@astryxdesign/core 0.1.7 → 0.1.8-canary.0c4d8d7

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 (428) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/README.md +30 -19
  3. package/dist/AppShell/AppShell.d.ts.map +1 -1
  4. package/dist/AppShell/AppShell.js +6 -2
  5. package/dist/AppShell/AppShellMobileContext.d.ts +8 -0
  6. package/dist/AppShell/AppShellMobileContext.d.ts.map +1 -1
  7. package/dist/Avatar/Avatar.d.ts +10 -5
  8. package/dist/Avatar/Avatar.d.ts.map +1 -1
  9. package/dist/Avatar/Avatar.js +12 -8
  10. package/dist/Avatar/AvatarSizeContext.d.ts +1 -1
  11. package/dist/Avatar/AvatarSizeContext.js +1 -1
  12. package/dist/Avatar/AvatarStatusDot.d.ts +2 -2
  13. package/dist/Avatar/AvatarStatusDot.js +2 -2
  14. package/dist/AvatarGroup/AvatarGroup.d.ts +2 -2
  15. package/dist/AvatarGroup/AvatarGroup.d.ts.map +1 -1
  16. package/dist/AvatarGroup/AvatarGroup.js +2 -2
  17. package/dist/AvatarGroup/AvatarGroupOverflow.d.ts +1 -1
  18. package/dist/AvatarGroup/AvatarGroupOverflow.d.ts.map +1 -1
  19. package/dist/AvatarGroup/AvatarGroupOverflow.js +16 -14
  20. package/dist/Banner/Banner.d.ts +9 -1
  21. package/dist/Banner/Banner.d.ts.map +1 -1
  22. package/dist/Banner/Banner.js +31 -2
  23. package/dist/Button/Button.d.ts +8 -2
  24. package/dist/Button/Button.d.ts.map +1 -1
  25. package/dist/Button/Button.js +31 -2
  26. package/dist/ButtonGroup/ButtonGroup.d.ts +9 -1
  27. package/dist/ButtonGroup/ButtonGroup.d.ts.map +1 -1
  28. package/dist/ButtonGroup/ButtonGroup.js +30 -1
  29. package/dist/Card/Card.d.ts +8 -2
  30. package/dist/Card/Card.d.ts.map +1 -1
  31. package/dist/Card/Card.js +28 -2
  32. package/dist/Carousel/Carousel.d.ts +6 -2
  33. package/dist/Carousel/Carousel.d.ts.map +1 -1
  34. package/dist/Carousel/Carousel.js +55 -5
  35. package/dist/Chat/ChatComposer.d.ts +8 -0
  36. package/dist/Chat/ChatComposer.d.ts.map +1 -1
  37. package/dist/Chat/ChatComposer.js +31 -6
  38. package/dist/Chat/ChatComposerDrawer.d.ts +2 -0
  39. package/dist/Chat/ChatComposerDrawer.d.ts.map +1 -1
  40. package/dist/Chat/ChatComposerDrawer.js +11 -1
  41. package/dist/Chat/ChatComposerInput.d.ts +20 -3
  42. package/dist/Chat/ChatComposerInput.d.ts.map +1 -1
  43. package/dist/Chat/ChatComposerInput.js +19 -3
  44. package/dist/Chat/ChatLayout.d.ts.map +1 -1
  45. package/dist/Chat/ChatLayoutScrollButton.d.ts.map +1 -1
  46. package/dist/Chat/ChatMessage.d.ts +1 -1
  47. package/dist/Chat/ChatMessage.d.ts.map +1 -1
  48. package/dist/Chat/ChatMessage.js +1 -1
  49. package/dist/Chat/ChatMessageMetadata.d.ts.map +1 -1
  50. package/dist/Chat/ChatSendButton.d.ts.map +1 -1
  51. package/dist/Chat/ChatToolCalls.d.ts +5 -1
  52. package/dist/Chat/ChatToolCalls.d.ts.map +1 -1
  53. package/dist/Chat/ChatToolCalls.js +12 -3
  54. package/dist/Chat/useTriggerMenu.d.ts.map +1 -1
  55. package/dist/Citation/Citation.d.ts.map +1 -1
  56. package/dist/Citation/Citation.js +10 -4
  57. package/dist/ClickableCard/ClickableCard.d.ts +9 -2
  58. package/dist/ClickableCard/ClickableCard.d.ts.map +1 -1
  59. package/dist/ClickableCard/ClickableCard.js +3 -0
  60. package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
  61. package/dist/CodeBlock/CodeBlock.js +8 -1
  62. package/dist/Collapsible/Collapsible.d.ts +11 -1
  63. package/dist/Collapsible/Collapsible.d.ts.map +1 -1
  64. package/dist/Collapsible/Collapsible.js +36 -4
  65. package/dist/CommandPalette/CommandPaletteInput.d.ts +7 -1
  66. package/dist/CommandPalette/CommandPaletteInput.d.ts.map +1 -1
  67. package/dist/CommandPalette/CommandPaletteInput.js +6 -1
  68. package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
  69. package/dist/ContextMenu/ContextMenu.js +4 -3
  70. package/dist/ContextMenu/index.d.ts +3 -0
  71. package/dist/ContextMenu/index.d.ts.map +1 -1
  72. package/dist/ContextMenu/index.js +7 -1
  73. package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
  74. package/dist/DateTimeInput/DateTimeInput.js +10 -1
  75. package/dist/Dialog/Dialog.d.ts.map +1 -1
  76. package/dist/Dialog/Dialog.js +2 -1
  77. package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
  78. package/dist/DropdownMenu/DropdownMenu.js +8 -4
  79. package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts +88 -0
  80. package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +1 -0
  81. package/dist/DropdownMenu/DropdownMenuCheckboxItem.js +169 -0
  82. package/dist/DropdownMenu/DropdownMenuContext.d.ts +17 -1
  83. package/dist/DropdownMenu/DropdownMenuContext.d.ts.map +1 -1
  84. package/dist/DropdownMenu/DropdownMenuContext.js +18 -0
  85. package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts +68 -0
  86. package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts.map +1 -0
  87. package/dist/DropdownMenu/DropdownMenuRadioGroup.js +69 -0
  88. package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts +69 -0
  89. package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts.map +1 -0
  90. package/dist/DropdownMenu/DropdownMenuRadioItem.js +178 -0
  91. package/dist/DropdownMenu/index.d.ts +5 -1
  92. package/dist/DropdownMenu/index.d.ts.map +1 -1
  93. package/dist/DropdownMenu/index.js +10 -1
  94. package/dist/DropdownMenu/menuItemRoles.d.ts +13 -0
  95. package/dist/DropdownMenu/menuItemRoles.d.ts.map +1 -0
  96. package/dist/DropdownMenu/menuItemRoles.js +15 -0
  97. package/dist/FieldStatus/FieldStatus.d.ts +8 -0
  98. package/dist/FieldStatus/FieldStatus.d.ts.map +1 -1
  99. package/dist/FieldStatus/FieldStatus.js +22 -4
  100. package/dist/FileInput/FileInput.d.ts.map +1 -1
  101. package/dist/FileInput/FileInput.js +10 -2
  102. package/dist/HoverCard/HoverCard.d.ts +9 -1
  103. package/dist/HoverCard/HoverCard.d.ts.map +1 -1
  104. package/dist/HoverCard/HoverCard.js +2 -0
  105. package/dist/HoverCard/useHoverCard.d.ts +8 -0
  106. package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
  107. package/dist/HoverCard/useHoverCard.js +7 -2
  108. package/dist/Icon/Icon.d.ts +43 -13
  109. package/dist/Icon/Icon.d.ts.map +1 -1
  110. package/dist/Icon/Icon.js +62 -27
  111. package/dist/Layer/useLayer.d.ts +6 -0
  112. package/dist/Layer/useLayer.d.ts.map +1 -1
  113. package/dist/Layer/useLayer.js +2 -0
  114. package/dist/MobileNav/MobileNav.d.ts.map +1 -1
  115. package/dist/MobileNav/MobileNav.js +6 -1
  116. package/dist/MobileNav/MobileNavToggle.d.ts.map +1 -1
  117. package/dist/MobileNav/MobileNavToggle.js +4 -0
  118. package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
  119. package/dist/MultiSelector/MultiSelector.js +39 -12
  120. package/dist/MultiSelector/hooks.d.ts.map +1 -1
  121. package/dist/MultiSelector/hooks.js +16 -0
  122. package/dist/NumberInput/NumberInput.d.ts.map +1 -1
  123. package/dist/Outline/Outline.d.ts +68 -3
  124. package/dist/Outline/Outline.d.ts.map +1 -1
  125. package/dist/Outline/Outline.js +128 -26
  126. package/dist/Outline/useScrollSpy.d.ts +27 -7
  127. package/dist/Outline/useScrollSpy.d.ts.map +1 -1
  128. package/dist/Outline/useScrollSpy.js +202 -70
  129. package/dist/OverflowList/OverflowList.d.ts +20 -3
  130. package/dist/OverflowList/OverflowList.d.ts.map +1 -1
  131. package/dist/OverflowList/OverflowList.js +29 -4
  132. package/dist/PowerSearch/PowerSearchEditPopover.js +1 -1
  133. package/dist/PowerSearch/usePowerSearchSource.d.ts.map +1 -1
  134. package/dist/SelectableCard/SelectableCard.d.ts +9 -2
  135. package/dist/SelectableCard/SelectableCard.d.ts.map +1 -1
  136. package/dist/SelectableCard/SelectableCard.js +14 -11
  137. package/dist/Selector/Selector.d.ts.map +1 -1
  138. package/dist/Selector/Selector.js +4 -2
  139. package/dist/Selector/hooks.d.ts.map +1 -1
  140. package/dist/Selector/hooks.js +16 -0
  141. package/dist/SideNav/SideNavCollapseButton.d.ts.map +1 -1
  142. package/dist/SideNav/SideNavHeading.d.ts.map +1 -1
  143. package/dist/SideNav/SideNavHeading.js +21 -8
  144. package/dist/SideNav/SideNavItem.d.ts.map +1 -1
  145. package/dist/Slider/Slider.d.ts.map +1 -1
  146. package/dist/Slider/Slider.js +15 -1
  147. package/dist/TabList/Tab.d.ts.map +1 -1
  148. package/dist/TabList/Tab.js +2 -2
  149. package/dist/TabList/TabList.d.ts.map +1 -1
  150. package/dist/TabList/TabList.js +2 -0
  151. package/dist/TabList/TabMenu.d.ts.map +1 -1
  152. package/dist/TabList/TabMenu.js +1 -1
  153. package/dist/Table/Table.d.ts +1 -1
  154. package/dist/Table/Table.js +1 -1
  155. package/dist/Table/index.d.ts +4 -0
  156. package/dist/Table/index.d.ts.map +1 -1
  157. package/dist/Table/index.js +2 -0
  158. package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts.map +1 -1
  159. package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
  160. package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +24 -2
  161. package/dist/Table/plugins/rowStatus/index.d.ts +3 -0
  162. package/dist/Table/plugins/rowStatus/index.d.ts.map +1 -0
  163. package/dist/Table/plugins/rowStatus/index.js +3 -0
  164. package/dist/Table/plugins/rowStatus/useTableRowStatus.d.ts +60 -0
  165. package/dist/Table/plugins/rowStatus/useTableRowStatus.d.ts.map +1 -0
  166. package/dist/Table/plugins/rowStatus/useTableRowStatus.js +145 -0
  167. package/dist/Table/plugins/selection/useTableSelection.d.ts +12 -0
  168. package/dist/Table/plugins/selection/useTableSelection.d.ts.map +1 -1
  169. package/dist/Table/plugins/selection/useTableSelection.js +4 -1
  170. package/dist/Table/plugins/sortable/useTableSortable.d.ts.map +1 -1
  171. package/dist/Table/plugins/sortable/useTableSortable.js +18 -7
  172. package/dist/Table/plugins/tree/index.d.ts +5 -0
  173. package/dist/Table/plugins/tree/index.d.ts.map +1 -0
  174. package/dist/Table/plugins/tree/index.js +4 -0
  175. package/dist/Table/plugins/tree/useTableTreeData.d.ts +38 -0
  176. package/dist/Table/plugins/tree/useTableTreeData.d.ts.map +1 -0
  177. package/dist/Table/plugins/tree/useTableTreeData.js +358 -0
  178. package/dist/Table/plugins/tree/useTableTreeState.d.ts +51 -0
  179. package/dist/Table/plugins/tree/useTableTreeState.d.ts.map +1 -0
  180. package/dist/Table/plugins/tree/useTableTreeState.js +175 -0
  181. package/dist/Table/useBaseTablePlugins.d.ts.map +1 -1
  182. package/dist/Table/useBaseTablePlugins.js +6 -3
  183. package/dist/Thumbnail/Thumbnail.d.ts +8 -1
  184. package/dist/Thumbnail/Thumbnail.d.ts.map +1 -1
  185. package/dist/Thumbnail/Thumbnail.js +46 -8
  186. package/dist/TimeInput/TimeInput.d.ts.map +1 -1
  187. package/dist/TimeInput/TimeInput.js +15 -4
  188. package/dist/Tokenizer/Tokenizer.d.ts +1 -1
  189. package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
  190. package/dist/Tokenizer/Tokenizer.js +16 -4
  191. package/dist/Toolbar/Toolbar.d.ts.map +1 -1
  192. package/dist/Toolbar/Toolbar.js +8 -1
  193. package/dist/TopNav/TopNavHeading.d.ts.map +1 -1
  194. package/dist/TopNav/TopNavHeading.js +18 -8
  195. package/dist/TopNav/TopNavMegaMenu.js +10 -4
  196. package/dist/TopNav/TopNavMenu.d.ts +2 -1
  197. package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
  198. package/dist/TopNav/TopNavMenu.js +68 -6
  199. package/dist/TreeList/TreeListItem.d.ts.map +1 -1
  200. package/dist/TreeList/TreeListItem.js +5 -14
  201. package/dist/astryx.css +51 -16
  202. package/dist/astryx.umd.js +56 -56
  203. package/dist/astryx.umd.js.map +4 -4
  204. package/dist/authoring/doc.d.ts.map +1 -1
  205. package/dist/hooks/computeOverflow.d.ts +47 -0
  206. package/dist/hooks/computeOverflow.d.ts.map +1 -0
  207. package/dist/hooks/computeOverflow.js +213 -0
  208. package/dist/hooks/useOverflow.d.ts +19 -0
  209. package/dist/hooks/useOverflow.d.ts.map +1 -1
  210. package/dist/hooks/useOverflow.js +37 -25
  211. package/dist/theme/Theme.js +1 -1
  212. package/dist/theme/defineTheme.d.ts +1 -1
  213. package/dist/theme/defineTheme.js +1 -1
  214. package/dist/theme/generateThemeRules.d.ts.map +1 -1
  215. package/dist/theme/generateThemeRules.js +51 -0
  216. package/dist/theme/hct.d.ts +0 -1
  217. package/dist/theme/hct.d.ts.map +1 -1
  218. package/dist/theme/hct.js +0 -3
  219. package/dist/utils/types.d.ts +13 -0
  220. package/dist/utils/types.d.ts.map +1 -1
  221. package/docs.mjs +32 -461
  222. package/locales/en.json +212 -172
  223. package/locales/fr-FR.json +10 -0
  224. package/locales/pseudo.json +30 -0
  225. package/package.json +3 -1
  226. package/scripts/postinstall.mjs +93 -0
  227. package/src/AppShell/AppShell.tsx +6 -0
  228. package/src/AppShell/AppShellMobileContext.tsx +8 -0
  229. package/src/AppShell/useAppShellMobile.doc.mjs +8 -0
  230. package/src/Avatar/Avatar.doc.mjs +6 -6
  231. package/src/Avatar/Avatar.tsx +16 -11
  232. package/src/Avatar/AvatarSizeContext.ts +1 -1
  233. package/src/Avatar/AvatarStatusDot.tsx +2 -2
  234. package/src/AvatarGroup/AvatarGroup.doc.mjs +1 -1
  235. package/src/AvatarGroup/AvatarGroup.test.tsx +17 -3
  236. package/src/AvatarGroup/AvatarGroup.tsx +3 -3
  237. package/src/AvatarGroup/AvatarGroupOverflow.doc.mjs +4 -4
  238. package/src/AvatarGroup/AvatarGroupOverflow.tsx +21 -5
  239. package/src/Banner/Banner.doc.mjs +9 -0
  240. package/src/Banner/Banner.test.tsx +30 -0
  241. package/src/Banner/Banner.tsx +47 -3
  242. package/src/Button/Button.doc.mjs +9 -0
  243. package/src/Button/Button.test.tsx +49 -0
  244. package/src/Button/Button.tsx +25 -1
  245. package/src/ButtonGroup/ButtonGroup.doc.mjs +3 -0
  246. package/src/ButtonGroup/ButtonGroup.test.tsx +37 -0
  247. package/src/ButtonGroup/ButtonGroup.tsx +32 -0
  248. package/src/Card/Card.doc.mjs +9 -0
  249. package/src/Card/Card.test.tsx +21 -3
  250. package/src/Card/Card.tsx +35 -2
  251. package/src/Carousel/Carousel.doc.mjs +1 -0
  252. package/src/Carousel/Carousel.test.tsx +149 -1
  253. package/src/Carousel/Carousel.tsx +62 -5
  254. package/src/Chat/Chat.doc.mjs +1 -1
  255. package/src/Chat/ChatComposer.doc.mjs +9 -0
  256. package/src/Chat/ChatComposer.test.tsx +35 -0
  257. package/src/Chat/ChatComposer.tsx +58 -9
  258. package/src/Chat/ChatComposerDrawer.test.tsx +61 -0
  259. package/src/Chat/ChatComposerDrawer.tsx +11 -1
  260. package/src/Chat/ChatComposerInput.doc.mjs +7 -0
  261. package/src/Chat/ChatComposerInput.test.tsx +87 -0
  262. package/src/Chat/ChatComposerInput.tsx +35 -3
  263. package/src/Chat/ChatLayout.tsx +3 -1
  264. package/src/Chat/ChatLayoutScrollButton.tsx +3 -1
  265. package/src/Chat/ChatMessage.tsx +4 -2
  266. package/src/Chat/ChatMessageMetadata.tsx +1 -2
  267. package/src/Chat/ChatSendButton.tsx +5 -1
  268. package/src/Chat/ChatToolCalls.test.tsx +64 -0
  269. package/src/Chat/ChatToolCalls.tsx +13 -1
  270. package/src/Chat/useTriggerMenu.tsx +3 -1
  271. package/src/CheckboxInput/CheckboxInput.doc.mjs +1 -1
  272. package/src/CheckboxInput/CheckboxInput.test.tsx +32 -1
  273. package/src/CheckboxList/CheckboxList.test.tsx +9 -1
  274. package/src/Citation/Citation.test.tsx +51 -0
  275. package/src/Citation/Citation.tsx +8 -2
  276. package/src/ClickableCard/ClickableCard.doc.mjs +2 -0
  277. package/src/ClickableCard/ClickableCard.test.tsx +34 -0
  278. package/src/ClickableCard/ClickableCard.tsx +11 -1
  279. package/src/CodeBlock/CodeBlock.test.tsx +56 -0
  280. package/src/CodeBlock/CodeBlock.tsx +9 -1
  281. package/src/Collapsible/Collapsible.doc.mjs +7 -0
  282. package/src/Collapsible/Collapsible.test.tsx +80 -0
  283. package/src/Collapsible/Collapsible.tsx +58 -5
  284. package/src/CommandPalette/CommandPaletteInput.doc.mjs +26 -9
  285. package/src/CommandPalette/CommandPaletteInput.test.tsx +34 -0
  286. package/src/CommandPalette/CommandPaletteInput.tsx +11 -0
  287. package/src/ContextMenu/ContextMenu.test.tsx +75 -1
  288. package/src/ContextMenu/ContextMenu.tsx +10 -5
  289. package/src/ContextMenu/index.ts +15 -0
  290. package/src/DateTimeInput/DateTimeInput.test.tsx +35 -0
  291. package/src/DateTimeInput/DateTimeInput.tsx +14 -2
  292. package/src/Dialog/Dialog.tsx +12 -2
  293. package/src/DropdownMenu/DropdownMenu.doc.mjs +23 -0
  294. package/src/DropdownMenu/DropdownMenu.tsx +11 -6
  295. package/src/DropdownMenu/DropdownMenuCheckboxItem.doc.mjs +95 -0
  296. package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +236 -0
  297. package/src/DropdownMenu/DropdownMenuContext.tsx +29 -1
  298. package/src/DropdownMenu/DropdownMenuItem.doc.mjs +7 -1
  299. package/src/DropdownMenu/DropdownMenuRadioGroup.doc.mjs +80 -0
  300. package/src/DropdownMenu/DropdownMenuRadioGroup.tsx +118 -0
  301. package/src/DropdownMenu/DropdownMenuRadioItem.doc.mjs +80 -0
  302. package/src/DropdownMenu/DropdownMenuRadioItem.tsx +232 -0
  303. package/src/DropdownMenu/DropdownMenuSelectable.test.tsx +163 -0
  304. package/src/DropdownMenu/index.ts +23 -3
  305. package/src/DropdownMenu/menuItemRoles.ts +22 -0
  306. package/src/Field/Field.doc.mjs +1 -1
  307. package/src/Field/Field.test.tsx +57 -12
  308. package/src/Field/FieldLabel.doc.mjs +1 -1
  309. package/src/FieldStatus/FieldStatus.doc.mjs +17 -5
  310. package/src/FieldStatus/FieldStatus.test.tsx +78 -40
  311. package/src/FieldStatus/FieldStatus.tsx +22 -4
  312. package/src/FileInput/FileInput.test.tsx +52 -3
  313. package/src/FileInput/FileInput.tsx +13 -2
  314. package/src/HoverCard/HoverCard.doc.mjs +13 -0
  315. package/src/HoverCard/HoverCard.test.tsx +21 -2
  316. package/src/HoverCard/HoverCard.tsx +11 -0
  317. package/src/HoverCard/useHoverCard.doc.mjs +2 -0
  318. package/src/HoverCard/useHoverCard.tsx +24 -2
  319. package/src/Icon/Icon.doc.mjs +12 -0
  320. package/src/Icon/Icon.test.tsx +142 -0
  321. package/src/Icon/Icon.tsx +98 -30
  322. package/src/IconButton/IconButton.doc.mjs +8 -0
  323. package/src/IconButton/IconButton.test.tsx +15 -18
  324. package/src/Item/Item.doc.mjs +1 -1
  325. package/src/Layer/useLayer.tsx +8 -0
  326. package/src/MobileNav/MobileNav.tsx +12 -1
  327. package/src/MobileNav/MobileNavToggle.test.tsx +116 -0
  328. package/src/MobileNav/MobileNavToggle.tsx +9 -1
  329. package/src/MultiSelector/MultiSelector.doc.mjs +4 -2
  330. package/src/MultiSelector/MultiSelector.test.tsx +162 -1
  331. package/src/MultiSelector/MultiSelector.tsx +55 -12
  332. package/src/MultiSelector/hooks.ts +17 -0
  333. package/src/NumberInput/NumberInput.doc.mjs +2 -2
  334. package/src/NumberInput/NumberInput.test.tsx +11 -7
  335. package/src/NumberInput/NumberInput.tsx +1 -2
  336. package/src/Outline/Outline.doc.mjs +123 -3
  337. package/src/Outline/Outline.test.tsx +735 -0
  338. package/src/Outline/Outline.tsx +183 -33
  339. package/src/Outline/useScrollSpy.ts +248 -72
  340. package/src/OverflowList/OverflowList.doc.mjs +39 -6
  341. package/src/OverflowList/OverflowList.test.tsx +111 -0
  342. package/src/OverflowList/OverflowList.tsx +48 -8
  343. package/src/PowerSearch/PowerSearchEditPopover.test.tsx +67 -0
  344. package/src/PowerSearch/PowerSearchEditPopover.tsx +1 -1
  345. package/src/PowerSearch/usePowerSearchSource.ts +1 -2
  346. package/src/SelectableCard/SelectableCard.doc.mjs +2 -0
  347. package/src/SelectableCard/SelectableCard.test.tsx +46 -4
  348. package/src/SelectableCard/SelectableCard.tsx +27 -14
  349. package/src/Selector/Selector.test.tsx +69 -0
  350. package/src/Selector/Selector.tsx +5 -1
  351. package/src/Selector/SelectorOption.doc.mjs +1 -1
  352. package/src/Selector/hooks.ts +17 -0
  353. package/src/SideNav/SideNav.test.tsx +119 -3
  354. package/src/SideNav/SideNavCollapseButton.tsx +6 -1
  355. package/src/SideNav/SideNavHeading.tsx +24 -8
  356. package/src/SideNav/SideNavItem.doc.mjs +2 -2
  357. package/src/SideNav/SideNavItem.tsx +5 -1
  358. package/src/Slider/Slider.test.tsx +62 -2
  359. package/src/Slider/Slider.tsx +15 -1
  360. package/src/Switch/Switch.doc.mjs +1 -1
  361. package/src/Switch/Switch.test.tsx +32 -1
  362. package/src/TabList/Tab.tsx +5 -1
  363. package/src/TabList/TabList.doc.mjs +3 -3
  364. package/src/TabList/TabList.test.tsx +66 -0
  365. package/src/TabList/TabList.tsx +8 -0
  366. package/src/TabList/TabMenu.tsx +4 -1
  367. package/src/Table/Table.doc.mjs +2 -0
  368. package/src/Table/Table.tsx +1 -1
  369. package/src/Table/index.ts +12 -0
  370. package/src/Table/plugins/groupedRows/useTableGroupedRows.tsx +6 -2
  371. package/src/Table/plugins/rowExpansion/useTableRowExpansion.test.tsx +90 -1
  372. package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +37 -5
  373. package/src/Table/plugins/rowStatus/index.ts +7 -0
  374. package/src/Table/plugins/rowStatus/useTableRowStatus.test.tsx +138 -0
  375. package/src/Table/plugins/rowStatus/useTableRowStatus.tsx +189 -0
  376. package/src/Table/plugins/selection/useTableSelection.test.tsx +16 -0
  377. package/src/Table/plugins/selection/useTableSelection.tsx +18 -1
  378. package/src/Table/plugins/sortable/useTableSortable.test.tsx +95 -9
  379. package/src/Table/plugins/sortable/useTableSortable.tsx +23 -7
  380. package/src/Table/plugins/tree/index.ts +12 -0
  381. package/src/Table/plugins/tree/useTableTreeData-perf.test.tsx +163 -0
  382. package/src/Table/plugins/tree/useTableTreeData.test.tsx +594 -0
  383. package/src/Table/plugins/tree/useTableTreeData.tsx +495 -0
  384. package/src/Table/plugins/tree/useTableTreeState.test.tsx +636 -0
  385. package/src/Table/plugins/tree/useTableTreeState.tsx +253 -0
  386. package/src/Table/useBaseTablePlugins.ts +6 -2
  387. package/src/Table/useTableRowStatus.doc.mjs +30 -0
  388. package/src/Table/useTableSelection.doc.mjs +65 -14
  389. package/src/Table/useTableTreeData.doc.mjs +75 -0
  390. package/src/Table/useTableTreeState.doc.mjs +98 -0
  391. package/src/TextArea/TextArea.doc.mjs +1 -1
  392. package/src/TextArea/TextArea.test.tsx +9 -1
  393. package/src/TextInput/TextInput.doc.mjs +1 -1
  394. package/src/Thumbnail/Thumbnail.doc.mjs +9 -0
  395. package/src/Thumbnail/Thumbnail.test.tsx +38 -8
  396. package/src/Thumbnail/Thumbnail.tsx +28 -1
  397. package/src/TimeInput/TimeInput.test.tsx +76 -1
  398. package/src/TimeInput/TimeInput.tsx +19 -6
  399. package/src/Tokenizer/Tokenizer.doc.mjs +1 -1
  400. package/src/Tokenizer/Tokenizer.test.tsx +137 -2
  401. package/src/Tokenizer/Tokenizer.tsx +16 -4
  402. package/src/Toolbar/Toolbar.tsx +10 -3
  403. package/src/TopNav/TopNav.test.tsx +80 -1
  404. package/src/TopNav/TopNavHeading.tsx +24 -8
  405. package/src/TopNav/TopNavMegaMenu.test.tsx +149 -1
  406. package/src/TopNav/TopNavMegaMenu.tsx +10 -4
  407. package/src/TopNav/TopNavMenu.test.tsx +118 -4
  408. package/src/TopNav/TopNavMenu.tsx +83 -5
  409. package/src/TreeList/TreeList.test.tsx +32 -1
  410. package/src/TreeList/TreeListItem.tsx +19 -10
  411. package/src/authoring/doc.ts +1 -3
  412. package/src/docs-script.test.mjs +18 -13
  413. package/src/hooks/computeOverflow.test.ts +422 -0
  414. package/src/hooks/computeOverflow.ts +290 -0
  415. package/src/hooks/useOverflow.test.ts +96 -4
  416. package/src/hooks/useOverflow.ts +77 -33
  417. package/src/postinstall.test.mjs +71 -0
  418. package/src/theme/Theme.doc.mjs +4 -4
  419. package/src/theme/Theme.tsx +1 -1
  420. package/src/theme/defineTheme.ts +1 -1
  421. package/src/theme/generateThemeRules.test.ts +65 -0
  422. package/src/theme/generateThemeRules.ts +56 -0
  423. package/src/theme/hct.ts +0 -4
  424. package/src/utils/types.ts +14 -0
  425. package/dist/TreeList/treeListItem.markers.stylex.d.ts +0 -16
  426. package/dist/TreeList/treeListItem.markers.stylex.d.ts.map +0 -1
  427. package/dist/TreeList/treeListItem.markers.stylex.js +0 -22
  428. package/src/TreeList/treeListItem.markers.stylex.ts +0 -20
