@astryxdesign/core 0.4.6 → 0.4.7-canary.20bae6c

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 (377) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/dist/AppShell/AppShell.d.ts.map +1 -1
  3. package/dist/AppShell/AppShell.js +3 -2
  4. package/dist/AspectRatio/AspectRatio.d.ts +24 -0
  5. package/dist/AspectRatio/AspectRatio.d.ts.map +1 -1
  6. package/dist/AspectRatio/AspectRatio.js +23 -4
  7. package/dist/AvatarGroup/AvatarGroup.d.ts.map +1 -1
  8. package/dist/AvatarGroup/AvatarGroup.js +3 -2
  9. package/dist/BottomSheet/BottomSheet.d.ts +1 -0
  10. package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
  11. package/dist/BottomSheet/BottomSheet.js +54 -15
  12. package/dist/BottomSheet/BottomSheetEdgeTint.d.ts +6 -0
  13. package/dist/BottomSheet/BottomSheetEdgeTint.d.ts.map +1 -0
  14. package/dist/BottomSheet/BottomSheetEdgeTint.js +62 -0
  15. package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
  16. package/dist/BottomSheet/BottomSheetPanel.js +1 -0
  17. package/dist/BottomSheet/BottomSheetSwitcher.d.ts +1 -0
  18. package/dist/BottomSheet/BottomSheetSwitcher.d.ts.map +1 -1
  19. package/dist/BottomSheet/BottomSheetSwitcher.js +13 -6
  20. package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
  21. package/dist/BottomSheet/useSheetGestures.js +23 -5
  22. package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
  23. package/dist/Breadcrumbs/BreadcrumbItem.js +11 -10
  24. package/dist/ButtonGroup/ButtonGroup.d.ts.map +1 -1
  25. package/dist/ButtonGroup/ButtonGroup.js +12 -4
  26. package/dist/Calendar/Calendar.d.ts +3 -1
  27. package/dist/Calendar/Calendar.d.ts.map +1 -1
  28. package/dist/Calendar/Calendar.js +13 -14
  29. package/dist/Calendar/getInitialFocusDate.d.ts +46 -0
  30. package/dist/Calendar/getInitialFocusDate.d.ts.map +1 -0
  31. package/dist/Calendar/getInitialFocusDate.js +62 -0
  32. package/dist/Carousel/Carousel.d.ts.map +1 -1
  33. package/dist/Carousel/Carousel.js +3 -3
  34. package/dist/Chat/ChatLayout.d.ts.map +1 -1
  35. package/dist/Chat/ChatLayout.js +3 -3
  36. package/dist/Chat/ChatMessageList.d.ts +22 -3
  37. package/dist/Chat/ChatMessageList.d.ts.map +1 -1
  38. package/dist/Chat/ChatMessageList.js +6 -3
  39. package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
  40. package/dist/CheckboxInput/CheckboxInput.js +3 -2
  41. package/dist/ClickableCard/ClickableCard.d.ts.map +1 -1
  42. package/dist/ClickableCard/ClickableCard.js +3 -3
  43. package/dist/CommandPalette/CommandPaletteInput.d.ts.map +1 -1
  44. package/dist/CommandPalette/CommandPaletteInput.js +3 -2
  45. package/dist/CommandPalette/CommandPaletteItem.d.ts.map +1 -1
  46. package/dist/CommandPalette/CommandPaletteItem.js +3 -2
  47. package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
  48. package/dist/ContextMenu/ContextMenu.js +4 -3
  49. package/dist/DateInput/DateInput.d.ts.map +1 -1
  50. package/dist/DateInput/DateInput.js +3 -2
  51. package/dist/DateInput/TouchDateField.d.ts.map +1 -1
  52. package/dist/DateInput/TouchDateField.js +34 -1
  53. package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
  54. package/dist/DateTimeInput/DateTimeInput.js +3 -2
  55. package/dist/Dialog/Dialog.d.ts +7 -1
  56. package/dist/Dialog/Dialog.d.ts.map +1 -1
  57. package/dist/Dialog/Dialog.js +89 -58
  58. package/dist/FileInput/FileInput.d.ts.map +1 -1
  59. package/dist/FileInput/FileInput.js +3 -2
  60. package/dist/Heading/Heading.d.ts.map +1 -1
  61. package/dist/Heading/Heading.js +6 -2
  62. package/dist/HoverCard/HoverCard.d.ts +6 -0
  63. package/dist/HoverCard/HoverCard.d.ts.map +1 -1
  64. package/dist/HoverCard/useHoverCard.d.ts +5 -0
  65. package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
  66. package/dist/HoverCard/useHoverCard.js +67 -25
  67. package/dist/Item/Item.d.ts.map +1 -1
  68. package/dist/Item/Item.js +4 -2
  69. package/dist/Kbd/Kbd.d.ts.map +1 -1
  70. package/dist/Kbd/Kbd.js +10 -3
  71. package/dist/Layer/LayerDepthContext.d.ts +52 -0
  72. package/dist/Layer/LayerDepthContext.d.ts.map +1 -0
  73. package/dist/Layer/LayerDepthContext.js +66 -0
  74. package/dist/Layer/index.d.ts +3 -0
  75. package/dist/Layer/index.d.ts.map +1 -1
  76. package/dist/Layer/index.js +4 -0
  77. package/dist/Layer/layerStack.d.ts +98 -0
  78. package/dist/Layer/layerStack.d.ts.map +1 -0
  79. package/dist/Layer/layerStack.js +306 -0
  80. package/dist/Layer/useLayerDismissal.d.ts +93 -0
  81. package/dist/Layer/useLayerDismissal.d.ts.map +1 -0
  82. package/dist/Layer/useLayerDismissal.js +91 -0
  83. package/dist/Lightbox/Lightbox.d.ts +1 -0
  84. package/dist/Lightbox/Lightbox.d.ts.map +1 -1
  85. package/dist/Lightbox/Lightbox.js +103 -81
  86. package/dist/Markdown/index.d.ts +1 -1
  87. package/dist/Markdown/index.d.ts.map +1 -1
  88. package/dist/Markdown/parser.d.ts +38 -1
  89. package/dist/Markdown/parser.d.ts.map +1 -1
  90. package/dist/Markdown/parser.js +149 -23
  91. package/dist/MobileNav/MobileNav.d.ts +6 -1
  92. package/dist/MobileNav/MobileNav.d.ts.map +1 -1
  93. package/dist/MobileNav/MobileNav.js +61 -36
  94. package/dist/MultiSelector/MultiSelector.d.ts +15 -1
  95. package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
  96. package/dist/MultiSelector/MultiSelector.js +17 -6
  97. package/dist/MultiSelector/index.d.ts +1 -1
  98. package/dist/MultiSelector/index.d.ts.map +1 -1
  99. package/dist/NavMenu/NavHeadingMenu.d.ts.map +1 -1
  100. package/dist/NavMenu/NavHeadingMenu.js +3 -2
  101. package/dist/Outline/Outline.d.ts.map +1 -1
  102. package/dist/Outline/Outline.js +3 -2
  103. package/dist/OverflowList/OverflowList.d.ts.map +1 -1
  104. package/dist/OverflowList/OverflowList.js +3 -2
  105. package/dist/Overlay/Overlay.d.ts.map +1 -1
  106. package/dist/Overlay/Overlay.js +3 -2
  107. package/dist/Popover/usePopover.d.ts.map +1 -1
  108. package/dist/Popover/usePopover.js +20 -17
  109. package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
  110. package/dist/PowerSearch/PowerSearch.js +3 -4
  111. package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
  112. package/dist/Resizable/ResizeHandle.js +3 -2
  113. package/dist/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  114. package/dist/SegmentedControl/SegmentedControl.js +3 -2
  115. package/dist/SelectableCard/SelectableCard.d.ts.map +1 -1
  116. package/dist/SelectableCard/SelectableCard.js +3 -3
  117. package/dist/Selector/Selector.d.ts.map +1 -1
  118. package/dist/Selector/Selector.js +5 -0
  119. package/dist/SideNav/SideNav.d.ts.map +1 -1
  120. package/dist/SideNav/SideNav.js +4 -3
  121. package/dist/SideNav/SideNavItem.d.ts.map +1 -1
  122. package/dist/SideNav/SideNavItem.js +4 -3
  123. package/dist/Slider/Slider.d.ts.map +1 -1
  124. package/dist/Slider/Slider.js +3 -3
  125. package/dist/Stepper/Step.d.ts +140 -0
  126. package/dist/Stepper/Step.d.ts.map +1 -0
  127. package/dist/Stepper/Step.js +1045 -0
  128. package/dist/Stepper/StepStatus.d.ts +24 -0
  129. package/dist/Stepper/StepStatus.d.ts.map +1 -0
  130. package/dist/Stepper/StepStatus.js +1 -0
  131. package/dist/Stepper/Stepper.d.ts +93 -0
  132. package/dist/Stepper/Stepper.d.ts.map +1 -0
  133. package/dist/Stepper/Stepper.js +184 -0
  134. package/dist/Stepper/StepperContext.d.ts +41 -0
  135. package/dist/Stepper/StepperContext.d.ts.map +1 -0
  136. package/dist/Stepper/StepperContext.js +34 -0
  137. package/dist/Stepper/index.d.ts +8 -0
  138. package/dist/Stepper/index.d.ts.map +1 -0
  139. package/dist/Stepper/index.js +7 -0
  140. package/dist/Stepper/stepper.stylex.d.ts +15 -0
  141. package/dist/Stepper/stepper.stylex.d.ts.map +1 -0
  142. package/dist/Stepper/stepper.stylex.js +20 -0
  143. package/dist/Switch/Switch.d.ts.map +1 -1
  144. package/dist/Switch/Switch.js +3 -2
  145. package/dist/TabList/Tab.d.ts.map +1 -1
  146. package/dist/TabList/Tab.js +5 -1
  147. package/dist/TabList/TabList.d.ts.map +1 -1
  148. package/dist/TabList/TabList.js +3 -3
  149. package/dist/Table/BaseTable.d.ts.map +1 -1
  150. package/dist/Table/BaseTable.js +4 -1
  151. package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts.map +1 -1
  152. package/dist/Table/plugins/groupedRows/useTableGroupedRows.js +20 -8
  153. package/dist/Table/plugins/pagination/useTablePagination.d.ts +3 -0
  154. package/dist/Table/plugins/pagination/useTablePagination.d.ts.map +1 -1
  155. package/dist/Table/plugins/pagination/useTablePagination.js +21 -4
  156. package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
  157. package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +7 -2
  158. package/dist/Table/plugins/rowStatus/useTableRowStatus.d.ts.map +1 -1
  159. package/dist/Table/plugins/rowStatus/useTableRowStatus.js +10 -3
  160. package/dist/Table/plugins/selection/useTableSelection.d.ts +16 -0
  161. package/dist/Table/plugins/selection/useTableSelection.d.ts.map +1 -1
  162. package/dist/Table/plugins/selection/useTableSelection.js +19 -5
  163. package/dist/Table/types.d.ts +22 -4
  164. package/dist/Table/types.d.ts.map +1 -1
  165. package/dist/Table/useBaseTablePlugins.d.ts.map +1 -1
  166. package/dist/Table/useBaseTablePlugins.js +5 -0
  167. package/dist/Text/Text.d.ts.map +1 -1
  168. package/dist/Text/Text.js +6 -2
  169. package/dist/TextArea/TextArea.d.ts.map +1 -1
  170. package/dist/TextArea/TextArea.js +3 -2
  171. package/dist/TextInput/TextInput.d.ts.map +1 -1
  172. package/dist/TextInput/TextInput.js +3 -2
  173. package/dist/TimeInput/TimeInput.d.ts.map +1 -1
  174. package/dist/TimeInput/TimeInput.js +3 -2
  175. package/dist/Timestamp/Timestamp.d.ts.map +1 -1
  176. package/dist/Timestamp/Timestamp.js +5 -3
  177. package/dist/Token/TokenLink.d.ts.map +1 -1
  178. package/dist/Token/TokenLink.js +2 -2
  179. package/dist/Tooltip/Tooltip.d.ts +5 -0
  180. package/dist/Tooltip/Tooltip.d.ts.map +1 -1
  181. package/dist/Tooltip/useTooltip.d.ts +5 -0
  182. package/dist/Tooltip/useTooltip.d.ts.map +1 -1
  183. package/dist/Tooltip/useTooltip.js +39 -24
  184. package/dist/TopNav/TopNavMegaMenu.d.ts.map +1 -1
  185. package/dist/TopNav/TopNavMegaMenu.js +3 -3
  186. package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
  187. package/dist/Typeahead/BaseTypeahead.js +3 -3
  188. package/dist/Typeahead/Typeahead.d.ts.map +1 -1
  189. package/dist/Typeahead/Typeahead.js +3 -2
  190. package/dist/astryx.css +43 -1
  191. package/dist/hooks/index.d.ts +1 -0
  192. package/dist/hooks/index.d.ts.map +1 -1
  193. package/dist/hooks/index.js +1 -0
  194. package/dist/hooks/useFocusTrap.d.ts +7 -4
  195. package/dist/hooks/useFocusTrap.d.ts.map +1 -1
  196. package/dist/hooks/useFocusTrap.js +52 -91
  197. package/dist/hooks/useHotkeys.d.ts.map +1 -1
  198. package/dist/hooks/useHotkeys.js +10 -3
  199. package/dist/hooks/useListFocus.d.ts +5 -2
  200. package/dist/hooks/useListFocus.d.ts.map +1 -1
  201. package/dist/hooks/useListFocus.js +12 -6
  202. package/dist/hooks/useMergedRefs.d.ts +18 -0
  203. package/dist/hooks/useMergedRefs.d.ts.map +1 -0
  204. package/dist/hooks/useMergedRefs.js +25 -0
  205. package/dist/index.d.ts +1 -0
  206. package/dist/index.d.ts.map +1 -1
  207. package/dist/index.js +1 -0
  208. package/dist/utils/timeParser.d.ts +1 -1
  209. package/dist/utils/timeParser.d.ts.map +1 -1
  210. package/dist/utils/timeParser.js +26 -12
  211. package/locales/en.json +27 -7
  212. package/locales/pseudo.json +15 -0
  213. package/package.json +8 -3
  214. package/src/AppShell/AppShell.tsx +3 -2
  215. package/src/AspectRatio/AspectRatio.doc.mjs +6 -3
  216. package/src/AspectRatio/AspectRatio.test.tsx +57 -10
  217. package/src/AspectRatio/AspectRatio.tsx +40 -1
  218. package/src/Avatar/Avatar.doc.mjs +2 -1
  219. package/src/AvatarGroup/AvatarGroup.tsx +3 -2
  220. package/src/BottomSheet/BottomSheet.test.tsx +123 -0
  221. package/src/BottomSheet/BottomSheet.tsx +36 -4
  222. package/src/BottomSheet/BottomSheetEdgeTint.test.tsx +225 -0
  223. package/src/BottomSheet/BottomSheetEdgeTint.tsx +82 -0
  224. package/src/BottomSheet/BottomSheetPanel.test.tsx +66 -0
  225. package/src/BottomSheet/BottomSheetPanel.tsx +19 -0
  226. package/src/BottomSheet/BottomSheetSwitcher.tsx +16 -2
  227. package/src/BottomSheet/useSheetGestures.test.ts +27 -0
  228. package/src/BottomSheet/useSheetGestures.ts +25 -5
  229. package/src/Breadcrumbs/BreadcrumbItem.tsx +9 -5
  230. package/src/Button/Button.doc.mjs +22 -0
  231. package/src/ButtonGroup/ButtonGroup.doc.mjs +7 -1
  232. package/src/ButtonGroup/ButtonGroup.test.tsx +185 -1
  233. package/src/ButtonGroup/ButtonGroup.tsx +11 -3
  234. package/src/Calendar/Calendar.doc.mjs +4 -3
  235. package/src/Calendar/Calendar.test.tsx +52 -0
  236. package/src/Calendar/Calendar.tsx +18 -15
  237. package/src/Calendar/getInitialFocusDate.test.ts +94 -0
  238. package/src/Calendar/getInitialFocusDate.ts +93 -0
  239. package/src/Carousel/Carousel.tsx +3 -2
  240. package/src/Chat/ChatLayout.tsx +3 -2
  241. package/src/Chat/ChatMessageList.doc.mjs +9 -1
  242. package/src/Chat/ChatMessageList.test.tsx +46 -0
  243. package/src/Chat/ChatMessageList.tsx +28 -4
  244. package/src/CheckboxInput/CheckboxInput.tsx +3 -2
  245. package/src/ClickableCard/ClickableCard.tsx +3 -2
  246. package/src/CodeBlock/CodeBlock.doc.mjs +6 -0
  247. package/src/CommandPalette/CommandPaletteInput.tsx +3 -2
  248. package/src/CommandPalette/CommandPaletteItem.tsx +3 -2
  249. package/src/ContextMenu/ContextMenu.doc.mjs +5 -0
  250. package/src/ContextMenu/ContextMenu.tsx +4 -3
  251. package/src/DateInput/DateInput.tsx +3 -2
  252. package/src/DateInput/DateInputTouch.test.tsx +36 -0
  253. package/src/DateInput/TouchDateField.tsx +35 -1
  254. package/src/DateTimeInput/DateTimeInput.tsx +2 -2
  255. package/src/Dialog/Dialog.doc.mjs +8 -3
  256. package/src/Dialog/Dialog.test.tsx +261 -1
  257. package/src/Dialog/Dialog.tsx +109 -58
  258. package/src/DropdownMenu/DropdownMenu.doc.mjs +6 -0
  259. package/src/Field/Field.doc.mjs +13 -2
  260. package/src/FileInput/FileInput.tsx +3 -2
  261. package/src/Heading/Heading.test.tsx +23 -1
  262. package/src/Heading/Heading.tsx +6 -2
  263. package/src/HoverCard/HoverCard.doc.mjs +5 -0
  264. package/src/HoverCard/HoverCard.tsx +6 -0
  265. package/src/HoverCard/useHoverCard.tsx +81 -30
  266. package/src/Item/Item.tsx +5 -4
  267. package/src/Kbd/Kbd.test.tsx +17 -0
  268. package/src/Kbd/Kbd.tsx +10 -3
  269. package/src/Layer/LayerDepthContext.tsx +62 -0
  270. package/src/Layer/index.ts +9 -0
  271. package/src/Layer/layerDismissalFamilies.test.tsx +359 -0
  272. package/src/Layer/layerDismissalInvariants.test.tsx +417 -0
  273. package/src/Layer/layerStack.ts +362 -0
  274. package/src/Layer/useLayerDismissal.test.tsx +469 -0
  275. package/src/Layer/useLayerDismissal.ts +173 -0
  276. package/src/Layout/Layout.doc.mjs +2 -2
  277. package/src/Lightbox/Lightbox.doc.mjs +12 -0
  278. package/src/Lightbox/Lightbox.tsx +124 -102
  279. package/src/Link/Link.doc.mjs +39 -0
  280. package/src/Markdown/index.ts +1 -0
  281. package/src/Markdown/parser.perf.test.ts +71 -1
  282. package/src/Markdown/parser.test.ts +145 -2
  283. package/src/Markdown/parser.ts +208 -22
  284. package/src/MobileNav/MobileNav.tsx +62 -36
  285. package/src/MoreMenu/MoreMenu.doc.mjs +7 -1
  286. package/src/MultiSelector/MultiSelector.doc.mjs +27 -0
  287. package/src/MultiSelector/MultiSelector.test.tsx +105 -0
  288. package/src/MultiSelector/MultiSelector.tsx +50 -6
  289. package/src/MultiSelector/index.ts +1 -0
  290. package/src/NavMenu/NavHeadingMenu.tsx +3 -2
  291. package/src/NumberInput/NumberInput.doc.mjs +5 -0
  292. package/src/Outline/Outline.tsx +3 -2
  293. package/src/OverflowList/OverflowList.tsx +3 -2
  294. package/src/Overlay/Overlay.tsx +3 -2
  295. package/src/Popover/Popover.test.tsx +27 -1
  296. package/src/Popover/usePopover.tsx +31 -28
  297. package/src/PowerSearch/PowerSearch.doc.mjs +26 -0
  298. package/src/PowerSearch/PowerSearch.tsx +5 -2
  299. package/src/Resizable/ResizeHandle.tsx +3 -2
  300. package/src/SegmentedControl/SegmentedControl.tsx +3 -2
  301. package/src/SelectableCard/SelectableCard.tsx +3 -2
  302. package/src/Selector/Selector.doc.mjs +12 -1
  303. package/src/Selector/Selector.test.tsx +21 -0
  304. package/src/Selector/Selector.tsx +11 -1
  305. package/src/SideNav/SideNav.doc.mjs +6 -6
  306. package/src/SideNav/SideNav.tsx +4 -2
  307. package/src/SideNav/SideNavItem.tsx +4 -2
  308. package/src/Slider/Slider.tsx +3 -2
  309. package/src/Stepper/Step.doc.mjs +98 -0
  310. package/src/Stepper/Step.tsx +1638 -0
  311. package/src/Stepper/StepStatus.ts +26 -0
  312. package/src/Stepper/Stepper.doc.mjs +370 -0
  313. package/src/Stepper/Stepper.test.tsx +1024 -0
  314. package/src/Stepper/Stepper.tsx +258 -0
  315. package/src/Stepper/StepperContext.ts +71 -0
  316. package/src/Stepper/index.ts +18 -0
  317. package/src/Stepper/stepper.stylex.ts +19 -0
  318. package/src/Switch/Switch.tsx +3 -2
  319. package/src/TabList/Tab.tsx +5 -1
  320. package/src/TabList/TabList.test.tsx +21 -4
  321. package/src/TabList/TabList.tsx +3 -2
  322. package/src/Table/BaseTable.tsx +6 -3
  323. package/src/Table/Table.test.tsx +35 -0
  324. package/src/Table/plugins/groupedRows/useTableGroupedRows-perf.test.tsx +112 -0
  325. package/src/Table/plugins/groupedRows/useTableGroupedRows.test.tsx +100 -0
  326. package/src/Table/plugins/groupedRows/useTableGroupedRows.tsx +17 -8
  327. package/src/Table/plugins/pagination/useTablePagination.test.tsx +34 -4
  328. package/src/Table/plugins/pagination/useTablePagination.tsx +35 -3
  329. package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +9 -2
  330. package/src/Table/plugins/rowStatus/useTableRowStatus.test.tsx +13 -7
  331. package/src/Table/plugins/rowStatus/useTableRowStatus.tsx +12 -3
  332. package/src/Table/plugins/selection/useTableSelection.test.tsx +76 -0
  333. package/src/Table/plugins/selection/useTableSelection.tsx +40 -7
  334. package/src/Table/types.ts +22 -4
  335. package/src/Table/useBaseTablePlugins.ts +5 -0
  336. package/src/Table/useTableGroupedRows.doc.mjs +5 -4
  337. package/src/Table/useTablePagination.doc.mjs +7 -0
  338. package/src/Table/useTableRowStatus.doc.mjs +1 -1
  339. package/src/Table/useTableSelection.doc.mjs +31 -0
  340. package/src/Text/Text.test.tsx +23 -1
  341. package/src/Text/Text.tsx +6 -2
  342. package/src/TextArea/TextArea.tsx +3 -2
  343. package/src/TextInput/TextInput.doc.mjs +10 -0
  344. package/src/TextInput/TextInput.tsx +3 -2
  345. package/src/Thumbnail/Thumbnail.doc.mjs +1 -1
  346. package/src/TimeInput/TimeInput.tsx +2 -2
  347. package/src/Timestamp/Timestamp.tsx +4 -2
  348. package/src/Toast/Toast.doc.mjs +6 -0
  349. package/src/Token/TokenLink.tsx +2 -2
  350. package/src/Tokenizer/Tokenizer.doc.mjs +16 -0
  351. package/src/Toolbar/Toolbar.doc.mjs +5 -0
  352. package/src/Tooltip/Tooltip.doc.mjs +5 -0
  353. package/src/Tooltip/Tooltip.test.tsx +32 -0
  354. package/src/Tooltip/Tooltip.tsx +5 -0
  355. package/src/Tooltip/useTooltip.tsx +47 -24
  356. package/src/TopNav/TopNavMegaMenu.tsx +3 -2
  357. package/src/Typeahead/BaseTypeahead.tsx +3 -2
  358. package/src/Typeahead/Typeahead.doc.mjs +5 -0
  359. package/src/Typeahead/Typeahead.tsx +3 -2
  360. package/src/__tests__/complexComponentContract.test.tsx +81 -0
  361. package/src/hooks/index.ts +2 -0
  362. package/src/hooks/useContainerReveal.doc.mjs +2 -2
  363. package/src/hooks/useFocusTrap.ts +54 -107
  364. package/src/hooks/useFocusTrapEscapeShim.test.tsx +165 -0
  365. package/src/hooks/useHotkeys.test.ts +18 -0
  366. package/src/hooks/useHotkeys.ts +10 -3
  367. package/src/hooks/useListFocus.doc.mjs +2 -2
  368. package/src/hooks/useListFocus.test.tsx +65 -3
  369. package/src/hooks/useListFocus.ts +15 -7
  370. package/src/hooks/useMergedRefs.doc.mjs +79 -0
  371. package/src/hooks/useMergedRefs.test.tsx +62 -0
  372. package/src/hooks/useMergedRefs.ts +36 -0
  373. package/src/index.ts +1 -0
  374. package/src/theme/MediaTheme.doc.mjs +5 -5
  375. package/src/utils/timeParser.test.ts +6 -1
  376. package/src/utils/timeParser.ts +35 -13
  377. package/src/__tests__/inputWidthContract.test.tsx +0 -69
