@astryxdesign/core 0.5.2-canary.c9c8564 → 0.5.2-canary.e03511b
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 +37 -0
- package/src/BottomSheet/BottomSheet.spec.md +177 -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/CheckboxList/CheckboxList.doc.mjs +172 -31
- package/src/CheckboxList/CheckboxList.spec.md +214 -0
- package/src/CommandPalette/CommandPalette.doc.mjs +72 -0
- package/src/CommandPalette/CommandPalette.spec.md +223 -0
- package/src/ComplexSelector/ComplexSelector.doc.mjs +42 -0
- package/src/ComplexSelector/ComplexSelector.spec.md +189 -0
- package/src/ContextMenu/ContextMenu.doc.mjs +61 -1
- package/src/ContextMenu/ContextMenu.spec.md +206 -0
- package/src/ContextMenu/ContextMenu.test.tsx +131 -1
- package/src/ContextMenu/ContextMenu.tsx +199 -32
- package/src/ContextMenu/index.ts +1 -0
- package/src/Divider/Divider.doc.mjs +24 -0
- package/src/Divider/Divider.spec.md +150 -0
- package/src/DropdownMenu/DropdownMenu.doc.mjs +305 -40
- package/src/DropdownMenu/DropdownMenu.spec.md +245 -0
- 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/FieldStatus/FieldStatus.doc.mjs +21 -0
- package/src/FieldStatus/FieldStatus.spec.md +212 -0
- package/src/Grid/Grid.doc.mjs +19 -0
- package/src/Grid/Grid.spec.md +161 -0
- package/src/Icon/Icon.doc.mjs +196 -48
- package/src/Icon/Icon.spec.md +191 -0
- package/src/IconButton/IconButton.doc.mjs +38 -0
- package/src/Kbd/Kbd.doc.mjs +18 -0
- package/src/Kbd/Kbd.spec.md +141 -0
- package/src/Layout/Layout.doc.mjs +32 -0
- package/src/Layout/Layout.spec.md +199 -0
- package/src/Lightbox/Lightbox.doc.mjs +149 -33
- package/src/Lightbox/Lightbox.spec.md +197 -0
- package/src/Markdown/Markdown.doc.mjs +60 -0
- package/src/Markdown/Markdown.spec.md +200 -0
- package/src/MobileNav/MobileNav.doc.mjs +140 -32
- package/src/MobileNav/MobileNav.spec.md +208 -0
- package/src/MoreMenu/MoreMenu.doc.mjs +59 -0
- package/src/MoreMenu/MoreMenu.spec.md +221 -0
- package/src/MoreMenu/MoreMenu.test.tsx +47 -0
- package/src/MoreMenu/MoreMenu.tsx +13 -1
- package/src/MultiSelector/MultiSelector.doc.mjs +128 -0
- package/src/MultiSelector/MultiSelector.spec.md +266 -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/NavIcon/NavIcon.doc.mjs +17 -0
- package/src/NavIcon/NavIcon.spec.md +133 -0
- package/src/NavMenu/NavHeadingMenu.spec.md +205 -0
- package/src/NavMenu/NavMenu.doc.mjs +37 -0
- package/src/Outline/Outline.doc.mjs +35 -0
- package/src/Outline/Outline.spec.md +161 -0
- package/src/OverflowList/OverflowList.doc.mjs +24 -0
- package/src/OverflowList/OverflowList.spec.md +156 -0
- package/src/Pagination/Pagination.doc.mjs +74 -0
- package/src/Pagination/Pagination.spec.md +225 -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.doc.mjs +198 -38
- package/src/ProgressBar/ProgressBar.spec.md +260 -0
- package/src/Resizable/Resizable.doc.mjs +59 -16
- package/src/Resizable/Resizable.spec.md +194 -0
- package/src/Section/Section.doc.mjs +17 -0
- package/src/Section/Section.spec.md +138 -0
- package/src/SegmentedControl/SegmentedControl.doc.mjs +83 -0
- package/src/SegmentedControl/SegmentedControl.spec.md +151 -0
- package/src/Selector/Selector.doc.mjs +12 -0
- package/src/Selector/Selector.spec.md +202 -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/Skeleton/Skeleton.doc.mjs +12 -0
- package/src/Skeleton/Skeleton.spec.md +126 -0
- package/src/Slider/Slider.doc.mjs +184 -30
- package/src/Slider/Slider.spec.md +223 -0
- package/src/Stack/Stack.doc.mjs +22 -0
- package/src/Stack/Stack.spec.md +154 -0
- package/src/StatusDot/StatusDot.doc.mjs +17 -0
- package/src/StatusDot/StatusDot.spec.md +137 -0
- package/src/Switch/Switch.doc.mjs +40 -0
- package/src/Switch/Switch.spec.md +174 -0
- package/src/Table/Table.doc.mjs +102 -24
- package/src/Table/Table.spec.md +283 -0
- package/src/Text/Text.doc.mjs +190 -43
- package/src/Text/Text.spec.md +205 -0
- package/src/TextArea/TextArea.doc.mjs +255 -45
- package/src/TextArea/TextArea.spec.md +204 -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/Toolbar/Toolbar.doc.mjs +19 -0
- package/src/Toolbar/Toolbar.spec.md +173 -0
- package/src/Tooltip/Tooltip.doc.mjs +17 -0
- package/src/Tooltip/Tooltip.spec.md +141 -0
- package/src/TreeList/TreeList.doc.mjs +58 -0
- package/src/TreeList/TreeList.spec.md +220 -0
- package/src/Typeahead/Typeahead.doc.mjs +83 -1
- package/src/Typeahead/Typeahead.spec.md +250 -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
|
@@ -1,5 +1,107 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
2
|
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').ComponentAnatomyElement[]} */
|
|
4
|
+
const anatomy = [
|
|
5
|
+
{
|
|
6
|
+
name: 'Trigger button',
|
|
7
|
+
required: true,
|
|
8
|
+
description: 'Button that opens and closes the selected menu presentation.',
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: 'Trigger indicator icon',
|
|
12
|
+
required: false,
|
|
13
|
+
description:
|
|
14
|
+
'Optional trailing chevron shown by a labeled trigger when hasChevron is enabled.',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'Pointer menu surface',
|
|
18
|
+
required: false,
|
|
19
|
+
description:
|
|
20
|
+
'Anchored top-level or nested menu panel used by the pointer presentation.',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'Pointer action row',
|
|
24
|
+
required: false,
|
|
25
|
+
description:
|
|
26
|
+
'Action, selectable option, or submenu trigger row in an anchored menu.',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'Icon-rendered item icon',
|
|
30
|
+
required: false,
|
|
31
|
+
description:
|
|
32
|
+
'Optional semantic or component icon rendered through Icon at the start of an action row.',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'Caller-rendered item start content',
|
|
36
|
+
required: false,
|
|
37
|
+
description:
|
|
38
|
+
'Optional arbitrary React content rendered directly at the start of an action row.',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'Checkbox indicator',
|
|
42
|
+
required: false,
|
|
43
|
+
description:
|
|
44
|
+
'Decorative shared checkbox indicator for a checkbox action row.',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'Radio indicator',
|
|
48
|
+
required: false,
|
|
49
|
+
description:
|
|
50
|
+
'Decorative shared radio indicator with an additional menu-owned target.',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: 'Pointer section heading',
|
|
54
|
+
required: false,
|
|
55
|
+
description:
|
|
56
|
+
'Heading that labels a data-driven section in an anchored menu.',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'Pointer divider',
|
|
60
|
+
required: false,
|
|
61
|
+
description: 'Divider between groups in an anchored menu.',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: 'Pointer submenu indicator icon',
|
|
65
|
+
required: false,
|
|
66
|
+
description:
|
|
67
|
+
'Trailing chevron that identifies an action row as a nested flyout trigger.',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: 'Touch sheet frame',
|
|
71
|
+
required: false,
|
|
72
|
+
description:
|
|
73
|
+
'BottomSheet panel, content area, handle, and optional scrim that host touch actions.',
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: 'Touch menu surface',
|
|
77
|
+
required: false,
|
|
78
|
+
description:
|
|
79
|
+
'Menu-owned content panel rendered inside the touch sheet frame.',
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: 'Touch heading',
|
|
83
|
+
required: false,
|
|
84
|
+
description:
|
|
85
|
+
'Current action-sheet title, updated when a nested action view is opened.',
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: 'Touch action list',
|
|
89
|
+
required: false,
|
|
90
|
+
description: 'Spacious List that groups actions in the touch presentation.',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: 'Touch action row',
|
|
94
|
+
required: false,
|
|
95
|
+
description:
|
|
96
|
+
'ListItem button used for an action or drill-in entry in the touch presentation.',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: 'Touch divider',
|
|
100
|
+
required: false,
|
|
101
|
+
description: 'Divider between action groups in the touch presentation.',
|
|
102
|
+
},
|
|
103
|
+
];
|
|
104
|
+
|
|
3
105
|
/** @type {import('@astryxdesign/cli/authoring').ComponentDoc} */
|
|
4
106
|
|
|
5
107
|
export const docs = {
|
|
@@ -7,24 +109,42 @@ export const docs = {
|
|
|
7
109
|
displayName: 'Dropdown Menu',
|
|
8
110
|
group: 'DropdownMenu',
|
|
9
111
|
category: 'Action',
|
|
10
|
-
keywords: [
|
|
112
|
+
keywords: [
|
|
113
|
+
'dropdown',
|
|
114
|
+
'menu',
|
|
115
|
+
'popover',
|
|
116
|
+
'select',
|
|
117
|
+
'actions',
|
|
118
|
+
'contextmenu',
|
|
119
|
+
'overflow',
|
|
120
|
+
'kebab',
|
|
121
|
+
'menubutton',
|
|
122
|
+
],
|
|
11
123
|
playground: {
|
|
12
124
|
// `items` is required; without seeded entries the properties-tab preview
|
|
13
125
|
// renders an empty trigger button. Provide a few actions so the preview
|
|
14
126
|
// is meaningful.
|
|
15
127
|
defaults: {
|
|
16
128
|
button: {label: 'Actions'},
|
|
129
|
+
presentation: 'popover',
|
|
17
130
|
items: [
|
|
18
|
-
{label: 'Edit'},
|
|
19
|
-
{label: 'Duplicate'},
|
|
20
|
-
{label: '
|
|
131
|
+
{label: 'Edit project', icon: 'wrench'},
|
|
132
|
+
{label: 'Duplicate project', icon: 'copy'},
|
|
133
|
+
{label: 'Share project', icon: 'externalLink'},
|
|
134
|
+
{label: 'Archive project', icon: 'stop'},
|
|
21
135
|
],
|
|
22
136
|
},
|
|
23
137
|
},
|
|
24
138
|
theming: {
|
|
25
139
|
targets: [
|
|
26
|
-
{
|
|
27
|
-
|
|
140
|
+
{
|
|
141
|
+
className: 'astryx-dropdown-menu',
|
|
142
|
+
visualProps: ['presentation'],
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
className: 'astryx-dropdown-menu-item',
|
|
146
|
+
visualProps: ['size', 'variant'],
|
|
147
|
+
},
|
|
28
148
|
{
|
|
29
149
|
className: 'astryx-dropdown-menu-radio',
|
|
30
150
|
visualProps: ['size'],
|
|
@@ -35,28 +155,48 @@ export const docs = {
|
|
|
35
155
|
{className: 'astryx-dropdown-menu-indicator-icon'},
|
|
36
156
|
],
|
|
37
157
|
vars: [
|
|
38
|
-
{
|
|
39
|
-
|
|
158
|
+
{
|
|
159
|
+
name: '--_dropdown-menu-radius',
|
|
160
|
+
description: 'Border radius of the menu popup',
|
|
161
|
+
default: 'var(--radius-element)',
|
|
162
|
+
private: true,
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
name: '--_dropdown-menu-padding',
|
|
166
|
+
description: 'Inner padding of the menu popup',
|
|
167
|
+
default: 'var(--spacing-1)',
|
|
168
|
+
private: true,
|
|
169
|
+
},
|
|
40
170
|
],
|
|
41
171
|
derived: [
|
|
42
172
|
{property: 'borderRadius', vars: ['--_dropdown-menu-radius']},
|
|
43
173
|
{property: 'padding', vars: ['--_dropdown-menu-padding']},
|
|
44
174
|
],
|
|
45
175
|
},
|
|
46
|
-
description:
|
|
176
|
+
description:
|
|
177
|
+
'Action menu with a trigger button and anchored, bottom-sheet, or adaptive presentation.',
|
|
47
178
|
props: [
|
|
48
179
|
{
|
|
49
180
|
name: 'button',
|
|
50
181
|
type: 'DropdownMenuButtonProps',
|
|
51
|
-
description:
|
|
182
|
+
description:
|
|
183
|
+
'Props for the trigger button (Button props except onClick).',
|
|
52
184
|
default: "{ label: 'Menu' }",
|
|
53
185
|
},
|
|
54
186
|
{
|
|
55
187
|
name: 'items',
|
|
56
188
|
type: 'DropdownMenuOption[]',
|
|
57
|
-
description:
|
|
189
|
+
description:
|
|
190
|
+
'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
191
|
required: true,
|
|
59
192
|
},
|
|
193
|
+
{
|
|
194
|
+
name: 'presentation',
|
|
195
|
+
type: "'popover' | 'bottom-sheet' | 'adaptive'",
|
|
196
|
+
description:
|
|
197
|
+
"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.",
|
|
198
|
+
default: "'popover'",
|
|
199
|
+
},
|
|
60
200
|
{
|
|
61
201
|
name: 'isMenuOpen',
|
|
62
202
|
type: 'boolean',
|
|
@@ -70,18 +210,21 @@ export const docs = {
|
|
|
70
210
|
{
|
|
71
211
|
name: 'menuWidth',
|
|
72
212
|
type: 'number | string',
|
|
73
|
-
description:
|
|
213
|
+
description:
|
|
214
|
+
'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
215
|
},
|
|
75
216
|
{
|
|
76
217
|
name: 'placement',
|
|
77
218
|
type: "'above' | 'below' | 'start' | 'end'",
|
|
78
|
-
description:
|
|
219
|
+
description:
|
|
220
|
+
"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
221
|
default: "'below'",
|
|
80
222
|
},
|
|
81
223
|
{
|
|
82
224
|
name: 'alignment',
|
|
83
225
|
type: "'start' | 'center' | 'end'",
|
|
84
|
-
description:
|
|
226
|
+
description:
|
|
227
|
+
"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
228
|
default: "'start'",
|
|
86
229
|
},
|
|
87
230
|
{
|
|
@@ -89,34 +232,71 @@ export const docs = {
|
|
|
89
232
|
type: '() => void',
|
|
90
233
|
description: 'Callback fired when the trigger button is clicked.',
|
|
91
234
|
},
|
|
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
235
|
{
|
|
99
236
|
name: 'hasChevron',
|
|
100
237
|
type: 'boolean',
|
|
101
|
-
description:
|
|
238
|
+
description:
|
|
239
|
+
'Whether to show a chevron icon on the trigger button. Set to false for icon-only triggers.',
|
|
102
240
|
default: 'true',
|
|
103
|
-
},
|
|
241
|
+
},
|
|
242
|
+
{
|
|
104
243
|
name: 'children',
|
|
105
244
|
type: 'ReactNode',
|
|
106
245
|
description:
|
|
107
246
|
'Compound-mode menu content: DropdownMenuItem, DropdownMenuDivider, DropdownMenuSubMenu, and the selectable items. Mutually exclusive with `items`.',
|
|
108
247
|
},
|
|
109
248
|
],
|
|
110
|
-
components: [
|
|
111
|
-
{name: 'DropdownMenuItem'},
|
|
112
|
-
],
|
|
249
|
+
components: [{name: 'DropdownMenuItem'}],
|
|
113
250
|
usage: {
|
|
114
|
-
|
|
251
|
+
anatomy,
|
|
252
|
+
description:
|
|
253
|
+
'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
254
|
bestPractices: [
|
|
116
|
-
{
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
255
|
+
{
|
|
256
|
+
guidance: true,
|
|
257
|
+
description:
|
|
258
|
+
'Keep menu items concise and action-oriented so users can scan options quickly.',
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
guidance: true,
|
|
262
|
+
description:
|
|
263
|
+
'Use sections and dividers to group related actions when the menu has many items.',
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
guidance: true,
|
|
267
|
+
description:
|
|
268
|
+
'For a short, flat action set, use presentation="bottom-sheet" when product policy calls for a modal touch surface.',
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
guidance: true,
|
|
272
|
+
description:
|
|
273
|
+
'Use presentation="adaptive" when the same short action set should remain anchored on pointer layouts and become a BottomSheet on compact coarse-pointer layouts.',
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
guidance: true,
|
|
277
|
+
description:
|
|
278
|
+
'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.',
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
guidance: true,
|
|
282
|
+
description:
|
|
283
|
+
'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.',
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
guidance: true,
|
|
287
|
+
description:
|
|
288
|
+
'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.',
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
guidance: false,
|
|
292
|
+
description:
|
|
293
|
+
'Use a DropdownMenu for navigation; use a navigation component instead.',
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
guidance: false,
|
|
297
|
+
description:
|
|
298
|
+
'Place more than 10–12 items in a single menu without grouping them into sections.',
|
|
299
|
+
},
|
|
120
300
|
],
|
|
121
301
|
},
|
|
122
302
|
};
|
|
@@ -124,12 +304,54 @@ export const docs = {
|
|
|
124
304
|
/** @type {import('@astryxdesign/cli/authoring').ComponentTranslationDoc} */
|
|
125
305
|
export const docsZh = {
|
|
126
306
|
usage: {
|
|
127
|
-
description:
|
|
307
|
+
description:
|
|
308
|
+
'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
309
|
bestPractices: [
|
|
129
|
-
{
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
310
|
+
{
|
|
311
|
+
guidance: true,
|
|
312
|
+
description:
|
|
313
|
+
'Keep menu items concise and action-oriented so users can scan options quickly.',
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
guidance: true,
|
|
317
|
+
description:
|
|
318
|
+
'Use sections and dividers to group related actions when the menu has many items.',
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
guidance: true,
|
|
322
|
+
description:
|
|
323
|
+
'For a short, flat action set, use presentation="bottom-sheet" when product policy calls for a modal touch surface.',
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
guidance: true,
|
|
327
|
+
description:
|
|
328
|
+
'Use presentation="adaptive" when the same short action set should remain anchored on pointer layouts and become a BottomSheet on compact coarse-pointer layouts.',
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
guidance: true,
|
|
332
|
+
description:
|
|
333
|
+
'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.',
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
guidance: true,
|
|
337
|
+
description:
|
|
338
|
+
'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.',
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
guidance: true,
|
|
342
|
+
description:
|
|
343
|
+
'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.',
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
guidance: false,
|
|
347
|
+
description:
|
|
348
|
+
'Use a DropdownMenu for navigation; use a navigation component instead.',
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
guidance: false,
|
|
352
|
+
description:
|
|
353
|
+
'Place more than 10–12 items in a single menu without grouping them into sections.',
|
|
354
|
+
},
|
|
133
355
|
],
|
|
134
356
|
},
|
|
135
357
|
};
|
|
@@ -138,12 +360,55 @@ export const docsZh = {
|
|
|
138
360
|
export const docsDense = {
|
|
139
361
|
description: 'dropdown menu for actionable items in popup',
|
|
140
362
|
usage: {
|
|
141
|
-
|
|
363
|
+
anatomy,
|
|
364
|
+
description:
|
|
365
|
+
'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
366
|
bestPractices: [
|
|
143
|
-
{
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
367
|
+
{
|
|
368
|
+
guidance: true,
|
|
369
|
+
description:
|
|
370
|
+
'Keep menu items concise and action-oriented so users can scan options quickly.',
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
guidance: true,
|
|
374
|
+
description:
|
|
375
|
+
'Use sections and dividers to group related actions when the menu has many items.',
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
guidance: true,
|
|
379
|
+
description:
|
|
380
|
+
'For a short, flat action set, use presentation="bottom-sheet" when product policy calls for a modal touch surface.',
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
guidance: true,
|
|
384
|
+
description:
|
|
385
|
+
'Use presentation="adaptive" when the same short action set should remain anchored on pointer layouts and become a BottomSheet on compact coarse-pointer layouts.',
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
guidance: true,
|
|
389
|
+
description:
|
|
390
|
+
'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.',
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
guidance: true,
|
|
394
|
+
description:
|
|
395
|
+
'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.',
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
guidance: true,
|
|
399
|
+
description:
|
|
400
|
+
'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.',
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
guidance: false,
|
|
404
|
+
description:
|
|
405
|
+
'Use a DropdownMenu for navigation; use a navigation component instead.',
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
guidance: false,
|
|
409
|
+
description:
|
|
410
|
+
'Place more than 10–12 items in a single menu without grouping them into sections.',
|
|
411
|
+
},
|
|
147
412
|
],
|
|
148
413
|
},
|
|
149
414
|
};
|