@astryxdesign/core 0.1.6 → 0.1.7-canary.0a6de96

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 (521) hide show
  1. package/CHANGELOG.md +68 -0
  2. package/README.md +2 -0
  3. package/dist/AlertDialog/AlertDialog.d.ts +1 -1
  4. package/dist/AlertDialog/AlertDialog.d.ts.map +1 -1
  5. package/dist/AlertDialog/AlertDialog.js +4 -1
  6. package/dist/AppShell/AppShell.d.ts.map +1 -1
  7. package/dist/AppShell/AppShell.js +3 -1
  8. package/dist/AvatarGroup/AvatarGroup.d.ts +1 -1
  9. package/dist/AvatarGroup/AvatarGroup.d.ts.map +1 -1
  10. package/dist/AvatarGroup/AvatarGroup.js +4 -1
  11. package/dist/Banner/Banner.d.ts.map +1 -1
  12. package/dist/Banner/Banner.js +8 -6
  13. package/dist/Breadcrumbs/Breadcrumbs.d.ts +1 -1
  14. package/dist/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
  15. package/dist/Breadcrumbs/Breadcrumbs.js +4 -1
  16. package/dist/Button/Button.d.ts +10 -2
  17. package/dist/Button/Button.d.ts.map +1 -1
  18. package/dist/Button/Button.js +49 -6
  19. package/dist/ButtonGroup/ButtonGroup.d.ts +20 -5
  20. package/dist/ButtonGroup/ButtonGroup.d.ts.map +1 -1
  21. package/dist/ButtonGroup/ButtonGroup.js +27 -11
  22. package/dist/Calendar/Calendar.d.ts.map +1 -1
  23. package/dist/Calendar/Calendar.js +29 -7
  24. package/dist/Carousel/Carousel.d.ts +1 -1
  25. package/dist/Carousel/Carousel.d.ts.map +1 -1
  26. package/dist/Carousel/Carousel.js +8 -5
  27. package/dist/Chat/ChatComposer.d.ts.map +1 -1
  28. package/dist/Chat/ChatComposer.js +4 -1
  29. package/dist/Chat/ChatComposerDrawer.d.ts +1 -1
  30. package/dist/Chat/ChatComposerDrawer.d.ts.map +1 -1
  31. package/dist/Chat/ChatComposerDrawer.js +9 -2
  32. package/dist/Chat/ChatComposerInput.d.ts.map +1 -1
  33. package/dist/Chat/ChatComposerInput.js +6 -2
  34. package/dist/Chat/ChatLayout.d.ts +1 -11
  35. package/dist/Chat/ChatLayout.d.ts.map +1 -1
  36. package/dist/Chat/ChatLayout.js +6 -4
  37. package/dist/Chat/ChatLayoutScrollButton.d.ts.map +1 -1
  38. package/dist/Chat/ChatLayoutScrollButton.js +4 -2
  39. package/dist/Chat/ChatMessage.d.ts +1 -1
  40. package/dist/Chat/ChatMessage.d.ts.map +1 -1
  41. package/dist/Chat/ChatMessage.js +8 -2
  42. package/dist/Chat/ChatMessageBubble.d.ts +1 -1
  43. package/dist/Chat/ChatMessageBubble.d.ts.map +1 -1
  44. package/dist/Chat/ChatMessageBubble.js +3 -1
  45. package/dist/Chat/ChatMessageList.d.ts +1 -1
  46. package/dist/Chat/ChatMessageList.d.ts.map +1 -1
  47. package/dist/Chat/ChatMessageList.js +3 -1
  48. package/dist/Chat/ChatMessageMetadata.d.ts.map +1 -1
  49. package/dist/Chat/ChatMessageMetadata.js +13 -8
  50. package/dist/Chat/ChatPastedTextToken.d.ts.map +1 -1
  51. package/dist/Chat/ChatPastedTextToken.js +3 -1
  52. package/dist/Chat/ChatSendButton.d.ts.map +1 -1
  53. package/dist/Chat/ChatSendButton.js +3 -1
  54. package/dist/Chat/index.d.ts +1 -1
  55. package/dist/Chat/index.d.ts.map +1 -1
  56. package/dist/Chat/useChatStreamScroll.d.ts +12 -1
  57. package/dist/Chat/useChatStreamScroll.d.ts.map +1 -1
  58. package/dist/Chat/useChatStreamScroll.js +43 -6
  59. package/dist/Chat/useSpeechRecognition.d.ts.map +1 -1
  60. package/dist/Chat/useSpeechRecognition.js +4 -2
  61. package/dist/Chat/useTriggerMenu.d.ts.map +1 -1
  62. package/dist/Chat/useTriggerMenu.js +4 -2
  63. package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
  64. package/dist/CheckboxInput/CheckboxInput.js +4 -2
  65. package/dist/CheckboxList/CheckboxList.d.ts +1 -1
  66. package/dist/CheckboxList/CheckboxList.d.ts.map +1 -1
  67. package/dist/CheckboxList/CheckboxList.js +3 -1
  68. package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
  69. package/dist/CheckboxList/CheckboxListItem.js +3 -1
  70. package/dist/Citation/Citation.d.ts.map +1 -1
  71. package/dist/Citation/Citation.js +10 -2
  72. package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
  73. package/dist/CodeBlock/CodeBlock.js +71 -53
  74. package/dist/Collapsible/Collapsible.d.ts.map +1 -1
  75. package/dist/Collapsible/Collapsible.js +8 -1
  76. package/dist/CommandPalette/CommandPalette.d.ts +1 -1
  77. package/dist/CommandPalette/CommandPalette.d.ts.map +1 -1
  78. package/dist/CommandPalette/CommandPalette.js +8 -3
  79. package/dist/CommandPalette/CommandPaletteInput.d.ts +1 -1
  80. package/dist/CommandPalette/CommandPaletteInput.d.ts.map +1 -1
  81. package/dist/CommandPalette/CommandPaletteInput.js +4 -1
  82. package/dist/CommandPalette/CommandPaletteList.d.ts +1 -1
  83. package/dist/CommandPalette/CommandPaletteList.d.ts.map +1 -1
  84. package/dist/CommandPalette/CommandPaletteList.js +4 -1
  85. package/dist/ContextMenu/ContextMenu.d.ts +1 -1
  86. package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
  87. package/dist/ContextMenu/ContextMenu.js +8 -4
  88. package/dist/ContextMenu/index.d.ts +3 -0
  89. package/dist/ContextMenu/index.d.ts.map +1 -1
  90. package/dist/ContextMenu/index.js +7 -1
  91. package/dist/DateInput/DateInput.d.ts +1 -1
  92. package/dist/DateInput/DateInput.d.ts.map +1 -1
  93. package/dist/DateInput/DateInput.js +10 -5
  94. package/dist/DateRangeInput/DateRangeInput.d.ts +1 -1
  95. package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
  96. package/dist/DateRangeInput/DateRangeInput.js +11 -6
  97. package/dist/DateTimeInput/DateTimeInput.d.ts +1 -1
  98. package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
  99. package/dist/DateTimeInput/DateTimeInput.js +15 -7
  100. package/dist/Dialog/Dialog.d.ts.map +1 -1
  101. package/dist/Dialog/Dialog.js +15 -12
  102. package/dist/Dialog/DialogHeader.d.ts +1 -1
  103. package/dist/Dialog/DialogHeader.d.ts.map +1 -1
  104. package/dist/Dialog/DialogHeader.js +7 -3
  105. package/dist/DropdownMenu/DropdownMenu.d.ts +1 -1
  106. package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
  107. package/dist/DropdownMenu/DropdownMenu.js +19 -9
  108. package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts +89 -0
  109. package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +1 -0
  110. package/dist/DropdownMenu/DropdownMenuCheckboxItem.js +170 -0
  111. package/dist/DropdownMenu/DropdownMenuContext.d.ts +17 -1
  112. package/dist/DropdownMenu/DropdownMenuContext.d.ts.map +1 -1
  113. package/dist/DropdownMenu/DropdownMenuContext.js +18 -0
  114. package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts +69 -0
  115. package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts.map +1 -0
  116. package/dist/DropdownMenu/DropdownMenuRadioGroup.js +70 -0
  117. package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts +69 -0
  118. package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts.map +1 -0
  119. package/dist/DropdownMenu/DropdownMenuRadioItem.js +178 -0
  120. package/dist/DropdownMenu/index.d.ts +5 -1
  121. package/dist/DropdownMenu/index.d.ts.map +1 -1
  122. package/dist/DropdownMenu/index.js +10 -1
  123. package/dist/DropdownMenu/menuItemRoles.d.ts +13 -0
  124. package/dist/DropdownMenu/menuItemRoles.d.ts.map +1 -0
  125. package/dist/DropdownMenu/menuItemRoles.js +15 -0
  126. package/dist/EmptyState/EmptyState.d.ts +4 -1
  127. package/dist/EmptyState/EmptyState.d.ts.map +1 -1
  128. package/dist/FileInput/FileInput.d.ts.map +1 -1
  129. package/dist/FileInput/FileInput.js +11 -1
  130. package/dist/Icon/Icon.d.ts +17 -12
  131. package/dist/Icon/Icon.d.ts.map +1 -1
  132. package/dist/Icon/Icon.js +28 -20
  133. package/dist/Kbd/Kbd.js +1 -1
  134. package/dist/Layer/useLayer.d.ts +10 -0
  135. package/dist/Layer/useLayer.d.ts.map +1 -1
  136. package/dist/Layer/useLayer.js +23 -1
  137. package/dist/Lightbox/Lightbox.d.ts.map +1 -1
  138. package/dist/Lightbox/Lightbox.js +6 -4
  139. package/dist/Link/Link.d.ts +5 -1
  140. package/dist/Link/Link.d.ts.map +1 -1
  141. package/dist/Link/Link.js +32 -1
  142. package/dist/Markdown/Markdown.d.ts.map +1 -1
  143. package/dist/Markdown/Markdown.js +10 -8
  144. package/dist/MobileNav/MobileNav.d.ts.map +1 -1
  145. package/dist/MobileNav/MobileNav.js +4 -2
  146. package/dist/MobileNav/MobileNavToggle.d.ts +1 -1
  147. package/dist/MobileNav/MobileNavToggle.d.ts.map +1 -1
  148. package/dist/MobileNav/MobileNavToggle.js +4 -1
  149. package/dist/MoreMenu/MoreMenu.d.ts +1 -1
  150. package/dist/MoreMenu/MoreMenu.d.ts.map +1 -1
  151. package/dist/MoreMenu/MoreMenu.js +4 -1
  152. package/dist/MultiSelector/MultiSelector.d.ts +1 -1
  153. package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
  154. package/dist/MultiSelector/MultiSelector.js +13 -6
  155. package/dist/NumberInput/NumberInput.d.ts.map +1 -1
  156. package/dist/NumberInput/NumberInput.js +5 -1
  157. package/dist/Outline/Outline.d.ts +1 -1
  158. package/dist/Outline/Outline.d.ts.map +1 -1
  159. package/dist/Outline/Outline.js +4 -1
  160. package/dist/Pagination/Pagination.d.ts +1 -1
  161. package/dist/Pagination/Pagination.d.ts.map +1 -1
  162. package/dist/Pagination/Pagination.js +38 -11
  163. package/dist/Popover/usePopover.d.ts.map +1 -1
  164. package/dist/Popover/usePopover.js +4 -1
  165. package/dist/PowerSearch/PowerSearch.d.ts +1 -1
  166. package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
  167. package/dist/PowerSearch/PowerSearch.js +22 -12
  168. package/dist/PowerSearch/PowerSearchEditPopover.d.ts +1 -1
  169. package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
  170. package/dist/PowerSearch/PowerSearchEditPopover.js +26 -20
  171. package/dist/PowerSearch/PowerSearchToken.d.ts.map +1 -1
  172. package/dist/PowerSearch/PowerSearchToken.js +7 -3
  173. package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
  174. package/dist/PowerSearch/PowerSearchValueEditor.js +34 -21
  175. package/dist/PowerSearch/formatFilterValue.d.ts +2 -1
  176. package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
  177. package/dist/PowerSearch/formatFilterValue.js +19 -9
  178. package/dist/PowerSearch/index.d.ts +2 -1
  179. package/dist/PowerSearch/index.d.ts.map +1 -1
  180. package/dist/PowerSearch/index.js +1 -0
  181. package/dist/PowerSearch/resolveOperatorLabel.d.ts +23 -0
  182. package/dist/PowerSearch/resolveOperatorLabel.d.ts.map +1 -0
  183. package/dist/PowerSearch/resolveOperatorLabel.js +28 -0
  184. package/dist/PowerSearch/types.d.ts +28 -2
  185. package/dist/PowerSearch/types.d.ts.map +1 -1
  186. package/dist/PowerSearch/usePowerSearchConfig.d.ts.map +1 -1
  187. package/dist/PowerSearch/usePowerSearchConfig.js +27 -27
  188. package/dist/PowerSearch/usePowerSearchSource.d.ts.map +1 -1
  189. package/dist/PowerSearch/usePowerSearchSource.js +15 -8
  190. package/dist/Resizable/ResizeHandle.d.ts +1 -1
  191. package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
  192. package/dist/Resizable/ResizeHandle.js +4 -1
  193. package/dist/Selector/Selector.d.ts.map +1 -1
  194. package/dist/Selector/Selector.js +52 -14
  195. package/dist/SideNav/SideNav.d.ts.map +1 -1
  196. package/dist/SideNav/SideNav.js +4 -2
  197. package/dist/SideNav/SideNavCollapseButton.d.ts.map +1 -1
  198. package/dist/SideNav/SideNavCollapseButton.js +3 -1
  199. package/dist/SideNav/SideNavHeading.d.ts.map +1 -1
  200. package/dist/SideNav/SideNavHeading.js +5 -3
  201. package/dist/SideNav/SideNavItem.d.ts.map +1 -1
  202. package/dist/SideNav/SideNavItem.js +7 -1
  203. package/dist/Switch/Switch.d.ts.map +1 -1
  204. package/dist/Switch/Switch.js +4 -2
  205. package/dist/TabList/TabList.d.ts +1 -1
  206. package/dist/TabList/TabList.d.ts.map +1 -1
  207. package/dist/TabList/TabList.js +4 -1
  208. package/dist/Table/BaseTable.d.ts.map +1 -1
  209. package/dist/Table/BaseTable.js +29 -16
  210. package/dist/Table/Table.d.ts.map +1 -1
  211. package/dist/Table/Table.js +5 -3
  212. package/dist/Table/plugins/columnResize/useTableColumnResize.js +1 -1
  213. package/dist/Table/plugins/filtering/useTableFiltering.d.ts.map +1 -1
  214. package/dist/Table/plugins/filtering/useTableFiltering.js +56 -19
  215. package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts +1 -1
  216. package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts.map +1 -1
  217. package/dist/Table/plugins/groupedRows/useTableGroupedRows.js +12 -5
  218. package/dist/Table/plugins/pagination/useTablePagination.d.ts.map +1 -1
  219. package/dist/Table/plugins/pagination/useTablePagination.js +6 -3
  220. package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
  221. package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +8 -6
  222. package/dist/Table/plugins/rowIndex/useTableRowIndex.d.ts +1 -1
  223. package/dist/Table/plugins/rowIndex/useTableRowIndex.js +1 -1
  224. package/dist/Table/plugins/selection/useTableSelection.d.ts.map +1 -1
  225. package/dist/Table/plugins/selection/useTableSelection.js +5 -2
  226. package/dist/Table/plugins/sortable/useTableSortable.d.ts.map +1 -1
  227. package/dist/Table/plugins/sortable/useTableSortable.js +6 -4
  228. package/dist/Table/plugins/stickyColumns/useTableStickyColumns.js +2 -2
  229. package/dist/Table/types.d.ts +17 -10
  230. package/dist/Table/types.d.ts.map +1 -1
  231. package/dist/TextInput/TextInput.d.ts.map +1 -1
  232. package/dist/TextInput/TextInput.js +5 -1
  233. package/dist/Thumbnail/Thumbnail.d.ts.map +1 -1
  234. package/dist/Thumbnail/Thumbnail.js +8 -2
  235. package/dist/TimeInput/TimeInput.d.ts +1 -1
  236. package/dist/TimeInput/TimeInput.d.ts.map +1 -1
  237. package/dist/TimeInput/TimeInput.js +7 -2
  238. package/dist/Timestamp/Timestamp.d.ts.map +1 -1
  239. package/dist/Timestamp/Timestamp.js +18 -3
  240. package/dist/Toast/Toast.d.ts.map +1 -1
  241. package/dist/Toast/Toast.js +3 -1
  242. package/dist/Toast/ToastViewport.d.ts.map +1 -1
  243. package/dist/Toast/ToastViewport.js +3 -1
  244. package/dist/Token/Token.d.ts.map +1 -1
  245. package/dist/Token/Token.js +8 -2
  246. package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
  247. package/dist/Tokenizer/Tokenizer.js +3 -1
  248. package/dist/TopNav/TopNav.d.ts +2 -1
  249. package/dist/TopNav/TopNav.d.ts.map +1 -1
  250. package/dist/TopNav/TopNav.js +4 -1
  251. package/dist/TopNav/TopNavHeading.d.ts.map +1 -1
  252. package/dist/TopNav/TopNavHeading.js +5 -3
  253. package/dist/TreeList/TreeList.d.ts.map +1 -1
  254. package/dist/TreeList/TreeList.js +5 -1
  255. package/dist/TreeList/TreeListItem.d.ts.map +1 -1
  256. package/dist/TreeList/TreeListItem.js +7 -1
  257. package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
  258. package/dist/Typeahead/BaseTypeahead.js +8 -4
  259. package/dist/Typeahead/Typeahead.d.ts.map +1 -1
  260. package/dist/Typeahead/Typeahead.js +3 -1
  261. package/dist/VisuallyHidden/VisuallyHidden.d.ts +1 -0
  262. package/dist/VisuallyHidden/VisuallyHidden.d.ts.map +1 -1
  263. package/dist/VisuallyHidden/VisuallyHidden.js +1 -0
  264. package/dist/astryx.css +35 -3
  265. package/dist/astryx.umd.js +62 -60
  266. package/dist/astryx.umd.js.map +4 -4
  267. package/dist/authoring/doc.d.ts +145 -0
  268. package/dist/authoring/doc.d.ts.map +1 -0
  269. package/dist/authoring/doc.js +100 -0
  270. package/dist/authoring/index.d.ts +29 -0
  271. package/dist/authoring/index.d.ts.map +1 -0
  272. package/dist/authoring/index.js +28 -0
  273. package/dist/authoring/integration.d.ts +35 -0
  274. package/dist/authoring/integration.d.ts.map +1 -0
  275. package/dist/authoring/integration.js +30 -0
  276. package/dist/authoring/template.d.ts +66 -0
  277. package/dist/authoring/template.d.ts.map +1 -0
  278. package/dist/authoring/template.js +55 -0
  279. package/dist/config.d.ts +80 -0
  280. package/dist/config.d.ts.map +1 -0
  281. package/dist/config.js +40 -0
  282. package/dist/docs-types.d.ts +13 -4
  283. package/dist/docs-types.d.ts.map +1 -1
  284. package/dist/i18n/InternationalizationContext.d.ts +12 -0
  285. package/dist/i18n/InternationalizationContext.d.ts.map +1 -0
  286. package/dist/i18n/InternationalizationContext.js +29 -0
  287. package/dist/i18n/InternationalizationProvider.d.ts +61 -0
  288. package/dist/i18n/InternationalizationProvider.d.ts.map +1 -0
  289. package/dist/i18n/InternationalizationProvider.js +44 -0
  290. package/dist/i18n/index.d.ts +24 -0
  291. package/dist/i18n/index.d.ts.map +1 -0
  292. package/dist/i18n/index.js +21 -0
  293. package/dist/i18n/resolve.d.ts +22 -0
  294. package/dist/i18n/resolve.d.ts.map +1 -0
  295. package/dist/i18n/resolve.js +141 -0
  296. package/dist/i18n/translator.d.ts +25 -0
  297. package/dist/i18n/translator.d.ts.map +1 -0
  298. package/dist/i18n/translator.js +1 -0
  299. package/dist/i18n/types.d.ts +47 -0
  300. package/dist/i18n/types.d.ts.map +1 -0
  301. package/dist/i18n/types.js +1 -0
  302. package/dist/i18n/useTranslator.d.ts +15 -0
  303. package/dist/i18n/useTranslator.d.ts.map +1 -0
  304. package/dist/i18n/useTranslator.js +39 -0
  305. package/dist/index.d.ts +1 -0
  306. package/dist/index.d.ts.map +1 -1
  307. package/dist/index.js +3 -0
  308. package/dist/theme/hct.d.ts +0 -1
  309. package/dist/theme/hct.d.ts.map +1 -1
  310. package/dist/theme/hct.js +0 -3
  311. package/dist/utils/color.d.ts +13 -1
  312. package/dist/utils/color.d.ts.map +1 -1
  313. package/dist/utils/color.js +23 -1
  314. package/dist/utils/index.d.ts +1 -1
  315. package/dist/utils/index.d.ts.map +1 -1
  316. package/dist/utils/index.js +1 -1
  317. package/locales/en.json +746 -0
  318. package/locales/pseudo.json +560 -0
  319. package/package.json +23 -2
  320. package/src/AlertDialog/AlertDialog.doc.mjs +5 -0
  321. package/src/AlertDialog/AlertDialog.tsx +4 -1
  322. package/src/AppShell/AppShell.doc.mjs +8 -2
  323. package/src/AppShell/AppShell.tsx +3 -1
  324. package/src/AvatarGroup/AvatarGroup.tsx +4 -1
  325. package/src/Banner/Banner.tsx +10 -5
  326. package/src/Breadcrumbs/Breadcrumbs.tsx +4 -1
  327. package/src/Button/Button.doc.mjs +8 -0
  328. package/src/Button/Button.test.tsx +27 -0
  329. package/src/Button/Button.tsx +51 -5
  330. package/src/ButtonGroup/ButtonGroup.test.tsx +386 -2
  331. package/src/ButtonGroup/ButtonGroup.tsx +27 -11
  332. package/src/Calendar/Calendar.test.tsx +103 -2
  333. package/src/Calendar/Calendar.tsx +29 -6
  334. package/src/Card/Card.doc.mjs +3 -3
  335. package/src/Carousel/Carousel.tsx +10 -7
  336. package/src/Chat/ChatComposer.tsx +5 -1
  337. package/src/Chat/ChatComposerDrawer.tsx +9 -2
  338. package/src/Chat/ChatComposerInput.tsx +10 -4
  339. package/src/Chat/ChatLayout.test.tsx +127 -2
  340. package/src/Chat/ChatLayout.tsx +5 -12
  341. package/src/Chat/ChatLayoutScrollButton.tsx +4 -2
  342. package/src/Chat/ChatMessage.tsx +5 -1
  343. package/src/Chat/ChatMessageBubble.tsx +2 -0
  344. package/src/Chat/ChatMessageList.doc.mjs +1 -1
  345. package/src/Chat/ChatMessageList.tsx +2 -0
  346. package/src/Chat/ChatMessageMetadata.tsx +15 -9
  347. package/src/Chat/ChatPastedTextToken.tsx +3 -1
  348. package/src/Chat/ChatSendButton.tsx +3 -1
  349. package/src/Chat/ChatToolCalls.doc.mjs +1 -1
  350. package/src/Chat/index.ts +1 -0
  351. package/src/Chat/useChatStreamScroll.test.tsx +168 -0
  352. package/src/Chat/useChatStreamScroll.ts +67 -11
  353. package/src/Chat/useSpeechRecognition.ts +11 -2
  354. package/src/Chat/useTriggerMenu.tsx +4 -2
  355. package/src/CheckboxInput/CheckboxInput.test.tsx +16 -0
  356. package/src/CheckboxInput/CheckboxInput.tsx +4 -2
  357. package/src/CheckboxList/CheckboxList.doc.mjs +6 -1
  358. package/src/CheckboxList/CheckboxList.tsx +2 -0
  359. package/src/CheckboxList/CheckboxListItem.tsx +7 -1
  360. package/src/Citation/Citation.tsx +4 -2
  361. package/src/ClickableCard/ClickableCard.doc.mjs +1 -1
  362. package/src/CodeBlock/CodeBlock.tsx +91 -40
  363. package/src/Collapsible/Collapsible.doc.mjs +1 -0
  364. package/src/Collapsible/Collapsible.test.tsx +6 -0
  365. package/src/Collapsible/Collapsible.tsx +19 -4
  366. package/src/CommandPalette/CommandPalette.tsx +10 -3
  367. package/src/CommandPalette/CommandPaletteInput.test.tsx +1 -1
  368. package/src/CommandPalette/CommandPaletteInput.tsx +5 -1
  369. package/src/CommandPalette/CommandPaletteList.tsx +4 -1
  370. package/src/ContextMenu/ContextMenu.test.tsx +75 -1
  371. package/src/ContextMenu/ContextMenu.tsx +14 -6
  372. package/src/ContextMenu/index.ts +15 -0
  373. package/src/DateInput/DateInput.doc.mjs +2 -2
  374. package/src/DateInput/DateInput.test.tsx +17 -5
  375. package/src/DateInput/DateInput.tsx +13 -5
  376. package/src/DateRangeInput/DateRangeInput.doc.mjs +1 -1
  377. package/src/DateRangeInput/DateRangeInput.tsx +14 -6
  378. package/src/DateTimeInput/DateTimeInput.doc.mjs +2 -2
  379. package/src/DateTimeInput/DateTimeInput.tsx +17 -7
  380. package/src/Dialog/Dialog.tsx +11 -15
  381. package/src/Dialog/DialogHeader.tsx +7 -3
  382. package/src/DropdownMenu/DropdownMenu.doc.mjs +23 -0
  383. package/src/DropdownMenu/DropdownMenu.tsx +23 -14
  384. package/src/DropdownMenu/DropdownMenuCheckboxItem.doc.mjs +95 -0
  385. package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +237 -0
  386. package/src/DropdownMenu/DropdownMenuContext.tsx +29 -1
  387. package/src/DropdownMenu/DropdownMenuItem.doc.mjs +6 -0
  388. package/src/DropdownMenu/DropdownMenuRadioGroup.doc.mjs +80 -0
  389. package/src/DropdownMenu/DropdownMenuRadioGroup.tsx +119 -0
  390. package/src/DropdownMenu/DropdownMenuRadioItem.doc.mjs +80 -0
  391. package/src/DropdownMenu/DropdownMenuRadioItem.tsx +232 -0
  392. package/src/DropdownMenu/DropdownMenuSelectable.test.tsx +163 -0
  393. package/src/DropdownMenu/index.ts +23 -3
  394. package/src/DropdownMenu/menuItemRoles.ts +22 -0
  395. package/src/EmptyState/EmptyState.doc.mjs +3 -3
  396. package/src/EmptyState/EmptyState.tsx +4 -1
  397. package/src/Field/Field.doc.mjs +2 -2
  398. package/src/FileInput/FileInput.test.tsx +40 -1
  399. package/src/FileInput/FileInput.tsx +12 -1
  400. package/src/Grid/Grid.doc.mjs +5 -5
  401. package/src/Icon/Icon.test.tsx +46 -0
  402. package/src/Icon/Icon.tsx +37 -24
  403. package/src/InputGroup/InputGroup.doc.mjs +1 -1
  404. package/src/Kbd/Kbd.test.tsx +26 -0
  405. package/src/Kbd/Kbd.tsx +1 -1
  406. package/src/Layer/useLayer.doc.mjs +8 -5
  407. package/src/Layer/useLayer.test.tsx +136 -1
  408. package/src/Layer/useLayer.tsx +34 -2
  409. package/src/Lightbox/Lightbox.doc.mjs +7 -2
  410. package/src/Lightbox/Lightbox.tsx +6 -4
  411. package/src/Link/Link.test.tsx +74 -2
  412. package/src/Link/Link.tsx +48 -1
  413. package/src/Markdown/Markdown.tsx +12 -4
  414. package/src/MobileNav/MobileNav.tsx +4 -2
  415. package/src/MobileNav/MobileNavToggle.tsx +5 -3
  416. package/src/MoreMenu/MoreMenu.tsx +4 -1
  417. package/src/MultiSelector/MultiSelector.tsx +14 -5
  418. package/src/NumberInput/NumberInput.tsx +3 -1
  419. package/src/Outline/Outline.tsx +4 -1
  420. package/src/OverflowList/OverflowList.doc.mjs +2 -2
  421. package/src/Pagination/Pagination.tsx +35 -12
  422. package/src/Popover/usePopover.tsx +6 -1
  423. package/src/PowerSearch/PowerSearch.doc.mjs +9 -4
  424. package/src/PowerSearch/PowerSearch.tsx +22 -10
  425. package/src/PowerSearch/PowerSearchEditPopover.tsx +27 -20
  426. package/src/PowerSearch/PowerSearchToken.tsx +17 -6
  427. package/src/PowerSearch/PowerSearchValueEditor.tsx +34 -21
  428. package/src/PowerSearch/formatFilterValue.test.ts +282 -0
  429. package/src/PowerSearch/formatFilterValue.ts +21 -8
  430. package/src/PowerSearch/index.ts +5 -0
  431. package/src/PowerSearch/resolveOperatorLabel.ts +34 -0
  432. package/src/PowerSearch/types.ts +33 -9
  433. package/src/PowerSearch/usePowerSearchConfig.ts +59 -27
  434. package/src/PowerSearch/usePowerSearchSource.ts +17 -8
  435. package/src/RadioList/RadioList.doc.mjs +1 -1
  436. package/src/Resizable/ResizeHandle.tsx +4 -1
  437. package/src/Section/Section.doc.mjs +4 -4
  438. package/src/SelectableCard/SelectableCard.doc.mjs +1 -1
  439. package/src/Selector/Selector.doc.mjs +6 -3
  440. package/src/Selector/Selector.test.tsx +114 -6
  441. package/src/Selector/Selector.tsx +68 -17
  442. package/src/SideNav/SideNav.tsx +4 -2
  443. package/src/SideNav/SideNavCollapseButton.tsx +3 -1
  444. package/src/SideNav/SideNavHeading.tsx +5 -3
  445. package/src/SideNav/SideNavItem.tsx +3 -1
  446. package/src/Slider/Slider.doc.mjs +2 -2
  447. package/src/Stack/Stack.doc.mjs +10 -10
  448. package/src/Switch/Switch.doc.mjs +2 -2
  449. package/src/Switch/Switch.test.tsx +16 -0
  450. package/src/Switch/Switch.tsx +4 -2
  451. package/src/TabList/TabList.tsx +4 -1
  452. package/src/Table/BaseTable.tsx +36 -19
  453. package/src/Table/Table.test.tsx +132 -1
  454. package/src/Table/Table.tsx +6 -4
  455. package/src/Table/plugins/columnResize/useTableColumnResize.tsx +1 -1
  456. package/src/Table/plugins/filtering/useTableFiltering.tsx +31 -30
  457. package/src/Table/plugins/groupedRows/useTableGroupedRows.tsx +7 -5
  458. package/src/Table/plugins/pagination/useTablePagination.tsx +4 -1
  459. package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +9 -8
  460. package/src/Table/plugins/rowIndex/useTableRowIndex.tsx +1 -1
  461. package/src/Table/plugins/selection/useTableSelection.tsx +6 -7
  462. package/src/Table/plugins/sortable/useTableSortable.tsx +8 -5
  463. package/src/Table/plugins/stickyColumns/useTableStickyColumns.tsx +4 -4
  464. package/src/Table/types.ts +18 -12
  465. package/src/Table/useTableFiltering.doc.mjs +2 -2
  466. package/src/Table/useTableGroupedRows.doc.mjs +3 -3
  467. package/src/Table/useTableSortable.doc.mjs +11 -11
  468. package/src/Text/Text.doc.mjs +2 -2
  469. package/src/TextInput/TextInput.tsx +3 -1
  470. package/src/Thumbnail/Thumbnail.tsx +4 -2
  471. package/src/TimeInput/TimeInput.doc.mjs +2 -2
  472. package/src/TimeInput/TimeInput.tsx +6 -2
  473. package/src/Timestamp/Timestamp.doc.mjs +4 -4
  474. package/src/Timestamp/Timestamp.test.tsx +120 -7
  475. package/src/Timestamp/Timestamp.tsx +21 -1
  476. package/src/Toast/Toast.tsx +3 -1
  477. package/src/Toast/ToastViewport.tsx +3 -1
  478. package/src/Token/Token.tsx +4 -2
  479. package/src/Tokenizer/Tokenizer.doc.mjs +2 -2
  480. package/src/Tokenizer/Tokenizer.tsx +4 -4
  481. package/src/Toolbar/Toolbar.doc.mjs +1 -1
  482. package/src/TopNav/TopNav.doc.mjs +1 -0
  483. package/src/TopNav/TopNav.test.tsx +30 -0
  484. package/src/TopNav/TopNav.tsx +6 -4
  485. package/src/TopNav/TopNavHeading.tsx +5 -3
  486. package/src/TreeList/TreeList.tsx +5 -1
  487. package/src/TreeList/TreeListItem.tsx +6 -1
  488. package/src/Typeahead/BaseTypeahead.tsx +11 -4
  489. package/src/Typeahead/Typeahead.doc.mjs +1 -1
  490. package/src/Typeahead/Typeahead.tsx +3 -1
  491. package/src/VisuallyHidden/VisuallyHidden.tsx +1 -0
  492. package/src/authoring/doc.ts +166 -0
  493. package/src/authoring/index.test.ts +52 -0
  494. package/src/authoring/index.ts +50 -0
  495. package/src/authoring/integration.ts +42 -0
  496. package/src/authoring/template.ts +74 -0
  497. package/src/config.test.ts +16 -0
  498. package/src/config.ts +92 -0
  499. package/src/docPropLiterals.test.ts +938 -0
  500. package/src/docs-types.ts +15 -10
  501. package/src/i18n/InternationalizationContext.ts +39 -0
  502. package/src/i18n/InternationalizationProvider.doc.mjs +72 -0
  503. package/src/i18n/InternationalizationProvider.tsx +82 -0
  504. package/src/i18n/__tests__/e2e-pagination.test.tsx +172 -0
  505. package/src/i18n/__tests__/e2e-powersearch.test.tsx +130 -0
  506. package/src/i18n/__tests__/resolve.test.ts +284 -0
  507. package/src/i18n/index.ts +32 -0
  508. package/src/i18n/resolve.ts +165 -0
  509. package/src/i18n/translator.ts +31 -0
  510. package/src/i18n/types.ts +53 -0
  511. package/src/i18n/useTranslator.doc.mjs +46 -0
  512. package/src/i18n/useTranslator.ts +50 -0
  513. package/src/index.ts +3 -0
  514. package/src/theme/hct.ts +0 -4
  515. package/src/utils/color.test.ts +101 -1
  516. package/src/utils/color.ts +23 -1
  517. package/src/utils/index.ts +8 -1
  518. package/dist/NavItem/index.d.ts +0 -9
  519. package/dist/NavItem/index.d.ts.map +0 -1
  520. package/dist/NavItem/index.js +0 -10
  521. package/src/NavItem/index.ts +0 -11
