@astryxdesign/core 0.3.0 → 0.4.0-canary.3112e99

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 (594) hide show
  1. package/CHANGELOG.md +156 -0
  2. package/dist/AlertDialog/AlertDialog.d.ts +10 -2
  3. package/dist/AlertDialog/AlertDialog.d.ts.map +1 -1
  4. package/dist/AlertDialog/AlertDialog.js +22 -3
  5. package/dist/AppShell/AppShell.d.ts +2 -2
  6. package/dist/AppShell/AppShell.d.ts.map +1 -1
  7. package/dist/AppShell/AppShell.js +40 -9
  8. package/dist/AspectRatio/AspectRatio.d.ts +13 -0
  9. package/dist/AspectRatio/AspectRatio.d.ts.map +1 -1
  10. package/dist/AspectRatio/AspectRatio.js +9 -0
  11. package/dist/Avatar/Avatar.d.ts.map +1 -1
  12. package/dist/Avatar/Avatar.js +33 -20
  13. package/dist/AvatarGroup/AvatarGroupOverflow.d.ts.map +1 -1
  14. package/dist/AvatarGroup/AvatarGroupOverflow.js +2 -3
  15. package/dist/Banner/Banner.d.ts +3 -0
  16. package/dist/Banner/Banner.d.ts.map +1 -1
  17. package/dist/Banner/Banner.js +32 -17
  18. package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
  19. package/dist/Breadcrumbs/BreadcrumbItem.js +21 -8
  20. package/dist/Breadcrumbs/index.d.ts +2 -1
  21. package/dist/Breadcrumbs/index.d.ts.map +1 -1
  22. package/dist/Breadcrumbs/index.js +1 -0
  23. package/dist/Button/Button.d.ts.map +1 -1
  24. package/dist/Button/Button.js +12 -16
  25. package/dist/Calendar/Calendar.d.ts.map +1 -1
  26. package/dist/Calendar/Calendar.js +2 -1
  27. package/dist/Calendar/styles.d.ts +0 -2
  28. package/dist/Calendar/styles.d.ts.map +1 -1
  29. package/dist/Calendar/styles.js +0 -2
  30. package/dist/Carousel/Carousel.d.ts.map +1 -1
  31. package/dist/Carousel/Carousel.js +8 -12
  32. package/dist/Chat/ChatDictationButton.d.ts.map +1 -1
  33. package/dist/Chat/ChatDictationButton.js +2 -1
  34. package/dist/Chat/ChatLayoutScrollButton.d.ts.map +1 -1
  35. package/dist/Chat/ChatLayoutScrollButton.js +3 -1
  36. package/dist/Chat/ChatSendButton.d.ts.map +1 -1
  37. package/dist/Chat/ChatSendButton.js +4 -3
  38. package/dist/Chat/ChatToolCalls.d.ts.map +1 -1
  39. package/dist/Chat/ChatToolCalls.js +17 -17
  40. package/dist/Chat/useTriggerMenu.d.ts.map +1 -1
  41. package/dist/Chat/useTriggerMenu.js +2 -6
  42. package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
  43. package/dist/CheckboxInput/CheckboxInput.js +36 -125
  44. package/dist/ClickableCard/ClickableCard.d.ts.map +1 -1
  45. package/dist/ClickableCard/ClickableCard.js +3 -11
  46. package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
  47. package/dist/CodeBlock/CodeBlock.js +84 -67
  48. package/dist/Collapsible/Collapsible.d.ts.map +1 -1
  49. package/dist/Collapsible/Collapsible.js +35 -15
  50. package/dist/CommandPalette/CommandPaletteItem.d.ts +1 -1
  51. package/dist/CommandPalette/CommandPaletteItem.d.ts.map +1 -1
  52. package/dist/CommandPalette/CommandPaletteItem.js +6 -3
  53. package/dist/CommandPalette/CommandPaletteList.js +1 -1
  54. package/dist/ComplexSelector/ComplexSelector.d.ts +1 -1
  55. package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
  56. package/dist/ComplexSelector/ComplexSelector.js +32 -31
  57. package/dist/ContextMenu/ContextMenu.d.ts +2 -2
  58. package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
  59. package/dist/ContextMenu/ContextMenu.js +1 -1
  60. package/dist/ContextMenu/index.d.ts +2 -1
  61. package/dist/ContextMenu/index.d.ts.map +1 -1
  62. package/dist/ContextMenu/index.js +1 -0
  63. package/dist/DateInput/DateInput.d.ts +9 -2
  64. package/dist/DateInput/DateInput.d.ts.map +1 -1
  65. package/dist/DateInput/DateInput.js +47 -33
  66. package/dist/DateRangeInput/DateRangeInput.d.ts +9 -2
  67. package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
  68. package/dist/DateRangeInput/DateRangeInput.js +55 -32
  69. package/dist/DateTimeInput/DateTimeInput.d.ts +9 -1
  70. package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
  71. package/dist/DateTimeInput/DateTimeInput.js +54 -30
  72. package/dist/Dialog/Dialog.d.ts.map +1 -1
  73. package/dist/Dialog/Dialog.js +4 -4
  74. package/dist/DropdownMenu/DropdownMenu.d.ts +33 -8
  75. package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
  76. package/dist/DropdownMenu/DropdownMenu.js +62 -20
  77. package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts +8 -11
  78. package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +1 -1
  79. package/dist/DropdownMenu/DropdownMenuCheckboxItem.js +32 -31
  80. package/dist/DropdownMenu/DropdownMenuDivider.d.ts +25 -0
  81. package/dist/DropdownMenu/DropdownMenuDivider.d.ts.map +1 -0
  82. package/dist/DropdownMenu/DropdownMenuDivider.js +66 -0
  83. package/dist/DropdownMenu/DropdownMenuItem.d.ts +15 -2
  84. package/dist/DropdownMenu/DropdownMenuItem.d.ts.map +1 -1
  85. package/dist/DropdownMenu/DropdownMenuItem.js +20 -8
  86. package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts +1 -1
  87. package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts.map +1 -1
  88. package/dist/DropdownMenu/DropdownMenuRadioGroup.js +10 -3
  89. package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts +5 -5
  90. package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts.map +1 -1
  91. package/dist/DropdownMenu/DropdownMenuRadioItem.js +24 -67
  92. package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -1
  93. package/dist/DropdownMenu/DropdownMenuSubMenu.js +2 -8
  94. package/dist/DropdownMenu/index.d.ts +2 -1
  95. package/dist/DropdownMenu/index.d.ts.map +1 -1
  96. package/dist/DropdownMenu/index.js +4 -0
  97. package/dist/DropdownMenu/renderDropdownItems.d.ts.map +1 -1
  98. package/dist/DropdownMenu/renderDropdownItems.js +35 -27
  99. package/dist/EmptyState/EmptyState.d.ts.map +1 -1
  100. package/dist/EmptyState/EmptyState.js +9 -5
  101. package/dist/Field/InputClearButton.d.ts +16 -3
  102. package/dist/Field/InputClearButton.d.ts.map +1 -1
  103. package/dist/Field/InputClearButton.js +15 -4
  104. package/dist/FileInput/FileInput.d.ts.map +1 -1
  105. package/dist/FileInput/FileInput.js +21 -10
  106. package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
  107. package/dist/HoverCard/useHoverCard.js +3 -19
  108. package/dist/Indicator/CheckIndicator.d.ts +25 -0
  109. package/dist/Indicator/CheckIndicator.d.ts.map +1 -0
  110. package/dist/Indicator/CheckIndicator.js +155 -0
  111. package/dist/Indicator/CheckboxIndicator.d.ts +22 -0
  112. package/dist/Indicator/CheckboxIndicator.d.ts.map +1 -0
  113. package/dist/Indicator/CheckboxIndicator.js +173 -0
  114. package/dist/Indicator/RadioIndicator.d.ts +23 -0
  115. package/dist/Indicator/RadioIndicator.d.ts.map +1 -0
  116. package/dist/Indicator/RadioIndicator.js +137 -0
  117. package/dist/Indicator/index.d.ts +24 -0
  118. package/dist/Indicator/index.d.ts.map +1 -0
  119. package/dist/Indicator/index.js +26 -0
  120. package/dist/Indicator/indicator.markers.stylex.d.ts +16 -0
  121. package/dist/Indicator/indicator.markers.stylex.d.ts.map +1 -0
  122. package/dist/Indicator/indicator.markers.stylex.js +21 -0
  123. package/dist/Indicator/indicatorRegistry.d.ts +71 -0
  124. package/dist/Indicator/indicatorRegistry.d.ts.map +1 -0
  125. package/dist/Indicator/indicatorRegistry.js +93 -0
  126. package/dist/Indicator/types.d.ts +177 -0
  127. package/dist/Indicator/types.d.ts.map +1 -0
  128. package/dist/Indicator/types.js +1 -0
  129. package/dist/Indicator/useIndicator.d.ts +18 -0
  130. package/dist/Indicator/useIndicator.d.ts.map +1 -0
  131. package/dist/Indicator/useIndicator.js +30 -0
  132. package/dist/Item/Item.d.ts.map +1 -1
  133. package/dist/Item/Item.js +4 -8
  134. package/dist/Layer/useLayer.d.ts +14 -0
  135. package/dist/Layer/useLayer.d.ts.map +1 -1
  136. package/dist/Layer/useLayer.js +25 -2
  137. package/dist/Lightbox/Lightbox.d.ts.map +1 -1
  138. package/dist/Lightbox/Lightbox.js +80 -103
  139. package/dist/Link/Link.d.ts.map +1 -1
  140. package/dist/Link/Link.js +4 -5
  141. package/dist/MobileNav/MobileNav.js +8 -8
  142. package/dist/MoreMenu/MoreMenu.d.ts +14 -1
  143. package/dist/MoreMenu/MoreMenu.d.ts.map +1 -1
  144. package/dist/MoreMenu/MoreMenu.js +4 -0
  145. package/dist/MultiSelector/MultiSelector.d.ts +8 -1
  146. package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
  147. package/dist/MultiSelector/MultiSelector.js +119 -95
  148. package/dist/NumberInput/NumberInput.d.ts +27 -1
  149. package/dist/NumberInput/NumberInput.d.ts.map +1 -1
  150. package/dist/NumberInput/NumberInput.js +230 -42
  151. package/dist/Outline/Outline.d.ts.map +1 -1
  152. package/dist/Outline/Outline.js +2 -3
  153. package/dist/Pagination/Pagination.d.ts.map +1 -1
  154. package/dist/Pagination/Pagination.js +61 -63
  155. package/dist/Popover/Popover.d.ts.map +1 -1
  156. package/dist/Popover/Popover.js +6 -8
  157. package/dist/Popover/usePopover.d.ts +15 -0
  158. package/dist/Popover/usePopover.d.ts.map +1 -1
  159. package/dist/Popover/usePopover.js +14 -2
  160. package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
  161. package/dist/PowerSearch/PowerSearch.js +1 -1
  162. package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
  163. package/dist/PowerSearch/PowerSearchEditPopover.js +7 -0
  164. package/dist/ProgressBar/ProgressBar.d.ts +11 -4
  165. package/dist/ProgressBar/ProgressBar.d.ts.map +1 -1
  166. package/dist/ProgressBar/ProgressBar.js +95 -6
  167. package/dist/RadioList/RadioListItem.d.ts.map +1 -1
  168. package/dist/RadioList/RadioListItem.js +29 -84
  169. package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
  170. package/dist/Resizable/ResizeHandle.js +2 -3
  171. package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
  172. package/dist/SegmentedControl/SegmentedControlItem.js +2 -3
  173. package/dist/SelectableCard/SelectableCard.d.ts.map +1 -1
  174. package/dist/SelectableCard/SelectableCard.js +3 -11
  175. package/dist/Selector/Selector.d.ts +12 -1
  176. package/dist/Selector/Selector.d.ts.map +1 -1
  177. package/dist/Selector/Selector.js +222 -111
  178. package/dist/Selector/hooks.d.ts +18 -6
  179. package/dist/Selector/hooks.d.ts.map +1 -1
  180. package/dist/Selector/hooks.js +57 -40
  181. package/dist/SideNav/SideNav.d.ts.map +1 -1
  182. package/dist/SideNav/SideNav.js +1 -1
  183. package/dist/SideNav/SideNavCollapseButton.d.ts +1 -1
  184. package/dist/SideNav/SideNavCollapseButton.d.ts.map +1 -1
  185. package/dist/SideNav/SideNavCollapseButton.js +29 -14
  186. package/dist/SideNav/SideNavHeading.d.ts.map +1 -1
  187. package/dist/SideNav/SideNavHeading.js +56 -20
  188. package/dist/SideNav/SideNavItem.d.ts.map +1 -1
  189. package/dist/SideNav/SideNavItem.js +28 -22
  190. package/dist/Slider/Slider.d.ts.map +1 -1
  191. package/dist/Slider/Slider.js +2 -6
  192. package/dist/Stack/stack.stylex.d.ts +3 -3
  193. package/dist/Switch/Switch.d.ts.map +1 -1
  194. package/dist/Switch/Switch.js +14 -13
  195. package/dist/TabList/Tab.d.ts.map +1 -1
  196. package/dist/TabList/Tab.js +2 -3
  197. package/dist/TabList/TabMenu.d.ts.map +1 -1
  198. package/dist/TabList/TabMenu.js +41 -19
  199. package/dist/Table/BaseTable.d.ts.map +1 -1
  200. package/dist/Table/BaseTable.js +8 -0
  201. package/dist/Table/TableRow.d.ts +1 -1
  202. package/dist/Table/TableRow.d.ts.map +1 -1
  203. package/dist/Table/TableRow.js +4 -2
  204. package/dist/Table/index.d.ts +1 -1
  205. package/dist/Table/index.d.ts.map +1 -1
  206. package/dist/Table/index.js +1 -1
  207. package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts +1 -1
  208. package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts.map +1 -1
  209. package/dist/Table/plugins/groupedRows/useTableGroupedRows.js +22 -18
  210. package/dist/Table/plugins/rowExpansion/index.d.ts +1 -1
  211. package/dist/Table/plugins/rowExpansion/index.d.ts.map +1 -1
  212. package/dist/Table/plugins/rowExpansion/index.js +1 -1
  213. package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts +41 -76
  214. package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
  215. package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +94 -345
  216. package/dist/Table/plugins/sortable/useTableSortable.d.ts.map +1 -1
  217. package/dist/Table/plugins/sortable/useTableSortable.js +23 -4
  218. package/dist/Table/plugins/tree/useTableTreeData.d.ts.map +1 -1
  219. package/dist/Table/plugins/tree/useTableTreeData.js +29 -33
  220. package/dist/Table/tableContextMenu.d.ts.map +1 -1
  221. package/dist/Table/tableContextMenu.js +2 -1
  222. package/dist/Table/types.d.ts +11 -0
  223. package/dist/Table/types.d.ts.map +1 -1
  224. package/dist/TextArea/TextArea.d.ts +10 -1
  225. package/dist/TextArea/TextArea.d.ts.map +1 -1
  226. package/dist/TextArea/TextArea.js +16 -6
  227. package/dist/TextInput/TextInput.d.ts +10 -1
  228. package/dist/TextInput/TextInput.d.ts.map +1 -1
  229. package/dist/TextInput/TextInput.js +13 -19
  230. package/dist/Thumbnail/Thumbnail.d.ts.map +1 -1
  231. package/dist/Thumbnail/Thumbnail.js +32 -26
  232. package/dist/TimeInput/TimeInput.d.ts.map +1 -1
  233. package/dist/TimeInput/TimeInput.js +14 -17
  234. package/dist/Timestamp/Timestamp.d.ts.map +1 -1
  235. package/dist/Timestamp/Timestamp.js +14 -3
  236. package/dist/Timestamp/TimestampHoverCard.d.ts.map +1 -1
  237. package/dist/Timestamp/TimestampHoverCard.js +16 -34
  238. package/dist/Timestamp/formatInstant.d.ts +11 -1
  239. package/dist/Timestamp/formatInstant.d.ts.map +1 -1
  240. package/dist/Timestamp/formatInstant.js +3 -1
  241. package/dist/Token/Token.d.ts.map +1 -1
  242. package/dist/Token/Token.js +20 -11
  243. package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
  244. package/dist/Tokenizer/Tokenizer.js +4 -2
  245. package/dist/Tooltip/useTooltip.d.ts.map +1 -1
  246. package/dist/Tooltip/useTooltip.js +3 -19
  247. package/dist/TopNav/TopNav.d.ts.map +1 -1
  248. package/dist/TopNav/TopNav.js +6 -5
  249. package/dist/TopNav/TopNavHeading.d.ts.map +1 -1
  250. package/dist/TopNav/TopNavHeading.js +54 -16
  251. package/dist/TopNav/TopNavItem.d.ts.map +1 -1
  252. package/dist/TopNav/TopNavItem.js +3 -9
  253. package/dist/TopNav/TopNavMegaMenu.d.ts +7 -0
  254. package/dist/TopNav/TopNavMegaMenu.d.ts.map +1 -1
  255. package/dist/TopNav/TopNavMegaMenu.js +146 -60
  256. package/dist/TopNav/TopNavMegaMenuItem.d.ts.map +1 -1
  257. package/dist/TopNav/TopNavMegaMenuItem.js +22 -3
  258. package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
  259. package/dist/TopNav/TopNavMenu.js +83 -38
  260. package/dist/TreeList/TreeList.d.ts.map +1 -1
  261. package/dist/TreeList/TreeList.js +13 -0
  262. package/dist/TreeList/TreeListBranches.d.ts +1 -1
  263. package/dist/TreeList/TreeListBranches.d.ts.map +1 -1
  264. package/dist/TreeList/TreeListBranches.js +14 -4
  265. package/dist/TreeList/TreeListItem.d.ts +11 -1
  266. package/dist/TreeList/TreeListItem.d.ts.map +1 -1
  267. package/dist/TreeList/TreeListItem.js +57 -30
  268. package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
  269. package/dist/Typeahead/BaseTypeahead.js +16 -8
  270. package/dist/astryx.css +84 -96
  271. package/dist/astryx.umd.js +56 -56
  272. package/dist/astryx.umd.js.map +4 -4
  273. package/dist/hooks/containerReveal.stylex.d.ts +61 -0
  274. package/dist/hooks/containerReveal.stylex.d.ts.map +1 -0
  275. package/dist/hooks/containerReveal.stylex.js +63 -0
  276. package/dist/hooks/index.d.ts +3 -0
  277. package/dist/hooks/index.d.ts.map +1 -1
  278. package/dist/hooks/index.js +2 -0
  279. package/dist/hooks/useClipboard.d.ts +59 -0
  280. package/dist/hooks/useClipboard.d.ts.map +1 -0
  281. package/dist/hooks/useClipboard.js +106 -0
  282. package/dist/hooks/useContainerReveal.d.ts +14 -8
  283. package/dist/hooks/useContainerReveal.d.ts.map +1 -1
  284. package/dist/hooks/useContainerReveal.js +28 -69
  285. package/dist/hooks/useIndicatorFocusRing.d.ts +28 -0
  286. package/dist/hooks/useIndicatorFocusRing.d.ts.map +1 -0
  287. package/dist/hooks/useIndicatorFocusRing.js +96 -0
  288. package/dist/hooks/useInputStatusIcon.d.ts.map +1 -1
  289. package/dist/hooks/useInputStatusIcon.js +17 -4
  290. package/dist/hooks/useLongPress.d.ts.map +1 -1
  291. package/dist/hooks/useLongPress.js +12 -2
  292. package/dist/hooks/useScrollLock.d.ts.map +1 -1
  293. package/dist/hooks/useScrollLock.js +33 -18
  294. package/dist/hooks/useStreamingText.d.ts +18 -3
  295. package/dist/hooks/useStreamingText.d.ts.map +1 -1
  296. package/dist/hooks/useStreamingText.js +47 -7
  297. package/dist/hooks/useTreeFocus.d.ts.map +1 -1
  298. package/dist/hooks/useTreeFocus.js +9 -3
  299. package/dist/hooks/useTypeahead.d.ts +3 -2
  300. package/dist/hooks/useTypeahead.d.ts.map +1 -1
  301. package/dist/hooks/useTypeahead.js +19 -7
  302. package/dist/index.d.ts +1 -0
  303. package/dist/index.d.ts.map +1 -1
  304. package/dist/index.js +1 -0
  305. package/dist/theme/defineTheme.d.ts +18 -2
  306. package/dist/theme/defineTheme.d.ts.map +1 -1
  307. package/dist/theme/defineTheme.js +10 -1
  308. package/dist/theme/derivedVarRegistry.d.ts +8 -0
  309. package/dist/theme/derivedVarRegistry.d.ts.map +1 -1
  310. package/dist/theme/derivedVarRegistry.js +14 -13
  311. package/dist/theme/expandColorScale.d.ts +3 -1
  312. package/dist/theme/expandColorScale.d.ts.map +1 -1
  313. package/dist/theme/expandColorScale.js +17 -7
  314. package/dist/theme/expandTypeScale.d.ts.map +1 -1
  315. package/dist/theme/expandTypeScale.js +17 -0
  316. package/dist/theme/generateThemeRules.d.ts.map +1 -1
  317. package/dist/theme/generateThemeRules.js +11 -0
  318. package/dist/theme/index.d.ts +2 -1
  319. package/dist/theme/index.d.ts.map +1 -1
  320. package/dist/theme/index.js +1 -1
  321. package/dist/theme/tokens.stylex.d.ts +12 -0
  322. package/dist/theme/tokens.stylex.d.ts.map +1 -1
  323. package/dist/theme/tokens.stylex.js +23 -0
  324. package/dist/utils/focusOutline.stylex.d.ts +122 -0
  325. package/dist/utils/focusOutline.stylex.d.ts.map +1 -0
  326. package/dist/utils/focusOutline.stylex.js +143 -0
  327. package/dist/utils/focusReturn.d.ts +24 -0
  328. package/dist/utils/focusReturn.d.ts.map +1 -0
  329. package/dist/utils/focusReturn.js +29 -0
  330. package/dist/utils/index.d.ts +2 -0
  331. package/dist/utils/index.d.ts.map +1 -1
  332. package/dist/utils/index.js +6 -1
  333. package/dist/utils/mergeRefs.d.ts.map +1 -1
  334. package/dist/utils/mergeRefs.js +7 -5
  335. package/dist/utils/rtlStyles.d.ts +2 -2
  336. package/dist/utils/rtlStyles.js +2 -2
  337. package/dist/utils/themeProps.d.ts +20 -1
  338. package/dist/utils/themeProps.d.ts.map +1 -1
  339. package/dist/utils/themeProps.js +8 -2
  340. package/locales/en.json +52 -0
  341. package/locales/pseudo.json +39 -0
  342. package/package.json +8 -3
  343. package/src/AlertDialog/AlertDialog.doc.mjs +16 -3
  344. package/src/AlertDialog/AlertDialog.test.tsx +208 -1
  345. package/src/AlertDialog/AlertDialog.tsx +21 -3
  346. package/src/AppShell/AppShell.doc.mjs +11 -0
  347. package/src/AppShell/AppShell.test.tsx +139 -0
  348. package/src/AppShell/AppShell.tsx +32 -22
  349. package/src/AspectRatio/AspectRatio.doc.mjs +27 -3
  350. package/src/AspectRatio/AspectRatio.test.tsx +30 -0
  351. package/src/AspectRatio/AspectRatio.tsx +13 -0
  352. package/src/Avatar/Avatar.doc.mjs +2 -13
  353. package/src/Avatar/Avatar.test.tsx +33 -8
  354. package/src/Avatar/Avatar.tsx +52 -50
  355. package/src/AvatarGroup/AvatarGroupOverflow.tsx +2 -9
  356. package/src/Banner/Banner.test.tsx +58 -1
  357. package/src/Banner/Banner.tsx +33 -11
  358. package/src/Breadcrumbs/BreadcrumbItem.tsx +16 -6
  359. package/src/Breadcrumbs/index.ts +5 -1
  360. package/src/Button/Button.doc.mjs +2 -2
  361. package/src/Button/Button.tsx +22 -41
  362. package/src/Calendar/Calendar.tsx +2 -1
  363. package/src/Calendar/styles.ts +0 -8
  364. package/src/Carousel/Carousel.doc.mjs +3 -0
  365. package/src/Carousel/Carousel.tsx +10 -6
  366. package/src/Chat/Chat.doc.mjs +2 -0
  367. package/src/Chat/ChatDictationButton.tsx +7 -1
  368. package/src/Chat/ChatLayoutScrollButton.test.tsx +22 -0
  369. package/src/Chat/ChatLayoutScrollButton.tsx +8 -1
  370. package/src/Chat/ChatSendButton.tsx +2 -3
  371. package/src/Chat/ChatToolCalls.test.tsx +35 -0
  372. package/src/Chat/ChatToolCalls.tsx +36 -16
  373. package/src/Chat/useTriggerMenu.tsx +2 -5
  374. package/src/CheckboxInput/CheckboxInput.doc.mjs +4 -2
  375. package/src/CheckboxInput/CheckboxInput.test.tsx +120 -0
  376. package/src/CheckboxInput/CheckboxInput.tsx +45 -202
  377. package/src/ClickableCard/ClickableCard.tsx +6 -11
  378. package/src/CodeBlock/CodeBlock.doc.mjs +3 -0
  379. package/src/CodeBlock/CodeBlock.test.tsx +91 -0
  380. package/src/CodeBlock/CodeBlock.tsx +57 -80
  381. package/src/Collapsible/Collapsible.tsx +22 -18
  382. package/src/CommandPalette/CommandPalette.test.tsx +29 -0
  383. package/src/CommandPalette/CommandPaletteItem.tsx +7 -4
  384. package/src/CommandPalette/CommandPaletteList.tsx +2 -2
  385. package/src/ComplexSelector/ComplexSelector.doc.mjs +42 -0
  386. package/src/ComplexSelector/ComplexSelector.test.tsx +73 -0
  387. package/src/ComplexSelector/ComplexSelector.tsx +41 -28
  388. package/src/ContextMenu/ContextMenu.doc.mjs +1 -1
  389. package/src/ContextMenu/ContextMenu.test.tsx +41 -0
  390. package/src/ContextMenu/ContextMenu.tsx +3 -3
  391. package/src/ContextMenu/index.ts +5 -1
  392. package/src/DateInput/DateInput.doc.mjs +18 -3
  393. package/src/DateInput/DateInput.test.tsx +112 -11
  394. package/src/DateInput/DateInput.tsx +44 -25
  395. package/src/DateRangeInput/DateRangeInput.doc.mjs +10 -2
  396. package/src/DateRangeInput/DateRangeInput.test.tsx +110 -14
  397. package/src/DateRangeInput/DateRangeInput.tsx +27 -21
  398. package/src/DateTimeInput/DateTimeInput.doc.mjs +16 -2
  399. package/src/DateTimeInput/DateTimeInput.test.tsx +154 -1
  400. package/src/DateTimeInput/DateTimeInput.tsx +58 -17
  401. package/src/Dialog/Dialog.tsx +2 -9
  402. package/src/DropdownMenu/DropdownMenu.doc.mjs +5 -9
  403. package/src/DropdownMenu/DropdownMenu.test.tsx +534 -4
  404. package/src/DropdownMenu/DropdownMenu.tsx +113 -52
  405. package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +27 -30
  406. package/src/DropdownMenu/DropdownMenuDivider.doc.mjs +34 -0
  407. package/src/DropdownMenu/DropdownMenuDivider.tsx +81 -0
  408. package/src/DropdownMenu/DropdownMenuItem.doc.mjs +39 -4
  409. package/src/DropdownMenu/DropdownMenuItem.tsx +48 -10
  410. package/src/DropdownMenu/DropdownMenuRadioGroup.tsx +2 -1
  411. package/src/DropdownMenu/DropdownMenuRadioItem.tsx +30 -76
  412. package/src/DropdownMenu/DropdownMenuSelectable.test.tsx +25 -19
  413. package/src/DropdownMenu/DropdownMenuSubMenu.test.tsx +44 -14
  414. package/src/DropdownMenu/DropdownMenuSubMenu.tsx +1 -5
  415. package/src/DropdownMenu/index.ts +8 -1
  416. package/src/DropdownMenu/renderDropdownItems.tsx +33 -34
  417. package/src/EmptyState/EmptyState.doc.mjs +4 -0
  418. package/src/EmptyState/EmptyState.test.tsx +62 -0
  419. package/src/EmptyState/EmptyState.tsx +16 -6
  420. package/src/Field/Field.doc.mjs +1 -0
  421. package/src/Field/InputClearButton.test.tsx +117 -0
  422. package/src/Field/InputClearButton.tsx +30 -3
  423. package/src/FileInput/FileInput.tsx +21 -8
  424. package/src/HoverCard/useHoverCard.tsx +2 -23
  425. package/src/Icon/Icon.doc.mjs +2 -1
  426. package/src/Indicator/CheckIndicator.tsx +174 -0
  427. package/src/Indicator/CheckboxIndicator.tsx +257 -0
  428. package/src/Indicator/Indicator.doc.mjs +344 -0
  429. package/src/Indicator/Indicator.test.tsx +393 -0
  430. package/src/Indicator/RadioIndicator.tsx +206 -0
  431. package/src/Indicator/index.ts +46 -0
  432. package/src/Indicator/indicator.markers.stylex.ts +19 -0
  433. package/src/Indicator/indicatorRegistry.test.tsx +106 -0
  434. package/src/Indicator/indicatorRegistry.ts +120 -0
  435. package/src/Indicator/types.ts +197 -0
  436. package/src/Indicator/useIndicator.ts +39 -0
  437. package/src/Item/Item.doc.mjs +1 -1
  438. package/src/Item/Item.tsx +7 -14
  439. package/src/Layer/useLayer.doc.mjs +2 -2
  440. package/src/Layer/useLayer.test.tsx +85 -0
  441. package/src/Layer/useLayer.tsx +39 -1
  442. package/src/Lightbox/Lightbox.doc.mjs +1 -1
  443. package/src/Lightbox/Lightbox.tsx +45 -49
  444. package/src/Link/Link.tsx +4 -11
  445. package/src/MobileNav/MobileNav.tsx +3 -3
  446. package/src/MoreMenu/MoreMenu.doc.mjs +31 -0
  447. package/src/MoreMenu/MoreMenu.test.tsx +68 -1
  448. package/src/MoreMenu/MoreMenu.tsx +19 -0
  449. package/src/MultiSelector/MultiSelector.doc.mjs +16 -1
  450. package/src/MultiSelector/MultiSelector.test.tsx +259 -16
  451. package/src/MultiSelector/MultiSelector.tsx +144 -121
  452. package/src/NumberInput/NumberInput.doc.mjs +265 -50
  453. package/src/NumberInput/NumberInput.test.tsx +726 -21
  454. package/src/NumberInput/NumberInput.tsx +353 -59
  455. package/src/Outline/Outline.tsx +2 -5
  456. package/src/Pagination/Pagination.doc.mjs +1 -1
  457. package/src/Pagination/Pagination.test.tsx +22 -7
  458. package/src/Pagination/Pagination.tsx +38 -35
  459. package/src/Popover/Popover.doc.mjs +2 -0
  460. package/src/Popover/Popover.tsx +6 -7
  461. package/src/Popover/usePopover.tsx +37 -4
  462. package/src/PowerSearch/PowerSearch.tsx +1 -1
  463. package/src/PowerSearch/PowerSearchEditPopover.test.tsx +42 -0
  464. package/src/PowerSearch/PowerSearchEditPopover.tsx +7 -0
  465. package/src/ProgressBar/ProgressBar.doc.mjs +27 -5
  466. package/src/ProgressBar/ProgressBar.test.tsx +224 -1
  467. package/src/ProgressBar/ProgressBar.tsx +126 -30
  468. package/src/RadioList/RadioList.doc.mjs +4 -2
  469. package/src/RadioList/RadioListItem.tsx +31 -130
  470. package/src/Resizable/ResizeHandle.tsx +2 -9
  471. package/src/SegmentedControl/SegmentedControlItem.tsx +2 -9
  472. package/src/SelectableCard/SelectableCard.tsx +4 -9
  473. package/src/Selector/Selector.doc.mjs +15 -4
  474. package/src/Selector/Selector.test.tsx +1234 -98
  475. package/src/Selector/Selector.tsx +254 -126
  476. package/src/Selector/hooks.ts +77 -50
  477. package/src/SideNav/SideNav.test.tsx +46 -0
  478. package/src/SideNav/SideNav.tsx +1 -0
  479. package/src/SideNav/SideNavCollapseButton.tsx +15 -10
  480. package/src/SideNav/SideNavHeading.tsx +48 -10
  481. package/src/SideNav/SideNavItem.tsx +20 -12
  482. package/src/Slider/Slider.tsx +2 -11
  483. package/src/Stack/Stack.doc.mjs +110 -0
  484. package/src/StatusDot/StatusDot.doc.mjs +12 -3
  485. package/src/Switch/Switch.test.tsx +32 -0
  486. package/src/Switch/Switch.tsx +18 -10
  487. package/src/TabList/Tab.tsx +2 -9
  488. package/src/TabList/TabMenu.tsx +14 -21
  489. package/src/Table/BaseTable.tsx +11 -0
  490. package/src/Table/Table.test.tsx +31 -0
  491. package/src/Table/TableRow.tsx +6 -0
  492. package/src/Table/index.ts +1 -4
  493. package/src/Table/plugins/groupedRows/useTableGroupedRows.tsx +30 -14
  494. package/src/Table/plugins/rowExpansion/index.ts +1 -4
  495. package/src/Table/plugins/rowExpansion/useTableRowExpansion.test.tsx +125 -175
  496. package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +115 -458
  497. package/src/Table/plugins/sortable/useTableSortable.tsx +2 -6
  498. package/src/Table/plugins/tree/useTableTreeData.tsx +43 -24
  499. package/src/Table/tableContextMenu.test.tsx +27 -0
  500. package/src/Table/tableContextMenu.tsx +1 -0
  501. package/src/Table/types.ts +11 -0
  502. package/src/Table/useTableGroupedRows.doc.mjs +1 -1
  503. package/src/Table/useTableRowExpansion.doc.mjs +43 -66
  504. package/src/TextArea/TextArea.doc.mjs +42 -2
  505. package/src/TextArea/TextArea.test.tsx +219 -0
  506. package/src/TextArea/TextArea.tsx +34 -7
  507. package/src/TextInput/TextInput.doc.mjs +18 -2
  508. package/src/TextInput/TextInput.test.tsx +189 -0
  509. package/src/TextInput/TextInput.tsx +25 -31
  510. package/src/Thumbnail/Thumbnail.tsx +2 -9
  511. package/src/TimeInput/TimeInput.doc.mjs +2 -2
  512. package/src/TimeInput/TimeInput.test.tsx +84 -3
  513. package/src/TimeInput/TimeInput.tsx +26 -28
  514. package/src/Timestamp/Timestamp.doc.mjs +4 -3
  515. package/src/Timestamp/Timestamp.test.tsx +91 -14
  516. package/src/Timestamp/Timestamp.tsx +14 -2
  517. package/src/Timestamp/TimestampHoverCard.tsx +13 -35
  518. package/src/Timestamp/formatInstant.ts +16 -1
  519. package/src/Token/Token.tsx +5 -28
  520. package/src/Tokenizer/Tokenizer.doc.mjs +2 -2
  521. package/src/Tokenizer/Tokenizer.test.tsx +45 -3
  522. package/src/Tokenizer/Tokenizer.tsx +10 -2
  523. package/src/Tooltip/useTooltip.tsx +2 -23
  524. package/src/TopNav/TopNav.tsx +1 -3
  525. package/src/TopNav/TopNavHeading.tsx +42 -13
  526. package/src/TopNav/TopNavItem.tsx +3 -21
  527. package/src/TopNav/TopNavMegaMenu.doc.mjs +5 -0
  528. package/src/TopNav/TopNavMegaMenu.test.tsx +433 -33
  529. package/src/TopNav/TopNavMegaMenu.tsx +118 -53
  530. package/src/TopNav/TopNavMegaMenuItem.tsx +2 -9
  531. package/src/TopNav/TopNavMenu.tsx +34 -37
  532. package/src/TreeList/TreeList.doc.mjs +5 -0
  533. package/src/TreeList/TreeList.test.tsx +208 -8
  534. package/src/TreeList/TreeList.tsx +22 -0
  535. package/src/TreeList/TreeListBranches.tsx +25 -2
  536. package/src/TreeList/TreeListItem.tsx +89 -52
  537. package/src/Typeahead/BaseTypeahead.tsx +19 -6
  538. package/src/Typeahead/Typeahead.doc.mjs +1 -0
  539. package/src/Typeahead/Typeahead.test.tsx +76 -3
  540. package/src/hooks/containerReveal.stylex.ts +102 -0
  541. package/src/hooks/index.ts +4 -0
  542. package/src/hooks/useClipboard.doc.mjs +87 -0
  543. package/src/hooks/useClipboard.test.tsx +151 -0
  544. package/src/hooks/useClipboard.ts +135 -0
  545. package/src/hooks/useContainerReveal.doc.mjs +7 -7
  546. package/src/hooks/useContainerReveal.test.tsx +42 -62
  547. package/src/hooks/useContainerReveal.ts +36 -91
  548. package/src/hooks/useImageMode.test.ts +1 -1
  549. package/src/hooks/useIndicatorFocusRing.tsx +120 -0
  550. package/src/hooks/useInputStatusIcon.tsx +8 -8
  551. package/src/hooks/useLongPress.test.tsx +18 -0
  552. package/src/hooks/useLongPress.ts +12 -2
  553. package/src/hooks/useScrollLock.test.ts +72 -0
  554. package/src/hooks/useScrollLock.ts +51 -19
  555. package/src/hooks/useStreamingText.test.ts +46 -1
  556. package/src/hooks/useStreamingText.ts +49 -7
  557. package/src/hooks/useTreeFocus.test.tsx +50 -0
  558. package/src/hooks/useTreeFocus.ts +14 -3
  559. package/src/hooks/useTypeahead.test.tsx +150 -0
  560. package/src/hooks/useTypeahead.ts +24 -9
  561. package/src/i18n/InternationalizationProvider.doc.mjs +7 -2
  562. package/src/index.ts +1 -0
  563. package/src/theme/defineTheme.ts +27 -0
  564. package/src/theme/derivedVarRegistry.test.ts +21 -1
  565. package/src/theme/derivedVarRegistry.ts +19 -6
  566. package/src/theme/expandColorScale.test.ts +14 -0
  567. package/src/theme/expandColorScale.ts +24 -9
  568. package/src/theme/expandTypeScale.test.ts +43 -0
  569. package/src/theme/expandTypeScale.ts +17 -0
  570. package/src/theme/generateThemeRules.test.ts +78 -20
  571. package/src/theme/generateThemeRules.ts +11 -0
  572. package/src/theme/index.ts +15 -0
  573. package/src/theme/tokens.stylex.ts +18 -0
  574. package/src/theme/tokens.test.ts +37 -0
  575. package/src/utils/focusOutline.stylex.ts +177 -0
  576. package/src/utils/focusReturn.test.ts +42 -0
  577. package/src/utils/focusReturn.ts +31 -0
  578. package/src/utils/index.ts +5 -0
  579. package/src/utils/mergeRefs.test.ts +48 -0
  580. package/src/utils/mergeRefs.ts +12 -6
  581. package/src/utils/rtlStyles.ts +2 -2
  582. package/src/utils/themeProps.ts +26 -4
  583. package/dist/CheckboxInput/checkbox.markers.stylex.d.ts +0 -9
  584. package/dist/CheckboxInput/checkbox.markers.stylex.d.ts.map +0 -1
  585. package/dist/CheckboxInput/checkbox.markers.stylex.js +0 -14
  586. package/dist/RadioList/radio.markers.stylex.d.ts +0 -7
  587. package/dist/RadioList/radio.markers.stylex.d.ts.map +0 -1
  588. package/dist/RadioList/radio.markers.stylex.js +0 -12
  589. package/dist/hooks/containerReveal.pool.stylex.d.ts +0 -303
  590. package/dist/hooks/containerReveal.pool.stylex.d.ts.map +0 -1
  591. package/dist/hooks/containerReveal.pool.stylex.js +0 -292
  592. package/src/CheckboxInput/checkbox.markers.stylex.ts +0 -12
  593. package/src/RadioList/radio.markers.stylex.ts +0 -10
  594. package/src/hooks/containerReveal.pool.stylex.ts +0 -571
