@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
@@ -56,6 +56,7 @@ import {
56
56
  } from './parser';
57
57
  import type {BlockNode, InlineNode, IncrementalState} from './parser';
58
58
  import {themeProps} from '../utils/themeProps';
59
+ import {useTranslator, type TranslatorFn} from '../i18n';
59
60
 
60
61
  type SyncReactNode = Exclude<React.ReactNode, Promise<unknown>>;
61
62
 
@@ -1041,8 +1042,9 @@ function renderBlock(
1041
1042
  contentWidthValue: string | null,
1042
1043
  contentAlign: 'start' | 'center',
1043
1044
  linkComponent: LinkComponentType = 'a',
1044
- inlinePlugins?: MarkdownInlinePlugin[],
1045
- components?: Partial<MarkdownComponents>,
1045
+ inlinePlugins: MarkdownInlinePlugin[] | undefined,
1046
+ components: Partial<MarkdownComponents> | undefined,
1047
+ t: TranslatorFn,
1046
1048
  ): SyncReactNode {
1047
1049
  const blockAlignMargin = BLOCK_ALIGN_MARGIN[contentAlign];
1048
1050
  const blockAlignStyle =
@@ -1197,6 +1199,7 @@ function renderBlock(
1197
1199
  linkComponent,
1198
1200
  inlinePlugins,
1199
1201
  components,
1202
+ t,
1200
1203
  ),
1201
1204
  );
1202
1205
  return <BlockquoteComp key={index}>{bqC}</BlockquoteComp>;
@@ -1230,6 +1233,7 @@ function renderBlock(
1230
1233
  linkComponent,
1231
1234
  inlinePlugins,
1232
1235
  components,
1236
+ t,
1233
1237
  ),
1234
1238
  )}
1235
1239
  </Blockquote>
@@ -1256,7 +1260,7 @@ function renderBlock(
1256
1260
  isLast && styles.noMarginBlockEnd,
1257
1261
  )}>
1258
1262
  <CheckboxList
1259
- label="Task list"
1263
+ label={t('@astryx.markdown.taskList')}
1260
1264
  isLabelHidden
1261
1265
  value={checkedValues}
1262
1266
  xstyle={styles.blockIndent}
@@ -1300,6 +1304,7 @@ function renderBlock(
1300
1304
  linkComponent,
1301
1305
  inlinePlugins,
1302
1306
  components,
1307
+ t,
1303
1308
  ),
1304
1309
  )}
1305
1310
  </>
@@ -1378,6 +1383,7 @@ function renderBlock(
1378
1383
  linkComponent,
1379
1384
  inlinePlugins,
1380
1385
  components,
1386
+ t,
1381
1387
  ),
1382
1388
  )}
1383
1389
  </>