@@ -128,6 +128,90 @@ describe('MultiSelector', () => {
128
128
  expect(screen.getByText('2 selected')).toBeInTheDocument();
129
129
  });
130
130
 
131
+ it('formats the count display with formatValue', () => {
132
+ render(
133
+ <MultiSelector
134
+ label="Spaces"
135
+ options={defaultOptions}
136
+ value={['Apple', 'Banana']}
137
+ onChange={() => {}}
138
+ formatValue={items => `${items.length} spaces selected`}
139
+ />,
140
+ );
141
+ expect(screen.getByText('2 spaces selected')).toBeInTheDocument();
142
+ });
143
+
144
+ it('passes selected values and resolved labels to formatValue', () => {
145
+ const formatValue = vi.fn(
146
+ (items: {value: string; label: string}[]) =>
147
+ `${items[0].label} and ${items.length - 1} more`,
148
+ );
149
+ render(
150
+ <MultiSelector
151
+ label="Fruit"
152
+ options={[
153
+ {value: 'a', label: 'Apple'},
154
+ {value: 'b', label: 'Banana'},
155
+ ]}
156
+ value={['a', 'b']}
157
+ onChange={() => {}}
158
+ formatValue={formatValue}
159
+ />,
160
+ );
161
+ expect(formatValue).toHaveBeenCalledWith([
162
+ {value: 'a', label: 'Apple'},
163
+ {value: 'b', label: 'Banana'},
164
+ ]);
165
+ expect(screen.getByText('Apple and 1 more')).toBeInTheDocument();
166
+ });
167
+
168
+ it('formats the labels display with formatValue', () => {
169
+ render(
170
+ <MultiSelector
171
+ label="Fruit"
172
+ options={defaultOptions}
173
+ value={['Apple', 'Banana', 'Orange']}
174
+ onChange={() => {}}
175
+ triggerDisplay="labels"
176
+ formatValue={items => items.map(item => item.label).join(' & ')}
177
+ />,
178
+ );
179
+ expect(screen.getByText('Apple & Banana & Orange')).toBeInTheDocument();
180
+ });
181
+
182
+ it('ignores formatValue in badges display', () => {
183
+ render(
184
+ <MultiSelector
185
+ label="Fruit"
186
+ options={defaultOptions}
187
+ value={['Apple', 'Banana']}
188
+ onChange={() => {}}
189
+ triggerDisplay="badges"
190
+ formatValue={() => 'formatted'}
191
+ />,
192
+ );
193
+ expect(screen.queryByText('formatted')).not.toBeInTheDocument();
194
+ const trigger = within(screen.getByRole('combobox'));
195
+ expect(trigger.getByText('Apple')).toBeInTheDocument();
196
+ expect(trigger.getByText('Banana')).toBeInTheDocument();
197
+ });
198
+
199
+ it('shows the placeholder rather than calling formatValue when empty', () => {
200
+ const formatValue = vi.fn(() => 'formatted');
201
+ render(
202
+ <MultiSelector
203
+ label="Fruit"
204
+ options={defaultOptions}
205
+ value={[]}
206
+ onChange={() => {}}
207
+ placeholder="Pick fruits..."
208
+ formatValue={formatValue}
209
+ />,
210
+ );
211
+ expect(screen.getByText('Pick fruits...')).toBeInTheDocument();
212
+ expect(formatValue).not.toHaveBeenCalled();
213
+ });
214
+
131
215
  it('shows labels display', () => {
132
216
  render(
133
217
  <MultiSelector
@@ -1981,6 +2065,27 @@ describe('MultiSelector list structure', () => {
1981
2065
  Node.DOCUMENT_POSITION_FOLLOWING,
1982
2066
  ).toBeTruthy();
1983
2067
  });
2068
+
2069
+ it('hides a standalone divider from the accessibility tree (#4994)', async () => {
2070
+ const user = userEvent.setup();
2071
+ render(
2072
+ <MultiSelector
2073
+ label="Fruit"
2074
+ options={['Apple', {type: 'divider'}, 'Banana']}
2075
+ value={[]}
2076
+ onChange={() => {}}
2077
+ />,
2078
+ );
2079
+ await user.click(screen.getByRole('combobox'));
2080
+
2081
+ // role="listbox" only permits option/group children. The divider still
2082
+ // renders role="separator" (unchanged visual/DOM), but must be excluded
2083
+ // from the accessibility tree so it never reaches the listbox's exposed
2084
+ // children (axe aria-required-children).
2085
+ const divider = document.querySelector('[role="separator"]');
2086
+ expect(divider).toBeTruthy();
2087
+ expect(divider).toHaveAttribute('aria-hidden', 'true');
2088
+ });
1984
2089
  });
