@astryxdesign/core 0.5.2-canary.c9c8564 → 0.5.2-canary.e4f8e4e
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/dist/BottomSheet/BottomSheet.d.ts +3 -1
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +4 -3
- package/dist/BottomSheet/BottomSheetEdgeTint.d.ts +2 -2
- package/dist/BottomSheet/BottomSheetEdgeTint.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetEdgeTint.js +7 -10
- package/dist/BottomSheet/BottomSheetSwitcher.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetSwitcher.js +1 -1
- package/dist/Button/Button.d.ts +2 -1
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +11 -4
- package/dist/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +2 -2
- package/dist/Chat/ChatToolCalls.d.ts.map +1 -1
- package/dist/Chat/ChatToolCalls.js +34 -17
- package/dist/ContextMenu/ContextMenu.d.ts +14 -3
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +149 -26
- package/dist/ContextMenu/index.d.ts +1 -0
- package/dist/ContextMenu/index.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.d.ts +24 -5
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +340 -26
- package/dist/DropdownMenu/DropdownMenuContext.d.ts +1 -1
- package/dist/DropdownMenu/DropdownMenuContext.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuItem.js +1 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts +6 -2
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.js +43 -14
- package/dist/DropdownMenu/MenuBottomSheet.d.ts +20 -0
- package/dist/DropdownMenu/MenuBottomSheet.d.ts.map +1 -0
- package/dist/DropdownMenu/MenuBottomSheet.js +36 -0
- package/dist/DropdownMenu/MenuBottomSheetActionList.d.ts +10 -0
- package/dist/DropdownMenu/MenuBottomSheetActionList.d.ts.map +1 -0
- package/dist/DropdownMenu/MenuBottomSheetActionList.js +111 -0
- package/dist/DropdownMenu/index.d.ts +2 -1
- package/dist/DropdownMenu/index.d.ts.map +1 -1
- package/dist/DropdownMenu/menuWidth.d.ts +14 -0
- package/dist/DropdownMenu/menuWidth.d.ts.map +1 -0
- package/dist/DropdownMenu/menuWidth.js +35 -0
- package/dist/DropdownMenu/useMenuOverflow.d.ts +10 -0
- package/dist/DropdownMenu/useMenuOverflow.d.ts.map +1 -0
- package/dist/DropdownMenu/useMenuOverflow.js +60 -0
- package/dist/MoreMenu/MoreMenu.d.ts +8 -2
- package/dist/MoreMenu/MoreMenu.d.ts.map +1 -1
- package/dist/MoreMenu/MoreMenu.js +2 -0
- package/dist/MultiSelector/MultiSelector.d.ts +11 -1
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +97 -68
- package/dist/MultiSelector/index.d.ts +1 -1
- package/dist/MultiSelector/index.d.ts.map +1 -1
- package/dist/Popover/Popover.d.ts +10 -6
- package/dist/Popover/Popover.d.ts.map +1 -1
- package/dist/Popover/Popover.js +141 -16
- package/dist/Popover/usePopover.d.ts +4 -0
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +52 -5
- package/dist/Selector/Selector.d.ts +10 -0
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +106 -80
- package/dist/Selector/SelectorBottomSheet.d.ts +21 -0
- package/dist/Selector/SelectorBottomSheet.d.ts.map +1 -0
- package/dist/Selector/SelectorBottomSheet.js +83 -0
- package/dist/Selector/index.d.ts +1 -1
- package/dist/Selector/index.d.ts.map +1 -1
- package/dist/Selector/selectorPresentation.stylex.d.ts +16 -0
- package/dist/Selector/selectorPresentation.stylex.d.ts.map +1 -0
- package/dist/Selector/selectorPresentation.stylex.js +21 -0
- package/dist/Selector/useSelectorPresentation.d.ts +32 -0
- package/dist/Selector/useSelectorPresentation.d.ts.map +1 -0
- package/dist/Selector/useSelectorPresentation.js +90 -0
- package/dist/Toast/useToastGesture.d.ts.map +1 -1
- package/dist/Toast/useToastGesture.js +46 -9
- package/dist/astryx.css +19 -1
- package/dist/hooks/useAdaptivePresentation.d.ts +5 -0
- package/dist/hooks/useAdaptivePresentation.d.ts.map +1 -0
- package/dist/hooks/useAdaptivePresentation.js +19 -0
- package/dist/hooks/useFocusReturnVisibility.d.ts +7 -0
- package/dist/hooks/useFocusReturnVisibility.d.ts.map +1 -0
- package/dist/hooks/useFocusReturnVisibility.js +35 -0
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +12 -0
- package/locales/en.json +20 -0
- package/locales/pseudo.json +15 -0
- package/package.json +2 -2
- package/src/BottomSheet/BottomSheet.doc.mjs +6 -0
- package/src/BottomSheet/BottomSheet.test.tsx +29 -0
- package/src/BottomSheet/BottomSheet.tsx +7 -4
- package/src/BottomSheet/BottomSheetEdgeTint.test.tsx +4 -6
- package/src/BottomSheet/BottomSheetEdgeTint.tsx +7 -10
- package/src/BottomSheet/BottomSheetSwitcher.tsx +1 -2
- package/src/Button/Button.doc.mjs +56 -0
- package/src/Button/Button.test.tsx +10 -0
- package/src/Button/Button.tsx +13 -5
- package/src/ButtonGroup/ButtonGroup.doc.mjs +47 -0
- package/src/Carousel/Carousel.test.tsx +83 -0
- package/src/Carousel/Carousel.tsx +8 -2
- package/src/Chat/ChatToolCalls.test.tsx +44 -0
- package/src/Chat/ChatToolCalls.tsx +36 -15
- package/src/ContextMenu/ContextMenu.doc.mjs +13 -1
- package/src/ContextMenu/ContextMenu.test.tsx +131 -1
- package/src/ContextMenu/ContextMenu.tsx +199 -32
- package/src/ContextMenu/index.ts +1 -0
- package/src/DropdownMenu/DropdownMenu.doc.mjs +201 -40
- package/src/DropdownMenu/DropdownMenu.test.tsx +518 -7
- package/src/DropdownMenu/DropdownMenu.tsx +459 -28
- package/src/DropdownMenu/DropdownMenuContext.tsx +1 -1
- package/src/DropdownMenu/DropdownMenuItem.tsx +2 -0
- package/src/DropdownMenu/DropdownMenuSubMenu.doc.mjs +4 -2
- package/src/DropdownMenu/DropdownMenuSubMenu.test.tsx +124 -0
- package/src/DropdownMenu/DropdownMenuSubMenu.tsx +72 -17
- package/src/DropdownMenu/MenuBottomSheet.tsx +46 -0
- package/src/DropdownMenu/MenuBottomSheetActionList.tsx +141 -0
- package/src/DropdownMenu/index.ts +2 -0
- package/src/DropdownMenu/menuWidth.ts +51 -0
- package/src/DropdownMenu/useMenuOverflow.ts +77 -0
- package/src/IconButton/IconButton.doc.mjs +38 -0
- package/src/MoreMenu/MoreMenu.doc.mjs +17 -0
- package/src/MoreMenu/MoreMenu.test.tsx +47 -0
- package/src/MoreMenu/MoreMenu.tsx +13 -1
- package/src/MultiSelector/MultiSelector.doc.mjs +16 -0
- package/src/MultiSelector/MultiSelector.test.tsx +127 -0
- package/src/MultiSelector/MultiSelector.tsx +121 -73
- package/src/MultiSelector/index.ts +1 -0
- package/src/Popover/Popover.doc.mjs +11 -11
- package/src/Popover/Popover.test.tsx +397 -2
- package/src/Popover/Popover.tsx +228 -21
- package/src/Popover/usePopover.tsx +92 -15
- package/src/ProgressBar/ProgressBar.spec.md +208 -0
- package/src/SegmentedControl/SegmentedControl.doc.mjs +56 -0
- package/src/Selector/Selector.doc.mjs +12 -0
- package/src/Selector/Selector.test.tsx +135 -0
- package/src/Selector/Selector.tsx +141 -82
- package/src/Selector/SelectorBottomSheet.tsx +97 -0
- package/src/Selector/index.ts +1 -0
- package/src/Selector/selectorPresentation.stylex.ts +20 -0
- package/src/Selector/useSelectorPresentation.ts +147 -0
- package/src/Toast/ToastViewport.test.tsx +118 -4
- package/src/Toast/useToastGesture.ts +61 -8
- package/src/ToggleButton/ToggleButton.doc.mjs +56 -0
- package/src/hooks/useAdaptivePresentation.ts +35 -0
- package/src/hooks/useFocusReturnVisibility.ts +45 -0
- package/src/hooks/useFocusTrap.test.tsx +40 -0
- package/src/hooks/useFocusTrap.ts +13 -0
- package/src/theme/themingTargets.test.ts +91 -25
|
@@ -7,24 +7,42 @@ export const docs = {
|
|
|
7
7
|
displayName: 'Dropdown Menu',
|
|
8
8
|
group: 'DropdownMenu',
|
|
9
9
|
category: 'Action',
|
|
10
|
-
keywords: [
|
|
10
|
+
keywords: [
|
|
11
|
+
'dropdown',
|
|
12
|
+
'menu',
|
|
13
|
+
'popover',
|
|
14
|
+
'select',
|
|
15
|
+
'actions',
|
|
16
|
+
'contextmenu',
|
|
17
|
+
'overflow',
|
|
18
|
+
'kebab',
|
|
19
|
+
'menubutton',
|
|
20
|
+
],
|
|
11
21
|
playground: {
|
|
12
22
|
// `items` is required; without seeded entries the properties-tab preview
|
|
13
23
|
// renders an empty trigger button. Provide a few actions so the preview
|
|
14
24
|
// is meaningful.
|
|
15
25
|
defaults: {
|
|
16
26
|
button: {label: 'Actions'},
|
|
27
|
+
presentation: 'popover',
|
|
17
28
|
items: [
|
|
18
|
-
{label: 'Edit'},
|
|
19
|
-
{label: 'Duplicate'},
|
|
20
|
-
{label: '
|
|
29
|
+
{label: 'Edit project', icon: 'wrench'},
|
|
30
|
+
{label: 'Duplicate project', icon: 'copy'},
|
|
31
|
+
{label: 'Share project', icon: 'externalLink'},
|
|
32
|
+
{label: 'Archive project', icon: 'stop'},
|
|
21
33
|
],
|
|
22
34
|
},
|
|
23
35
|
},
|
|
24
36
|
theming: {
|
|
25
37
|
targets: [
|
|
26
|
-
{
|
|
27
|
-
|
|
38
|
+
{
|
|
39
|
+
className: 'astryx-dropdown-menu',
|
|
40
|
+
visualProps: ['presentation'],
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
className: 'astryx-dropdown-menu-item',
|
|
44
|
+
visualProps: ['size', 'variant'],
|
|
45
|
+
},
|
|
28
46
|
{
|
|
29
47
|
className: 'astryx-dropdown-menu-radio',
|
|
30
48
|
visualProps: ['size'],
|
|
@@ -35,28 +53,48 @@ export const docs = {
|
|
|
35
53
|
{className: 'astryx-dropdown-menu-indicator-icon'},
|
|
36
54
|
],
|
|
37
55
|
vars: [
|
|
38
|
-
{
|
|
39
|
-
|
|
56
|
+
{
|
|
57
|
+
name: '--_dropdown-menu-radius',
|
|
58
|
+
description: 'Border radius of the menu popup',
|
|
59
|
+
default: 'var(--radius-element)',
|
|
60
|
+
private: true,
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: '--_dropdown-menu-padding',
|
|
64
|
+
description: 'Inner padding of the menu popup',
|
|
65
|
+
default: 'var(--spacing-1)',
|
|
66
|
+
private: true,
|
|
67
|
+
},
|
|
40
68
|
],
|
|
41
69
|
derived: [
|
|
42
70
|
{property: 'borderRadius', vars: ['--_dropdown-menu-radius']},
|
|
43
71
|
{property: 'padding', vars: ['--_dropdown-menu-padding']},
|
|
44
72
|
],
|
|
45
73
|
},
|
|
46
|
-
description:
|
|
74
|
+
description:
|
|
75
|
+
'Action menu with a trigger button and anchored, bottom-sheet, or adaptive presentation.',
|
|
47
76
|
props: [
|
|
48
77
|
{
|
|
49
78
|
name: 'button',
|
|
50
79
|
type: 'DropdownMenuButtonProps',
|
|
51
|
-
description:
|
|
80
|
+
description:
|
|
81
|
+
'Props for the trigger button (Button props except onClick).',
|
|
52
82
|
default: "{ label: 'Menu' }",
|
|
53
83
|
},
|
|
54
84
|
{
|
|
55
85
|
name: 'items',
|
|
56
86
|
type: 'DropdownMenuOption[]',
|
|
57
|
-
description:
|
|
87
|
+
description:
|
|
88
|
+
'Array of menu entries. Each entry is one of: an action item `{label, onClick?, icon?, description?, endContent?, isDisabled?, variant?, hasCloseOnSelect?, id?}` (variant `"destructive"` renders it in the error color; `endContent` holds trailing content such as a keyboard-shortcut hint; `id` is the row\'s stable React key, needed only when the array reorders or filters), a divider `{type: "divider"}`, or a section `{type: "section", title?, id?, items: [...action items]}`.',
|
|
58
89
|
required: true,
|
|
59
90
|
},
|
|
91
|
+
{
|
|
92
|
+
name: 'presentation',
|
|
93
|
+
type: "'popover' | 'bottom-sheet' | 'adaptive'",
|
|
94
|
+
description:
|
|
95
|
+
"Presentation surface for data-driven items. 'popover' stays anchored, 'bottom-sheet' always renders the actions in a modal BottomSheet, and 'adaptive' uses a BottomSheet on compact coarse-pointer layouts while remaining anchored elsewhere. Compound children currently support popover only.",
|
|
96
|
+
default: "'popover'",
|
|
97
|
+
},
|
|
60
98
|
{
|
|
61
99
|
name: 'isMenuOpen',
|
|
62
100
|
type: 'boolean',
|
|
@@ -70,18 +108,21 @@ export const docs = {
|
|
|
70
108
|
{
|
|
71
109
|
name: 'menuWidth',
|
|
72
110
|
type: 'number | string',
|
|
73
|
-
description:
|
|
111
|
+
description:
|
|
112
|
+
'Minimum width for the popover presentation. Length values may grow for content; intrinsic and CSS-wide keywords select the preferred inline size. Every form is capped to the available viewport space. Defaults to matching the trigger width up to that cap.',
|
|
74
113
|
},
|
|
75
114
|
{
|
|
76
115
|
name: 'placement',
|
|
77
116
|
type: "'above' | 'below' | 'start' | 'end'",
|
|
78
|
-
description:
|
|
117
|
+
description:
|
|
118
|
+
"Popover placement relative to the trigger. Ignored by the bottom-sheet presentation. Logical: start/end resolve against the menu's own inherited direction (RTL mirrors).",
|
|
79
119
|
default: "'below'",
|
|
80
120
|
},
|
|
81
121
|
{
|
|
82
122
|
name: 'alignment',
|
|
83
123
|
type: "'start' | 'center' | 'end'",
|
|
84
|
-
description:
|
|
124
|
+
description:
|
|
125
|
+
"Popover alignment along the placement axis. Ignored by the bottom-sheet presentation. Logical: start/end follow the menu's own inherited direction (RTL mirrors).",
|
|
85
126
|
default: "'start'",
|
|
86
127
|
},
|
|
87
128
|
{
|
|
@@ -89,34 +130,70 @@ export const docs = {
|
|
|
89
130
|
type: '() => void',
|
|
90
131
|
description: 'Callback fired when the trigger button is clicked.',
|
|
91
132
|
},
|
|
92
|
-
{
|
|
93
|
-
name: 'placement',
|
|
94
|
-
type: "'above' | 'below' | 'start' | 'end'",
|
|
95
|
-
description: 'Position placement for the menu popover relative to the trigger button.',
|
|
96
|
-
default: "'below'",
|
|
97
|
-
},
|
|
98
133
|
{
|
|
99
134
|
name: 'hasChevron',
|
|
100
135
|
type: 'boolean',
|
|
101
|
-
description:
|
|
136
|
+
description:
|
|
137
|
+
'Whether to show a chevron icon on the trigger button. Set to false for icon-only triggers.',
|
|
102
138
|
default: 'true',
|
|
103
|
-
},
|
|
139
|
+
},
|
|
140
|
+
{
|
|
104
141
|
name: 'children',
|
|
105
142
|
type: 'ReactNode',
|
|
106
143
|
description:
|
|
107
144
|
'Compound-mode menu content: DropdownMenuItem, DropdownMenuDivider, DropdownMenuSubMenu, and the selectable items. Mutually exclusive with `items`.',
|
|
108
145
|
},
|
|
109
146
|
],
|
|
110
|
-
components: [
|
|
111
|
-
{name: 'DropdownMenuItem'},
|
|
112
|
-
],
|
|
147
|
+
components: [{name: 'DropdownMenuItem'}],
|
|
113
148
|
usage: {
|
|
114
|
-
description:
|
|
149
|
+
description:
|
|
150
|
+
'A dropdown menu that displays a list of actionable items in a popup triggered by a button. Use to present action options as a next step in a process, or to offer contextual actions without cluttering the interface.',
|
|
115
151
|
bestPractices: [
|
|
116
|
-
{
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
152
|
+
{
|
|
153
|
+
guidance: true,
|
|
154
|
+
description:
|
|
155
|
+
'Keep menu items concise and action-oriented so users can scan options quickly.',
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
guidance: true,
|
|
159
|
+
description:
|
|
160
|
+
'Use sections and dividers to group related actions when the menu has many items.',
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
guidance: true,
|
|
164
|
+
description:
|
|
165
|
+
'For a short, flat action set, use presentation="bottom-sheet" when product policy calls for a modal touch surface.',
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
guidance: true,
|
|
169
|
+
description:
|
|
170
|
+
'Use presentation="adaptive" when the same short action set should remain anchored on pointer layouts and become a BottomSheet on compact coarse-pointer layouts.',
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
guidance: true,
|
|
174
|
+
description:
|
|
175
|
+
'For a hierarchy that cannot fit as adjacent flyouts on a compact touch surface, a product may explicitly use a drill-in interaction with a Back action.',
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
guidance: true,
|
|
179
|
+
description:
|
|
180
|
+
'Choose presentation explicitly in product code. A compact, coarse-pointer, hover-free media query is one useful policy, but DropdownMenu does not impose a universal device breakpoint.',
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
guidance: true,
|
|
184
|
+
description:
|
|
185
|
+
'When the content is no longer a short list of immediate actions, reevaluate the interaction and choose a component that matches the actual task; content traits alone do not determine the component.',
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
guidance: false,
|
|
189
|
+
description:
|
|
190
|
+
'Use a DropdownMenu for navigation; use a navigation component instead.',
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
guidance: false,
|
|
194
|
+
description:
|
|
195
|
+
'Place more than 10–12 items in a single menu without grouping them into sections.',
|
|
196
|
+
},
|
|
120
197
|
],
|
|
121
198
|
},
|
|
122
199
|
};
|
|
@@ -124,12 +201,54 @@ export const docs = {
|
|
|
124
201
|
/** @type {import('@astryxdesign/cli/authoring').ComponentTranslationDoc} */
|
|
125
202
|
export const docsZh = {
|
|
126
203
|
usage: {
|
|
127
|
-
description:
|
|
204
|
+
description:
|
|
205
|
+
'A dropdown menu that displays a list of actionable items in a popup triggered by a button. Use to present action options as a next step in a process, or to offer contextual actions without cluttering the interface.',
|
|
128
206
|
bestPractices: [
|
|
129
|
-
{
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
207
|
+
{
|
|
208
|
+
guidance: true,
|
|
209
|
+
description:
|
|
210
|
+
'Keep menu items concise and action-oriented so users can scan options quickly.',
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
guidance: true,
|
|
214
|
+
description:
|
|
215
|
+
'Use sections and dividers to group related actions when the menu has many items.',
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
guidance: true,
|
|
219
|
+
description:
|
|
220
|
+
'For a short, flat action set, use presentation="bottom-sheet" when product policy calls for a modal touch surface.',
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
guidance: true,
|
|
224
|
+
description:
|
|
225
|
+
'Use presentation="adaptive" when the same short action set should remain anchored on pointer layouts and become a BottomSheet on compact coarse-pointer layouts.',
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
guidance: true,
|
|
229
|
+
description:
|
|
230
|
+
'For a hierarchy that cannot fit as adjacent flyouts on a compact touch surface, a product may explicitly use a drill-in interaction with a Back action.',
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
guidance: true,
|
|
234
|
+
description:
|
|
235
|
+
'Choose presentation explicitly in product code. A compact, coarse-pointer, hover-free media query is one useful policy, but DropdownMenu does not impose a universal device breakpoint.',
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
guidance: true,
|
|
239
|
+
description:
|
|
240
|
+
'When the content is no longer a short list of immediate actions, reevaluate the interaction and choose a component that matches the actual task; content traits alone do not determine the component.',
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
guidance: false,
|
|
244
|
+
description:
|
|
245
|
+
'Use a DropdownMenu for navigation; use a navigation component instead.',
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
guidance: false,
|
|
249
|
+
description:
|
|
250
|
+
'Place more than 10–12 items in a single menu without grouping them into sections.',
|
|
251
|
+
},
|
|
133
252
|
],
|
|
134
253
|
},
|
|
135
254
|
};
|
|
@@ -138,12 +257,54 @@ export const docsZh = {
|
|
|
138
257
|
export const docsDense = {
|
|
139
258
|
description: 'dropdown menu for actionable items in popup',
|
|
140
259
|
usage: {
|
|
141
|
-
description:
|
|
260
|
+
description:
|
|
261
|
+
'A dropdown menu that displays a list of actionable items in a popup triggered by a button. Use to present action options as a next step in a process, or to offer contextual actions without cluttering the interface.',
|
|
142
262
|
bestPractices: [
|
|
143
|
-
{
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
263
|
+
{
|
|
264
|
+
guidance: true,
|
|
265
|
+
description:
|
|
266
|
+
'Keep menu items concise and action-oriented so users can scan options quickly.',
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
guidance: true,
|
|
270
|
+
description:
|
|
271
|
+
'Use sections and dividers to group related actions when the menu has many items.',
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
guidance: true,
|
|
275
|
+
description:
|
|
276
|
+
'For a short, flat action set, use presentation="bottom-sheet" when product policy calls for a modal touch surface.',
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
guidance: true,
|
|
280
|
+
description:
|
|
281
|
+
'Use presentation="adaptive" when the same short action set should remain anchored on pointer layouts and become a BottomSheet on compact coarse-pointer layouts.',
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
guidance: true,
|
|
285
|
+
description:
|
|
286
|
+
'For a hierarchy that cannot fit as adjacent flyouts on a compact touch surface, a product may explicitly use a drill-in interaction with a Back action.',
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
guidance: true,
|
|
290
|
+
description:
|
|
291
|
+
'Choose presentation explicitly in product code. A compact, coarse-pointer, hover-free media query is one useful policy, but DropdownMenu does not impose a universal device breakpoint.',
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
guidance: true,
|
|
295
|
+
description:
|
|
296
|
+
'When the content is no longer a short list of immediate actions, reevaluate the interaction and choose a component that matches the actual task; content traits alone do not determine the component.',
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
guidance: false,
|
|
300
|
+
description:
|
|
301
|
+
'Use a DropdownMenu for navigation; use a navigation component instead.',
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
guidance: false,
|
|
305
|
+
description:
|
|
306
|
+
'Place more than 10–12 items in a single menu without grouping them into sections.',
|
|
307
|
+
},
|
|
147
308
|
],
|
|
148
309
|
},
|
|
149
310
|
};
|