-
Notifications
You must be signed in to change notification settings - Fork 1
/
split-button.html
322 lines (281 loc) · 15.7 KB
/
split-button.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>split-button</title>
<script type="module" src="https://js.arcgis.com/calcite-components/1.0.0-beta.91/calcite.esm.js"></script>
<link rel="stylesheet" type="text/css" href="https://js.arcgis.com/calcite-components/1.0.0-beta.91/calcite.css" />
<style>
h1,
calcite-split-button {
margin-bottom: 5rem;
}
h2 {
margin-bottom: 3rem;
}
body {
font-family: var(--calcite-sans-family);
font-size: var(--calcite-font-size-0);
color: var(--calcite-ui-text-1);
max-width: 1024px;
min-width: 280px;
width: 70vw;
padding: 0 var(--calcite-spacing-double);
margin: 0 auto;
background-color: var(--calcite-ui-background);
}
/* Theme Switcher */
#theme-label {
position: fixed;
top: 20px;
right: 20px;
z-index: 2;
background-color: var(--calcite-ui-background);
border: 1px solid;
border-color: var(--calcite-ui-border-1);
border-radius: var(--calcite-border-radius);
margin: 0;
padding: 10px;
}
#theme-label label {
margin: 0;
}
</style>
</head>
<body>
<main>
<!-- calcite-switch -->
<div id="theme-label">
<calcite-label layout="inline">
Toggle theme
<calcite-switch id="theme-switch"></calcite-switch>
</calcite-label>
</div>
<h1><code>split-button</code></h1>
<p>Testing the context provided with this component only.<p>
<ol>
<li>Can the split button component be accessed?</li>
<li>Is there sufficient context provided to the component?</li>
</ol>
<h2>Test 1. Split Button Color Contrast</h2>
<ol>
<li>Test color contrast with the Solid, Clear, Outline and Transparent Split buttons.</li>
<li>Ensure testing includes toggling the theme (light and dark).</li>
</ol>
<br>
<h3>Solid</h3>
<calcite-split-button primary-text="Solid Blue" appearance="solid" primary-label="Solid Blue" dropdown-label="Solid Blue Actions">
<calcite-dropdown-group selection-mode="none">
<calcite-dropdown-item>Action 1</calcite-dropdown-item>
<calcite-dropdown-item>Action 2</calcite-dropdown-item>
<calcite-dropdown-item>Action 3</calcite-dropdown-item>
</calcite-dropdown-group>
</calcite-split-button>
<calcite-split-button primary-text="Solid Inverse" appearance="solid" color="inverse" primary-label="Solid Inverse" dropdown-label="Solid Inverse Actions">
<calcite-dropdown-group selection-mode="none">
<calcite-dropdown-item>Action 1</calcite-dropdown-item>
<calcite-dropdown-item>Action 2</calcite-dropdown-item>
<calcite-dropdown-item>Action 3</calcite-dropdown-item>
</calcite-dropdown-group>
</calcite-split-button>
<calcite-split-button primary-text="Solid Neutral" appearance="solid" color="neutral" primary-label="Solid Neutral" dropdown-label="Solid Neutral Actions">
<calcite-dropdown-group selection-mode="none">
<calcite-dropdown-item>Action 1</calcite-dropdown-item>
<calcite-dropdown-item>Action 2</calcite-dropdown-item>
<calcite-dropdown-item>Action 3</calcite-dropdown-item>
</calcite-dropdown-group>
</calcite-split-button>
<calcite-split-button primary-text="Solid Red" appearance="solid" color="red" primary-label="Solid Red" dropdown-label="Solid Red Actions">
<calcite-dropdown-group selection-mode="none">
<calcite-dropdown-item>Action 1</calcite-dropdown-item>
<calcite-dropdown-item>Action 2</calcite-dropdown-item>
<calcite-dropdown-item>Action 3</calcite-dropdown-item>
</calcite-dropdown-group>
</calcite-split-button>
<h3>Clear</h3>
<calcite-split-button primary-text="Clear Blue" appearance="clear" primary-label="Clear Blue" dropdown-label="Clear Blue Actions">
<calcite-dropdown-group selection-mode="none">
<calcite-dropdown-item>Action 1</calcite-dropdown-item>
<calcite-dropdown-item>Action 2</calcite-dropdown-item>
<calcite-dropdown-item>Action 3</calcite-dropdown-item>
</calcite-dropdown-group>
</calcite-split-button>
<calcite-split-button primary-text="Clear Inverse" appearance="clear" color="inverse" primary-label="Clear Inverse" dropdown-label="Clear Inverse Actions">
<calcite-dropdown-group selection-mode="none">
<calcite-dropdown-item>Action 1</calcite-dropdown-item>
<calcite-dropdown-item>Action 2</calcite-dropdown-item>
<calcite-dropdown-item>Action 3</calcite-dropdown-item>
</calcite-dropdown-group>
</calcite-split-button>
<calcite-split-button primary-text="Clear Neutral" appearance="clear" color="neutral" primary-label="Clear Neutral" dropdown-label="Clear Neutral Actions">
<calcite-dropdown-group selection-mode="none">
<calcite-dropdown-item>Action 1</calcite-dropdown-item>
<calcite-dropdown-item>Action 2</calcite-dropdown-item>
<calcite-dropdown-item>Action 3</calcite-dropdown-item>
</calcite-dropdown-group>
</calcite-split-button>
<calcite-split-button primary-text="Clear Red" appearance="clear" color="red" primary-label="Clear Red" dropdown-label="Clear Red Actions">
<calcite-dropdown-group selection-mode="none">
<calcite-dropdown-item>Action 1</calcite-dropdown-item>
<calcite-dropdown-item>Action 2</calcite-dropdown-item>
<calcite-dropdown-item>Action 3</calcite-dropdown-item>
</calcite-dropdown-group>
</calcite-split-button>
<h3>Outline</h3>
<calcite-split-button primary-text="Outline Blue" appearance="outline" primary-label="Outline Blue" dropdown-label="Outline Blue Actions">
<calcite-dropdown-group selection-mode="none">
<calcite-dropdown-item>Action 1</calcite-dropdown-item>
<calcite-dropdown-item>Action 2</calcite-dropdown-item>
<calcite-dropdown-item>Action 3</calcite-dropdown-item>
</calcite-dropdown-group>
</calcite-split-button>
<calcite-split-button primary-text="Outline Inverse" appearance="outline" color="inverse" primary-label="Outline Inverse" dropdown-label="Outline Inverse Actions">
<calcite-dropdown-group selection-mode="none">
<calcite-dropdown-item>Action 1</calcite-dropdown-item>
<calcite-dropdown-item>Action 2</calcite-dropdown-item>
<calcite-dropdown-item>Action 3</calcite-dropdown-item>
</calcite-dropdown-group>
</calcite-split-button>
<calcite-split-button primary-text="Outline Neutral" appearance="outline" color="neutral" primary-label="Outline Neutral" dropdown-label="Outline Neutral Actions">
<calcite-dropdown-group selection-mode="none">
<calcite-dropdown-item>Action 1</calcite-dropdown-item>
<calcite-dropdown-item>Action 2</calcite-dropdown-item>
<calcite-dropdown-item>Action 3</calcite-dropdown-item>
</calcite-dropdown-group>
</calcite-split-button>
<calcite-split-button primary-text="Outline Red" appearance="outline" color="red" primary-label="Outline Red" dropdown-label="Outline Red Actions">
<calcite-dropdown-group selection-mode="none">
<calcite-dropdown-item>Action 1</calcite-dropdown-item>
<calcite-dropdown-item>Action 2</calcite-dropdown-item>
<calcite-dropdown-item>Action 3</calcite-dropdown-item>
</calcite-dropdown-group>
</calcite-split-button>
<h3>Transparent</h3>
<calcite-split-button primary-text="Transparent Blue" appearance="transparent" primary-label="Transparent Blue" dropdown-label="Transparent Blue Actions">
<calcite-dropdown-group selection-mode="none">
<calcite-dropdown-item>Action 1</calcite-dropdown-item>
<calcite-dropdown-item>Action 2</calcite-dropdown-item>
<calcite-dropdown-item>Action 3</calcite-dropdown-item>
</calcite-dropdown-group>
</calcite-split-button>
<calcite-split-button primary-text="Transparent Inverse" appearance="transparent" color="inverse" primary-label="Transparent Inverse" dropdown-label="Transparent Inverse Actions">
<calcite-dropdown-group selection-mode="none">
<calcite-dropdown-item>Action 1</calcite-dropdown-item>
<calcite-dropdown-item>Action 2</calcite-dropdown-item>
<calcite-dropdown-item>Action 3</calcite-dropdown-item>
</calcite-dropdown-group>
</calcite-split-button>
<calcite-split-button primary-text="Transparent Neutral" appearance="transparent" color="neutral" primary-label="Transparent Neutral" dropdown-label="Transparent Neutral Actions">
<calcite-dropdown-group selection-mode="none">
<calcite-dropdown-item>Action 1</calcite-dropdown-item>
<calcite-dropdown-item>Action 2</calcite-dropdown-item>
<calcite-dropdown-item>Action 3</calcite-dropdown-item>
</calcite-dropdown-group>
</calcite-split-button>
<calcite-split-button primary-text="Transparent Red" appearance="transparent" color="red" primary-label="Transparent Red" dropdown-label="Transparent Red Actions">
<calcite-dropdown-group selection-mode="none">
<calcite-dropdown-item>Action 1</calcite-dropdown-item>
<calcite-dropdown-item>Action 2</calcite-dropdown-item>
<calcite-dropdown-item>Action 3</calcite-dropdown-item>
</calcite-dropdown-group>
</calcite-split-button>
<h2>Test 2. Split Button Scales</h2>
<calcite-split-button primary-text="Split button small scale" scale="s" primary-label="Small Scale" dropdown-label="Small Scale Actions">
<calcite-dropdown-group selection-mode="none">
<calcite-dropdown-item>Action 1</calcite-dropdown-item>
<calcite-dropdown-item>Action 2</calcite-dropdown-item>
<calcite-dropdown-item>Action 3</calcite-dropdown-item>
</calcite-dropdown-group>
</calcite-split-button>
<calcite-split-button primary-text="Split button medium scale" scale="m" primary-label="Medium Scale" dropdown-label="Medium Scale Actions">
<calcite-dropdown-group selection-mode="none">
<calcite-dropdown-item>Action 1</calcite-dropdown-item>
<calcite-dropdown-item>Action 2</calcite-dropdown-item>
<calcite-dropdown-item>Action 3</calcite-dropdown-item>
</calcite-dropdown-group>
</calcite-split-button>
<calcite-split-button primary-text="Split button large scale" scale="l" primary-label="Large Scale" dropdown-label="Large Scale Actions">
<calcite-dropdown-group selection-mode="none">
<calcite-dropdown-item>Action 1</calcite-dropdown-item>
<calcite-dropdown-item>Action 2</calcite-dropdown-item>
<calcite-dropdown-item>Action 3</calcite-dropdown-item>
</calcite-dropdown-group>
</calcite-split-button>
<h2>Test 3. Disabled Split Button</h2>
<calcite-split-button primary-text="Disabled split button" disabled primary-label="Disabled split button" dropdown-label="Disabled split button Actions">
<calcite-dropdown-group selection-mode="none">
<calcite-dropdown-item>Action 1</calcite-dropdown-item>
<calcite-dropdown-item>Action 2</calcite-dropdown-item>
<calcite-dropdown-item>Action 3</calcite-dropdown-item>
</calcite-dropdown-group>
</calcite-split-button>
<h2>Test 4. Loading Split Button</h2>
<calcite-split-button primary-text="Loading split button" loading primary-label="Loading split button" dropdown-label="Loading split button Actions">
<calcite-dropdown-group selection-mode="none">
<calcite-dropdown-item>Action 1</calcite-dropdown-item>
<calcite-dropdown-item>Action 2</calcite-dropdown-item>
<calcite-dropdown-item>Action 3</calcite-dropdown-item>
</calcite-dropdown-group>
</calcite-split-button>
<h2>Test 5. Split Button with Icons</h2>
<calcite-split-button primary-text="Split button with icons" primary-icon-end="3d-glasses" primary-icon-start="3d-glasses" primary-label="Split button with icons" dropdown-label="Split button with icons Actions">
<calcite-dropdown-group selection-mode="none">
<calcite-dropdown-item>Action 1</calcite-dropdown-item>
<calcite-dropdown-item>Action 2</calcite-dropdown-item>
<calcite-dropdown-item>Action 3</calcite-dropdown-item>
</calcite-dropdown-group>
</calcite-split-button>
<h2>Test 6. Split Button with Icon Only</h2>
<calcite-split-button primary-icon-start="save" primary-label="Split button with icon only" dropdown-label="Split button with icon only Actions">
<calcite-dropdown-group selection-mode="none">
<calcite-dropdown-item>Option 2</calcite-dropdown-item>
<calcite-dropdown-item>Option 3</calcite-dropdown-item>
<calcite-dropdown-item>Option 4</calcite-dropdown-item>
</calcite-dropdown-group>
</calcite-split-button>
<h2>Test 7. Split Button Dropdown Icon Type</h2>
<h3>Chevron dropdown icon</h3>
<calcite-split-button primary-text="Chevron dropdown icon" primary-label="Chevron dropdown icon" dropdown-label="Chevron dropdown icon Actions">
<calcite-dropdown-group selection-mode="none">
<calcite-dropdown-item>Action 1</calcite-dropdown-item>
<calcite-dropdown-item>Action 2</calcite-dropdown-item>
<calcite-dropdown-item>Action 3</calcite-dropdown-item>
</calcite-dropdown-group>
</calcite-split-button>
<h3>Caret dropdown icon</h3>
<calcite-split-button primary-text="Caret dropdown icon" dropdown-icon-type="caret" primary-label="Caret dropdown icon" dropdown-label="Caret dropdown icon Actions">
<calcite-dropdown-group selection-mode="none">
<calcite-dropdown-item>Action 1</calcite-dropdown-item>
<calcite-dropdown-item>Action 2</calcite-dropdown-item>
<calcite-dropdown-item>Action 3</calcite-dropdown-item>
</calcite-dropdown-group>
</calcite-split-button>
<h3>Ellipsis dropdown icon</h3>
<calcite-split-button primary-text="Ellipsis dropdown icon" dropdown-icon-type="ellipsis" primary-label="Ellipsis dropdown icon" dropdown-label="Ellipsis dropdown icon Actions">
<calcite-dropdown-group selection-mode="none">
<calcite-dropdown-item>Action 1</calcite-dropdown-item>
<calcite-dropdown-item>Action 2</calcite-dropdown-item>
<calcite-dropdown-item>Action 3</calcite-dropdown-item>
</calcite-dropdown-group>
</calcite-split-button>
<h3>Overflow dropdown icon</h3>
<calcite-split-button primary-text="Overflow dropdown icon" dropdown-icon-type="overflow" primary-label="Overflow dropdown icon" dropdown-label="Overflow dropdown icon Actions">
<calcite-dropdown-group selection-mode="none">
<calcite-dropdown-item>Action 1</calcite-dropdown-item>
<calcite-dropdown-item>Action 2</calcite-dropdown-item>
<calcite-dropdown-item>Action 3</calcite-dropdown-item>
</calcite-dropdown-group>
</calcite-split-button>
</main>
</body>
<script>
window.onload = () => {
// Theme Switcher
const themeSwitch = document.getElementById("theme-switch");
themeSwitch.addEventListener("calciteSwitchChange", () => {
document.body.classList.toggle("calcite-theme-dark");
});
};
</script>
</html>