@@ -1 +1 @@
1
- {"version":3,"file":"doc.d.ts","sourceRoot":"","sources":["../../src/authoring/doc.ts"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"doc.d.ts","sourceRoot":"","sources":["../../src/authoring/doc.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * @file computeOverflow.ts
3
+ * @input Plain measurements (item widths, gap, available width, indicator width, limits)
4
+ * @output Pure overflow computation: how many items are visible and their row layout
5
+ * @position Pure helper consumed by useOverflow; contains no DOM or React code so the
6
+ * fit/clamp math and the multi-row packing can be unit-tested in isolation.
7
+ *
8
+ * There is a single source of truth for `visibleCount`:
9
+ * visibleCount = clamp(fitCount, minVisibleItems, maxVisibleItems ?? itemCount)
10
+ *
11
+ * SYNC: When modified, update:
12
+ * - /packages/core/src/hooks/useOverflow.ts (the only caller)
13
+ */
14
+ export interface ComputeOverflowInput {
15
+ /** Measured widths of each item, in original DOM order. */
16
+ widths: number[];
17
+ /** Gap between items, in pixels. */
18
+ gap: number;
19
+ /** Width available to lay items out, in pixels. */
20
+ availableWidth: number;
21
+ /** Measured width of the overflow indicator (0 if none). */
22
+ indicatorWidth: number;
23
+ /** Floor — always show at least this many items. */
24
+ minVisibleItems: number;
25
+ /** Ceiling — never show more than this many items. `undefined` = no cap. */
26
+ maxVisibleItems?: number;
27
+ /**
28
+ * Bounded multi-row: wrap items across up to this many rows, then collapse
29
+ * the rest into the overflow indicator. `undefined` (or `1`) = single line.
30
+ */
31
+ maxRows?: number;
32
+ /** Which end items collapse from. */
33
+ collapseFrom: 'start' | 'end';
34
+ }
35
+ export interface ComputeOverflowResult {
36
+ /** Number of items that should be rendered in the visible container. */
37
+ visibleCount: number;
38
+ /** Number of rows the visible items occupy (always 1 for the single-line path). */
39
+ rows: number;
40
+ }
41
+ /**
42
+ * Pure overflow computation. Given plain measurements and the configured
43
+ * limits, return how many items should be visible and how many rows they
44
+ * occupy. No DOM, no React — safe to unit-test directly.
45
+ */
46
+ export declare function computeOverflow(input: ComputeOverflowInput): ComputeOverflowResult;
47
+ //# sourceMappingURL=computeOverflow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"computeOverflow.d.ts","sourceRoot":"","sources":["../../src/hooks/computeOverflow.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,oBAAoB;IACnC,2DAA2D;IAC3D,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,oCAAoC;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,mDAAmD;IACnD,cAAc,EAAE,MAAM,CAAC;IACvB,4DAA4D;IAC5D,cAAc,EAAE,MAAM,CAAC;IACvB,oDAAoD;IACpD,eAAe,EAAE,MAAM,CAAC;IACxB,4EAA4E;IAC5E,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qCAAqC;IACrC,YAAY,EAAE,OAAO,GAAG,KAAK,CAAC;CAC/B;AAED,MAAM,WAAW,qBAAqB;IACpC,wEAAwE;IACxE,YAAY,EAAE,MAAM,CAAC;IACrB,mFAAmF;IACnF,IAAI,EAAE,MAAM,CAAC;CACd;AA0LD;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,oBAAoB,GAC1B,qBAAqB,CAqDvB"}
@@ -0,0 +1,213 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @file computeOverflow.ts
5
+ * @input Plain measurements (item widths, gap, available width, indicator width, limits)
6
+ * @output Pure overflow computation: how many items are visible and their row layout
7
+ * @position Pure helper consumed by useOverflow; contains no DOM or React code so the
8
+ * fit/clamp math and the multi-row packing can be unit-tested in isolation.
9
+ *
10
+ * There is a single source of truth for `visibleCount`:
11
+ * visibleCount = clamp(fitCount, minVisibleItems, maxVisibleItems ?? itemCount)
12
+ *
13
+ * SYNC: When modified, update:
14
+ * - /packages/core/src/hooks/useOverflow.ts (the only caller)
15
+ */
16
+
17
+ function clamp(value, min, max) {
18
+ return Math.max(Math.min(value, max), min);
19
+ }
20
+
21
+ /**
22
+ * Resolve the ceiling and floor into a single [floor, ceiling] pair.
23
+ *
24
+ * `maxVisibleItems` is clamped to `itemCount` (a cap larger than the list is a
25
+ * no-op). When `maxVisibleItems < minVisibleItems`, the floor wins (D1) via the
26
+ * final clamp — the hook is responsible for the dev-only warning.
27
+ */
28
+ function resolveBounds(itemCount, minVisibleItems, maxVisibleItems) {
29
+ const floor = Math.max(0, Math.min(minVisibleItems, itemCount));
30
+ const rawCeiling = maxVisibleItems == null ? itemCount : maxVisibleItems;
31
+ const ceiling = Math.max(0, Math.min(rawCeiling, itemCount));
32
+ return {
33
+ floor,
34
+ ceiling
35
+ };
36
+ }
37
+
38
+ /**
39
+ * Single-line greedy fit: how many items fit in one row of `availableWidth`,
40
+ * reserving indicator space for every non-final admitted item. Mirrors the
41
+ * original in-hook loop so single-line behavior is unchanged.
42
+ */
43
+ function computeSingleLineFit(orderedWidths, gap, availableWidth, indicatorWidth, floor, ceiling) {
44
+ let totalWidth = 0;
45
+ let count = 0;
46
+ for (let i = 0; i < orderedWidths.length; i++) {
47
+ if (count >= ceiling) {
48
+ break;
49
+ }
50
+ const itemWidth = orderedWidths[i];
51
+ const gapWidth = i > 0 ? gap : 0;
52
+ const candidateWidth = totalWidth + itemWidth + gapWidth;
53
+ const isLastItem = i === orderedWidths.length - 1;
54
+ const reservedWidth = isLastItem ? 0 : indicatorWidth + (count > 0 || indicatorWidth > 0 ? gap : 0);
55
+ if (candidateWidth + reservedWidth > availableWidth && count >= floor) {
56
+ break;
57
+ }
58
+ totalWidth = candidateWidth;
59
+ count++;
60
+ }
61
+ return count;
62
+ }
63
+
64
+ /**
65
+ * Pack items into rows, wrapping when the next item would exceed
66
+ * `availableWidth`. On the last allowed row, keep `indicatorReserve` px free so
67
+ * the overflow indicator fits. Stops admitting once no further item can be
68
+ * placed within `maxRows`.
69
+ */
70
+ function packRows(orderedWidths, gap, availableWidth, indicatorReserve, maxRows) {
71
+ let placed = 0;
72
+ let row = 1;
73
+ let rowWidth = 0;
74
+ for (let i = 0; i < orderedWidths.length; i++) {
75
+ const w = orderedWidths[i];
76
+ const isFirstInRow = rowWidth === 0;
77
+ const candidate = isFirstInRow ? w : rowWidth + gap + w;
78
+ const onLastRow = row === maxRows;
79
+ const reserve = onLastRow && indicatorReserve > 0 ? indicatorReserve + gap : 0;
80
+ if (candidate + reserve <= availableWidth) {
81
+ rowWidth = candidate;
82
+ placed++;
83
+ continue;
84
+ }
85
+ if (isFirstInRow) {
86
+ // A single item wider than the row occupies this row alone (it will be
87
+ // clipped visually). But if it can't coexist with the reserved indicator
88
+ // on the last row, stop here.
89
+ if (onLastRow && reserve > 0) {
90
+ break;
91
+ }
92
+ rowWidth = candidate;
93
+ placed++;
94
+ continue;
95
+ }
96
+ if (row >= maxRows) {
97
+ break;
98
+ }
99
+ row++;
100
+ rowWidth = 0;
101
+ i--; // re-attempt this item as the first on the new row
102
+ }
103
+ return {
104
+ placed,
105
+ rows: row
106
+ };
107
+ }
108
+
109
+ /** Count how many rows a set of items occupies when wrapped at availableWidth. */
110
+ function countRows(orderedWidths, gap, availableWidth) {
111
+ if (orderedWidths.length === 0) {
112
+ return 0;
113
+ }
114
+ let rows = 1;
115
+ let rowWidth = 0;
116
+ for (let i = 0; i < orderedWidths.length; i++) {
117
+ const w = orderedWidths[i];
118
+ const isFirstInRow = rowWidth === 0;
119
+ const candidate = isFirstInRow ? w : rowWidth + gap + w;
120
+ if (candidate <= availableWidth || isFirstInRow) {
121
+ rowWidth = candidate;
122
+ } else {
123
+ rows++;
124
+ rowWidth = w;
125
+ }
126
+ }
127
+ return rows;
128
+ }
129
+
130
+ /**
131
+ * Multi-row packing (Strategy A): simulate wrapping items into rows of
132
+ * `availableWidth`, admitting items until a new item would require a row beyond
133
+ * `maxRows`, reserving indicator space on the final row when items overflow.
134
+ * Returns the admitted count and how many rows those items occupy. Assumes
135
+ * uniform row height.
136
+ */
137
+ function computeMultiRowFit(orderedWidths, gap, availableWidth, indicatorWidth, maxRows) {
138
+ const n = orderedWidths.length;
139
+ if (n === 0) {
140
+ return {
141
+ count: 0,
142
+ rows: 0
143
+ };
144
+ }
145
+
146
+ // If everything fits within maxRows without reserving indicator space, there
147
+ // is no overflow and no indicator is needed.
148
+ const packAll = packRows(orderedWidths, gap, availableWidth, 0, maxRows);
149
+ if (packAll.placed === n) {
150
+ return {
151
+ count: n,
152
+ rows: packAll.rows
153
+ };
154
+ }
155
+
156
+ // Overflow → reserve indicator space on the final row and re-pack.
157
+ const packWithIndicator = packRows(orderedWidths, gap, availableWidth, indicatorWidth, maxRows);
158
+ const count = packWithIndicator.placed;
159
+ const rows = countRows(orderedWidths.slice(0, count), gap, availableWidth);
160
+ return {
161
+ count,
162
+ rows: Math.max(count > 0 ? 1 : 0, rows)
163
+ };
164
+ }
165
+
166
+ /**
167
+ * Pure overflow computation. Given plain measurements and the configured
168
+ * limits, return how many items should be visible and how many rows they
169
+ * occupy. No DOM, no React — safe to unit-test directly.
170
+ */
171
+ export function computeOverflow(input) {
172
+ const {
173
+ widths,
174
+ gap,
175
+ availableWidth,
176
+ indicatorWidth,
177
+ minVisibleItems,
178
+ maxVisibleItems,
179
+ maxRows,
180
+ collapseFrom
181
+ } = input;
182
+ const itemCount = widths.length;
183
+ if (itemCount === 0) {
184
+ return {
185
+ visibleCount: 0,
186
+ rows: 0
187
+ };
188
+ }
189
+ const {
190
+ floor,
191
+ ceiling
192
+ } = resolveBounds(itemCount, minVisibleItems, maxVisibleItems);
193
+ const orderedWidths = collapseFrom === 'end' ? widths : [...widths].reverse();
194
+ const multiRow = maxRows != null && maxRows > 1;
195
+ if (!multiRow) {
196
+ const fitCount = computeSingleLineFit(orderedWidths, gap, availableWidth, indicatorWidth, floor, ceiling);
197
+ const visibleCount = clamp(fitCount, floor, ceiling);
198
+ return {
199
+ visibleCount,
200
+ rows: visibleCount > 0 ? 1 : 0
201
+ };
202
+ }
203
+ const {
204
+ count,
205
+ rows
206
+ } = computeMultiRowFit(orderedWidths, gap, availableWidth, indicatorWidth, maxRows);
207
+ const visibleCount = clamp(count, floor, ceiling);
208
+ const resolvedRows = visibleCount === count ? rows : countRows(orderedWidths.slice(0, visibleCount), gap, availableWidth);
209
+ return {
210
+ visibleCount,
211
+ rows: visibleCount > 0 ? Math.max(1, resolvedRows) : 0
212
+ };
213
+ }
@@ -9,6 +9,21 @@ export interface UseOverflowOptions {
9
9
  * @default 0
10
10
  */
11
11
  minVisibleItems?: number;
12
+ /**
13
+ * Maximum number of items to ever show, even if they all fit. The ceiling
14
+ * partner to `minVisibleItems`. `undefined` means no cap. When it is less
15
+ * than `minVisibleItems`, the floor wins and a dev-only warning is emitted.
16
+ * @default undefined
17
+ */
18
+ maxVisibleItems?: number;
19
+ /**
20
+ * Wrap items across up to this many rows before collapsing the rest into the
21
+ * overflow indicator. `undefined` (or `1`) keeps the single-line behavior.
22
+ * A number, not a boolean: unbounded wrapping is a plain flex-wrap layout,
23
+ * not overflow collapse. Assumes uniform row height.
24
+ * @default undefined
25
+ */
26
+ maxRows?: number;
12
27
  /**
13
28
  * Which end to collapse items from.
14
29
  * @default 'end'
@@ -35,6 +50,10 @@ export interface UseOverflowReturn {
35
50
  visibleCount: number;
36
51
  /** Whether any items are overflowing */
37
52
  hasOverflow: boolean;
53
+ /** Number of rows the visible items occupy (1 for the single-line path) */
54
+ rows: number;
55
+ /** Measured max item height in pixels; used to size the multi-row container */
56
+ rowHeight: number;
38
57
  }
39
58
  /**
40
59
  * Hook for managing horizontal overflow of a list of items.
@@ -1 +1 @@
1
- {"version":3,"file":"useOverflow.d.ts","sourceRoot":"","sources":["../../src/hooks/useOverflow.ts"],"names":[],"mappings":"AAsBA,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IAE/B;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAE,eAAe,GAAG,aAAa,CAAC;CAC5C;AAED,MAAM,WAAW,iBAAiB;IAChC,qDAAqD;IACrD,YAAY,EAAE,KAAK,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IAC7C,wDAAwD;IACxD,UAAU,EAAE,KAAK,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IAC3C,wDAAwD;IACxD,YAAY,EAAE,MAAM,CAAC;IACrB,wCAAwC;IACxC,WAAW,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,WAAW,CACzB,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,kBAAuB,GAC/B,iBAAiB,CAsInB"}
1
+ {"version":3,"file":"useOverflow.d.ts","sourceRoot":"","sources":["../../src/hooks/useOverflow.ts"],"names":[],"mappings":"AA0BA,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IAE/B;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAE,eAAe,GAAG,aAAa,CAAC;CAC5C;AAED,MAAM,WAAW,iBAAiB;IAChC,qDAAqD;IACrD,YAAY,EAAE,KAAK,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IAC7C,wDAAwD;IACxD,UAAU,EAAE,KAAK,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IAC3C,wDAAwD;IACxD,YAAY,EAAE,MAAM,CAAC;IACrB,wCAAwC;IACxC,WAAW,EAAE,OAAO,CAAC;IACrB,2EAA2E;IAC3E,IAAI,EAAE,MAAM,CAAC;IACb,+EAA+E;IAC/E,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,WAAW,CACzB,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,kBAAuB,GAC/B,iBAAiB,CAyJnB"}
@@ -10,14 +10,18 @@
10
10
  *
11
11
  * Measures children rendered in a hidden container to determine how many fit
12
12
  * in the available width, without flickering. Uses ResizeObserver to react
13
- * to container size changes.
13
+ * to container size changes. Supports an optional item cap (`maxVisibleItems`)
14
+ * and bounded multi-row wrapping (`maxRows`); the fit/clamp/row-packing math
15
+ * lives in the pure `computeOverflow` helper.
14
16
  *
15
17
  * SYNC: When modified, update:
16
18
  * - /packages/core/src/hooks/index.ts
19
+ * - /packages/core/src/hooks/computeOverflow.ts (the pure computation)
17
20
  */
18
21
  import { useState, useCallback, useRef } from 'react';
19
22
  import { useIsomorphicLayoutEffect } from "./useIsomorphicLayoutEffect.js";
20
23
  import { observeResize, unobserveResize } from "../utils/sharedResizeObserver.js";
24
+ import { computeOverflow } from "./computeOverflow.js";
21
25
  /**
22
26
  * Hook for managing horizontal overflow of a list of items.
23
27
  *
@@ -40,11 +44,18 @@ export function useOverflow(itemCount, options = {}) {
40
44
  const {
41
45
  gap = 0,
42
46
  minVisibleItems = 0,
47
+ maxVisibleItems,
48
+ maxRows,
43
49
  collapseFrom = 'end',
44
50
  behavior = 'observeSelf'
45
51
  } = options;
52
+ if (process.env.NODE_ENV !== 'production' && maxVisibleItems != null && maxVisibleItems < minVisibleItems) {
53
+ console.warn(`useOverflow: maxVisibleItems (${maxVisibleItems}) is less than ` + `minVisibleItems (${minVisibleItems}); the floor wins and ` + `minVisibleItems items will be shown.`);
54
+ }
46
55
  const observeParent = behavior === 'observeParent';
47
56
  const [visibleCount, setVisibleCount] = useState(itemCount);
57
+ const [rows, setRows] = useState(1);
58
+ const [rowHeight, setRowHeight] = useState(0);
48
59
  const containerElRef = useRef(null);
49
60
  const measureElRef = useRef(null);
50
61
  const observedElRef = useRef(null);
@@ -72,34 +83,33 @@ export function useOverflow(itemCount, options = {}) {
72
83
  if (children.length === 0) {
73
84
  // eslint-disable-next-line @eslint-react/set-state-in-effect -- overflow count is derived from measured DOM widths
74
85
  setVisibleCount(0);
86
+ // eslint-disable-next-line @eslint-react/set-state-in-effect -- derived from measured DOM
87
+ setRows(0);
75
88
  return;
76
89
  }
77
-
78
- // Collect widths of all children
79
90
  const widths = children.map(child => child.offsetWidth);
80
-
81
- // Determine how many items fit
82
- let totalWidth = 0;
83
- let count = 0;
84
- const orderedWidths = collapseFrom === 'end' ? widths : [...widths].reverse();
85
- for (let i = 0; i < orderedWidths.length; i++) {
86
- const itemWidth = orderedWidths[i];
87
- const gapWidth = i > 0 ? gap : 0;
88
- const candidateWidth = totalWidth + itemWidth + gapWidth;
89
-
90
- // If this isn't the last item, we need to reserve space for the indicator
91
- const isLastItem = i === orderedWidths.length - 1;
92
- const reservedWidth = isLastItem ? 0 : indicatorWidth + (count > 0 || indicatorWidth > 0 ? gap : 0);
93
- if (candidateWidth + reservedWidth > availableWidth && count >= minVisibleItems) {
94
- break;
95
- }
96
- totalWidth = candidateWidth;
97
- count++;
98
- }
91
+ const measuredRowHeight = children.reduce((max, child) => Math.max(max, child.offsetHeight || 0), 0);
92
+ const {
93
+ visibleCount: nextVisible,
94
+ rows: nextRows
95
+ } = computeOverflow({
96
+ widths,
97
+ gap,
98
+ availableWidth,
99
+ indicatorWidth,
100
+ minVisibleItems,
101
+ maxVisibleItems,
102
+ maxRows,
103
+ collapseFrom
104
+ });
99
105
 
100
106
  // eslint-disable-next-line @eslint-react/set-state-in-effect -- overflow count is derived from measured DOM widths
101
- setVisibleCount(Math.max(Math.min(count, itemCount), minVisibleItems));
102
- }, [itemCount, gap, minVisibleItems, collapseFrom, observeParent]);
107
+ setVisibleCount(nextVisible);
108
+ // eslint-disable-next-line @eslint-react/set-state-in-effect -- derived from measured DOM
109
+ setRows(prev => prev === nextRows ? prev : nextRows);
110
+ // eslint-disable-next-line @eslint-react/set-state-in-effect -- derived from measured DOM
111
+ setRowHeight(prev => prev === measuredRowHeight ? prev : measuredRowHeight);
112
+ }, [itemCount, gap, minVisibleItems, maxVisibleItems, maxRows, collapseFrom, observeParent]);
103
113
  const containerRef = useCallback(el => {
104
114
  containerElRef.current = el;
105
115
 
@@ -132,6 +142,8 @@ export function useOverflow(itemCount, options = {}) {
132
142
  containerRef,
133
143
  measureRef,
134
144
  visibleCount,
135
- hasOverflow
145
+ hasOverflow,
146
+ rows,
147
+ rowHeight
136
148
  };
137
149
  }
@@ -115,7 +115,7 @@ function useThemeStyleInjection(theme) {
115
115
  // One-time perf hint per theme
116
116
  if (!warnedThemes.has(theme.name)) {
117
117
  warnedThemes.add(theme.name);
118
- console.warn(`[Astryx] Theme "${theme.name}" is using runtime style injection. ` + `For better performance, use the pre-built theme:\n\n` + ` import {${theme.name}Theme} from '@astryxdesign/theme-${theme.name}/built';\n` + ` import '@astryxdesign/theme-${theme.name}/theme.css';\n\n` + `For custom themes, run \`npx astryx theme build <file>\` to generate ` + `the built artifacts.`);
118
+ console.warn(`[Astryx] Theme "${theme.name}" is using runtime style injection. ` + `For better performance, use the pre-built theme:\n\n` + ` import {${theme.name}Theme} from '@astryxdesign/theme-${theme.name}/built';\n` + ` import '@astryxdesign/theme-${theme.name}/theme.css';\n\n` + `For custom themes, run \`npx @astryxdesign/cli theme build <file>\` to generate ` + `the built artifacts.`);
119
119
  }
120
120
  const {
121
121
  prose,
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Two distribution modes:
5
5
  * - Unbuilt: Theme generates CSS and injects a <style> tag at runtime
6
- * - Built: `npx astryx theme build` pre-compiles to a CSS file; Theme just
6
+ * - Built: `astryx theme build` pre-compiles to a CSS file; Theme just
7
7
  * sets the data-astryx-theme attribute
8
8
  *
9
9
  * Token values can be:
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Two distribution modes:
7
7
  * - Unbuilt: Theme generates CSS and injects a <style> tag at runtime
8
- * - Built: `npx astryx theme build` pre-compiles to a CSS file; Theme just
8
+ * - Built: `astryx theme build` pre-compiles to a CSS file; Theme just
9
9
  * sets the data-astryx-theme attribute
10
10
  *
11
11
  * Token values can be:
@@ -1 +1 @@
1
- {"version":3,"file":"generateThemeRules.d.ts","sourceRoot":"","sources":["../../src/theme/generateThemeRules.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AA+DhD;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,+EAA+E;IAC/E,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,kFAAkF;IAClF,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAgKD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,EAAE,CAgChE;AAoMD;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,YAAY,GAAG,eAAe,CAe5E;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CA4E9D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,YAAY,GAAG,cAAc,CA2BpE;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAQhE"}
1
+ {"version":3,"file":"generateThemeRules.d.ts","sourceRoot":"","sources":["../../src/theme/generateThemeRules.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AA+DhD;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,+EAA+E;IAC/E,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,kFAAkF;IAClF,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAgKD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,EAAE,CAoChE;AAwPD;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,YAAY,GAAG,eAAe,CAe5E;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CA4E9D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,YAAY,GAAG,cAAc,CA2BpE;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAQhE"}
@@ -247,6 +247,10 @@ export function generateThemeRules(theme) {
247
247
  // 4. Prop-level color overrides (for text/heading/link specificity)
248
248
  generateColorOverrides(theme.components || {}, parts);
249
249
 
250
+ // 5. Text `size`-prop font-size overrides (so an explicit size beats a
251
+ // themed type's font-size across the astryx-base → astryx-theme layers)
252
+ generateSizeOverrides(theme.components || {}, parts);
253
+
250
254
  // (on-media rules are generated separately — see generateOnMediaCSS)
251
255
 
252
256
  return parts;
@@ -408,6 +412,53 @@ function generateColorOverrides(components, parts) {
408
412
  }
409
413
  }
410
414
 
415
+ /**
416
+ * Map a Text `size` prop value to its raw font-size token.
417
+ * Mirrors `sizeStyles` in `Text/text.stylex.ts` (note `xsm` → `--font-size-xs`).
418
+ * <!-- SYNC: packages/core/src/Text/text.stylex.ts (sizeStyles) -->
419
+ */
420
+ const TEXT_SIZE_TOKEN_MAP = {
421
+ '4xs': 'var(--font-size-4xs)',
422
+ '3xs': 'var(--font-size-3xs)',
423
+ '2xs': 'var(--font-size-2xs)',
424
+ xsm: 'var(--font-size-xs)',
425
+ sm: 'var(--font-size-sm)',
426
+ base: 'var(--font-size-base)',
427
+ lg: 'var(--font-size-lg)',
428
+ xl: 'var(--font-size-xl)',
429
+ '2xl': 'var(--font-size-2xl)',
430
+ '3xl': 'var(--font-size-3xl)',
431
+ '4xl': 'var(--font-size-4xl)'
432
+ };
433
+
434
+ /**
435
+ * Generate `size`-prop font-size overrides for the Text component.
436
+ *
437
+ * The `size` prop is documented as a font-size override that wins over the
438
+ * size implied by `type`. Its StyleX class lives in `@layer astryx-base`, but a
439
+ * theme's per-type font-size rule (`.astryx-text.<type>`) lives in the higher
440
+ * `@layer astryx-theme`, so the layer cascade let the theme silently shadow
441
+ * `size` for any `type` the theme styled. Re-emitting the size classes here —
442
+ * same layer as the type rules, same `.astryx-text.<x>` specificity, later in
443
+ * source — restores `size` as a real override.
444
+ *
445
+ * Only `font-size` is overridden; line-height and other type properties are
446
+ * intentionally preserved, matching the prop's documented contract.
447
+ *
448
+ * Gated on the theme touching `text` (which includes the auto-generated
449
+ * type-scale rules) — with no theme type rule to beat, the base-layer StyleX
450
+ * class already wins and no override is needed.
451
+ */
452
+ function generateSizeOverrides(components, parts) {
453
+ if (!('text' in components)) {
454
+ return;
455
+ }
456
+ for (const [sizeName, sizeValue] of Object.entries(TEXT_SIZE_TOKEN_MAP)) {
457
+ const suffix = parseStyleKey(`size:${sizeName}`);
458
+ parts.push(` ${componentClassSelector('text', suffix)} { font-size: ${sizeValue}; }`);
459
+ }
460
+ }
461
+
411
462
  /**
412
463
  * Generate theme rules split into component and prose groups.
413
464
  *
@@ -4,7 +4,6 @@ export interface HCT {
4
4
  tone: number;
5
5
  }
6
6
  export declare function toneToY(tone: number): number;
7
- export declare function yToTone(y: number): number;
8
7
  /**
9
8
  * Convert a hex color to HCT.
10
9
  * Hue: 0-360, Chroma: 0-~120, Tone: 0-100.
@@ -1 +1 @@
1
- {"version":3,"file":"hct.d.ts","sourceRoot":"","sources":["../../src/theme/hct.ts"],"names":[],"mappings":"AAwBA,MAAM,WAAW,GAAG;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAoFD,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEzC;AAkBD;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAkBzC;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CA8BzC;AAkDD;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,GACb,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAMxB;AAMD;;GAEG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAM/D"}
1
+ {"version":3,"file":"hct.d.ts","sourceRoot":"","sources":["../../src/theme/hct.ts"],"names":[],"mappings":"AAwBA,MAAM,WAAW,GAAG;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAoFD,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5C;AAkBD;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAkBzC;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CA8BzC;AAkDD;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,GACb,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAMxB;AAMD;;GAEG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAM/D"}
package/dist/theme/hct.js CHANGED
@@ -79,9 +79,6 @@ function labToXyz(L, a, b) {
79
79
  export function toneToY(tone) {
80
80
  return labFInv((tone + 16) / 116);
81
81
  }
82
- export function yToTone(y) {
83
- return 116 * labF(y) - 16;
84
- }
85
82
 
86
83
  // =============================================================================
87
84
  // Hex <-> RGB
@@ -8,6 +8,19 @@
8
8
  * Size value type - accepts numbers (treated as pixels) or strings (e.g., '100%', '50vh').
9
9
  */
10
10
  export type SizeValue = number | string;
11
+ /**
12
+ * Resting elevation level for configurable surfaces.
13
+ *
14
+ * Maps to the shadow token scale:
15
+ * - `none` = flat (`box-shadow: none`)
16
+ * - `low` = `--shadow-low`
17
+ * - `med` = `--shadow-med`
18
+ * - `high` = `--shadow-high`
19
+ *
20
+ * Components narrow this union to the steps they actually need — e.g. Card
21
+ * exposes all four, while ChatComposer exposes only `'none' | 'low'`.
22
+ */
23
+ export type Elevation = 'none' | 'low' | 'med' | 'high';
11
24
  /**
12
25
  * Numeric spacing step from the Astryx spacing scale.
13
26
  *
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/utils/types.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;AAExC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/utils/types.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;AAExC;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;AAExD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC"}