@astryxdesign/core 0.0.15 → 0.1.0-canary.08d4cf4

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 (384) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/README.md +8 -10
  3. package/dist/AlertDialog/AlertDialog.js +2 -2
  4. package/dist/AppShell/AppShell.js +5 -5
  5. package/dist/AspectRatio/AspectRatio.js +2 -2
  6. package/dist/Avatar/Avatar.js +2 -2
  7. package/dist/Avatar/AvatarStatusDot.js +2 -2
  8. package/dist/AvatarGroup/AvatarGroup.js +2 -2
  9. package/dist/AvatarGroup/AvatarGroupOverflow.js +3 -3
  10. package/dist/Badge/Badge.js +2 -2
  11. package/dist/Banner/Banner.d.ts +2 -2
  12. package/dist/Banner/Banner.js +6 -6
  13. package/dist/Blockquote/Blockquote.js +2 -2
  14. package/dist/Breadcrumbs/BreadcrumbItem.js +3 -3
  15. package/dist/Breadcrumbs/Breadcrumbs.js +2 -2
  16. package/dist/Button/Button.js +2 -2
  17. package/dist/ButtonGroup/ButtonGroup.js +2 -2
  18. package/dist/Calendar/Calendar.js +3 -3
  19. package/dist/Card/Card.js +2 -2
  20. package/dist/Carousel/Carousel.js +2 -2
  21. package/dist/Center/Center.js +2 -2
  22. package/dist/Chat/ChatComposer.js +2 -2
  23. package/dist/Chat/ChatComposerDrawer.js +2 -2
  24. package/dist/Chat/ChatComposerInput.js +2 -2
  25. package/dist/Chat/ChatLayout.js +2 -2
  26. package/dist/Chat/ChatLayoutScrollButton.d.ts.map +1 -1
  27. package/dist/Chat/ChatLayoutScrollButton.js +5 -1
  28. package/dist/Chat/ChatMessage.js +2 -2
  29. package/dist/Chat/ChatMessageBubble.js +2 -2
  30. package/dist/Chat/ChatMessageList.js +2 -2
  31. package/dist/Chat/ChatMessageMetadata.js +2 -2
  32. package/dist/Chat/ChatSendButton.js +2 -2
  33. package/dist/Chat/ChatSystemMessage.js +3 -3
  34. package/dist/Chat/ChatTokenizedText.js +3 -3
  35. package/dist/Chat/ChatToolCalls.js +3 -3
  36. package/dist/Chat/useTriggerMenu.js +2 -2
  37. package/dist/CheckboxInput/CheckboxInput.js +3 -3
  38. package/dist/CheckboxList/CheckboxList.js +2 -2
  39. package/dist/Citation/Citation.js +3 -3
  40. package/dist/ClickableCard/ClickableCard.js +2 -2
  41. package/dist/Code/Code.js +2 -2
  42. package/dist/CodeBlock/CodeBlock.js +2 -2
  43. package/dist/Collapsible/Collapsible.js +2 -2
  44. package/dist/CommandPalette/CommandPaletteFooter.js +2 -2
  45. package/dist/CommandPalette/CommandPaletteGroup.js +2 -2
  46. package/dist/CommandPalette/CommandPaletteInput.js +2 -2
  47. package/dist/CommandPalette/CommandPaletteItem.js +2 -2
  48. package/dist/CommandPalette/CommandPaletteList.js +2 -2
  49. package/dist/ContextMenu/ContextMenu.js +4 -4
  50. package/dist/DateInput/DateInput.js +2 -2
  51. package/dist/DateRangeInput/DateRangeInput.js +2 -2
  52. package/dist/DateTimeInput/DateTimeInput.js +2 -2
  53. package/dist/Dialog/Dialog.js +3 -3
  54. package/dist/Divider/Divider.js +2 -2
  55. package/dist/DropdownMenu/DropdownMenu.js +4 -4
  56. package/dist/DropdownMenu/DropdownMenuItem.js +2 -2
  57. package/dist/DropdownMenu/{renderXDSDropdownItems.d.ts → renderDropdownItems.d.ts} +3 -3
  58. package/dist/DropdownMenu/renderDropdownItems.d.ts.map +1 -0
  59. package/dist/DropdownMenu/{renderXDSDropdownItems.js → renderDropdownItems.js} +2 -2
  60. package/dist/EmptyState/EmptyState.js +2 -2
  61. package/dist/Field/Field.js +3 -3
  62. package/dist/Field/FieldLabel.js +2 -2
  63. package/dist/FieldStatus/FieldStatus.js +2 -2
  64. package/dist/FileInput/FileInput.js +2 -2
  65. package/dist/FormLayout/FormLayout.js +2 -2
  66. package/dist/Grid/Grid.js +3 -3
  67. package/dist/Grid/GridSpan.js +2 -2
  68. package/dist/Heading/Heading.js +2 -2
  69. package/dist/HoverCard/useHoverCard.js +2 -2
  70. package/dist/Icon/Icon.js +3 -3
  71. package/dist/InputGroup/InputGroup.js +2 -2
  72. package/dist/InputGroup/InputGroupText.js +2 -2
  73. package/dist/Item/Item.js +2 -2
  74. package/dist/Kbd/Kbd.js +2 -2
  75. package/dist/Layer/useLayer.d.ts +2 -2
  76. package/dist/Layout/Layout.js +2 -2
  77. package/dist/Layout/LayoutContent.js +2 -2
  78. package/dist/Layout/LayoutFooter.js +2 -2
  79. package/dist/Layout/LayoutHeader.js +2 -2
  80. package/dist/Layout/LayoutPanel.js +2 -2
  81. package/dist/Lightbox/Lightbox.js +2 -2
  82. package/dist/Link/Link.js +3 -3
  83. package/dist/List/List.js +2 -2
  84. package/dist/List/ListItem.js +2 -2
  85. package/dist/Markdown/Markdown.js +3 -3
  86. package/dist/MetadataList/MetadataList.js +2 -2
  87. package/dist/MetadataList/MetadataListItem.js +3 -3
  88. package/dist/MobileNav/MobileNav.js +2 -2
  89. package/dist/MultiSelector/MultiSelector.js +2 -2
  90. package/dist/NavIcon/NavIcon.js +2 -2
  91. package/dist/NavMenu/NavHeadingMenu.js +2 -2
  92. package/dist/NavMenu/NavHeadingMenuItem.js +2 -2
  93. package/dist/NumberInput/NumberInput.js +2 -2
  94. package/dist/Outline/Outline.d.ts +3 -2
  95. package/dist/Outline/Outline.d.ts.map +1 -1
  96. package/dist/Outline/Outline.js +27 -8
  97. package/dist/Outline/useScrollSpy.d.ts +14 -1
  98. package/dist/Outline/useScrollSpy.d.ts.map +1 -1
  99. package/dist/Outline/useScrollSpy.js +161 -50
  100. package/dist/OverflowList/OverflowList.js +2 -2
  101. package/dist/Overlay/Overlay.js +2 -2
  102. package/dist/Overlay/OverlayScrim.js +2 -2
  103. package/dist/Pagination/Pagination.js +3 -3
  104. package/dist/Popover/Popover.js +4 -4
  105. package/dist/PowerSearch/PowerSearch.js +2 -2
  106. package/dist/ProgressBar/ProgressBar.js +5 -5
  107. package/dist/RadioList/RadioList.js +2 -2
  108. package/dist/RadioList/RadioListItem.js +4 -4
  109. package/dist/Resizable/ResizeHandle.js +4 -4
  110. package/dist/Resizable/useResizable.d.ts.map +1 -1
  111. package/dist/Resizable/useResizable.js +1 -5
  112. package/dist/Section/Section.js +2 -2
  113. package/dist/SegmentedControl/SegmentedControl.js +2 -2
  114. package/dist/SegmentedControl/SegmentedControlItem.js +2 -2
  115. package/dist/SelectableCard/SelectableCard.js +2 -2
  116. package/dist/Selector/Selector.d.ts.map +1 -1
  117. package/dist/Selector/Selector.js +3 -3
  118. package/dist/Selector/SelectorOption.js +2 -2
  119. package/dist/SideNav/SideNav.js +3 -3
  120. package/dist/SideNav/SideNavHeading.js +9 -9
  121. package/dist/SideNav/SideNavItem.js +3 -3
  122. package/dist/SideNav/SideNavSection.js +2 -2
  123. package/dist/Skeleton/Skeleton.js +2 -2
  124. package/dist/Slider/Slider.js +4 -4
  125. package/dist/Spinner/Spinner.js +3 -3
  126. package/dist/Stack/Stack.js +2 -2
  127. package/dist/Stack/StackItem.js +2 -2
  128. package/dist/StatusDot/StatusDot.js +2 -2
  129. package/dist/Switch/Switch.js +4 -4
  130. package/dist/TabList/Tab.js +3 -3
  131. package/dist/TabList/TabList.js +2 -2
  132. package/dist/TabList/TabMenu.js +5 -5
  133. package/dist/Table/BaseTable.js +2 -2
  134. package/dist/Table/Table.js +3 -3
  135. package/dist/Table/TableBody.js +2 -2
  136. package/dist/Table/TableCell.js +3 -3
  137. package/dist/Table/TableFooter.js +2 -2
  138. package/dist/Table/TableHeader.js +2 -2
  139. package/dist/Table/TableHeaderCell.js +3 -3
  140. package/dist/Table/TableRow.js +3 -3
  141. package/dist/Text/Text.js +2 -2
  142. package/dist/TextArea/TextArea.js +2 -2
  143. package/dist/TextInput/TextInput.js +2 -2
  144. package/dist/Thumbnail/Thumbnail.js +2 -2
  145. package/dist/TimeInput/TimeInput.js +2 -2
  146. package/dist/Timestamp/Timestamp.js +2 -2
  147. package/dist/Toast/Toast.js +2 -2
  148. package/dist/ToggleButton/ToggleButton.d.ts +10 -3
  149. package/dist/ToggleButton/ToggleButton.d.ts.map +1 -1
  150. package/dist/ToggleButton/ToggleButton.js +66 -20
  151. package/dist/ToggleButton/ToggleButtonGroup.js +2 -2
  152. package/dist/Token/Token.js +4 -4
  153. package/dist/Tokenizer/Tokenizer.js +3 -3
  154. package/dist/Toolbar/Toolbar.js +2 -2
  155. package/dist/Tooltip/useTooltip.js +2 -2
  156. package/dist/TopNav/TopNav.js +3 -3
  157. package/dist/TopNav/TopNavHeading.js +7 -7
  158. package/dist/TopNav/TopNavItem.js +3 -3
  159. package/dist/TopNav/TopNavMegaMenu.js +3 -3
  160. package/dist/TopNav/TopNavMegaMenuFeaturedCard.js +2 -2
  161. package/dist/TopNav/TopNavMegaMenuItem.js +3 -3
  162. package/dist/TopNav/TopNavMenu.js +2 -2
  163. package/dist/TreeList/TreeList.js +2 -2
  164. package/dist/TreeList/TreeListItem.js +2 -2
  165. package/dist/Typeahead/BaseTypeahead.js +2 -2
  166. package/dist/Typeahead/Typeahead.js +2 -2
  167. package/dist/Typeahead/TypeaheadItem.js +2 -2
  168. package/dist/docs-types.d.ts +3 -3
  169. package/dist/docs-types.d.ts.map +1 -1
  170. package/dist/naming.d.ts +1 -1
  171. package/dist/naming.js +1 -1
  172. package/dist/theme/Theme.js +1 -1
  173. package/dist/theme/defineTheme.d.ts +3 -3
  174. package/dist/theme/defineTheme.d.ts.map +1 -1
  175. package/dist/theme/defineTheme.js +1 -1
  176. package/dist/theme/index.d.ts +2 -2
  177. package/dist/theme/index.d.ts.map +1 -1
  178. package/dist/theme/index.js +2 -2
  179. package/dist/theme/syntax/defineSyntaxTheme.js +1 -1
  180. package/dist/theme/tokens.d.ts +1 -1
  181. package/dist/theme/tokens.js +4 -4
  182. package/dist/theme/useTheme.d.ts +2 -2
  183. package/dist/utils/dateParser.d.ts.map +1 -1
  184. package/dist/utils/dateParser.js +15 -2
  185. package/dist/utils/mergeProps.d.ts +3 -3
  186. package/dist/utils/mergeProps.js +4 -4
  187. package/dist/utils/parseStyleKey.d.ts +2 -2
  188. package/dist/utils/parseStyleKey.js +2 -2
  189. package/dist/utils/{xdsThemeProps.d.ts → themeProps.d.ts} +4 -4
  190. package/dist/utils/themeProps.d.ts.map +1 -0
  191. package/dist/utils/{xdsThemeProps.js → themeProps.js} +5 -5
  192. package/package.json +2 -2
  193. package/src/AlertDialog/AlertDialog.tsx +2 -2
  194. package/src/AppShell/AppShell.tsx +5 -5
  195. package/src/AspectRatio/AspectRatio.tsx +2 -2
  196. package/src/Avatar/Avatar.tsx +2 -2
  197. package/src/Avatar/AvatarStatusDot.tsx +2 -2
  198. package/src/AvatarGroup/AvatarGroup.tsx +2 -2
  199. package/src/AvatarGroup/AvatarGroupOverflow.tsx +3 -3
  200. package/src/Badge/Badge.tsx +2 -2
  201. package/src/Banner/Banner.tsx +6 -6
  202. package/src/Blockquote/Blockquote.tsx +2 -2
  203. package/src/Breadcrumbs/BreadcrumbItem.tsx +3 -3
  204. package/src/Breadcrumbs/Breadcrumbs.tsx +2 -2
  205. package/src/Button/Button.tsx +2 -2
  206. package/src/ButtonGroup/ButtonGroup.tsx +2 -2
  207. package/src/Calendar/Calendar.tsx +3 -3
  208. package/src/Card/Card.tsx +2 -2
  209. package/src/Carousel/Carousel.tsx +2 -2
  210. package/src/Center/Center.tsx +2 -2
  211. package/src/Chat/ChatComposer.tsx +2 -2
  212. package/src/Chat/ChatComposerDrawer.tsx +2 -2
  213. package/src/Chat/ChatComposerInput.tsx +2 -2
  214. package/src/Chat/ChatLayout.tsx +2 -2
  215. package/src/Chat/ChatLayoutScrollButton.tsx +7 -1
  216. package/src/Chat/ChatMessage.tsx +2 -2
  217. package/src/Chat/ChatMessageBubble.tsx +2 -2
  218. package/src/Chat/ChatMessageList.tsx +2 -2
  219. package/src/Chat/ChatMessageMetadata.tsx +2 -2
  220. package/src/Chat/ChatSendButton.tsx +2 -2
  221. package/src/Chat/ChatSystemMessage.tsx +3 -3
  222. package/src/Chat/ChatTokenizedText.tsx +3 -3
  223. package/src/Chat/ChatToolCalls.tsx +3 -3
  224. package/src/Chat/useTriggerMenu.tsx +2 -2
  225. package/src/CheckboxInput/CheckboxInput.tsx +3 -3
  226. package/src/CheckboxList/CheckboxList.tsx +2 -2
  227. package/src/Citation/Citation.tsx +3 -3
  228. package/src/ClickableCard/ClickableCard.tsx +2 -2
  229. package/src/Code/Code.tsx +2 -2
  230. package/src/CodeBlock/CodeBlock.tsx +2 -2
  231. package/src/Collapsible/Collapsible.tsx +2 -2
  232. package/src/Collapsible/useCollapsible.doc.mjs +2 -2
  233. package/src/CommandPalette/CommandPaletteFooter.tsx +2 -2
  234. package/src/CommandPalette/CommandPaletteGroup.tsx +2 -2
  235. package/src/CommandPalette/CommandPaletteInput.tsx +2 -2
  236. package/src/CommandPalette/CommandPaletteItem.tsx +2 -2
  237. package/src/CommandPalette/CommandPaletteList.tsx +2 -2
  238. package/src/ContextMenu/ContextMenu.tsx +4 -4
  239. package/src/DateInput/DateInput.test.tsx +68 -20
  240. package/src/DateInput/DateInput.tsx +2 -2
  241. package/src/DateRangeInput/DateRangeInput.tsx +2 -2
  242. package/src/DateTimeInput/DateTimeInput.tsx +2 -2
  243. package/src/Dialog/Dialog.tsx +3 -3
  244. package/src/Divider/Divider.doc.mjs +1 -1
  245. package/src/Divider/Divider.tsx +2 -2
  246. package/src/DropdownMenu/DropdownMenu.tsx +4 -4
  247. package/src/DropdownMenu/DropdownMenuItem.tsx +2 -2
  248. package/src/DropdownMenu/{renderXDSDropdownItems.tsx → renderDropdownItems.tsx} +2 -2
  249. package/src/EmptyState/EmptyState.tsx +2 -2
  250. package/src/Field/Field.tsx +3 -3
  251. package/src/Field/FieldLabel.tsx +2 -2
  252. package/src/FieldStatus/FieldStatus.tsx +2 -2
  253. package/src/FileInput/FileInput.tsx +2 -2
  254. package/src/FormLayout/FormLayout.doc.mjs +3 -3
  255. package/src/FormLayout/FormLayout.tsx +2 -2
  256. package/src/Grid/Grid.tsx +3 -3
  257. package/src/Grid/GridSpan.tsx +2 -2
  258. package/src/Heading/Heading.tsx +2 -2
  259. package/src/HoverCard/useHoverCard.tsx +2 -2
  260. package/src/Icon/Icon.doc.mjs +4 -4
  261. package/src/Icon/Icon.tsx +3 -3
  262. package/src/InputGroup/InputGroup.tsx +2 -2
  263. package/src/InputGroup/InputGroupText.tsx +2 -2
  264. package/src/Item/Item.doc.mjs +2 -2
  265. package/src/Item/Item.tsx +2 -2
  266. package/src/Kbd/Kbd.tsx +2 -2
  267. package/src/Layer/useLayer.tsx +2 -2
  268. package/src/Layout/Layout.tsx +2 -2
  269. package/src/Layout/LayoutContent.tsx +2 -2
  270. package/src/Layout/LayoutFooter.tsx +2 -2
  271. package/src/Layout/LayoutHeader.tsx +2 -2
  272. package/src/Layout/LayoutPanel.tsx +2 -2
  273. package/src/Lightbox/Lightbox.tsx +2 -2
  274. package/src/Link/Link.doc.mjs +3 -3
  275. package/src/Link/Link.tsx +3 -3
  276. package/src/Link/LinkProvider.doc.mjs +3 -3
  277. package/src/List/List.tsx +2 -2
  278. package/src/List/ListItem.tsx +2 -2
  279. package/src/Markdown/Markdown.doc.mjs +4 -4
  280. package/src/Markdown/Markdown.tsx +3 -3
  281. package/src/MetadataList/MetadataList.tsx +2 -2
  282. package/src/MetadataList/MetadataListItem.tsx +3 -3
  283. package/src/MobileNav/MobileNav.tsx +2 -2
  284. package/src/MoreMenu/MoreMenu.doc.mjs +0 -13
  285. package/src/MultiSelector/MultiSelector.tsx +2 -2
  286. package/src/NavIcon/NavIcon.tsx +2 -2
  287. package/src/NavMenu/NavHeadingMenu.tsx +2 -2
  288. package/src/NavMenu/NavHeadingMenuItem.tsx +2 -2
  289. package/src/NumberInput/NumberInput.tsx +2 -2
  290. package/src/Outline/Outline.doc.mjs +1 -1
  291. package/src/Outline/Outline.test.tsx +76 -38
  292. package/src/Outline/Outline.tsx +27 -8
  293. package/src/Outline/useScrollSpy.ts +196 -63
  294. package/src/OverflowList/OverflowList.tsx +2 -2
  295. package/src/Overlay/Overlay.tsx +2 -2
  296. package/src/Overlay/OverlayScrim.tsx +2 -2
  297. package/src/Pagination/Pagination.tsx +3 -3
  298. package/src/Popover/Popover.tsx +4 -4
  299. package/src/PowerSearch/PowerSearch.tsx +2 -2
  300. package/src/ProgressBar/ProgressBar.tsx +5 -5
  301. package/src/RadioList/RadioList.tsx +2 -2
  302. package/src/RadioList/RadioListItem.tsx +4 -4
  303. package/src/Resizable/Resizable.doc.mjs +2 -2
  304. package/src/Resizable/ResizeHandle.tsx +4 -4
  305. package/src/Resizable/useResizable.ts +1 -7
  306. package/src/Section/Section.tsx +2 -2
  307. package/src/SegmentedControl/SegmentedControl.tsx +2 -2
  308. package/src/SegmentedControl/SegmentedControlItem.tsx +2 -2
  309. package/src/SelectableCard/SelectableCard.tsx +2 -2
  310. package/src/Selector/Selector.tsx +7 -8
  311. package/src/Selector/SelectorOption.tsx +2 -2
  312. package/src/SideNav/SideNav.tsx +3 -3
  313. package/src/SideNav/SideNavHeading.tsx +9 -9
  314. package/src/SideNav/SideNavItem.tsx +3 -3
  315. package/src/SideNav/SideNavSection.tsx +2 -2
  316. package/src/Skeleton/Skeleton.tsx +2 -2
  317. package/src/Slider/Slider.tsx +4 -4
  318. package/src/Spinner/Spinner.tsx +3 -3
  319. package/src/Stack/Stack.tsx +2 -2
  320. package/src/Stack/StackItem.tsx +2 -2
  321. package/src/StatusDot/StatusDot.tsx +2 -2
  322. package/src/Switch/Switch.tsx +4 -4
  323. package/src/TabList/Tab.tsx +3 -3
  324. package/src/TabList/TabList.tsx +2 -2
  325. package/src/TabList/TabMenu.tsx +5 -5
  326. package/src/Table/BaseTable.tsx +2 -2
  327. package/src/Table/Table.doc.mjs +3 -3
  328. package/src/Table/Table.tsx +3 -3
  329. package/src/Table/TableBody.tsx +2 -2
  330. package/src/Table/TableCell.tsx +3 -3
  331. package/src/Table/TableFooter.tsx +2 -2
  332. package/src/Table/TableHeader.tsx +2 -2
  333. package/src/Table/TableHeaderCell.tsx +3 -3
  334. package/src/Table/TableRow.tsx +3 -3
  335. package/src/Text/Text.tsx +2 -2
  336. package/src/TextArea/TextArea.tsx +2 -2
  337. package/src/TextInput/TextInput.tsx +2 -2
  338. package/src/Thumbnail/Thumbnail.tsx +2 -2
  339. package/src/TimeInput/TimeInput.tsx +2 -2
  340. package/src/Timestamp/Timestamp.tsx +2 -2
  341. package/src/Toast/Toast.tsx +2 -2
  342. package/src/ToggleButton/ToggleButton.doc.mjs +2 -2
  343. package/src/ToggleButton/ToggleButton.test.tsx +148 -6
  344. package/src/ToggleButton/ToggleButton.tsx +85 -22
  345. package/src/ToggleButton/ToggleButtonGroup.tsx +2 -2
  346. package/src/Token/Token.tsx +4 -4
  347. package/src/Tokenizer/Tokenizer.tsx +3 -3
  348. package/src/Toolbar/Toolbar.doc.mjs +8 -7
  349. package/src/Toolbar/Toolbar.tsx +2 -2
  350. package/src/Tooltip/useTooltip.tsx +2 -2
  351. package/src/TopNav/TopNav.tsx +3 -3
  352. package/src/TopNav/TopNavHeading.tsx +7 -7
  353. package/src/TopNav/TopNavItem.tsx +3 -3
  354. package/src/TopNav/TopNavMegaMenu.tsx +3 -3
  355. package/src/TopNav/TopNavMegaMenuFeaturedCard.tsx +2 -2
  356. package/src/TopNav/TopNavMegaMenuItem.tsx +3 -3
  357. package/src/TopNav/TopNavMenu.tsx +2 -2
  358. package/src/TreeList/TreeList.tsx +2 -2
  359. package/src/TreeList/TreeListItem.tsx +2 -2
  360. package/src/Typeahead/BaseTypeahead.tsx +2 -2
  361. package/src/Typeahead/Typeahead.tsx +2 -2
  362. package/src/Typeahead/TypeaheadItem.tsx +2 -2
  363. package/src/docs-types.ts +3 -3
  364. package/src/hooks/useEntryAnimation.doc.mjs +3 -3
  365. package/src/hooks/useMediaQuery.doc.mjs +2 -2
  366. package/src/hooks/useStreamingText.doc.mjs +3 -3
  367. package/src/naming.ts +1 -1
  368. package/src/reset.css +1 -1
  369. package/src/tailwind-theme.css +1 -1
  370. package/src/theme/Theme.doc.mjs +2 -2
  371. package/src/theme/Theme.tsx +1 -1
  372. package/src/theme/defineTheme.ts +3 -3
  373. package/src/theme/index.ts +2 -2
  374. package/src/theme/syntax/defineSyntaxTheme.ts +1 -1
  375. package/src/theme/tokens.ts +4 -4
  376. package/src/theme/useTheme.ts +2 -2
  377. package/src/utils/dateParser.test.ts +26 -0
  378. package/src/utils/dateParser.ts +16 -2
  379. package/src/utils/mergeProps.ts +4 -4
  380. package/src/utils/parseStyleKey.ts +2 -2
  381. package/src/utils/{xdsThemeProps.test.ts → themeProps.test.ts} +12 -12
  382. package/src/utils/{xdsThemeProps.ts → themeProps.ts} +5 -5
  383. package/dist/DropdownMenu/renderXDSDropdownItems.d.ts.map +0 -1
  384. package/dist/utils/xdsThemeProps.d.ts.map +0 -1
