@astryxdesign/core 0.3.0 → 0.4.0-canary.058f476

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 (664) hide show
  1. package/CHANGELOG.md +156 -0
  2. package/dist/AlertDialog/AlertDialog.d.ts +10 -2
  3. package/dist/AlertDialog/AlertDialog.d.ts.map +1 -1
  4. package/dist/AlertDialog/AlertDialog.js +22 -3
  5. package/dist/AppShell/AppShell.d.ts +2 -2
  6. package/dist/AppShell/AppShell.d.ts.map +1 -1
  7. package/dist/AppShell/AppShell.js +40 -9
  8. package/dist/AspectRatio/AspectRatio.d.ts +13 -0
  9. package/dist/AspectRatio/AspectRatio.d.ts.map +1 -1
  10. package/dist/AspectRatio/AspectRatio.js +10 -2
  11. package/dist/AspectRatio/index.d.ts.map +1 -1
  12. package/dist/AspectRatio/index.js +1 -2
  13. package/dist/Avatar/Avatar.d.ts.map +1 -1
  14. package/dist/Avatar/Avatar.js +33 -20
  15. package/dist/AvatarGroup/AvatarGroupOverflow.d.ts.map +1 -1
  16. package/dist/AvatarGroup/AvatarGroupOverflow.js +2 -3
  17. package/dist/Badge/Badge.d.ts.map +1 -1
  18. package/dist/Badge/Badge.js +1 -2
  19. package/dist/Badge/index.d.ts.map +1 -1
  20. package/dist/Badge/index.js +1 -2
  21. package/dist/Banner/Banner.d.ts +3 -0
  22. package/dist/Banner/Banner.d.ts.map +1 -1
  23. package/dist/Banner/Banner.js +32 -17
  24. package/dist/Blockquote/Blockquote.d.ts.map +1 -1
  25. package/dist/Blockquote/Blockquote.js +1 -2
  26. package/dist/Blockquote/index.d.ts.map +1 -1
  27. package/dist/Blockquote/index.js +1 -2
  28. package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
  29. package/dist/Breadcrumbs/BreadcrumbItem.js +21 -8
  30. package/dist/Breadcrumbs/index.d.ts +2 -1
  31. package/dist/Breadcrumbs/index.d.ts.map +1 -1
  32. package/dist/Breadcrumbs/index.js +1 -0
  33. package/dist/Button/Button.d.ts.map +1 -1
  34. package/dist/Button/Button.js +12 -16
  35. package/dist/Calendar/Calendar.d.ts.map +1 -1
  36. package/dist/Calendar/Calendar.js +2 -1
  37. package/dist/Calendar/styles.d.ts +0 -2
  38. package/dist/Calendar/styles.d.ts.map +1 -1
  39. package/dist/Calendar/styles.js +0 -2
  40. package/dist/Card/Card.d.ts.map +1 -1
  41. package/dist/Card/Card.js +1 -2
  42. package/dist/Card/index.d.ts.map +1 -1
  43. package/dist/Card/index.js +1 -2
  44. package/dist/Carousel/Carousel.d.ts.map +1 -1
  45. package/dist/Carousel/Carousel.js +8 -12
  46. package/dist/Center/Center.d.ts.map +1 -1
  47. package/dist/Center/Center.js +1 -2
  48. package/dist/Center/index.d.ts.map +1 -1
  49. package/dist/Center/index.js +1 -2
  50. package/dist/Chat/ChatDictationButton.d.ts.map +1 -1
  51. package/dist/Chat/ChatDictationButton.js +2 -1
  52. package/dist/Chat/ChatLayoutScrollButton.d.ts.map +1 -1
  53. package/dist/Chat/ChatLayoutScrollButton.js +3 -1
  54. package/dist/Chat/ChatSendButton.d.ts.map +1 -1
  55. package/dist/Chat/ChatSendButton.js +4 -3
  56. package/dist/Chat/ChatToolCalls.d.ts.map +1 -1
  57. package/dist/Chat/ChatToolCalls.js +17 -17
  58. package/dist/Chat/useTriggerMenu.d.ts.map +1 -1
  59. package/dist/Chat/useTriggerMenu.js +2 -6
  60. package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
  61. package/dist/CheckboxInput/CheckboxInput.js +36 -125
  62. package/dist/ClickableCard/ClickableCard.d.ts.map +1 -1
  63. package/dist/ClickableCard/ClickableCard.js +3 -11
  64. package/dist/Code/Code.d.ts.map +1 -1
  65. package/dist/Code/Code.js +1 -2
  66. package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
  67. package/dist/CodeBlock/CodeBlock.js +84 -67
  68. package/dist/Collapsible/Collapsible.d.ts.map +1 -1
  69. package/dist/Collapsible/Collapsible.js +35 -15
  70. package/dist/CommandPalette/CommandPalette.d.ts.map +1 -1
  71. package/dist/CommandPalette/CommandPalette.js +5 -0
  72. package/dist/CommandPalette/CommandPaletteItem.d.ts +1 -1
  73. package/dist/CommandPalette/CommandPaletteItem.d.ts.map +1 -1
  74. package/dist/CommandPalette/CommandPaletteItem.js +6 -3
  75. package/dist/CommandPalette/CommandPaletteList.js +1 -1
  76. package/dist/ComplexSelector/ComplexSelector.d.ts +1 -1
  77. package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
  78. package/dist/ComplexSelector/ComplexSelector.js +32 -31
  79. package/dist/ContextMenu/ContextMenu.d.ts +2 -2
  80. package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
  81. package/dist/ContextMenu/ContextMenu.js +1 -1
  82. package/dist/ContextMenu/index.d.ts +2 -1
  83. package/dist/ContextMenu/index.d.ts.map +1 -1
  84. package/dist/ContextMenu/index.js +1 -0
  85. package/dist/DateInput/DateInput.d.ts +9 -2
  86. package/dist/DateInput/DateInput.d.ts.map +1 -1
  87. package/dist/DateInput/DateInput.js +47 -33
  88. package/dist/DateRangeInput/DateRangeInput.d.ts +9 -2
  89. package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
  90. package/dist/DateRangeInput/DateRangeInput.js +55 -32
  91. package/dist/DateTimeInput/DateTimeInput.d.ts +9 -1
  92. package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
  93. package/dist/DateTimeInput/DateTimeInput.js +54 -30
  94. package/dist/Dialog/Dialog.d.ts.map +1 -1
  95. package/dist/Dialog/Dialog.js +4 -4
  96. package/dist/DropdownMenu/DropdownMenu.d.ts +33 -8
  97. package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
  98. package/dist/DropdownMenu/DropdownMenu.js +62 -20
  99. package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts +8 -11
  100. package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +1 -1
  101. package/dist/DropdownMenu/DropdownMenuCheckboxItem.js +32 -31
  102. package/dist/DropdownMenu/DropdownMenuDivider.d.ts +25 -0
  103. package/dist/DropdownMenu/DropdownMenuDivider.d.ts.map +1 -0
  104. package/dist/DropdownMenu/DropdownMenuDivider.js +66 -0
  105. package/dist/DropdownMenu/DropdownMenuItem.d.ts +15 -2
  106. package/dist/DropdownMenu/DropdownMenuItem.d.ts.map +1 -1
  107. package/dist/DropdownMenu/DropdownMenuItem.js +20 -8
  108. package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts +1 -1
  109. package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts.map +1 -1
  110. package/dist/DropdownMenu/DropdownMenuRadioGroup.js +10 -3
  111. package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts +5 -5
  112. package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts.map +1 -1
  113. package/dist/DropdownMenu/DropdownMenuRadioItem.js +24 -67
  114. package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -1
  115. package/dist/DropdownMenu/DropdownMenuSubMenu.js +2 -8
  116. package/dist/DropdownMenu/index.d.ts +2 -1
  117. package/dist/DropdownMenu/index.d.ts.map +1 -1
  118. package/dist/DropdownMenu/index.js +4 -0
  119. package/dist/DropdownMenu/renderDropdownItems.d.ts.map +1 -1
  120. package/dist/DropdownMenu/renderDropdownItems.js +35 -27
  121. package/dist/EmptyState/EmptyState.d.ts.map +1 -1
  122. package/dist/EmptyState/EmptyState.js +9 -5
  123. package/dist/Field/InputClearButton.d.ts +16 -3
  124. package/dist/Field/InputClearButton.d.ts.map +1 -1
  125. package/dist/Field/InputClearButton.js +15 -4
  126. package/dist/Field/PanelSearchInput.d.ts +81 -0
  127. package/dist/Field/PanelSearchInput.d.ts.map +1 -0
  128. package/dist/Field/PanelSearchInput.js +151 -0
  129. package/dist/FileInput/FileInput.d.ts.map +1 -1
  130. package/dist/FileInput/FileInput.js +21 -10
  131. package/dist/Grid/Grid.d.ts.map +1 -1
  132. package/dist/Grid/Grid.js +1 -2
  133. package/dist/Grid/index.d.ts.map +1 -1
  134. package/dist/Grid/index.js +1 -2
  135. package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
  136. package/dist/HoverCard/useHoverCard.js +3 -19
  137. package/dist/Icon/globalIconRegistry.d.ts +5 -4
  138. package/dist/Icon/globalIconRegistry.d.ts.map +1 -1
  139. package/dist/Icon/globalIconRegistry.js +5 -4
  140. package/dist/Indicator/CheckIndicator.d.ts +25 -0
  141. package/dist/Indicator/CheckIndicator.d.ts.map +1 -0
  142. package/dist/Indicator/CheckIndicator.js +155 -0
  143. package/dist/Indicator/CheckboxIndicator.d.ts +22 -0
  144. package/dist/Indicator/CheckboxIndicator.d.ts.map +1 -0
  145. package/dist/Indicator/CheckboxIndicator.js +173 -0
  146. package/dist/Indicator/RadioIndicator.d.ts +23 -0
  147. package/dist/Indicator/RadioIndicator.d.ts.map +1 -0
  148. package/dist/Indicator/RadioIndicator.js +137 -0
  149. package/dist/Indicator/index.d.ts +24 -0
  150. package/dist/Indicator/index.d.ts.map +1 -0
  151. package/dist/Indicator/index.js +26 -0
  152. package/dist/Indicator/indicator.markers.stylex.d.ts +16 -0
  153. package/dist/Indicator/indicator.markers.stylex.d.ts.map +1 -0
  154. package/dist/Indicator/indicator.markers.stylex.js +21 -0
  155. package/dist/Indicator/indicatorRegistry.d.ts +71 -0
  156. package/dist/Indicator/indicatorRegistry.d.ts.map +1 -0
  157. package/dist/Indicator/indicatorRegistry.js +93 -0
  158. package/dist/Indicator/types.d.ts +177 -0
  159. package/dist/Indicator/types.d.ts.map +1 -0
  160. package/dist/Indicator/types.js +1 -0
  161. package/dist/Indicator/useIndicator.d.ts +18 -0
  162. package/dist/Indicator/useIndicator.d.ts.map +1 -0
  163. package/dist/Indicator/useIndicator.js +30 -0
  164. package/dist/Item/Item.d.ts.map +1 -1
  165. package/dist/Item/Item.js +4 -8
  166. package/dist/Layer/useLayer.d.ts +14 -0
  167. package/dist/Layer/useLayer.d.ts.map +1 -1
  168. package/dist/Layer/useLayer.js +25 -2
  169. package/dist/Lightbox/Lightbox.d.ts.map +1 -1
  170. package/dist/Lightbox/Lightbox.js +80 -103
  171. package/dist/Link/Link.d.ts.map +1 -1
  172. package/dist/Link/Link.js +4 -5
  173. package/dist/MobileNav/MobileNav.js +8 -8
  174. package/dist/MoreMenu/MoreMenu.d.ts +14 -1
  175. package/dist/MoreMenu/MoreMenu.d.ts.map +1 -1
  176. package/dist/MoreMenu/MoreMenu.js +4 -0
  177. package/dist/MultiSelector/MultiSelector.d.ts +8 -1
  178. package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
  179. package/dist/MultiSelector/MultiSelector.js +205 -170
  180. package/dist/NumberInput/NumberInput.d.ts +27 -1
  181. package/dist/NumberInput/NumberInput.d.ts.map +1 -1
  182. package/dist/NumberInput/NumberInput.js +230 -42
  183. package/dist/Outline/Outline.d.ts.map +1 -1
  184. package/dist/Outline/Outline.js +2 -3
  185. package/dist/Pagination/Pagination.d.ts.map +1 -1
  186. package/dist/Pagination/Pagination.js +61 -63
  187. package/dist/Popover/Popover.d.ts.map +1 -1
  188. package/dist/Popover/Popover.js +6 -8
  189. package/dist/Popover/usePopover.d.ts +15 -0
  190. package/dist/Popover/usePopover.d.ts.map +1 -1
  191. package/dist/Popover/usePopover.js +14 -2
  192. package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
  193. package/dist/PowerSearch/PowerSearch.js +1 -1
  194. package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
  195. package/dist/PowerSearch/PowerSearchEditPopover.js +7 -0
  196. package/dist/ProgressBar/ProgressBar.d.ts +11 -4
  197. package/dist/ProgressBar/ProgressBar.d.ts.map +1 -1
  198. package/dist/ProgressBar/ProgressBar.js +95 -6
  199. package/dist/RadioList/RadioListItem.d.ts.map +1 -1
  200. package/dist/RadioList/RadioListItem.js +29 -84
  201. package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
  202. package/dist/Resizable/ResizeHandle.js +2 -3
  203. package/dist/Section/Section.d.ts.map +1 -1
  204. package/dist/Section/Section.js +1 -2
  205. package/dist/Section/index.d.ts.map +1 -1
  206. package/dist/Section/index.js +1 -2
  207. package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
  208. package/dist/SegmentedControl/SegmentedControlItem.js +2 -3
  209. package/dist/SelectableCard/SelectableCard.d.ts.map +1 -1
  210. package/dist/SelectableCard/SelectableCard.js +3 -11
  211. package/dist/Selector/Selector.d.ts +12 -1
  212. package/dist/Selector/Selector.d.ts.map +1 -1
  213. package/dist/Selector/Selector.js +293 -183
  214. package/dist/Selector/hooks.d.ts +18 -6
  215. package/dist/Selector/hooks.d.ts.map +1 -1
  216. package/dist/Selector/hooks.js +57 -40
  217. package/dist/SideNav/SideNav.d.ts.map +1 -1
  218. package/dist/SideNav/SideNav.js +1 -1
  219. package/dist/SideNav/SideNavCollapseButton.d.ts +1 -1
  220. package/dist/SideNav/SideNavCollapseButton.d.ts.map +1 -1
  221. package/dist/SideNav/SideNavCollapseButton.js +29 -14
  222. package/dist/SideNav/SideNavHeading.d.ts.map +1 -1
  223. package/dist/SideNav/SideNavHeading.js +56 -20
  224. package/dist/SideNav/SideNavItem.d.ts.map +1 -1
  225. package/dist/SideNav/SideNavItem.js +28 -22
  226. package/dist/Skeleton/Skeleton.d.ts.map +1 -1
  227. package/dist/Skeleton/Skeleton.js +1 -2
  228. package/dist/Skeleton/index.d.ts.map +1 -1
  229. package/dist/Skeleton/index.js +1 -2
  230. package/dist/Slider/Slider.d.ts.map +1 -1
  231. package/dist/Slider/Slider.js +2 -6
  232. package/dist/Stack/stack.stylex.d.ts +3 -3
  233. package/dist/Switch/Switch.d.ts.map +1 -1
  234. package/dist/Switch/Switch.js +14 -13
  235. package/dist/TabList/Tab.d.ts.map +1 -1
  236. package/dist/TabList/Tab.js +2 -3
  237. package/dist/TabList/TabMenu.d.ts.map +1 -1
  238. package/dist/TabList/TabMenu.js +41 -19
  239. package/dist/Table/BaseTable.d.ts.map +1 -1
  240. package/dist/Table/BaseTable.js +8 -0
  241. package/dist/Table/TableRow.d.ts +1 -1
  242. package/dist/Table/TableRow.d.ts.map +1 -1
  243. package/dist/Table/TableRow.js +4 -2
  244. package/dist/Table/index.d.ts +1 -1
  245. package/dist/Table/index.d.ts.map +1 -1
  246. package/dist/Table/index.js +1 -1
  247. package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts +1 -1
  248. package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts.map +1 -1
  249. package/dist/Table/plugins/groupedRows/useTableGroupedRows.js +22 -18
  250. package/dist/Table/plugins/rowExpansion/index.d.ts +1 -1
  251. package/dist/Table/plugins/rowExpansion/index.d.ts.map +1 -1
  252. package/dist/Table/plugins/rowExpansion/index.js +1 -1
  253. package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts +41 -76
  254. package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
  255. package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +94 -345
  256. package/dist/Table/plugins/sortable/useTableSortable.d.ts.map +1 -1
  257. package/dist/Table/plugins/sortable/useTableSortable.js +23 -4
  258. package/dist/Table/plugins/tree/useTableTreeData.d.ts.map +1 -1
  259. package/dist/Table/plugins/tree/useTableTreeData.js +29 -33
  260. package/dist/Table/tableContextMenu.d.ts.map +1 -1
  261. package/dist/Table/tableContextMenu.js +2 -1
  262. package/dist/Table/types.d.ts +11 -0
  263. package/dist/Table/types.d.ts.map +1 -1
  264. package/dist/TextArea/TextArea.d.ts +10 -1
  265. package/dist/TextArea/TextArea.d.ts.map +1 -1
  266. package/dist/TextArea/TextArea.js +16 -6
  267. package/dist/TextInput/TextInput.d.ts +10 -1
  268. package/dist/TextInput/TextInput.d.ts.map +1 -1
  269. package/dist/TextInput/TextInput.js +13 -19
  270. package/dist/Thumbnail/Thumbnail.d.ts.map +1 -1
  271. package/dist/Thumbnail/Thumbnail.js +32 -26
  272. package/dist/TimeInput/TimeInput.d.ts.map +1 -1
  273. package/dist/TimeInput/TimeInput.js +14 -17
  274. package/dist/Timestamp/Timestamp.d.ts.map +1 -1
  275. package/dist/Timestamp/Timestamp.js +14 -3
  276. package/dist/Timestamp/TimestampHoverCard.d.ts.map +1 -1
  277. package/dist/Timestamp/TimestampHoverCard.js +16 -34
  278. package/dist/Timestamp/formatInstant.d.ts +11 -1
  279. package/dist/Timestamp/formatInstant.d.ts.map +1 -1
  280. package/dist/Timestamp/formatInstant.js +3 -1
  281. package/dist/Token/Token.d.ts.map +1 -1
  282. package/dist/Token/Token.js +20 -11
  283. package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
  284. package/dist/Tokenizer/Tokenizer.js +4 -2
  285. package/dist/Tooltip/useTooltip.d.ts.map +1 -1
  286. package/dist/Tooltip/useTooltip.js +3 -19
  287. package/dist/TopNav/TopNav.d.ts.map +1 -1
  288. package/dist/TopNav/TopNav.js +6 -5
  289. package/dist/TopNav/TopNavHeading.d.ts.map +1 -1
  290. package/dist/TopNav/TopNavHeading.js +54 -16
  291. package/dist/TopNav/TopNavItem.d.ts.map +1 -1
  292. package/dist/TopNav/TopNavItem.js +3 -9
  293. package/dist/TopNav/TopNavMegaMenu.d.ts +7 -0
  294. package/dist/TopNav/TopNavMegaMenu.d.ts.map +1 -1
  295. package/dist/TopNav/TopNavMegaMenu.js +146 -60
  296. package/dist/TopNav/TopNavMegaMenuItem.d.ts.map +1 -1
  297. package/dist/TopNav/TopNavMegaMenuItem.js +22 -3
  298. package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
  299. package/dist/TopNav/TopNavMenu.js +83 -38
  300. package/dist/TreeList/TreeList.d.ts.map +1 -1
  301. package/dist/TreeList/TreeList.js +13 -0
  302. package/dist/TreeList/TreeListBranches.d.ts +1 -1
  303. package/dist/TreeList/TreeListBranches.d.ts.map +1 -1
  304. package/dist/TreeList/TreeListBranches.js +14 -4
  305. package/dist/TreeList/TreeListItem.d.ts +11 -1
  306. package/dist/TreeList/TreeListItem.d.ts.map +1 -1
  307. package/dist/TreeList/TreeListItem.js +57 -30
  308. package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
  309. package/dist/Typeahead/BaseTypeahead.js +16 -8
  310. package/dist/VisuallyHidden/VisuallyHidden.d.ts.map +1 -1
  311. package/dist/VisuallyHidden/VisuallyHidden.js +1 -2
  312. package/dist/VisuallyHidden/index.d.ts.map +1 -1
  313. package/dist/VisuallyHidden/index.js +1 -2
  314. package/dist/astryx.css +86 -96
  315. package/dist/astryx.umd.js +56 -56
  316. package/dist/astryx.umd.js.map +4 -4
  317. package/dist/hooks/containerReveal.stylex.d.ts +61 -0
  318. package/dist/hooks/containerReveal.stylex.d.ts.map +1 -0
  319. package/dist/hooks/containerReveal.stylex.js +63 -0
  320. package/dist/hooks/index.d.ts +3 -0
  321. package/dist/hooks/index.d.ts.map +1 -1
  322. package/dist/hooks/index.js +2 -0
  323. package/dist/hooks/useClipboard.d.ts +59 -0
  324. package/dist/hooks/useClipboard.d.ts.map +1 -0
  325. package/dist/hooks/useClipboard.js +106 -0
  326. package/dist/hooks/useContainerReveal.d.ts +14 -8
  327. package/dist/hooks/useContainerReveal.d.ts.map +1 -1
  328. package/dist/hooks/useContainerReveal.js +28 -69
  329. package/dist/hooks/useIndicatorFocusRing.d.ts +28 -0
  330. package/dist/hooks/useIndicatorFocusRing.d.ts.map +1 -0
  331. package/dist/hooks/useIndicatorFocusRing.js +96 -0
  332. package/dist/hooks/useInputStatusIcon.d.ts.map +1 -1
  333. package/dist/hooks/useInputStatusIcon.js +17 -4
  334. package/dist/hooks/useLongPress.d.ts.map +1 -1
  335. package/dist/hooks/useLongPress.js +12 -2
  336. package/dist/hooks/useScrollLock.d.ts.map +1 -1
  337. package/dist/hooks/useScrollLock.js +33 -18
  338. package/dist/hooks/useStreamingText.d.ts +18 -3
  339. package/dist/hooks/useStreamingText.d.ts.map +1 -1
  340. package/dist/hooks/useStreamingText.js +47 -7
  341. package/dist/hooks/useTreeFocus.d.ts.map +1 -1
  342. package/dist/hooks/useTreeFocus.js +9 -3
  343. package/dist/hooks/useTypeahead.d.ts +3 -2
  344. package/dist/hooks/useTypeahead.d.ts.map +1 -1
  345. package/dist/hooks/useTypeahead.js +19 -7
  346. package/dist/index.d.ts +1 -0
  347. package/dist/index.d.ts.map +1 -1
  348. package/dist/index.js +1 -0
  349. package/dist/theme/defineTheme.d.ts +18 -2
  350. package/dist/theme/defineTheme.d.ts.map +1 -1
  351. package/dist/theme/defineTheme.js +10 -1
  352. package/dist/theme/derivedVarRegistry.d.ts +8 -0
  353. package/dist/theme/derivedVarRegistry.d.ts.map +1 -1
  354. package/dist/theme/derivedVarRegistry.js +14 -13
  355. package/dist/theme/expandColorScale.d.ts +3 -1
  356. package/dist/theme/expandColorScale.d.ts.map +1 -1
  357. package/dist/theme/expandColorScale.js +17 -7
  358. package/dist/theme/expandTypeScale.d.ts.map +1 -1
  359. package/dist/theme/expandTypeScale.js +17 -0
  360. package/dist/theme/generateThemeRules.d.ts.map +1 -1
  361. package/dist/theme/generateThemeRules.js +11 -0
  362. package/dist/theme/index.d.ts +2 -1
  363. package/dist/theme/index.d.ts.map +1 -1
  364. package/dist/theme/index.js +1 -1
  365. package/dist/theme/tokens.stylex.d.ts +12 -0
  366. package/dist/theme/tokens.stylex.d.ts.map +1 -1
  367. package/dist/theme/tokens.stylex.js +23 -0
  368. package/dist/utils/focusOutline.stylex.d.ts +122 -0
  369. package/dist/utils/focusOutline.stylex.d.ts.map +1 -0
  370. package/dist/utils/focusOutline.stylex.js +143 -0
  371. package/dist/utils/focusReturn.d.ts +24 -0
  372. package/dist/utils/focusReturn.d.ts.map +1 -0
  373. package/dist/utils/focusReturn.js +29 -0
  374. package/dist/utils/index.d.ts +2 -0
  375. package/dist/utils/index.d.ts.map +1 -1
  376. package/dist/utils/index.js +6 -1
  377. package/dist/utils/interactionModality.d.ts +34 -0
  378. package/dist/utils/interactionModality.d.ts.map +1 -0
  379. package/dist/utils/interactionModality.js +70 -0
  380. package/dist/utils/mergeRefs.d.ts.map +1 -1
  381. package/dist/utils/mergeRefs.js +7 -5
  382. package/dist/utils/rtlStyles.d.ts +2 -2
  383. package/dist/utils/rtlStyles.js +2 -2
  384. package/dist/utils/themeProps.d.ts +20 -1
  385. package/dist/utils/themeProps.d.ts.map +1 -1
  386. package/dist/utils/themeProps.js +8 -2
  387. package/locales/en.json +52 -0
  388. package/locales/pseudo.json +39 -0
  389. package/package.json +8 -3
  390. package/src/AlertDialog/AlertDialog.doc.mjs +16 -3
  391. package/src/AlertDialog/AlertDialog.test.tsx +208 -1
  392. package/src/AlertDialog/AlertDialog.tsx +21 -3
  393. package/src/AppShell/AppShell.doc.mjs +14 -0
  394. package/src/AppShell/AppShell.test.tsx +139 -0
  395. package/src/AppShell/AppShell.tsx +32 -22
  396. package/src/AspectRatio/AspectRatio.doc.mjs +27 -3
  397. package/src/AspectRatio/AspectRatio.test.tsx +30 -0
  398. package/src/AspectRatio/AspectRatio.tsx +13 -2
  399. package/src/AspectRatio/index.ts +0 -2
  400. package/src/Avatar/Avatar.doc.mjs +2 -13
  401. package/src/Avatar/Avatar.test.tsx +33 -8
  402. package/src/Avatar/Avatar.tsx +52 -50
  403. package/src/AvatarGroup/AvatarGroupOverflow.tsx +2 -9
  404. package/src/Badge/Badge.tsx +0 -2
  405. package/src/Badge/index.ts +0 -2
  406. package/src/Banner/Banner.test.tsx +58 -1
  407. package/src/Banner/Banner.tsx +33 -11
  408. package/src/Blockquote/Blockquote.tsx +0 -2
  409. package/src/Blockquote/index.ts +0 -2
  410. package/src/Breadcrumbs/BreadcrumbItem.tsx +16 -6
  411. package/src/Breadcrumbs/index.ts +5 -1
  412. package/src/Button/Button.doc.mjs +2 -2
  413. package/src/Button/Button.tsx +22 -41
  414. package/src/Calendar/Calendar.tsx +2 -1
  415. package/src/Calendar/styles.ts +0 -8
  416. package/src/Card/Card.tsx +0 -2
  417. package/src/Card/index.ts +0 -2
  418. package/src/Carousel/Carousel.doc.mjs +3 -0
  419. package/src/Carousel/Carousel.tsx +10 -6
  420. package/src/Center/Center.tsx +0 -2
  421. package/src/Center/index.ts +0 -2
  422. package/src/Chat/Chat.doc.mjs +2 -0
  423. package/src/Chat/ChatDictationButton.tsx +7 -1
  424. package/src/Chat/ChatLayoutScrollButton.test.tsx +22 -0
  425. package/src/Chat/ChatLayoutScrollButton.tsx +8 -1
  426. package/src/Chat/ChatSendButton.tsx +2 -3
  427. package/src/Chat/ChatToolCalls.test.tsx +35 -0
  428. package/src/Chat/ChatToolCalls.tsx +36 -16
  429. package/src/Chat/useTriggerMenu.tsx +2 -5
  430. package/src/CheckboxInput/CheckboxInput.doc.mjs +4 -2
  431. package/src/CheckboxInput/CheckboxInput.test.tsx +120 -0
  432. package/src/CheckboxInput/CheckboxInput.tsx +45 -202
  433. package/src/ClickableCard/ClickableCard.tsx +6 -11
  434. package/src/Code/Code.tsx +0 -2
  435. package/src/CodeBlock/CodeBlock.doc.mjs +3 -0
  436. package/src/CodeBlock/CodeBlock.test.tsx +91 -0
  437. package/src/CodeBlock/CodeBlock.tsx +57 -80
  438. package/src/Collapsible/Collapsible.tsx +22 -18
  439. package/src/CommandPalette/CommandPalette.test.tsx +83 -0
  440. package/src/CommandPalette/CommandPalette.tsx +5 -0
  441. package/src/CommandPalette/CommandPaletteItem.tsx +7 -4
  442. package/src/CommandPalette/CommandPaletteList.tsx +2 -2
  443. package/src/ComplexSelector/ComplexSelector.doc.mjs +42 -0
  444. package/src/ComplexSelector/ComplexSelector.test.tsx +73 -0
  445. package/src/ComplexSelector/ComplexSelector.tsx +41 -28
  446. package/src/ContextMenu/ContextMenu.doc.mjs +1 -1
  447. package/src/ContextMenu/ContextMenu.test.tsx +41 -0
  448. package/src/ContextMenu/ContextMenu.tsx +3 -3
  449. package/src/ContextMenu/index.ts +5 -1
  450. package/src/DateInput/DateInput.doc.mjs +18 -3
  451. package/src/DateInput/DateInput.test.tsx +112 -11
  452. package/src/DateInput/DateInput.tsx +44 -25
  453. package/src/DateRangeInput/DateRangeInput.doc.mjs +10 -2
  454. package/src/DateRangeInput/DateRangeInput.test.tsx +110 -14
  455. package/src/DateRangeInput/DateRangeInput.tsx +27 -21
  456. package/src/DateTimeInput/DateTimeInput.doc.mjs +16 -2
  457. package/src/DateTimeInput/DateTimeInput.test.tsx +154 -1
  458. package/src/DateTimeInput/DateTimeInput.tsx +58 -17
  459. package/src/Dialog/Dialog.tsx +2 -9
  460. package/src/DropdownMenu/DropdownMenu.doc.mjs +5 -9
  461. package/src/DropdownMenu/DropdownMenu.test.tsx +534 -4
  462. package/src/DropdownMenu/DropdownMenu.tsx +113 -52
  463. package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +27 -30
  464. package/src/DropdownMenu/DropdownMenuDivider.doc.mjs +34 -0
  465. package/src/DropdownMenu/DropdownMenuDivider.tsx +81 -0
  466. package/src/DropdownMenu/DropdownMenuItem.doc.mjs +39 -4
  467. package/src/DropdownMenu/DropdownMenuItem.tsx +48 -10
  468. package/src/DropdownMenu/DropdownMenuRadioGroup.tsx +2 -1
  469. package/src/DropdownMenu/DropdownMenuRadioItem.tsx +30 -76
  470. package/src/DropdownMenu/DropdownMenuSelectable.test.tsx +25 -19
  471. package/src/DropdownMenu/DropdownMenuSubMenu.test.tsx +44 -14
  472. package/src/DropdownMenu/DropdownMenuSubMenu.tsx +1 -5
  473. package/src/DropdownMenu/index.ts +8 -1
  474. package/src/DropdownMenu/renderDropdownItems.tsx +33 -34
  475. package/src/EmptyState/EmptyState.doc.mjs +4 -0
  476. package/src/EmptyState/EmptyState.test.tsx +62 -0
  477. package/src/EmptyState/EmptyState.tsx +16 -6
  478. package/src/Field/Field.doc.mjs +1 -0
  479. package/src/Field/InputClearButton.test.tsx +117 -0
  480. package/src/Field/InputClearButton.tsx +30 -3
  481. package/src/Field/PanelSearchInput.tsx +271 -0
  482. package/src/FileInput/FileInput.tsx +21 -8
  483. package/src/Grid/Grid.tsx +0 -2
  484. package/src/Grid/index.ts +0 -2
  485. package/src/HoverCard/useHoverCard.tsx +2 -23
  486. package/src/Icon/Icon.doc.mjs +2 -1
  487. package/src/Icon/globalIconRegistry.tsx +5 -4
  488. package/src/Indicator/CheckIndicator.tsx +174 -0
  489. package/src/Indicator/CheckboxIndicator.tsx +257 -0
  490. package/src/Indicator/Indicator.doc.mjs +344 -0
  491. package/src/Indicator/Indicator.test.tsx +393 -0
  492. package/src/Indicator/RadioIndicator.tsx +206 -0
  493. package/src/Indicator/index.ts +46 -0
  494. package/src/Indicator/indicator.markers.stylex.ts +19 -0
  495. package/src/Indicator/indicatorRegistry.test.tsx +106 -0
  496. package/src/Indicator/indicatorRegistry.ts +120 -0
  497. package/src/Indicator/types.ts +197 -0
  498. package/src/Indicator/useIndicator.ts +39 -0
  499. package/src/Item/Item.doc.mjs +1 -1
  500. package/src/Item/Item.tsx +7 -14
  501. package/src/Layer/useLayer.doc.mjs +2 -2
  502. package/src/Layer/useLayer.test.tsx +85 -0
  503. package/src/Layer/useLayer.tsx +39 -1
  504. package/src/Lightbox/Lightbox.doc.mjs +1 -1
  505. package/src/Lightbox/Lightbox.tsx +45 -49
  506. package/src/Link/Link.tsx +4 -11
  507. package/src/MobileNav/MobileNav.tsx +3 -3
  508. package/src/MoreMenu/MoreMenu.doc.mjs +31 -0
  509. package/src/MoreMenu/MoreMenu.test.tsx +68 -1
  510. package/src/MoreMenu/MoreMenu.tsx +19 -0
  511. package/src/MultiSelector/MultiSelector.doc.mjs +18 -1
  512. package/src/MultiSelector/MultiSelector.test.tsx +387 -18
  513. package/src/MultiSelector/MultiSelector.tsx +267 -220
  514. package/src/NumberInput/NumberInput.doc.mjs +265 -50
  515. package/src/NumberInput/NumberInput.test.tsx +726 -21
  516. package/src/NumberInput/NumberInput.tsx +353 -59
  517. package/src/Outline/Outline.tsx +2 -5
  518. package/src/Pagination/Pagination.doc.mjs +1 -1
  519. package/src/Pagination/Pagination.test.tsx +22 -7
  520. package/src/Pagination/Pagination.tsx +38 -35
  521. package/src/Popover/Popover.doc.mjs +2 -0
  522. package/src/Popover/Popover.tsx +6 -7
  523. package/src/Popover/usePopover.tsx +37 -4
  524. package/src/PowerSearch/PowerSearch.tsx +1 -1
  525. package/src/PowerSearch/PowerSearchEditPopover.test.tsx +42 -0
  526. package/src/PowerSearch/PowerSearchEditPopover.tsx +7 -0
  527. package/src/ProgressBar/ProgressBar.doc.mjs +27 -5
  528. package/src/ProgressBar/ProgressBar.test.tsx +224 -1
  529. package/src/ProgressBar/ProgressBar.tsx +126 -30
  530. package/src/RadioList/RadioList.doc.mjs +4 -2
  531. package/src/RadioList/RadioListItem.tsx +31 -130
  532. package/src/Resizable/ResizeHandle.tsx +2 -9
  533. package/src/Section/Section.tsx +0 -2
  534. package/src/Section/index.ts +0 -2
  535. package/src/SegmentedControl/SegmentedControlItem.tsx +2 -9
  536. package/src/SelectableCard/SelectableCard.tsx +4 -9
  537. package/src/Selector/Selector.doc.mjs +17 -4
  538. package/src/Selector/Selector.test.tsx +1394 -100
  539. package/src/Selector/Selector.tsx +355 -212
  540. package/src/Selector/hooks.ts +77 -50
  541. package/src/SideNav/SideNav.test.tsx +46 -0
  542. package/src/SideNav/SideNav.tsx +1 -0
  543. package/src/SideNav/SideNavCollapseButton.tsx +15 -10
  544. package/src/SideNav/SideNavHeading.tsx +48 -10
  545. package/src/SideNav/SideNavItem.tsx +20 -12
  546. package/src/Skeleton/Skeleton.tsx +0 -2
  547. package/src/Skeleton/index.ts +0 -2
  548. package/src/Slider/Slider.tsx +2 -11
  549. package/src/Stack/Stack.doc.mjs +110 -0
  550. package/src/StatusDot/StatusDot.doc.mjs +12 -3
  551. package/src/Switch/Switch.test.tsx +32 -0
  552. package/src/Switch/Switch.tsx +18 -10
  553. package/src/TabList/Tab.tsx +2 -9
  554. package/src/TabList/TabMenu.tsx +14 -21
  555. package/src/Table/BaseTable.tsx +11 -0
  556. package/src/Table/Table.test.tsx +31 -0
  557. package/src/Table/TableRow.tsx +6 -0
  558. package/src/Table/index.ts +1 -4
  559. package/src/Table/plugins/groupedRows/useTableGroupedRows.tsx +30 -14
  560. package/src/Table/plugins/rowExpansion/index.ts +1 -4
  561. package/src/Table/plugins/rowExpansion/useTableRowExpansion.test.tsx +125 -175
  562. package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +115 -458
  563. package/src/Table/plugins/sortable/useTableSortable.tsx +2 -6
  564. package/src/Table/plugins/tree/useTableTreeData.tsx +43 -24
  565. package/src/Table/tableContextMenu.test.tsx +27 -0
  566. package/src/Table/tableContextMenu.tsx +1 -0
  567. package/src/Table/types.ts +11 -0
  568. package/src/Table/useTableGroupedRows.doc.mjs +1 -1
  569. package/src/Table/useTableRowExpansion.doc.mjs +43 -66
  570. package/src/TextArea/TextArea.doc.mjs +42 -2
  571. package/src/TextArea/TextArea.test.tsx +219 -0
  572. package/src/TextArea/TextArea.tsx +34 -7
  573. package/src/TextInput/TextInput.doc.mjs +18 -2
  574. package/src/TextInput/TextInput.test.tsx +189 -0
  575. package/src/TextInput/TextInput.tsx +25 -31
  576. package/src/Thumbnail/Thumbnail.tsx +2 -9
  577. package/src/TimeInput/TimeInput.doc.mjs +2 -2
  578. package/src/TimeInput/TimeInput.test.tsx +84 -3
  579. package/src/TimeInput/TimeInput.tsx +26 -28
  580. package/src/Timestamp/Timestamp.doc.mjs +4 -3
  581. package/src/Timestamp/Timestamp.test.tsx +91 -14
  582. package/src/Timestamp/Timestamp.tsx +14 -2
  583. package/src/Timestamp/TimestampHoverCard.tsx +13 -35
  584. package/src/Timestamp/formatInstant.ts +16 -1
  585. package/src/Token/Token.tsx +5 -28
  586. package/src/Tokenizer/Tokenizer.doc.mjs +2 -2
  587. package/src/Tokenizer/Tokenizer.test.tsx +45 -3
  588. package/src/Tokenizer/Tokenizer.tsx +10 -2
  589. package/src/Tooltip/useTooltip.tsx +2 -23
  590. package/src/TopNav/TopNav.tsx +1 -3
  591. package/src/TopNav/TopNavHeading.tsx +42 -13
  592. package/src/TopNav/TopNavItem.tsx +3 -21
  593. package/src/TopNav/TopNavMegaMenu.doc.mjs +5 -0
  594. package/src/TopNav/TopNavMegaMenu.test.tsx +433 -33
  595. package/src/TopNav/TopNavMegaMenu.tsx +118 -53
  596. package/src/TopNav/TopNavMegaMenuItem.tsx +2 -9
  597. package/src/TopNav/TopNavMenu.tsx +34 -37
  598. package/src/TreeList/TreeList.doc.mjs +5 -0
  599. package/src/TreeList/TreeList.test.tsx +208 -8
  600. package/src/TreeList/TreeList.tsx +22 -0
  601. package/src/TreeList/TreeListBranches.tsx +25 -2
  602. package/src/TreeList/TreeListItem.tsx +89 -52
  603. package/src/Typeahead/BaseTypeahead.tsx +19 -6
  604. package/src/Typeahead/Typeahead.doc.mjs +1 -0
  605. package/src/Typeahead/Typeahead.test.tsx +76 -3
  606. package/src/VisuallyHidden/VisuallyHidden.tsx +0 -2
  607. package/src/VisuallyHidden/index.ts +0 -2
  608. package/src/hooks/containerReveal.stylex.ts +102 -0
  609. package/src/hooks/index.ts +4 -0
  610. package/src/hooks/useClipboard.doc.mjs +87 -0
  611. package/src/hooks/useClipboard.test.tsx +151 -0
  612. package/src/hooks/useClipboard.ts +135 -0
  613. package/src/hooks/useContainerReveal.doc.mjs +7 -7
  614. package/src/hooks/useContainerReveal.test.tsx +42 -62
  615. package/src/hooks/useContainerReveal.ts +36 -91
  616. package/src/hooks/useImageMode.test.ts +1 -1
  617. package/src/hooks/useIndicatorFocusRing.tsx +120 -0
  618. package/src/hooks/useInputStatusIcon.tsx +8 -8
  619. package/src/hooks/useLongPress.test.tsx +18 -0
  620. package/src/hooks/useLongPress.ts +12 -2
  621. package/src/hooks/useScrollLock.test.ts +72 -0
  622. package/src/hooks/useScrollLock.ts +51 -19
  623. package/src/hooks/useStreamingText.test.ts +46 -1
  624. package/src/hooks/useStreamingText.ts +49 -7
  625. package/src/hooks/useTreeFocus.test.tsx +50 -0
  626. package/src/hooks/useTreeFocus.ts +14 -3
  627. package/src/hooks/useTypeahead.test.tsx +150 -0
  628. package/src/hooks/useTypeahead.ts +24 -9
  629. package/src/i18n/InternationalizationProvider.doc.mjs +7 -2
  630. package/src/index.ts +1 -0
  631. package/src/serverSafeComponents.test.ts +665 -0
  632. package/src/theme/defineTheme.ts +27 -0
  633. package/src/theme/derivedVarRegistry.test.ts +21 -1
  634. package/src/theme/derivedVarRegistry.ts +19 -6
  635. package/src/theme/expandColorScale.test.ts +14 -0
  636. package/src/theme/expandColorScale.ts +24 -9
  637. package/src/theme/expandTypeScale.test.ts +43 -0
  638. package/src/theme/expandTypeScale.ts +17 -0
  639. package/src/theme/generateThemeRules.test.ts +78 -20
  640. package/src/theme/generateThemeRules.ts +11 -0
  641. package/src/theme/index.ts +15 -0
  642. package/src/theme/tokens.stylex.ts +18 -0
  643. package/src/theme/tokens.test.ts +37 -0
  644. package/src/utils/focusOutline.stylex.ts +177 -0
  645. package/src/utils/focusReturn.test.ts +42 -0
  646. package/src/utils/focusReturn.ts +31 -0
  647. package/src/utils/index.ts +5 -0
  648. package/src/utils/interactionModality.ts +74 -0
  649. package/src/utils/mergeRefs.test.ts +48 -0
  650. package/src/utils/mergeRefs.ts +12 -6
  651. package/src/utils/rtlStyles.ts +2 -2
  652. package/src/utils/themeProps.ts +26 -4
  653. package/dist/CheckboxInput/checkbox.markers.stylex.d.ts +0 -9
  654. package/dist/CheckboxInput/checkbox.markers.stylex.d.ts.map +0 -1
  655. package/dist/CheckboxInput/checkbox.markers.stylex.js +0 -14
  656. package/dist/RadioList/radio.markers.stylex.d.ts +0 -7
  657. package/dist/RadioList/radio.markers.stylex.d.ts.map +0 -1
  658. package/dist/RadioList/radio.markers.stylex.js +0 -12
  659. package/dist/hooks/containerReveal.pool.stylex.d.ts +0 -303
  660. package/dist/hooks/containerReveal.pool.stylex.d.ts.map +0 -1
  661. package/dist/hooks/containerReveal.pool.stylex.js +0 -292
  662. package/src/CheckboxInput/checkbox.markers.stylex.ts +0 -12
  663. package/src/RadioList/radio.markers.stylex.ts +0 -10
  664. package/src/hooks/containerReveal.pool.stylex.ts +0 -571
