@accelint/design-toolkit 9.8.0 → 9.9.1

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 (252) hide show
  1. package/catalog-info.yaml +7 -4
  2. package/dist/components/accordion/context.d.ts +2 -2
  3. package/dist/components/accordion/group.d.ts +2 -2
  4. package/dist/components/accordion/header.d.ts +2 -2
  5. package/dist/components/accordion/index.d.ts +2 -2
  6. package/dist/components/accordion/panel.d.ts +2 -2
  7. package/dist/components/accordion/trigger.d.ts +2 -2
  8. package/dist/components/action-bar/index.d.ts +2 -2
  9. package/dist/components/audio/index.d.ts +2 -2
  10. package/dist/components/avatar/context.d.ts +4 -4
  11. package/dist/components/avatar/index.d.ts +2 -2
  12. package/dist/components/badge/context.d.ts +4 -4
  13. package/dist/components/badge/index.d.ts +2 -2
  14. package/dist/components/breadcrumbs/index.d.ts +2 -2
  15. package/dist/components/button/__internal__/clear.js +1 -0
  16. package/dist/components/button/__internal__/clear.js.map +1 -1
  17. package/dist/components/button/context.d.ts +8 -8
  18. package/dist/components/button/index.d.ts +2 -2
  19. package/dist/components/button/link.d.ts +2 -2
  20. package/dist/components/button/toggle.d.ts +2 -2
  21. package/dist/components/checkbox/context.d.ts +3 -3
  22. package/dist/components/checkbox/group.d.ts +2 -2
  23. package/dist/components/checkbox/index.d.ts +2 -2
  24. package/dist/components/chip/context.d.ts +4 -4
  25. package/dist/components/chip/deletable.d.ts +2 -2
  26. package/dist/components/chip/index.d.ts +2 -2
  27. package/dist/components/chip/list.d.ts +4 -4
  28. package/dist/components/chip/selectable.d.ts +2 -2
  29. package/dist/components/classification-badge/context.d.ts +4 -4
  30. package/dist/components/classification-badge/index.d.ts +2 -2
  31. package/dist/components/classification-banner/context.d.ts +4 -4
  32. package/dist/components/classification-banner/index.d.ts +2 -2
  33. package/dist/components/clock/index.d.ts +2 -2
  34. package/dist/components/color-picker/index.d.ts +7 -45
  35. package/dist/components/color-picker/index.js +34 -52
  36. package/dist/components/color-picker/index.js.map +1 -1
  37. package/dist/components/color-picker/styles.module.css +5 -1
  38. package/dist/components/color-picker/types.d.ts +17 -4
  39. package/dist/components/combobox-field/context.d.ts +4 -4
  40. package/dist/components/combobox-field/index.d.ts +2 -2
  41. package/dist/components/combobox-field/index.js +19 -1
  42. package/dist/components/combobox-field/index.js.map +1 -1
  43. package/dist/components/coordinate-field/context.d.ts +6 -6
  44. package/dist/components/coordinate-field/index.d.ts +2 -2
  45. package/dist/components/coordinate-field/index.js +49 -42
  46. package/dist/components/coordinate-field/index.js.map +1 -1
  47. package/dist/components/coordinate-field/segment.d.ts +2 -2
  48. package/dist/components/coordinate-field/types.d.ts +5 -0
  49. package/dist/components/coordinate-field/types.js.map +1 -1
  50. package/dist/components/date-field/index.d.ts +2 -2
  51. package/dist/components/deferred-collection/index.d.ts +2 -2
  52. package/dist/components/details-list/context.d.ts +4 -4
  53. package/dist/components/details-list/index.d.ts +2 -2
  54. package/dist/components/details-list/label.d.ts +2 -2
  55. package/dist/components/details-list/value.d.ts +2 -2
  56. package/dist/components/dialog/content.d.ts +2 -2
  57. package/dist/components/dialog/context.d.ts +2 -2
  58. package/dist/components/dialog/footer.d.ts +2 -2
  59. package/dist/components/dialog/index.d.ts +2 -2
  60. package/dist/components/dialog/title.d.ts +2 -2
  61. package/dist/components/divider/context.d.ts +4 -4
  62. package/dist/components/divider/index.d.ts +2 -2
  63. package/dist/components/drawer/back.d.ts +2 -2
  64. package/dist/components/drawer/close.d.ts +2 -2
  65. package/dist/components/drawer/content.d.ts +2 -2
  66. package/dist/components/drawer/context.d.ts +3 -3
  67. package/dist/components/drawer/footer.d.ts +2 -2
  68. package/dist/components/drawer/header-title.d.ts +2 -2
  69. package/dist/components/drawer/header.d.ts +2 -2
  70. package/dist/components/drawer/index.d.ts +2 -2
  71. package/dist/components/drawer/layout-main.d.ts +2 -2
  72. package/dist/components/drawer/layout.d.ts +2 -2
  73. package/dist/components/drawer/menu-item.d.ts +2 -2
  74. package/dist/components/drawer/menu-item.js +2 -2
  75. package/dist/components/drawer/menu.d.ts +2 -2
  76. package/dist/components/drawer/panel.d.ts +2 -2
  77. package/dist/components/drawer/trigger.d.ts +2 -2
  78. package/dist/components/drawer/types.d.ts +1 -1
  79. package/dist/components/drawer/view.d.ts +2 -2
  80. package/dist/components/flashcard/index.d.ts +9 -9
  81. package/dist/components/floating-card/context.d.ts +2 -2
  82. package/dist/components/floating-card/index.d.ts +2 -2
  83. package/dist/components/floating-card/provider.d.ts +2 -2
  84. package/dist/components/floating-card/provider.js +2 -2
  85. package/dist/components/floating-card/provider.js.map +1 -1
  86. package/dist/components/floating-card/styles.module.css +1 -1
  87. package/dist/components/hero/context.d.ts +2 -2
  88. package/dist/components/hero/index.d.ts +2 -2
  89. package/dist/components/hero/subtitle.d.ts +3 -3
  90. package/dist/components/hero/title.d.ts +2 -2
  91. package/dist/components/hotkey/context.d.ts +4 -4
  92. package/dist/components/hotkey/index.d.ts +2 -2
  93. package/dist/components/hotkey/set.d.ts +2 -2
  94. package/dist/components/icon/context.d.ts +4 -4
  95. package/dist/components/icon/index.d.ts +2 -2
  96. package/dist/components/input/context.d.ts +2 -2
  97. package/dist/components/input/index.d.ts +2 -2
  98. package/dist/components/input/styles.module.css +8 -0
  99. package/dist/components/kanban/card-body.d.ts +2 -2
  100. package/dist/components/kanban/card-header-actions.d.ts +2 -2
  101. package/dist/components/kanban/card-header-title.d.ts +2 -2
  102. package/dist/components/kanban/card-header.d.ts +2 -2
  103. package/dist/components/kanban/card.d.ts +2 -2
  104. package/dist/components/kanban/column-actions.d.ts +2 -2
  105. package/dist/components/kanban/column-container.d.ts +2 -2
  106. package/dist/components/kanban/column-content.d.ts +2 -2
  107. package/dist/components/kanban/column-header-actions.d.ts +2 -2
  108. package/dist/components/kanban/column-header-drag-handle.d.ts +2 -2
  109. package/dist/components/kanban/column-header-title.d.ts +2 -2
  110. package/dist/components/kanban/column-header.d.ts +2 -2
  111. package/dist/components/kanban/column.d.ts +2 -2
  112. package/dist/components/kanban/context.d.ts +2 -2
  113. package/dist/components/kanban/header-actions.d.ts +2 -2
  114. package/dist/components/kanban/header-search.d.ts +2 -2
  115. package/dist/components/kanban/header-title.d.ts +2 -2
  116. package/dist/components/kanban/header.d.ts +2 -2
  117. package/dist/components/kanban/kanban.d.ts +4 -4
  118. package/dist/components/label/context.d.ts +4 -4
  119. package/dist/components/label/index.d.ts +2 -2
  120. package/dist/components/lines/index.d.ts +2 -2
  121. package/dist/components/link/context.d.ts +2 -2
  122. package/dist/components/link/index.d.ts +2 -2
  123. package/dist/components/list/context.d.ts +2 -2
  124. package/dist/components/list/index.d.ts +2 -2
  125. package/dist/components/list/item-content.d.ts +2 -2
  126. package/dist/components/list/item-description.d.ts +2 -2
  127. package/dist/components/list/item-title.d.ts +2 -2
  128. package/dist/components/list/item.d.ts +2 -2
  129. package/dist/components/media-controls/context.d.ts +4 -4
  130. package/dist/components/media-controls/fullscreen-button.d.ts +2 -2
  131. package/dist/components/media-controls/index.d.ts +2 -2
  132. package/dist/components/media-controls/mute-button.d.ts +2 -2
  133. package/dist/components/media-controls/play-button.d.ts +2 -2
  134. package/dist/components/media-controls/playback-rate.d.ts +2 -2
  135. package/dist/components/media-controls/seek-button.d.ts +2 -2
  136. package/dist/components/media-controls/time-display.d.ts +2 -2
  137. package/dist/components/media-controls/time-range.d.ts +2 -2
  138. package/dist/components/media-controls/volume-slider.d.ts +2 -2
  139. package/dist/components/menu/context.d.ts +2 -2
  140. package/dist/components/menu/index.d.ts +2 -2
  141. package/dist/components/menu/item-description.d.ts +2 -2
  142. package/dist/components/menu/item-label.d.ts +2 -2
  143. package/dist/components/menu/item.d.ts +2 -2
  144. package/dist/components/menu/section.d.ts +2 -2
  145. package/dist/components/menu/separator.d.ts +2 -2
  146. package/dist/components/menu/submenu.d.ts +3 -3
  147. package/dist/components/notice/index.d.ts +2 -2
  148. package/dist/components/notice/list.d.ts +2 -2
  149. package/dist/components/notice/list.js +1 -1
  150. package/dist/components/notice/notice-icon.d.ts +2 -2
  151. package/dist/components/notice/types.d.ts +1 -1
  152. package/dist/components/options/context.d.ts +2 -2
  153. package/dist/components/options/index.d.ts +2 -2
  154. package/dist/components/options/item-content.d.ts +2 -2
  155. package/dist/components/options/item-description.d.ts +2 -2
  156. package/dist/components/options/item-label.d.ts +3 -2
  157. package/dist/components/options/item-label.js +20 -4
  158. package/dist/components/options/item-label.js.map +1 -1
  159. package/dist/components/options/item.d.ts +2 -2
  160. package/dist/components/options/section.d.ts +2 -2
  161. package/dist/components/options/styles.module.css +20 -0
  162. package/dist/components/pagination/context.d.ts +2 -2
  163. package/dist/components/pagination/pages.d.ts +2 -2
  164. package/dist/components/popover/content.d.ts +2 -2
  165. package/dist/components/popover/footer.d.ts +2 -2
  166. package/dist/components/popover/index.d.ts +2 -2
  167. package/dist/components/popover/title.d.ts +2 -2
  168. package/dist/components/popover/trigger.d.ts +2 -2
  169. package/dist/components/query-builder/action-element.d.ts +2 -2
  170. package/dist/components/query-builder/actions.d.ts +4 -4
  171. package/dist/components/query-builder/combinator-selector.d.ts +2 -2
  172. package/dist/components/query-builder/index.d.ts +2 -2
  173. package/dist/components/query-builder/rule-group.d.ts +4 -4
  174. package/dist/components/query-builder/rule.d.ts +2 -2
  175. package/dist/components/query-builder/value-editor.d.ts +2 -2
  176. package/dist/components/query-builder/value-selector.d.ts +2 -2
  177. package/dist/components/radio/context.d.ts +3 -3
  178. package/dist/components/radio/group.d.ts +2 -2
  179. package/dist/components/radio/index.d.ts +2 -2
  180. package/dist/components/search-field/context.d.ts +4 -4
  181. package/dist/components/search-field/index.d.ts +2 -2
  182. package/dist/components/select-field/context.d.ts +4 -4
  183. package/dist/components/select-field/index.d.ts +2 -2
  184. package/dist/components/sidenav/avatar.d.ts +2 -2
  185. package/dist/components/sidenav/content.d.ts +2 -2
  186. package/dist/components/sidenav/context.d.ts +2 -2
  187. package/dist/components/sidenav/footer.d.ts +2 -2
  188. package/dist/components/sidenav/header.d.ts +2 -2
  189. package/dist/components/sidenav/index.d.ts +2 -2
  190. package/dist/components/sidenav/item.d.ts +2 -2
  191. package/dist/components/sidenav/link.d.ts +2 -2
  192. package/dist/components/sidenav/menu-item.d.ts +2 -2
  193. package/dist/components/sidenav/menu.d.ts +2 -2
  194. package/dist/components/sidenav/trigger.d.ts +2 -2
  195. package/dist/components/sidenav/trigger.js +1 -1
  196. package/dist/components/sidenav/types.d.ts +1 -1
  197. package/dist/components/skeleton/index.d.ts +2 -2
  198. package/dist/components/slider/index.d.ts +2 -2
  199. package/dist/components/slider/styles.module.css +3 -2
  200. package/dist/components/status-indicator/index.d.ts +2 -2
  201. package/dist/components/switch/context.d.ts +4 -4
  202. package/dist/components/switch/index.d.ts +2 -2
  203. package/dist/components/table/body.d.ts +2 -2
  204. package/dist/components/table/cell.d.ts +2 -2
  205. package/dist/components/table/context.d.ts +2 -2
  206. package/dist/components/table/header-cell.d.ts +2 -2
  207. package/dist/components/table/header.d.ts +2 -2
  208. package/dist/components/table/index.d.ts +2 -2
  209. package/dist/components/table/row.d.ts +2 -2
  210. package/dist/components/tabs/context.d.ts +6 -6
  211. package/dist/components/tabs/index.d.ts +2 -2
  212. package/dist/components/tabs/list.d.ts +2 -2
  213. package/dist/components/tabs/panel.d.ts +2 -2
  214. package/dist/components/tabs/tab.d.ts +2 -2
  215. package/dist/components/text-area-field/context.d.ts +4 -4
  216. package/dist/components/text-area-field/index.d.ts +2 -2
  217. package/dist/components/text-field/context.d.ts +4 -4
  218. package/dist/components/text-field/index.d.ts +2 -2
  219. package/dist/components/time-field/index.d.ts +2 -2
  220. package/dist/components/tooltip/index.d.ts +2 -2
  221. package/dist/components/tooltip/trigger.d.ts +2 -2
  222. package/dist/components/tooltip/trigger.js +1 -1
  223. package/dist/components/tree/index.d.ts +2 -2
  224. package/dist/components/tree/index.js +6 -4
  225. package/dist/components/tree/index.js.map +1 -1
  226. package/dist/components/tree/item-actions.d.ts +2 -2
  227. package/dist/components/tree/item-content.d.ts +2 -2
  228. package/dist/components/tree/item-content.js +9 -5
  229. package/dist/components/tree/item-content.js.map +1 -1
  230. package/dist/components/tree/item-description.d.ts +2 -2
  231. package/dist/components/tree/item-label.d.ts +2 -2
  232. package/dist/components/tree/item-prefix-icon.d.ts +2 -2
  233. package/dist/components/tree/item.d.ts +2 -2
  234. package/dist/components/tree/lines.d.ts +4 -2
  235. package/dist/components/tree/lines.js +8 -4
  236. package/dist/components/tree/lines.js.map +1 -1
  237. package/dist/components/tree/styles.module.css +23 -3
  238. package/dist/components/video/index.d.ts +2 -2
  239. package/dist/components/view-stack/context.d.ts +2 -2
  240. package/dist/components/view-stack/index.d.ts +2 -2
  241. package/dist/components/view-stack/index.js +1 -1
  242. package/dist/components/view-stack/trigger.d.ts +2 -2
  243. package/dist/components/view-stack/types.d.ts +1 -1
  244. package/dist/components/view-stack/view.d.ts +2 -2
  245. package/dist/hooks/use-tree/state/index.js +7 -14
  246. package/dist/hooks/use-tree/state/index.js.map +1 -1
  247. package/dist/index.js +3 -3
  248. package/dist/node_modules/.pnpm/@react-aria_collections@3.0.0-rc.7_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@react-aria/collections/dist/BaseCollection.js +134 -0
  249. package/dist/node_modules/.pnpm/@react-aria_collections@3.0.0-rc.7_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@react-aria/collections/dist/BaseCollection.js.map +1 -0
  250. package/dist/providers/portal.js +1 -1
  251. package/dist/providers/theme-provider.d.ts +2 -2
  252. package/package.json +14 -9
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["acc","AriaTree","className"],"sources":["../../../src/components/tree/index.tsx"],"sourcesContent":["/*\n * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport { Cache } from '@/hooks/use-tree/actions/cache';\nimport type { Key, Selection } from '@react-types/shared';\nimport 'client-only';\nimport { clsx } from '@accelint/design-foundation/lib/utils';\nimport { useMemo } from 'react';\nimport {\n Tree as AriaTree,\n composeRenderProps,\n DropIndicator,\n type DropTarget,\n useDragAndDrop,\n} from 'react-aria-components';\nimport { TreeContext } from './context';\nimport styles from './styles.module.css';\nimport type { TreeProps } from './types';\n\nconst defaultRenderDropIndicator = (target: DropTarget) => (\n <DropIndicator target={target} className={styles.dropIndicator} />\n);\n\n/**\n * Tree - Hierarchical tree view with selection, visibility, and drag-and-drop\n *\n * Supports static or dynamic collections with keyboard navigation and accessibility.\n *\n * @param props - {@link TreeProps}\n * @param props.children - Tree items or render function for dynamic collections.\n * @param props.className - CSS class for the tree container.\n * @param props.disabledKeys - Set of disabled item keys.\n * @param props.dragAndDropConfig - Configuration for drag and drop behavior.\n * @param props.expandedKeys - Set of expanded item keys.\n * @param props.items - Data source for dynamic collections.\n * @param props.selectedKeys - Set of selected item keys.\n * @param props.showRuleLines - Whether to show connecting lines between items.\n * @param props.showVisibility - Whether to show visibility toggle buttons.\n * @param props.selectionMode - Selection mode for the tree.\n * @param props.variant - Visual density variant.\n * @param props.visibleKeys - Set of visible item keys.\n * @param props.onVisibilityChange - Callback when item visibility changes.\n * @param props.onSelectionChange - Callback when selection changes.\n * @returns The rendered Tree component.\n *\n * @example\n * // Dynamic collection\n * ```tsx\n * <Tree items={items} expandedKeys={expandedKeys}>\n * {(node) => <TreeItem key={node.key}>{node.label}</TreeItem>}\n * </Tree>\n * ```\n *\n * @example\n * ```tsx\n * // Static collection\n * <Tree>\n * <TreeItem id=\"one\" textValue=\"one\">\n * <TreeItemContent>One</TreeItemContent>\n * <TreeItem id=\"two\" textValue=\"two\">\n * <TreeItemContent>Two</TreeItemContent>\n * </TreeItem>\n * </TreeItem>\n * </Tree>\n * ```\n */\nexport function Tree<T>({\n children,\n className,\n disabledKeys: disabledKeysProp,\n dragAndDropConfig,\n expandedKeys: expandedKeysProp,\n items,\n selectedKeys: selectedKeysProp,\n showRuleLines = true,\n showVisibility = true,\n selectionMode = 'multiple',\n variant = 'cozy',\n visibleKeys: visibleKeysProp,\n onVisibilityChange,\n onSelectionChange,\n ...rest\n}: TreeProps<T>) {\n /**\n * A static collection is hard-coded. Dynamic is data-driven from an external source.\n * https://react-spectrum.adobe.com/react-aria/Tree.html#content\n *\n * Controlled state should only be used on a static tree.\n */\n if (\n items &&\n (disabledKeysProp ||\n expandedKeysProp ||\n selectedKeysProp ||\n visibleKeysProp)\n ) {\n throw new Error(\n 'Tree should only be controlled with state from either `items` or keys props, not both',\n );\n }\n\n /**\n * A static tree won't support the node iterator pattern.\n */\n if (!!items !== (typeof children === 'function')) {\n throw new Error(\n 'Tree `items` and node iterator `children` must be used together',\n );\n }\n\n const { dragAndDropHooks } = useDragAndDrop({\n renderDropIndicator: defaultRenderDropIndicator,\n getAllowedDropOperations: () => ['move'],\n getDropOperation: () => 'move',\n ...dragAndDropConfig,\n });\n const cache = useMemo(() => (items ? new Cache([...items]) : null), [items]);\n const nodes = useMemo(() => cache?.getAllNodes(), [cache]);\n const {\n disabledKeys,\n expandedKeys,\n selectedKeys,\n visibleKeys,\n visibilityComputedKeys,\n } = useMemo(() => {\n const acc = {\n disabledKeys: nodes ? new Set<Key>() : disabledKeysProp,\n expandedKeys: nodes ? new Set<Key>() : expandedKeysProp,\n selectedKeys: nodes ? new Set<Key>() : selectedKeysProp,\n visibleKeys: nodes ? new Set<Key>() : visibleKeysProp,\n visibilityComputedKeys: new Set<Key>(),\n };\n\n if (!nodes) {\n return acc;\n }\n\n return nodes.reduce(\n (\n acc,\n {\n key,\n isDisabled,\n isExpanded,\n isSelected,\n isVisible,\n isVisibleComputed,\n },\n ) => {\n if (isDisabled) {\n acc.disabledKeys?.add(key);\n }\n if (isExpanded) {\n acc.expandedKeys?.add(key);\n }\n if (isSelected) {\n acc.selectedKeys?.add(key);\n }\n if (isVisible) {\n acc.visibleKeys?.add(key);\n }\n if (isVisibleComputed) {\n acc.visibilityComputedKeys.add(key);\n }\n return acc;\n },\n acc,\n );\n }, [\n nodes,\n disabledKeysProp,\n expandedKeysProp,\n selectedKeysProp,\n visibleKeysProp,\n ]);\n\n const handleSelectionChange = selectedKeys\n ? (selection: Selection) => {\n if (selection !== 'all') {\n onSelectionChange?.(selection);\n }\n }\n : undefined;\n\n return (\n <TreeContext.Provider\n value={{\n disabledKeys,\n expandedKeys,\n selectedKeys,\n showRuleLines,\n showVisibility,\n variant,\n visibleKeys,\n visibilityComputedKeys,\n isStatic: typeof children !== 'function',\n onVisibilityChange: onVisibilityChange ?? (() => undefined), // TODO: improve\n }}\n >\n <AriaTree\n {...rest}\n className={composeRenderProps(className, (className) =>\n clsx(styles.tree, className),\n )}\n disabledKeys={disabledKeys}\n dragAndDropHooks={dragAndDropHooks}\n expandedKeys={expandedKeys}\n items={items}\n selectedKeys={selectedKeys}\n onSelectionChange={handleSelectionChange}\n selectionMode={selectionMode}\n >\n {children}\n </AriaTree>\n </TreeContext.Provider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAM,8BAA8B,WAClC,oBAAC;CAAsB;CAAQ,WAAW,OAAO;EAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CpE,SAAgB,KAAQ,EACtB,UACA,WACA,cAAc,kBACd,mBACA,cAAc,kBACd,OACA,cAAc,kBACd,gBAAgB,MAChB,iBAAiB,MACjB,gBAAgB,YAChB,UAAU,QACV,aAAa,iBACb,oBACA,mBACA,GAAG,QACY;;;;;;;AAOf,KACE,UACC,oBACC,oBACA,oBACA,iBAEF,OAAM,IAAI,MACR,wFACD;;;;AAMH,KAAI,CAAC,CAAC,WAAW,OAAO,aAAa,YACnC,OAAM,IAAI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mBAAmB;GACJ;GAEd;IACQ;GACU"}
1
+ {"version":3,"file":"index.js","names":["acc","AriaTree","className"],"sources":["../../../src/components/tree/index.tsx"],"sourcesContent":["/*\n * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport { Cache } from '@/hooks/use-tree/actions/cache';\nimport type { Key, Selection } from '@react-types/shared';\nimport 'client-only';\nimport { clsx } from '@accelint/design-foundation/lib/utils';\nimport { useMemo } from 'react';\nimport {\n Tree as AriaTree,\n composeRenderProps,\n DropIndicator,\n type DropTarget,\n useDragAndDrop,\n} from 'react-aria-components';\nimport { TreeContext } from './context';\nimport styles from './styles.module.css';\nimport type { TreeProps } from './types';\n\nconst defaultRenderDropIndicator = (target: DropTarget) => {\n const isBetweenItems =\n target.type === 'item' &&\n (target.dropPosition === 'before' || target.dropPosition === 'after');\n return (\n <DropIndicator\n target={target}\n className={\n isBetweenItems ? styles.dropIndicatorBetween : styles.dropIndicator\n }\n />\n );\n};\n\n/**\n * Tree - Hierarchical tree view with selection, visibility, and drag-and-drop\n *\n * Supports static or dynamic collections with keyboard navigation and accessibility.\n *\n * @param props - {@link TreeProps}\n * @param props.children - Tree items or render function for dynamic collections.\n * @param props.className - CSS class for the tree container.\n * @param props.disabledKeys - Set of disabled item keys.\n * @param props.dragAndDropConfig - Configuration for drag and drop behavior.\n * @param props.expandedKeys - Set of expanded item keys.\n * @param props.items - Data source for dynamic collections.\n * @param props.selectedKeys - Set of selected item keys.\n * @param props.showRuleLines - Whether to show connecting lines between items.\n * @param props.showVisibility - Whether to show visibility toggle buttons.\n * @param props.selectionMode - Selection mode for the tree.\n * @param props.variant - Visual density variant.\n * @param props.visibleKeys - Set of visible item keys.\n * @param props.onVisibilityChange - Callback when item visibility changes.\n * @param props.onSelectionChange - Callback when selection changes.\n * @returns The rendered Tree component.\n *\n * @example\n * // Dynamic collection\n * ```tsx\n * <Tree items={items} expandedKeys={expandedKeys}>\n * {(node) => <TreeItem key={node.key}>{node.label}</TreeItem>}\n * </Tree>\n * ```\n *\n * @example\n * ```tsx\n * // Static collection\n * <Tree>\n * <TreeItem id=\"one\" textValue=\"one\">\n * <TreeItemContent>One</TreeItemContent>\n * <TreeItem id=\"two\" textValue=\"two\">\n * <TreeItemContent>Two</TreeItemContent>\n * </TreeItem>\n * </TreeItem>\n * </Tree>\n * ```\n */\nexport function Tree<T>({\n children,\n className,\n disabledKeys: disabledKeysProp,\n dragAndDropConfig,\n expandedKeys: expandedKeysProp,\n items,\n selectedKeys: selectedKeysProp,\n showRuleLines = true,\n showVisibility = true,\n selectionMode = 'multiple',\n variant = 'cozy',\n visibleKeys: visibleKeysProp,\n onVisibilityChange,\n onSelectionChange,\n ...rest\n}: TreeProps<T>) {\n /**\n * A static collection is hard-coded. Dynamic is data-driven from an external source.\n * https://react-spectrum.adobe.com/react-aria/Tree.html#content\n *\n * Controlled state should only be used on a static tree.\n */\n if (\n items &&\n (disabledKeysProp ||\n expandedKeysProp ||\n selectedKeysProp ||\n visibleKeysProp)\n ) {\n throw new Error(\n 'Tree should only be controlled with state from either `items` or keys props, not both',\n );\n }\n\n /**\n * A static tree won't support the node iterator pattern.\n */\n if (!!items !== (typeof children === 'function')) {\n throw new Error(\n 'Tree `items` and node iterator `children` must be used together',\n );\n }\n\n const { dragAndDropHooks } = useDragAndDrop({\n renderDropIndicator: defaultRenderDropIndicator,\n getAllowedDropOperations: () => ['move'],\n getDropOperation: () => 'move',\n ...dragAndDropConfig,\n });\n const cache = useMemo(() => (items ? new Cache([...items]) : null), [items]);\n const nodes = useMemo(() => cache?.getAllNodes(), [cache]);\n const {\n disabledKeys,\n expandedKeys,\n selectedKeys,\n visibleKeys,\n visibilityComputedKeys,\n } = useMemo(() => {\n const acc = {\n disabledKeys: nodes ? new Set<Key>() : disabledKeysProp,\n expandedKeys: nodes ? new Set<Key>() : expandedKeysProp,\n selectedKeys: nodes ? new Set<Key>() : selectedKeysProp,\n visibleKeys: nodes ? new Set<Key>() : visibleKeysProp,\n visibilityComputedKeys: new Set<Key>(),\n };\n\n if (!nodes) {\n return acc;\n }\n\n return nodes.reduce(\n (\n acc,\n {\n key,\n isDisabled,\n isExpanded,\n isSelected,\n isVisible,\n isVisibleComputed,\n },\n ) => {\n if (isDisabled) {\n acc.disabledKeys?.add(key);\n }\n if (isExpanded) {\n acc.expandedKeys?.add(key);\n }\n if (isSelected) {\n acc.selectedKeys?.add(key);\n }\n if (isVisible) {\n acc.visibleKeys?.add(key);\n }\n if (isVisibleComputed) {\n acc.visibilityComputedKeys.add(key);\n }\n return acc;\n },\n acc,\n );\n }, [\n nodes,\n disabledKeysProp,\n expandedKeysProp,\n selectedKeysProp,\n visibleKeysProp,\n ]);\n\n const handleSelectionChange = selectedKeys\n ? (selection: Selection) => {\n if (selection !== 'all') {\n onSelectionChange?.(selection);\n }\n }\n : undefined;\n\n return (\n <TreeContext.Provider\n value={{\n disabledKeys,\n expandedKeys,\n selectedKeys,\n showRuleLines,\n showVisibility,\n variant,\n visibleKeys,\n visibilityComputedKeys,\n isStatic: typeof children !== 'function',\n onVisibilityChange: onVisibilityChange ?? (() => undefined), // TODO: improve\n }}\n >\n <AriaTree\n {...rest}\n className={composeRenderProps(className, (className) =>\n clsx(styles.tree, className),\n )}\n disabledKeys={disabledKeys}\n dragAndDropHooks={dragAndDropHooks}\n expandedKeys={expandedKeys}\n items={items}\n selectedKeys={selectedKeys}\n onSelectionChange={handleSelectionChange}\n selectionMode={selectionMode}\n >\n {children}\n </AriaTree>\n </TreeContext.Provider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;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AI,WACF,OAAI,cAAc,IAAI,IAAI;AAE5B,OAAI,UACF,OAAI,aAAa,IAAI,IAAI;AAE3B,OAAI,kBACF,OAAI,uBAAuB,IAAI,IAAI;AAErC,UAAOA;KAET,IACD;IACA;EACD;EACA;EACA;EACA;EACA;EACD,CAAC;CAEF,MAAM,wBAAwB,gBACzB,cAAyB;AACxB,MAAI,cAAc,MAChB,qBAAoB,UAAU;KAGlC;AAEJ,QACE,oBAAC,YAAY;EACX,OAAO;GACL;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA,UAAU,OAAO,aAAa;GAC9B,oBAAoB,6BAA6B;GAClD;YAED,oBAACC;GACC,GAAI;GACJ,WAAW,mBAAmB,YAAY,gBACxC,KAAK,OAAO,MAAMC,YAAU,CAC7B;GACa;GACI;GACJ;GACP;GACO;GACd,mBAAmB;GACJ;GAEd;IACQ;GACU"}
@@ -11,7 +11,7 @@
11
11
  */
12
12
 
13
13
  import { PropsWithChildren } from "react";
14
- import * as react_jsx_runtime192 from "react/jsx-runtime";
14
+ import * as react_jsx_runtime199 from "react/jsx-runtime";
15
15
 
16
16
  //#region src/components/tree/item-actions.d.ts
17
17
 
@@ -39,7 +39,7 @@ declare function TreeItemActions({
39
39
  className
40
40
  }: PropsWithChildren & {
41
41
  className?: string;
42
- }): react_jsx_runtime192.JSX.Element;
42
+ }): react_jsx_runtime199.JSX.Element;
43
43
  //#endregion