@@ -7,7 +7,7 @@ export const docs = {
7
7
  subComponentOf: 'Table',
8
8
  displayName: 'useTableGroupedRows',
9
9
  description:
10
- 'Hook that groups a flat data array into collapsible section rows. Each distinct groupBy value becomes a full-width section-header row with a chevron toggle, the group label, and a member count; collapsing hides that group\u2019s data rows while keeping the header visible. Mirrors useTableRowExpansionState: the consumer owns the collapsedGroups set and the hook returns {data, plugin, idKey} \u2014 pass all three to Table (data, plugins, and idKey respectively).',
10
+ 'Hook that groups a flat data array into collapsible section rows. Each distinct groupBy value becomes a full-width section-header row with a chevron toggle, the group label, and a member count; collapsing hides that group\'s data rows while keeping the header visible. Mirrors useTableRowExpansionState: the consumer owns the collapsedGroups set and the hook returns {data, plugin, idKey}: pass all three to Table (data, plugins, and idKey respectively).',
11
11
  props: [
12
12
  {
13
13
  name: 'data',
@@ -58,10 +58,10 @@ export const docs = {
58
58
  /** @type {import('../docs-types').TranslationDoc} */
59
59
  export const docsDense = {
60
60
  description:
61
- 'Groups a flat data array into collapsible section rows. Each groupBy value becomes a full-width header (chevron + label + count); collapsing hides its rows. Returns {data, plugin, idKey} \u2014 pass to Table data / plugins / idKey. Consumer owns the collapsedGroups set.',
61
+ 'Groups a flat data array into collapsible section rows. Each groupBy value becomes a full-width header (chevron + label + count); collapsing hides its rows. Returns {data, plugin, idKey}: pass to Table data / plugins / idKey. Consumer owns the collapsedGroups set.',
62
62
  propDescriptions: {
63
63
  data: 'The flat data to group.',
64
- groupBy: 'Derive a row\u2019s group key. Same key = same section.',
64
+ groupBy: 'Derive a row\'s group key. Same key = same section.',
65
65
  collapsedGroups: 'Set of currently-collapsed group keys.',
66
66
  onToggleGroup: 'Called with the group key when a header is toggled.',
67
67
  renderGroupHeader: "Custom header content (right of chevron). Default '<key> (<count>)'.",
@@ -13,20 +13,20 @@ export const docs = {
13
13
  props: [
14
14
  {
15
15
  name: 'sort',
16
- type: 'TableSortState<TSortKey>',
17
- description: 'Current sort state. Ordered array of {sortKey, direction} entries. First entry is the primary sort.',
16
+ type: "Array<{sortKey: TSortKey, direction: 'ascending' | 'descending'}>",
17
+ description: "Current sort state (TableSortState<TSortKey>). Ordered array of entries; the first is the primary sort, the rest are tiebreakers. An empty array means unsorted. Direction is the full word: 'ascending' / 'descending', not 'asc' / 'desc'.",
18
18
  required: true,
19
19
  },
20
20
  {
21
21
  name: 'onSortChange',
22
- type: '(sort: TableSortState<TSortKey>) => void',
23
- description: 'Called when the user clicks a header cell to change sort.',
22
+ type: "(sort: Array<{sortKey: TSortKey, direction: 'ascending' | 'descending'}>) => void",
23
+ description: 'Called when the user clicks a header cell to change sort. Receives the next sort state.',
24
24
  required: true,
25
25
  },
26
26
  {
27
27
  name: 'allowUnsortedState',
28
28
  type: 'boolean',
29
- description: 'Allow cycling back to unsorted. When true: asc, desc, unsorted. When false: asc, desc, asc.',
29
+ description: "Allow cycling back to unsorted. When true: 'ascending', 'descending', unsorted. When false: 'ascending', 'descending', 'ascending'.",
30
30
  default: 'false',
31
31
  },
32
32
  {
@@ -45,20 +45,20 @@ export const docsZh = {
45
45
  props: [
46
46
  {
47
47
  name: 'sort',
48
- type: 'TableSortState<TSortKey>',
49
- description: '当前排序状态。{sortKey, direction} 条目的有序数组。第一个条目是主排序。',
48
+ type: "Array<{sortKey: TSortKey, direction: 'ascending' | 'descending'}>",
49
+ description: "当前排序状态。{sortKey, direction} 条目的有序数组。第一个条目是主排序。方向值为完整单词 'ascending' / 'descending',不是 'asc' / 'desc'。",
50
50
  required: true,
51
51
  },
52
52
  {
53
53
  name: 'onSortChange',
54
- type: '(sort: TableSortState<TSortKey>) => void',
54
+ type: "(sort: Array<{sortKey: TSortKey, direction: 'ascending' | 'descending'}>) => void",
55
55
  description: '用户点击表头单元格更改排序时调用。',
56
56
  required: true,
57
57
  },
58
58
  {
59
59
  name: 'allowUnsortedState',
60
60
  type: 'boolean',
61
- description: '允许循环回到未排序状态。为 true 时:升序、降序、未排序。为 false 时:升序、降序、升序。',
61
+ description: "允许循环回到未排序状态。为 true 时:'ascending'、'descending'、未排序。为 false 时:'ascending'、'descending'、'ascending'。",
62
62
  default: 'false',
63
63
  },
64
64
  {
@@ -75,9 +75,9 @@ export const docsDense = {
75
75
  displayName: 'useTableSortable',
76
76
  description: 'Headless multi-sort plugin. Consumer owns sort state + callback. Shift+click for secondary sort. Sort indicators auto-render in header cells.',
77
77
  propDescriptions: {
78
- sort: 'Current sort state; ordered array of {sortKey, direction} entries.',
78
+ sort: "Current sort state; ordered array of {sortKey, direction: 'ascending'|'descending'} entries. Not 'asc'/'desc'.",
79
79
  onSortChange: 'Called on header click to change sort.',
80
- allowUnsortedState: 'Allow cycling to unsorted. true: asc>desc>unsorted. false: asc>desc>asc.',
80
+ allowUnsortedState: "Allow cycling to unsorted. true: ascending>descending>unsorted. false: ascending>descending>ascending.",
81
81
  isMultiSortEnabled: 'Enable multi-sort via Shift+click. Regular click replaces sort state.',
82
82
  },
83
83
  };
@@ -23,8 +23,8 @@ export const docs = {
23
23
  props: [
24
24
  {
25
25
  name: 'type',
26
- type: "'body' | 'large' | 'label' | 'supporting' | 'code' | 'display-1' | 'display-2' | 'display-3'",
27
- description: 'Semantic text type. Determines size, weight, and line-height from the theme. Note: this prop is called `type`, not `variant`.',
26
+ type: "'body' | 'large' | 'label' | 'supporting' | 'code' | 'display-1' | 'display-2' | 'display-3' | 'inherit'",
27
+ description: "Semantic text type. Determines size, weight, and line-height from the theme. 'inherit' takes all three from the surrounding text instead. Themes may add custom types. Note: this prop is called `type`, not `variant`.",
28
28
  default: "'body'",
29
29
  },
30
30
  {
@@ -123,6 +123,7 @@ import {useInputGroup} from '../InputGroup/InputGroupContext';
123
123
  import type {BaseProps} from '../BaseProps';
124
124
  import type {SizeValue} from '../utils/types';
125
125
  import {themeProps} from '../utils/themeProps';
126
+ import {useTranslator} from '../i18n';
126
127
 
127
128
  export type TextInputType = 'text' | 'password' | 'email';
128
129
 
@@ -298,6 +299,7 @@ export function TextInput({
298
299
  ref,
299
300
  ...rest
300
301
  }: TextInputProps) {
302
+ const t = useTranslator();
301
303
  const size = useSize(sizeProp, 'md');
302
304
 
303
305
  const id = useId();
@@ -448,7 +450,7 @@ export function TextInput({
448
450
  <button
449
451
  type="button"
450
452
  onClick={handleClear}
451
- aria-label={`Clear ${label}`}
453
+ aria-label={t('@astryx.textInput.clearLabel', {label})}
452
454
  {...stylex.props(styles.clearButton)}>
453
455
  <Icon icon="close" size="sm" color="secondary" />
454
456
  </button>
@@ -40,6 +40,7 @@ import {useImageMode} from '../hooks/useImageMode';
40
40
  import type {BaseProps} from '../BaseProps';
41
41
  import {mergeProps} from '../utils';
42
42
  import {themeProps} from '../utils/themeProps';
43
+ import {useTranslator} from '../i18n';
43
44
 
44
45
  /** Sample the region behind the remove button (20px button, 4px inset, in 64px container). */
45
46
  const BUTTON_REGION = {x: 0.5, y: 0.06, width: 0.44, height: 0.44};
@@ -252,6 +253,7 @@ export function Thumbnail({
252
253
  ref,
253
254
  ...props
254
255
  }: ThumbnailProps) {
256
+ const t = useTranslator();
255
257
  const imageMode = useImageMode(src, {region: BUTTON_REGION, fallback: null});
256
258
 
257
259
  const hasSrc = src != null;
@@ -281,7 +283,7 @@ export function Thumbnail({
281
283
  onRemove != null && !isDisabled ? (
282
284
  <Button
283
285
  icon={<Icon icon="close" size="xsm" />}
284
- label={`Remove ${accessibleName}`}
286
+ label={t('@astryx.thumbnail.remove', {accessibleName})}
285
287
  variant="secondary"
286
288
  size="sm"
287
289
  isIconOnly
@@ -315,7 +317,7 @@ export function Thumbnail({
315
317
  <button
316
318
  type="button"
317
319
  onClick={onClick}
318
- aria-label={`Open ${accessibleName}`}
320
+ aria-label={t('@astryx.thumbnail.open', {accessibleName})}
319
321
  {...stylex.props(styles.interactiveButton)}>
320
322
  {imageContent}
321
323
  </button>
@@ -225,7 +225,7 @@ export const docs = {
225
225
  },
226
226
  {
227
227
  name: 'status',
228
- type: 'InputStatus',
228
+ type: "{type: 'warning' | 'error' | 'success', message?: string}",
229
229
  description:
230
230
  'Status indicator that colors the border and displays an icon. When a message is provided it is rendered below the input.',
231
231
  },
@@ -368,7 +368,7 @@ export const docsZh = {
368
368
  },
369
369
  {
370
370
  name: 'status',
371
- type: 'InputStatus',
371
+ type: "{type: 'warning' | 'error' | 'success', message?: string}",
372
372
  description:
373
373
  '为边框着色并显示图标的状态指示器。当提供消息时,消息渲染在输入框下方。',
374
374
  },
@@ -69,6 +69,7 @@ import {useInputGroup} from '../InputGroup/InputGroupContext';
69
69
  import {groupStyles} from '../InputGroup/groupStyles';
70
70
  import {useTooltip} from '../Tooltip';
71
71
  import {themeProps} from '../utils/themeProps';
72
+ import {useTranslator} from '../i18n';
72
73
 
73
74
  const styles = stylex.create({
74
75
  icon: {
@@ -341,7 +342,7 @@ export function TimeInput({
341
342
  hasAutoFocus = false,
342
343
  hourFormat = '12h',
343
344
  increment = 1,
344
- placeholder = 'Select a time',
345
+ placeholder: placeholderFromProps,
345
346
  size: sizeProp,
346
347
  status,
347
348
  labelTooltip,
@@ -351,6 +352,9 @@ export function TimeInput({
351
352
  style,
352
353
  ref,
353
354
  }: TimeInputProps) {
355
+ const t = useTranslator();
356
+ const placeholder =
357
+ placeholderFromProps ?? t('@astryx.timeInput.placeholder');
354
358
  const size = useSize(sizeProp, 'md');
355
359
 
356
360
  const id = useId();
@@ -659,7 +663,7 @@ export function TimeInput({
659
663
  <button
660
664
  type="button"
661
665
  onClick={handleClear}
662
- aria-label={`Clear ${label}`}
666
+ aria-label={t('@astryx.timeInput.clearLabel', {label})}
663
667
  {...stylex.props(styles.clearButton)}>
664
668
  <Icon icon="close" size="sm" color="secondary" />
665
669
  </button>
@@ -61,24 +61,24 @@ export const docs = {
61
61
  },
62
62
  {
63
63
  name: 'type',
64
- type: 'TextType',
64
+ type: "'body' | 'large' | 'label' | 'supporting' | 'code' | 'display-1' | 'display-2' | 'display-3' | 'inherit'",
65
65
  description: 'Semantic text type from Text. Determines size, weight, and line-height.',
66
66
  default: "'supporting'",
67
67
  },
68
68
  {
69
69
  name: 'size',
70
- type: 'TextSize',
70
+ type: "'4xs' | '3xs' | '2xs' | 'xsm' | 'sm' | 'base' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl'",
71
71
  description: 'Explicit font size override. Overrides the size from type.',
72
72
  },
73
73
  {
74
74
  name: 'color',
75
- type: 'TextColor',
75
+ type: "'primary' | 'secondary' | 'disabled' | 'placeholder' | 'accent' | 'inherit'",
76
76
  description: 'Text color.',
77
77
  default: "'secondary'",
78
78
  },
79
79
  {
80
80
  name: 'weight',
81
- type: 'TextWeight',
81
+ type: "'normal' | 'medium' | 'semibold' | 'bold'",
82
82
  description: 'Font weight override.',
83
83
  },
84
84
  ],
@@ -1,7 +1,8 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  import {describe, it, expect, vi, beforeEach, afterEach} from 'vitest';
4
- import {render, screen, act} from '@testing-library/react';
4
+ import {render, screen, act, waitFor} from '@testing-library/react';
5
+ import userEvent from '@testing-library/user-event';
5
6
  import {Timestamp} from './Timestamp';
6
7
 
7
8
  describe('Timestamp', () => {
@@ -41,9 +42,7 @@ describe('Timestamp', () => {
41
42
  );
42
43
  expect(screen.getByText('59 minutes ago')).toBeInTheDocument();
43
44
 
44
- rerender(
45
- <Timestamp value={Date.now() / 1000 - 86399} format="relative" />,
46
- );
45
+ rerender(<Timestamp value={Date.now() / 1000 - 86399} format="relative" />);
47
46
  expect(screen.getByText('23 hours ago')).toBeInTheDocument();
48
47
 
49
48
  rerender(
@@ -52,9 +51,7 @@ describe('Timestamp', () => {
52
51
  expect(screen.getByText('29 days ago')).toBeInTheDocument();
53
52
 
54
53
  // Same guarantee on the future side.
55
- rerender(
56
- <Timestamp value={Date.now() / 1000 + 3599} format="relative" />,
57
- );
54
+ rerender(<Timestamp value={Date.now() / 1000 + 3599} format="relative" />);
58
55
  expect(screen.getByText('in 59 minutes')).toBeInTheDocument();
59
56
  });
60
57
 
@@ -342,4 +339,120 @@ describe('Timestamp', () => {
342
339
  warn.mockRestore();
343
340
  }
344
341
  });
342
+
343
+ // --- Tooltip keyboard reachability (WCAG 1.4.13 / 2.1.1) ---
344
+
345
+ describe('tooltip keyboard reachability', () => {
346
+ const originalMatches = HTMLElement.prototype.matches;
347
+ const originalShowPopover = HTMLElement.prototype.showPopover;
348
+ const originalHidePopover = HTMLElement.prototype.hidePopover;
349
+
350
+ beforeEach(() => {
351
+ // The tooltip is lazy-loaded via a dynamic import; real timers let the
352
+ // import promise and RTL's waitFor resolve naturally (the outer
353
+ // beforeEach installs fake timers, which would stall them).
354
+ vi.useRealTimers();
355
+
356
+ // Mock the Popover API, which jsdom does not implement.
357
+ HTMLElement.prototype.showPopover = vi.fn();
358
+ HTMLElement.prototype.hidePopover = vi.fn();
359
+
360
+ // jsdom does not derive :focus-visible from keyboard focus for a <time>
361
+ // element; treat the focused element as focus-visible so the tooltip's
362
+ // keyboard-focus path can be exercised.
363
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
364
+ (HTMLElement.prototype as any).matches = function (
365
+ selector: string,
366
+ ): boolean {
367
+ if (selector === ':focus-visible') {
368
+ return this === document.activeElement;
369
+ }
370
+ return originalMatches.call(this, selector);
371
+ };
372
+ });
373
+
374
+ afterEach(() => {
375
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
376
+ (HTMLElement.prototype as any).matches = originalMatches;
377
+ HTMLElement.prototype.showPopover = originalShowPopover;
378
+ HTMLElement.prototype.hidePopover = originalHidePopover;
379
+ });
380
+
381
+ it('makes the <time> element focusable while the tooltip is attached', () => {
382
+ render(
383
+ <Timestamp
384
+ value={Date.now() / 1000 - 3600}
385
+ format="relative"
386
+ data-testid="ts"
387
+ />,
388
+ );
389
+ expect(screen.getByTestId('ts')).toHaveAttribute('tabindex', '0');
390
+ });
391
+
392
+ it('shows the tooltip when the timestamp receives keyboard focus', async () => {
393
+ const user = userEvent.setup();
394
+ render(
395
+ <Timestamp
396
+ value={Date.now() / 1000 - 3600}
397
+ format="relative"
398
+ data-testid="ts"
399
+ />,
400
+ );
401
+ const el = screen.getByTestId('ts');
402
+
403
+ // Wait for the lazy-loaded tooltip layer to mount and confirm it
404
+ // carries the full absolute time (same string as the aria-label).
405
+ // Compare with normalized whitespace: Intl output can contain narrow
406
+ // no-break spaces that jest-dom's matcher normalization would break on.
407
+ const layer = await screen.findByRole('tooltip', {hidden: true});
408
+ const normalize = (s: string) => s.replace(/\s+/g, ' ');
409
+ expect(normalize(layer.textContent ?? '')).toContain(
410
+ normalize(el.getAttribute('aria-label') ?? '\0'),
411
+ );
412
+
413
+ // Tab onto the timestamp — the only tab stop in the document.
414
+ await user.tab();
415
+ expect(el).toHaveFocus();
416
+ await waitFor(() => {
417
+ expect(HTMLElement.prototype.showPopover).toHaveBeenCalled();
418
+ });
419
+ });
420
+
421
+ it('does not add a tab stop when the tooltip is disabled', () => {
422
+ render(
423
+ <Timestamp
424
+ value={Date.now() / 1000 - 3600}
425
+ format="relative"
426
+ hasTooltip={false}
427
+ data-testid="ts"
428
+ />,
429
+ );
430
+ expect(screen.getByTestId('ts')).not.toHaveAttribute('tabindex');
431
+ });
432
+
433
+ it('does not add a tab stop for absolute formats (no tooltip)', () => {
434
+ render(
435
+ <Timestamp
436
+ value="2026-02-19T17:00:00Z"
437
+ format="date_time"
438
+ data-testid="ts"
439
+ />,
440
+ );
441
+ expect(screen.getByTestId('ts')).not.toHaveAttribute('tabindex');
442
+ });
443
+
444
+ it('keeps the full absolute aria-label while the tooltip is attached', () => {
445
+ render(
446
+ <Timestamp
447
+ value={Date.now() / 1000 - 3600}
448
+ format="relative"
449
+ data-testid="ts"
450
+ />,
451
+ );
452
+ const label = screen.getByTestId('ts').getAttribute('aria-label');
453
+ expect(label).toBeTruthy();
454
+ // The label is the full absolute string, not the relative text.
455
+ expect(label).not.toContain('ago');
456
+ });
457
+ });
345
458
  });
@@ -23,6 +23,7 @@ import type {TextType, TextSize, TextColor, TextWeight} from '../theme/types';
23
23
  import {mergeProps, mergeRefs} from '../utils';
24
24
  import type {BaseProps} from '../BaseProps';
25
25
  import {themeProps} from '../utils/themeProps';
26
+ import {colorVars} from '../theme/tokens.stylex';
26
27
 
27
28
  const LazyXDSTooltip = lazy(async () =>
28
29
  import('../Tooltip/Tooltip').then(mod => ({default: mod.Tooltip})),
@@ -118,6 +119,18 @@ const styles = stylex.create({
118
119
  color: 'inherit',
119
120
  fontWeight: 'inherit',
120
121
  },
122
+ // Visible focus ring for the tooltip tab stop, matching the repo-wide
123
+ // focus-visible outline treatment (see Token, Thumbnail).
124
+ focusable: {
125
+ outline: {
126
+ default: null,
127
+ ':focus-visible': `2px solid ${colorVars['--color-accent']}`,
128
+ },
129
+ outlineOffset: {
130
+ default: '0',
131
+ ':focus-visible': '2px',
132
+ },
133
+ },
121
134
  });
122
135
 
123
136
  // =============================================================================
@@ -431,8 +444,15 @@ export function Timestamp({
431
444
  aria-label={
432
445
  effectiveFormat === 'relative' ? fullAbsoluteText : undefined
433
446
  }
447
+ // The absolute-time tooltip is anchored here with the default 'auto'
448
+ // focus trigger, which only activates on focusable anchors. A bare
449
+ // <time> is not focusable, so without a tab stop sighted keyboard
450
+ // users could never reveal the tooltip (WCAG 1.4.13 / 2.1.1). Only
451
+ // add the tab stop while a tooltip is actually attached — no
452
+ // gratuitous tab stops otherwise.
453
+ tabIndex={showTooltip ? 0 : undefined}
434
454
  data-testid={testId}
435
- {...stylex.props(styles.time)}>
455
+ {...stylex.props(styles.time, showTooltip && styles.focusable)}>
436
456
  {displayText}
437
457
  </time>
438
458
  </Text>
@@ -22,6 +22,7 @@ import {useTheme} from '../theme';
22
22
  import {MediaTheme} from '../theme/MediaTheme';
23
23
  import type {ToastType, ToastDismissReason} from './types';
24
24
  import {themeProps} from '../utils/themeProps';
25
+ import {useTranslator} from '../i18n';
25
26
 
26
27
  const styles = stylex.create({
27
28
  root: {
@@ -115,6 +116,7 @@ export function Toast({
115
116
  isExiting = false,
116
117
  onDismiss,
117
118
  }: ToastProps) {
119
+ const t = useTranslator();
118
120
  const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
119
121
  const isPausedRef = useRef(false);
120
122
  const remainingRef = useRef(autoHideDuration);
@@ -226,7 +228,7 @@ export function Toast({
226
228
  variant="ghost"
227
229
  size="sm"
228
230
  icon={<Icon icon="close" size="sm" color="inherit" />}
229
- label="Dismiss notification"
231
+ label={t('@astryx.toast.dismiss')}
230
232
  onClick={handleDismiss}
231
233
  isIconOnly
232
234
  />
@@ -17,6 +17,7 @@ import {INTERACTIVE_SELECTORS} from '../hooks/useClickableContainer';
17
17
  import {Toast} from './Toast';
18
18
  import {ToastContext, type ToastContextValue} from './ToastContext';
19
19
  import type {ToastEntry, ToastPosition, ToastDismissReason} from './types';
20
+ import {useTranslator} from '../i18n';
20
21
 
21
22
  const styles = stylex.create({
22
23
  viewport: {
@@ -107,6 +108,7 @@ export function ToastViewport({
107
108
  isTopLayer = true,
108
109
  children,
109
110
  }: ToastViewportProps) {
111
+ const t = useTranslator();
110
112
  const [toasts, setToasts] = useState<ToastEntry[]>([]);
111
113
  const [exitingIds, setExitingIds] = useState<Set<string>>(new Set());
112
114
  const toastsRef = useRef(toasts);
@@ -363,7 +365,7 @@ export function ToastViewport({
363
365
  <div
364
366
  ref={viewportRef}
365
367
  role="region"
366
- aria-label="Notifications"
368
+ aria-label={t('@astryx.toast.viewport')}
367
369
  tabIndex={-1}
368
370
  // popover="manual" promotes to the top layer (above dialogs).
369
371
  // Omitted inside dialogs where the viewport is already in a top layer.
@@ -34,6 +34,7 @@ import {useLinkComponent} from '../Link/useLinkComponent';
34
34
  import {useInteractiveRole} from '../hooks/useInteractiveRole';
35
35
  import type {BaseProps} from '../BaseProps';
36
36
  import {themeProps} from '../utils/themeProps';
37
+ import {useTranslator} from '../i18n';
37
38
 
38
39
  // =============================================================================
39
40
  // Types
@@ -324,6 +325,7 @@ export function Token({
324
325
  'data-testid': testId,
325
326
  ref,
326
327
  }: TokenProps) {
328
+ const t = useTranslator();
327
329
  const LinkComponent = useLinkComponent();
328
330
  const role = useInteractiveRole({href, onClick, isDisabled});
329
331
 
@@ -342,7 +344,7 @@ export function Token({
342
344
  {onRemove != null && (
343
345
  <button
344
346
  type="button"
345
- aria-label={`Remove ${label}`}
347
+ aria-label={t('@astryx.token.remove', {label})}
346
348
  onClick={e => {
347
349
  e.stopPropagation();
348
350
  onRemove(e);
@@ -432,7 +434,7 @@ export function Token({
432
434
  {onRemove != null && (
433
435
  <button
434
436
  type="button"
435
- aria-label={`Remove ${label}`}
437
+ aria-label={t('@astryx.token.remove', {label})}
436
438
  onClick={e => {
437
439
  e.stopPropagation();
438
440
  onRemove(e);
@@ -84,7 +84,7 @@ export const docs = {
84
84
  },
85
85
  {
86
86
  name: 'status',
87
- type: 'InputStatus',
87
+ type: "{type: 'warning' | 'error' | 'success', message?: string}",
88
88
  description:
89
89
  'Validation status object with type and message for error/warning/success states.',
90
90
  },
@@ -296,7 +296,7 @@ export const docsZh = {
296
296
  },
297
297
  {
298
298
  name: 'status',
299
- type: 'InputStatus',
299
+ type: "{type: 'warning' | 'error' | 'success', message?: string}",
300
300
  description:
301
301
  '\u9a8c\u8bc1\u72b6\u6001\u5bf9\u8c61\uff0c\u5305\u542b\u7c7b\u578b\u548c\u6d88\u606f\uff0c\u7528\u4e8e\u9519\u8bef/\u8b66\u544a/\u6210\u529f\u72b6\u6001\u3002',
302
302
  },
@@ -52,6 +52,7 @@ import {
52
52
  import type {SearchableItem, SearchSource} from '../Typeahead/types';
53
53
  import {mergeProps} from '../utils';
54
54
  import {themeProps} from '../utils/themeProps';
55
+ import {useTranslator} from '../i18n';
55
56
 
56
57
  // Re-export status types for convenience
57
58
  export type {
@@ -81,9 +82,7 @@ export type TokenizerSize = 'sm' | 'md' | 'lg';
81
82
  * - `'unfocusedLayer'`: Shows a single line with "+ N more" when unfocused, expands as an overlay on focus.
82
83
  */
83
84
  export type TokenizerOverflowBehavior =
84
- | 'none'
85
- | 'unfocusedInline'
86
- | 'unfocusedLayer';
85
+ 'none' | 'unfocusedInline' | 'unfocusedLayer';
87
86
 
88
87
  /**
89
88
  * Imperative handle for Tokenizer handleRef.
@@ -403,6 +402,7 @@ export function Tokenizer<T extends SearchableItem>({
403
402
  ref,
404
403
  handleRef,
405
404
  }: TokenizerProps<T>) {
405
+ const t = useTranslator();
406
406
  const size = useSize(sizeProp, 'md');
407
407
  const inputId = useId();
408
408
  const descriptionId = useId();
@@ -786,7 +786,7 @@ export function Tokenizer<T extends SearchableItem>({
786
786
  {endContent}
787
787
  {hasClear && value.length > 0 && !isDisabled && (
788
788
  <InputClearButton
789
- label="Clear all"
789
+ label={t('@astryx.tokenizer.clearAll')}
790
790
  onClick={e => {
791
791
  e.stopPropagation();
792
792
  handleClearAll();
@@ -116,7 +116,7 @@ export const docs = {
116
116
  },
117
117
  {
118
118
  name: 'gap',
119
- type: 'SpacingStep',
119
+ type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
120
120
  description: 'Gap between items within each slot.',
121
121
  default: '1',
122
122
  },
@@ -109,6 +109,7 @@ export const docs = {
109
109
  name: 'label',
110
110
  type: 'string',
111
111
  description: 'Accessible label for the navigation landmark, applied as aria-label on the <nav> element.',
112
+ default: "'Top navigation'",
112
113
  },
113
114
  {
114
115
  name: 'xstyle',
@@ -13,6 +13,7 @@ import {describe, it, expect, vi} from 'vitest';
13
13
  import {render, screen} from '@testing-library/react';
14
14
  import userEvent from '@testing-library/user-event';
15
15
  import {TopNav} from './TopNav';
16
+ import {TopNavRenderContext} from './TopNavRenderContext';
16
17
  import {TopNavHeading} from './TopNavHeading';
17
18
  import {NavIcon} from '../NavIcon';
18
19
  import {TopNavItem} from './TopNavItem';
@@ -45,6 +46,35 @@ describe('TopNav', () => {
45
46
  );
46
47
  });
47
48
 
49
+ it('defaults the landmark label to "Top navigation" when label is omitted', () => {
50
+ render(<TopNav />);
51
+ expect(
52
+ screen.getByRole('navigation', {name: 'Top navigation'}),
53
+ ).toBeInTheDocument();
54
+ });
55
+
56
+ it('defaults the landmark label in mobile-bar mode', () => {
57
+ render(
58
+ <TopNavRenderContext value="mobile-bar">
59
+ <TopNav heading={<span>Logo</span>} />
60
+ </TopNavRenderContext>,
61
+ );
62
+ expect(
63
+ screen.getByRole('navigation', {name: 'Top navigation'}),
64
+ ).toBeInTheDocument();
65
+ });
66
+
67
+ it('custom label overrides the default in mobile-bar mode', () => {
68
+ render(
69
+ <TopNavRenderContext value="mobile-bar">
70
+ <TopNav label="Utility navigation" />
71
+ </TopNavRenderContext>,
72
+ );
73
+ expect(
74
+ screen.getByRole('navigation', {name: 'Utility navigation'}),
75
+ ).toBeInTheDocument();
76
+ });
77
+
48
78
  it('renders heading slot content', () => {
49
79
  render(<TopNav heading={<span data-testid="title-content">Logo</span>} />);
50
80
  expect(screen.getByTestId('title-content')).toBeInTheDocument();