@astryxdesign/core 0.3.0-canary.e9fc2bb → 0.3.0-canary.ee705d8

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 (333) hide show
  1. package/dist/AlertDialog/AlertDialog.d.ts +10 -2
  2. package/dist/AlertDialog/AlertDialog.d.ts.map +1 -1
  3. package/dist/AlertDialog/AlertDialog.js +22 -3
  4. package/dist/Avatar/Avatar.d.ts.map +1 -1
  5. package/dist/Avatar/Avatar.js +2 -10
  6. package/dist/AvatarGroup/AvatarGroupOverflow.d.ts.map +1 -1
  7. package/dist/AvatarGroup/AvatarGroupOverflow.js +2 -3
  8. package/dist/Button/Button.d.ts.map +1 -1
  9. package/dist/Button/Button.js +11 -15
  10. package/dist/Calendar/Calendar.d.ts.map +1 -1
  11. package/dist/Calendar/Calendar.js +2 -1
  12. package/dist/Calendar/styles.d.ts +0 -2
  13. package/dist/Calendar/styles.d.ts.map +1 -1
  14. package/dist/Calendar/styles.js +0 -2
  15. package/dist/Chat/ChatDictationButton.d.ts.map +1 -1
  16. package/dist/Chat/ChatDictationButton.js +2 -1
  17. package/dist/Chat/ChatLayoutScrollButton.d.ts.map +1 -1
  18. package/dist/Chat/ChatLayoutScrollButton.js +3 -1
  19. package/dist/Chat/ChatSendButton.d.ts.map +1 -1
  20. package/dist/Chat/ChatSendButton.js +4 -3
  21. package/dist/Chat/ChatToolCalls.d.ts.map +1 -1
  22. package/dist/Chat/ChatToolCalls.js +1 -1
  23. package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
  24. package/dist/CheckboxInput/CheckboxInput.js +36 -125
  25. package/dist/ClickableCard/ClickableCard.d.ts.map +1 -1
  26. package/dist/ClickableCard/ClickableCard.js +3 -11
  27. package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
  28. package/dist/CodeBlock/CodeBlock.js +59 -55
  29. package/dist/Collapsible/Collapsible.d.ts.map +1 -1
  30. package/dist/Collapsible/Collapsible.js +2 -3
  31. package/dist/CommandPalette/CommandPaletteItem.d.ts +1 -1
  32. package/dist/CommandPalette/CommandPaletteItem.d.ts.map +1 -1
  33. package/dist/CommandPalette/CommandPaletteItem.js +6 -3
  34. package/dist/CommandPalette/CommandPaletteList.js +1 -1
  35. package/dist/ComplexSelector/ComplexSelector.d.ts +1 -1
  36. package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
  37. package/dist/ComplexSelector/ComplexSelector.js +12 -8
  38. package/dist/ContextMenu/ContextMenu.js +1 -1
  39. package/dist/Dialog/Dialog.d.ts.map +1 -1
  40. package/dist/Dialog/Dialog.js +4 -4
  41. package/dist/DropdownMenu/DropdownMenu.d.ts +5 -0
  42. package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
  43. package/dist/DropdownMenu/DropdownMenu.js +46 -7
  44. package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts +8 -11
  45. package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +1 -1
  46. package/dist/DropdownMenu/DropdownMenuCheckboxItem.js +32 -31
  47. package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts +5 -5
  48. package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts.map +1 -1
  49. package/dist/DropdownMenu/DropdownMenuRadioItem.js +24 -67
  50. package/dist/EmptyState/EmptyState.js +1 -1
  51. package/dist/Indicator/CheckIndicator.d.ts +26 -0
  52. package/dist/Indicator/CheckIndicator.d.ts.map +1 -0
  53. package/dist/Indicator/CheckIndicator.js +156 -0
  54. package/dist/Indicator/CheckboxIndicator.d.ts +22 -0
  55. package/dist/Indicator/CheckboxIndicator.d.ts.map +1 -0
  56. package/dist/Indicator/CheckboxIndicator.js +173 -0
  57. package/dist/Indicator/RadioIndicator.d.ts +23 -0
  58. package/dist/Indicator/RadioIndicator.d.ts.map +1 -0
  59. package/dist/Indicator/RadioIndicator.js +137 -0
  60. package/dist/Indicator/index.d.ts +24 -0
  61. package/dist/Indicator/index.d.ts.map +1 -0
  62. package/dist/Indicator/index.js +26 -0
  63. package/dist/Indicator/indicator.markers.stylex.d.ts +16 -0
  64. package/dist/Indicator/indicator.markers.stylex.d.ts.map +1 -0
  65. package/dist/Indicator/indicator.markers.stylex.js +21 -0
  66. package/dist/Indicator/indicatorRegistry.d.ts +71 -0
  67. package/dist/Indicator/indicatorRegistry.d.ts.map +1 -0
  68. package/dist/Indicator/indicatorRegistry.js +93 -0
  69. package/dist/Indicator/types.d.ts +160 -0
  70. package/dist/Indicator/types.d.ts.map +1 -0
  71. package/dist/Indicator/types.js +1 -0
  72. package/dist/Indicator/useIndicator.d.ts +18 -0
  73. package/dist/Indicator/useIndicator.d.ts.map +1 -0
  74. package/dist/Indicator/useIndicator.js +30 -0
  75. package/dist/Item/Item.d.ts.map +1 -1
  76. package/dist/Item/Item.js +2 -6
  77. package/dist/Link/Link.d.ts.map +1 -1
  78. package/dist/Link/Link.js +4 -5
  79. package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
  80. package/dist/MultiSelector/MultiSelector.js +20 -9
  81. package/dist/NumberInput/NumberInput.d.ts +10 -1
  82. package/dist/NumberInput/NumberInput.d.ts.map +1 -1
  83. package/dist/NumberInput/NumberInput.js +7 -5
  84. package/dist/Outline/Outline.d.ts.map +1 -1
  85. package/dist/Outline/Outline.js +2 -3
  86. package/dist/Pagination/Pagination.d.ts.map +1 -1
  87. package/dist/Pagination/Pagination.js +30 -26
  88. package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
  89. package/dist/PowerSearch/PowerSearchEditPopover.js +7 -0
  90. package/dist/RadioList/RadioListItem.d.ts.map +1 -1
  91. package/dist/RadioList/RadioListItem.js +29 -84
  92. package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
  93. package/dist/Resizable/ResizeHandle.js +2 -3
  94. package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
  95. package/dist/SegmentedControl/SegmentedControlItem.js +2 -3
  96. package/dist/SelectableCard/SelectableCard.d.ts.map +1 -1
  97. package/dist/SelectableCard/SelectableCard.js +3 -11
  98. package/dist/Selector/Selector.d.ts.map +1 -1
  99. package/dist/Selector/Selector.js +85 -28
  100. package/dist/Selector/hooks.d.ts +14 -2
  101. package/dist/Selector/hooks.d.ts.map +1 -1
  102. package/dist/Selector/hooks.js +19 -21
  103. package/dist/SideNav/SideNav.d.ts.map +1 -1
  104. package/dist/SideNav/SideNav.js +1 -1
  105. package/dist/SideNav/SideNavHeading.d.ts.map +1 -1
  106. package/dist/SideNav/SideNavHeading.js +1 -1
  107. package/dist/Switch/Switch.d.ts.map +1 -1
  108. package/dist/Switch/Switch.js +1 -0
  109. package/dist/TabList/Tab.d.ts.map +1 -1
  110. package/dist/TabList/Tab.js +2 -3
  111. package/dist/TabList/TabMenu.d.ts.map +1 -1
  112. package/dist/TabList/TabMenu.js +27 -11
  113. package/dist/Table/BaseTable.d.ts.map +1 -1
  114. package/dist/Table/BaseTable.js +8 -0
  115. package/dist/Table/index.d.ts +1 -1
  116. package/dist/Table/index.d.ts.map +1 -1
  117. package/dist/Table/index.js +1 -1
  118. package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts +1 -1
  119. package/dist/Table/plugins/groupedRows/useTableGroupedRows.js +1 -1
  120. package/dist/Table/plugins/rowExpansion/index.d.ts +1 -1
  121. package/dist/Table/plugins/rowExpansion/index.d.ts.map +1 -1
  122. package/dist/Table/plugins/rowExpansion/index.js +1 -1
  123. package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts +41 -76
  124. package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
  125. package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +88 -333
  126. package/dist/Table/plugins/sortable/useTableSortable.d.ts.map +1 -1
  127. package/dist/Table/plugins/sortable/useTableSortable.js +23 -4
  128. package/dist/Table/tableContextMenu.d.ts.map +1 -1
  129. package/dist/Table/tableContextMenu.js +2 -1
  130. package/dist/Table/types.d.ts +11 -0
  131. package/dist/Table/types.d.ts.map +1 -1
  132. package/dist/TextArea/TextArea.d.ts +10 -1
  133. package/dist/TextArea/TextArea.d.ts.map +1 -1
  134. package/dist/TextArea/TextArea.js +12 -4
  135. package/dist/TextInput/TextInput.d.ts +10 -1
  136. package/dist/TextInput/TextInput.d.ts.map +1 -1
  137. package/dist/TextInput/TextInput.js +6 -4
  138. package/dist/Thumbnail/Thumbnail.d.ts.map +1 -1
  139. package/dist/Thumbnail/Thumbnail.js +32 -26
  140. package/dist/Timestamp/TimestampHoverCard.d.ts.map +1 -1
  141. package/dist/Timestamp/TimestampHoverCard.js +16 -34
  142. package/dist/Token/Token.d.ts.map +1 -1
  143. package/dist/Token/Token.js +20 -11
  144. package/dist/TopNav/TopNavItem.d.ts.map +1 -1
  145. package/dist/TopNav/TopNavItem.js +3 -9
  146. package/dist/TopNav/TopNavMegaMenu.d.ts +7 -0
  147. package/dist/TopNav/TopNavMegaMenu.d.ts.map +1 -1
  148. package/dist/TopNav/TopNavMegaMenu.js +94 -28
  149. package/dist/TopNav/TopNavMegaMenuItem.d.ts.map +1 -1
  150. package/dist/TopNav/TopNavMegaMenuItem.js +22 -3
  151. package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
  152. package/dist/TopNav/TopNavMenu.js +43 -11
  153. package/dist/TreeList/TreeListItem.d.ts.map +1 -1
  154. package/dist/TreeList/TreeListItem.js +12 -10
  155. package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
  156. package/dist/Typeahead/BaseTypeahead.js +14 -2
  157. package/dist/astryx.css +19 -27
  158. package/dist/astryx.umd.js +55 -55
  159. package/dist/astryx.umd.js.map +4 -4
  160. package/dist/hooks/index.d.ts +3 -0
  161. package/dist/hooks/index.d.ts.map +1 -1
  162. package/dist/hooks/index.js +2 -0
  163. package/dist/hooks/useClipboard.d.ts +59 -0
  164. package/dist/hooks/useClipboard.d.ts.map +1 -0
  165. package/dist/hooks/useClipboard.js +106 -0
  166. package/dist/hooks/useIndicatorFocusRing.d.ts +29 -0
  167. package/dist/hooks/useIndicatorFocusRing.d.ts.map +1 -0
  168. package/dist/hooks/useIndicatorFocusRing.js +97 -0
  169. package/dist/hooks/useStreamingText.d.ts +18 -3
  170. package/dist/hooks/useStreamingText.d.ts.map +1 -1
  171. package/dist/hooks/useStreamingText.js +47 -7
  172. package/dist/hooks/useTreeFocus.d.ts.map +1 -1
  173. package/dist/hooks/useTreeFocus.js +9 -3
  174. package/dist/hooks/useTypeahead.d.ts +3 -2
  175. package/dist/hooks/useTypeahead.d.ts.map +1 -1
  176. package/dist/hooks/useTypeahead.js +19 -7
  177. package/dist/index.d.ts +1 -0
  178. package/dist/index.d.ts.map +1 -1
  179. package/dist/index.js +1 -0
  180. package/dist/theme/defineTheme.d.ts +16 -0
  181. package/dist/theme/defineTheme.d.ts.map +1 -1
  182. package/dist/theme/defineTheme.js +8 -0
  183. package/dist/theme/expandTypeScale.d.ts.map +1 -1
  184. package/dist/theme/expandTypeScale.js +17 -0
  185. package/dist/theme/index.d.ts +1 -0
  186. package/dist/theme/index.d.ts.map +1 -1
  187. package/dist/utils/focusOutline.stylex.d.ts +107 -0
  188. package/dist/utils/focusOutline.stylex.d.ts.map +1 -0
  189. package/dist/utils/focusOutline.stylex.js +130 -0
  190. package/dist/utils/themeProps.d.ts +20 -1
  191. package/dist/utils/themeProps.d.ts.map +1 -1
  192. package/dist/utils/themeProps.js +8 -2
  193. package/package.json +7 -2
  194. package/src/AlertDialog/AlertDialog.doc.mjs +16 -3
  195. package/src/AlertDialog/AlertDialog.test.tsx +208 -1
  196. package/src/AlertDialog/AlertDialog.tsx +21 -3
  197. package/src/Avatar/Avatar.tsx +2 -28
  198. package/src/AvatarGroup/AvatarGroupOverflow.tsx +2 -9
  199. package/src/Button/Button.tsx +21 -41
  200. package/src/Calendar/Calendar.tsx +2 -1
  201. package/src/Calendar/styles.ts +0 -8
  202. package/src/Chat/Chat.doc.mjs +2 -0
  203. package/src/Chat/ChatDictationButton.tsx +7 -1
  204. package/src/Chat/ChatLayoutScrollButton.test.tsx +22 -0
  205. package/src/Chat/ChatLayoutScrollButton.tsx +8 -1
  206. package/src/Chat/ChatSendButton.tsx +2 -3
  207. package/src/Chat/ChatToolCalls.test.tsx +35 -0
  208. package/src/Chat/ChatToolCalls.tsx +12 -0
  209. package/src/CheckboxInput/CheckboxInput.doc.mjs +4 -2
  210. package/src/CheckboxInput/CheckboxInput.test.tsx +115 -0
  211. package/src/CheckboxInput/CheckboxInput.tsx +45 -202
  212. package/src/ClickableCard/ClickableCard.tsx +6 -11
  213. package/src/CodeBlock/CodeBlock.doc.mjs +1 -0
  214. package/src/CodeBlock/CodeBlock.test.tsx +24 -0
  215. package/src/CodeBlock/CodeBlock.tsx +32 -70
  216. package/src/Collapsible/Collapsible.tsx +2 -9
  217. package/src/CommandPalette/CommandPalette.test.tsx +29 -0
  218. package/src/CommandPalette/CommandPaletteItem.tsx +7 -4
  219. package/src/CommandPalette/CommandPaletteList.tsx +2 -2
  220. package/src/ComplexSelector/ComplexSelector.test.tsx +25 -0
  221. package/src/ComplexSelector/ComplexSelector.tsx +17 -9
  222. package/src/ContextMenu/ContextMenu.tsx +1 -1
  223. package/src/DateInput/DateInput.doc.mjs +1 -1
  224. package/src/DateRangeInput/DateRangeInput.doc.mjs +1 -1
  225. package/src/DateTimeInput/DateTimeInput.doc.mjs +1 -1
  226. package/src/Dialog/Dialog.tsx +2 -9
  227. package/src/DropdownMenu/DropdownMenu.doc.mjs +0 -5
  228. package/src/DropdownMenu/DropdownMenu.test.tsx +214 -4
  229. package/src/DropdownMenu/DropdownMenu.tsx +74 -30
  230. package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +27 -30
  231. package/src/DropdownMenu/DropdownMenuRadioItem.tsx +30 -76
  232. package/src/DropdownMenu/DropdownMenuSelectable.test.tsx +25 -19
  233. package/src/DropdownMenu/DropdownMenuSubMenu.test.tsx +44 -14
  234. package/src/EmptyState/EmptyState.tsx +2 -2
  235. package/src/Indicator/CheckIndicator.tsx +175 -0
  236. package/src/Indicator/CheckboxIndicator.tsx +257 -0
  237. package/src/Indicator/Indicator.doc.mjs +287 -0
  238. package/src/Indicator/Indicator.test.tsx +369 -0
  239. package/src/Indicator/RadioIndicator.tsx +206 -0
  240. package/src/Indicator/index.ts +45 -0
  241. package/src/Indicator/indicator.markers.stylex.ts +19 -0
  242. package/src/Indicator/indicatorRegistry.test.tsx +106 -0
  243. package/src/Indicator/indicatorRegistry.ts +120 -0
  244. package/src/Indicator/types.ts +179 -0
  245. package/src/Indicator/useIndicator.ts +39 -0
  246. package/src/Item/Item.tsx +2 -12
  247. package/src/Link/Link.tsx +4 -11
  248. package/src/MoreMenu/MoreMenu.test.tsx +28 -1
  249. package/src/MultiSelector/MultiSelector.doc.mjs +6 -0
  250. package/src/MultiSelector/MultiSelector.test.tsx +172 -0
  251. package/src/MultiSelector/MultiSelector.tsx +67 -54
  252. package/src/NumberInput/NumberInput.doc.mjs +18 -2
  253. package/src/NumberInput/NumberInput.test.tsx +112 -0
  254. package/src/NumberInput/NumberInput.tsx +15 -4
  255. package/src/Outline/Outline.tsx +2 -5
  256. package/src/Pagination/Pagination.tsx +2 -9
  257. package/src/PowerSearch/PowerSearchEditPopover.test.tsx +42 -0
  258. package/src/PowerSearch/PowerSearchEditPopover.tsx +7 -0
  259. package/src/ProgressBar/ProgressBar.doc.mjs +1 -1
  260. package/src/RadioList/RadioList.doc.mjs +4 -2
  261. package/src/RadioList/RadioListItem.tsx +31 -130
  262. package/src/Resizable/ResizeHandle.tsx +2 -9
  263. package/src/SegmentedControl/SegmentedControlItem.tsx +2 -9
  264. package/src/SelectableCard/SelectableCard.tsx +4 -9
  265. package/src/Selector/Selector.doc.mjs +4 -3
  266. package/src/Selector/Selector.test.tsx +650 -4
  267. package/src/Selector/Selector.tsx +140 -68
  268. package/src/Selector/hooks.ts +32 -29
  269. package/src/SideNav/SideNav.test.tsx +46 -0
  270. package/src/SideNav/SideNav.tsx +1 -0
  271. package/src/SideNav/SideNavHeading.tsx +5 -1
  272. package/src/Switch/Switch.test.tsx +32 -0
  273. package/src/Switch/Switch.tsx +1 -0
  274. package/src/TabList/Tab.tsx +2 -9
  275. package/src/TabList/TabMenu.tsx +3 -14
  276. package/src/Table/BaseTable.tsx +11 -0
  277. package/src/Table/index.ts +1 -4
  278. package/src/Table/plugins/groupedRows/useTableGroupedRows.tsx +1 -1
  279. package/src/Table/plugins/rowExpansion/index.ts +1 -4
  280. package/src/Table/plugins/rowExpansion/useTableRowExpansion.test.tsx +125 -175
  281. package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +112 -474
  282. package/src/Table/plugins/sortable/useTableSortable.tsx +2 -6
  283. package/src/Table/tableContextMenu.test.tsx +27 -0
  284. package/src/Table/tableContextMenu.tsx +1 -0
  285. package/src/Table/types.ts +11 -0
  286. package/src/Table/useTableGroupedRows.doc.mjs +1 -1
  287. package/src/Table/useTableRowExpansion.doc.mjs +43 -66
  288. package/src/TextArea/TextArea.doc.mjs +18 -2
  289. package/src/TextArea/TextArea.test.tsx +145 -0
  290. package/src/TextArea/TextArea.tsx +20 -4
  291. package/src/TextInput/TextInput.doc.mjs +18 -2
  292. package/src/TextInput/TextInput.test.tsx +112 -0
  293. package/src/TextInput/TextInput.tsx +14 -3
  294. package/src/Thumbnail/Thumbnail.tsx +2 -9
  295. package/src/Timestamp/TimestampHoverCard.tsx +13 -35
  296. package/src/Token/Token.tsx +5 -28
  297. package/src/TopNav/TopNavItem.tsx +3 -21
  298. package/src/TopNav/TopNavMegaMenu.test.tsx +433 -33
  299. package/src/TopNav/TopNavMegaMenu.tsx +88 -33
  300. package/src/TopNav/TopNavMegaMenuItem.tsx +2 -9
  301. package/src/TopNav/TopNavMenu.tsx +6 -18
  302. package/src/TreeList/TreeList.test.tsx +7 -7
  303. package/src/TreeList/TreeListItem.tsx +18 -33
  304. package/src/Typeahead/BaseTypeahead.tsx +17 -1
  305. package/src/Typeahead/Typeahead.doc.mjs +1 -0
  306. package/src/Typeahead/Typeahead.test.tsx +76 -3
  307. package/src/hooks/index.ts +4 -0
  308. package/src/hooks/useClipboard.doc.mjs +86 -0
  309. package/src/hooks/useClipboard.test.tsx +151 -0
  310. package/src/hooks/useClipboard.ts +135 -0
  311. package/src/hooks/useIndicatorFocusRing.tsx +121 -0
  312. package/src/hooks/useStreamingText.test.ts +46 -1
  313. package/src/hooks/useStreamingText.ts +49 -7
  314. package/src/hooks/useTreeFocus.test.tsx +50 -0
  315. package/src/hooks/useTreeFocus.ts +14 -3
  316. package/src/hooks/useTypeahead.test.tsx +150 -0
  317. package/src/hooks/useTypeahead.ts +24 -9
  318. package/src/i18n/InternationalizationProvider.doc.mjs +7 -2
  319. package/src/index.ts +1 -0
  320. package/src/theme/defineTheme.ts +24 -0
  321. package/src/theme/expandTypeScale.test.ts +43 -0
  322. package/src/theme/expandTypeScale.ts +17 -0
  323. package/src/theme/index.ts +13 -0
  324. package/src/utils/focusOutline.stylex.ts +163 -0
  325. package/src/utils/themeProps.ts +26 -4
  326. package/dist/CheckboxInput/checkbox.markers.stylex.d.ts +0 -9
  327. package/dist/CheckboxInput/checkbox.markers.stylex.d.ts.map +0 -1
  328. package/dist/CheckboxInput/checkbox.markers.stylex.js +0 -14
  329. package/dist/RadioList/radio.markers.stylex.d.ts +0 -7
  330. package/dist/RadioList/radio.markers.stylex.d.ts.map +0 -1
  331. package/dist/RadioList/radio.markers.stylex.js +0 -12
  332. package/src/CheckboxInput/checkbox.markers.stylex.ts +0 -12
  333. package/src/RadioList/radio.markers.stylex.ts +0 -10