44
44
  export { TreeItemActions };
45
45
  //# sourceMappingURL=item-actions.d.ts.map
@@ -11,7 +11,7 @@
11
11
  */
12
12
 
13
13
  import { TreeItemContentProps } from "./types.js";
14
- import * as react_jsx_runtime61 from "react/jsx-runtime";
14
+ import * as react_jsx_runtime198 from "react/jsx-runtime";
15
15
 
16
16
  //#region src/components/tree/item-content.d.ts
17
17
 
@@ -35,7 +35,7 @@ import * as react_jsx_runtime61 from "react/jsx-runtime";
35
35
  */
36
36
  declare function TreeItemContent({
37
37
  children
38
- }: TreeItemContentProps): react_jsx_runtime61.JSX.Element;
38
+ }: TreeItemContentProps): react_jsx_runtime198.JSX.Element;
39
39
  //#endregion
40
40
  export { TreeItemContent };
41
41
  //# sourceMappingURL=item-content.d.ts.map
@@ -49,11 +49,14 @@ import Show from "@accelint/icons/show";
49
49
  */
50
50
  function TreeItemContent({ children }) {
51
51
  const { showVisibility, variant, visibleKeys, onVisibilityChange } = useContext(TreeContext);
52
- const { isVisible, isViewable } = useContext(TreeItemContext);
52
+ const { isVisible, isViewable, ancestors } = useContext(TreeItemContext);
53
53
  const size = variant === "cozy" ? "medium" : "small";
54
54
  return /* @__PURE__ */ jsx(TreeItemContent$1, { children: (renderProps) => {
55
55
  const { id, allowsDragging, hasChildItems, level, selectionBehavior, selectionMode, state, isDisabled, isExpanded, isSelected } = renderProps;
56
- const isLastOfSet = !(state.collection.getItem(id)?.nextKey || hasChildItems);
56
+ const isLastOfSet = !state.collection.getItem(id)?.nextKey;
57
+ const ancestorLastOfSet = ancestors.slice(0, -1).map((ancestorKey) => {
58
+ return !state.collection.getItem(ancestorKey)?.nextKey;
59
+ });
57
60
  const shouldShowSelection = selectionBehavior === "toggle" && selectionMode !== "none";
58
61
  const handlePress = () => {
59
62
  const keys = new Set(visibleKeys);
@@ -77,15 +80,16 @@ function TreeItemContent({ children }) {
77
80
  }),
78
81
  level > 1 && /* @__PURE__ */ jsx(TreeLines, {
79
82
  level,
80
- isLastOfSet
83
+ isLastOfSet,
84
+ ancestorLastOfSet
81
85
  }),
82
- hasChildItems ? /* @__PURE__ */ jsx(Button$1, {
86
+ hasChildItems && /* @__PURE__ */ jsx(Button$1, {
83
87
  slot: "chevron",
84
88
  variant: "icon",
85
89
  size,
86
90
  className: styles.expansion,
87
91
  children: /* @__PURE__ */ jsx(Icon, { children: isExpanded ? /* @__PURE__ */ jsx(ChevronDown, {}) : /* @__PURE__ */ jsx(ChevronUp, {}) })
88
- }) : /* @__PURE__ */ jsx("div", { className: clsx(styles.spacing, styles[variant]) }),
92
+ }),
89
93
  /* @__PURE__ */ jsx("div", {
90
94
  className: clsx(styles.display, styles[variant]),
91
95
  children: typeof children === "function" ? children({
@@ -1 +1 @@
1
- {"version":3,"file":"item-content.js","names":["AriaTreeItemContent","Button","Checkbox"],"sources":["../../../src/components/tree/item-content.tsx"],"sourcesContent":["/*\n * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { clsx } from '@accelint/design-foundation/lib/utils';\nimport ChevronDown from '@accelint/icons/chevron-down';\nimport ChevronUp from '@accelint/icons/chevron-up';\nimport DragVert from '@accelint/icons/drag-vert';\nimport Hide from '@accelint/icons/hide';\nimport Show from '@accelint/icons/show';\nimport { useContext } from 'react';\nimport { TreeItemContent as AriaTreeItemContent } from 'react-aria-components';\nimport { Button } from '../button';\nimport { Checkbox } from '../checkbox';\nimport { Icon } from '../icon';\nimport { IconProvider } from '../icon/context';\nimport { TreeContext, TreeItemContext } from './context';\nimport { TreeLines } from './lines';\nimport styles from './styles.module.css';\nimport type { Key } from '@react-types/shared';\nimport type { TreeItemContentProps } from './types';\n\n/**\n * TreeItemContent - Renders the display content of a tree node\n *\n * @example\n * ```tsx\n * <TreeItem id=\"node\" textValue=\"Node\">\n * <TreeItemContent>\n * <TreeItemPrefixIcon><Folder /></TreeItemPrefixIcon>\n * <TreeItemLabel>Folder Name</TreeItemLabel>\n * <TreeItemDescription>Contains 5 items</TreeItemDescription>\n * </TreeItemContent>\n * </TreeItem>\n * ```\n *\n * @param props - {@link TreeItemContentProps}\n * @param props.children - Content to render, or a render function receiving TreeItemContentRenderProps.\n * @returns The rendered TreeItemContent component.\n */\nexport function TreeItemContent({ children }: TreeItemContentProps) {\n const { showVisibility, variant, visibleKeys, onVisibilityChange } =\n useContext(TreeContext);\n const { isVisible, isViewable } = useContext(TreeItemContext);\n const size = variant === 'cozy' ? 'medium' : 'small';\n\n return (\n <AriaTreeItemContent>\n {(renderProps) => {\n const {\n id,\n allowsDragging,\n hasChildItems,\n level,\n selectionBehavior,\n selectionMode,\n state,\n isDisabled,\n isExpanded,\n isSelected,\n } = renderProps;\n\n const isLastOfSet = !(\n state.collection.getItem(id)?.nextKey || hasChildItems\n );\n const shouldShowSelection =\n selectionBehavior === 'toggle' && selectionMode !== 'none';\n\n const handlePress = () => {\n const keys = new Set<Key>(visibleKeys);\n visibleKeys?.has(id) ? keys.delete(id) : keys.add(id);\n onVisibilityChange?.(keys);\n };\n\n return (\n <IconProvider size={size}>\n <div\n className={clsx('group', styles.content, styles[variant])}\n data-last-of-set={isLastOfSet}\n >\n {showVisibility && (\n <Button\n variant='icon'\n color='mono-bold'\n size={size}\n onPress={handlePress}\n isDisabled={isDisabled}\n className={styles.visibility}\n >\n <Icon>{isVisible ? <Show /> : <Hide />}</Icon>\n </Button>\n )}\n {level > 1 && (\n <TreeLines level={level} isLastOfSet={isLastOfSet} />\n )}\n {hasChildItems ? (\n <Button\n slot='chevron'\n variant='icon'\n size={size}\n className={styles.expansion}\n >\n <Icon>{isExpanded ? <ChevronDown /> : <ChevronUp />}</Icon>\n </Button>\n ) : (\n <div className={clsx(styles.spacing, styles[variant])} />\n )}\n <div className={clsx(styles.display, styles[variant])}>\n {typeof children === 'function'\n ? children({\n ...renderProps,\n variant,\n isVisible,\n isViewable: isViewable,\n defaultChildren: null,\n })\n : children}\n </div>\n {shouldShowSelection && (\n <Checkbox\n slot='selection'\n isSelected={isSelected}\n isDisabled={isDisabled}\n />\n )}\n {allowsDragging && (\n <Button\n slot='drag'\n variant='icon'\n size={size}\n isDisabled={isDisabled}\n className={styles.drag}\n >\n <Icon>\n <DragVert />\n </Icon>\n </Button>\n )}\n </div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ACjB,SAAS;OACP,GAAG;OACH;OACA;OACY;OACZ,iBAAiB;OAClB,CAAC,GACF;OACA;KACL,uBACC,oBAACC;MACC,MAAK;MACO;MACA;OACZ;KAEH,kBACC,oBAACD;MACC,MAAK;MACL,SAAQ;MACF;MACM;MACZ,WAAW,OAAO;gBAElB,oBAAC,kBACC,oBAAC,aAAW,GACP;OACA;;KAEP;IACO;KAGC"}
1
+ {"version":3,"file":"item-content.js","names":["AriaTreeItemContent","Button","Checkbox"],"sources":["../../../src/components/tree/item-content.tsx"],"sourcesContent":["/*\n * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { clsx } from '@accelint/design-foundation/lib/utils';\nimport ChevronDown from '@accelint/icons/chevron-down';\nimport ChevronUp from '@accelint/icons/chevron-up';\nimport DragVert from '@accelint/icons/drag-vert';\nimport Hide from '@accelint/icons/hide';\nimport Show from '@accelint/icons/show';\nimport { useContext } from 'react';\nimport { TreeItemContent as AriaTreeItemContent } from 'react-aria-components';\nimport { Button } from '../button';\nimport { Checkbox } from '../checkbox';\nimport { Icon } from '../icon';\nimport { IconProvider } from '../icon/context';\nimport { TreeContext, TreeItemContext } from './context';\nimport { TreeLines } from './lines';\nimport styles from './styles.module.css';\nimport type { Key } from '@react-types/shared';\nimport type { TreeItemContentProps } from './types';\n\n/**\n * TreeItemContent - Renders the display content of a tree node\n *\n * @example\n * ```tsx\n * <TreeItem id=\"node\" textValue=\"Node\">\n * <TreeItemContent>\n * <TreeItemPrefixIcon><Folder /></TreeItemPrefixIcon>\n * <TreeItemLabel>Folder Name</TreeItemLabel>\n * <TreeItemDescription>Contains 5 items</TreeItemDescription>\n * </TreeItemContent>\n * </TreeItem>\n * ```\n *\n * @param props - {@link TreeItemContentProps}\n * @param props.children - Content to render, or a render function receiving TreeItemContentRenderProps.\n * @returns The rendered TreeItemContent component.\n */\nexport function TreeItemContent({ children }: TreeItemContentProps) {\n const { showVisibility, variant, visibleKeys, onVisibilityChange } =\n useContext(TreeContext);\n const { isVisible, isViewable, ancestors } = useContext(TreeItemContext);\n const size = variant === 'cozy' ? 'medium' : 'small';\n\n return (\n <AriaTreeItemContent>\n {(renderProps) => {\n const {\n id,\n allowsDragging,\n hasChildItems,\n level,\n selectionBehavior,\n selectionMode,\n state,\n isDisabled,\n isExpanded,\n isSelected,\n } = renderProps;\n\n const item = state.collection.getItem(id);\n const isLastOfSet = !item?.nextKey;\n\n // Determine if ancestors are last of set (excludes current item)\n const ancestorLastOfSet = ancestors.slice(0, -1).map((ancestorKey) => {\n const ancestorItem = state.collection.getItem(ancestorKey);\n return !ancestorItem?.nextKey;\n });\n\n const shouldShowSelection =\n selectionBehavior === 'toggle' && selectionMode !== 'none';\n\n const handlePress = () => {\n const keys = new Set<Key>(visibleKeys);\n visibleKeys?.has(id) ? keys.delete(id) : keys.add(id);\n onVisibilityChange?.(keys);\n };\n\n return (\n <IconProvider size={size}>\n <div\n className={clsx('group', styles.content, styles[variant])}\n data-last-of-set={isLastOfSet}\n >\n {showVisibility && (\n <Button\n variant='icon'\n color='mono-bold'\n size={size}\n onPress={handlePress}\n isDisabled={isDisabled}\n className={styles.visibility}\n >\n <Icon>{isVisible ? <Show /> : <Hide />}</Icon>\n </Button>\n )}\n {level > 1 && (\n <TreeLines\n level={level}\n isLastOfSet={isLastOfSet}\n ancestorLastOfSet={ancestorLastOfSet}\n />\n )}\n {hasChildItems && (\n <Button\n slot='chevron'\n variant='icon'\n size={size}\n className={styles.expansion}\n >\n <Icon>{isExpanded ? <ChevronDown /> : <ChevronUp />}</Icon>\n </Button>\n )}\n <div className={clsx(styles.display, styles[variant])}>\n {typeof children === 'function'\n ? children({\n ...renderProps,\n variant,\n isVisible,\n isViewable: isViewable,\n defaultChildren: null,\n })\n : children}\n </div>\n {shouldShowSelection && (\n <Checkbox\n slot='selection'\n isSelected={isSelected}\n isDisabled={isDisabled}\n />\n )}\n {allowsDragging && (\n <Button\n slot='drag'\n variant='icon'\n size={size}\n isDisabled={isDisabled}\n className={styles.drag}\n >\n <Icon>\n <DragVert />\n </Icon>\n </Button>\n )}\n </div>\n </IconProvider>\n );\n }}\n </AriaTreeItemContent>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,SAAgB,gBAAgB,EAAE,YAAkC;CAClE,MAAM,EAAE,gBAAgB,SAAS,aAAa,uBAC5C,WAAW,YAAY;CACzB,MAAM,EAAE,WAAW,YAAY,cAAc,WAAW,gBAAgB;CACxE,MAAM,OAAO,YAAY,SAAS,WAAW;AAE7C,QACE,oBAACA,gCACG,gBAAgB;EAChB,MAAM,EACJ,IACA,gBACA,eACA,OACA,mBACA,eACA,OACA,YACA,YACA,eACE;EAGJ,MAAM,cAAc,CADP,MAAM,WAAW,QAAQ,GAAG,EACd;EAG3B,MAAM,oBAAoB,UAAU,MAAM,GAAG,GAAG,CAAC,KAAK,gBAAgB;AAEpE,UAAO,CADc,MAAM,WAAW,QAAQ,YAAY,EACpC;IACtB;EAEF,MAAM,sBACJ,sBAAsB,YAAY,kBAAkB;EAEtD,MAAM,oBAAoB;GACxB,MAAM,OAAO,IAAI,IAAS,YAAY;AACtC,gBAAa,IAAI,GAAG,GAAG,KAAK,OAAO,GAAG,GAAG,KAAK,IAAI,GAAG;AACrD,wBAAqB,KAAK;;AAG5B,SACE,oBAAC;GAAmB;aAClB,qBAAC;IACC,WAAW,KAAK,SAAS,OAAO,SAAS,OAAO,SAAS;IACzD,oBAAkB;;KAEjB,kBACC,oBAACC;MACC,SAAQ;MACR,OAAM;MACA;MACN,SAAS;MACG;MACZ,WAAW,OAAO;gBAElB,oBAAC,kBAAM,YAAY,oBAAC,SAAO,GAAG,oBAAC,SAAO,GAAQ;OACvC;KAEV,QAAQ,KACP,oBAAC;MACQ;MACM;MACM;OACnB;KAEH,iBACC,oBAACA;MACC,MAAK;MACL,SAAQ;MACF;MACN,WAAW,OAAO;gBAElB,oBAAC,kBAAM,aAAa,oBAAC,gBAAc,GAAG,oBAAC,cAAY,GAAQ;OACpD;KAEX,oBAAC;MAAI,WAAW,KAAK,OAAO,SAAS,OAAO,SAAS;gBAClD,OAAO,aAAa,aACjB,SAAS;OACP,GAAG;OACH;OACA;OACY;OACZ,iBAAiB;OAClB,CAAC,GACF;OACA;KACL,uBACC,oBAACC;MACC,MAAK;MACO;MACA;OACZ;KAEH,kBACC,oBAACD;MACC,MAAK;MACL,SAAQ;MACF;MACM;MACZ,WAAW,OAAO;gBAElB,oBAAC,kBACC,oBAAC,aAAW,GACP;OACA;;KAEP;IACO;KAGC"}
@@ -11,7 +11,7 @@
11
11
  */
12
12
 
13
13
  import { TextProps } from "react-aria-components";
14
- import * as react_jsx_runtime193 from "react/jsx-runtime";
14
+ import * as react_jsx_runtime200 from "react/jsx-runtime";
15
15
 
16
16
  //#region src/components/tree/item-description.d.ts
17
17
  /**
@@ -33,7 +33,7 @@ import * as react_jsx_runtime193 from "react/jsx-runtime";
33
33
  declare function TreeItemDescription({
34
34
  children,
35
35
  className
36
- }: TextProps): react_jsx_runtime193.JSX.Element | null;
36
+ }: TextProps): react_jsx_runtime200.JSX.Element | null;
37
37
  //#endregion
38
38
  export { TreeItemDescription };
39
39
  //# sourceMappingURL=item-description.d.ts.map
@@ -11,7 +11,7 @@
11
11
  */
12
12
 
13
13
  import { TextProps } from "react-aria-components";
14
- import * as react_jsx_runtime194 from "react/jsx-runtime";
14
+ import * as react_jsx_runtime197 from "react/jsx-runtime";
15
15
 
16
16
  //#region src/components/tree/item-label.d.ts
17
17
  /**
@@ -33,7 +33,7 @@ import * as react_jsx_runtime194 from "react/jsx-runtime";
33
33
  declare function TreeItemLabel({
34
34
  children,
35
35
  className
36
- }: TextProps): react_jsx_runtime194.JSX.Element;
36
+ }: TextProps): react_jsx_runtime197.JSX.Element;
37
37
  //#endregion
38
38
  export { TreeItemLabel };
39
39
  //# sourceMappingURL=item-label.d.ts.map
@@ -11,7 +11,7 @@
11
11
  */
12
12
 
13
13
  import { IconProps } from "../icon/types.js";
14
- import * as react_jsx_runtime204 from "react/jsx-runtime";
14
+ import * as react_jsx_runtime195 from "react/jsx-runtime";
15
15
 
16
16
  //#region src/components/tree/item-prefix-icon.d.ts
17
17
  /**
@@ -33,7 +33,7 @@ import * as react_jsx_runtime204 from "react/jsx-runtime";
33
33
  declare function TreeItemPrefixIcon({
34
34
  children,
35
35
  className
36
- }: IconProps): react_jsx_runtime204.JSX.Element;
36
+ }: IconProps): react_jsx_runtime195.JSX.Element;
37
37
  //#endregion
38
38
  export { TreeItemPrefixIcon };
39
39
  //# sourceMappingURL=item-prefix-icon.d.ts.map
@@ -12,7 +12,7 @@
12
12
 
13
13
  import { TreeItemProps } from "./types.js";
14
14
  import "client-only";
15
- import * as react_jsx_runtime195 from "react/jsx-runtime";
15
+ import * as react_jsx_runtime201 from "react/jsx-runtime";
16
16
 
17
17
  //#region src/components/tree/item.d.ts
18
18
 
@@ -44,7 +44,7 @@ declare function TreeItem({
44
44
  className,
45
45
  id,
46
46
  ...rest
47
- }: TreeItemProps): react_jsx_runtime195.JSX.Element;
47
+ }: TreeItemProps): react_jsx_runtime201.JSX.Element;
48
48
  //#endregion
49
49
  export { TreeItem };
50
50
  //# sourceMappingURL=item.d.ts.map
@@ -10,7 +10,7 @@
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
12
 
13
- import * as react51 from "react";
13
+ import * as react52 from "react";
14
14
 
15
15
  //#region src/components/tree/lines.d.ts
16
16
  /**
@@ -19,11 +19,13 @@ import * as react51 from "react";
19
19
  * @param props - Component props.
20
20
  * @param props.level - The nesting level of the tree item.
21
21
  * @param props.isLastOfSet - Whether this item is the last in its sibling group.
22
+ * @param props.ancestorLastOfSet - Array tracking which ancestors are last of set at each level.
22
23
  * @returns An array of Line components representing the tree structure.
23
24
  */
24
- declare const TreeLines: react51.NamedExoticComponent<{
25
+ declare const TreeLines: react52.NamedExoticComponent<{
25
26
  level: number;
26
27
  isLastOfSet: boolean;
28
+ ancestorLastOfSet: boolean[];
27
29
  }>;
28
30
  //#endregion
29
31
  export { TreeLines };
@@ -25,16 +25,20 @@ import styles from "./styles.module.css";
25
25
  * @param props - Component props.
26
26
  * @param props.level - The nesting level of the tree item.
27
27
  * @param props.isLastOfSet - Whether this item is the last in its sibling group.
28
+ * @param props.ancestorLastOfSet - Array tracking which ancestors are last of set at each level.
28
29
  * @returns An array of Line components representing the tree structure.
29
30
  */
30
- const TreeLines = memo(function TreeLines$1({ level, isLastOfSet }) {
31
+ const TreeLines = memo(function TreeLines$1({ level, isLastOfSet, ancestorLastOfSet }) {
31
32
  const { showRuleLines, variant } = useContext(TreeContext);
32
33
  return Array.from({ length: level }).map((_, i) => {
33
34
  const type = i === level - 1 ? "branch" : "vert";
35
+ const line = isLastOfSet && i === level - 1 ? "last" : type;
36
+ const size = variant === "crammed" ? "medium" : "large";
37
+ const shouldHideLine = ancestorLastOfSet[i] ?? false;
34
38
  return /* @__PURE__ */ jsx(Lines, {
35
- variant: isLastOfSet && i > 0 ? "last" : type,
36
- size: variant === "crammed" ? "medium" : "large",
37
- isVisible: showRuleLines,
39
+ variant: line,
40
+ size,
41
+ isVisible: showRuleLines && !shouldHideLine,
38
42
  className: clsx(styles.spacing, styles[variant])
39
43
  }, i);
40
44
  });
@@ -1 +1 @@
1
- {"version":3,"file":"lines.js","names":["TreeLines"],"sources":["../../../src/components/tree/lines.tsx"],"sourcesContent":["/*\n * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { clsx } from '@accelint/design-foundation/lib/utils';\nimport { memo, useContext } from 'react';\nimport { Lines } from '../lines';\nimport { TreeContext } from './context';\nimport styles from './styles.module.css';\n\n/**\n * TreeLines - Renders connecting lines for tree hierarchy visualization.\n *\n * @param props - Component props.\n * @param props.level - The nesting level of the tree item.\n * @param props.isLastOfSet - Whether this item is the last in its sibling group.\n * @returns An array of Line components representing the tree structure.\n */\nexport const TreeLines = memo(function TreeLines({\n level,\n isLastOfSet,\n}: {\n level: number;\n isLastOfSet: boolean;\n}) {\n const { showRuleLines, variant } = useContext(TreeContext);\n\n return Array.from({ length: level }).map((_, i) => {\n const type = i === level - 1 ? 'branch' : 'vert';\n const line = isLastOfSet && i > 0 ? 'last' : type;\n const size = variant === 'crammed' ? 'medium' : 'large';\n\n return (\n <Lines\n // biome-ignore lint/suspicious/noArrayIndexKey: index should be the key, only count matters\n key={i}\n variant={line}\n size={size}\n isVisible={showRuleLines}\n className={clsx(styles.spacing, styles[variant])}\n />\n );\n });\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAa,YAAY,KAAK,SAASA,YAAU,EAC/C,OACA,eAIC;CACD,MAAM,EAAE,eAAe,YAAY,WAAW,YAAY;AAE1D,QAAO,MAAM,KAAK,EAAE,QAAQ,OAAO,CAAC,CAAC,KAAK,GAAG,MAAM;EACjD,MAAM,OAAO,MAAM,QAAQ,IAAI,WAAW;AAI1C,SACE,oBAAC;GAGC,SAPS,eAAe,IAAI,IAAI,SAAS;GAQzC,MAPS,YAAY,YAAY,WAAW;GAQ5C,WAAW;GACX,WAAW,KAAK,OAAO,SAAS,OAAO,SAAS;KAJ3C,EAKL;GAEJ;EACF"}
1
+ {"version":3,"file":"lines.js","names":["TreeLines"],"sources":["../../../src/components/tree/lines.tsx"],"sourcesContent":["/*\n * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { clsx } from '@accelint/design-foundation/lib/utils';\nimport { memo, useContext } from 'react';\nimport { Lines } from '../lines';\nimport { TreeContext } from './context';\nimport styles from './styles.module.css';\n\n/**\n * TreeLines - Renders connecting lines for tree hierarchy visualization.\n *\n * @param props - Component props.\n * @param props.level - The nesting level of the tree item.\n * @param props.isLastOfSet - Whether this item is the last in its sibling group.\n * @param props.ancestorLastOfSet - Array tracking which ancestors are last of set at each level.\n * @returns An array of Line components representing the tree structure.\n */\nexport const TreeLines = memo(function TreeLines({\n level,\n isLastOfSet,\n ancestorLastOfSet,\n}: {\n level: number;\n isLastOfSet: boolean;\n ancestorLastOfSet: boolean[];\n}) {\n const { showRuleLines, variant } = useContext(TreeContext);\n\n return Array.from({ length: level }).map((_, i) => {\n const type = i === level - 1 ? 'branch' : 'vert';\n const line = isLastOfSet && i === level - 1 ? 'last' : type;\n const size = variant === 'crammed' ? 'medium' : 'large';\n\n // Hide line at position i if the ancestor at that level is last of set\n const shouldHideLine = ancestorLastOfSet[i] ?? false;\n\n return (\n <Lines\n // biome-ignore lint/suspicious/noArrayIndexKey: index should be the key, only count matters\n key={i}\n variant={line}\n size={size}\n isVisible={showRuleLines && !shouldHideLine}\n className={clsx(styles.spacing, styles[variant])}\n />\n );\n });\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAa,YAAY,KAAK,SAASA,YAAU,EAC/C,OACA,aACA,qBAKC;CACD,MAAM,EAAE,eAAe,YAAY,WAAW,YAAY;AAE1D,QAAO,MAAM,KAAK,EAAE,QAAQ,OAAO,CAAC,CAAC,KAAK,GAAG,MAAM;EACjD,MAAM,OAAO,MAAM,QAAQ,IAAI,WAAW;EAC1C,MAAM,OAAO,eAAe,MAAM,QAAQ,IAAI,SAAS;EACvD,MAAM,OAAO,YAAY,YAAY,WAAW;EAGhD,MAAM,iBAAiB,kBAAkB,MAAM;AAE/C,SACE,oBAAC;GAGC,SAAS;GACH;GACN,WAAW,iBAAiB,CAAC;GAC7B,WAAW,KAAK,OAAO,SAAS,OAAO,SAAS;KAJ3C,EAKL;GAEJ;EACF"}
@@ -29,7 +29,7 @@
29
29
  }
30
30
 
31
31
  @variant hover {
32
- @apply bg-interactive-muted-hover;
32
+ @apply bg-interactive-muted-hover/50;
33
33
  }
34
34
 
35
35
  @variant focus-visible {
@@ -41,12 +41,12 @@
41
41
  }
42
42
 
43
43
  @variant drop-target {
44
- @apply outline-accent-primary-bold border;
44
+ @apply outline-accent-primary-bold outline;
45
45
  background-color: --alpha(var(--bg-accent-primary-muted) / 20%);
46
46
  }
47
47
 
48
48
  @variant disabled {
49
- @apply cursor-not-allowed border-none;
49
+ @apply fg-disabled cursor-not-allowed border-none;
50
50
 
51
51
  @variant hover {
52
52
  @apply bg-transparent;
@@ -55,6 +55,10 @@
55
55
  @variant data-[drop-target=true] {
56
56
  @apply bg-transparent;
57
57
  }
58
+
59
+ .description {
60
+ @apply fg-disabled;
61
+ }
58
62
  }
59
63
 
60
64
  &.cozy {
@@ -184,4 +188,20 @@
184
188
  .dropIndicator {
185
189
  @apply h-xxs bg-(--outline-accent-primary-hover);
186
190
  }
191
+
192
+ .dropIndicatorBetween {
193
+ @apply h-xs my-xs rounded-full bg-(--outline-accent-primary-hover);
194
+ }
195
+ }
196
+
197
+ @layer components.l2 {
198
+ .visibility {
199
+ @variant group-not-viewable/tree-item {
200
+ @apply fg-primary-muted;
201
+
202
+ @variant disabled {
203
+ @apply fg-disabled;
204
+ }
205
+ }
206
+ }
187
207
  }
@@ -12,7 +12,7 @@
12
12
 
13
13
  import { VideoProps } from "./types.js";
14
14
  import "client-only";
15
- import * as react_jsx_runtime199 from "react/jsx-runtime";
15
+ import * as react_jsx_runtime203 from "react/jsx-runtime";
16
16
 
17
17
  //#region src/components/video/index.d.ts
18
18
 
@@ -91,7 +91,7 @@ declare function Video({
91
91
  noMutedPref,
92
92
  lang,
93
93
  ...rest
94
- }: VideoProps): react_jsx_runtime199.JSX.Element;
94
+ }: VideoProps): react_jsx_runtime203.JSX.Element;
95
95
  //#endregion
96
96
  export { Video };
97
97
  //# sourceMappingURL=index.d.ts.map
@@ -12,12 +12,12 @@
12
12
 
13
13
  import { ViewStackContextValue } from "./types.js";
14
14
  import "client-only";
15
- import * as react52 from "react";
15
+ import * as react44 from "react";
16
16
  import { UniqueId } from "@accelint/core";
17
17
 
18
18
  //#region src/components/view-stack/context.d.ts
19
19
  /** Context for sharing state across ViewStack components */
20
- declare const ViewStackContext: react52.Context<ViewStackContextValue>;
20
+ declare const ViewStackContext: react44.Context<ViewStackContextValue>;
21
21
  /** Event handlers for ViewStack events */
22
22
  declare const ViewStackEventHandlers: {
23
23
  readonly back: (stack: UniqueId) => void;
@@ -12,7 +12,7 @@
12
12
 
13
13
  import { ViewStackProps } from "./types.js";
14
14
  import "client-only";
15
- import * as react_jsx_runtime196 from "react/jsx-runtime";
15
+ import * as react_jsx_runtime186 from "react/jsx-runtime";
16
16
 
17
17
  //#region src/components/view-stack/index.d.ts
18
18
 
@@ -47,7 +47,7 @@ declare function ViewStack({
47
47
  children,
48
48
  defaultView,
49
49
  onChange
50
- }: ViewStackProps): react_jsx_runtime196.JSX.Element;
50
+ }: ViewStackProps): react_jsx_runtime186.JSX.Element;
51
51
  //#endregion
52
52
  export { ViewStack };
53
53
  //# sourceMappingURL=index.d.ts.map
@@ -18,8 +18,8 @@ import { ViewStackContext } from "./context.js";
18
18
  import "client-only";
19
19
  import { useCallback, useRef, useState } from "react";
20
20
  import { jsx } from "react/jsx-runtime";
21
- import { useOn } from "@accelint/bus/react";
22
21
  import { isUUID } from "@accelint/core";
22
+ import { useOn } from "@accelint/bus/react";
23
23
 
24
24
  //#region src/components/view-stack/index.tsx
25
25
  /**
@@ -12,7 +12,7 @@
12
12
 
13
13
  import { ViewStackTriggerProps } from "./types.js";
14
14
  import "client-only";
15
- import * as react_jsx_runtime197 from "react/jsx-runtime";
15
+ import * as react_jsx_runtime187 from "react/jsx-runtime";
16
16
 
17
17
  //#region src/components/view-stack/trigger.d.ts
18
18
 
@@ -45,7 +45,7 @@ import * as react_jsx_runtime197 from "react/jsx-runtime";
45
45
  declare function ViewStackTrigger({
46
46
  children,
47
47
  for: types
48
- }: ViewStackTriggerProps): react_jsx_runtime197.JSX.Element;
48
+ }: ViewStackTriggerProps): react_jsx_runtime187.JSX.Element;
49
49
  //#endregion
50
50
  export { ViewStackTrigger };
51
51
  //# sourceMappingURL=trigger.d.ts.map
@@ -13,8 +13,8 @@
13
13
  import { ViewStackEventTypes } from "./events.js";
14
14
  import { ComponentProps, PropsWithChildren, RefAttributes } from "react";
15
15
  import { Pressable } from "react-aria-components";
16
- import { Payload } from "@accelint/bus";
17
16
  import { UniqueId } from "@accelint/core";
17
+ import { Payload } from "@accelint/bus";
18
18
 
19
19
  //#region src/components/view-stack/types.d.ts
20
20
  /**
@@ -12,7 +12,7 @@
12
12
 
13
13
  import { ViewStackViewProps } from "./types.js";
14
14
  import "client-only";
15
- import * as react_jsx_runtime198 from "react/jsx-runtime";
15
+ import * as react_jsx_runtime188 from "react/jsx-runtime";
16
16
 
17
17
  //#region src/components/view-stack/view.d.ts
18
18
 
@@ -43,7 +43,7 @@ import * as react_jsx_runtime198 from "react/jsx-runtime";
43
43
  declare function ViewStackView({
44
44
  id,
45
45
  children
46
- }: ViewStackViewProps): react_jsx_runtime198.JSX.Element | null;
46
+ }: ViewStackViewProps): react_jsx_runtime188.JSX.Element | null;
47
47
  //#endregion
48
48
  export { ViewStackView };
49
49
  //# sourceMappingURL=view.d.ts.map
@@ -37,10 +37,6 @@ function useTreeState({ items }) {
37
37
  "text/plain": JSON.stringify(node)
38
38
  };
39
39
  }),
40
- onReorder: (e) => {
41
- if (e.target.dropPosition === "before") setNodes(actions.moveBefore(e.target.key, e.keys));
42
- else setNodes(actions.moveAfter(e.target.key, e.keys));
43
- },
44
40
  onInsert: ({ items: items$1, target }) => {
45
41
  (async () => {
46
42
  const processedItems = await processDroppedItems(items$1, dragAndDropConfig.acceptedDragTypes ?? []);
@@ -49,22 +45,19 @@ function useTreeState({ items }) {
49
45
  else if (target.dropPosition === "after") setNodes(actions.insertAfter(target.key, processedItems));
50
46
  })();
51
47
  },
52
- onItemDrop: ({ target, items: items$1 }) => {
53
- (async () => {
54
- const targetNode = actions.getNode(target.key);
55
- const [item] = items$1;
56
- if (target.dropPosition === "on" && targetNode && item && item.kind !== "directory") {
57
- const key = await item.getText("key");
58
- if (key) setNodes(actions.moveInto(target.key, new Set([key])));
59
- }
60
- })();
61
- },
62
48
  onRootDrop: ({ items: items$1 }) => {
63
49
  (async () => {
64
50
  const processedItems = await processDroppedItems(items$1, dragAndDropConfig.acceptedDragTypes ?? []);
65
51
  setNodes(actions.remove(new Set(processedItems.map((item) => item.key))));
66
52
  setNodes(actions.insertAfter(null, processedItems));
67
53
  })();
54
+ },
55
+ onMove: (e) => {
56
+ if (e.target.dropPosition === "before") setNodes(actions.moveBefore(e.target.key, e.keys));
57
+ else if (e.target.dropPosition === "after") setNodes(actions.moveAfter(e.target.key, e.keys));
58
+ else if (e.target.dropPosition === "on") {
59
+ if (actions.getNode(e.target.key)) setNodes(actions.moveInto(e.target.key, e.keys));
60
+ }
68
61
  }
69
62
  };
70
63
  function collapseAll() {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["dragAndDropConfig: DragAndDropConfig","items"],"sources":["../../../../src/hooks/use-tree/state/index.ts"],"sourcesContent":["/*\n * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport { useState } from 'react';\nimport { useTreeActions } from '../actions';\nimport { processDroppedItems } from './utils';\nimport type {\n DragItem,\n DroppableCollectionInsertDropEvent,\n DroppableCollectionOnItemDropEvent,\n DroppableCollectionReorderEvent,\n DroppableCollectionRootDropEvent,\n Key,\n Selection,\n} from '@react-types/shared';\nimport type {\n DragAndDropConfig,\n UseTreeState,\n UseTreeStateOptions,\n} from '../types';\n\n/**\n * Stateful tree manager with drag-and-drop, selection, expansion, and visibility controls\n *\n * @param options - {@link UseTreeStateOptions}\n * @param options.items - Initial tree node items.\n * @returns {@link UseTreeState} Tree state, actions, and drag-and-drop configuration.\n */\nexport function useTreeState<T>({\n items,\n}: UseTreeStateOptions<T>): UseTreeState<T> {\n const [nodes, setNodes] = useState(items);\n const actions = useTreeActions<T>({ nodes });\n\n const dragAndDropConfig: DragAndDropConfig = {\n getItems: (keys: Set<Key>): DragItem[] =>\n [...keys].map((key) => {\n const node = actions.getNode(key);\n\n return {\n key: `${key}`,\n 'text/plain': JSON.stringify(node),\n };\n }),\n onReorder: (e: DroppableCollectionReorderEvent) => {\n if (e.target.dropPosition === 'before') {\n setNodes(actions.moveBefore(e.target.key, e.keys));\n } else {\n setNodes(actions.moveAfter(e.target.key, e.keys));\n }\n },\n onInsert: ({ items, target }: DroppableCollectionInsertDropEvent) => {\n (async () => {\n const processedItems = await processDroppedItems(\n items,\n dragAndDropConfig.acceptedDragTypes ?? [],\n );\n\n setNodes(\n actions.remove(new Set(processedItems.map((item) => item.id))),\n );\n\n if (target.dropPosition === 'before') {\n setNodes(actions.insertBefore(target.key, processedItems));\n } else if (target.dropPosition === 'after') {\n setNodes(actions.insertAfter(target.key, processedItems));\n }\n })();\n },\n onItemDrop: ({ target, items }: DroppableCollectionOnItemDropEvent) => {\n (async () => {\n const targetNode = actions.getNode(target.key);\n const [item] = items;\n\n if (\n target.dropPosition === 'on' &&\n targetNode &&\n item &&\n item.kind !== 'directory'\n ) {\n const key = await item.getText('key');\n\n if (key) {\n setNodes(actions.moveInto(target.key, new Set([key])));\n }\n }\n })();\n },\n onRootDrop: ({ items }: DroppableCollectionRootDropEvent) => {\n (async () => {\n const processedItems = await processDroppedItems(\n items,\n dragAndDropConfig.acceptedDragTypes ?? [],\n );\n\n setNodes(\n actions.remove(new Set(processedItems.map((item) => item.key))),\n );\n setNodes(actions.insertAfter(null, processedItems));\n })();\n },\n };\n\n function collapseAll() {\n setNodes(actions.collapseAll());\n }\n\n function expandAll() {\n setNodes(actions.expandAll());\n }\n\n function onExpandedChange(keys: Set<Key>) {\n setNodes(actions.onExpandedChange(keys));\n }\n\n function selectAll() {\n setNodes(actions.selectAll());\n }\n\n function unselectAll() {\n setNodes(actions.unselectAll());\n }\n\n function onSelectionChange(keys: Selection) {\n if (keys === 'all') {\n return selectAll();\n }\n\n setNodes(actions.onSelectionChange(keys));\n }\n\n function hideAll() {\n setNodes(actions.hideAll());\n }\n\n function revealAll() {\n setNodes(actions.revealAll());\n }\n\n function onVisibilityChange(keys: Set<Key>) {\n setNodes(actions.onVisibilityChange(keys));\n }\n\n return {\n nodes,\n actions: {\n // Expansion\n collapseAll,\n expandAll,\n onExpandedChange,\n\n // Selection\n selectAll,\n unselectAll,\n onSelectionChange,\n\n // Visibility\n hideAll,\n revealAll,\n onVisibilityChange,\n },\n dragAndDropConfig,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,SAAgB,aAAgB,EAC9B,SAC0C;CAC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AE,CAC1C;AAED,aACE,QAAQ,OAAO,IAAI,IAAI,eAAe,KAAK,SAAS,KAAK,IAAI,CAAC,CAAC,CAChE;AACD,aAAS,QAAQ,YAAY,MAAM,eAAe,CAAC;OACjD;;EAEP;CAED,SAAS,cAAc;AACrB,WAAS,QAAQ,aAAa,CAAC;;CAGjC,SAAS,YAAY;AACnB,WAAS,QAAQ,WAAW,CAAC;;CAG/B,SAAS,iBAAiB,MAAgB;AACxC,WAAS,QAAQ,iBAAiB,KAAK,CAAC;;CAG1C,SAAS,YAAY;AACnB,WAAS,QAAQ,WAAW,CAAC;;CAG/B,SAAS,cAAc;AACrB,WAAS,QAAQ,aAAa,CAAC;;CAGjC,SAAS,kBAAkB,MAAiB;AAC1C,MAAI,SAAS,MACX,QAAO,WAAW;AAGpB,WAAS,QAAQ,kBAAkB,KAAK,CAAC;;CAG3C,SAAS,UAAU;AACjB,WAAS,QAAQ,SAAS,CAAC;;CAG7B,SAAS,YAAY;AACnB,WAAS,QAAQ,WAAW,CAAC;;CAG/B,SAAS,mBAAmB,MAAgB;AAC1C,WAAS,QAAQ,mBAAmB,KAAK,CAAC;;AAG5C,QAAO;EACL;EACA,SAAS;GAEP;GACA;GACA;GAGA;GACA;GACA;GAGA;GACA;GACA;GACD;EACD;EACD"}
1
+ {"version":3,"file":"index.js","names":["dragAndDropConfig: DragAndDropConfig","items"],"sources":["../../../../src/hooks/use-tree/state/index.ts"],"sourcesContent":["/*\n * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport { useState } from 'react';\nimport { useTreeActions } from '../actions';\nimport { processDroppedItems } from './utils';\nimport type {\n DragItem,\n DroppableCollectionInsertDropEvent,\n DroppableCollectionRootDropEvent,\n Key,\n Selection,\n} from '@react-types/shared';\nimport type {\n DragAndDropConfig,\n UseTreeState,\n UseTreeStateOptions,\n} from '../types';\n\n/**\n * Stateful tree manager with drag-and-drop, selection, expansion, and visibility controls\n *\n * @param options - {@link UseTreeStateOptions}\n * @param options.items - Initial tree node items.\n * @returns {@link UseTreeState} Tree state, actions, and drag-and-drop configuration.\n */\nexport function useTreeState<T>({\n items,\n}: UseTreeStateOptions<T>): UseTreeState<T> {\n const [nodes, setNodes] = useState(items);\n const actions = useTreeActions<T>({ nodes });\n\n const dragAndDropConfig: DragAndDropConfig = {\n getItems: (keys: Set<Key>): DragItem[] =>\n [...keys].map((key) => {\n const node = actions.getNode(key);\n\n return {\n key: `${key}`,\n 'text/plain': JSON.stringify(node),\n };\n }),\n onInsert: ({ items, target }: DroppableCollectionInsertDropEvent) => {\n (async () => {\n const processedItems = await processDroppedItems(\n items,\n dragAndDropConfig.acceptedDragTypes ?? [],\n );\n\n setNodes(\n actions.remove(new Set(processedItems.map((item) => item.id))),\n );\n\n if (target.dropPosition === 'before') {\n setNodes(actions.insertBefore(target.key, processedItems));\n } else if (target.dropPosition === 'after') {\n setNodes(actions.insertAfter(target.key, processedItems));\n }\n })();\n },\n onRootDrop: ({ items }: DroppableCollectionRootDropEvent) => {\n (async () => {\n const processedItems = await processDroppedItems(\n items,\n dragAndDropConfig.acceptedDragTypes ?? [],\n );\n\n setNodes(\n actions.remove(new Set(processedItems.map((item) => item.key))),\n );\n setNodes(actions.insertAfter(null, processedItems));\n })();\n },\n onMove: (e) => {\n if (e.target.dropPosition === 'before') {\n setNodes(actions.moveBefore(e.target.key, e.keys));\n } else if (e.target.dropPosition === 'after') {\n setNodes(actions.moveAfter(e.target.key, e.keys));\n } else if (e.target.dropPosition === 'on') {\n const targetNode = actions.getNode(e.target.key);\n if (targetNode) {\n setNodes(actions.moveInto(e.target.key, e.keys));\n }\n }\n },\n };\n\n function collapseAll() {\n setNodes(actions.collapseAll());\n }\n\n function expandAll() {\n setNodes(actions.expandAll());\n }\n\n function onExpandedChange(keys: Set<Key>) {\n setNodes(actions.onExpandedChange(keys));\n }\n\n function selectAll() {\n setNodes(actions.selectAll());\n }\n\n function unselectAll() {\n setNodes(actions.unselectAll());\n }\n\n function onSelectionChange(keys: Selection) {\n if (keys === 'all') {\n return selectAll();\n }\n\n setNodes(actions.onSelectionChange(keys));\n }\n\n function hideAll() {\n setNodes(actions.hideAll());\n }\n\n function revealAll() {\n setNodes(actions.revealAll());\n }\n\n function onVisibilityChange(keys: Set<Key>) {\n setNodes(actions.onVisibilityChange(keys));\n }\n\n return {\n nodes,\n actions: {\n // Expansion\n collapseAll,\n expandAll,\n onExpandedChange,\n\n // Selection\n selectAll,\n unselectAll,\n onSelectionChange,\n\n // Visibility\n hideAll,\n revealAll,\n onVisibilityChange,\n },\n dragAndDropConfig,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,SAAgB,aAAgB,EAC9B,SAC0C;CAC1C,MAAM,CAAC,OAAO,YAAY,SAAS,MAAM;CACzC,MAAM,UAAU,eAAkB,EAAE,OAAO,CAAC;CAE5C,MAAMA,oBAAuC;EAC3C,WAAW,SACT,CAAC,GAAG,KAAK,CAAC,KAAK,QAAQ;GACrB,MAAM,OAAO,QAAQ,QAAQ,IAAI;AAEjC,UAAO;IACL,KAAK,GAAG;IACR,cAAc,KAAK,UAAU,KAAK;IACnC;IACD;EACJ,WAAW,EAAE,gBAAO,aAAiD;AACnE,IAAC,YAAY;IACX,MAAM,iBAAiB,MAAM,oBAC3BC,SACA,kBAAkB,qBAAqB,EAAE,CAC1C;AAED,aACE,QAAQ,OAAO,IAAI,IAAI,eAAe,KAAK,SAAS,KAAK,GAAG,CAAC,CAAC,CAC/D;AAED,QAAI,OAAO,iBAAiB,SAC1B,UAAS,QAAQ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Q,mBAAmB,KAAK,CAAC;;AAG5C,QAAO;EACL;EACA,SAAS;GAEP;GACA;GACA;GAGA;GACA;GACA;GAGA;GACA;GACA;GACD;EACD;EACD"}
package/dist/index.js CHANGED
@@ -83,6 +83,9 @@ import { PopoverTitle } from "./components/popover/title.js";
83
83
  import { RadioContext, RadioGroupContext } from "./components/radio/context.js";
84
84
  import { Radio } from "./components/radio/index.js";
85
85
  import { RadioGroup } from "./components/radio/group.js";
86
+ import { Tooltip } from "./components/tooltip/index.js";
87
+ import { TooltipContext } from "./components/tooltip/context.js";
88
+ import { TooltipTrigger } from "./components/tooltip/trigger.js";
86
89
  import { CoordinateSegment } from "./components/coordinate-field/segment.js";
87
90
  import { CoordinateField } from "./components/coordinate-field/index.js";
88
91
  import { DateField } from "./components/date-field/index.js";
@@ -109,9 +112,6 @@ import { ViewStack } from "./components/view-stack/index.js";
109
112
  import { Drawer } from "./components/drawer/index.js";
110
113
  import { DrawerLayoutMain } from "./components/drawer/layout-main.js";
111
114
  import { DrawerLayout } from "./components/drawer/layout.js";
112
- import { Tooltip } from "./components/tooltip/index.js";
113
- import { TooltipContext } from "./components/tooltip/context.js";
114
- import { TooltipTrigger } from "./components/tooltip/trigger.js";
115
115
  import { DrawerMenuItem } from "./components/drawer/menu-item.js";
116
116
  import { DrawerMenu } from "./components/drawer/menu.js";
117
117
  import { DrawerPanel } from "./components/drawer/panel.js";