@astryxdesign/core 0.1.5 → 0.1.6-canary.02f2602

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 (564) hide show
  1. package/CHANGELOG.md +24 -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 +21 -18
  6. package/dist/AlertDialog/useImperativeAlertDialog.d.ts +0 -2
  7. package/dist/AlertDialog/useImperativeAlertDialog.d.ts.map +1 -1
  8. package/dist/AlertDialog/useImperativeAlertDialog.js +3 -5
  9. package/dist/AppShell/AppShell.d.ts.map +1 -1
  10. package/dist/AppShell/AppShell.js +55 -53
  11. package/dist/AspectRatio/AspectRatio.js +5 -5
  12. package/dist/Avatar/Avatar.js +19 -19
  13. package/dist/Avatar/AvatarStatusDot.js +5 -5
  14. package/dist/AvatarGroup/AvatarGroup.d.ts +1 -1
  15. package/dist/AvatarGroup/AvatarGroup.d.ts.map +1 -1
  16. package/dist/AvatarGroup/AvatarGroup.js +9 -6
  17. package/dist/AvatarGroup/AvatarGroupOverflow.js +5 -5
  18. package/dist/Badge/Badge.js +3 -3
  19. package/dist/Banner/Banner.d.ts.map +1 -1
  20. package/dist/Banner/Banner.js +32 -30
  21. package/dist/Blockquote/Blockquote.js +7 -7
  22. package/dist/Breadcrumbs/BreadcrumbItem.js +17 -17
  23. package/dist/Breadcrumbs/Breadcrumbs.d.ts +1 -1
  24. package/dist/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
  25. package/dist/Breadcrumbs/Breadcrumbs.js +11 -8
  26. package/dist/Button/Button.d.ts.map +1 -1
  27. package/dist/Button/Button.js +53 -23
  28. package/dist/ButtonGroup/ButtonGroup.d.ts +20 -5
  29. package/dist/ButtonGroup/ButtonGroup.d.ts.map +1 -1
  30. package/dist/ButtonGroup/ButtonGroup.js +34 -18
  31. package/dist/Calendar/Calendar.d.ts.map +1 -1
  32. package/dist/Calendar/Calendar.js +51 -48
  33. package/dist/Card/Card.js +3 -3
  34. package/dist/Carousel/Carousel.d.ts +1 -1
  35. package/dist/Carousel/Carousel.d.ts.map +1 -1
  36. package/dist/Carousel/Carousel.js +27 -24
  37. package/dist/Center/Center.js +3 -3
  38. package/dist/Chat/ChatComposer.d.ts.map +1 -1
  39. package/dist/Chat/ChatComposer.js +27 -24
  40. package/dist/Chat/ChatComposerDrawer.d.ts +1 -1
  41. package/dist/Chat/ChatComposerDrawer.d.ts.map +1 -1
  42. package/dist/Chat/ChatComposerDrawer.js +23 -16
  43. package/dist/Chat/ChatComposerInput.d.ts.map +1 -1
  44. package/dist/Chat/ChatComposerInput.js +20 -16
  45. package/dist/Chat/ChatDictationButton.js +10 -10
  46. package/dist/Chat/ChatLayout.d.ts +1 -11
  47. package/dist/Chat/ChatLayout.d.ts.map +1 -1
  48. package/dist/Chat/ChatLayout.js +23 -21
  49. package/dist/Chat/ChatLayoutScrollButton.d.ts.map +1 -1
  50. package/dist/Chat/ChatLayoutScrollButton.js +13 -11
  51. package/dist/Chat/ChatMessage.d.ts +1 -1
  52. package/dist/Chat/ChatMessage.d.ts.map +1 -1
  53. package/dist/Chat/ChatMessage.js +20 -14
  54. package/dist/Chat/ChatMessageBubble.d.ts +1 -1
  55. package/dist/Chat/ChatMessageBubble.d.ts.map +1 -1
  56. package/dist/Chat/ChatMessageBubble.js +10 -8
  57. package/dist/Chat/ChatMessageList.d.ts +1 -1
  58. package/dist/Chat/ChatMessageList.d.ts.map +1 -1
  59. package/dist/Chat/ChatMessageList.js +17 -15
  60. package/dist/Chat/ChatMessageMetadata.d.ts.map +1 -1
  61. package/dist/Chat/ChatMessageMetadata.js +24 -19
  62. package/dist/Chat/ChatPastedTextToken.d.ts.map +1 -1
  63. package/dist/Chat/ChatPastedTextToken.js +16 -14
  64. package/dist/Chat/ChatSendButton.d.ts.map +1 -1
  65. package/dist/Chat/ChatSendButton.js +6 -4
  66. package/dist/Chat/ChatSystemMessage.js +11 -11
  67. package/dist/Chat/ChatTokenizedText.js +8 -8
  68. package/dist/Chat/ChatToolCalls.js +73 -73
  69. package/dist/Chat/useSpeechRecognition.d.ts.map +1 -1
  70. package/dist/Chat/useSpeechRecognition.js +4 -2
  71. package/dist/Chat/useTriggerMenu.d.ts.map +1 -1
  72. package/dist/Chat/useTriggerMenu.js +19 -17
  73. package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
  74. package/dist/CheckboxInput/CheckboxInput.js +26 -24
  75. package/dist/CheckboxList/CheckboxList.d.ts +1 -1
  76. package/dist/CheckboxList/CheckboxList.d.ts.map +1 -1
  77. package/dist/CheckboxList/CheckboxList.js +12 -10
  78. package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
  79. package/dist/CheckboxList/CheckboxListItem.js +8 -6
  80. package/dist/Citation/Citation.d.ts.map +1 -1
  81. package/dist/Citation/Citation.js +20 -12
  82. package/dist/ClickableCard/ClickableCard.js +6 -6
  83. package/dist/Code/Code.js +3 -3
  84. package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
  85. package/dist/CodeBlock/CodeBlock.js +114 -96
  86. package/dist/Collapsible/Collapsible.js +11 -11
  87. package/dist/Collapsible/CollapsibleGroup.js +7 -7
  88. package/dist/CommandPalette/CommandPalette.d.ts +1 -1
  89. package/dist/CommandPalette/CommandPalette.d.ts.map +1 -1
  90. package/dist/CommandPalette/CommandPalette.js +39 -34
  91. package/dist/CommandPalette/CommandPaletteEmpty.js +3 -3
  92. package/dist/CommandPalette/CommandPaletteFooter.js +16 -16
  93. package/dist/CommandPalette/CommandPaletteGroup.js +5 -5
  94. package/dist/CommandPalette/CommandPaletteInput.d.ts +1 -1
  95. package/dist/CommandPalette/CommandPaletteInput.d.ts.map +1 -1
  96. package/dist/CommandPalette/CommandPaletteInput.js +17 -14
  97. package/dist/CommandPalette/CommandPaletteItem.js +3 -3
  98. package/dist/CommandPalette/CommandPaletteList.d.ts +1 -1
  99. package/dist/CommandPalette/CommandPaletteList.d.ts.map +1 -1
  100. package/dist/CommandPalette/CommandPaletteList.js +7 -4
  101. package/dist/ContextMenu/ContextMenu.d.ts +1 -1
  102. package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
  103. package/dist/ContextMenu/ContextMenu.js +14 -11
  104. package/dist/DateInput/DateInput.d.ts +1 -1
  105. package/dist/DateInput/DateInput.d.ts.map +1 -1
  106. package/dist/DateInput/DateInput.js +28 -23
  107. package/dist/DateRangeInput/DateRangeInput.d.ts +1 -1
  108. package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
  109. package/dist/DateRangeInput/DateRangeInput.js +32 -27
  110. package/dist/DateTimeInput/DateTimeInput.d.ts +1 -1
  111. package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
  112. package/dist/DateTimeInput/DateTimeInput.js +41 -33
  113. package/dist/Dialog/Dialog.js +9 -9
  114. package/dist/Dialog/DialogHeader.d.ts.map +1 -1
  115. package/dist/Dialog/DialogHeader.js +20 -18
  116. package/dist/Dialog/useImperativeDialog.js +3 -3
  117. package/dist/Divider/Divider.js +7 -7
  118. package/dist/DropdownMenu/DropdownMenu.d.ts +1 -1
  119. package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
  120. package/dist/DropdownMenu/DropdownMenu.js +21 -15
  121. package/dist/DropdownMenu/DropdownMenuItem.js +3 -3
  122. package/dist/DropdownMenu/renderDropdownItems.js +10 -10
  123. package/dist/EmptyState/EmptyState.d.ts +4 -1
  124. package/dist/EmptyState/EmptyState.d.ts.map +1 -1
  125. package/dist/EmptyState/EmptyState.js +9 -9
  126. package/dist/Field/Field.js +17 -17
  127. package/dist/Field/FieldLabel.js +15 -15
  128. package/dist/Field/InputClearButton.js +5 -5
  129. package/dist/FieldStatus/FieldStatus.js +3 -3
  130. package/dist/FileInput/FileInput.d.ts.map +1 -1
  131. package/dist/FileInput/FileInput.js +34 -30
  132. package/dist/FormLayout/FormLayout.js +5 -5
  133. package/dist/Grid/Grid.js +3 -3
  134. package/dist/Grid/GridSpan.js +3 -3
  135. package/dist/HStack/HStack.js +3 -3
  136. package/dist/Heading/Heading.js +10 -10
  137. package/dist/HoverCard/HoverCard.js +9 -9
  138. package/dist/HoverCard/useHoverCard.js +3 -3
  139. package/dist/Icon/Icon.js +11 -11
  140. package/dist/Icon/defaultIcons.js +116 -116
  141. package/dist/IconButton/IconButton.js +3 -3
  142. package/dist/InputGroup/InputGroup.js +9 -9
  143. package/dist/InputGroup/InputGroupText.js +3 -3
  144. package/dist/Item/Item.js +17 -17
  145. package/dist/Kbd/Kbd.js +5 -5
  146. package/dist/Layer/LayerProvider.js +7 -7
  147. package/dist/Layer/useLayer.js +5 -5
  148. package/dist/Layout/Layout.js +21 -21
  149. package/dist/Layout/LayoutContent.js +3 -3
  150. package/dist/Layout/LayoutFooter.js +5 -5
  151. package/dist/Layout/LayoutHeader.js +5 -5
  152. package/dist/Layout/LayoutPanel.js +3 -3
  153. package/dist/Lightbox/Lightbox.d.ts.map +1 -1
  154. package/dist/Lightbox/Lightbox.js +35 -33
  155. package/dist/Lightbox/useLightbox.d.ts +0 -1
  156. package/dist/Lightbox/useLightbox.d.ts.map +1 -1
  157. package/dist/Lightbox/useLightbox.js +3 -4
  158. package/dist/Link/Link.d.ts +5 -3
  159. package/dist/Link/Link.d.ts.map +1 -1
  160. package/dist/Link/Link.js +47 -18
  161. package/dist/Link/LinkProvider.js +3 -3
  162. package/dist/Link/useLinkify.js +3 -3
  163. package/dist/List/List.js +11 -11
  164. package/dist/List/ListItem.js +11 -11
  165. package/dist/Markdown/Markdown.d.ts.map +1 -1
  166. package/dist/Markdown/Markdown.js +111 -109
  167. package/dist/MetadataList/MetadataList.js +10 -10
  168. package/dist/MetadataList/MetadataListItem.js +15 -15
  169. package/dist/MobileNav/MobileNav.d.ts.map +1 -1
  170. package/dist/MobileNav/MobileNav.js +19 -17
  171. package/dist/MobileNav/MobileNavToggle.d.ts +1 -1
  172. package/dist/MobileNav/MobileNavToggle.d.ts.map +1 -1
  173. package/dist/MobileNav/MobileNavToggle.js +9 -6
  174. package/dist/MoreMenu/MoreMenu.d.ts +1 -1
  175. package/dist/MoreMenu/MoreMenu.d.ts.map +1 -1
  176. package/dist/MoreMenu/MoreMenu.js +7 -4
  177. package/dist/MultiSelector/MultiSelector.d.ts +1 -1
  178. package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
  179. package/dist/MultiSelector/MultiSelector.js +69 -62
  180. package/dist/NavIcon/NavIcon.js +3 -3
  181. package/dist/NavMenu/NavHeadingMenu.js +5 -5
  182. package/dist/NavMenu/NavHeadingMenuItem.js +8 -8
  183. package/dist/NumberInput/NumberInput.d.ts.map +1 -1
  184. package/dist/NumberInput/NumberInput.js +21 -17
  185. package/dist/Outline/Outline.d.ts +1 -1
  186. package/dist/Outline/Outline.d.ts.map +1 -1
  187. package/dist/Outline/Outline.js +19 -16
  188. package/dist/OverflowList/OverflowList.js +8 -8
  189. package/dist/Overlay/Overlay.js +3 -3
  190. package/dist/Overlay/OverlayScrim.js +5 -5
  191. package/dist/Overlay/useOverlay.d.ts +0 -3
  192. package/dist/Overlay/useOverlay.d.ts.map +1 -1
  193. package/dist/Overlay/useOverlay.js +3 -6
  194. package/dist/Pagination/Pagination.d.ts +1 -1
  195. package/dist/Pagination/Pagination.d.ts.map +1 -1
  196. package/dist/Pagination/Pagination.js +73 -46
  197. package/dist/Popover/Popover.js +16 -16
  198. package/dist/Popover/usePopover.d.ts.map +1 -1
  199. package/dist/Popover/usePopover.js +11 -8
  200. package/dist/PowerSearch/PowerSearch.d.ts +1 -1
  201. package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
  202. package/dist/PowerSearch/PowerSearch.js +95 -85
  203. package/dist/PowerSearch/PowerSearchEditPopover.d.ts +1 -1
  204. package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
  205. package/dist/PowerSearch/PowerSearchEditPopover.js +109 -103
  206. package/dist/PowerSearch/PowerSearchFilterEditor.js +3 -3
  207. package/dist/PowerSearch/PowerSearchToken.d.ts.map +1 -1
  208. package/dist/PowerSearch/PowerSearchToken.js +12 -8
  209. package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
  210. package/dist/PowerSearch/PowerSearchValueEditor.js +88 -75
  211. package/dist/PowerSearch/formatFilterValue.d.ts +2 -1
  212. package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
  213. package/dist/PowerSearch/formatFilterValue.js +19 -9
  214. package/dist/PowerSearch/index.d.ts +2 -1
  215. package/dist/PowerSearch/index.d.ts.map +1 -1
  216. package/dist/PowerSearch/index.js +1 -0
  217. package/dist/PowerSearch/resolveOperatorLabel.d.ts +23 -0
  218. package/dist/PowerSearch/resolveOperatorLabel.d.ts.map +1 -0
  219. package/dist/PowerSearch/resolveOperatorLabel.js +28 -0
  220. package/dist/PowerSearch/types.d.ts +28 -2
  221. package/dist/PowerSearch/types.d.ts.map +1 -1
  222. package/dist/PowerSearch/usePowerSearchConfig.d.ts.map +1 -1
  223. package/dist/PowerSearch/usePowerSearchConfig.js +27 -27
  224. package/dist/PowerSearch/usePowerSearchSource.d.ts.map +1 -1
  225. package/dist/PowerSearch/usePowerSearchSource.js +15 -8
  226. package/dist/ProgressBar/ProgressBar.js +13 -13
  227. package/dist/RadioList/RadioList.js +7 -7
  228. package/dist/RadioList/RadioListItem.js +18 -18
  229. package/dist/Resizable/ResizeHandle.d.ts +1 -1
  230. package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
  231. package/dist/Resizable/ResizeHandle.js +10 -7
  232. package/dist/Section/Section.js +5 -5
  233. package/dist/SegmentedControl/SegmentedControl.js +5 -5
  234. package/dist/SegmentedControl/SegmentedControlItem.js +7 -7
  235. package/dist/SelectableCard/SelectableCard.js +5 -5
  236. package/dist/Selector/Selector.d.ts.map +1 -1
  237. package/dist/Selector/Selector.js +57 -51
  238. package/dist/Selector/SelectorOption.js +3 -3
  239. package/dist/SideNav/SideNav.d.ts.map +1 -1
  240. package/dist/SideNav/SideNav.js +38 -36
  241. package/dist/SideNav/SideNavCollapseButton.d.ts.map +1 -1
  242. package/dist/SideNav/SideNavCollapseButton.js +8 -6
  243. package/dist/SideNav/SideNavHeading.d.ts.map +1 -1
  244. package/dist/SideNav/SideNavHeading.js +92 -90
  245. package/dist/SideNav/SideNavItem.d.ts.map +1 -1
  246. package/dist/SideNav/SideNavItem.js +49 -43
  247. package/dist/SideNav/SideNavSection.js +14 -14
  248. package/dist/Skeleton/Skeleton.js +3 -3
  249. package/dist/Slider/Slider.js +23 -23
  250. package/dist/Spinner/Spinner.js +9 -9
  251. package/dist/StatusDot/StatusDot.js +5 -5
  252. package/dist/Switch/Switch.d.ts.map +1 -1
  253. package/dist/Switch/Switch.js +29 -27
  254. package/dist/TabList/Tab.js +18 -18
  255. package/dist/TabList/TabList.d.ts +1 -1
  256. package/dist/TabList/TabList.d.ts.map +1 -1
  257. package/dist/TabList/TabList.js +9 -6
  258. package/dist/TabList/TabMenu.js +23 -23
  259. package/dist/Table/BaseTable.d.ts.map +1 -1
  260. package/dist/Table/BaseTable.js +39 -37
  261. package/dist/Table/Table.d.ts.map +1 -1
  262. package/dist/Table/Table.js +10 -8
  263. package/dist/Table/TableBody.js +3 -3
  264. package/dist/Table/TableCell.js +3 -3
  265. package/dist/Table/TableFooter.js +3 -3
  266. package/dist/Table/TableHeader.js +3 -3
  267. package/dist/Table/TableHeaderCell.js +3 -3
  268. package/dist/Table/TableRow.js +5 -5
  269. package/dist/Table/index.d.ts +4 -0
  270. package/dist/Table/index.d.ts.map +1 -1
  271. package/dist/Table/index.js +2 -0
  272. package/dist/Table/plugins/columnResize/useTableColumnResize.js +9 -9
  273. package/dist/Table/plugins/filtering/useTableFiltering.d.ts.map +1 -1
  274. package/dist/Table/plugins/filtering/useTableFiltering.js +127 -90
  275. package/dist/Table/plugins/groupedRows/index.d.ts +3 -0
  276. package/dist/Table/plugins/groupedRows/index.d.ts.map +1 -0
  277. package/dist/Table/plugins/groupedRows/index.js +3 -0
  278. package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts +78 -0
  279. package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts.map +1 -0
  280. package/dist/Table/plugins/groupedRows/useTableGroupedRows.js +257 -0
  281. package/dist/Table/plugins/pagination/useTablePagination.d.ts.map +1 -1
  282. package/dist/Table/plugins/pagination/useTablePagination.js +12 -9
  283. package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts +1 -1
  284. package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
  285. package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +30 -28
  286. package/dist/Table/plugins/rowIndex/index.d.ts +3 -0
  287. package/dist/Table/plugins/rowIndex/index.d.ts.map +1 -0
  288. package/dist/Table/plugins/rowIndex/index.js +3 -0
  289. package/dist/Table/plugins/rowIndex/useTableRowIndex.d.ts +50 -0
  290. package/dist/Table/plugins/rowIndex/useTableRowIndex.d.ts.map +1 -0
  291. package/dist/Table/plugins/rowIndex/useTableRowIndex.js +91 -0
  292. package/dist/Table/plugins/selection/useTableSelection.d.ts.map +1 -1
  293. package/dist/Table/plugins/selection/useTableSelection.js +23 -20
  294. package/dist/Table/plugins/sortable/useTableSortable.d.ts.map +1 -1
  295. package/dist/Table/plugins/sortable/useTableSortable.js +23 -21
  296. package/dist/Table/tableContextMenu.js +9 -9
  297. package/dist/Text/Text.js +10 -10
  298. package/dist/TextArea/TextArea.js +14 -14
  299. package/dist/TextInput/TextInput.d.ts.map +1 -1
  300. package/dist/TextInput/TextInput.js +20 -16
  301. package/dist/Thumbnail/Thumbnail.d.ts.map +1 -1
  302. package/dist/Thumbnail/Thumbnail.js +37 -31
  303. package/dist/TimeInput/TimeInput.d.ts +1 -1
  304. package/dist/TimeInput/TimeInput.d.ts.map +1 -1
  305. package/dist/TimeInput/TimeInput.js +28 -23
  306. package/dist/Timestamp/Timestamp.d.ts.map +1 -1
  307. package/dist/Timestamp/Timestamp.js +29 -14
  308. package/dist/Toast/Toast.d.ts.map +1 -1
  309. package/dist/Toast/Toast.js +17 -15
  310. package/dist/Toast/ToastViewport.d.ts.map +1 -1
  311. package/dist/Toast/ToastViewport.js +14 -12
  312. package/dist/Toast/useToast.js +4 -4
  313. package/dist/ToggleButton/ToggleButton.js +12 -12
  314. package/dist/ToggleButton/ToggleButtonGroup.js +5 -5
  315. package/dist/Token/Token.d.ts.map +1 -1
  316. package/dist/Token/Token.js +29 -23
  317. package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
  318. package/dist/Tokenizer/Tokenizer.js +33 -31
  319. package/dist/Toolbar/Toolbar.js +18 -18
  320. package/dist/Tooltip/Tooltip.js +11 -11
  321. package/dist/Tooltip/useTooltip.js +3 -3
  322. package/dist/TopNav/TopNav.d.ts +2 -1
  323. package/dist/TopNav/TopNav.d.ts.map +1 -1
  324. package/dist/TopNav/TopNav.js +36 -33
  325. package/dist/TopNav/TopNavHeading.d.ts.map +1 -1
  326. package/dist/TopNav/TopNavHeading.js +72 -70
  327. package/dist/TopNav/TopNavItem.js +5 -5
  328. package/dist/TopNav/TopNavMegaMenu.js +30 -30
  329. package/dist/TopNav/TopNavMegaMenuFeaturedCard.js +10 -10
  330. package/dist/TopNav/TopNavMegaMenuItem.js +16 -16
  331. package/dist/TopNav/TopNavMenu.js +32 -32
  332. package/dist/TreeList/TreeList.d.ts.map +1 -1
  333. package/dist/TreeList/TreeList.js +13 -9
  334. package/dist/TreeList/TreeListBranches.js +11 -11
  335. package/dist/TreeList/TreeListItem.d.ts.map +1 -1
  336. package/dist/TreeList/TreeListItem.js +37 -31
  337. package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
  338. package/dist/Typeahead/BaseTypeahead.js +26 -22
  339. package/dist/Typeahead/Typeahead.d.ts.map +1 -1
  340. package/dist/Typeahead/Typeahead.js +15 -13
  341. package/dist/Typeahead/TypeaheadItem.js +10 -10
  342. package/dist/VStack/VStack.js +3 -3
  343. package/dist/VisuallyHidden/VisuallyHidden.d.ts +1 -3
  344. package/dist/VisuallyHidden/VisuallyHidden.d.ts.map +1 -1
  345. package/dist/VisuallyHidden/VisuallyHidden.js +1 -3
  346. package/dist/astryx.css +20 -2
  347. package/dist/astryx.umd.js +66 -64
  348. package/dist/astryx.umd.js.map +4 -4
  349. package/dist/authoring/doc.d.ts +145 -0
  350. package/dist/authoring/doc.d.ts.map +1 -0
  351. package/dist/authoring/doc.js +100 -0
  352. package/dist/authoring/index.d.ts +29 -0
  353. package/dist/authoring/index.d.ts.map +1 -0
  354. package/dist/authoring/index.js +28 -0
  355. package/dist/authoring/integration.d.ts +35 -0
  356. package/dist/authoring/integration.d.ts.map +1 -0
  357. package/dist/authoring/integration.js +30 -0
  358. package/dist/authoring/template.d.ts +66 -0
  359. package/dist/authoring/template.d.ts.map +1 -0
  360. package/dist/authoring/template.js +55 -0
  361. package/dist/config.d.ts +80 -0
  362. package/dist/config.d.ts.map +1 -0
  363. package/dist/config.js +40 -0
  364. package/dist/hooks/useKeyboardHint.js +9 -9
  365. package/dist/i18n/InternationalizationContext.d.ts +12 -0
  366. package/dist/i18n/InternationalizationContext.d.ts.map +1 -0
  367. package/dist/i18n/InternationalizationContext.js +29 -0
  368. package/dist/i18n/InternationalizationProvider.d.ts +62 -0
  369. package/dist/i18n/InternationalizationProvider.d.ts.map +1 -0
  370. package/dist/i18n/InternationalizationProvider.js +44 -0
  371. package/dist/i18n/index.d.ts +24 -0
  372. package/dist/i18n/index.d.ts.map +1 -0
  373. package/dist/i18n/index.js +21 -0
  374. package/dist/i18n/resolve.d.ts +22 -0
  375. package/dist/i18n/resolve.d.ts.map +1 -0
  376. package/dist/i18n/resolve.js +141 -0
  377. package/dist/i18n/translator.d.ts +25 -0
  378. package/dist/i18n/translator.d.ts.map +1 -0
  379. package/dist/i18n/translator.js +1 -0
  380. package/dist/i18n/types.d.ts +47 -0
  381. package/dist/i18n/types.d.ts.map +1 -0
  382. package/dist/i18n/types.js +1 -0
  383. package/dist/i18n/useTranslator.d.ts +15 -0
  384. package/dist/i18n/useTranslator.d.ts.map +1 -0
  385. package/dist/i18n/useTranslator.js +39 -0
  386. package/dist/index.d.ts +1 -0
  387. package/dist/index.d.ts.map +1 -1
  388. package/dist/index.js +3 -0
  389. package/dist/theme/MediaTheme.js +3 -3
  390. package/dist/theme/Theme.js +7 -7
  391. package/dist/theme/syntax/SyntaxTheme.js +5 -5
  392. package/locales/en.json +746 -0
  393. package/locales/pseudo.json +560 -0
  394. package/package.json +24 -3
  395. package/src/AlertDialog/AlertDialog.doc.mjs +5 -0
  396. package/src/AlertDialog/AlertDialog.tsx +4 -1
  397. package/src/AlertDialog/useImperativeAlertDialog.tsx +0 -2
  398. package/src/AppShell/AppShell.doc.mjs +8 -2
  399. package/src/AppShell/AppShell.tsx +3 -1
  400. package/src/AvatarGroup/AvatarGroup.tsx +4 -1
  401. package/src/Banner/Banner.tsx +10 -5
  402. package/src/Breadcrumbs/Breadcrumbs.tsx +4 -1
  403. package/src/Button/Button.tsx +34 -4
  404. package/src/ButtonGroup/ButtonGroup.test.tsx +386 -2
  405. package/src/ButtonGroup/ButtonGroup.tsx +27 -11
  406. package/src/Calendar/Calendar.tsx +8 -5
  407. package/src/Card/Card.doc.mjs +3 -3
  408. package/src/Carousel/Carousel.tsx +10 -7
  409. package/src/Chat/ChatComposer.tsx +5 -1
  410. package/src/Chat/ChatComposerDrawer.tsx +9 -2
  411. package/src/Chat/ChatComposerInput.tsx +10 -4
  412. package/src/Chat/ChatLayout.tsx +5 -12
  413. package/src/Chat/ChatLayoutScrollButton.tsx +4 -2
  414. package/src/Chat/ChatMessage.tsx +5 -1
  415. package/src/Chat/ChatMessageBubble.tsx +2 -0
  416. package/src/Chat/ChatMessageList.doc.mjs +1 -1
  417. package/src/Chat/ChatMessageList.tsx +2 -0
  418. package/src/Chat/ChatMessageMetadata.tsx +15 -9
  419. package/src/Chat/ChatPastedTextToken.tsx +3 -1
  420. package/src/Chat/ChatSendButton.tsx +3 -1
  421. package/src/Chat/ChatToolCalls.doc.mjs +1 -1
  422. package/src/Chat/useSpeechRecognition.ts +11 -2
  423. package/src/Chat/useTriggerMenu.tsx +4 -2
  424. package/src/CheckboxInput/CheckboxInput.test.tsx +16 -0
  425. package/src/CheckboxInput/CheckboxInput.tsx +4 -2
  426. package/src/CheckboxList/CheckboxList.doc.mjs +6 -1
  427. package/src/CheckboxList/CheckboxList.tsx +2 -0
  428. package/src/CheckboxList/CheckboxListItem.tsx +7 -1
  429. package/src/Citation/Citation.tsx +4 -2
  430. package/src/ClickableCard/ClickableCard.doc.mjs +1 -1
  431. package/src/CodeBlock/CodeBlock.tsx +91 -40
  432. package/src/Collapsible/Collapsible.doc.mjs +3 -3
  433. package/src/CommandPalette/CommandPalette.tsx +10 -3
  434. package/src/CommandPalette/CommandPaletteInput.test.tsx +1 -1
  435. package/src/CommandPalette/CommandPaletteInput.tsx +5 -1
  436. package/src/CommandPalette/CommandPaletteList.tsx +4 -1
  437. package/src/ContextMenu/ContextMenu.tsx +4 -1
  438. package/src/DateInput/DateInput.doc.mjs +2 -2
  439. package/src/DateInput/DateInput.tsx +13 -5
  440. package/src/DateRangeInput/DateRangeInput.doc.mjs +7 -7
  441. package/src/DateRangeInput/DateRangeInput.tsx +14 -6
  442. package/src/DateTimeInput/DateTimeInput.doc.mjs +2 -2
  443. package/src/DateTimeInput/DateTimeInput.tsx +17 -7
  444. package/src/Dialog/DialogHeader.tsx +4 -2
  445. package/src/DropdownMenu/DropdownMenu.tsx +12 -8
  446. package/src/EmptyState/EmptyState.doc.mjs +3 -3
  447. package/src/EmptyState/EmptyState.tsx +4 -1
  448. package/src/Field/Field.doc.mjs +2 -2
  449. package/src/FileInput/FileInput.tsx +3 -1
  450. package/src/Grid/Grid.doc.mjs +5 -5
  451. package/src/InputGroup/InputGroup.doc.mjs +1 -1
  452. package/src/Layer/useLayer.doc.mjs +2 -2
  453. package/src/Lightbox/Lightbox.doc.mjs +7 -2
  454. package/src/Lightbox/Lightbox.tsx +6 -4
  455. package/src/Lightbox/useLightbox.tsx +0 -1
  456. package/src/Link/Link.test.tsx +74 -2
  457. package/src/Link/Link.tsx +48 -3
  458. package/src/Markdown/Markdown.tsx +12 -4
  459. package/src/MobileNav/MobileNav.tsx +4 -2
  460. package/src/MobileNav/MobileNavToggle.tsx +5 -3
  461. package/src/MoreMenu/MoreMenu.tsx +4 -1
  462. package/src/MultiSelector/MultiSelector.tsx +14 -5
  463. package/src/NumberInput/NumberInput.tsx +3 -1
  464. package/src/Outline/Outline.tsx +4 -1
  465. package/src/OverflowList/OverflowList.doc.mjs +2 -2
  466. package/src/Overlay/useOverlay.tsx +0 -3
  467. package/src/Pagination/Pagination.tsx +35 -12
  468. package/src/Popover/usePopover.tsx +6 -1
  469. package/src/PowerSearch/PowerSearch.doc.mjs +9 -4
  470. package/src/PowerSearch/PowerSearch.tsx +22 -10
  471. package/src/PowerSearch/PowerSearchEditPopover.tsx +27 -20
  472. package/src/PowerSearch/PowerSearchToken.tsx +17 -6
  473. package/src/PowerSearch/PowerSearchValueEditor.tsx +34 -21
  474. package/src/PowerSearch/formatFilterValue.test.ts +282 -0
  475. package/src/PowerSearch/formatFilterValue.ts +21 -8
  476. package/src/PowerSearch/index.ts +5 -0
  477. package/src/PowerSearch/resolveOperatorLabel.ts +34 -0
  478. package/src/PowerSearch/types.ts +33 -9
  479. package/src/PowerSearch/usePowerSearchConfig.ts +59 -27
  480. package/src/PowerSearch/usePowerSearchSource.ts +17 -8
  481. package/src/RadioList/RadioList.doc.mjs +1 -1
  482. package/src/Resizable/ResizeHandle.tsx +4 -1
  483. package/src/Section/Section.doc.mjs +4 -4
  484. package/src/SelectableCard/SelectableCard.doc.mjs +1 -1
  485. package/src/Selector/Selector.tsx +11 -6
  486. package/src/SideNav/SideNav.tsx +4 -2
  487. package/src/SideNav/SideNavCollapseButton.tsx +3 -1
  488. package/src/SideNav/SideNavHeading.tsx +5 -3
  489. package/src/SideNav/SideNavItem.tsx +3 -1
  490. package/src/Slider/Slider.doc.mjs +2 -2
  491. package/src/Stack/Stack.doc.mjs +10 -10
  492. package/src/Switch/Switch.doc.mjs +2 -2
  493. package/src/Switch/Switch.test.tsx +16 -0
  494. package/src/Switch/Switch.tsx +4 -2
  495. package/src/TabList/TabList.tsx +4 -1
  496. package/src/Table/BaseTable.tsx +8 -1
  497. package/src/Table/Table.doc.mjs +1 -1
  498. package/src/Table/Table.tsx +3 -1
  499. package/src/Table/index.ts +7 -0
  500. package/src/Table/plugins/filtering/useTableFiltering.tsx +31 -30
  501. package/src/Table/plugins/groupedRows/index.ts +7 -0
  502. package/src/Table/plugins/groupedRows/useTableGroupedRows.test.tsx +231 -0
  503. package/src/Table/plugins/groupedRows/useTableGroupedRows.tsx +351 -0
  504. package/src/Table/plugins/pagination/useTablePagination.tsx +4 -1
  505. package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +8 -4
  506. package/src/Table/plugins/rowIndex/index.ts +4 -0
  507. package/src/Table/plugins/rowIndex/useTableRowIndex.test.tsx +132 -0
  508. package/src/Table/plugins/rowIndex/useTableRowIndex.tsx +114 -0
  509. package/src/Table/plugins/selection/useTableSelection.tsx +6 -7
  510. package/src/Table/plugins/sortable/useTableSortable.tsx +8 -5
  511. package/src/Table/useTableFiltering.doc.mjs +2 -2
  512. package/src/Table/useTableGroupedRows.doc.mjs +71 -0
  513. package/src/Table/useTableRowIndex.doc.mjs +50 -0
  514. package/src/Table/useTableSortable.doc.mjs +11 -11
  515. package/src/Text/Text.doc.mjs +2 -2
  516. package/src/TextInput/TextInput.tsx +3 -1
  517. package/src/Thumbnail/Thumbnail.tsx +4 -2
  518. package/src/TimeInput/TimeInput.doc.mjs +2 -2
  519. package/src/TimeInput/TimeInput.tsx +6 -2
  520. package/src/Timestamp/Timestamp.doc.mjs +4 -4
  521. package/src/Timestamp/Timestamp.test.tsx +120 -7
  522. package/src/Timestamp/Timestamp.tsx +21 -1
  523. package/src/Toast/Toast.tsx +3 -1
  524. package/src/Toast/ToastViewport.tsx +3 -1
  525. package/src/Token/Token.tsx +4 -2
  526. package/src/Tokenizer/Tokenizer.doc.mjs +2 -2
  527. package/src/Tokenizer/Tokenizer.tsx +4 -4
  528. package/src/Toolbar/Toolbar.doc.mjs +1 -1
  529. package/src/TopNav/TopNav.doc.mjs +1 -0
  530. package/src/TopNav/TopNav.test.tsx +30 -0
  531. package/src/TopNav/TopNav.tsx +6 -4
  532. package/src/TopNav/TopNavHeading.tsx +5 -3
  533. package/src/TreeList/TreeList.tsx +5 -1
  534. package/src/TreeList/TreeListItem.tsx +6 -1
  535. package/src/Typeahead/BaseTypeahead.tsx +11 -4
  536. package/src/Typeahead/Typeahead.doc.mjs +1 -1
  537. package/src/Typeahead/Typeahead.tsx +3 -1
  538. package/src/VisuallyHidden/VisuallyHidden.tsx +1 -3
  539. package/src/authoring/doc.ts +166 -0
  540. package/src/authoring/index.test.ts +52 -0
  541. package/src/authoring/index.ts +50 -0
  542. package/src/authoring/integration.ts +42 -0
  543. package/src/authoring/template.ts +74 -0
  544. package/src/config.test.ts +16 -0
  545. package/src/config.ts +92 -0
  546. package/src/docPropLiterals.test.ts +902 -0
  547. package/src/hooks/useHotkeys.doc.mjs +5 -5
  548. package/src/i18n/InternationalizationContext.ts +39 -0
  549. package/src/i18n/InternationalizationProvider.doc.mjs +72 -0
  550. package/src/i18n/InternationalizationProvider.tsx +83 -0
  551. package/src/i18n/__tests__/e2e-pagination.test.tsx +172 -0
  552. package/src/i18n/__tests__/e2e-powersearch.test.tsx +130 -0
  553. package/src/i18n/__tests__/resolve.test.ts +284 -0
  554. package/src/i18n/index.ts +32 -0
  555. package/src/i18n/resolve.ts +165 -0
  556. package/src/i18n/translator.ts +31 -0
  557. package/src/i18n/types.ts +53 -0
  558. package/src/i18n/useTranslator.doc.mjs +46 -0
  559. package/src/i18n/useTranslator.ts +50 -0
  560. package/src/index.ts +3 -0
  561. package/dist/NavItem/index.d.ts +0 -9
  562. package/dist/NavItem/index.d.ts.map +0 -1
  563. package/dist/NavItem/index.js +0 -10
  564. package/src/NavItem/index.ts +0 -11
