@dxos/react-ui-list 0.9.1-main.c7dcc2e112 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/index.mjs +628 -167
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +628 -167
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/aspects/useListDisclosure.d.ts +4 -4
- package/dist/types/src/aspects/useListDisclosure.d.ts.map +1 -1
- package/dist/types/src/aspects/useListNavigation.d.ts +9 -7
- package/dist/types/src/aspects/useListNavigation.d.ts.map +1 -1
- package/dist/types/src/aspects/useListSelection.d.ts +3 -3
- package/dist/types/src/aspects/useListSelection.d.ts.map +1 -1
- package/dist/types/src/components/Accordion/Accordion.d.ts +1 -1
- package/dist/types/src/components/Accordion/AccordionItem.d.ts +3 -1
- package/dist/types/src/components/Accordion/AccordionItem.d.ts.map +1 -1
- package/dist/types/src/components/Combobox/Combobox.d.ts +10 -3
- package/dist/types/src/components/Combobox/Combobox.d.ts.map +1 -1
- package/dist/types/src/components/DropIndicator/DropIndicator.d.ts +12 -0
- package/dist/types/src/components/DropIndicator/DropIndicator.d.ts.map +1 -0
- package/dist/types/src/components/DropIndicator/index.d.ts +2 -0
- package/dist/types/src/components/DropIndicator/index.d.ts.map +1 -0
- package/dist/types/src/components/Empty/Empty.d.ts +17 -0
- package/dist/types/src/components/Empty/Empty.d.ts.map +1 -0
- package/dist/types/src/components/Empty/Empty.stories.d.ts +18 -0
- package/dist/types/src/components/Empty/Empty.stories.d.ts.map +1 -0
- package/dist/types/src/components/Empty/index.d.ts +2 -0
- package/dist/types/src/components/Empty/index.d.ts.map +1 -0
- package/dist/types/src/components/List.theme.d.ts +193 -0
- package/dist/types/src/components/List.theme.d.ts.map +1 -0
- package/dist/types/src/components/Listbox/ListItemContent.d.ts +27 -0
- package/dist/types/src/components/Listbox/ListItemContent.d.ts.map +1 -0
- package/dist/types/src/components/Listbox/ListItemContent.stories.d.ts +24 -0
- package/dist/types/src/components/Listbox/ListItemContent.stories.d.ts.map +1 -0
- package/dist/types/src/components/Listbox/Listbox.d.ts +19 -2
- package/dist/types/src/components/Listbox/Listbox.d.ts.map +1 -1
- package/dist/types/src/components/Listbox/Listbox.stories.d.ts +4 -0
- package/dist/types/src/components/Listbox/Listbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/OrderedList/OrderedList.d.ts +1 -1
- package/dist/types/src/components/OrderedList/OrderedList.d.ts.map +1 -1
- package/dist/types/src/components/OrderedList/OrderedListItem.d.ts.map +1 -1
- package/dist/types/src/components/OrderedList/OrderedListRoot.d.ts +1 -1
- package/dist/types/src/components/OrderedList/OrderedListRoot.d.ts.map +1 -1
- package/dist/types/src/components/Picker/Picker.d.ts +12 -4
- package/dist/types/src/components/Picker/Picker.d.ts.map +1 -1
- package/dist/types/src/components/Picker/index.d.ts +1 -1
- package/dist/types/src/components/Picker/index.d.ts.map +1 -1
- package/dist/types/src/components/Tree/Tree.d.ts +1 -1
- package/dist/types/src/components/Tree/Tree.d.ts.map +1 -1
- package/dist/types/src/components/Tree/Tree.stories.d.ts +5 -2
- package/dist/types/src/components/Tree/Tree.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tree/TreeContext.d.ts +2 -0
- package/dist/types/src/components/Tree/TreeContext.d.ts.map +1 -1
- package/dist/types/src/components/Tree/TreeDropIndicator.d.ts +10 -0
- package/dist/types/src/components/Tree/TreeDropIndicator.d.ts.map +1 -0
- package/dist/types/src/components/Tree/TreeItem.d.ts.map +1 -1
- package/dist/types/src/components/Tree/testing.d.ts +4 -1
- package/dist/types/src/components/Tree/testing.d.ts.map +1 -1
- package/dist/types/src/components/Treegrid/Treegrid.d.ts +33 -0
- package/dist/types/src/components/Treegrid/Treegrid.d.ts.map +1 -0
- package/dist/types/src/components/Treegrid/Treegrid.stories.d.ts +11 -0
- package/dist/types/src/components/Treegrid/Treegrid.stories.d.ts.map +1 -0
- package/dist/types/src/components/Treegrid/Treegrid.theme.d.ts +37 -0
- package/dist/types/src/components/Treegrid/Treegrid.theme.d.ts.map +1 -0
- package/dist/types/src/components/Treegrid/index.d.ts +2 -0
- package/dist/types/src/components/Treegrid/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +3 -0
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +23 -22
- package/src/aspects/useListDisclosure.ts +8 -8
- package/src/aspects/useListNavigation.ts +9 -7
- package/src/aspects/useListSelection.ts +4 -4
- package/src/components/Accordion/AccordionItem.tsx +31 -13
- package/src/components/Combobox/Combobox.tsx +46 -38
- package/src/components/DropIndicator/DropIndicator.tsx +74 -0
- package/src/components/DropIndicator/index.ts +5 -0
- package/src/components/Empty/Empty.stories.tsx +37 -0
- package/src/components/Empty/Empty.tsx +41 -0
- package/src/components/Empty/index.ts +5 -0
- package/src/components/List.theme.ts +99 -0
- package/src/components/Listbox/ListItemContent.stories.tsx +41 -0
- package/src/components/Listbox/ListItemContent.tsx +49 -0
- package/src/components/Listbox/Listbox.stories.tsx +106 -7
- package/src/components/Listbox/Listbox.tsx +85 -42
- package/src/components/OrderedList/OrderedList.tsx +1 -1
- package/src/components/OrderedList/OrderedListItem.tsx +13 -13
- package/src/components/OrderedList/OrderedListRoot.tsx +6 -3
- package/src/components/Picker/Picker.tsx +25 -15
- package/src/components/Picker/index.ts +1 -1
- package/src/components/Tree/Tree.stories.tsx +39 -15
- package/src/components/Tree/Tree.tsx +13 -3
- package/src/components/Tree/TreeContext.tsx +2 -0
- package/src/components/Tree/TreeDropIndicator.tsx +72 -0
- package/src/components/Tree/TreeItem.tsx +43 -3
- package/src/components/Tree/TreeItemHeading.tsx +2 -2
- package/src/components/Tree/testing.ts +19 -14
- package/src/components/Treegrid/Treegrid.stories.tsx +132 -0
- package/src/components/Treegrid/Treegrid.theme.ts +38 -0
- package/src/components/Treegrid/Treegrid.tsx +187 -0
- package/src/components/Treegrid/index.ts +5 -0
- package/src/components/index.ts +3 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/aspects/useListDisclosure.ts", "../../../src/aspects/useListGrid.ts", "../../../src/aspects/useListNavigation.ts", "../../../src/aspects/useListSelection.ts", "../../../src/aspects/useReorder.ts", "../../../src/components/Accordion/AccordionItem.tsx", "../../../src/components/Accordion/AccordionRoot.tsx", "../../../src/components/Accordion/Accordion.tsx", "../../../src/components/Combobox/Combobox.tsx", "../../../src/components/Picker/Picker.tsx", "../../../src/components/Picker/context.ts", "../../../src/components/Listbox/Listbox.tsx", "../../../src/components/OrderedList/OrderedListItem.tsx", "../../../src/components/OrderedList/OrderedListRoot.tsx", "../../../src/components/OrderedList/OrderedList.tsx", "../../../src/components/Tree/Tree.tsx", "../../../src/components/Tree/TreeContext.tsx", "../../../src/components/Tree/TreeItem.tsx", "../../../src/components/Tree/helpers.ts", "../../../src/components/Tree/TreeItemHeading.tsx", "../../../src/components/Tree/TreeItemToggle.tsx", "../../../src/util/path.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport { type MouseEvent, useCallback, useEffect, useId, useRef, useState } from 'react';\n\nexport type ListDisclosureMode = 'single' | 'multi';\n\ntype SingleValue = string | undefined;\ntype MultiValue = ReadonlySet<string>;\n\ntype ValueFor<M extends ListDisclosureMode> = M extends 'single' ? SingleValue : MultiValue;\n\nexport type UseListDisclosureOptions<M extends ListDisclosureMode = ListDisclosureMode> = {\n mode: M;\n /** Controlled value: a single id (single mode) or a set of ids (multi mode). */\n value?: ValueFor<M>;\n defaultValue?: ValueFor<M>;\n /** Called whenever the disclosure value changes. */\n onValueChange?: (next: ValueFor<M>) => void;\n};\n\nexport type DisclosureItemBinding = {\n expanded: boolean;\n toggle: () => void;\n /** Stable id on the disclosure trigger; the controlled panel references it via aria-labelledby. */\n triggerId: string;\n /** Stable id on the controlled panel; the trigger references it via aria-controls. */\n panelId: string;\n /** Spread onto the trigger element (button, title row, …). */\n triggerProps: {\n id: string;\n 'aria-expanded': boolean;\n 'aria-controls': string;\n onClick: (event: MouseEvent) => void;\n };\n /** Spread onto the disclosed panel; carries role=region for SR navigation. */\n panelProps: {\n id: string;\n role: 'region';\n 'aria-labelledby': string;\n };\n};\n\nexport type UseListDisclosureReturn = {\n /** Return the disclosure binding for a single item by id. */\n bind: (id: string) => DisclosureItemBinding;\n};\n\nconst isMulti = (value: SingleValue | MultiValue): value is MultiValue => value instanceof Set;\n\n/**\n * Disclosure (open/close) aspect for list items. Owns single- or multi-expand state and\n * generates the trigger/panel ids needed for `aria-controls` / `aria-labelledby`. Pairs\n * with `useListGrid`'s expand-caret slot.\n *\n * `single` mode tracks one expanded id; expanding another collapses the previous (matches\n * the existing `OrderedList` behaviour).\n *\n * `multi` mode tracks a `Set<string>` of expanded ids; intended for `Tree` and other\n * multi-branch disclosure surfaces.\n *\n * Controlled-ness keys on `onValueChange` rather than on the value's presence so that\n * `undefined` (single mode) and the empty set (multi mode) remain valid \"nothing expanded\"\n * values. Radix's `useControllableState` (1.1.0) flips to uncontrolled when a controlled\n * value clears to `undefined`, then re-reads the stale internal state and fails to collapse —\n * a hand-rolled controller is the only correct option here.\n */\nexport const useListDisclosure: {\n <M extends ListDisclosureMode>(opts: UseListDisclosureOptions<M>): UseListDisclosureReturn;\n} = (opts) => {\n const { mode, value, defaultValue, onValueChange } = opts;\n const idPrefix = useId();\n\n // Latches whenever the consumer passes the `value` prop key, regardless of whether the\n // current value is `undefined`. A controlled single-expand parent (`expandedId: string | undefined`)\n // must be able to clear to undefined without the row falling back to stale internal state —\n // detecting controlled-ness by `value !== undefined` would misclassify \"controlled and currently\n // empty\" as uncontrolled.\n const wasControlledRef = useRef(Object.prototype.hasOwnProperty.call(opts, 'value'));\n if (Object.prototype.hasOwnProperty.call(opts, 'value')) {\n wasControlledRef.current = true;\n }\n const isControlled = wasControlledRef.current;\n\n const [internalValue, setInternalValue] = useState<SingleValue | MultiValue>(() => defaultValue);\n\n // Mirror the controlled prop into internal state so going uncontrolled in a later render\n // doesn't surface a stale internal value (and so consumers can read `internalValue`\n // uniformly regardless of mode).\n useEffect(() => {\n if (isControlled) {\n setInternalValue(value);\n }\n }, [isControlled, value]);\n\n const resolvedValue = isControlled ? value : internalValue;\n\n const isExpanded = useCallback(\n (id: string) => {\n if (mode === 'multi') {\n return isMulti(resolvedValue) && resolvedValue.has(id);\n }\n return resolvedValue === id;\n },\n [mode, resolvedValue],\n );\n\n const setExpanded = useCallback(\n (id: string, expanded: boolean) => {\n const computeNext = (): SingleValue | MultiValue => {\n if (mode === 'multi') {\n const current = isMulti(resolvedValue) ? resolvedValue : new Set<string>();\n const next = new Set(current);\n if (expanded) {\n next.add(id);\n } else {\n next.delete(id);\n }\n return next;\n }\n return expanded ? id : undefined;\n };\n const next = computeNext();\n if (!isControlled) {\n setInternalValue(next);\n }\n onValueChange?.(next as ValueFor<typeof mode>);\n },\n [mode, resolvedValue, isControlled, onValueChange],\n );\n\n const bind = useCallback(\n (id: string): DisclosureItemBinding => {\n const expanded = isExpanded(id);\n const triggerId = `${idPrefix}-${id}-trigger`;\n const panelId = `${idPrefix}-${id}-panel`;\n return {\n expanded,\n toggle: () => setExpanded(id, !expanded),\n triggerId,\n panelId,\n triggerProps: {\n id: triggerId,\n 'aria-expanded': expanded,\n 'aria-controls': panelId,\n onClick: () => setExpanded(id, !expanded),\n },\n panelProps: {\n id: panelId,\n role: 'region',\n 'aria-labelledby': triggerId,\n },\n };\n },\n [idPrefix, isExpanded, setExpanded],\n );\n\n return { bind };\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { type CSSProperties, useMemo } from 'react';\n\nexport type UseListGridOptions = {\n /**\n * Number of inline action slots between title and expand caret. Each slot is sized to\n * `var(--dx-rail-item)` so an `IconButton` lands on the same baseline as the trailing icon.\n */\n actionSlots?: number;\n /** Reserve an expand-caret slot at the end of the title row. */\n expandable?: boolean;\n /** Reserve a trailing-action slot outside the row's card (e.g. delete). */\n trailing?: boolean;\n};\n\nexport type UseListGridReturn = {\n /** Spread onto the outer row element to apply the grid template. */\n rowProps: { className: string; style: CSSProperties };\n};\n\n/**\n * Row layout aspect. Generates the CSS grid template that keeps drag handle, title,\n * inline actions, expand caret, and trailing icon co-aligned on the same line —\n * independent of whether the row body is expanded.\n *\n * Width tracks are `var(--dx-rail-item)` for icon-button slots and `1fr` for the\n * title, so every icon-shaped slot is the same width as `IconBlock` / `IconButton iconOnly`\n * and the line aligns without per-pixel adjustments.\n */\nexport const useListGrid = ({\n actionSlots = 0,\n expandable = false,\n trailing = false,\n}: UseListGridOptions = {}): UseListGridReturn => {\n // Grid columns: [handle] [title=1fr] [action × N] [expand?] [trailing?]\n // `items-start` keeps trailing/handle anchored to the row top so they don't shift\n // when the title-row card grows vertically (e.g. on expand).\n const gridTemplateColumns = useMemo(() => {\n const tracks = ['var(--dx-rail-item)', '1fr'];\n for (let index = 0; index < actionSlots; index++) {\n tracks.push('var(--dx-rail-item)');\n }\n if (expandable) {\n tracks.push('var(--dx-rail-item)');\n }\n if (trailing) {\n tracks.push('var(--dx-rail-item)');\n }\n return tracks.join(' ');\n }, [actionSlots, expandable, trailing]);\n\n return {\n rowProps: {\n className: 'grid items-start gap-1',\n style: { gridTemplateColumns },\n },\n };\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { type TabsterDOMAttribute, useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport { type FocusEvent, useCallback, useMemo } from 'react';\n\nexport type ListNavigationMode = 'list' | 'listbox' | 'grid';\n\nexport type UseListNavigationOptions = {\n /**\n * Determines the bundled ARIA role + keyboard wiring.\n *\n * - `list` — `role='list'` items are `role='listitem'`. Arrow keys move focus among\n * interactive descendants of the row (handles, buttons). No selection semantics.\n * - `listbox` — `role='listbox'` items are `role='option'`. Arrow keys move focus\n * between options; `memorizeCurrent` keeps the last-focused option when re-entering.\n * - `grid` — `role='grid'` items are `role='row'`. Two-axis arrow navigation.\n */\n mode: ListNavigationMode;\n /**\n * Override default axis. `list` and `listbox` default to `'vertical'`; `grid`\n * defaults to `'grid'` (two-axis). Set explicitly when a horizontal list is needed.\n */\n axis?: 'vertical' | 'horizontal' | 'grid' | 'grid-linear' | 'both';\n /**\n * Remember the last-focused item when re-entering the group. Defaults to `true`.\n * Only meaningful for `listbox` mode.\n */\n memorizeCurrent?: boolean;\n};\n\ntype ContainerRole = 'list' | 'listbox' | 'grid';\ntype ItemRole = 'listitem' | 'option' | 'row';\n\nexport type UseListNavigationReturn = {\n /**\n * Spread onto the container element to apply role + ARIA + Tabster attributes.\n * Also wires a focus-on-entry handler that redirects to the selected or first\n * focusable item — Tabster doesn't cover initial focus, only traversal.\n *\n * The shape is intentionally open — Tabster's `useArrowNavigationGroup` returns\n * `TabsterDOMAttribute` (one or more `data-tabster*` attributes that may be undefined\n * when the runtime is disabled), and the precise key set isn't part of Tabster's\n * stable contract.\n */\n containerProps: TabsterDOMAttribute & {\n role: ContainerRole;\n 'aria-orientation'?: 'vertical' | 'horizontal';\n onFocus: (event: FocusEvent<HTMLElement>) => void;\n };\n /**\n * Apply to each item. Returns role, tabIndex, and aria-disabled. Disabled options remain\n * focusable so screen readers can announce them, per WAI-ARIA listbox guidance.\n */\n itemProps: (opts?: { disabled?: boolean }) => {\n role: ItemRole;\n tabIndex: number;\n 'aria-disabled'?: true;\n };\n};\n\nconst containerRoleByMode: Record<ListNavigationMode, ContainerRole> = {\n list: 'list',\n listbox: 'listbox',\n grid: 'grid',\n};\n\nconst itemRoleByMode: Record<ListNavigationMode, ItemRole> = {\n list: 'listitem',\n listbox: 'option',\n grid: 'row',\n};\n\nconst defaultAxisByMode: Record<ListNavigationMode, 'vertical' | 'horizontal' | 'grid'> = {\n list: 'vertical',\n listbox: 'vertical',\n grid: 'grid',\n};\n\n/**\n * Find the focus-on-entry target inside a listbox container: the currently-selected\n * option, or the first non-disabled option. Used to give arrow-key navigation a\n * meaningful starting point when focus first lands on the listbox itself.\n */\nconst findListboxEntryTarget = (container: HTMLElement): HTMLElement | null => {\n return (\n container.querySelector<HTMLElement>('[role=\"option\"][aria-selected=\"true\"]:not([aria-disabled=\"true\"])') ??\n container.querySelector<HTMLElement>('[role=\"option\"]:not([aria-disabled=\"true\"])')\n );\n};\n\n/**\n * Keyboard navigation + ARIA role aspect for list-shaped surfaces. Wraps Tabster's\n * `useArrowNavigationGroup` with a `mode` that selects the appropriate role bundle\n * and adds a focus-on-entry redirect (Tabster handles traversal once focus is on a\n * child; first-entry is the consumer's responsibility).\n *\n * Canonical for all list-shaped surfaces (List, OrderedList, RowList, Tree,\n * Combobox.List, Mosaic.Stack). Non-list focus zones — e.g. Composer's multi-pane\n * chrome — should keep their own Tabster wiring (Focus.Group).\n */\nexport const useListNavigation = ({\n mode,\n axis,\n memorizeCurrent = true,\n}: UseListNavigationOptions): UseListNavigationReturn => {\n const tabsterAttrs = useArrowNavigationGroup({\n axis: axis ?? defaultAxisByMode[mode],\n memorizeCurrent,\n });\n\n const handleFocus = useCallback(\n (event: FocusEvent<HTMLElement>) => {\n if (event.target !== event.currentTarget) {\n // Focus is already on a descendant; Tabster handles traversal from here.\n return;\n }\n if (mode !== 'listbox') {\n return;\n }\n // First-time entry on the listbox itself: redirect focus into a meaningful child\n // so arrow keys have an immediate starting point.\n const target = findListboxEntryTarget(event.currentTarget);\n target?.focus();\n },\n [mode],\n );\n\n // `aria-orientation` only accepts 'vertical' or 'horizontal'. Tabster's `axis` permits\n // grid-shaped values too ('grid', 'grid-linear', 'both'); collapse those (and the grid mode\n // itself) so we never leak an invalid ARIA value into the DOM.\n const orientation: 'vertical' | 'horizontal' | undefined =\n mode === 'grid' ? undefined : axis === 'horizontal' ? 'horizontal' : 'vertical';\n\n const containerProps = useMemo(\n () => ({\n role: containerRoleByMode[mode],\n ...(orientation && { 'aria-orientation': orientation }),\n ...tabsterAttrs,\n onFocus: handleFocus,\n }),\n [mode, orientation, tabsterAttrs, handleFocus],\n );\n\n // Listbox items need tabIndex=0 so Tabster can focus them; list/grid items inherit\n // their tabIndex from their interactive descendants (button-shaped handles, links).\n const itemRole = itemRoleByMode[mode];\n const itemTabIndex = mode === 'listbox' ? 0 : -1;\n const itemProps = useCallback(\n ({ disabled }: { disabled?: boolean } = {}) => ({\n role: itemRole,\n tabIndex: itemTabIndex,\n ...(disabled && { 'aria-disabled': true as const }),\n }),\n [itemRole, itemTabIndex],\n );\n\n return { containerProps, itemProps };\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { type FocusEvent, type MouseEvent, useCallback, useEffect, useRef, useState } from 'react';\n\nexport type ListSelectionMode = 'single' | 'multi';\n\ntype SingleValue = string | undefined;\ntype MultiValue = ReadonlySet<string>;\n\ntype ValueFor<M extends ListSelectionMode> = M extends 'single' ? SingleValue : MultiValue;\n\nexport type UseListSelectionOptions<M extends ListSelectionMode = ListSelectionMode> = {\n mode: M;\n /** Controlled selected id (single mode) or set of ids (multi mode). */\n value?: ValueFor<M>;\n defaultValue?: ValueFor<M>;\n onValueChange?: (next: ValueFor<M>) => void;\n /**\n * Selection follows focus. Defaults to `true` for single-select (matches the WAI-ARIA\n * listbox pattern) and `false` for multi-select (focus and toggle are separate gestures).\n */\n followsFocus?: boolean;\n};\n\nexport type SelectionItemBinding = {\n selected: boolean;\n toggle: () => void;\n /** Spread onto the row element to bind click + focus + ARIA. */\n rowProps: {\n 'aria-selected': boolean;\n onClick: (event: MouseEvent) => void;\n onFocus?: (event: FocusEvent) => void;\n };\n};\n\nexport type UseListSelectionReturn = {\n bind: (id: string, opts?: { disabled?: boolean }) => SelectionItemBinding;\n};\n\nconst isMulti = (value: SingleValue | MultiValue): value is MultiValue => value instanceof Set;\n\n/**\n * Selection aspect for list-shaped surfaces. Owns single- or multi-select state with\n * controllable value semantics; emits `aria-selected` + click/focus handlers per row.\n *\n * `single` mode: at most one selected id, selection follows focus by default. Matches the\n * existing `RowList` behaviour and the WAI-ARIA listbox single-select pattern.\n *\n * `multi` mode: tracks a `Set<string>`. Selection does NOT follow focus by default — multi\n * select usually pairs with an explicit toggle affordance (checkbox or keyboard Space) rather\n * than implicit focus-tracking.\n */\nexport const useListSelection: {\n <M extends ListSelectionMode>(opts: UseListSelectionOptions<M>): UseListSelectionReturn;\n} = (opts) => {\n const { mode, value, defaultValue, onValueChange, followsFocus } = opts;\n\n // Latches whenever the consumer passes the `value` prop key (even as undefined). A controlled\n // single-select consumer (`selectedId: string | undefined`) must be able to clear to undefined\n // without the row falling back to stale internal state — Radix `useControllableState` (1.1.0)\n // mishandles that case, so we mirror useListDisclosure's hand-rolled controller here.\n const wasControlledRef = useRef(Object.prototype.hasOwnProperty.call(opts, 'value'));\n if (Object.prototype.hasOwnProperty.call(opts, 'value')) {\n wasControlledRef.current = true;\n }\n const isControlled = wasControlledRef.current;\n\n const [internalValue, setInternalValue] = useState<SingleValue | MultiValue>(() => defaultValue);\n\n useEffect(() => {\n if (isControlled) {\n setInternalValue(value);\n }\n }, [isControlled, value]);\n\n const resolvedValue = isControlled ? value : internalValue;\n const setResolvedValue = useCallback(\n (next: SingleValue | MultiValue) => {\n if (!isControlled) {\n setInternalValue(next);\n }\n onValueChange?.(next as ValueFor<typeof mode>);\n },\n [isControlled, onValueChange, mode],\n );\n\n const isSelected = useCallback(\n (id: string) => {\n if (mode === 'multi') {\n return isMulti(resolvedValue) && resolvedValue.has(id);\n }\n return resolvedValue === id;\n },\n [mode, resolvedValue],\n );\n\n const setSelected = useCallback(\n (id: string, selected: boolean) => {\n if (mode === 'multi') {\n const current = isMulti(resolvedValue) ? resolvedValue : new Set<string>();\n const next = new Set(current);\n if (selected) {\n next.add(id);\n } else {\n next.delete(id);\n }\n setResolvedValue(next);\n } else {\n setResolvedValue(selected ? id : undefined);\n }\n },\n [mode, resolvedValue, setResolvedValue],\n );\n\n const followFocusDefault = mode === 'single';\n const trackFocus = followsFocus ?? followFocusDefault;\n\n const bind = useCallback(\n (id: string, { disabled }: { disabled?: boolean } = {}): SelectionItemBinding => {\n const selected = isSelected(id);\n return {\n selected,\n toggle: () => {\n if (!disabled) {\n setSelected(id, mode === 'multi' ? !selected : true);\n }\n },\n rowProps: {\n 'aria-selected': selected,\n onClick: () => {\n if (disabled) {\n return;\n }\n setSelected(id, mode === 'multi' ? !selected : true);\n },\n ...(trackFocus && {\n onFocus: (event: FocusEvent) => {\n if (disabled || selected) {\n return;\n }\n // Selection follows focus only while navigating *between* options within the list.\n // Focus entering the list from outside (e.g. a popover auto-focusing on open) must\n // not change selection, or it would clobber the controlled value when entry focus\n // lands on a non-selected option. Detect entry via `relatedTarget`: a synthetic event\n // without DOM context (unit tests) falls through to the original follow-focus path.\n const container = event.currentTarget?.closest?.('[role=\"listbox\"],[role=\"list\"],[role=\"grid\"]');\n if (container && !container.contains(event.relatedTarget)) {\n return;\n }\n setSelected(id, true);\n },\n }),\n },\n };\n },\n [isSelected, mode, setSelected, trackFocus],\n );\n\n return { bind };\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { autoScrollForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/element';\nimport {\n type Edge,\n attachClosestEdge,\n extractClosestEdge,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { getReorderDestinationIndex } from '@atlaskit/pragmatic-drag-and-drop-hitbox/util/get-reorder-destination-index';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n type ElementDragPayload,\n draggable,\n dropTargetForElements,\n monitorForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\nimport { type ReactNode, type RefCallback, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\n/**\n * Internal payload key. We attach this to every draggable's data so the root monitor can\n * recognise drops that belong to its own list and ignore foreign payloads.\n */\nconst REORDER_LIST_KEY = '__dxosReorderListId';\n\nlet reorderListIdCounter = 0;\nconst allocateReorderListId = (): string => `reorder-${++reorderListIdCounter}`;\n\nexport type ReorderAxis = 'vertical' | 'horizontal';\n\nexport type ReorderItemState =\n | { type: 'idle' }\n | { type: 'preview'; container: HTMLElement }\n | { type: 'dragging' }\n | { type: 'dragging-over'; closestEdge: Edge | null };\n\nconst IDLE: ReorderItemState = { type: 'idle' };\n\nexport type UseReorderListOptions<T> = {\n /** Authoritative item list. Read on each drop to compute the new index. */\n items: readonly T[];\n /** Stable identifier per item. The monitor uses this to find source/target indices. */\n getId: (item: T) => string;\n /** Called with `(fromIndex, toIndex)` when a drop completes inside this list. */\n onMove: (fromIndex: number, toIndex: number) => void;\n /** Drop axis. Defaults to `'vertical'`. */\n axis?: ReorderAxis;\n /** When true, drag handles report as disabled. Defaults to false. */\n readonly?: boolean;\n /** Forwarded to pragmatic-dnd's `getInitialData` on each draggable. */\n getInitialData?: (item: T, index: number) => Record<string, unknown>;\n /** Overrides the default `canDrop` (which matches payloads tagged with this list's id). */\n canDrop?: (args: { source: ElementDragPayload }) => boolean;\n /** Renderer for a custom native drag preview. */\n getDragPreview?: (item: T) => ReactNode;\n};\n\nexport type ReorderActive<T> = { id: string; item: T; container: HTMLElement } | null;\n\n/**\n * Stable controller created by `useReorderList`. Item components consume it via\n * `useReorderItem(controller, id)`. The controller is reference-stable across renders.\n */\nexport type ReorderListController<T> = {\n /** Internal: list id; payload tagged with this is the only data the monitor accepts by default. */\n listId: string;\n /** Look up an item by id. Used by the item hook to bind pragmatic-dnd at register time. */\n getItem: (id: string) => { item: T; index: number } | null;\n /** Bind a row's pragmatic-dnd primitives. Idempotent; returns a cleanup function. */\n bindItem: (\n id: string,\n refs: { row: HTMLElement; handle: HTMLElement },\n onItemState: (state: ReorderItemState) => void,\n ) => () => void;\n};\n\nexport type UseReorderListReturn<T> = {\n controller: ReorderListController<T>;\n /** The currently-dragging item, or null. Used by global drag preview portals. */\n active: ReorderActive<T>;\n /** Same as `controller.listId`. Exposed for diagnostics. */\n listId: string;\n};\n\n/**\n * List-level reorder aspect. Spins up pragmatic-dnd's `monitorForElements` and produces a\n * stable controller that per-row hooks consume. Item registration + the per-item draggable /\n * drop-target wiring lives in `useReorderItem` so each row owns its own React state without\n * re-rendering siblings on hover.\n */\nexport const useReorderList = <T>({\n items,\n getId,\n onMove,\n axis = 'vertical',\n readonly = false,\n getInitialData,\n canDrop,\n getDragPreview,\n}: UseReorderListOptions<T>): UseReorderListReturn<T> => {\n const listIdRef = useRef<string | null>(null);\n if (!listIdRef.current) {\n listIdRef.current = allocateReorderListId();\n }\n const listId = listIdRef.current;\n\n // Stable refs to mutable inputs so the controller and the monitor effect don't tear down\n // on every render. The functions returned in `controller` read from these refs.\n const itemsRef = useRef(items);\n itemsRef.current = items;\n const getIdRef = useRef(getId);\n getIdRef.current = getId;\n const onMoveRef = useRef(onMove);\n onMoveRef.current = onMove;\n const canDropRef = useRef(canDrop);\n canDropRef.current = canDrop;\n const getInitialDataRef = useRef(getInitialData);\n getInitialDataRef.current = getInitialData;\n const getDragPreviewRef = useRef(getDragPreview);\n getDragPreviewRef.current = getDragPreview;\n const readonlyRef = useRef(readonly);\n readonlyRef.current = readonly;\n\n const [active, setActive] = useState<ReorderActive<T>>(null);\n\n const findIndex = useCallback((id: string): number => {\n return itemsRef.current.findIndex((item) => getIdRef.current(item) === id);\n }, []);\n\n const findIndexFromPayload = useCallback(\n (data: Record<string, unknown> | undefined): number => {\n if (!data || data[REORDER_LIST_KEY] !== listId) {\n return -1;\n }\n const id = data.id as string | undefined;\n return id ? findIndex(id) : -1;\n },\n [listId, findIndex],\n );\n\n // The list-level monitor watches drops belonging to this list and computes the destination\n // index using pragmatic-dnd's helper. Mounted once per list lifetime.\n useEffect(() => {\n return monitorForElements({\n canMonitor: ({ source }) => {\n if (canDropRef.current) {\n return canDropRef.current({ source });\n }\n return source.data[REORDER_LIST_KEY] === listId;\n },\n onDrop: ({ location, source }) => {\n const target = location.current.dropTargets[0];\n if (!target) {\n return;\n }\n const sourceIdx = findIndexFromPayload(source.data);\n const targetIdx = findIndexFromPayload(target.data);\n if (sourceIdx < 0 || targetIdx < 0) {\n return;\n }\n const destinationIndex = getReorderDestinationIndex({\n closestEdgeOfTarget: extractClosestEdge(target.data),\n startIndex: sourceIdx,\n indexOfTarget: targetIdx,\n axis,\n });\n onMoveRef.current(sourceIdx, destinationIndex);\n },\n });\n }, [listId, axis, findIndexFromPayload]);\n\n // The controller is reference-stable. Item-level hooks call `bindItem` to register their\n // DOM elements with pragmatic-dnd; `getItem` is the synchronous lookup used at bind time.\n const controller = useMemo<ReorderListController<T>>(\n () => ({\n listId,\n getItem: (id) => {\n const index = findIndex(id);\n if (index < 0) {\n return null;\n }\n return { item: itemsRef.current[index], index };\n },\n bindItem: (id, refs, onItemState) => {\n const lookup = () => {\n const index = findIndex(id);\n return { item: itemsRef.current[index], index };\n };\n const { item, index } = lookup();\n if (!item && index < 0) {\n return () => {};\n }\n const allowedEdges: Edge[] = axis === 'vertical' ? ['top', 'bottom'] : ['left', 'right'];\n return combine(\n draggable({\n element: refs.row,\n dragHandle: refs.handle,\n canDrag: () => !readonlyRef.current,\n getInitialData: () => {\n const current = lookup();\n return {\n [REORDER_LIST_KEY]: listId,\n id,\n ...(getInitialDataRef.current?.(current.item, current.index) ?? {}),\n };\n },\n onGenerateDragPreview: getDragPreviewRef.current\n ? ({ nativeSetDragImage, source }) => {\n const rect = source.element.getBoundingClientRect();\n setCustomNativeDragPreview({\n nativeSetDragImage,\n getOffset: ({ container }) => ({ x: 20, y: container.getBoundingClientRect().height / 2 }),\n render: ({ container }) => {\n container.style.width = `${rect.width}px`;\n onItemState({ type: 'preview', container });\n const current = lookup();\n setActive({ id, item: current.item, container });\n return () => {\n onItemState(IDLE);\n setActive(null);\n };\n },\n });\n }\n : undefined,\n onDragStart: () => {\n onItemState({ type: 'dragging' });\n const current = lookup();\n setActive({ id, item: current.item, container: refs.row });\n },\n onDrop: () => {\n onItemState(IDLE);\n setActive(null);\n },\n }),\n dropTargetForElements({\n element: refs.row,\n canDrop: ({ source }) => {\n if (source.element === refs.row) {\n return false;\n }\n if (canDropRef.current) {\n return canDropRef.current({ source });\n }\n return source.data[REORDER_LIST_KEY] === listId;\n },\n getData: ({ input }) =>\n attachClosestEdge({ [REORDER_LIST_KEY]: listId, id }, { element: refs.row, input, allowedEdges }),\n getIsSticky: () => true,\n onDragEnter: ({ self }) => {\n onItemState({ type: 'dragging-over', closestEdge: extractClosestEdge(self.data) });\n },\n onDrag: ({ self }) => {\n onItemState({ type: 'dragging-over', closestEdge: extractClosestEdge(self.data) });\n },\n onDragLeave: () => onItemState(IDLE),\n onDrop: () => onItemState(IDLE),\n }),\n );\n },\n }),\n [listId, axis, findIndex],\n );\n\n return { controller, active, listId };\n};\n\nexport type ReorderItemBinding = {\n rowRef: RefCallback<HTMLElement>;\n handleRef: RefCallback<HTMLElement>;\n state: ReorderItemState;\n isDragging: boolean;\n closestEdge: Edge | null;\n};\n\n/**\n * Per-row reorder hook. Owns the row's local state and registers the row's DOM elements\n * with the list controller once both `rowRef` and `handleRef` are attached. Unmounting (or\n * detaching either ref) tears down the registration.\n *\n * Called inside the item component, not in the parent's render loop — this is what keeps\n * us inside the rules of hooks.\n */\nexport const useReorderItem = <T>(controller: ReorderListController<T>, id: string): ReorderItemBinding => {\n const [state, setState] = useState<ReorderItemState>(IDLE);\n\n // Snapshot the attached DOM nodes between renders without disturbing the React tree. When\n // both refs have resolved we register with the list controller; either detaching triggers\n // cleanup so we never leak pragmatic-dnd bindings.\n const rowElement = useRef<HTMLElement | null>(null);\n const handleElement = useRef<HTMLElement | null>(null);\n const cleanupRef = useRef<(() => void) | null>(null);\n\n const tryRegister = useCallback(() => {\n if (!rowElement.current || !handleElement.current) {\n return;\n }\n cleanupRef.current?.();\n cleanupRef.current = controller.bindItem(id, { row: rowElement.current, handle: handleElement.current }, setState);\n }, [controller, id]);\n\n const teardown = useCallback(() => {\n cleanupRef.current?.();\n cleanupRef.current = null;\n setState(IDLE);\n }, []);\n\n // Re-register if the controller or id changes (e.g. items reorder identity-stable).\n useEffect(() => {\n tryRegister();\n return teardown;\n }, [tryRegister, teardown]);\n\n const rowRef = useCallback<RefCallback<HTMLElement>>(\n (node) => {\n rowElement.current = node;\n if (node) {\n tryRegister();\n } else {\n teardown();\n }\n },\n [tryRegister, teardown],\n );\n\n const handleRef = useCallback<RefCallback<HTMLElement>>(\n (node) => {\n handleElement.current = node;\n if (node && rowElement.current) {\n tryRegister();\n } else if (!node) {\n // Mirror rowRef: if either ref detaches, tear down pragmatic-dnd bindings so a\n // re-attaching handle creates a fresh registration rather than racing the old one.\n teardown();\n }\n },\n [tryRegister, teardown],\n );\n\n return {\n rowRef,\n handleRef,\n state,\n isDragging: state.type === 'dragging',\n closestEdge: state.type === 'dragging-over' ? state.closestEdge : null,\n };\n};\n\n/**\n * Wire pragmatic-dnd's auto-scroll on a scrollable container. While any pragmatic-dnd drag\n * is in flight, hovering near the edges of the registered element scrolls the container\n * automatically. Pair with `OrderedList.Viewport` (or any caller-owned ScrollArea) so long\n * lists can be reordered without manually scrolling first.\n *\n * `autoScrollForElements` is global — it activates on every drag regardless of which list\n * started it — so it's safe to register one element per scroll surface.\n *\n * Returns a callback ref so the registration fires as soon as the element attaches and the\n * cleanup fires when it detaches; React doesn't re-run effects on mutable `ref.current`\n * changes, so a plain `useEffect` on a `useRef` would miss late-mounting elements entirely.\n */\nexport const useReorderAutoScroll = (): RefCallback<HTMLElement> => {\n const cleanupRef = useRef<(() => void) | null>(null);\n return useCallback((node) => {\n cleanupRef.current?.();\n cleanupRef.current = node ? autoScrollForElements({ element: node }) : null;\n }, []);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as AccordionPrimitive from '@radix-ui/react-accordion';\nimport { createContext } from '@radix-ui/react-context';\nimport React, { type PropsWithChildren } from 'react';\n\nimport { Icon, type ThemedClassName } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\n// See `AccordionRoot.tsx` for the rationale on `ListItemRecord = any`.\ntype ListItemRecord = any;\nimport { useAccordionContext } from './AccordionRoot';\n\nconst ACCORDION_ITEM_NAME = 'AccordionItem';\n\ntype AccordionItemContext<T extends ListItemRecord> = {\n item: T;\n};\n\n// TODO(wittjosiah): This seems to be conflicting with something in the bundle.\n// Perhaps @radix-ui/react-accordion?\nexport const [AccordionItemProvider, useDxAccordionItemContext] =\n createContext<AccordionItemContext<any>>(ACCORDION_ITEM_NAME);\n\nexport type AccordionItemProps<T extends ListItemRecord> = ThemedClassName<PropsWithChildren<{ item: T }>>;\n\nexport const AccordionItem = <T extends ListItemRecord>({ children, classNames, item }: AccordionItemProps<T>) => {\n const { getId } = useAccordionContext(ACCORDION_ITEM_NAME);\n\n return (\n <AccordionItemProvider {...{ item }}>\n <AccordionPrimitive.Item value={getId(item)} className={mx('overflow-hidden', classNames)}>\n {children}\n </AccordionPrimitive.Item>\n </AccordionItemProvider>\n );\n};\n\nexport type AccordionItemHeaderProps = ThemedClassName<AccordionPrimitive.AccordionHeaderProps & { icon?: string }>;\n\nexport const AccordionItemHeader = ({ classNames, children, icon, ...props }: AccordionItemHeaderProps) => {\n return (\n <AccordionPrimitive.Header {...props} className={mx(classNames)}>\n {/* `justify-between` pins the toggle caret to the trailing edge of the row regardless of\n the header content's intrinsic width — so the affordance lives at a predictable\n right-end position. The content wrapper grabs the remaining space. */}\n <AccordionPrimitive.Trigger className='group flex items-center justify-between gap-2 p-2 dx-focus-ring-inset w-full text-start'>\n {icon && <Icon icon={icon} size={4} />}\n <span className='min-w-0 flex-1 truncate'>{children}</span>\n <Icon\n icon='ph--caret-right--regular'\n size={4}\n classNames='shrink-0 transition-transform duration-200 group-data-[state=open]:rotate-90'\n />\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n );\n};\n\nexport type AccordionItemBodyProps = ThemedClassName<PropsWithChildren>;\n\nexport const AccordionItemBody = ({ children, classNames }: AccordionItemBodyProps) => {\n return (\n <AccordionPrimitive.Content className='overflow-hidden data-[state=closed]:animate-slide-up data-[state=open]:animate-slide-down'>\n <div className={mx('p-2', classNames)}>{children}</div>\n </AccordionPrimitive.Content>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as AccordionPrimitive from '@radix-ui/react-accordion';\nimport { createContext } from '@radix-ui/react-context';\nimport React, { type ReactNode } from 'react';\n\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\n// Records flowing through this compound carry caller-defined shapes (any record with an\n// optional `id` is acceptable; `getId` defaults to reading `.id`). Typed as `any` so the\n// generic parameter remains the caller's source of truth.\ntype ListItemRecord = any;\n\ntype AccordionContext<T extends ListItemRecord> = {\n getId: (item: T) => string;\n};\n\nconst ACCORDION_NAME = 'Accordion';\n\nexport const [AccordionProvider, useAccordionContext] = createContext<AccordionContext<any>>(ACCORDION_NAME);\n\nexport type AccordionRendererProps<T extends ListItemRecord> = {\n items: T[];\n};\n\nconst defaultGetId = <T extends ListItemRecord>(item: T) => (item as any)?.id;\n\nexport type AccordionRootProps<T extends ListItemRecord> = ThemedClassName<\n {\n children?: (props: AccordionRendererProps<T>) => ReactNode;\n items?: T[];\n } & Partial<Pick<AccordionContext<T>, 'getId'>>\n>;\n\nexport const AccordionRoot = <T extends ListItemRecord>({\n classNames,\n items,\n getId = defaultGetId,\n children,\n value,\n defaultValue,\n onValueChange,\n}: AccordionRootProps<T> &\n Pick<AccordionPrimitive.AccordionMultipleProps, 'value' | 'defaultValue' | 'onValueChange'>) => {\n return (\n <AccordionProvider {...{ getId }}>\n <AccordionPrimitive.Root\n type='multiple'\n value={value}\n defaultValue={defaultValue}\n onValueChange={onValueChange}\n className={mx(classNames)}\n >\n {children?.({ items: items ?? [] })}\n </AccordionPrimitive.Root>\n </AccordionProvider>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { AccordionItem, AccordionItemBody, AccordionItemHeader } from './AccordionItem';\nimport { AccordionRoot } from './AccordionRoot';\n\n// TODO(burdon): Next iteration should be based on Radix UI Accordion:\n// https://www.radix-ui.com/primitives/docs/components/accordion\n// TODO(burdon): Support key navigation.\n\nexport const Accordion = {\n Root: AccordionRoot,\n Item: AccordionItem,\n ItemHeader: AccordionItemHeader,\n ItemBody: AccordionItemBody,\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\n// `Combobox` — popover-list with text input. Generic; no search-domain\n// dependencies. Built on `Picker` (this same package) for the\n// listbox-with-input pattern (registry, virtual highlight, keyboard\n// nav, the two performance-split contexts) and `Popover` from\n// `@dxos/react-ui` for the trigger/content/arrow.\n//\n// Filtering is the caller's responsibility — render only the matching\n// `<Combobox.Item>` children. For fuzzy / search-domain filtering,\n// pair with `useSearchListResults` from `@dxos/react-ui-search`.\n//\n// https://www.w3.org/WAI/ARIA/apg/patterns/combobox\n\nimport { createContext } from '@radix-ui/react-context';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport React, {\n type ComponentPropsWithoutRef,\n type ComponentPropsWithRef,\n type PropsWithChildren,\n forwardRef,\n useCallback,\n} from 'react';\n\nimport {\n Button,\n type ButtonProps,\n Icon,\n type IconProps,\n Popover,\n type PopoverArrowProps,\n type PopoverContentProps,\n type PopoverVirtualTriggerProps,\n ScrollArea,\n type ThemedClassName,\n useId,\n} from '@dxos/react-ui';\nimport { composable, composableProps } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\nimport { Picker, type PickerInputProps, type PickerItemProps } from '../Picker';\n\nconst COMBOBOX_NAME = 'Combobox';\nconst COMBOBOX_CONTENT_NAME = 'ComboboxContent';\nconst COMBOBOX_ITEM_NAME = 'ComboboxItem';\nconst COMBOBOX_TRIGGER_NAME = 'ComboboxTrigger';\n\n//\n// Context — open/value state shared with Trigger and Item.\n//\n\ntype ComboboxContextValue = {\n modalId: string;\n isCombobox: true;\n placeholder?: string;\n open: boolean;\n onOpenChange: (nextOpen: boolean) => void;\n value: string;\n onValueChange: (nextValue: string) => void;\n};\n\nconst [ComboboxProvider, useComboboxContext] = createContext<Partial<ComboboxContextValue>>(COMBOBOX_NAME, {});\n\n//\n// Root\n//\n\ntype ComboboxRootProps = PropsWithChildren<\n Partial<\n ComboboxContextValue & {\n modal: boolean;\n defaultOpen: boolean;\n defaultValue: string;\n placeholder: string;\n }\n >\n>;\n\nconst ComboboxRoot = ({\n children,\n modal,\n modalId: modalIdProp,\n open: openProp,\n defaultOpen,\n onOpenChange: propsOnOpenChange,\n value: valueProp,\n defaultValue,\n onValueChange: propsOnValueChange,\n placeholder,\n}: ComboboxRootProps) => {\n const modalId = useId(COMBOBOX_NAME, modalIdProp);\n const [open = false, onOpenChange] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: propsOnOpenChange,\n });\n const [value = '', onValueChange] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue,\n onChange: propsOnValueChange,\n });\n\n return (\n <Popover.Root open={open} onOpenChange={onOpenChange} modal={modal}>\n <ComboboxProvider\n isCombobox\n modalId={modalId}\n placeholder={placeholder}\n open={open}\n onOpenChange={onOpenChange}\n value={value}\n onValueChange={onValueChange}\n >\n {children}\n </ComboboxProvider>\n </Popover.Root>\n );\n};\n\n//\n// Content — Popover.Content + Picker.Root.\n//\n// Filtering is caller-driven: pass already-matching <Combobox.Item> children.\n//\n\ntype ComboboxContentProps = PopoverContentProps;\n\nconst ComboboxContent = composable<HTMLDivElement, ComboboxContentProps>(({ children, ...props }, forwardedRef) => {\n const { modalId } = useComboboxContext(COMBOBOX_CONTENT_NAME);\n\n return (\n <Popover.Content {...composableProps(props, { id: modalId })} ref={forwardedRef}>\n <Popover.Viewport classNames='w-(--radix-popover-trigger-width)'>\n <Picker.Root>{children}</Picker.Root>\n </Popover.Viewport>\n </Popover.Content>\n );\n});\n\nComboboxContent.displayName = COMBOBOX_CONTENT_NAME;\n\n//\n// Trigger — the button that opens the popover.\n//\n\ntype ComboboxTriggerProps = ButtonProps;\n\nconst ComboboxTrigger = forwardRef<HTMLButtonElement, ComboboxTriggerProps>(\n ({ children, onClick, ...props }, forwardedRef) => {\n const { modalId, open, onOpenChange, placeholder, value } = useComboboxContext(COMBOBOX_TRIGGER_NAME);\n const handleClick = useCallback(\n (event: Parameters<Exclude<ButtonProps['onClick'], undefined>>[0]) => {\n onClick?.(event);\n onOpenChange?.(true);\n },\n [onClick, onOpenChange],\n );\n\n return (\n <Popover.Trigger asChild>\n <Button\n {...props}\n role='combobox'\n aria-expanded={open}\n aria-controls={modalId}\n aria-haspopup='dialog'\n onClick={handleClick}\n ref={forwardedRef}\n >\n {children ?? (\n <>\n <span className={mx('font-normal text-start flex-1 min-w-0 truncate me-2', !value && 'text-subdued')}>\n {value || placeholder}\n </span>\n <Icon icon='ph--caret-down--bold' size={3} />\n </>\n )}\n </Button>\n </Popover.Trigger>\n );\n },\n);\n\nComboboxTrigger.displayName = COMBOBOX_TRIGGER_NAME;\n\n//\n// VirtualTrigger\n//\n\ntype ComboboxVirtualTriggerProps = PopoverVirtualTriggerProps;\n\nconst ComboboxVirtualTrigger = Popover.VirtualTrigger;\n\n//\n// Input — text input wired to Picker.Input. Caller controls value.\n//\n\ntype ComboboxInputProps = ThemedClassName<\n Omit<ComponentPropsWithRef<'input'>, 'value'> & Pick<PickerInputProps, 'value' | 'onValueChange'>\n>;\n\nconst ComboboxInput = forwardRef<HTMLInputElement, ComboboxInputProps>(({ classNames, ...props }, forwardedRef) => {\n return (\n <Picker.Input\n {...props}\n classNames={['m-form-chrome mb-0 w-[calc(100%-2*var(--spacing-form-chrome))]', classNames]}\n ref={forwardedRef}\n />\n );\n});\n\nComboboxInput.displayName = 'Combobox.Input';\n\n//\n// List — scroll wrapper around items.\n//\n\ntype ComboboxListProps = PropsWithChildren<{ classNames?: string | string[] }>;\n\nconst ComboboxList = forwardRef<HTMLDivElement, ComboboxListProps>(\n ({ classNames, children, ...props }, forwardedRef) => {\n return (\n <ScrollArea.Root\n {...composableProps(props, { classNames: ['py-form-chrome', classNames] })}\n role='listbox'\n centered\n padding\n thin\n ref={forwardedRef}\n >\n <ScrollArea.Viewport>{children}</ScrollArea.Viewport>\n </ScrollArea.Root>\n );\n },\n);\n\nComboboxList.displayName = 'Combobox.List';\n\n//\n// Item — wraps Picker.Item; commits value + closes popover on select.\n//\n\ntype ComboboxItemProps = ThemedClassName<\n PropsWithChildren<{\n /** Unique identifier. */\n value: string;\n /** Display label (used when `children` are not provided). */\n label?: string;\n /** Optional icon id (Phosphor) shown before the label. */\n icon?: string;\n /** Additional class names for the icon. */\n iconClassNames?: IconProps['classNames'];\n /** Show a check icon on the right (commonly used for confirming the picked item). */\n checked?: boolean;\n /** Suffix text after the label. */\n suffix?: string;\n /** Disabled. */\n disabled?: boolean;\n /** Caller-supplied select handler in addition to value-commit. */\n onSelect?: () => void;\n /** Whether to close the popover when this item is selected. Defaults to true. */\n closeOnSelect?: boolean;\n }>\n>;\n\nconst ComboboxItem = forwardRef<HTMLDivElement, ComboboxItemProps>(\n (\n {\n classNames,\n onSelect,\n value,\n label,\n icon,\n iconClassNames,\n checked,\n suffix,\n disabled,\n closeOnSelect = true,\n children,\n },\n forwardedRef,\n ) => {\n const { onValueChange, onOpenChange } = useComboboxContext(COMBOBOX_ITEM_NAME);\n const handleSelect = useCallback<NonNullable<PickerItemProps['onSelect']>>(() => {\n onSelect?.();\n if (value !== undefined) {\n onValueChange?.(value);\n }\n if (closeOnSelect) {\n onOpenChange?.(false);\n }\n }, [onSelect, onValueChange, onOpenChange, value, closeOnSelect]);\n\n return (\n <Picker.Item\n value={value}\n disabled={disabled}\n onSelect={handleSelect}\n ref={forwardedRef}\n classNames={[\n // Full width inside the viewport (no horizontal margin).\n // `px-3 py-1`, `cursor-pointer`, `select-none` and the\n // `dx-hover` / `dx-selected` pairing come from `Picker.Item`'s\n // defaults; we only add the row-shape (flex / icons + label)\n // and the disabled overrides on top.\n 'flex w-full gap-2 items-center',\n disabled && 'hover:bg-transparent data-[selected=true]:bg-transparent',\n classNames,\n ]}\n >\n {children ?? (\n <>\n {icon && <Icon icon={icon} classNames={iconClassNames} />}\n <span className='w-0 grow truncate'>{label}</span>\n {suffix && <span className='shrink-0 text-description'>{suffix}</span>}\n {checked && <Icon icon='ph--check--regular' />}\n </>\n )}\n </Picker.Item>\n );\n },\n);\n\nComboboxItem.displayName = COMBOBOX_ITEM_NAME;\n\n//\n// Arrow\n//\n\ntype ComboboxArrowProps = PopoverArrowProps;\n\nconst ComboboxArrow = Popover.Arrow;\n\n//\n// Empty — passthrough placeholder. No translation; caller supplies copy.\n//\n\ntype ComboboxEmptyProps = ThemedClassName<PropsWithChildren>;\n\nconst ComboboxEmpty = forwardRef<HTMLDivElement, ComboboxEmptyProps>(({ classNames, children }, forwardedRef) => {\n return (\n <div ref={forwardedRef} role='status' className={mx(classNames)}>\n {children}\n </div>\n );\n});\n\nComboboxEmpty.displayName = 'Combobox.Empty';\n\n//\n// Portal\n//\n\ntype ComboboxPortalProps = ComponentPropsWithoutRef<typeof Popover.Portal>;\n\nconst ComboboxPortal = Popover.Portal;\n\n//\n// Combobox\n//\n\nexport const Combobox = {\n Root: ComboboxRoot,\n Portal: ComboboxPortal,\n Content: ComboboxContent,\n Trigger: ComboboxTrigger,\n VirtualTrigger: ComboboxVirtualTrigger,\n Input: ComboboxInput,\n List: ComboboxList,\n Item: ComboboxItem,\n Arrow: ComboboxArrow,\n Empty: ComboboxEmpty,\n};\n\nexport type {\n ComboboxRootProps,\n ComboboxPortalProps,\n ComboboxContentProps,\n ComboboxTriggerProps,\n ComboboxVirtualTriggerProps,\n ComboboxInputProps,\n ComboboxListProps,\n ComboboxItemProps,\n ComboboxArrowProps,\n ComboboxEmptyProps,\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\n// `Picker` — generic listbox-with-input compound implementing the\n// WAI-ARIA combobox keyboard pattern. Search / filtering live one layer\n// up in `@dxos/react-ui-search`.\n//\n// The two contexts (Input / Item) are split so items don't re-render on\n// every keystroke and the input doesn't re-render on every (un)register.\n\nimport { Slot } from '@radix-ui/react-slot';\nimport React, {\n type ChangeEvent,\n type ComponentPropsWithRef,\n type ElementType,\n type KeyboardEvent,\n type MouseEvent as ReactMouseEvent,\n type PropsWithChildren,\n type ReactNode,\n forwardRef,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { type Density, type Elevation, Input, type ThemedClassName, useThemeContext } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\nimport {\n PickerInputContextProvider,\n PickerItemContextProvider,\n usePickerInputContext,\n usePickerItemContext,\n} from './context';\n\ntype ItemData = {\n element: HTMLElement;\n disabled?: boolean;\n onSelect?: () => void;\n};\n\n//\n// Root\n//\n\ntype PickerRootProps = PropsWithChildren<{}>;\n\nconst PickerRoot = ({ children }: PickerRootProps) => {\n const [selectedValue, setSelectedValue] = useState<string | undefined>(undefined);\n const itemsRef = useRef<Map<string, ItemData>>(new Map());\n // Bumped on every (un)register to retrigger auto-select.\n const [itemVersion, setItemVersion] = useState(0);\n\n // Auto-select first non-disabled item when the current selection is\n // gone or disabled.\n useEffect(() => {\n const current = selectedValue !== undefined ? itemsRef.current.get(selectedValue) : undefined;\n const isValid = current !== undefined && !current.disabled;\n if (!isValid && itemsRef.current.size > 0) {\n const entries = Array.from(itemsRef.current.entries()).filter(([, data]) => !data.disabled);\n if (entries.length > 0) {\n entries.sort(([, a], [, b]) => {\n const position = a.element.compareDocumentPosition(b.element);\n if (position & Node.DOCUMENT_POSITION_FOLLOWING) {\n return -1;\n }\n if (position & Node.DOCUMENT_POSITION_PRECEDING) {\n return 1;\n }\n return 0;\n });\n const firstValue = entries[0]?.[0];\n if (firstValue !== undefined && firstValue !== selectedValue) {\n setSelectedValue(firstValue);\n }\n } else if (selectedValue !== undefined) {\n setSelectedValue(undefined);\n }\n }\n }, [itemVersion, selectedValue]);\n\n const registerItem = useCallback(\n (value: string, element: HTMLElement | null, onSelect: (() => void) | undefined, disabled?: boolean) => {\n if (element) {\n itemsRef.current.set(value, { element, onSelect, disabled });\n setItemVersion((v) => v + 1);\n }\n },\n [],\n );\n\n const unregisterItem = useCallback((value: string) => {\n itemsRef.current.delete(value);\n setItemVersion((v) => v + 1);\n }, []);\n\n // DOM-order list of enabled item values.\n const getItemValues = useCallback(() => {\n return Array.from(itemsRef.current.entries())\n .filter(([, data]) => !data.disabled)\n .sort(([, a], [, b]) => {\n const position = a.element.compareDocumentPosition(b.element);\n return position & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : position & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;\n })\n .map(([value]) => value);\n }, []);\n\n const triggerSelect = useCallback(() => {\n if (selectedValue !== undefined) {\n const item = itemsRef.current.get(selectedValue);\n item?.onSelect?.();\n }\n }, [selectedValue]);\n\n // Stable values items subscribe to.\n const itemContextValue = useMemo(\n () => ({\n selectedValue,\n onSelectedValueChange: setSelectedValue,\n registerItem,\n unregisterItem,\n }),\n [selectedValue, registerItem, unregisterItem],\n );\n\n // Volatile values the input subscribes to (keyboard helpers).\n const inputContextValue = useMemo(\n () => ({\n selectedValue,\n onSelectedValueChange: setSelectedValue,\n getItemValues,\n triggerSelect,\n }),\n [selectedValue, getItemValues, triggerSelect],\n );\n\n return (\n <PickerInputContextProvider {...inputContextValue}>\n <PickerItemContextProvider {...itemContextValue}>{children}</PickerItemContextProvider>\n </PickerInputContextProvider>\n );\n};\n\nPickerRoot.displayName = 'Picker.Root';\n\n//\n// Input\n//\n\ntype InputVariant = 'default' | 'subdued';\n\ntype PickerInputProps = ThemedClassName<\n Omit<ComponentPropsWithRef<'input'>, 'value'> & {\n /** Controlled input value. Caller owns this — e.g. binds to query state. */\n value?: string;\n /** Called on every keystroke with the new input string. */\n onValueChange?: (value: string) => void;\n density?: Density;\n elevation?: Elevation;\n variant?: InputVariant;\n }\n>;\n\nconst PickerInput = forwardRef<HTMLInputElement, PickerInputProps>(\n ({ value, onValueChange, onChange, onKeyDown, autoFocus, ...props }, forwardedRef) => {\n const { hasIosKeyboard } = useThemeContext();\n const { selectedValue, onSelectedValueChange, getItemValues, triggerSelect } =\n usePickerInputContext('Picker.Input');\n\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n onValueChange?.(event.target.value);\n onChange?.(event);\n },\n [onValueChange, onChange],\n );\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLInputElement>) => {\n onKeyDown?.(event);\n if (event.defaultPrevented) {\n return;\n }\n const values = getItemValues();\n if (values.length === 0) {\n if (event.key === 'Escape') {\n onValueChange?.('');\n }\n return;\n }\n\n const currentIndex = selectedValue !== undefined ? values.indexOf(selectedValue) : -1;\n\n switch (event.key) {\n case 'ArrowDown': {\n event.preventDefault();\n const nextIndex = currentIndex === -1 ? 0 : Math.min(currentIndex + 1, values.length - 1);\n const nextValue = values[nextIndex];\n if (nextValue !== undefined) {\n onSelectedValueChange(nextValue);\n }\n break;\n }\n case 'ArrowUp': {\n event.preventDefault();\n const prevIndex = currentIndex === -1 ? values.length - 1 : Math.max(currentIndex - 1, 0);\n const prevValue = values[prevIndex];\n if (prevValue !== undefined) {\n onSelectedValueChange(prevValue);\n }\n break;\n }\n case 'Enter': {\n if (selectedValue !== undefined) {\n event.preventDefault();\n triggerSelect();\n }\n break;\n }\n case 'Home': {\n event.preventDefault();\n const firstValue = values[0];\n if (firstValue !== undefined) {\n onSelectedValueChange(firstValue);\n }\n break;\n }\n case 'End': {\n event.preventDefault();\n const lastValue = values[values.length - 1];\n if (lastValue !== undefined) {\n onSelectedValueChange(lastValue);\n }\n break;\n }\n case 'Escape': {\n event.preventDefault();\n if (selectedValue !== undefined) {\n onSelectedValueChange(undefined);\n } else {\n onValueChange?.('');\n }\n break;\n }\n }\n },\n [selectedValue, onSelectedValueChange, getItemValues, triggerSelect, onValueChange, onKeyDown],\n );\n\n // Only force-control when `value` is provided; otherwise leave the\n // input uncontrolled so it accepts keystrokes without `onValueChange`.\n return (\n <Input.Root>\n <Input.TextInput\n {...props}\n autoFocus={autoFocus && !hasIosKeyboard}\n {...(value !== undefined && { value })}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n ref={forwardedRef}\n />\n </Input.Root>\n );\n },\n);\n\nPickerInput.displayName = 'Picker.Input';\n\n//\n// Item\n//\n\ntype PickerItemProps = ThemedClassName<{\n /** Unique identifier; used by the registry and DOM-order traversal. */\n value: string;\n /** Callback when the item is committed (click, or Enter while highlighted). */\n onSelect?: () => void;\n /** Disable the item — registry-visible but not focusable, not navigable, not clickable. */\n disabled?: boolean;\n asChild?: boolean;\n children?: ReactNode;\n}>;\n\nconst PickerItem = forwardRef<HTMLDivElement, PickerItemProps>(\n ({ classNames, value, onSelect, disabled, asChild, children, ...props }, forwardedRef) => {\n const { selectedValue, onSelectedValueChange, registerItem, unregisterItem } = usePickerItemContext('Picker.Item');\n const internalRef = useRef<HTMLDivElement>(null);\n\n const isSelected = selectedValue === value && !disabled;\n\n useEffect(() => {\n const element = internalRef.current;\n if (element) {\n registerItem(value, element, onSelect, disabled);\n }\n return () => unregisterItem(value);\n }, [value, onSelect, disabled, registerItem, unregisterItem]);\n\n useEffect(() => {\n if (isSelected && internalRef.current) {\n internalRef.current.scrollIntoView({ block: 'nearest', behavior: 'smooth' });\n }\n }, [isSelected]);\n\n const handleClick = useCallback(() => {\n if (disabled) {\n return;\n }\n onSelectedValueChange(value);\n onSelect?.();\n }, [disabled, value, onSelectedValueChange, onSelect]);\n\n // Keep focus on `Picker.Input`: any `tabIndex` (incl. `-1`) would\n // steal focus on click and break the input's arrow-key handler.\n const handleMouseDown = useCallback((event: ReactMouseEvent<HTMLElement>) => {\n event.preventDefault();\n }, []);\n\n const Comp: ElementType = asChild ? Slot : 'div';\n\n // Padding follows `--gutter` to align with sibling `Column.Center`\n // content; falls back to `0.75rem` when not nested under `Column.Root`.\n return (\n <Comp\n {...props}\n ref={(node: HTMLDivElement | null) => {\n internalRef.current = node;\n if (typeof forwardedRef === 'function') {\n forwardedRef(node);\n } else if (forwardedRef) {\n forwardedRef.current = node;\n }\n }}\n role='option'\n aria-selected={isSelected}\n aria-disabled={disabled}\n data-selected={isSelected}\n data-disabled={disabled}\n data-value={value}\n // Browser focus stays on the input; highlight is via `aria-selected`.\n tabIndex={-1}\n className={mx(\n 'dx-hover dx-selected px-[var(--gutter,0.75rem)] py-1 cursor-pointer select-none',\n disabled && 'opacity-50 cursor-not-allowed',\n classNames,\n )}\n onMouseDown={handleMouseDown}\n onClick={handleClick}\n >\n {children}\n </Comp>\n );\n },\n);\n\nPickerItem.displayName = 'Picker.Item';\n\nexport const Picker = {\n Root: PickerRoot,\n Input: PickerInput,\n Item: PickerItem,\n};\n\nexport type { PickerRootProps, PickerInputProps, PickerItemProps };\n\nexport { usePickerInputContext, usePickerItemContext } from './context';\n", "//\n// Copyright 2026 DXOS.org\n//\n\n// Two contexts (Item / Input) instead of one — performance optimization\n// from the original SearchList: items don't subscribe to query / input\n// state, so typing in the input doesn't re-render every option.\n\nimport { createContext } from '@radix-ui/react-context';\n\n/** Stable: items subscribe to selection, registry. Doesn't change on query. */\nexport type PickerItemContextValue = {\n /** Currently highlighted item value (virtual; not browser focus). */\n selectedValue: string | undefined;\n /** Update the highlighted value (e.g. arrow keys, hover). */\n onSelectedValueChange: (value: string | undefined) => void;\n /** Register an item for keyboard nav + DOM-order traversal. */\n registerItem: (\n value: string,\n element: HTMLElement | null,\n onSelect: (() => void) | undefined,\n disabled?: boolean,\n ) => void;\n /** Unregister an item. */\n unregisterItem: (value: string) => void;\n};\n\n/** Volatile: input subscribes to selection + the input keyboard helpers. */\nexport type PickerInputContextValue = {\n /** Currently highlighted item value. */\n selectedValue: string | undefined;\n /** Update the highlighted value. */\n onSelectedValueChange: (value: string | undefined) => void;\n /** Get registered item values in DOM order (excludes disabled). */\n getItemValues: () => string[];\n /** Trigger the highlighted item's `onSelect`. */\n triggerSelect: () => void;\n};\n\nexport const [PickerItemContextProvider, usePickerItemContext] = createContext<PickerItemContextValue>('PickerItem');\n\nexport const [PickerInputContextProvider, usePickerInputContext] =\n createContext<PickerInputContextValue>('PickerInput');\n", "//\n// Copyright 2026 DXOS.org\n//\n\n// `Listbox` — single-select selectable list. Single canonical compound for the picker /\n// option-list pattern: full-pane (with `Listbox.Viewport` ScrollArea wrapper) and compact\n// popover (no Viewport) usage share the same shape and selection model.\n//\n// Compound shape (matches Radix Select / Toolbar / Tabs):\n//\n// <Listbox.Root value={…} onValueChange={…}>\n// {/* Viewport is optional — include for full-pane pickers, omit for popovers. */}\n// <Listbox.Viewport thin padding>\n// <Listbox.Content aria-label='Tools'>\n// <Listbox.Item id='a'>\n// <Listbox.ItemLabel>Alpha</Listbox.ItemLabel>\n// <Listbox.Indicator />\n// </Listbox.Item>\n// <Listbox.Item id='b'>…</Listbox.Item>\n// </Listbox.Content>\n// </Listbox.Viewport>\n// </Listbox.Root>\n//\n// - `Root` — headless context provider (no DOM). Owns the single-selection `value` model.\n// - `Viewport` — optional `ScrollArea.Root` + `ScrollArea.Viewport`. Always scrolls when\n// present. Forwards ScrollArea knobs (`thin`, `padding`, `centered`).\n// - `Content` — the `<ul role='listbox'>` holding the items. Applies the navigation aspect's\n// container props (Tabster arrow nav, focus-on-entry redirect, role + aria-orientation).\n// - `Item` — `<li role='option'>` with `aria-selected` on the selected row, paired with\n// `dx-selected` styling. See `ui-theme/src/css/components/selected.md`.\n// - `ItemLabel` — text helper that truncates and takes most of the row width.\n// - `Indicator` — optional checkmark icon next to the selected item (confirmatory, since\n// `dx-selected` already styles the row).\n//\n// Selection model: single-select (`value: string | undefined`). Selection follows focus,\n// so arrow keys + click both update it. Matches the codebase's existing\n// `useSelected(_, 'single')` convention from `@dxos/react-ui-attention`.\n//\n// What this layer deliberately does NOT do:\n// - Virtualization or drag-and-drop. Reach for `@dxos/react-ui-mosaic`.\n// - Multi-select. Future expansion — the aspect (`useListSelection`) already supports it.\n\nimport { createContext } from '@radix-ui/react-context';\nimport React, {\n type ComponentPropsWithRef,\n type FocusEvent,\n type ForwardedRef,\n type MouseEvent,\n type PropsWithChildren,\n forwardRef,\n useCallback,\n useMemo,\n} from 'react';\n\nimport { List, ListItem } from '@dxos/react-list';\nimport {\n Icon,\n type IconProps,\n ScrollArea,\n type ScrollAreaRootProps,\n type ThemedClassName,\n composable,\n composableProps,\n} from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\nimport {\n type SelectionItemBinding,\n type UseListSelectionReturn,\n useListNavigation,\n useListSelection,\n} from '../../aspects';\n\nconst LISTBOX_NAME = 'Listbox';\nconst LISTBOX_ROOT_NAME = 'Listbox.Root';\nconst LISTBOX_VIEWPORT_NAME = 'Listbox.Viewport';\nconst LISTBOX_CONTENT_NAME = 'Listbox.Content';\nconst LISTBOX_ITEM_NAME = 'Listbox.Item';\nconst LISTBOX_ITEM_LABEL_NAME = 'Listbox.ItemLabel';\nconst LISTBOX_INDICATOR_NAME = 'Listbox.Indicator';\n\n//\n// Contexts — plain Radix contexts (un-scoped). Scoped composition (nested Listboxes,\n// Combobox embeddings) is a future expansion; when needed, switch to `createContextScope`\n// and thread `__listboxScope` through every subcomponent's props in one focused PR.\n//\n\ntype ListboxContextValue = {\n /** Selection aspect binding factory; items consume their own bindings from this. */\n selection: UseListSelectionReturn;\n};\n\ntype ListboxItemContextValue = {\n id: string;\n selected: boolean;\n};\n\nconst [ListboxProvider, useListboxContext] = createContext<ListboxContextValue>(LISTBOX_NAME);\nconst [ListboxItemProvider, useListboxItemContext] = createContext<ListboxItemContextValue>(LISTBOX_ITEM_NAME);\n\n//\n// Root — headless context provider. Renders no DOM.\n//\n\ntype RootProps = PropsWithChildren<{\n /** Currently-selected option id (controlled). */\n value?: string;\n /** Initial selected option for uncontrolled mode. */\n defaultValue?: string;\n /**\n * Called when the user picks a different option (click, arrow keys, focus). Receives the\n * option's `id` prop. Selection cannot clear to `undefined` from the UI in single-select\n * mode (clicking an already-selected row is a no-op), so the callback always receives a\n * defined id.\n */\n onValueChange?: (value: string) => void;\n /** Reserved for parity with the prior `Listbox.Root`; focus-on-entry already covers most cases. */\n autoFocus?: boolean;\n}>;\n\nconst Root = ({ value, defaultValue, onValueChange, autoFocus: _autoFocus, children }: RootProps) => {\n // The selection aspect emits `string | undefined` because `useListSelection` is mode-\n // generic; in single-select the value only clears when the consumer drives it, never from\n // a row click. Filter to keep the public callback narrow.\n const selection = useListSelection({\n mode: 'single',\n value,\n defaultValue,\n onValueChange: (next) => {\n if (next !== undefined) {\n onValueChange?.(next);\n }\n },\n });\n\n const context = useMemo(() => ({ selection }), [selection]);\n\n return <ListboxProvider {...context}>{children}</ListboxProvider>;\n};\n\nRoot.displayName = LISTBOX_ROOT_NAME;\n\n//\n// Viewport — ScrollArea wrapper. Always scrolls; forwards ScrollArea knobs.\n//\n// Optional — popover/dialog consumers can skip it and provide their own scroll container.\n//\n\ntype ViewportProps = Pick<ScrollAreaRootProps, 'thin' | 'padding' | 'centered'>;\n\nconst Viewport = composable<HTMLDivElement, ViewportProps>((props, forwardedRef) => {\n const { thin, padding, centered, children, ...rest } = props as PropsWithChildren<\n ViewportProps & Record<string, unknown>\n >;\n return (\n <ScrollArea.Root\n {...composableProps<HTMLDivElement>(rest, { classNames: 'dx-container' })}\n {...{ thin, padding, centered }}\n orientation='vertical'\n ref={forwardedRef}\n >\n <ScrollArea.Viewport>{children}</ScrollArea.Viewport>\n </ScrollArea.Root>\n );\n});\n\nViewport.displayName = LISTBOX_VIEWPORT_NAME;\n\n//\n// Content — the listbox `<ul>` (Tabster arrow group + aria-label + role).\n//\n\ntype ContentProps = {\n /**\n * Accessible label for the listbox. Strongly recommended; assistive tech announces this\n * when focus enters the list.\n */\n 'aria-label'?: string;\n};\n\nconst Content = composable<HTMLUListElement, ContentProps>((props, forwardedRef) => {\n // Touch the context so Content fails loudly if used outside Root.\n useListboxContext(LISTBOX_CONTENT_NAME);\n\n // `useListNavigation` bundles role=listbox, aria-orientation, Tabster arrow nav, and the\n // focus-on-entry redirect (to selected, then first non-disabled option).\n const navigation = useListNavigation({ mode: 'listbox' });\n\n const { children, ...rest } = props as PropsWithChildren<ContentProps & Record<string, unknown>>;\n\n // We render via the primitive `<List>` so descendant `<ListItem>`s satisfy their Radix\n // context-scope check. The container's role/aria/Tabster wiring comes from the navigation\n // aspect rather than the primitive's `selectable` plumbing — that keeps the ARIA grammar\n // (`aria-selected`) owned by `Item` below.\n const composed = composableProps<HTMLUListElement>(rest, { classNames: 'flex flex-col' });\n return (\n <List\n variant='unordered'\n {...composed}\n {...navigation.containerProps}\n ref={forwardedRef as unknown as ForwardedRef<HTMLOListElement>}\n >\n {children}\n </List>\n );\n});\n\nContent.displayName = LISTBOX_CONTENT_NAME;\n\n//\n// Item — option row.\n//\n\ntype ItemProps = PropsWithChildren<{\n /** Stable identifier; matched against the parent's `value`. */\n id: string;\n /** Disable the row — focusable but doesn't update selection, dimmed. */\n disabled?: boolean;\n /** Optional click handler in addition to selection. */\n onClick?: (event: MouseEvent<HTMLLIElement>) => void;\n /** Optional focus handler in addition to selection-follows-focus. */\n onFocus?: (event: FocusEvent<HTMLLIElement>) => void;\n}>;\n\n// `dx-selected` pairs with `aria-selected=\"true\"` (set per-option below); see\n// `ui-theme/src/css/components/selected.md`.\nconst ITEM_BASE = 'flex items-center dx-hover dx-selected px-3 py-2 cursor-pointer outline-none';\n\nconst Item = composable<HTMLLIElement, ItemProps>((props, forwardedRef) => {\n const { id, disabled, onClick, onFocus, children, ...rest } = props as ItemProps & Record<string, unknown>;\n const { selection } = useListboxContext(LISTBOX_ITEM_NAME);\n const binding: SelectionItemBinding = selection.bind(id, { disabled });\n\n // Compose the selection aspect's click/focus handlers with the row's optional ones so\n // both wire-ups stay synchronized: selection happens before user code so a click that\n // also runs imperative side effects sees the selected value first.\n const handleClick = useCallback(\n (event: MouseEvent<HTMLLIElement>) => {\n binding.rowProps.onClick(event);\n if (!disabled) {\n onClick?.(event);\n }\n },\n [binding, disabled, onClick],\n );\n\n const handleFocus = useCallback(\n (event: FocusEvent<HTMLLIElement>) => {\n binding.rowProps.onFocus?.(event);\n onFocus?.(event);\n },\n [binding, onFocus],\n );\n\n const composed = composableProps<HTMLLIElement>(rest, {\n classNames: [ITEM_BASE, disabled && 'opacity-50 cursor-not-allowed'],\n });\n\n // Per WAI-ARIA APG listbox guidance, disabled options remain keyboard-navigable for SR\n // announcement; the selection model is not updated for disabled rows (the aspect's\n // binding enforces that internally).\n return (\n <ListItemProviderHost id={id} selected={binding.selected}>\n <ListItem\n {...composed}\n role='option'\n tabIndex={0}\n aria-selected={binding.selected}\n aria-disabled={disabled || undefined}\n onClick={handleClick}\n onFocus={handleFocus}\n ref={forwardedRef}\n >\n {children}\n </ListItem>\n </ListItemProviderHost>\n );\n});\n\nItem.displayName = LISTBOX_ITEM_NAME;\n\n/**\n * Publishes the item context so `Indicator` (and any future per-item descendant) can read\n * selection state without a second hook subscription. Tiny adapter — separated so `Item`'s\n * own composition stays a single component.\n */\nconst ListItemProviderHost = ({ id, selected, children }: PropsWithChildren<ListboxItemContextValue>) => (\n <ListboxItemProvider id={id} selected={selected}>\n {children}\n </ListboxItemProvider>\n);\n\n//\n// ItemLabel — text content for the item; grows and truncates.\n//\n\ntype ItemLabelProps = ThemedClassName<ComponentPropsWithRef<'span'>>;\n\nconst ItemLabel = forwardRef<HTMLSpanElement, ItemLabelProps>(({ classNames, children, ...rest }, forwardedRef) => (\n <span {...rest} className={mx('grow truncate', classNames)} ref={forwardedRef}>\n {children}\n </span>\n));\n\nItemLabel.displayName = LISTBOX_ITEM_LABEL_NAME;\n\n//\n// Indicator — checkmark icon for the selected item.\n//\n\ntype IndicatorProps = Omit<IconProps, 'icon'> & Partial<Pick<IconProps, 'icon'>>;\n\nconst Indicator = forwardRef<SVGSVGElement, IndicatorProps>(({ classNames, ...rootProps }, forwardedRef) => {\n const { selected } = useListboxItemContext(LISTBOX_INDICATOR_NAME);\n return (\n <Icon\n icon='ph--check--regular'\n {...rootProps}\n classNames={mx(!selected && 'invisible', classNames)}\n ref={forwardedRef}\n />\n );\n});\n\nIndicator.displayName = LISTBOX_INDICATOR_NAME;\n\n/**\n * Read selection state for a single id from inside any descendant of `<Listbox.Root>`.\n * Returns `true` when the row is currently selected. Lets composing components react to\n * selection without re-rendering on unrelated changes.\n */\nconst useListboxSelection = (id: string): boolean => {\n const { selection } = useListboxContext('useListboxSelection');\n return selection.bind(id).selected;\n};\n\n//\n// Public namespace.\n//\n\nconst Listbox = {\n Root,\n Viewport,\n Content,\n Item,\n ItemLabel,\n Indicator,\n};\n\nexport { Listbox, useListboxSelection };\nexport type {\n RootProps as ListboxRootProps,\n ViewportProps as ListboxViewportProps,\n ContentProps as ListboxContentProps,\n ItemProps as ListboxItemProps,\n ItemLabelProps as ListboxItemLabelProps,\n IndicatorProps as ListboxIndicatorProps,\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { createContext } from '@radix-ui/react-context';\nimport React, {\n type ComponentProps,\n type CSSProperties,\n type MouseEvent,\n type PropsWithChildren,\n type ReactNode,\n type RefCallback,\n useCallback,\n} from 'react';\n\nimport {\n IconBlock,\n IconButton,\n type IconButtonProps,\n ListItem as NaturalListItem,\n type ThemedClassName,\n ToggleIconButton,\n useTranslation,\n} from '@dxos/react-ui';\nimport { mx, osTranslations } from '@dxos/ui-theme';\n\nimport { useListGrid, useReorderItem } from '../../aspects';\nimport { type ListItemRecord, useOrderedListContext } from './OrderedListRoot';\n\nconst ORDERED_LIST_ITEM_NAME = 'OrderedListItem';\n\ntype OrderedListItemContextValue = {\n id: string;\n expanded: boolean;\n toggle: () => void;\n canDrag: boolean;\n handleRef: RefCallback<HTMLElement>;\n /** ARIA wiring for the controlled disclosure panel. */\n triggerProps: ReturnType<NonNullable<ReturnType<typeof useOrderedListContext>['disclosure']['bind']>>['triggerProps'];\n panelProps: ReturnType<NonNullable<ReturnType<typeof useOrderedListContext>['disclosure']['bind']>>['panelProps'];\n};\n\nconst [OrderedListItemProvider, useOrderedListItemContext] =\n createContext<OrderedListItemContextValue>(ORDERED_LIST_ITEM_NAME);\n\nexport type OrderedListItemProps<T extends ListItemRecord> = ThemedClassName<\n PropsWithChildren<{\n id: string;\n /** The record handed to the underlying reorder hook (kept for back-compat with callers). */\n item: T;\n /** Defaults to true; false disables the drag handle. */\n canDrag?: boolean;\n /** Apply the row-hover affordance. Defaults to false. */\n hover?: boolean;\n /**\n * Visually highlights the row as the \"currently active\" entry — sets `aria-current=\"true\"`\n * paired with `dx-current` styling. `aria-current` is the right grammar for an active row\n * inside a `list`-mode container (listbox/option semantics live on `Listbox`); used for\n * surfaces like the `Mixer` where the active layer needs visual highlight without\n * adopting listbox role semantics.\n */\n selected?: boolean;\n /** Optional click handler bound to the outer row element. */\n onClick?: (event: MouseEvent<HTMLDivElement>) => void;\n /** Inline style merged onto the outer element. Used for grid templates produced by `useListGrid`. */\n style?: CSSProperties;\n }>\n>;\n\n/**\n * A single reorderable item. Calls `useReorderItem` to wire pragmatic-dnd refs + state,\n * resolves disclosure state from the root context, and exposes both via item context for\n * the sub-components (`OrderedListDragHandle`, `OrderedListTitle`, `OrderedListExpandCaret`).\n *\n * The outer element applies only structural concerns (`relative` + state classes); the\n * layout (flex/grid) is controlled by the caller via `classNames` so master-detail rows\n * and bare reorderable rows can share the same component.\n */\nexport const OrderedListItem = <T extends ListItemRecord>({\n id,\n canDrag = true,\n hover = false,\n selected,\n onClick,\n classNames,\n style,\n children,\n}: OrderedListItemProps<T>) => {\n const { reorder, disclosure, navigation } = useOrderedListContext(ORDERED_LIST_ITEM_NAME);\n const { rowRef, handleRef, closestEdge, state } = useReorderItem(reorder, id);\n const { expanded, toggle, triggerProps, panelProps } = disclosure.bind(id);\n\n return (\n <OrderedListItemProvider\n id={id}\n expanded={expanded}\n toggle={toggle}\n canDrag={canDrag}\n handleRef={handleRef}\n triggerProps={triggerProps}\n panelProps={panelProps}\n >\n <div\n ref={rowRef as RefCallback<HTMLDivElement>}\n {...navigation.itemProps()}\n style={style}\n aria-current={selected || undefined}\n onClick={onClick}\n className={mx(\n 'relative dx-current',\n hover && 'dx-hover',\n state.type === 'dragging' && 'opacity-50',\n classNames,\n )}\n >\n {children}\n {closestEdge && <NaturalListItem.DropIndicator edge={closestEdge} />}\n </div>\n </OrderedListItemProvider>\n );\n};\n\n/**\n * Drag handle. Disabled when the list is readonly or the item opts out via `canDrag={false}`.\n * The button is the only element that initiates drag — pragmatic-dnd's `dragHandle:` option\n * scopes the source surface to this ref.\n */\nexport const OrderedListDragHandle = () => {\n const { readonly } = useOrderedListContext('OrderedListDragHandle');\n const { canDrag, handleRef } = useOrderedListItemContext('OrderedListDragHandle');\n const { t } = useTranslation(osTranslations);\n const disabled = readonly || !canDrag;\n return (\n <IconButton\n variant='ghost'\n disabled={disabled}\n noTooltip\n icon='ph--dots-six-vertical--regular'\n iconOnly\n label={t('drag-handle.label')}\n ref={handleRef as RefCallback<HTMLButtonElement>}\n />\n );\n};\n\n/**\n * Clickable title; clicking toggles the item's expanded state. Carries a stable id so the\n * expanded panel can name itself via `aria-labelledby`.\n */\nexport const OrderedListTitle = ({\n classNames,\n children,\n onClick,\n ...props\n}: ThemedClassName<PropsWithChildren<ComponentProps<'div'>>>) => {\n const { triggerProps } = useOrderedListItemContext('OrderedListTitle');\n const handleClick = useCallback(\n (event: MouseEvent<HTMLDivElement>) => {\n onClick?.(event);\n triggerProps.onClick(event);\n },\n [onClick, triggerProps],\n );\n return (\n <div\n {...props}\n // The title row is also the disclosure trigger, so it carries the trigger's\n // `id` + `aria-expanded` + `aria-controls` for assistive tech.\n id={triggerProps.id}\n aria-expanded={triggerProps['aria-expanded']}\n aria-controls={triggerProps['aria-controls']}\n className={mx('flex grow items-center truncate cursor-pointer', classNames)}\n onClick={handleClick}\n >\n {children}\n </div>\n );\n};\n\n/**\n * Generic action icon button. Anchored in a `var(--dx-rail-item)` IconBlock so it shares a\n * centerline with the title row regardless of expand state. Use for inline row actions\n * (mute, edit, copy, etc.); pair with `OrderedListDeleteButton` for the delete affordance.\n */\nexport const OrderedListIconButton = ({\n autoHide = false,\n disabled,\n classNames,\n ...props\n}: IconButtonProps & { autoHide?: boolean }) => (\n <IconBlock>\n <IconButton\n {...props}\n variant='ghost'\n iconOnly\n disabled={disabled}\n classNames={[classNames, autoHide && disabled && 'hidden']}\n />\n </IconBlock>\n);\n\n/**\n * Delete icon button. Anchored in a `var(--dx-rail-item)` IconBlock so it shares a centerline\n * with the title row regardless of expand state. No `my-[1px]` nudge: the central column's\n * outline is `ring-1` (see `OrderedListDetailItem`) so layout is exact.\n */\nexport const OrderedListDeleteButton = ({\n autoHide = false,\n icon = 'ph--x--regular',\n label,\n disabled,\n classNames,\n ...props\n}: Partial<Pick<IconButtonProps, 'icon'>> &\n Omit<IconButtonProps, 'icon' | 'label'> & { autoHide?: boolean; label?: string }) => {\n const { t } = useTranslation(osTranslations);\n return (\n <OrderedListIconButton\n {...props}\n autoHide={autoHide}\n disabled={disabled}\n icon={icon}\n label={label ?? t('delete.label')}\n classNames={classNames}\n />\n );\n};\n\n/**\n * Expand/collapse caret; reflects and toggles the item's expanded state via the disclosure\n * trigger's `aria-expanded` + `aria-controls`.\n */\nexport const OrderedListExpandCaret = ({ onClick, ...props }: Partial<IconButtonProps>) => {\n const { t } = useTranslation(osTranslations);\n const { expanded, toggle, triggerProps } = useOrderedListItemContext('OrderedListExpandCaret');\n const handleClick = useCallback(\n (event: MouseEvent<HTMLButtonElement>) => {\n toggle();\n onClick?.(event);\n },\n [toggle, onClick],\n );\n return (\n <ToggleIconButton\n iconOnly\n variant='ghost'\n active={expanded}\n icon='ph--caret-right--regular'\n label={t('toggle-expand.label')}\n // Disclosure semantics are carried here for AT users that interact with the caret\n // rather than the title.\n aria-expanded={triggerProps['aria-expanded']}\n aria-controls={triggerProps['aria-controls']}\n onClick={handleClick}\n {...props}\n />\n );\n};\n\nexport type OrderedListDetailItemProps<T extends ListItemRecord> = ThemedClassName<\n PropsWithChildren<{\n id: string;\n /** The record handed to the underlying reorder hook (kept for back-compat with callers). */\n item: T;\n /** Defaults to true; false disables the drag handle. */\n canDrag?: boolean;\n /** Title content shown in the clickable name row (clicking toggles expansion). */\n title: ReactNode;\n titleClassNames?: ThemedClassName<any>['classNames'];\n /** Inline actions placed in the name row before the expand caret (e.g. a visibility toggle). */\n actions?: ReactNode;\n /** Action(s) placed outside the bordered column, flanking it (e.g. a delete button). */\n trailing?: ReactNode;\n /** When false, hides the expand caret and detail panel. Defaults to true. */\n expandable?: boolean;\n }>\n>;\n\n/**\n * Master-detail row: a drag handle and trailing action flank a `ring-1`-outlined central\n * column whose title row (title + inline actions + expand caret) toggles an inline detail\n * panel (children).\n *\n * Outline uses `ring-1` (rendered as box-shadow) rather than `border` so the column's\n * content area is the full `var(--dx-rail-item)` height — handles, title, caret, and\n * trailing all sit on the same baseline without per-pixel nudges.\n */\nexport const OrderedListDetailItem = <T extends ListItemRecord>({\n id,\n item,\n canDrag,\n title,\n titleClassNames,\n actions,\n trailing,\n expandable = true,\n classNames,\n children,\n}: OrderedListDetailItemProps<T>) => {\n const grid = useListGrid({ trailing: !!trailing });\n return (\n <OrderedListItem\n id={id}\n item={item}\n canDrag={canDrag}\n // The grid template is inline so the row's three slots (handle / card / trailing)\n // land in fixed-width tracks that share a baseline with the title row inside the card.\n // See useListGrid for the rationale.\n style={grid.rowProps.style}\n classNames={mx(grid.rowProps.className, 'pb-1', classNames)}\n >\n <OrderedListDragHandle />\n <div className='flex flex-col ring-1 ring-subdued-separator rounded-sm overflow-hidden'>\n <div className='flex items-center min-h-[var(--dx-rail-item)]'>\n {expandable ? (\n <OrderedListTitle classNames={mx('px-2', titleClassNames)}>{title}</OrderedListTitle>\n ) : (\n // When the row is not expandable, render a plain (non-toggling) title so a click\n // doesn't mutate hidden disclosure state. Mirrors `OrderedListTitle`'s structure\n // minus the trigger plumbing.\n <div className={mx('flex grow items-center truncate px-2', titleClassNames)}>{title}</div>\n )}\n {actions}\n {expandable && <OrderedListExpandCaret />}\n </div>\n {expandable && <DetailPanel>{children}</DetailPanel>}\n </div>\n {trailing}\n </OrderedListItem>\n );\n};\n\n/**\n * Read-only panel renderer that consumes the item's disclosure state from context. Kept as\n * a small sub-component so the panel's `id` + `role=region` + `aria-labelledby` come from a\n * single source — and so a closed item doesn't pay for rendering an empty panel.\n */\nconst DetailPanel = ({ children }: PropsWithChildren) => {\n const { expanded, panelProps } = useOrderedListItemContext('OrderedListDetailItem.Panel');\n if (!expanded || !children) {\n return null;\n }\n return (\n <div {...panelProps} className='px-2 pb-2'>\n {children}\n </div>\n );\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { createContext } from '@radix-ui/react-context';\nimport React, { type PropsWithChildren, type ReactNode, useMemo } from 'react';\n\nimport {\n ScrollArea,\n type ScrollAreaRootProps,\n type ThemedClassName,\n composable,\n composableProps,\n} from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\nimport {\n type ReorderActive,\n type ReorderListController,\n type UseListNavigationReturn,\n type UseListDisclosureReturn,\n useListDisclosure,\n useListNavigation,\n useReorderAutoScroll,\n useReorderList,\n} from '../../aspects';\n\nexport type ListItemRecord = any;\n\nconst ORDERED_LIST_NAME = 'OrderedList';\n\ntype OrderedListContextValue<T extends ListItemRecord> = {\n reorder: ReorderListController<T>;\n disclosure: UseListDisclosureReturn;\n navigation: UseListNavigationReturn;\n readonly?: boolean;\n active: ReorderActive<T>;\n /**\n * Stable id accessor reused by items that want to look up their record (e.g. the\n * `OrderedListItem` <-> `useReorderItem` plumbing).\n */\n getId: (item: T) => string;\n};\n\nconst [OrderedListProvider, useOrderedListContext] = createContext<OrderedListContextValue<any>>(ORDERED_LIST_NAME);\n\nexport { useOrderedListContext };\n\nexport type OrderedListRootProps<T extends ListItemRecord> = ThemedClassName<{\n items: readonly T[];\n /**\n * Type guard reserved for backwards compatibility with the deprecated `List` API. The\n * aspect layer doesn't need it (payloads are scoped via the list's internal id) — values\n * passed here are currently ignored. Will be removed when call-sites migrate.\n */\n isItem?: (item: any) => boolean;\n /**\n * Stable id accessor. When omitted, the hook falls back to reference equality, which\n * breaks after a pragmatic-dnd round-trip serialises the payload — supply a `getId` for\n * any list whose items are plain values rather than ECHO refs.\n */\n getId?: (item: T) => string;\n onMove?: (fromIndex: number, toIndex: number) => void;\n readonly?: boolean;\n /** Controlled expanded item id (single-expand). */\n expandedId?: string;\n defaultExpandedId?: string;\n onExpandedChange?: (id: string | undefined) => void;\n children: (props: { items: readonly T[] }) => ReactNode;\n}>;\n\nconst defaultGetId = <T extends ListItemRecord>(item: T) => (item as any)?.id;\nconst noopMove = () => {};\n\n/**\n * Reorderable, single-expandable master-detail list. Wraps the aspect hooks:\n *\n * - `useReorderList` — drag-and-drop reorder via pragmatic-dnd.\n * - `useListDisclosure` (single mode) — single-expand state machine.\n * - `useListNavigation` (list mode) — Tabster keyboard nav across items.\n *\n * Owns the drag-handle / delete / expand-caret chrome plus expand state. Renders no DOM\n * itself; `OrderedListContent` is the container.\n */\nexport const OrderedListRoot = <T extends ListItemRecord>({\n items,\n getId = defaultGetId,\n onMove = noopMove,\n readonly,\n expandedId,\n defaultExpandedId,\n onExpandedChange,\n children,\n}: OrderedListRootProps<T>) => {\n const { controller, active } = useReorderList<T>({\n items,\n getId,\n onMove,\n readonly,\n });\n\n const disclosure = useListDisclosure({\n mode: 'single',\n value: expandedId,\n defaultValue: defaultExpandedId,\n onValueChange: (next) => onExpandedChange?.(next),\n });\n\n const navigation = useListNavigation({ mode: 'list' });\n\n // Memoise the context value so identity-stable items don't re-render on aspect re-renders\n // that don't affect their bindings (e.g. an unrelated drag-state change).\n const context = useMemo(\n () => ({\n reorder: controller,\n disclosure,\n navigation,\n readonly,\n active,\n getId,\n }),\n [controller, disclosure, navigation, readonly, active, getId],\n );\n\n return <OrderedListProvider {...context}>{children({ items })}</OrderedListProvider>;\n};\n\n/**\n * Container for the list. Applies the navigation aspect's `containerProps` so role,\n * aria-orientation, Tabster attributes, and focus-on-entry are wired in one place.\n */\nexport const OrderedListContent = ({ classNames, children }: ThemedClassName<PropsWithChildren>) => {\n const { navigation } = useOrderedListContext('OrderedList.Content');\n return (\n <div {...navigation.containerProps} className={mx('flex flex-col', classNames)}>\n {children}\n </div>\n );\n};\n\n/**\n * Optional ScrollArea wrapper for the list. Mirrors `Listbox.Viewport`. Include when the\n * list needs to fill a constrained pane and scroll independently; omit for static lists\n * that flow with their parent.\n *\n * Wires `useReorderAutoScroll` on the inner viewport so pragmatic-dnd auto-scrolls the\n * container when a drag hovers near its edges — long lists can be reordered without\n * scrolling manually first.\n */\ntype OrderedListViewportProps = Pick<ScrollAreaRootProps, 'thin' | 'padding' | 'centered'>;\n\nexport const OrderedListViewport = composable<HTMLDivElement, OrderedListViewportProps>((props, forwardedRef) => {\n const { thin, padding, centered, children, ...rest } = props as PropsWithChildren<\n OrderedListViewportProps & Record<string, unknown>\n >;\n // Callback ref so registration fires on attach and cleanup on detach — `useEffect` on a\n // ref object would miss the element entirely (ref mutations don't re-run effects).\n const autoScrollRef = useReorderAutoScroll();\n return (\n <ScrollArea.Root\n {...composableProps<HTMLDivElement>(rest, { classNames: 'dx-container' })}\n {...{ thin, padding, centered }}\n orientation='vertical'\n ref={forwardedRef}\n >\n <ScrollArea.Viewport ref={autoScrollRef}>{children}</ScrollArea.Viewport>\n </ScrollArea.Root>\n );\n});\n\nOrderedListViewport.displayName = 'OrderedList.Viewport';\n\nexport type { OrderedListViewportProps };\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport {\n OrderedListDeleteButton,\n OrderedListDetailItem,\n type OrderedListDetailItemProps,\n OrderedListDragHandle,\n OrderedListExpandCaret,\n OrderedListIconButton,\n OrderedListItem,\n type OrderedListItemProps,\n OrderedListTitle,\n} from './OrderedListItem';\nimport {\n OrderedListContent,\n OrderedListRoot,\n type OrderedListRootProps,\n OrderedListViewport,\n type OrderedListViewportProps,\n} from './OrderedListRoot';\n\n/**\n * Reorderable, single-expandable master-detail list.\n *\n * `DetailItem` encapsulates the common master-detail row (drag handle + bordered column with a\n * name row that toggles an inline detail panel + a trailing action). Compose the lower-level\n * `Item` / `DragHandle` / `Title` / `ExpandCaret` / `DeleteButton` directly for other layouts.\n *\n * @example\n * <OrderedList.Root items={…} isItem={…} getId={…} onMove={…} expandedId={…} onExpandedChange={…}>\n * {({ items }) => (\n * <OrderedList.Content>\n * {items.map((item) => (\n * <OrderedList.DetailItem\n * key={item.id}\n * id={item.id}\n * item={item}\n * title={item.label}\n * trailing={<OrderedList.DeleteButton onClick={…} />}\n * >\n * {detail}\n * </OrderedList.DetailItem>\n * ))}\n * </OrderedList.Content>\n * )}\n * </OrderedList.Root>\n */\nexport const OrderedList = {\n Root: OrderedListRoot,\n Viewport: OrderedListViewport,\n Content: OrderedListContent,\n Item: OrderedListItem,\n DetailItem: OrderedListDetailItem,\n DragHandle: OrderedListDragHandle,\n Title: OrderedListTitle,\n IconButton: OrderedListIconButton,\n DeleteButton: OrderedListDeleteButton,\n ExpandCaret: OrderedListExpandCaret,\n};\n\nexport type { OrderedListRootProps, OrderedListItemProps, OrderedListDetailItemProps, OrderedListViewportProps };\n", "//\n// Copyright 2024 DXOS.org\n\nimport { useAtomValue } from '@effect-atom/atom-react';\nimport React, { useMemo } from 'react';\n\nimport { Treegrid, type TreegridRootProps } from '@dxos/react-ui';\n\nimport { type TreeModel, TreeProvider } from './TreeContext';\nimport { TreeItemById, type TreeItemByIdProps, type TreeItemProps } from './TreeItem';\n\nexport type TreeProps<T extends { id: string } = any> = {\n model: TreeModel<T>;\n rootId?: string;\n path?: string[];\n id: string;\n} & Partial<Pick<TreegridRootProps, 'gridTemplateColumns' | 'classNames'>> &\n Pick<\n TreeItemProps<T>,\n | 'draggable'\n | 'renderColumns'\n | 'blockInstruction'\n | 'canDrop'\n | 'canSelect'\n | 'onOpenChange'\n | 'onSelect'\n | 'onItemHover'\n | 'levelOffset'\n >;\n\nexport const Tree = <T extends { id: string } = any>({\n classNames,\n model,\n rootId,\n path,\n id,\n draggable = false,\n gridTemplateColumns = '[tree-row-start] minmax(0, 1fr) min-content [tree-row-end]',\n levelOffset,\n renderColumns,\n blockInstruction,\n canDrop,\n canSelect,\n onOpenChange,\n onSelect,\n onItemHover,\n}: TreeProps<T>) => {\n const childIds = useAtomValue(model.childIds(rootId));\n const treePath = useMemo(() => (path ? [...path, id] : [id]), [id, path]);\n\n const childProps: Omit<TreeItemByIdProps, 'id' | 'last'> = {\n path: treePath,\n levelOffset,\n draggable,\n renderColumns,\n blockInstruction,\n canDrop,\n canSelect,\n onOpenChange,\n onSelect,\n onItemHover,\n };\n\n return (\n <Treegrid.Root gridTemplateColumns={gridTemplateColumns} classNames={classNames}>\n <TreeProvider value={model}>\n {childIds.map((childId, index) => (\n <TreeItemById key={childId} id={childId} last={index === childIds.length - 1} {...childProps} />\n ))}\n </TreeProvider>\n </Treegrid.Root>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { type Atom } from '@effect-atom/atom-react';\nimport { createContext, useContext } from 'react';\n\nimport { raise } from '@dxos/debug';\nimport { type Label } from '@dxos/react-ui';\n\nexport type TreeItemDataProps = {\n id: string;\n label: Label;\n parentOf?: string[];\n /** When `false`, the item cannot be dragged (overrides tree-level `draggable`). */\n draggable?: boolean;\n /** When `false`, the item does not participate as a drop target. */\n droppable?: boolean;\n className?: string;\n headingClassName?: string;\n icon?: string;\n iconHue?: string;\n disabled?: boolean;\n testId?: string;\n /** Optional item count rendered as a neutral badge directly after the label. */\n count?: number;\n /** Optional count of new/modified items; when greater than zero it shows as a rose badge in place of `count`. */\n modifiedCount?: number;\n};\n\nexport interface TreeModel<T extends { id: string } = any> {\n /** Atom family: resolve item by ID (content). */\n item: (id: string) => Atom.Atom<T | undefined>;\n /** Atom family: open state keyed by path. */\n itemOpen: (path: string[]) => Atom.Atom<boolean>;\n /** Atom family: current (selected) state keyed by path. */\n itemCurrent: (path: string[]) => Atom.Atom<boolean>;\n /** Atom family: display props for an item at a given path (path includes item's own ID at end). */\n itemProps: (path: string[]) => Atom.Atom<TreeItemDataProps>;\n /** Atom family: outbound child IDs for a parent ID (topology). Undefined = root. */\n childIds: (parentId?: string) => Atom.Atom<string[]>;\n}\n\nconst TreeContext = createContext<TreeModel | null>(null);\n\nexport const TreeProvider = TreeContext.Provider;\n\nexport const useTree = () => useContext(TreeContext) ?? raise(new Error('TreeContext not found'));\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport {\n type Instruction,\n type ItemMode,\n attachInstruction,\n extractInstruction,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport { draggable, dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { useAtomValue } from '@effect-atom/atom-react';\nimport * as Schema from 'effect/Schema';\nimport React, {\n type FC,\n type KeyboardEvent,\n type MouseEvent,\n memo,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { invariant } from '@dxos/invariant';\nimport { TreeItem as NaturalTreeItem, Treegrid, TREEGRID_PARENT_OF_SEPARATOR } from '@dxos/react-ui';\nimport {\n ghostFocusWithin,\n ghostHover,\n hoverableControls,\n hoverableFocusedKeyboardControls,\n hoverableFocusedWithinControls,\n mx,\n} from '@dxos/ui-theme';\n\nimport { DEFAULT_INDENTATION, paddingIndentation } from './helpers';\nimport { useTree } from './TreeContext';\nimport { TreeItemHeading } from './TreeItemHeading';\nimport { TreeItemToggle } from './TreeItemToggle';\n\nconst hoverableDescriptionIcons =\n '[--icons-color:inherit] hover-hover:[--icons-color:var(--description-text)] hover-hover:hover:[--icons-color:inherit] focus-within:[--icons-color:inherit]';\n\ntype TreeItemDragState = 'idle' | 'dragging' | 'preview' | 'parent-of-instruction';\n\nexport const TreeDataSchema = Schema.Struct({\n id: Schema.String,\n path: Schema.Array(Schema.String),\n item: Schema.Any,\n});\n\nexport type TreeData = Schema.Schema.Type<typeof TreeDataSchema>;\nexport const isTreeData = (data: unknown): data is TreeData => Schema.is(TreeDataSchema)(data);\n\nexport type ColumnRenderer<T extends { id: string } = any> = FC<{\n item: T;\n path: string[];\n open: boolean;\n menuOpen: boolean;\n setMenuOpen: (open: boolean) => void;\n}>;\n\nexport type TreeItemProps<T extends { id: string } = any> = {\n item: T;\n path: string[];\n levelOffset?: number;\n last: boolean;\n draggable?: boolean;\n renderColumns?: ColumnRenderer<T>;\n blockInstruction?: (params: { instruction: Instruction; source: TreeData; target: TreeData }) => boolean;\n canDrop?: (params: { source: TreeData; target: TreeData }) => boolean;\n canSelect?: (params: { item: T; path: string[] }) => boolean;\n onOpenChange?: (params: { item: T; path: string[]; open: boolean }) => void;\n onSelect?: (params: { item: T; path: string[]; current: boolean; option: boolean }) => void;\n onItemHover?: (params: { item: T }) => void;\n};\n\nconst RawTreeItem = <T extends { id: string } = any>({\n item,\n path: pathProp,\n levelOffset = 2,\n last,\n draggable: draggableProp,\n renderColumns: Columns,\n blockInstruction,\n canDrop,\n canSelect,\n onOpenChange,\n onSelect,\n onItemHover,\n}: TreeItemProps<T>) => {\n const rowRef = useRef<HTMLDivElement | null>(null);\n const buttonRef = useRef<HTMLButtonElement | null>(null);\n const openRef = useRef(false);\n const cancelExpandRef = useRef<NodeJS.Timeout | null>(null);\n const [_state, setState] = useState<TreeItemDragState>('idle');\n const [instruction, setInstruction] = useState<Instruction | null>(null);\n const [menuOpen, setMenuOpen] = useState(false);\n\n const {\n itemProps: itemPropsAtom,\n childIds: childIdsAtom,\n itemOpen: itemOpenAtom,\n itemCurrent: itemCurrentAtom,\n } = useTree();\n const path = useMemo(() => [...pathProp, item.id], [pathProp, item.id]);\n\n const {\n id,\n parentOf,\n draggable: itemDraggable,\n droppable: itemDroppable,\n label,\n className,\n headingClassName,\n icon,\n iconHue,\n disabled,\n testId,\n count,\n modifiedCount,\n } = useAtomValue(itemPropsAtom(path));\n const childIds = useAtomValue(childIdsAtom(item.id));\n const open = useAtomValue(itemOpenAtom(path));\n const current = useAtomValue(itemCurrentAtom(path));\n\n const level = path.length - levelOffset;\n const isBranch = !!parentOf;\n const mode: ItemMode = last ? 'last-in-group' : open ? 'expanded' : 'standard';\n const canSelectItem = canSelect?.({ item, path }) ?? true;\n const data = { id, path, item } satisfies TreeData;\n const shouldSeedNativeDragData = typeof document !== 'undefined' && document.body.hasAttribute('data-platform');\n\n const cancelExpand = useCallback(() => {\n if (cancelExpandRef.current) {\n clearTimeout(cancelExpandRef.current);\n cancelExpandRef.current = null;\n }\n }, []);\n\n const isItemDraggable = draggableProp && itemDraggable !== false;\n const isItemDroppable = itemDroppable !== false;\n const nativeDragText = id;\n\n useEffect(() => {\n if (!draggableProp) {\n return;\n }\n\n invariant(buttonRef.current);\n\n const makeDraggable = () =>\n draggable({\n element: buttonRef.current!,\n getInitialData: () => data,\n getInitialDataForExternal: () => {\n if (!shouldSeedNativeDragData) {\n return {};\n }\n return { 'text/plain': nativeDragText };\n },\n onDragStart: () => {\n setState('dragging');\n if (open) {\n openRef.current = true;\n onOpenChange?.({ item, path, open: false });\n }\n },\n onDrop: () => {\n setState('idle');\n if (openRef.current) {\n onOpenChange?.({ item, path, open: true });\n }\n },\n });\n\n if (!isItemDroppable) {\n return isItemDraggable ? makeDraggable() : undefined;\n }\n\n const dropTarget = dropTargetForElements({\n element: buttonRef.current,\n getData: ({ input, element }) => {\n return attachInstruction(data, {\n input,\n element,\n indentPerLevel: DEFAULT_INDENTATION,\n currentLevel: level,\n mode,\n block: isBranch ? [] : ['make-child'],\n });\n },\n canDrop: ({ source }) => {\n const _canDrop = canDrop ?? (() => true);\n return source.element !== buttonRef.current && _canDrop({ source: source.data as TreeData, target: data });\n },\n getIsSticky: () => true,\n onDrag: ({ self, source }) => {\n const desired = extractInstruction(self.data);\n const block =\n desired && blockInstruction?.({ instruction: desired, source: source.data as TreeData, target: data });\n const instruction: Instruction | null =\n block && desired.type !== 'instruction-blocked' ? { type: 'instruction-blocked', desired } : desired;\n\n if (source.data.id !== id) {\n if (instruction?.type === 'make-child' && isBranch && !open && !cancelExpandRef.current) {\n cancelExpandRef.current = setTimeout(() => {\n onOpenChange?.({ item, path, open: true });\n }, 500);\n }\n\n if (instruction?.type !== 'make-child') {\n cancelExpand();\n }\n\n setInstruction(instruction);\n } else if (instruction?.type === 'reparent') {\n // TODO(wittjosiah): This is not occurring in the current implementation.\n setInstruction(instruction);\n } else {\n setInstruction(null);\n }\n },\n onDragLeave: () => {\n cancelExpand();\n setInstruction(null);\n },\n onDrop: () => {\n cancelExpand();\n setInstruction(null);\n },\n });\n\n if (!isItemDraggable) {\n return dropTarget;\n }\n\n // https://atlassian.design/components/pragmatic-drag-and-drop/core-package/adapters/element/about\n return combine(makeDraggable(), dropTarget);\n }, [draggableProp, isItemDraggable, isItemDroppable, item, id, mode, path, open, blockInstruction, canDrop]);\n\n // Cancel expand on unmount.\n useEffect(() => () => cancelExpand(), [cancelExpand]);\n\n const handleOpenToggle = useCallback(\n () => onOpenChange?.({ item, path, open: !open }),\n [onOpenChange, item, path, open],\n );\n\n const handleSelect = useCallback(\n (option = false) => {\n // If the item is a branch, toggle it if:\n // - also holding down the option key\n // - or the item is currently selected\n if (isBranch && (option || current)) {\n handleOpenToggle();\n } else if (canSelectItem) {\n canSelect?.({ item, path });\n rowRef.current?.focus();\n onSelect?.({ item, path, current: !current, option });\n }\n },\n [item, path, current, isBranch, canSelectItem, handleOpenToggle, onSelect],\n );\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent) => {\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowLeft':\n isBranch && handleOpenToggle();\n break;\n }\n },\n [isBranch, open, handleOpenToggle, handleSelect],\n );\n\n const handleItemHover = useCallback(() => {\n onItemHover?.({ item });\n }, [onItemHover, item]);\n\n const handleContextMenu = useCallback(\n (event: MouseEvent) => {\n event.preventDefault();\n setMenuOpen(true);\n },\n [setMenuOpen],\n );\n\n const childProps = {\n draggable: draggableProp,\n renderColumns: Columns,\n blockInstruction,\n canDrop,\n canSelect,\n onItemHover,\n onOpenChange,\n onSelect,\n };\n\n return (\n <>\n <Treegrid.Row\n ref={rowRef}\n key={id}\n id={id}\n aria-labelledby={`${id}__label`}\n parentOf={parentOf?.join(TREEGRID_PARENT_OF_SEPARATOR)}\n data-object-id={id}\n data-testid={testId}\n // NOTE(thure): This is intentionally an empty string to for descendents to select by in the CSS\n // without alerting the user (except for in the correct link element). See also:\n // https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current#description\n aria-current={current ? ('' as 'page') : undefined}\n classNames={mx(\n 'grid grid-cols-subgrid col-[tree-row] mt-0.5 is-current:bg-current-surface',\n // Highlight the row while a descendant marks an open popover anchor (e.g. inline rename).\n 'has-[[data-popover-anchor]]:bg-current-surface',\n hoverableControls,\n hoverableFocusedKeyboardControls,\n hoverableFocusedWithinControls,\n hoverableDescriptionIcons,\n ghostFocusWithin,\n ghostHover,\n className,\n )}\n onKeyDown={handleKeyDown}\n onMouseEnter={handleItemHover}\n onContextMenu={handleContextMenu}\n >\n <div className='indent relative grid grid-cols-subgrid col-[tree-row]' style={paddingIndentation(level)}>\n <Treegrid.Cell classNames='flex items-center'>\n <TreeItemToggle isBranch={isBranch} open={open} onClick={handleOpenToggle} />\n <TreeItemHeading\n disabled={disabled}\n current={current}\n label={label}\n className={headingClassName}\n icon={icon}\n iconHue={iconHue}\n count={count}\n modifiedCount={modifiedCount}\n onSelect={handleSelect}\n ref={buttonRef}\n />\n </Treegrid.Cell>\n {Columns && <Columns item={item} path={path} open={open} menuOpen={menuOpen} setMenuOpen={setMenuOpen} />}\n {instruction && <NaturalTreeItem.DropIndicator instruction={instruction} gap={2} />}\n </div>\n </Treegrid.Row>\n {open &&\n childIds.map((childId, index) => (\n <TreeItemById key={childId} id={childId} path={path} last={index === childIds.length - 1} {...childProps} />\n ))}\n </>\n );\n};\n\nexport const TreeItem = memo(RawTreeItem) as FC<TreeItemProps>;\n\n/** Resolves a child ID to an item via the `item` atom and renders a TreeItem. */\nexport type TreeItemByIdProps = Omit<TreeItemProps, 'item'> & { id: string };\n\nconst RawTreeItemById = <T extends { id: string } = any>({ id, ...props }: TreeItemByIdProps) => {\n const { item: itemAtom } = useTree();\n const item = useAtomValue(itemAtom(id)) as T | undefined;\n if (!item) {\n return null;\n }\n return <TreeItem item={item} {...props} />;\n};\n\nexport const TreeItemById = memo(RawTreeItemById) as FC<TreeItemByIdProps>;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nexport const DEFAULT_INDENTATION = 8;\n\nexport const paddingIndentation = (level: number, indentation = DEFAULT_INDENTATION) => ({\n paddingInlineStart: `${(level - 1) * indentation}px`,\n});\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { type KeyboardEvent, type MouseEvent, forwardRef, memo, useCallback } from 'react';\n\nimport { Button, Icon, type Label, Tag, TextTooltip, toLocalizedString, useTranslation } from '@dxos/react-ui';\nimport { getStyles } from '@dxos/ui-theme';\n\n// TODO(wittjosiah): Consider whether there should be a separate disabled prop which was visually distinct\n// rather than just making the item unselectable.\nexport type TreeItemHeadingProps = {\n label: Label;\n className?: string;\n icon?: string;\n iconHue?: string;\n disabled?: boolean;\n current?: boolean;\n /** Optional item count rendered as a neutral badge directly after the label. */\n count?: number;\n /** Optional count of new/modified items; when greater than zero it replaces {@link count} with a rose badge. */\n modifiedCount?: number;\n onSelect?: (option: boolean) => void;\n};\n\nexport const TreeItemHeading = memo(\n forwardRef<HTMLButtonElement, TreeItemHeadingProps>(\n ({ label, className, icon, iconHue, disabled, current, count, modifiedCount, onSelect }, forwardedRef) => {\n const { t } = useTranslation();\n const styles = iconHue ? getStyles(iconHue) : undefined;\n\n const handleSelect = useCallback(\n (event: MouseEvent) => {\n onSelect?.(event.altKey);\n },\n [onSelect],\n );\n\n const handleButtonKeydown = useCallback(\n (event: KeyboardEvent) => {\n if (event.key === ' ' || event.key === 'Enter') {\n event.preventDefault();\n event.stopPropagation();\n onSelect?.(event.altKey);\n }\n },\n [onSelect],\n );\n\n return (\n <TextTooltip\n text={toLocalizedString(label, t)}\n side='bottom'\n truncateQuery='span[data-tooltip]'\n onlyWhenTruncating\n asChild\n ref={forwardedRef}\n >\n <Button\n data-testid='treeItem.heading'\n variant='ghost'\n classNames={[\n 'grow shrink min-w-0 justify-start gap-2 ps-0.5 hover:bg-transparent dark:hover:bg-transparent',\n 'disabled:cursor-default disabled:opacity-100',\n className,\n ]}\n disabled={disabled}\n onClick={handleSelect}\n onKeyDown={handleButtonKeydown}\n {...(current && { 'aria-current': 'location' })}\n >\n {icon && <Icon size={5} icon={icon ?? 'ph--circle-dashed--regular'} classNames={['my-1', styles?.text]} />}\n <span className='min-w-0 truncate text-start font-normal' data-tooltip>\n {toLocalizedString(label, t)}\n </span>\n <CountBadge count={count} modifiedCount={modifiedCount} />\n </Button>\n </TextTooltip>\n );\n },\n ),\n);\n\n/**\n * Renders the count badge after a tree item label.\n * A positive `modifiedCount` (e.g. new/unread items) shows as a rose badge in place of the neutral total `count`.\n */\nconst CountBadge = ({ count, modifiedCount }: Pick<TreeItemHeadingProps, 'count' | 'modifiedCount'>) => {\n if (typeof modifiedCount === 'number' && modifiedCount > 0) {\n return (\n <Tag palette='rose' classNames='shrink-0 text-center [min-inline-size:1.5rem] tabular-nums'>\n {modifiedCount}\n </Tag>\n );\n }\n\n if (typeof count === 'number') {\n return (\n <Tag palette='neutral' classNames='shrink-0 text-center [min-inline-size:1.5rem] tabular-nums'>\n {count}\n </Tag>\n );\n }\n\n return null;\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { forwardRef, memo } from 'react';\n\nimport { IconButton, type IconButtonProps } from '@dxos/react-ui';\n\nexport type TreeItemToggleProps = Omit<IconButtonProps, 'icon' | 'size' | 'label'> & {\n open?: boolean;\n isBranch?: boolean;\n hidden?: boolean;\n};\n\nexport const TreeItemToggle = memo(\n forwardRef<HTMLButtonElement, TreeItemToggleProps>(\n ({ classNames, open, isBranch, hidden, ...props }, forwardedRef) => {\n return (\n <IconButton\n ref={forwardedRef}\n data-testid='treeItem.toggle'\n aria-expanded={open}\n variant='ghost'\n density='md'\n classNames={[\n 'h-full w-6 px-0',\n '[&_svg]:transition-transform [&_svg]:duration-200',\n open ? '[&_svg]:rotate-90' : '[&_svg]:rotate-0',\n hidden ? 'hidden' : !isBranch && 'invisible',\n classNames,\n ]}\n size={3}\n icon='ph--caret-right--bold'\n iconOnly\n noTooltip\n label={open ? 'Click to close' : 'Click to open'}\n tabIndex={-1}\n {...props}\n />\n );\n },\n ),\n);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nconst SEPARATOR = '+';\n\nexport const Path = {\n create: (...args: string[]) => args.join(SEPARATOR),\n\n parts: (path: string) => path.split(SEPARATOR),\n length: (path: string) => path.split(SEPARATOR).length,\n first: (path: string) => path.split(SEPARATOR)[0] ?? path,\n last: (path: string) => path.split(SEPARATOR).at(-1) ?? path,\n parent: (path: string) => path.split(SEPARATOR).slice(0, -1).join(SEPARATOR),\n\n hasRoot: (path: string, id: string) => Path.first(path) === id,\n hasChild: (path: string, compare: string) => Path.parent(compare) === path,\n hasDescendent: (path: string, compare: string) => compare !== path && compare.startsWith(path),\n siblings: (path: string, compare: string) => Path.parent(path) === Path.parent(compare),\n onPath: (path: string, id: string) => Path.parts(path).includes(id),\n};\n"],
|
|
5
|
-
"mappings": ";;;AAIA,SAA0BA,aAAaC,WAAWC,OAAOC,QAAQC,gBAAgB;AA6CjF,IAAMC,UAAU,CAACC,UAAyDA,iBAAiBC;AAmBpF,IAAMC,oBAET,CAACC,SAAAA;AACH,QAAM,EAAEC,MAAMJ,OAAOK,cAAcC,cAAa,IAAKH;AACrD,QAAMI,WAAWX,MAAAA;AAOjB,QAAMY,mBAAmBX,OAAOY,OAAOC,UAAUC,eAAeC,KAAKT,MAAM,OAAA,CAAA;AAC3E,MAAIM,OAAOC,UAAUC,eAAeC,KAAKT,MAAM,OAAA,GAAU;AACvDK,qBAAiBK,UAAU;EAC7B;AACA,QAAMC,eAAeN,iBAAiBK;AAEtC,QAAM,CAACE,eAAeC,gBAAAA,IAAoBlB,SAAmC,MAAMO,YAAAA;AAKnFV,YAAU,MAAA;AACR,QAAImB,cAAc;AAChBE,uBAAiBhB,KAAAA;IACnB;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;EAEzCK,OAAO,CAACC,SAAiBA,KAAKC,MAAMP,SAAAA;EACpCQ,QAAQ,CAACF,SAAiBA,KAAKC,MAAMP,SAAAA,EAAWQ;EAChDC,OAAO,CAACH,SAAiBA,KAAKC,MAAMP,SAAAA,EAAW,CAAA,KAAMM;EACrDI,MAAM,CAACJ,SAAiBA,KAAKC,MAAMP,SAAAA,EAAWW,GAAG,EAAC,KAAML;EACxDM,QAAQ,CAACN,SAAiBA,KAAKC,MAAMP,SAAAA,EAAWa,MAAM,GAAG,EAAC,EAAGT,KAAKJ,SAAAA;EAElEc,SAAS,CAACR,MAAcS,OAAed,KAAKQ,MAAMH,IAAAA,MAAUS;EAC5DC,UAAU,CAACV,MAAcW,YAAoBhB,KAAKW,OAAOK,OAAAA,MAAaX;EACtEY,eAAe,CAACZ,MAAcW,YAAoBA,YAAYX,QAAQW,QAAQE,WAAWb,IAAAA;EACzFc,UAAU,CAACd,MAAcW,YAAoBhB,KAAKW,OAAON,IAAAA,MAAUL,KAAKW,OAAOK,OAAAA;EAC/EI,QAAQ,CAACf,MAAcS,OAAed,KAAKI,MAAMC,IAAAA,EAAMgB,SAASP,EAAAA;AAClE;",
|
|
6
|
-
"names": ["useCallback", "useEffect", "useId", "useRef", "useState", "isMulti", "value", "Set", "useListDisclosure", "opts", "mode", "defaultValue", "onValueChange", "idPrefix", "wasControlledRef", "Object", "prototype", "hasOwnProperty", "call", "current", "isControlled", "internalValue", "setInternalValue", "resolvedValue", "isExpanded", "id", "has", "setExpanded", "expanded", "computeNext", "next", "add", "delete", "undefined", "bind", "triggerId", "panelId", "toggle", "triggerProps", "onClick", "panelProps", "role", "useMemo", "useListGrid", "actionSlots", "expandable", "trailing", "gridTemplateColumns", "tracks", "index", "push", "join", "rowProps", "className", "style", "useArrowNavigationGroup", "useCallback", "useMemo", "containerRoleByMode", "list", "listbox", "grid", "itemRoleByMode", "defaultAxisByMode", "findListboxEntryTarget", "container", "querySelector", "useListNavigation", "mode", "axis", "memorizeCurrent", "tabsterAttrs", "handleFocus", "event", "target", "currentTarget", "focus", "orientation", "undefined", "containerProps", "role", "onFocus", "itemRole", "itemTabIndex", "itemProps", "disabled", "tabIndex", "useCallback", "useEffect", "useRef", "useState", "isMulti", "value", "Set", "useListSelection", "opts", "mode", "defaultValue", "onValueChange", "followsFocus", "wasControlledRef", "Object", "prototype", "hasOwnProperty", "call", "current", "isControlled", "internalValue", "setInternalValue", "resolvedValue", "setResolvedValue", "next", "isSelected", "id", "has", "setSelected", "selected", "add", "delete", "undefined", "followFocusDefault", "trackFocus", "bind", "disabled", "toggle", "rowProps", "onClick", "onFocus", "event", "container", "currentTarget", "closest", "contains", "relatedTarget", "autoScrollForElements", "attachClosestEdge", "extractClosestEdge", "getReorderDestinationIndex", "combine", "draggable", "dropTargetForElements", "monitorForElements", "setCustomNativeDragPreview", "useCallback", "useEffect", "useMemo", "useRef", "useState", "REORDER_LIST_KEY", "reorderListIdCounter", "allocateReorderListId", "IDLE", "type", "useReorderList", "items", "getId", "onMove", "axis", "readonly", "getInitialData", "canDrop", "getDragPreview", "listIdRef", "current", "listId", "itemsRef", "getIdRef", "onMoveRef", "canDropRef", "getInitialDataRef", "getDragPreviewRef", "readonlyRef", "active", "setActive", "findIndex", "id", "item", "findIndexFromPayload", "data", "canMonitor", "source", "onDrop", "location", "target", "dropTargets", "sourceIdx", "targetIdx", "destinationIndex", "closestEdgeOfTarget", "startIndex", "indexOfTarget", "controller", "getItem", "index", "bindItem", "refs", "onItemState", "lookup", "allowedEdges", "element", "row", "dragHandle", "handle", "canDrag", "onGenerateDragPreview", "nativeSetDragImage", "rect", "getBoundingClientRect", "getOffset", "container", "x", "y", "height", "render", "style", "width", "undefined", "onDragStart", "getData", "input", "getIsSticky", "onDragEnter", "self", "closestEdge", "onDrag", "onDragLeave", "useReorderItem", "state", "setState", "rowElement", "handleElement", "cleanupRef", "tryRegister", "teardown", "rowRef", "node", "handleRef", "isDragging", "useReorderAutoScroll", "AccordionPrimitive", "createContext", "React", "Icon", "mx", "AccordionPrimitive", "createContext", "React", "mx", "ACCORDION_NAME", "AccordionProvider", "useAccordionContext", "defaultGetId", "item", "id", "AccordionRoot", "classNames", "items", "getId", "children", "value", "defaultValue", "onValueChange", "Root", "type", "className", "ACCORDION_ITEM_NAME", "AccordionItemProvider", "useDxAccordionItemContext", "createContext", "AccordionItem", "children", "classNames", "item", "getId", "useAccordionContext", "React", "Item", "value", "className", "mx", "AccordionItemHeader", "icon", "props", "Header", "Trigger", "Icon", "size", "span", "AccordionItemBody", "Content", "div", "Accordion", "Root", "AccordionRoot", "Item", "AccordionItem", "ItemHeader", "AccordionItemHeader", "ItemBody", "AccordionItemBody", "createContext", "useControllableState", "React", "forwardRef", "useCallback", "Button", "Icon", "Popover", "ScrollArea", "useId", "composable", "composableProps", "mx", "Slot", "React", "forwardRef", "useCallback", "useEffect", "useMemo", "useRef", "useState", "Input", "useThemeContext", "mx", "createContext", "PickerItemContextProvider", "usePickerItemContext", "PickerInputContextProvider", "usePickerInputContext", "PickerRoot", "children", "selectedValue", "setSelectedValue", "useState", "undefined", "itemsRef", "useRef", "Map", "itemVersion", "setItemVersion", "useEffect", "current", "get", "isValid", "disabled", "size", "entries", "Array", "from", "filter", "data", "length", "sort", "a", "b", "position", "element", "compareDocumentPosition", "Node", "DOCUMENT_POSITION_FOLLOWING", "DOCUMENT_POSITION_PRECEDING", "firstValue", "registerItem", "useCallback", "value", "onSelect", "set", "v", "unregisterItem", "delete", "getItemValues", "map", "triggerSelect", "item", "itemContextValue", "useMemo", "onSelectedValueChange", "inputContextValue", "React", "PickerInputContextProvider", "PickerItemContextProvider", "displayName", "PickerInput", "forwardRef", "onValueChange", "onChange", "onKeyDown", "autoFocus", "props", "forwardedRef", "hasIosKeyboard", "useThemeContext", "usePickerInputContext", "handleChange", "event", "target", "handleKeyDown", "defaultPrevented", "values", "key", "currentIndex", "indexOf", "preventDefault", "nextIndex", "Math", "min", "nextValue", "prevIndex", "max", "prevValue", "lastValue", "Input", "Root", "TextInput", "ref", "PickerItem", "classNames", "asChild", "usePickerItemContext", "internalRef", "isSelected", "scrollIntoView", "block", "behavior", "handleClick", "handleMouseDown", "Comp", "Slot", "node", "role", "aria-selected", "aria-disabled", "data-selected", "data-disabled", "data-value", "tabIndex", "className", "mx", "onMouseDown", "onClick", "Picker", "Item", "COMBOBOX_NAME", "COMBOBOX_CONTENT_NAME", "COMBOBOX_ITEM_NAME", "COMBOBOX_TRIGGER_NAME", "ComboboxProvider", "useComboboxContext", "createContext", "ComboboxRoot", "children", "modal", "modalId", "modalIdProp", "open", "openProp", "defaultOpen", "onOpenChange", "propsOnOpenChange", "value", "valueProp", "defaultValue", "onValueChange", "propsOnValueChange", "placeholder", "useId", "useControllableState", "prop", "defaultProp", "onChange", "React", "Popover", "Root", "isCombobox", "ComboboxContent", "composable", "props", "forwardedRef", "Content", "composableProps", "id", "ref", "Viewport", "classNames", "Picker", "displayName", "ComboboxTrigger", "forwardRef", "onClick", "handleClick", "useCallback", "event", "Trigger", "asChild", "Button", "role", "aria-expanded", "aria-controls", "aria-haspopup", "span", "className", "mx", "Icon", "icon", "size", "ComboboxVirtualTrigger", "VirtualTrigger", "ComboboxInput", "Input", "ComboboxList", "ScrollArea", "centered", "padding", "thin", "ComboboxItem", "onSelect", "label", "iconClassNames", "checked", "suffix", "disabled", "closeOnSelect", "handleSelect", "undefined", "Item", "ComboboxArrow", "Arrow", "ComboboxEmpty", "div", "ComboboxPortal", "Portal", "Combobox", "List", "Empty", "createContext", "React", "forwardRef", "useCallback", "useMemo", "List", "ListItem", "Icon", "ScrollArea", "composable", "composableProps", "mx", "LISTBOX_NAME", "LISTBOX_ROOT_NAME", "LISTBOX_VIEWPORT_NAME", "LISTBOX_CONTENT_NAME", "LISTBOX_ITEM_NAME", "LISTBOX_ITEM_LABEL_NAME", "LISTBOX_INDICATOR_NAME", "ListboxProvider", "useListboxContext", "createContext", "ListboxItemProvider", "useListboxItemContext", "Root", "value", "defaultValue", "onValueChange", "autoFocus", "_autoFocus", "children", "selection", "useListSelection", "mode", "next", "undefined", "context", "useMemo", "React", "displayName", "Viewport", "composable", "props", "forwardedRef", "thin", "padding", "centered", "rest", "ScrollArea", "composableProps", "classNames", "orientation", "ref", "Content", "navigation", "useListNavigation", "composed", "List", "variant", "containerProps", "ITEM_BASE", "Item", "id", "disabled", "onClick", "onFocus", "binding", "bind", "handleClick", "useCallback", "event", "rowProps", "handleFocus", "ListItemProviderHost", "selected", "ListItem", "role", "tabIndex", "aria-selected", "aria-disabled", "ItemLabel", "forwardRef", "span", "className", "mx", "Indicator", "rootProps", "Icon", "icon", "useListboxSelection", "Listbox", "createContext", "React", "useCallback", "IconBlock", "IconButton", "ListItem", "NaturalListItem", "ToggleIconButton", "useTranslation", "mx", "osTranslations", "createContext", "React", "useMemo", "ScrollArea", "composable", "composableProps", "mx", "ORDERED_LIST_NAME", "OrderedListProvider", "useOrderedListContext", "createContext", "defaultGetId", "item", "id", "noopMove", "OrderedListRoot", "items", "getId", "onMove", "readonly", "expandedId", "defaultExpandedId", "onExpandedChange", "children", "controller", "active", "useReorderList", "disclosure", "useListDisclosure", "mode", "value", "defaultValue", "onValueChange", "next", "navigation", "useListNavigation", "context", "useMemo", "reorder", "React", "OrderedListProvider", "OrderedListContent", "classNames", "useOrderedListContext", "div", "containerProps", "className", "mx", "OrderedListViewport", "composable", "props", "forwardedRef", "thin", "padding", "centered", "rest", "autoScrollRef", "useReorderAutoScroll", "ScrollArea", "Root", "composableProps", "orientation", "ref", "Viewport", "displayName", "ORDERED_LIST_ITEM_NAME", "OrderedListItemProvider", "useOrderedListItemContext", "createContext", "OrderedListItem", "id", "canDrag", "hover", "selected", "onClick", "classNames", "style", "children", "reorder", "disclosure", "navigation", "useOrderedListContext", "rowRef", "handleRef", "closestEdge", "state", "useReorderItem", "expanded", "toggle", "triggerProps", "panelProps", "bind", "React", "div", "ref", "itemProps", "aria-current", "undefined", "className", "mx", "type", "NaturalListItem", "DropIndicator", "edge", "OrderedListDragHandle", "readonly", "t", "useTranslation", "osTranslations", "disabled", "IconButton", "variant", "noTooltip", "icon", "iconOnly", "label", "OrderedListTitle", "props", "handleClick", "useCallback", "event", "aria-expanded", "aria-controls", "OrderedListIconButton", "autoHide", "IconBlock", "OrderedListDeleteButton", "OrderedListExpandCaret", "ToggleIconButton", "active", "OrderedListDetailItem", "item", "title", "titleClassNames", "actions", "trailing", "expandable", "grid", "useListGrid", "rowProps", "DetailPanel", "OrderedList", "Root", "OrderedListRoot", "Viewport", "OrderedListViewport", "Content", "OrderedListContent", "Item", "OrderedListItem", "DetailItem", "OrderedListDetailItem", "DragHandle", "OrderedListDragHandle", "Title", "OrderedListTitle", "IconButton", "OrderedListIconButton", "DeleteButton", "OrderedListDeleteButton", "ExpandCaret", "OrderedListExpandCaret", "useAtomValue", "React", "useMemo", "Treegrid", "createContext", "useContext", "raise", "TreeContext", "TreeProvider", "Provider", "useTree", "Error", "attachInstruction", "extractInstruction", "combine", "draggable", "dropTargetForElements", "useAtomValue", "Schema", "React", "memo", "useCallback", "useEffect", "useMemo", "useRef", "useState", "invariant", "TreeItem", "NaturalTreeItem", "Treegrid", "TREEGRID_PARENT_OF_SEPARATOR", "ghostFocusWithin", "ghostHover", "hoverableControls", "hoverableFocusedKeyboardControls", "hoverableFocusedWithinControls", "mx", "DEFAULT_INDENTATION", "paddingIndentation", "level", "indentation", "paddingInlineStart", "React", "forwardRef", "memo", "useCallback", "Button", "Icon", "Tag", "TextTooltip", "toLocalizedString", "useTranslation", "getStyles", "TreeItemHeading", "label", "className", "icon", "iconHue", "disabled", "current", "count", "modifiedCount", "onSelect", "forwardedRef", "t", "styles", "undefined", "handleSelect", "event", "altKey", "handleButtonKeydown", "key", "preventDefault", "stopPropagation", "text", "side", "truncateQuery", "onlyWhenTruncating", "asChild", "ref", "data-testid", "variant", "classNames", "onClick", "onKeyDown", "size", "span", "data-tooltip", "CountBadge", "palette", "React", "forwardRef", "memo", "IconButton", "TreeItemToggle", "classNames", "open", "isBranch", "hidden", "props", "forwardedRef", "ref", "data-testid", "aria-expanded", "variant", "density", "size", "icon", "iconOnly", "noTooltip", "label", "tabIndex", "hoverableDescriptionIcons", "id", "path", "Schema", "item", "isTreeData", "rowRef", "buttonRef", "useRef", "openRef", "cancelExpandRef", "setState", "useState", "setInstruction", "menuOpen", "setMenuOpen", "itemPropsAtom", "childIds", "childIdsAtom", "useMemo", "pathProp", "open", "useAtomValue", "itemOpenAtom", "current", "itemCurrentAtom", "level", "levelOffset", "isBranch", "parentOf", "mode", "last", "canSelectItem", "nativeDragText", "useEffect", "draggableProp", "invariant", "element", "getInitialData", "draggable", "data", "getInitialDataForExternal", "shouldSeedNativeDragData", "onDragStart", "onOpenChange", "onDrop", "isItemDroppable", "dropTarget", "dropTargetForElements", "getData", "input", "attachInstruction", "indentPerLevel", "currentLevel", "block", "canDrop", "source", "target", "getIsSticky", "onDrag", "desired", "instruction", "onDragLeave", "blockInstruction", "useCallback", "canSelect", "onSelect", "option", "handleOpenToggle", "handleSelect", "onItemHover", "renderColumns", "Columns", "aria-labelledby", "data-object-id", "data-testid", "testId", "onKeyDown", "handleKeyDown", "onMouseEnter", "handleItemHover", "onContextMenu", "className", "paddingIndentation", "classNames", "React", "TreeItemToggle", "onClick", "disabled", "label", "icon", "iconHue", "count", "modifiedCount", "ref", "gap", "key", "childId", "useTree", "itemAtom", "Tree", "classNames", "model", "rootId", "path", "id", "draggable", "gridTemplateColumns", "levelOffset", "renderColumns", "blockInstruction", "canDrop", "canSelect", "onOpenChange", "onSelect", "onItemHover", "childIds", "useAtomValue", "treePath", "useMemo", "childProps", "React", "Treegrid", "Root", "TreeProvider", "value", "map", "childId", "index", "TreeItemById", "key", "last", "length", "SEPARATOR", "Path", "create", "args", "join", "parts", "path", "split", "length", "first", "last", "at", "parent", "slice", "hasRoot", "id", "hasChild", "compare", "hasDescendent", "startsWith", "siblings", "onPath", "includes"]
|
|
3
|
+
"sources": ["../../../src/aspects/useListDisclosure.ts", "../../../src/aspects/useListGrid.ts", "../../../src/aspects/useListNavigation.ts", "../../../src/aspects/useListSelection.ts", "../../../src/aspects/useReorder.ts", "../../../src/components/Accordion/AccordionItem.tsx", "../../../src/components/List.theme.ts", "../../../src/components/Accordion/AccordionRoot.tsx", "../../../src/components/Accordion/Accordion.tsx", "../../../src/components/Combobox/Combobox.tsx", "../../../src/components/Picker/Picker.tsx", "../../../src/components/Picker/context.ts", "../../../src/components/DropIndicator/DropIndicator.tsx", "../../../src/components/Empty/Empty.tsx", "../../../src/components/Listbox/Listbox.tsx", "../../../src/components/Listbox/ListItemContent.tsx", "../../../src/components/OrderedList/OrderedListItem.tsx", "../../../src/components/OrderedList/OrderedListRoot.tsx", "../../../src/components/OrderedList/OrderedList.tsx", "../../../src/components/Tree/Tree.tsx", "../../../src/components/Treegrid/Treegrid.tsx", "../../../src/components/Treegrid/Treegrid.theme.ts", "../../../src/components/Tree/TreeContext.tsx", "../../../src/components/Tree/TreeItem.tsx", "../../../src/components/Tree/helpers.ts", "../../../src/components/Tree/TreeDropIndicator.tsx", "../../../src/components/Tree/TreeItemHeading.tsx", "../../../src/components/Tree/TreeItemToggle.tsx", "../../../src/util/path.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport { type MouseEvent, useCallback, useEffect, useId, useRef, useState } from 'react';\n\nexport type ListDisclosureMode = 'single' | 'multi';\n\ntype SingleValue = string | undefined;\ntype MultiValue = ReadonlySet<string>;\n\ntype ValueFor<M extends ListDisclosureMode> = M extends 'single' ? SingleValue : MultiValue;\n\nexport type UseListDisclosureOptions<M extends ListDisclosureMode = ListDisclosureMode> = {\n mode: M;\n /** Controlled value: a single id (single mode) or a set of ids (multi mode). */\n value?: ValueFor<M>;\n defaultValue?: ValueFor<M>;\n /** Called whenever the disclosure value changes. */\n onValueChange?: (next: ValueFor<M>) => void;\n};\n\nexport type DisclosureItemBinding = {\n expanded: boolean;\n toggle: () => void;\n /** Stable id on the disclosure trigger; the controlled panel references it via aria-labelledby. */\n triggerId: string;\n /** Stable id on the controlled panel; the trigger references it via aria-controls. */\n panelId: string;\n /** Spread onto the trigger element (button, title row, …). */\n triggerProps: {\n 'id': string;\n 'aria-expanded': boolean;\n 'aria-controls': string;\n 'onClick': (event: MouseEvent) => void;\n };\n /** Spread onto the disclosed panel; carries role=region for SR navigation. */\n panelProps: {\n 'id': string;\n 'role': 'region';\n 'aria-labelledby': string;\n };\n};\n\nexport type UseListDisclosureReturn = {\n /** Return the disclosure binding for a single item by id. */\n bind: (id: string) => DisclosureItemBinding;\n};\n\nconst isMulti = (value: SingleValue | MultiValue): value is MultiValue => value instanceof Set;\n\n/**\n * Disclosure (open/close) aspect for list items. Owns single- or multi-expand state and\n * generates the trigger/panel ids needed for `aria-controls` / `aria-labelledby`. Pairs\n * with `useListGrid`'s expand-caret slot.\n *\n * `single` mode tracks one expanded id; expanding another collapses the previous (matches\n * the existing `OrderedList` behaviour).\n *\n * `multi` mode tracks a `Set<string>` of expanded ids; intended for `Tree` and other\n * multi-branch disclosure surfaces.\n *\n * Controlled-ness keys on `onValueChange` rather than on the value's presence so that\n * `undefined` (single mode) and the empty set (multi mode) remain valid \"nothing expanded\"\n * values. Radix's `useControllableState` (1.1.0) flips to uncontrolled when a controlled\n * value clears to `undefined`, then re-reads the stale internal state and fails to collapse —\n * a hand-rolled controller is the only correct option here.\n */\nexport const useListDisclosure: {\n <M extends ListDisclosureMode>(opts: UseListDisclosureOptions<M>): UseListDisclosureReturn;\n} = (opts) => {\n const { mode, value, defaultValue, onValueChange } = opts;\n const idPrefix = useId();\n\n // Latches whenever the consumer passes the `value` prop key, regardless of whether the\n // current value is `undefined`. A controlled single-expand parent (`expandedId: string | undefined`)\n // must be able to clear to undefined without the row falling back to stale internal state —\n // detecting controlled-ness by `value !== undefined` would misclassify \"controlled and currently\n // empty\" as uncontrolled.\n const wasControlledRef = useRef(Object.prototype.hasOwnProperty.call(opts, 'value'));\n if (Object.prototype.hasOwnProperty.call(opts, 'value')) {\n wasControlledRef.current = true;\n }\n const isControlled = wasControlledRef.current;\n\n const [internalValue, setInternalValue] = useState<SingleValue | MultiValue>(() => defaultValue);\n\n // Mirror the controlled prop into internal state so going uncontrolled in a later render\n // doesn't surface a stale internal value (and so consumers can read `internalValue`\n // uniformly regardless of mode).\n useEffect(() => {\n if (isControlled) {\n setInternalValue(value);\n }\n }, [isControlled, value]);\n\n const resolvedValue = isControlled ? value : internalValue;\n\n const isExpanded = useCallback(\n (id: string) => {\n if (mode === 'multi') {\n return isMulti(resolvedValue) && resolvedValue.has(id);\n }\n return resolvedValue === id;\n },\n [mode, resolvedValue],\n );\n\n const setExpanded = useCallback(\n (id: string, expanded: boolean) => {\n const computeNext = (): SingleValue | MultiValue => {\n if (mode === 'multi') {\n const current = isMulti(resolvedValue) ? resolvedValue : new Set<string>();\n const next = new Set(current);\n if (expanded) {\n next.add(id);\n } else {\n next.delete(id);\n }\n return next;\n }\n return expanded ? id : undefined;\n };\n const next = computeNext();\n if (!isControlled) {\n setInternalValue(next);\n }\n onValueChange?.(next as ValueFor<typeof mode>);\n },\n [mode, resolvedValue, isControlled, onValueChange],\n );\n\n const bind = useCallback(\n (id: string): DisclosureItemBinding => {\n const expanded = isExpanded(id);\n const triggerId = `${idPrefix}-${id}-trigger`;\n const panelId = `${idPrefix}-${id}-panel`;\n return {\n expanded,\n toggle: () => setExpanded(id, !expanded),\n triggerId,\n panelId,\n triggerProps: {\n 'id': triggerId,\n 'aria-expanded': expanded,\n 'aria-controls': panelId,\n 'onClick': () => setExpanded(id, !expanded),\n },\n panelProps: {\n 'id': panelId,\n 'role': 'region',\n 'aria-labelledby': triggerId,\n },\n };\n },\n [idPrefix, isExpanded, setExpanded],\n );\n\n return { bind };\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { type CSSProperties, useMemo } from 'react';\n\nexport type UseListGridOptions = {\n /**\n * Number of inline action slots between title and expand caret. Each slot is sized to\n * `var(--dx-rail-item)` so an `IconButton` lands on the same baseline as the trailing icon.\n */\n actionSlots?: number;\n /** Reserve an expand-caret slot at the end of the title row. */\n expandable?: boolean;\n /** Reserve a trailing-action slot outside the row's card (e.g. delete). */\n trailing?: boolean;\n};\n\nexport type UseListGridReturn = {\n /** Spread onto the outer row element to apply the grid template. */\n rowProps: { className: string; style: CSSProperties };\n};\n\n/**\n * Row layout aspect. Generates the CSS grid template that keeps drag handle, title,\n * inline actions, expand caret, and trailing icon co-aligned on the same line —\n * independent of whether the row body is expanded.\n *\n * Width tracks are `var(--dx-rail-item)` for icon-button slots and `1fr` for the\n * title, so every icon-shaped slot is the same width as `IconBlock` / `IconButton iconOnly`\n * and the line aligns without per-pixel adjustments.\n */\nexport const useListGrid = ({\n actionSlots = 0,\n expandable = false,\n trailing = false,\n}: UseListGridOptions = {}): UseListGridReturn => {\n // Grid columns: [handle] [title=1fr] [action × N] [expand?] [trailing?]\n // `items-start` keeps trailing/handle anchored to the row top so they don't shift\n // when the title-row card grows vertically (e.g. on expand).\n const gridTemplateColumns = useMemo(() => {\n const tracks = ['var(--dx-rail-item)', '1fr'];\n for (let index = 0; index < actionSlots; index++) {\n tracks.push('var(--dx-rail-item)');\n }\n if (expandable) {\n tracks.push('var(--dx-rail-item)');\n }\n if (trailing) {\n tracks.push('var(--dx-rail-item)');\n }\n return tracks.join(' ');\n }, [actionSlots, expandable, trailing]);\n\n return {\n rowProps: {\n className: 'grid items-start gap-1',\n style: { gridTemplateColumns },\n },\n };\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { type TabsterDOMAttribute, useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport { type FocusEvent, useCallback, useMemo } from 'react';\n\nexport type ListNavigationMode = 'list' | 'listbox' | 'grid';\n\nexport type UseListNavigationOptions = {\n /**\n * Determines the bundled ARIA role + keyboard wiring.\n *\n * - `list` — `role='list'` items are `role='listitem'`. Arrow keys move focus among\n * interactive descendants of the row (handles, buttons). No selection semantics.\n * - `listbox` — `role='listbox'` items are `role='option'`. Arrow keys move focus\n * between options; `memorizeCurrent` keeps the last-focused option when re-entering.\n * - `grid` — `role='grid'` items are `role='row'`. Two-axis arrow navigation.\n */\n mode: ListNavigationMode;\n /**\n * Override default axis. `list` and `listbox` default to `'vertical'`; `grid`\n * defaults to `'grid'` (two-axis). Set explicitly when a horizontal list is needed.\n */\n axis?: 'vertical' | 'horizontal' | 'grid' | 'grid-linear' | 'both';\n /**\n * Remember the last-focused item when re-entering the group. Defaults to `true`.\n * Only meaningful for `listbox` mode.\n */\n memorizeCurrent?: boolean;\n};\n\ntype ContainerRole = 'list' | 'listbox' | 'grid';\ntype ItemRole = 'listitem' | 'option' | 'row';\n\nexport type UseListNavigationReturn = {\n /**\n * Spread onto the container element to apply role + ARIA + Tabster attributes.\n * Also wires a focus-on-entry handler that redirects to the selected or first\n * focusable item — Tabster doesn't cover initial focus, only traversal.\n *\n * The shape is intentionally open — Tabster's `useArrowNavigationGroup` returns\n * `TabsterDOMAttribute` (one or more `data-tabster*` attributes that may be undefined\n * when the runtime is disabled), and the precise key set isn't part of Tabster's\n * stable contract.\n */\n containerProps: TabsterDOMAttribute & {\n 'role': ContainerRole;\n 'aria-orientation'?: 'vertical' | 'horizontal';\n 'onFocus': (event: FocusEvent<HTMLElement>) => void;\n };\n /**\n * Apply to each item. Returns role, tabIndex, and aria-disabled. Disabled options remain\n * focusable so screen readers can announce them, per WAI-ARIA listbox guidance.\n */\n itemProps: (opts?: { disabled?: boolean }) => {\n 'role': ItemRole;\n 'tabIndex': number;\n 'aria-disabled'?: true;\n };\n};\n\nconst containerRoleByMode: Record<ListNavigationMode, ContainerRole> = {\n list: 'list',\n listbox: 'listbox',\n grid: 'grid',\n};\n\nconst itemRoleByMode: Record<ListNavigationMode, ItemRole> = {\n list: 'listitem',\n listbox: 'option',\n grid: 'row',\n};\n\nconst defaultAxisByMode: Record<ListNavigationMode, 'vertical' | 'horizontal' | 'grid'> = {\n list: 'vertical',\n listbox: 'vertical',\n grid: 'grid',\n};\n\n/**\n * Find the focus-on-entry target inside a listbox container: the currently-selected\n * option, or the first non-disabled option. Used to give arrow-key navigation a\n * meaningful starting point when focus first lands on the listbox itself.\n */\nconst findListboxEntryTarget = (container: HTMLElement): HTMLElement | null => {\n return (\n container.querySelector<HTMLElement>('[role=\"option\"][aria-selected=\"true\"]:not([aria-disabled=\"true\"])') ??\n container.querySelector<HTMLElement>('[role=\"option\"]:not([aria-disabled=\"true\"])')\n );\n};\n\n/**\n * Keyboard navigation + ARIA role aspect for list-shaped surfaces. Wraps Tabster's\n * `useArrowNavigationGroup` with a `mode` that selects the appropriate role bundle\n * and adds a focus-on-entry redirect (Tabster handles traversal once focus is on a\n * child; first-entry is the consumer's responsibility).\n *\n * The canonical roving-tabindex keyboard aspect. Currently consumed by `Listbox` and\n * `OrderedList`; `Tree` (Treegrid), `Picker`/`Combobox` (input-driven virtual focus), and\n * `Mosaic.Stack` still ship bespoke navigation — see `react-ui-list/AUDIT.md` for the\n * convergence analysis. Non-list focus zones — e.g. Composer's multi-pane chrome — keep\n * their own Tabster wiring (`Focus.Group`).\n */\nexport const useListNavigation = ({\n mode,\n axis,\n memorizeCurrent = true,\n}: UseListNavigationOptions): UseListNavigationReturn => {\n const tabsterAttrs = useArrowNavigationGroup({\n axis: axis ?? defaultAxisByMode[mode],\n memorizeCurrent,\n });\n\n const handleFocus = useCallback(\n (event: FocusEvent<HTMLElement>) => {\n if (event.target !== event.currentTarget) {\n // Focus is already on a descendant; Tabster handles traversal from here.\n return;\n }\n if (mode !== 'listbox') {\n return;\n }\n // First-time entry on the listbox itself: redirect focus into a meaningful child\n // so arrow keys have an immediate starting point.\n const target = findListboxEntryTarget(event.currentTarget);\n target?.focus();\n },\n [mode],\n );\n\n // `aria-orientation` only accepts 'vertical' or 'horizontal'. Tabster's `axis` permits\n // grid-shaped values too ('grid', 'grid-linear', 'both'); collapse those (and the grid mode\n // itself) so we never leak an invalid ARIA value into the DOM.\n const orientation: 'vertical' | 'horizontal' | undefined =\n mode === 'grid' ? undefined : axis === 'horizontal' ? 'horizontal' : 'vertical';\n\n const containerProps = useMemo(\n () => ({\n role: containerRoleByMode[mode],\n ...(orientation && { 'aria-orientation': orientation }),\n ...tabsterAttrs,\n onFocus: handleFocus,\n }),\n [mode, orientation, tabsterAttrs, handleFocus],\n );\n\n // Listbox items need tabIndex=0 so Tabster can focus them; list/grid items inherit\n // their tabIndex from their interactive descendants (button-shaped handles, links).\n const itemRole = itemRoleByMode[mode];\n const itemTabIndex = mode === 'listbox' ? 0 : -1;\n const itemProps = useCallback(\n ({ disabled }: { disabled?: boolean } = {}) => ({\n role: itemRole,\n tabIndex: itemTabIndex,\n ...(disabled && { 'aria-disabled': true as const }),\n }),\n [itemRole, itemTabIndex],\n );\n\n return { containerProps, itemProps };\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { type FocusEvent, type MouseEvent, useCallback, useEffect, useRef, useState } from 'react';\n\nexport type ListSelectionMode = 'single' | 'multi';\n\ntype SingleValue = string | undefined;\ntype MultiValue = ReadonlySet<string>;\n\ntype ValueFor<M extends ListSelectionMode> = M extends 'single' ? SingleValue : MultiValue;\n\nexport type UseListSelectionOptions<M extends ListSelectionMode = ListSelectionMode> = {\n mode: M;\n /** Controlled selected id (single mode) or set of ids (multi mode). */\n value?: ValueFor<M>;\n defaultValue?: ValueFor<M>;\n onValueChange?: (next: ValueFor<M>) => void;\n /**\n * Selection follows focus. Defaults to `true` for single-select (matches the WAI-ARIA\n * listbox pattern) and `false` for multi-select (focus and toggle are separate gestures).\n */\n followsFocus?: boolean;\n};\n\nexport type SelectionItemBinding = {\n selected: boolean;\n toggle: () => void;\n /** Spread onto the row element to bind click + focus + ARIA. */\n rowProps: {\n 'aria-selected': boolean;\n 'onClick': (event: MouseEvent) => void;\n 'onFocus'?: (event: FocusEvent) => void;\n };\n};\n\nexport type UseListSelectionReturn = {\n bind: (id: string, opts?: { disabled?: boolean }) => SelectionItemBinding;\n};\n\nconst isMulti = (value: SingleValue | MultiValue): value is MultiValue => value instanceof Set;\n\n/**\n * Selection aspect for list-shaped surfaces. Owns single- or multi-select state with\n * controllable value semantics; emits `aria-selected` + click/focus handlers per row.\n *\n * `single` mode: at most one selected id, selection follows focus by default. Matches the\n * `Listbox` behaviour and the WAI-ARIA listbox single-select pattern.\n *\n * `multi` mode: tracks a `Set<string>`. Selection does NOT follow focus by default — multi\n * select usually pairs with an explicit toggle affordance (checkbox or keyboard Space) rather\n * than implicit focus-tracking.\n */\nexport const useListSelection: {\n <M extends ListSelectionMode>(opts: UseListSelectionOptions<M>): UseListSelectionReturn;\n} = (opts) => {\n const { mode, value, defaultValue, onValueChange, followsFocus } = opts;\n\n // Latches whenever the consumer passes the `value` prop key (even as undefined). A controlled\n // single-select consumer (`selectedId: string | undefined`) must be able to clear to undefined\n // without the row falling back to stale internal state — Radix `useControllableState` (1.1.0)\n // mishandles that case, so we mirror useListDisclosure's hand-rolled controller here.\n const wasControlledRef = useRef(Object.prototype.hasOwnProperty.call(opts, 'value'));\n if (Object.prototype.hasOwnProperty.call(opts, 'value')) {\n wasControlledRef.current = true;\n }\n const isControlled = wasControlledRef.current;\n\n const [internalValue, setInternalValue] = useState<SingleValue | MultiValue>(() => defaultValue);\n\n useEffect(() => {\n if (isControlled) {\n setInternalValue(value);\n }\n }, [isControlled, value]);\n\n const resolvedValue = isControlled ? value : internalValue;\n const setResolvedValue = useCallback(\n (next: SingleValue | MultiValue) => {\n if (!isControlled) {\n setInternalValue(next);\n }\n onValueChange?.(next as ValueFor<typeof mode>);\n },\n [isControlled, onValueChange, mode],\n );\n\n const isSelected = useCallback(\n (id: string) => {\n if (mode === 'multi') {\n return isMulti(resolvedValue) && resolvedValue.has(id);\n }\n return resolvedValue === id;\n },\n [mode, resolvedValue],\n );\n\n const setSelected = useCallback(\n (id: string, selected: boolean) => {\n if (mode === 'multi') {\n const current = isMulti(resolvedValue) ? resolvedValue : new Set<string>();\n const next = new Set(current);\n if (selected) {\n next.add(id);\n } else {\n next.delete(id);\n }\n setResolvedValue(next);\n } else {\n setResolvedValue(selected ? id : undefined);\n }\n },\n [mode, resolvedValue, setResolvedValue],\n );\n\n const followFocusDefault = mode === 'single';\n const trackFocus = followsFocus ?? followFocusDefault;\n\n const bind = useCallback(\n (id: string, { disabled }: { disabled?: boolean } = {}): SelectionItemBinding => {\n const selected = isSelected(id);\n return {\n selected,\n toggle: () => {\n if (!disabled) {\n setSelected(id, mode === 'multi' ? !selected : true);\n }\n },\n rowProps: {\n 'aria-selected': selected,\n 'onClick': () => {\n if (disabled) {\n return;\n }\n setSelected(id, mode === 'multi' ? !selected : true);\n },\n ...(trackFocus && {\n onFocus: (event: FocusEvent) => {\n if (disabled || selected) {\n return;\n }\n // Selection follows focus only while navigating *between* options within the list.\n // Focus entering the list from outside (e.g. a popover auto-focusing on open) must\n // not change selection, or it would clobber the controlled value when entry focus\n // lands on a non-selected option. Detect entry via `relatedTarget`: a synthetic event\n // without DOM context (unit tests) falls through to the original follow-focus path.\n const container = event.currentTarget?.closest?.('[role=\"listbox\"],[role=\"list\"],[role=\"grid\"]');\n if (container && !container.contains(event.relatedTarget)) {\n return;\n }\n setSelected(id, true);\n },\n }),\n },\n };\n },\n [isSelected, mode, setSelected, trackFocus],\n );\n\n return { bind };\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { autoScrollForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/element';\nimport {\n type Edge,\n attachClosestEdge,\n extractClosestEdge,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { getReorderDestinationIndex } from '@atlaskit/pragmatic-drag-and-drop-hitbox/util/get-reorder-destination-index';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n type ElementDragPayload,\n draggable,\n dropTargetForElements,\n monitorForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\nimport { type ReactNode, type RefCallback, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\n/**\n * Internal payload key. We attach this to every draggable's data so the root monitor can\n * recognise drops that belong to its own list and ignore foreign payloads.\n */\nconst REORDER_LIST_KEY = '__dxosReorderListId';\n\nlet reorderListIdCounter = 0;\nconst allocateReorderListId = (): string => `reorder-${++reorderListIdCounter}`;\n\nexport type ReorderAxis = 'vertical' | 'horizontal';\n\nexport type ReorderItemState =\n | { type: 'idle' }\n | { type: 'preview'; container: HTMLElement }\n | { type: 'dragging' }\n | { type: 'dragging-over'; closestEdge: Edge | null };\n\nconst IDLE: ReorderItemState = { type: 'idle' };\n\nexport type UseReorderListOptions<T> = {\n /** Authoritative item list. Read on each drop to compute the new index. */\n items: readonly T[];\n /** Stable identifier per item. The monitor uses this to find source/target indices. */\n getId: (item: T) => string;\n /** Called with `(fromIndex, toIndex)` when a drop completes inside this list. */\n onMove: (fromIndex: number, toIndex: number) => void;\n /** Drop axis. Defaults to `'vertical'`. */\n axis?: ReorderAxis;\n /** When true, drag handles report as disabled. Defaults to false. */\n readonly?: boolean;\n /** Forwarded to pragmatic-dnd's `getInitialData` on each draggable. */\n getInitialData?: (item: T, index: number) => Record<string, unknown>;\n /** Overrides the default `canDrop` (which matches payloads tagged with this list's id). */\n canDrop?: (args: { source: ElementDragPayload }) => boolean;\n /** Renderer for a custom native drag preview. */\n getDragPreview?: (item: T) => ReactNode;\n};\n\nexport type ReorderActive<T> = { id: string; item: T; container: HTMLElement } | null;\n\n/**\n * Stable controller created by `useReorderList`. Item components consume it via\n * `useReorderItem(controller, id)`. The controller is reference-stable across renders.\n */\nexport type ReorderListController<T> = {\n /** Internal: list id; payload tagged with this is the only data the monitor accepts by default. */\n listId: string;\n /** Look up an item by id. Used by the item hook to bind pragmatic-dnd at register time. */\n getItem: (id: string) => { item: T; index: number } | null;\n /** Bind a row's pragmatic-dnd primitives. Idempotent; returns a cleanup function. */\n bindItem: (\n id: string,\n refs: { row: HTMLElement; handle: HTMLElement },\n onItemState: (state: ReorderItemState) => void,\n ) => () => void;\n};\n\nexport type UseReorderListReturn<T> = {\n controller: ReorderListController<T>;\n /** The currently-dragging item, or null. Used by global drag preview portals. */\n active: ReorderActive<T>;\n /** Same as `controller.listId`. Exposed for diagnostics. */\n listId: string;\n};\n\n/**\n * List-level reorder aspect. Spins up pragmatic-dnd's `monitorForElements` and produces a\n * stable controller that per-row hooks consume. Item registration + the per-item draggable /\n * drop-target wiring lives in `useReorderItem` so each row owns its own React state without\n * re-rendering siblings on hover.\n */\nexport const useReorderList = <T>({\n items,\n getId,\n onMove,\n axis = 'vertical',\n readonly = false,\n getInitialData,\n canDrop,\n getDragPreview,\n}: UseReorderListOptions<T>): UseReorderListReturn<T> => {\n const listIdRef = useRef<string | null>(null);\n if (!listIdRef.current) {\n listIdRef.current = allocateReorderListId();\n }\n const listId = listIdRef.current;\n\n // Stable refs to mutable inputs so the controller and the monitor effect don't tear down\n // on every render. The functions returned in `controller` read from these refs.\n const itemsRef = useRef(items);\n itemsRef.current = items;\n const getIdRef = useRef(getId);\n getIdRef.current = getId;\n const onMoveRef = useRef(onMove);\n onMoveRef.current = onMove;\n const canDropRef = useRef(canDrop);\n canDropRef.current = canDrop;\n const getInitialDataRef = useRef(getInitialData);\n getInitialDataRef.current = getInitialData;\n const getDragPreviewRef = useRef(getDragPreview);\n getDragPreviewRef.current = getDragPreview;\n const readonlyRef = useRef(readonly);\n readonlyRef.current = readonly;\n\n const [active, setActive] = useState<ReorderActive<T>>(null);\n\n const findIndex = useCallback((id: string): number => {\n return itemsRef.current.findIndex((item) => getIdRef.current(item) === id);\n }, []);\n\n const findIndexFromPayload = useCallback(\n (data: Record<string, unknown> | undefined): number => {\n if (!data || data[REORDER_LIST_KEY] !== listId) {\n return -1;\n }\n const id = data.id as string | undefined;\n return id ? findIndex(id) : -1;\n },\n [listId, findIndex],\n );\n\n // The list-level monitor watches drops belonging to this list and computes the destination\n // index using pragmatic-dnd's helper. Mounted once per list lifetime.\n useEffect(() => {\n return monitorForElements({\n canMonitor: ({ source }) => {\n if (canDropRef.current) {\n return canDropRef.current({ source });\n }\n return source.data[REORDER_LIST_KEY] === listId;\n },\n onDrop: ({ location, source }) => {\n const target = location.current.dropTargets[0];\n if (!target) {\n return;\n }\n const sourceIdx = findIndexFromPayload(source.data);\n const targetIdx = findIndexFromPayload(target.data);\n if (sourceIdx < 0 || targetIdx < 0) {\n return;\n }\n const destinationIndex = getReorderDestinationIndex({\n closestEdgeOfTarget: extractClosestEdge(target.data),\n startIndex: sourceIdx,\n indexOfTarget: targetIdx,\n axis,\n });\n onMoveRef.current(sourceIdx, destinationIndex);\n },\n });\n }, [listId, axis, findIndexFromPayload]);\n\n // The controller is reference-stable. Item-level hooks call `bindItem` to register their\n // DOM elements with pragmatic-dnd; `getItem` is the synchronous lookup used at bind time.\n const controller = useMemo<ReorderListController<T>>(\n () => ({\n listId,\n getItem: (id) => {\n const index = findIndex(id);\n if (index < 0) {\n return null;\n }\n return { item: itemsRef.current[index], index };\n },\n bindItem: (id, refs, onItemState) => {\n const lookup = () => {\n const index = findIndex(id);\n return { item: itemsRef.current[index], index };\n };\n const { item, index } = lookup();\n if (!item && index < 0) {\n return () => {};\n }\n const allowedEdges: Edge[] = axis === 'vertical' ? ['top', 'bottom'] : ['left', 'right'];\n return combine(\n draggable({\n element: refs.row,\n dragHandle: refs.handle,\n canDrag: () => !readonlyRef.current,\n getInitialData: () => {\n const current = lookup();\n return {\n [REORDER_LIST_KEY]: listId,\n id,\n ...(getInitialDataRef.current?.(current.item, current.index) ?? {}),\n };\n },\n onGenerateDragPreview: getDragPreviewRef.current\n ? ({ nativeSetDragImage, source }) => {\n const rect = source.element.getBoundingClientRect();\n setCustomNativeDragPreview({\n nativeSetDragImage,\n getOffset: ({ container }) => ({ x: 20, y: container.getBoundingClientRect().height / 2 }),\n render: ({ container }) => {\n container.style.width = `${rect.width}px`;\n onItemState({ type: 'preview', container });\n const current = lookup();\n setActive({ id, item: current.item, container });\n return () => {\n onItemState(IDLE);\n setActive(null);\n };\n },\n });\n }\n : undefined,\n onDragStart: () => {\n onItemState({ type: 'dragging' });\n const current = lookup();\n setActive({ id, item: current.item, container: refs.row });\n },\n onDrop: () => {\n onItemState(IDLE);\n setActive(null);\n },\n }),\n dropTargetForElements({\n element: refs.row,\n canDrop: ({ source }) => {\n if (source.element === refs.row) {\n return false;\n }\n if (canDropRef.current) {\n return canDropRef.current({ source });\n }\n return source.data[REORDER_LIST_KEY] === listId;\n },\n getData: ({ input }) =>\n attachClosestEdge({ [REORDER_LIST_KEY]: listId, id }, { element: refs.row, input, allowedEdges }),\n getIsSticky: () => true,\n onDragEnter: ({ self }) => {\n onItemState({ type: 'dragging-over', closestEdge: extractClosestEdge(self.data) });\n },\n onDrag: ({ self }) => {\n onItemState({ type: 'dragging-over', closestEdge: extractClosestEdge(self.data) });\n },\n onDragLeave: () => onItemState(IDLE),\n onDrop: () => onItemState(IDLE),\n }),\n );\n },\n }),\n [listId, axis, findIndex],\n );\n\n return { controller, active, listId };\n};\n\nexport type ReorderItemBinding = {\n rowRef: RefCallback<HTMLElement>;\n handleRef: RefCallback<HTMLElement>;\n state: ReorderItemState;\n isDragging: boolean;\n closestEdge: Edge | null;\n};\n\n/**\n * Per-row reorder hook. Owns the row's local state and registers the row's DOM elements\n * with the list controller once both `rowRef` and `handleRef` are attached. Unmounting (or\n * detaching either ref) tears down the registration.\n *\n * Called inside the item component, not in the parent's render loop — this is what keeps\n * us inside the rules of hooks.\n */\nexport const useReorderItem = <T>(controller: ReorderListController<T>, id: string): ReorderItemBinding => {\n const [state, setState] = useState<ReorderItemState>(IDLE);\n\n // Snapshot the attached DOM nodes between renders without disturbing the React tree. When\n // both refs have resolved we register with the list controller; either detaching triggers\n // cleanup so we never leak pragmatic-dnd bindings.\n const rowElement = useRef<HTMLElement | null>(null);\n const handleElement = useRef<HTMLElement | null>(null);\n const cleanupRef = useRef<(() => void) | null>(null);\n\n const tryRegister = useCallback(() => {\n if (!rowElement.current || !handleElement.current) {\n return;\n }\n cleanupRef.current?.();\n cleanupRef.current = controller.bindItem(id, { row: rowElement.current, handle: handleElement.current }, setState);\n }, [controller, id]);\n\n const teardown = useCallback(() => {\n cleanupRef.current?.();\n cleanupRef.current = null;\n setState(IDLE);\n }, []);\n\n // Re-register if the controller or id changes (e.g. items reorder identity-stable).\n useEffect(() => {\n tryRegister();\n return teardown;\n }, [tryRegister, teardown]);\n\n const rowRef = useCallback<RefCallback<HTMLElement>>(\n (node) => {\n rowElement.current = node;\n if (node) {\n tryRegister();\n } else {\n teardown();\n }\n },\n [tryRegister, teardown],\n );\n\n const handleRef = useCallback<RefCallback<HTMLElement>>(\n (node) => {\n handleElement.current = node;\n if (node && rowElement.current) {\n tryRegister();\n } else if (!node) {\n // Mirror rowRef: if either ref detaches, tear down pragmatic-dnd bindings so a\n // re-attaching handle creates a fresh registration rather than racing the old one.\n teardown();\n }\n },\n [tryRegister, teardown],\n );\n\n return {\n rowRef,\n handleRef,\n state,\n isDragging: state.type === 'dragging',\n closestEdge: state.type === 'dragging-over' ? state.closestEdge : null,\n };\n};\n\n/**\n * Wire pragmatic-dnd's auto-scroll on a scrollable container. While any pragmatic-dnd drag\n * is in flight, hovering near the edges of the registered element scrolls the container\n * automatically. Pair with `OrderedList.Viewport` (or any caller-owned ScrollArea) so long\n * lists can be reordered without manually scrolling first.\n *\n * `autoScrollForElements` is global — it activates on every drag regardless of which list\n * started it — so it's safe to register one element per scroll surface.\n *\n * Returns a callback ref so the registration fires as soon as the element attaches and the\n * cleanup fires when it detaches; React doesn't re-run effects on mutable `ref.current`\n * changes, so a plain `useEffect` on a `useRef` would miss late-mounting elements entirely.\n */\nexport const useReorderAutoScroll = (): RefCallback<HTMLElement> => {\n const cleanupRef = useRef<(() => void) | null>(null);\n return useCallback((node) => {\n cleanupRef.current?.();\n cleanupRef.current = node ? autoScrollForElements({ element: node }) : null;\n }, []);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as AccordionPrimitive from '@radix-ui/react-accordion';\nimport { createContext } from '@radix-ui/react-context';\nimport React, { type PropsWithChildren } from 'react';\n\nimport { Icon, type ThemedClassName } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\nimport { listTheme } from '../List.theme';\n\n// See `AccordionRoot.tsx` for the rationale on `ListItemRecord = any`.\ntype ListItemRecord = any;\nimport { useAccordionContext } from './AccordionRoot';\n\nconst ACCORDION_ITEM_NAME = 'AccordionItem';\n\nconst styles = listTheme.styles();\n\ntype AccordionItemContext<T extends ListItemRecord> = {\n item: T;\n};\n\n// TODO(wittjosiah): This seems to be conflicting with something in the bundle.\n// Perhaps @radix-ui/react-accordion?\nexport const [AccordionItemProvider, useDxAccordionItemContext] =\n createContext<AccordionItemContext<any>>(ACCORDION_ITEM_NAME);\n\nexport type AccordionItemProps<T extends ListItemRecord> = ThemedClassName<PropsWithChildren<{ item: T }>>;\n\nexport const AccordionItem = <T extends ListItemRecord>({ children, classNames, item }: AccordionItemProps<T>) => {\n const { getId } = useAccordionContext(ACCORDION_ITEM_NAME);\n\n return (\n <AccordionItemProvider {...{ item }}>\n <AccordionPrimitive.Item value={getId(item)} className={styles.accordionItem({ class: mx(classNames) })}>\n {children}\n </AccordionPrimitive.Item>\n </AccordionItemProvider>\n );\n};\n\nexport type AccordionItemHeaderProps = ThemedClassName<\n AccordionPrimitive.AccordionHeaderProps & {\n icon?: string;\n /** Apply `dx-hover` row styling on the trigger (off by default; mirrors `Listbox.Item`). */\n hover?: boolean;\n }\n>;\n\nexport const AccordionItemHeader = ({ classNames, children, icon, hover, ...props }: AccordionItemHeaderProps) => {\n return (\n <AccordionPrimitive.Header {...props} className={mx(classNames)}>\n {/* `justify-between` pins the toggle caret to the trailing edge of the row regardless of\n the header content's intrinsic width — so the affordance lives at a predictable\n right-end position. The content wrapper grabs the remaining space. */}\n <AccordionPrimitive.Trigger className={styles.accordionTrigger({ class: hover && 'dx-hover' })}>\n {/* Leading icon and caret center within a single line-height band (`h-6`) so they sit on\n the same centerline as the first line of the content, which may span multiple lines. */}\n {icon && (\n <span className={styles.accordionTriggerIcon()}>\n <Icon icon={icon} size={4} />\n </span>\n )}\n <div className={styles.accordionTriggerContent()}>{children}</div>\n <span className={styles.accordionTriggerIcon()}>\n <Icon\n icon='ph--caret-right--regular'\n size={4}\n classNames='transition-transform duration-200 group-data-[state=open]:rotate-90'\n />\n </span>\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n );\n};\n\nexport type AccordionItemBodyProps = ThemedClassName<PropsWithChildren>;\n\nexport const AccordionItemBody = ({ children, classNames }: AccordionItemBodyProps) => {\n return (\n <AccordionPrimitive.Content className={styles.accordionBody()}>\n <div className={styles.accordionBodyContent({ class: mx(classNames) })}>{children}</div>\n </AccordionPrimitive.Content>\n );\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { tv } from '@dxos/ui-theme';\n\n/**\n * Tailwind-variants theme for all react-ui-list components.\n * Consumers call `listTheme.styles()` to get the slot functions.\n * Each slot function accepts an optional `{ class: ... }` override for per-instance merging.\n *\n * Structural pattern shared across list components:\n * - viewport: ScrollArea wrapper (`dx-container`)\n * - content: flex-col item container\n * - item: base row (interactive affordances come from dx-hover / dx-selected / dx-current)\n */\nconst listStyles = tv({\n slots: {\n //\n // Accordion\n //\n accordionItem: 'overflow-hidden',\n // Row trigger: spans the full width and pins the trailing caret to the inline-end edge.\n accordionTrigger: 'group flex items-start justify-between gap-2 p-2 dx-focus-ring-inset w-full text-start',\n // Leading / trailing icon wrappers: fixed height so they sit on the centerline of the first\n // content line even when the header spans multiple lines.\n accordionTriggerIcon: 'flex items-center h-6 shrink-0',\n accordionTriggerContent: 'min-w-0 flex-1',\n // Slide animations are driven by Radix Accordion's data-state attribute.\n accordionBody: 'overflow-hidden data-[state=closed]:animate-slide-up data-[state=open]:animate-slide-down',\n accordionBodyContent: 'p-2',\n\n //\n // Listbox\n //\n listboxViewport: 'dx-container',\n listboxContent: 'flex flex-col',\n // `dx-selected` pairs with `aria-selected=\"true\"` set per-option (see\n // `ui-theme/src/css/components/state.md`). `outline-none` removes the native focus\n // ring; Tabster / `dx-focus-ring` handles keyboard focus at the container level.\n listboxItem: 'flex items-center dx-hover dx-selected px-3 py-2 cursor-pointer outline-none',\n listboxItemLabel: 'grow truncate',\n\n //\n // OrderedList\n //\n orderedListViewport: 'dx-container',\n orderedListContent: 'flex flex-col',\n // `dx-current` enables `aria-current` row styling (not listbox/option semantics).\n orderedListItem: 'relative dx-current',\n // Bordered column wrapping title + detail panel in the master-detail layout.\n orderedListDetailColumn: 'flex flex-col ring-1 ring-subdued-separator rounded-sm overflow-hidden',\n // `min-h` matches the shared rail-item track so handles, title, and caret share a baseline.\n orderedListDetailTitleRow: 'flex items-center min-h-[var(--dx-rail-item)]',\n orderedListDetailPanel: 'px-2 pb-2',\n orderedListTitle: 'flex grow items-center truncate cursor-pointer',\n\n //\n // Picker\n //\n // `px-[var(--gutter,…)]` aligns padding with sibling `Column.Center` content, falling back to\n // 0.75rem when not nested under `Column.Root`.\n pickerItem: 'dx-hover dx-selected px-[var(--gutter,0.75rem)] py-1 cursor-pointer select-none',\n\n //\n // Combobox\n //\n // `m-form-chrome mb-0` mirrors the rest of the form-chrome padding convention.\n comboboxInput: 'm-form-chrome mb-0 w-[calc(100%-2*var(--spacing-form-chrome))]',\n comboboxList: 'py-form-chrome',\n // Trigger value / placeholder text — grows and truncates; subdued when placeholder.\n comboboxTriggerText: 'font-normal text-start flex-1 min-w-0 truncate me-2',\n // Item row adds flex layout; `dx-hover`/`dx-selected` and padding come from `Picker.Item`.\n comboboxItem: 'flex w-full gap-2 items-center',\n comboboxItemDescription: 'text-sm text-description truncate',\n\n //\n // ItemContent\n //\n // Two-column grid: fixed rail-item icon track + flexible content track.\n itemContentRoot: 'grid grid-cols-[var(--dx-rail-item)_minmax(0,1fr)] items-center gap-x-2 is-full min-is-0',\n itemContentIcon: 'col-start-1 row-start-1 place-self-center',\n itemContentTitle: 'col-start-2 row-start-1 min-is-0 truncate',\n itemContentDescription: 'col-start-2 row-start-2 min-is-0 truncate text-sm text-description',\n\n //\n // Empty\n //\n empty: 'flex flex-col items-center justify-center gap-2 p-4 text-sm text-center text-description',\n },\n});\n\n/** react-ui-list theme: call `.styles()` to get per-slot class functions. */\nexport const listTheme = {\n styles: listStyles,\n};\n\n/** Slot names of {@link listTheme.styles}, for `bridgeTv` registration. */\nexport const listSlots = Object.keys(listTheme.styles()) as Array<keyof ReturnType<typeof listTheme.styles>>;\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as AccordionPrimitive from '@radix-ui/react-accordion';\nimport { createContext } from '@radix-ui/react-context';\nimport React, { type ReactNode } from 'react';\n\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\n// Records flowing through this compound carry caller-defined shapes (any record with an\n// optional `id` is acceptable; `getId` defaults to reading `.id`). Typed as `any` so the\n// generic parameter remains the caller's source of truth.\ntype ListItemRecord = any;\n\ntype AccordionContext<T extends ListItemRecord> = {\n getId: (item: T) => string;\n};\n\nconst ACCORDION_NAME = 'Accordion';\n\nexport const [AccordionProvider, useAccordionContext] = createContext<AccordionContext<any>>(ACCORDION_NAME);\n\nexport type AccordionRendererProps<T extends ListItemRecord> = {\n items: T[];\n};\n\nconst defaultGetId = <T extends ListItemRecord>(item: T) => (item as any)?.id;\n\nexport type AccordionRootProps<T extends ListItemRecord> = ThemedClassName<\n {\n children?: (props: AccordionRendererProps<T>) => ReactNode;\n items?: T[];\n } & Partial<Pick<AccordionContext<T>, 'getId'>>\n>;\n\nexport const AccordionRoot = <T extends ListItemRecord>({\n classNames,\n items,\n getId = defaultGetId,\n children,\n value,\n defaultValue,\n onValueChange,\n}: AccordionRootProps<T> &\n Pick<AccordionPrimitive.AccordionMultipleProps, 'value' | 'defaultValue' | 'onValueChange'>) => {\n return (\n <AccordionProvider {...{ getId }}>\n <AccordionPrimitive.Root\n type='multiple'\n value={value}\n defaultValue={defaultValue}\n onValueChange={onValueChange}\n className={mx(classNames)}\n >\n {children?.({ items: items ?? [] })}\n </AccordionPrimitive.Root>\n </AccordionProvider>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { AccordionItem, AccordionItemBody, AccordionItemHeader } from './AccordionItem';\nimport { AccordionRoot } from './AccordionRoot';\n\n// TODO(burdon): Next iteration should be based on Radix UI Accordion:\n// https://www.radix-ui.com/primitives/docs/components/accordion\n// TODO(burdon): Support key navigation.\n\nexport const Accordion = {\n Root: AccordionRoot,\n Item: AccordionItem,\n ItemHeader: AccordionItemHeader,\n ItemBody: AccordionItemBody,\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\n// `Combobox` — popover-list with text input. Generic; no search-domain\n// dependencies. Built on `Picker` (this same package) for the\n// listbox-with-input pattern (registry, virtual highlight, keyboard\n// nav, the two performance-split contexts) and `Popover` from\n// `@dxos/react-ui` for the trigger/content/arrow.\n//\n// Filtering is the caller's responsibility — render only the matching\n// `<Combobox.Item>` children. For fuzzy / search-domain filtering,\n// pair with `useSearchListResults` from `@dxos/react-ui-search`.\n//\n// https://www.w3.org/WAI/ARIA/apg/patterns/combobox\n\nimport { createContext } from '@radix-ui/react-context';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport React, {\n type ComponentPropsWithoutRef,\n type ComponentPropsWithRef,\n type PropsWithChildren,\n forwardRef,\n useCallback,\n} from 'react';\n\nimport {\n Button,\n type ButtonProps,\n Icon,\n type IconProps,\n Popover,\n type PopoverArrowProps,\n type PopoverContentProps,\n type PopoverVirtualTriggerProps,\n ScrollArea,\n type ThemedClassName,\n useId,\n} from '@dxos/react-ui';\nimport { composable, composableProps } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\nimport { listTheme } from '../List.theme';\nimport { Picker, type PickerInputProps, type PickerItemProps } from '../Picker';\n\nconst styles = listTheme.styles();\n\nconst COMBOBOX_NAME = 'Combobox';\nconst COMBOBOX_CONTENT_NAME = 'ComboboxContent';\nconst COMBOBOX_ITEM_NAME = 'ComboboxItem';\nconst COMBOBOX_TRIGGER_NAME = 'ComboboxTrigger';\n\n//\n// Context — open/value state shared with Trigger and Item.\n//\n\ntype ComboboxContextValue = {\n modalId: string;\n isCombobox: true;\n placeholder?: string;\n open: boolean;\n onOpenChange: (nextOpen: boolean) => void;\n value: string;\n onValueChange: (nextValue: string) => void;\n};\n\nconst [ComboboxProvider, useComboboxContext] = createContext<Partial<ComboboxContextValue>>(COMBOBOX_NAME, {});\n\n//\n// Root\n//\n\ntype ComboboxRootProps = PropsWithChildren<\n Partial<\n ComboboxContextValue & {\n modal: boolean;\n defaultOpen: boolean;\n defaultValue: string;\n placeholder: string;\n }\n >\n>;\n\nconst ComboboxRoot = ({\n children,\n modal,\n modalId: modalIdProp,\n open: openProp,\n defaultOpen,\n onOpenChange: propsOnOpenChange,\n value: valueProp,\n defaultValue,\n onValueChange: propsOnValueChange,\n placeholder,\n}: ComboboxRootProps) => {\n const modalId = useId(COMBOBOX_NAME, modalIdProp);\n const [open = false, onOpenChange] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: propsOnOpenChange,\n });\n const [value = '', onValueChange] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue,\n onChange: propsOnValueChange,\n });\n\n return (\n <Popover.Root open={open} onOpenChange={onOpenChange} modal={modal}>\n <ComboboxProvider\n isCombobox\n modalId={modalId}\n placeholder={placeholder}\n open={open}\n onOpenChange={onOpenChange}\n value={value}\n onValueChange={onValueChange}\n >\n {children}\n </ComboboxProvider>\n </Popover.Root>\n );\n};\n\n//\n// Content — Popover.Content + Picker.Root.\n//\n// Filtering is caller-driven: pass already-matching <Combobox.Item> children.\n//\n\ntype ComboboxContentProps = PopoverContentProps & {\n /** Snap the highlight to the first item whenever the list changes (type-to-filter lists). */\n resetSelectionOnChange?: boolean;\n};\n\nconst ComboboxContent = composable<HTMLDivElement, ComboboxContentProps>(\n ({ children, resetSelectionOnChange, ...props }, forwardedRef) => {\n const { modalId } = useComboboxContext(COMBOBOX_CONTENT_NAME);\n\n return (\n <Popover.Content {...composableProps(props, { id: modalId })} ref={forwardedRef}>\n <Popover.Viewport classNames='w-(--radix-popover-trigger-width)'>\n <Picker.Root resetSelectionOnChange={resetSelectionOnChange}>{children}</Picker.Root>\n </Popover.Viewport>\n </Popover.Content>\n );\n },\n);\n\nComboboxContent.displayName = COMBOBOX_CONTENT_NAME;\n\n//\n// Trigger — the button that opens the popover.\n//\n\ntype ComboboxTriggerProps = ButtonProps;\n\nconst ComboboxTrigger = forwardRef<HTMLButtonElement, ComboboxTriggerProps>(\n ({ children, onClick, ...props }, forwardedRef) => {\n const { modalId, open, onOpenChange, placeholder, value } = useComboboxContext(COMBOBOX_TRIGGER_NAME);\n const handleClick = useCallback(\n (event: Parameters<Exclude<ButtonProps['onClick'], undefined>>[0]) => {\n onClick?.(event);\n onOpenChange?.(true);\n },\n [onClick, onOpenChange],\n );\n\n return (\n <Popover.Trigger asChild>\n <Button\n {...props}\n role='combobox'\n aria-expanded={open}\n aria-controls={modalId}\n aria-haspopup='dialog'\n onClick={handleClick}\n ref={forwardedRef}\n >\n {children ?? (\n <>\n <span className={styles.comboboxTriggerText({ class: !value && 'text-subdued' })}>\n {value || placeholder}\n </span>\n <Icon icon='ph--caret-down--bold' size={3} />\n </>\n )}\n </Button>\n </Popover.Trigger>\n );\n },\n);\n\nComboboxTrigger.displayName = COMBOBOX_TRIGGER_NAME;\n\n//\n// VirtualTrigger\n//\n\ntype ComboboxVirtualTriggerProps = PopoverVirtualTriggerProps;\n\nconst ComboboxVirtualTrigger = Popover.VirtualTrigger;\n\n//\n// Input — text input wired to Picker.Input. Caller controls value.\n//\n\ntype ComboboxInputProps = ThemedClassName<\n Omit<ComponentPropsWithRef<'input'>, 'value'> & Pick<PickerInputProps, 'value' | 'onValueChange'>\n>;\n\nconst ComboboxInput = forwardRef<HTMLInputElement, ComboboxInputProps>(({ classNames, ...props }, forwardedRef) => {\n return <Picker.Input {...props} classNames={styles.comboboxInput({ class: classNames })} ref={forwardedRef} />;\n});\n\nComboboxInput.displayName = 'Combobox.Input';\n\n//\n// List — scroll wrapper around items.\n//\n\ntype ComboboxListProps = PropsWithChildren<{ classNames?: string | string[] }>;\n\nconst ComboboxList = forwardRef<HTMLDivElement, ComboboxListProps>(\n ({ classNames, children, ...props }, forwardedRef) => {\n return (\n <ScrollArea.Root\n {...composableProps(props, { classNames: styles.comboboxList({ class: classNames }) })}\n role='listbox'\n centered\n padding\n thin\n ref={forwardedRef}\n >\n <ScrollArea.Viewport>{children}</ScrollArea.Viewport>\n </ScrollArea.Root>\n );\n },\n);\n\nComboboxList.displayName = 'Combobox.List';\n\n//\n// Item — wraps Picker.Item; commits value + closes popover on select.\n//\n\ntype ComboboxItemProps = ThemedClassName<\n PropsWithChildren<{\n /** Unique identifier. */\n value: string;\n /** Display label (used when `children` are not provided). */\n label?: string;\n /** Optional secondary line shown beneath the label (muted, smaller). */\n description?: string;\n /** Optional icon id (Phosphor) shown before the label. */\n icon?: string;\n /** Additional class names for the icon. */\n iconClassNames?: IconProps['classNames'];\n /** Show a check icon on the right (commonly used for confirming the picked item). */\n checked?: boolean;\n /** Suffix text after the label. */\n suffix?: string;\n /** Disabled. */\n disabled?: boolean;\n /** Caller-supplied select handler in addition to value-commit. */\n onSelect?: () => void;\n /** Whether to close the popover when this item is selected. Defaults to true. */\n closeOnSelect?: boolean;\n }>\n>;\n\nconst ComboboxItem = forwardRef<HTMLDivElement, ComboboxItemProps>(\n (\n {\n classNames,\n onSelect,\n value,\n label,\n description,\n icon,\n iconClassNames,\n checked,\n suffix,\n disabled,\n closeOnSelect = true,\n children,\n },\n forwardedRef,\n ) => {\n const { onValueChange, onOpenChange } = useComboboxContext(COMBOBOX_ITEM_NAME);\n const handleSelect = useCallback<NonNullable<PickerItemProps['onSelect']>>(() => {\n onSelect?.();\n if (value !== undefined) {\n onValueChange?.(value);\n }\n if (closeOnSelect) {\n onOpenChange?.(false);\n }\n }, [onSelect, onValueChange, onOpenChange, value, closeOnSelect]);\n\n return (\n <Picker.Item\n value={value}\n disabled={disabled}\n onSelect={handleSelect}\n ref={forwardedRef}\n classNames={styles.comboboxItem({\n // `px-3 py-1`, `cursor-pointer`, `select-none` and the `dx-hover` / `dx-selected`\n // pairing come from `Picker.Item`'s defaults; the slot only adds row-shape (flex /\n // icons + label). Disabled overrides are layered on per-instance.\n class: mx(disabled && 'hover:bg-transparent data-[selected=true]:bg-transparent', classNames),\n })}\n >\n {children ?? (\n <>\n {icon && <Icon icon={icon} classNames={iconClassNames} />}\n {description ? (\n <span className='w-0 grow flex flex-col'>\n <span className='truncate'>{label}</span>\n <span className={styles.comboboxItemDescription()}>{description}</span>\n </span>\n ) : (\n <span className='w-0 grow truncate'>{label}</span>\n )}\n {suffix && <span className='shrink-0 text-description'>{suffix}</span>}\n {checked && <Icon icon='ph--check--regular' />}\n </>\n )}\n </Picker.Item>\n );\n },\n);\n\nComboboxItem.displayName = COMBOBOX_ITEM_NAME;\n\n//\n// Arrow\n//\n\ntype ComboboxArrowProps = PopoverArrowProps;\n\nconst ComboboxArrow = Popover.Arrow;\n\n//\n// Empty — passthrough placeholder. No translation; caller supplies copy.\n//\n\ntype ComboboxEmptyProps = ThemedClassName<PropsWithChildren>;\n\nconst ComboboxEmpty = forwardRef<HTMLDivElement, ComboboxEmptyProps>(({ classNames, children }, forwardedRef) => {\n return (\n <div ref={forwardedRef} role='status' className={mx(classNames)}>\n {children}\n </div>\n );\n});\n\nComboboxEmpty.displayName = 'Combobox.Empty';\n\n//\n// Portal\n//\n\ntype ComboboxPortalProps = ComponentPropsWithoutRef<typeof Popover.Portal>;\n\nconst ComboboxPortal = Popover.Portal;\n\n//\n// Combobox\n//\n\nexport const Combobox = {\n Root: ComboboxRoot,\n Portal: ComboboxPortal,\n Content: ComboboxContent,\n Trigger: ComboboxTrigger,\n VirtualTrigger: ComboboxVirtualTrigger,\n Input: ComboboxInput,\n List: ComboboxList,\n Item: ComboboxItem,\n Arrow: ComboboxArrow,\n Empty: ComboboxEmpty,\n};\n\nexport type {\n ComboboxArrowProps,\n ComboboxContentProps,\n ComboboxEmptyProps,\n ComboboxInputProps,\n ComboboxItemProps,\n ComboboxListProps,\n ComboboxPortalProps,\n ComboboxRootProps,\n ComboboxTriggerProps,\n ComboboxVirtualTriggerProps,\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\n// `Picker` — generic listbox-with-input compound implementing the\n// WAI-ARIA combobox keyboard pattern. Search / filtering live one layer\n// up in `@dxos/react-ui-search`.\n//\n// The two contexts (Input / Item) are split so items don't re-render on\n// every keystroke and the input doesn't re-render on every (un)register.\n\nimport { Slot } from '@radix-ui/react-slot';\nimport React, {\n type ChangeEvent,\n type ComponentPropsWithRef,\n type ElementType,\n type KeyboardEvent,\n type PropsWithChildren,\n type MouseEvent as ReactMouseEvent,\n type ReactNode,\n forwardRef,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { type Density, type Elevation, Input, type ThemedClassName, useThemeContext } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\nimport { listTheme } from '../List.theme';\nimport {\n PickerInputContextProvider,\n PickerItemContextProvider,\n usePickerInputContext,\n usePickerItemContext,\n} from './context';\n\nconst styles = listTheme.styles();\n\ntype ItemData = {\n element: HTMLElement;\n disabled?: boolean;\n onSelect?: () => void;\n};\n\n//\n// Root\n//\n\ntype PickerRootProps = PropsWithChildren<{\n /**\n * When the item set changes, snap the highlight back to the first item (command-palette behavior),\n * instead of only re-selecting when the current selection disappears. Use for type-to-filter lists so\n * the top result stays highlighted as results update. Does not fire on keyboard navigation (which\n * changes the selection, not the item set). Defaults to false.\n */\n resetSelectionOnChange?: boolean;\n}>;\n\nconst PickerRoot = ({ children, resetSelectionOnChange = false }: PickerRootProps) => {\n const [selectedValue, setSelectedValue] = useState<string | undefined>(undefined);\n const itemsRef = useRef<Map<string, ItemData>>(new Map());\n // Bumped on every (un)register to retrigger auto-select.\n const [itemVersion, setItemVersion] = useState(0);\n // Tracks the last-seen item set so a reset fires only when items change, not on selection change.\n const prevItemVersionRef = useRef(itemVersion);\n\n // Auto-select the first non-disabled item when the current selection is gone or disabled — or, when\n // `resetSelectionOnChange`, whenever the item set itself changes.\n useEffect(() => {\n const itemsChanged = prevItemVersionRef.current !== itemVersion;\n prevItemVersionRef.current = itemVersion;\n\n const current = selectedValue !== undefined ? itemsRef.current.get(selectedValue) : undefined;\n const isValid = current !== undefined && !current.disabled;\n if ((!isValid || (resetSelectionOnChange && itemsChanged)) && itemsRef.current.size > 0) {\n const entries = Array.from(itemsRef.current.entries()).filter(([, data]) => !data.disabled);\n if (entries.length > 0) {\n entries.sort(([, a], [, b]) => {\n const position = a.element.compareDocumentPosition(b.element);\n if (position & Node.DOCUMENT_POSITION_FOLLOWING) {\n return -1;\n }\n if (position & Node.DOCUMENT_POSITION_PRECEDING) {\n return 1;\n }\n return 0;\n });\n const firstValue = entries[0]?.[0];\n if (firstValue !== undefined && firstValue !== selectedValue) {\n setSelectedValue(firstValue);\n }\n } else if (selectedValue !== undefined) {\n setSelectedValue(undefined);\n }\n }\n }, [itemVersion, selectedValue, resetSelectionOnChange]);\n\n const registerItem = useCallback(\n (value: string, element: HTMLElement | null, onSelect: (() => void) | undefined, disabled?: boolean) => {\n if (element) {\n itemsRef.current.set(value, { element, onSelect, disabled });\n setItemVersion((v) => v + 1);\n }\n },\n [],\n );\n\n const unregisterItem = useCallback((value: string) => {\n itemsRef.current.delete(value);\n setItemVersion((v) => v + 1);\n }, []);\n\n // DOM-order list of enabled item values.\n const getItemValues = useCallback(() => {\n return Array.from(itemsRef.current.entries())\n .filter(([, data]) => !data.disabled)\n .sort(([, a], [, b]) => {\n const position = a.element.compareDocumentPosition(b.element);\n return position & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : position & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;\n })\n .map(([value]) => value);\n }, []);\n\n const triggerSelect = useCallback(() => {\n if (selectedValue !== undefined) {\n const item = itemsRef.current.get(selectedValue);\n item?.onSelect?.();\n }\n }, [selectedValue]);\n\n // Stable values items subscribe to.\n const itemContextValue = useMemo(\n () => ({\n selectedValue,\n onSelectedValueChange: setSelectedValue,\n registerItem,\n unregisterItem,\n }),\n [selectedValue, registerItem, unregisterItem],\n );\n\n // Volatile values the input subscribes to (keyboard helpers).\n const inputContextValue = useMemo(\n () => ({\n selectedValue,\n onSelectedValueChange: setSelectedValue,\n getItemValues,\n triggerSelect,\n }),\n [selectedValue, getItemValues, triggerSelect],\n );\n\n return (\n <PickerInputContextProvider {...inputContextValue}>\n <PickerItemContextProvider {...itemContextValue}>{children}</PickerItemContextProvider>\n </PickerInputContextProvider>\n );\n};\n\nPickerRoot.displayName = 'Picker.Root';\n\n//\n// Input\n//\n\ntype InputVariant = 'default' | 'subdued';\n\ntype PickerInputProps = ThemedClassName<\n Omit<ComponentPropsWithRef<'input'>, 'value'> & {\n /** Controlled input value. Caller owns this — e.g. binds to query state. */\n value?: string;\n /** Called on every keystroke with the new input string. */\n onValueChange?: (value: string) => void;\n density?: Density;\n elevation?: Elevation;\n variant?: InputVariant;\n }\n>;\n\nconst PickerInput = forwardRef<HTMLInputElement, PickerInputProps>(\n ({ value, onValueChange, onChange, onKeyDown, autoFocus, ...props }, forwardedRef) => {\n const { hasIosKeyboard } = useThemeContext();\n const { selectedValue, onSelectedValueChange, getItemValues, triggerSelect } =\n usePickerInputContext('Picker.Input');\n\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n onValueChange?.(event.target.value);\n onChange?.(event);\n },\n [onValueChange, onChange],\n );\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLInputElement>) => {\n onKeyDown?.(event);\n if (event.defaultPrevented) {\n return;\n }\n const values = getItemValues();\n if (values.length === 0) {\n if (event.key === 'Escape') {\n onValueChange?.('');\n }\n return;\n }\n\n const currentIndex = selectedValue !== undefined ? values.indexOf(selectedValue) : -1;\n\n switch (event.key) {\n case 'ArrowDown': {\n event.preventDefault();\n const nextIndex = currentIndex === -1 ? 0 : Math.min(currentIndex + 1, values.length - 1);\n const nextValue = values[nextIndex];\n if (nextValue !== undefined) {\n onSelectedValueChange(nextValue);\n }\n break;\n }\n case 'ArrowUp': {\n event.preventDefault();\n const prevIndex = currentIndex === -1 ? values.length - 1 : Math.max(currentIndex - 1, 0);\n const prevValue = values[prevIndex];\n if (prevValue !== undefined) {\n onSelectedValueChange(prevValue);\n }\n break;\n }\n case 'Enter': {\n if (selectedValue !== undefined) {\n event.preventDefault();\n triggerSelect();\n }\n break;\n }\n case 'Home': {\n event.preventDefault();\n const firstValue = values[0];\n if (firstValue !== undefined) {\n onSelectedValueChange(firstValue);\n }\n break;\n }\n case 'End': {\n event.preventDefault();\n const lastValue = values[values.length - 1];\n if (lastValue !== undefined) {\n onSelectedValueChange(lastValue);\n }\n break;\n }\n case 'Escape': {\n event.preventDefault();\n if (selectedValue !== undefined) {\n onSelectedValueChange(undefined);\n } else {\n onValueChange?.('');\n }\n break;\n }\n }\n },\n [selectedValue, onSelectedValueChange, getItemValues, triggerSelect, onValueChange, onKeyDown],\n );\n\n // Only force-control when `value` is provided; otherwise leave the\n // input uncontrolled so it accepts keystrokes without `onValueChange`.\n return (\n <Input.Root>\n <Input.TextInput\n {...props}\n autoFocus={autoFocus && !hasIosKeyboard}\n {...(value !== undefined && { value })}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n ref={forwardedRef}\n />\n </Input.Root>\n );\n },\n);\n\nPickerInput.displayName = 'Picker.Input';\n\n//\n// Item\n//\n\ntype PickerItemProps = ThemedClassName<{\n /** Unique identifier; used by the registry and DOM-order traversal. */\n value: string;\n /** Callback when the item is committed (click, or Enter while highlighted). */\n onSelect?: () => void;\n /** Disable the item — registry-visible but not focusable, not navigable, not clickable. */\n disabled?: boolean;\n asChild?: boolean;\n children?: ReactNode;\n}>;\n\nconst PickerItem = forwardRef<HTMLDivElement, PickerItemProps>(\n ({ classNames, value, onSelect, disabled, asChild, children, ...props }, forwardedRef) => {\n const { selectedValue, onSelectedValueChange, registerItem, unregisterItem } = usePickerItemContext('Picker.Item');\n const internalRef = useRef<HTMLDivElement>(null);\n\n const isSelected = selectedValue === value && !disabled;\n\n useEffect(() => {\n const element = internalRef.current;\n if (element) {\n registerItem(value, element, onSelect, disabled);\n }\n return () => unregisterItem(value);\n }, [value, onSelect, disabled, registerItem, unregisterItem]);\n\n useEffect(() => {\n if (isSelected && internalRef.current) {\n internalRef.current.scrollIntoView({ block: 'nearest', behavior: 'smooth' });\n }\n }, [isSelected]);\n\n const handleClick = useCallback(() => {\n if (disabled) {\n return;\n }\n onSelectedValueChange(value);\n onSelect?.();\n }, [disabled, value, onSelectedValueChange, onSelect]);\n\n // Keep focus on `Picker.Input`: any `tabIndex` (incl. `-1`) would\n // steal focus on click and break the input's arrow-key handler.\n const handleMouseDown = useCallback((event: ReactMouseEvent<HTMLElement>) => {\n event.preventDefault();\n }, []);\n\n const Comp: ElementType = asChild ? Slot : 'div';\n\n return (\n <Comp\n {...props}\n ref={(node: HTMLDivElement | null) => {\n internalRef.current = node;\n if (typeof forwardedRef === 'function') {\n forwardedRef(node);\n } else if (forwardedRef) {\n forwardedRef.current = node;\n }\n }}\n role='option'\n aria-selected={isSelected}\n aria-disabled={disabled}\n data-selected={isSelected}\n data-disabled={disabled}\n data-value={value}\n // Browser focus stays on the input; highlight is via `aria-selected`.\n tabIndex={-1}\n className={styles.pickerItem({ class: mx(disabled && 'opacity-50 cursor-not-allowed', classNames) })}\n onMouseDown={handleMouseDown}\n onClick={handleClick}\n >\n {children}\n </Comp>\n );\n },\n);\n\nPickerItem.displayName = 'Picker.Item';\n\nexport const Picker = {\n Root: PickerRoot,\n Input: PickerInput,\n Item: PickerItem,\n};\n\nexport type { PickerInputProps, PickerItemProps, PickerRootProps };\n\nexport { usePickerInputContext, usePickerItemContext } from './context';\n", "//\n// Copyright 2026 DXOS.org\n//\n\n// Two contexts (Item / Input) instead of one — performance optimization\n// from the original SearchList: items don't subscribe to query / input\n// state, so typing in the input doesn't re-render every option.\n\nimport { createContext } from '@radix-ui/react-context';\n\n/** Stable: items subscribe to selection, registry. Doesn't change on query. */\nexport type PickerItemContextValue = {\n /** Currently highlighted item value (virtual; not browser focus). */\n selectedValue: string | undefined;\n /** Update the highlighted value (e.g. arrow keys, hover). */\n onSelectedValueChange: (value: string | undefined) => void;\n /** Register an item for keyboard nav + DOM-order traversal. */\n registerItem: (\n value: string,\n element: HTMLElement | null,\n onSelect: (() => void) | undefined,\n disabled?: boolean,\n ) => void;\n /** Unregister an item. */\n unregisterItem: (value: string) => void;\n};\n\n/** Volatile: input subscribes to selection + the input keyboard helpers. */\nexport type PickerInputContextValue = {\n /** Currently highlighted item value. */\n selectedValue: string | undefined;\n /** Update the highlighted value. */\n onSelectedValueChange: (value: string | undefined) => void;\n /** Get registered item values in DOM order (excludes disabled). */\n getItemValues: () => string[];\n /** Trigger the highlighted item's `onSelect`. */\n triggerSelect: () => void;\n};\n\nexport const [PickerItemContextProvider, usePickerItemContext] = createContext<PickerItemContextValue>('PickerItem');\n\nexport const [PickerInputContextProvider, usePickerInputContext] =\n createContext<PickerInputContextValue>('PickerInput');\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { type Edge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/types';\nimport React, { type CSSProperties, type HTMLAttributes } from 'react';\n\n// Tailwind port of `@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box`. The atlaskit\n// React component `require`s a `.compiled.css` file, which crashes the node test loader (and\n// thus every node-tested plugin that transitively imports this list); this port is CSS-free\n// and theme-aware (`bg-accent-bg`). `react-ui-mosaic` keeps the atlaskit component. See\n// `react-ui-list/AUDIT.md` D4.\n\ntype Orientation = 'horizontal' | 'vertical';\n\nconst edgeToOrientationMap: Record<Edge, Orientation> = {\n top: 'horizontal',\n bottom: 'horizontal',\n left: 'vertical',\n right: 'vertical',\n};\n\nconst orientationStyles: Record<Orientation, HTMLAttributes<HTMLElement>['className']> = {\n horizontal:\n 'h-(--line-thickness) left-[calc(var(--line-inset)+var(--terminal-radius))] right-(--line-inset) before:left-(--terminal-inset)',\n vertical:\n 'w-(--line-thickness) top-[calc(var(--line-inset)+var(--terminal-radius))] bottom-(--line-inset) before:top-(--terminal-inset)',\n};\n\nconst edgeStyles: Record<Edge, HTMLAttributes<HTMLElement>['className']> = {\n top: 'top-(--line-offset) before:top-(--offset-terminal)',\n right: 'right-(--line-offset) before:right-(--offset-terminal)',\n bottom: 'bottom-(--line-offset) before:bottom-(--offset-terminal)',\n left: 'left-(--line-offset) before:left-(--offset-terminal)',\n};\n\nconst strokeSize = 2;\nconst terminalSize = 8;\nconst offsetToAlignTerminalWithLine = (strokeSize - terminalSize) / 2;\n\n/** Props for {@link DropIndicator}. */\nexport type DropIndicatorProps = {\n edge: Edge;\n gap?: number;\n terminalInset?: number;\n lineInset?: number;\n};\n\n/** Themed box-edge drop indicator (line + circular terminal) for pragmatic-dnd reorder. */\nexport const DropIndicator = ({\n edge,\n gap = 0,\n lineInset = 0,\n terminalInset = lineInset - terminalSize,\n}: DropIndicatorProps) => {\n const orientation = edgeToOrientationMap[edge];\n\n return (\n <div\n style={\n {\n '--line-thickness': `${strokeSize}px`,\n '--line-offset': `calc(-0.5 * (${gap}px + ${strokeSize}px))`,\n '--line-inset': `${lineInset}px`,\n '--terminal-size': `${terminalSize}px`,\n '--terminal-radius': `${terminalSize / 2}px`,\n '--terminal-inset': `${terminalInset}px`,\n '--offset-terminal': `${offsetToAlignTerminalWithLine}px`,\n } as CSSProperties\n }\n className={`absolute z-10 pointer-events-none bg-accent-bg before:content-[''] before:w-(--terminal-size) before:h-(--terminal-size) box-border before:box-border before:absolute before:border-[length:--line-thickness] before:border-solid before:border-accent-bg before:rounded-full ${orientationStyles[orientation]} ${edgeStyles[edge]}`}\n />\n );\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport React, { type ReactNode } from 'react';\n\nimport { Icon, composable, composableProps, useTranslation } from '@dxos/react-ui';\nimport { osTranslations } from '@dxos/ui-theme';\nimport { type ComposableProps } from '@dxos/ui-types';\n\nexport type EmptyProps = ComposableProps<{\n /** Message to show; caller is responsible for translating it. Falls back to a generic message when omitted. */\n label?: ReactNode;\n /** Optional Phosphor icon name shown above the message. */\n icon?: string;\n}>;\n\n/**\n * Empty-state placeholder for a list/collection: a subdued, centered message shown in place of the list\n * when there are no items. Pass a domain-specific {@link EmptyProps.label} (already translated); when none is\n * given it falls back to a generic \"No items\" message from the shared `os` translation namespace.\n */\nexport const Empty = composable<HTMLDivElement, EmptyProps>(({ label, icon, ...props }, forwardedRef) => {\n const { t } = useTranslation(osTranslations);\n // `defaultValue` keeps the fallback working even before a host registers the key, and leaves it translatable.\n const message = label ?? t('empty.label', { defaultValue: 'No items' });\n return (\n <div\n {...composableProps<HTMLDivElement>(props, {\n classNames: 'flex flex-col items-center justify-center gap-2 p-4 text-sm text-center text-description',\n role: 'status',\n })}\n ref={forwardedRef}\n >\n {icon && <Icon icon={icon} size={6} classNames='text-subdued' />}\n <span>{message}</span>\n </div>\n );\n});\n\nEmpty.displayName = 'Empty';\n", "//\n// Copyright 2026 DXOS.org\n//\n\n// `Listbox` — the package's general styled list, with **opt-in selection**. One compound for\n// both the picker / option-list pattern (full-pane with `Listbox.Viewport`, or compact popover\n// without) and plain styled content rows.\n//\n// Selection is inferred from props: pass `value`/`defaultValue`/`onValueChange` on `Root` and\n// it's a single-select `role=listbox` (options carry `aria-selected` + `dx-selected`, selection\n// follows focus); omit them and it's a plain `role=list` of `role=listitem` rows (hover only, no\n// selection semantics) — the shape the deprecated `@dxos/react-ui` `List`/`ListItem` filled.\n// (`Listbox` is slated to be renamed `List` once that legacy component is deleted.)\n//\n// Compound shape (matches Radix Select / Toolbar / Tabs):\n//\n// <Listbox.Root value={…} onValueChange={…}>\n// {/* Viewport is optional — include for full-pane pickers, omit for popovers. */}\n// <Listbox.Viewport thin padding>\n// <Listbox.Content aria-label='Tools'>\n// <Listbox.Item id='a'>\n// <Listbox.ItemLabel>Alpha</Listbox.ItemLabel>\n// <Listbox.Indicator />\n// </Listbox.Item>\n// <Listbox.Item id='b'>…</Listbox.Item>\n// </Listbox.Content>\n// </Listbox.Viewport>\n// </Listbox.Root>\n//\n// - `Root` — headless context provider (no DOM). Owns the single-selection `value` model.\n// - `Viewport` — optional `ScrollArea.Root` + `ScrollArea.Viewport`. Always scrolls when\n// present. Forwards ScrollArea knobs (`thin`, `padding`, `centered`).\n// - `Content` — the `<ul role='listbox'>` holding the items. Applies the navigation aspect's\n// container props (Tabster arrow nav, focus-on-entry redirect, role + aria-orientation).\n// - `Item` — `<li role='option'>` with `aria-selected` on the selected row, paired with\n// `dx-selected` styling. See `ui-theme/src/css/components/state.md`.\n// - `ItemLabel` — text helper that truncates and takes most of the row width.\n// - `Indicator` — optional checkmark icon next to the selected item (confirmatory, since\n// `dx-selected` already styles the row).\n//\n// Selection model: single-select (`value: string | undefined`). Selection follows focus,\n// so arrow keys + click both update it. Matches the codebase's existing\n// `useSelected(_, 'single')` convention from `@dxos/react-ui-attention`.\n//\n// What this layer deliberately does NOT do:\n// - Virtualization or drag-and-drop. Reach for `@dxos/react-ui-mosaic`.\n// - Multi-select. Future expansion — the aspect (`useListSelection`) already supports it.\n\nimport { createContext } from '@radix-ui/react-context';\nimport React, {\n type ComponentPropsWithRef,\n type FocusEvent,\n type ForwardedRef,\n type MouseEvent,\n type PropsWithChildren,\n forwardRef,\n useCallback,\n useMemo,\n} from 'react';\n\nimport { List, ListItem } from '@dxos/react-list';\nimport {\n Icon,\n type IconProps,\n ScrollArea,\n type ScrollAreaRootProps,\n type ThemedClassName,\n composable,\n composableProps,\n} from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\nimport {\n type SelectionItemBinding,\n type UseListSelectionReturn,\n useListNavigation,\n useListSelection,\n} from '../../aspects';\nimport { listTheme } from '../List.theme';\nimport { ListItemContent, type ListItemContentProps } from './ListItemContent';\n\nconst styles = listTheme.styles();\n\nconst LISTBOX_NAME = 'Listbox';\nconst LISTBOX_ROOT_NAME = 'Listbox.Root';\nconst LISTBOX_VIEWPORT_NAME = 'Listbox.Viewport';\nconst LISTBOX_CONTENT_NAME = 'Listbox.Content';\nconst LISTBOX_ITEM_NAME = 'Listbox.Item';\nconst LISTBOX_ITEM_LABEL_NAME = 'Listbox.ItemLabel';\nconst LISTBOX_INDICATOR_NAME = 'Listbox.Indicator';\n\n//\n// Contexts — plain Radix contexts (un-scoped). Scoped composition (nested Listboxes,\n// Combobox embeddings) is a future expansion; when needed, switch to `createContextScope`\n// and thread `__listboxScope` through every subcomponent's props in one focused PR.\n//\n\ntype ListboxContextValue = {\n /**\n * Whether the list participates in selection. Inferred on `Root` from the presence of\n * `value`/`defaultValue`/`onValueChange`. Drives `role` (listbox/option vs list/listitem),\n * `aria-selected`, and whether row clicks update the selection model.\n */\n selectable: boolean;\n /** Selection aspect binding factory; items consume their own bindings from this. */\n selection: UseListSelectionReturn;\n};\n\ntype ListboxItemContextValue = {\n id: string;\n selected: boolean;\n};\n\nconst [ListboxProvider, useListboxContext] = createContext<ListboxContextValue>(LISTBOX_NAME);\nconst [ListboxItemProvider, useListboxItemContext] = createContext<ListboxItemContextValue>(LISTBOX_ITEM_NAME);\n\n//\n// Root — headless context provider. Renders no DOM.\n//\n\ntype RootProps = PropsWithChildren<{\n /**\n * Currently-selected option id (controlled). Supplying any of `value`/`defaultValue`/\n * `onValueChange` makes the list selectable; omitting all three renders plain rows.\n */\n value?: string;\n /** Initial selected option for uncontrolled mode. */\n defaultValue?: string;\n /**\n * Called when the user picks a different option (click, arrow keys, focus). Receives the\n * option's `id` prop. Selection cannot clear to `undefined` from the UI in single-select\n * mode (clicking an already-selected row is a no-op), so the callback always receives a\n * defined id.\n */\n onValueChange?: (value: string) => void;\n /** Reserved for parity with the prior `Listbox.Root`; focus-on-entry already covers most cases. */\n autoFocus?: boolean;\n}>;\n\nconst Root = ({ value, defaultValue, onValueChange, autoFocus: _autoFocus, children }: RootProps) => {\n // Selection is opt-in: a list is selectable only when the consumer wires the value model.\n // Plain content lists (the migrated `@dxos/react-ui` `List` call sites) pass none of these\n // and render as `role=list`/`listitem` rows.\n const selectable = value !== undefined || defaultValue !== undefined || onValueChange !== undefined;\n\n // `useListSelection` is a hook, so it is always called (stable hook order); `selectable`\n // gates whether items actually consume the binding. The aspect emits `string | undefined`\n // because it is mode-generic; in single-select the value only clears when the consumer\n // drives it, never from a row click — filter to keep the public callback narrow.\n const selection = useListSelection({\n mode: 'single',\n value,\n defaultValue,\n onValueChange: (next) => {\n if (next !== undefined) {\n onValueChange?.(next);\n }\n },\n });\n\n const context = useMemo(() => ({ selectable, selection }), [selectable, selection]);\n\n return <ListboxProvider {...context}>{children}</ListboxProvider>;\n};\n\nRoot.displayName = LISTBOX_ROOT_NAME;\n\n//\n// Viewport — ScrollArea wrapper. Always scrolls; forwards ScrollArea knobs.\n//\n// Optional — popover/dialog consumers can skip it and provide their own scroll container.\n//\n\ntype ViewportProps = Pick<ScrollAreaRootProps, 'thin' | 'padding' | 'centered'>;\n\nconst Viewport = composable<HTMLDivElement, ViewportProps>((props, forwardedRef) => {\n const { thin, padding, centered, children, ...rest } = props as PropsWithChildren<\n ViewportProps & Record<string, unknown>\n >;\n return (\n <ScrollArea.Root\n {...composableProps<HTMLDivElement>(rest, { classNames: styles.listboxViewport() })}\n {...{ thin, padding, centered }}\n orientation='vertical'\n ref={forwardedRef}\n >\n <ScrollArea.Viewport>{children}</ScrollArea.Viewport>\n </ScrollArea.Root>\n );\n});\n\nViewport.displayName = LISTBOX_VIEWPORT_NAME;\n\n//\n// Content — the listbox `<ul>` (Tabster arrow group + aria-label + role).\n//\n\ntype ContentProps = {\n /**\n * Accessible label for the listbox. Strongly recommended; assistive tech announces this\n * when focus enters the list.\n */\n 'aria-label'?: string;\n};\n\nconst Content = composable<HTMLUListElement, ContentProps>((props, forwardedRef) => {\n const { selectable } = useListboxContext(LISTBOX_CONTENT_NAME);\n\n // `useListNavigation` bundles role + aria-orientation + Tabster arrow nav. In `listbox` mode\n // it also adds the focus-on-entry redirect (to selected, then first non-disabled option);\n // `list` mode is for the non-selectable rows (arrow nav across interactive descendants only).\n const navigation = useListNavigation({ mode: selectable ? 'listbox' : 'list' });\n\n const { children, ...rest } = props as PropsWithChildren<ContentProps & Record<string, unknown>>;\n\n // We render via the primitive `<List>` so descendant `<ListItem>`s satisfy their Radix\n // context-scope check. The container's role/aria/Tabster wiring comes from the navigation\n // aspect rather than the primitive's `selectable` plumbing — that keeps the ARIA grammar\n // (`aria-selected`) owned by `Item` below.\n const composed = composableProps<HTMLUListElement>(rest, { classNames: styles.listboxContent() });\n return (\n <List\n variant='unordered'\n {...composed}\n {...navigation.containerProps}\n ref={forwardedRef as unknown as ForwardedRef<HTMLOListElement>}\n >\n {children}\n </List>\n );\n});\n\nContent.displayName = LISTBOX_CONTENT_NAME;\n\n//\n// Item — option row.\n//\n\ntype ItemProps = PropsWithChildren<{\n /** Stable identifier; matched against the parent's `value`. */\n id: string;\n /** Disable the row — focusable but doesn't update selection, dimmed. */\n disabled?: boolean;\n /** Optional click handler in addition to selection. */\n onClick?: (event: MouseEvent<HTMLLIElement>) => void;\n /** Optional focus handler in addition to selection-follows-focus. */\n onFocus?: (event: FocusEvent<HTMLLIElement>) => void;\n /**\n * Optional pointer-down handler. Fires before focus (and therefore before selection-follows-focus\n * mutates the value), so consumers can observe the pre-gesture selection — e.g. to implement\n * click-to-toggle without the focus-then-click double count.\n */\n onMouseDown?: (event: MouseEvent<HTMLLIElement>) => void;\n}>;\n\nconst Item = composable<HTMLLIElement, ItemProps>((props, forwardedRef) => {\n const { id, disabled, onClick, onFocus, onMouseDown, children, ...rest } = props as ItemProps &\n Record<string, unknown>;\n const { selectable, selection } = useListboxContext(LISTBOX_ITEM_NAME);\n const binding: SelectionItemBinding = selection.bind(id, { disabled });\n const selected = selectable && binding.selected;\n // A non-selectable row is interactive only if the caller wired a click; otherwise it's a\n // plain display row (no pointer affordance).\n const interactive = selectable || onClick != null;\n\n // Compose the selection aspect's click/focus handlers with the row's optional ones so both\n // wire-ups stay synchronized: selection happens before user code so a click that also runs\n // imperative side effects sees the selected value first. Skipped entirely when not selectable\n // so a plain row click doesn't mutate hidden selection state.\n const handleClick = useCallback(\n (event: MouseEvent<HTMLLIElement>) => {\n if (selectable) {\n binding.rowProps.onClick(event);\n }\n if (!disabled) {\n onClick?.(event);\n }\n },\n [selectable, binding, disabled, onClick],\n );\n\n const handleFocus = useCallback(\n (event: FocusEvent<HTMLLIElement>) => {\n if (selectable) {\n binding.rowProps.onFocus?.(event);\n }\n onFocus?.(event);\n },\n [selectable, binding, onFocus],\n );\n\n const composed = composableProps<HTMLLIElement>(rest, {\n classNames: styles.listboxItem({\n class: [!interactive && 'cursor-default', disabled && 'opacity-50 cursor-not-allowed'],\n }),\n });\n\n // Per WAI-ARIA APG listbox guidance, disabled options remain keyboard-navigable for SR\n // announcement; the selection model is not updated for disabled rows (the aspect's binding\n // enforces that internally). Non-selectable rows are `role=listitem` with no `aria-selected`.\n return (\n <ListItemProviderHost id={id} selected={selected}>\n <ListItem\n {...composed}\n role={selectable ? 'option' : 'listitem'}\n tabIndex={selectable ? 0 : -1}\n aria-selected={selectable ? selected : undefined}\n aria-disabled={disabled || undefined}\n onClick={handleClick}\n onFocus={handleFocus}\n onMouseDown={onMouseDown}\n ref={forwardedRef}\n >\n {children}\n </ListItem>\n </ListItemProviderHost>\n );\n});\n\nItem.displayName = LISTBOX_ITEM_NAME;\n\n/**\n * Publishes the item context so `Indicator` (and any future per-item descendant) can read\n * selection state without a second hook subscription. Tiny adapter — separated so `Item`'s\n * own composition stays a single component.\n */\nconst ListItemProviderHost = ({ id, selected, children }: PropsWithChildren<ListboxItemContextValue>) => (\n <ListboxItemProvider id={id} selected={selected}>\n {children}\n </ListboxItemProvider>\n);\n\n//\n// ItemLabel — text content for the item; grows and truncates.\n//\n\ntype ItemLabelProps = ThemedClassName<ComponentPropsWithRef<'span'>>;\n\nconst ItemLabel = forwardRef<HTMLSpanElement, ItemLabelProps>(({ classNames, children, ...rest }, forwardedRef) => (\n <span {...rest} className={styles.listboxItemLabel({ class: mx(classNames) })} ref={forwardedRef}>\n {children}\n </span>\n));\n\nItemLabel.displayName = LISTBOX_ITEM_LABEL_NAME;\n\n//\n// Indicator — checkmark icon for the selected item.\n//\n\ntype IndicatorProps = Omit<IconProps, 'icon'> & Partial<Pick<IconProps, 'icon'>>;\n\nconst Indicator = forwardRef<SVGSVGElement, IndicatorProps>(({ classNames, ...rootProps }, forwardedRef) => {\n const { selected } = useListboxItemContext(LISTBOX_INDICATOR_NAME);\n return (\n <Icon\n icon='ph--check--regular'\n {...rootProps}\n classNames={mx(!selected && 'invisible', classNames)}\n ref={forwardedRef}\n />\n );\n});\n\nIndicator.displayName = LISTBOX_INDICATOR_NAME;\n\n/**\n * Read selection state for a single id from inside any descendant of `<Listbox.Root>`.\n * Returns `true` when the row is currently selected. Lets composing components react to\n * selection without re-rendering on unrelated changes.\n */\nconst useListboxSelection = (id: string): boolean => {\n const { selection } = useListboxContext('useListboxSelection');\n return selection.bind(id).selected;\n};\n\n//\n// Public namespace.\n//\n\nconst Listbox = {\n Root,\n Viewport,\n Content,\n Item,\n ItemLabel,\n ItemContent: ListItemContent,\n Indicator,\n};\n\nexport { Listbox, useListboxSelection };\n\nexport type {\n ListItemContentProps as ItemContentProps,\n ContentProps as ListboxContentProps,\n IndicatorProps as ListboxIndicatorProps,\n ItemLabelProps as ListboxItemLabelProps,\n ItemProps as ListboxItemProps,\n RootProps as ListboxRootProps,\n ViewportProps as ListboxViewportProps,\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport React, { type ReactElement, type ReactNode, forwardRef } from 'react';\n\nimport { Icon, type ThemedClassName } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\nimport { listTheme } from '../List.theme';\n\n/**\n * Presentational row layout: a rail-sized leading icon centered on the primary line, with an\n * optional secondary line aligned beneath the title in the content column. Drop inside a\n * `Listbox.Item`, an `Accordion.ItemHeader`, or any row container.\n *\n * The grid uses the same `var(--dx-rail-item)` rail track as `useListGrid`, so an adjacent body\n * (e.g. an `Accordion.ItemBody`) can reuse `grid-cols-[var(--dx-rail-item)_1fr]` to line its\n * content up under the same content column.\n */\nconst styles = listTheme.styles();\n\nexport type ListItemContentProps = ThemedClassName<{\n /**\n * Leading icon: an icon name (rendered as a neutral size-5 `Icon`) or a custom `Icon` element\n * carrying its own size/colour (e.g. `<Icon icon='…' classNames='text-success-text' />`).\n */\n icon?: string | ReactElement;\n /** Primary line. */\n title: ReactNode;\n /** Optional secondary line, aligned under the title in the content column. */\n description?: ReactNode;\n}>;\n\nexport const ListItemContent = forwardRef<HTMLDivElement, ListItemContentProps>(\n ({ classNames, icon, title, description }, forwardedRef) => (\n <div ref={forwardedRef} className={styles.itemContentRoot({ class: mx(classNames) })}>\n {icon != null && (\n <div className={styles.itemContentIcon()}>\n {typeof icon === 'string' ? <Icon icon={icon} size={5} /> : icon}\n </div>\n )}\n <span className={styles.itemContentTitle()}>{title}</span>\n {description != null && <span className={styles.itemContentDescription()}>{description}</span>}\n </div>\n ),\n);\n\nListItemContent.displayName = 'ItemContent';\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { createContext } from '@radix-ui/react-context';\nimport React, {\n type ComponentProps,\n type CSSProperties,\n type MouseEvent,\n type PropsWithChildren,\n type ReactNode,\n type RefCallback,\n useCallback,\n} from 'react';\n\nimport {\n IconBlock,\n IconButton,\n type IconButtonProps,\n type ThemedClassName,\n ToggleIconButton,\n useTranslation,\n} from '@dxos/react-ui';\nimport { mx, osTranslations } from '@dxos/ui-theme';\n\nimport { useListGrid, useReorderItem } from '../../aspects';\nimport { DropIndicator } from '../DropIndicator';\nimport { listTheme } from '../List.theme';\nimport { type ListItemRecord, useOrderedListContext } from './OrderedListRoot';\n\nconst styles = listTheme.styles();\n\nconst ORDERED_LIST_ITEM_NAME = 'OrderedListItem';\n\ntype OrderedListItemContextValue = {\n id: string;\n expanded: boolean;\n toggle: () => void;\n canDrag: boolean;\n handleRef: RefCallback<HTMLElement>;\n /** ARIA wiring for the controlled disclosure panel. */\n triggerProps: ReturnType<NonNullable<ReturnType<typeof useOrderedListContext>['disclosure']['bind']>>['triggerProps'];\n panelProps: ReturnType<NonNullable<ReturnType<typeof useOrderedListContext>['disclosure']['bind']>>['panelProps'];\n};\n\nconst [OrderedListItemProvider, useOrderedListItemContext] =\n createContext<OrderedListItemContextValue>(ORDERED_LIST_ITEM_NAME);\n\nexport type OrderedListItemProps<T extends ListItemRecord> = ThemedClassName<\n PropsWithChildren<{\n id: string;\n /** The record handed to the underlying reorder hook (kept for back-compat with callers). */\n item: T;\n /** Defaults to true; false disables the drag handle. */\n canDrag?: boolean;\n /** Apply the row-hover affordance. Defaults to false. */\n hover?: boolean;\n /**\n * Visually highlights the row as the \"currently active\" entry — sets `aria-current=\"true\"`\n * paired with `dx-current` styling. `aria-current` is the right grammar for an active row\n * inside a `list`-mode container (listbox/option semantics live on `Listbox`); used for\n * surfaces like the `Mixer` where the active layer needs visual highlight without\n * adopting listbox role semantics.\n */\n selected?: boolean;\n /** Optional click handler bound to the outer row element. */\n onClick?: (event: MouseEvent<HTMLDivElement>) => void;\n /** Inline style merged onto the outer element. Used for grid templates produced by `useListGrid`. */\n style?: CSSProperties;\n }>\n>;\n\n/**\n * A single reorderable item. Calls `useReorderItem` to wire pragmatic-dnd refs + state,\n * resolves disclosure state from the root context, and exposes both via item context for\n * the sub-components (`OrderedListDragHandle`, `OrderedListTitle`, `OrderedListExpandCaret`).\n *\n * The outer element applies only structural concerns (`relative` + state classes); the\n * layout (flex/grid) is controlled by the caller via `classNames` so master-detail rows\n * and bare reorderable rows can share the same component.\n */\nexport const OrderedListItem = <T extends ListItemRecord>({\n id,\n canDrag = true,\n hover = false,\n selected,\n onClick,\n classNames,\n style,\n children,\n}: OrderedListItemProps<T>) => {\n const { reorder, disclosure, navigation } = useOrderedListContext(ORDERED_LIST_ITEM_NAME);\n const { rowRef, handleRef, closestEdge, state } = useReorderItem(reorder, id);\n const { expanded, toggle, triggerProps, panelProps } = disclosure.bind(id);\n\n return (\n <OrderedListItemProvider\n id={id}\n expanded={expanded}\n toggle={toggle}\n canDrag={canDrag}\n handleRef={handleRef}\n triggerProps={triggerProps}\n panelProps={panelProps}\n >\n <div\n ref={rowRef as RefCallback<HTMLDivElement>}\n {...navigation.itemProps()}\n style={style}\n aria-current={selected || undefined}\n onClick={onClick}\n className={styles.orderedListItem({\n class: mx(hover && 'dx-hover', state.type === 'dragging' && 'opacity-50', classNames),\n })}\n >\n {children}\n {closestEdge && <DropIndicator edge={closestEdge} />}\n </div>\n </OrderedListItemProvider>\n );\n};\n\n/**\n * Drag handle. Disabled when the list is readonly or the item opts out via `canDrag={false}`.\n * The button is the only element that initiates drag — pragmatic-dnd's `dragHandle:` option\n * scopes the source surface to this ref.\n */\nexport const OrderedListDragHandle = () => {\n const { readonly } = useOrderedListContext('OrderedListDragHandle');\n const { canDrag, handleRef } = useOrderedListItemContext('OrderedListDragHandle');\n const { t } = useTranslation(osTranslations);\n const disabled = readonly || !canDrag;\n return (\n <IconButton\n variant='ghost'\n disabled={disabled}\n noTooltip\n icon='ph--dots-six-vertical--regular'\n iconOnly\n label={t('drag-handle.label')}\n ref={handleRef as RefCallback<HTMLButtonElement>}\n />\n );\n};\n\n/**\n * Clickable title; clicking toggles the item's expanded state. Carries a stable id so the\n * expanded panel can name itself via `aria-labelledby`.\n */\nexport const OrderedListTitle = ({\n classNames,\n children,\n onClick,\n ...props\n}: ThemedClassName<PropsWithChildren<ComponentProps<'div'>>>) => {\n const { triggerProps } = useOrderedListItemContext('OrderedListTitle');\n const handleClick = useCallback(\n (event: MouseEvent<HTMLDivElement>) => {\n onClick?.(event);\n triggerProps.onClick(event);\n },\n [onClick, triggerProps],\n );\n return (\n <div\n {...props}\n // The title row is also the disclosure trigger, so it carries the trigger's\n // `id` + `aria-expanded` + `aria-controls` for assistive tech.\n id={triggerProps.id}\n aria-expanded={triggerProps['aria-expanded']}\n aria-controls={triggerProps['aria-controls']}\n className={styles.orderedListTitle({ class: mx(classNames) })}\n onClick={handleClick}\n >\n {children}\n </div>\n );\n};\n\n/**\n * Generic action icon button. Anchored in a `var(--dx-rail-item)` IconBlock so it shares a\n * centerline with the title row regardless of expand state. Use for inline row actions\n * (mute, edit, copy, etc.); pair with `OrderedListDeleteButton` for the delete affordance.\n */\nexport const OrderedListIconButton = ({\n autoHide = false,\n disabled,\n classNames,\n ...props\n}: IconButtonProps & { autoHide?: boolean }) => (\n <IconBlock>\n <IconButton\n {...props}\n variant='ghost'\n iconOnly\n disabled={disabled}\n classNames={[classNames, autoHide && disabled && 'hidden']}\n />\n </IconBlock>\n);\n\n/**\n * Delete icon button. Anchored in a `var(--dx-rail-item)` IconBlock so it shares a centerline\n * with the title row regardless of expand state. No `my-[1px]` nudge: the central column's\n * outline is `ring-1` (see `OrderedListDetailItem`) so layout is exact.\n */\nexport const OrderedListDeleteButton = ({\n autoHide = false,\n icon = 'ph--x--regular',\n label,\n disabled,\n classNames,\n ...props\n}: Partial<Pick<IconButtonProps, 'icon'>> &\n Omit<IconButtonProps, 'icon' | 'label'> & { autoHide?: boolean; label?: string }) => {\n const { t } = useTranslation(osTranslations);\n return (\n <OrderedListIconButton\n {...props}\n autoHide={autoHide}\n disabled={disabled}\n icon={icon}\n label={label ?? t('delete.label')}\n classNames={classNames}\n />\n );\n};\n\n/**\n * Expand/collapse caret; reflects and toggles the item's expanded state via the disclosure\n * trigger's `aria-expanded` + `aria-controls`.\n */\nexport const OrderedListExpandCaret = ({ onClick, ...props }: Partial<IconButtonProps>) => {\n const { t } = useTranslation(osTranslations);\n const { expanded, toggle, triggerProps } = useOrderedListItemContext('OrderedListExpandCaret');\n const handleClick = useCallback(\n (event: MouseEvent<HTMLButtonElement>) => {\n toggle();\n onClick?.(event);\n },\n [toggle, onClick],\n );\n return (\n <ToggleIconButton\n iconOnly\n variant='ghost'\n active={expanded}\n icon='ph--caret-right--regular'\n label={t('toggle-expand.label')}\n // Disclosure semantics are carried here for AT users that interact with the caret\n // rather than the title.\n aria-expanded={triggerProps['aria-expanded']}\n aria-controls={triggerProps['aria-controls']}\n onClick={handleClick}\n {...props}\n />\n );\n};\n\nexport type OrderedListDetailItemProps<T extends ListItemRecord> = ThemedClassName<\n PropsWithChildren<{\n id: string;\n /** The record handed to the underlying reorder hook (kept for back-compat with callers). */\n item: T;\n /** Defaults to true; false disables the drag handle. */\n canDrag?: boolean;\n /** Title content shown in the clickable name row (clicking toggles expansion). */\n title: ReactNode;\n titleClassNames?: ThemedClassName<any>['classNames'];\n /** Inline actions placed in the name row before the expand caret (e.g. a visibility toggle). */\n actions?: ReactNode;\n /** Action(s) placed outside the bordered column, flanking it (e.g. a delete button). */\n trailing?: ReactNode;\n /** When false, hides the expand caret and detail panel. Defaults to true. */\n expandable?: boolean;\n }>\n>;\n\n/**\n * Master-detail row: a drag handle and trailing action flank a `ring-1`-outlined central\n * column whose title row (title + inline actions + expand caret) toggles an inline detail\n * panel (children).\n *\n * Outline uses `ring-1` (rendered as box-shadow) rather than `border` so the column's\n * content area is the full `var(--dx-rail-item)` height — handles, title, caret, and\n * trailing all sit on the same baseline without per-pixel nudges.\n */\nexport const OrderedListDetailItem = <T extends ListItemRecord>({\n id,\n item,\n canDrag,\n title,\n titleClassNames,\n actions,\n trailing,\n expandable = true,\n classNames,\n children,\n}: OrderedListDetailItemProps<T>) => {\n const grid = useListGrid({ trailing: !!trailing });\n return (\n <OrderedListItem\n id={id}\n item={item}\n canDrag={canDrag}\n // The grid template is inline so the row's three slots (handle / card / trailing)\n // land in fixed-width tracks that share a baseline with the title row inside the card.\n // See useListGrid for the rationale.\n style={grid.rowProps.style}\n classNames={mx(grid.rowProps.className, 'pb-1', classNames)}\n >\n <OrderedListDragHandle />\n <div className={styles.orderedListDetailColumn()}>\n <div className={styles.orderedListDetailTitleRow()}>\n {expandable ? (\n <OrderedListTitle classNames={mx('px-2', titleClassNames)}>{title}</OrderedListTitle>\n ) : (\n // When the row is not expandable, render a plain (non-toggling) title so a click\n // doesn't mutate hidden disclosure state. Mirrors `OrderedListTitle`'s structure\n // minus the trigger plumbing.\n <div className={styles.orderedListTitle({ class: mx('cursor-auto px-2', titleClassNames) })}>{title}</div>\n )}\n {actions}\n {expandable && <OrderedListExpandCaret />}\n </div>\n {expandable && <DetailPanel>{children}</DetailPanel>}\n </div>\n {trailing}\n </OrderedListItem>\n );\n};\n\n/**\n * Read-only panel renderer that consumes the item's disclosure state from context. Kept as\n * a small sub-component so the panel's `id` + `role=region` + `aria-labelledby` come from a\n * single source — and so a closed item doesn't pay for rendering an empty panel.\n */\nconst DetailPanel = ({ children }: PropsWithChildren) => {\n const { expanded, panelProps } = useOrderedListItemContext('OrderedListDetailItem.Panel');\n if (!expanded || !children) {\n return null;\n }\n return (\n <div {...panelProps} className={styles.orderedListDetailPanel()}>\n {children}\n </div>\n );\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { createContext } from '@radix-ui/react-context';\nimport React, { type PropsWithChildren, type ReactNode, useMemo } from 'react';\n\nimport {\n ScrollArea,\n type ScrollAreaRootProps,\n type ThemedClassName,\n composable,\n composableProps,\n} from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\nimport {\n type ReorderActive,\n type ReorderListController,\n type UseListDisclosureReturn,\n type UseListNavigationReturn,\n useListDisclosure,\n useListNavigation,\n useReorderAutoScroll,\n useReorderList,\n} from '../../aspects';\nimport { listTheme } from '../List.theme';\n\nconst styles = listTheme.styles();\n\nexport type ListItemRecord = any;\n\nconst ORDERED_LIST_NAME = 'OrderedList';\n\ntype OrderedListContextValue<T extends ListItemRecord> = {\n reorder: ReorderListController<T>;\n disclosure: UseListDisclosureReturn;\n navigation: UseListNavigationReturn;\n readonly?: boolean;\n active: ReorderActive<T>;\n /**\n * Stable id accessor reused by items that want to look up their record (e.g. the\n * `OrderedListItem` <-> `useReorderItem` plumbing).\n */\n getId: (item: T) => string;\n};\n\nconst [OrderedListProvider, useOrderedListContext] = createContext<OrderedListContextValue<any>>(ORDERED_LIST_NAME);\n\nexport { useOrderedListContext };\n\nexport type OrderedListRootProps<T extends ListItemRecord> = ThemedClassName<{\n items: readonly T[];\n /**\n * Type guard reserved for backwards compatibility with the deprecated `List` API. The\n * aspect layer doesn't need it (payloads are scoped via the list's internal id) — values\n * passed here are currently ignored. Will be removed when call-sites migrate.\n */\n isItem?: (item: any) => boolean;\n /**\n * Stable id accessor. When omitted, the hook falls back to reference equality, which\n * breaks after a pragmatic-dnd round-trip serialises the payload — supply a `getId` for\n * any list whose items are plain values rather than ECHO refs.\n */\n getId?: (item: T) => string;\n onMove?: (fromIndex: number, toIndex: number) => void;\n readonly?: boolean;\n /** Controlled expanded item id (single-expand). */\n expandedId?: string;\n defaultExpandedId?: string;\n onExpandedChange?: (id: string | undefined) => void;\n children: (props: { items: readonly T[] }) => ReactNode;\n}>;\n\nconst defaultGetId = <T extends ListItemRecord>(item: T) => (item as any)?.id;\nconst noopMove = () => {};\n\n/**\n * Reorderable, single-expandable master-detail list. Wraps the aspect hooks:\n *\n * - `useReorderList` — drag-and-drop reorder via pragmatic-dnd.\n * - `useListDisclosure` (single mode) — single-expand state machine.\n * - `useListNavigation` (list mode) — Tabster keyboard nav across items.\n *\n * Owns the drag-handle / delete / expand-caret chrome plus expand state. Renders no DOM\n * itself; `OrderedListContent` is the container.\n */\nexport const OrderedListRoot = <T extends ListItemRecord>({\n items,\n getId = defaultGetId,\n onMove = noopMove,\n readonly,\n expandedId,\n defaultExpandedId,\n onExpandedChange,\n children,\n}: OrderedListRootProps<T>) => {\n const { controller, active } = useReorderList<T>({\n items,\n getId,\n onMove,\n readonly,\n });\n\n const disclosure = useListDisclosure({\n mode: 'single',\n value: expandedId,\n defaultValue: defaultExpandedId,\n onValueChange: (next) => onExpandedChange?.(next),\n });\n\n const navigation = useListNavigation({ mode: 'list' });\n\n // Memoise the context value so identity-stable items don't re-render on aspect re-renders\n // that don't affect their bindings (e.g. an unrelated drag-state change).\n const context = useMemo(\n () => ({\n reorder: controller,\n disclosure,\n navigation,\n readonly,\n active,\n getId,\n }),\n [controller, disclosure, navigation, readonly, active, getId],\n );\n\n return <OrderedListProvider {...context}>{children({ items })}</OrderedListProvider>;\n};\n\n/**\n * Container for the list. Applies the navigation aspect's `containerProps` so role,\n * aria-orientation, Tabster attributes, and focus-on-entry are wired in one place.\n */\nexport const OrderedListContent = ({ classNames, children }: ThemedClassName<PropsWithChildren>) => {\n const { navigation } = useOrderedListContext('OrderedList.Content');\n return (\n <div {...navigation.containerProps} className={styles.orderedListContent({ class: mx(classNames) })}>\n {children}\n </div>\n );\n};\n\n/**\n * Optional ScrollArea wrapper for the list. Mirrors `Listbox.Viewport`. Include when the\n * list needs to fill a constrained pane and scroll independently; omit for static lists\n * that flow with their parent.\n *\n * Wires `useReorderAutoScroll` on the inner viewport so pragmatic-dnd auto-scrolls the\n * container when a drag hovers near its edges — long lists can be reordered without\n * scrolling manually first.\n */\ntype OrderedListViewportProps = Pick<ScrollAreaRootProps, 'thin' | 'padding' | 'centered'>;\n\nexport const OrderedListViewport = composable<HTMLDivElement, OrderedListViewportProps>((props, forwardedRef) => {\n const { thin, padding, centered, children, ...rest } = props as PropsWithChildren<\n OrderedListViewportProps & Record<string, unknown>\n >;\n // Callback ref so registration fires on attach and cleanup on detach — `useEffect` on a\n // ref object would miss the element entirely (ref mutations don't re-run effects).\n const autoScrollRef = useReorderAutoScroll();\n return (\n <ScrollArea.Root\n {...composableProps<HTMLDivElement>(rest, { classNames: styles.orderedListViewport() })}\n {...{ thin, padding, centered }}\n orientation='vertical'\n ref={forwardedRef}\n >\n <ScrollArea.Viewport ref={autoScrollRef}>{children}</ScrollArea.Viewport>\n </ScrollArea.Root>\n );\n});\n\nOrderedListViewport.displayName = 'OrderedList.Viewport';\n\nexport type { OrderedListViewportProps };\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport {\n OrderedListDeleteButton,\n OrderedListDetailItem,\n type OrderedListDetailItemProps,\n OrderedListDragHandle,\n OrderedListExpandCaret,\n OrderedListIconButton,\n OrderedListItem,\n type OrderedListItemProps,\n OrderedListTitle,\n} from './OrderedListItem';\nimport {\n OrderedListContent,\n OrderedListRoot,\n type OrderedListRootProps,\n OrderedListViewport,\n type OrderedListViewportProps,\n} from './OrderedListRoot';\n\n/**\n * Reorderable, single-expandable master-detail list.\n *\n * `DetailItem` encapsulates the common master-detail row (drag handle + bordered column with a\n * name row that toggles an inline detail panel + a trailing action). Compose the lower-level\n * `Item` / `DragHandle` / `Title` / `ExpandCaret` / `DeleteButton` directly for other layouts.\n *\n * @example\n * <OrderedList.Root items={…} isItem={…} getId={…} onMove={…} expandedId={…} onExpandedChange={…}>\n * {({ items }) => (\n * <OrderedList.Content>\n * {items.map((item) => (\n * <OrderedList.DetailItem\n * key={item.id}\n * id={item.id}\n * item={item}\n * title={item.label}\n * trailing={<OrderedList.DeleteButton onClick={…} />}\n * >\n * {detail}\n * </OrderedList.DetailItem>\n * ))}\n * </OrderedList.Content>\n * )}\n * </OrderedList.Root>\n */\nexport const OrderedList = {\n Root: OrderedListRoot,\n Viewport: OrderedListViewport,\n Content: OrderedListContent,\n Item: OrderedListItem,\n DetailItem: OrderedListDetailItem,\n DragHandle: OrderedListDragHandle,\n Title: OrderedListTitle,\n IconButton: OrderedListIconButton,\n DeleteButton: OrderedListDeleteButton,\n ExpandCaret: OrderedListExpandCaret,\n};\n\nexport type { OrderedListDetailItemProps, OrderedListItemProps, OrderedListRootProps, OrderedListViewportProps };\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { useAtomValue } from '@effect-atom/atom-react';\nimport React, { useMemo } from 'react';\n\nimport { Treegrid, type TreegridRootProps } from '../Treegrid';\nimport { type TreeModel, TreeProvider } from './TreeContext';\nimport { TreeItemById, type TreeItemByIdProps, type TreeItemProps } from './TreeItem';\n\nexport type TreeProps<T extends { id: string } = any> = {\n model: TreeModel<T>;\n rootId?: string;\n path?: string[];\n id: string;\n} & Partial<Pick<TreegridRootProps, 'gridTemplateColumns' | 'classNames'>> &\n Pick<\n TreeItemProps<T>,\n | 'draggable'\n | 'renderColumns'\n | 'blockInstruction'\n | 'canDrop'\n | 'canSelect'\n | 'onOpenChange'\n | 'onSelect'\n | 'onItemHover'\n | 'levelOffset'\n >;\n\n/** Renders a single root-level child. */\nconst TreeChild = <T extends { id: string } = any>({\n id,\n path: parentPath,\n last,\n ...childProps\n}: TreeItemByIdProps & { last: boolean }) => {\n return <TreeItemById id={id} path={parentPath} last={last} {...childProps} />;\n};\n\nexport const Tree = <T extends { id: string } = any>({\n classNames,\n model,\n rootId,\n path,\n id,\n draggable = false,\n gridTemplateColumns = '[tree-row-start] minmax(0, 1fr) min-content [tree-row-end]',\n levelOffset,\n renderColumns,\n blockInstruction,\n canDrop,\n canSelect,\n onOpenChange,\n onSelect,\n onItemHover,\n}: TreeProps<T>) => {\n const childIds = useAtomValue(model.childIds(rootId));\n const treePath = useMemo(() => (path ? [...path, id] : [id]), [id, path]);\n\n const childProps: Omit<TreeItemByIdProps, 'id' | 'last'> = {\n path: treePath,\n levelOffset,\n draggable,\n renderColumns,\n blockInstruction,\n canDrop,\n canSelect,\n onOpenChange,\n onSelect,\n onItemHover,\n };\n\n return (\n <Treegrid.Root gridTemplateColumns={gridTemplateColumns} classNames={classNames}>\n <TreeProvider value={model}>\n {childIds.map((childId, index) => (\n <TreeChild key={childId} id={childId} last={index === childIds.length - 1} {...childProps} />\n ))}\n </TreeProvider>\n </Treegrid.Root>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { type Scope, createContextScope } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport React, {\n type ComponentPropsWithRef,\n type CSSProperties,\n type KeyboardEvent,\n forwardRef,\n useCallback,\n} from 'react';\n\nimport { type ThemedClassName, composable, composableProps } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\nimport { treegridTheme } from './Treegrid.theme';\n\n// TODO(thure): https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/treegrid_role\n\nconst styles = treegridTheme.styles();\n\nconst TREEGRID_ROW_NAME = 'Treegrid.Row';\n\ntype TreegridRowScopedProps<P> = P & { __treegridRowScope?: Scope };\n\nconst [createTreegridRowContext, createTreegridRowScope] = createContextScope(TREEGRID_ROW_NAME, []);\n\ntype TreegridRowContextValue = {\n open?: boolean;\n onOpenChange?: (nextOpen: boolean) => void;\n};\n\nconst [TreegridRowProvider, useTreegridRowContext] =\n createTreegridRowContext<TreegridRowContextValue>(TREEGRID_ROW_NAME);\n\n// TODO(burdon): Replace with functions.\nexport const TREEGRID_PATH_SEPARATOR = '~';\nexport const TREEGRID_PARENT_OF_SEPARATOR = ' ';\n\ntype TreegridRootProps = ThemedClassName<ComponentPropsWithRef<typeof Primitive.div>> & {\n gridTemplateColumns?: CSSProperties['gridTemplateColumns'];\n asChild?: boolean;\n};\n\nconst TreegridRoot = composable<HTMLDivElement, TreegridRootProps>(\n ({ asChild, classNames, children, style, gridTemplateColumns, onKeyDown: onKeyDownProp, ...props }, forwardedRef) => {\n const { className, role: _role, ...rest } = composableProps<HTMLDivElement>(props, { classNames });\n const Comp = asChild ? Slot : Primitive.div;\n const { findFirstFocusable } = useFocusFinders();\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n switch (event.key) {\n case 'ArrowDown':\n case 'ArrowUp': {\n const direction = event.key === 'ArrowDown' ? 'down' : 'up';\n const target = event.target as HTMLElement;\n\n // Find ancestor with data-arrow-keys containing the relevant direction.\n const ancestorWithArrowKeys = target.closest(`[data-arrow-keys*=\"${direction}\"], [data-arrow-keys=\"all\"]`);\n\n // If no ancestor with data-arrow-keys found, proceed with row navigation.\n if (!ancestorWithArrowKeys) {\n // Find the closest row\n const currentRow = target.closest('[role=\"row\"]');\n if (currentRow) {\n // Find the treegrid container.\n const treegrid = currentRow.closest('[role=\"treegrid\"]');\n if (treegrid) {\n // Get all rows in the treegrid.\n const rows = Array.from(treegrid.querySelectorAll('[role=\"row\"]'));\n const currentIndex = rows.indexOf(currentRow as Element);\n\n // Find next or previous row.\n const nextIndex = direction === 'down' ? currentIndex + 1 : currentIndex - 1;\n const targetRow = rows[nextIndex];\n\n if (targetRow) {\n // Focus the first focusable element in the target row.\n const firstFocusable = findFirstFocusable(targetRow as HTMLElement);\n if (firstFocusable) {\n event.preventDefault();\n firstFocusable.focus();\n }\n }\n }\n }\n }\n break;\n }\n }\n onKeyDownProp?.(event);\n },\n [findFirstFocusable, onKeyDownProp],\n );\n\n return (\n <Comp\n role='treegrid'\n {...rest}\n className={styles.root({ class: mx(className) })}\n style={{ ...style, gridTemplateColumns }}\n onKeyDown={handleKeyDown}\n ref={forwardedRef}\n >\n {children}\n </Comp>\n );\n },\n);\n\ntype TreegridRowProps = ThemedClassName<ComponentPropsWithRef<typeof Primitive.div>> & {\n id: string;\n asChild?: boolean;\n parentOf?: string;\n defaultOpen?: boolean;\n open?: boolean;\n onOpenChange?(open: boolean): void;\n};\n\nconst TreegridRow = forwardRef<HTMLDivElement, TreegridRowScopedProps<TreegridRowProps>>(\n (\n {\n __treegridRowScope,\n asChild,\n classNames,\n children,\n id,\n parentOf,\n open: propsOpen,\n defaultOpen,\n onOpenChange: propsOnOpenChange,\n ...props\n },\n forwardedRef,\n ) => {\n const Comp = asChild ? Slot : Primitive.div;\n const pathParts = id.split(TREEGRID_PATH_SEPARATOR);\n const level = pathParts.length - 1;\n const [open, onOpenChange] = useControllableState({\n prop: propsOpen,\n onChange: propsOnOpenChange,\n defaultProp: defaultOpen,\n });\n\n return (\n <TreegridRowProvider open={open} onOpenChange={onOpenChange} scope={__treegridRowScope}>\n <Comp\n role='row'\n aria-level={level}\n className={styles.row({ class: mx(treegridTheme.rowLevel(level), classNames) })}\n {...(parentOf && { 'aria-expanded': open, 'aria-owns': parentOf })}\n {...props}\n id={id}\n ref={forwardedRef}\n >\n {children}\n </Comp>\n </TreegridRowProvider>\n );\n },\n);\n\ntype TreegridCellProps = ThemedClassName<ComponentPropsWithRef<typeof Primitive.div>> & { indent?: boolean };\n\nconst TreegridCell = forwardRef<HTMLDivElement, TreegridCellProps>(\n ({ classNames, children, indent, ...props }, forwardedRef) => {\n return (\n <div role='gridcell' className={styles.cell({ indent, class: mx(classNames) })} {...props} ref={forwardedRef}>\n {children}\n </div>\n );\n },\n);\n\nexport type { TreegridRootProps, TreegridRowProps };\n\nexport const Treegrid = {\n Root: TreegridRoot,\n Row: TreegridRow,\n Cell: TreegridCell,\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { tv } from '@dxos/ui-theme';\n\n// Per-level indentation of the first `.indent` cell, plus a bolder root row. Clamped to 1–8.\nconst levelStyles = new Map<number, string>([\n [1, '[&>.indent:first-of-type]:pl-0 font-medium'],\n [2, '[&>.indent:first-of-type]:pl-0'],\n [3, '[&>.indent:first-of-type]:pl-1'],\n [4, '[&>.indent:first-of-type]:pl-2'],\n [5, '[&>.indent:first-of-type]:pl-3'],\n [6, '[&>.indent:first-of-type]:pl-4'],\n [7, '[&>.indent:first-of-type]:pl-5'],\n [8, '[&>.indent:first-of-type]:pl-6'],\n]);\n\nconst treegridStyles = tv({\n slots: {\n root: 'grid',\n row: '',\n cell: '',\n },\n variants: {\n // `indent` marks the cell that carries the per-level left padding (selected via `.indent`).\n indent: {\n true: { cell: 'indent' },\n },\n },\n});\n\n/** Self-contained {@link Treegrid} theme (tailwind-variants), plus the level→row-class lookup. */\nexport const treegridTheme = {\n styles: treegridStyles,\n /** Row class for a 1-based depth level (clamped to 1–8). */\n rowLevel: (level: number): string => levelStyles.get(Math.min(Math.max(Math.round(level), 1), 8)) ?? '',\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { type Atom } from '@effect-atom/atom-react';\nimport { createContext, useContext } from 'react';\n\nimport { raise } from '@dxos/debug';\nimport { type Label } from '@dxos/react-ui';\n\nexport type TreeItemDataProps = {\n id: string;\n label: Label;\n parentOf?: string[];\n /** Pass-through of the node's disposition; the tree uses this to branch render mode (e.g. `'group'` → section header). */\n disposition?: string;\n /** When `false`, the item cannot be dragged (overrides tree-level `draggable`). */\n draggable?: boolean;\n /** When `false`, the item does not participate as a drop target. */\n droppable?: boolean;\n className?: string;\n headingClassName?: string;\n icon?: string;\n iconHue?: string;\n disabled?: boolean;\n testId?: string;\n /** Optional item count rendered as a neutral badge directly after the label. */\n count?: number;\n /** Optional count of new/modified items; when greater than zero it shows as a rose badge in place of `count`. */\n modifiedCount?: number;\n};\n\nexport interface TreeModel<T extends { id: string } = any> {\n /** Atom family: resolve item by ID (content). */\n item: (id: string) => Atom.Atom<T | undefined>;\n /** Atom family: open state keyed by path. */\n itemOpen: (path: string[]) => Atom.Atom<boolean>;\n /** Atom family: current (selected) state keyed by path. */\n itemCurrent: (path: string[]) => Atom.Atom<boolean>;\n /** Atom family: display props for an item at a given path (path includes item's own ID at end). */\n itemProps: (path: string[]) => Atom.Atom<TreeItemDataProps>;\n /** Atom family: outbound child IDs for a parent ID (topology). Undefined = root. */\n childIds: (parentId?: string) => Atom.Atom<string[]>;\n}\n\nconst TreeContext = createContext<TreeModel | null>(null);\n\nexport const TreeProvider = TreeContext.Provider;\n\nexport const useTree = () => useContext(TreeContext) ?? raise(new Error('TreeContext not found'));\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport {\n type Instruction,\n type ItemMode,\n attachInstruction,\n extractInstruction,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport { draggable, dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { useAtomValue } from '@effect-atom/atom-react';\nimport * as Schema from 'effect/Schema';\nimport React, {\n type FC,\n type KeyboardEvent,\n type MouseEvent,\n memo,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { invariant } from '@dxos/invariant';\nimport { type Label, toLocalizedString, useTranslation } from '@dxos/react-ui';\nimport {\n ghostFocusWithin,\n ghostHover,\n hoverableControls,\n hoverableFocusedKeyboardControls,\n hoverableFocusedWithinControls,\n mx,\n} from '@dxos/ui-theme';\n\nimport { Treegrid, TREEGRID_PARENT_OF_SEPARATOR } from '../Treegrid';\nimport { DEFAULT_INDENTATION, paddingIndentation } from './helpers';\nimport { useTree } from './TreeContext';\nimport { TreeDropIndicator } from './TreeDropIndicator';\nimport { TreeItemHeading } from './TreeItemHeading';\nimport { TreeItemToggle } from './TreeItemToggle';\n\nconst hoverableDescriptionIcons =\n '[--icons-color:inherit] hover-hover:[--icons-color:var(--description-text)] hover-hover:hover:[--icons-color:inherit] focus-within:[--icons-color:inherit]';\n\n/** Renders a section-group label spanning the full tree row. Used when a node has `disposition === 'group'`. */\nconst NavTreeSectionHeader = ({ label }: { label: Label }) => {\n const { t } = useTranslation();\n return (\n <div\n role='heading'\n aria-level={2}\n className='col-[tree-row] pl-7 pt-3 pb-0.5 text-xs uppercase tracking-widest text-subdued hover:text-description select-none'\n >\n {toLocalizedString(label, t)}\n </div>\n );\n};\n\ntype TreeItemDragState = 'idle' | 'dragging' | 'preview' | 'parent-of-instruction';\n\nexport const TreeDataSchema = Schema.Struct({\n id: Schema.String,\n path: Schema.Array(Schema.String),\n item: Schema.Any,\n});\n\nexport type TreeData = Schema.Schema.Type<typeof TreeDataSchema>;\nexport const isTreeData = (data: unknown): data is TreeData => Schema.is(TreeDataSchema)(data);\n\nexport type ColumnRenderer<T extends { id: string } = any> = FC<{\n item: T;\n path: string[];\n open: boolean;\n menuOpen: boolean;\n setMenuOpen: (open: boolean) => void;\n}>;\n\nexport type TreeItemProps<T extends { id: string } = any> = {\n item: T;\n path: string[];\n levelOffset?: number;\n last: boolean;\n draggable?: boolean;\n renderColumns?: ColumnRenderer<T>;\n blockInstruction?: (params: { instruction: Instruction; source: TreeData; target: TreeData }) => boolean;\n canDrop?: (params: { source: TreeData; target: TreeData }) => boolean;\n canSelect?: (params: { item: T; path: string[] }) => boolean;\n onOpenChange?: (params: { item: T; path: string[]; open: boolean }) => void;\n onSelect?: (params: { item: T; path: string[]; current: boolean; option: boolean }) => void;\n onItemHover?: (params: { item: T }) => void;\n};\n\nconst RawTreeItem = <T extends { id: string } = any>({\n item,\n path: pathProp,\n levelOffset = 2,\n last,\n draggable: draggableProp,\n renderColumns: Columns,\n blockInstruction,\n canDrop,\n canSelect,\n onOpenChange,\n onSelect,\n onItemHover,\n}: TreeItemProps<T>) => {\n const rowRef = useRef<HTMLDivElement | null>(null);\n const buttonRef = useRef<HTMLButtonElement | null>(null);\n const openRef = useRef(false);\n const cancelExpandRef = useRef<NodeJS.Timeout | null>(null);\n const [_state, setState] = useState<TreeItemDragState>('idle');\n const [instruction, setInstruction] = useState<Instruction | null>(null);\n const [menuOpen, setMenuOpen] = useState(false);\n\n const {\n itemProps: itemPropsAtom,\n childIds: childIdsAtom,\n itemOpen: itemOpenAtom,\n itemCurrent: itemCurrentAtom,\n } = useTree();\n const path = useMemo(() => [...pathProp, item.id], [pathProp, item.id]);\n\n const {\n id,\n parentOf,\n disposition,\n draggable: itemDraggable,\n droppable: itemDroppable,\n label,\n className,\n headingClassName,\n icon,\n iconHue,\n disabled,\n testId,\n count,\n modifiedCount,\n } = useAtomValue(itemPropsAtom(path));\n const childIds = useAtomValue(childIdsAtom(item.id));\n const open = useAtomValue(itemOpenAtom(path));\n const current = useAtomValue(itemCurrentAtom(path));\n\n const level = path.length - levelOffset;\n const isBranch = !!parentOf;\n const mode: ItemMode = last ? 'last-in-group' : open ? 'expanded' : 'standard';\n const canSelectItem = canSelect?.({ item, path }) ?? true;\n const data = { id, path, item } satisfies TreeData;\n const shouldSeedNativeDragData = typeof document !== 'undefined' && document.body.hasAttribute('data-platform');\n\n const cancelExpand = useCallback(() => {\n if (cancelExpandRef.current) {\n clearTimeout(cancelExpandRef.current);\n cancelExpandRef.current = null;\n }\n }, []);\n\n const isItemDraggable = draggableProp && itemDraggable !== false;\n const isItemDroppable = itemDroppable !== false;\n const nativeDragText = id;\n\n useEffect(() => {\n if (!draggableProp || (!isItemDraggable && !isItemDroppable)) {\n return;\n }\n\n invariant(buttonRef.current);\n\n const makeDraggable = () =>\n draggable({\n element: buttonRef.current!,\n getInitialData: () => data,\n getInitialDataForExternal: () => {\n if (!shouldSeedNativeDragData) {\n return {};\n }\n return { 'text/plain': nativeDragText };\n },\n onDragStart: () => {\n setState('dragging');\n if (open) {\n openRef.current = true;\n onOpenChange?.({ item, path, open: false });\n }\n },\n onDrop: () => {\n setState('idle');\n if (openRef.current) {\n onOpenChange?.({ item, path, open: true });\n }\n },\n });\n\n if (!isItemDroppable) {\n return isItemDraggable ? makeDraggable() : undefined;\n }\n\n const dropTarget = dropTargetForElements({\n element: buttonRef.current,\n getData: ({ input, element }) => {\n return attachInstruction(data, {\n input,\n element,\n indentPerLevel: DEFAULT_INDENTATION,\n currentLevel: level,\n mode,\n block: isBranch ? [] : ['make-child'],\n });\n },\n canDrop: ({ source }) => {\n const _canDrop = canDrop ?? (() => true);\n return source.element !== buttonRef.current && _canDrop({ source: source.data as TreeData, target: data });\n },\n getIsSticky: () => true,\n onDrag: ({ self, source }) => {\n const desired = extractInstruction(self.data);\n const block =\n desired && blockInstruction?.({ instruction: desired, source: source.data as TreeData, target: data });\n const instruction: Instruction | null =\n block && desired.type !== 'instruction-blocked' ? { type: 'instruction-blocked', desired } : desired;\n\n if (source.data.id !== id) {\n if (instruction?.type === 'make-child' && isBranch && !open && !cancelExpandRef.current) {\n cancelExpandRef.current = setTimeout(() => {\n onOpenChange?.({ item, path, open: true });\n }, 500);\n }\n\n if (instruction?.type !== 'make-child') {\n cancelExpand();\n }\n\n setInstruction(instruction);\n } else if (instruction?.type === 'reparent') {\n // TODO(wittjosiah): This is not occurring in the current implementation.\n setInstruction(instruction);\n } else {\n setInstruction(null);\n }\n },\n onDragLeave: () => {\n cancelExpand();\n setInstruction(null);\n },\n onDrop: () => {\n cancelExpand();\n setInstruction(null);\n },\n });\n\n if (!isItemDraggable) {\n return dropTarget;\n }\n\n // https://atlassian.design/components/pragmatic-drag-and-drop/core-package/adapters/element/about\n return combine(makeDraggable(), dropTarget);\n }, [draggableProp, isItemDraggable, isItemDroppable, item, id, mode, path, open, blockInstruction, canDrop]);\n\n // Cancel expand on unmount.\n useEffect(() => () => cancelExpand(), [cancelExpand]);\n\n const handleOpenToggle = useCallback(\n () => onOpenChange?.({ item, path, open: !open }),\n [onOpenChange, item, path, open],\n );\n\n const handleSelect = useCallback(\n (option = false) => {\n // If the item is a branch, toggle it if:\n // - also holding down the option key\n // - or the item is currently selected\n if (isBranch && (option || current)) {\n handleOpenToggle();\n } else if (canSelectItem) {\n canSelect?.({ item, path });\n rowRef.current?.focus();\n onSelect?.({ item, path, current: !current, option });\n }\n },\n [item, path, current, isBranch, canSelectItem, handleOpenToggle, onSelect],\n );\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent) => {\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowLeft':\n isBranch && handleOpenToggle();\n break;\n }\n },\n [isBranch, open, handleOpenToggle, handleSelect],\n );\n\n const handleItemHover = useCallback(() => {\n onItemHover?.({ item });\n }, [onItemHover, item]);\n\n const handleContextMenu = useCallback(\n (event: MouseEvent) => {\n event.preventDefault();\n setMenuOpen(true);\n },\n [setMenuOpen],\n );\n\n const childProps = {\n draggable: draggableProp,\n renderColumns: Columns,\n blockInstruction,\n canDrop,\n canSelect,\n onItemHover,\n onOpenChange,\n onSelect,\n };\n\n // Group nodes render as a flat section header with their children always expanded at the same visual level.\n // Suppress the header entirely when there are no children to avoid orphaned section labels.\n if (disposition === 'group') {\n if (childIds.length === 0) {\n return null;\n }\n return (\n <>\n <NavTreeSectionHeader label={label} />\n {childIds.map((childId, index) => (\n <TreeItemById\n key={childId}\n id={childId}\n path={path}\n last={index === childIds.length - 1}\n levelOffset={levelOffset + 1}\n {...childProps}\n />\n ))}\n </>\n );\n }\n\n return (\n <>\n <Treegrid.Row\n ref={rowRef}\n key={id}\n id={id}\n aria-labelledby={`${id}__label`}\n parentOf={parentOf?.join(TREEGRID_PARENT_OF_SEPARATOR)}\n data-object-id={id}\n data-testid={testId}\n // NOTE(thure): This is intentionally an empty string to for descendents to select by in the CSS\n // without alerting the user (except for in the correct link element). See also:\n // https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current#description\n aria-current={current ? ('' as 'page') : undefined}\n classNames={mx(\n 'grid grid-cols-subgrid col-[tree-row] mt-0.5 is-current:bg-current-surface',\n // Highlight the row while a descendant marks an open popover anchor (e.g. inline rename).\n 'has-[[data-popover-anchor]]:bg-current-surface',\n hoverableControls,\n hoverableFocusedKeyboardControls,\n hoverableFocusedWithinControls,\n hoverableDescriptionIcons,\n ghostFocusWithin,\n ghostHover,\n className,\n )}\n onKeyDown={handleKeyDown}\n onMouseEnter={handleItemHover}\n onContextMenu={handleContextMenu}\n >\n <div className='indent relative grid grid-cols-subgrid col-[tree-row]' style={paddingIndentation(level)}>\n <Treegrid.Cell classNames='flex items-center'>\n <TreeItemToggle isBranch={isBranch} open={open} onClick={handleOpenToggle} />\n <TreeItemHeading\n disabled={disabled}\n current={current}\n label={label}\n className={headingClassName}\n icon={icon}\n iconHue={iconHue}\n count={count}\n modifiedCount={modifiedCount}\n onSelect={handleSelect}\n ref={buttonRef}\n />\n </Treegrid.Cell>\n {Columns && <Columns item={item} path={path} open={open} menuOpen={menuOpen} setMenuOpen={setMenuOpen} />}\n {instruction && <TreeDropIndicator instruction={instruction} gap={2} />}\n </div>\n </Treegrid.Row>\n {open &&\n childIds.map((childId, index) => (\n <TreeItemById key={childId} id={childId} path={path} last={index === childIds.length - 1} {...childProps} />\n ))}\n </>\n );\n};\n\nexport const TreeItem = memo(RawTreeItem) as FC<TreeItemProps>;\n\n/** Resolves a child ID to an item via the `item` atom and renders a TreeItem. */\nexport type TreeItemByIdProps = Omit<TreeItemProps, 'item'> & { id: string };\n\nconst RawTreeItemById = <T extends { id: string } = any>({ id, ...props }: TreeItemByIdProps) => {\n const { item: itemAtom } = useTree();\n const item = useAtomValue(itemAtom(id)) as T | undefined;\n if (!item) {\n return null;\n }\n return <TreeItem item={item} {...props} />;\n};\n\nexport const TreeItemById = memo(RawTreeItemById) as FC<TreeItemByIdProps>;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nexport const DEFAULT_INDENTATION = 8;\n\nexport const paddingIndentation = (level: number, indentation = DEFAULT_INDENTATION) => ({\n paddingInlineStart: `${(level - 1) * indentation}px`,\n});\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { type Instruction } from '@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item';\nimport React, { type CSSProperties, type HTMLAttributes } from 'react';\n\n// Tree-item instruction indicator. Atlaskit's `react-drop-indicator` ships `box`/`list-item`\n// renderers but no `tree-item` one, so this stays a small Tailwind port (theme-aware via\n// `bg-accent-bg`). See `react-ui-list/AUDIT.md` D4.\n// https://github.com/atlassian/pragmatic-drag-and-drop/blob/main/packages/hitbox/constellation/index/about.mdx#tree-item\n\ntype InstructionType = Exclude<Instruction, { type: 'instruction-blocked' }>['type'];\ntype Orientation = 'sibling' | 'child';\n\nconst edgeToOrientationMap: Record<InstructionType, Orientation> = {\n 'reorder-above': 'sibling',\n 'reorder-below': 'sibling',\n 'make-child': 'child',\n 'reparent': 'child',\n};\n\nconst orientationStyles: Record<Orientation, HTMLAttributes<HTMLElement>['className']> = {\n sibling:\n 'h-(--line-thickness) left-(--horizontal-indent) right-0 bg-accent-bg before:left-(--negative-terminal-size)',\n child: 'inset-0 border-[length:var(--line-thickness)] before:invisible',\n};\n\nconst instructionStyles: Record<InstructionType, HTMLAttributes<HTMLElement>['className']> = {\n 'reorder-above': 'top-(--line-offset) before:top-(--offset-terminal)',\n 'reorder-below': 'bottom-(--line-offset) before:bottom-(--offset-terminal)',\n 'make-child': 'border-accent-bg',\n 'reparent': '',\n};\n\nconst strokeSize = 2;\nconst terminalSize = 8;\nconst offsetToAlignTerminalWithLine = (strokeSize - terminalSize) / 2;\n\n/** Props for {@link TreeDropIndicator}. */\nexport type TreeDropIndicatorProps = {\n instruction: Instruction;\n gap?: number;\n};\n\n/** Themed drop indicator for a tree-item pragmatic-dnd `Instruction` (sibling reorder / make-child). */\nexport const TreeDropIndicator = ({ instruction, gap = 0 }: TreeDropIndicatorProps) => {\n const lineOffset = `calc(-0.5 * (${gap}px + ${strokeSize}px))`;\n const isBlocked = instruction.type === 'instruction-blocked';\n const desiredInstruction = isBlocked ? instruction.desired : instruction;\n const orientation = edgeToOrientationMap[desiredInstruction.type];\n if (isBlocked) {\n return null;\n }\n\n return (\n <div\n style={\n {\n '--line-thickness': `${strokeSize}px`,\n '--line-offset': `${lineOffset}`,\n '--terminal-size': `${terminalSize}px`,\n '--terminal-radius': `${terminalSize / 2}px`,\n '--negative-terminal-size': `-${terminalSize}px`,\n '--offset-terminal': `${offsetToAlignTerminalWithLine}px`,\n '--horizontal-indent': `${desiredInstruction.currentLevel * desiredInstruction.indentPerLevel + 4}px`,\n } as CSSProperties\n }\n className={`absolute z-10 pointer-events-none before:w-(--terminal-size) before:h-(--terminal-size) box-border before:absolute before:border-[length:--line-thickness] before:border-solid before:border-accent-bg before:rounded-full ${orientationStyles[orientation]} ${instructionStyles[desiredInstruction.type]}`}\n ></div>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { type KeyboardEvent, type MouseEvent, forwardRef, memo, useCallback } from 'react';\n\nimport { Button, Icon, type Label, Tag, TextTooltip, toLocalizedString, useTranslation } from '@dxos/react-ui';\nimport { getStyles } from '@dxos/ui-theme';\n\n// TODO(wittjosiah): Consider whether there should be a separate disabled prop which was visually distinct\n// rather than just making the item unselectable.\nexport type TreeItemHeadingProps = {\n label: Label;\n className?: string;\n icon?: string;\n iconHue?: string;\n disabled?: boolean;\n current?: boolean;\n /** Optional item count rendered as a neutral badge directly after the label. */\n count?: number;\n /** Optional count of new/modified items; when greater than zero it replaces {@link count} with a rose badge. */\n modifiedCount?: number;\n onSelect?: (option: boolean) => void;\n};\n\nexport const TreeItemHeading = memo(\n forwardRef<HTMLButtonElement, TreeItemHeadingProps>(\n ({ label, className, icon, iconHue, disabled, current, count, modifiedCount, onSelect }, forwardedRef) => {\n const { t } = useTranslation();\n const styles = iconHue ? getStyles(iconHue) : undefined;\n\n const handleSelect = useCallback(\n (event: MouseEvent) => {\n onSelect?.(event.altKey);\n },\n [onSelect],\n );\n\n const handleButtonKeydown = useCallback(\n (event: KeyboardEvent) => {\n if (event.key === ' ' || event.key === 'Enter') {\n event.preventDefault();\n event.stopPropagation();\n onSelect?.(event.altKey);\n }\n },\n [onSelect],\n );\n\n return (\n <TextTooltip\n text={toLocalizedString(label, t)}\n side='bottom'\n truncateQuery='span[data-tooltip]'\n onlyWhenTruncating\n asChild\n ref={forwardedRef}\n >\n <Button\n data-testid='treeItem.heading'\n variant='ghost'\n classNames={[\n 'grow shrink min-w-0 justify-start gap-2 ps-0.5 hover:bg-transparent dark:hover:bg-transparent',\n 'disabled:cursor-default disabled:opacity-100',\n className,\n ]}\n disabled={disabled}\n onClick={handleSelect}\n onKeyDown={handleButtonKeydown}\n {...(current && { 'aria-current': 'location' })}\n >\n {icon && <Icon size={5} icon={icon ?? 'ph--circle-dashed--regular'} classNames={['my-1', styles?.text]} />}\n <span className='min-w-0 truncate text-start font-normal' data-tooltip>\n {toLocalizedString(label, t)}\n </span>\n <CountBadge count={count} modifiedCount={modifiedCount} />\n </Button>\n </TextTooltip>\n );\n },\n ),\n);\n\n/**\n * Renders the count badge after a tree item label.\n * A positive `modifiedCount` (e.g. new/unread items) shows as a rose badge in place of the neutral total `count`.\n */\nconst CountBadge = ({ count, modifiedCount }: Pick<TreeItemHeadingProps, 'count' | 'modifiedCount'>) => {\n if (typeof modifiedCount === 'number' && modifiedCount > 0) {\n return (\n <Tag hue='rose' classNames='shrink-0 text-center [min-inline-size:1.5rem] tabular-nums'>\n {modifiedCount}\n </Tag>\n );\n }\n\n if (typeof count === 'number') {\n return (\n <Tag hue='neutral' classNames='shrink-0 text-center [min-inline-size:1.5rem] tabular-nums'>\n {count}\n </Tag>\n );\n }\n\n return null;\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { forwardRef, memo } from 'react';\n\nimport { IconButton, type IconButtonProps } from '@dxos/react-ui';\n\nexport type TreeItemToggleProps = Omit<IconButtonProps, 'icon' | 'size' | 'label'> & {\n open?: boolean;\n isBranch?: boolean;\n hidden?: boolean;\n};\n\nexport const TreeItemToggle = memo(\n forwardRef<HTMLButtonElement, TreeItemToggleProps>(\n ({ classNames, open, isBranch, hidden, ...props }, forwardedRef) => {\n return (\n <IconButton\n ref={forwardedRef}\n data-testid='treeItem.toggle'\n aria-expanded={open}\n variant='ghost'\n density='md'\n classNames={[\n 'h-full w-6 px-0',\n '[&_svg]:transition-transform [&_svg]:duration-200',\n open ? '[&_svg]:rotate-90' : '[&_svg]:rotate-0',\n hidden ? 'hidden' : !isBranch && 'invisible',\n classNames,\n ]}\n size={3}\n icon='ph--caret-right--bold'\n iconOnly\n noTooltip\n label={open ? 'Click to close' : 'Click to open'}\n tabIndex={-1}\n {...props}\n />\n );\n },\n ),\n);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nconst SEPARATOR = '+';\n\nexport const Path = {\n create: (...args: string[]) => args.join(SEPARATOR),\n\n parts: (path: string) => path.split(SEPARATOR),\n length: (path: string) => path.split(SEPARATOR).length,\n first: (path: string) => path.split(SEPARATOR)[0] ?? path,\n last: (path: string) => path.split(SEPARATOR).at(-1) ?? path,\n parent: (path: string) => path.split(SEPARATOR).slice(0, -1).join(SEPARATOR),\n\n hasRoot: (path: string, id: string) => Path.first(path) === id,\n hasChild: (path: string, compare: string) => Path.parent(compare) === path,\n hasDescendent: (path: string, compare: string) => compare !== path && compare.startsWith(path),\n siblings: (path: string, compare: string) => Path.parent(path) === Path.parent(compare),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"useState", "isMulti", "value", "Set", "useListDisclosure", "opts", "mode", "defaultValue", "onValueChange", "idPrefix", "wasControlledRef", "Object", "prototype", "hasOwnProperty", "call", "current", "isControlled", "internalValue", "setInternalValue", "resolvedValue", "isExpanded", "id", "has", "setExpanded", "expanded", "computeNext", "next", "add", "delete", "undefined", "bind", "triggerId", "panelId", "toggle", "triggerProps", "panelProps", "useMemo", "useListGrid", "actionSlots", "expandable", "trailing", "gridTemplateColumns", "tracks", "index", "push", "join", "rowProps", "className", "style", "useArrowNavigationGroup", "useCallback", "useMemo", "containerRoleByMode", "list", "listbox", "grid", "itemRoleByMode", "defaultAxisByMode", "findListboxEntryTarget", "container", "querySelector", "useListNavigation", "mode", "axis", "memorizeCurrent", "tabsterAttrs", "handleFocus", "event", "target", "currentTarget", "focus", "orientation", "undefined", "containerProps", "role", "onFocus", "itemRole", "itemTabIndex", "itemProps", "disabled", "tabIndex", "useCallback", "useEffect", "useRef", "useState", "isMulti", "value", "Set", "useListSelection", "opts", "mode", "defaultValue", "onValueChange", "followsFocus", "wasControlledRef", "Object", "prototype", "hasOwnProperty", "call", "current", "isControlled", "internalValue", "setInternalValue", "resolvedValue", "setResolvedValue", "next", "isSelected", "id", "has", "setSelected", "selected", "add", "delete", "undefined", "followFocusDefault", "trackFocus", "bind", "disabled", "toggle", "rowProps", "onFocus", "event", "container", "currentTarget", "closest", "contains", "relatedTarget", "autoScrollForElements", "attachClosestEdge", "extractClosestEdge", "getReorderDestinationIndex", "combine", "draggable", "dropTargetForElements", "monitorForElements", "setCustomNativeDragPreview", "useCallback", "useEffect", "useMemo", "useRef", "useState", "REORDER_LIST_KEY", "reorderListIdCounter", "allocateReorderListId", "IDLE", "type", "useReorderList", "items", "getId", "onMove", "axis", "readonly", "getInitialData", "canDrop", "getDragPreview", "listIdRef", "current", "listId", "itemsRef", "getIdRef", "onMoveRef", "canDropRef", "getInitialDataRef", "getDragPreviewRef", "readonlyRef", "active", "setActive", "findIndex", "id", "item", "findIndexFromPayload", "data", "canMonitor", "source", "onDrop", "location", "target", "dropTargets", "sourceIdx", "targetIdx", "destinationIndex", "closestEdgeOfTarget", "startIndex", "indexOfTarget", "controller", "getItem", "index", "bindItem", "refs", "onItemState", "lookup", "allowedEdges", "element", "row", "dragHandle", "handle", "canDrag", "onGenerateDragPreview", "nativeSetDragImage", "rect", "getBoundingClientRect", "getOffset", "container", "x", "y", "height", "render", "style", "width", "undefined", "onDragStart", "getData", "input", "getIsSticky", "onDragEnter", "self", "closestEdge", "onDrag", "onDragLeave", "useReorderItem", "state", "setState", "rowElement", "handleElement", "cleanupRef", "tryRegister", "teardown", "rowRef", "node", "handleRef", "isDragging", "useReorderAutoScroll", "AccordionPrimitive", "createContext", "React", "Icon", "mx", "tv", "listStyles", "slots", "accordionItem", "accordionTrigger", "accordionTriggerIcon", "accordionTriggerContent", "accordionBody", "accordionBodyContent", "listboxViewport", "listboxContent", "listboxItem", "listboxItemLabel", "orderedListViewport", "orderedListContent", "orderedListItem", "orderedListDetailColumn", "orderedListDetailTitleRow", "orderedListDetailPanel", "orderedListTitle", "pickerItem", "comboboxInput", "comboboxList", "comboboxTriggerText", "comboboxItem", "comboboxItemDescription", "itemContentRoot", "itemContentIcon", "itemContentTitle", "itemContentDescription", "empty", "listTheme", "styles", "listSlots", "Object", "keys", "AccordionPrimitive", "createContext", "React", "mx", "ACCORDION_NAME", "AccordionProvider", "useAccordionContext", "defaultGetId", "item", "id", "AccordionRoot", "classNames", "items", "getId", "children", "value", "defaultValue", "onValueChange", "Root", "type", "className", "ACCORDION_ITEM_NAME", "styles", "listTheme", "AccordionItemProvider", "useDxAccordionItemContext", "createContext", "AccordionItem", "children", "classNames", "item", "getId", "useAccordionContext", "React", "Item", "value", "className", "accordionItem", "class", "mx", "AccordionItemHeader", "icon", "hover", "props", "Header", "Trigger", "accordionTrigger", "span", "accordionTriggerIcon", "Icon", "size", "div", "accordionTriggerContent", "AccordionItemBody", "Content", "accordionBody", "accordionBodyContent", "Accordion", "Root", "AccordionRoot", "Item", "AccordionItem", "ItemHeader", "AccordionItemHeader", "ItemBody", "AccordionItemBody", "createContext", "useControllableState", "React", "forwardRef", "useCallback", "Button", "Icon", "Popover", "ScrollArea", "useId", "composable", "composableProps", "mx", "Slot", "React", "forwardRef", "useCallback", "useEffect", "useMemo", "useRef", "useState", "Input", "useThemeContext", "mx", "createContext", "PickerItemContextProvider", "usePickerItemContext", "PickerInputContextProvider", "usePickerInputContext", "styles", "listTheme", "PickerRoot", "children", "resetSelectionOnChange", "selectedValue", "setSelectedValue", "useState", "undefined", "itemsRef", "useRef", "Map", "itemVersion", "setItemVersion", "prevItemVersionRef", "useEffect", "itemsChanged", "current", "get", "isValid", "disabled", "size", "entries", "Array", "from", "filter", "data", "length", "sort", "a", "b", "position", "element", "compareDocumentPosition", "Node", "DOCUMENT_POSITION_FOLLOWING", "DOCUMENT_POSITION_PRECEDING", "firstValue", "registerItem", "useCallback", "value", "onSelect", "set", "v", "unregisterItem", "delete", "getItemValues", "map", "triggerSelect", "item", "itemContextValue", "useMemo", "onSelectedValueChange", "inputContextValue", "React", "PickerInputContextProvider", "PickerItemContextProvider", "displayName", "PickerInput", "forwardRef", "onValueChange", "onChange", "onKeyDown", "autoFocus", "props", "forwardedRef", "hasIosKeyboard", "useThemeContext", "usePickerInputContext", "handleChange", "event", "target", "handleKeyDown", "defaultPrevented", "values", "key", "currentIndex", "indexOf", "preventDefault", "nextIndex", "Math", "min", "nextValue", "prevIndex", "max", "prevValue", "lastValue", "Input", "Root", "TextInput", "ref", "PickerItem", "classNames", "asChild", "usePickerItemContext", "internalRef", "isSelected", "scrollIntoView", "block", "behavior", "handleClick", "handleMouseDown", "Comp", "Slot", "node", "role", "aria-selected", "aria-disabled", "data-selected", "data-disabled", "data-value", "tabIndex", "className", "pickerItem", "class", "mx", "onMouseDown", "onClick", "Picker", "Item", "styles", "listTheme", "COMBOBOX_NAME", "COMBOBOX_CONTENT_NAME", "COMBOBOX_ITEM_NAME", "COMBOBOX_TRIGGER_NAME", "ComboboxProvider", "useComboboxContext", "createContext", "ComboboxRoot", "children", "modal", "modalId", "modalIdProp", "open", "openProp", "defaultOpen", "onOpenChange", "propsOnOpenChange", "value", "valueProp", "defaultValue", "onValueChange", "propsOnValueChange", "placeholder", "useId", "useControllableState", "prop", "defaultProp", "onChange", "React", "Popover", "Root", "isCombobox", "ComboboxContent", "composable", "resetSelectionOnChange", "props", "forwardedRef", "Content", "composableProps", "id", "ref", "Viewport", "classNames", "Picker", "displayName", "ComboboxTrigger", "forwardRef", "onClick", "handleClick", "useCallback", "event", "Trigger", "asChild", "Button", "role", "aria-expanded", "aria-controls", "aria-haspopup", "span", "className", "comboboxTriggerText", "class", "Icon", "icon", "size", "ComboboxVirtualTrigger", "VirtualTrigger", "ComboboxInput", "Input", "comboboxInput", "ComboboxList", "ScrollArea", "comboboxList", "centered", "padding", "thin", "ComboboxItem", "onSelect", "label", "description", "iconClassNames", "checked", "suffix", "disabled", "closeOnSelect", "handleSelect", "undefined", "Item", "comboboxItem", "mx", "comboboxItemDescription", "ComboboxArrow", "Arrow", "ComboboxEmpty", "div", "ComboboxPortal", "Portal", "Combobox", "List", "Empty", "React", "edgeToOrientationMap", "top", "bottom", "left", "right", "orientationStyles", "horizontal", "vertical", "edgeStyles", "strokeSize", "terminalSize", "offsetToAlignTerminalWithLine", "DropIndicator", "edge", "gap", "lineInset", "terminalInset", "orientation", "div", "style", "className", "React", "Icon", "composable", "composableProps", "useTranslation", "osTranslations", "Empty", "label", "icon", "props", "forwardedRef", "t", "message", "defaultValue", "div", "classNames", "role", "ref", "size", "span", "displayName", "createContext", "React", "forwardRef", "useCallback", "useMemo", "List", "ListItem", "Icon", "ScrollArea", "composable", "composableProps", "mx", "React", "forwardRef", "Icon", "mx", "styles", "listTheme", "ListItemContent", "forwardRef", "classNames", "icon", "title", "description", "forwardedRef", "React", "div", "ref", "className", "itemContentRoot", "class", "mx", "itemContentIcon", "Icon", "size", "span", "itemContentTitle", "itemContentDescription", "displayName", "styles", "listTheme", "LISTBOX_NAME", "LISTBOX_ROOT_NAME", "LISTBOX_VIEWPORT_NAME", "LISTBOX_CONTENT_NAME", "LISTBOX_ITEM_NAME", "LISTBOX_ITEM_LABEL_NAME", "LISTBOX_INDICATOR_NAME", "ListboxProvider", "useListboxContext", "createContext", "ListboxItemProvider", "useListboxItemContext", "Root", "value", "defaultValue", "onValueChange", "autoFocus", "_autoFocus", "children", "selectable", "undefined", "selection", "useListSelection", "mode", "next", "context", "useMemo", "React", "displayName", "Viewport", "composable", "props", "forwardedRef", "thin", "padding", "centered", "rest", "ScrollArea", "composableProps", "classNames", "listboxViewport", "orientation", "ref", "Content", "navigation", "useListNavigation", "composed", "listboxContent", "List", "variant", "containerProps", "Item", "id", "disabled", "onClick", "onFocus", "onMouseDown", "binding", "bind", "selected", "interactive", "handleClick", "useCallback", "event", "rowProps", "handleFocus", "listboxItem", "class", "ListItemProviderHost", "ListItem", "role", "tabIndex", "aria-selected", "aria-disabled", "ItemLabel", "forwardRef", "span", "className", "listboxItemLabel", "mx", "Indicator", "rootProps", "Icon", "icon", "useListboxSelection", "Listbox", "ItemContent", "ListItemContent", "createContext", "React", "useCallback", "IconBlock", "IconButton", "ToggleIconButton", "useTranslation", "mx", "osTranslations", "createContext", "React", "useMemo", "ScrollArea", "composable", "composableProps", "mx", "styles", "listTheme", "ORDERED_LIST_NAME", "OrderedListProvider", "useOrderedListContext", "createContext", "defaultGetId", "item", "id", "noopMove", "OrderedListRoot", "items", "getId", "onMove", "readonly", "expandedId", "defaultExpandedId", "onExpandedChange", "children", "controller", "active", "useReorderList", "disclosure", "useListDisclosure", "mode", "value", "defaultValue", "onValueChange", "next", "navigation", "useListNavigation", "context", "useMemo", "reorder", "React", "OrderedListProvider", "OrderedListContent", "classNames", "useOrderedListContext", "div", "containerProps", "className", "styles", "orderedListContent", "class", "mx", "OrderedListViewport", "composable", "props", "forwardedRef", "thin", "padding", "centered", "rest", "autoScrollRef", "useReorderAutoScroll", "ScrollArea", "Root", "composableProps", "orderedListViewport", "orientation", "ref", "Viewport", "displayName", "styles", "listTheme", "ORDERED_LIST_ITEM_NAME", "OrderedListItemProvider", "useOrderedListItemContext", "createContext", "OrderedListItem", "id", "canDrag", "hover", "selected", "onClick", "classNames", "style", "children", "reorder", "disclosure", "navigation", "useOrderedListContext", "rowRef", "handleRef", "closestEdge", "state", "useReorderItem", "expanded", "toggle", "triggerProps", "panelProps", "bind", "React", "div", "ref", "itemProps", "aria-current", "undefined", "className", "orderedListItem", "class", "mx", "type", "DropIndicator", "edge", "OrderedListDragHandle", "readonly", "t", "useTranslation", "osTranslations", "disabled", "IconButton", "variant", "noTooltip", "icon", "iconOnly", "label", "OrderedListTitle", "props", "handleClick", "useCallback", "event", "aria-expanded", "aria-controls", "orderedListTitle", "OrderedListIconButton", "autoHide", "IconBlock", "OrderedListDeleteButton", "OrderedListExpandCaret", "ToggleIconButton", "active", "OrderedListDetailItem", "item", "title", "titleClassNames", "actions", "trailing", "expandable", "grid", "useListGrid", "rowProps", "orderedListDetailColumn", "orderedListDetailTitleRow", "DetailPanel", "orderedListDetailPanel", "OrderedList", "Root", "OrderedListRoot", "Viewport", "OrderedListViewport", "Content", "OrderedListContent", "Item", "OrderedListItem", "DetailItem", "OrderedListDetailItem", "DragHandle", "OrderedListDragHandle", "Title", "OrderedListTitle", "IconButton", "OrderedListIconButton", "DeleteButton", "OrderedListDeleteButton", "ExpandCaret", "OrderedListExpandCaret", "useAtomValue", "React", "useMemo", "useFocusFinders", "createContextScope", "Primitive", "Slot", "useControllableState", "React", "forwardRef", "useCallback", "composable", "composableProps", "mx", "tv", "levelStyles", "Map", "treegridStyles", "slots", "root", "row", "cell", "variants", "indent", "true", "treegridTheme", "styles", "rowLevel", "level", "get", "Math", "min", "max", "round", "styles", "treegridTheme", "TREEGRID_ROW_NAME", "createTreegridRowContext", "createTreegridRowScope", "createContextScope", "TreegridRowProvider", "useTreegridRowContext", "TREEGRID_PATH_SEPARATOR", "TREEGRID_PARENT_OF_SEPARATOR", "TreegridRoot", "composable", "asChild", "classNames", "children", "style", "gridTemplateColumns", "onKeyDown", "onKeyDownProp", "props", "forwardedRef", "className", "role", "_role", "rest", "composableProps", "Comp", "Slot", "Primitive", "div", "findFirstFocusable", "useFocusFinders", "handleKeyDown", "useCallback", "event", "key", "direction", "target", "ancestorWithArrowKeys", "closest", "currentRow", "treegrid", "rows", "Array", "from", "querySelectorAll", "currentIndex", "indexOf", "nextIndex", "targetRow", "firstFocusable", "preventDefault", "focus", "React", "root", "class", "mx", "ref", "TreegridRow", "forwardRef", "__treegridRowScope", "id", "parentOf", "open", "propsOpen", "defaultOpen", "onOpenChange", "propsOnOpenChange", "pathParts", "split", "level", "length", "useControllableState", "prop", "onChange", "defaultProp", "scope", "aria-level", "row", "rowLevel", "TreegridCell", "indent", "cell", "Treegrid", "Root", "Row", "Cell", "createContext", "useContext", "raise", "TreeContext", "TreeProvider", "Provider", "useTree", "Error", "attachInstruction", "extractInstruction", "combine", "draggable", "dropTargetForElements", "useAtomValue", "Schema", "React", "memo", "useCallback", "useEffect", "useMemo", "useRef", "useState", "invariant", "toLocalizedString", "useTranslation", "ghostFocusWithin", "ghostHover", "hoverableControls", "hoverableFocusedKeyboardControls", "hoverableFocusedWithinControls", "mx", "DEFAULT_INDENTATION", "paddingIndentation", "level", "indentation", "paddingInlineStart", "React", "edgeToOrientationMap", "orientationStyles", "sibling", "child", "instructionStyles", "strokeSize", "terminalSize", "offsetToAlignTerminalWithLine", "TreeDropIndicator", "instruction", "gap", "lineOffset", "isBlocked", "type", "desiredInstruction", "desired", "orientation", "div", "style", "currentLevel", "indentPerLevel", "className", "React", "forwardRef", "memo", "useCallback", "Button", "Icon", "Tag", "TextTooltip", "toLocalizedString", "useTranslation", "getStyles", "TreeItemHeading", "label", "className", "icon", "iconHue", "disabled", "current", "count", "modifiedCount", "onSelect", "forwardedRef", "t", "styles", "undefined", "handleSelect", "event", "altKey", "handleButtonKeydown", "key", "preventDefault", "stopPropagation", "text", "side", "truncateQuery", "onlyWhenTruncating", "asChild", "ref", "data-testid", "variant", "classNames", "onClick", "onKeyDown", "size", "span", "data-tooltip", "CountBadge", "hue", "React", "forwardRef", "memo", "IconButton", "TreeItemToggle", "classNames", "open", "isBranch", "hidden", "props", "forwardedRef", "ref", "data-testid", "aria-expanded", "variant", "density", "size", "icon", "iconOnly", "noTooltip", "label", "tabIndex", "hoverableDescriptionIcons", "useTranslation", "div", "role", "React", "className", "toLocalizedString", "TreeDataSchema", "Schema", "path", "item", "isTreeData", "rowRef", "buttonRef", "useRef", "openRef", "cancelExpandRef", "setState", "useState", "setInstruction", "menuOpen", "setMenuOpen", "itemPropsAtom", "childIds", "childIdsAtom", "useMemo", "pathProp", "id", "open", "useAtomValue", "itemOpenAtom", "current", "itemCurrentAtom", "level", "levelOffset", "isBranch", "parentOf", "mode", "last", "canSelectItem", "nativeDragText", "useEffect", "draggableProp", "invariant", "element", "getInitialData", "draggable", "data", "getInitialDataForExternal", "shouldSeedNativeDragData", "onDragStart", "onOpenChange", "onDrop", "isItemDroppable", "dropTarget", "dropTargetForElements", "getData", "input", "attachInstruction", "indentPerLevel", "currentLevel", "block", "canDrop", "source", "target", "getIsSticky", "onDrag", "desired", "instruction", "onDragLeave", "blockInstruction", "useCallback", "canSelect", "onSelect", "option", "handleOpenToggle", "handleSelect", "onItemHover", "renderColumns", "Columns", "childId", "index", "TreeItemById", "childProps", "aria-labelledby", "data-object-id", "data-testid", "testId", "onKeyDown", "handleKeyDown", "onMouseEnter", "handleItemHover", "onContextMenu", "paddingIndentation", "classNames", "TreeItemToggle", "onClick", "disabled", "label", "icon", "iconHue", "count", "modifiedCount", "ref", "gap", "key", "useTree", "itemAtom", "TreeChild", "id", "path", "parentPath", "last", "childProps", "React", "TreeItemById", "Tree", "classNames", "model", "rootId", "draggable", "gridTemplateColumns", "levelOffset", "renderColumns", "blockInstruction", "canDrop", "canSelect", "onOpenChange", "onSelect", "onItemHover", "childIds", "useAtomValue", "treePath", "useMemo", "Treegrid", "Root", "TreeProvider", "value", "map", "childId", "index", "key", "length", "SEPARATOR", "Path", "create", "args", "join", "parts", "path", "split", "length", "first", "last", "at", "parent", "slice", "hasRoot", "id", "hasChild", "compare", "hasDescendent", "startsWith", "siblings", "onPath", "includes"]
|
|
7
7
|
}
|