@czi-sds/mcp 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/tailwind.json +25 -25
- package/data/zeroheight-cache.json +5065 -1
- package/data/zeroheight-exports/Accordion.md +81 -20
- package/data/zeroheight-exports/Banner.md +104 -10
- package/data/zeroheight-exports/Buttons.md +1029 -1454
- package/data/zeroheight-exports/Callout.md +174 -9
- package/data/zeroheight-exports/Colors.md +1164 -41
- package/data/zeroheight-exports/Content-Card.md +148 -0
- package/data/zeroheight-exports/Control-Inputs.md +778 -63
- package/data/zeroheight-exports/Corners.md +8 -15
- package/data/zeroheight-exports/Dialog.md +200 -12
- package/data/zeroheight-exports/Downloads.md +120 -0
- package/data/zeroheight-exports/Dropdown-Input.md +616 -12
- package/data/zeroheight-exports/Dropdown-Menus.md +1150 -0
- package/data/zeroheight-exports/Field-Inputs.md +450 -9
- package/data/zeroheight-exports/Filters.md +238 -9
- package/data/zeroheight-exports/Getting-Started.md +7 -3
- package/data/zeroheight-exports/Hero.md +152 -0
- package/data/zeroheight-exports/Icons.md +1854 -218
- package/data/zeroheight-exports/Intent.md +40 -0
- package/data/zeroheight-exports/Link.md +52 -6
- package/data/zeroheight-exports/Lists.md +364 -6
- package/data/zeroheight-exports/Loading-Indicator.md +8 -0
- package/data/zeroheight-exports/Navigation.md +328 -6
- package/data/zeroheight-exports/Notification.md +172 -12
- package/data/zeroheight-exports/Panel.md +72 -12
- package/data/zeroheight-exports/README.md +17 -19
- package/data/zeroheight-exports/Responsive-Design.md +52 -0
- package/data/zeroheight-exports/Search-Input.md +44 -0
- package/data/zeroheight-exports/Search.md +248 -0
- package/data/zeroheight-exports/Segmented-Control.md +34 -9
- package/data/zeroheight-exports/Table.md +468 -47
- package/data/zeroheight-exports/Tabs.md +542 -9
- package/data/zeroheight-exports/Tags.md +504 -12
- package/data/zeroheight-exports/Text-Link.md +100 -0
- package/data/zeroheight-exports/Theming.md +36 -6
- package/data/zeroheight-exports/Tooltips.md +466 -15
- package/data/zeroheight-exports/Typography.md +64 -32
- package/package.json +3 -3
- package/data/zeroheight-exports/Dropdown-Menu.md +0 -3883
|
@@ -0,0 +1,1150 @@
|
|
|
1
|
+
# Dropdown Menus
|
|
2
|
+
|
|
3
|
+
Dropdown Menus are coupled with Dropdown Inputs and in some cases Icon Buttons whenever those elements present the user with options to choose from or selections to make.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
>**Warning:** The Dropdown Menu and its affiliated components have undergone a major overhaul in their construction and how they have been coded, rendering the documentation below out of date.
|
|
8
|
+
>
|
|
9
|
+
>While the SDS works on updating the documentation to reflect these changes, see `src/core/Dropdown/index.stories.tsx` within the `sci-components` codebase for example usage of the new Dropdown Menu structure.
|
|
10
|
+
|
|
11
|
+
## Dropdown Menu Variants
|
|
12
|
+
|
|
13
|
+
| In their basic form, Dropdown Menus are composed of a Menu Container that is filled with Menu Items offering the user options to adjust or select that are contextually relevant to the Dropdown Input they are coupled with. Menu Items can be optionally paired with additional details or with counters that indicate the number of items within that Menu Item's category. Additionally, Dropdown Menus can be configured to include a Search Input, have their Menu Items separated out into different sections or groupings, or a combination of these features. | | **Jump to section:** Dropdown Menu Common Configurations Menu Item |
|
|
14
|
+
| --- | --- | --- |
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Dropdown Menu
|
|
19
|
+
|
|
20
|
+
| | In Figma | | | Meets Accessibility | | | In napari hub + .org Codebases |
|
|
21
|
+
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
22
|
+
|
|
23
|
+
Dropdown Menus can be configured to have their Menu Items all in one large list or separated out into different sections or groupings; these Menu Item formats are established by the `[array]` passed into the `options` prop. Additionally, Dropdown Menus can be configured to include a Search Input. See the Data Format section below for details about configuring the `[array]`.
|
|
24
|
+
|
|
25
|
+
Dropdown Menus are used in combination with Dropdown Inputs on napari hub as part of plugin Filters, accessible on the left side of the plugin page.
|
|
26
|
+
|
|
27
|
+
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
**Default**
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
**Default + Search**
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
**Default + Sections**
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
### Data Format
|
|
56
|
+
|
|
57
|
+
Use the following configuration for the `[array]` passed into the `options` prop:
|
|
58
|
+
|
|
59
|
+
```js
|
|
60
|
+
data = [
|
|
61
|
+
{
|
|
62
|
+
// section with a Header and Menu Item Details
|
|
63
|
+
dataRows: [
|
|
64
|
+
{
|
|
65
|
+
name: "Menu Item",
|
|
66
|
+
details: "Details",
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: "Menu Item",
|
|
70
|
+
details: "Details",
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: "Menu Item",
|
|
74
|
+
details: "Details",
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
label: "Section One",
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
// section with Menu Item Counts
|
|
81
|
+
dataRows: [
|
|
82
|
+
{
|
|
83
|
+
name: "Menu Item",
|
|
84
|
+
count: 20,
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: "Menu Item",
|
|
88
|
+
count: 40,
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: "Menu Item",
|
|
92
|
+
count: 60,
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
// section with disabled Menu Items
|
|
98
|
+
dataRows: [
|
|
99
|
+
{
|
|
100
|
+
name: "Menu Item",
|
|
101
|
+
disabled: true,
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
name: "Menu Item",
|
|
105
|
+
disabled: true,
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: "Menu Item",
|
|
109
|
+
disabled: true,
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
},
|
|
113
|
+
];
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
### Dropdown Menu Spacing
|
|
119
|
+
|
|
120
|
+
These rules establish how much margin should exist between and around elements.
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
**Dropdown Menu spacing**
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Common Configurations
|
|
131
|
+
|
|
132
|
+
Dropdown Menus can be thought of as being comprised of different combinations of building blocks all within a Menu Container, ensuring a wide range of flexibility for whatever need a designer has with their designs.
|
|
133
|
+
|
|
134
|
+
Below are a number of common Dropdown Menu configurations, but by no means is this an exhaustive list:
|
|
135
|
+
|
|
136
|
+
| **Search + Count** | **Search + Sections** | **Search + Details** |
|
|
137
|
+
| --- | --- | --- |
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
**Search + Count**
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
**Search + Sections**
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
**Search + Details**
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
| **Sections + Details** | **Search + Sections + Details** | **Search + Sections + Count** |
|
|
158
|
+
| --- | --- | --- |
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
**Sections + Details**
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
**Search + Sections + Details**
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
**Search + Sections + Count**
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Menu Item
|
|
181
|
+
|
|
182
|
+
| | In Figma | | | Meets Accessibility | | | In napari hub + .org Codebases |
|
|
183
|
+
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
184
|
+
|
|
185
|
+
Menu Items can be optionally paired with additional clarifying details, with counters that indicate the number of items within that Menu Item's category, or be disabled entirely. These details are established within the `[array]` passed into the `options` prop on the Dropdown Menu component.
|
|
186
|
+
|
|
187
|
+
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
188
|
+
|
|
189
|
+
| **Default** | **Hover** | **Selected** | **Selected + Hover** | **Disabled** | **Selected + Disabled** |
|
|
190
|
+
| --- | --- | --- | --- | --- | --- |
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
**MenuItem**
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
**MenuItem**
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
**MenuItem**
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
**MenuItem**
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
**MenuItem**
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
**MenuItem**
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
| **Default + Count** | **Hover** | **Selected** | **Selected + Hover** | **Disabled** | **Selected + Disabled** |
|
|
229
|
+
| --- | --- | --- | --- | --- | --- |
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
**MenuItem**
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
**MenuItem**
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
**MenuItem**
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
**MenuItem**
|
|
252
|
+
|
|
253
|
+
---
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
**MenuItem**
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
**MenuItem**
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
| **Default + Details** | **Hover** | **Selected** | **Selected + Hover** | **Disabled** | **Selected + Disabled** |
|
|
268
|
+
| --- | --- | --- | --- | --- | --- |
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
**MenuItem**
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
**MenuItem**
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
**MenuItem**
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
**MenuItem**
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
**MenuItem**
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
**MenuItem**
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
## Code
|
|
307
|
+
|
|
308
|
+
## Dropdown Menu Component
|
|
309
|
+
|
|
310
|
+
| Below you will find interactive Storybook iframes for the Dropdown Menu. Tabs within each iframe provide a different set of tools: The Controls tab allows you to see and adjust all available props. The Actions tab shows you data displayed by event handler arguments. | | **Jump to component:** DropdownMenu |
|
|
311
|
+
| --- | --- | --- |
|
|
312
|
+
|
|
313
|
+
---
|
|
314
|
+
|
|
315
|
+
>**Warning:** The Dropdown Menu and its affiliated components have undergone a major overhaul in their construction and how they have been coded, rendering the documentation below out of date.
|
|
316
|
+
>
|
|
317
|
+
>While the SDS works on updating the documentation to reflect these changes, see `src/core/Dropdown/index.stories.tsx` within the `sci-components` codebase for example usage of the new Dropdown Menu structure.
|
|
318
|
+
|
|
319
|
+
>This component appears as it is in the default SDS codebase. Once imported into the napari hub or napari.org codebases, use a theme file to enable the napari visual appearance customization.
|
|
320
|
+
|
|
321
|
+
### DropdownMenu
|
|
322
|
+
|
|
323
|
+
Storybook
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
---
|
|
328
|
+
|
|
329
|
+
Dropdown Menus are coupled with Dropdown Inputs, Dropdown Buttons, and in some cases Icon Buttons whenever those elements present the user with options to choose from or selections to make.
|
|
330
|
+
|
|
331
|
+
## Overview
|
|
332
|
+
|
|
333
|
+
>**NOTE:** The Dropdown Menu and its affiliated components have undergone a major overhaul in their construction and how they have been coded, rendering the documentation below out of date.
|
|
334
|
+
>
|
|
335
|
+
>While the SDS works on updating the documentation to reflect these changes, see `src/core/Dropdown/index.stories.tsx` within the `sci-components` codebase for example usage of the new Dropdown Menu structure.
|
|
336
|
+
|
|
337
|
+
## Dropdown Menu Variants
|
|
338
|
+
|
|
339
|
+
| In their basic form, Dropdown Menus are composed of a Menu Container that is filled with Menu Items offering the user options to adjust or select that are contextually relevant to the Button or Dropdown Input they are coupled with. Menu Items can be optionally paired with additional details or with counters that indicate the number of items within that Menu Item's category. Dropdown Menus can also be multi-select, allowing the user to choose multiple options from the group of Menu Items. Additionally, Dropdown Menus can be configured to include a Search Input, have their Menu Items separated out into different sections or groupings, have a built-in title, or any combination of these features. | | **Jump to section:** Dropdown Menu Common Configurations Menu Item |
|
|
340
|
+
| --- | --- | --- |
|
|
341
|
+
|
|
342
|
+
---
|
|
343
|
+
|
|
344
|
+
## Dropdown Menu
|
|
345
|
+
|
|
346
|
+
| | In Figma | | | Meets Accessibility | | | In CZ GEN EPI Codebase |
|
|
347
|
+
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
348
|
+
|
|
349
|
+
### Single-select Dropdown Menu
|
|
350
|
+
|
|
351
|
+
Use the Single-select Dropdown Menu when users are only able to select one item from the menu. They can be configured to have their Menu Items separated out into different sections or groupings, or have a built-in title; both of these features are established by the `[array]` passed into the `options` prop. Additionally, they can be configured to include a Search Input. See the Data Format section below for details around configuring the `[array]`.
|
|
352
|
+
|
|
353
|
+
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
**Default**
|
|
360
|
+
|
|
361
|
+
---
|
|
362
|
+
|
|
363
|
+
---
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
**Default + Title**
|
|
368
|
+
|
|
369
|
+
---
|
|
370
|
+
|
|
371
|
+
---
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
**Default + Search**
|
|
376
|
+
|
|
377
|
+
---
|
|
378
|
+
|
|
379
|
+
---
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
**Default + Sections**
|
|
384
|
+
|
|
385
|
+
---
|
|
386
|
+
|
|
387
|
+
### Multi-select Dropdown Menu
|
|
388
|
+
|
|
389
|
+
Use the Multi-select Dropdown Menu when users are able to select one or more items from the menu. They can be configured to have their Menu Items separated out into different sections or groupings, or have a built-in title; both of these features are established by the `[array]` passed into the `options` prop. Additionally, they can be configured to include a Search Input. See the Data Format section below for details around configuring the `[array]`.
|
|
390
|
+
|
|
391
|
+
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
**Default**
|
|
398
|
+
|
|
399
|
+
---
|
|
400
|
+
|
|
401
|
+
---
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
**Default + Title**
|
|
406
|
+
|
|
407
|
+
---
|
|
408
|
+
|
|
409
|
+
---
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
**Default + Search**
|
|
414
|
+
|
|
415
|
+
---
|
|
416
|
+
|
|
417
|
+
---
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
**Default + Sections**
|
|
422
|
+
|
|
423
|
+
---
|
|
424
|
+
|
|
425
|
+
### Data Format
|
|
426
|
+
|
|
427
|
+
Use the following configuration for the `[array]` passed into the `options` prop:
|
|
428
|
+
|
|
429
|
+
```js
|
|
430
|
+
data = [
|
|
431
|
+
{
|
|
432
|
+
// section with a Header and Menu Item Details
|
|
433
|
+
dataRows: [
|
|
434
|
+
{
|
|
435
|
+
name: "Menu Item",
|
|
436
|
+
details: "Details",
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
name: "Menu Item",
|
|
440
|
+
details: "Details",
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
name: "Menu Item",
|
|
444
|
+
details: "Details",
|
|
445
|
+
},
|
|
446
|
+
],
|
|
447
|
+
label: "Section One",
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
// section with Menu Item Counts
|
|
451
|
+
dataRows: [
|
|
452
|
+
{
|
|
453
|
+
name: "Menu Item",
|
|
454
|
+
count: 20,
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
name: "Menu Item",
|
|
458
|
+
count: 40,
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
name: "Menu Item",
|
|
462
|
+
count: 60,
|
|
463
|
+
},
|
|
464
|
+
],
|
|
465
|
+
},
|
|
466
|
+
];
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
---
|
|
470
|
+
|
|
471
|
+
### Dropdown Menu Spacing
|
|
472
|
+
|
|
473
|
+
These rules establish how much margin should exist between and around elements.
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
**Dropdown Menu Spacing**
|
|
478
|
+
|
|
479
|
+
---
|
|
480
|
+
|
|
481
|
+
---
|
|
482
|
+
|
|
483
|
+
## Common Configurations
|
|
484
|
+
|
|
485
|
+
Dropdown Menus can be thought of as being comprised of different combinations of building blocks all within a Menu Container, ensuring a wide range of flexibility for whatever need a designer has with their designs.
|
|
486
|
+
|
|
487
|
+
Below are a number of common Dropdown Menu configurations, but by no means is this an exhaustive list:
|
|
488
|
+
|
|
489
|
+
| **Title + Count** | **Search + Sections + Details** | **Title + Details** |
|
|
490
|
+
| --- | --- | --- |
|
|
491
|
+
|
|
492
|
+
|
|
493
|
+
|
|
494
|
+
**Title + Count**
|
|
495
|
+
|
|
496
|
+
---
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+
|
|
500
|
+
**Search + Sections + Details**
|
|
501
|
+
|
|
502
|
+
---
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
**Title + Details**
|
|
507
|
+
|
|
508
|
+
---
|
|
509
|
+
|
|
510
|
+
| **Search + Details** | **Title + Search + Count** | **Title + Sections + Details** |
|
|
511
|
+
| --- | --- | --- |
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
**Search + Details**
|
|
516
|
+
|
|
517
|
+
---
|
|
518
|
+
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
**Search + Title + Count**
|
|
522
|
+
|
|
523
|
+
---
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
|
|
527
|
+
**Title + Sections + Details**
|
|
528
|
+
|
|
529
|
+
---
|
|
530
|
+
|
|
531
|
+
---
|
|
532
|
+
|
|
533
|
+
## Menu Item
|
|
534
|
+
|
|
535
|
+
| | In Figma | | | Meets Accessibility | | | In CZ GEN EPI Codebase |
|
|
536
|
+
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
537
|
+
|
|
538
|
+
### Single-select Menu Item
|
|
539
|
+
|
|
540
|
+
Menu Items can be optionally paired with additional clarifying details, with counters that indicate the number of items within that Menu Item's category, or be disabled entirely. These details are established within the `[array]` passed into the `options` prop on the Dropdown Menu component.
|
|
541
|
+
|
|
542
|
+
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
543
|
+
|
|
544
|
+
| **Default** | **Hover** | **Selected** | **Disabled** |
|
|
545
|
+
| --- | --- | --- | --- |
|
|
546
|
+
|
|
547
|
+
|
|
548
|
+
|
|
549
|
+
**MenuItem**
|
|
550
|
+
|
|
551
|
+
---
|
|
552
|
+
|
|
553
|
+
|
|
554
|
+
|
|
555
|
+
**MenuItem**
|
|
556
|
+
|
|
557
|
+
---
|
|
558
|
+
|
|
559
|
+
|
|
560
|
+
|
|
561
|
+
**MenuItem**
|
|
562
|
+
|
|
563
|
+
---
|
|
564
|
+
|
|
565
|
+
|
|
566
|
+
|
|
567
|
+
**MenuItem**
|
|
568
|
+
|
|
569
|
+
---
|
|
570
|
+
|
|
571
|
+
| **Default + Count** | **Hover** | **Selected** | **Disabled** |
|
|
572
|
+
| --- | --- | --- | --- |
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
|
|
576
|
+
**MenuItem**
|
|
577
|
+
|
|
578
|
+
---
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
**MenuItem**
|
|
583
|
+
|
|
584
|
+
---
|
|
585
|
+
|
|
586
|
+
|
|
587
|
+
|
|
588
|
+
**MenuItem**
|
|
589
|
+
|
|
590
|
+
---
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
|
|
594
|
+
**MenuItem**
|
|
595
|
+
|
|
596
|
+
---
|
|
597
|
+
|
|
598
|
+
| **Default + Details** | **Hover** | **Selected** | **Disabled** |
|
|
599
|
+
| --- | --- | --- | --- |
|
|
600
|
+
|
|
601
|
+
|
|
602
|
+
|
|
603
|
+
**MenuItem**
|
|
604
|
+
|
|
605
|
+
---
|
|
606
|
+
|
|
607
|
+
|
|
608
|
+
|
|
609
|
+
**MenuItem**
|
|
610
|
+
|
|
611
|
+
---
|
|
612
|
+
|
|
613
|
+
|
|
614
|
+
|
|
615
|
+
**MenuItem**
|
|
616
|
+
|
|
617
|
+
---
|
|
618
|
+
|
|
619
|
+
|
|
620
|
+
|
|
621
|
+
**MenuItem**
|
|
622
|
+
|
|
623
|
+
---
|
|
624
|
+
|
|
625
|
+
|
|
626
|
+
|
|
627
|
+
### Multi-select Menu Item
|
|
628
|
+
|
|
629
|
+
Menu Items can be optionally paired with additional clarifying details, with counters that indicate the number of items within that Menu Item's category, or be disabled entirely. These details are established within the `[array]` passed into the `options` prop on the Dropdown Menu component.
|
|
630
|
+
|
|
631
|
+
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
632
|
+
|
|
633
|
+
| **Default** | **Hover** | **Selected** | **Disabled** |
|
|
634
|
+
| --- | --- | --- | --- |
|
|
635
|
+
|
|
636
|
+
|
|
637
|
+
|
|
638
|
+
**MenuItem**
|
|
639
|
+
|
|
640
|
+
---
|
|
641
|
+
|
|
642
|
+
|
|
643
|
+
|
|
644
|
+
**MenuItem**
|
|
645
|
+
|
|
646
|
+
---
|
|
647
|
+
|
|
648
|
+
|
|
649
|
+
|
|
650
|
+
**MenuItem**
|
|
651
|
+
|
|
652
|
+
---
|
|
653
|
+
|
|
654
|
+
|
|
655
|
+
|
|
656
|
+
**MenuItem**
|
|
657
|
+
|
|
658
|
+
---
|
|
659
|
+
|
|
660
|
+
| **Default + Count** | **Hover** | **Selected** | **Disabled** |
|
|
661
|
+
| --- | --- | --- | --- |
|
|
662
|
+
|
|
663
|
+
|
|
664
|
+
|
|
665
|
+
**MenuItem**
|
|
666
|
+
|
|
667
|
+
---
|
|
668
|
+
|
|
669
|
+
|
|
670
|
+
|
|
671
|
+
**MenuItem**
|
|
672
|
+
|
|
673
|
+
---
|
|
674
|
+
|
|
675
|
+
|
|
676
|
+
|
|
677
|
+
**MenuItem**
|
|
678
|
+
|
|
679
|
+
---
|
|
680
|
+
|
|
681
|
+
|
|
682
|
+
|
|
683
|
+
**MenuItem**
|
|
684
|
+
|
|
685
|
+
---
|
|
686
|
+
|
|
687
|
+
| **Default + Details** | **Hover** | **Selected** | **Disabled** |
|
|
688
|
+
| --- | --- | --- | --- |
|
|
689
|
+
|
|
690
|
+
|
|
691
|
+
|
|
692
|
+
**MenuItem**
|
|
693
|
+
|
|
694
|
+
---
|
|
695
|
+
|
|
696
|
+
|
|
697
|
+
|
|
698
|
+
**MenuItem**
|
|
699
|
+
|
|
700
|
+
---
|
|
701
|
+
|
|
702
|
+
|
|
703
|
+
|
|
704
|
+
**MenuItem**
|
|
705
|
+
|
|
706
|
+
---
|
|
707
|
+
|
|
708
|
+
|
|
709
|
+
|
|
710
|
+
**MenuItem**
|
|
711
|
+
|
|
712
|
+
---
|
|
713
|
+
|
|
714
|
+
## Code
|
|
715
|
+
|
|
716
|
+
## Dropdown Menu Component
|
|
717
|
+
|
|
718
|
+
| Below you will find interactive Storybook iframes for the Dropdown Menu. Tabs within each iframe provide a different set of tools: The Controls tab allows you to see and adjust all available props. The Actions tab shows you data displayed by event handler arguments. | | **Jump to component:** DropdownMenu |
|
|
719
|
+
| --- | --- | --- |
|
|
720
|
+
|
|
721
|
+
---
|
|
722
|
+
|
|
723
|
+
>**NOTE:** The Dropdown Menu and its affiliated components have undergone a major overhaul in their construction and how they have been coded, rendering the documentation below out of date.
|
|
724
|
+
>
|
|
725
|
+
>While the SDS works on updating the documentation to reflect these changes, see `src/core/Dropdown/index.stories.tsx` within the `sci-components` codebase for example usage of the new Dropdown Menu structure.
|
|
726
|
+
|
|
727
|
+
>This component appears as it is in the default SDS codebase. Once imported into the CZ GEN EPI codebase, use a theme file to enable the CZ GEN EPI visual appearance customization.
|
|
728
|
+
|
|
729
|
+
### DropdownMenu
|
|
730
|
+
|
|
731
|
+
Storybook
|
|
732
|
+
|
|
733
|
+
---
|
|
734
|
+
|
|
735
|
+
Dropdown Menus are coupled with Dropdown Inputs, Dropdown Buttons, and in some cases Icon Buttons whenever those elements present the user with options to choose from or selections to make.
|
|
736
|
+
|
|
737
|
+
## Overview
|
|
738
|
+
|
|
739
|
+
>**Warning:** The Dropdown Menu and its affiliated components have undergone a major overhaul in their construction and how they have been coded, rendering the documentation below out of date.
|
|
740
|
+
>
|
|
741
|
+
>While the SDS works on updating the documentation to reflect these changes, see `src/core/Dropdown/index.stories.tsx` within the `sci-components` codebase for example usage of the new Dropdown Menu structure.
|
|
742
|
+
|
|
743
|
+
## Dropdown Menu Variants
|
|
744
|
+
|
|
745
|
+
| In their basic form, Dropdown Menus are composed of a Menu Container that is filled with Menu Items offering the user options to adjust or select that are contextually relevant to the Button or Dropdown Input they are coupled with. Menu Items can be optionally paired with additional details or with counters that indicate the number of items within that Menu Item's category. Dropdown Menus can also be multi-select, allowing the user to choose multiple options from the group of Menu Items. Additionally, Dropdown Menus can be configured to include a Search Input, have their Menu Items separated out into different sections or groupings, have a built-in title, or any combination of these features. | | **Jump to section:** Dropdown Menu Common Configurations Menu Item |
|
|
746
|
+
| --- | --- | --- |
|
|
747
|
+
|
|
748
|
+
---
|
|
749
|
+
|
|
750
|
+
## Dropdown Menu
|
|
751
|
+
|
|
752
|
+
| | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
|
|
753
|
+
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
754
|
+
|
|
755
|
+
### Single-select Dropdown Menu
|
|
756
|
+
|
|
757
|
+
Use the Single-select Dropdown Menu when users are only able to select one item from the menu. They can be configured to have their Menu Items separated out into different sections or groupings, or have a built-in title; both of these features are established by the `[array]` passed into the `options` prop. Additionally, they can be configured to include a Search Input. See the Data Format section below for details around configuring the `[array]`.
|
|
758
|
+
|
|
759
|
+
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
760
|
+
|
|
761
|
+
|
|
762
|
+
|
|
763
|
+
|
|
764
|
+
|
|
765
|
+
**Default**
|
|
766
|
+
|
|
767
|
+
---
|
|
768
|
+
|
|
769
|
+
---
|
|
770
|
+
|
|
771
|
+
|
|
772
|
+
|
|
773
|
+
**Default + Title**
|
|
774
|
+
|
|
775
|
+
---
|
|
776
|
+
|
|
777
|
+
---
|
|
778
|
+
|
|
779
|
+
|
|
780
|
+
|
|
781
|
+
**Default + Search**
|
|
782
|
+
|
|
783
|
+
---
|
|
784
|
+
|
|
785
|
+
---
|
|
786
|
+
|
|
787
|
+
|
|
788
|
+
|
|
789
|
+
**Default + Sections**
|
|
790
|
+
|
|
791
|
+
---
|
|
792
|
+
|
|
793
|
+
|
|
794
|
+
|
|
795
|
+
### Multi-select Dropdown Menu
|
|
796
|
+
|
|
797
|
+
Use the Multi-select Dropdown Menu when users are able to select one or more items from the menu. They can be configured to have their Menu Items separated out into different sections or groupings, or have a built-in title; both of these features are established by the `[array]` passed into the `options` prop. Additionally, they can be configured to include a Search Input. See the Data Format section below for details around configuring the `[array]`.
|
|
798
|
+
|
|
799
|
+
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
800
|
+
|
|
801
|
+
|
|
802
|
+
|
|
803
|
+
|
|
804
|
+
|
|
805
|
+
**Default**
|
|
806
|
+
|
|
807
|
+
---
|
|
808
|
+
|
|
809
|
+
---
|
|
810
|
+
|
|
811
|
+
|
|
812
|
+
|
|
813
|
+
**Default + Title**
|
|
814
|
+
|
|
815
|
+
---
|
|
816
|
+
|
|
817
|
+
---
|
|
818
|
+
|
|
819
|
+
|
|
820
|
+
|
|
821
|
+
**Default + Search**
|
|
822
|
+
|
|
823
|
+
---
|
|
824
|
+
|
|
825
|
+
---
|
|
826
|
+
|
|
827
|
+
|
|
828
|
+
|
|
829
|
+
**Default + Sections**
|
|
830
|
+
|
|
831
|
+
---
|
|
832
|
+
|
|
833
|
+
---
|
|
834
|
+
|
|
835
|
+
|
|
836
|
+
|
|
837
|
+
**Default + Buttons**
|
|
838
|
+
|
|
839
|
+
---
|
|
840
|
+
|
|
841
|
+
---
|
|
842
|
+
|
|
843
|
+
### Data Format
|
|
844
|
+
|
|
845
|
+
Use the following configuration for the `[array]` passed into the `options` prop:
|
|
846
|
+
|
|
847
|
+
```js
|
|
848
|
+
data = [
|
|
849
|
+
{
|
|
850
|
+
// section with a Header and Menu Item Details
|
|
851
|
+
dataRows: [
|
|
852
|
+
{
|
|
853
|
+
name: "Menu Item",
|
|
854
|
+
details: "Details",
|
|
855
|
+
},
|
|
856
|
+
{
|
|
857
|
+
name: "Menu Item",
|
|
858
|
+
details: "Details",
|
|
859
|
+
},
|
|
860
|
+
{
|
|
861
|
+
name: "Menu Item",
|
|
862
|
+
details: "Details",
|
|
863
|
+
},
|
|
864
|
+
],
|
|
865
|
+
label: "Section One",
|
|
866
|
+
},
|
|
867
|
+
{
|
|
868
|
+
// section with Menu Item Counts
|
|
869
|
+
dataRows: [
|
|
870
|
+
{
|
|
871
|
+
name: "Menu Item",
|
|
872
|
+
count: 20,
|
|
873
|
+
},
|
|
874
|
+
{
|
|
875
|
+
name: "Menu Item",
|
|
876
|
+
count: 40,
|
|
877
|
+
},
|
|
878
|
+
{
|
|
879
|
+
name: "Menu Item",
|
|
880
|
+
count: 60,
|
|
881
|
+
},
|
|
882
|
+
],
|
|
883
|
+
},
|
|
884
|
+
];
|
|
885
|
+
```
|
|
886
|
+
|
|
887
|
+
---
|
|
888
|
+
|
|
889
|
+
### Dropdown Menu Spacing
|
|
890
|
+
|
|
891
|
+
These rules establish how much margin should exist between and around elements.
|
|
892
|
+
|
|
893
|
+
|
|
894
|
+
|
|
895
|
+
**Dropdown Menu Spacing**
|
|
896
|
+
|
|
897
|
+
---
|
|
898
|
+
|
|
899
|
+
---
|
|
900
|
+
|
|
901
|
+
## Common Configurations
|
|
902
|
+
|
|
903
|
+
Dropdown Menus can be thought of as being comprised of different combinations of building blocks all within a Menu Container, ensuring a wide range of flexibility for whatever need a designer has with their designs.
|
|
904
|
+
|
|
905
|
+
Below are a number of common Dropdown Menu configurations, but by no means is this an exhaustive list:
|
|
906
|
+
|
|
907
|
+
| **Title + Count** | **Search + Sections + Details** | **Title + Details** |
|
|
908
|
+
| --- | --- | --- |
|
|
909
|
+
|
|
910
|
+
|
|
911
|
+
|
|
912
|
+
**Title + Count**
|
|
913
|
+
|
|
914
|
+
---
|
|
915
|
+
|
|
916
|
+
|
|
917
|
+
|
|
918
|
+
**Search + Sections + Details**
|
|
919
|
+
|
|
920
|
+
---
|
|
921
|
+
|
|
922
|
+
|
|
923
|
+
|
|
924
|
+
**Title + Details**
|
|
925
|
+
|
|
926
|
+
---
|
|
927
|
+
|
|
928
|
+
| **Search + Details** | **Title + Search + Count** | **Title + Sections + Details** |
|
|
929
|
+
| --- | --- | --- |
|
|
930
|
+
|
|
931
|
+
|
|
932
|
+
|
|
933
|
+
**Search + Details**
|
|
934
|
+
|
|
935
|
+
---
|
|
936
|
+
|
|
937
|
+
|
|
938
|
+
|
|
939
|
+
**Search + Title + Count**
|
|
940
|
+
|
|
941
|
+
---
|
|
942
|
+
|
|
943
|
+
|
|
944
|
+
|
|
945
|
+
**Title + Sections + Details**
|
|
946
|
+
|
|
947
|
+
---
|
|
948
|
+
|
|
949
|
+
---
|
|
950
|
+
|
|
951
|
+
## Menu Item
|
|
952
|
+
|
|
953
|
+
| | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
|
|
954
|
+
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
955
|
+
|
|
956
|
+
### Single-select Menu Item
|
|
957
|
+
|
|
958
|
+
Menu Items can be optionally paired with additional clarifying details, with counters that indicate the number of items within that Menu Item's category, or be disabled entirely. These details are established within the `[array]` passed into the `options` prop on the Dropdown Menu component.
|
|
959
|
+
|
|
960
|
+
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
961
|
+
|
|
962
|
+
| **Default** | **Hover** | **Selected** | **Disabled** |
|
|
963
|
+
| --- | --- | --- | --- |
|
|
964
|
+
|
|
965
|
+
|
|
966
|
+
|
|
967
|
+
**MenuItem**
|
|
968
|
+
|
|
969
|
+
---
|
|
970
|
+
|
|
971
|
+
|
|
972
|
+
|
|
973
|
+
**MenuItem**
|
|
974
|
+
|
|
975
|
+
---
|
|
976
|
+
|
|
977
|
+
|
|
978
|
+
|
|
979
|
+
**MenuItem**
|
|
980
|
+
|
|
981
|
+
---
|
|
982
|
+
|
|
983
|
+
|
|
984
|
+
|
|
985
|
+
**MenuItem**
|
|
986
|
+
|
|
987
|
+
---
|
|
988
|
+
|
|
989
|
+
| **Default + Count** | **Hover** | **Selected** | **Disabled** |
|
|
990
|
+
| --- | --- | --- | --- |
|
|
991
|
+
|
|
992
|
+
|
|
993
|
+
|
|
994
|
+
**MenuItem**
|
|
995
|
+
|
|
996
|
+
---
|
|
997
|
+
|
|
998
|
+
|
|
999
|
+
|
|
1000
|
+
**MenuItem**
|
|
1001
|
+
|
|
1002
|
+
---
|
|
1003
|
+
|
|
1004
|
+
|
|
1005
|
+
|
|
1006
|
+
**MenuItem**
|
|
1007
|
+
|
|
1008
|
+
---
|
|
1009
|
+
|
|
1010
|
+
|
|
1011
|
+
|
|
1012
|
+
**MenuItem**
|
|
1013
|
+
|
|
1014
|
+
---
|
|
1015
|
+
|
|
1016
|
+
| **Default + Details** | **Hover** | **Selected** | **Disabled** |
|
|
1017
|
+
| --- | --- | --- | --- |
|
|
1018
|
+
|
|
1019
|
+
|
|
1020
|
+
|
|
1021
|
+
**MenuItem**
|
|
1022
|
+
|
|
1023
|
+
---
|
|
1024
|
+
|
|
1025
|
+
|
|
1026
|
+
|
|
1027
|
+
**MenuItem**
|
|
1028
|
+
|
|
1029
|
+
---
|
|
1030
|
+
|
|
1031
|
+
|
|
1032
|
+
|
|
1033
|
+
**MenuItem**
|
|
1034
|
+
|
|
1035
|
+
---
|
|
1036
|
+
|
|
1037
|
+
|
|
1038
|
+
|
|
1039
|
+
**MenuItem**
|
|
1040
|
+
|
|
1041
|
+
---
|
|
1042
|
+
|
|
1043
|
+
|
|
1044
|
+
|
|
1045
|
+
### Multi-select Menu Item
|
|
1046
|
+
|
|
1047
|
+
Menu Items can be optionally paired with additional clarifying details, with counters that indicate the number of items within that Menu Item's category, or be disabled entirely. These details are established within the `[array]` passed into the `options` prop on the Dropdown Menu component.
|
|
1048
|
+
|
|
1049
|
+
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
1050
|
+
|
|
1051
|
+
| **Default** | **Hover** | **Selected** | **Disabled** |
|
|
1052
|
+
| --- | --- | --- | --- |
|
|
1053
|
+
|
|
1054
|
+
|
|
1055
|
+
|
|
1056
|
+
**MenuItem**
|
|
1057
|
+
|
|
1058
|
+
---
|
|
1059
|
+
|
|
1060
|
+
|
|
1061
|
+
|
|
1062
|
+
**MenuItem**
|
|
1063
|
+
|
|
1064
|
+
---
|
|
1065
|
+
|
|
1066
|
+
|
|
1067
|
+
|
|
1068
|
+
**MenuItem**
|
|
1069
|
+
|
|
1070
|
+
---
|
|
1071
|
+
|
|
1072
|
+
|
|
1073
|
+
|
|
1074
|
+
**MenuItem**
|
|
1075
|
+
|
|
1076
|
+
---
|
|
1077
|
+
|
|
1078
|
+
| **Default + Count** | **Hover** | **Selected** | **Disabled** |
|
|
1079
|
+
| --- | --- | --- | --- |
|
|
1080
|
+
|
|
1081
|
+
|
|
1082
|
+
|
|
1083
|
+
**MenuItem**
|
|
1084
|
+
|
|
1085
|
+
---
|
|
1086
|
+
|
|
1087
|
+
|
|
1088
|
+
|
|
1089
|
+
**MenuItem**
|
|
1090
|
+
|
|
1091
|
+
---
|
|
1092
|
+
|
|
1093
|
+
|
|
1094
|
+
|
|
1095
|
+
**MenuItem**
|
|
1096
|
+
|
|
1097
|
+
---
|
|
1098
|
+
|
|
1099
|
+
|
|
1100
|
+
|
|
1101
|
+
**MenuItem**
|
|
1102
|
+
|
|
1103
|
+
---
|
|
1104
|
+
|
|
1105
|
+
| **Default + Details** | **Hover** | **Selected** | **Disabled** |
|
|
1106
|
+
| --- | --- | --- | --- |
|
|
1107
|
+
|
|
1108
|
+
|
|
1109
|
+
|
|
1110
|
+
**MenuItem**
|
|
1111
|
+
|
|
1112
|
+
---
|
|
1113
|
+
|
|
1114
|
+
|
|
1115
|
+
|
|
1116
|
+
**MenuItem**
|
|
1117
|
+
|
|
1118
|
+
---
|
|
1119
|
+
|
|
1120
|
+
|
|
1121
|
+
|
|
1122
|
+
**MenuItem**
|
|
1123
|
+
|
|
1124
|
+
---
|
|
1125
|
+
|
|
1126
|
+
|
|
1127
|
+
|
|
1128
|
+
**MenuItem**
|
|
1129
|
+
|
|
1130
|
+
---
|
|
1131
|
+
|
|
1132
|
+
## Code
|
|
1133
|
+
|
|
1134
|
+
## Dropdown Menu Component
|
|
1135
|
+
|
|
1136
|
+
| Below you will find interactive Storybook iframes for the Dropdown Menu. Tabs within each iframe provide a different set of tools: The Controls tab allows you to see and adjust all available props. The Actions tab shows you data displayed by event handler arguments. | | **Jump to component:** DropdownMenu |
|
|
1137
|
+
| --- | --- | --- |
|
|
1138
|
+
|
|
1139
|
+
---
|
|
1140
|
+
|
|
1141
|
+
>**NOTE:** The Dropdown Menu and its affiliated components have undergone a major overhaul in their construction and how they have been coded, rendering the documentation below out of date.
|
|
1142
|
+
>
|
|
1143
|
+
>While the SDS works on updating the documentation to reflect these changes, see `src/core/Dropdown/index.stories.tsx` within the `sci-components` codebase for example usage of the new Dropdown Menu structure.
|
|
1144
|
+
|
|
1145
|
+
### DropdownMenu
|
|
1146
|
+
|
|
1147
|
+
Storybook
|
|
1148
|
+
|
|
1149
|
+
|
|
1150
|
+
|