@@ -4,7 +4,8 @@
4
4
 
5
5
  /**
6
6
  * @file Selector.tsx
7
- * @input Uses React, StyleX, usePopover, useTooltip, Icon, InputGroupContext
7
+ * @input Uses React, StyleX, usePopover, useTooltip, Icon, InputGroupContext,
8
+ * and Selector positioning hooks
8
9
  * @output Exports Selector component
9
10
  * @position Core implementation; consumed by index.ts
10
11
  *
@@ -20,25 +21,29 @@ import * as stylex from '@stylexjs/stylex';
20
21
  import { usePopover } from "../Popover/usePopover.js";
21
22
  import { useTooltip } from "../Tooltip/index.js";
22
23
  import { Icon, renderIconSlot } from "../Icon/index.js";
23
- import { Field, inputStatusBorderStyles, inputStatusHoverShadowStyles, inputWrapperStyles } from "../Field/index.js";
24
+ import { useIndicator } from "../Indicator/index.js";
25
+ import { Field, InputClearButton, inputStatusBorderStyles, inputStatusHoverShadowStyles, inputWrapperStyles } from "../Field/index.js";
24
26
  import { Divider } from "../Divider/index.js";
25
27
  import { layerAnimations } from "../Layer/layerAnimations.stylex.js";
26
28
  import { Spinner } from "../Spinner/index.js";
27
- import { TextInput } from "../TextInput/index.js";
29
+ import { PanelSearchInput } from "../Field/PanelSearchInput.js";
28
30
  import { useAnnounce } from "../hooks/useAnnounce.js";
29
31
  import "../theme/tokens.stylex.js";
30
32
  import { colorVars, sizeVars, spacingVars, radiusVars, durationVars, easeVars, typographyVars, fontWeightVars, typeScaleVars, borderVars } from "../theme/tokens.stylex.js";
31
33
  import { isOptionData, isDivider, isSection, normalizeOption, getSelectableOptions } from "./utils.js";
32
34
  import { useCombobox, useSelectedItemOffset } from "./hooks.js";
35
+ import { useTypeahead } from "../hooks/useTypeahead.js";
33
36
  import { SelectorOption } from "./SelectorOption.js";
34
37
  import { getInputARIA, mergeProps } from "../utils/index.js";
35
38
  import { useSize } from "../SizeContext/SizeContext.js";
36
39
  import { themeProps } from "../utils/themeProps.js";
40
+ import { focusOutlineStyles } from "../utils/focusOutline.stylex.js";
41
+ import { stableClassName } from "../naming.js";
37
42
  import { groupStyles } from "../InputGroup/groupStyles.js";
38
43
  import { useInputGroup } from "../InputGroup/InputGroupContext.js";
39
44
  import { VisuallyHidden } from "../VisuallyHidden/index.js";
40
45
  import { useTranslator } from "../i18n/index.js";
41
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
46
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
42
47
  const styles = {
43
48
  triggerContainer: {
44
49
  kVAEAm: "x1n2onr6",
@@ -60,6 +65,21 @@ const styles = {
60
65
  kMwMTN: "xv1l7n4",
61
66
  $$css: true
62
67
  },
68
+ triggerIcon: {
69
+ kmuXW: "x2lah0s",
70
+ $$css: true
71
+ },
72
+ triggerIconRotation: {
73
+ k1ekBW: "x11xpdln",
74
+ kIyJzY: "xuedmi6",
75
+ kAMwcw: "xlr8y92",
76
+ k3nNDw: "x1g0ag68",
77
+ $$css: true
78
+ },
79
+ triggerIconOpen: {
80
+ k3aq6I: "x19jd1h0",
81
+ $$css: true
82
+ },
63
83
  triggerGhost: {
64
84
  kzqmXN: "x14atkfc",
65
85
  kMzoRj: "xc342km",
@@ -67,8 +87,6 @@ const styles = {
67
87
  kKwaWg: "x1ilzqfv xq8i9tn",
68
88
  kGVxlE: "x1gnnqk1 x1irk71m x15ysqaf",
69
89
  k63SB2: "x1e4wzip",
70
- kI3sdo: "x1a2a7pz x1irc7jg",
71
- kInvED: "x1wfwxd8 xscfbxq",
72
90
  k1ekBW: "xrafxwg",
73
91
  k3aq6I: "x3oybdh xk4oym4",
74
92
  $$css: true
@@ -78,12 +96,26 @@ const styles = {
78
96
  k3aq6I: "x1c071of x1pdlv7q",
79
97
  $$css: true
80
98
  },
81
- popover: {
82
- k7Eaqz: "xrzjruh",
99
+ statusButton: {
100
+ k1xSpc: "x78zum5",
101
+ kGNEyG: "x6s0dn4",
102
+ kjj79g: "xl56j7k",
103
+ kmVPX3: "x1717udv",
104
+ kogj98: "x1ghz6dp",
105
+ kMzoRj: "xc342km",
106
+ ksu8eU: "xng3xce",
107
+ kWkggS: "xjbqb8w",
108
+ kMwMTN: "x1heor9g",
109
+ kkrTdU: "x1ypdohk",
110
+ kaIpWk: "xh6dtrn",
83
111
  $$css: true
84
112
  },
85
- sectionDivider: {
86
- kqGvvJ: "xsq74q5",
113
+ searchRowInput: {
114
+ kg3NbH: "x2hg6jq",
115
+ $$css: true
116
+ },
117
+ popover: {
118
+ k7Eaqz: "xrzjruh",
87
119
  $$css: true
88
120
  },
89
121
  divider: {
@@ -249,6 +281,7 @@ export function Selector(props) {
249
281
  startIcon,
250
282
  htmlName,
251
283
  renderOption,
284
+ indicatorPosition = 'end',
252
285
  hasSearch = false,
253
286
  searchPlaceholder: searchPlaceholderFromProps,
254
287
  placement,
@@ -275,16 +308,20 @@ export function Selector(props) {
275
308
  const statusMessageId = useId();
276
309
  const inputLabelId = useId();
277
310
  const searchId = useId();
311
+ // Measure from the same outer control that usePopover anchors to; using the
312
+ // shorter inner button makes every size's selected row land too low.
313
+ const anchorRef = useRef(null);
278
314
  const triggerRef = useRef(null);
279
315
  const searchRef = useRef(null);
280
316
  const inputGroup = useInputGroup();
281
317
  const [searchQuery, setSearchQuery] = useState('');
282
- // A typed query shows TextInput's built-in clear (✕) button, which becomes
318
+ // A typed query shows the search row's clear (✕) button, which becomes
283
319
  // the next tab stop after the search input.
284
320
  const hasQuery = searchQuery.length > 0;
285
321
  const [, startTransition] = useTransition();
286
322
  const [optimisticValue, setOptimisticValue] = useOptimistic(normalizedValue);
287
323
  const isBusy = isLoading || optimisticValue !== normalizedValue;
324
+ const announce = useAnnounce();
288
325
 
289
326
  // Disabled-reason tooltip. Disabled controls swallow pointer events, so the
290
327
  // tooltip listeners attach to the trigger container (which already exists)
@@ -325,15 +362,15 @@ export function Selector(props) {
325
362
  // Ref for listbox to measure selected item position
326
363
  const listboxRef = useRef(null);
327
364
 
328
- // Announce match counts / "No results found" politely as the user types, so
329
- // screen-reader users hear how many options remain. Filtering was previously
330
- // silent (comboboxes-7). Mirrors BaseTypeahead, which announces from its
331
- // query-change callback (not a reactive effect) via the same useAnnounce hook.
332
- const announce = useAnnounce();
365
+ // Typeahead is defined below (it needs the popover), but closing and clearing
366
+ // must drop its pending buffer — otherwise a stale prefix survives the reset
367
+ // window and poisons the next keystroke ("Dog" then "c" would search "dc").
368
+ const resetTypeaheadRef = useRef(() => {});
333
369
 
334
370
  // Layer for dropdown positioning
335
371
  const handleLayerHide = useCallback(() => {
336
372
  setSearchQuery('');
373
+ resetTypeaheadRef.current();
337
374
  // Clear any lingering result count when the popover closes so stale status
338
375
  // text does not linger in the a11y tree.
339
376
  announce('');
@@ -346,7 +383,10 @@ export function Selector(props) {
346
383
  hasAutoFocus: false,
347
384
  // The popup's own role="listbox" is the exposed semantics; the trigger
348
385
  // keeps DOM focus, so wrapping it in a modal dialog would misrepresent it.
349
- role: 'none'
386
+ role: 'none',
387
+ // The theme target belongs on the SURFACE that paints the popup, which
388
+ // `usePopover` owns — not on the scrolling list inside it.
389
+ surfaceTarget: 'selector-popup'
350
390
  });
351
391
 
352
392
  // Open dropdown on mount when isDefaultOpen is true
@@ -384,7 +424,7 @@ export function Selector(props) {
384
424
  selectedItemIndex,
385
425
  listboxId,
386
426
  listboxRef,
387
- triggerRef
427
+ anchorRef
388
428
  });
389
429
  const selectedItemOffset = shouldOverlaySelectedItem ? rawOffset : 0;
390
430
  const isPositioned = shouldOverlaySelectedItem ? rawIsPositioned : true;
@@ -396,6 +436,7 @@ export function Selector(props) {
396
436
  // Clear the current value. Shared by the clear button and the keyboard
397
437
  // Delete/Backspace path so clearing is reachable without a mouse.
398
438
  const clearValue = useCallback(() => {
439
+ resetTypeaheadRef.current();
399
440
  onChange?.(null);
400
441
  if (changeAction) {
401
442
  startTransition(async () => {
@@ -405,10 +446,25 @@ export function Selector(props) {
405
446
  }
406
447
  }, [onChange, changeAction, startTransition, setOptimisticValue]);
407
448
 
408
- // Selector behavior (keyboard nav, typeahead, selection)
449
+ // Type-to-find appends to the query rather than replacing it: characters
450
+ // typed before focus reaches the search input must not be dropped.
451
+ const appendSearchQuery = useCallback(char => {
452
+ setSearchQuery(query => query + char);
453
+ }, []);
454
+ const commitValue = useCallback(newValue => {
455
+ onChange?.(newValue);
456
+ if (changeAction) {
457
+ startTransition(async () => {
458
+ setOptimisticValue(newValue);
459
+ await changeAction(newValue);
460
+ });
461
+ }
462
+ }, [onChange, changeAction, startTransition, setOptimisticValue]);
463
+
464
+ // Selector behavior (keyboard nav, selection)
409
465
  const {
410
466
  highlightedIndex,
411
- setHighlightedIndex: _setHighlightedIndex,
467
+ setHighlightedIndex,
412
468
  getItemId,
413
469
  onTriggerClick,
414
470
  onKeyDown,
@@ -416,7 +472,11 @@ export function Selector(props) {
416
472
  onItemMouseEnter
417
473
  } = useCombobox({
418
474
  selectableItems: filteredItems,
419
- value: normalizedValue,
475
+ // The optimistic value, not the raw prop: with a pending changeAction the
476
+ // prop still holds the old selection, so the popup would open with the
477
+ // highlight on it and Delete/Backspace could clear a value the action has
478
+ // already replaced.
479
+ value: optimisticValue,
420
480
  isDisabled,
421
481
  isOpen: popover.isOpen,
422
482
  hasSearch,
@@ -424,24 +484,56 @@ export function Selector(props) {
424
484
  popover.show();
425
485
  if (hasSearch) {
426
486
  requestAnimationFrame(() => {
427
- searchRef.current?.focus();
487
+ const input = searchRef.current;
488
+ if (input) {
489
+ input.focus();
490
+ // When typing seeded the query, place the caret after it so the
491
+ // user keeps typing where they left off.
492
+ input.setSelectionRange(input.value.length, input.value.length);
493
+ }
428
494
  });
429
495
  }
430
496
  }, [popover, hasSearch]),
431
497
  onClose: popover.hide,
432
- onSelect: useCallback(newValue => {
433
- onChange?.(newValue);
434
- if (changeAction) {
435
- startTransition(async () => {
436
- setOptimisticValue(newValue);
437
- await changeAction(newValue);
438
- });
439
- }
440
- }, [onChange, changeAction, startTransition, setOptimisticValue]),
498
+ onSelect: commitValue,
441
499
  onClear: hasClear ? clearValue : undefined,
500
+ onSearchSeed: appendSearchQuery,
442
501
  listboxId
443
502
  });
444
503
 
504
+ // Type-to-select, shared with the other collections (menus, listboxes).
505
+ // Open, it walks the highlight — aria-activedescendant announces each match.
506
+ // Closed, it commits the match like a native select, which changes the value
507
+ // without opening the popup or moving focus, so nothing else would prompt
508
+ // assistive tech to re-read the trigger: announce it explicitly.
509
+ const typeahead = useTypeahead({
510
+ getItemLabels: () => selectableItems.map(item => item.label ?? item.value),
511
+ isDisabled: index => selectableItems[index]?.disabled === true,
512
+ // Cycle onward from the highlight when open, from the committed selection
513
+ // when closed — the optimistic one, so a pending changeAction cannot strand
514
+ // cycling on the first match. -1 means nothing is selected or highlighted,
515
+ // which the hook reads as "search from the top".
516
+ getCurrentIndex: () => popover.isOpen ? highlightedIndex : selectedItemIndex,
517
+ onMatch: index => {
518
+ const item = selectableItems[index];
519
+ if (popover.isOpen) {
520
+ setHighlightedIndex(index);
521
+ } else if (item.value !== optimisticValue) {
522
+ commitValue(item.value);
523
+ announce(item.label ?? item.value);
524
+ }
525
+ }
526
+ });
527
+ resetTypeaheadRef.current = typeahead.reset;
528
+ const handleTriggerKeyDown = useCallback(e => {
529
+ // With hasSearch the query input owns typing, so type-to-select is off.
530
+ if (!isDisabled && !hasSearch && typeahead.onKeyDown(e)) {
531
+ e.preventDefault();
532
+ return;
533
+ }
534
+ onKeyDown(e);
535
+ }, [isDisabled, hasSearch, typeahead, onKeyDown]);
536
+
445
537
  // Keep the highlighted option visible during keyboard navigation. The
446
538
  // listbox is a fixed-height scroll container, so without this the virtual
447
539
  // cursor walks off-screen once navigation passes the visible window. Mirrors
@@ -466,13 +558,39 @@ export function Selector(props) {
466
558
  if (!hasSearch) {
467
559
  return null;
468
560
  }
469
- return /*#__PURE__*/_jsx("div", {
470
- ...{
471
- className: "x78zum5 x6s0dn4 xf314gf xu0wf1k"
472
- },
473
- onKeyDown: e => {
474
- // The clear (✕) button lives inside the TextInput, after the input in
475
- // DOM order. When it is focused and the user tabs forward there is
561
+ return /*#__PURE__*/_jsx(PanelSearchInput, {
562
+ ref: searchRef,
563
+ id: searchId
564
+ // The search row is the panel's header: a magnifier, a borderless
565
+ // input, and the shared clear (✕) button. It deliberately does NOT
566
+ // render a bordered TextInput — the popup is already a bordered
567
+ // surface, and a field inside it drew a second box within that box.
568
+ ,
569
+ label: t('@astryx.selector.searchOptions')
570
+ // Same accessible name the TextInput's built-in clear produced
571
+ // ("Clear Search options"), so the affordance keeps its name while its
572
+ // chrome changes.
573
+ ,
574
+ clearLabel: t('@astryx.textInput.clearLabel', {
575
+ label: t('@astryx.selector.searchOptions')
576
+ }),
577
+ ...themeProps('selector-search'),
578
+ xstyle: variant !== 'ghost' && styles.searchRowInput
579
+ // When hasSearch is set, focus moves into this input on open, so it —
580
+ // not the trigger — must be the combobox that reports the highlighted
581
+ // option via aria-activedescendant (comboboxes-4). A bare searchbox
582
+ // left the highlight silent to screen readers.
583
+ ,
584
+ role: "combobox",
585
+ "aria-expanded": popover.isOpen,
586
+ "aria-controls": listboxId,
587
+ "aria-autocomplete": "list",
588
+ "aria-activedescendant": popover.isOpen && highlightedIndex >= 0 ? getItemId(highlightedIndex) : undefined,
589
+ value: searchQuery,
590
+ onValueChange: handleSearchChange,
591
+ onContainerKeyDown: e => {
592
+ // The clear (✕) button lives inside the row, after the input in DOM
593
+ // order. When it is focused and the user tabs forward there is
476
594
  // nothing else in the popup, so dismiss it (Shift+Tab returns to the
477
595
  // input natively). Key events originating on the input are handled on
478
596
  // the input below; ignore them here so we don't double-dismiss.
@@ -483,63 +601,70 @@ export function Selector(props) {
483
601
  onKeyDown(e);
484
602
  }
485
603
  },
486
- children: /*#__PURE__*/_jsx(TextInput, {
487
- ref: searchRef,
488
- id: searchId
489
- // The search field IS a TextInput: the leading magnifier is its
490
- // `startIcon` and the trailing clear (✕) is its built-in `hasClear`
491
- // (which resets the value and refocuses the input). We add no bespoke
492
- // affordance chrome — the field just looks and behaves like every
493
- // other Astryx input.
494
- ,
495
- label: t('@astryx.selector.searchOptions'),
496
- isLabelHidden: true,
497
- startIcon: "search",
498
- hasClear: true,
499
- size: "sm"
500
- // Fill the dropdown's width (minus the wrapper's inline padding) so
501
- // the field is flush end-to-end rather than sized to its content.
502
- ,
503
- width: "100%"
504
- // When hasSearch is set, focus moves into this input on open, so it —
505
- // not the trigger — must be the combobox that reports the highlighted
506
- // option via aria-activedescendant (comboboxes-4). A bare searchbox
507
- // left the highlight silent to screen readers. role + aria-* pass
508
- // through to the underlying <input> via BaseProps.
509
- ,
510
- role: "combobox",
511
- "aria-expanded": popover.isOpen,
512
- "aria-controls": listboxId,
513
- "aria-autocomplete": "list",
514
- "aria-activedescendant": popover.isOpen && highlightedIndex >= 0 ? getItemId(highlightedIndex) : undefined,
515
- value: searchQuery,
516
- onChange: handleSearchChange,
517
- onKeyDown: e => {
518
- // Arrow keys navigate options; Enter selects; Escape closes.
519
- // Home/End are left to the input for caret movement (APG editable
520
- // combobox); PageUp/PageDown are the sanctioned substitute for
521
- // jumping to the first/last option.
522
- if (e.key === 'ArrowDown' || e.key === 'ArrowUp' || e.key === 'PageUp' || e.key === 'PageDown' || e.key === 'Enter' || e.key === 'Escape') {
523
- onKeyDown(e);
524
- return;
525
- }
526
- // Tab: when a query is showing the clear (✕) button, forward-tab
527
- // moves focus to it (keeping the popup open) so the affordance is
528
- // keyboard-reachable. Every other Tab dismisses the popup as usual.
529
- if (e.key === 'Tab' && (e.shiftKey || !hasQuery)) {
530
- onKeyDown(e);
531
- }
532
- },
533
- placeholder: searchPlaceholder
534
- })
604
+ onKeyDown: e => {
605
+ // Arrow keys navigate options; Enter selects; Escape closes.
606
+ // Home/End are left to the input for caret movement (APG editable
607
+ // combobox); PageUp/PageDown are the sanctioned substitute for
608
+ // jumping to the first/last option.
609
+ if (e.key === 'ArrowDown' || e.key === 'ArrowUp' || e.key === 'PageUp' || e.key === 'PageDown' || e.key === 'Enter' || e.key === 'Escape') {
610
+ onKeyDown(e);
611
+ return;
612
+ }
613
+ // Tab: when a query is showing the clear (✕) button, forward-tab
614
+ // moves focus to it (keeping the popup open) so the affordance is
615
+ // keyboard-reachable. Every other Tab dismisses the popup as usual.
616
+ if (e.key === 'Tab' && (e.shiftKey || !hasQuery)) {
617
+ onKeyDown(e);
618
+ }
619
+ },
620
+ placeholder: searchPlaceholder
535
621
  });
536
- }, [hasSearch, searchId, listboxId, searchQuery, hasQuery, searchPlaceholder, handleSearchChange, onKeyDown, popover.isOpen, highlightedIndex, getItemId, t]);
622
+ }, [hasSearch, searchId, listboxId, searchQuery, hasQuery, searchPlaceholder, handleSearchChange, onKeyDown, popover.isOpen, highlightedIndex, getItemId, variant, t]);
623
+
624
+ // The single-selection mark, resolved from the theme once per render. A
625
+ // theme that maps `check` to another indicator (a radio, say) changes every
626
+ // selected-option mark in the app through this one lookup.
627
+ const SelectionMark = useIndicator('check');
537
628
 
