@dxos/react-ui-list 0.9.0 → 0.9.1-main.c7dcc2e112

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/dist/lib/browser/index.mjs +993 -521
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/node-esm/index.mjs +993 -521
  5. package/dist/lib/node-esm/index.mjs.map +4 -4
  6. package/dist/lib/node-esm/meta.json +1 -1
  7. package/dist/types/src/aspects/index.d.ts +6 -0
  8. package/dist/types/src/aspects/index.d.ts.map +1 -0
  9. package/dist/types/src/aspects/useListDisclosure.d.ts +60 -0
  10. package/dist/types/src/aspects/useListDisclosure.d.ts.map +1 -0
  11. package/dist/types/src/aspects/useListDisclosure.test.d.ts +2 -0
  12. package/dist/types/src/aspects/useListDisclosure.test.d.ts.map +1 -0
  13. package/dist/types/src/aspects/useListGrid.d.ts +30 -0
  14. package/dist/types/src/aspects/useListGrid.d.ts.map +1 -0
  15. package/dist/types/src/aspects/useListGrid.test.d.ts +2 -0
  16. package/dist/types/src/aspects/useListGrid.test.d.ts.map +1 -0
  17. package/dist/types/src/aspects/useListNavigation.d.ts +68 -0
  18. package/dist/types/src/aspects/useListNavigation.d.ts.map +1 -0
  19. package/dist/types/src/aspects/useListNavigation.test.d.ts +2 -0
  20. package/dist/types/src/aspects/useListNavigation.test.d.ts.map +1 -0
  21. package/dist/types/src/aspects/useListSelection.d.ts +48 -0
  22. package/dist/types/src/aspects/useListSelection.d.ts.map +1 -0
  23. package/dist/types/src/aspects/useListSelection.test.d.ts +2 -0
  24. package/dist/types/src/aspects/useListSelection.test.d.ts.map +1 -0
  25. package/dist/types/src/aspects/useReorder.d.ts +103 -0
  26. package/dist/types/src/aspects/useReorder.d.ts.map +1 -0
  27. package/dist/types/src/components/Accordion/Accordion.d.ts +1 -1
  28. package/dist/types/src/components/Accordion/AccordionItem.d.ts +5 -3
  29. package/dist/types/src/components/Accordion/AccordionItem.d.ts.map +1 -1
  30. package/dist/types/src/components/Accordion/AccordionRoot.d.ts +1 -1
  31. package/dist/types/src/components/Accordion/AccordionRoot.d.ts.map +1 -1
  32. package/dist/types/src/components/Listbox/Listbox.d.ts +60 -20
  33. package/dist/types/src/components/Listbox/Listbox.d.ts.map +1 -1
  34. package/dist/types/src/components/Listbox/Listbox.stories.d.ts +27 -3
  35. package/dist/types/src/components/Listbox/Listbox.stories.d.ts.map +1 -1
  36. package/dist/types/src/components/OrderedList/OrderedList.d.ts +49 -0
  37. package/dist/types/src/components/OrderedList/OrderedList.d.ts.map +1 -0
  38. package/dist/types/src/components/OrderedList/OrderedList.stories.d.ts +11 -0
  39. package/dist/types/src/components/OrderedList/OrderedList.stories.d.ts.map +1 -0
  40. package/dist/types/src/components/OrderedList/OrderedList.test.d.ts +2 -0
  41. package/dist/types/src/components/OrderedList/OrderedList.test.d.ts.map +1 -0
  42. package/dist/types/src/components/OrderedList/OrderedListItem.d.ts +94 -0
  43. package/dist/types/src/components/OrderedList/OrderedListItem.d.ts.map +1 -0
  44. package/dist/types/src/components/OrderedList/OrderedListRoot.d.ts +73 -0
  45. package/dist/types/src/components/OrderedList/OrderedListRoot.d.ts.map +1 -0
  46. package/dist/types/src/components/OrderedList/index.d.ts +2 -0
  47. package/dist/types/src/components/OrderedList/index.d.ts.map +1 -0
  48. package/dist/types/src/components/Tree/TreeItem.d.ts.map +1 -1
  49. package/dist/types/src/components/Tree/TreeItemHeading.d.ts.map +1 -1
  50. package/dist/types/src/components/index.d.ts +1 -2
  51. package/dist/types/src/components/index.d.ts.map +1 -1
  52. package/dist/types/src/index.d.ts +1 -0
  53. package/dist/types/src/index.d.ts.map +1 -1
  54. package/dist/types/src/vitest-setup.d.ts +2 -0
  55. package/dist/types/src/vitest-setup.d.ts.map +1 -0
  56. package/dist/types/tsconfig.tsbuildinfo +1 -1
  57. package/package.json +18 -15
  58. package/src/aspects/index.ts +9 -0
  59. package/src/aspects/useListDisclosure.test.ts +72 -0
  60. package/src/aspects/useListDisclosure.ts +160 -0
  61. package/src/aspects/useListGrid.test.ts +41 -0
  62. package/src/aspects/useListGrid.ts +61 -0
  63. package/src/aspects/useListNavigation.test.ts +44 -0
  64. package/src/aspects/useListNavigation.ts +160 -0
  65. package/src/aspects/useListSelection.test.ts +101 -0
  66. package/src/aspects/useListSelection.ts +162 -0
  67. package/src/aspects/useReorder.ts +370 -0
  68. package/src/components/Accordion/Accordion.stories.tsx +1 -1
  69. package/src/components/Accordion/AccordionItem.tsx +11 -6
  70. package/src/components/Accordion/AccordionRoot.tsx +4 -1
  71. package/src/components/Listbox/Listbox.stories.tsx +171 -21
  72. package/src/components/Listbox/Listbox.tsx +302 -145
  73. package/src/components/OrderedList/OrderedList.stories.tsx +379 -0
  74. package/src/components/OrderedList/OrderedList.test.tsx +59 -0
  75. package/src/components/OrderedList/OrderedList.tsx +63 -0
  76. package/src/components/OrderedList/OrderedListItem.tsx +348 -0
  77. package/src/components/OrderedList/OrderedListRoot.tsx +173 -0
  78. package/src/components/OrderedList/index.ts +5 -0
  79. package/src/components/Tree/TreeItem.tsx +2 -0
  80. package/src/components/Tree/TreeItemHeading.tsx +1 -2
  81. package/src/components/index.ts +1 -2
  82. package/src/index.ts +1 -0
  83. package/src/vitest-setup.ts +11 -0
  84. package/dist/types/src/components/List/List.d.ts +0 -40
  85. package/dist/types/src/components/List/List.d.ts.map +0 -1
  86. package/dist/types/src/components/List/List.stories.d.ts +0 -18
  87. package/dist/types/src/components/List/List.stories.d.ts.map +0 -1
  88. package/dist/types/src/components/List/ListItem.d.ts +0 -49
  89. package/dist/types/src/components/List/ListItem.d.ts.map +0 -1
  90. package/dist/types/src/components/List/ListRoot.d.ts +0 -29
  91. package/dist/types/src/components/List/ListRoot.d.ts.map +0 -1
  92. package/dist/types/src/components/List/index.d.ts +0 -2
  93. package/dist/types/src/components/List/index.d.ts.map +0 -1
  94. package/dist/types/src/components/List/testing.d.ts +0 -15
  95. package/dist/types/src/components/List/testing.d.ts.map +0 -1
  96. package/dist/types/src/components/RowList/RowList.d.ts +0 -61
  97. package/dist/types/src/components/RowList/RowList.d.ts.map +0 -1
  98. package/dist/types/src/components/RowList/RowList.stories.d.ts +0 -35
  99. package/dist/types/src/components/RowList/RowList.stories.d.ts.map +0 -1
  100. package/dist/types/src/components/RowList/index.d.ts +0 -3
  101. package/dist/types/src/components/RowList/index.d.ts.map +0 -1
  102. package/src/components/List/List.stories.tsx +0 -129
  103. package/src/components/List/List.tsx +0 -47
  104. package/src/components/List/ListItem.tsx +0 -287
  105. package/src/components/List/ListRoot.tsx +0 -106
  106. package/src/components/List/index.ts +0 -5
  107. package/src/components/List/testing.ts +0 -31
  108. package/src/components/RowList/RowList.stories.tsx +0 -163
  109. package/src/components/RowList/RowList.tsx +0 -350
  110. package/src/components/RowList/index.ts +0 -6
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../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/List/ListItem.tsx", "../../../src/components/List/ListRoot.tsx", "../../../src/components/List/List.tsx", "../../../src/components/Listbox/Listbox.tsx", "../../../src/components/RowList/RowList.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 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 { type ListItemRecord } from '../List';\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>;\n\nexport const AccordionItemHeader = ({ classNames, children, ...props }: AccordionItemHeaderProps) => {\n return (\n <AccordionPrimitive.Header {...props} className={mx(classNames)}>\n <AccordionPrimitive.Trigger className='group flex items-center p-2 dx-focus-ring-inset w-full text-start'>\n {children}\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 </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\nimport { type ListItemRecord } from '../List';\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 2024 DXOS.org\n//\n\nimport {\n type Edge,\n attachClosestEdge,\n extractClosestEdge,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport { draggable, dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\nimport { createContext } from '@radix-ui/react-context';\nimport { Slot } from '@radix-ui/react-slot';\nimport React, {\n type ComponentProps,\n type HTMLAttributes,\n type PropsWithChildren,\n type ReactNode,\n RefObject,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport { createPortal } from 'react-dom';\n\nimport { invariant } from '@dxos/invariant';\nimport {\n IconButton,\n type IconButtonProps,\n ListItem as NaturalListItem,\n type ThemedClassName,\n useTranslation,\n} from '@dxos/react-ui';\nimport { mx, osTranslations } from '@dxos/ui-theme';\n\nimport { useListContext } from './ListRoot';\n\nexport type ListItemRecord = any;\n\nexport type ItemDragState =\n | {\n type: 'idle';\n }\n | {\n type: 'preview';\n container: HTMLElement;\n }\n | {\n type: 'is-dragging';\n }\n | {\n type: 'is-dragging-over';\n closestEdge: Edge | null;\n };\n\nexport const idle: ItemDragState = { type: 'idle' };\n\nconst stateStyles: { [Key in ItemDragState['type']]?: HTMLAttributes<HTMLDivElement>['className'] } = {\n 'is-dragging': 'opacity-50',\n};\n\ntype ListItemContext<T extends ListItemRecord> = {\n item: T;\n dragHandleRef: RefObject<HTMLButtonElement | null>;\n};\n\n/**\n * Default context defined for ListItemDragPreview, which is defined outside of ListItem.\n */\nconst defaultContext: ListItemContext<any> = {} as any;\n\nconst LIST_ITEM_NAME = 'ListItem';\n\nexport const [ListItemProvider, useListItemContext] = createContext<ListItemContext<any>>(\n LIST_ITEM_NAME,\n defaultContext,\n);\n\nexport type ListItemProps<T extends ListItemRecord> = ThemedClassName<\n PropsWithChildren<\n {\n item: T;\n asChild?: boolean;\n selected?: boolean;\n } & HTMLAttributes<HTMLDivElement>\n >\n>;\n\n/**\n * Draggable list item.\n */\nexport const ListItem = <T extends ListItemRecord>({\n children,\n classNames,\n item,\n asChild,\n selected,\n ...props\n}: ListItemProps<T>) => {\n const Comp = asChild ? Slot : 'div';\n const { isItem, readonly, dragPreview, setState: setRootState } = useListContext(LIST_ITEM_NAME);\n const rootRef = useRef<HTMLDivElement | null>(null);\n const dragHandleRef = useRef<HTMLButtonElement | null>(null);\n const [state, setState] = useState<ItemDragState>(idle);\n\n useEffect(() => {\n const element = rootRef.current;\n invariant(element);\n return combine(\n //\n // https://atlassian.design/components/pragmatic-drag-and-drop/core-package/adapters/element/about#draggable\n //\n draggable({\n element,\n dragHandle: dragHandleRef.current!,\n canDrag: () => !readonly,\n getInitialData: () => item as any,\n onGenerateDragPreview: dragPreview\n ? ({ nativeSetDragImage, source }) => {\n const rect = source.element.getBoundingClientRect();\n setCustomNativeDragPreview({\n nativeSetDragImage,\n getOffset: ({ container }) => {\n const { height } = container.getBoundingClientRect();\n return { x: 20, y: height / 2 };\n },\n render: ({ container }) => {\n container.style.width = rect.width + 'px';\n setState({ type: 'preview', container });\n setRootState({ type: 'preview', container, item });\n return () => {}; // TODO(burdon): Cleanup.\n },\n });\n }\n : undefined,\n onDragStart: () => {\n setState({ type: 'is-dragging' });\n setRootState({ type: 'is-dragging', item });\n },\n onDrop: () => {\n setState(idle);\n setRootState(idle);\n },\n }),\n\n //\n // https://atlassian.design/components/pragmatic-drag-and-drop/core-package/adapters/element/about#drop-target-for-elements\n //\n dropTargetForElements({\n element,\n canDrop: ({ source }) => {\n return (source.element !== element && isItem?.(source.data)) ?? false;\n },\n getData: ({ input }) => {\n return attachClosestEdge(item as any, { element, input, allowedEdges: ['top', 'bottom'] });\n },\n getIsSticky: () => true,\n onDragEnter: ({ self }) => {\n const closestEdge = extractClosestEdge(self.data);\n setState({ type: 'is-dragging-over', closestEdge });\n },\n onDragLeave: () => {\n setState(idle);\n },\n onDrag: ({ self }) => {\n const closestEdge = extractClosestEdge(self.data);\n setState((current) => {\n if (current.type === 'is-dragging-over' && current.closestEdge === closestEdge) {\n return current;\n }\n return { type: 'is-dragging-over', closestEdge };\n });\n },\n onDrop: () => {\n setState(idle);\n },\n }),\n );\n }, [item]);\n\n return (\n <ListItemProvider item={item} dragHandleRef={dragHandleRef}>\n <Comp\n {...props}\n role='listitem'\n aria-selected={selected}\n className={mx('relative p-1 dx-selected dx-hover', classNames, stateStyles[state.type])}\n ref={rootRef}\n >\n {children}\n </Comp>\n {state.type === 'is-dragging-over' && state.closestEdge && (\n <NaturalListItem.DropIndicator edge={state.closestEdge} />\n )}\n </ListItemProvider>\n );\n};\n\n//\n// List item components\n//\n\nexport const ListItemIconButton = ({\n autoHide = true,\n iconOnly = true,\n variant = 'ghost',\n classNames,\n disabled,\n ...props\n}: IconButtonProps & { autoHide?: boolean }) => {\n const { state } = useListContext('ITEM_BUTTON');\n const isDisabled = state.type !== 'idle' || disabled;\n return (\n <IconButton\n {...props}\n disabled={isDisabled}\n iconOnly={iconOnly}\n variant={variant}\n classNames={[classNames, autoHide && disabled && 'hidden']}\n />\n );\n};\n\n// TODO(burdon): Generalize to action button.\nexport const ListItemDeleteButton = ({\n autoHide = true,\n classNames,\n disabled,\n icon = 'ph--x--regular',\n label,\n ...props\n}: Partial<Pick<IconButtonProps, 'icon'>> &\n Omit<IconButtonProps, 'icon' | 'label'> & { autoHide?: boolean; label?: string }) => {\n const { state } = useListContext('DELETE_BUTTON');\n const isDisabled = state.type !== 'idle' || disabled;\n const { t } = useTranslation(osTranslations);\n return (\n <IconButton\n {...props}\n variant='ghost'\n disabled={isDisabled}\n icon={icon}\n iconOnly\n label={label ?? t('delete.label')}\n classNames={[classNames, autoHide && disabled && 'hidden']}\n />\n );\n};\n\nexport const ListItemDragHandle = ({ disabled }: Pick<IconButtonProps, 'disabled'>) => {\n const { dragHandleRef } = useListItemContext('DRAG_HANDLE');\n const { t } = useTranslation(osTranslations);\n return (\n <IconButton\n variant='ghost'\n disabled={disabled}\n icon='ph--dots-six-vertical--regular'\n iconOnly\n label={t('drag-handle.label')}\n ref={dragHandleRef}\n />\n );\n};\n\nexport const ListItemDragPreview = <T extends ListItemRecord>({\n children,\n}: {\n children: ({ item }: { item: T }) => ReactNode;\n}) => {\n const { state } = useListContext('DRAG_PREVIEW');\n return state?.type === 'preview' ? createPortal(children({ item: state.item }), state.container) : null;\n};\n\nexport const ListItemWrapper = ({ classNames, children }: ThemedClassName<PropsWithChildren>) => (\n <div className={mx('flex w-full gap-2', classNames)}>{children}</div>\n);\n\nexport const ListItemTitle = ({\n classNames,\n children,\n ...props\n}: ThemedClassName<PropsWithChildren<ComponentProps<'div'>>>) => (\n <div className={mx('flex grow items-center truncate', classNames)} {...props}>\n {children}\n </div>\n);\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { extractClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { getReorderDestinationIndex } from '@atlaskit/pragmatic-drag-and-drop-hitbox/util/get-reorder-destination-index';\nimport { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { createContext } from '@radix-ui/react-context';\nimport React, { type ReactNode, useCallback, useEffect, useState } from 'react';\n\nimport { type ItemDragState, type ListItemRecord, idle } from './ListItem';\n\ntype ListContext<T extends ListItemRecord> = {\n // TODO(burdon): Rename drag state.\n state: ItemDragState & { item?: T };\n setState: (state: ItemDragState & { item?: T }) => void;\n readonly?: boolean;\n dragPreview?: boolean;\n isItem?: (item: any) => boolean;\n getId?: (item: T) => string; // TODO(burdon): Require if T doesn't conform to type.\n};\n\nconst LIST_NAME = 'List';\n\nexport const [ListProvider, useListContext] = createContext<ListContext<any>>(LIST_NAME);\n\nexport type ListRendererProps<T extends ListItemRecord> = {\n state: ListContext<T>['state'];\n items: readonly T[];\n};\n\nconst defaultGetId = <T extends ListItemRecord>(item: T) => (item as any)?.id;\n\nexport type ListRootProps<T extends ListItemRecord> = {\n children?: (props: ListRendererProps<T>) => ReactNode;\n items?: readonly T[];\n onMove?: (fromIndex: number, toIndex: number) => void;\n} & Pick<ListContext<T>, 'isItem' | 'getId' | 'readonly' | 'dragPreview'>;\n\nexport const ListRoot = <T extends ListItemRecord>({\n children,\n items,\n isItem,\n getId = defaultGetId,\n onMove,\n ...props\n}: ListRootProps<T>) => {\n const isEqual = useCallback(\n (a: T, b: T) => {\n const idA = getId?.(a);\n const idB = getId?.(b);\n\n if (idA !== undefined && idB !== undefined) {\n return idA === idB;\n } else {\n // Fallback for primitive values or when getId fails.\n // NOTE(ZaymonFC): After drag and drop, pragmatic internally serializes drop targets which breaks reference equality.\n // You must provide an `getId` function that returns a stable identifier for your items.\n return a === b;\n }\n },\n [getId],\n );\n\n const [state, setState] = useState<ListContext<T>['state']>(idle);\n useEffect(() => {\n if (!items) {\n return;\n }\n\n return monitorForElements({\n canMonitor: ({ source }) => isItem?.(source.data) ?? false,\n onDrop: ({ location, source }) => {\n const target = location.current.dropTargets[0];\n if (!target) {\n return;\n }\n\n const sourceData = source.data;\n const targetData = target.data;\n if (!isItem?.(sourceData) || !isItem?.(targetData)) {\n return;\n }\n\n const sourceIdx = items.findIndex((item) => isEqual(item, sourceData as T));\n const targetIdx = items.findIndex((item) => isEqual(item, targetData as T));\n if (targetIdx < 0 || sourceIdx < 0) {\n return;\n }\n const closestEdgeOfTarget = extractClosestEdge(targetData);\n const destinationIndex = getReorderDestinationIndex({\n closestEdgeOfTarget,\n startIndex: sourceIdx,\n indexOfTarget: targetIdx,\n axis: 'vertical',\n });\n\n onMove?.(sourceIdx, destinationIndex);\n },\n });\n }, [items, isEqual, onMove]);\n\n return (\n <ListProvider {...{ state, setState, isItem, ...props }}>{children?.({ state, items: items ?? [] })}</ListProvider>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport {\n ListItem,\n ListItemIconButton,\n ListItemDeleteButton,\n ListItemDragHandle,\n ListItemDragPreview,\n type ListItemProps,\n type ListItemRecord,\n ListItemTitle,\n ListItemWrapper,\n} from './ListItem';\nimport { ListRoot, type ListRootProps } from './ListRoot';\n\n/**\n * Draggable list with per-row drag handles and delete buttons.\n * Ref: https://github.com/atlassian/pragmatic-drag-and-drop\n * Ref: https://github.com/alexreardon/pdnd-react-tailwind/blob/main/src/task.tsx\n *\n * @deprecated New code should use one of:\n *\n * - `RowList` / `CardList` from this same package — for selectable\n * pickers (master/detail). Correct ARIA + dx-* by construction.\n * - `Mosaic.Stack` / `Mosaic.VirtualStack` from `@dxos/react-ui-mosaic`\n * — for virtualized or drag-reorderable card stacks.\n *\n * This component is retained for the existing reorder-with-delete-button\n * use cases (plugin-meeting, plugin-automation, plugin-zen, etc.) until\n * each is migrated; see `AUDIT.md` Phase 6 for the migration plan.\n */\nexport const List = {\n Root: ListRoot,\n Item: ListItem,\n ItemDragPreview: ListItemDragPreview,\n ItemWrapper: ListItemWrapper,\n ItemDragHandle: ListItemDragHandle,\n ItemIconButton: ListItemIconButton,\n ItemDeleteButton: ListItemDeleteButton,\n ItemTitle: ListItemTitle,\n};\n\ntype ListItem = ListItemRecord;\n\nexport type { ListRootProps, ListItemProps, ListItem, ListItemRecord };\n", "//\n// Copyright 2023 DXOS.org\n//\n\n// `Listbox` — single-select listbox with optional check indicator.\n//\n// Internally composes `RowList` from this same package: `Listbox.Root`\n// is `RowList.Root` + `RowList.Content`, and `Listbox.Option` is `Row`.\n// The compound API (`Listbox.Root` / `.Option` / `.OptionLabel` /\n// `.OptionIndicator`) is preserved so existing call sites keep working.\n//\n// Why this shape (when `RowList` is right there): `Listbox` historically\n// rendered as a flat `<ul>` with no `ScrollArea` wrapper — it's used\n// inside dialogs / popovers / panels that own their own scroll. Skipping\n// `RowList.Viewport` keeps that behaviour. If a caller wants the styled\n// scroll surface, they wrap the listbox in `RowList.Viewport` themselves.\n\nimport { type Scope, createContextScope } from '@radix-ui/react-context';\nimport React, { type ComponentPropsWithRef, type ReactNode, forwardRef } from 'react';\n\nimport { Icon, type IconProps, type ThemedClassName } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\nimport { Row, RowList, createRowListScope, useRowListSelection } from '../RowList';\n\nconst commandItem = 'flex items-center overflow-hidden';\n\nconst LISTBOX_NAME = 'Listbox';\nconst LISTBOX_OPTION_NAME = 'ListboxOption';\nconst LISTBOX_OPTION_LABEL_NAME = 'ListboxOptionLabel';\nconst LISTBOX_OPTION_INDICATOR_NAME = 'ListboxOptionIndicator';\n\n//\n// Context — only used to thread `value` through to `OptionIndicator` so\n// it knows whether to show the checkmark. Selection state itself lives\n// in `RowList`'s context (we delegate to it via composition).\n//\n\ntype ListboxScopedProps<P> = P & { __listboxScope?: Scope };\ntype ListboxOptionScopedProps<P> = P & { __listboxOptionScope?: Scope };\n\nconst [createListboxContext, createListboxScope] = createContextScope(LISTBOX_NAME, [createRowListScope]);\nconst [createListboxOptionContext, createListboxOptionScope] = createContextScope(LISTBOX_OPTION_NAME, [\n createListboxScope,\n]);\n\ntype ListboxOptionContextValue = {\n value: string;\n isSelected: boolean;\n};\n\nconst [ListboxOptionProvider, useListboxOptionContext] =\n createListboxOptionContext<ListboxOptionContextValue>(LISTBOX_OPTION_NAME);\n\n//\n// Root — composes `RowList.Root` + `RowList.Content`.\n//\n// Maps the public `value` / `onValueChange` API to RowList's\n// `selectedId` / `onSelectChange` so existing consumers don't change.\n//\n\ntype ListboxRootProps = ThemedClassName<ComponentPropsWithRef<'ul'>> & {\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n /** Reserved — autoFocus on mount. RowList's focus-on-entry covers the typical case. */\n autoFocus?: boolean;\n};\n\nconst ListboxRoot = forwardRef<HTMLUListElement, ListboxRootProps>(\n (props: ListboxScopedProps<ListboxRootProps>, forwardedRef) => {\n const {\n __listboxScope: _scope,\n children,\n classNames,\n value,\n defaultValue,\n onValueChange,\n autoFocus: _autoFocus,\n ...rootProps\n } = props;\n\n return (\n <RowList.Root selectedId={value} defaultSelectedId={defaultValue} onSelectChange={onValueChange}>\n <RowList.Content {...rootProps} classNames={mx('w-full', classNames)} ref={forwardedRef}>\n {children}\n </RowList.Content>\n </RowList.Root>\n );\n },\n);\n\nListboxRoot.displayName = 'Listbox.Root';\n\n//\n// Option — composes `Row`. Adds the listbox-specific styling and\n// publishes `{ value, isSelected }` so `OptionIndicator` can render a\n// checkmark.\n//\n\ntype ListboxOptionProps = ThemedClassName<ComponentPropsWithRef<'li'>> & {\n value: string;\n};\n\nconst ListboxOption = forwardRef<HTMLLIElement, ListboxOptionProps>(\n (props: ListboxScopedProps<ListboxOptionProps>, forwardedRef) => {\n const { __listboxScope, children, classNames, value, ...rootProps } = props;\n\n // Selection state is read inside `ListboxOptionProviderHost` via\n // the public `useRowListSelection` hook and republished on the\n // listbox-option scope so `OptionIndicator` can render its\n // checkmark synchronously.\n return (\n <Row\n id={value}\n {...rootProps}\n classNames={mx('dx-focus-ring rounded-xs', commandItem, classNames)}\n ref={forwardedRef}\n >\n <ListboxOptionProviderHost value={value}>{children}</ListboxOptionProviderHost>\n </Row>\n );\n },\n);\n\nListboxOption.displayName = 'Listbox.Option';\n\n// Reads selection state from RowList's context (via `useRowListSelection`)\n// and publishes it on the listbox-option scope so `OptionIndicator` can\n// render its checkmark. Tiny adapter — keeps Listbox's public option API\n// intact while delegating the actual state to RowList.\nconst ListboxOptionProviderHost = ({\n value,\n children,\n}: ListboxScopedProps<{ value: string; children?: ReactNode }>) => {\n const isSelected = useRowListSelection(value);\n return (\n <ListboxOptionProvider scope={undefined} value={value} isSelected={isSelected}>\n {children}\n </ListboxOptionProvider>\n );\n};\n\n//\n// OptionLabel\n//\n\nconst ListboxOptionLabel = forwardRef<HTMLDivElement, ThemedClassName<ComponentPropsWithRef<'div'>>>(\n ({ children, classNames, ...rootProps }, forwardedRef) => {\n return (\n <span {...rootProps} className={mx('grow truncate', classNames)} ref={forwardedRef}>\n {children}\n </span>\n );\n },\n);\n\nListboxOptionLabel.displayName = 'Listbox.OptionLabel';\n\n//\n// OptionIndicator — checkmark for the selected option.\n//\n// Reads `isSelected` from the option context. The visual indicator is\n// also covered by `dx-selected` on the row, so the checkmark is purely\n// confirmatory.\n//\n\ntype ListboxOptionIndicatorProps = Omit<IconProps, 'icon'> & Partial<Pick<IconProps, 'icon'>>;\n\nconst ListboxOptionIndicator = forwardRef<SVGSVGElement, ListboxOptionIndicatorProps>(\n (props: ListboxOptionScopedProps<ListboxOptionIndicatorProps>, forwardedRef) => {\n const { __listboxOptionScope, classNames, ...rootProps } = props;\n const { isSelected } = useListboxOptionContext(LISTBOX_OPTION_INDICATOR_NAME, __listboxOptionScope);\n\n return (\n <Icon\n icon='ph--check--regular'\n {...rootProps}\n classNames={mx(!isSelected && 'invisible', classNames)}\n ref={forwardedRef}\n />\n );\n },\n);\n\nListboxOptionIndicator.displayName = 'Listbox.OptionIndicator';\n\n//\n// Listbox\n//\n\nexport const Listbox = {\n Root: ListboxRoot,\n Option: ListboxOption,\n OptionLabel: ListboxOptionLabel,\n OptionIndicator: ListboxOptionIndicator,\n};\n\nexport { createListboxScope };\n\nexport type { ListboxRootProps, ListboxOptionProps, ListboxScopedProps };\n", "//\n// Copyright 2026 DXOS.org\n//\n\n// `RowList` — Radix-style compound listbox / single-select picker.\n//\n// Compound shape (matches Radix Select / Toolbar / Tabs):\n//\n// <RowList.Root selectedId={…} onSelectChange={…}>\n// <RowList.Viewport thin padding>\n// <RowList.Content aria-label='Tools'>\n// <Row id='a'>…</Row>\n// <Row id='b'>…</Row>\n// </RowList.Content>\n// </RowList.Viewport>\n// </RowList.Root>\n//\n// - `Root` — headless context provider (no DOM). Owns the\n// single-select `selectedId` model.\n// - `Viewport` — `ScrollArea.Root` + `ScrollArea.Viewport`. Always\n// scrolls. Forwards ScrollArea knobs (`thin`, `padding`,\n// `centered`).\n// - `Content` — the `<ul role=\"listbox\">` holding the items. Carries\n// the tabster arrow-nav group and the `aria-label`.\n// - `Row` — `<li role=\"option\">` with `aria-selected` on the\n// selected row, paired with `dx-selected` styling. See\n// `ui-theme/src/css/components/selected.md`.\n//\n// Single visual variant. Card-style rendering, denser/wider rows,\n// dividers, etc. are styling concerns layered on via `classNames` —\n// not separate components.\n//\n// Selection model:\n//\n// This layer ships single-select (`selectedId: string | undefined`).\n// Selection follows focus, so arrow keys + click both update it. This\n// matches the codebase's existing `useSelected(_, 'single')` convention\n// from `@dxos/react-ui-attention`.\n//\n// Multi-select (`selectedIds: ReadonlySet<string>` + per-row checkbox\n// affordance) is a future expansion point. When it lands it'll likely\n// plumb through `react-ui-attention`'s `SelectionManager` for\n// cross-context state sharing — but RowList itself can stay\n// provider-agnostic, with consumers wiring it as they need.\n//\n// Composability:\n//\n// `Viewport`, `Content`, and `Row` are all `composable()` from\n// `@dxos/ui-theme` — they merge `classNames` + parent-Slot\n// `className` via `composableProps()` and accept any standard HTML\n// attributes. None expose `asChild`: Viewport can't (two nested\n// elements, no coherent slot target), and Content / Row would need\n// to abandon the `@dxos/react-list` primitive's context to honor it\n// — not worth the complexity for this layer. If a consumer needs a\n// `<button>`-as-row or a `<div>`-as-listbox, drop down to\n// `@dxos/react-list` directly.\n//\n// Keyboard:\n//\n// `useArrowNavigationGroup({ axis: 'vertical', memorizeCurrent: true })`\n// from `@fluentui/react-tabster` is applied to `Content`. Tabster\n// auto-initializes (`useTabster` lazy-creates the runtime) so no\n// provider setup is required at the app/storybook level. ArrowUp /\n// ArrowDown move focus among options.\n//\n// When focus first lands on the `<ul>` itself (e.g. user tabs in),\n// `Content` redirects focus into the selected option (or the first\n// one) so arrow keys have an immediate starting point.\n//\n// What this layer deliberately does NOT do:\n//\n// - Virtualization or drag-and-drop. Reach for `@dxos/react-ui-mosaic`.\n// - Multi-select (see \"Selection model\" above; future expansion).\n\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport React, { type FocusEvent, type ForwardedRef, type MouseEvent, type PropsWithChildren, useCallback } from 'react';\n\nimport { List, ListItem } from '@dxos/react-list';\nimport { ScrollArea, type ScrollAreaRootProps } from '@dxos/react-ui';\nimport { composable, composableProps } from '@dxos/react-ui';\n\nconst ROW_LIST_NAME = 'RowList';\nconst ROW_LIST_ROOT_NAME = 'RowList.Root';\nconst ROW_LIST_VIEWPORT_NAME = 'RowList.Viewport';\nconst ROW_LIST_CONTENT_NAME = 'RowList.Content';\nconst ROW_NAME = 'List.Row';\n\n//\n// Context — Radix-scoped so future composition (a tree of nested\n// RowLists, or a parent like a Combobox embedding RowList) can read\n// the right scope.\n//\n\ntype RowListContextValue = {\n /** The currently-selected option id. */\n selectedId?: string;\n /** Set the selected option (called from click, arrow nav, focus). */\n setSelected: (id: string) => void;\n};\n\nconst [createRowListContext, createRowListScope] = createContextScope(ROW_LIST_NAME, []);\nconst [RowListProvider, useRowListContext] = createRowListContext<RowListContextValue>(ROW_LIST_NAME);\n\n//\n// Root — headless context provider. Renders no DOM.\n//\n\ntype RootProps = PropsWithChildren<{\n /** Currently-selected option id (controlled). */\n selectedId?: string;\n /** Initial selected option for uncontrolled mode. */\n defaultSelectedId?: string;\n /**\n * Called when the user picks a different option (click, arrow keys,\n * focus). Receives the option's `id` prop.\n */\n onSelectChange?: (id: string) => void;\n}>;\n\nconst Root = ({ selectedId, defaultSelectedId, onSelectChange, children }: RootProps) => {\n // `useControllableState`'s `onChange` is typed `(state: string | undefined) => void`,\n // but our public `onSelectChange` is `(id: string) => void` (an `id` is always\n // a string when emitted). Wrap to satisfy the type without leaking\n // `undefined` to callers.\n const [resolved, setResolved] = useControllableState<string | undefined>({\n prop: selectedId,\n defaultProp: defaultSelectedId,\n onChange: (next) => {\n if (next !== undefined) {\n onSelectChange?.(next);\n }\n },\n });\n\n const setSelected = useCallback((id: string) => setResolved(id), [setResolved]);\n\n return (\n <RowListProvider scope={undefined} selectedId={resolved} setSelected={setSelected}>\n {children}\n </RowListProvider>\n );\n};\n\nRoot.displayName = ROW_LIST_ROOT_NAME;\n\n//\n// Viewport — ScrollArea wrapper. Always scrolls; forwards ScrollArea knobs.\n//\n\n// Subset of ScrollArea.Root props that make sense on a list viewport.\n// `orientation` is fixed to 'vertical' — for other knobs (autoHide,\n// snap, …) build your own ScrollArea wrapper and skip Viewport.\n//\n// `Viewport` is `composable()` rather than `slottable()` because there\n// is no coherent `asChild` semantic for a wrapper that always renders\n// two nested elements (`ScrollArea.Root` containing `ScrollArea.Viewport`).\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 = ROW_LIST_VIEWPORT_NAME;\n\n//\n// Content — the listbox `<ul>` (tabster arrow group + aria-label).\n//\n\ntype ContentProps = {\n /**\n * Accessible label for the listbox. Strongly recommended; assistive\n * tech announces this when focus enters the list.\n */\n 'aria-label'?: string;\n};\n\n// Find the first non-disabled `role='option'` descendant in DOM order.\n// Used as the focus-on-entry target so we don't land on a disabled row.\nconst firstEnabledOption = (ul: HTMLElement | null): HTMLLIElement | null => {\n if (!ul) {\n return null;\n }\n return ul.querySelector<HTMLLIElement>('[role=\"option\"]:not([aria-disabled=\"true\"])');\n};\n\nconst Content = composable<HTMLUListElement, ContentProps>((props, forwardedRef) => {\n // Touch the context so Content fails loudly if used outside Root.\n useRowListContext(ROW_LIST_CONTENT_NAME, undefined);\n\n // Tabster arrow-key navigation. `useTabster` auto-initializes the\n // runtime on first call, so no app/storybook-level setup is required.\n // The data attributes returned here go onto the focusable container —\n // the `<ul>` rendered by the primitive `<List>`.\n const arrowGroup = useArrowNavigationGroup({ axis: 'vertical', memorizeCurrent: true });\n\n const { children, ...rest } = props as PropsWithChildren<ContentProps & Record<string, unknown>>;\n\n // When focus first enters the `<ul>` itself (e.g. user tabs in),\n // redirect into the selected option (or the first enabled one) so\n // arrow keys have an immediate starting point. Tabster doesn't do\n // this — it manages traversal once focus is already on a child.\n const handleFocus = useCallback((event: FocusEvent<HTMLUListElement>) => {\n if (event.target !== event.currentTarget) {\n return;\n }\n const ul = event.currentTarget;\n const selected = ul.querySelector<HTMLLIElement>(\n '[role=\"option\"][aria-selected=\"true\"]:not([aria-disabled=\"true\"])',\n );\n const target = selected ?? firstEnabledOption(ul);\n target?.focus();\n }, []);\n\n // Render via the primitive `<List>` so descendant `<ListItem>`s\n // satisfy their Radix context-scope check. We don't pass `selectable`\n // — we set `role='listbox'` and `aria-selected` ourselves in `Row`,\n // so the primitive's listbox-mode plumbing isn't needed.\n const composed = composableProps<HTMLUListElement>(rest, { classNames: 'flex flex-col' });\n return (\n <List\n variant='unordered'\n {...composed}\n {...arrowGroup}\n role='listbox'\n onFocus={handleFocus}\n ref={forwardedRef as unknown as ForwardedRef<HTMLOListElement>}\n >\n {children}\n </List>\n );\n});\n\nContent.displayName = ROW_LIST_CONTENT_NAME;\n\n//\n// Row — option item.\n//\n\ntype RowProps = PropsWithChildren<{\n /** Stable identifier; matched against the parent's `selectedId`. */\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);\n// see `ui-theme/src/css/components/selected.md`.\nconst ROW_BASE = 'dx-hover dx-selected px-3 py-2 cursor-pointer outline-none'; // border-b border-separator last:border-b-0';\n\nconst Row = composable<HTMLLIElement, RowProps>((props, forwardedRef) => {\n const { id, disabled, onClick, onFocus, children, ...rest } = props as RowProps & Record<string, unknown>;\n const { selectedId, setSelected } = useRowListContext(ROW_NAME, undefined);\n const isSelected = selectedId === id;\n\n const handleClick = useCallback(\n (event: MouseEvent<HTMLLIElement>) => {\n if (disabled) {\n return;\n }\n setSelected(id);\n onClick?.(event);\n },\n [disabled, id, setSelected, onClick],\n );\n\n // Selection-follows-focus: arrow nav (and any focus path) updates\n // `selectedId` so the model stays in sync with what the user is\n // looking at. Disabled rows are still focusable for screen-reader\n // announcement but don't update the selection model.\n const handleFocus = useCallback(\n (event: FocusEvent<HTMLLIElement>) => {\n if (!disabled && selectedId !== id) {\n setSelected(id);\n }\n onFocus?.(event);\n },\n [disabled, selectedId, id, setSelected, onFocus],\n );\n\n const composed = composableProps<HTMLLIElement>(rest, {\n classNames: [ROW_BASE, disabled && 'opacity-50 cursor-not-allowed'],\n });\n\n // Per WAI-ARIA APG listbox guidance, disabled options remain\n // keyboard-navigable for SR announcement; the selection model is not\n // updated for disabled rows (see `handleFocus` / `handleClick` above).\n return (\n <ListItem\n {...composed}\n role='option'\n tabIndex={0}\n aria-selected={isSelected}\n aria-disabled={disabled || undefined}\n onClick={handleClick}\n onFocus={handleFocus}\n ref={forwardedRef}\n >\n {children}\n </ListItem>\n );\n});\n\nRow.displayName = ROW_NAME;\n\n/**\n * Read selection state for a single id, from inside any descendant of\n * `<RowList.Root>`. Returns `true` when the row is currently selected.\n * Lets composing components (e.g. `Listbox.OptionIndicator`) react to\n * selection without re-rendering on unrelated changes.\n */\nconst useRowListSelection = (id: string): boolean => {\n const { selectedId } = useRowListContext('useRowListSelection', undefined);\n return selectedId === id;\n};\n\n//\n// Public namespace.\n//\n\nconst RowList = {\n Root,\n Viewport,\n Content,\n};\n\nexport { RowList, Row, createRowListScope, useRowListSelection };\nexport type {\n RootProps as RowListRootProps,\n ViewportProps as RowListViewportProps,\n ContentProps as RowListContentProps,\n RowProps,\n};\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 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, toLocalizedString, useTranslation } from '@dxos/react-ui';\nimport { TextTooltip } from '@dxos/react-ui-text-tooltip';\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,YAAYA,yBAAwB;AACpC,SAASC,iBAAAA,sBAAqB;AAC9B,OAAOC,YAAuC;AAE9C,SAASC,YAAkC;AAC3C,SAASC,MAAAA,WAAU;;;ACLnB,YAAYC,wBAAwB;AACpC,SAASC,qBAAqB;AAC9B,OAAOC,WAA+B;AAGtC,SAASC,UAAU;AAQnB,IAAMC,iBAAiB;AAEhB,IAAM,CAACC,mBAAmBC,mBAAAA,IAAuBL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AKC,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": ["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", "props", "Header", "Trigger", "Icon", "icon", "size", "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", "attachClosestEdge", "extractClosestEdge", "combine", "draggable", "dropTargetForElements", "setCustomNativeDragPreview", "createContext", "Slot", "React", "useEffect", "useRef", "useState", "createPortal", "invariant", "IconButton", "ListItem", "NaturalListItem", "useTranslation", "mx", "osTranslations", "extractClosestEdge", "getReorderDestinationIndex", "monitorForElements", "createContext", "React", "useCallback", "useEffect", "useState", "LIST_NAME", "ListProvider", "useListContext", "createContext", "defaultGetId", "item", "id", "ListRoot", "children", "items", "isItem", "getId", "onMove", "props", "isEqual", "useCallback", "a", "b", "idA", "idB", "undefined", "state", "setState", "useState", "idle", "useEffect", "monitorForElements", "canMonitor", "source", "data", "onDrop", "location", "target", "current", "dropTargets", "sourceData", "targetData", "sourceIdx", "findIndex", "targetIdx", "closestEdgeOfTarget", "extractClosestEdge", "destinationIndex", "getReorderDestinationIndex", "startIndex", "indexOfTarget", "axis", "React", "idle", "stateStyles", "ListItemProvider", "isItem", "dragPreview", "setRootState", "useListContext", "LIST_ITEM_NAME", "rootRef", "Slot", "dragHandleRef", "useRef", "setState", "useState", "useEffect", "element", "invariant", "dragHandle", "canDrag", "getInitialData", "item", "onGenerateDragPreview", "rect", "source", "setCustomNativeDragPreview", "nativeSetDragImage", "x", "height", "render", "container", "undefined", "onDragStart", "type", "onDrop", "getData", "input", "allowedEdges", "getIsSticky", "onDragEnter", "closestEdge", "extractClosestEdge", "onDragLeave", "onDrag", "self", "current", "React", "aria-selected", "className", "ref", "children", "state", "edge", "isDisabled", "disabled", "IconButton", "iconOnly", "variant", "classNames", "autoHide", "t", "useTranslation", "osTranslations", "props", "icon", "label", "ListItemWrapper", "ListItemTitle", "mx", "List", "Root", "ListRoot", "Item", "ListItem", "ItemDragPreview", "ListItemDragPreview", "ItemWrapper", "ListItemWrapper", "ItemDragHandle", "ListItemDragHandle", "ItemIconButton", "ListItemIconButton", "ItemDeleteButton", "ListItemDeleteButton", "ItemTitle", "ListItemTitle", "createContextScope", "React", "forwardRef", "Icon", "mx", "useArrowNavigationGroup", "createContextScope", "useControllableState", "React", "useCallback", "List", "ListItem", "ScrollArea", "composable", "composableProps", "ROW_LIST_NAME", "ROW_LIST_ROOT_NAME", "ROW_LIST_VIEWPORT_NAME", "ROW_LIST_CONTENT_NAME", "ROW_NAME", "createRowListContext", "createRowListScope", "RowListProvider", "useRowListContext", "Root", "selectedId", "defaultSelectedId", "onSelectChange", "children", "resolved", "setResolved", "prop", "defaultProp", "onChange", "next", "undefined", "setSelected", "id", "scope", "displayName", "Viewport", "props", "forwardedRef", "thin", "padding", "centered", "rest", "classNames", "orientation", "ref", "firstEnabledOption", "ul", "querySelector", "Content", "arrowGroup", "axis", "memorizeCurrent", "handleFocus", "event", "target", "currentTarget", "selected", "focus", "composed", "variant", "role", "onFocus", "ROW_BASE", "Row", "disabled", "onClick", "isSelected", "handleClick", "tabIndex", "aria-selected", "aria-disabled", "useRowListSelection", "RowList", "commandItem", "LISTBOX_NAME", "LISTBOX_OPTION_NAME", "LISTBOX_OPTION_INDICATOR_NAME", "createListboxContext", "createListboxScope", "createContextScope", "LISTBOX_NAME", "createRowListScope", "createListboxOptionContext", "createListboxOptionScope", "LISTBOX_OPTION_NAME", "ListboxOptionProvider", "useListboxOptionContext", "ListboxRoot", "forwardRef", "props", "forwardedRef", "__listboxScope", "_scope", "children", "classNames", "value", "defaultValue", "onValueChange", "autoFocus", "_autoFocus", "rootProps", "React", "RowList", "Root", "selectedId", "defaultSelectedId", "onSelectChange", "Content", "mx", "ref", "displayName", "ListboxOption", "Row", "id", "commandItem", "ListboxOptionProviderHost", "isSelected", "useRowListSelection", "scope", "undefined", "ListboxOptionLabel", "span", "className", "ListboxOptionIndicator", "__listboxOptionScope", "Icon", "icon", "Listbox", "Option", "OptionLabel", "OptionIndicator", "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", "toLocalizedString", "useTranslation", "TextTooltip", "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", "__dxlog_file", "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/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;EACF,GAAG;IAACc;IAAcd;GAAM;AAExB,QAAMiB,gBAAgBH,eAAed,QAAQe;AAE7C,QAAMG,aAAaxB,YACjB,CAACyB,OAAAA;AACC,QAAIf,SAAS,SAAS;AACpB,aAAOL,QAAQkB,aAAAA,KAAkBA,cAAcG,IAAID,EAAAA;IACrD;AACA,WAAOF,kBAAkBE;EAC3B,GACA;IAACf;IAAMa;GAAc;AAGvB,QAAMI,cAAc3B,YAClB,CAACyB,IAAYG,aAAAA;AACX,UAAMC,cAAc,MAAA;AAClB,UAAInB,SAAS,SAAS;AACpB,cAAMS,UAAUd,QAAQkB,aAAAA,IAAiBA,gBAAgB,oBAAIhB,IAAAA;AAC7D,cAAMuB,QAAO,IAAIvB,IAAIY,O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W,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"]
7
7
  }