@@ -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();
@@ -21,6 +21,7 @@ import type {BaseProps} from '../BaseProps';
21
21
  import * as stylex from '@stylexjs/stylex';
22
22
  import {spacingVars} from '../theme/tokens.stylex';
23
23
  import {mergeProps} from '../utils';
24
+ import {useTranslator} from '../i18n';
24
25
  import {TopNavSlotContext} from './TopNavContext';
25
26
  import {useTopNavRenderMode} from './TopNavRenderContext';
26
27
  import {useTopNavMobileContent} from './TopNavMobileContentContext';
@@ -147,6 +148,7 @@ export interface TopNavProps extends BaseProps<HTMLElement> {
147
148
  /**
148
149
  * Accessible label for the navigation landmark.
149
150
  * Helps screen readers identify the navigation area.
151
+ * @default 'Top navigation'
150
152
  */
151
153
  label?: string;
152
154
  }
@@ -176,13 +178,15 @@ export function TopNav({
176
178
  children,
177
179
  centerContent,
178
180
  endContent,
179
- label,
181
+ label: labelFromProps,
180
182
  xstyle,
181
183
  className,
182
184
  style,
183
185
  ref,
184
186
  ...props
185
187
  }: TopNavProps) {
188
+ const t = useTranslator();
189
+ const label = labelFromProps ?? t('@astryx.topNav.landmarkLabel');
186
190
  const renderMode = useTopNavRenderMode();
187
191
  const mobileContent = useTopNavMobileContent();
188
192
  const {hasAutoToggle} = useAppShellMobile();
@@ -294,9 +298,7 @@ export function TopNav({
294
298
  ) : (
295
299
  endContent && (
296
300
  <div {...stylex.props(styles.endContent)}>
297
- <TopNavSlotContext value="end">
298
- {endContent}
299
- </TopNavSlotContext>
301
+ <TopNavSlotContext value="end">{endContent}</TopNavSlotContext>
300
302
  </div>
301
303
  )
302
304
  )}
@@ -39,6 +39,7 @@ import type {BaseProps} from '../BaseProps';
39
39
  import {useMenuHover} from '../hooks/useMenuHover';
40
40
  import {NavHeadingCloseContext} from '../NavMenu/NavMenuContext';
41
41
  import {themeProps} from '../utils/themeProps';
42
+ import {useTranslator} from '../i18n';
42
43
 
43
44
  // =============================================================================
44
45
  // Styles
@@ -318,6 +319,7 @@ export function TopNavHeading({
318
319
  ref,
319
320
  ...props
320
321
  }: TopNavHeadingProps) {
322
+ const t = useTranslator();
321
323
  const LinkComponent = useLinkComponent(as);
322
324
  // Support both headingHref and legacy href
323
325
  const headingHref = headingHrefProp ?? href;
@@ -329,7 +331,7 @@ export function TopNavHeading({
329
331
  const rootRef = useRef<HTMLElement>(null);
330
332
 
331
333
  const popover = usePopover({
332
- dialogLabel: 'Navigation menu',
334
+ dialogLabel: t('@astryx.topNav.heading.dialogLabel'),
333
335
  hasCloseButton: false,
334
336
  });
335
337
 
@@ -494,7 +496,7 @@ export function TopNavHeading({
494
496
  {renderTextContent(
495
497
  <button
496
498
  type="button"
497
- aria-label="Open menu"
499
+ aria-label={t('@astryx.topNav.heading.openMenu')}
498
500
  onClick={e => {
499
501
  e.stopPropagation();
500
502
  triggerProps.onClick();
@@ -557,7 +559,7 @@ export function TopNavHeading({
557
559
  showChevron ? (
558
560
  <button
559
561
  type="button"
560
- aria-label="Open menu"
562
+ aria-label={t('@astryx.topNav.heading.openMenu')}
561
563
  onClick={e => {
562
564
  e.stopPropagation();
563
565
  triggerProps.onClick();
@@ -208,8 +208,12 @@ export function TreeList({
208
208
  // to this treeitem's own row — never a descendant treeitem's action inside an
209
209
  // expanded group.
210
210
  const activateItem = useCallback((current: HTMLElement): boolean => {
211
+ // The chevron toggle is marked with `data-tree-toggle` (set by
212
+ // TreeListItem) so this filter stays stable across locales — matching by
213
+ // aria-label would break under any locale where "Toggle children" is
214
+ // translated.
211
215
  const candidates = current.querySelectorAll<HTMLElement>(
212
- 'a[href], button:not([aria-label="Toggle children"])',
216
+ 'a[href], button:not([data-tree-toggle])',
213
217
  );
214
218
  for (const candidate of candidates) {
215
219
  if (candidate.closest('[role="treeitem"]') === current) {
@@ -31,6 +31,7 @@ import {TreeListBranches} from './TreeListBranches';
31
31
  import type {TreeListDensity} from './TreeListTypes';
32
32
  import {treeItemScope} from './treeListItem.markers.stylex';
33
33
  import {themeProps} from '../utils/themeProps';
34
+ import {useTranslator} from '../i18n';
34
35
 
35
36
  // =============================================================================
36
37
  // Styles
@@ -299,6 +300,7 @@ export function TreeListItem({
299
300
  setSize,
300
301
  isTabbable,
301
302
  }: TreeListItemInternalProps) {
303
+ const t = useTranslator();
302
304
  const labelId = useId();
303
305
  const descriptionId = useId();
304
306
  const LinkComponent = useLinkComponent();
@@ -374,7 +376,10 @@ export function TreeListItem({
374
376
  <button
375
377
  type="button"
376
378
  aria-expanded={isExpanded}
377
- aria-label="Toggle children"
379
+ aria-label={t('@astryx.treeList.toggleChildren')}
380
+ // Stable identity for TreeList's activateItem selector — do not
381
+ // remove without also updating TreeList.tsx.
382
+ data-tree-toggle=""
378
383
  disabled={isDisabled}
379
384
  // Roving tabindex lives on the treeitem row; the chevron toggle is not
380
385
  // a separate tab stop. Row-level Enter/Space forwards to this button.
@@ -44,6 +44,7 @@ import {getKey, mergeProps, mergeRefs} from '../utils';
44
44
  import type {BaseProps} from '../BaseProps';
45
45
  import type {SearchableItem, SearchSource} from './types';
46
46
  import {themeProps} from '../utils/themeProps';
47
+ import {useTranslator} from '../i18n';
47
48
 
48
49
  // =============================================================================
49
50
  // Types
@@ -302,10 +303,10 @@ export const BaseTypeahead = function BaseTypeahead<T extends SearchableItem>({
302
303
  value,
303
304
  onChange,
304
305
  renderItem,
305
- placeholder = 'Search...',
306
+ placeholder: placeholderFromProps,
306
307
  hasEntriesOnFocus = false,
307
308
  maxMenuItems = 10,
308
- emptySearchResultsText = 'No results found',
309
+ emptySearchResultsText: emptySearchResultsTextFromProps,
309
310
  isDisabled = false,
310
311
  isFocusableDisabled = false,
311
312
  hasAutoFocus = false,
@@ -321,6 +322,12 @@ export const BaseTypeahead = function BaseTypeahead<T extends SearchableItem>({
321
322
  size = 'md',
322
323
  ref,
323
324
  }: BaseTypeaheadProps<T>) {
325
+ const t = useTranslator();
326
+ const placeholder =
327
+ placeholderFromProps ?? t('@astryx.typeahead.searchPlaceholder');
328
+ const emptySearchResultsText =
329
+ emptySearchResultsTextFromProps ??
330
+ t('@astryx.typeahead.emptySearchResults');
324
331
  const generatedId = useId();
325
332
  const inputId = externalInputId ?? generatedId;
326
333
  const listboxId = useId();
@@ -759,7 +766,7 @@ export const BaseTypeahead = function BaseTypeahead<T extends SearchableItem>({
759
766
  {isLoading && (
760
767
  <span
761
768
  role="status"
762
- aria-label="Loading"
769
+ aria-label={t('@astryx.typeahead.loading')}
763
770
  {...stylex.props(styles.loadingSpinner)}>
764
771
  <Icon icon="clock" size="sm" color="secondary" />
765
772
  </span>
@@ -769,7 +776,7 @@ export const BaseTypeahead = function BaseTypeahead<T extends SearchableItem>({
769
776
  <div
770
777
  id={listboxId}
771
778
  role="listbox"
772
- aria-label="Search results"
779
+ aria-label={t('@astryx.typeahead.searchResults')}
773
780
  {...mergeProps(
774
781
  themeProps('typeahead-dropdown'),
775
782
  stylex.props(styles.dropdown),
@@ -85,7 +85,7 @@ export const docs = {
85
85
  },
86
86
  {
87
87
  name: 'status',
88
- type: 'InputStatus',
88
+ type: "{type: 'warning' | 'error' | 'success', message?: string}",
89
89
  description:
90
90
  'Validation status object with type and message for error/warning/success states.',
91
91
  },
@@ -49,6 +49,7 @@ import type {BaseProps} from '../BaseProps';
49
49
  import type {SizeValue} from '../utils/types';
50
50
  import type {SearchableItem, SearchSource} from './types';
51
51
  import {themeProps} from '../utils/themeProps';
52
+ import {useTranslator} from '../i18n';
52
53
 
53
54
  export type {
54
55
  InputStatus as TypeaheadStatus,
@@ -249,6 +250,7 @@ export function Typeahead<T extends SearchableItem>({
249
250
  style,
250
251
  'data-testid': testId,
251
252
  }: TypeaheadProps<T>) {
253
+ const t = useTranslator();
252
254
  const size = useSize(sizeProp, 'md');
253
255
  const inputId = useId();
254
256
  const inputLabelId = useId();
@@ -460,7 +462,7 @@ export function Typeahead<T extends SearchableItem>({
460
462
  />
461
463
  {hasClear && value && !isDisabled && (
462
464
  <InputClearButton
463
- label="Clear selection"
465
+ label={t('@astryx.typeahead.clearSelection')}
464
466
  onClick={e => {
465
467
  e.stopPropagation();
466
468
  handleClear();
@@ -13,6 +13,7 @@
13
13
  * - /packages/core/src/VisuallyHidden/VisuallyHidden.doc.mjs
14
14
  * - /packages/core/src/VisuallyHidden/VisuallyHidden.test.tsx
15
15
  * - /apps/storybook/stories/VisuallyHidden.stories.tsx
16
+ * - /packages/cli/templates/blocks/components/VisuallyHidden/ (showcase blocks)
16
17
  */
17
18
 
18
19
  import {createElement, type ElementType, type ReactNode, type Ref} from 'react';
@@ -79,12 +80,9 @@ const styles = stylex.create({
79
80
  *
80
81
  * @example
81
82
  * ```
82
- * // Accessible name for an icon-only button
83
83
  * <IconButton icon="trash" label="">
84
84
  * <VisuallyHidden>Delete incident</VisuallyHidden>
85
85
  * </IconButton>
86
- *
87
- * // Live region for announcements
88
86
  * <VisuallyHidden as="div" aria-live="polite">
89
87
  * {`Moved ${task} to ${column}`}
90
88
  * </VisuallyHidden>
@@ -0,0 +1,166 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @file doc.ts
5
+ * @input A component/function/generic doc object (without the `type` tag).
6
+ * @output Type-preserving `createComponentDoc`/`createFunctionDoc`/`createDoc`
7
+ * helpers plus the doc-authoring TypeScript surface.
8
+ * @position Integration-author authoring surface. See `./index.ts` for why
9
+ * these authoring factories live in `@astryxdesign/core`.
10
+ *
11
+ * A doc describes a documentable unit of the design system so the CLI and docs
12
+ * surfaces can list, search, and render it. There are three kinds, each a tiny
13
+ * runtime identity helper that stamps a `type` discriminant:
14
+ *
15
+ * - `createComponentDoc` -> `type: 'component'` — a component (or a family).
16
+ * - `createFunctionDoc` -> `type: 'function'` — any function, including
17
+ * hooks: an "inputs + outputs" surface (`params` + `returns`).
18
+ * - `createDoc` -> `type: 'generic'` — reference/topic docs.
19
+ *
20
+ * These factories do NOT validate. Validation happens at the CLI load boundary,
21
+ * where doc discovery runs the loaded value through a schema that accepts BOTH
22
+ * the stamped formats and the legacy loose `export const docs = {...}` shape.
23
+ */
24
+
25
+ /**
26
+ * Fields shared by every doc kind (component + function + generic).
27
+ *
28
+ * `group` vs `parent` are distinct:
29
+ * - `group` is a FLAT sidebar bucket label; many docs can share it and it is
30
+ * NOT an inheritance key.
31
+ * - `parent` is a DIRECTED inheritance/composition pointer — a doc naming the
32
+ * doc it belongs to (e.g. a sub-component naming its parent component). The
33
+ * legacy `subComponentOf` field is a synonym.
34
+ *
35
+ * `relatedDocs` is a single flat curated cross-reference list; it replaces the
36
+ * legacy split `relatedComponents` + `relatedHooks`.
37
+ */
38
+ export interface AstryxBaseDocInput {
39
+ /** Name of the documented unit, without any prefix, PascalCase. Required. */
40
+ name: string;
41
+ /** Human-readable display name for gallery/sidebar. */
42
+ displayName?: string;
43
+ /** Short description. */
44
+ description?: string;
45
+ /** Usage documentation (description, best practices, anatomy, slotElements). */
46
+ usage?: unknown;
47
+ /** Flat sidebar grouping label (not an inheritance key). */
48
+ group?: string;
49
+ /** Overview-page functional category. */
50
+ category?: string;
51
+ /** CLI fuzzy-search keywords. */
52
+ keywords?: string[];
53
+ /** Directed inheritance/composition pointer to the doc this belongs to. */
54
+ parent?: string;
55
+ /** Flat curated cross-reference list of related doc names. */
56
+ relatedDocs?: string[];
57
+ /** Hide the whole doc from human-facing UI (stays importable/discoverable). */
58
+ hidden?: boolean;
59
+ /** Exclude from the categorized overview page (kept in sidebar/CLI). */
60
+ isHiddenFromOverview?: boolean;
61
+ /** Any additional fields the rich doc surface carries. */
62
+ [key: string]: unknown;
63
+ }
64
+
65
+ /** A single documented prop (mirrors `PropDoc` from core docs-types). */
66
+ export interface AstryxPropInput {
67
+ name: string;
68
+ type: string;
69
+ description: string;
70
+ default?: string;
71
+ required?: boolean;
72
+ [key: string]: unknown;
73
+ }
74
+
75
+ /** A single documented param (mirrors `HookParamDoc`). */
76
+ export interface AstryxParamInput {
77
+ name: string;
78
+ type: string;
79
+ description: string;
80
+ default?: string;
81
+ required?: boolean;
82
+ [key: string]: unknown;
83
+ }
84
+
85
+ /** A single documented return field (mirrors `HookReturnDoc`). */
86
+ export interface AstryxReturnInput {
87
+ name: string;
88
+ type: string;
89
+ description: string;
90
+ [key: string]: unknown;
91
+ }
92
+
93
+ /**
94
+ * Input accepted by {@link createComponentDoc}. A component (or a family). The
95
+ * `type` discriminant is injected by the factory. `anatomy`/`slotElements` live
96
+ * inside `usage`; `importPath` is DERIVED (never authored).
97
+ */
98
+ export interface AstryxComponentDocInput extends AstryxBaseDocInput {
99
+ /** All public props for the component. */
100
+ props: AstryxPropInput[];
101
+ /** Theming/selector-surface metadata. */
102
+ theming?: unknown;
103
+ /** Interactive-preview playground configuration. */
104
+ playground?: unknown;
105
+ /** Short code examples rendered after the props table. */
106
+ examples?: unknown[];
107
+ }
108
+
109
+ /**
110
+ * Input accepted by {@link createFunctionDoc}. Covers any function, including
111
+ * hooks: an inputs (`params`) + outputs (`returns`) surface. The `type`
112
+ * discriminant is injected by the factory; `importPath` is DERIVED.
113
+ */
114
+ export interface AstryxFunctionDocInput extends AstryxBaseDocInput {
115
+ /** Function/hook parameters or options-object fields. */
116
+ params: AstryxParamInput[];
117
+ /** Return value documentation. One entry per field (or a single primitive). */
118
+ returns: AstryxReturnInput[];
119
+ }
120
+
121
+ /**
122
+ * Input accepted by {@link createDoc}. A generic reference/topic doc — just the
123
+ * shared base. The `type` discriminant is injected by the factory.
124
+ */
125
+ export type AstryxGenericDocInput = AstryxBaseDocInput;
126
+
127
+ /**
128
+ * Back-compat alias. Previously `createDoc` accepted a broad component-doc
129
+ * record; the union of the three input kinds preserves that permissiveness for
130
+ * any code referring to the old name.
131
+ */
132
+ export type AstryxComponentDoc =
133
+ | AstryxComponentDocInput
134
+ | AstryxFunctionDocInput
135
+ | AstryxGenericDocInput;
136
+
137
+ /**
138
+ * Author a component doc. Stamp-only: returns the def with `type: 'component'`
139
+ * injected. Validation happens at the CLI load boundary.
140
+ */
141
+ export function createComponentDoc<T extends AstryxComponentDocInput>(
142
+ def: T,
143
+ ): T & {type: 'component'} {
144
+ return {...def, type: 'component'};
145
+ }
146
+
147
+ /**
148
+ * Author a function doc (covers any function, including hooks). Stamp-only:
149
+ * returns the def with `type: 'function'` injected. Validation happens at the
150
+ * CLI load boundary.
151
+ */
152
+ export function createFunctionDoc<T extends AstryxFunctionDocInput>(
153
+ def: T,
154
+ ): T & {type: 'function'} {
155
+ return {...def, type: 'function'};
156
+ }
157
+
158
+ /**
159
+ * Author a generic reference/topic doc. Stamp-only: returns the def with
160
+ * `type: 'generic'` injected. Validation happens at the CLI load boundary.
161
+ */
162
+ export function createDoc<T extends AstryxGenericDocInput>(
163
+ def: T,
164
+ ): T & {type: 'generic'} {
165
+ return {...def, type: 'generic'};
166
+ }
@@ -0,0 +1,52 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ import {describe, expect, it} from 'vitest';
4
+ import {
5
+ createIntegration,
6
+ createPageTemplate,
7
+ createBlockTemplate,
8
+ createComponentDoc,
9
+ createFunctionDoc,
10
+ createDoc,
11
+ } from './index';
12
+
13
+ describe('authoring factories', () => {
14
+ it('createIntegration returns its argument unchanged', () => {
15
+ const input = {components: './c', templates: './t'};
16
+ expect(createIntegration(input)).toBe(input);
17
+ });
18
+
19
+ it('createPageTemplate / createBlockTemplate stamp the template type', () => {
20
+ expect(createPageTemplate({name: 'P', description: 'd'}).type).toBe('page');
21
+ expect(createBlockTemplate({name: 'B', description: 'd'}).type).toBe(
22
+ 'block',
23
+ );
24
+ });
25
+
26
+ it('createPageTemplate preserves authored fields', () => {
27
+ const t = createPageTemplate({name: 'P', description: 'd', category: 'x'});
28
+ expect(t).toMatchObject({
29
+ name: 'P',
30
+ description: 'd',
31
+ category: 'x',
32
+ type: 'page',
33
+ });
34
+ });
35
+
36
+ it('doc factories stamp the doc kind', () => {
37
+ expect(createComponentDoc({name: 'Button', props: []}).type).toBe(
38
+ 'component',
39
+ );
40
+ expect(
41
+ createFunctionDoc({name: 'useX', params: [], returns: []}).type,
42
+ ).toBe('function');
43
+ expect(createDoc({name: 'Topic'}).type).toBe('generic');
44
+ });
45
+
46
+ it('doc factories do not mutate the input object', () => {
47
+ const input = {name: 'Button', props: []};
48
+ const out = createComponentDoc(input);
49
+ expect(out).not.toBe(input);
50
+ expect(input).not.toHaveProperty('type');
51
+ });
52
+ });