1985
2090
 
1986
2091
  describe('MultiSelector search affordances', () => {
@@ -424,6 +424,11 @@ export type MultiSelectorStatusType = 'warning' | 'error' | 'success';
424
424
 
425
425
  export type {MultiSelectorStatus};
426
426
 
427
+ export interface MultiSelectorSelectedItem {
428
+ value: string;
429
+ label: string;
430
+ }
431
+
427
432
  export interface MultiSelectorProps<
428
433
  T extends MultiSelectorOptionType = MultiSelectorOptionType,
429
434
  > extends Omit<BaseProps, 'onChange' | 'defaultValue'> {
@@ -608,6 +613,17 @@ export interface MultiSelectorProps<
608
613
  */
609
614
  triggerDisplay?: 'count' | 'labels' | 'badges';
610
615
 
616
+ /**
617
+ * Formats the trigger text when triggerDisplay is 'count' or 'labels'.
618
+ * Receives the selected items (value plus resolved label, in selection
619
+ * order) and returns the full trigger text; the count is `items.length`.
620
+ * Not called when nothing is selected — the placeholder shows instead — and
621
+ * not called for triggerDisplay 'badges', which renders Badge elements
622
+ * rather than text.
623
+ * @default items => `${items.length} selected` for 'count', "A, B, C, +N" for 'labels'
624
+ */
625
+ formatValue?: (items: MultiSelectorSelectedItem[]) => string;
626
+
611
627
  /**
612
628
  * Maximum number of badges to show before showing "+N".
613
629
  * Only used when triggerDisplay is 'badges'.
@@ -711,6 +727,7 @@ export function MultiSelector<T extends MultiSelectorOptionType>({
711
727
  hasSearch = false,
712
728
  searchPlaceholder: searchPlaceholderFromProps,
713
729
  triggerDisplay = 'count',
730
+ formatValue,
714
731
  maxBadges = 3,
715
732
  renderOption,
716
733
  indicatorPosition = 'start',
@@ -1107,13 +1124,18 @@ export function MultiSelector<T extends MultiSelectorOptionType>({
1107
1124
  }, [popover.isOpen, highlightedIndex, getItemId]);
1108
1125
 
1109
1126
  // Build trigger display content
1110
- const selectedLabels = useMemo(() => {
1127
+ const selectedItems = useMemo(() => {
1111
1128
  return optimisticValue.map(v => {
1112
1129
  const item = selectableItems.find(i => i.value === v);
1113
- return item?.label ?? v;
1130
+ return {value: v, label: item?.label ?? v};
1114
1131
  });
1115
1132
  }, [optimisticValue, selectableItems]);
1116
1133
 
1134
+ const selectedLabels = useMemo(
1135
+ () => selectedItems.map(item => item.label),
1136
+ [selectedItems],
1137
+ );
1138
+
1117
1139
  const renderTriggerContent = useCallback(() => {
1118
1140
  if (optimisticValue.length === 0) {
1119
1141
  return <span {...stylex.props(styles.triggerText)}>{placeholder}</span>;
@@ -1123,7 +1145,8 @@ export function MultiSelector<T extends MultiSelectorOptionType>({
1123
1145
  case 'count':
1124
1146
  return (
1125
1147
  <span {...stylex.props(styles.triggerText)}>
1126
- {optimisticValue.length} selected
1148
+ {formatValue?.(selectedItems) ??
1149
+ `${optimisticValue.length} selected`}
1127
1150
  </span>
1128
1151
  );
1129
1152
 
@@ -1134,7 +1157,11 @@ export function MultiSelector<T extends MultiSelectorOptionType>({
1134
1157
  remaining > 0
1135
1158
  ? `${displayed.join(', ')}, +${remaining}`
1136
1159
  : displayed.join(', ');
1137
- return <span {...stylex.props(styles.triggerText)}>{text}</span>;
1160
+ return (
1161
+ <span {...stylex.props(styles.triggerText)}>
1162
+ {formatValue?.(selectedItems) ?? text}
1163
+ </span>
1164
+ );
1138
1165
  }
1139
1166
 
1140
1167
  case 'badges': {
@@ -1154,7 +1181,15 @@ export function MultiSelector<T extends MultiSelectorOptionType>({
1154
1181
  );
1155
1182
  }
1156
1183
  }
1157
- }, [optimisticValue, triggerDisplay, selectedLabels, placeholder, maxBadges]);
1184
+ }, [
1185
+ optimisticValue,
1186
+ triggerDisplay,
1187
+ selectedItems,
1188
+ selectedLabels,
1189
+ placeholder,
1190
+ formatValue,
1191
+ maxBadges,
1192
+ ]);
1158
1193
 
1159
1194
  // Render search input
1160
1195
  const renderSearch = useCallback(() => {
@@ -1420,8 +1455,17 @@ export function MultiSelector<T extends MultiSelectorOptionType>({
1420
1455
  // A standalone divider between groups would orphan itself once its
1421
1456
  // neighbors are filtered out, so skip it while searching.
1422
1457
  if (!isSearching) {
1458
+ // role="listbox" only permits option/group children; the divider
1459
+ // carries no information the options don't, so it's hidden from
1460
+ // the accessibility tree entirely rather than exposing
1461
+ // role="separator" as a disallowed listbox child (axe
1462
+ // aria-required-children).
1423
1463
  elements.push(
1424
- <Divider key={`divider-${i}`} xstyle={styles.divider} />,
1464
+ <Divider
1465
+ key={`divider-${i}`}
1466
+ aria-hidden="true"
1467
+ xstyle={styles.divider}
1468
+ />,
1425
1469
  );
1426
1470
  }
1427
1471
  } else if (isSection(option)) {
@@ -13,6 +13,7 @@ export {
13
13
  type MultiSelectorProps,
14
14
  type MultiSelectorSize,
15
15
  type MultiSelectorStatusType,
16
+ type MultiSelectorSelectedItem,
16
17
  } from './MultiSelector';
17
18
  export type {
18
19
  MultiSelectorOptionType,
@@ -15,7 +15,7 @@
15
15
  import React, {useCallback, useMemo, type ReactNode} from 'react';
16
16
  import * as stylex from '@stylexjs/stylex';
17
17
  import {spacingVars} from '../theme/tokens.stylex';
18
- import {mergeProps, mergeRefs} from '../utils';
18
+ import {mergeProps} from '../utils';
19
19
  import type {BaseProps} from '../BaseProps';
20
20
  import {useListFocus} from '../hooks/useListFocus';
21
21
  import {useTypeahead} from '../hooks/useTypeahead';
@@ -26,6 +26,7 @@ import {
26
26
  type NavHeadingMenuSize,
27
27
  } from './NavMenuContext';
28
28
 
29
+ import {useMergedRefs} from '../hooks/useMergedRefs';
29
30
  const styles = stylex.create({
30
31
  root: {
31
32
  display: 'flex',
@@ -162,7 +163,7 @@ export function NavHeadingMenu({
162
163
  return (
163
164
  <NavHeadingMenuContext value={ctx}>
164
165
  <div
165
- ref={mergeRefs(ref, listRef)}
166
+ ref={useMergedRefs(ref, listRef)}
166
167
  role="menu"
167
168
  onKeyDown={listKeyDown}
168
169
  data-testid={testId}
@@ -61,6 +61,11 @@ export const docs = {
61
61
  description:
62
62
  'Whether the field is optional (mutually exclusive with isRequired).',
63
63
  },
64
+ {
65
+ name: 'onKeyDown',
66
+ type: '(e: KeyboardEvent<HTMLInputElement>) => void',
67
+ description: 'Callback fired on keydown events on the input.',
68
+ },
64
69
  {
65
70
  name: 'isRequired',
66
71
  type: 'boolean',
@@ -37,7 +37,7 @@ import {
37
37
  import {useLinkComponent} from '../Link/useLinkComponent';
38
38
  import {useListFocus} from '../hooks/useListFocus';
39
39
  import {useIsomorphicLayoutEffect} from '../hooks/useIsomorphicLayoutEffect';
40
- import {mergeProps, mergeRefs} from '../utils';
40
+ import {mergeProps} from '../utils';
41
41
  import type {BaseProps} from '../BaseProps';
42
42
  import {useScrollSpy} from './useScrollSpy';
43
43
  import type {OutlineItem} from './types';
@@ -45,6 +45,7 @@ import {themeProps} from '../utils/themeProps';
45
45
  import {focusOutlineProps} from '../utils/focusOutline.stylex';
46
46
  import {useTranslator} from '../i18n';
47
47
 
48
+ import {useMergedRefs} from '../hooks/useMergedRefs';
48
49
  export type {OutlineItem} from './types';
49
50
 
50
51
  export interface OutlineProps extends BaseProps<HTMLElement> {
@@ -443,7 +444,7 @@ export function Outline({
443
444
  return (
444
445
  <nav
445
446
  {...props}
446
- ref={mergeRefs(rootRef, ref)}
447
+ ref={useMergedRefs(rootRef, ref)}
447
448
  aria-label={label}
448
449
  data-testid={testId}
449
450
  {...mergeProps(
@@ -22,11 +22,12 @@ import {type ReactNode, type ReactElement, Children} from 'react';
22
22
  import type {BaseProps} from '../BaseProps';
23
23
  import type {SpacingStep} from '../utils/types';
24
24
  import * as stylex from '@stylexjs/stylex';
25
- import {mergeProps, mergeRefs} from '../utils';
25
+ import {mergeProps} from '../utils';
26
26
  import {useOverflow} from '../hooks/useOverflow';
27
27
  import {spacingVars} from '../theme/tokens.stylex';
28
28
  import {themeProps} from '../utils/themeProps';
29
29
 
30
+ import {useMergedRefs} from '../hooks/useMergedRefs';
30
31
  const styles = stylex.create({
31
32
  container: {
32
33
  display: 'flex',
@@ -280,7 +281,7 @@ export function OverflowList({
280
281
 
281
282
  {/* Visible container */}
282
283
  <div
283
- ref={mergeRefs(ref, containerRef)}
284
+ ref={useMergedRefs(ref, containerRef)}
284
285
  {...mergeProps(
285
286
  themeProps('overflow-list'),
286
287
  stylex.props(
@@ -17,7 +17,7 @@
17
17
 
18
18
  import type {ReactNode, Ref} from 'react';
19
19
  import * as stylex from '@stylexjs/stylex';
20
- import {mergeProps, mergeRefs} from '../utils';
20
+ import {mergeProps} from '../utils';
21
21
  import {useOverlay} from './useOverlay';
22
22
  import {useIsomorphicLayoutEffect} from '../hooks/useIsomorphicLayoutEffect';
23
23
  import {overlayScope, overlayContainerStyles} from './overlay.markers.stylex';
@@ -30,6 +30,7 @@ import type {
30
30
  OverlayShowOn,
31
31
  } from './OverlayScrim';
32
32
 
33
+ import {useMergedRefs} from '../hooks/useMergedRefs';
33
34
  export interface OverlayProps extends Pick<
34
35
  BaseProps<HTMLDivElement>,
35
36
  'xstyle' | 'className' | 'style'
@@ -113,7 +114,7 @@ export function Overlay({
113
114
 
114
115
  return (
115
116
  <div
116
- ref={mergeRefs(ref, overlay.containerRef)}
117
+ ref={useMergedRefs(ref, overlay.containerRef)}
117
118
  {...mergeProps(
118
119
  themeProps('overlay'),
119
120
  stylex.props(overlayScope, overlayContainerStyles.root, xstyle),
@@ -2,7 +2,8 @@
2
2
 
3
3
  /**
4
4
  * @file Popover.test.tsx
5
- * @input Uses vitest, @testing-library/react, Popover component
5
+ * @input Uses vitest, @testing-library/react, Popover, Dialog,
6
+ * SegmentedControl
6
7
  * @output Unit tests for Popover component behavior
7
8
  * @position Testing; validates Popover.tsx implementation
8
9
  *
@@ -14,6 +15,7 @@ import {render, screen, fireEvent} from '@testing-library/react';
14
15
  import React, {useRef} from 'react';
15
16
  import {Popover} from './Popover';
16
17
  import {Dialog} from '../Dialog';
18
+ import {SegmentedControl, SegmentedControlItem} from '../SegmentedControl';
17
19
 
18
20
  // Store original matches to restore later
19
21
  const originalMatches = HTMLElement.prototype.matches;
@@ -306,6 +308,30 @@ describe('Popover', () => {
306
308
  expect(trigger).toHaveAttribute('aria-expanded', 'false');
307
309
  });
308
310
 
311
+ it('dismisses on Escape pressed inside a roving-focus list', () => {
312
+ render(
313
+ <Popover
314
+ content={
315
+ <SegmentedControl value="grid" onChange={() => {}} label="View">
316
+ <SegmentedControlItem value="grid" label="Grid" />
317
+ <SegmentedControlItem value="list" label="List" />
318
+ </SegmentedControl>
319
+ }
320
+ label="Test">
321
+ <button type="button">Open</button>
322
+ </Popover>,
323
+ );
324
+ const trigger = screen.getByRole('button', {name: 'Open'});
325
+ fireEvent.click(trigger);
326
+ expect(trigger).toHaveAttribute('aria-expanded', 'true');
327
+
328
+ // From the segment, so the list's own key handler runs first. jsdom has
329
+ // no popover display, so the open content still reads as hidden.
330
+ const segment = screen.getByRole('radio', {name: 'Grid', hidden: true});
331
+ fireEvent.keyDown(segment, {key: 'Escape'});
332
+ expect(trigger).toHaveAttribute('aria-expanded', 'false');
333
+ });
334
+
309
335
  it('stays open on Escape when hasEscapeDismiss is false', () => {
310
336
  render(
311
337
  <Popover
@@ -19,6 +19,7 @@ import React, {useCallback, useEffect, useRef, type ReactNode} from 'react';
19
19
  import * as stylex from '@stylexjs/stylex';
20
20
  import {useLayer, type ContextRenderProps} from '../Layer/useLayer';
21
21
  import {useFocusTrap} from '../hooks/useFocusTrap';
22
+ import {LayerDepthProvider} from '../Layer/LayerDepthContext';
22
23
  import type {StyleXStyles} from '@stylexjs/stylex';
23
24
  import {
24
25
  colorVars,
@@ -436,34 +437,36 @@ export function usePopover(options: UsePopoverOptions = {}): UsePopoverReturn {
436
437
  : surfaceProps.className;
437
438
 
438
439
  return layer.render(
439
- <div
440
- ref={contentRef}
441
- role={role === 'dialog' ? 'dialog' : undefined}
442
- aria-modal={role === 'dialog' && isModal ? true : undefined}
443
- aria-label={role === 'dialog' ? dialogLabel : undefined}
444
- {...mergeProps(
445
- {...surfaceProps, className: surfaceClassName},
446
- stylex.props(
447
- styles.contentWrapper,
448
- hasSurface && styles.surface,
449
- xstyle,
450
- ),
451
- )}>
452
- {children}
453
- {hasCloseButton && (
454
- <div
455
- {...stylex.props(
456
- styles.closeButtonWrapper,
457
- rtlStyles.centerInline('100%'),
458
- )}>
459
- <Button
460
- variant="secondary"
461
- label={closeButtonLabel}
462
- onClick={layer.hide}
463
- />
464
- </div>
465
- )}
466
- </div>,
440
+ <LayerDepthProvider>
441
+ <div
442
+ ref={contentRef}
443
+ role={role === 'dialog' ? 'dialog' : undefined}
444
+ aria-modal={role === 'dialog' && isModal ? true : undefined}
445
+ aria-label={role === 'dialog' ? dialogLabel : undefined}
446
+ {...mergeProps(
447
+ {...surfaceProps, className: surfaceClassName},
448
+ stylex.props(
449
+ styles.contentWrapper,
450
+ hasSurface && styles.surface,
451
+ xstyle,
452
+ ),
453
+ )}>
454
+ {children}
455
+ {hasCloseButton && (
456
+ <div
457
+ {...stylex.props(
458
+ styles.closeButtonWrapper,
459
+ rtlStyles.centerInline('100%'),
460
+ )}>
461
+ <Button
462
+ variant="secondary"
463
+ label={closeButtonLabel}
464
+ onClick={layer.hide}
465
+ />
466
+ </div>
467
+ )}
468
+ </div>
469
+ </LayerDepthProvider>,
467
470
  {...props, xstyle: props?.xstyle},
468
471
  );
469
472
  },
@@ -142,6 +142,32 @@ export const docs = {
142
142
  description: 'Size of the search input and tokens.',
143
143
  default: "'md'",
144
144
  },
145
+ {
146
+ name: 'menuWidth',
147
+ type: 'number',
148
+ description: 'Maximum width for the operator/value dropdown menu in pixels.',
149
+ },
150
+ {
151
+ name: 'maxOperatorMenuItems',
152
+ type: 'number',
153
+ description: 'Maximum number of items displayed in the operator dropdown.',
154
+ },
155
+ {
156
+ name: 'tokenOverflowBehavior',
157
+ type: "'none' | 'unfocusedInline' | 'unfocusedLayer'",
158
+ description: 'Controls how tokens overflow when the container is too narrow. Forwarded to Tokenizer.',
159
+ default: "'none'",
160
+ },
161
+ {
162
+ name: 'onFocus',
163
+ type: '(e: FocusEvent<HTMLInputElement>) => void',
164
+ description: 'Fires when focus enters the search input.',
165
+ },
166
+ {
167
+ name: 'onBlur',
168
+ type: '(e: FocusEvent<HTMLInputElement>) => void',
169
+ description: 'Fires when focus leaves the search input.',
170
+ },
145
171
  {
146
172
  name: 'xstyle',
147
173
  type: 'StyleXStyles',
@@ -46,7 +46,6 @@ import {
46
46
  typeScaleVars,
47
47
  fontWeightVars,
48
48
  } from '../theme/tokens.stylex';
49
- import {mergeRefs} from '../utils';
50
49
  import {useSize} from '../SizeContext/SizeContext';
51
50
  import {useInternalConfig} from './useInternalConfig';
52
51
  import {usePowerSearchSource} from './usePowerSearchSource';
@@ -75,6 +74,7 @@ import type {
75
74
  PowerSearchComponents,
76
75
  } from './types';
77
76
 
77
+ import {useMergedRefs} from '../hooks/useMergedRefs';
78
78
  // =============================================================================
79
79
  // Icon mapping for typeahead entries
80
80
  // =============================================================================
@@ -1029,7 +1029,10 @@ export function PowerSearch({
1029
1029
  return (
1030
1030
  <>
1031
1031
  <div
1032
- ref={mergeRefs(ref, popover.triggerRef as React.Ref<HTMLDivElement>)}
1032
+ ref={useMergedRefs(
1033
+ ref,
1034
+ popover.triggerRef as React.Ref<HTMLDivElement>,
1035
+ )}
1033
1036
  {...themeProps('power-search')}>
1034
1037
  <Tokenizer
1035
1038
  handleRef={tokenizerRef}
@@ -35,11 +35,12 @@ import {
35
35
  spacingVars,
36
36
  } from '../theme/tokens.stylex';
37
37
  import {focusOutlineProps} from '../utils/focusOutline.stylex';
38
- import {mergeProps, mergeRefs, rtlStyles} from '../utils';
38
+ import {mergeProps, rtlStyles} from '../utils';
39
39
  import type {ResizableProps} from './useResizable';
40
40
  import {themeProps} from '../utils/themeProps';
41
41
  import {useTranslator} from '../i18n';
42
42
 
43
+ import {useMergedRefs} from '../hooks/useMergedRefs';
43
44
  const KEYBOARD_STEP = 10;
44
45
  const KEYBOARD_LARGE_STEP = 50;
45
46
 
@@ -549,7 +550,7 @@ export function ResizeHandle({
549
550
 
550
551
  return (
551
552
  <div
552
- ref={mergeRefs(ref, handleRef)}
553
+ ref={useMergedRefs(ref, handleRef)}
553
554
  role="separator"
554
555
  aria-orientation={isHorizontal ? 'vertical' : 'horizontal'}
555
556
  aria-valuenow={ariaValueNow}
@@ -26,11 +26,12 @@ import type {
26
26
  SegmentedControlSize,
27
27
  SegmentedControlLayout,
28
28
  } from './SegmentedControlContext';
29
- import {mergeProps, mergeRefs, composeEventHandlers} from '../utils';
29
+ import {mergeProps, composeEventHandlers} from '../utils';
30
30
  import {useSize} from '../SizeContext/SizeContext';
31
31
  import type {BaseProps} from '../BaseProps';
32
32
  import {themeProps} from '../utils/themeProps';
33
33
 
34
+ import {useMergedRefs} from '../hooks/useMergedRefs';
34
35
  export interface SegmentedControlProps extends Omit<
35
36
  BaseProps<HTMLDivElement>,
36
37
  'onChange'
@@ -258,7 +259,7 @@ export function SegmentedControl({
258
259
  return (
259
260
  <SegmentedControlContext value={contextValue}>
260
261
  <div
261
- ref={mergeRefs(ref, listRef, disabledMessageTooltip.ref)}
262
+ ref={useMergedRefs(ref, listRef, disabledMessageTooltip.ref)}
262
263
  {...rest}
263
264
  role="radiogroup"
264
265
  aria-label={label}
@@ -40,7 +40,7 @@ import * as stylex from '@stylexjs/stylex';
40
40
  import type {StyleXStyles} from '@stylexjs/stylex';
41
41
  import {colorVars, durationVars, easeVars} from '../theme/tokens.stylex';
42
42
  import type {Elevation, SizeValue, SpacingStep} from '../utils/types';
43
- import {mergeProps, mergeRefs} from '../utils';
43
+ import {mergeProps} from '../utils';
44
44
  import {Card} from '../Card/Card';
45
45
  import type {CardVariant} from '../Card/Card';
46
46
  import {useClickableContainer} from '../hooks/useClickableContainer';
@@ -48,6 +48,7 @@ import type {BaseProps} from '../BaseProps';
48
48
  import {themeProps} from '../utils/themeProps';
49
49
  import {focusOutlineProps} from '../utils/focusOutline.stylex';
50
50
 
51
+ import {useMergedRefs} from '../hooks/useMergedRefs';
51
52
  // =============================================================================
52
53
  // Styles — selection + interaction; Card handles the rest
53
54
  // =============================================================================
@@ -346,7 +347,7 @@ export function SelectableCard({
346
347
 
347
348
  return (
348
349
  <Card
349
- ref={mergeRefs(ref, containerRef)}
350
+ ref={useMergedRefs(ref, containerRef)}
350
351
  width={width}
351
352
  height={height}
352
353
  maxWidth={maxWidth}
@@ -171,7 +171,7 @@ export const docs = {
171
171
  name: 'renderValue',
172
172
  type: '(option: SelectorOptionData) => ReactNode',
173
173
  description:
174
- 'Custom render function for the selected option inside the closed trigger. The trigger is sized by padding, so it is the size token for a one-line value (28/32/36) and exactly one text line taller for a two-line one (48/52/56) — always on the 4px rhythm, always aligned with the buttons and inputs beside it. Inside an InputGroup the group owns the row height: a SelectorOption folds onto one line and ellipsizes, and any taller node is cut off at the row.',
174
+ 'Custom render function for the selected option inside the closed trigger. The trigger is sized by padding, so it is the size token for a one-line value (28/32/36) and exactly one text line taller for a two-line one (48/52/56), always on the 4px rhythm, always aligned with the buttons and inputs beside it. Inside an InputGroup the group owns the row height: a SelectorOption folds onto one line and ellipsizes, and any taller node is cut off at the row.',
175
175
  },
176
176
  {
177
177
  name: 'indicatorPosition',
@@ -186,6 +186,17 @@ export const docs = {
186
186
  description:
187
187
  'Width of the field (number = pixels, string used as-is, e.g. "100%"). Sizes the whole field (label, control, and status) so they stay aligned.',
188
188
  },
189
+ {
190
+ name: 'startIcon',
191
+ type: 'IconType | ReactNode',
192
+ description: 'Icon displayed at the start of the selector trigger.',
193
+ },
194
+ {
195
+ name: 'isLoading',
196
+ type: 'boolean',
197
+ description: 'Shows a loading spinner in the trigger.',
198
+ default: 'false',
199
+ },
189
200
  {
190
201
  name: 'xstyle',
191
202
  type: 'StyleXStyles',