@@ -337,9 +337,9 @@ export function ContextMenu({
337
337
  return /*#__PURE__*/_jsxs(_Fragment, {
338
338
  children: [/*#__PURE__*/_jsxs("div", {
339
339
  ref: mergeRefs(ref, triggerRef),
340
+ ...triggerProps,
340
341
  onContextMenu: handleContextMenu,
341
342
  ...longPressHandlers,
342
- ...triggerProps,
343
343
  "data-testid": testId,
344
344
  ...stylex.props(styles.trigger, ...(triggerXstyle ? Array.isArray(triggerXstyle) ? triggerXstyle : [triggerXstyle] : [])),
345
345
  children: [children, /*#__PURE__*/_jsx("span", {
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/Dialog/Dialog.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAoB5C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAKhD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,SAAS,CAAC;AAqB9C;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,gBAAgB,CAAC;AAEnD;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;AAEzD,4EAA4E;AAC5E,UAAU,mBAAmB;IAC3B,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1B;AAED;;;;;GAKG;AACH,MAAM,WAAW,cAAe,SAAQ,mBAAmB;IACzD,6EAA6E;IAC7E,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,yEAAyE;IACzE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB;AA+HD;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,cAAc;;;;;EAUpE;AAED,MAAM,WAAW,WAAY,SAAQ,SAAS,CAAC,iBAAiB,CAAC;IAC/D,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACnC;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;;;OAOG;IACH,YAAY,EAAE,C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ACX,SAAkB,EAClB,QAAQ,EACR,OAAoB,EACpB,OAAgB,EAChB,OAAO,EACP,QAAQ,EACR,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,WAAW,sCA2Sb;yBA3Te,MAAM"}
@@ -27,12 +27,14 @@ import { mergeProps, mergeRefs } from "../utils/index.js";
27
27
  import { devWarn } from "../utils/devWarning.js";
28
28
  import { DialogContext } from "./DialogContext.js";
29
29
  import { themeProps } from "../utils/themeProps.js";
30
- import { jsx as _jsx } from "react/jsx-runtime";
30
+ import { focusOutlineProps } from "../utils/focusOutline.stylex.js";
31
+
31
32
  /**
32
33
  * Calculate a directional translate offset for dialog entry animation.
33
34
  * Returns a normalized vector from the trigger element toward the viewport
34
35
  * center, scaled to the given distance.
35
36
  */
37
+ import { jsx as _jsx } from "react/jsx-runtime";
36
38
  function getDialogDirection(triggerEl, distance = 16) {
37
39
  const rect = triggerEl.getBoundingClientRect();
38
40
  const dx = rect.left + rect.width / 2 - window.innerWidth / 2;
@@ -91,8 +93,6 @@ const styles = {
91
93
  k44tkh: "xqgcaz",
92
94
  kyAemX: "x128ha8g",
93
95
  kWV6AL: "xskzprw",
94
- kI3sdo: "x17nn4n9",
95
- kInvED: "x1wfwxd8 x7s97pk",
96
96
  $$css: true
97
97
  },
98
98
  open: {
@@ -447,7 +447,7 @@ export function Dialog({
447
447
  ...safeProps,
448
448
  ...mergeProps(themeProps('dialog', {
449
449
  variant
450
- }), stylex.props(styles.dialog, isOpen && styles.open, styles.backdrop, !isFullscreen && dynamicStyles.sizing(width, maxHeight), hasPosition && (() => {
450
+ }), focusOutlineProps.focusVisible(styles.dialog, isOpen && styles.open, styles.backdrop, !isFullscreen && dynamicStyles.sizing(width, maxHeight), hasPosition && (() => {
451
451
  const o = resolveDialogPositionOffsets(position);
452
452
  return dynamicStyles.position(o.top, o.insetInlineStart, o.insetInlineEnd, o.bottom);
453
453
  })(), isFullscreen && styles.fullscreen, xstyle), className, style),
@@ -10,6 +10,11 @@
10
10
  *
11
11
  * Both modes use useListFocus for DOM-based keyboard navigation.
12
12
  *
13
+ * Initial focus on open follows the input modality: a keyboard open
14
+ * (Enter / Space / ArrowDown on the trigger) focuses the first enabled item
15
+ * (APG menu-button); a pointer open focuses the menu container itself so no
16
+ * item reads as pre-selected, and the first ArrowDown then moves to item 1.
17
+ *
13
18
  * SYNC: When modified, update these files to stay in sync:
14
19
  * - /packages/core/src/DropdownMenu/DropdownMenu.doc.mjs
15
20
  * - /packages/core/src/DropdownMenu/DropdownMenu.test.tsx
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownMenu.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenu.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,EAOZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,EAAS,KAAK,WAAW,EAAC,MAAM,WAAW,CAAC;AAInD,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,oBAAoB,CAAC;AAa9D,OAAO,KAAK,EAAC,cAAc,EAAE,cAAc,EAAC,MAAM,mBAAmB,CAAC;AAQtE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAyC5C;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAChD,qBAAqB,EACrB,MAAM,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,CAC9C;IACC;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,KAAK,CAAC,EAAE,kBAAkB,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,oBAAoB,EAAE,CAAC;CAC/B;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AAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAE3B;;;;OAIG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAE3B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,UAAU,qBAAsB,SAAQ,qBAAqB;IAC3D,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAC5B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,UAAU,yBAA0B,SAAQ,qBAAqB;IAC/D,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,MAAM,iBAAiB,GAC3B,qBAAqB,GAAG,yBAAyB,CAAC;AA+BpD,wBAAgB,YAAY,CAAC,EAC3B,MAAM,EAAE,eAAe,EACvB,UAAU,EAAE,gBAAgB,EAC5B,YAAY,EACZ,SAAS,EACT,OAAO,EACP,UAAiB,EACjB,SAAmB,EACnB,SAAmB,EACnB,SAAS,EACT,KAAK,EACL,MAAM,EACN,aAAa,EAAE,MAAM,EACrB,GAAG,KAAK,EACT,EAAE,iBAAiB,qBA+TnB;yBA7Ue,YAAY"}
@@ -14,6 +14,11 @@
14
14
  *
15
15
  * Both modes use useListFocus for DOM-based keyboard navigation.
16
16
  *
17
+ * Initial focus on open follows the input modality: a keyboard open
18
+ * (Enter / Space / ArrowDown on the trigger) focuses the first enabled item
19
+ * (APG menu-button); a pointer open focuses the menu container itself so no
20
+ * item reads as pre-selected, and the first ArrowDown then moves to item 1.
21
+ *
17
22
  * SYNC: When modified, update these files to stay in sync:
18
23
  * - /packages/core/src/DropdownMenu/DropdownMenu.doc.mjs
19
24
  * - /packages/core/src/DropdownMenu/DropdownMenu.test.tsx
@@ -179,6 +184,13 @@ export function DropdownMenu({
179
184
  // Defer item focus until the layer has committed open, so focus restore
180
185
  // captures the trigger instead of the first menu item.
181
186
  const shouldFocusOnOpenRef = useRef(false);
187
+
188
+ // How the next open was initiated. Keyboard (and programmatic) opens focus
189
+ // the first enabled item per the APG menu-button pattern; pointer opens
190
+ // focus the menu container instead, so no item is visually highlighted as
191
+ // if pre-selected (#4477). Reset to 'keyboard' after every open so
192
+ // programmatic controlled opens keep the item-focus behavior.
193
+ const openModalityRef = useRef('keyboard');
182
194
  const handleLayerShow = useCallback(() => {
183
195
  onOpenChange?.(true);
184
196
  if (!isControlled) {
@@ -238,14 +250,26 @@ export function DropdownMenu({
238
250
  }
239
251
  }, [controlledIsOpen, isControlled, popover]);
240
252
 
241
- // Move focus into the menu only after the layer has committed open.
253
+ // Move focus into the menu only after the layer has committed open,
254
+ // honoring the input modality: keyboard (and programmatic) opens land on
255
+ // the first enabled item per the APG menu-button pattern; pointer opens
256
+ // focus the menu container itself (tabIndex={-1}) so no item is
257
+ // highlighted as if pre-selected (#4477). Container focus keeps arrows,
258
+ // typeahead, Escape and Tab in the menu's onKeyDown, and is also the
259
+ // fallback when no item is focusable (e.g. all disabled), mirroring the
260
+ // submenu flyout fallback.
242
261
  useEffect(() => {
243
262
  if (!popover.isOpen || !shouldFocusOnOpenRef.current) {
244
263
  return;
245
264
  }
246
265
  shouldFocusOnOpenRef.current = false;
247
- requestAnimationFrame(() => focusFirst());
248
- }, [popover.isOpen, focusFirst]);
266
+ requestAnimationFrame(() => {
267
+ if (openModalityRef.current === 'pointer' || !focusFirst()) {
268
+ listRef.current?.focus();
269
+ }
270
+ openModalityRef.current = 'keyboard';
271
+ });
272
+ }, [popover.isOpen, focusFirst, listRef]);
249
273
 
250
274
  // Extend useListFocus with Enter/Space activation + typeahead
251
275
  const listKeyDown = useCallback(e => {
@@ -278,25 +302,34 @@ export function DropdownMenu({
278
302
  }
279
303
  listNavKeyDown(e);
280
304
  }, [listNavKeyDown, closeMenu, typeahead, ownsEvent]);
281
- const openAndFocus = useCallback(() => {
305
+ const openAndFocus = useCallback((modality = 'keyboard') => {
306
+ openModalityRef.current = modality;
282
307
  shouldFocusOnOpenRef.current = true;
283
308
  popover.show();
284
309
  }, [popover]);
285
- const handleButtonClick = useCallback(() => {
310
+ const handleButtonClick = useCallback(e => {
286
311
  // If the menu was just closed by light dismiss (e.g. iOS Safari fires
287
312
  // pointerdown → hide before the trigger's click), the click would
288
- // otherwise immediately re-open it. Short-circuit within the guard window.
313
+ // otherwise immediately re-open it. Short-circuit within the guard
314
+ // window.
289
315
  if (Date.now() - lastHideTimeRef.current < 50) {
290
316
  return;
291
317
  }
292
318
  onClick?.();
319
+ // detail === 0 marks a synthesized click (screen reader / AT
320
+ // activation): treat it as keyboard so those users still land on the
321
+ // first item. Real pointer clicks report detail >= 1.
322
+ const modality = e.detail === 0 ? 'keyboard' : 'pointer';
293
323
  if (isControlled) {
324
+ if (!controlledIsOpen) {
325
+ openModalityRef.current = modality;
326
+ }
294
327
  onOpenChange?.(!controlledIsOpen);
295
328
  } else {
296
329
  if (popover.isOpen) {
297
330
  popover.hide();
298
331
  } else {
299
- openAndFocus();
332
+ openAndFocus(modality);
300
333
  }
301
334
  }
302
335
  }, [onClick, isControlled, onOpenChange, controlledIsOpen, popover, openAndFocus]);
@@ -356,6 +389,12 @@ export function DropdownMenu({
356
389
  ref: listRef,
357
390
  id: menuId,
358
391
  role: "menu"
392
+ // Focus target for pointer opens (not in the Tab order): holding
393
+ // focus on the container keeps key events (arrows, typeahead,
394
+ // Escape, Tab) inside the menu without highlighting any item.
395
+ // Mirrors the DropdownMenuSubMenu flyout container.
396
+ ,
397
+ tabIndex: -1
359
398
  // Give the menu an accessible name from its trigger's label, so
360
399
  // screen readers announce e.g. "Actions menu" rather than an unnamed
361
400
  // menu (menus-13).
@@ -11,17 +11,14 @@
11
11
  * Enter/Space activation come from the parent DropdownMenu's useListFocus +
12
12
  * activation path, which matches menuitemcheckbox alongside plain menuitem rows.
13
13
  *
14
- * The checkbox visual composes the real CheckboxInput primitive so its checkmark
15
- * matches CheckboxListItem and picks up the standard `checkbox` theming slots.
16
- * It is purely decorative: the composed control is wrapped in an element that is
17
- * both `aria-hidden` and `inert`, so it contributes nothing to the row's
18
- * accessible name, and its native <input> and sr-only label stay out of the tab
19
- * order and the accessibility tree while pointer clicks fall through to the row
20
- * — the same shim MultiSelector uses. The row owns the checked state and
21
- * accessible name. The control size is derived from the menu's item size (a
22
- * `sm` menu gets the compact control; `md`/`lg` get the standard one) and it
23
- * swaps to the inline-end of the row on coarse-pointer (touch) devices via CSS
24
- * `order`, so it lands where selection toggles are conventionally placed on
14
+ * The checkbox visual is the shared checkbox indicator, decorative
15
+ * (aria-hidden) — the row owns the role, checked state, and accessible name, so
16
+ * there is no nested native <input> to shim out of the accessibility tree. It
17
+ * picks up the same `checkbox` theming (and any theme replacement) as
18
+ * CheckboxInput. The control size is derived from the menu's item size (a `sm`
19
+ * menu gets the compact control; `md`/`lg` get the standard one) and the marker
20
+ * box swaps to the inline-end of the row on coarse-pointer (touch) devices via
21
+ * CSS `order`, so it lands where selection toggles are conventionally placed on
25
22
  * mobile.
26
23
  */
27
24
  import { type ReactNode } from 'react';
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownMenuCheckboxItem.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuCheckboxItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAiC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAErE,OAAO,EAAiB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAOtD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAsC5C,MAAM,WAAW,6BAA8B,SAAQ,IAAI,CACzD,SAAS,EACT,UAAU,GAAG,MAAM,GAAG,cAAc,GAAG,UAAU,CAClD;IACC;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B;;OAEG;IACH,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H,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,KAAK,EACL,WAAW,EACX,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,UAAkB,EAClB,gBAAwB,EACxB,UAAU,EACV,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EAAE,6BAA6B,+BA0D/B;yBAvEe,wBAAwB"}
@@ -15,23 +15,20 @@
15
15
  * Enter/Space activation come from the parent DropdownMenu's useListFocus +
16
16
  * activation path, which matches menuitemcheckbox alongside plain menuitem rows.
17
17
  *
18
- * The checkbox visual composes the real CheckboxInput primitive so its checkmark
19
- * matches CheckboxListItem and picks up the standard `checkbox` theming slots.
20
- * It is purely decorative: the composed control is wrapped in an element that is
21
- * both `aria-hidden` and `inert`, so it contributes nothing to the row's
22
- * accessible name, and its native <input> and sr-only label stay out of the tab
23
- * order and the accessibility tree while pointer clicks fall through to the row
24
- * — the same shim MultiSelector uses. The row owns the checked state and
25
- * accessible name. The control size is derived from the menu's item size (a
26
- * `sm` menu gets the compact control; `md`/`lg` get the standard one) and it
27
- * swaps to the inline-end of the row on coarse-pointer (touch) devices via CSS
28
- * `order`, so it lands where selection toggles are conventionally placed on
18
+ * The checkbox visual is the shared checkbox indicator, decorative
19
+ * (aria-hidden) — the row owns the role, checked state, and accessible name, so
20
+ * there is no nested native <input> to shim out of the accessibility tree. It
21
+ * picks up the same `checkbox` theming (and any theme replacement) as
22
+ * CheckboxInput. The control size is derived from the menu's item size (a `sm`
23
+ * menu gets the compact control; `md`/`lg` get the standard one) and the marker
24
+ * box swaps to the inline-end of the row on coarse-pointer (touch) devices via
25
+ * CSS `order`, so it lands where selection toggles are conventionally placed on
29
26
  * mobile.
30
27
  */
31
28
  import { useCallback } from 'react';
32
29
  import * as stylex from '@stylexjs/stylex';
33
30
  import { renderIconSlot } from "../Icon/index.js";
34
- import { CheckboxInput } from "../CheckboxInput/CheckboxInput.js";
31
+ import { useIndicator } from "../Indicator/index.js";
35
32
  import { Item } from "../Item/index.js";
36
33
  import { useDropdownMenuContext } from "./DropdownMenuContext.js";
37
34
  import { focusMenuItemOnHover } from "./menuItemHover.js";
@@ -53,8 +50,18 @@ const styles = {
53
50
  kSiTet: "xbyyjgo",
54
51
  kkrTdU: "x1h6gzvc",
55
52
  $$css: true
53
+ },
54
+ marker: {
55
+ kfzvcC: "x47corl",
56
+ kayTVb: "x1g77sc7 xozvky",
57
+ keTefX: "x1lziwak x1jymrmb",
58
+ $$css: true
56
59
  }
57
60
  };
61
+
62
+ // Matches the control sizes CheckboxInput uses, so a checkbox reads the same in
63
+ // a menu row as it does in a form.
64
+
58
65
  /**
59
66
  * A checkable dropdown menu item (role="menuitemcheckbox").
60
67
  *
@@ -90,12 +97,7 @@ export function DropdownMenuCheckboxItem({
90
97
  const ctx = useDropdownMenuContext();
91
98
  const menuSize = ctx?.menuSize ?? 'md';
92
99
  const controlSize = menuSize === 'sm' ? 'sm' : 'md';
93
-
94
- // The composed checkbox is decorative and inert, so its label never reaches
95
- // the accessibility tree — the row's `label` prop provides the announced
96
- // name. CheckboxInput still requires a string label, so pass one through when
97
- // the row label is a plain string.
98
- const checkboxLabel = typeof label === 'string' ? label : '';
100
+ const CheckboxControl = useIndicator('checkbox');
99
101
  const handleClick = useCallback(() => {
100
102
  if (isDisabled) {
101
103
  return;
@@ -112,19 +114,18 @@ export function DropdownMenuCheckboxItem({
112
114
  "aria-checked": value,
113
115
  tabIndex: isDisabled ? undefined : -1,
114
116
  onPointerMove: handlePointerMove,
115
- marker: /*#__PURE__*/_jsx("div", {
116
- "aria-hidden": "true",
117
- inert: true,
118
- ...{
119
- className: "x78zum5 x2lah0s x47corl x1g77sc7 xozvky x1lziwak x1jymrmb"
120
- },
121
- children: /*#__PURE__*/_jsx(CheckboxInput, {
122
- label: checkboxLabel,
123
- isLabelHidden: true,
124
- value: value,
125
- isDisabled: isDisabled,
126
- size: controlSize
127
- })
117
+ marker:
118
+ /*#__PURE__*/
119
+ // No wrapper, and no menu-specific theme target: the shared
120
+ // `astryx-checkbox` target is already on this element (main reached
121
+ // the menu checkbox through it too), so the menu adds only its own
122
+ // placement rules. A wrapper here would have duplicated the
123
+ // indicator's control size and moved nothing themeable.
124
+ _jsx(CheckboxControl, {
125
+ state: value ? 'checked' : 'unchecked',
126
+ size: controlSize,
127
+ isDisabled: isDisabled,
128
+ xstyle: styles.marker
128
129
  }),
129
130
  startContent: icon ? renderIconSlot(icon, {
130
131
  size: 'sm',
@@ -10,11 +10,11 @@
10
10
  * state + onChange come from DropdownMenuRadioGroupContext. Keyboard nav +
11
11
  * Enter/Space activation come from the parent DropdownMenu.
12
12
  *
13
- * The round radio visual (circle + center dot) is decorative (aria-hidden) —
14
- * the row owns the checked state. Its size is derived from the menu's item size
15
- * and it swaps to the inline-end of the row on coarse-pointer (touch) devices
16
- * via CSS `order`. The dot is a shaped element, not an icon (a filled circle
17
- * has no registry glyph).
13
+ * The round radio visual is the shared radio indicator, decorative
14
+ * (aria-hidden) — the row owns the checked state, and menu radios pick up the
15
+ * same `radio` theming (and any theme replacement) as RadioList. This row keeps
16
+ * the marker box: its size is derived from the menu's item size and it swaps to
17
+ * the inline-end of the row on coarse-pointer (touch) devices via CSS `order`.
18
18
  */
19
19
  import { type ReactNode } from 'react';
20
20
  import { type IconType } from '../Icon';
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownMenuRadioItem.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuRadioItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAiC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAErE,OAAO,EAAiB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAYtD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAqE5C,MAAM,WAAW,0BAA2B,SAAQ,IAAI,CACtD,SAAS,EACT,MAAM,GAAG,cAAc,GAAG,UAAU,CACrC;IACC;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EACL,KAAK,EACL,WAAW,EACX,IAAI,EACJ,UAAkB,EAClB,UAAU,EACV,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EAAE,0BAA0B,+BAgF5B;yBA3Fe,qBAAqB"}
1
+ {"version":3,"file":"DropdownMenuRadioItem.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuRadioItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAiC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAErE,OAAO,EAAiB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAOtD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAyC5C,MAAM,WAAW,0BAA2B,SAAQ,IAAI,CACtD,SAAS,EACT,MAAM,GAAG,cAAc,GAAG,UAAU,CACrC;IACC;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EACL,KAAK,EACL,WAAW,EACX,IAAI,EACJ,UAAkB,EAClB,UAAU,EACV,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EAAE,0BAA0B,+BAmE5B;yBA9Ee,qBAAqB"}
@@ -14,20 +14,21 @@
14
14
  * state + onChange come from DropdownMenuRadioGroupContext. Keyboard nav +
15
15
  * Enter/Space activation come from the parent DropdownMenu.
16
16
  *
17
- * The round radio visual (circle + center dot) is decorative (aria-hidden) —
18
- * the row owns the checked state. Its size is derived from the menu's item size
19
- * and it swaps to the inline-end of the row on coarse-pointer (touch) devices
20
- * via CSS `order`. The dot is a shaped element, not an icon (a filled circle
21
- * has no registry glyph).
17
+ * The round radio visual is the shared radio indicator, decorative
18
+ * (aria-hidden) — the row owns the checked state, and menu radios pick up the
19
+ * same `radio` theming (and any theme replacement) as RadioList. This row keeps
20
+ * the marker box: its size is derived from the menu's item size and it swaps to
21
+ * the inline-end of the row on coarse-pointer (touch) devices via CSS `order`.
22
22
  */
23
23
  import { useCallback } from 'react';
24
24
  import * as stylex from '@stylexjs/stylex';
25
25
  import { renderIconSlot } from "../Icon/index.js";
26
+ import { useIndicator } from "../Indicator/index.js";
26
27
  import { Item } from "../Item/index.js";
27
28
  import { useDropdownMenuContext } from "./DropdownMenuContext.js";
28
29
  import { focusMenuItemOnHover } from "./menuItemHover.js";
29
30
  import "../theme/tokens.stylex.js";
30
- import { colorVars, spacingVars, durationVars, easeVars, borderVars } from "../theme/tokens.stylex.js";
31
+ import { colorVars, spacingVars } from "../theme/tokens.stylex.js";
31
32
  import { mergeProps, themeProps } from "../utils/index.js";
32
33
  import { useDropdownMenuRadioGroupContext } from "./DropdownMenuContext.js";
33
34
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -46,62 +47,17 @@ const styles = {
46
47
  kkrTdU: "x1h6gzvc",
47
48
  $$css: true
48
49
  },
49
- circle: {
50
- k1xSpc: "x78zum5",
51
- kGNEyG: "x6s0dn4",
52
- kjj79g: "xl56j7k",
53
- kmuXW: "x2lah0s",
54
- kB7OPa: "x9f619",
55
- kMzoRj: "x1litavf",
56
- ksu8eU: "x1y0btm7",
57
- kaIpWk: "x16rqkct",
58
- k1ekBW: "xts7igz",
59
- kIyJzY: "xuedmi6 x12w9bfk",
60
- kAMwcw: "xlr8y92",
50
+ marker: {
51
+ kfzvcC: "x47corl",
61
52
  kayTVb: "x1g77sc7 xozvky",
62
53
  keTefX: "x1lziwak x1jymrmb",
63
54
  $$css: true
64
- },
65
- unchecked: {
66
- kVAM5u: "xvy26l8",
67
- kWkggS: "x10xzikg",
68
- $$css: true
69
- },
70
- checked: {
71
- kVAM5u: "xad5do",
72
- kWkggS: "x1ewilqj",
73
- $$css: true
74
- },
75
- dot: {
76
- kaIpWk: "x16rqkct",
77
- kWkggS: "x1azo05",
78
- $$css: true
79
- }
80
- };
81
- const circleSizeStyles = {
82
- sm: {
83
- kzqmXN: "x1xp8n7a",
84
- kZKoxP: "xmix8c7",
85
- $$css: true
86
- },
87
- md: {
88
- kzqmXN: "x17z2i9w",
89
- kZKoxP: "x17rw0jw",
90
- $$css: true
91
- }
92
- };
93
- const dotSizeStyles = {
94
- sm: {
95
- kzqmXN: "x1v4s8kt",
96
- kZKoxP: "xols6we",
97
- $$css: true
98
- },
99
- md: {
100
- kzqmXN: "x1xc55vz",
101
- kZKoxP: "xdk7pt",
102
- $$css: true
103
55
  }
104
56
  };
57
+
58
+ // Matches the control sizes RadioList uses, so a radio reads the same in a
59
+ // menu row as it does in a radio group.
60
+
105
61
  /**
106
62
  * A single option in a DropdownMenuRadioGroup (role="menuitemradio").
107
63
  *
@@ -133,6 +89,7 @@ export function DropdownMenuRadioItem({
133
89
  const menuSize = menuCtx?.menuSize ?? 'md';
134
90
  const controlSize = menuSize === 'sm' ? 'sm' : 'md';
135
91
  const isChecked = groupCtx.value === value;
92
+ const RadioControl = useIndicator('radio');
136
93
  const handleClick = useCallback(() => {
137
94
  if (isDisabled) {
138
95
  return;
@@ -149,19 +106,19 @@ export function DropdownMenuRadioItem({
149
106
  "aria-checked": isChecked,
150
107
  tabIndex: isDisabled ? undefined : -1,
151
108
  onPointerMove: handlePointerMove,
152
- marker: /*#__PURE__*/_jsx("span", {
153
- "aria-hidden": "true",
154
- ...mergeProps(themeProps('dropdown-menu-radio', {
109
+ marker:
110
+ /*#__PURE__*/
111
+ // No wrapper — see DropdownMenuCheckboxItem: the target belongs on the
112
+ // visible circle, and the indicator already owns its control size.
113
+ _jsx(RadioControl, {
114
+ state: isChecked ? 'checked' : 'unchecked',
115
+ size: controlSize,
116
+ isDisabled: isDisabled,
117
+ xstyle: styles.marker,
118
+ ...themeProps('dropdown-menu-radio', {
155
119
  size: controlSize,
156
120
  checked: isChecked ? 'checked' : null,
157
121
  disabled: isDisabled ? 'disabled' : null
158
- }), stylex.props(styles.circle, circleSizeStyles[controlSize], isChecked ? styles.checked : styles.unchecked)),
159
- children: isChecked && /*#__PURE__*/_jsx("span", {
160
- ...mergeProps(themeProps('dropdown-menu-radio-dot', {
161
- size: controlSize,
162
- checked: 'checked',
163
- disabled: isDisabled ? 'disabled' : null
164
- }), stylex.props(styles.dot, dotSizeStyles[controlSize]))
165
122
  })
166
123
  }),
167
124
  startContent: icon ? renderIconSlot(icon, {
@@ -77,11 +77,11 @@ export function EmptyState({
77
77
  const HeadingTag = `h${headingLevel}`;
78
78
  return /*#__PURE__*/_jsxs("div", {
79
79
  ref: ref,
80
+ ...props,
80
81
  role: "status",
81
82
  ...mergeProps(themeProps('empty-state', {
82
83
  variant: isCompact ? 'compact' : null
83
84
  }), stylex.props(styles.container, isCompact && styles.containerCompact, xstyle), className, style),
84
- ...props,
85
85
  children: [icon != null && /*#__PURE__*/_jsx("div", {
86
86
  "aria-hidden": "true",
87
87
  children: icon
@@ -0,0 +1,26 @@
1
+ import type { IndicatorProps } from './types';
2
+ /**
3
+ * The default single-selection mark: a checkmark when chosen, nothing when not.
4
+ *
5
+ * Decorative and non-interactive — it renders `aria-hidden` and owns no role,
6
+ * state, or focus behavior; the option or row that hosts it keeps all of that.
7
+ *
8
+ * @example
9
+ * ```
10
+ * <CheckIndicator state={isSelected ? 'checked' : 'unchecked'} size="sm" />
11
+ * ```
12
+ *
13
+ * Swap every single-selection mark for a radio:
14
+ *
15
+ * @example
16
+ * ```
17
+ * import {RadioIndicator} from '@astryxdesign/core/Indicator';
18
+ *
19
+ * defineTheme({name: 'brand', indicators: {check: RadioIndicator}});
20
+ * ```
21
+ */
22
+ export declare function CheckIndicator({ state, size, isDisabled, children, ref, className, style, xstyle, ...rest }: IndicatorProps<'singleSelection'>): import("react").JSX.Element | null;
23
+ export declare namespace CheckIndicator {
24
+ var displayName: string;
25
+ }
26
+ //# sourceMappingURL=CheckIndicator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CheckIndicator.d.ts","sourceRoot":"","sources":["../../src/Indicator/CheckIndicator.tsx"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,SAAS,CAAC;AA6B5C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,IAAW,EACX,UAAkB,EAClB,QAAQ,EACR,GAAG,EACH,SAAS,EACT,KAAK,EACL,MAAM,EACN,GAAG,IAAI,EACR,EAAE,cAAc,CAAC,iBAAiB,CAAC,sCA6EnC;yBAvFe,cAAc"}