@@ -1407,7 +1413,7 @@ function renderBlock(
1407
1413
  // (axe: landmark-unique).
1408
1414
  tabIndex={0}
1409
1415
  role="group"
1410
- aria-label="Table"
1416
+ aria-label={t('@astryx.markdown.table')}
1411
1417
  {...stylex.props(
1412
1418
  styles.tableWrapper,
1413
1419
  spacing,
@@ -1567,6 +1573,7 @@ export function Markdown({
1567
1573
  style,
1568
1574
  'data-testid': testId,
1569
1575
  }: MarkdownProps): React.ReactElement {
1576
+ const t = useTranslator();
1570
1577
  const LinkComponent = useLinkComponent();
1571
1578
  // Derive the set of source IDs for the parser (stable across renders when sources don't change)
1572
1579
  const sourceIds = useMemo(
@@ -1725,6 +1732,7 @@ export function Markdown({
1725
1732
  LinkComponent,
1726
1733
  inlinePlugins,
1727
1734
  components,
1735
+ t,
1728
1736
  ),
1729
1737
  )}
1730
1738
  </div>
@@ -49,6 +49,7 @@ import {useAppShellMobile} from '../AppShell/AppShellMobileContext';
49
49
  import {mergeProps, mergeRefs, composeEventHandlers} from '../utils';
50
50
  import type {BaseProps} from '../BaseProps';
51
51
  import {themeProps} from '../utils/themeProps';
52
+ import {useTranslator} from '../i18n';
52
53
 
53
54
  // =============================================================================
54
55
  // Styles
@@ -290,6 +291,7 @@ export function MobileNav({
290
291
  ref,
291
292
  ...rest
292
293
  }: MobileNavProps) {
294
+ const t = useTranslator();
293
295
  // Read from AppShell context as fallback
294
296
  const appShellMobile = useAppShellMobile();
295
297
  const isOpen = isOpenProp ?? appShellMobile.isMobileNavOpen;
@@ -423,7 +425,7 @@ export function MobileNav({
423
425
  )}
424
426
  {...rest}
425
427
  data-testid={testId}
426
- aria-label={label ?? (typeof header === 'string' ? header : 'Navigation')}
428
+ aria-label={label ?? (typeof header === 'string' ? header : t('@astryx.mobileNav.navigation'))}
427
429
  onClick={composeEventHandlers(onClickProp, handleDialogClick)}
428
430
  onCancel={handleCancel}>
429
431
  {/* Drawer panel — tabIndex so showModal() focuses the drawer, not the close button */}
@@ -448,7 +450,7 @@ export function MobileNav({
448
450
  )}
449
451
  <Button
450
452
  variant="ghost"
451
- label="Close navigation"
453
+ label={t('@astryx.mobileNav.closeNavigation')}
452
454
  icon={<Icon icon="close" color="inherit" />}
453
455
  onClick={() => onOpenChange(false)}
454
456
  isIconOnly
@@ -18,6 +18,7 @@ import {Button} from '../Button';
18
18
  import {Icon} from '../Icon';
19
19
  import {useAppShellMobile} from '../AppShell/AppShellMobileContext';
20
20
  import type {BaseProps} from '../BaseProps';
21
+ import {useTranslator} from '../i18n';
21
22
 
22
23
  export interface MobileNavToggleProps extends Pick<
23
24
  BaseProps,
@@ -60,14 +61,15 @@ export interface MobileNavToggleProps extends Pick<
60
61
  export function MobileNavToggle({
61
62
  ref,
62
63
  children,
63
- label = 'Open navigation',
64
+ label: labelFromProps,
64
65
  'data-testid': testId,
65
66
  xstyle,
66
67
  className,
67
68
  style,
68
69
  }: MobileNavToggleProps) {
69
- const {isMobile, isMobileNavEnabled, toggleMobileNav} =
70
- useAppShellMobile();
70
+ const t = useTranslator();
71
+ const label = labelFromProps ?? t('@astryx.mobileNav.toggle.open');
72
+ const {isMobile, isMobileNavEnabled, toggleMobileNav} = useAppShellMobile();
71
73
 
72
74
  // Don't render above the breakpoint or when mobile nav is disabled
73
75
  if (!isMobile || !isMobileNavEnabled) {
@@ -26,6 +26,7 @@ import type {DropdownMenuOption} from '../DropdownMenu';
26
26
  import type {ButtonVariant, ButtonSize} from '../Button';
27
27
  import type {BaseProps} from '../BaseProps';
28
28
  import {stableClassName} from '../naming';
29
+ import {useTranslator} from '../i18n';
29
30
 
30
31
  export interface MoreMenuProps extends Pick<
31
32
  BaseProps,
@@ -102,7 +103,7 @@ export interface MoreMenuProps extends Pick<
102
103
  */
103
104
  export function MoreMenu({
104
105
  items,
105
- label = 'More options',
106
+ label: labelFromProps,
106
107
  variant = 'ghost',
107
108
  size: sizeProp,
108
109
  icon,
@@ -115,6 +116,8 @@ export function MoreMenu({
115
116
  'data-testid': testId,
116
117
  ref,
117
118
  }: MoreMenuProps) {
119
+ const t = useTranslator();
120
+ const label = labelFromProps ?? t('@astryx.moreMenu.label');
118
121
  const size = useSize(sizeProp, 'md');
119
122
  const moreIcon = getIcon('moreHorizontal');
120
123
 
@@ -76,6 +76,7 @@ import {themeProps} from '../utils/themeProps';
76
76
  import {groupStyles} from '../InputGroup/groupStyles';
77
77
  import {useInputGroup} from '../InputGroup/InputGroupContext';
78
78
  import {VisuallyHidden} from '../VisuallyHidden';
79
+ import {useTranslator} from '../i18n';
79
80
 
80
81
  // Sentinel value for the select-all item in keyboard navigation
81
82
  const SELECT_ALL_VALUE = '__xds_select_all__';
@@ -589,16 +590,16 @@ export function MultiSelector<T extends MultiSelectorOptionType>({
589
590
  onChange,
590
591
  changeAction,
591
592
  isLoading = false,
592
- placeholder = 'Select...',
593
+ placeholder: placeholderFromProps,
593
594
  size: sizeProp,
594
595
  status,
595
596
  labelTooltip,
596
597
  startIcon,
597
598
  hasClear = false,
598
599
  hasSelectAll = false,
599
- selectAllLabel = 'Select all',
600
+ selectAllLabel: selectAllLabelFromProps,
600
601
  hasSearch = false,
601
- searchPlaceholder = 'Search...',
602
+ searchPlaceholder: searchPlaceholderFromProps,
602
603
  triggerDisplay = 'count',
603
604
  maxBadges = 3,
604
605
  renderOption,
@@ -610,6 +611,13 @@ export function MultiSelector<T extends MultiSelectorOptionType>({
610
611
  className,
611
612
  style,
612
613
  }: MultiSelectorProps<T>) {
614
+ const t = useTranslator();
615
+ const placeholder =
616
+ placeholderFromProps ?? t('@astryx.multiSelector.selectPlaceholder');
617
+ const selectAllLabel =
618
+ selectAllLabelFromProps ?? t('@astryx.multiSelector.selectAll');
619
+ const searchPlaceholder =
620
+ searchPlaceholderFromProps ?? t('@astryx.multiSelector.searchPlaceholder');
613
621
  const size = useSize(sizeProp, 'md');
614
622
  const triggerId = useId();
615
623
  const listboxId = useId();
@@ -1030,7 +1038,7 @@ export function MultiSelector<T extends MultiSelectorOptionType>({
1030
1038
  ? getItemId(highlightedIndex)
1031
1039
  : undefined
1032
1040
  }
1033
- aria-label="Search options"
1041
+ aria-label={t('@astryx.multiSelector.searchOptions')}
1034
1042
  type="text"
1035
1043
  value={searchQuery}
1036
1044
  onChange={e => setSearchQuery(e.target.value)}
@@ -1063,6 +1071,7 @@ export function MultiSelector<T extends MultiSelectorOptionType>({
1063
1071
  popover.isOpen,
1064
1072
  highlightedIndex,
1065
1073
  getItemId,
1074
+ t,
1066
1075
  ]);
1067
1076
 
1068
1077
  // Render an individual item (index-based)
@@ -1305,7 +1314,7 @@ export function MultiSelector<T extends MultiSelectorOptionType>({
1305
1314
  <button
1306
1315
  type="button"
1307
1316
  onClick={handleClear}
1308
- aria-label={`Clear all ${label}`}
1317
+ aria-label={t('@astryx.multiSelector.clearAll', {label})}
1309
1318
  {...stylex.props(styles.clearButton)}>
1310
1319
  <Icon icon="close" size="sm" color="secondary" />
1311
1320
  </button>
@@ -135,6 +135,7 @@ import {mergeProps, mergeRefs} from '../utils';
135
135
  import type {BaseProps} from '../BaseProps';
136
136
  import type {SizeValue} from '../utils/types';
137
137
  import {themeProps} from '../utils/themeProps';
138
+ import {useTranslator} from '../i18n';
138
139
 
139
140
  interface NumberInputPropsBase extends Omit<
140
141
  BaseProps,
@@ -399,6 +400,7 @@ export function NumberInput({
399
400
  ref,
400
401
  ...rest
401
402
  }: NumberInputProps) {
403
+ const t = useTranslator();
402
404
  const size = useSize(sizeProp, 'md');
403
405
  const id = useId();
404
406
  const inputLabelID = useId();
@@ -663,7 +665,7 @@ export function NumberInput({
663
665
  <button
664
666
  type="button"
665
667
  onClick={handleClear}
666
- aria-label={`Clear ${label}`}
668
+ aria-label={t('@astryx.numberInput.clearLabel', {label})}
667
669
  {...stylex.props(styles.clearButton)}>
668
670
  <Icon icon="close" size="sm" color="secondary" />
669
671
  </button>
@@ -37,6 +37,7 @@ import type {BaseProps} from '../BaseProps';
37
37
  import {useScrollSpy} from './useScrollSpy';
38
38
  import type {OutlineItem} from './types';
39
39
  import {themeProps} from '../utils/themeProps';
40
+ import {useTranslator} from '../i18n';
40
41
 
41
42
  export type {OutlineItem} from './types';
42
43
 
@@ -236,7 +237,7 @@ export function Outline({
236
237
  items,
237
238
  activeId,
238
239
  onActiveIdChange,
239
- label = 'Table of contents',
240
+ label: labelFromProps,
240
241
  density = 'default',
241
242
  xstyle,
242
243
  className,
@@ -245,6 +246,8 @@ export function Outline({
245
246
  'data-testid': testId,
246
247
  ...props
247
248
  }: OutlineProps) {
249
+ const t = useTranslator();
250
+ const label = labelFromProps ?? t('@astryx.outline.label');
248
251
  const rootRef = useRef<HTMLElement | null>(null);
249
252
  const LinkComponent = useLinkComponent();
250
253
  const isControlled = activeId !== undefined;
@@ -50,7 +50,7 @@ export const docs = {
50
50
  },
51
51
  {
52
52
  name: 'gap',
53
- type: 'SpacingStep',
53
+ type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
54
54
  description:
55
55
  'Gap between items as a spacing token step (0, 0.5, 1, 1.5, 2, 3, 4, 5, 6, 8, 10).',
56
56
  default: '2',
@@ -116,7 +116,7 @@ export const docsZh = {
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:
121
121
  '项目间距,使用间距步进值(0、0.5、1、1.5、2、3、4、5、6、8、10)。',
122
122
  default: '2',
@@ -39,6 +39,7 @@ import {useListFocus} from '../hooks/useListFocus';
39
39
  import {mergeProps} from '../utils';
40
40
  import type {BaseProps} from '../BaseProps';
41
41
  import {themeProps} from '../utils/themeProps';
42
+ import {useTranslator} from '../i18n/useTranslator';
42
43
 
43
44
  // =============================================================================
44
45
  // Types
@@ -344,7 +345,7 @@ export function Pagination({
344
345
  siblingCount = 1,
345
346
  size = 'md',
346
347
  isDisabled = false,
347
- label = 'Pagination',
348
+ label: labelFromProps,
348
349
  'data-testid': testId,
349
350
  xstyle,
350
351
  className,
@@ -354,6 +355,14 @@ export function Pagination({
354
355
  }: PaginationProps) {
355
356
  const [, startTransition] = useTransition();
356
357
 
358
+ // Resolve system strings once per render. Prop overrides win.
359
+ const t = useTranslator();
360
+ const label = labelFromProps ?? t('@astryx.pagination.label');
361
+ const previousLabel = t('@astryx.pagination.previous');
362
+ const nextLabel = t('@astryx.pagination.next');
363
+ const pageIndicatorsLabel = t('@astryx.pagination.pageIndicators');
364
+ const itemsPerPageLabel = t('@astryx.pagination.itemsPerPage');
365
+
357
366
  // pageSize is typed as number, so 0, NaN, and negatives are valid at the
358
367
  // type level but yield Infinity/NaN page counts, and
359
368
  // Array.from({length: Infinity}) crashes the dots variant. Coerce to a
@@ -418,8 +427,11 @@ export function Pagination({
418
427
  onChange(newPage);
419
428
  announce(
420
429
  computedTotalPages != null
421
- ? `Page ${newPage} of ${computedTotalPages}`
422
- : `Page ${newPage}`,
430
+ ? t('@astryx.pagination.pageOfTotal', {
431
+ current: newPage,
432
+ total: computedTotalPages,
433
+ })
434
+ : t('@astryx.pagination.pageAnnounce', {current: newPage}),
423
435
  );
424
436
  startTransition(async () => {
425
437
  setOptimisticPage(newPage);
@@ -511,8 +523,10 @@ export function Pagination({
511
523
  return (
512
524
  <Button
513
525
  key={item}
514
- label={`Go to page ${item}`}
515
- aria-label={`Go to page ${item}`}
526
+ label={t('@astryx.pagination.goToPage', {page: item})}
527
+ aria-label={t('@astryx.pagination.goToPage', {
528
+ page: item,
529
+ })}
516
530
  variant="ghost"
517
531
  size={buttonSize}
518
532
  onClick={() => handlePageChange(item)}
@@ -534,7 +548,11 @@ export function Pagination({
534
548
  return (
535
549
  <span {...stylex.props(styles.infoText)}>
536
550
  <Text type="body" size="sm" color="secondary">
537
- {`${rangeStart}\u2013${rangeEnd} of ${totalItems}`}
551
+ {t('@astryx.pagination.count', {
552
+ from: rangeStart,
553
+ to: rangeEnd,
554
+ total: totalItems,
555
+ })}
538
556
  </Text>
539
557
  </span>
540
558
  );
@@ -547,7 +565,10 @@ export function Pagination({
547
565
  return (
548
566
  <span {...stylex.props(styles.infoText)}>
549
567
  <Text type="body" size="sm" color="secondary">
550
- {`Page ${optimisticPage} of ${computedTotalPages}`}
568
+ {t('@astryx.pagination.pageOfTotal', {
569
+ current: optimisticPage,
570
+ total: computedTotalPages,
571
+ })}
551
572
  </Text>
552
573
  </span>
553
574
  );
@@ -563,7 +584,7 @@ export function Pagination({
563
584
  ref={dotsListRef}
564
585
  {...stylex.props(styles.dotsContainer)}
565
586
  role="group"
566
- aria-label="Page indicators"
587
+ aria-label={pageIndicatorsLabel}
567
588
  onKeyDown={handleDotsKeyDown}
568
589
  onFocus={handleDotsFocus}>
569
590
  {Array.from({length: computedTotalPages}, (_, i) => {
@@ -573,7 +594,9 @@ export function Pagination({
573
594
  key={i + 1}
574
595
  type="button"
575
596
  data-page={i + 1}
576
- aria-label={`Go to page ${i + 1}`}
597
+ aria-label={t('@astryx.pagination.goToPage', {
598
+ page: i + 1,
599
+ })}
577
600
  aria-current={isActive ? 'page' : undefined}
578
601
  // The active dot is the single roving tab stop; useListFocus
579
602
  // maintains it as focus and the active page move.
@@ -624,7 +647,7 @@ export function Pagination({
624
647
  <div {...stylex.props(styles.pageSizeSelector)}>
625
648
  <div {...stylex.props(styles.pageSizeSelectorControl)}>
626
649
  <Selector
627
- label="Items per page"
650
+ label={itemsPerPageLabel}
628
651
  isLabelHidden
629
652
  options={pageSizeOptions.map(opt => String(opt))}
630
653
  value={String(pageSize)}
@@ -637,7 +660,7 @@ export function Pagination({
637
660
  )}
638
661
  <div {...stylex.props(styles.controls)}>
639
662
  <Button
640
- label="Go to previous page"
663
+ label={previousLabel}
641
664
  variant="ghost"
642
665
  size={buttonSize}
643
666
  icon={<Icon icon="chevronLeft" size={isSm ? 'sm' : 'md'} />}
@@ -649,7 +672,7 @@ export function Pagination({
649
672
  {renderIndicator()}
650
673
 
651
674
  <Button
652
- label="Go to next page"
675
+ label={nextLabel}
653
676
  variant="ghost"
654
677
  size={buttonSize}
655
678
  icon={<Icon icon="chevronRight" size={isSm ? 'sm' : 'md'} />}
@@ -27,6 +27,7 @@ import {
27
27
  shadowVars,
28
28
  } from '../theme/tokens.stylex';
29
29
  import {Button} from '../Button';
30
+ import {useTranslator} from '../i18n';
30
31
 
31
32
  const styles = stylex.create({
32
33
  // Default popover surface — background, radius, shadow.
@@ -309,12 +310,16 @@ export function usePopover(options: UsePopoverOptions = {}): UsePopoverReturn {
309
310
  hasAutoFocus = true,
310
311
  hasSurface = true,
311
312
  hasCloseButton = true,
312
- closeButtonLabel = 'Close popover',
313
+ closeButtonLabel: closeButtonLabelFromProps,
313
314
  dialogLabel,
314
315
  role = 'dialog',
315
316
  isModal = true,
316
317
  } = options;
317
318
 
319
+ const t = useTranslator();
320
+ const closeButtonLabel =
321
+ closeButtonLabelFromProps ?? t('@astryx.popover.close');
322
+
318
323
  // Track the trigger element for returning focus
319
324
  const triggerElementRef = useRef<HTMLElement | null>(null);
320
325
 
@@ -23,7 +23,7 @@ export const docs = {
23
23
  },
24
24
  {
25
25
  name: 'onChange',
26
- type: '(filters: ReadonlyArray<PowerSearchFilter>, changeType: PowerSearchChangeType, index: number) => void',
26
+ type: "(filters: ReadonlyArray<PowerSearchFilter>, changeType: 'add' | 'edit' | 'remove', index: number) => void",
27
27
  description:
28
28
  "Called when filters change. changeType is 'add', 'edit', or 'remove'. index is the affected filter's position.",
29
29
  required: true,
@@ -79,7 +79,7 @@ export const docs = {
79
79
  },
80
80
  {
81
81
  name: 'status',
82
- type: 'InputStatus',
82
+ type: "{type: 'warning' | 'error' | 'success', message?: string}",
83
83
  description:
84
84
  'Validation status object with type and optional message.',
85
85
  },
@@ -145,6 +145,11 @@ export const docs = {
145
145
  { guidance: false, description: 'Wrap a disabled PowerSearch in Tooltip to explain why it is disabled; disabled controls swallow the hover events the wrapper needs. Use the disabledMessage prop instead.' },
146
146
  ],
147
147
  },
148
+ theming: {
149
+ targets: [
150
+ {className: 'astryx-power-search'},
151
+ ],
152
+ },
148
153
  };
149
154
 
150
155
  // -------------------------------------------------------
@@ -172,7 +177,7 @@ export const docsZh = {
172
177
  },
173
178
  {
174
179
  name: 'onChange',
175
- type: '(filters: ReadonlyArray<PowerSearchFilter>, changeType: PowerSearchChangeType, index: number) => void',
180
+ type: "(filters: ReadonlyArray<PowerSearchFilter>, changeType: 'add' | 'edit' | 'remove', index: number) => void",
176
181
  description:
177
182
  "当过滤器变更时调用。changeType 为 'add'、'edit' 或 'remove'。index 为受影响的过滤器位置。",
178
183
  required: true,
@@ -227,7 +232,7 @@ export const docsZh = {
227
232
  },
228
233
  {
229
234
  name: 'status',
230
- type: 'InputStatus',
235
+ type: "{type: 'warning' | 'error' | 'success', message?: string}",
231
236
  description: '带有类型和可选消息的验证状态对象。',
232
237
  },
233
238
  {
@@ -52,7 +52,9 @@ import {useInternalConfig} from './useInternalConfig';
52
52
  import {usePowerSearchSource} from './usePowerSearchSource';
53
53
  import {formatFilterValue} from './formatFilterValue';
54
54
  import {PowerSearchEditPopover} from './PowerSearchEditPopover';
55
+ import {resolveOperatorLabel} from './resolveOperatorLabel';
55
56
  import {themeProps} from '../utils/themeProps';
57
+ import {useTranslator} from '../i18n';
56
58
  import type {
57
59
  PowerSearchConfig,
58
60
  PowerSearchFilter,
@@ -513,9 +515,9 @@ export function PowerSearch({
513
515
  config: configProp,
514
516
  filters,
515
517
  onChange,
516
- label = 'Search',
518
+ label: labelFromProps,
517
519
  isLabelHidden = true,
518
- placeholder = 'Search...',
520
+ placeholder: placeholderFromProps,
519
521
  hasAutoFocus = false,
520
522
  hasClear = true,
521
523
  isReadOnly = false,
@@ -526,7 +528,7 @@ export function PowerSearch({
526
528
  onBlur,
527
529
  status,
528
530
  maxTokenLength = 40,
529
- popoverSaveButtonLabel = 'Apply',
531
+ popoverSaveButtonLabel: popoverSaveButtonLabelFromProps,
530
532
  timezoneID,
531
533
  tokenOverflowBehavior,
532
534
  endContent,
@@ -543,6 +545,12 @@ export function PowerSearch({
543
545
  const size = useSize(sizeProp, 'md');
544
546
  const config = useInternalConfig(configProp);
545
547
  const searchSource = usePowerSearchSource(config);
548
+ const t = useTranslator();
549
+ const label = labelFromProps ?? t('@astryx.powersearch.label');
550
+ const placeholder =
551
+ placeholderFromProps ?? t('@astryx.powersearch.placeholder');
552
+ const popoverSaveButtonLabel =
553
+ popoverSaveButtonLabelFromProps ?? t('@astryx.powersearch.editor.apply');
546
554
  const tokenizerRef = useRef<TokenizerHandle>(null);
547
555
 
548
556
  const [popoverState, setPopoverStateRaw] = useState<PopoverState>({
@@ -598,13 +606,15 @@ export function PowerSearch({
598
606
  return filters.map((filter, index) => {
599
607
  const field = config.getField(filter.field);
600
608
  const operator = config.getOperator(filter.field, filter.operator);
601
- const operatorLabel = operator?.label ? `: ${operator.label}` : '';
609
+ const resolvedOp = operator ? resolveOperatorLabel(operator, t) : '';
610
+ const operatorLabel = resolvedOp ? `: ${resolvedOp}` : '';
602
611
  const valueStr = operator
603
612
  ? formatFilterValue(
604
613
  config,
605
614
  operator.value,
606
615
  filter.value,
607
616
  maxTokenLength,
617
+ t,
608
618
  timezoneID,
609
619
  )
610
620
  : '';
@@ -624,7 +634,7 @@ export function PowerSearch({
624
634
  },
625
635
  };
626
636
  });
627
- }, [filters, config, maxTokenLength, timezoneID]);
637
+ }, [filters, config, maxTokenLength, timezoneID, t]);
628
638
 
629
639
  // Handle tokenizer onChange (field selected from typeahead)
630
640
  const handleTokenizerChange = useCallback(
@@ -787,7 +797,7 @@ export function PowerSearch({
787
797
 
788
798
  // Default token rendering
789
799
  const fieldLabel = field?.label ?? '';
790
- const operatorLabel = operator?.label ?? '';
800
+ const operatorLabel = operator ? resolveOperatorLabel(operator, t) : '';
791
801
  const tokenLabel = `${fieldLabel}: ${operatorLabel}`.trim();
792
802
  const adjustedMaxLength = Math.max(
793
803
  maxTokenLength - fieldLabel.length - operatorLabel.length,
@@ -843,6 +853,7 @@ export function PowerSearch({
843
853
  isDisabled,
844
854
  handleTokenClick,
845
855
  componentOverrides,
856
+ t,
846
857
  ],
847
858
  );
848
859
 
@@ -948,17 +959,18 @@ export function PowerSearch({
948
959
  ]);
949
960
 
950
961
  // Plain-text form of the result count, shared by the visible label and the
951
- // screen-reader announcement so the two never drift.
962
+ // screen-reader announcement so the two never drift. The ICU plural handles
963
+ // the number formatting + `result` vs `results` in one message so translators
964
+ // can match the locale's plural rules.
952
965
  const resultCountText = useMemo((): string | null => {
953
966
  if (resultCount == null) {
954
967
  return null;
955
968
  }
956
969
  if (typeof resultCount === 'number') {
957
- const formatted = new Intl.NumberFormat().format(resultCount);
958
- return `${formatted} ${resultCount === 1 ? 'result' : 'results'}`;
970
+ return t('@astryx.powersearch.resultCount', {count: resultCount});
959
971
  }
960
972
  return resultCount;
961
- }, [resultCount]);
973
+ }, [resultCount, t]);
962
974
 
963
975
  // Announce result-count changes to screen readers through a polite live
964
976
  // region, mirroring the way Typeahead announces its dropdown result count.