@astryxdesign/core 0.4.5 → 0.4.6-canary.cea9ecd

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 (538) hide show
  1. package/CHANGELOG.md +134 -0
  2. package/dist/Avatar/Avatar.d.ts +10 -5
  3. package/dist/Avatar/Avatar.d.ts.map +1 -1
  4. package/dist/Avatar/Avatar.js +139 -30
  5. package/dist/Avatar/AvatarStatusDot.d.ts +2 -1
  6. package/dist/Avatar/AvatarStatusDot.d.ts.map +1 -1
  7. package/dist/Avatar/AvatarStatusDot.js +30 -4
  8. package/dist/Avatar/AvatarStatusLabelContext.d.ts +39 -0
  9. package/dist/Avatar/AvatarStatusLabelContext.d.ts.map +1 -0
  10. package/dist/Avatar/AvatarStatusLabelContext.js +41 -0
  11. package/dist/AvatarGroup/AvatarGroup.d.ts +3 -1
  12. package/dist/AvatarGroup/AvatarGroup.d.ts.map +1 -1
  13. package/dist/AvatarGroup/AvatarGroupOverflow.d.ts.map +1 -1
  14. package/dist/AvatarGroup/AvatarGroupOverflow.js +15 -9
  15. package/dist/Blockquote/Blockquote.d.ts +4 -3
  16. package/dist/Blockquote/Blockquote.d.ts.map +1 -1
  17. package/dist/Blockquote/Blockquote.js +9 -10
  18. package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
  19. package/dist/BottomSheet/BottomSheetPanel.js +21 -5
  20. package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
  21. package/dist/Breadcrumbs/BreadcrumbItem.js +47 -34
  22. package/dist/Button/Button.d.ts.map +1 -1
  23. package/dist/Button/Button.js +7 -7
  24. package/dist/Calendar/Calendar.d.ts.map +1 -1
  25. package/dist/Calendar/Calendar.js +21 -12
  26. package/dist/Calendar/hooks/useCalendarNavigation.d.ts.map +1 -1
  27. package/dist/Calendar/hooks/useCalendarNavigation.js +8 -4
  28. package/dist/Calendar/styles.d.ts +2 -2
  29. package/dist/Calendar/styles.d.ts.map +1 -1
  30. package/dist/Calendar/styles.js +5 -5
  31. package/dist/Center/Center.d.ts +23 -1
  32. package/dist/Center/Center.d.ts.map +1 -1
  33. package/dist/Center/Center.js +12 -6
  34. package/dist/Chat/ChatComposer.d.ts.map +1 -1
  35. package/dist/Chat/ChatComposer.js +3 -3
  36. package/dist/Chat/ChatComposerDrawer.d.ts.map +1 -1
  37. package/dist/Chat/ChatComposerDrawer.js +2 -2
  38. package/dist/Chat/ChatToolCalls.d.ts.map +1 -1
  39. package/dist/Chat/ChatToolCalls.js +2 -2
  40. package/dist/Chat/useChatDictation.d.ts +1 -1
  41. package/dist/Chat/useChatDictation.d.ts.map +1 -1
  42. package/dist/Chat/useSpeechRecognition.d.ts +1 -1
  43. package/dist/Chat/useSpeechRecognition.d.ts.map +1 -1
  44. package/dist/Chat/useSpeechRecognition.js +4 -3
  45. package/dist/Chat/useTriggerMenu.d.ts.map +1 -1
  46. package/dist/Chat/useTriggerMenu.js +2 -2
  47. package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
  48. package/dist/CheckboxInput/CheckboxInput.js +2 -2
  49. package/dist/Citation/Citation.d.ts.map +1 -1
  50. package/dist/Citation/Citation.js +5 -5
  51. package/dist/ClickableCard/ClickableCard.d.ts.map +1 -1
  52. package/dist/ClickableCard/ClickableCard.js +4 -4
  53. package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
  54. package/dist/CodeBlock/CodeBlock.js +1 -1
  55. package/dist/Collapsible/Collapsible.d.ts.map +1 -1
  56. package/dist/Collapsible/Collapsible.js +2 -2
  57. package/dist/CommandPalette/CommandPaletteItem.d.ts.map +1 -1
  58. package/dist/CommandPalette/CommandPaletteItem.js +3 -3
  59. package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
  60. package/dist/ComplexSelector/ComplexSelector.js +6 -6
  61. package/dist/DateInput/DateInput.d.ts +31 -2
  62. package/dist/DateInput/DateInput.d.ts.map +1 -1
  63. package/dist/DateInput/DateInput.js +90 -22
  64. package/dist/DateInput/MonthScroller.d.ts +35 -0
  65. package/dist/DateInput/MonthScroller.d.ts.map +1 -0
  66. package/dist/DateInput/MonthScroller.js +658 -0
  67. package/dist/DateInput/MonthYearWheels.d.ts +24 -0
  68. package/dist/DateInput/MonthYearWheels.d.ts.map +1 -0
  69. package/dist/DateInput/MonthYearWheels.js +114 -0
  70. package/dist/DateInput/TouchDateField.d.ts +10 -0
  71. package/dist/DateInput/TouchDateField.d.ts.map +1 -0
  72. package/dist/DateInput/TouchDateField.js +810 -0
  73. package/dist/DateInput/Wheel.d.ts +41 -0
  74. package/dist/DateInput/Wheel.d.ts.map +1 -0
  75. package/dist/DateInput/Wheel.js +315 -0
  76. package/dist/DateInput/monthGeometry.d.ts +65 -0
  77. package/dist/DateInput/monthGeometry.d.ts.map +1 -0
  78. package/dist/DateInput/monthGeometry.js +98 -0
  79. package/dist/DateInput/tokens.stylex.d.ts +63 -0
  80. package/dist/DateInput/tokens.stylex.d.ts.map +1 -0
  81. package/dist/DateInput/tokens.stylex.js +74 -0
  82. package/dist/DateInput/useOwnScrollGesture.d.ts +41 -0
  83. package/dist/DateInput/useOwnScrollGesture.d.ts.map +1 -0
  84. package/dist/DateInput/useOwnScrollGesture.js +202 -0
  85. package/dist/DateInput/usePointerDragScroll.d.ts +15 -0
  86. package/dist/DateInput/usePointerDragScroll.d.ts.map +1 -0
  87. package/dist/DateInput/usePointerDragScroll.js +216 -0
  88. package/dist/DateInput/useScrollSettle.d.ts +26 -0
  89. package/dist/DateInput/useScrollSettle.d.ts.map +1 -0
  90. package/dist/DateInput/useScrollSettle.js +149 -0
  91. package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
  92. package/dist/DateRangeInput/DateRangeInput.js +17 -14
  93. package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
  94. package/dist/DateTimeInput/DateTimeInput.js +17 -14
  95. package/dist/Dialog/Dialog.d.ts.map +1 -1
  96. package/dist/Dialog/Dialog.js +3 -3
  97. package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +1 -1
  98. package/dist/DropdownMenu/DropdownMenuCheckboxItem.js +2 -2
  99. package/dist/DropdownMenu/DropdownMenuItem.d.ts.map +1 -1
  100. package/dist/DropdownMenu/DropdownMenuItem.js +2 -2
  101. package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts.map +1 -1
  102. package/dist/DropdownMenu/DropdownMenuRadioItem.js +2 -2
  103. package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -1
  104. package/dist/DropdownMenu/DropdownMenuSubMenu.js +2 -2
  105. package/dist/Field/FieldLabel.d.ts.map +1 -1
  106. package/dist/Field/FieldLabel.js +4 -4
  107. package/dist/Field/InputClearButton.d.ts.map +1 -1
  108. package/dist/Field/InputClearButton.js +6 -0
  109. package/dist/Field/inputStyles.stylex.d.ts +1 -1
  110. package/dist/Field/inputStyles.stylex.d.ts.map +1 -1
  111. package/dist/Field/inputStyles.stylex.js +5 -5
  112. package/dist/FileInput/FileInput.d.ts.map +1 -1
  113. package/dist/FileInput/FileInput.js +6 -6
  114. package/dist/HoverCard/HoverCard.d.ts +13 -3
  115. package/dist/HoverCard/HoverCard.d.ts.map +1 -1
  116. package/dist/HoverCard/HoverCard.js +2 -0
  117. package/dist/HoverCard/index.d.ts +1 -1
  118. package/dist/HoverCard/index.d.ts.map +1 -1
  119. package/dist/HoverCard/useHoverCard.d.ts +17 -2
  120. package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
  121. package/dist/HoverCard/useHoverCard.js +78 -9
  122. package/dist/InputGroup/InputGroup.js +1 -1
  123. package/dist/Item/Item.d.ts +9 -1
  124. package/dist/Item/Item.d.ts.map +1 -1
  125. package/dist/Item/Item.js +52 -14
  126. package/dist/Layer/index.d.ts +4 -2
  127. package/dist/Layer/index.d.ts.map +1 -1
  128. package/dist/Layer/index.js +2 -0
  129. package/dist/Layer/useLayer.d.ts.map +1 -1
  130. package/dist/Layer/useLayer.js +3 -2
  131. package/dist/Layer/useTouchTrigger.d.ts +113 -0
  132. package/dist/Layer/useTouchTrigger.d.ts.map +1 -0
  133. package/dist/Layer/useTouchTrigger.js +241 -0
  134. package/dist/Layout/container.stylex.d.ts +4 -2
  135. package/dist/Layout/container.stylex.d.ts.map +1 -1
  136. package/dist/Layout/container.stylex.js +19 -11
  137. package/dist/Layout/index.d.ts +1 -0
  138. package/dist/Layout/index.d.ts.map +1 -1
  139. package/dist/Layout/index.js +4 -0
  140. package/dist/Layout/padding.stylex.d.ts +315 -12
  141. package/dist/Layout/padding.stylex.d.ts.map +1 -1
  142. package/dist/Layout/padding.stylex.js +389 -12
  143. package/dist/Lightbox/Lightbox.d.ts.map +1 -1
  144. package/dist/Lightbox/Lightbox.js +5 -4
  145. package/dist/Link/Link.d.ts.map +1 -1
  146. package/dist/Link/Link.js +6 -6
  147. package/dist/MetadataList/MetadataList.d.ts.map +1 -1
  148. package/dist/MetadataList/MetadataList.js +1 -1
  149. package/dist/MobileNav/MobileNav.d.ts +1 -0
  150. package/dist/MobileNav/MobileNav.d.ts.map +1 -1
  151. package/dist/MobileNav/MobileNav.js +24 -6
  152. package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
  153. package/dist/MultiSelector/MultiSelector.js +8 -8
  154. package/dist/NavItem/navItemStyles.stylex.d.ts +4 -4
  155. package/dist/NavItem/navItemStyles.stylex.d.ts.map +1 -1
  156. package/dist/NavItem/navItemStyles.stylex.js +4 -4
  157. package/dist/NavMenu/NavHeadingMenuItem.d.ts.map +1 -1
  158. package/dist/NavMenu/NavHeadingMenuItem.js +3 -3
  159. package/dist/NumberInput/NumberInput.d.ts.map +1 -1
  160. package/dist/NumberInput/NumberInput.js +36 -8
  161. package/dist/Outline/Outline.d.ts.map +1 -1
  162. package/dist/Outline/Outline.js +3 -3
  163. package/dist/Pagination/Pagination.d.ts.map +1 -1
  164. package/dist/Pagination/Pagination.js +2 -2
  165. package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
  166. package/dist/PowerSearch/PowerSearch.js +11 -12
  167. package/dist/PowerSearch/PowerSearchToken.d.ts.map +1 -1
  168. package/dist/PowerSearch/PowerSearchToken.js +3 -1
  169. package/dist/PowerSearch/formatFilterValue.d.ts +11 -2
  170. package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
  171. package/dist/PowerSearch/formatFilterValue.js +23 -8
  172. package/dist/RadioList/RadioListItem.d.ts +2 -2
  173. package/dist/RadioList/RadioListItem.d.ts.map +1 -1
  174. package/dist/RadioList/RadioListItem.js +70 -40
  175. package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
  176. package/dist/Resizable/ResizeHandle.js +7 -7
  177. package/dist/Section/Section.d.ts +36 -1
  178. package/dist/Section/Section.d.ts.map +1 -1
  179. package/dist/Section/Section.js +12 -2
  180. package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
  181. package/dist/SegmentedControl/SegmentedControlItem.js +7 -2
  182. package/dist/SelectableCard/SelectableCard.d.ts.map +1 -1
  183. package/dist/SelectableCard/SelectableCard.js +3 -3
  184. package/dist/Selector/Selector.d.ts +26 -1
  185. package/dist/Selector/Selector.d.ts.map +1 -1
  186. package/dist/Selector/Selector.js +93 -20
  187. package/dist/Selector/SelectorOption.d.ts +14 -1
  188. package/dist/Selector/SelectorOption.d.ts.map +1 -1
  189. package/dist/Selector/SelectorOption.js +6 -0
  190. package/dist/Selector/SelectorRowLayoutContext.d.ts +8 -0
  191. package/dist/Selector/SelectorRowLayoutContext.d.ts.map +1 -0
  192. package/dist/Selector/SelectorRowLayoutContext.js +27 -0
  193. package/dist/Selector/types.d.ts +1 -0
  194. package/dist/Selector/types.d.ts.map +1 -1
  195. package/dist/SideNav/SideNavHeading.d.ts.map +1 -1
  196. package/dist/SideNav/SideNavHeading.js +4 -4
  197. package/dist/SideNav/SideNavItem.d.ts.map +1 -1
  198. package/dist/SideNav/SideNavItem.js +3 -3
  199. package/dist/Slider/Slider.d.ts.map +1 -1
  200. package/dist/Slider/Slider.js +7 -7
  201. package/dist/Stack/Stack.d.ts +23 -1
  202. package/dist/Stack/Stack.d.ts.map +1 -1
  203. package/dist/Stack/Stack.js +12 -6
  204. package/dist/Switch/Switch.d.ts.map +1 -1
  205. package/dist/Switch/Switch.js +2 -2
  206. package/dist/TabList/Tab.d.ts.map +1 -1
  207. package/dist/TabList/Tab.js +1 -1
  208. package/dist/TabList/TabMenu.d.ts.map +1 -1
  209. package/dist/TabList/TabMenu.js +3 -3
  210. package/dist/Table/TableRow.js +4 -4
  211. package/dist/Table/plugins/columnResize/useTableColumnResize.d.ts.map +1 -1
  212. package/dist/Table/plugins/columnResize/useTableColumnResize.js +1 -1
  213. package/dist/Table/plugins/filtering/useTableFiltering.d.ts.map +1 -1
  214. package/dist/Table/plugins/filtering/useTableFiltering.js +2 -2
  215. package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts.map +1 -1
  216. package/dist/Table/plugins/groupedRows/useTableGroupedRows.js +2 -2
  217. package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
  218. package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +2 -2
  219. package/dist/Table/plugins/sortable/useTableSortable.d.ts.map +1 -1
  220. package/dist/Table/plugins/sortable/useTableSortable.js +1 -1
  221. package/dist/Table/plugins/sortable/useTableSortableState.d.ts +5 -3
  222. package/dist/Table/plugins/sortable/useTableSortableState.d.ts.map +1 -1
  223. package/dist/Table/plugins/sortable/useTableSortableState.js +12 -9
  224. package/dist/Table/plugins/tree/useTableTreeData.d.ts.map +1 -1
  225. package/dist/Table/plugins/tree/useTableTreeData.js +3 -3
  226. package/dist/TextArea/TextArea.js +1 -1
  227. package/dist/TextInput/TextInput.js +1 -1
  228. package/dist/Thumbnail/Thumbnail.d.ts.map +1 -1
  229. package/dist/Thumbnail/Thumbnail.js +3 -3
  230. package/dist/TimeInput/TimeInput.js +2 -2
  231. package/dist/Timestamp/Timestamp.d.ts.map +1 -1
  232. package/dist/Timestamp/Timestamp.js +6 -4
  233. package/dist/Timestamp/formatInstant.d.ts +3 -2
  234. package/dist/Timestamp/formatInstant.d.ts.map +1 -1
  235. package/dist/Timestamp/formatInstant.js +8 -8
  236. package/dist/Timestamp/tooltipEntries.d.ts +2 -1
  237. package/dist/Timestamp/tooltipEntries.d.ts.map +1 -1
  238. package/dist/Timestamp/tooltipEntries.js +5 -3
  239. package/dist/Toast/Toast.d.ts +4 -3
  240. package/dist/Toast/Toast.d.ts.map +1 -1
  241. package/dist/Toast/Toast.js +10 -7
  242. package/dist/Token/Token.d.ts.map +1 -1
  243. package/dist/Token/Token.js +6 -6
  244. package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
  245. package/dist/Tokenizer/Tokenizer.js +1 -1
  246. package/dist/Tooltip/Tooltip.d.ts +16 -3
  247. package/dist/Tooltip/Tooltip.d.ts.map +1 -1
  248. package/dist/Tooltip/Tooltip.js +2 -0
  249. package/dist/Tooltip/index.d.ts +1 -1
  250. package/dist/Tooltip/index.d.ts.map +1 -1
  251. package/dist/Tooltip/useTooltip.d.ts +21 -2
  252. package/dist/Tooltip/useTooltip.d.ts.map +1 -1
  253. package/dist/Tooltip/useTooltip.js +71 -13
  254. package/dist/TopNav/TopNavHeading.d.ts.map +1 -1
  255. package/dist/TopNav/TopNavHeading.js +4 -4
  256. package/dist/TopNav/TopNavItem.d.ts.map +1 -1
  257. package/dist/TopNav/TopNavItem.js +3 -3
  258. package/dist/TopNav/TopNavMegaMenu.d.ts.map +1 -1
  259. package/dist/TopNav/TopNavMegaMenu.js +2 -2
  260. package/dist/TopNav/TopNavMegaMenuItem.d.ts.map +1 -1
  261. package/dist/TopNav/TopNavMegaMenuItem.js +2 -2
  262. package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
  263. package/dist/TopNav/TopNavMenu.js +4 -4
  264. package/dist/TreeList/TreeListItem.d.ts.map +1 -1
  265. package/dist/TreeList/TreeListItem.js +7 -7
  266. package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
  267. package/dist/Typeahead/BaseTypeahead.js +2 -2
  268. package/dist/Typeahead/Typeahead.d.ts.map +1 -1
  269. package/dist/Typeahead/Typeahead.js +1 -1
  270. package/dist/astryx.css +124 -62
  271. package/dist/hooks/containerReveal.stylex.d.ts.map +1 -1
  272. package/dist/hooks/containerReveal.stylex.js +18 -18
  273. package/dist/hooks/scrollbarGutter.d.ts +28 -0
  274. package/dist/hooks/scrollbarGutter.d.ts.map +1 -0
  275. package/dist/hooks/scrollbarGutter.js +103 -0
  276. package/dist/hooks/useAutoMediaMode.d.ts +31 -0
  277. package/dist/hooks/useAutoMediaMode.d.ts.map +1 -0
  278. package/dist/hooks/useAutoMediaMode.js +201 -0
  279. package/dist/hooks/useInputStatusIcon.d.ts.map +1 -1
  280. package/dist/hooks/useInputStatusIcon.js +1 -1
  281. package/dist/hooks/useListFocus.d.ts +5 -2
  282. package/dist/hooks/useListFocus.d.ts.map +1 -1
  283. package/dist/hooks/useListFocus.js +12 -6
  284. package/dist/hooks/useScrollLock.d.ts +4 -0
  285. package/dist/hooks/useScrollLock.d.ts.map +1 -1
  286. package/dist/hooks/useScrollLock.js +13 -1
  287. package/dist/i18n/InternationalizationContext.d.ts.map +1 -1
  288. package/dist/i18n/InternationalizationContext.js +2 -0
  289. package/dist/i18n/index.d.ts +6 -0
  290. package/dist/i18n/index.d.ts.map +1 -1
  291. package/dist/i18n/index.js +6 -0
  292. package/dist/i18n/useCollator.d.ts +12 -0
  293. package/dist/i18n/useCollator.d.ts.map +1 -0
  294. package/dist/i18n/useCollator.js +40 -0
  295. package/dist/i18n/useLocale.d.ts +3 -0
  296. package/dist/i18n/useLocale.d.ts.map +1 -0
  297. package/dist/i18n/useLocale.js +31 -0
  298. package/dist/theme/MediaTheme.d.ts +25 -5
  299. package/dist/theme/MediaTheme.d.ts.map +1 -1
  300. package/dist/theme/MediaTheme.js +31 -6
  301. package/dist/theme/defineTheme.d.ts +5 -0
  302. package/dist/theme/defineTheme.d.ts.map +1 -1
  303. package/dist/theme/defineTheme.js +5 -0
  304. package/dist/theme/derivedVarRegistry.d.ts.map +1 -1
  305. package/dist/theme/derivedVarRegistry.js +7 -0
  306. package/dist/theme/generateThemeRules.d.ts.map +1 -1
  307. package/dist/theme/generateThemeRules.js +66 -5
  308. package/dist/theme/index.d.ts +1 -1
  309. package/dist/theme/index.d.ts.map +1 -1
  310. package/dist/theme/syntax/index.d.ts +6 -0
  311. package/dist/theme/syntax/index.d.ts.map +1 -1
  312. package/dist/theme/syntax/index.js +7 -2
  313. package/dist/utils/dateParser.d.ts +4 -3
  314. package/dist/utils/dateParser.d.ts.map +1 -1
  315. package/dist/utils/dateParser.js +8 -8
  316. package/dist/utils/index.d.ts +1 -1
  317. package/dist/utils/index.d.ts.map +1 -1
  318. package/dist/utils/index.js +1 -1
  319. package/dist/utils/plainDate.d.ts +5 -2
  320. package/dist/utils/plainDate.d.ts.map +1 -1
  321. package/dist/utils/plainDate.js +20 -4
  322. package/locales/en.json +28 -0
  323. package/locales/pseudo.json +21 -0
  324. package/package.json +3 -3
  325. package/src/Avatar/Avatar.doc.mjs +10 -6
  326. package/src/Avatar/Avatar.test.tsx +219 -1
  327. package/src/Avatar/Avatar.tsx +179 -37
  328. package/src/Avatar/AvatarStatusDot.tsx +30 -4
  329. package/src/Avatar/AvatarStatusLabelContext.ts +47 -0
  330. package/src/AvatarGroup/AvatarGroup.doc.mjs +10 -6
  331. package/src/AvatarGroup/AvatarGroup.test.tsx +62 -0
  332. package/src/AvatarGroup/AvatarGroup.tsx +3 -1
  333. package/src/AvatarGroup/AvatarGroupOverflow.tsx +31 -8
  334. package/src/Banner/Banner.doc.mjs +2 -0
  335. package/src/Blockquote/Blockquote.doc.mjs +30 -7
  336. package/src/Blockquote/Blockquote.test.tsx +34 -3
  337. package/src/Blockquote/Blockquote.tsx +11 -9
  338. package/src/BottomSheet/BottomSheet.doc.mjs +3 -3
  339. package/src/BottomSheet/BottomSheet.test.tsx +24 -0
  340. package/src/BottomSheet/BottomSheetPanel.test.tsx +91 -0
  341. package/src/BottomSheet/BottomSheetPanel.tsx +58 -3
  342. package/src/Breadcrumbs/BreadcrumbItem.tsx +36 -23
  343. package/src/Breadcrumbs/Breadcrumbs.doc.mjs +26 -2
  344. package/src/Breadcrumbs/Breadcrumbs.test.tsx +31 -0
  345. package/src/Button/Button.tsx +12 -9
  346. package/src/Calendar/Calendar.tsx +15 -9
  347. package/src/Calendar/hooks/useCalendarNavigation.ts +6 -4
  348. package/src/Calendar/styles.ts +8 -5
  349. package/src/Center/Center.doc.mjs +48 -0
  350. package/src/Center/Center.test.tsx +158 -0
  351. package/src/Center/Center.tsx +50 -9
  352. package/src/Chat/ChatComposer.tsx +11 -5
  353. package/src/Chat/ChatComposerDrawer.tsx +4 -1
  354. package/src/Chat/ChatToolCalls.tsx +13 -4
  355. package/src/Chat/{useChatDictation.test.ts → useChatDictation.test.tsx} +29 -14
  356. package/src/Chat/useChatDictation.ts +1 -1
  357. package/src/Chat/useSpeechRecognition.ts +5 -3
  358. package/src/Chat/useTriggerMenu.tsx +4 -1
  359. package/src/CheckboxInput/CheckboxInput.tsx +5 -2
  360. package/src/Citation/Citation.test.tsx +6 -1
  361. package/src/Citation/Citation.tsx +11 -5
  362. package/src/ClickableCard/ClickableCard.tsx +7 -4
  363. package/src/CodeBlock/CodeBlock.tsx +4 -1
  364. package/src/Collapsible/Collapsible.tsx +5 -2
  365. package/src/CommandPalette/CommandPaletteItem.tsx +6 -3
  366. package/src/ComplexSelector/ComplexSelector.doc.mjs +10 -0
  367. package/src/ComplexSelector/ComplexSelector.tsx +14 -7
  368. package/src/DateInput/DateInput.test.tsx +17 -1
  369. package/src/DateInput/DateInput.tsx +93 -21
  370. package/src/DateInput/DateInputTouch.test.tsx +2582 -0
  371. package/src/DateInput/MonthScroller.tsx +878 -0
  372. package/src/DateInput/MonthYearWheels.tsx +147 -0
  373. package/src/DateInput/TouchDateField.tsx +1223 -0
  374. package/src/DateInput/Wheel.tsx +473 -0
  375. package/src/DateInput/monthGeometry.ts +118 -0
  376. package/src/DateInput/tokens.stylex.ts +99 -0
  377. package/src/DateInput/useOwnScrollGesture.ts +227 -0
  378. package/src/DateInput/usePointerDragScroll.ts +220 -0
  379. package/src/DateInput/useScrollSettle.ts +164 -0
  380. package/src/DateRangeInput/DateRangeInput.doc.mjs +1 -1
  381. package/src/DateRangeInput/DateRangeInput.tsx +31 -13
  382. package/src/DateTimeInput/DateTimeInput.tsx +25 -9
  383. package/src/Dialog/Dialog.test.tsx +24 -0
  384. package/src/Dialog/Dialog.tsx +3 -0
  385. package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +5 -2
  386. package/src/DropdownMenu/DropdownMenuItem.tsx +5 -2
  387. package/src/DropdownMenu/DropdownMenuRadioItem.tsx +5 -2
  388. package/src/DropdownMenu/DropdownMenuSubMenu.tsx +5 -2
  389. package/src/Field/Field.doc.mjs +2 -0
  390. package/src/Field/FieldLabel.tsx +9 -3
  391. package/src/Field/InputClearButton.test.tsx +110 -3
  392. package/src/Field/InputClearButton.tsx +38 -0
  393. package/src/Field/inputStyles.stylex.ts +17 -13
  394. package/src/FileInput/FileInput.tsx +15 -8
  395. package/src/FormLayout/FormLayout.doc.mjs +1 -1
  396. package/src/HoverCard/HoverCard.doc.mjs +18 -0
  397. package/src/HoverCard/HoverCard.test.tsx +189 -0
  398. package/src/HoverCard/HoverCard.tsx +22 -2
  399. package/src/HoverCard/index.ts +1 -0
  400. package/src/HoverCard/useHoverCard.doc.mjs +2 -0
  401. package/src/HoverCard/useHoverCard.tsx +103 -7
  402. package/src/InputGroup/InputGroup.tsx +1 -1
  403. package/src/Item/Item.doc.mjs +1 -0
  404. package/src/Item/Item.test.tsx +50 -0
  405. package/src/Item/Item.tsx +54 -6
  406. package/src/Layer/index.ts +10 -0
  407. package/src/Layer/useLayer.tsx +13 -2
  408. package/src/Layer/useTouchTrigger.test.ts +70 -0
  409. package/src/Layer/useTouchTrigger.ts +366 -0
  410. package/src/Layout/Layout.doc.mjs +18 -0
  411. package/src/Layout/container.stylex.ts +11 -3
  412. package/src/Layout/index.ts +4 -0
  413. package/src/Layout/overlayPaddingReset.test.tsx +222 -0
  414. package/src/Layout/padding.stylex.ts +192 -12
  415. package/src/Lightbox/Lightbox.tsx +11 -3
  416. package/src/Link/Link.tsx +9 -6
  417. package/src/MetadataList/MetadataList.tsx +4 -1
  418. package/src/MobileNav/MobileNav.tsx +61 -5
  419. package/src/MobileNav/MobileNavEntryAnimation.test.tsx +212 -0
  420. package/src/MobileNav/MobileNavScrollbarGutter.test.tsx +109 -0
  421. package/src/MultiSelector/MultiSelector.test.tsx +1 -1
  422. package/src/MultiSelector/MultiSelector.tsx +26 -10
  423. package/src/NavItem/navItemStyles.stylex.ts +7 -4
  424. package/src/NavMenu/NavHeadingMenuItem.tsx +6 -3
  425. package/src/NumberInput/NumberInput.doc.mjs +24 -0
  426. package/src/NumberInput/NumberInput.test.tsx +138 -0
  427. package/src/NumberInput/NumberInput.tsx +47 -8
  428. package/src/Outline/Outline.tsx +5 -2
  429. package/src/Pagination/Pagination.tsx +5 -2
  430. package/src/Popover/Popover.test.tsx +27 -1
  431. package/src/PowerSearch/PowerSearch.tsx +17 -8
  432. package/src/PowerSearch/PowerSearchToken.tsx +3 -0
  433. package/src/PowerSearch/formatFilterValue.test.ts +22 -2
  434. package/src/PowerSearch/formatFilterValue.ts +31 -6
  435. package/src/RadioList/RadioList.doc.mjs +1 -1
  436. package/src/RadioList/RadioList.test.tsx +170 -2
  437. package/src/RadioList/RadioListItem.tsx +88 -53
  438. package/src/Resizable/ResizeHandle.test.tsx +22 -0
  439. package/src/Resizable/ResizeHandle.tsx +25 -7
  440. package/src/Section/Section.doc.mjs +55 -0
  441. package/src/Section/Section.test.tsx +201 -4
  442. package/src/Section/Section.tsx +69 -0
  443. package/src/SegmentedControl/SegmentedControl.test.tsx +31 -0
  444. package/src/SegmentedControl/SegmentedControlItem.tsx +15 -3
  445. package/src/SelectableCard/SelectableCard.tsx +6 -3
  446. package/src/Selector/Selector.doc.mjs +16 -2
  447. package/src/Selector/Selector.test.tsx +525 -1
  448. package/src/Selector/Selector.tsx +180 -25
  449. package/src/Selector/SelectorOption.doc.mjs +7 -0
  450. package/src/Selector/SelectorOption.tsx +21 -0
  451. package/src/Selector/SelectorRowLayoutContext.ts +32 -0
  452. package/src/Selector/types.ts +4 -4
  453. package/src/SideNav/SideNavHeading.tsx +14 -5
  454. package/src/SideNav/SideNavItem.tsx +9 -3
  455. package/src/Slider/Slider.tsx +25 -6
  456. package/src/Stack/Stack.doc.mjs +72 -0
  457. package/src/Stack/Stack.test.tsx +156 -0
  458. package/src/Stack/Stack.tsx +50 -8
  459. package/src/Switch/Switch.tsx +5 -2
  460. package/src/TabList/Tab.tsx +4 -1
  461. package/src/TabList/TabMenu.tsx +9 -3
  462. package/src/Table/TableRow.tsx +4 -4
  463. package/src/Table/plugins/columnResize/useTableColumnResize.tsx +6 -2
  464. package/src/Table/plugins/filtering/useTableFiltering.tsx +4 -1
  465. package/src/Table/plugins/groupedRows/useTableGroupedRows.tsx +10 -3
  466. package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +6 -3
  467. package/src/Table/plugins/sortable/useTableSortable.tsx +4 -1
  468. package/src/Table/plugins/sortable/useTableSortableState.test.tsx +34 -0
  469. package/src/Table/plugins/sortable/useTableSortableState.tsx +26 -23
  470. package/src/Table/plugins/tree/useTableTreeData.tsx +10 -4
  471. package/src/TextArea/TextArea.doc.mjs +1 -1
  472. package/src/TextArea/TextArea.tsx +1 -1
  473. package/src/TextInput/TextInput.tsx +1 -1
  474. package/src/Thumbnail/Thumbnail.tsx +9 -3
  475. package/src/TimeInput/TimeInput.tsx +1 -1
  476. package/src/Timestamp/Timestamp.test.tsx +27 -7
  477. package/src/Timestamp/Timestamp.tsx +8 -4
  478. package/src/Timestamp/formatInstant.ts +9 -7
  479. package/src/Timestamp/tooltipEntries.test.ts +11 -6
  480. package/src/Timestamp/tooltipEntries.ts +6 -2
  481. package/src/Toast/Toast.tsx +9 -7
  482. package/src/Token/Token.tsx +14 -5
  483. package/src/Tokenizer/Tokenizer.tsx +4 -1
  484. package/src/Tooltip/Tooltip.doc.mjs +18 -0
  485. package/src/Tooltip/Tooltip.test.tsx +254 -1
  486. package/src/Tooltip/Tooltip.tsx +22 -2
  487. package/src/Tooltip/index.ts +1 -0
  488. package/src/Tooltip/useTooltip.doc.mjs +2 -0
  489. package/src/Tooltip/useTooltip.tsx +99 -21
  490. package/src/TopNav/TopNavHeading.tsx +13 -4
  491. package/src/TopNav/TopNavItem.tsx +6 -3
  492. package/src/TopNav/TopNavMegaMenu.tsx +5 -2
  493. package/src/TopNav/TopNavMegaMenuItem.tsx +5 -2
  494. package/src/TopNav/TopNavMenu.tsx +10 -4
  495. package/src/TreeList/TreeListItem.tsx +22 -7
  496. package/src/Typeahead/BaseTypeahead.tsx +5 -2
  497. package/src/Typeahead/Typeahead.tsx +4 -1
  498. package/src/hooks/containerReveal.stylex.ts +54 -18
  499. package/src/hooks/scrollbarGutter.test.ts +167 -0
  500. package/src/hooks/scrollbarGutter.ts +121 -0
  501. package/src/hooks/useAutoMediaMode.test.ts +109 -0
  502. package/src/hooks/useAutoMediaMode.ts +233 -0
  503. package/src/hooks/useInputStatusIcon.tsx +4 -1
  504. package/src/hooks/useListFocus.doc.mjs +2 -2
  505. package/src/hooks/useListFocus.test.tsx +65 -3
  506. package/src/hooks/useListFocus.ts +15 -7
  507. package/src/hooks/useScrollLock.doc.mjs +4 -4
  508. package/src/hooks/useScrollLock.test.ts +73 -0
  509. package/src/hooks/useScrollLock.ts +14 -0
  510. package/src/i18n/InternationalizationContext.ts +2 -0
  511. package/src/i18n/__tests__/e2e-powersearch.test.tsx +37 -1
  512. package/src/i18n/__tests__/useCollator.test.tsx +115 -0
  513. package/src/i18n/__tests__/useLocale.test.tsx +52 -0
  514. package/src/i18n/index.ts +6 -0
  515. package/src/i18n/useCollator.doc.mjs +84 -0
  516. package/src/i18n/useCollator.ts +44 -0
  517. package/src/i18n/useLocale.doc.mjs +70 -0
  518. package/src/i18n/useLocale.ts +34 -0
  519. package/src/i18n/useTranslator.doc.mjs +1 -1
  520. package/src/reset.css +9 -2
  521. package/src/reset.test.ts +22 -0
  522. package/src/theme/MediaTheme.doc.mjs +23 -4
  523. package/src/theme/MediaTheme.dom.test.tsx +97 -0
  524. package/src/theme/MediaTheme.tsx +42 -7
  525. package/src/theme/defineTheme.test.ts +9 -3
  526. package/src/theme/defineTheme.ts +5 -0
  527. package/src/theme/derivedVarRegistry.test.ts +19 -5
  528. package/src/theme/derivedVarRegistry.ts +4 -0
  529. package/src/theme/generateThemeRules.test.ts +118 -0
  530. package/src/theme/generateThemeRules.ts +83 -5
  531. package/src/theme/index.ts +1 -1
  532. package/src/theme/syntax/index.ts +6 -2
  533. package/src/theme/syntax/serverSafeSyntax.test.ts +68 -0
  534. package/src/utils/dateParser.test.ts +20 -0
  535. package/src/utils/dateParser.ts +14 -7
  536. package/src/utils/index.ts +2 -0
  537. package/src/utils/plainDate.test.ts +6 -0
  538. package/src/utils/plainDate.ts +21 -4
