@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
@@ -40,6 +40,7 @@ import {
40
40
  import {mergeProps, groupItems} from '../utils';
41
41
  import type {SearchableItem} from '../Typeahead/types';
42
42
  import {themeProps} from '../utils/themeProps';
43
+ import {useTranslator} from '../i18n';
43
44
  import type {ChatComposerTrigger, ChatComposerToken} from './ChatComposerInput';
44
45
 
45
46
  // =============================================================================
@@ -254,6 +255,7 @@ function deleteTriggerText(
254
255
  export function useTriggerMenu(
255
256
  options: UseTriggerMenuOptions,
256
257
  ): UseTriggerMenuReturn {
258
+ const t = useTranslator();
257
259
  const {
258
260
  triggers,
259
261
  editableRef,
@@ -697,7 +699,7 @@ export function useTriggerMenu(
697
699
  <div
698
700
  id={listboxId}
699
701
  role="listbox"
700
- aria-label={trigger?.menuLabel ?? 'Suggestions'}
702
+ aria-label={trigger?.menuLabel ?? t('@astryx.chatTriggerMenu.suggestions')}
701
703
  {...mergeProps(
702
704
  themeProps('trigger-menu'),
703
705
  stylex.props(styles.dropdown),
@@ -710,7 +712,7 @@ export function useTriggerMenu(
710
712
  xstyle: [styles.popoverSurface, styles.popoverGap],
711
713
  },
712
714
  );
713
- }, [popover, listboxId, state, selectItem, getItemId]);
715
+ }, [popover, listboxId, state, selectItem, getItemId, t]);
714
716
 
715
717
  return {
716
718
  state,
@@ -248,6 +248,22 @@ describe('CheckboxInput', () => {
248
248
  expect(screen.getByLabelText('Select row')).toBeInTheDocument();
249
249
  });
250
250
 
251
+ it('keeps description linked via aria-describedby when isLabelHidden', () => {
252
+ render(
253
+ <CheckboxInput
254
+ label="Select row"
255
+ isLabelHidden
256
+ description="Selects this row for bulk actions"
257
+ value={false}
258
+ onChange={() => {}}
259
+ />,
260
+ );
261
+ const checkbox = screen.getByRole('checkbox');
262
+ const description = screen.getByText('Selects this row for bulk actions');
263
+ expect(description.id).not.toBe('');
264
+ expect(checkbox.getAttribute('aria-describedby')).toContain(description.id);
265
+ });
266
+
251
267
  it('shows label visually by default', () => {
252
268
  render(
253
269
  <CheckboxInput label="Accept terms" value={false} onChange={() => {}} />,
@@ -446,9 +446,11 @@ export function CheckboxInput({
446
446
  );
447
447
 
448
448
  // Build aria-describedby from description and status message
449
- // Only include descriptionID when the element actually renders
449
+ // Only include descriptionID when the element actually renders.
450
+ // FieldLabel renders the description (with descriptionID) even when the
451
+ // label is visually hidden — it's sr-only, so keep it linked.
450
452
  const describedByParts: string[] = [];
451
- if (description && !isLabelHidden) {
453
+ if (description) {
452
454
  describedByParts.push(descriptionID);
453
455
  }
454
456
  if (status?.message) {
@@ -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: 'Status indicator ({ type, message }).',
90
90
  },
91
91
  {
@@ -108,6 +108,11 @@ export const docs = {
108
108
  { guidance: false, description: 'Wrap a disabled CheckboxList in Tooltip to explain why it is disabled; disabled controls swallow the hover events the wrapper needs. Use the disabledMessage prop instead.' },
109
109
  ],
110
110
  },
111
+ theming: {
112
+ targets: [
113
+ {className: 'astryx-checkbox-list'},
114
+ ],
115
+ },
111
116
  };
112
117
 
113
118
  /** @type {import('../docs-types').TranslationDoc} */
@@ -163,6 +163,7 @@ export function CheckboxList({
163
163
  className,
164
164
  style,
165
165
  'data-testid': dataTestId,
166
+ ...rest
166
167
  }: CheckboxListProps) {
167
168
  const inputID = useId();
168
169
  const labelID = useId();
@@ -234,6 +235,7 @@ export function CheckboxList({
234
235
 
235
236
  return (
236
237
  <Field
238
+ {...rest}
237
239
  ref={ref}
238
240
  data-testid={dataTestId}
239
241
  label={label}
@@ -26,6 +26,7 @@ import {CheckboxInput} from '../CheckboxInput/CheckboxInput';
26
26
  import {ListItem} from '../List/ListItem';
27
27
  import {ListContext} from '../List/ListContext';
28
28
  import {CheckboxListContext} from './CheckboxListContext';
29
+ import {useTranslator} from '../i18n';
29
30
 
30
31
  // =============================================================================
31
32
  // Styles
@@ -132,6 +133,7 @@ export function CheckboxListItem({
132
133
  onClick: onClickProp,
133
134
  ...restProps
134
135
  }: CheckboxListItemProps) {
136
+ const t = useTranslator();
135
137
  const ctx = use(CheckboxListContext);
136
138
 
137
139
  if (ctx && ctx.value !== undefined && value === undefined) {
@@ -224,7 +226,11 @@ export function CheckboxListItem({
224
226
  style={style}
225
227
  startContent={
226
228
  <CheckboxInput
227
- label={typeof label === 'string' ? label : 'Checkbox'}
229
+ label={
230
+ typeof label === 'string'
231
+ ? label
232
+ : t('@astryx.checkboxList.item.checkbox')
233
+ }
228
234
  isLabelHidden
229
235
  value={resolvedChecked}
230
236
  onChange={() => handleToggle()}
@@ -28,6 +28,7 @@ import {
28
28
  import {mergeProps} from '../utils';
29
29
  import type {BaseProps} from '../BaseProps';
30
30
  import {themeProps} from '../utils/themeProps';
31
+ import {useTranslator} from '../i18n';
31
32
 
32
33
  export interface CitationSource {
33
34
  title?: string;
@@ -154,6 +155,7 @@ export function Citation({
154
155
  'data-testid': testId,
155
156
  ...rest
156
157
  }: CitationProps): React.ReactElement {
158
+ const t = useTranslator();
157
159
  const title = source.title ?? String(number);
158
160
  const href = source.url;
159
161
  const icon = source.icon;
@@ -181,7 +183,7 @@ export function Citation({
181
183
  {...rest}
182
184
  ref={elementRef}
183
185
  role={noteRole}
184
- aria-label={`Citation ${number}: ${title}`}
186
+ aria-label={t('@astryx.citation.label', {number, title})}
185
187
  data-testid={testId}
186
188
  {...linkProps}
187
189
  {...mergeProps(
@@ -204,7 +206,7 @@ export function Citation({
204
206
  {...rest}
205
207
  ref={elementRef}
206
208
  role={noteRole}
207
- aria-label={`Citation ${number}: ${title}`}
209
+ aria-label={t('@astryx.citation.label', {number, title})}
208
210
  data-testid={testId}
209
211
  {...linkProps}
210
212
  {...mergeProps(
@@ -26,7 +26,7 @@ export const docs = {
26
26
  {name: 'target', type: 'string', description: 'Link target.', default: "'_self'"},
27
27
  {name: 'isDisabled', type: 'boolean', description: 'Disables the card.', default: 'false'},
28
28
  {name: 'children', type: 'ReactNode', description: 'Card content.'},
29
- {name: 'padding', type: "SpacingStep", description: 'Inner padding.', default: '4'},
29
+ {name: 'padding', type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10', description: 'Inner padding.', default: '4'},
30
30
  {name: 'variant', type: "'default' | 'transparent' | 'muted' | 'blue' | 'cyan' | 'gray' | 'green' | 'orange' | 'pink' | 'purple' | 'red' | 'teal' | 'yellow'", description: 'Background color variant.', default: "'default'"},
31
31
  {name: 'width', type: 'SizeValue', description: 'Card width.'},
32
32
  {name: 'height', type: 'SizeValue', description: 'Card height.'},
@@ -45,6 +45,7 @@ import type {SyntaxToken, TokenLine} from './tokenizer';
45
45
  import {ensureHighlightStyles} from './highlightStyles';
46
46
  import {applyHighlightRangesChunked} from './highlightRanges';
47
47
  import {themeProps} from '../utils/themeProps';
48
+ import {useTranslator} from '../i18n';
48
49
  import {SyntaxTheme, type SyntaxThemeDefinition} from '../theme/syntax';
49
50
 
50
51
  // ---------------------------------------------------------------------------
@@ -78,6 +79,13 @@ const dynamicStyles = stylex.create({
78
79
  minWidth: value === 'fit-content' ? 'min(100%, 400px)' : null,
79
80
  maxWidth: value === 'fit-content' ? '100%' : null,
80
81
  }),
82
+ // Width of the line-number column, sized to the widest number. `ch` is the
83
+ // advance of "0" in the (monospace) code font, so N digits => N ch. Set on
84
+ // <code>; `--_codeblock-gutter-width` is unregistered so it inherits (with its var()
85
+ // substituted) down to the line divs that read it for their grid track.
86
+ gutterWidth: (digits: number) => ({
87
+ '--_codeblock-gutter-width': `${digits}ch`,
88
+ }),
81
89
  });
82
90
 
83
91
  const styles = stylex.create({
@@ -188,22 +196,6 @@ const styles = stylex.create({
188
196
  ':focus-visible': '2px',
189
197
  },
190
198
  },
191
- gutter: {
192
- flexShrink: 0,
193
- paddingBlock: spacingVars['--spacing-3'],
194
- paddingInlineStart: spacingVars['--spacing-4'],
195
- paddingInlineEnd: spacingVars['--spacing-3'],
196
- textAlign: 'end',
197
- userSelect: 'none',
198
- color: 'var(--color-syntax-punctuation)',
199
- borderRightWidth: borderVars['--border-width'],
200
- borderRightStyle: 'solid',
201
- borderRightColor: colorVars['--color-border'],
202
- },
203
- gutterLine: {
204
- fontFamily: typographyVars['--font-family-code'],
205
- lineHeight: typeScaleVars['--text-code-leading'],
206
- },
207
199
  code: {
208
200
  display: 'block',
209
201
  flex: 1,
@@ -222,9 +214,53 @@ const styles = stylex.create({
222
214
  wordBreak: 'break-all',
223
215
  overflowWrap: 'break-word',
224
216
  },
217
+ // With line numbers on, the <code> element hosts the full-height divider
218
+ // between the number gutter and the code. It spans the code's block padding
219
+ // too (inset-block: 0), so the rule reaches the top and bottom edges the way
220
+ // the old separate gutter column did. The numbers themselves are drawn per
221
+ // line (see `lineNumbered`) — a separate column can't track wrap height.
222
+ codeNumbered: {
223
+ position: 'relative',
224
+ '::after': {
225
+ content: '""',
226
+ position: 'absolute',
227
+ insetBlock: 0,
228
+ insetInlineStart: `calc(${spacingVars['--spacing-4']} + var(--_codeblock-gutter-width) + ${spacingVars['--spacing-3']})`,
229
+ width: 0,
230
+ borderInlineStartWidth: borderVars['--border-width'],
231
+ borderInlineStartStyle: 'solid',
232
+ borderInlineStartColor: colorVars['--color-border'],
233
+ pointerEvents: 'none',
234
+ },
235
+ },
225
236
  line: {
226
237
  lineHeight: typeScaleVars['--text-code-leading'],
227
238
  },
239
+ // Per-line number gutter: a two-column grid ([number] [code]). The number is
240
+ // a ::before generated from the data-line attribute. Because the number and
241
+ // its code occupy one grid row, the row grows to fit wrapped code while the
242
+ // number stays pinned to the row's first visual line (alignSelf: start) —
243
+ // this is what keeps numbers aligned when isWrapped wraps a line.
244
+ lineNumbered: {
245
+ display: 'grid',
246
+ gridTemplateColumns: 'var(--_codeblock-gutter-width) 1fr',
247
+ columnGap: `calc(${spacingVars['--spacing-3']} + ${borderVars['--border-width']} + ${spacingVars['--spacing-4']})`,
248
+ '::before': {
249
+ content: 'attr(data-line)',
250
+ gridColumn: '1',
251
+ alignSelf: 'start',
252
+ textAlign: 'end',
253
+ color: 'var(--color-syntax-punctuation)',
254
+ userSelect: 'none',
255
+ fontFamily: typographyVars['--font-family-code'],
256
+ },
257
+ },
258
+ // In span mode the tokens are wrapped in this element so they form a single
259
+ // grid item in column 2 (otherwise each token span would flow into its own
260
+ // grid cell). minWidth:0 lets it shrink so long lines wrap within the track.
261
+ lineContent: {
262
+ minWidth: 0,
263
+ },
228
264
  lineChunk: {
229
265
  contentVisibility: 'auto',
230
266
  },
@@ -239,12 +275,6 @@ const styles = stylex.create({
239
275
  sizeMd: {
240
276
  fontSize: typeScaleVars['--text-code-size'],
241
277
  },
242
- gutterSm: {
243
- fontSize: typeScaleVars['--text-supporting-size'],
244
- },
245
- gutterMd: {
246
- fontSize: typeScaleVars['--text-code-size'],
247
- },
248
278
  copyButton: {
249
279
  display: 'inline-flex',
250
280
  alignItems: 'center',
@@ -285,11 +315,13 @@ const CodeChunk = React.memo(function CodeChunk({
285
315
  startIndex,
286
316
  highlightSet,
287
317
  renderLineContent,
318
+ lineNumbers,
288
319
  }: {
289
320
  lines: string[];
290
321
  startIndex: number;
291
322
  highlightSet: Set<number> | null;
292
323
  renderLineContent: (line: string, lineIndex: number) => React.ReactNode;
324
+ lineNumbers: boolean;
293
325
  }) {
294
326
  return (
295
327
  <>
@@ -301,6 +333,7 @@ const CodeChunk = React.memo(function CodeChunk({
301
333
  data-line={i + 1}
302
334
  {...stylex.props(
303
335
  styles.line,
336
+ lineNumbers && styles.lineNumbered,
304
337
  (highlightSet?.has(i + 1) ?? false) && styles.lineHighlighted,
305
338
  )}>
306
339
  {renderLineContent(line, i)}
@@ -315,6 +348,7 @@ function renderLines(
315
348
  lines: string[],
316
349
  highlightSet: Set<number> | null,
317
350
  renderLineContent: (line: string, lineIndex: number) => React.ReactNode,
351
+ lineNumbers: boolean,
318
352
  chunkSize: number = LINE_CHUNK_SIZE,
319
353
  ): React.ReactNode {
320
354
  chunkSize = Math.max(1, Math.floor(chunkSize));
@@ -326,6 +360,7 @@ function renderLines(
326
360
  startIndex={0}
327
361
  highlightSet={highlightSet}
328
362
  renderLineContent={renderLineContent}
363
+ lineNumbers={lineNumbers}
329
364
  />
330
365
  );
331
366
  }
@@ -347,6 +382,7 @@ function renderLines(
347
382
  startIndex={start}
348
383
  highlightSet={highlightSet}
349
384
  renderLineContent={renderLineContent}
385
+ lineNumbers={lineNumbers}
350
386
  />
351
387
  </div>,
352
388
  );
@@ -542,12 +578,16 @@ function SpanCodeContent({
542
578
  highlightSet,
543
579
  isWrapped,
544
580
  sizeStyle,
581
+ hasLineNumbers,
582
+ maxDigits,
545
583
  }: {
546
584
  lines: string[];
547
585
  tokenLines: TokenLine[];
548
586
  highlightSet: Set<number> | null;
549
587
  isWrapped: boolean;
550
588
  sizeStyle: stylex.StyleXStyles;
589
+ hasLineNumbers: boolean;
590
+ maxDigits: number;
551
591
  }) {
552
592
  useInsertionEffect(() => {
553
593
  ensureHighlightStyles();
@@ -556,7 +596,13 @@ function SpanCodeContent({
556
596
  const renderLineContent = useCallback(
557
597
  (line: string, lineIndex: number): React.ReactNode => {
558
598
  const tokens = tokenLines[lineIndex] ?? [];
559
- return buildSpanLine(line, tokens);
599
+ // Wrap tokens in a single element so they occupy one grid cell when line
600
+ // numbers are on (see `lineNumbered`); an inline span is a no-op when off.
601
+ return (
602
+ <span {...stylex.props(styles.lineContent)}>
603
+ {buildSpanLine(line, tokens)}
604
+ </span>
605
+ );
560
606
  },
561
607
  [tokenLines],
562
608
  );
@@ -567,8 +613,10 @@ function SpanCodeContent({
567
613
  styles.code,
568
614
  sizeStyle,
569
615
  isWrapped && styles.codeWrapped,
616
+ hasLineNumbers && styles.codeNumbered,
617
+ hasLineNumbers && dynamicStyles.gutterWidth(maxDigits),
570
618
  )}>
571
- {renderLines(lines, highlightSet, renderLineContent)}
619
+ {renderLines(lines, highlightSet, renderLineContent, hasLineNumbers)}
572
620
  </code>
573
621
  );
574
622
  }
@@ -583,12 +631,16 @@ function RangeCodeContent({
583
631
  highlightSet,
584
632
  isWrapped,
585
633
  sizeStyle,
634
+ hasLineNumbers,
635
+ maxDigits,
586
636
  }: {
587
637
  lines: string[];
588
638
  tokenLines: TokenLine[];
589
639
  highlightSet: Set<number> | null;
590
640
  isWrapped: boolean;
591
641
  sizeStyle: stylex.StyleXStyles;
642
+ hasLineNumbers: boolean;
643
+ maxDigits: number;
592
644
  }) {
593
645
  const codeRef = useRef<HTMLElement>(null);
594
646
 
@@ -606,6 +658,9 @@ function RangeCodeContent({
606
658
  return applyHighlightRangesChunked(codeEl, tokenLines);
607
659
  }, [tokenLines]);
608
660
 
661
+ // Range mode keeps the line's text as a bare text node (its firstChild) so
662
+ // applyHighlightRangesChunked can map token offsets onto it \u2014 no wrapper. The
663
+ // number ::before is a pseudo-element, so it never becomes a child node here.
609
664
  const renderLineContent = useCallback(
610
665
  (line: string): React.ReactNode => line || '\u200b',
611
666
  [],
@@ -618,8 +673,10 @@ function RangeCodeContent({
618
673
  styles.code,
619
674
  sizeStyle,
620
675
  isWrapped && styles.codeWrapped,
676
+ hasLineNumbers && styles.codeNumbered,
677
+ hasLineNumbers && dynamicStyles.gutterWidth(maxDigits),
621
678
  )}>
622
- {renderLines(lines, highlightSet, renderLineContent)}
679
+ {renderLines(lines, highlightSet, renderLineContent, hasLineNumbers)}
623
680
  </code>
624
681
  );
625
682
  }
@@ -662,6 +719,7 @@ export function CodeBlock({
662
719
  ref,
663
720
  ...props
664
721
  }: CodeBlockProps) {
722
+ const t = useTranslator();
665
723
  const [copied, setCopied] = useState(false);
666
724
  const copyResetTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
667
725
  const announce = useAnnounce();
@@ -718,7 +776,8 @@ export function CodeBlock({
718
776
  }, [code, onCopy, announce]);
719
777
 
720
778
  const sizeStyle = size === 'sm' ? styles.sizeSm : styles.sizeMd;
721
- const gutterSizeStyle = size === 'sm' ? styles.gutterSm : styles.gutterMd;
779
+ // Digits in the largest line number sizes the gutter column width.
780
+ const maxLineDigits = String(lines.length).length;
722
781
  const languageLabel =
723
782
  hasLanguageLabel && language !== 'plaintext' ? language : null;
724
783
  const showHeader = title != null || languageLabel != null;
@@ -748,7 +807,7 @@ export function CodeBlock({
748
807
  e.stopPropagation();
749
808
  void handleCopy();
750
809
  }}
751
- aria-label={copied ? 'Copied' : 'Copy code'}
810
+ aria-label={copied ? t('@astryx.codeBlock.copied') : t('@astryx.codeBlock.copyCode')}
752
811
  {...stylex.props(
753
812
  styles.copyButton,
754
813
  !showHeader && styles.copyButtonAbsolute,
@@ -811,7 +870,7 @@ export function CodeBlock({
811
870
  // create duplicate same-named landmarks (axe: landmark-unique).
812
871
  tabIndex={0}
813
872
  role="group"
814
- aria-label={languageLabel ?? 'Code'}
873
+ aria-label={languageLabel ?? t('@astryx.codeBlock.code')}
815
874
  {...mergeProps(stylex.props(styles.scrollContainer), {
816
875
  style: scrollStyle,
817
876
  })}>
@@ -820,18 +879,6 @@ export function CodeBlock({
820
879
  styles.codeWrapper,
821
880
  showHeader && !hasLineNumbers && styles.codeWrapperCompact,
822
881
  )}>
823
- {hasLineNumbers && (
824
- <div
825
- {...stylex.props(styles.gutter, gutterSizeStyle)}
826
- aria-hidden="true">
827
- {lines.map((_, i) => (
828
- // eslint-disable-next-line @eslint-react/no-array-index-key -- gutter line numbers are positional by definition
829
- <div key={i} {...stylex.props(styles.gutterLine)}>
830
- {i + 1}
831
- </div>
832
- ))}
833
- </div>
834
- )}
835
882
  {useSpans ? (
836
883
  <SpanCodeContent
837
884
  lines={lines}
@@ -839,6 +886,8 @@ export function CodeBlock({
839
886
  highlightSet={highlightSet}
840
887
  isWrapped={isWrapped}
841
888
  sizeStyle={sizeStyle}
889
+ hasLineNumbers={hasLineNumbers}
890
+ maxDigits={maxLineDigits}
842
891
  />
843
892
  ) : (
844
893
  <RangeCodeContent
@@ -847,6 +896,8 @@ export function CodeBlock({
847
896
  highlightSet={highlightSet}
848
897
  isWrapped={isWrapped}
849
898
  sizeStyle={sizeStyle}
899
+ hasLineNumbers={hasLineNumbers}
900
+ maxDigits={maxLineDigits}
850
901
  />
851
902
  )}
852
903
  </div>
@@ -70,7 +70,7 @@ export const docs = {
70
70
  usage: {
71
71
  description: 'Collapsible hides and reveals content behind a trigger button. Use it in settings panels, FAQ pages, or detail views to keep the page scannable while letting users drill into sections they care about. Wrap multiple collapsibles in CollapsibleGroup for accordion behavior. For custom collapsible components, use the `useCollapsible` hook directly (`astryx hook useCollapsible`).',
72
72
  bestPractices: [
73
- { guidance: true, description: 'Use hasDividers on CollapsibleGroup for FAQ-style lists built-in row hairlines with themed border tokens, no hand-rolled borders.' },
73
+ { guidance: true, description: 'Use hasDividers on CollapsibleGroup for FAQ-style lists: built-in row hairlines with themed border tokens, no hand-rolled borders.' },
74
74
  { guidance: true, description: 'Wrap each Collapsible in an Card for visual separation in accordion layouts, or use CollapsibleGroup\'s hasDividers for flat lists; don\'t combine both.' },
75
75
  { guidance: true, description: 'Use CollapsibleGroup with type="single" for settings or FAQ pages where only one section should be open at a time.' },
76
76
  { guidance: true, description: 'Use type="multiple" when users need to compare content across sections, like feature lists or pricing tiers.' },
@@ -92,7 +92,7 @@ export const docsZh = {
92
92
  usage: {
93
93
  description: 'Collapsible hides and reveals content behind a trigger button. Use it in settings panels, FAQ pages, or detail views to keep the page scannable while letting users drill into sections they care about. Wrap multiple collapsibles in CollapsibleGroup for accordion behavior.',
94
94
  bestPractices: [
95
- { guidance: true, description: 'Use hasDividers on CollapsibleGroup for FAQ-style lists built-in row hairlines with themed border tokens, no hand-rolled borders.' },
95
+ { guidance: true, description: 'Use hasDividers on CollapsibleGroup for FAQ-style lists: built-in row hairlines with themed border tokens, no hand-rolled borders.' },
96
96
  { guidance: true, description: 'Wrap each Collapsible in an Card for visual separation in accordion layouts, or use CollapsibleGroup\'s hasDividers for flat lists; don\'t combine both.' },
97
97
  { guidance: true, description: 'Use CollapsibleGroup with type="single" for settings or FAQ pages where only one section should be open at a time.' },
98
98
  { guidance: true, description: 'Use type="multiple" when users need to compare content across sections, like feature lists or pricing tiers.' },
@@ -110,7 +110,7 @@ export const docsDense = {
110
110
  usage: {
111
111
  description: 'Collapsible hides and reveals content behind a trigger button. Use in settings, FAQs, or detail views. Wrap in CollapsibleGroup for accordion behavior.',
112
112
  bestPractices: [
113
- { guidance: true, description: 'Use hasDividers on CollapsibleGroup for FAQ-style lists built-in row hairlines, no hand-rolled borders.' },
113
+ { guidance: true, description: 'Use hasDividers on CollapsibleGroup for FAQ-style lists: built-in row hairlines, no hand-rolled borders.' },
114
114
  { guidance: true, description: 'Wrap each Collapsible in an Card for visual separation, or use CollapsibleGroup\'s hasDividers for flat lists; not both.' },
115
115
  { guidance: true, description: 'Use CollapsibleGroup with type="single" for settings or FAQ pages where only one section should be open at a time.' },
116
116
  { guidance: true, description: 'Use type="multiple" when users need to compare across sections.' },
@@ -36,6 +36,7 @@ import {CommandPaletteInput} from './CommandPaletteInput';
36
36
  import {CommandPaletteFooter} from './CommandPaletteFooter';
37
37
  import {CommandPaletteEmpty} from './CommandPaletteEmpty';
38
38
  import type {BaseProps} from '../BaseProps';
39
+ import {useTranslator} from '../i18n';
39
40
 
40
41
  export interface CommandPaletteProps<
41
42
  T extends SearchableItem = SearchableItem,
@@ -260,14 +261,20 @@ export function CommandPalette<T extends SearchableItem = SearchableItem>({
260
261
  input,
261
262
  footer,
262
263
  renderItem,
263
- emptySearchText = 'No results',
264
- emptyBootstrapText = 'Type to search',
264
+ emptySearchText: emptySearchTextFromProps,
265
+ emptyBootstrapText: emptyBootstrapTextFromProps,
265
266
  value: controlledValue,
266
267
  onValueChange,
267
- label = 'Command palette',
268
+ label: labelFromProps,
268
269
  width = 640,
269
270
  maxHeight = 480,
270
271
  }: CommandPaletteProps<T>) {
272
+ const t = useTranslator();
273
+ const label = labelFromProps ?? t('@astryx.commandPalette.label');
274
+ const emptySearchText =
275
+ emptySearchTextFromProps ?? t('@astryx.commandPalette.emptySearch');
276
+ const emptyBootstrapText =
277
+ emptyBootstrapTextFromProps ?? t('@astryx.commandPalette.emptyBootstrap');
271
278
  const listId = useId();
272
279
  // search: the committed query — only advances when async results arrive.
273
280
  // optimisticSearch: updates immediately on keystroke, drives input + empty state.
@@ -17,7 +17,7 @@ import type {CommandPaletteContextValue} from './CommandPaletteContext';
17
17
  describe('CommandPaletteInput', () => {
18
18
  it('renders with default placeholder', () => {
19
19
  render(<CommandPaletteInput />);
20
- expect(screen.getByPlaceholderText('Search...')).toBeInTheDocument();
20
+ expect(screen.getByPlaceholderText('Search')).toBeInTheDocument();
21
21
  });
22
22
 
23
23
  it('renders with custom placeholder', () => {
@@ -27,6 +27,7 @@ import {useCommandPaletteContext} from './CommandPaletteContext';
27
27
  import {useDialogContext} from '../Dialog/DialogContext';
28
28
  import type {BaseProps} from '../BaseProps';
29
29
  import {themeProps} from '../utils/themeProps';
30
+ import {useTranslator} from '../i18n';
30
31
 
31
32
  const styles = stylex.create({
32
33
  wrapper: {
@@ -147,7 +148,7 @@ export interface CommandPaletteInputProps extends Omit<
147
148
  export function CommandPaletteInput({
148
149
  value: controlledValue,
149
150
  onValueChange,
150
- placeholder = 'Search...',
151
+ placeholder: placeholderFromProps,
151
152
  hasAutoFocus = true,
152
153
  endContent,
153
154
  onChange,
@@ -156,6 +157,9 @@ export function CommandPaletteInput({
156
157
  xstyle,
157
158
  ...props
158
159
  }: CommandPaletteInputProps) {
160
+ const t = useTranslator();
161
+ const placeholder =
162
+ placeholderFromProps ?? t('@astryx.commandPalette.input.placeholder');
159
163
  const ctx = useCommandPaletteContext();
160
164
  const dialogContext = useDialogContext();
161
165
  const inputRef = useRef<HTMLInputElement>(null);
@@ -20,6 +20,7 @@ import {mergeProps} from '../utils';
20
20
  import {spacingVars} from '../theme/tokens.stylex';
21
21
  import {useCommandPaletteContext} from './CommandPaletteContext';
22
22
  import {themeProps} from '../utils/themeProps';
23
+ import {useTranslator} from '../i18n';
23
24
 
24
25
  const styles = stylex.create({
25
26
  list: {
@@ -72,13 +73,15 @@ export interface CommandPaletteListProps extends BaseProps<HTMLDivElement> {
72
73
  */
73
74
  export function CommandPaletteList({
74
75
  children,
75
- label = 'Commands',
76
+ label: labelFromProps,
76
77
  ref,
77
78
  xstyle,
78
79
  className,
79
80
  style,
80
81
  ...props
81
82
  }: CommandPaletteListProps) {
83
+ const t = useTranslator();
84
+ const label = labelFromProps ?? t('@astryx.commandPalette.list.label');
82
85
  const ctx = useCommandPaletteContext();
83
86
 
84
87
  return (
@@ -62,6 +62,7 @@ import {mergeProps, mergeRefs} from '../utils';
62
62
  import type {BaseProps} from '../BaseProps';
63
63
  import type {StyleXStyles} from '../theme/types';
64
64
  import {themeProps} from '../utils/themeProps';
65
+ import {useTranslator} from '../i18n';
65
66
  import type {
66
67
  DropdownMenuOption,
67
68
  DropdownMenuItemData,
@@ -205,7 +206,7 @@ export function ContextMenu({
205
206
  children,
206
207
  menuWidth,
207
208
  size = 'md',
208
- label = 'Context menu',
209
+ label: labelFromProps,
209
210
  isDisabled = false,
210
211
  onOpenChange,
211
212
  ref,
@@ -216,6 +217,8 @@ export function ContextMenu({
216
217
  'data-testid': testId,
217
218
  ...props
218
219
  }: ContextMenuProps) {
220
+ const t = useTranslator();
221
+ const label = labelFromProps ?? t('@astryx.contextMenu.label');
219
222
  const items = ('items' in props ? props.items : undefined) ?? [];
220
223
  const menuContent = 'menuContent' in props ? props.menuContent : undefined;
221
224
 
@@ -111,7 +111,7 @@ export const docs = {
111
111
  },
112
112
  {
113
113
  name: 'status',
114
- type: 'InputStatus',
114
+ type: "{type: 'warning' | 'error' | 'success', message?: string}",
115
115
  description:
116
116
  'Status indicator object for error, warning, or success states with a message.',
117
117
  },
@@ -374,7 +374,7 @@ export const docsZh = {
374
374
  },
375
375
  {
376
376
  name: 'status',
377
- type: 'InputStatus',
377
+ type: "{type: 'warning' | 'error' | 'success', message?: string}",
378
378
  description: '错误、警告或成功状态的状态指示对象,附带消息。',
379
379
  },
380
380
  {