538
629
  // Render an individual item
539
630
  const renderItem = useCallback((item, flatIndex) => {
540
631
  const isHighlighted = flatIndex === highlightedIndex;
541
632
  const isSelected = item.value === normalizedValue;
542
- return /*#__PURE__*/_jsxs("div", {
633
+
634
+ /*
635
+ * Rendered UNCONDITIONALLY, with the state passed down: the default
636
+ * check draws nothing when unchecked, but a theme that replaces the
637
+ * `check` indicator with a radio needs the unselected state to draw
638
+ * its empty circle. `{isSelected && …}` would make that impossible.
639
+ *
640
+ * `selector-check` stays the stable target for the mark's position
641
+ * in the row; the indicator owns what the mark looks like.
642
+ */
643
+ const mark = /*#__PURE__*/_jsx("span", {
644
+ ...{
645
+ className: "x3nfvp2 x6s0dn4 xl56j7k x2lah0s xgomdpo"
646
+ },
647
+ children: /*#__PURE__*/_jsx(SelectionMark, {
648
+ state: isSelected ? 'checked' : 'unchecked',
649
+ size: "sm",
650
+ isDisabled: item.disabled ?? false,
651
+ ...themeProps('selector-check')
652
+ })
653
+ });
654
+ const optionContent = /*#__PURE__*/_jsx("span", {
655
+ ...{
656
+ className: "x78zum5 x6s0dn4 x1txdalj x98rzlu xeuugli"
657
+ },
658
+ children: renderOption ? renderOption(item) : /*#__PURE__*/_jsx(DefaultOption, {
659
+ option: item
660
+ })
661
+ });
662
+ const content = indicatorPosition === 'start' ? /*#__PURE__*/_jsxs(_Fragment, {
663
+ children: [mark, optionContent]
664
+ }) : /*#__PURE__*/_jsxs(_Fragment, {
665
+ children: [optionContent, mark]
666
+ });
667
+ return /*#__PURE__*/_jsx("div", {
543
668
  id: getItemId(flatIndex),
544
669
  role: "option",
545
670
  "aria-selected": isSelected,
@@ -547,20 +672,9 @@ export function Selector(props) {
547
672
  onClick: () => onItemSelect(item),
548
673
  onMouseEnter: () => onItemMouseEnter(item, flatIndex),
549
674
  ...stylex.props(styles.item, itemSizeStyles[size], isHighlighted && styles.itemHighlighted, isSelected && styles.itemSelected, item.disabled && styles.itemDisabled),
550
- children: [/*#__PURE__*/_jsx("span", {
551
- ...{
552
- className: "x78zum5 x6s0dn4 x1txdalj x98rzlu xeuugli"
553
- },
554
- children: renderOption ? renderOption(item) : /*#__PURE__*/_jsx(DefaultOption, {
555
- option: item
556
- })
557
- }), isSelected && /*#__PURE__*/_jsx(Icon, {
558
- icon: "check",
559
- size: "sm",
560
- color: "accent"
561
- })]
675
+ children: content
562
676
  }, item.value);
563
- }, [renderOption, highlightedIndex, size, normalizedValue, getItemId, onItemSelect, onItemMouseEnter]);
677
+ }, [renderOption, indicatorPosition, highlightedIndex, size, normalizedValue, getItemId, onItemSelect, onItemMouseEnter, SelectionMark]);
564
678
 
565
679
  // Render all options (handling sections/dividers)
566
680
  const renderOptions = useCallback(() => {
@@ -574,9 +688,9 @@ export function Selector(props) {
574
688
  // result-count live region instead.
575
689
  return [/*#__PURE__*/_jsx("div", {
576
690
  role: "presentation",
577
- ...{
691
+ ...mergeProps(themeProps('selector-empty-state'), {
578
692
  className: "x1b2ylru x2b8uid xv1l7n4 x9ynric xcr08ib"
579
- },
693
+ }),
580
694
  children: "No results found"
581
695
  }, "empty")];
582
696
  }
@@ -608,16 +722,21 @@ export function Selector(props) {
608
722
  if (sectionItems.length === 0) {
609
723
  continue;
610
724
  }
611
- if (option.title) {
612
- elements.push(/*#__PURE__*/_jsx(Divider, {
613
- label: option.title,
614
- xstyle: styles.sectionDivider
615
- }, `section-divider-${i}`));
616
- }
617
- elements.push(/*#__PURE__*/_jsx("div", {
725
+ // The heading lives INSIDE the group and is aria-hidden: the group
726
+ // already carries the title as its accessible name, so exposing the
727
+ // text again would announce it twice. This also keeps role="listbox"'s
728
+ // children to option/group only — the old labeled Divider sat in the
729
+ // listbox as a stray role="separator".
730
+ elements.push(/*#__PURE__*/_jsxs("div", {
618
731
  role: "group",
619
732
  "aria-label": option.title,
620
- children: sectionItems
733
+ children: [option.title && /*#__PURE__*/_jsx("div", {
734
+ "aria-hidden": "true",
735
+ ...mergeProps(themeProps('selector-section-heading'), {
736
+ className: "xu0wf1k xf314gf x9ynric x141an7d x1ltkj2j xv1l7n4 x87ps6o"
737
+ }),
738
+ children: option.title
739
+ }), sectionItems]
621
740
  }, `section-${i}`));
622
741
  } else if (isOptionData(option)) {
623
742
  const normalized = normalizeOption(option);
@@ -638,6 +757,7 @@ export function Selector(props) {
638
757
  const selectorContent = /*#__PURE__*/_jsxs(_Fragment, {
639
758
  children: [/*#__PURE__*/_jsxs("div", {
640
759
  ref: el => {
760
+ anchorRef.current = el;
641
761
  popover.triggerRef(el);
642
762
  // Anchor + hover/focus listeners for the disabled-message tooltip.
643
763
  // Handlers are gated internally by isEnabled, and anchor names
@@ -649,8 +769,9 @@ export function Selector(props) {
649
769
  ...mergeProps(themeProps('selector', {
650
770
  variant,
651
771
  size,
652
- status: status?.type ?? null
653
- }), stylex.props(inputWrapperStyles.base, styles.triggerContainer, sizeStyles[size], variant === 'ghost' && styles.triggerGhost, isDisabled && inputWrapperStyles.disabled, variant === 'ghost' && isDisabled && styles.triggerGhostDisabled, !selectedItem && styles.triggerPlaceholder, variant !== 'ghost' && status && inputStatusBorderStyles[status.type], variant !== 'ghost' && status && !isDisabled && inputStatusHoverShadowStyles[status.type], variant !== 'ghost' && inputGroup && groupStyles.inGroup, xstyle), className, style),
772
+ status: status?.type ?? null,
773
+ disabled: isDisabled ? 'disabled' : null
774
+ }), stylex.props(inputWrapperStyles.base, styles.triggerContainer, sizeStyles[size], variant === 'ghost' && styles.triggerGhost, variant === 'ghost' && focusOutlineStyles.focusWithin, isDisabled && inputWrapperStyles.disabled, variant === 'ghost' && isDisabled && styles.triggerGhostDisabled, !selectedItem && styles.triggerPlaceholder, variant !== 'ghost' && status && inputStatusBorderStyles[status.type], variant !== 'ghost' && status && !isDisabled && inputStatusHoverShadowStyles[status.type], variant !== 'ghost' && inputGroup && groupStyles.inGroup, xstyle), className, style),
654
775
  children: [startIcon && renderIconSlot(startIcon, {
655
776
  size: 'sm',
656
777
  color: 'secondary'
@@ -682,7 +803,7 @@ export function Selector(props) {
682
803
  ,
683
804
  disabled: isDisabled && !showsDisabledMessage,
684
805
  "aria-disabled": showsDisabledMessage ? 'true' : undefined,
685
- onKeyDown: onKeyDown,
806
+ onKeyDown: handleTriggerKeyDown,
686
807
  tabIndex: isDisabled && !showsDisabledMessage ? -1 : 0,
687
808
  ...{
688
809
  className: "x78zum5 x6s0dn4 x1qughib x1txdalj x1iyjqo2 xs83m0k x1r8uery xeuugli x1717udv x1ghz6dp xc342km xng3xce xjbqb8w xjb2p0i x1qlqyl8 x15bjb6t x1heor9g x1ypdohk x1a2a7pz"
@@ -703,84 +824,63 @@ export function Selector(props) {
703
824
  disabled: isDisabled
704
825
  }), isBusy && /*#__PURE__*/_jsx(Spinner, {
705
826
  size: "sm"
706
- }), hasClear && value != null && !isDisabled && /*#__PURE__*/_jsx("button", {
707
- type: "button",
708
- onClick: handleClear,
709
- "aria-label": t('@astryx.selector.clearLabel', {
827
+ }), hasClear && value != null && !isDisabled && /*#__PURE__*/_jsx(InputClearButton, {
828
+ label: t('@astryx.selector.clearLabel', {
710
829
  label
711
830
  }),
712
- ...{
713
- className: "x78zum5 x6s0dn4 xl56j7k x1717udv x1ghz6dp xc342km xng3xce xjbqb8w x1ypdohk xh6dtrn x1a2a7pz x1p25gnr x1y3gkto"
714
- },
831
+ onClick: handleClear,
832
+ iconClassName: stableClassName('selector-clear-icon')
833
+ }), showStatusIcon ? showStatusTooltip ? /*#__PURE__*/_jsx("button", {
834
+ ref: statusTooltip.ref,
835
+ type: "button",
836
+ "aria-label": t(STATUS_BUTTON_LABEL_KEY[status.type]),
837
+ "aria-describedby": statusTooltip.describedBy,
838
+ onClick: e => e.stopPropagation(),
839
+ ...stylex.props(focusOutlineStyles.focusVisible, styles.statusButton),
715
840
  children: /*#__PURE__*/_jsx(Icon, {
716
- icon: "close",
717
- size: "sm",
718
- color: "secondary"
719
- // Stable theme target on the clear glyph itself, so a theme can
720
- // restyle just this icon (color, size, hover) via `defineTheme`.
721
- // Same-element rules in @layer astryx-theme win over the icon's
722
- // own base color/size, which a button-level target could not
723
- // reach.
724
- ,
725
- ...themeProps('selector-clear-icon')
726
- })
727
- }), /*#__PURE__*/_jsx("span", {
728
- ...{
729
- 0: {
730
- className: "x2lah0s x78zum5 x6s0dn4 xl56j7k x1kky2od xlup9mm x11xpdln xuedmi6 xlr8y92 x1g0ag68 xv9yike"
731
- },
732
- 2: {
733
- className: "x2lah0s x78zum5 x6s0dn4 xl56j7k x1kky2od xlup9mm x11xpdln xuedmi6 xlr8y92 x1g0ag68 xv9yike x19jd1h0"
734
- },
735
- 1: {
736
- className: "x2lah0s x78zum5 x6s0dn4 xl56j7k x1kky2od xlup9mm x11xpdln xuedmi6 xlr8y92 x1g0ag68 xv9yike xq2gx43"
737
- },
738
- 3: {
739
- className: "x2lah0s x78zum5 x6s0dn4 xl56j7k x1kky2od xlup9mm x11xpdln xuedmi6 xlr8y92 x1g0ag68 xv9yike x19jd1h0 xq2gx43"
740
- }
741
- }[!!(!showStatusIcon && popover.isOpen) << 1 | !!showStatusIcon << 0],
742
- children: showStatusIcon ? showStatusTooltip ? /*#__PURE__*/_jsx("button", {
743
- ref: statusTooltip.ref,
744
- type: "button",
745
- "aria-label": t(STATUS_BUTTON_LABEL_KEY[status.type]),
746
- "aria-describedby": statusTooltip.describedBy,
747
- onClick: e => e.stopPropagation(),
748
- ...{
749
- className: "x78zum5 x6s0dn4 xl56j7k x1717udv x1ghz6dp xc342km xng3xce xjbqb8w x1heor9g x1ypdohk xh6dtrn x1a2a7pz x1p25gnr x1y3gkto"
750
- },
751
- children: /*#__PURE__*/_jsx(Icon, {
752
- icon: STATUS_ICON_MAP[status.type],
753
- size: "sm",
754
- color: STATUS_ICON_COLOR_MAP[status.type]
755
- })
756
- }) : /*#__PURE__*/_jsx(Icon, {
757
841
  icon: STATUS_ICON_MAP[status.type],
758
842
  size: "sm",
759
- color: STATUS_ICON_COLOR_MAP[status.type]
760
- }) : /*#__PURE__*/_jsx(Icon, {
761
- icon: "chevronDown",
762
- size: "sm",
763
- color: "inherit"
764
- // Stable theme target on the chevron glyph itself, so a theme can
765
- // restyle just this icon (color, size, hover) — and its
766
- // open/closed state — via `defineTheme`. Same-element rules in
767
- // @layer astryx-theme win over the icon's own base color/size,
768
- // which a button-level target could not reach.
769
- ,
770
- ...themeProps('selector-indicator-icon', {
771
- state: popover.isOpen ? 'expanded' : 'collapsed'
772
- })
843
+ color: STATUS_ICON_COLOR_MAP[status.type],
844
+ xstyle: styles.triggerIcon
845
+ })
846
+ }) : /*#__PURE__*/_jsx(Icon, {
847
+ icon: STATUS_ICON_MAP[status.type],
848
+ size: "sm",
849
+ color: STATUS_ICON_COLOR_MAP[status.type],
850
+ xstyle: styles.triggerIcon
851
+ }) : /*#__PURE__*/_jsx(Icon, {
852
+ icon: "chevronDown",
853
+ size: "sm",
854
+ color: "secondary"
855
+ // The rotation rides on the glyph, alongside the box and color
856
+ // the wrapper used to provide, so one element carries the mark,
857
+ // its open/closed transform, and the theme target.
858
+ ,
859
+ xstyle: [styles.triggerIcon, styles.triggerIconRotation, popover.isOpen && styles.triggerIconOpen]
860
+ // Stable theme target on the chevron glyph itself, so a theme can
861
+ // restyle just this icon (color, size, hover) — and its
862
+ // open/closed state — via `defineTheme`. Same-element rules in
863
+ // @layer astryx-theme win over the icon's own base color/size,
864
+ // which a button-level target could not reach.
865
+ ,
866
+ ...themeProps('selector-indicator-icon', {
867
+ state: popover.isOpen ? 'expanded' : 'collapsed'
773
868
  })
774
869
  })]
775
870
  }), popover.render(hasSearch ? /*#__PURE__*/_jsxs("div", {
776
- children: [renderSearch(), /*#__PURE__*/_jsx("div", {
871
+ children: [renderSearch(), /*#__PURE__*/_jsx(Divider, {}), /*#__PURE__*/_jsx("div", {
777
872
  ref: listboxRef,
778
873
  id: listboxId,
779
874
  role: "listbox",
780
875
  "aria-labelledby": triggerId,
781
876
  ...{
782
- className: "x9f619 xuyqlj2 x1odjw0f x9epnlk x1hc1fzr x1ey1afo"
783
- },
877
+ 0: {
878
+ className: "x9f619 xuyqlj2 x1odjw0f xu0wf1k x7a5moj x1hc1fzr x1ey1afo"
879
+ },
880
+ 1: {
881
+ className: "x9f619 xuyqlj2 x1odjw0f xu0wf1k x1hc1fzr x1ey1afo x2hg6jq"
882
+ }
883
+ }[!!(variant !== 'ghost') << 0],
784
884
  children: renderOptions()
785
885
  })]
786
886
  }) : /*#__PURE__*/_jsx("div", {
@@ -790,16 +890,26 @@ export function Selector(props) {
790
890
  "aria-labelledby": triggerId,
791
891
  ...{
792
892
  0: {
793
- className: "x9f619 xuyqlj2 x1odjw0f x9epnlk x1hc1fzr x1ey1afo"
893
+ className: "x9f619 xuyqlj2 x1odjw0f xu0wf1k x7a5moj x1hc1fzr x1ey1afo"
894
+ },
895
+ 2: {
896
+ className: "x9f619 xuyqlj2 x1odjw0f xu0wf1k x1hc1fzr x1ey1afo x2hg6jq"
794
897
  },
795
898
  1: {
796
- className: "x9f619 xuyqlj2 x1odjw0f x9epnlk xg01cxk xq2gx43"
899
+ className: "x9f619 xuyqlj2 x1odjw0f xu0wf1k x7a5moj xg01cxk xq2gx43"
900
+ },
901
+ 3: {
902
+ className: "x9f619 xuyqlj2 x1odjw0f xu0wf1k x2hg6jq xg01cxk xq2gx43"
797
903
  }
798
- }[!!!isPositioned << 0],
904
+ }[!!(variant !== 'ghost') << 1 | !!!isPositioned << 0],
799
905
  children: renderOptions()
800
906
  }), {
801
907
  placement: popoverPlacement,
802
908
  alignment: 'start',
909
+ // The system's standard menu clearance, except in overlay mode:
910
+ // there the measured negative margin owns the block geometry and
911
+ // the menu is meant to sit on the trigger, not clear it.
912
+ offset: shouldOverlaySelectedItem ? undefined : spacingVars['--spacing-1'],
803
913
  xstyle: [styles.popover, layerAnimations[popoverPlacement]],
804
914
  style: popoverOffsetStyle
805
915
  }), showStatusTooltip && statusTooltip.renderTooltip(status?.message ?? ''), showsDisabledMessage && disabledMessageTooltip.renderTooltip(disabledMessage)]