@@ -20,7 +20,7 @@ import "../theme/tokens.stylex.js";
20
20
  import { colorVars } from "../theme/tokens.stylex.js";
21
21
  import { Tooltip } from "../Tooltip/Tooltip.js";
22
22
  import { mergeProps } from "../utils/index.js";
23
- import { xdsThemeProps } from "../utils/xdsThemeProps.js";
23
+ import { themeProps } from "../utils/themeProps.js";
24
24
 
25
25
  /**
26
26
  * Pulse animation keyframes
@@ -128,7 +128,7 @@ export function StatusDot({
128
128
  ref: ref,
129
129
  role: "img",
130
130
  "aria-label": label,
131
- ...mergeProps(xdsThemeProps('statusdot', {
131
+ ...mergeProps(themeProps('statusdot', {
132
132
  variant
133
133
  }), stylex.props(styles.base, variants[variant], isPulsing && styles.pulsing, isPulsing && styles.reducedMotion, xstyle), className, style),
134
134
  ...props
@@ -25,7 +25,7 @@ import { Spinner } from "../Spinner/index.js";
25
25
  import { mergeProps } from "../utils/index.js";
26
26
  import "./switch.markers.stylex.js";
27
27
  import { switchScope } from "./switch.markers.stylex.js";
28
- import { xdsThemeProps } from "../utils/xdsThemeProps.js";
28
+ import { themeProps } from "../utils/themeProps.js";
29
29
 
30
30
  // Fixed dimensions: 40px width, 24px height, 16px thumb (off), 20px thumb (on)
31
31
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
@@ -167,7 +167,7 @@ export function Switch({
167
167
  }[!!isDisabled << 1 | !!isBusy << 0]
168
168
  }), /*#__PURE__*/_jsx("div", {
169
169
  "aria-hidden": "true",
170
- ...mergeProps(xdsThemeProps('switch', {
170
+ ...mergeProps(themeProps('switch', {
171
171
  checked: isOn ? 'checked' : null,
172
172
  disabled: isDisabled ? 'disabled' : null
173
173
  }), {
@@ -221,7 +221,7 @@ export function Switch({
221
221
  }
222
222
  }[!!isOn << 3 | !!!isDisabled << 2 | !!isDisabled << 1 | !!(isDisabled && !isOn) << 0]),
223
223
  children: /*#__PURE__*/_jsx("div", {
224
- ...mergeProps(xdsThemeProps('switch-thumb', {
224
+ ...mergeProps(themeProps('switch-thumb', {
225
225
  checked: isOn ? 'checked' : null
226
226
  }), {
227
227
  0: {
@@ -261,7 +261,7 @@ export function Switch({
261
261
  })
262
262
  });
263
263
  return /*#__PURE__*/_jsxs("div", {
264
- ...mergeProps(xdsThemeProps('switch-field', {
264
+ ...mergeProps(themeProps('switch-field', {
265
265
  labelPosition: labelPosition !== 'end' ? labelPosition : undefined,
266
266
  labelSpacing: labelSpacing !== 'default' ? labelSpacing : undefined
267
267
  }), stylex.props(width != null && dynamicWidthStyles.width(width), xstyle), className, style),
@@ -25,7 +25,7 @@ import { tabScope } from "./tab.markers.stylex.js";
25
25
  import { useLinkComponent } from "../Link/useLinkComponent.js";
26
26
  import { mergeProps } from "../utils/index.js";
27
27
  import { EDGE_COMP_ATTR } from "../Layout/edgeCompensation.stylex.js";
28
- import { xdsThemeProps } from "../utils/xdsThemeProps.js";
28
+ import { themeProps } from "../utils/themeProps.js";
29
29
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
30
30
  // =============================================================================
31
31
  // Styles
@@ -187,7 +187,7 @@ export function Tab({
187
187
  } : {}),
188
188
  [EDGE_COMP_ATTR]: '',
189
189
  'aria-current': isSelected ? 'page' : undefined,
190
- ...mergeProps(xdsThemeProps('tab', {
190
+ ...mergeProps(themeProps('tab', {
191
191
  selected: isSelected ? 'selected' : null
192
192
  }), stylex.props(styles.base, sizeStyles[size], isSelected && styles.selected, isFill && layoutStyles.fill, tabScope, xstyle), className, style)
193
193
  };
@@ -196,7 +196,7 @@ export function Tab({
196
196
  ...stylex.props(styles.hoverBg, hoverSizeStyles[size])
197
197
  });
198
198
  const indicatorElement = /*#__PURE__*/_jsx("span", {
199
- ...mergeProps(xdsThemeProps('tab-indicator', {
199
+ ...mergeProps(themeProps('tab-indicator', {
200
200
  selected: isSelected ? 'selected' : null
201
201
  }), {
202
202
  0: {
@@ -22,7 +22,7 @@ import { TabListContext } from "./TabListContext.js";
22
22
  import { useSize } from "../SizeContext/SizeContext.js";
23
23
  import { mergeProps } from "../utils/index.js";
24
24
  import { EDGE_COMP_ATTR } from "../Layout/edgeCompensation.stylex.js";
25
- import { xdsThemeProps } from "../utils/xdsThemeProps.js";
25
+ import { themeProps } from "../utils/themeProps.js";
26
26
  import { jsx as _jsx } from "react/jsx-runtime";
27
27
  const styles = {
28
28
  nav: {
@@ -88,7 +88,7 @@ export function TabList({
88
88
  "aria-label": "Tabs",
89
89
  [EDGE_COMP_ATTR]: '',
90
90
  ...restProps,
91
- ...mergeProps(xdsThemeProps('tab-list', {
91
+ ...mergeProps(themeProps('tab-list', {
92
92
  size
93
93
  }), stylex.props(styles.nav, layout === 'fill' && styles.fill, hasDivider && styles.divider, xstyle), className, style),
94
94
  children: children
@@ -27,7 +27,7 @@ import { useTabListContext } from "./TabListContext.js";
27
27
  import "./tab.markers.stylex.js";
28
28
  import { tabScope } from "./tab.markers.stylex.js";
29
29
  import { mergeProps, mergeRefs } from "../utils/index.js";
30
- import { xdsThemeProps } from "../utils/xdsThemeProps.js";
30
+ import { themeProps } from "../utils/themeProps.js";
31
31
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
32
32
  // =============================================================================
33
33
  // Styles
@@ -170,7 +170,7 @@ export function TabMenu({
170
170
  "aria-expanded": popover.isOpen,
171
171
  "aria-controls": menuId,
172
172
  onClick: handleToggle,
173
- ...mergeProps(xdsThemeProps('tab-menu'), stylex.props(styles.trigger, sizeStyles[size], hasSelectedOption && styles.triggerSelected, tabScope, xstyle), className, style),
173
+ ...mergeProps(themeProps('tab-menu'), stylex.props(styles.trigger, sizeStyles[size], hasSelectedOption && styles.triggerSelected, tabScope, xstyle), className, style),
174
174
  children: [/*#__PURE__*/_jsx("span", {
175
175
  "aria-hidden": "true",
176
176
  ...stylex.props(styles.hoverBg, hoverSizeStyles[size])
@@ -206,7 +206,7 @@ export function TabMenu({
206
206
  color: "inherit"
207
207
  })
208
208
  }), hasSelectedOption && /*#__PURE__*/_jsx("span", {
209
- ...mergeProps(xdsThemeProps('tab-indicator', {
209
+ ...mergeProps(themeProps('tab-indicator', {
210
210
  selected: 'selected'
211
211
  }), {
212
212
  className: "x10l6tqk xqmqy1e xnp31yv xmz3bnw x36qwtl xjspbzw x47corl xnpjden xuedmi6 xlr8y92 xowkcby x1hc1fzr"
@@ -218,7 +218,7 @@ export function TabMenu({
218
218
  role: "menu",
219
219
  "aria-label": label,
220
220
  onKeyDown: handleListKeyDown,
221
- ...mergeProps(xdsThemeProps('tab-menu-dropdown'), {
221
+ ...mergeProps(themeProps('tab-menu-dropdown'), {
222
222
  className: "x78zum5 xdt5ytf x1lsbc85 xu0wf1k x7a5moj"
223
223
  }),
224
224
  children: [/*#__PURE__*/_jsx("span", {
@@ -240,7 +240,7 @@ export function TabMenu({
240
240
  handleSelect(option.value);
241
241
  }
242
242
  },
243
- ...mergeProps(xdsThemeProps('tab-menu-item'), {
243
+ ...mergeProps(themeProps('tab-menu-item'), {
244
244
  0: {
245
245
  className: "x78zum5 x6s0dn4 x1qughib x1txdalj xce4md1 xrrkdod xh6dtrn xjb2p0i xcr08ib x1kq96og x1sodnla x1tgivj0 x1ypdohk x15406qy xuedmi6 xlr8y92 xjbqb8w xe9uy6x x17nn4n9"
246
246
  },
@@ -27,7 +27,7 @@ import { TableBody } from "./TableBody.js";
27
27
  import { mergeProps } from "../utils/index.js";
28
28
  import { EmptyState } from "../EmptyState/index.js";
29
29
  import { Text } from "../Text/index.js";
30
- import { xdsThemeProps } from "../utils/xdsThemeProps.js";
30
+ import { themeProps } from "../utils/themeProps.js";
31
31
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
32
32
  const styles = {
33
33
  table: {
@@ -342,7 +342,7 @@ function BaseTableInner({
342
342
  let tableElement = /*#__PURE__*/_jsx("table", {
343
343
  ref: ref,
344
344
  ...tableRenderProps.htmlProps,
345
- ...mergeProps(xdsThemeProps('base-table'), stylex.props(...tableRenderProps.styles), tableRenderProps.htmlProps.className),
345
+ ...mergeProps(themeProps('base-table'), stylex.props(...tableRenderProps.styles), tableRenderProps.htmlProps.className),
346
346
  style: tableStyle,
347
347
  children: children ? children : /*#__PURE__*/_jsxs(_Fragment, {
348
348
  children: [hasColumns && /*#__PURE__*/_jsx(TableHeader, {
@@ -23,7 +23,7 @@ import { BaseTable } from "./BaseTable.js";
23
23
  import { TableContext } from "./TableContext.js";
24
24
  import { useBaseTablePlugins } from "./useBaseTablePlugins.js";
25
25
  import { mergeProps } from "../utils/index.js";
26
- import { xdsThemeProps } from "../utils/xdsThemeProps.js";
26
+ import { themeProps } from "../utils/themeProps.js";
27
27
 
28
28
  // =============================================================================
29
29
  // Table Types
@@ -57,7 +57,7 @@ function TableScrollWrapper({
57
57
  children
58
58
  }) {
59
59
  return /*#__PURE__*/_jsx("div", {
60
- ...mergeProps(xdsThemeProps('table-scroll-wrapper'), {
60
+ ...mergeProps(themeProps('table-scroll-wrapper'), {
61
61
  className: "xw2csxc x5lxg6s xojxgvx x1fcf3bl xx6qvi6 xkibk3 xlayyun"
62
62
  }),
63
63
  children: children
@@ -72,7 +72,7 @@ function buildTableStylePlugin() {
72
72
  return {
73
73
  transformTable(props) {
74
74
  const existingClass = props.htmlProps.className ?? '';
75
- const tableClass = xdsThemeProps('table').className;
75
+ const tableClass = themeProps('table').className;
76
76
  return {
77
77
  ...props,
78
78
  htmlProps: {
@@ -4,7 +4,7 @@
4
4
 
5
5
  import * as stylex from '@stylexjs/stylex';
6
6
  import { mergeProps } from "../utils/index.js";
7
- import { xdsThemeProps } from "../utils/xdsThemeProps.js";
7
+ import { themeProps } from "../utils/themeProps.js";
8
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
9
  export function TableBody({
10
10
  ref,
@@ -13,7 +13,7 @@ export function TableBody({
13
13
  }) {
14
14
  return /*#__PURE__*/_jsx("tbody", {
15
15
  ref: ref,
16
- ...mergeProps(xdsThemeProps('table-body'), stylex.props(xstyle)),
16
+ ...mergeProps(themeProps('table-body'), stylex.props(xstyle)),
17
17
  children: children
18
18
  });
19
19
  }
@@ -20,7 +20,7 @@ import "./table.stylex.js";
20
20
  import { overflowStyles, wrapStyles, containerEdgeStyles, tableRowMarker } from "./table.stylex.js";
21
21
  import { useTableContext, buildDividerStyles, mergeXStyle } from "./useTableCellStyles.js";
22
22
  import { mergeProps } from "../utils/index.js";
23
- import { xdsThemeProps } from "../utils/xdsThemeProps.js";
23
+ import { themeProps } from "../utils/themeProps.js";
24
24
 
25
25
  /** Props for TableCell — thin `<td>` wrapper */
26
26
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -105,7 +105,7 @@ export function TableCell({
105
105
  return /*#__PURE__*/_jsx("td", {
106
106
  ref: ref,
107
107
  ...props,
108
- ...mergeProps(xdsThemeProps('table-cell'), stylex.props(xstyle), incomingClassName, incomingStyle),
108
+ ...mergeProps(themeProps('table-cell'), stylex.props(xstyle), incomingClassName, incomingStyle),
109
109
  children: children
110
110
  });
111
111
  }
@@ -113,7 +113,7 @@ export function TableCell({
113
113
  return /*#__PURE__*/_jsx("td", {
114
114
  ref: ref,
115
115
  ...props,
116
- ...mergeProps(xdsThemeProps('table-cell'), stylex.props(...mergeXStyle(cellStyles, xstyle)), incomingClassName, incomingStyle),
116
+ ...mergeProps(themeProps('table-cell'), stylex.props(...mergeXStyle(cellStyles, xstyle)), incomingClassName, incomingStyle),
117
117
  children: children
118
118
  });
119
119
  }
@@ -4,7 +4,7 @@
4
4
 
5
5
  import * as stylex from '@stylexjs/stylex';
6
6
  import { mergeProps } from "../utils/index.js";
7
- import { xdsThemeProps } from "../utils/xdsThemeProps.js";
7
+ import { themeProps } from "../utils/themeProps.js";
8
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
9
  export function TableFooter({
10
10
  ref,
@@ -13,7 +13,7 @@ export function TableFooter({
13
13
  }) {
14
14
  return /*#__PURE__*/_jsx("tfoot", {
15
15
  ref: ref,
16
- ...mergeProps(xdsThemeProps('table-footer'), stylex.props(xstyle)),
16
+ ...mergeProps(themeProps('table-footer'), stylex.props(xstyle)),
17
17
  children: children
18
18
  });
19
19
  }
@@ -4,7 +4,7 @@
4
4
 
5
5
  import * as stylex from '@stylexjs/stylex';
6
6
  import { mergeProps } from "../utils/index.js";
7
- import { xdsThemeProps } from "../utils/xdsThemeProps.js";
7
+ import { themeProps } from "../utils/themeProps.js";
8
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
9
  export function TableHeader({
10
10
  ref,
@@ -13,7 +13,7 @@ export function TableHeader({
13
13
  }) {
14
14
  return /*#__PURE__*/_jsx("thead", {
15
15
  ref: ref,
16
- ...mergeProps(xdsThemeProps('table-header'), stylex.props(xstyle)),
16
+ ...mergeProps(themeProps('table-header'), stylex.props(xstyle)),
17
17
  children: children
18
18
  });
19
19
  }
@@ -19,7 +19,7 @@ import { colorVars, spacingVars, fontWeightVars, typeScaleVars, borderVars } fro
19
19
  import { overflowStyles, containerEdgeStyles } from "./table.stylex.js";
20
20
  import { useTableContext, mergeXStyle } from "./useTableCellStyles.js";
21
21
  import { mergeProps } from "../utils/index.js";
22
- import { xdsThemeProps } from "../utils/xdsThemeProps.js";
22
+ import { themeProps } from "../utils/themeProps.js";
23
23
 
24
24
  /** Props for TableHeaderCell — `<th>` wrapper with context-aware styling */
25
25
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -103,7 +103,7 @@ export function TableHeaderCell({
103
103
  return /*#__PURE__*/_jsx("th", {
104
104
  ref: ref,
105
105
  ...props,
106
- ...mergeProps(xdsThemeProps('table-header-cell'), stylex.props(xstyle), incomingClassName, incomingStyle),
106
+ ...mergeProps(themeProps('table-header-cell'), stylex.props(xstyle), incomingClassName, incomingStyle),
107
107
  children: children
108
108
  });
109
109
  }
@@ -120,7 +120,7 @@ export function TableHeaderCell({
120
120
  return /*#__PURE__*/_jsx("th", {
121
121
  ref: ref,
122
122
  ...props,
123
- ...mergeProps(xdsThemeProps('table-header-cell'), stylex.props(...mergeXStyle(cellStyles, xstyle)), incomingClassName, incomingStyle),
123
+ ...mergeProps(themeProps('table-header-cell'), stylex.props(...mergeXStyle(cellStyles, xstyle)), incomingClassName, incomingStyle),
124
124
  children: children
125
125
  });
126
126
  }
@@ -20,7 +20,7 @@ import { colorVars, durationVars, easeVars } from "../theme/tokens.stylex.js";
20
20
  import { tableRowMarker } from "./table.stylex.js";
21
21
  import { TableContext } from "./TableContext.js";
22
22
  import { mergeProps } from "../utils/index.js";
23
- import { xdsThemeProps } from "../utils/xdsThemeProps.js";
23
+ import { themeProps } from "../utils/themeProps.js";
24
24
 
25
25
  /** Props for TableRow — thin `<tr>` wrapper */
26
26
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -76,7 +76,7 @@ export function TableRow({
76
76
  return /*#__PURE__*/_jsx("tr", {
77
77
  ref: ref,
78
78
  ...props,
79
- ...mergeProps(xdsThemeProps('table-row'), stylex.props(tableRowMarker, xstyle)),
79
+ ...mergeProps(themeProps('table-row'), stylex.props(tableRowMarker, xstyle)),
80
80
  children: children
81
81
  });
82
82
  }
@@ -100,7 +100,7 @@ export function TableRow({
100
100
  return /*#__PURE__*/_jsx("tr", {
101
101
  ref: ref,
102
102
  ...props,
103
- ...mergeProps(xdsThemeProps('table-row'), stylex.props(tableRowMarker, ...rowStyles)),
103
+ ...mergeProps(themeProps('table-row'), stylex.props(tableRowMarker, ...rowStyles)),
104
104
  children: children
105
105
  });
106
106
  }
package/dist/Text/Text.js CHANGED
@@ -20,7 +20,7 @@ import * as stylex from '@stylexjs/stylex';
20
20
  import { colorStyles, defaultWeightByTypeStyles, sizeByTypeStyles, weightStyles, displayStyles, justifyStyles, truncationStyles, wordBreakStyles, textWrapStyles, capsizeStyles, decorationStyles, tabularNumbersStyle, truncationTooltipStyles } from "./text.stylex.js";
21
21
  import { useTruncation } from "./useTruncation.js";
22
22
  import { mergeProps, mergeRefs } from "../utils/index.js";
23
- import { xdsThemeProps } from "../utils/xdsThemeProps.js";
23
+ import { themeProps } from "../utils/themeProps.js";
24
24
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
25
25
  const LazyXDSTooltip = /*#__PURE__*/lazy(async () => import('../Tooltip/Tooltip').then(mod => ({
26
26
  default: mod.Tooltip
@@ -118,7 +118,7 @@ export function Text({
118
118
  return /*#__PURE__*/_jsxs(_Fragment, {
119
119
  children: [/*#__PURE__*/_jsx(Component, {
120
120
  ref: mergeRefs(ref, truncation.ref, textRef),
121
- ...mergeProps(xdsThemeProps('text', {
121
+ ...mergeProps(themeProps('text', {
122
122
  type,
123
123
  color: resolvedColor
124
124
  }), stylex.props(colorStyles[resolvedColor], sizeByTypeStyles[styleType], defaultWeightByTypeStyles[styleType], weight && weightStyles[weight],
@@ -25,7 +25,7 @@ import { Spinner } from "../Spinner/index.js";
25
25
  import { mergeProps, mergeRefs } from "../utils/index.js";
26
26
  import { useInputContainer } from "../hooks/useInputContainer.js";
27
27
  import { useSize } from "../SizeContext/SizeContext.js";
28
- import { xdsThemeProps } from "../utils/xdsThemeProps.js";
28
+ import { themeProps } from "../utils/themeProps.js";
29
29
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
30
30
  const COUNTER_WARNING_THRESHOLD = 0.8;
31
31
  const styles = {
@@ -150,7 +150,7 @@ export function TextArea({
150
150
  ref: containerRef,
151
151
  onClick: handleWrapperClick,
152
152
  onMouseUp: handleWrapperMouseUp,
153
- ...mergeProps(xdsThemeProps('textarea', {
153
+ ...mergeProps(themeProps('textarea', {
154
154
  size,
155
155
  status: status?.type ?? null
156
156
  }), stylex.props(inputWrapperStyles.base, styles.wrapper, textareaSizeStyles[size], effectivelyDisabled && inputWrapperStyles.disabled, status && inputStatusBorderStyles[status.type], status && inputStatusHoverShadowStyles[status.type], status && inputStatusFocusWithinStyles[status.type], xstyle), className, style),
@@ -44,7 +44,7 @@ import { mergeProps, mergeRefs } from "../utils/index.js";
44
44
  import { useSize } from "../SizeContext/SizeContext.js";
45
45
  import { useInputContainer } from "../hooks/useInputContainer.js";
46
46
  import { useInputGroup } from "../InputGroup/InputGroupContext.js";
47
- import { xdsThemeProps } from "../utils/xdsThemeProps.js";
47
+ import { themeProps } from "../utils/themeProps.js";
48
48
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
49
49
  /**
50
50
  * A text input component for collecting user input.
@@ -135,7 +135,7 @@ export function TextInput({
135
135
  ref: containerRef,
136
136
  onClick: handleWrapperClick,
137
137
  onMouseUp: handleWrapperMouseUp,
138
- ...mergeProps(xdsThemeProps('text-input', {
138
+ ...mergeProps(themeProps('text-input', {
139
139
  size,
140
140
  status: status?.type ?? null
141
141
  }), stylex.props(inputWrapperStyles.base, sizeStyles[size], isDisabled && inputWrapperStyles.disabled, status && inputStatusBorderStyles[status.type], status && inputStatusHoverShadowStyles[status.type], status && inputStatusFocusWithinStyles[status.type], inputGroup && groupStyles.inGroup, xstyle), className, style),
@@ -31,7 +31,7 @@ import { Tooltip } from "../Tooltip/Tooltip.js";
31
31
  import { MediaTheme } from "../theme/MediaTheme.js";
32
32
  import { useImageMode } from "../hooks/useImageMode.js";
33
33
  import { mergeProps } from "../utils/index.js";
34
- import { xdsThemeProps } from "../utils/xdsThemeProps.js";
34
+ import { themeProps } from "../utils/themeProps.js";
35
35
 
36
36
  /** Sample the region behind the remove button (20px button, 4px inset, in 64px container). */
37
37
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
@@ -170,7 +170,7 @@ export function Thumbnail({
170
170
  ref: ref,
171
171
  "data-testid": testId,
172
172
  "aria-label": accessibleName,
173
- ...mergeProps(xdsThemeProps('thumbnail'), stylex.props(styles.root, isDisabled && styles.disabled, xstyle), className, style),
173
+ ...mergeProps(themeProps('thumbnail'), stylex.props(styles.root, isDisabled && styles.disabled, xstyle), className, style),
174
174
  ...props,
175
175
  children: /*#__PURE__*/_jsxs("div", {
176
176
  ...{
@@ -25,7 +25,7 @@ import { Spinner } from "../Spinner/index.js";
25
25
  import { parseTimeInput, formatDisplayTime12h, formatDisplayTime24h, formatISOTime, adjustTime, isTimeInRange, mergeProps, mergeRefs } from "../utils/index.js";
26
26
  import { useSize } from "../SizeContext/SizeContext.js";
27
27
  import { useInputContainer } from "../hooks/useInputContainer.js";
28
- import { xdsThemeProps } from "../utils/xdsThemeProps.js";
28
+ import { themeProps } from "../utils/themeProps.js";
29
29
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
30
30
  const sizeStyles = {
31
31
  sm: {
@@ -262,7 +262,7 @@ export function TimeInput({
262
262
  ref: containerRef,
263
263
  onClick: handleWrapperClick,
264
264
  onMouseUp: handleWrapperMouseUp,
265
- ...mergeProps(xdsThemeProps('time-input', {
265
+ ...mergeProps(themeProps('time-input', {
266
266
  size,
267
267
  status: status?.type ?? null
268
268
  }), stylex.props(inputWrapperStyles.base, sizeStyles[size], isDisabled && inputWrapperStyles.disabled, status && inputStatusBorderStyles[status.type], status && inputStatusHoverShadowStyles[status.type], status && inputStatusFocusWithinStyles[status.type], xstyle), className, style),
@@ -19,7 +19,7 @@ import { useEffect, useRef, useState, lazy, Suspense } from 'react';
19
19
  import * as stylex from '@stylexjs/stylex';
20
20
  import { Text } from "../Text/index.js";
21
21
  import { mergeProps, mergeRefs } from "../utils/index.js";
22
- import { xdsThemeProps } from "../utils/xdsThemeProps.js";
22
+ import { themeProps } from "../utils/themeProps.js";
23
23
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
24
24
  const LazyXDSTooltip = /*#__PURE__*/lazy(async () => import('../Tooltip/Tooltip').then(mod => ({
25
25
  default: mod.Tooltip
@@ -260,7 +260,7 @@ export function Timestamp({
260
260
  return () => clearInterval(timer);
261
261
  }, [isLive, effectiveFormat, diffSeconds]);
262
262
  const showTooltip = hasTooltip && effectiveFormat === 'relative';
263
- const timestampProps = mergeProps(xdsThemeProps('timestamp', {
263
+ const timestampProps = mergeProps(themeProps('timestamp', {
264
264
  format: effectiveFormat
265
265
  }), {
266
266
  className,
@@ -11,7 +11,7 @@ import { colorVars, spacingVars, radiusVars, durationVars, easeVars, shadowVars,
11
11
  import { mergeProps } from "../utils/index.js";
12
12
  import { useTheme } from "../theme/index.js";
13
13
  import { MediaTheme } from "../theme/MediaTheme.js";
14
- import { xdsThemeProps } from "../utils/xdsThemeProps.js";
14
+ import { themeProps } from "../utils/themeProps.js";
15
15
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
16
16
  /**
17
17
  * Individual toast notification.
@@ -106,7 +106,7 @@ export function Toast({
106
106
  onMouseLeave: resumeTimer,
107
107
  onFocusCapture: pauseTimer,
108
108
  onBlurCapture: resumeTimer,
109
- ...mergeProps(xdsThemeProps('toast', {
109
+ ...mergeProps(themeProps('toast', {
110
110
  type
111
111
  }), {
112
112
  0: {
@@ -38,8 +38,15 @@ export interface ToggleButtonProps extends BaseProps<HTMLButtonElement> {
38
38
  */
39
39
  onPressedChange?: (isPressed: boolean) => void;
40
40
  /**
41
- * Async action handler for API-backed toggles.
42
- * The button shows a loading spinner while the promise is pending.
41
+ * Action handler for API- or navigation-backed toggles, run inside a
42
+ * transition. The button shows a loading spinner while the action is
43
+ * pending — whether it returns a promise or synchronously triggers a
44
+ * suspending update (e.g. a router navigation that suspends on data).
45
+ *
46
+ * Because it runs in a transition, the toggle is *interruptible*: clicking
47
+ * again while an action is pending starts a new transition with the next
48
+ * optimistic state, so the action reflects the latest intent rather than
49
+ * being dropped.
43
50
  *
44
51
  * @example
45
52
  * ```
@@ -53,7 +60,7 @@ export interface ToggleButtonProps extends BaseProps<HTMLButtonElement> {
53
60
  * />
54
61
  * ```
55
62
  */
56
- pressedChangeAction?: (isPressed: boolean) => Promise<void>;
63
+ pressedChangeAction?: (isPressed: boolean) => void | Promise<void>;
57
64
  /**
58
65
  * The size of the toggle button.
59
66
  * When used inside ToggleButtonGroup, defaults to the group's size.
@@ -1 +1 @@
1
- {"version":3,"file":"ToggleButton.d.ts","sourceRoot":"","sources":["../../src/ToggleButton/ToggleButton.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAc,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAIzD,OAAO,EAAS,KAAK,UAAU,EAAC,MAAM,WAAW,CAAC;AAElD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA0C5C,MAAM,WAAW,iBAAkB,SAAQ,SAAS,CAAC,iBAAiB,CAAC;IACrE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACnC;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IAE/C;;;;;;;;;;;;;;;OAeG;IACH,mBAAmB,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAE5D;;;;OAIG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAElB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;;;;;;;OAUG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IAExB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAMD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,YAAY,CAAC,EAC3B,GAAG,EACH,KAAK,EACL,SAAS,EAAE,aAAa,EACxB,eAAe,EAAE,mBAAmB,EACpC,mBAAmB,EACnB,IAAI,EAAE,QAAQ,EACd,UAAU,EAAE,cAAsB,EAClC,SAAiB,EACjB,IAAI,EACJ,UAAkB,EAClB,WAAW,EACX,QAAQ,EACR,OAAO,EACP,KAAK,EACL,MAAM,EACN,SAAS,EAAE,UAAU,EACrB,KAAK,EACL,GAAG,KAAK,EACT,EAAE,iBAAiB,GAAG,SAAS,CAuF/B;yBA1Ge,YAAY"}
1
+ {"version":3,"file":"ToggleButton.d.ts","sourceRoot":"","sources":["../../src/ToggleButton/ToggleButton.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAMZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,OAAO,EAAS,KAAK,UAAU,EAAC,MAAM,WAAW,CAAC;AAElD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAyE5C,MAAM,WAAW,iBAAkB,SAAQ,SAAS,CAAC,iBAAiB,CAAC;IACrE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACnC;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IAE/C;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,mBAAmB,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnE;;;;OAIG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAElB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;;;;;;;OAUG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IAExB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAMD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,YAAY,CAAC,EAC3B,GAAG,EACH,KAAK,EACL,SAAS,EAAE,aAAa,EACxB,eAAe,EAAE,mBAAmB,EACpC,mBAAmB,EACnB,IAAI,EAAE,QAAQ,EACd,UAAU,EAAE,cAAsB,EAClC,SAAiB,EACjB,IAAI,EACJ,UAAkB,EAClB,WAAW,EACX,QAAQ,EACR,OAAO,EACP,KAAK,EACL,MAAM,EACN,SAAS,EAAE,UAAU,EACrB,KAAK,EACL,GAAG,KAAK,EACT,EAAE,iBAAiB,GAAG,SAAS,CAyG/B;yBA5He,YAAY"}
@@ -19,13 +19,45 @@
19
19
  * - /apps/storybook/stories/ToggleButton.stories.tsx
20
20
  * - /packages/cli/templates/blocks/components/ToggleButton/ (showcase blocks)
21
21
  */
22
- import React, { useCallback } from 'react';
22
+ import React, { useCallback, useEffect, useOptimistic, useState, useTransition } from 'react';
23
23
  import * as stylex from '@stylexjs/stylex';
24
24
  import "../theme/tokens.stylex.js";
25
25
  import { colorVars, fontWeightVars } from "../theme/tokens.stylex.js";
26
26
  import { Button } from "../Button/index.js";
27
27
  import { useToggleButtonGroup } from "./ToggleButtonGroup.js";
28
- import { xdsThemeProps } from "../utils/xdsThemeProps.js";
28
+ import { themeProps } from "../utils/themeProps.js";
29
+
30
+ // =============================================================================
31
+ // Constants & helpers
32
+ // =============================================================================
33
+
34
+ /**
35
+ * The spinner only appears once the action has been pending for this long.
36
+ * A fast action shows the optimistic pressed state immediately with no spinner
37
+ * flash, and rapid re-clicks can interrupt the in-flight action before the
38
+ * button locks behind the spinner.
39
+ */
40
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
41
+ const PENDING_SPINNER_DELAY_MS = 150;
42
+
43
+ /**
44
+ * Returns `true` only once `active` has stayed `true` for `delayMs`.
45
+ * Used to debounce the loading spinner so the optimistic state shows first.
46
+ */
47
+ function useDelayed(active, delayMs) {
48
+ const [delayed, setDelayed] = useState(false);
49
+ useEffect(() => {
50
+ if (!active) {
51
+ return undefined;
52
+ }
53
+ const timer = setTimeout(() => setDelayed(true), delayMs);
54
+ return () => {
55
+ clearTimeout(timer);
56
+ setDelayed(false);
57
+ };
58
+ }, [active, delayMs]);
59
+ return active && delayed;
60
+ }
29
61
 
30
62
  // =============================================================================
31
63
  // Styles
@@ -36,7 +68,6 @@ import { xdsThemeProps } from "../utils/xdsThemeProps.js";
36
68
  * A hidden span renders the same text at semibold weight to reserve
37
69
  * the wider width, preventing layout shift when toggling.
38
70
  */
39
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
40
71
  const pressedStyles = {
41
72
  background: {
42
73
  kWkggS: "xi89dp7",
@@ -93,32 +124,47 @@ export function ToggleButton({
93
124
  style,
94
125
  ...props
95
126
  }) {
96
- // Read group context if inside a group
97
127
  const group = useToggleButtonGroup();
98
-
99
- // Resolve state from group or props
100
- const isPressed = group && value != null ? group.selectedValues.has(value) : isPressedProp ?? false;
128
+ const committedPressed = group && value != null ? group.selectedValues.has(value) : isPressedProp ?? false;
101
129
  const size = sizeProp ?? group?.size ?? 'md';
102
130
  const isDisabled = group?.isDisabled ?? isDisabledProp;
131
+
132
+ // Track the pressed state optimistically. While an action is pending, the
133
+ // button reflects the intended (optimistic) state immediately, and a click
134
+ // mid-flight derives its next state from this value — so rapid toggles read
135
+ // true -> false -> true rather than stalling on the last committed value.
136
+ const [optimisticPressed, setOptimisticPressed] = useOptimistic(committedPressed);
137
+ const isPressed = optimisticPressed;
103
138
  const resolvedIcon = isPressed && pressedIcon ? pressedIcon : icon;
139
+
140
+ // Run the toggle inside a transition. The action is interruptible: clicking
141
+ // again while it is pending starts a fresh transition with the next
142
+ // optimistic state instead of being dropped, so there is no re-entry guard.
143
+ // Both onPressedChange and pressedChangeAction run inside the transition,
144
+ // which means a synchronous-but-suspending handler (e.g. a router navigation
145
+ // that suspends on data) also drives the pending state — not just promises.
146
+ const [isPending, startTransition] = useTransition();
147
+ // Debounce the spinner so a fast action shows the optimistic state without a
148
+ // spinner flash, and rapid re-clicks can interrupt before the button locks.
149
+ const showSpinner = useDelayed(isPending, PENDING_SPINNER_DELAY_MS);
150
+ const isLoadingState = isLoading || showSpinner;
104
151
  const handleClick = useCallback(() => {
105
- if (isDisabled || isLoading) {
152
+ if (isDisabled) {
106
153
  return;
107
154
  }
108
155
  if (group && value != null) {
109
- // Delegate to group context
156
+ // Group mode delegates selection to the group; no async-action path.
110
157
  group.toggle(value);
111
- } else if (onPressedChangeProp) {
112
- // Standalone toggle
113
- const newState = !isPressed;
114
- onPressedChangeProp(newState);
115
- if (pressedChangeAction) {
116
- void pressedChangeAction(newState);
117
- }
158
+ return;
118
159
  }
119
- }, [isDisabled, isLoading, group, value, onPressedChangeProp, pressedChangeAction, isPressed]);
160
+ const newState = !optimisticPressed;
161
+ startTransition(async () => {
162
+ setOptimisticPressed(newState);
163
+ onPressedChangeProp?.(newState);
164
+ await pressedChangeAction?.(newState);
165
+ });
166
+ }, [isDisabled, group, value, optimisticPressed, onPressedChangeProp, pressedChangeAction, setOptimisticPressed]);
120
167
 
121
- // Label with font weight shift and width reservation
122
168
  // isIconOnly prop is the source of truth for icon-only rendering.
123
169
  const labelContent = children != null ? /*#__PURE__*/_jsxs("span", {
124
170
  ...{
@@ -165,12 +211,12 @@ export function ToggleButton({
165
211
  variant: "ghost",
166
212
  size: size,
167
213
  isDisabled: isDisabled,
168
- isLoading: isLoading,
214
+ isLoading: isLoadingState,
169
215
  isIconOnly: isIconOnly,
170
216
  "aria-pressed": isPressed,
171
217
  icon: resolvedIcon,
172
218
  tooltip: tooltip,
173
- ...xdsThemeProps('toggle-button', {
219
+ ...themeProps('toggle-button', {
174
220
  isPressed: isPressed ? 'true' : 'false'
175
221
  }),
176
222
  xstyle: [isPressed ? pressedStyles.background : undefined, xstyle],