{"version":3,"file":"TreeView.mjs","names":[],"sources":["../../../../src/next/tree-view/TreeView.tsx"],"sourcesContent":["/*!\n *\n *  Copyright (c) \"Neo4j\"\n *  Neo4j Sweden AB [http://neo4j.com]\n *\n *  This file is part of Neo4j.\n *\n *  Neo4j is free software: you can redistribute it and/or modify\n *  it under the terms of the GNU General Public License as published by\n *  the Free Software Foundation, either version 3 of the License, or\n *  (at your option) any later version.\n *\n *  This program is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n *  GNU General Public License for more details.\n *\n *  You should have received a copy of the GNU General Public License\n *  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { useMergeRefs } from '@floating-ui/react';\nimport classNames from 'classnames';\nimport {\n  Children,\n  cloneElement,\n  createContext,\n  isValidElement,\n  useCallback,\n  useContext,\n  useEffect,\n  useId,\n  useLayoutEffect,\n  useMemo,\n  useRef,\n  useState,\n  useSyncExternalStore,\n} from 'react';\n\nimport { type CommonProps, type TooltipObjectProps } from '../../_common/types';\nimport { useSemicontrolledState } from '../../_common/use-semi-controlled-state';\nimport { needleWarningMessage } from '../../_common/utils';\nimport { Checkbox } from '../../checkbox';\nimport { CleanIconButton } from '../../clean-icon-button';\nimport { ConditionalWrap } from '../../conditional-wrap';\nimport { isApplePlatform } from '../../helpers/platform';\nimport { ChevronRightIconOutline } from '../../icons/generated/heroIcons/ChevronRightIconOutline';\nimport { EllipsisHorizontalIconOutline } from '../../icons/generated/heroIcons/EllipsisHorizontalIconOutline';\nimport { Menu } from '../../menu';\nimport { Skeleton } from '../../skeleton';\nimport { Tooltip } from '../../tooltip';\nimport {\n  computeNextSelection,\n  computeSelectionEdges,\n  countChangedIds,\n  formatSelectionAnnouncement,\n  type SelectionAnchor,\n  type SelectionEdge,\n  type SelectionIntent,\n  type SelectionMode,\n} from './selection';\n\ntype ItemEntry = {\n  isDisabled: boolean;\n  isSelectable: boolean;\n  isSelected: boolean;\n  onSelectedChange?: (isSelected: boolean) => void;\n  parentId: string | null;\n  toggleExpanded: () => void;\n};\n\ntype TreeViewContextValue = {\n  isRootManaged: boolean;\n  level: number;\n  onSelectionIntent: (itemId: string, intent: SelectionIntent) => void;\n  parentId: string | null;\n  registerItem: (itemId: string, entry: ItemEntry | null) => void;\n  selectionMode: SelectionMode;\n  setFocusedId: (id: string | null) => void;\n  store: TreeViewStore;\n};\n\nconst noop = () => undefined;\n\nconst EMPTY_EDGES: ReadonlyMap<string, SelectionEdge> = new Map();\nconst EMPTY_IDS: ReadonlySet<string> = new Set();\nconst EMPTY_ID_LIST: string[] = [];\n\ntype TreeViewStoreState = {\n  edgeById: ReadonlyMap<string, SelectionEdge>;\n  focusedId: string | null;\n  /** Mirror of the selected ids; only meaningful when the root manages selection. */\n  selectedIds: ReadonlySet<string>;\n};\n\ntype TreeViewStore = {\n  getState: () => TreeViewStoreState;\n  setState: (partial: Partial<TreeViewStoreState>) => void;\n  subscribe: (listener: () => void) => () => void;\n};\n\n/**\n * Volatile per-interaction state (focus, root-managed selection, edge\n * styling) lives in this store instead of React context, so each item can\n * subscribe to its own primitive slice via `useSyncExternalStore` and an\n * interaction only re-renders the rows whose slice actually changed.\n */\nfunction createTreeViewStore(\n  initialState?: Partial<TreeViewStoreState>,\n): TreeViewStore {\n  let state: TreeViewStoreState = {\n    edgeById: EMPTY_EDGES,\n    focusedId: null,\n    selectedIds: EMPTY_IDS,\n    ...initialState,\n  };\n  const listeners = new Set<() => void>();\n  return {\n    getState: () => state,\n    setState: (partial) => {\n      state = { ...state, ...partial };\n      listeners.forEach((listener) => listener());\n    },\n    subscribe: (listener) => {\n      listeners.add(listener);\n      return () => {\n        listeners.delete(listener);\n      };\n    },\n  };\n}\n\nconst TREE_EVENTS = {\n  action: 'treeitem-action',\n  collapse: 'treeitem-collapse',\n  expand: 'treeitem-expand',\n} as const;\n\nconst TreeViewContext = createContext<TreeViewContextValue>({\n  isRootManaged: false,\n  level: 1,\n  onSelectionIntent: noop,\n  parentId: null,\n  registerItem: noop,\n  selectionMode: 'single',\n  setFocusedId: noop,\n  store: createTreeViewStore(),\n});\n\n/**\n * On Apple platforms Ctrl+click is the context menu gesture, so only Cmd may\n * stand for an additive selection there.\n */\nfunction getSelectionIntent(\n  event: React.KeyboardEvent | React.MouseEvent,\n): SelectionIntent {\n  return {\n    isRange: event.shiftKey,\n    isToggle: isApplePlatform() ? event.metaKey : event.ctrlKey,\n  };\n}\n\nfunction getVisibleTreeItems(root: HTMLElement): HTMLElement[] {\n  return Array.from(\n    root.querySelectorAll<HTMLElement>('[role=\"treeitem\"]'),\n  ).filter((el) => {\n    let parent = el.parentElement;\n    while (parent && parent !== root) {\n      if (parent.getAttribute('role') === 'group' && parent.hidden) {\n        return false;\n      }\n      parent = parent.parentElement;\n    }\n    return true;\n  });\n}\n\nfunction getVisibleItemIds(root: HTMLElement): string[] {\n  return getVisibleTreeItems(root).map((el) => el.id);\n}\n\nfunction areIdSetsEqual(\n  first: ReadonlySet<string>,\n  second: ReadonlySet<string>,\n): boolean {\n  if (first.size !== second.size) {\n    return false;\n  }\n  for (const id of first) {\n    if (!second.has(id)) {\n      return false;\n    }\n  }\n  return true;\n}\n\nfunction areEdgeMapsEqual(\n  first: ReadonlyMap<string, SelectionEdge>,\n  second: ReadonlyMap<string, SelectionEdge>,\n): boolean {\n  if (first.size !== second.size) {\n    return false;\n  }\n  for (const [id, edge] of first) {\n    if (second.get(id) !== edge) {\n      return false;\n    }\n  }\n  return true;\n}\n\nfunction annotateTreeItems(children: React.ReactNode): React.ReactNode {\n  const items = Children.toArray(children);\n  const treeItemCount = items.filter(\n    (child): child is React.ReactElement =>\n      isValidElement(child) && child.type === Item,\n  ).length;\n\n  let posInSet = 0;\n  return Children.map(children, (child) => {\n    if (isValidElement(child) && child.type === Item) {\n      posInSet++;\n      return cloneElement(\n        child as React.ReactElement<React.HTMLAttributes<HTMLElement>>,\n        {\n          'aria-posinset': posInSet,\n          'aria-setsize': treeItemCount,\n        },\n      );\n    }\n    return child;\n  });\n}\n\ntype RootProps = {\n  /** The aria-label for the tree. Required for accessibility, unless using ariaLabelledby. Pass null to omit. */\n  ariaLabel: string | null;\n  /** The aria-labelledby for the tree. Pass a string of space-separated IDs of elements that label the tree. */\n  ariaLabelledby?: string;\n  /** The children of the tree. Should be TreeView.Item components or TreeView.SkeletonItem components only. */\n  children?: React.ReactNode;\n  /** Initially selected item ids for an uncontrolled root-managed selection. */\n  defaultSelectedIds?: string[];\n  /** Selected item ids. Makes the tree manage selection itself, instead of each item managing its own. */\n  selectedIds?: string[];\n  /** Selection mode for the tree. Defaults to \"single\". */\n  selectionMode?: SelectionMode;\n  /** Callback called with the complete next selection whenever the tree manages selection. Fires once per interaction. */\n  onSelectedIdsChange?: (selectedIds: string[]) => void;\n};\n\n/**\n * Root container for a tree view. Renders a `role=\"tree\"` element with full\n * keyboard navigation (arrow keys, Home/End, Enter/Space) following the\n * WAI-ARIA TreeView pattern.\n *\n * Direct children should be `TreeView.Item` or `TreeView.SkeletonItem`.\n *\n * @example\n * ```tsx\n * <TreeView ariaLabel=\"Files\">\n *   <TreeView.Item title=\"README.md\" onSelectedChange={setSelected} isSelected={selected} />\n * </TreeView>\n * ```\n *\n * @alpha - this component is still in development and may change in the future. It might not have feature parity with the old tree view yet.\n */\nconst Root = ({\n  children,\n  defaultSelectedIds,\n  selectedIds: selectedIdsProp,\n  selectionMode = 'single',\n  ariaLabel,\n  ariaLabelledby,\n  className,\n  style,\n  htmlAttributes,\n  onSelectedIdsChange,\n  ref,\n  ...restProps\n}: CommonProps<'div', RootProps>) => {\n  const treeRef = useRef<HTMLDivElement>(null);\n  const mergedRef = useMergeRefs([treeRef, ref]);\n  const [announcement, setAnnouncement] = useState('');\n  // While focus is inside the tree the root drops out of the tab order so\n  // that Shift+Tab moves focus out of the tree instead of landing on the\n  // root, which would delegate focus straight back to the item (a trap).\n  const [isFocusWithin, setIsFocusWithin] = useState(false);\n  const anchorRef = useRef<SelectionAnchor>(null);\n  const entriesRef = useRef(new Map<string, ItemEntry>());\n\n  const isRootManaged =\n    selectedIdsProp !== undefined || defaultSelectedIds !== undefined;\n\n  const storeRef = useRef<TreeViewStore>(null);\n  if (storeRef.current === null) {\n    storeRef.current = createTreeViewStore({\n      selectedIds: new Set(\n        selectedIdsProp ?? defaultSelectedIds ?? EMPTY_ID_LIST,\n      ),\n    });\n  }\n  const store = storeRef.current;\n\n  const setFocusedId = useCallback(\n    (id: string | null) => {\n      if (store.getState().focusedId !== id) {\n        store.setState({ focusedId: id });\n      }\n    },\n    [store],\n  );\n\n  const [selectedIdList, setSelectedIdList] = useSemicontrolledState<string[]>({\n    isControlled: selectedIdsProp !== undefined,\n    onChange: onSelectedIdsChange,\n    state: selectedIdsProp ?? defaultSelectedIds ?? EMPTY_ID_LIST,\n  });\n\n  // useSemicontrolledState recreates its setter whenever the value changes;\n  // reading it through a ref keeps onSelectionIntent (and with it the\n  // memoized context value) stable across selection changes.\n  const setSelectedIdListRef = useRef(setSelectedIdList);\n  useLayoutEffect(() => {\n    setSelectedIdListRef.current = setSelectedIdList;\n  });\n\n  const readSelectedIds = useCallback((): Set<string> => {\n    if (isRootManaged) {\n      return new Set(store.getState().selectedIds);\n    }\n    const selected = new Set<string>();\n    entriesRef.current.forEach((entry, itemId) => {\n      if (entry.isSelected) {\n        selected.add(itemId);\n      }\n    });\n    return selected;\n  }, [isRootManaged, store]);\n\n  const readItemMaps = useCallback(() => {\n    const parentIdById = new Map<string, string>();\n    const selectableIds = new Set<string>();\n    entriesRef.current.forEach((entry, itemId) => {\n      if (entry.parentId !== null) {\n        parentIdById.set(itemId, entry.parentId);\n      }\n      if (entry.isSelectable && !entry.isDisabled) {\n        selectableIds.add(itemId);\n      }\n    });\n    return { parentIdById, selectableIds };\n  }, []);\n\n  const recomputeEdges = useCallback(() => {\n    const root = treeRef.current;\n    const previousEdges = store.getState().edgeById;\n    if (!root || selectionMode !== 'multiple-replace') {\n      if (previousEdges.size > 0) {\n        store.setState({ edgeById: EMPTY_EDGES });\n      }\n      return;\n    }\n    const selectedIds = readSelectedIds();\n    if (selectedIds.size === 0 && previousEdges.size === 0) {\n      return;\n    }\n    const nextEdges = computeSelectionEdges(\n      getVisibleItemIds(root),\n      selectedIds,\n    );\n    if (!areEdgeMapsEqual(previousEdges, nextEdges)) {\n      store.setState({ edgeById: nextEdges });\n    }\n  }, [readSelectedIds, selectionMode, store]);\n\n  const recomputeEdgesRef = useRef(recomputeEdges);\n  useLayoutEffect(() => {\n    recomputeEdgesRef.current = recomputeEdges;\n  });\n\n  // Debounced through a microtask so a commit that touches many items (mount,\n  // expansion, range selection) triggers a single recompute, after all item\n  // layout effects have registered and before the browser paints.\n  const isEdgeRecomputeScheduledRef = useRef(false);\n  const scheduleEdgeRecompute = useCallback(() => {\n    if (isEdgeRecomputeScheduledRef.current) {\n      return;\n    }\n    isEdgeRecomputeScheduledRef.current = true;\n    queueMicrotask(() => {\n      isEdgeRecomputeScheduledRef.current = false;\n      recomputeEdgesRef.current();\n    });\n  }, []);\n\n  const registerItem = useCallback(\n    (itemId: string, entry: ItemEntry | null) => {\n      if (entry === null) {\n        entriesRef.current.delete(itemId);\n      } else {\n        entriesRef.current.set(itemId, entry);\n      }\n      // Covers item mount/unmount and expansion toggles (a collapsing parent\n      // re-registers because its toggleExpanded callback is recreated).\n      scheduleEdgeRecompute();\n    },\n    [scheduleEdgeRecompute],\n  );\n\n  const onSelectionIntent = useCallback(\n    (itemId: string, intent: SelectionIntent) => {\n      const root = treeRef.current;\n      const entry = entriesRef.current.get(itemId);\n      if (!root || !entry || entry.isDisabled) {\n        return;\n      }\n      if (!entry.isSelectable) {\n        entry.toggleExpanded();\n        return;\n      }\n\n      const { parentIdById, selectableIds } = readItemMaps();\n      const selectedIds = readSelectedIds();\n      const result = computeNextSelection({\n        anchor: anchorRef.current,\n        intent,\n        parentIdById,\n        selectableIds,\n        selectedIds,\n        selectionMode,\n        targetId: itemId,\n        visibleIds: getVisibleItemIds(root),\n      });\n      anchorRef.current = result.anchor;\n\n      const nextSelectedIds = result.selectedIds;\n      const changedCount = countChangedIds(selectedIds, nextSelectedIds);\n\n      if (isRootManaged) {\n        if (changedCount > 0) {\n          setSelectedIdListRef.current([...nextSelectedIds]);\n        }\n      } else if (selectionMode === 'single') {\n        // Single mode leaves clearing the previously selected item to the\n        // consumer, so only the clicked item is told about the change.\n        if (!selectedIds.has(itemId)) {\n          entry.onSelectedChange?.(true);\n        }\n      } else {\n        entriesRef.current.forEach((itemEntry, id) => {\n          const isSelected = nextSelectedIds.has(id);\n          if (itemEntry.isSelected !== isSelected) {\n            itemEntry.onSelectedChange?.(isSelected);\n          }\n        });\n      }\n\n      scheduleEdgeRecompute();\n\n      if (selectionMode !== 'single') {\n        setAnnouncement(\n          intent.isRange\n            ? formatSelectionAnnouncement(nextSelectedIds.size)\n            : '',\n        );\n      }\n    },\n    [\n      isRootManaged,\n      readItemMaps,\n      readSelectedIds,\n      scheduleEdgeRecompute,\n      selectionMode,\n    ],\n  );\n\n  // Mirrors the root-managed selection into the store, so items subscribe to\n  // their own slice and event handlers read it without a state dependency.\n  useLayoutEffect(() => {\n    const next = isRootManaged ? new Set(selectedIdList) : EMPTY_IDS;\n    if (areIdSetsEqual(store.getState().selectedIds, next)) {\n      return;\n    }\n    store.setState({ selectedIds: next });\n    scheduleEdgeRecompute();\n  }, [isRootManaged, scheduleEdgeRecompute, selectedIdList, store]);\n\n  // Computes edges on mount and whenever the edge inputs change identity\n  // (selection mode, root-managed flag). Interaction-driven recomputes go\n  // through scheduleEdgeRecompute instead.\n  useLayoutEffect(() => {\n    recomputeEdges();\n  }, [recomputeEdges]);\n\n  const handleKeyDown = useCallback(\n    (event: React.KeyboardEvent<HTMLDivElement>) => {\n      const root = treeRef.current;\n      if (!root) {\n        return;\n      }\n\n      const items = getVisibleTreeItems(root);\n      if (items.length === 0) {\n        return;\n      }\n\n      const currentIndex = items.findIndex(\n        (el) => el.id === store.getState().focusedId,\n      );\n      let isHandled = true;\n\n      const extendRangeTo = (item: HTMLElement) => {\n        if (selectionMode === 'single' || currentIndex < 0) {\n          return;\n        }\n        const entry = entriesRef.current.get(item.id);\n        if (!entry?.isSelectable || entry.isDisabled) {\n          return;\n        }\n        if (anchorRef.current === null) {\n          // A keyboard range has no preceding click to repeat, so it grows the\n          // selection outwards from wherever focus already is.\n          anchorRef.current = {\n            baseSelectedIds: readSelectedIds(),\n            id: items[currentIndex].id,\n            isSelected: true,\n          };\n        }\n        onSelectionIntent(item.id, { isRange: true, isToggle: false });\n      };\n\n      switch (event.key) {\n        case 'ArrowDown': {\n          const nextIndex =\n            currentIndex < items.length - 1 ? currentIndex + 1 : currentIndex;\n          const nextItem = items[nextIndex];\n          if (nextItem) {\n            if (event.shiftKey) {\n              extendRangeTo(nextItem);\n            }\n            setFocusedId(nextItem.id);\n            nextItem.focus();\n          }\n          break;\n        }\n        case 'ArrowUp': {\n          const prevIndex = currentIndex > 0 ? currentIndex - 1 : 0;\n          const prevItem = items[prevIndex];\n          if (prevItem) {\n            if (event.shiftKey) {\n              extendRangeTo(prevItem);\n            }\n            setFocusedId(prevItem.id);\n            prevItem.focus();\n          }\n          break;\n        }\n        case 'ArrowRight': {\n          const current = currentIndex >= 0 ? items[currentIndex] : null;\n          if (!current) {\n            break;\n          }\n          const isExpanded = current.getAttribute('aria-expanded');\n          if (isExpanded === 'false') {\n            current.dispatchEvent(new CustomEvent(TREE_EVENTS.expand));\n          } else if (isExpanded === 'true') {\n            const nextIndex = currentIndex + 1;\n            if (nextIndex < items.length) {\n              const nextItem = items[nextIndex];\n              setFocusedId(nextItem.id);\n              nextItem.focus();\n            }\n          }\n          break;\n        }\n        case 'ArrowLeft': {\n          const current = currentIndex >= 0 ? items[currentIndex] : null;\n          if (!current) {\n            break;\n          }\n          const isExpanded = current.getAttribute('aria-expanded');\n          if (isExpanded === 'true') {\n            current.dispatchEvent(new CustomEvent(TREE_EVENTS.collapse));\n          } else {\n            const parentGroup = current.closest('[role=\"group\"]');\n            if (parentGroup?.id) {\n              const parentItem = root.querySelector<HTMLElement>(\n                `[aria-owns=\"${parentGroup.id}\"]`,\n              );\n              if (parentItem) {\n                setFocusedId(parentItem.id);\n                parentItem.focus();\n              }\n            }\n          }\n          break;\n        }\n        case 'Home': {\n          const first = items[0];\n          if (first) {\n            setFocusedId(first.id);\n            first.focus();\n          }\n          break;\n        }\n        case 'End': {\n          const last = items[items.length - 1];\n          if (last) {\n            setFocusedId(last.id);\n            last.focus();\n          }\n          break;\n        }\n        case 'Enter':\n        case ' ': {\n          const current = currentIndex >= 0 ? items[currentIndex] : null;\n          if (current) {\n            onSelectionIntent(current.id, getSelectionIntent(event));\n          }\n          break;\n        }\n        case 'F10': {\n          if (event.shiftKey) {\n            const current = currentIndex >= 0 ? items[currentIndex] : null;\n            if (current) {\n              current.dispatchEvent(new CustomEvent(TREE_EVENTS.action));\n            }\n          } else {\n            isHandled = false;\n          }\n          break;\n        }\n        default:\n          isHandled = false;\n      }\n\n      if (isHandled) {\n        event.preventDefault();\n        event.stopPropagation();\n      }\n    },\n    [onSelectionIntent, readSelectedIds, selectionMode, setFocusedId, store],\n  );\n\n  const handleFocus = useCallback(\n    (event: React.FocusEvent<HTMLDivElement>) => {\n      const root = treeRef.current;\n      if (!root) {\n        return;\n      }\n\n      setIsFocusWithin(true);\n\n      if (event.target === root) {\n        const items = getVisibleTreeItems(root);\n        const { focusedId } = store.getState();\n        const alreadyFocused = focusedId\n          ? items.find((el) => el.id === focusedId)\n          : null;\n        const target = alreadyFocused ?? items[0];\n        if (target) {\n          setFocusedId(target.id);\n          target.focus();\n        }\n      }\n    },\n    [setFocusedId, store],\n  );\n\n  const handleBlur = useCallback((event: React.FocusEvent<HTMLDivElement>) => {\n    const root = treeRef.current;\n    if (!root) {\n      return;\n    }\n    if (\n      !(event.relatedTarget instanceof Node) ||\n      !root.contains(event.relatedTarget)\n    ) {\n      setIsFocusWithin(false);\n    }\n  }, []);\n\n  const classes = classNames(className, 'ndl-tree-view-new', {\n    'ndl-tree-view-new--checkbox': selectionMode === 'multiple',\n  });\n\n  // Cached on children identity so Root-internal state commits (announcement,\n  // uncontrolled selection) reuse the same annotated elements and React bails\n  // out of the whole item subtree instead of re-rendering every row.\n  const annotatedChildren = useMemo(\n    () => annotateTreeItems(children),\n    [children],\n  );\n\n  // Everything in here is stable or primitive, so items only re-render via\n  // context when the tree's configuration changes, not per interaction.\n  const contextValue = useMemo(\n    () => ({\n      isRootManaged,\n      level: 1,\n      onSelectionIntent,\n      parentId: null,\n      registerItem,\n      selectionMode,\n      setFocusedId,\n      store,\n    }),\n    [\n      isRootManaged,\n      onSelectionIntent,\n      registerItem,\n      selectionMode,\n      setFocusedId,\n      store,\n    ],\n  );\n\n  return (\n    <TreeViewContext.Provider value={contextValue}>\n      <div\n        ref={mergedRef}\n        role=\"tree\"\n        aria-multiselectable={\n          selectionMode === 'multiple' || selectionMode === 'multiple-replace'\n            ? true\n            : undefined\n        }\n        tabIndex={isFocusWithin ? -1 : 0}\n        className={classes}\n        onKeyDown={handleKeyDown}\n        onFocus={handleFocus}\n        onBlur={handleBlur}\n        aria-label={ariaLabel ?? undefined}\n        aria-labelledby={ariaLabelledby}\n        style={style}\n        {...htmlAttributes}\n        {...restProps}\n      >\n        {annotatedChildren}\n      </div>\n      <div\n        role=\"status\"\n        aria-live=\"polite\"\n        aria-atomic=\"true\"\n        className=\"ndl-tree-view-new-live-region\"\n      >\n        {announcement}\n      </div>\n    </TreeViewContext.Provider>\n  );\n};\n\ntype ItemProps = {\n  /** Nested TreeView.Item or TreeView.SkeletonItem elements rendered as sub-items in a collapsible group. */\n  children?: React.ReactNode;\n  /** The label content displayed in the item row. */\n  title?: React.ReactNode;\n  /** Default expansion for uncontrolled items */\n  isDefaultExpanded?: boolean;\n  /** Whether the item has children. Decides if the item should render a chevron for expansion. Needed for lazy loading. */\n  hasChildren?: boolean;\n  /** Identifies the item. Required when the tree manages selection via `selectedIds`. */\n  id?: string;\n  /** Whether the item is disabled */\n  isDisabled?: boolean;\n  /** Whether the item is expanded. Makes the item controlled. */\n  isExpanded?: boolean;\n  /** Whether the item is in an indeterminate state. Only meaningful in multi-select mode for parent nodes. */\n  isIndeterminate?: boolean;\n  /** Whether the item is loading. Applies aria-busy=\"true\" to the item. */\n  isLoading?: boolean;\n  /** Whether the item can be selected. Defaults to true when the tree manages selection, and otherwise to whether `onSelectedChange` is set. */\n  isSelectable?: boolean;\n  /** Whether the item is selected. Ignored when the tree manages selection via `selectedIds`. */\n  isSelected?: boolean;\n  /** Leading visual for the item. */\n  leadingVisual?: React.ReactNode;\n  /** Trailing content for the item. Shown after the children but before the action menu. */\n  trailingContent?: React.ReactNode;\n  /** ReactNode containing Menu.Item elements to render in an action menu. When provided, an action button is rendered. */\n  actionMenuItems?: React.ReactNode;\n  /** Props forwarded to the Menu sub-components (anchorRef, onClose). */\n  actionMenuProps?: React.ComponentProps<typeof Menu>;\n  /** Content rendered inside the tooltip. When provided, the item is wrapped in a Tooltip. */\n  tooltipContent?: React.ReactNode;\n  /** Props forwarded to the Tooltip sub-components (root, trigger, content). */\n  tooltipProps?: TooltipObjectProps;\n  /** Callback called when the item is expanded/collapsed. */\n  onExpandedChange?: (isExpanded: boolean) => void;\n  /** Callback called when the item is selected/deselected. Receives the new selected state. Ignored when the tree manages selection via `selectedIds`. */\n  onSelectedChange?: (isSelected: boolean) => void;\n};\n\n/**\n * A single item within a `TreeView`. Renders a `role=\"treeitem\"` element that\n * supports selection, expansion, leading/trailing visuals, and an action menu.\n *\n * The `title` prop provides the item's label content. Nesting `TreeView.Item`\n * elements as `children` creates a hierarchical tree structure.\n *\n * Supports both controlled (`isExpanded`) and uncontrolled (`isDefaultExpanded`)\n * expansion, as well as lazy loading via `hasChildren` + `isLoading`.\n *\n * @example\n * ```tsx\n * <TreeView.Item\n *   title=\"src\"\n *   leadingVisual={<FolderIcon />}\n *   isSelected={selected}\n *   onSelectedChange={setSelected}\n * >\n *   <TreeView.Item title=\"index.ts\" />\n * </TreeView.Item>\n * ```\n */\nconst Item = ({\n  actionMenuItems,\n  children,\n  isDefaultExpanded = false,\n  hasChildren: hasChildrenProp,\n  id: idProp,\n  isDisabled,\n  isExpanded: isExpandedProp,\n  isIndeterminate,\n  isLoading,\n  isSelectable: isSelectableProp,\n  isSelected: isSelectedProp,\n  leadingVisual,\n  title,\n  tooltipContent,\n  tooltipProps,\n  trailingContent,\n  onExpandedChange,\n  onSelectedChange,\n  actionMenuProps,\n  className,\n  style,\n  htmlAttributes,\n  ref,\n  ...restProps\n}: CommonProps<'div', ItemProps>) => {\n  const generatedId = useId();\n  const itemId = idProp ?? htmlAttributes?.id ?? `ndl-treeitem-${generatedId}`;\n  const titleId = `ndl-treeitem-title-${generatedId}`;\n  const groupId = `ndl-treegroup-${generatedId}`;\n  const itemRef = useRef<HTMLDivElement>(null);\n  const actionButtonRef = useRef<HTMLButtonElement>(null);\n  const didOpenViaKeyboard = useRef(false);\n  const [isMenuOpen, setIsMenuOpen] = useState(false);\n  const treeViewContext = useContext(TreeViewContext);\n  const {\n    isRootManaged,\n    level,\n    onSelectionIntent,\n    parentId,\n    registerItem,\n    selectionMode,\n    setFocusedId,\n    store,\n  } = treeViewContext;\n\n  // Primitive slices of the store, so Object.is bails out of re-renders for\n  // rows whose focus/selection/edge state did not change.\n  const isFocused = useSyncExternalStore(\n    store.subscribe,\n    () => store.getState().focusedId === itemId,\n    () => store.getState().focusedId === itemId,\n  );\n  const isRootSelected = useSyncExternalStore(\n    store.subscribe,\n    () => store.getState().selectedIds.has(itemId),\n    () => store.getState().selectedIds.has(itemId),\n  );\n  const edge = useSyncExternalStore(\n    store.subscribe,\n    () => store.getState().edgeById.get(itemId),\n    () => store.getState().edgeById.get(itemId),\n  );\n\n  const isControlledExpansion = isExpandedProp !== undefined;\n  const [isExpanded, setIsExpanded] = useSemicontrolledState({\n    isControlled: isControlledExpansion,\n    onChange: onExpandedChange,\n    state: isExpandedProp ?? isDefaultExpanded,\n  });\n\n  const hasChildren = hasChildrenProp ?? Children.count(children) > 0;\n  const isSelectable = isRootManaged\n    ? (isSelectableProp ?? true)\n    : (isSelectableProp ?? onSelectedChange !== undefined);\n  const isSelected = isRootManaged ? isRootSelected : (isSelectedProp ?? false);\n  const isMultiple = selectionMode === 'multiple';\n\n  const toggleExpanded = useCallback(() => {\n    if (isDisabled) {\n      return;\n    }\n    if (hasChildren) {\n      setIsExpanded(!isExpanded);\n    }\n  }, [isDisabled, hasChildren, setIsExpanded, isExpanded]);\n\n  useLayoutEffect(() => {\n    registerItem(itemId, {\n      isDisabled: isDisabled ?? false,\n      isSelectable,\n      isSelected,\n      onSelectedChange,\n      parentId,\n      toggleExpanded,\n    });\n  }, [\n    isDisabled,\n    isSelectable,\n    isSelected,\n    itemId,\n    onSelectedChange,\n    parentId,\n    registerItem,\n    toggleExpanded,\n  ]);\n\n  useLayoutEffect(() => {\n    return () => registerItem(itemId, null);\n  }, [itemId, registerItem]);\n\n  useEffect(() => {\n    if (!isRootManaged) {\n      return;\n    }\n    if (idProp === undefined) {\n      needleWarningMessage(\n        'TreeView.Item needs an `id` when the tree manages selection with `selectedIds`.',\n      );\n    }\n    if (isSelectedProp !== undefined || onSelectedChange !== undefined) {\n      needleWarningMessage(\n        'TreeView.Item `isSelected` and `onSelectedChange` are ignored when the tree manages selection with `selectedIds`.',\n      );\n    }\n  }, [idProp, isRootManaged, isSelectedProp, onSelectedChange]);\n\n  const handleClick = useCallback(\n    (event: React.MouseEvent) => {\n      if (isDisabled) {\n        return;\n      }\n      setFocusedId(itemId);\n      onSelectionIntent(itemId, getSelectionIntent(event));\n    },\n    [isDisabled, setFocusedId, itemId, onSelectionIntent],\n  );\n\n  const handleChevronClick = useCallback(\n    (event: React.MouseEvent) => {\n      event.stopPropagation();\n      if (isDisabled) {\n        return;\n      }\n      setFocusedId(itemId);\n      toggleExpanded();\n    },\n    [isDisabled, setFocusedId, itemId, toggleExpanded],\n  );\n\n  const handleMenuClose = useCallback(() => {\n    setIsMenuOpen(false);\n    if (didOpenViaKeyboard.current) {\n      itemRef.current?.focus();\n      didOpenViaKeyboard.current = false;\n    }\n  }, []);\n\n  const handleCustomEvents = useCallback(\n    (event: Event) => {\n      if (event.type === TREE_EVENTS.expand) {\n        event.stopPropagation();\n        if (hasChildren && !isExpanded && !isDisabled) {\n          setIsExpanded(true);\n        }\n      } else if (event.type === TREE_EVENTS.collapse) {\n        event.stopPropagation();\n        if (hasChildren && isExpanded && !isDisabled) {\n          setIsExpanded(false);\n        }\n      } else if (event.type === TREE_EVENTS.action) {\n        event.stopPropagation();\n        if (actionMenuItems && !isDisabled) {\n          didOpenViaKeyboard.current = true;\n          setIsMenuOpen(true);\n        }\n      }\n    },\n    [actionMenuItems, hasChildren, isExpanded, isDisabled, setIsExpanded],\n  );\n\n  const callbackRef = useCallback(\n    (node: HTMLDivElement | null) => {\n      const prev = itemRef.current;\n      if (prev) {\n        prev.removeEventListener(TREE_EVENTS.expand, handleCustomEvents);\n        prev.removeEventListener(TREE_EVENTS.collapse, handleCustomEvents);\n        prev.removeEventListener(TREE_EVENTS.action, handleCustomEvents);\n      }\n      (itemRef as React.MutableRefObject<HTMLDivElement | null>).current = node;\n      if (node) {\n        node.addEventListener(TREE_EVENTS.expand, handleCustomEvents);\n        node.addEventListener(TREE_EVENTS.collapse, handleCustomEvents);\n        node.addEventListener(TREE_EVENTS.action, handleCustomEvents);\n      }\n    },\n    [handleCustomEvents],\n  );\n\n  const mergedRef = useMergeRefs([callbackRef, ref]);\n\n  const selectionAriaProps = (() => {\n    if (!isSelectable) {\n      return {};\n    }\n    if (isMultiple) {\n      return {\n        'aria-checked': isIndeterminate ? ('mixed' as const) : isSelected,\n      };\n    }\n    return { 'aria-selected': isSelected };\n  })();\n\n  const edgeClass =\n    edge === undefined ? undefined : `ndl-tree-view-new-item--selected-${edge}`;\n\n  const childContextValue = useMemo(\n    () => ({\n      ...treeViewContext,\n      level: treeViewContext.level + 1,\n      parentId: itemId,\n    }),\n    [itemId, treeViewContext],\n  );\n\n  // Same caching as in Root: keeps child element identity stable across\n  // renders of this item (selection, focus, expansion) so unchanged\n  // descendants bail out of re-rendering.\n  const annotatedChildren = useMemo(\n    () => annotateTreeItems(children),\n    [children],\n  );\n\n  const itemElement = (\n    // eslint-disable-next-line jsx-a11y/click-events-have-key-events -- keyboard handled on tree root; aria-selected/aria-checked applied via spread\n    <div\n      ref={mergedRef}\n      // eslint-disable-next-line jsx-a11y/role-has-required-aria-props -- aria-selected/aria-checked applied conditionally via spread\n      role=\"treeitem\"\n      {...selectionAriaProps}\n      aria-expanded={hasChildren ? isExpanded : undefined}\n      aria-owns={hasChildren ? groupId : undefined}\n      aria-disabled={isDisabled || undefined}\n      aria-busy={isLoading || undefined}\n      aria-keyshortcuts={actionMenuItems ? 'Shift+F10' : undefined}\n      aria-labelledby={titleId}\n      aria-level={level}\n      tabIndex={isFocused ? 0 : -1}\n      className={classNames('ndl-tree-view-new-item', className, edgeClass, {\n        'ndl-tree-view-new-item--disabled': isDisabled,\n        'ndl-tree-view-new-item--parent': hasChildren,\n        'ndl-tree-view-new-item--selected': isSelected && isSelectable,\n      })}\n      style={{ '--tree-level': level - 1, ...style } as React.CSSProperties}\n      onClick={(event) => {\n        event.stopPropagation();\n        handleClick(event);\n      }}\n      {...htmlAttributes}\n      {...restProps}\n      id={itemId}\n    >\n      <div\n        className={classNames('ndl-tree-view-new-item-content', {\n          'ndl-tree-view-new-item-content--parent': hasChildren,\n        })}\n      >\n        {hasChildren && (\n          // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions -- keyboard handled on tree root\n          <span\n            className=\"ndl-tree-view-new-chevron\"\n            aria-disabled={isDisabled}\n            onClick={handleChevronClick}\n          >\n            <ChevronRightIconOutline\n              className={classNames('ndl-tree-view-new-chevron-icon', {\n                'ndl-tree-view-new-chevron-icon--open': isExpanded,\n              })}\n            />\n          </span>\n        )}\n        {leadingVisual && (\n          <div className=\"ndl-tree-view-new-item-content-leading-visual\">\n            {leadingVisual}\n          </div>\n        )}\n        {isMultiple && isSelectable && (\n          <div className=\"ndl-tree-view-new-checkbox\" inert>\n            <Checkbox\n              style={{ borderWidth: '1.5px' }}\n              ariaLabel=\"Select\"\n              isChecked={isSelected}\n              isIndeterminate={isIndeterminate}\n              isDisabled={isDisabled}\n              onChange={noop}\n            />\n          </div>\n        )}\n        <div id={titleId} className=\"ndl-tree-view-new-item-content-title\">\n          {title}\n        </div>\n        {trailingContent && (\n          <div className=\"ndl-tree-view-new-item-content-trailing-content\">\n            {trailingContent}\n          </div>\n        )}\n        {actionMenuItems && (\n          <div\n            className={classNames('ndl-tree-view-new-action', {\n              'ndl-tree-view-new-action--visible': isMenuOpen,\n            })}\n          >\n            <CleanIconButton\n              ref={actionButtonRef}\n              size=\"small\"\n              description={null}\n              isDisabled={isDisabled}\n              style={{ height: '24px', width: '24px' }}\n              htmlAttributes={{\n                'aria-expanded': isMenuOpen || undefined,\n                'aria-haspopup': 'menu',\n                'aria-label': 'Actions',\n                onClick: (event: React.MouseEvent) => {\n                  event.stopPropagation();\n                  didOpenViaKeyboard.current = false;\n                  setIsMenuOpen((prev) => !prev);\n                },\n                tabIndex: -1,\n              }}\n            >\n              <EllipsisHorizontalIconOutline />\n            </CleanIconButton>\n            <Menu\n              isOpen={isMenuOpen}\n              anchorRef={actionButtonRef}\n              onClose={handleMenuClose}\n              {...actionMenuProps}\n            >\n              {actionMenuItems}\n            </Menu>\n          </div>\n        )}\n      </div>\n    </div>\n  );\n\n  return (\n    <>\n      <ConditionalWrap\n        shouldWrap={tooltipContent !== undefined && tooltipContent !== null}\n        wrap={(children) => (\n          <Tooltip\n            type=\"simple\"\n            hoverDelay={{ close: 0, open: 500 }}\n            isDisabled={isMenuOpen}\n            followCursor=\"initial\"\n            {...tooltipProps?.root}\n          >\n            <Tooltip.Trigger hasButtonWrapper {...tooltipProps?.trigger}>\n              {children}\n            </Tooltip.Trigger>\n            <Tooltip.Content {...tooltipProps?.content}>\n              {tooltipContent}\n            </Tooltip.Content>\n          </Tooltip>\n        )}\n      >\n        {itemElement}\n      </ConditionalWrap>\n      {hasChildren && (\n        <TreeViewContext.Provider value={childContextValue}>\n          <div\n            role=\"group\"\n            id={groupId}\n            hidden={!isExpanded}\n            style={{ '--tree-level': level - 1 } as React.CSSProperties}\n          >\n            {annotatedChildren}\n          </div>\n        </TreeViewContext.Provider>\n      )}\n    </>\n  );\n};\n\ntype SkeletonItemProps = {\n  /** The number of rows to render. */\n  rows?: number;\n};\n\n/**\n * A skeleton placeholder for tree items that are being loaded. Renders one or\n * more `Skeleton` rows at the current nesting depth. The element is\n * `aria-hidden` since it is purely a visual indicator and not interactive.\n *\n * Typically used inside a `TreeView.Item` that has `isLoading` set, to give\n * the user a visual hint that child items are being fetched.\n *\n * @example\n * ```tsx\n * <TreeView.Item title=\"Lazy folder\" hasChildren isLoading isExpanded>\n *   {isLoading && <TreeView.SkeletonItem rows={3} />}\n * </TreeView.Item>\n * ```\n */\nconst SkeletonItem = ({\n  rows = 1,\n  className,\n  style,\n  htmlAttributes,\n  ref,\n  ...restProps\n}: CommonProps<'div', SkeletonItemProps>) => {\n  const { level } = useContext(TreeViewContext);\n  return (\n    <div\n      ref={ref}\n      aria-hidden=\"true\"\n      className={classNames('ndl-tree-view-new-skeleton', className)}\n      style={{ '--tree-level': level - 1, ...style } as React.CSSProperties}\n      {...htmlAttributes}\n      {...restProps}\n    >\n      {Array.from({ length: rows }, (_unused, index) => (\n        <Skeleton key={index} height=\"18px\" width=\"100%\" />\n      ))}\n    </div>\n  );\n};\n\n/**\n * @remarks\n * Selection can be managed per item, with `isSelected` and `onSelectedChange`\n * on each `TreeView.Item`, or by the tree itself, by passing `selectedIds` (or\n * `defaultSelectedIds`) together with `onSelectedIdsChange`. When the tree\n * manages selection, every item needs an `id`, and each item's own\n * `isSelected` and `onSelectedChange` are ignored.\n *\n * The available selection modes are:\n *\n * - `single` — one item at a time. An unmodified click selects the clicked item and never clears it.\n * - `multiple` — multi-select with checkboxes. An unmodified click toggles an item, and `Shift` repeats that across a range without clearing anything outside it.\n * - `multiple-replace` — multi-select without checkboxes. An unmodified click selects only that item, `Cmd`/`Ctrl` toggles it and moves the anchor, and `Shift` extends from that anchor while retaining its selection snapshot. `Shift` + arrow extends the range.\n */\nconst TreeView = Object.assign(Root, { Item, SkeletonItem });\nexport { TreeView };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4QE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;;CA2hBA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;;CA+XA;CACA;CACA;CACA;CACA;;AAxnCF,MAAM,aAAa,KAAA;AAEnB,MAAM,8BAAkD,IAAI,IAAI;AAChE,MAAM,4BAAiC,IAAI,IAAI;AAC/C,MAAM,gBAA0B,CAAC;;;;;;;AAqBjC,SAAS,oBACP,cACe;CACf,IAAI,QAAA,eAAA;EACF,UAAU;EACV,WAAW;EACX,aAAa;CACV,GAAA,YACL;CACA,MAAM,4BAAY,IAAI,IAAgB;CACtC,OAAO;EACL,gBAAgB;EAChB,WAAW,YAAY;GACrB,QAAA,eAAA,eAAA,CAAA,GAAa,KAAA,GAAU,OAAQ;GAC/B,UAAU,SAAS,aAAa,SAAS,CAAC;EAC5C;EACA,YAAY,aAAa;GACvB,UAAU,IAAI,QAAQ;GACtB,aAAa;IACX,UAAU,OAAO,QAAQ;GAC3B;EACF;CACF;AACF;AAEA,MAAM,cAAc;CAClB,QAAQ;CACR,UAAU;CACV,QAAQ;AACV;AAEA,MAAM,kBAAkB,cAAoC;CAC1D,eAAe;CACf,OAAO;CACP,mBAAmB;CACnB,UAAU;CACV,cAAc;CACd,eAAe;CACf,cAAc;CACd,OAAO,oBAAoB;AAC7B,CAAC;;;;;AAMD,SAAS,mBACP,OACiB;CACjB,OAAO;E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