@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.
Files changed (216) hide show
  1. package/dist/BottomSheet/BottomSheet.d.ts +3 -1
  2. package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
  3. package/dist/BottomSheet/BottomSheet.js +4 -3
  4. package/dist/BottomSheet/BottomSheetEdgeTint.d.ts +2 -2
  5. package/dist/BottomSheet/BottomSheetEdgeTint.d.ts.map +1 -1
  6. package/dist/BottomSheet/BottomSheetEdgeTint.js +7 -10
  7. package/dist/BottomSheet/BottomSheetSwitcher.d.ts.map +1 -1
  8. package/dist/BottomSheet/BottomSheetSwitcher.js +1 -1
  9. package/dist/Button/Button.d.ts +2 -1
  10. package/dist/Button/Button.d.ts.map +1 -1
  11. package/dist/Button/Button.js +11 -4
  12. package/dist/Carousel/Carousel.d.ts.map +1 -1
  13. package/dist/Carousel/Carousel.js +2 -2
  14. package/dist/Chat/ChatToolCalls.d.ts.map +1 -1
  15. package/dist/Chat/ChatToolCalls.js +34 -17
  16. package/dist/ContextMenu/ContextMenu.d.ts +14 -3
  17. package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
  18. package/dist/ContextMenu/ContextMenu.js +149 -26
  19. package/dist/ContextMenu/index.d.ts +1 -0
  20. package/dist/ContextMenu/index.d.ts.map +1 -1
  21. package/dist/DropdownMenu/DropdownMenu.d.ts +24 -5
  22. package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
  23. package/dist/DropdownMenu/DropdownMenu.js +340 -26
  24. package/dist/DropdownMenu/DropdownMenuContext.d.ts +1 -1
  25. package/dist/DropdownMenu/DropdownMenuContext.d.ts.map +1 -1
  26. package/dist/DropdownMenu/DropdownMenuItem.d.ts.map +1 -1
  27. package/dist/DropdownMenu/DropdownMenuItem.js +1 -1
  28. package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts +6 -2
  29. package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -1
  30. package/dist/DropdownMenu/DropdownMenuSubMenu.js +43 -14
  31. package/dist/DropdownMenu/MenuBottomSheet.d.ts +20 -0
  32. package/dist/DropdownMenu/MenuBottomSheet.d.ts.map +1 -0
  33. package/dist/DropdownMenu/MenuBottomSheet.js +36 -0
  34. package/dist/DropdownMenu/MenuBottomSheetActionList.d.ts +10 -0
  35. package/dist/DropdownMenu/MenuBottomSheetActionList.d.ts.map +1 -0
  36. package/dist/DropdownMenu/MenuBottomSheetActionList.js +111 -0
  37. package/dist/DropdownMenu/index.d.ts +2 -1
  38. package/dist/DropdownMenu/index.d.ts.map +1 -1
  39. package/dist/DropdownMenu/menuWidth.d.ts +14 -0
  40. package/dist/DropdownMenu/menuWidth.d.ts.map +1 -0
  41. package/dist/DropdownMenu/menuWidth.js +35 -0
  42. package/dist/DropdownMenu/useMenuOverflow.d.ts +10 -0
  43. package/dist/DropdownMenu/useMenuOverflow.d.ts.map +1 -0
  44. package/dist/DropdownMenu/useMenuOverflow.js +60 -0
  45. package/dist/MoreMenu/MoreMenu.d.ts +8 -2
  46. package/dist/MoreMenu/MoreMenu.d.ts.map +1 -1
  47. package/dist/MoreMenu/MoreMenu.js +2 -0
  48. package/dist/MultiSelector/MultiSelector.d.ts +11 -1
  49. package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
  50. package/dist/MultiSelector/MultiSelector.js +97 -68
  51. package/dist/MultiSelector/index.d.ts +1 -1
  52. package/dist/MultiSelector/index.d.ts.map +1 -1
  53. package/dist/Popover/Popover.d.ts +10 -6
  54. package/dist/Popover/Popover.d.ts.map +1 -1
  55. package/dist/Popover/Popover.js +141 -16
  56. package/dist/Popover/usePopover.d.ts +4 -0
  57. package/dist/Popover/usePopover.d.ts.map +1 -1
  58. package/dist/Popover/usePopover.js +52 -5
  59. package/dist/Selector/Selector.d.ts +10 -0
  60. package/dist/Selector/Selector.d.ts.map +1 -1
  61. package/dist/Selector/Selector.js +106 -80
  62. package/dist/Selector/SelectorBottomSheet.d.ts +21 -0
  63. package/dist/Selector/SelectorBottomSheet.d.ts.map +1 -0
  64. package/dist/Selector/SelectorBottomSheet.js +83 -0
  65. package/dist/Selector/index.d.ts +1 -1
  66. package/dist/Selector/index.d.ts.map +1 -1
  67. package/dist/Selector/selectorPresentation.stylex.d.ts +16 -0
  68. package/dist/Selector/selectorPresentation.stylex.d.ts.map +1 -0
  69. package/dist/Selector/selectorPresentation.stylex.js +21 -0
  70. package/dist/Selector/useSelectorPresentation.d.ts +32 -0
  71. package/dist/Selector/useSelectorPresentation.d.ts.map +1 -0
  72. package/dist/Selector/useSelectorPresentation.js +90 -0
  73. package/dist/Toast/useToastGesture.d.ts.map +1 -1
  74. package/dist/Toast/useToastGesture.js +46 -9
  75. package/dist/astryx.css +19 -1
  76. package/dist/hooks/useAdaptivePresentation.d.ts +5 -0
  77. package/dist/hooks/useAdaptivePresentation.d.ts.map +1 -0
  78. package/dist/hooks/useAdaptivePresentation.js +19 -0
  79. package/dist/hooks/useFocusReturnVisibility.d.ts +7 -0
  80. package/dist/hooks/useFocusReturnVisibility.d.ts.map +1 -0
  81. package/dist/hooks/useFocusReturnVisibility.js +35 -0
  82. package/dist/hooks/useFocusTrap.d.ts.map +1 -1
  83. package/dist/hooks/useFocusTrap.js +12 -0
  84. package/locales/en.json +20 -0
  85. package/locales/pseudo.json +15 -0
  86. package/package.json +2 -2
  87. package/src/BottomSheet/BottomSheet.doc.mjs +37 -0
  88. package/src/BottomSheet/BottomSheet.spec.md +177 -0
  89. package/src/BottomSheet/BottomSheet.test.tsx +29 -0
  90. package/src/BottomSheet/BottomSheet.tsx +7 -4
  91. package/src/BottomSheet/BottomSheetEdgeTint.test.tsx +4 -6
  92. package/src/BottomSheet/BottomSheetEdgeTint.tsx +7 -10
  93. package/src/BottomSheet/BottomSheetSwitcher.tsx +1 -2
  94. package/src/Button/Button.doc.mjs +56 -0
  95. package/src/Button/Button.test.tsx +10 -0
  96. package/src/Button/Button.tsx +13 -5
  97. package/src/ButtonGroup/ButtonGroup.doc.mjs +47 -0
  98. package/src/Carousel/Carousel.test.tsx +83 -0
  99. package/src/Carousel/Carousel.tsx +8 -2
  100. package/src/Chat/ChatToolCalls.test.tsx +44 -0
  101. package/src/Chat/ChatToolCalls.tsx +36 -15
  102. package/src/CheckboxList/CheckboxList.doc.mjs +172 -31
  103. package/src/CheckboxList/CheckboxList.spec.md +214 -0
  104. package/src/CommandPalette/CommandPalette.doc.mjs +72 -0
  105. package/src/CommandPalette/CommandPalette.spec.md +223 -0
  106. package/src/ComplexSelector/ComplexSelector.doc.mjs +42 -0
  107. package/src/ComplexSelector/ComplexSelector.spec.md +189 -0
  108. package/src/ContextMenu/ContextMenu.doc.mjs +61 -1
  109. package/src/ContextMenu/ContextMenu.spec.md +206 -0
  110. package/src/ContextMenu/ContextMenu.test.tsx +131 -1
  111. package/src/ContextMenu/ContextMenu.tsx +199 -32
  112. package/src/ContextMenu/index.ts +1 -0
  113. package/src/Divider/Divider.doc.mjs +24 -0
  114. package/src/Divider/Divider.spec.md +150 -0
  115. package/src/DropdownMenu/DropdownMenu.doc.mjs +305 -40
  116. package/src/DropdownMenu/DropdownMenu.spec.md +245 -0
  117. package/src/DropdownMenu/DropdownMenu.test.tsx +518 -7
  118. package/src/DropdownMenu/DropdownMenu.tsx +459 -28
  119. package/src/DropdownMenu/DropdownMenuContext.tsx +1 -1
  120. package/src/DropdownMenu/DropdownMenuItem.tsx +2 -0
  121. package/src/DropdownMenu/DropdownMenuSubMenu.doc.mjs +4 -2
  122. package/src/DropdownMenu/DropdownMenuSubMenu.test.tsx +124 -0
  123. package/src/DropdownMenu/DropdownMenuSubMenu.tsx +72 -17
  124. package/src/DropdownMenu/MenuBottomSheet.tsx +46 -0
  125. package/src/DropdownMenu/MenuBottomSheetActionList.tsx +141 -0
  126. package/src/DropdownMenu/index.ts +2 -0
  127. package/src/DropdownMenu/menuWidth.ts +51 -0
  128. package/src/DropdownMenu/useMenuOverflow.ts +77 -0
  129. package/src/FieldStatus/FieldStatus.doc.mjs +21 -0
  130. package/src/FieldStatus/FieldStatus.spec.md +212 -0
  131. package/src/Grid/Grid.doc.mjs +19 -0
  132. package/src/Grid/Grid.spec.md +161 -0
  133. package/src/Icon/Icon.doc.mjs +196 -48
  134. package/src/Icon/Icon.spec.md +191 -0
  135. package/src/IconButton/IconButton.doc.mjs +38 -0
  136. package/src/Kbd/Kbd.doc.mjs +18 -0
  137. package/src/Kbd/Kbd.spec.md +141 -0
  138. package/src/Layout/Layout.doc.mjs +32 -0
  139. package/src/Layout/Layout.spec.md +199 -0
  140. package/src/Lightbox/Lightbox.doc.mjs +149 -33
  141. package/src/Lightbox/Lightbox.spec.md +197 -0
  142. package/src/Markdown/Markdown.doc.mjs +60 -0
  143. package/src/Markdown/Markdown.spec.md +200 -0
  144. package/src/MobileNav/MobileNav.doc.mjs +140 -32
  145. package/src/MobileNav/MobileNav.spec.md +208 -0
  146. package/src/MoreMenu/MoreMenu.doc.mjs +59 -0
  147. package/src/MoreMenu/MoreMenu.spec.md +221 -0
  148. package/src/MoreMenu/MoreMenu.test.tsx +47 -0
  149. package/src/MoreMenu/MoreMenu.tsx +13 -1
  150. package/src/MultiSelector/MultiSelector.doc.mjs +128 -0
  151. package/src/MultiSelector/MultiSelector.spec.md +266 -0
  152. package/src/MultiSelector/MultiSelector.test.tsx +127 -0
  153. package/src/MultiSelector/MultiSelector.tsx +121 -73
  154. package/src/MultiSelector/index.ts +1 -0
  155. package/src/NavIcon/NavIcon.doc.mjs +17 -0
  156. package/src/NavIcon/NavIcon.spec.md +133 -0
  157. package/src/NavMenu/NavHeadingMenu.spec.md +205 -0
  158. package/src/NavMenu/NavMenu.doc.mjs +37 -0
  159. package/src/Outline/Outline.doc.mjs +35 -0
  160. package/src/Outline/Outline.spec.md +161 -0
  161. package/src/OverflowList/OverflowList.doc.mjs +24 -0
  162. package/src/OverflowList/OverflowList.spec.md +156 -0
  163. package/src/Pagination/Pagination.doc.mjs +74 -0
  164. package/src/Pagination/Pagination.spec.md +225 -0
  165. package/src/Popover/Popover.doc.mjs +11 -11
  166. package/src/Popover/Popover.test.tsx +397 -2
  167. package/src/Popover/Popover.tsx +228 -21
  168. package/src/Popover/usePopover.tsx +92 -15
  169. package/src/ProgressBar/ProgressBar.doc.mjs +198 -38
  170. package/src/ProgressBar/ProgressBar.spec.md +260 -0
  171. package/src/Resizable/Resizable.doc.mjs +59 -16
  172. package/src/Resizable/Resizable.spec.md +194 -0
  173. package/src/Section/Section.doc.mjs +17 -0
  174. package/src/Section/Section.spec.md +138 -0
  175. package/src/SegmentedControl/SegmentedControl.doc.mjs +83 -0
  176. package/src/SegmentedControl/SegmentedControl.spec.md +151 -0
  177. package/src/Selector/Selector.doc.mjs +12 -0
  178. package/src/Selector/Selector.spec.md +202 -0
  179. package/src/Selector/Selector.test.tsx +135 -0
  180. package/src/Selector/Selector.tsx +141 -82
  181. package/src/Selector/SelectorBottomSheet.tsx +97 -0
  182. package/src/Selector/index.ts +1 -0
  183. package/src/Selector/selectorPresentation.stylex.ts +20 -0
  184. package/src/Selector/useSelectorPresentation.ts +147 -0
  185. package/src/Skeleton/Skeleton.doc.mjs +12 -0
  186. package/src/Skeleton/Skeleton.spec.md +126 -0
  187. package/src/Slider/Slider.doc.mjs +184 -30
  188. package/src/Slider/Slider.spec.md +223 -0
  189. package/src/Stack/Stack.doc.mjs +22 -0
  190. package/src/Stack/Stack.spec.md +154 -0
  191. package/src/StatusDot/StatusDot.doc.mjs +17 -0
  192. package/src/StatusDot/StatusDot.spec.md +137 -0
  193. package/src/Switch/Switch.doc.mjs +40 -0
  194. package/src/Switch/Switch.spec.md +174 -0
  195. package/src/Table/Table.doc.mjs +102 -24
  196. package/src/Table/Table.spec.md +283 -0
  197. package/src/Text/Text.doc.mjs +190 -43
  198. package/src/Text/Text.spec.md +205 -0
  199. package/src/TextArea/TextArea.doc.mjs +255 -45
  200. package/src/TextArea/TextArea.spec.md +204 -0
  201. package/src/Toast/ToastViewport.test.tsx +118 -4
  202. package/src/Toast/useToastGesture.ts +61 -8
  203. package/src/ToggleButton/ToggleButton.doc.mjs +56 -0
  204. package/src/Toolbar/Toolbar.doc.mjs +19 -0
  205. package/src/Toolbar/Toolbar.spec.md +173 -0
  206. package/src/Tooltip/Tooltip.doc.mjs +17 -0
  207. package/src/Tooltip/Tooltip.spec.md +141 -0
  208. package/src/TreeList/TreeList.doc.mjs +58 -0
  209. package/src/TreeList/TreeList.spec.md +220 -0
  210. package/src/Typeahead/Typeahead.doc.mjs +83 -1
  211. package/src/Typeahead/Typeahead.spec.md +250 -0
  212. package/src/hooks/useAdaptivePresentation.ts +35 -0
  213. package/src/hooks/useFocusReturnVisibility.ts +45 -0
  214. package/src/hooks/useFocusTrap.test.tsx +40 -0
  215. package/src/hooks/useFocusTrap.ts +13 -0
  216. 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: ["dropdown","menu","popover","select","actions","contextmenu","overflow","kebab","menubutton"],
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: 'Delete'},
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
- {className: 'astryx-dropdown-menu'},
27
- {className: 'astryx-dropdown-menu-item', visualProps: ['size', 'variant']},
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
- {name: '--_dropdown-menu-radius', description: 'Border radius of the menu popup', default: 'var(--radius-element)', private: true},
39
- {name: '--_dropdown-menu-padding', description: 'Inner padding of the menu popup', default: 'var(--spacing-1)', private: true},
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: 'Main dropdown menu component with a trigger button and popup item list.',
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: 'Props for the trigger button (Button props except onClick).',
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: '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]}`.',
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: 'Custom menu width; defaults to matching the trigger button width.',
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: "Position placement relative to the trigger. Logical: start/end resolve against the menu's own inherited direction (RTL mirrors).",
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: "Alignment along the placement axis. Logical: start/end follow the menu's own inherited direction (RTL mirrors).",
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: 'Whether to show a chevron icon on the trigger button. Set to false for icon-only triggers.',
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
- description: '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.',
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
- { guidance: true, description: 'Keep menu items concise and action-oriented so users can scan options quickly.' },
117
- { guidance: true, description: 'Use sections and dividers to group related actions when the menu has many items.' },
118
- { guidance: false, description: 'Use a DropdownMenu for navigation; use a navigation component instead.' },
119
- { guidance: false, description: 'Place more than 10–12 items in a single menu without grouping them into sections.' },
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: '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.',
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
- { guidance: true, description: 'Keep menu items concise and action-oriented so users can scan options quickly.' },
130
- { guidance: true, description: 'Use sections and dividers to group related actions when the menu has many items.' },
131
- { guidance: false, description: 'Use a DropdownMenu for navigation; use a navigation component instead.' },
132
- { guidance: false, description: 'Place more than 10–12 items in a single menu without grouping them into sections.' },
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
- description: '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.',
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
- { guidance: true, description: 'Keep menu items concise and action-oriented so users can scan options quickly.' },
144
- { guidance: true, description: 'Use sections and dividers to group related actions when the menu has many items.' },
145
- { guidance: false, description: 'Use a DropdownMenu for navigation; use a navigation component instead.' },
146
- { guidance: false, description: 'Place more than 10–12 items in a single menu without grouping them into sections.' },
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
  };