@crewlethq/ui 0.2.0 → 0.3.0

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 (497) hide show
  1. package/README.md +1714 -14
  2. package/dist/Accordion/Accordion.d.ts +54 -0
  3. package/dist/Accordion/index.d.ts +4 -0
  4. package/dist/Accordion/index.js +6 -0
  5. package/dist/Accordion-ZI2WLD5C.css +87 -0
  6. package/dist/AddPill/AddPill.d.ts +114 -0
  7. package/dist/AddPill/index.d.ts +3 -0
  8. package/dist/AddPill/index.js +3 -0
  9. package/dist/AddPill-DFWXYLIQ.css +434 -0
  10. package/dist/Announcer/Announcer.d.ts +15 -0
  11. package/dist/Announcer/index.d.ts +2 -0
  12. package/dist/Announcer/index.js +3 -0
  13. package/dist/AppShell/AppShell.d.ts +193 -0
  14. package/dist/AppShell/index.d.ts +3 -0
  15. package/dist/AppShell/index.js +6 -0
  16. package/dist/AppShell-NVE6LHNI.css +395 -0
  17. package/dist/Avatar/Avatar.d.ts +104 -0
  18. package/dist/Avatar/index.d.ts +3 -0
  19. package/dist/Avatar/index.js +2 -0
  20. package/dist/Avatar-P2KRQM2B.css +156 -0
  21. package/dist/BrandLockup/BrandLockup.d.ts +41 -0
  22. package/dist/BrandLockup/index.d.ts +3 -0
  23. package/dist/BrandLockup/index.js +2 -0
  24. package/dist/BrandLockup-6ISDEHPJ.css +108 -0
  25. package/dist/Button/Button.d.ts +88 -0
  26. package/dist/Button/index.d.ts +3 -0
  27. package/dist/Button/index.js +3 -0
  28. package/dist/Button-D4J6B4MA.css +302 -0
  29. package/dist/CalendarGrid/CalendarGrid.d.ts +87 -0
  30. package/dist/CalendarGrid/index.d.ts +3 -0
  31. package/dist/CalendarGrid/index.js +2 -0
  32. package/dist/CalendarGrid-V6TQ5QKS.css +128 -0
  33. package/dist/Callout/Callout.d.ts +47 -0
  34. package/dist/Callout/index.d.ts +3 -0
  35. package/dist/Callout/index.js +2 -0
  36. package/dist/Callout-S7QDWHDL.css +111 -0
  37. package/dist/Canvas/Canvas.d.ts +234 -0
  38. package/dist/Canvas/geometry.d.ts +249 -0
  39. package/dist/Canvas/index.d.ts +5 -0
  40. package/dist/Canvas/index.js +8 -0
  41. package/dist/Canvas/layerNode.d.ts +20 -0
  42. package/dist/Canvas-Q6JETCWR.css +315 -0
  43. package/dist/Card/Card.d.ts +142 -0
  44. package/dist/Card/headerSlot.d.ts +65 -0
  45. package/dist/Card/index.d.ts +5 -0
  46. package/dist/Card/index.js +6 -0
  47. package/dist/Card-AHX3Q2JD.css +428 -0
  48. package/dist/Charts/ActivityStrip.d.ts +45 -0
  49. package/dist/Charts/BarList.d.ts +51 -0
  50. package/dist/Charts/Legend.d.ts +32 -0
  51. package/dist/Charts/StackedBar.d.ts +38 -0
  52. package/dist/Charts/TimeSeries.d.ts +92 -0
  53. package/dist/Charts/dataColor.d.ts +20 -0
  54. package/dist/Charts/index.d.ts +12 -0
  55. package/dist/Charts/index.js +3 -0
  56. package/dist/Charts-D7G2BSXH.css +277 -0
  57. package/dist/Checkbox/Checkbox.d.ts +45 -0
  58. package/dist/Checkbox/index.d.ts +3 -0
  59. package/dist/Checkbox/index.js +2 -0
  60. package/dist/Checkbox-VGW26YLQ.css +111 -0
  61. package/dist/CodeBlock/CodeBlock.d.ts +60 -0
  62. package/dist/CodeBlock/index.d.ts +3 -0
  63. package/dist/CodeBlock/index.js +7 -0
  64. package/dist/CodeBlock-U2W6NNVC.css +153 -0
  65. package/dist/Combobox/Combobox.d.ts +89 -0
  66. package/dist/Combobox/index.d.ts +3 -0
  67. package/dist/Combobox/index.js +8 -0
  68. package/dist/Combobox-4FUVYIE7.css +80 -0
  69. package/dist/CommandPalette/CommandPalette.d.ts +77 -0
  70. package/dist/CommandPalette/index.d.ts +3 -0
  71. package/dist/CommandPalette/index.js +11 -0
  72. package/dist/CommandPalette-CSJDUCQA.css +115 -0
  73. package/dist/Container/Container.d.ts +17 -0
  74. package/dist/Container/index.d.ts +3 -0
  75. package/dist/Container/index.js +2 -0
  76. package/dist/Container-3TSKMGNI.css +52 -0
  77. package/dist/Copyable/CopyButton.d.ts +54 -0
  78. package/dist/Copyable/Copyable.d.ts +34 -0
  79. package/dist/Copyable/index.d.ts +5 -0
  80. package/dist/Copyable/index.js +6 -0
  81. package/dist/Copyable-5PNRFOLS.css +125 -0
  82. package/dist/Count/Count.d.ts +24 -0
  83. package/dist/Count/index.d.ts +3 -0
  84. package/dist/Count/index.js +3 -0
  85. package/dist/Count-ZVCJ6VPD.css +20 -0
  86. package/dist/DataTable/CopyableCell.d.ts +12 -0
  87. package/dist/DataTable/DataTable.d.ts +615 -0
  88. package/dist/DataTable/RowActionsMenu.d.ts +7 -0
  89. package/dist/DataTable/index.d.ts +7 -0
  90. package/dist/DataTable/index.js +14 -0
  91. package/dist/DataTable-ITNACQ2X.css +2020 -0
  92. package/dist/DataView/DataView.d.ts +109 -0
  93. package/dist/DataView/DataViewToolbar.d.ts +87 -0
  94. package/dist/DataView/FilterAxisBar.d.ts +103 -0
  95. package/dist/DataView/columns.d.ts +35 -0
  96. package/dist/DataView/filters.d.ts +184 -0
  97. package/dist/DataView/index.d.ts +11 -0
  98. package/dist/DataView/index.js +25 -0
  99. package/dist/DataView-256YF32J.css +441 -0
  100. package/dist/DateTimePicker/DateTimePicker.d.ts +91 -0
  101. package/dist/DateTimePicker/index.d.ts +3 -0
  102. package/dist/DateTimePicker/index.js +9 -0
  103. package/dist/DateTimePicker-22VNXRWC.css +199 -0
  104. package/dist/DescriptionList/DescriptionList.d.ts +36 -0
  105. package/dist/DescriptionList/index.d.ts +3 -0
  106. package/dist/DescriptionList/index.js +2 -0
  107. package/dist/DescriptionList-YYY3V3O6.css +59 -0
  108. package/dist/DiffList/DiffList.d.ts +47 -0
  109. package/dist/DiffList/index.d.ts +3 -0
  110. package/dist/DiffList/index.js +3 -0
  111. package/dist/DiffList-3EX64AAE.css +94 -0
  112. package/dist/Disclosure/Disclosure.d.ts +56 -0
  113. package/dist/Disclosure/anatomy.d.ts +43 -0
  114. package/dist/Disclosure/index.d.ts +5 -0
  115. package/dist/Disclosure/index.js +6 -0
  116. package/dist/Disclosure-VKBJJIZ7.css +176 -0
  117. package/dist/EmptyState/EmptyState.d.ts +39 -0
  118. package/dist/EmptyState/index.d.ts +3 -0
  119. package/dist/EmptyState/index.js +3 -0
  120. package/dist/EmptyState-C6HRBGT7.css +73 -0
  121. package/dist/EmptyValue/EmptyValue.d.ts +31 -0
  122. package/dist/EmptyValue/index.d.ts +3 -0
  123. package/dist/EmptyValue/index.js +3 -0
  124. package/dist/EmptyValue-4B6ODXHT.css +12 -0
  125. package/dist/EntityChip/EntityChip.d.ts +40 -0
  126. package/dist/EntityChip/index.d.ts +3 -0
  127. package/dist/EntityChip/index.js +3 -0
  128. package/dist/EntityChip-LUCPZBBG.css +64 -0
  129. package/dist/ErrorBoundary/ErrorBoundary.d.ts +58 -0
  130. package/dist/ErrorBoundary/index.d.ts +3 -0
  131. package/dist/ErrorBoundary/index.js +4 -0
  132. package/dist/ErrorBoundary-ME36CQTA.css +59 -0
  133. package/dist/Eyebrow/Eyebrow.d.ts +18 -0
  134. package/dist/Eyebrow/index.d.ts +3 -0
  135. package/dist/Eyebrow/index.js +2 -0
  136. package/dist/Eyebrow-5NREGHQH.css +46 -0
  137. package/dist/FilterChip/FilterChip.d.ts +68 -0
  138. package/dist/FilterChip/index.d.ts +3 -0
  139. package/dist/FilterChip/index.js +3 -0
  140. package/dist/FilterChip-GTGLLOXE.css +107 -0
  141. package/dist/Fullscreen/index.d.ts +2 -0
  142. package/dist/Fullscreen/index.js +1 -0
  143. package/dist/Fullscreen/useFullscreen.d.ts +32 -0
  144. package/dist/IconButton/IconButton.d.ts +45 -0
  145. package/dist/IconButton/index.d.ts +3 -0
  146. package/dist/IconButton/index.js +3 -0
  147. package/dist/IconButton-VQGNMJDI.css +158 -0
  148. package/dist/ImageUpload/ImageUpload.d.ts +37 -0
  149. package/dist/ImageUpload/index.d.ts +3 -0
  150. package/dist/ImageUpload/index.js +3 -0
  151. package/dist/ImageUpload-HKFIZR6D.css +193 -0
  152. package/dist/InlineCode/InlineCode.d.ts +37 -0
  153. package/dist/InlineCode/index.d.ts +3 -0
  154. package/dist/InlineCode/index.js +2 -0
  155. package/dist/InlineCode-6WSR5COL.css +65 -0
  156. package/dist/Input/FormField.d.ts +61 -0
  157. package/dist/Input/FormRow.d.ts +6 -0
  158. package/dist/Input/FormSection.d.ts +28 -0
  159. package/dist/Input/Input.d.ts +98 -0
  160. package/dist/Input/Label.d.ts +31 -0
  161. package/dist/Input/ReadOnlyField.d.ts +30 -0
  162. package/dist/Input/Textarea.d.ts +16 -0
  163. package/dist/Input/index.d.ts +15 -0
  164. package/dist/Input/index.js +5 -0
  165. package/dist/Input-2PU5CPKK.css +616 -0
  166. package/dist/Kbd/Kbd.d.ts +40 -0
  167. package/dist/Kbd/index.d.ts +3 -0
  168. package/dist/Kbd/index.js +3 -0
  169. package/dist/Kbd-W66MXQI5.css +61 -0
  170. package/dist/Layer/LayerHost.d.ts +23 -0
  171. package/dist/Layer/index.d.ts +7 -0
  172. package/dist/Layer/index.js +3 -0
  173. package/dist/Layer/place.d.ts +63 -0
  174. package/dist/Layer/stack.d.ts +159 -0
  175. package/dist/Layer-NAFSGCFA.css +23 -0
  176. package/dist/Layout/Layout.d.ts +104 -0
  177. package/dist/Layout/index.d.ts +3 -0
  178. package/dist/Layout/index.js +2 -0
  179. package/dist/Layout-2ZCV3IGF.css +171 -0
  180. package/dist/Link/Link.d.ts +45 -0
  181. package/dist/Link/index.d.ts +3 -0
  182. package/dist/Link/index.js +3 -0
  183. package/dist/Link-6BEFNMN2.css +80 -0
  184. package/dist/List/List.d.ts +73 -0
  185. package/dist/List/index.d.ts +3 -0
  186. package/dist/List/index.js +3 -0
  187. package/dist/List-XTHESXLR.css +161 -0
  188. package/dist/ListInput/ListInput.d.ts +68 -0
  189. package/dist/ListInput/index.d.ts +3 -0
  190. package/dist/ListInput/index.js +10 -0
  191. package/dist/ListInput-O7LJKOIG.css +147 -0
  192. package/dist/Listbox/index.d.ts +5 -0
  193. package/dist/Listbox/index.js +2 -0
  194. package/dist/Listbox/useListbox.d.ts +97 -0
  195. package/dist/Listbox/useOptionKeys.d.ts +64 -0
  196. package/dist/Listbox-X2DOTSQA.css +110 -0
  197. package/dist/Menu/Menu.d.ts +118 -0
  198. package/dist/Menu/index.d.ts +3 -0
  199. package/dist/Menu/index.js +7 -0
  200. package/dist/Menu-6DE7I66I.css +222 -0
  201. package/dist/Meter/Meter.d.ts +49 -0
  202. package/dist/Meter/index.d.ts +3 -0
  203. package/dist/Meter/index.js +3 -0
  204. package/dist/Meter-SKOOXQBC.css +87 -0
  205. package/dist/Modal/ConfirmModal.d.ts +74 -0
  206. package/dist/Modal/Modal.d.ts +154 -0
  207. package/dist/Modal/index.d.ts +5 -0
  208. package/dist/Modal/index.js +8 -0
  209. package/dist/Modal-XYQJ4BL6.css +484 -0
  210. package/dist/NewItemsNotice/NewItemsNotice.d.ts +28 -0
  211. package/dist/NewItemsNotice/index.d.ts +3 -0
  212. package/dist/NewItemsNotice/index.js +4 -0
  213. package/dist/NewItemsNotice-T4DSSPVV.css +60 -0
  214. package/dist/OrgLabel/OrgLabel.d.ts +117 -0
  215. package/dist/OrgLabel/index.d.ts +3 -0
  216. package/dist/OrgLabel/index.js +2 -0
  217. package/dist/OrgLabel-D7U6QJZD.css +293 -0
  218. package/dist/OrgNode/OrgNode.d.ts +103 -0
  219. package/dist/OrgNode/index.d.ts +3 -0
  220. package/dist/OrgNode/index.js +3 -0
  221. package/dist/OrgNode-BT7T2Q2X.css +214 -0
  222. package/dist/OrgTable/OrgTable.d.ts +113 -0
  223. package/dist/OrgTable/index.d.ts +3 -0
  224. package/dist/OrgTable/index.js +11 -0
  225. package/dist/OrgTable-VWMFC3TB.css +360 -0
  226. package/dist/PageHeader/PageHeader.d.ts +35 -0
  227. package/dist/PageHeader/index.d.ts +3 -0
  228. package/dist/PageHeader/index.js +3 -0
  229. package/dist/PageHeader-6EYWQXRE.css +88 -0
  230. package/dist/Popover/Popover.d.ts +91 -0
  231. package/dist/Popover/index.d.ts +3 -0
  232. package/dist/Popover/index.js +4 -0
  233. package/dist/Popover-WJGCF3ZQ.css +185 -0
  234. package/dist/PricingCard/PricingCard.d.ts +56 -0
  235. package/dist/PricingCard/index.d.ts +3 -0
  236. package/dist/PricingCard/index.js +4 -0
  237. package/dist/PricingCard-JFI7RYXP.css +278 -0
  238. package/dist/Prose/Prose.d.ts +33 -0
  239. package/dist/Prose/index.d.ts +3 -0
  240. package/dist/Prose/index.js +2 -0
  241. package/dist/Prose-BTXNFT2Q.css +99 -0
  242. package/dist/RelativeTime/RelativeTime.d.ts +31 -0
  243. package/dist/RelativeTime/clock.d.ts +9 -0
  244. package/dist/RelativeTime/format.d.ts +38 -0
  245. package/dist/RelativeTime/index.d.ts +6 -0
  246. package/dist/RelativeTime/index.js +4 -0
  247. package/dist/RelativeTime-EBAQPGO2.css +10 -0
  248. package/dist/SearchTrigger/SearchTrigger.d.ts +29 -0
  249. package/dist/SearchTrigger/index.d.ts +3 -0
  250. package/dist/SearchTrigger/index.js +2 -0
  251. package/dist/SearchTrigger-QXOYAUUY.css +79 -0
  252. package/dist/Section/Section.d.ts +41 -0
  253. package/dist/Section/index.d.ts +3 -0
  254. package/dist/Section/index.js +3 -0
  255. package/dist/Section-QRUPRIQ2.css +127 -0
  256. package/dist/SegmentedControl/SegmentedControl.d.ts +68 -0
  257. package/dist/SegmentedControl/index.d.ts +4 -0
  258. package/dist/SegmentedControl/index.js +5 -0
  259. package/dist/SegmentedControl-X3BI3XU4.css +68 -0
  260. package/dist/Select/Select.d.ts +138 -0
  261. package/dist/Select/index.d.ts +3 -0
  262. package/dist/Select/index.js +5 -0
  263. package/dist/Select-2X77FSWR.css +350 -0
  264. package/dist/Shortcut/index.d.ts +2 -0
  265. package/dist/Shortcut/index.js +4 -0
  266. package/dist/Shortcut/useShortcut.d.ts +68 -0
  267. package/dist/SidebarNav/SidebarNav.d.ts +117 -0
  268. package/dist/SidebarNav/index.d.ts +3 -0
  269. package/dist/SidebarNav/index.js +3 -0
  270. package/dist/SidebarNav-QGSFKZYA.css +319 -0
  271. package/dist/Skeleton/Skeleton.d.ts +50 -0
  272. package/dist/Skeleton/index.d.ts +3 -0
  273. package/dist/Skeleton/index.js +3 -0
  274. package/dist/Skeleton-V735HRGM.css +421 -0
  275. package/dist/StatCard/StatCard.d.ts +56 -0
  276. package/dist/StatCard/index.d.ts +3 -0
  277. package/dist/StatCard/index.js +3 -0
  278. package/dist/StatCard-KYPKZUWX.css +111 -0
  279. package/dist/StatGroup/StatGroup.d.ts +20 -0
  280. package/dist/StatGroup/index.d.ts +3 -0
  281. package/dist/StatGroup/index.js +2 -0
  282. package/dist/StatGroup-TGB6AEKM.css +80 -0
  283. package/dist/StatusDot/StatusDot.d.ts +25 -0
  284. package/dist/StatusDot/index.d.ts +3 -0
  285. package/dist/StatusDot/index.js +2 -0
  286. package/dist/StatusDot-HA2L2FSX.css +84 -0
  287. package/dist/Switch/Switch.d.ts +38 -0
  288. package/dist/Switch/index.d.ts +3 -0
  289. package/dist/Switch/index.js +2 -0
  290. package/dist/Switch-U4OWK4CL.css +169 -0
  291. package/dist/Table/Table.d.ts +51 -0
  292. package/dist/Table/index.d.ts +3 -0
  293. package/dist/Table/index.js +3 -0
  294. package/dist/Table-MDOLVUAW.css +159 -0
  295. package/dist/Tabs/Tabs.d.ts +97 -0
  296. package/dist/Tabs/index.d.ts +3 -0
  297. package/dist/Tabs/index.js +4 -0
  298. package/dist/Tabs/roving.d.ts +36 -0
  299. package/dist/Tabs-VLICJFVB.css +275 -0
  300. package/dist/Tag/Tag.d.ts +107 -0
  301. package/dist/Tag/index.d.ts +3 -0
  302. package/dist/Tag/index.js +3 -0
  303. package/dist/Tag-VNZEYLB6.css +406 -0
  304. package/dist/TagGroup/TagGroup.d.ts +41 -0
  305. package/dist/TagGroup/index.d.ts +3 -0
  306. package/dist/TagGroup/index.js +4 -0
  307. package/dist/TagGroup-APC2EFH4.css +75 -0
  308. package/dist/TagsInput/TagsInput.d.ts +112 -0
  309. package/dist/TagsInput/index.d.ts +3 -0
  310. package/dist/TagsInput/index.js +10 -0
  311. package/dist/TagsInput-W4P36PRJ.css +168 -0
  312. package/dist/Text/Text.d.ts +67 -0
  313. package/dist/Text/index.d.ts +3 -0
  314. package/dist/Text/index.js +2 -0
  315. package/dist/Text-XIPYYZX2.css +154 -0
  316. package/dist/ThemeSwitcher/ThemeSwitcher.d.ts +47 -0
  317. package/dist/ThemeSwitcher/index.d.ts +4 -0
  318. package/dist/ThemeSwitcher/index.js +6 -0
  319. package/dist/ThemeSwitcher/preferences.d.ts +51 -0
  320. package/dist/TimeWindowPicker/TimeWindowPicker.d.ts +231 -0
  321. package/dist/TimeWindowPicker/index.d.ts +3 -0
  322. package/dist/TimeWindowPicker/index.js +13 -0
  323. package/dist/TimeWindowPicker/mask.d.ts +82 -0
  324. package/dist/TimeWindowPicker-7I7KWCMU.css +403 -0
  325. package/dist/Timeline/Timeline.d.ts +51 -0
  326. package/dist/Timeline/index.d.ts +3 -0
  327. package/dist/Timeline/index.js +3 -0
  328. package/dist/Timeline-27SYKOFX.css +144 -0
  329. package/dist/Toaster/Toaster.d.ts +108 -0
  330. package/dist/Toaster/index.d.ts +3 -0
  331. package/dist/Toaster/index.js +5 -0
  332. package/dist/Toaster-NVDCEIP5.css +306 -0
  333. package/dist/Toolbar/Toolbar.d.ts +62 -0
  334. package/dist/Toolbar/index.d.ts +3 -0
  335. package/dist/Toolbar/index.js +4 -0
  336. package/dist/Toolbar-IP6LXN45.css +48 -0
  337. package/dist/Tooltip/Tooltip.d.ts +51 -0
  338. package/dist/Tooltip/index.d.ts +3 -0
  339. package/dist/Tooltip/index.js +4 -0
  340. package/dist/Tooltip-LKQF7CE4.css +71 -0
  341. package/dist/Tree/index.d.ts +8 -0
  342. package/dist/Tree/index.js +1 -0
  343. package/dist/Tree/layout.d.ts +160 -0
  344. package/dist/Tree/model.d.ts +110 -0
  345. package/dist/Tree/useMeasuredSizes.d.ts +61 -0
  346. package/dist/Tree/useTreeState.d.ts +89 -0
  347. package/dist/TreeCanvas/TreeCanvas.d.ts +384 -0
  348. package/dist/TreeCanvas/index.d.ts +3 -0
  349. package/dist/TreeCanvas/index.js +10 -0
  350. package/dist/TreeCanvas/motion.d.ts +59 -0
  351. package/dist/TreeCanvas-WBNQPHC7.css +1098 -0
  352. package/dist/TreeGrid/TreeGrid.d.ts +142 -0
  353. package/dist/TreeGrid/index.d.ts +3 -0
  354. package/dist/TreeGrid/index.js +8 -0
  355. package/dist/TreeGrid-NSW7VMOX.css +132 -0
  356. package/dist/VisuallyHidden/VisuallyHidden.d.ts +23 -0
  357. package/dist/VisuallyHidden/index.d.ts +3 -0
  358. package/dist/VisuallyHidden/index.js +2 -0
  359. package/dist/VisuallyHidden-L552H7OA.css +21 -0
  360. package/dist/chunk-22O7LAW2.js +41 -0
  361. package/dist/chunk-23DHIMJA.js +38 -0
  362. package/dist/chunk-2EOKFKHX.js +263 -0
  363. package/dist/chunk-2PRH365R.js +74 -0
  364. package/dist/chunk-2ZQMA2WB.js +57 -0
  365. package/dist/chunk-3CZ7XAVY.js +139 -0
  366. package/dist/chunk-3EYF6HKB.js +135 -0
  367. package/dist/chunk-3ZP55QZE.js +40 -0
  368. package/dist/chunk-53DVJCVW.js +14 -0
  369. package/dist/chunk-5C5YMZQU.js +51 -0
  370. package/dist/chunk-5EKIWVOR.js +132 -0
  371. package/dist/chunk-5IMACPJS.js +495 -0
  372. package/dist/chunk-5KPQ6D7N.js +54 -0
  373. package/dist/chunk-5SDBMKUO.js +297 -0
  374. package/dist/chunk-5WS6L6FA.js +114 -0
  375. package/dist/chunk-7EM5T4ME.js +39 -0
  376. package/dist/chunk-7FZ53WDJ.js +163 -0
  377. package/dist/chunk-7HPRF5XN.js +525 -0
  378. package/dist/chunk-7RPGY3JE.js +43 -0
  379. package/dist/chunk-A2UXBCLO.js +48 -0
  380. package/dist/chunk-ARMRX2YV.js +96 -0
  381. package/dist/chunk-AV2DXAEL.js +27 -0
  382. package/dist/chunk-BHHIIK3M.js +17 -0
  383. package/dist/chunk-BZFWDIV6.js +9 -0
  384. package/dist/chunk-BZYDZBAN.js +123 -0
  385. package/dist/chunk-CMEE37QJ.js +628 -0
  386. package/dist/chunk-D3OADIM6.js +112 -0
  387. package/dist/chunk-DD5BBGBE.js +162 -0
  388. package/dist/chunk-EHMQQHYR.js +1652 -0
  389. package/dist/chunk-EN6K2IFA.js +256 -0
  390. package/dist/chunk-EPOOQZYA.js +118 -0
  391. package/dist/chunk-ESCO4XYW.js +144 -0
  392. package/dist/chunk-EUCC37WY.js +14 -0
  393. package/dist/chunk-EV6IMYJ6.js +62 -0
  394. package/dist/chunk-F27EPQ7D.js +68 -0
  395. package/dist/chunk-F4PJZ4ED.js +245 -0
  396. package/dist/chunk-F6OE5FH3.js +49 -0
  397. package/dist/chunk-FBZAKNSX.js +263 -0
  398. package/dist/chunk-FEFTGVMF.js +46 -0
  399. package/dist/chunk-G2QFRTJ2.js +823 -0
  400. package/dist/chunk-GHYY2WPF.js +907 -0
  401. package/dist/chunk-GTOUGQQK.js +147 -0
  402. package/dist/chunk-GUIF6Q6N.js +143 -0
  403. package/dist/chunk-GXQ3B46I.js +216 -0
  404. package/dist/chunk-H4FBTAYS.js +130 -0
  405. package/dist/chunk-HOXGBLEY.js +37 -0
  406. package/dist/chunk-HQNHV7D6.js +54 -0
  407. package/dist/chunk-HTDFCRJZ.js +92 -0
  408. package/dist/chunk-HZ5XZNPS.js +98 -0
  409. package/dist/chunk-IAJLHVUA.js +28 -0
  410. package/dist/chunk-IJ7QXNIJ.js +1 -0
  411. package/dist/chunk-ITHXJHBB.js +280 -0
  412. package/dist/chunk-JCSA3XVH.js +32 -0
  413. package/dist/chunk-KLJCCMF3.js +97 -0
  414. package/dist/chunk-LGCPQIOZ.js +49 -0
  415. package/dist/chunk-LWKJQTOM.js +77 -0
  416. package/dist/chunk-MNAXYY3R.js +215 -0
  417. package/dist/chunk-NN62JQLR.js +29 -0
  418. package/dist/chunk-NPZY6YYL.js +251 -0
  419. package/dist/chunk-NTRZGNEX.js +529 -0
  420. package/dist/chunk-O6232G37.js +273 -0
  421. package/dist/chunk-O67VF5MS.js +58 -0
  422. package/dist/chunk-ODEQTPFM.js +6 -0
  423. package/dist/chunk-PNFASD6F.js +98 -0
  424. package/dist/chunk-PQADV6P6.js +19 -0
  425. package/dist/chunk-PZSWF74H.js +15 -0
  426. package/dist/chunk-Q4ZPPART.js +26 -0
  427. package/dist/chunk-QNCVHRZL.js +17 -0
  428. package/dist/chunk-QVE4GJAT.js +15 -0
  429. package/dist/chunk-QYOFACSP.js +36 -0
  430. package/dist/chunk-RA2ULG6H.js +29 -0
  431. package/dist/chunk-RDGD7Z7I.js +350 -0
  432. package/dist/chunk-RK4XPHVG.js +16 -0
  433. package/dist/chunk-RSAQOKH3.js +38 -0
  434. package/dist/chunk-S2XHHEW4.js +84 -0
  435. package/dist/chunk-S4GZWSKR.js +137 -0
  436. package/dist/chunk-SFZOKW2G.js +52 -0
  437. package/dist/chunk-T7FKOJKW.js +221 -0
  438. package/dist/chunk-UG46QBLT.js +325 -0
  439. package/dist/chunk-UOGSZKLT.js +134 -0
  440. package/dist/chunk-V2XMNLMS.js +52 -0
  441. package/dist/chunk-V663QU4R.js +51 -0
  442. package/dist/chunk-W4ENKCXJ.js +40 -0
  443. package/dist/chunk-W5J7R5EB.js +107 -0
  444. package/dist/chunk-WNI2WSJF.js +27 -0
  445. package/dist/chunk-XDTYBF2F.js +36 -0
  446. package/dist/chunk-XN4JBAN3.js +32 -0
  447. package/dist/chunk-XV6WRMBC.js +211 -0
  448. package/dist/chunk-YLYOWZ4V.js +33 -0
  449. package/dist/chunk-YMWONFSI.js +170 -0
  450. package/dist/chunk-ZCR6YGQ4.js +1 -0
  451. package/dist/generated/index.d.ts +83 -0
  452. package/dist/generated/index.js +91 -0
  453. package/dist/index.d.ts +1 -1217
  454. package/dist/index.js +91 -4518
  455. package/dist/styles.css +14841 -4274
  456. package/dist/utils/cx.d.ts +10 -0
  457. package/dist/utils/headingLevel.d.ts +16 -0
  458. package/dist/utils/index.d.ts +6 -0
  459. package/dist/utils/index.js +4 -0
  460. package/dist/utils/tone.d.ts +25 -0
  461. package/dist/utils/useClipboard.d.ts +30 -0
  462. package/package.json +18 -10
  463. package/scripts/bundle-css.mjs +25 -0
  464. package/scripts/check-css-literals.mjs +166 -0
  465. package/scripts/check-css-variables.mjs +184 -0
  466. package/scripts/check-css.mjs +27 -0
  467. package/scripts/css-source.mjs +67 -0
  468. package/scripts/write-barrel.mjs +60 -0
  469. package/dist/Accordion-NIMJQIOI.css +0 -88
  470. package/dist/AppShell-ZW3NSFBP.css +0 -51
  471. package/dist/Avatar-V6NG6Q45.css +0 -67
  472. package/dist/Button-XGCTXXYP.css +0 -174
  473. package/dist/Callout-LEGDIMAM.css +0 -52
  474. package/dist/Card-BOZGBML7.css +0 -86
  475. package/dist/Checkbox-OCUICIIZ.css +0 -58
  476. package/dist/CodeBlock-IEMBNIQC.css +0 -90
  477. package/dist/Container-LTKBA2FW.css +0 -21
  478. package/dist/Copyable-IB57OTHZ.css +0 -123
  479. package/dist/DataTable-3GALZUW2.css +0 -1593
  480. package/dist/DateTimePicker-NMSSGVPK.css +0 -312
  481. package/dist/Eyebrow-AVBORAS2.css +0 -30
  482. package/dist/IconButton-GB4PJDG2.css +0 -82
  483. package/dist/ImageUpload-3HQDF2KC.css +0 -158
  484. package/dist/Input-ZHUTN7CU.css +0 -210
  485. package/dist/Kbd-Q77CDZY7.css +0 -23
  486. package/dist/Modal-FJVG66S4.css +0 -138
  487. package/dist/Popover-FUFULUE2.css +0 -123
  488. package/dist/PricingCard-NKYV3JHA.css +0 -238
  489. package/dist/Section-665ZIPG6.css +0 -20
  490. package/dist/Select-GPRF7PRB.css +0 -294
  491. package/dist/Skeleton-3WEFLRDN.css +0 -378
  492. package/dist/StatCard-RTJIVTRB.css +0 -50
  493. package/dist/Table-AR3TRY2E.css +0 -89
  494. package/dist/Tabs-XZ4JIH3E.css +0 -153
  495. package/dist/Tag-R5QDJLYJ.css +0 -163
  496. package/dist/TimeWindowPicker-L3G5Q7UT.css +0 -629
  497. package/dist/Toaster-2O65VOR4.css +0 -264
