@astryxdesign/core 0.4.4 → 0.4.5-canary.013e728

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 (469) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/dist/AvatarGroup/AvatarGroupOverflow.js +1 -1
  3. package/dist/BottomSheet/BottomSheet.d.ts +11 -2
  4. package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
  5. package/dist/BottomSheet/BottomSheet.js +4 -0
  6. package/dist/BottomSheet/BottomSheetPanel.d.ts +5 -2
  7. package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
  8. package/dist/BottomSheet/BottomSheetPanel.js +65 -15
  9. package/dist/BottomSheet/index.d.ts +1 -1
  10. package/dist/BottomSheet/index.d.ts.map +1 -1
  11. package/dist/BottomSheet/snapOffsets.d.ts +57 -20
  12. package/dist/BottomSheet/snapOffsets.d.ts.map +1 -1
  13. package/dist/BottomSheet/snapOffsets.js +106 -30
  14. package/dist/BottomSheet/useSheetGestures.d.ts +13 -8
  15. package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
  16. package/dist/BottomSheet/useSheetGestures.js +160 -64
  17. package/dist/Breadcrumbs/BreadcrumbItem.js +6 -6
  18. package/dist/Button/Button.js +5 -5
  19. package/dist/Calendar/Calendar.d.ts +17 -0
  20. package/dist/Calendar/Calendar.d.ts.map +1 -1
  21. package/dist/Calendar/Calendar.js +55 -15
  22. package/dist/Calendar/getStandaloneShortWeekdayNames.d.ts +14 -0
  23. package/dist/Calendar/getStandaloneShortWeekdayNames.d.ts.map +1 -0
  24. package/dist/Calendar/getStandaloneShortWeekdayNames.js +26 -0
  25. package/dist/Calendar/hooks/useCalendarConstraints.d.ts +22 -1
  26. package/dist/Calendar/hooks/useCalendarConstraints.d.ts.map +1 -1
  27. package/dist/Calendar/hooks/useCalendarConstraints.js +26 -4
  28. package/dist/Calendar/hooks/useCalendarDays.d.ts.map +1 -1
  29. package/dist/Calendar/hooks/useCalendarDays.js +14 -10
  30. package/dist/Calendar/hooks/useCalendarNavigation.d.ts.map +1 -1
  31. package/dist/Calendar/hooks/useCalendarNavigation.js +8 -4
  32. package/dist/Calendar/standaloneShortWeekdayNames.generated.d.ts +47 -0
  33. package/dist/Calendar/standaloneShortWeekdayNames.generated.d.ts.map +1 -0
  34. package/dist/Calendar/standaloneShortWeekdayNames.generated.js +40 -0
  35. package/dist/Calendar/styles.js +3 -3
  36. package/dist/Center/Center.d.ts +23 -1
  37. package/dist/Center/Center.d.ts.map +1 -1
  38. package/dist/Center/Center.js +12 -6
  39. package/dist/Chat/ChatComposer.d.ts.map +1 -1
  40. package/dist/Chat/ChatComposer.js +2 -2
  41. package/dist/Chat/ChatToolCalls.js +1 -1
  42. package/dist/Chat/useChatDictation.d.ts +1 -1
  43. package/dist/Chat/useChatDictation.d.ts.map +1 -1
  44. package/dist/Chat/useSpeechRecognition.d.ts +1 -1
  45. package/dist/Chat/useSpeechRecognition.d.ts.map +1 -1
  46. package/dist/Chat/useSpeechRecognition.js +4 -3
  47. package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
  48. package/dist/CheckboxInput/CheckboxInput.js +9 -0
  49. package/dist/Citation/Citation.js +3 -3
  50. package/dist/ClickableCard/ClickableCard.js +2 -2
  51. package/dist/CommandPalette/CommandPaletteItem.js +1 -1
  52. package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
  53. package/dist/ComplexSelector/ComplexSelector.js +8 -3
  54. package/dist/DateInput/DateInput.d.ts.map +1 -1
  55. package/dist/DateInput/DateInput.js +17 -9
  56. package/dist/DateRangeInput/DateRangeInput.d.ts +23 -1
  57. package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
  58. package/dist/DateRangeInput/DateRangeInput.js +47 -9
  59. package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
  60. package/dist/DateTimeInput/DateTimeInput.js +18 -10
  61. package/dist/Dialog/Dialog.d.ts.map +1 -1
  62. package/dist/Dialog/Dialog.js +3 -3
  63. package/dist/Field/FieldLabel.d.ts +2 -1
  64. package/dist/Field/FieldLabel.d.ts.map +1 -1
  65. package/dist/Field/FieldLabel.js +21 -3
  66. package/dist/Field/InputClearButton.d.ts +2 -1
  67. package/dist/Field/InputClearButton.d.ts.map +1 -1
  68. package/dist/Field/InputClearButton.js +12 -1
  69. package/dist/Field/inputStyles.stylex.d.ts.map +1 -1
  70. package/dist/Field/inputStyles.stylex.js +4 -4
  71. package/dist/FileInput/FileInput.d.ts.map +1 -1
  72. package/dist/FileInput/FileInput.js +2 -2
  73. package/dist/FormLayout/FormLayout.d.ts +24 -2
  74. package/dist/FormLayout/FormLayout.d.ts.map +1 -1
  75. package/dist/FormLayout/FormLayout.js +7 -2
  76. package/dist/FormLayout/FormLayoutContext.d.ts +15 -2
  77. package/dist/FormLayout/FormLayoutContext.d.ts.map +1 -1
  78. package/dist/FormLayout/FormLayoutContext.js +19 -4
  79. package/dist/FormLayout/index.d.ts +1 -1
  80. package/dist/FormLayout/index.d.ts.map +1 -1
  81. package/dist/HoverCard/HoverCard.d.ts +13 -3
  82. package/dist/HoverCard/HoverCard.d.ts.map +1 -1
  83. package/dist/HoverCard/HoverCard.js +2 -0
  84. package/dist/HoverCard/index.d.ts +1 -1
  85. package/dist/HoverCard/index.d.ts.map +1 -1
  86. package/dist/HoverCard/useHoverCard.d.ts +17 -2
  87. package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
  88. package/dist/HoverCard/useHoverCard.js +78 -9
  89. package/dist/Item/Item.d.ts +9 -1
  90. package/dist/Item/Item.d.ts.map +1 -1
  91. package/dist/Item/Item.js +46 -8
  92. package/dist/Layer/index.d.ts +4 -2
  93. package/dist/Layer/index.d.ts.map +1 -1
  94. package/dist/Layer/index.js +2 -0
  95. package/dist/Layer/useLayer.d.ts.map +1 -1
  96. package/dist/Layer/useLayer.js +3 -2
  97. package/dist/Layer/useTouchTrigger.d.ts +113 -0
  98. package/dist/Layer/useTouchTrigger.d.ts.map +1 -0
  99. package/dist/Layer/useTouchTrigger.js +241 -0
  100. package/dist/Layout/container.stylex.d.ts +4 -2
  101. package/dist/Layout/container.stylex.d.ts.map +1 -1
  102. package/dist/Layout/container.stylex.js +19 -11
  103. package/dist/Layout/index.d.ts +1 -0
  104. package/dist/Layout/index.d.ts.map +1 -1
  105. package/dist/Layout/index.js +4 -0
  106. package/dist/Layout/padding.stylex.d.ts +315 -12
  107. package/dist/Layout/padding.stylex.d.ts.map +1 -1
  108. package/dist/Layout/padding.stylex.js +389 -12
  109. package/dist/Lightbox/Lightbox.d.ts.map +1 -1
  110. package/dist/Lightbox/Lightbox.js +2 -1
  111. package/dist/Link/Link.js +4 -4
  112. package/dist/Markdown/Markdown.d.ts +8 -0
  113. package/dist/Markdown/Markdown.d.ts.map +1 -1
  114. package/dist/Markdown/Markdown.js +31 -3
  115. package/dist/Markdown/parser.d.ts +14 -2
  116. package/dist/Markdown/parser.d.ts.map +1 -1
  117. package/dist/Markdown/parser.js +50 -2
  118. package/dist/MobileNav/MobileNav.d.ts +1 -0
  119. package/dist/MobileNav/MobileNav.d.ts.map +1 -1
  120. package/dist/MobileNav/MobileNav.js +24 -6
  121. package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
  122. package/dist/MultiSelector/MultiSelector.js +8 -3
  123. package/dist/NavItem/navItemStyles.stylex.d.ts +2 -2
  124. package/dist/NavItem/navItemStyles.stylex.js +2 -2
  125. package/dist/NavMenu/NavHeadingMenuItem.js +1 -1
  126. package/dist/NumberInput/NumberInput.d.ts.map +1 -1
  127. package/dist/NumberInput/NumberInput.js +38 -5
  128. package/dist/Outline/Outline.js +2 -2
  129. package/dist/Outline/parseOutlineFromMarkdown.d.ts +2 -0
  130. package/dist/Outline/parseOutlineFromMarkdown.d.ts.map +1 -1
  131. package/dist/Outline/parseOutlineFromMarkdown.js +5 -31
  132. package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
  133. package/dist/PowerSearch/PowerSearch.js +11 -12
  134. package/dist/PowerSearch/PowerSearchToken.d.ts.map +1 -1
  135. package/dist/PowerSearch/PowerSearchToken.js +3 -1
  136. package/dist/PowerSearch/formatFilterValue.d.ts +11 -2
  137. package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
  138. package/dist/PowerSearch/formatFilterValue.js +23 -8
  139. package/dist/RadioList/RadioList.d.ts.map +1 -1
  140. package/dist/RadioList/RadioList.js +12 -1
  141. package/dist/RadioList/RadioListItem.d.ts +2 -2
  142. package/dist/RadioList/RadioListItem.d.ts.map +1 -1
  143. package/dist/RadioList/RadioListItem.js +68 -38
  144. package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
  145. package/dist/Resizable/ResizeHandle.js +3 -3
  146. package/dist/Section/Section.d.ts +36 -1
  147. package/dist/Section/Section.d.ts.map +1 -1
  148. package/dist/Section/Section.js +12 -2
  149. package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
  150. package/dist/SegmentedControl/SegmentedControlItem.js +6 -1
  151. package/dist/SelectableCard/SelectableCard.js +1 -1
  152. package/dist/Selector/Selector.d.ts +26 -1
  153. package/dist/Selector/Selector.d.ts.map +1 -1
  154. package/dist/Selector/Selector.js +95 -17
  155. package/dist/Selector/SelectorOption.d.ts +14 -1
  156. package/dist/Selector/SelectorOption.d.ts.map +1 -1
  157. package/dist/Selector/SelectorOption.js +6 -0
  158. package/dist/Selector/SelectorRowLayoutContext.d.ts +8 -0
  159. package/dist/Selector/SelectorRowLayoutContext.d.ts.map +1 -0
  160. package/dist/Selector/SelectorRowLayoutContext.js +27 -0
  161. package/dist/Selector/types.d.ts +1 -0
  162. package/dist/Selector/types.d.ts.map +1 -1
  163. package/dist/SideNav/SideNavHeading.js +1 -1
  164. package/dist/SideNav/SideNavItem.js +1 -1
  165. package/dist/Slider/Slider.d.ts.map +1 -1
  166. package/dist/Slider/Slider.js +3 -3
  167. package/dist/Stack/Stack.d.ts +23 -1
  168. package/dist/Stack/Stack.d.ts.map +1 -1
  169. package/dist/Stack/Stack.js +12 -6
  170. package/dist/StatusDot/StatusDot.d.ts +43 -3
  171. package/dist/StatusDot/StatusDot.d.ts.map +1 -1
  172. package/dist/StatusDot/StatusDot.js +42 -5
  173. package/dist/Switch/Switch.d.ts.map +1 -1
  174. package/dist/Switch/Switch.js +9 -0
  175. package/dist/TabList/TabMenu.js +1 -1
  176. package/dist/Table/TableRow.js +4 -4
  177. package/dist/Table/plugins/columnResize/useTableColumnResize.d.ts.map +1 -1
  178. package/dist/Table/plugins/columnResize/useTableColumnResize.js +1 -1
  179. package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts.map +1 -1
  180. package/dist/Table/plugins/groupedRows/useTableGroupedRows.js +1 -1
  181. package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
  182. package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +7 -2
  183. package/dist/Table/plugins/sortable/useTableSortableState.d.ts +5 -3
  184. package/dist/Table/plugins/sortable/useTableSortableState.d.ts.map +1 -1
  185. package/dist/Table/plugins/sortable/useTableSortableState.js +12 -9
  186. package/dist/Table/plugins/tree/useTableTreeData.js +2 -2
  187. package/dist/TextArea/TextArea.d.ts.map +1 -1
  188. package/dist/TextArea/TextArea.js +6 -1
  189. package/dist/TextInput/TextInput.d.ts.map +1 -1
  190. package/dist/TextInput/TextInput.js +6 -1
  191. package/dist/Thumbnail/Thumbnail.js +1 -1
  192. package/dist/TimeInput/TimeInput.d.ts.map +1 -1
  193. package/dist/TimeInput/TimeInput.js +6 -1
  194. package/dist/Timestamp/Timestamp.d.ts.map +1 -1
  195. package/dist/Timestamp/Timestamp.js +6 -4
  196. package/dist/Timestamp/formatInstant.d.ts +3 -2
  197. package/dist/Timestamp/formatInstant.d.ts.map +1 -1
  198. package/dist/Timestamp/formatInstant.js +8 -8
  199. package/dist/Timestamp/tooltipEntries.d.ts +2 -1
  200. package/dist/Timestamp/tooltipEntries.d.ts.map +1 -1
  201. package/dist/Timestamp/tooltipEntries.js +5 -3
  202. package/dist/Token/Token.js +1 -1
  203. package/dist/Tooltip/Tooltip.d.ts +16 -3
  204. package/dist/Tooltip/Tooltip.d.ts.map +1 -1
  205. package/dist/Tooltip/Tooltip.js +2 -0
  206. package/dist/Tooltip/index.d.ts +1 -1
  207. package/dist/Tooltip/index.d.ts.map +1 -1
  208. package/dist/Tooltip/useTooltip.d.ts +21 -2
  209. package/dist/Tooltip/useTooltip.d.ts.map +1 -1
  210. package/dist/Tooltip/useTooltip.js +71 -13
  211. package/dist/TopNav/TopNavHeading.js +2 -2
  212. package/dist/TopNav/TopNavItem.js +2 -2
  213. package/dist/TopNav/TopNavMegaMenu.js +1 -1
  214. package/dist/TopNav/TopNavMegaMenuItem.js +1 -1
  215. package/dist/TopNav/TopNavMenu.js +2 -2
  216. package/dist/TreeList/TreeListItem.js +1 -1
  217. package/dist/astryx.css +85 -60
  218. package/dist/hooks/containerReveal.stylex.d.ts.map +1 -1
  219. package/dist/hooks/containerReveal.stylex.js +18 -18
  220. package/dist/hooks/scrollbarGutter.d.ts +28 -0
  221. package/dist/hooks/scrollbarGutter.d.ts.map +1 -0
  222. package/dist/hooks/scrollbarGutter.js +103 -0
  223. package/dist/hooks/useResolvedRequired.d.ts +19 -0
  224. package/dist/hooks/useResolvedRequired.d.ts.map +1 -0
  225. package/dist/hooks/useResolvedRequired.js +40 -0
  226. package/dist/hooks/useScrollLock.d.ts +4 -0
  227. package/dist/hooks/useScrollLock.d.ts.map +1 -1
  228. package/dist/hooks/useScrollLock.js +13 -1
  229. package/dist/i18n/InternationalizationContext.d.ts.map +1 -1
  230. package/dist/i18n/InternationalizationContext.js +2 -0
  231. package/dist/i18n/index.d.ts +6 -0
  232. package/dist/i18n/index.d.ts.map +1 -1
  233. package/dist/i18n/index.js +6 -0
  234. package/dist/i18n/useCollator.d.ts +12 -0
  235. package/dist/i18n/useCollator.d.ts.map +1 -0
  236. package/dist/i18n/useCollator.js +40 -0
  237. package/dist/i18n/useLocale.d.ts +3 -0
  238. package/dist/i18n/useLocale.d.ts.map +1 -0
  239. package/dist/i18n/useLocale.js +31 -0
  240. package/dist/theme/defineTheme.d.ts +5 -0
  241. package/dist/theme/defineTheme.d.ts.map +1 -1
  242. package/dist/theme/defineTheme.js +5 -0
  243. package/dist/theme/derivedVarRegistry.d.ts.map +1 -1
  244. package/dist/theme/derivedVarRegistry.js +7 -0
  245. package/dist/theme/generateThemeRules.d.ts.map +1 -1
  246. package/dist/theme/generateThemeRules.js +66 -5
  247. package/dist/utils/dateParser.d.ts +4 -3
  248. package/dist/utils/dateParser.d.ts.map +1 -1
  249. package/dist/utils/dateParser.js +8 -8
  250. package/dist/utils/plainDate.d.ts +9 -2
  251. package/dist/utils/plainDate.d.ts.map +1 -1
  252. package/dist/utils/plainDate.js +16 -4
  253. package/locales/af-ZA.json +958 -0
  254. package/locales/ar-SA.json +998 -0
  255. package/locales/ca-ES.json +974 -0
  256. package/locales/cs-CZ.json +990 -0
  257. package/locales/da-DK.json +966 -0
  258. package/locales/de-DE.json +966 -0
  259. package/locales/el-GR.json +990 -0
  260. package/locales/en.json +8 -0
  261. package/locales/es-ES.json +978 -0
  262. package/locales/fi-FI.json +990 -0
  263. package/locales/fr-FR.json +928 -0
  264. package/locales/he-IL.json +990 -0
  265. package/locales/hu-HU.json +990 -0
  266. package/locales/it-IT.json +978 -0
  267. package/locales/ja-JP.json +998 -0
  268. package/locales/ko-KR.json +990 -0
  269. package/locales/nl-NL.json +954 -0
  270. package/locales/no-NO.json +978 -0
  271. package/locales/pl-PL.json +982 -0
  272. package/locales/pseudo.json +6 -0
  273. package/locales/pt-BR.json +982 -0
  274. package/locales/pt-PT.json +982 -0
  275. package/locales/ro-RO.json +982 -0
  276. package/locales/ru-RU.json +990 -0
  277. package/locales/sr-SP.json +990 -0
  278. package/locales/sv-SE.json +986 -0
  279. package/locales/tr-TR.json +990 -0
  280. package/locales/uk-UA.json +990 -0
  281. package/locales/vi-VN.json +986 -0
  282. package/locales/zh-CN.json +998 -0
  283. package/locales/zh-TW.json +998 -0
  284. package/package.json +3 -3
  285. package/src/AvatarGroup/AvatarGroupOverflow.tsx +1 -1
  286. package/src/Banner/Banner.doc.mjs +2 -0
  287. package/src/BottomSheet/BottomSheet.doc.mjs +36 -3
  288. package/src/BottomSheet/BottomSheet.test.tsx +177 -2
  289. package/src/BottomSheet/BottomSheet.tsx +16 -2
  290. package/src/BottomSheet/BottomSheetPanel.test.tsx +41 -0
  291. package/src/BottomSheet/BottomSheetPanel.tsx +95 -15
  292. package/src/BottomSheet/index.ts +5 -1
  293. package/src/BottomSheet/snapOffsets.test.ts +114 -47
  294. package/src/BottomSheet/snapOffsets.ts +119 -33
  295. package/src/BottomSheet/useSheetGestures.test.ts +113 -15
  296. package/src/BottomSheet/useSheetGestures.ts +196 -100
  297. package/src/Breadcrumbs/BreadcrumbItem.tsx +1 -1
  298. package/src/Button/Button.tsx +7 -7
  299. package/src/Calendar/Calendar.doc.mjs +16 -0
  300. package/src/Calendar/Calendar.test.tsx +137 -0
  301. package/src/Calendar/Calendar.tsx +80 -11
  302. package/src/Calendar/getStandaloneShortWeekdayNames.test.ts +54 -0
  303. package/src/Calendar/getStandaloneShortWeekdayNames.ts +38 -0
  304. package/src/Calendar/hooks/useCalendarConstraints.ts +54 -3
  305. package/src/Calendar/hooks/useCalendarDays.ts +13 -10
  306. package/src/Calendar/hooks/useCalendarNavigation.ts +6 -4
  307. package/src/Calendar/standaloneShortWeekdayNames.generated.ts +50 -0
  308. package/src/Calendar/styles.ts +3 -3
  309. package/src/Center/Center.doc.mjs +48 -0
  310. package/src/Center/Center.test.tsx +158 -0
  311. package/src/Center/Center.tsx +50 -9
  312. package/src/Chat/ChatComposer.tsx +7 -4
  313. package/src/Chat/ChatToolCalls.tsx +1 -1
  314. package/src/Chat/{useChatDictation.test.ts → useChatDictation.test.tsx} +29 -14
  315. package/src/Chat/useChatDictation.ts +1 -1
  316. package/src/Chat/useSpeechRecognition.ts +5 -3
  317. package/src/CheckboxInput/CheckboxInput.tsx +6 -0
  318. package/src/Citation/Citation.tsx +3 -3
  319. package/src/ClickableCard/ClickableCard.tsx +2 -2
  320. package/src/CommandPalette/CommandPaletteItem.tsx +1 -1
  321. package/src/ComplexSelector/ComplexSelector.doc.mjs +10 -0
  322. package/src/ComplexSelector/ComplexSelector.tsx +8 -5
  323. package/src/DateInput/DateInput.test.tsx +17 -1
  324. package/src/DateInput/DateInput.tsx +13 -9
  325. package/src/DateRangeInput/DateRangeInput.doc.mjs +16 -0
  326. package/src/DateRangeInput/DateRangeInput.test.tsx +81 -1
  327. package/src/DateRangeInput/DateRangeInput.tsx +88 -8
  328. package/src/DateTimeInput/DateTimeInput.tsx +23 -8
  329. package/src/Dialog/Dialog.test.tsx +24 -0
  330. package/src/Dialog/Dialog.tsx +3 -0
  331. package/src/Field/Field.doc.mjs +3 -0
  332. package/src/Field/FieldLabel.tsx +20 -4
  333. package/src/Field/InputClearButton.test.tsx +134 -2
  334. package/src/Field/InputClearButton.tsx +42 -1
  335. package/src/Field/inputStyles.stylex.ts +16 -12
  336. package/src/FileInput/FileInput.tsx +5 -4
  337. package/src/FormLayout/FormLayout.doc.mjs +13 -0
  338. package/src/FormLayout/FormLayout.test.tsx +181 -4
  339. package/src/FormLayout/FormLayout.tsx +33 -2
  340. package/src/FormLayout/FormLayoutContext.ts +22 -7
  341. package/src/FormLayout/index.ts +1 -1
  342. package/src/HoverCard/HoverCard.doc.mjs +18 -0
  343. package/src/HoverCard/HoverCard.test.tsx +189 -0
  344. package/src/HoverCard/HoverCard.tsx +22 -2
  345. package/src/HoverCard/index.ts +1 -0
  346. package/src/HoverCard/useHoverCard.doc.mjs +2 -0
  347. package/src/HoverCard/useHoverCard.tsx +103 -7
  348. package/src/Item/Item.doc.mjs +1 -0
  349. package/src/Item/Item.test.tsx +50 -0
  350. package/src/Item/Item.tsx +41 -2
  351. package/src/Layer/index.ts +10 -0
  352. package/src/Layer/useLayer.tsx +13 -2
  353. package/src/Layer/useTouchTrigger.test.ts +70 -0
  354. package/src/Layer/useTouchTrigger.ts +366 -0
  355. package/src/Layout/Layout.doc.mjs +18 -0
  356. package/src/Layout/container.stylex.ts +11 -3
  357. package/src/Layout/index.ts +4 -0
  358. package/src/Layout/overlayPaddingReset.test.tsx +222 -0
  359. package/src/Layout/padding.stylex.ts +192 -12
  360. package/src/Lightbox/Lightbox.tsx +2 -1
  361. package/src/Link/Link.tsx +4 -4
  362. package/src/Markdown/Markdown.doc.mjs +3 -0
  363. package/src/Markdown/Markdown.test.tsx +78 -0
  364. package/src/Markdown/Markdown.tsx +41 -1
  365. package/src/Markdown/parser.ts +60 -2
  366. package/src/MobileNav/MobileNav.tsx +61 -5
  367. package/src/MobileNav/MobileNavEntryAnimation.test.tsx +212 -0
  368. package/src/MobileNav/MobileNavScrollbarGutter.test.tsx +109 -0
  369. package/src/MultiSelector/MultiSelector.test.tsx +1 -1
  370. package/src/MultiSelector/MultiSelector.tsx +8 -5
  371. package/src/NavItem/navItemStyles.stylex.ts +2 -2
  372. package/src/NavMenu/NavHeadingMenuItem.tsx +1 -1
  373. package/src/NumberInput/NumberInput.doc.mjs +24 -0
  374. package/src/NumberInput/NumberInput.test.tsx +138 -0
  375. package/src/NumberInput/NumberInput.tsx +44 -6
  376. package/src/Outline/Outline.doc.mjs +2 -0
  377. package/src/Outline/Outline.tsx +1 -1
  378. package/src/Outline/parseOutlineFromMarkdown.ts +10 -40
  379. package/src/PowerSearch/PowerSearch.tsx +17 -8
  380. package/src/PowerSearch/PowerSearchToken.tsx +3 -0
  381. package/src/PowerSearch/formatFilterValue.test.ts +22 -2
  382. package/src/PowerSearch/formatFilterValue.ts +31 -6
  383. package/src/RadioList/RadioList.doc.mjs +1 -1
  384. package/src/RadioList/RadioList.test.tsx +170 -2
  385. package/src/RadioList/RadioList.tsx +9 -1
  386. package/src/RadioList/RadioListItem.tsx +83 -51
  387. package/src/Resizable/ResizeHandle.test.tsx +22 -0
  388. package/src/Resizable/ResizeHandle.tsx +9 -3
  389. package/src/Section/Section.doc.mjs +55 -0
  390. package/src/Section/Section.test.tsx +201 -4
  391. package/src/Section/Section.tsx +69 -0
  392. package/src/SegmentedControl/SegmentedControl.test.tsx +31 -0
  393. package/src/SegmentedControl/SegmentedControlItem.tsx +11 -2
  394. package/src/SelectableCard/SelectableCard.tsx +1 -1
  395. package/src/Selector/Selector.doc.mjs +16 -2
  396. package/src/Selector/Selector.test.tsx +525 -1
  397. package/src/Selector/Selector.tsx +166 -21
  398. package/src/Selector/SelectorOption.doc.mjs +7 -0
  399. package/src/Selector/SelectorOption.tsx +21 -0
  400. package/src/Selector/SelectorRowLayoutContext.ts +32 -0
  401. package/src/Selector/types.ts +4 -4
  402. package/src/SideNav/SideNavHeading.tsx +2 -2
  403. package/src/SideNav/SideNavItem.tsx +1 -1
  404. package/src/Slider/Slider.tsx +11 -1
  405. package/src/Stack/Stack.doc.mjs +72 -0
  406. package/src/Stack/Stack.test.tsx +156 -0
  407. package/src/Stack/Stack.tsx +50 -8
  408. package/src/StatusDot/StatusDot.doc.mjs +13 -0
  409. package/src/StatusDot/StatusDot.test.tsx +115 -8
  410. package/src/StatusDot/StatusDot.tsx +74 -9
  411. package/src/Switch/Switch.tsx +6 -0
  412. package/src/TabList/TabMenu.tsx +1 -1
  413. package/src/Table/TableRow.tsx +4 -4
  414. package/src/Table/plugins/columnResize/useTableColumnResize.tsx +2 -1
  415. package/src/Table/plugins/groupedRows/useTableGroupedRows.tsx +2 -1
  416. package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +22 -4
  417. package/src/Table/plugins/sortable/useTableSortableState.test.tsx +34 -0
  418. package/src/Table/plugins/sortable/useTableSortableState.tsx +26 -23
  419. package/src/Table/plugins/tree/useTableTreeData.tsx +2 -2
  420. package/src/TextArea/TextArea.doc.mjs +1 -1
  421. package/src/TextArea/TextArea.tsx +3 -1
  422. package/src/TextInput/TextInput.tsx +3 -1
  423. package/src/Thumbnail/Thumbnail.tsx +1 -1
  424. package/src/TimeInput/TimeInput.tsx +3 -1
  425. package/src/Timestamp/Timestamp.test.tsx +27 -7
  426. package/src/Timestamp/Timestamp.tsx +8 -4
  427. package/src/Timestamp/formatInstant.ts +9 -7
  428. package/src/Timestamp/tooltipEntries.test.ts +11 -6
  429. package/src/Timestamp/tooltipEntries.ts +6 -2
  430. package/src/Token/Token.tsx +1 -1
  431. package/src/Tooltip/Tooltip.doc.mjs +18 -0
  432. package/src/Tooltip/Tooltip.test.tsx +254 -1
  433. package/src/Tooltip/Tooltip.tsx +22 -2
  434. package/src/Tooltip/index.ts +1 -0
  435. package/src/Tooltip/useTooltip.doc.mjs +2 -0
  436. package/src/Tooltip/useTooltip.tsx +99 -21
  437. package/src/TopNav/TopNavHeading.tsx +1 -1
  438. package/src/TopNav/TopNavItem.tsx +2 -2
  439. package/src/TopNav/TopNavMegaMenu.tsx +1 -1
  440. package/src/TopNav/TopNavMegaMenuItem.tsx +1 -1
  441. package/src/TopNav/TopNavMenu.tsx +2 -2
  442. package/src/TreeList/TreeListItem.tsx +1 -1
  443. package/src/hooks/containerReveal.stylex.ts +54 -18
  444. package/src/hooks/scrollbarGutter.test.ts +167 -0
  445. package/src/hooks/scrollbarGutter.ts +121 -0
  446. package/src/hooks/useResolvedRequired.ts +42 -0
  447. package/src/hooks/useScrollLock.doc.mjs +4 -4
  448. package/src/hooks/useScrollLock.test.ts +73 -0
  449. package/src/hooks/useScrollLock.ts +14 -0
  450. package/src/i18n/InternationalizationContext.ts +2 -0
  451. package/src/i18n/__tests__/e2e-powersearch.test.tsx +37 -1
  452. package/src/i18n/__tests__/useCollator.test.tsx +115 -0
  453. package/src/i18n/__tests__/useLocale.test.tsx +52 -0
  454. package/src/i18n/index.ts +6 -0
  455. package/src/i18n/useCollator.doc.mjs +84 -0
  456. package/src/i18n/useCollator.ts +44 -0
  457. package/src/i18n/useLocale.doc.mjs +70 -0
  458. package/src/i18n/useLocale.ts +34 -0
  459. package/src/i18n/useTranslator.doc.mjs +1 -1
  460. package/src/theme/defineTheme.test.ts +9 -3
  461. package/src/theme/defineTheme.ts +5 -0
  462. package/src/theme/derivedVarRegistry.test.ts +19 -5
  463. package/src/theme/derivedVarRegistry.ts +4 -0
  464. package/src/theme/generateThemeRules.test.ts +118 -0
  465. package/src/theme/generateThemeRules.ts +83 -5
  466. package/src/utils/dateParser.test.ts +20 -0
  467. package/src/utils/dateParser.ts +14 -7
  468. package/src/utils/plainDate.test.ts +56 -0
  469. package/src/utils/plainDate.ts +17 -4