@@ -73,6 +73,7 @@ import {useCombobox, useSelectedItemOffset} from './hooks';
73
73
  import {useTypeahead} from '../hooks/useTypeahead';
74
74
  import {useResolvedRequired} from '../hooks/useResolvedRequired';
75
75
  import {SelectorOption} from './SelectorOption';
76
+ import {SelectorRowLayoutContext} from './SelectorRowLayoutContext';
76
77
  import {getInputARIA, isImeKeyEvent, mergeProps} from '../utils';
77
78
  import {useSize} from '../SizeContext/SizeContext';
78
79
  import type {BaseProps} from '../BaseProps';
@@ -101,9 +102,18 @@ const styles = stylex.create({
101
102
  default: typeScaleVars['--text-label-size'],
102
103
  '@media (pointer: coarse)': `max(1rem, ${typeScaleVars['--text-label-size']})`,
103
104
  },
104
- lineHeight: typeScaleVars['--text-label-leading'],
105
+ // A FIXED line box, not the ratio: the trigger's padding is derived from
106
+ // one line being `--spacing-5` tall, and a ratio makes the line box track
107
+ // the font — which the coarse-pointer bump above (and any theme that
108
+ // changes `--font-size-base`) then moves, taking the control off its size
109
+ // token. The glyphs still grow for touch; only the box they sit in is
110
+ // pinned. Item's own rows set their line heights and are unaffected.
111
+ lineHeight: spacingVars['--spacing-5'],
105
112
  color: colorVars['--color-text-primary'],
106
- cursor: 'pointer',
113
+ cursor: {
114
+ default: 'pointer',
115
+ ':is(:disabled,[aria-disabled="true"])': 'default',
116
+ },
107
117
  },