@@ -0,0 +1,529 @@
1
+ import { useMemo, useState, useCallback, useRef, useEffect, useLayoutEffect } from 'react';
2
+ import { flushSync } from 'react-dom';
3
+
4
+ // src/Tree/model.ts
5
+ function createTreeModel(forest) {
6
+ const children = /* @__PURE__ */ new Map();
7
+ const parent = /* @__PURE__ */ new Map();
8
+ const label = /* @__PURE__ */ new Map();
9
+ const depth = /* @__PURE__ */ new Map();
10
+ const order = [];
11
+ const visit = (node, up, level) => {
12
+ if (parent.has(node.id)) {
13
+ throw new RangeError(`createTreeModel: the id "${node.id}" appears twice; every row needs its own id`);
14
+ }
15
+ parent.set(node.id, up);
16
+ label.set(node.id, node.label);
17
+ depth.set(node.id, level);
18
+ order.push(node.id);
19
+ const kids2 = node.children ?? [];
20
+ children.set(
21
+ node.id,
22
+ kids2.map((kid) => kid.id)
23
+ );
24
+ kids2.forEach((kid) => visit(kid, node.id, level + 1));
25
+ };
26
+ forest.forEach((root) => visit(root, null, 0));
27
+ return { roots: forest.map((root) => root.id), children, parent, label, depth, order };
28
+ }
29
+ var kids = (tree, id) => tree.children.get(id) ?? [];
30
+ function siblings(tree, id) {
31
+ const up = tree.parent.get(id);
32
+ return up == null ? tree.roots : kids(tree, up);
33
+ }
34
+ function treeExpandable(tree, id) {
35
+ return kids(tree, id).length > 0;
36
+ }
37
+ function treeLevel(tree, id) {
38
+ return (tree.depth.get(id) ?? 0) + 1;
39
+ }
40
+ function treeSetSize(tree, id) {
41
+ return siblings(tree, id).length;
42
+ }
43
+ function treePosInSet(tree, id) {
44
+ return siblings(tree, id).indexOf(id) + 1;
45
+ }
46
+ function treeParent(tree, id) {
47
+ return tree.parent.get(id) ?? null;
48
+ }
49
+ function treeFirstChild(tree, id) {
50
+ return kids(tree, id)[0] ?? null;
51
+ }
52
+ function treeAncestors(tree, id) {
53
+ const out = [];
54
+ for (let up = tree.parent.get(id) ?? null; up !== null; up = tree.parent.get(up) ?? null) {
55
+ out.unshift(up);
56
+ }
57
+ return out;
58
+ }
59
+ function treeExpandTo(tree, expanded, id) {
60
+ return /* @__PURE__ */ new Set([...expanded, ...treeAncestors(tree, id)]);
61
+ }
62
+ function treeAllExpandable(tree) {
63
+ return new Set(tree.order.filter((id) => treeExpandable(tree, id)));
64
+ }
65
+ var open = (tree, expanded, id) => expanded.has(id) && treeExpandable(tree, id);
66
+ function treeVisible(tree, expanded) {
67
+ const out = [];
68
+ const walk = (ids) => {
69
+ for (const id of ids) {
70
+ out.push(id);
71
+ if (open(tree, expanded, id)) walk(kids(tree, id));
72
+ }
73
+ };
74
+ walk(tree.roots);
75
+ return out;
76
+ }
77
+ function treeFirst(tree) {
78
+ return tree.roots[0] ?? null;
79
+ }
80
+ function treeLast(tree, expanded) {
81
+ let last = tree.roots[tree.roots.length - 1] ?? null;
82
+ while (last !== null && open(tree, expanded, last)) {
83
+ const children = kids(tree, last);
84
+ last = children[children.length - 1];
85
+ }
86
+ return last;
87
+ }
88
+ function treeNext(tree, expanded, id) {
89
+ if (open(tree, expanded, id)) return kids(tree, id)[0];
90
+ for (let at = id; at !== null; at = treeParent(tree, at)) {
91
+ const row = siblings(tree, at);
92
+ const next = row[row.indexOf(at) + 1];
93
+ if (next !== void 0) return next;
94
+ }
95
+ return null;
96
+ }
97
+ function treePrevious(tree, expanded, id) {
98
+ const row = siblings(tree, id);
99
+ const at = row.indexOf(id);
100
+ if (at <= 0) return treeParent(tree, id);
101
+ let last = row[at - 1];
102
+ while (open(tree, expanded, last)) {
103
+ const children = kids(tree, last);
104
+ last = children[children.length - 1];
105
+ }
106
+ return last;
107
+ }
108
+ function treeExpandOrDescend(tree, expanded, id) {
109
+ if (!treeExpandable(tree, id)) return null;
110
+ return expanded.has(id) ? { focus: kids(tree, id)[0] } : { expand: id };
111
+ }
112
+ function treeCollapseOrAscend(tree, expanded, id) {
113
+ if (open(tree, expanded, id)) return { collapse: id };
114
+ const up = treeParent(tree, id);
115
+ return up === null ? null : { focus: up };
116
+ }
117
+ var TYPE_AHEAD_RESET_MS = 500;
118
+ var RESERVED = /* @__PURE__ */ new Set(["+", "-", "0"]);
119
+ function liveWord(state, now) {
120
+ return now - state.at > TYPE_AHEAD_RESET_MS ? "" : state.text;
121
+ }
122
+ function isTypeAheadKey(event, state, now) {
123
+ if (event.ctrlKey || event.metaKey || event.altKey) return false;
124
+ if ([...event.key].length !== 1) return false;
125
+ if (liveWord(state, now) !== "") return true;
126
+ return event.key !== " " && !RESERVED.has(event.key);
127
+ }
128
+ function typeAheadBuffer(state, key, now) {
129
+ return { text: liveWord(state, now) + key, at: now };
130
+ }
131
+ function treeTypeAhead(tree, expanded, from, text) {
132
+ if (text === "") return null;
133
+ const rows = treeVisible(tree, expanded);
134
+ if (rows.length === 0) return null;
135
+ const lower = text.toLocaleLowerCase();
136
+ const cycling = [...lower].every((character) => character === lower[0]);
137
+ const needle = cycling ? lower[0] : lower;
138
+ const at = from === null ? -1 : rows.indexOf(from);
139
+ const begin = at < 0 ? 0 : at + (cycling ? 1 : 0);
140
+ for (let step = 0; step < rows.length; step++) {
141
+ const id = rows[(begin + step) % rows.length];
142
+ if ((tree.label.get(id) ?? "").toLocaleLowerCase().startsWith(needle)) return id;
143
+ }
144
+ return null;
145
+ }
146
+
147
+ // src/Tree/layout.ts
148
+ var MIN_OUTLINE_HEIGHT = 1;
149
+ function bandsOf(roots, gapY) {
150
+ const height = [];
151
+ const visit = (node, depth) => {
152
+ height[depth] = Math.max(height[depth] ?? 0, node.height);
153
+ node.children.forEach((child) => visit(child, depth + 1));
154
+ };
155
+ roots.forEach((root) => visit(root, 0));
156
+ const top = [];
157
+ let at = 0;
158
+ for (let depth = 0; depth < height.length; depth++) {
159
+ top[depth] = at;
160
+ at += height[depth] + gapY;
161
+ }
162
+ return { top, height };
163
+ }
164
+ function shift(outline, dx, dy) {
165
+ return outline.map((s) => ({ top: s.top + dy, bottom: s.bottom + dy, value: s.value + dx }));
166
+ }
167
+ function mirror(outline) {
168
+ return outline.map((s) => ({ ...s, value: -s.value }));
169
+ }
170
+ function merge(a, b, pick) {
171
+ const cuts = [...new Set([...a, ...b].flatMap((s) => [s.top, s.bottom]))].sort((x, y) => x - y);
172
+ const out = [];
173
+ let i = 0;
174
+ let j = 0;
175
+ for (let k = 0; k + 1 < cuts.length; k++) {
176
+ const lo = cuts[k];
177
+ const hi = cuts[k + 1];
178
+ while (i < a.length && a[i].bottom <= lo) i++;
179
+ while (j < b.length && b[j].bottom <= lo) j++;
180
+ const va = i < a.length && a[i].top <= lo ? a[i].value : void 0;
181
+ const vb = j < b.length && b[j].top <= lo ? b[j].value : void 0;
182
+ const value = va !== void 0 && vb !== void 0 ? pick(va, vb) : va ?? vb;
183
+ if (value === void 0) continue;
184
+ const last = out[out.length - 1];
185
+ if (last && last.bottom === lo && last.value === value) last.bottom = hi;
186
+ else out.push({ top: lo, bottom: hi, value });
187
+ }
188
+ return out;
189
+ }
190
+ function separation(right, left, gap) {
191
+ let need = -Infinity;
192
+ let i = 0;
193
+ for (const s of left) {
194
+ while (i < right.length && right[i].bottom <= s.top) i++;
195
+ for (let k = i; k < right.length && right[k].top < s.bottom; k++) {
196
+ need = Math.max(need, right[k].value - s.value);
197
+ }
198
+ }
199
+ if (Number.isFinite(need)) return need + gap;
200
+ const maxRight = right.reduce((m, s) => Math.max(m, s.value), -Infinity);
201
+ const minLeft = left.reduce((m, s) => Math.min(m, s.value), Infinity);
202
+ return maxRight - minLeft + gap;
203
+ }
204
+ function packFromLeft(kids2, gap) {
205
+ const positions = [0];
206
+ let reach = kids2[0].right;
207
+ for (let i = 1; i < kids2.length; i++) {
208
+ const at = separation(reach, kids2[i].left, gap);
209
+ positions.push(at);
210
+ reach = merge(reach, shift(kids2[i].right, at, 0), Math.max);
211
+ }
212
+ return positions;
213
+ }
214
+ function pack(kids2, gap) {
215
+ const fromLeft = packFromLeft(kids2, gap);
216
+ const mirrored = [...kids2].reverse().map((k) => ({ left: mirror(k.right), right: mirror(k.left) }));
217
+ const fromRight = packFromLeft(mirrored, gap).map((p) => -p).reverse();
218
+ const first = fromRight[0];
219
+ const averaged = fromLeft.map((p, i) => (p + fromRight[i] - first) / 2);
220
+ const centre = (averaged[0] + averaged[averaged.length - 1]) / 2;
221
+ return averaged.map((p) => p - centre);
222
+ }
223
+ function build(node, gaps, bands, depth) {
224
+ const kids2 = node.children.map((child) => build(child, gaps, bands, depth + 1));
225
+ const half = node.width / 2;
226
+ const tall = Math.max(node.height, MIN_OUTLINE_HEIGHT);
227
+ const inBand = bands ? (bands.height[depth] - node.height) / 2 : 0;
228
+ let left = [{ top: inBand, bottom: inBand + tall, value: -half }];
229
+ let right = [{ top: inBand, bottom: inBand + tall, value: half }];
230
+ if (kids2.length === 0) return { node, kids: kids2, offsets: [], inBand, left, right };
231
+ const offsets = pack(kids2, gaps.gapX);
232
+ const childTop = bands ? bands.top[depth + 1] - bands.top[depth] : node.height + gaps.gapY;
233
+ if (!bands && childTop > node.height) {
234
+ const band = (value) => [{ top: node.height, bottom: childTop, value }];
235
+ left = merge(left, band(Math.min(-half, offsets[0])), Math.min);
236
+ right = merge(right, band(Math.max(half, offsets[offsets.length - 1])), Math.max);
237
+ }
238
+ kids2.forEach((kid, i) => {
239
+ left = merge(left, shift(kid.left, offsets[i], childTop), Math.min);
240
+ right = merge(right, shift(kid.right, offsets[i], childTop), Math.max);
241
+ });
242
+ return { node, kids: kids2, offsets, inBand, left, right };
243
+ }
244
+ function validate(roots, gaps) {
245
+ const size = (value) => Number.isFinite(value) && value >= 0;
246
+ if (!size(gaps.gapX) || !size(gaps.gapY) || !size(gaps.margin ?? 0)) {
247
+ throw new RangeError(
248
+ `layoutForest: gapX, gapY and margin must be finite and non-negative, got ${JSON.stringify(gaps)}`
249
+ );
250
+ }
251
+ if (gaps.ranks !== void 0 && gaps.ranks !== "per-parent" && gaps.ranks !== "shared") {
252
+ throw new RangeError(`layoutForest: ranks is "${gaps.ranks}"; it is "per-parent" or "shared"`);
253
+ }
254
+ const seen = /* @__PURE__ */ new Set();
255
+ const visit = (node) => {
256
+ if (seen.has(node.id)) {
257
+ throw new RangeError(`layoutForest: the id "${node.id}" appears twice; every box needs its own id`);
258
+ }
259
+ seen.add(node.id);
260
+ if (!size(node.width) || !size(node.height)) {
261
+ throw new RangeError(
262
+ `layoutForest: "${node.id}" is ${node.width} by ${node.height}; a size must be finite and non-negative`
263
+ );
264
+ }
265
+ node.children.forEach(visit);
266
+ };
267
+ roots.forEach(visit);
268
+ }
269
+ function layoutForest(roots, gaps) {
270
+ validate(roots, gaps);
271
+ const margin = gaps.margin ?? 0;
272
+ const nodes = [];
273
+ if (roots.length === 0) {
274
+ return { nodes, byId: /* @__PURE__ */ new Map(), bounds: { x: 0, y: 0, width: 0, height: 0 } };
275
+ }
276
+ const bands = gaps.ranks === "shared" ? bandsOf(roots, gaps.gapY) : null;
277
+ const trees = roots.map((root) => build(root, gaps, bands, 0));
278
+ const centres = pack(trees, gaps.gapX);
279
+ const place = (tree, centre, top, depth, parent) => {
280
+ const { node } = tree;
281
+ nodes.push({
282
+ id: node.id,
283
+ x: centre - node.width / 2,
284
+ y: top + tree.inBand,
285
+ width: node.width,
286
+ height: node.height,
287
+ depth,
288
+ parent
289
+ });
290
+ const childTop = bands ? bands.top[depth + 1] : top + node.height + gaps.gapY;
291
+ tree.kids.forEach((kid, i) => place(kid, centre + tree.offsets[i], childTop, depth + 1, node.id));
292
+ };
293
+ trees.forEach((tree, i) => place(tree, centres[i], bands ? bands.top[0] : 0, 0, null));
294
+ let minX = Infinity;
295
+ for (const node of nodes) minX = Math.min(minX, node.x);
296
+ let maxX = -Infinity;
297
+ let maxY = 0;
298
+ for (const node of nodes) {
299
+ node.x += margin - minX;
300
+ node.y += margin;
301
+ maxX = Math.max(maxX, node.x + node.width);
302
+ maxY = Math.max(maxY, node.y + node.height);
303
+ }
304
+ return {
305
+ nodes,
306
+ byId: new Map(nodes.map((node) => [node.id, node])),
307
+ bounds: { x: 0, y: 0, width: maxX + margin, height: maxY + margin }
308
+ };
309
+ }
310
+ var CONNECTOR_RADIUS = 12;
311
+ function layoutConnectors(layout, shape = "step") {
312
+ const out = [];
313
+ for (const node of layout.nodes) {
314
+ if (node.parent === null) continue;
315
+ const parent = layout.byId.get(node.parent);
316
+ if (!parent) continue;
317
+ const fromX = parent.x + parent.width / 2;
318
+ const fromY = parent.y + parent.height;
319
+ const toX = node.x + node.width / 2;
320
+ const toY = node.y;
321
+ const midY = fromY + (toY - fromY) / 2;
322
+ const across = toX - fromX;
323
+ const at = (d) => out.push({ id: node.id, parent: parent.id, d });
324
+ if (shape === "curve") {
325
+ at(`M ${fromX} ${fromY} C ${fromX} ${midY}, ${toX} ${midY}, ${toX} ${toY}`);
326
+ continue;
327
+ }
328
+ if (Math.abs(across) < 0.5) {
329
+ at(`M${fromX} ${fromY}V${toY}`);
330
+ continue;
331
+ }
332
+ const radius = Math.min(CONNECTOR_RADIUS, Math.abs(across) / 2, Math.abs(midY - fromY));
333
+ const step = across > 0 ? radius : -radius;
334
+ at(
335
+ `M${fromX} ${fromY}V${midY - radius}Q${fromX} ${midY},${fromX + step} ${midY}H${toX - step}Q${toX} ${midY},${toX} ${midY + radius}V${toY}`
336
+ );
337
+ }
338
+ return out;
339
+ }
340
+ function useTreeState(forest, selected) {
341
+ const model = useMemo(() => createTreeModel(forest), [forest]);
342
+ const [collapsed, setCollapsed] = useState(() => /* @__PURE__ */ new Set());
343
+ const expanded = useMemo(() => {
344
+ const out = treeAllExpandable(model);
345
+ for (const id of collapsed) out.delete(id);
346
+ return out;
347
+ }, [model, collapsed]);
348
+ const rows = useMemo(() => treeVisible(model, expanded), [model, expanded]);
349
+ const [wanted, setActive] = useState(null);
350
+ const active = useMemo(() => {
351
+ const id = wanted ?? selected;
352
+ if (id !== null && model.parent.has(id)) {
353
+ if (rows.includes(id)) return id;
354
+ const shown = treeAncestors(model, id).reverse().find((ancestor) => rows.includes(ancestor));
355
+ if (shown) return shown;
356
+ }
357
+ return treeFirst(model);
358
+ }, [wanted, selected, model, rows]);
359
+ const toggle = useCallback((id) => {
360
+ setCollapsed((was) => {
361
+ const next = new Set(was);
362
+ if (next.has(id)) next.delete(id);
363
+ else next.add(id);
364
+ return next;
365
+ });
366
+ }, []);
367
+ const current = useRef({ model, collapsed });
368
+ current.current = { model, collapsed };
369
+ const expandAll = useCallback(() => setCollapsed(/* @__PURE__ */ new Set()), []);
370
+ const collapseAll = useCallback(() => {
371
+ const { model: shown } = current.current;
372
+ const next = treeAllExpandable(shown);
373
+ shown.roots.forEach((root) => next.delete(root));
374
+ setCollapsed(next);
375
+ }, []);
376
+ const open2 = useCallback((id) => {
377
+ const { model: shown, collapsed: closed } = current.current;
378
+ const hidden = treeAncestors(shown, id).filter((ancestor) => closed.has(ancestor));
379
+ if (hidden.length === 0) return false;
380
+ setCollapsed((was) => {
381
+ const next = new Set(was);
382
+ hidden.forEach((ancestor) => next.delete(ancestor));
383
+ return next;
384
+ });
385
+ return true;
386
+ }, []);
387
+ const buffer = useRef({ text: "", at: 0 });
388
+ const typed = (event, from, now) => {
389
+ if (!isTypeAheadKey(event, buffer.current, now)) return void 0;
390
+ buffer.current = typeAheadBuffer(buffer.current, event.key, now);
391
+ return treeTypeAhead(model, expanded, from, buffer.current.text);
392
+ };
393
+ return { model, expanded, rows, active, setActive, toggle, expandAll, collapseAll, open: open2, typed };
394
+ }
395
+ function treeStep(tree, id, event) {
396
+ if (event.ctrlKey || event.metaKey || event.altKey) return void 0;
397
+ const { model, expanded } = tree;
398
+ const focus = (next) => next === null ? null : { focus: next };
399
+ switch (event.key) {
400
+ case "ArrowDown":
401
+ return focus(treeNext(model, expanded, id));
402
+ case "ArrowUp":
403
+ return focus(treePrevious(model, expanded, id));
404
+ case "ArrowRight": {
405
+ const step = treeExpandOrDescend(model, expanded, id);
406
+ if (step === null) return null;
407
+ return "expand" in step ? { toggle: step.expand } : { focus: step.focus };
408
+ }
409
+ case "ArrowLeft": {
410
+ const step = treeCollapseOrAscend(model, expanded, id);
411
+ if (step === null) return null;
412
+ return "collapse" in step ? { toggle: step.collapse } : { focus: step.focus };
413
+ }
414
+ case "Home":
415
+ return focus(treeFirst(model));
416
+ case "End":
417
+ return focus(treeLast(model, expanded));
418
+ default: {
419
+ const found = tree.typed(event, id, event.timeStamp);
420
+ return found === void 0 ? void 0 : focus(found);
421
+ }
422
+ }
423
+ }
424
+ function treeItemAction(event) {
425
+ if (event.key === "F10" && event.shiftKey && !event.ctrlKey && !event.metaKey && !event.altKey) {
426
+ return "menu";
427
+ }
428
+ if (event.ctrlKey || event.metaKey || event.altKey) return null;
429
+ if (event.key === "ContextMenu") return "menu";
430
+ if (event.shiftKey) return null;
431
+ if (event.key === "Enter") return "activate";
432
+ if (event.key === "Delete" || event.key === "Backspace") return "remove";
433
+ return null;
434
+ }
435
+ var SIZE_EPSILON = 0.5;
436
+ function sizeOf(entry) {
437
+ const box = entry.borderBoxSize?.[0];
438
+ if (box) return { width: box.inlineSize, height: box.blockSize };
439
+ const el = entry.target;
440
+ return { width: el.offsetWidth, height: el.offsetHeight };
441
+ }
442
+ function useMeasuredSizes() {
443
+ const [sizes, setSizes] = useState(() => /* @__PURE__ */ new Map());
444
+ const current = useRef(sizes);
445
+ current.current = sizes;
446
+ const observer = useRef(null);
447
+ const idOf = useRef(/* @__PURE__ */ new WeakMap());
448
+ const callbacks = useRef(/* @__PURE__ */ new Map());
449
+ const elements = useRef(/* @__PURE__ */ new Map());
450
+ const onResize = useCallback((entries) => {
451
+ let next = null;
452
+ for (const entry of entries) {
453
+ const id = idOf.current.get(entry.target);
454
+ if (id === void 0) continue;
455
+ const size = sizeOf(entry);
456
+ const was = (next ?? current.current).get(id);
457
+ if (was && Math.abs(was.width - size.width) < SIZE_EPSILON && Math.abs(was.height - size.height) < SIZE_EPSILON) {
458
+ continue;
459
+ }
460
+ next ??= new Map(current.current);
461
+ next.set(id, size);
462
+ }
463
+ if (!next) return;
464
+ const changed = next;
465
+ current.current = changed;
466
+ flushSync(() => setSizes(changed));
467
+ }, []);
468
+ const observe = useCallback(
469
+ (el) => {
470
+ if (typeof ResizeObserver === "undefined") return;
471
+ observer.current ??= new ResizeObserver(onResize);
472
+ observer.current.observe(el, { box: "border-box" });
473
+ },
474
+ [onResize]
475
+ );
476
+ const measure = useCallback(
477
+ (id) => {
478
+ let callback = callbacks.current.get(id);
479
+ if (callback) return callback;
480
+ callback = (el) => {
481
+ const previous = elements.current.get(id);
482
+ if (previous && previous !== el) {
483
+ observer.current?.unobserve(previous);
484
+ idOf.current.delete(previous);
485
+ elements.current.delete(id);
486
+ }
487
+ if (!el) return;
488
+ elements.current.set(id, el);
489
+ idOf.current.set(el, id);
490
+ observe(el);
491
+ };
492
+ callbacks.current.set(id, callback);
493
+ return callback;
494
+ },
495
+ [observe]
496
+ );
497
+ useEffect(
498
+ () => () => {
499
+ observer.current?.disconnect();
500
+ observer.current = null;
501
+ },
502
+ []
503
+ );
504
+ const measured = useCallback(
505
+ (ids) => {
506
+ for (const id of ids) if (!sizes.has(id)) return false;
507
+ return true;
508
+ },
509
+ [sizes]
510
+ );
511
+ return { measure, sizes, measured };
512
+ }
513
+ function useLayoutAnchor(positions, anchorId, keep) {
514
+ const previous = useRef(positions);
515
+ const keepNow = useRef(keep);
516
+ keepNow.current = keep;
517
+ useLayoutEffect(() => {
518
+ const was = previous.current;
519
+ previous.current = positions;
520
+ if (!was || !positions || anchorId === null || was === positions) return;
521
+ const before = was.get(anchorId);
522
+ const after = positions.get(anchorId);
523
+ if (before && after && (before.x !== after.x || before.y !== after.y)) {
524
+ keepNow.current(before, after);
525
+ }
526
+ }, [positions, anchorId]);
527
+ }
528
+
529
+ export { SIZE_EPSILON, TYPE_AHEAD_RESET_MS, createTreeModel, isTypeAheadKey, layoutConnectors, layoutForest, treeAllExpandable, treeAncestors, treeCollapseOrAscend, treeExpandOrDescend, treeExpandTo, treeExpandable, treeFirst, treeFirstChild, treeItemAction, treeLast, treeLevel, treeNext, treeParent, treePosInSet, treePrevious, treeSetSize, treeStep, treeTypeAhead, treeVisible, typeAheadBuffer, useLayoutAnchor, useMeasuredSizes, useTreeState };