@@ -1 +1 @@
1
- {"version":3,"file":"derivedVarRegistry.d.ts","sourceRoot":"","sources":["../../src/theme/derivedVarRegistry.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,WAAW,eAAe;IAC9B,2EAA2E;IAC3E,QAAQ,EAAE,MAAM,CAAC;IACjB,2EAA2E;IAC3E,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,iFAAiF;IACjF,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,EAAE,CAiChE,CAAC;AAEF;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,GACf,eAAe,EAAE,CAMnB"}
1
+ {"version":3,"file":"derivedVarRegistry.d.ts","sourceRoot":"","sources":["../../src/theme/derivedVarRegistry.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,WAAW,eAAe;IAC9B,2EAA2E;IAC3E,QAAQ,EAAE,MAAM,CAAC;IACjB,2EAA2E;IAC3E,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,iFAAiF;IACjF,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,EAAE,CAsChE,CAAC;AAEF;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,GACf,eAAe,EAAE,CAMnB"}
@@ -26,19 +26,6 @@
26
26
  * entries share the same property.
27
27
  */
28
28
  export const derivedVarRegistry = {
29
- avatar: [{
30
- property: 'fontSize',
31
- vars: ['--_avatar-fallback-font-size']
32
- }, {
33
- property: 'fontWeight',
34
- vars: ['--_avatar-fallback-font-weight']
35
- }, {
36
- property: 'color',
37
- vars: ['--_avatar-fallback-color']
38
- }, {
39
- property: 'backgroundColor',
40
- vars: ['--_avatar-fallback-background']
41
- }],
42
29
  banner: [{
43
30
  property: 'borderRadius',
44
31
  vars: ['--_banner-radius']
@@ -87,6 +74,15 @@ export const derivedVarRegistry = {
87
74
  property: 'borderRadius',
88
75
  vars: ['--_popover-radius']
89
76
  }],
77
+ 'progressbar-mark': [{
78
+ property: 'width',
79
+ vars: ['--_progressbar-mark-width'],
80
+ replaces: true
81
+ }, {
82
+ property: 'height',
83
+ vars: ['--_progressbar-mark-height'],
84
+ replaces: true
85
+ }],
90
86
  section: [{
91
87
  property: 'padding',
92
88
  expand: 'container'
@@ -97,6 +93,11 @@ export const derivedVarRegistry = {
97
93
  }, {
98
94
  property: 'padding',
99
95
  vars: ['--_segmented-control-padding']
96
+ }],
97
+ textarea: [{
98
+ property: 'paddingInline',
99
+ vars: ['--_textarea-inline-padding'],
100
+ replaces: true
100
101
  }]
101
102
  };
102
103
 
@@ -30,7 +30,9 @@ export interface ColorScaleConfig {
30
30
  */
31
31
  neutralStyle?: 'warm' | 'cool' | 'neutral';
32
32
  /**
33
- * Contrast level. Affects tone assignments for text and UI elements.
33
+ * Contrast level. `'high'` pulls text, icons, and borders toward stronger
34
+ * tones (and thickens the subtle border's alpha) so structural and textual
35
+ * boundaries stay perceivable.
34
36
  * @default 'standard'
35
37
  */
36
38
  contrast?: 'standard' | 'high';
@@ -1 +1 @@
1
- {"version":3,"file":"expandColorScale.d.ts","sourceRoot":"","sources":["../../src/theme/expandColorScale.ts"],"names":[],"mappings":"AAuCA;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAE3C;;;OAGG;IACH,QAAQ,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC;CAChC;AAED,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAyCtD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,EACZ,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GACf,MAAM,CAYR;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,gBAAgB,CAuH3E"}
1
+ {"version":3,"file":"expandColorScale.d.ts","sourceRoot":"","sources":["../../src/theme/expandColorScale.ts"],"names":[],"mappings":"AAuCA;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAE3C;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC;CAChC;AAED,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAyCtD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,EACZ,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GACf,MAAM,CAYR;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,gBAAgB,CAoI3E"}
@@ -158,13 +158,21 @@ export function expandColorScale(config) {
158
158
  const textSecondaryLightTone = isHigh ? 20 : 30;
159
159
  const textSecondaryDarkTone = isHigh ? 80 : 70;
160
160
 
161
+ // Borders track contrast the same way text does: high contrast pulls the
162
+ // emphasized border tone toward mid-scale (stronger against both the near-
163
+ // white light surface and the near-black dark surface) and thickens the
164
+ // otherwise-decorative subtle hairline by doubling its alpha, so structural
165
+ // boundaries stay perceivable for users who opt into high contrast.
166
+ const borderSubtleAlpha = isHigh ? 0.2 : 0.1;
167
+
161
168
  // Emphasized borders outline form controls (CheckboxInput, Selector), so
162
169
  // they are non-text UI boundaries under WCAG 1.4.11 and must reach 3:1
163
- // against the surface they sit on. The preferred tones (70 light /
164
- // 30 dark) land around 2.2:1 / 1.8:1, so bump the tone toward the
165
- // opposing extreme until the ratio passes. Text tones need no such loop:
166
- // their spacing guarantees >= 4.5:1 for any hue/chroma (see file header).
167
- const borderEmphasized = ld(ensureContrastTone(seedHue, neutralVariantChroma, 70, -1, N[99], NON_TEXT_MIN_CONTRAST), ensureContrastTone(seedHue, neutralVariantChroma, 30, 1, N[10], NON_TEXT_MIN_CONTRAST));
170
+ // against the surface they sit on. High contrast starts at a more
171
+ // aggressive tone (50 vs 70/30), guaranteeing a stronger result; standard
172
+ // contrast starts at 70/30 and walks toward mid-scale only as far as needed.
173
+ const borderEmphasizedStartLight = isHigh ? 50 : 70;
174
+ const borderEmphasizedStartDark = isHigh ? 50 : 30;
175
+ const borderEmphasized = ld(ensureContrastTone(seedHue, neutralVariantChroma, borderEmphasizedStartLight, -1, N[99], NON_TEXT_MIN_CONTRAST), ensureContrastTone(seedHue, neutralVariantChroma, borderEmphasizedStartDark, 1, N[10], NON_TEXT_MIN_CONTRAST));
168
176
  return {
169
177
  // Core semantic — only with a seed accent. Without one these fall through
170
178
  // to colorDefaults, whose --color-accent is NOT what the default seed
@@ -202,8 +210,10 @@ export function expandColorScale(config) {
202
210
  '--color-background-popover': ld(N[99], N[20]),
203
211
  '--color-background-inverted': ld(N[10], N[99]),
204
212
  // Border
205
- // Decorative hairline (~1.1:1 by design) — not a WCAG 1.4.11 boundary.
206
- '--color-border': ld(hexWithAlpha(N[10], 0.1), hexWithAlpha(N[95], 0.1)),
213
+ // Border
214
+ // Decorative hairline — not a WCAG 1.4.11 boundary. High contrast
215
+ // doubles the alpha so structural boundaries stay perceivable.
216
+ '--color-border': ld(hexWithAlpha(N[10], borderSubtleAlpha), hexWithAlpha(N[95], borderSubtleAlpha)),
207
217
  '--color-border-emphasized': borderEmphasized,
208
218
  // Effects
209
219
  '--color-skeleton': ld(NV[70], NV[30]),
@@ -1 +1 @@
1
- {"version":3,"file":"expandTypeScale.d.ts","sourceRoot":"","sources":["../../src/theme/expandTypeScale.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAMH,oEAAoE;AACpE,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC;AAErC;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAC1C,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,eAAe,CAAC,CAC/C,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,OAAO,CACvC,MAAM,CACF,MAAM,GACN,OAAO,GACP,OAAO,GACP,MAAM,GACN,YAAY,GACZ,WAAW,GACX,WAAW,GACX,WAAW,GACX,CAAC,MAAM,GAAG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,WAAW,GACX,WAAW,GACX,CAAC,MAAM,GAAG,EAAE,CAAC,EACf,eAAe,CAChB,CACF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,WAAW,eAAe;IAC9B,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,6DAA6D;IAC7D,OAAO,CAAC,EAAE;QACR,yEAAyE;QACzE,OAAO,CAAC,EAAE,sBAAsB,CAAC;QACjC,oEAAoE;QACpE,IAAI,CAAC,EAAE,mBAAmB,CAAC;KAC5B,CAAC;CACH;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAwIrD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,eAAe,GAAG,eAAe,CA+CxE;AAiBD;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,eAAe,GACvB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAmDxD"}
@@ -332,6 +332,23 @@ export function generateTypeScaleComponents(_config) {
332
332
  lineHeight: `var(--text-heading-${level}-leading)`
333
333
  };
334
334
  }
335
+ // `Heading` renders both a `level:N` and, when set, a `type:display-N`
336
+ // visual-prop class simultaneously (type sizing takes precedence over
337
+ // level sizing — see Heading.tsx's own `type ? sizeByTypeStyles[type] :
338
+ // sizeByLevelStyles[level]`). Without a `type:display-N` rule here, the
339
+ // `level:N` rule is the only one that matches, so it silently wins
340
+ // regardless of `type` once a theme supplies a type scale. Emitting these
341
+ // after the level rules keeps them later in source order, so they take
342
+ // precedence at equal specificity, matching the component's own logic.
343
+ // fontWeight is intentionally omitted, mirroring the `text` branch below
344
+ // and preserving `defaultWeightByTypeStyles`.
345
+ for (const type of ['display-1', 'display-2', 'display-3']) {
346
+ headingRules[`type:${type}`] = {
347
+ fontFamily: 'var(--font-family-heading)',
348
+ fontSize: `var(--text-${type}-size)`,
349
+ lineHeight: `var(--text-${type}-leading)`
350
+ };
351
+ }
335
352
  components.heading = headingRules;
336
353
  const textRules = {};
337
354
  for (const type of ['body', 'large', 'label', 'code', 'supporting', 'display-1', 'display-2', 'display-3']) {
@@ -1 +1 @@
1
- {"version":3,"file":"generateThemeRules.d.ts","sourceRoot":"","sources":["../../src/theme/generateThemeRules.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AA+DhD;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,+EAA+E;IAC/E,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,kFAAkF;IAClF,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAgKD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,EAAE,CAoChE;AAwPD;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,YAAY,GAAG,eAAe,CAe5E;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CA4E9D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,YAAY,GAAG,cAAc,CA2BpE"}
1
+ {"version":3,"file":"generateThemeRules.d.ts","sourceRoot":"","sources":["../../src/theme/generateThemeRules.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AA+DhD;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,+EAA+E;IAC/E,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,kFAAkF;IAClF,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAgKD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,EAAE,CAoChE;AAmQD;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,YAAY,GAAG,eAAe,CAe5E;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CA4E9D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,YAAY,GAAG,cAAc,CA2BpE"}
@@ -288,9 +288,11 @@ function generateComponentRules(components, parts) {
288
288
  // Entries are processed in order (priority).
289
289
  // - `vars`: emit internal CSS custom property declarations
290
290
  // - `expand: 'container'`: expand padding to container layout tokens
291
+ // - `replaces: true`: emit only the var, dropping the source property
291
292
  let finalProps = props;
292
293
  const derivedProps = [];
293
294
  let containerExpanded = false;
295
+ const replacedProps = new Set();
294
296
  for (const [prop, value] of props) {
295
297
  const derived = getDerivedVars(component, prop);
296
298
  // Padding longhands (paddingBlock, paddingInline, etc.) also
@@ -300,6 +302,9 @@ function generateComponentRules(components, parts) {
300
302
  if (entry.expand === 'container' && PADDING_PROPS.has(prop)) {
301
303
  containerExpanded = true;
302
304
  }
305
+ if (entry.replaces) {
306
+ replacedProps.add(prop);
307
+ }
303
308
  if (entry.vars) {
304
309
  for (const varName of entry.vars) {
305
310
  derivedProps.push([varName, value]);
@@ -317,6 +322,12 @@ function generateComponentRules(components, parts) {
317
322
  const containerTokens = expandContainerPadding(component, parsed);
318
323
  finalProps = [...nonPaddingProps, ...containerTokens];
319
324
  }
325
+
326
+ // Drop properties whose derived entry set `replaces` — their value is
327
+ // carried by the emitted var and must not land on the class element.
328
+ if (replacedProps.size > 0) {
329
+ finalProps = finalProps.filter(([p]) => !replacedProps.has(p));
330
+ }
320
331
  if (derivedProps.length > 0) {
321
332
  finalProps = [...finalProps, ...derivedProps];
322
333
  }
@@ -30,10 +30,11 @@ export { expandColorScale } from './expandColorScale';
30
30
  export type { ColorScaleConfig, ColorScaleTokens } from './expandColorScale';
31
31
  export { expandMotionScale } from './expandMotionScale';
32
32
  export type { MotionScaleConfig, MotionScaleTokens } from './expandMotionScale';
33
- export { colorDefaults, spacingDefaults, sizeDefaults, borderDefaults, radiusDefaults, shadowDefaults, durationDefaults, easeDefaults, typographyDefaults, textSizeDefaults, fontWeightDefaults, typeScaleDefaults, colorVars, spacingVars, sizeVars, borderVars, radiusVars, shadowVars, durationVars, easeVars, typographyVars, textSizeVars, fontWeightVars, typeScaleVars, } from './tokens.stylex';
33
+ export { colorDefaults, spacingDefaults, sizeDefaults, borderDefaults, focusDefaults, radiusDefaults, shadowDefaults, durationDefaults, easeDefaults, typographyDefaults, textSizeDefaults, fontWeightDefaults, typeScaleDefaults, colorVars, spacingVars, sizeVars, borderVars, focusVars, radiusVars, shadowVars, durationVars, easeVars, typographyVars, textSizeVars, fontWeightVars, typeScaleVars, } from './tokens.stylex';
34
34
  export type { ColorVarName, SpacingVarName, SizeVarName, BorderVarName, RadiusVarName, ShadowVarName, DurationVarName, EaseVarName, TypographyVarName, TextSizeVarName, FontWeightVarName, TypeScaleVarName, } from './tokens.stylex';
35
35
  export { useTheme, useThemeName, ThemeContext } from './useTheme';
36
36
  export type { UseThemeReturn, ThemeContextValue } from './useTheme';
37
+ export type { IndicatorComponent, IndicatorFamily, IndicatorFamilyMap, IndicatorMap, IndicatorName, IndicatorNameOfFamily, IndicatorProps, IndicatorRegistry, IndicatorSize, IndicatorState, } from '../Indicator';
37
38
  export { resolveThemeToken, resolveThemeTokens, tokenVar, tokenVars, } from './tokens';
38
39
  export type { ResolveThemeTokenOptions, ResolveThemeTokensOptions, ResolvedThemeMode, } from './tokens';
39
40
  export type { TextColorMap } from '../Text';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,YAAY,EAAC,eAAe,EAAC,MAAM,cAAc,CAAC;AAClD,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EACvB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,cAAc,EACd,aAAa,GACd,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,WAAW,GACZ,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,cAAc,GACf,MAAM,eAAe,CAAC;AAEvB,YAAY,EACV,eAAe,EACf,eAAe,EACf,aAAa,GACd,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAC,iBAAiB,EAAC,MAAM,UAAU,CAAC;AAC3C,YAAY,EACV,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAC,WAAW,EAAE,cAAc,EAAC,MAAM,UAAU,CAAC;AACrD,YAAY,EAAC,oBAAoB,EAAC,MAAM,UAAU,CAAC;AAEnD,OAAO,EAAC,eAAe,EAAE,2BAA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BAAiB,GAClB,MAAM,UAAU,CAAC;AAElB,YAAY,EAAC,YAAY,EAAC,MAAM,SAAS,CAAC;AAC1C,YAAY,EACV,SAAS,EACT,UAAU,EACV,QAAQ,EACR,eAAe,EACf,eAAe,EACf,QAAQ,EACR,UAAU,EACV,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,UAAU,GACX,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,YAAY,EAAC,eAAe,EAAC,MAAM,cAAc,CAAC;AAClD,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EACvB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,cAAc,EACd,aAAa,GACd,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,WAAW,GACZ,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,cAAc,GACf,MAAM,eAAe,CAAC;AAEvB,YAAY,EACV,eAAe,EACf,eAAe,EACf,aAAa,GACd,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAC,iBAAiB,EAAC,MAAM,UAAU,CAAC;AAC3C,YAAY,EACV,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAC,WAAW,EAAE,cAAc,EA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E,YAAY,EACV,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,qBAAqB,EACrB,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,QAAQ,EACR,SAAS,GACV,MAAM,UAAU,CAAC;AAClB,YAAY,EACV,wBAAwB,EACxB,yBAAyB,EACzB,iBAAiB,GAClB,MAAM,UAAU,CAAC;AAElB,YAAY,EAAC,YAAY,EAAC,MAAM,SAAS,CAAC;AAC1C,YAAY,EACV,SAAS,EACT,UAAU,EACV,QAAQ,EACR,eAAe,EACf,eAAe,EACf,QAAQ,EACR,UAAU,EACV,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,UAAU,GACX,MAAM,SAAS,CAAC"}
@@ -29,7 +29,7 @@ export { expandRadiusScale } from "./expandRadiusScale.js";
29
29
  export { expandColorScale } from "./expandColorScale.js";
30
30
  export { expandMotionScale } from "./expandMotionScale.js";
31
31
  // Export token defaults and vars for use in custom components and themes
32
- export { colorDefaults, spacingDefaults, sizeDefaults, borderDefaults, radiusDefaults, shadowDefaults, durationDefaults, easeDefaults, typographyDefaults, textSizeDefaults, fontWeightDefaults, typeScaleDefaults, colorVars, spacingVars, sizeVars, borderVars, radiusVars, shadowVars, durationVars, easeVars, typographyVars, textSizeVars, fontWeightVars, typeScaleVars } from "./tokens.stylex.js";
32
+ export { colorDefaults, spacingDefaults, sizeDefaults, borderDefaults, focusDefaults, radiusDefaults, shadowDefaults, durationDefaults, easeDefaults, typographyDefaults, textSizeDefaults, fontWeightDefaults, typeScaleDefaults, colorVars, spacingVars, sizeVars, borderVars, focusVars, radiusVars, shadowVars, durationVars, easeVars, typographyVars, textSizeVars, fontWeightVars, typeScaleVars } from "./tokens.stylex.js";
33
33
 
34
34
  // Export token key types for theme authoring
35
35
 
@@ -225,6 +225,18 @@ export declare const borderVars: stylex.VarGroup<Readonly<{
225
225
  readonly '--border-width': "1px";
226
226
  }>, symbol>;
227
227
  export type BorderVarName = keyof typeof borderDefaults;
228
+ export declare const focusDefaults: {
229
+ readonly '--focus-outline-width': "2px";
230
+ readonly '--focus-outline-style': "solid";
231
+ readonly '--focus-outline-color': "var(--color-accent)";
232
+ readonly '--focus-outline-offset': "3px";
233
+ };
234
+ export declare const focusVars: stylex.VarGroup<Readonly<{
235
+ readonly '--focus-outline-width': "2px";
236
+ readonly '--focus-outline-style': "solid";
237
+ readonly '--focus-outline-color': "var(--color-accent)";
238
+ readonly '--focus-outline-offset': "3px";
239
+ }>, symbol>;
228
240
  export declare const radiusDefaults: {
229
241
  readonly '--radius-none': "0px";
230
242
  readonly '--radius-inner': "4px";
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.stylex.d.ts","sourceRoot":"","sources":["../../src/theme/tokens.stylex.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAM3C,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyHhB,CAAC;AAEX,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAAmC,CAAC;AAM1D,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;CAgBlB,CAAC;AAEX,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;WAAqC,CAAC;AAM9D,eAAO,MAAM,YAAY;;;;CAIf,CAAC;AAEX,eAAO,MAAM,QAAQ;;;;WAAkC,CAAC;AAMxD,eAAO,MAAM,cAAc;;CAEjB,CAAC;AAEX,eAAO,MAAM,UAAU;;WAAoC,CAAC;AAE5D,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,cAAc,C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AgB,GAAG,MAAM,OAAO,iBAAiB,CAAC"}
@@ -284,6 +284,29 @@ export const borderVars = {
284
284
  "--border-width": "var(--border-width)",
285
285
  __varGroupHash__: "xafi2nm"
286
286
  };
287
+ // =============================================================================
288
+ // Focus Tokens
289
+ // =============================================================================
290
+ // The keyboard focus ring, as one definition for the whole system. Values come
291
+ // from Design Conventions §User Interaction States: 2px --color-accent at 3px
292
+ // offset. Components read these through utils/focusOutline.stylex.ts; the
293
+ // `:focus-visible` condition stays in core, so a theme can restyle the ring
294
+ // but cannot show it to pointer users.
295
+
296
+ export const focusDefaults = {
297
+ '--focus-outline-width': '2px',
298
+ '--focus-outline-style': 'solid',
299
+ '--focus-outline-color': 'var(--color-accent)',
300
+ '--focus-outline-offset': '3px'
301
+ };
302
+ export const focusVars = {
303
+ "--focus-outline-width": "var(--focus-outline-width)",
304
+ "--focus-outline-style": "var(--focus-outline-style)",
305
+ "--focus-outline-color": "var(--focus-outline-color)",
306
+ "--focus-outline-offset": "var(--focus-outline-offset)",
307
+ __varGroupHash__: "xzxs3qz"
308
+ };
309
+
287
310
  // =============================================================================
288
311
  // Radius Tokens
289
312
  // =============================================================================
@@ -0,0 +1,122 @@
1
+ /**
2
+ * @file focusOutline.stylex.ts
3
+ * @input Uses StyleX and theme color tokens
4
+ * @output Exports shared focus-outline prop builders
5
+ * @position Internal utility for consistent keyboard focus outlines across core components
6
+ *
7
+ * Centralizes the standard Astryx focus outline, shown only for keyboard focus.
8
+ * Every focusable surface drew the same 2px accent ring already; writing it per
9
+ * component meant dozens of identical definitions to keep in step, and they did
10
+ * not stay in step — offsets drifted and one ring was a border-width thick.
11
+ *
12
+ * Every ring in core and lab is drawn from here, with one exception recorded in
13
+ * Switch: its condition is a component-scoped ancestor marker, which cannot be
14
+ * shared without leaking focus state between components. A component may still
15
+ * override the OFFSET (a ring that must sit inset, or clear of a field border);
16
+ * width, style and color are not restated anywhere.
17
+ *
18
+ * Every value comes from the `--focus-outline-*` tokens, which is how a theme
19
+ * restyles the ring: one override reaches every component at once. The
20
+ * `:focus-visible` condition is not themeable and stays here, so a theme can
21
+ * change what the ring looks like but cannot show it to pointer users.
22
+ */
23
+ import * as stylex from '@stylexjs/stylex';
24
+ /**
25
+ * The ring as a single `outline` value, for reading it at runtime — an
26
+ * assertion, or an element styled imperatively.
27
+ *
28
+ * NOT usable inside another file's `stylex.create`: StyleX resolves imported
29
+ * `defineVars` and nothing else, so a component whose condition
30
+ * {@link focusOutlineStyles} cannot express (Switch, whose ring keys off a
31
+ * component-scoped ancestor marker) has to compose the `focusVars` tokens
32
+ * itself.
33
+ */
34
+ export declare const FOCUS_OUTLINE: string;
35
+ /**
36
+ * The standard focus ring as plain CSS values, for the one case that has to
37
+ * apply it imperatively: a control whose focusable input is visually hidden and
38
+ * whose ring must land on a *themeable indicator* beside it (see
39
+ * `useIndicatorFocusRing`). Everything else should use the styles above.
40
+ *
41
+ * Longhands, not the `outline` shorthand, for the same reason the styles are:
42
+ * a shorthand resets every longhand it covers, so a caller could not re-color
43
+ * the ring without restating its width and style. Split, each part is
44
+ * independently overridable — and every part stays a var, so a theme's
45
+ * `--focus-outline-*` overrides still flow through.
46
+ *
47
+ * Keys are camelCase to match `HTMLElement.style`, so this spreads straight
48
+ * onto an element:
49
+ *
50
+ * ```ts
51
+ * Object.assign(el.style, FOCUS_OUTLINE_PARTS); // draw
52
+ * Object.assign(el.style, FOCUS_OUTLINE_PARTS_NONE); // clear
53
+ * ```
54
+ */
55
+ export declare const FOCUS_OUTLINE_PARTS: {
56
+ readonly outlineWidth: stylex.StyleXVar<"2px">;
57
+ readonly outlineStyle: stylex.StyleXVar<"solid">;
58
+ readonly outlineColor: stylex.StyleXVar<"var(--color-accent)">;
59
+ readonly outlineOffset: stylex.StyleXVar<"3px">;
60
+ };
61
+ /** Clears {@link FOCUS_OUTLINE_PARTS}, one key per part so nothing lingers. */
62
+ export declare const FOCUS_OUTLINE_PARTS_NONE: {
63
+ readonly outlineWidth: "";
64
+ readonly outlineStyle: "";
65
+ readonly outlineColor: "";
66
+ readonly outlineOffset: "";
67
+ };
68
+ export declare const focusOutlineStyles: Readonly<{
69
+ readonly focusVisible: Readonly<{
70
+ readonly outlineWidth: stylex.StyleXClassNameFor<"outlineWidth", "0" | "2px">;
71
+ readonly outlineStyle: stylex.StyleXClassNameFor<"outlineStyle", "none" | "solid">;
72
+ readonly outlineColor: stylex.StyleXClassNameFor<"outlineColor", "var(--color-accent)" | null>;
73
+ readonly outlineOffset: stylex.StyleXClassNameFor<"outlineOffset", "0" | "3px">;
74
+ }>;
75
+ readonly focusWithin: Readonly<{
76
+ readonly outlineWidth: stylex.StyleXClassNameFor<"outlineWidth", "0" | "2px">;
77
+ readonly outlineStyle: stylex.StyleXClassNameFor<"outlineStyle", "none" | "solid">;
78
+ readonly outlineColor: stylex.StyleXClassNameFor<"outlineColor", "var(--color-accent)" | null>;
79
+ readonly outlineOffset: stylex.StyleXClassNameFor<"outlineOffset", "0" | "3px">;
80
+ }>;
81
+ readonly publishFocusVisibleVars: Readonly<{
82
+ readonly '--_focus-outline': stylex.StyleXClassNameFor<"--_focus-outline", string>;
83
+ readonly '--_focus-outline-offset': stylex.StyleXClassNameFor<"--_focus-outline-offset", "0" | "3px">;
84
+ }>;
85
+ readonly focusWithinOrPublished: Readonly<{
86
+ readonly outline: stylex.StyleXClassNameFor<"outline", string>;
87
+ readonly outlineOffset: stylex.StyleXClassNameFor<"outlineOffset", "3px" | "var(--_focus-outline-offset, 0)">;
88
+ }>;
89
+ }>;
90
+ type StyleXPropsArg = unknown;
91
+ export declare const focusOutlineProps: {
92
+ readonly focusVisible: (...styles: StyleXPropsArg[]) => Readonly<{
93
+ className?: string;
94
+ 'data-style-src'?: string;
95
+ style?: Readonly<{
96
+ [$$Key$$: string]: string | number;
97
+ }>;
98
+ }>;
99
+ readonly focusWithin: (...styles: StyleXPropsArg[]) => Readonly<{
100
+ className?: string;
101
+ 'data-style-src'?: string;
102
+ style?: Readonly<{
103
+ [$$Key$$: string]: string | number;
104
+ }>;
105
+ }>;
106
+ readonly publishFocusVisibleVars: (...styles: StyleXPropsArg[]) => Readonly<{
107
+ className?: string;
108
+ 'data-style-src'?: string;
109
+ style?: Readonly<{
110
+ [$$Key$$: string]: string | number;
111
+ }>;
112
+ }>;
113
+ readonly focusWithinOrPublished: (...styles: StyleXPropsArg[]) => Readonly<{
114
+ className?: string;
115
+ 'data-style-src'?: string;
116
+ style?: Readonly<{
117
+ [$$Key$$: string]: string | number;
118
+ }>;
119
+ }>;
120
+ };
121
+ export {};
122
+ //# sourceMappingURL=focusOutline.stylex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"focusOutline.stylex.d.ts","sourceRoot":"","sources":["../../src/utils/focusOutline.stylex.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAS3C;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,QAAyE,CAAC;AAgBpG;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,mBAAmB;;;;;CAKtB,CAAC;AAEX,+EAA+E;AAC/E,eAAO,MAAM,wBAAwB;;;;;CAK3B,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;EAmD7B,CAAC;AAIH,KAAK,cAAc,GAAG,OAAO,CAAC;AAiB9B,eAAO,MAAM,iBAAiB;uCAdT,cAAc,EAAE;;;;;;;sCAAhB,cAAc,EAAE;;;;;;;kDAAhB,cAAc,EAAE;;;;;;;iDAAhB,cAAc,EAAE;;;;;;;CAuB3B,CAAC"}
@@ -0,0 +1,143 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @file focusOutline.stylex.ts
5
+ * @input Uses StyleX and theme color tokens
6
+ * @output Exports shared focus-outline prop builders
7
+ * @position Internal utility for consistent keyboard focus outlines across core components
8
+ *
9
+ * Centralizes the standard Astryx focus outline, shown only for keyboard focus.
10
+ * Every focusable surface drew the same 2px accent ring already; writing it per
11
+ * component meant dozens of identical definitions to keep in step, and they did
12
+ * not stay in step — offsets drifted and one ring was a border-width thick.
13
+ *
14
+ * Every ring in core and lab is drawn from here, with one exception recorded in
15
+ * Switch: its condition is a component-scoped ancestor marker, which cannot be
16
+ * shared without leaking focus state between components. A component may still
17
+ * override the OFFSET (a ring that must sit inset, or clear of a field border);
18
+ * width, style and color are not restated anywhere.
19
+ *
20
+ * Every value comes from the `--focus-outline-*` tokens, which is how a theme
21
+ * restyles the ring: one override reaches every component at once. The
22
+ * `:focus-visible` condition is not themeable and stays here, so a theme can
23
+ * change what the ring looks like but cannot show it to pointer users.
24
+ */
25
+
26
+ import * as stylex from '@stylexjs/stylex';
27
+ import "../theme/tokens.stylex.js";
28
+ import { focusVars } from "../theme/tokens.stylex.js";
29
+ const FOCUS_OUTLINE_WIDTH = focusVars['--focus-outline-width'];
30
+ const FOCUS_OUTLINE_STYLE = focusVars['--focus-outline-style'];
31
+ const FOCUS_OUTLINE_COLOR = focusVars['--focus-outline-color'];
32
+ const FOCUS_OUTLINE_OFFSET = focusVars['--focus-outline-offset'];
33
+
34
+ /**
35
+ * The ring as a single `outline` value, for reading it at runtime — an
36
+ * assertion, or an element styled imperatively.
37
+ *
38
+ * NOT usable inside another file's `stylex.create`: StyleX resolves imported
39
+ * `defineVars` and nothing else, so a component whose condition
40
+ * {@link focusOutlineStyles} cannot express (Switch, whose ring keys off a
41
+ * component-scoped ancestor marker) has to compose the `focusVars` tokens
42
+ * itself.
43
+ */
44
+ export const FOCUS_OUTLINE = `${FOCUS_OUTLINE_WIDTH} ${FOCUS_OUTLINE_STYLE} ${FOCUS_OUTLINE_COLOR}`;
45
+
46
+ /**
47
+ * Written as longhands rather than the `outline` shorthand.
48
+ *
49
+ * A shorthand resets every longhand it covers, so `outline: 2px solid accent`
50
+ * would clobber a later `outlineColor` no matter the order — which is how
51
+ * destructive buttons silently lost their red ring. With longhands, a variant
52
+ * can re-color the ring and inherit width, style and offset.
53
+ */
54
+ const focusOutlineLonghands = {
55
+ outlineWidth: FOCUS_OUTLINE_WIDTH,
56
+ outlineStyle: FOCUS_OUTLINE_STYLE,
57
+ outlineColor: FOCUS_OUTLINE_COLOR
58
+ };
59
+
60
+ /**
61
+ * The standard focus ring as plain CSS values, for the one case that has to
62
+ * apply it imperatively: a control whose focusable input is visually hidden and
63
+ * whose ring must land on a *themeable indicator* beside it (see
64
+ * `useIndicatorFocusRing`). Everything else should use the styles above.
65
+ *
66
+ * Longhands, not the `outline` shorthand, for the same reason the styles are:
67
+ * a shorthand resets every longhand it covers, so a caller could not re-color
68
+ * the ring without restating its width and style. Split, each part is
69
+ * independently overridable — and every part stays a var, so a theme's
70
+ * `--focus-outline-*` overrides still flow through.
71
+ *
72
+ * Keys are camelCase to match `HTMLElement.style`, so this spreads straight
73
+ * onto an element:
74
+ *
75
+ * ```ts
76
+ * Object.assign(el.style, FOCUS_OUTLINE_PARTS); // draw
77
+ * Object.assign(el.style, FOCUS_OUTLINE_PARTS_NONE); // clear
78
+ * ```
79
+ */
80
+ export const FOCUS_OUTLINE_PARTS = {
81
+ outlineWidth: FOCUS_OUTLINE_WIDTH,
82
+ outlineStyle: FOCUS_OUTLINE_STYLE,
83
+ outlineColor: FOCUS_OUTLINE_COLOR,
84
+ outlineOffset: FOCUS_OUTLINE_OFFSET
85
+ };
86
+
87
+ /** Clears {@link FOCUS_OUTLINE_PARTS}, one key per part so nothing lingers. */
88
+ export const FOCUS_OUTLINE_PARTS_NONE = {
89
+ outlineWidth: '',
90
+ outlineStyle: '',
91
+ outlineColor: '',
92
+ outlineOffset: ''
93
+ };
94
+ export const focusOutlineStyles = {
95
+ focusVisible: {
96
+ kMeerF: "x1k57tk5 x1vidyx5",
97
+ k3XXqK: "x1t137rt x1jhp3zv",
98
+ kjBf7l: "xx47ajj",
99
+ kInvED: "x1wfwxd8 x1vwwbsn",
100
+ $$css: true
101
+ },
102
+ focusWithin: {
103
+ kMeerF: "x1k57tk5 x11j6mr8",
104
+ k3XXqK: "x1t137rt xciu248",
105
+ kjBf7l: "x1uy843r",
106
+ kInvED: "x1wfwxd8 x1jumodi",
107
+ $$css: true
108
+ },
109
+ publishFocusVisibleVars: {
110
+ "--_focus-outline": "x17wzz1v xqih627",
111
+ "--_focus-outline-offset": "xgzxwq1 xqchwus",
112
+ $$css: true
113
+ },
114
+ focusWithinOrPublished: {
115
+ kI3sdo: "xaw4jrz x16s19ga",
116
+ kInvED: "x1kvmbwa x1jumodi",
117
+ $$css: true
118
+ }
119
+ };
120
+
121
+ // StyleX does not expose a stable public input type for stylex.props();
122
+ // keep this helper permissive so it mirrors stylex.props() itself.
123
+
124
+ function makeFocusOutlineProps(style) {
125
+ return (...styles) =>
126
+ // Caller styles LAST, so a component can deliberately re-color its ring —
127
+ // destructive buttons ring in error red, not accent. StyleX is last-wins,
128
+ // and reversing this to protect the ring silently ate that override.
129
+ //
130
+ // The hazard in this direction is the opposite one: a caller whose base
131
+ // style carries `outline: 'none'` wipes the ring out entirely (TreeList
132
+ // did, and shipped a focusable row with no visible focus). Two things
133
+ // guard it — this file states the rule, and the ring is written as
134
+ // LONGHANDS, so an override has to name `outlineStyle`/`outlineWidth`
135
+ // explicitly rather than erasing them through the `outline` shorthand.
136
+ stylex.props(style, ...styles);
137
+ }
138
+ export const focusOutlineProps = {
139
+ focusVisible: makeFocusOutlineProps(focusOutlineStyles.focusVisible),
140
+ focusWithin: makeFocusOutlineProps(focusOutlineStyles.focusWithin),
141
+ publishFocusVisibleVars: makeFocusOutlineProps(focusOutlineStyles.publishFocusVisibleVars),
142
+ focusWithinOrPublished: makeFocusOutlineProps(focusOutlineStyles.focusWithinOrPublished)
143
+ };
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @file focusReturn.ts
3
+ * @input The document's current active element.
4
+ * @output Whether focus is currently "detached" — on nothing in particular.
5
+ * @position Utility; used by overlay triggers (e.g. DateInput, DateTimeInput)
6
+ * that return focus to their control when the overlay closes, but only when
7
+ * the dismiss did not already move focus somewhere the user chose.
8
+ */
9
+ /**
10
+ * True when focus rests on nothing in particular — no active element, or the
11
+ * document body / root element.
12
+ *
13
+ * An overlay (popover, calendar, dropdown) that restores focus to its trigger
14
+ * on close should do so ONLY when this is true. A native `popover="auto"`
15
+ * light-dismiss fires its close synchronously with the pointer event that
16
+ * moved focus, so by the time the close handler runs, focus has already
17
+ * landed on whatever the user clicked — another field, a button, anywhere.
18
+ * Restoring focus unconditionally would yank it back and fight that click.
19
+ * The one case the browser leaves unresolved is Escape or a click on
20
+ * non-focusable empty space, which drops focus to the body; that is exactly
21
+ * when the trigger should reclaim it.
22
+ */
23
+ export declare function isFocusDetached(doc?: Document): boolean;
24
+ //# sourceMappingURL=focusReturn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"focusReturn.d.ts","sourceRoot":"","sources":["../../src/utils/focusReturn.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,GAAG,GAAE,QAAmB,GAAG,OAAO,CAKjE"}
@@ -0,0 +1,29 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @file focusReturn.ts
5
+ * @input The document's current active element.
6
+ * @output Whether focus is currently "detached" — on nothing in particular.
7
+ * @position Utility; used by overlay triggers (e.g. DateInput, DateTimeInput)
8
+ * that return focus to their control when the overlay closes, but only when
9
+ * the dismiss did not already move focus somewhere the user chose.
10
+ */
11
+
12
+ /**
13
+ * True when focus rests on nothing in particular — no active element, or the
14
+ * document body / root element.
15
+ *
16
+ * An overlay (popover, calendar, dropdown) that restores focus to its trigger
17
+ * on close should do so ONLY when this is true. A native `popover="auto"`
18
+ * light-dismiss fires its close synchronously with the pointer event that
19
+ * moved focus, so by the time the close handler runs, focus has already
20
+ * landed on whatever the user clicked — another field, a button, anywhere.
21
+ * Restoring focus unconditionally would yank it back and fight that click.
22
+ * The one case the browser leaves unresolved is Escape or a click on
23
+ * non-focusable empty space, which drops focus to the body; that is exactly
24
+ * when the trigger should reclaim it.
25
+ */
26
+ export function isFocusDetached(doc = document) {
27
+ const active = doc.activeElement;
28
+ return active == null || active === doc.body || active === doc.documentElement;
29
+ }
@@ -15,6 +15,7 @@ export { parseStyleKey } from './parseStyleKey';
15
15
  export { getKey, type Key, type KeyFallback } from './getKey';
16
16
  export { mergeProps } from './mergeProps';
17
17
  export { mergeRefs } from './mergeRefs';
18
+ export { isFocusDetached } from './focusReturn';
18
19
  export { composeEventHandlers } from './composeEventHandlers';
19
20
  export { themeProps, themeDataAttributes } from './themeProps';
20
21
  export type { ClassValue, ClassProps, ThemeDataAttributes, ThemeProps, } from './themeProps';
@@ -28,4 +29,5 @@ export { parseHex, parseRgb, parseColor, formatHex, formatColor, toGLFloats, } f
28
29
  export type { RGBA } from './color';
29
30
  export { devWarn, devError, warnOnce, formatDevMessage } from './devWarning';
30
31
  export { rtlStyles } from './rtlStyles';
32
+ export { focusOutlineStyles, focusOutlineProps } from './focusOutline.stylex';
31
33
  //# sourceMappingURL=index.d.ts.map