108
118
  // Trigger button — the actual combobox button, visually integrated with the container
109
119
  trigger: {
@@ -124,7 +134,10 @@ const styles = stylex.create({
124
134
  fontSize: 'inherit',
125
135
  lineHeight: 'inherit',
126
136
  color: 'inherit',
127
- cursor: 'pointer',
137
+ cursor: {
138
+ default: 'pointer',
139
+ ':is(:disabled,[aria-disabled="true"])': 'default',
140
+ },
128
141
  // The wrapper (inputWrapperStyles.base) renders the focus ring via
129
142
  // :focus-within when this button is focused, matching TextInput/NumberInput.
130
143
  // The button must not draw its own :focus-visible outline or the two stack
@@ -142,6 +155,43 @@ const styles = stylex.create({
142
155
  whiteSpace: 'nowrap',
143
156
  textAlign: 'start',
144
157
  },
158
+ // Inside an InputGroup the group's own height is the row, and the trigger
159
+ // takes it: `height: 100%` from `groupStyles.inGroup` can only govern if the
160
+ // trigger stops asserting a floor of its own — otherwise a control sized
161
+ // above its group (`<InputGroup size="md"><Selector size="lg">`) grows the
162
+ // row it was supposed to sit in. The padding goes with it: the row is
163
+ // already the size token, and the value box is centred in it.
164
+ triggerInGroup: {
165
+ minHeight: 0,
166
+ paddingBlock: 0,
167
+ },
168
+ // Wrapper for `renderValue` output. Takes the free width and clips
169
+ // horizontally so a long value ellipsizes rather than widening the trigger;
170
+ // vertically the content sizes the control, which the size styles below
171
+ // handle.
172
+ triggerValue: {
173
+ flexGrow: 1,
174
+ minWidth: 0,
175
+ overflow: 'hidden',
176
+ textAlign: 'start',
177
+ },
178
+ // Inside an InputGroup the row height is the group's, so the trigger clamps
179
+ // its own value box to that row rather than asking the value to fit it: any
180
+ // node is cut off at the row's edge instead of bleeding through the border
181
+ // over whatever sits above and below the group. The rows the system draws
182
+ // itself never reach the cut — the row-layout context folds them onto one
183
+ // line first (SelectorRowLayoutContext).
184
+ //
185
+ // The clamp is a percentage, not the size token, because a group can be a
186
+ // different size than the control inside it; the row is whatever the group
187
+ // made it. That needs a definite height to resolve against, which is what
188
+ // stretching the button provides.
189
+ triggerButtonInGroup: {
190
+ alignSelf: 'stretch',
191
+ },
192
+ triggerValueInGroup: {
193
+ maxHeight: '100%',
194
+ },
145
195
  // Only what Icon does not already provide: `size="sm"` gives the 16px box
146
196
  // and `color` the token, but the glyph still must not shrink inside the flex
147
197
  // trigger.
@@ -169,16 +219,17 @@ const styles = stylex.create({
169
219
  backgroundColor: 'transparent',
170
220
  backgroundImage: {
171
221
  default: null,
172
- ':hover': {
222
+ ':hover:where(:not(:disabled,[aria-disabled="true"]))': {
173
223
  '@media (hover: hover)': `linear-gradient(${colorVars['--color-overlay-hover']}, ${colorVars['--color-overlay-hover']})`,
174
224
  },
175
225
  ':active': `linear-gradient(${colorVars['--color-overlay-pressed']}, ${colorVars['--color-overlay-pressed']})`,
176
226
  },
177
227
  boxShadow: {
178
228
  default: 'none',
179
- ':hover:not(:focus-within)': {
180
- '@media (hover: hover)': 'none',
181
- },
229
+ ':hover:not(:focus-within):where(:not(:disabled,[aria-disabled="true"]))':
230
+ {
231
+ '@media (hover: hover)': 'none',
232
+ },
182
233
  ':focus-within': 'none',
183
234
  },
184
235
  fontWeight: fontWeightVars['--font-weight-medium'],
@@ -208,7 +259,10 @@ const styles = stylex.create({
208
259
  borderStyle: 'none',
209
260
  backgroundColor: 'transparent',
210
261
  color: 'inherit',
211
- cursor: 'pointer',
262
+ cursor: {
263
+ default: 'pointer',
264
+ ':is(:disabled,[aria-disabled="true"])': 'default',
265
+ },
212
266
  borderRadius: radiusVars['--radius-element'],
213
267
  },
214
268
 
@@ -286,7 +340,10 @@ const styles = stylex.create({
286
340
  color: colorVars['--color-text-primary'],
287
341
  backgroundColor: 'transparent',
288
342
  border: 'none',
289
- cursor: 'pointer',
343
+ cursor: {
344
+ default: 'pointer',
345
+ ':is(:disabled,[aria-disabled="true"])': 'default',
346
+ },
290
347
  textAlign: 'start',
291
348
  outline: 'none',
292
349
  },
@@ -324,19 +381,35 @@ const styles = stylex.create({
324
381
  },
325
382
  itemDisabled: {
326
383
  opacity: 0.5,
327
- cursor: 'not-allowed',
384
+ cursor: 'default',
328
385
  },
329
386
  });
330
387
 
388
+ // The trigger is sized by PADDING, not by a fixed height, so it is the size
389
+ // token plus one text line for each extra line the value uses: 28/32/36 for
390
+ // one line, 48/52/56 for two. The token and a text line are both multiples of
391
+ // 4, so every trigger lands on the 4px rhythm and lines up with the Buttons
392
+ // and inputs beside it. No prop picks the height — the content does, and it
393
+ // can only land on the grid.
394
+ //
395
+ // `--spacing-5` is one line here because `triggerContainer` pins its
396
+ // line-height to exactly that; the two must stay in step, which is why both
397
+ // read the same token rather than one hardcoding 20px.
398
+ const linePad = (token: string) =>
399
+ `calc((${token} - ${spacingVars['--spacing-5']} - 2 * ${borderVars['--border-width']}) / 2)`;
400
+
331
401
  const sizeStyles = stylex.create({
332
402
  sm: {
333
- height: sizeVars['--size-element-sm'],
403
+ minHeight: sizeVars['--size-element-sm'],
404
+ paddingBlock: linePad(sizeVars['--size-element-sm']),
334
405
  },
335
406
  md: {
336
- height: sizeVars['--size-element-md'],
407
+ minHeight: sizeVars['--size-element-md'],
408
+ paddingBlock: linePad(sizeVars['--size-element-md']),
337
409
  },
338
410
  lg: {
339
- height: sizeVars['--size-element-lg'],
411
+ minHeight: sizeVars['--size-element-lg'],
412
+ paddingBlock: linePad(sizeVars['--size-element-lg']),
340
413
  },
341
414
  });
342
415
 
@@ -517,7 +590,8 @@ interface SelectorPropsBase<
517
590
  labelTooltip?: string;
518
591
 
519
592
  /**
520
- * Icon displayed at the start of the selector trigger.
593
+ * Icon displayed at the start of the selector trigger. Takes precedence over
594
+ * the selected option's own `icon`, which the trigger otherwise renders.
521
595
  */
522
596
  startIcon?: ReactNode | IconType;
523
597
 
@@ -527,6 +601,31 @@ interface SelectorPropsBase<
527
601
  */
528
602
  renderOption?: (option: SelectorOptionData) => ReactNode;
529
603
 
604
+ /**
605
+ * Custom render function for the selected option inside the closed trigger.
606
+ * Only called when something is selected; the placeholder is unaffected.
607
+ *
608
+ * Passing this does not change the trigger's height — what it draws does. A
609
+ * one-line value measures exactly the `size` token, so the control still
610
+ * lines up with the Buttons and inputs beside it; each further line of
611
+ * content adds one text line. Inside an `InputGroup` the group owns the row
612
+ * height: the trigger clamps its value box to that row, so a `SelectorOption`
613
+ * folds onto one line and ellipsizes, and anything taller than the row is cut
614
+ * off at it rather than bleeding over the rows above and below.
615
+ *
616
+ * @example
617
+ * ```
618
+ * renderValue={option => (
619
+ * <SelectorOption
620
+ * icon={option.icon}
621
+ * label={option.label}
622
+ * description={option.description}
623
+ * />
624
+ * )}
625
+ * ```
626
+ */
627
+ renderValue?: (option: SelectorOptionData) => ReactNode;
628
+
530
629
  /**
531
630
  * Which edge of the option row carries the selected mark. `start` reserves a
532
631
  * mark column ahead of every label so they stay aligned, the way a native
@@ -614,7 +713,11 @@ export type SelectorProps<T extends SelectorOptionType = SelectorOptionType> =
614
713
  */
615
714
  function DefaultOption({option}: {option: SelectorOptionData}) {
616
715
  return (
617
- <SelectorOption icon={option.icon} label={option.label ?? option.value} />
716
+ <SelectorOption
717
+ icon={option.icon}
718
+ label={option.label ?? option.value}
719
+ description={option.description}
720
+ />
618
721
  );
619
722
  }
620
723
 
@@ -687,6 +790,7 @@ export function Selector<T extends SelectorOptionType>(
687
790
  startIcon,
688
791
  htmlName,
689
792
  renderOption,
793
+ renderValue,
690
794
  indicatorPosition = 'end',
691
795
  hasSearch = false,
692
796
  searchPlaceholder: searchPlaceholderFromProps,
@@ -1166,12 +1270,27 @@ export function Selector<T extends SelectorOptionType>(
1166
1270
  aria-disabled={item.disabled}
1167
1271
  onClick={() => onItemSelect(item)}
1168
1272
  onMouseEnter={() => onItemMouseEnter(item, flatIndex)}
1169
- {...stylex.props(
1170
- styles.item,
1171
- itemSizeStyles[size],
1172
- isHighlighted && styles.itemHighlighted,
1173
- isSelected && styles.itemSelected,
1174
- item.disabled && styles.itemDisabled,
1273
+ {...mergeProps(
1274
+ // Stable theme target on the option row itself, mirroring
1275
+ // `multi-selector-option`: it carries the row's size and runtime
1276
+ // state so a theme can express "selected option at large" or
1277
+ // restyle a given row density without structural selectors. The
1278
+ // row's padding is split across a base and a per-size override (the
1279
+ // default `md` trims the block axis), so `size` is what a theme
1280
+ // needs to reach it. Named `-option-row` because `selector-option`
1281
+ // is the public SelectorOption content primitive, not this row.
1282
+ themeProps('selector-option-row', {
1283
+ size,
1284
+ selected: isSelected ? 'selected' : null,
1285
+ disabled: item.disabled ? 'disabled' : null,
1286
+ }),
1287
+ stylex.props(
1288
+ styles.item,
1289
+ itemSizeStyles[size],
1290
+ isHighlighted && styles.itemHighlighted,
1291
+ isSelected && styles.itemSelected,
1292
+ item.disabled && styles.itemDisabled,
1293
+ ),
1175
1294
  )}>
1176
1295
  {content}
1177
1296
  </div>
@@ -1281,6 +1400,40 @@ export function Selector<T extends SelectorOptionType>(
1281
1400
  const showStatusTooltip =
1282
1401
  status != null && effectiveStatusVariant === 'tooltip' && !!status.message;
1283
1402
 
1403
+ // Two lines cannot fit inside an InputGroup: the group pins the row height,
1404
+ // and the trigger clamps its value box to one line so nothing bleeds through
1405
+ // its border (styles.triggerValueInGroup). The clamp holds for any node; the
1406
+ // context is what lets the rows the system draws itself reflow into that one
1407
+ // line — label and description side by side — instead of being cut off at
1408
+ // it. Outside a group the caller's own row decides, and the trigger's
1409
+ // padding sizes it to whatever that draws.
1410
+ const rowLayout = inputGroup ? 'inline' : 'stacked';
1411
+
1412
+ // What the closed trigger shows for the current selection: the option's icon
1413
+ // and label. `startIcon` wins over the option's own icon so a caller who
1414
+ // pins a field icon does not get two.
1415
+ const valueContent =
1416
+ selectedItem && renderValue ? (
1417
+ <SelectorRowLayoutContext value={rowLayout}>
1418
+ <span
1419
+ {...stylex.props(
1420
+ styles.triggerValue,
1421
+ inputGroup && styles.triggerValueInGroup,
1422
+ )}>
1423
+ {renderValue(selectedItem)}
1424
+ </span>
1425
+ </SelectorRowLayoutContext>
1426
+ ) : (
1427
+ <>
1428
+ {!startIcon &&
1429
+ selectedItem?.icon != null &&
1430
+ renderIconSlot(selectedItem.icon, {size: 'sm', color: 'secondary'})}
1431
+ <span {...stylex.props(styles.triggerLabel)}>
1432
+ {selectedItem?.label ?? placeholder}
1433
+ </span>
1434
+ </>
1435
+ );
1436
+
1284
1437
  const selectorContent = (
1285
1438
  <>
1286
1439
  <div
@@ -1318,6 +1471,7 @@ export function Selector<T extends SelectorOptionType>(
1318
1471
  !isDisabled &&
1319
1472
  inputStatusHoverShadowStyles[status.type],
1320
1473
  variant !== 'ghost' && inputGroup && groupStyles.inGroup,
1474
+ inputGroup && styles.triggerInGroup,
1321
1475
  xstyle,
1322
1476
  ),
1323
1477
  className,
@@ -1357,10 +1511,11 @@ export function Selector<T extends SelectorOptionType>(
1357
1511
  aria-disabled={showsDisabledMessage ? 'true' : undefined}
1358
1512
  onKeyDown={handleTriggerKeyDown}
1359
1513
  tabIndex={isDisabled && !showsDisabledMessage ? -1 : 0}
1360
- {...stylex.props(styles.trigger)}>
1361
- <span {...stylex.props(styles.triggerLabel)}>
1362
- {selectedItem?.label ?? placeholder}
1363
- </span>
1514
+ {...stylex.props(
1515
+ styles.trigger,
1516
+ inputGroup && styles.triggerButtonInGroup,
1517
+ )}>
1518
+ {valueContent}
1364
1519
  </button>
1365
1520
  {htmlName != null && (
1366
1521
  <input
@@ -27,6 +27,13 @@ export const docs = {
27
27
  type: 'ReactNode',
28
28
  description: 'Secondary description text displayed below the label.',
29
29
  },
30
+ {
31
+ name: 'layout',
32
+ type: "'stacked' | 'inline'",
33
+ description:
34
+ "How the label and description sit together. 'stacked' puts the description on its own line; 'inline' keeps both on one line so the row fits a fixed-height host. Inside a Selector trigger the trigger's padding sizes itself to whichever layout you pick, so both land on the 4px rhythm; an InputGroup pins the row height and forces 'inline'.",
35
+ default: "'stacked'",
36
+ },
30
37
  {
31
38
  name: 'endContent',
32
39
  type: 'ReactNode',
@@ -13,6 +13,7 @@ import * as stylex from '@stylexjs/stylex';
13
13
  import type {StyleXStyles} from '@stylexjs/stylex';
14
14
  import {renderIconSlot, type IconType} from '../Icon';
15
15
  import {Item} from '../Item';
16
+ import {useSelectorRowLayout} from './SelectorRowLayoutContext';
16
17
  import {mergeProps} from '../utils';
17
18
  import {themeProps} from '../utils/themeProps';
18
19
 
@@ -40,6 +41,20 @@ export interface SelectorOptionProps {
40
41
  */
41
42
  description?: ReactNode;
42
43
 
44
+ /**
45
+ * How the label and description sit together. `stacked` puts the
46
+ * description on its own line below the label; `inline` keeps both on one
47
+ * line, with the description ellipsizing first.
48
+ *
49
+ * In a Selector trigger this is the caller's choice and the trigger sizes
50
+ * itself to it — one line at the size token, two lines exactly one text line
51
+ * taller. Inside an `InputGroup` the row height is pinned by the group, so
52
+ * `inline` is forced.
53
+ *
54
+ * @default 'stacked'
55
+ */
56
+ layout?: 'stacked' | 'inline';
57
+
43
58
  /**
44
59
  * Additional content to render after the label/description.
45
60
  */
@@ -95,11 +110,16 @@ export function SelectorOption({
95
110
  icon,
96
111
  label,
97
112
  description,
113
+ layout,
98
114
  endContent,
99
115
  xstyle,
100
116
  className,
101
117
  style,
102
118
  }: SelectorOptionProps) {
119
+ // A height-pinned host (the trigger inside an InputGroup) overrides the
120
+ // caller's choice: the row physically cannot be two lines there.
121
+ const enforcedLayout = useSelectorRowLayout();
122
+
103
123
  return (
104
124
  <Item
105
125
  startContent={
@@ -109,6 +129,7 @@ export function SelectorOption({
109
129
  }
110
130
  label={label}
111
131
  description={description}
132
+ layout={enforcedLayout === 'inline' ? 'inline' : layout}
112
133
  endContent={endContent}
113
134
  xstyle={[embeddedStyles.root, xstyle]}
114
135
  {...mergeProps(themeProps('selector-option'), {className, style})}
@@ -0,0 +1,32 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ /**
6
+ * @file SelectorRowLayoutContext.ts
7
+ * @input React createContext/use
8
+ * @output Exports the row-layout context and useSelectorRowLayout hook
9
+ * @position Internal to the Selector module; read by SelectorOption
10
+ *
11
+ * The trigger inside an InputGroup is height-pinned by the group, so its value
12
+ * box is clamped to one line and anything taller is cut off at the fold. This
13
+ * context is how the rows the system draws itself avoid being cut: they reflow
14
+ * label and description onto that one line instead. The geometry does not
15
+ * depend on it — a node that ignores this context still cannot grow the row.
16
+ */
17
+
18
+ import {createContext, use} from 'react';
19
+
20
+ export type SelectorRowLayout = 'stacked' | 'inline';
21
+
22
+ export const SelectorRowLayoutContext =
23
+ createContext<SelectorRowLayout>('stacked');
24
+ SelectorRowLayoutContext.displayName = 'SelectorRowLayoutContext';
25
+
26
+ /**
27
+ * The row layout a host imposes on the options it renders. `stacked` outside
28
+ * any height-pinned host.
29
+ */
30
+ export function useSelectorRowLayout(): SelectorRowLayout {
31
+ return use(SelectorRowLayoutContext);
32
+ }
@@ -14,7 +14,10 @@ import type {IconType} from '../Icon';
14
14
  */
15
15
  export type SelectorOptionData = {
16
16
  value: string;
17
+ // Kept a string, not ReactNode: search filtering and type-ahead both
18
+ // lowercase this to match keystrokes.
17
19
  label?: string;
20
+ description?: ReactNode;
18
21
  disabled?: boolean;
19
22
  icon?: ReactNode | IconType;
20
23
  };
@@ -40,7 +43,4 @@ export type SelectorSection = {
40
43
  * Can be a plain string, option data object, divider, or section.
41
44
  */
42
45
  export type SelectorOptionType =
43
- | string
44
- | SelectorOptionData
45
- | SelectorDivider
46
- | SelectorSection;
46
+ string | SelectorOptionData | SelectorDivider | SelectorSection;
@@ -73,7 +73,10 @@ const styles = stylex.create({
73
73
  paddingInline: 0,
74
74
  },
75
75
  interactive: {
76
- cursor: 'pointer',
76
+ cursor: {
77
+ default: 'pointer',
78
+ ':is(:disabled,[aria-disabled="true"])': 'default',
79
+ },
77
80
  borderRadius: radiusVars['--radius-element'],
78
81
  borderWidth: 0,
79
82
  borderStyle: 'none',
@@ -82,7 +85,7 @@ const styles = stylex.create({
82
85
  fontSize: 'inherit',
83
86
  fontWeight: fontWeightVars['--font-weight-normal'],
84
87
  textAlign: 'start',
85
- ':hover': {
88
+ ':hover:where(:not(:disabled,[aria-disabled="true"]))': {
86
89
  '@media (hover: hover)': {
87
90
  backgroundColor: colorVars['--color-overlay-hover'],
88
91
  },
@@ -91,7 +94,10 @@ const styles = stylex.create({
91
94
  // Menu trigger: like interactive but no hover background.
92
95
  // Only cursor:pointer signals interactivity; the popover provides context.
93
96
  menuTrigger: {
94
- cursor: 'pointer',
97
+ cursor: {
98
+ default: 'pointer',
99
+ ':is(:disabled,[aria-disabled="true"])': 'default',
100
+ },
95
101
  borderRadius: radiusVars['--radius-element'],
96
102
  borderWidth: 0,
97
103
  borderStyle: 'none',
@@ -104,7 +110,7 @@ const styles = stylex.create({
104
110
  interactiveCollapsed: {
105
111
  backgroundColor: {
106
112
  default: 'transparent',
107
- ':hover': {
113
+ ':hover:where(:not(:disabled,[aria-disabled="true"]))': {
108
114
  '@media (hover: hover)': 'transparent',
109
115
  },
110
116
  },
@@ -212,7 +218,10 @@ const styles = stylex.create({
212
218
  marginBlockStart: spacingVars['--spacing-1'],
213
219
  marginBlockEnd: spacingVars['--spacing-2'],
214
220
  marginInline: spacingVars['--spacing-1'],
215
- cursor: 'pointer',
221
+ cursor: {
222
+ default: 'pointer',
223
+ ':is(:disabled,[aria-disabled="true"])': 'default',
224
+ },
216
225
  },
217
226
  // Chevron inside the popover heading — same as chevron but rotated up
218
227
  popoverChevron: {
@@ -145,9 +145,12 @@ const styles = stylex.create({
145
145
  borderStyle: 'none',
146
146
  backgroundColor: 'transparent',
147
147
  color: 'inherit',
148
- cursor: 'pointer',
148
+ cursor: {
149
+ default: 'pointer',
150
+ ':is(:disabled,[aria-disabled="true"])': 'default',
151
+ },
149
152
  borderRadius: radiusVars['--radius-element'],
150
- ':hover': {
153
+ ':hover:where(:not(:disabled,[aria-disabled="true"]))': {
151
154
  '@media (hover: hover)': {
152
155
  backgroundColor: colorVars['--color-overlay-hover'],
153
156
  },
@@ -181,7 +184,10 @@ const styles = stylex.create({
181
184
  fontWeight: 'inherit',
182
185
  lineHeight: 'inherit',
183
186
  textAlign: 'start',
184
- cursor: 'pointer',
187
+ cursor: {
188
+ default: 'pointer',
189
+ ':is(:disabled,[aria-disabled="true"])': 'default',
190
+ },
185
191
  },
186
192
  // No border and no background: `usePopover` paints the panel this renders
187
193
  // into. Drawing a second surface here put square corners inside its rounded
@@ -184,18 +184,34 @@ const styles = stylex.create({
184
184
  '@media (pointer: coarse)': '24px',
185
185
  },
186
186
  width: '100%',
187
- cursor: 'pointer',
187
+ cursor: {
188
+ default: 'pointer',
189
+ ':is(:disabled,[aria-disabled="true"])': 'default',
190
+ },
188
191
  },
189
192
  trackContainerVertical: {
190
193
  width: THUMB_SIZE,
191
194
  height: 160,
195
+ // Same tap target, rotated: the vertical track is the thing you press, and
196
+ // it is only THUMB_SIZE (20px) wide. `minBlockSize` above floors the
197
+ // horizontal track's short axis; here the short axis is the inline one
198
+ // (the block size is already 160px), so floor that instead. The rail,
199
+ // fill, marks and thumb all center on the inline 50%, so they stay put;
200
+ // only the invisible tappable area grows. Desktop is unchanged.
201
+ minInlineSize: {
202
+ default: null,
203
+ '@media (pointer: coarse)': '24px',
204
+ },
192
205
  flexDirection: 'column',
193
206
  justifyContent: 'center',
194
- cursor: 'pointer',
207
+ cursor: {
208
+ default: 'pointer',
209
+ ':is(:disabled,[aria-disabled="true"])': 'default',
210
+ },
195
211
  },
196
212
  trackContainerDisabled: {
197
213
  opacity: 0.5,
198
- cursor: 'not-allowed',
214
+ cursor: 'default',
199
215
  },
200
216
  track: {
201
217
  position: 'absolute',
@@ -241,7 +257,10 @@ const styles = stylex.create({
241
257
  },
242
258
  transitionTimingFunction: easeVars['--ease-standard'],
243
259
  outline: 'none',
244
- cursor: 'grab',
260
+ cursor: {
261
+ default: 'grab',
262
+ ':is(:disabled,[aria-disabled="true"])': 'default',
263
+ },
245
264
  zIndex: 1,
246
265
  },
247
266
  thumbHorizontal: {
@@ -258,14 +277,14 @@ const styles = stylex.create({
258
277
  thumbHover: {
259
278
  backgroundColor: {
260
279
  default: colorVars['--color-accent'],
261
- ':hover': {
280
+ ':hover:where(:not(:disabled,[aria-disabled="true"]))': {
262
281
  '@media (hover: hover)': `color-mix(in srgb, ${colorVars['--color-accent']}, ${colorVars['--color-tint-hover']} 15%)`,
263
282
  },
264
283
  },
265
284
  },
266
285
  thumbDisabled: {
267
286
  backgroundColor: colorVars['--color-background-muted'],
268
- cursor: 'not-allowed',
287
+ cursor: 'default',
269
288
  },
270
289
  textValue: {
271
290
  fontFamily: typographyVars['--font-family-body'],