@@ -71,7 +71,9 @@ import {
71
71
  } from './utils';
72
72
  import {useCombobox, useSelectedItemOffset} from './hooks';
73
73
  import {useTypeahead} from '../hooks/useTypeahead';
74
+ import {useResolvedRequired} from '../hooks/useResolvedRequired';
74
75
  import {SelectorOption} from './SelectorOption';
76
+ import {SelectorRowLayoutContext} from './SelectorRowLayoutContext';
75
77
  import {getInputARIA, isImeKeyEvent, mergeProps} from '../utils';
76
78
  import {useSize} from '../SizeContext/SizeContext';
77
79
  import type {BaseProps} from '../BaseProps';
@@ -100,7 +102,13 @@ const styles = stylex.create({
100
102
  default: typeScaleVars['--text-label-size'],
101
103
  '@media (pointer: coarse)': `max(1rem, ${typeScaleVars['--text-label-size']})`,
102
104
  },
103
- 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'],
104
112
  color: colorVars['--color-text-primary'],
105
113
  cursor: 'pointer',
106
114
  },
@@ -141,6 +149,43 @@ const styles = stylex.create({
141
149
  whiteSpace: 'nowrap',
142
150
  textAlign: 'start',
143
151
  },
152
+ // Inside an InputGroup the group's own height is the row, and the trigger
153
+ // takes it: `height: 100%` from `groupStyles.inGroup` can only govern if the
154
+ // trigger stops asserting a floor of its own — otherwise a control sized
155
+ // above its group (`<InputGroup size="md"><Selector size="lg">`) grows the
156
+ // row it was supposed to sit in. The padding goes with it: the row is
157
+ // already the size token, and the value box is centred in it.
158
+ triggerInGroup: {
159
+ minHeight: 0,
160
+ paddingBlock: 0,
161
+ },
162
+ // Wrapper for `renderValue` output. Takes the free width and clips
163
+ // horizontally so a long value ellipsizes rather than widening the trigger;
164
+ // vertically the content sizes the control, which the size styles below
165
+ // handle.
166
+ triggerValue: {
167
+ flexGrow: 1,
168
+ minWidth: 0,
169
+ overflow: 'hidden',
170
+ textAlign: 'start',
171
+ },
172
+ // Inside an InputGroup the row height is the group's, so the trigger clamps
173
+ // its own value box to that row rather than asking the value to fit it: any
174
+ // node is cut off at the row's edge instead of bleeding through the border
175
+ // over whatever sits above and below the group. The rows the system draws
176
+ // itself never reach the cut — the row-layout context folds them onto one
177
+ // line first (SelectorRowLayoutContext).
178
+ //
179
+ // The clamp is a percentage, not the size token, because a group can be a
180
+ // different size than the control inside it; the row is whatever the group
181
+ // made it. That needs a definite height to resolve against, which is what
182
+ // stretching the button provides.
183
+ triggerButtonInGroup: {
184
+ alignSelf: 'stretch',
185
+ },
186
+ triggerValueInGroup: {
187
+ maxHeight: '100%',
188
+ },
144
189
  // Only what Icon does not already provide: `size="sm"` gives the 16px box
145
190
  // and `color` the token, but the glyph still must not shrink inside the flex
146
191
  // trigger.
@@ -168,16 +213,17 @@ const styles = stylex.create({
168
213
  backgroundColor: 'transparent',
169
214
  backgroundImage: {
170
215
  default: null,
171
- ':hover': {
216
+ ':hover:where(:not(:disabled,[aria-disabled="true"]))': {
172
217
  '@media (hover: hover)': `linear-gradient(${colorVars['--color-overlay-hover']}, ${colorVars['--color-overlay-hover']})`,
173
218
  },
174
219
  ':active': `linear-gradient(${colorVars['--color-overlay-pressed']}, ${colorVars['--color-overlay-pressed']})`,
175
220
  },
176
221
  boxShadow: {
177
222
  default: 'none',
178
- ':hover:not(:focus-within)': {
179
- '@media (hover: hover)': 'none',
180
- },
223
+ ':hover:not(:focus-within):where(:not(:disabled,[aria-disabled="true"]))':
224
+ {
225
+ '@media (hover: hover)': 'none',
226
+ },
181
227
  ':focus-within': 'none',
182
228
  },
183
229
  fontWeight: fontWeightVars['--font-weight-medium'],
@@ -327,15 +373,31 @@ const styles = stylex.create({
327
373
  },
328
374
  });
329
375
 
376
+ // The trigger is sized by PADDING, not by a fixed height, so it is the size
377
+ // token plus one text line for each extra line the value uses: 28/32/36 for
378
+ // one line, 48/52/56 for two. The token and a text line are both multiples of
379
+ // 4, so every trigger lands on the 4px rhythm and lines up with the Buttons
380
+ // and inputs beside it. No prop picks the height — the content does, and it
381
+ // can only land on the grid.
382
+ //
383
+ // `--spacing-5` is one line here because `triggerContainer` pins its
384
+ // line-height to exactly that; the two must stay in step, which is why both
385
+ // read the same token rather than one hardcoding 20px.
386
+ const linePad = (token: string) =>
387
+ `calc((${token} - ${spacingVars['--spacing-5']} - 2 * ${borderVars['--border-width']}) / 2)`;
388
+
330
389
  const sizeStyles = stylex.create({
331
390
  sm: {
332
- height: sizeVars['--size-element-sm'],
391
+ minHeight: sizeVars['--size-element-sm'],
392
+ paddingBlock: linePad(sizeVars['--size-element-sm']),
333
393
  },
334
394
  md: {
335
- height: sizeVars['--size-element-md'],
395
+ minHeight: sizeVars['--size-element-md'],
396
+ paddingBlock: linePad(sizeVars['--size-element-md']),
336
397
  },
337
398
  lg: {
338
- height: sizeVars['--size-element-lg'],
399
+ minHeight: sizeVars['--size-element-lg'],
400
+ paddingBlock: linePad(sizeVars['--size-element-lg']),
339
401
  },
340
402
  });
341
403
 
@@ -516,7 +578,8 @@ interface SelectorPropsBase<
516
578
  labelTooltip?: string;
517
579
 
518
580
  /**
519
- * Icon displayed at the start of the selector trigger.
581
+ * Icon displayed at the start of the selector trigger. Takes precedence over
582
+ * the selected option's own `icon`, which the trigger otherwise renders.
520
583
  */
521
584
  startIcon?: ReactNode | IconType;
522
585
 
@@ -526,6 +589,31 @@ interface SelectorPropsBase<
526
589
  */
527
590
  renderOption?: (option: SelectorOptionData) => ReactNode;
528
591
 
592
+ /**
593
+ * Custom render function for the selected option inside the closed trigger.
594
+ * Only called when something is selected; the placeholder is unaffected.
595
+ *
596
+ * Passing this does not change the trigger's height — what it draws does. A
597
+ * one-line value measures exactly the `size` token, so the control still
598
+ * lines up with the Buttons and inputs beside it; each further line of
599
+ * content adds one text line. Inside an `InputGroup` the group owns the row
600
+ * height: the trigger clamps its value box to that row, so a `SelectorOption`
601
+ * folds onto one line and ellipsizes, and anything taller than the row is cut
602
+ * off at it rather than bleeding over the rows above and below.
603
+ *
604
+ * @example
605
+ * ```
606
+ * renderValue={option => (
607
+ * <SelectorOption
608
+ * icon={option.icon}
609
+ * label={option.label}
610
+ * description={option.description}
611
+ * />
612
+ * )}
613
+ * ```
614
+ */
615
+ renderValue?: (option: SelectorOptionData) => ReactNode;
616
+
529
617
  /**
530
618
  * Which edge of the option row carries the selected mark. `start` reserves a
531
619
  * mark column ahead of every label so they stay aligned, the way a native
@@ -613,7 +701,11 @@ export type SelectorProps<T extends SelectorOptionType = SelectorOptionType> =
613
701
  */
614
702
  function DefaultOption({option}: {option: SelectorOptionData}) {
615
703
  return (
616
- <SelectorOption icon={option.icon} label={option.label ?? option.value} />
704
+ <SelectorOption
705
+ icon={option.icon}
706
+ label={option.label ?? option.value}
707
+ description={option.description}
708
+ />
617
709
  );
618
710
  }
619
711
 
@@ -686,6 +778,7 @@ export function Selector<T extends SelectorOptionType>(
686
778
  startIcon,
687
779
  htmlName,
688
780
  renderOption,
781
+ renderValue,
689
782
  indicatorPosition = 'end',
690
783
  hasSearch = false,
691
784
  searchPlaceholder: searchPlaceholderFromProps,
@@ -699,6 +792,7 @@ export function Selector<T extends SelectorOptionType>(
699
792
  hasClear: hasClearProp,
700
793
  ...rest
701
794
  } = props as SelectorPropsClearable<T>;
795
+ const isEffectivelyRequired = useResolvedRequired({isRequired, isOptional});
702
796
  const placeholder = placeholderFromProps ?? t('@astryx.selector.placeholder');
703
797
  const searchPlaceholder =
704
798
  searchPlaceholderFromProps ?? t('@astryx.selector.searchPlaceholder');
@@ -1164,12 +1258,27 @@ export function Selector<T extends SelectorOptionType>(
1164
1258
  aria-disabled={item.disabled}
1165
1259
  onClick={() => onItemSelect(item)}
1166
1260
  onMouseEnter={() => onItemMouseEnter(item, flatIndex)}
1167
- {...stylex.props(
1168
- styles.item,
1169
- itemSizeStyles[size],
1170
- isHighlighted && styles.itemHighlighted,
1171
- isSelected && styles.itemSelected,
1172
- item.disabled && styles.itemDisabled,
1261
+ {...mergeProps(
1262
+ // Stable theme target on the option row itself, mirroring
1263
+ // `multi-selector-option`: it carries the row's size and runtime
1264
+ // state so a theme can express "selected option at large" or
1265
+ // restyle a given row density without structural selectors. The
1266
+ // row's padding is split across a base and a per-size override (the
1267
+ // default `md` trims the block axis), so `size` is what a theme
1268
+ // needs to reach it. Named `-option-row` because `selector-option`
1269
+ // is the public SelectorOption content primitive, not this row.
1270
+ themeProps('selector-option-row', {
1271
+ size,
1272
+ selected: isSelected ? 'selected' : null,
1273
+ disabled: item.disabled ? 'disabled' : null,
1274
+ }),
1275
+ stylex.props(
1276
+ styles.item,
1277
+ itemSizeStyles[size],
1278
+ isHighlighted && styles.itemHighlighted,
1279
+ isSelected && styles.itemSelected,
1280
+ item.disabled && styles.itemDisabled,
1281
+ ),
1173
1282
  )}>
1174
1283
  {content}
1175
1284
  </div>
@@ -1279,6 +1388,40 @@ export function Selector<T extends SelectorOptionType>(
1279
1388
  const showStatusTooltip =
1280
1389
  status != null && effectiveStatusVariant === 'tooltip' && !!status.message;
1281
1390
 
1391
+ // Two lines cannot fit inside an InputGroup: the group pins the row height,
1392
+ // and the trigger clamps its value box to one line so nothing bleeds through
1393
+ // its border (styles.triggerValueInGroup). The clamp holds for any node; the
1394
+ // context is what lets the rows the system draws itself reflow into that one
1395
+ // line — label and description side by side — instead of being cut off at
1396
+ // it. Outside a group the caller's own row decides, and the trigger's
1397
+ // padding sizes it to whatever that draws.
1398
+ const rowLayout = inputGroup ? 'inline' : 'stacked';
1399
+
1400
+ // What the closed trigger shows for the current selection: the option's icon
1401
+ // and label. `startIcon` wins over the option's own icon so a caller who
1402
+ // pins a field icon does not get two.
1403
+ const valueContent =
1404
+ selectedItem && renderValue ? (
1405
+ <SelectorRowLayoutContext value={rowLayout}>
1406
+ <span
1407
+ {...stylex.props(
1408
+ styles.triggerValue,
1409
+ inputGroup && styles.triggerValueInGroup,
1410
+ )}>
1411
+ {renderValue(selectedItem)}
1412
+ </span>
1413
+ </SelectorRowLayoutContext>
1414
+ ) : (
1415
+ <>
1416
+ {!startIcon &&
1417
+ selectedItem?.icon != null &&
1418
+ renderIconSlot(selectedItem.icon, {size: 'sm', color: 'secondary'})}
1419
+ <span {...stylex.props(styles.triggerLabel)}>
1420
+ {selectedItem?.label ?? placeholder}
1421
+ </span>
1422
+ </>
1423
+ );
1424
+
1282
1425
  const selectorContent = (
1283
1426
  <>
1284
1427
  <div
@@ -1316,6 +1459,7 @@ export function Selector<T extends SelectorOptionType>(
1316
1459
  !isDisabled &&
1317
1460
  inputStatusHoverShadowStyles[status.type],
1318
1461
  variant !== 'ghost' && inputGroup && groupStyles.inGroup,
1462
+ inputGroup && styles.triggerInGroup,
1319
1463
  xstyle,
1320
1464
  ),
1321
1465
  className,
@@ -1345,7 +1489,7 @@ export function Selector<T extends SelectorOptionType>(
1345
1489
  }
1346
1490
  aria-describedby={ariaDescribedBy}
1347
1491
  aria-labelledby={ariaLabelledBy}
1348
- aria-required={isRequired ? 'true' : undefined}
1492
+ aria-required={isEffectivelyRequired ? 'true' : undefined}
1349
1493
  aria-invalid={status?.type === 'error' ? 'true' : undefined}
1350
1494
  aria-busy={isBusy || undefined}
1351
1495
  // With a disabledMessage the trigger keeps focusability via
@@ -1355,10 +1499,11 @@ export function Selector<T extends SelectorOptionType>(
1355
1499
  aria-disabled={showsDisabledMessage ? 'true' : undefined}
1356
1500
  onKeyDown={handleTriggerKeyDown}
1357
1501
  tabIndex={isDisabled && !showsDisabledMessage ? -1 : 0}
1358
- {...stylex.props(styles.trigger)}>
1359
- <span {...stylex.props(styles.triggerLabel)}>
1360
- {selectedItem?.label ?? placeholder}
1361
- </span>
1502
+ {...stylex.props(
1503
+ styles.trigger,
1504
+ inputGroup && styles.triggerButtonInGroup,
1505
+ )}>
1506
+ {valueContent}
1362
1507
  </button>
1363
1508
  {htmlName != null && (
1364
1509
  <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;
@@ -82,7 +82,7 @@ const styles = stylex.create({
82
82
  fontSize: 'inherit',
83
83
  fontWeight: fontWeightVars['--font-weight-normal'],
84
84
  textAlign: 'start',
85
- ':hover': {
85
+ ':hover:where(:not(:disabled,[aria-disabled="true"]))': {
86
86
  '@media (hover: hover)': {
87
87
  backgroundColor: colorVars['--color-overlay-hover'],
88
88
  },
@@ -104,7 +104,7 @@ const styles = stylex.create({
104
104
  interactiveCollapsed: {
105
105
  backgroundColor: {
106
106
  default: 'transparent',
107
- ':hover': {
107
+ ':hover:where(:not(:disabled,[aria-disabled="true"]))': {
108
108
  '@media (hover: hover)': 'transparent',
109
109
  },
110
110
  },
@@ -147,7 +147,7 @@ const styles = stylex.create({
147
147
  color: 'inherit',
148
148
  cursor: 'pointer',
149
149
  borderRadius: radiusVars['--radius-element'],
150
- ':hover': {
150
+ ':hover:where(:not(:disabled,[aria-disabled="true"]))': {
151
151
  '@media (hover: hover)': {
152
152
  backgroundColor: colorVars['--color-overlay-hover'],
153
153
  },
@@ -189,6 +189,16 @@ const styles = stylex.create({
189
189
  trackContainerVertical: {
190
190
  width: THUMB_SIZE,
191
191
  height: 160,
192
+ // Same tap target, rotated: the vertical track is the thing you press, and
193
+ // it is only THUMB_SIZE (20px) wide. `minBlockSize` above floors the
194
+ // horizontal track's short axis; here the short axis is the inline one
195
+ // (the block size is already 160px), so floor that instead. The rail,
196
+ // fill, marks and thumb all center on the inline 50%, so they stay put;
197
+ // only the invisible tappable area grows. Desktop is unchanged.
198
+ minInlineSize: {
199
+ default: null,
200
+ '@media (pointer: coarse)': '24px',
201
+ },
192
202
  flexDirection: 'column',
193
203
  justifyContent: 'center',
194
204
  cursor: 'pointer',
@@ -258,7 +268,7 @@ const styles = stylex.create({
258
268
  thumbHover: {
259
269
  backgroundColor: {
260
270
  default: colorVars['--color-accent'],
261
- ':hover': {
271
+ ':hover:where(:not(:disabled,[aria-disabled="true"]))': {
262
272
  '@media (hover: hover)': `color-mix(in srgb, ${colorVars['--color-accent']}, ${colorVars['--color-tint-hover']} 15%)`,
263
273
  },
264
274
  },
@@ -46,12 +46,36 @@ export const docs = {
46
46
  description:
47
47
  'Inline (horizontal) padding. Overrides padding on the inline axis when both are set.',
48
48
  },
49
+ {
50
+ name: 'paddingInlineStart',
51
+ type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
52
+ description:
53
+ 'Inline-start padding, using the spacing scale (left in LTR, right in RTL). Overrides paddingInline and padding on that edge only.',
54
+ },
55
+ {
56
+ name: 'paddingInlineEnd',
57
+ type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
58
+ description:
59
+ 'Inline-end padding, using the spacing scale (right in LTR, left in RTL). Overrides paddingInline and padding on that edge only.',
60
+ },
49
61
  {
50
62
  name: 'paddingBlock',
51
63
  type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
52
64
  description:
53
65
  'Block (vertical) padding. Overrides padding on the block axis when both are set.',
54
66
  },
67
+ {
68
+ name: 'paddingBlockStart',
69
+ type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
70
+ description:
71
+ 'Block-start (top) padding, using the spacing scale. Overrides paddingBlock and padding on that edge only.',
72
+ },
73
+ {
74
+ name: 'paddingBlockEnd',
75
+ type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
76
+ description:
77
+ 'Block-end (bottom) padding, using the spacing scale. Overrides paddingBlock and padding on that edge only.',
78
+ },
55
79
  {
56
80
  name: 'isScrollable',
57
81
  type: 'boolean',
@@ -150,12 +174,36 @@ export const docs = {
150
174
  description:
151
175
  'Inline (horizontal) padding, using the spacing scale. Overrides padding on the inline axis when both are set.',
152
176
  },
177
+ {
178
+ name: 'paddingInlineStart',
179
+ type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
180
+ description:
181
+ 'Inline-start padding, using the spacing scale (left in LTR, right in RTL). Overrides paddingInline and padding on that edge only.',
182
+ },
183
+ {
184
+ name: 'paddingInlineEnd',
185
+ type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
186
+ description:
187
+ 'Inline-end padding, using the spacing scale (right in LTR, left in RTL). Overrides paddingInline and padding on that edge only.',
188
+ },
153
189
  {
154
190
  name: 'paddingBlock',
155
191
  type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
156
192
  description:
157
193
  'Block (vertical) padding, using the spacing scale. Overrides padding on the block axis when both are set.',
158
194
  },
195
+ {
196
+ name: 'paddingBlockStart',
197
+ type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
198
+ description:
199
+ 'Block-start (top) padding, using the spacing scale. Overrides paddingBlock and padding on that edge only.',
200
+ },
201
+ {
202
+ name: 'paddingBlockEnd',
203
+ type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
204
+ description:
205
+ 'Block-end (bottom) padding, using the spacing scale. Overrides paddingBlock and padding on that edge only.',
206
+ },
159
207
  {
160
208
  name: 'isScrollable',
161
209
  type: 'boolean',
@@ -253,12 +301,36 @@ export const docs = {
253
301
  description:
254
302
  'Inline (horizontal) padding, using the spacing scale. Overrides padding on the inline axis when both are set.',
255
303
  },
304
+ {
305
+ name: 'paddingInlineStart',
306
+ type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
307
+ description:
308
+ 'Inline-start padding, using the spacing scale (left in LTR, right in RTL). Overrides paddingInline and padding on that edge only.',
309
+ },
310
+ {
311
+ name: 'paddingInlineEnd',
312
+ type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
313
+ description:
314
+ 'Inline-end padding, using the spacing scale (right in LTR, left in RTL). Overrides paddingInline and padding on that edge only.',
315
+ },
256
316
  {
257
317
  name: 'paddingBlock',
258
318
  type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
259
319
  description:
260
320
  'Block (vertical) padding, using the spacing scale. Overrides padding on the block axis when both are set.',
261
321
  },
322
+ {
323
+ name: 'paddingBlockStart',
324
+ type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
325
+ description:
326
+ 'Block-start (top) padding, using the spacing scale. Overrides paddingBlock and padding on that edge only.',
327
+ },
328
+ {
329
+ name: 'paddingBlockEnd',
330
+ type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
331
+ description:
332
+ 'Block-end (bottom) padding, using the spacing scale. Overrides paddingBlock and padding on that edge only.',
333
+ },
262
334
  {
263
335
  name: 'isScrollable',
264
336
  type: 'boolean',