-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathpage-dropdowns.html
501 lines (379 loc) · 13.6 KB
/
page-dropdowns.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
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
---
layout: default
title: Dropdowns
permalink: /dropdowns/
is_searchable: true
---
<section class="sui-row-with-sidenav">
<!-- Navigation -->
<div class="sui-sidenav" role="navigation" aria-label="Page Options">
<ul class="sui-vertical-tabs sui-sidenav-hide-md">
<li class="sui-vertical-tab current">
<a href="#" role="button" data-tab="samples">Samples</a>
</li>
<li class="sui-vertical-tab">
<a href="#" role="button" data-tab="alignment">Alignment</a>
</li>
<li class="sui-vertical-tab">
<a href="#" role="button" data-tab="documentation">Documentation</a>
</li>
</ul>
<div class="sui-sidenav-settings">
<div class="sui-form-field sui-sidenav-hide-lg">
<select class="sui-select">
<option value="samples">Samples</option>
<option value="alignment">Alignment</option>
<option value="documentation">Documentation</option>
</select>
</div>
</div>
</div>
<!-- DROPDOWNS: Samples-->
<div class="sui-box" data-tab="samples">
<div class="sui-box-header">
<h3 class="sui-box-title">Samples</h3>
</div>
<div class="sui-box-body">
<div class="sui-box-settings-row">
<div class="sui-box-settings-col-1">
<span class="sui-settings-label">Menu with Links</span>
</div>
<div class="sui-box-settings-col-2">
<h3 class="sui-label">Only text items</h3>
<div class="sui-border-frame">
<div class="sui-dropdown sui-dropdown-right">
<button aria-expanded="false"
class="sui-button-icon sui-dropdown-anchor"
aria-label="More Options">
<span class="sui-icon-widget-settings-config" aria-hidden="true"></span>
</button>
<ul>
<li><a href="https://premium.wpmudev.org/"
target="_blank">
Menu Item
</a></li>
<li><a href="https://premium.wpmudev.org/"
target="_blank">
Menu Item
</a></li>
<li><a href="https://premium.wpmudev.org/"
target="_blank">
Menu Item
</a></li>
</ul>
</div>
</div>
<h3 class="sui-label">Text with icon items</h3>
<div class="sui-border-frame">
<div class="sui-dropdown sui-dropdown-right">
<button aria-expanded="false"
class="sui-button-icon sui-dropdown-anchor"
aria-label="More Options">
<span class="sui-icon-widget-settings-config" aria-hidden="true"></span>
</button>
<ul>
<li><a href="https://premium.wpmudev.org/"
target="_blank">
<span class="sui-icon-wpmudev-logo" aria-hidden="true"></span> Menu Item
</a></li>
<li><a href="https://premium.wpmudev.org/"
target="_blank">
<span class="sui-icon-wpmudev-logo" aria-hidden="true"></span> Menu Item
</a></li>
<li><a href="https://premium.wpmudev.org/"
target="_blank">
<span class="sui-icon-wpmudev-logo" aria-hidden="true"></span> Menu Item
</a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="sui-box-settings-row">
<div class="sui-box-settings-col-1">
<span class="sui-settings-label">Menu with Buttons</span>
</div>
<div class="sui-box-settings-col-2">
<h3 class="sui-label">Only text items</h3>
<div class="sui-border-frame">
<div class="sui-dropdown sui-dropdown-right">
<button aria-expanded="false"
class="sui-button-icon sui-dropdown-anchor"
aria-label="More Options">
<span class="sui-icon-widget-settings-config" aria-hidden="true"></span>
</button>
<ul>
<li><button onclick="activateButton(event)">
Menu Item
</a></li>
<li><button onclick="activateButton(event)">
Menu Item
</button></li>
<li><button onclick="activateButton(event)">
Menu Item
</button></li>
</ul>
</div>
</div>
<h3 class="sui-label">Text with icon items</h3>
<div class="sui-border-frame">
<div class="sui-dropdown sui-dropdown-right">
<button aria-expanded="false"
class="sui-button-icon sui-dropdown-anchor"
aria-label="More Options">
<span class="sui-icon-widget-settings-config" aria-hidden="true"></span>
</button>
<ul>
<li><button onclick="activateButton(event)">
<span class="sui-icon-wpmudev-logo" aria-hidden="true"></span> Menu Item
</a></li>
<li><button onclick="activateButton(event)">
<span class="sui-icon-wpmudev-logo" aria-hidden="true"></span> Menu Item
</button></li>
<li><button onclick="activateButton(event)">
<span class="sui-icon-wpmudev-logo" aria-hidden="true"></span> Menu Item
</button></li>
</ul>
</div>
</div>
<script>
function activateButton(evt) {
var button = evt.target,
parent = button.parentNode.parentNode,
buttons = parent.children;
for ( var i = 0; i < buttons.length; i++ ) {
buttons[i].classList.remove( 'active' );
}
button.parentNode.classList.add( 'active' );
evt.preventDefault();
evt.stopPropagation();
}
</script>
</div>
</div>
</div>
</div>
<!-- DROPDOWNS: Alignment-->
<div class="sui-box" data-tab="alignment" style="display: none;">
<div class="sui-box-header">
<h3 class="sui-box-title">Alignment</h3>
</div>
<div class="sui-box-body">
<div class="sui-box-settings-row">
<div class="sui-box-settings-col-1">
<span class="sui-settings-label">Default</span>
<span class="sui-description">Menu by default is right-aligned with the button.</span>
</div>
<div class="sui-box-settings-col-2">
<div class="sui-dropdown">
<button aria-expanded="false"
class="sui-button-icon sui-dropdown-anchor"
aria-label="More Options">
<span class="sui-icon-widget-settings-config" aria-hidden="true"></span>
</button>
<ul>
<li><a href="https://premium.wpmudev.org/"
target="_blank">
External link
</a></li>
<li><button type="button"
data-a11y-dialog-show="my-accessible-dialog">
CTA button
</button></li>
</ul>
</div>
<div class="sui-dropdown">
<button aria-expanded="false"
class="sui-button-icon sui-dropdown-anchor"
aria-label="More Options">
<span class="sui-icon-widget-settings-config" aria-hidden="true"></span>
</button>
<ul>
<li><a href="https://premium.wpmudev.org/hub/support/"
target="_blank">
<span class="sui-icon-wpmudev-logo" aria-hidden="true"></span> Link with icon
</a></li>
<li><button type="button"
data-a11y-dialog-show="my-accessible-dialog">
<span class="sui-icon-popup" aria-hidden="true"></span> Button with icon
</button></li>
</ul>
</div>
</div>
</div>
<div class="sui-box-settings-row">
<div class="sui-box-settings-col-1">
<span class="sui-settings-label">Left</span>
<span class="sui-description">Menu will be left-aligned with the button.</span>
</div>
<div class="sui-box-settings-col-2">
<div class="sui-dropdown sui-dropdown-right">
<button aria-expanded="false"
class="sui-button-icon sui-dropdown-anchor"
aria-label="More Options">
<span class="sui-icon-widget-settings-config" aria-hidden="true"></span>
</button>
<ul>
<li><a href="https://premium.wpmudev.org/"
target="_blank">
External link
</a></li>
<li><button type="button"
data-a11y-dialog-show="my-accessible-dialog">
CTA button
</button></li>
</ul>
</div>
<div class="sui-dropdown sui-dropdown-right">
<button aria-expanded="false"
class="sui-button-icon sui-dropdown-anchor"
aria-label="More Options">
<span class="sui-icon-widget-settings-config" aria-hidden="true"></span>
</button>
<ul>
<li><a href="https://premium.wpmudev.org/hub/support/"
target="_blank">
<span class="sui-icon-wpmudev-logo" aria-hidden="true"></span> Link with icon
</a></li>
<li><button type="button"
data-a11y-dialog-show="my-accessible-dialog">
<span class="sui-icon-popup" aria-hidden="true"></span> Button with icon
</button></li>
</ul>
</div>
</div>
</div>
<div class="sui-box-settings-row">
<div class="sui-box-settings-col-1">
<span class="sui-settings-label">Center</span>
<span class="sui-description">Menu will be center-aligned with the button.</span>
</div>
<div class="sui-box-settings-col-2">
<div class="sui-dropdown sui-dropdown-center">
<button aria-expanded="false"
class="sui-button-icon sui-dropdown-anchor"
aria-label="More Options">
<span class="sui-icon-widget-settings-config" aria-hidden="true"></span>
</button>
<ul>
<li><a href="https://premium.wpmudev.org/"
target="_blank">
External link
</a></li>
<li><button type="button"
data-a11y-dialog-show="my-accessible-dialog">
CTA button
</button></li>
</ul>
</div>
<div class="sui-dropdown sui-dropdown-center">
<button aria-expanded="false"
class="sui-button-icon sui-dropdown-anchor"
aria-label="More Options">
<span class="sui-icon-widget-settings-config" aria-hidden="true"></span>
</button>
<ul>
<li><a href="https://premium.wpmudev.org/hub/support/"
target="_blank">
<span class="sui-icon-wpmudev-logo" aria-hidden="true"></span> Link with icon
</a></li>
<li><button type="button"
data-a11y-dialog-show="my-accessible-dialog">
<span class="sui-icon-popup" aria-hidden="true"></span> Button with icon
</button></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<!-- DROPDOWNS: Documentation -->
<div class="sui-box" data-tab="documentation" style="display: none;">
<div class="sui-box-header">
<h3 class="sui-box-title">Documentation</h3>
</div>
<div class="sui-box-body">
<!-- Warning -->
<div class="sui-notice sui-notice-yellow sui-active" style="display: block;">
<div class="sui-notice-content">
<div class="sui-notice-message">
<span class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></span>
<p>If you are using <code>SUI 2.3.2</code> or older version, you need to update the dropdown button markup when you upgrade to <code>SUI 2.3.3</code>.</p>
</div>
</div>
</div>
<!-- Warning -->
<div class="sui-notice sui-notice-yellow sui-active" style="display: block;">
<div class="sui-notice-content">
<div class="sui-notice-message">
<span class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></span>
<p>If you are using individual js components, <code>dropdowns.js</code> is required.</p>
</div>
</div>
</div>
<!-- ROW: Specifications -->
<div
id="showcase-specs"
utilities-page="{{ site.baseurl }}/utilities/"
monochrome="true"
rtl-lang="true"
></div>
<div class="sui-box-settings-row">
<div class="sui-box-settings-col-1">
<span class="sui-settings-label">Element Markup</span>
<span class="sui-description">This is the correct markup to use for dropdown elements.</span>
</div>
<div class="sui-box-settings-col-2">
<div class="demo-code-block">
<pre class="sui-code-snippet html">
<div class="sui-dropdown">
<button class="sui-button-icon sui-dropdown-anchor" aria-label="Dropdown">
<span class="sui-icon-widget-settings-config" aria-hidden="true"></span>
</button>
<ul>
<li><button>CTA Button</button></li>
<li><a href="http://external-link.com/" target="_blank">External link</a></li>
<li><button><span class="sui-icon-trash" aria-hidden="true"></span> Button with icon</button></li>
</ul>
</div>
</pre>
</div>
</div>
</div>
<div class="sui-box-settings-row">
<div class="sui-box-settings-col-1">
<span class="sui-settings-label">Menu Variations</span>
<span class="sui-description">There are some projects where the menu should display in different places.</span>
</div>
<div class="sui-box-settings-col-2">
<div class="sui-box-settings-row">
<div class="sui-box-settings-col-2">
<label class="sui-settings-label">Left menu</label>
<span class="sui-description">In case you need the menu aligns to the left, you can make use of <code>sui-dropdown-right</code> class. For example:</span>
<div class="demo-code-block" style="margin-top: 20px;">
<pre class="sui-code-snippet html">
<div class="sui-dropdown sui-dropdown-right">
<!-- The rest of the element goes here -->
</div>
</pre>
</div>
</div>
</div>
<div class="sui-box-settings-row">
<div class="sui-box-settings-col-2">
<label class="sui-settings-label">Center menu</label>
<span class="sui-description">In case you need the menu aligns to the middle, you can make use of <code>sui-dropdown-center</code> class. For example:</span>
<div class="demo-code-block" style="margin-top: 20px;">
<pre class="sui-code-snippet html">
<div class="sui-dropdown sui-dropdown-center">
<!-- The rest of the element goes here -->
</div>
</pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>