@dxos/react-ui-searchlist 0.8.4-main.21d9917 → 0.8.4-main.2244d791bb

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.
@@ -155,21 +155,23 @@ var SearchListRoot = ({ children, value: valueProp, defaultValue = "", debounceM
155
155
  }, children));
156
156
  };
157
157
  SearchListRoot.displayName = "SearchList.Root";
158
- var SearchListViewport = ({ classNames, children }) => {
158
+ var SearchListContent = /* @__PURE__ */ forwardRef(({ classNames, children }, forwardedRef) => {
159
159
  return /* @__PURE__ */ React.createElement("div", {
160
160
  role: "none",
161
- className: mx("is-full min-bs-0 grow overflow-y-auto", classNames)
161
+ // TODO(burdon): Remove p-1 hack.
162
+ className: mx("flex flex-col gap-2 bs-full is-full min-bs-0 overflow-hidden p-1", classNames),
163
+ ref: forwardedRef
162
164
  }, children);
163
- };
164
- SearchListViewport.displayName = "SearchList.Viewport";
165
- var SearchListContent = /* @__PURE__ */ forwardRef(({ classNames, children }, forwardedRef) => {
165
+ });
166
+ SearchListContent.displayName = "SearchList.Content";
167
+ var SearchListViewport = /* @__PURE__ */ forwardRef(({ classNames, children }, forwardedRef) => {
166
168
  return /* @__PURE__ */ React.createElement("div", {
167
- ref: forwardedRef,
168
169
  role: "listbox",
169
- className: mx("flex flex-col is-full min-bs-0 grow overflow-hidden", classNames)
170
+ className: mx("bs-full is-full min-bs-0 overflow-y-auto", classNames),
171
+ ref: forwardedRef
170
172
  }, children);
171
173
  });
172
- SearchListContent.displayName = "SearchList.Content";
174
+ SearchListViewport.displayName = "SearchList.Viewport";
173
175
  var SearchListInput = /* @__PURE__ */ forwardRef(({ classNames, density: propsDensity, elevation: propsElevation, variant, placeholder, onChange, ...props }, forwardedRef) => {
174
176
  const { query, onQueryChange, selectedValue, onSelectedValueChange, getItemValues, triggerSelect } = useSearchListInputContext("SearchList.Input");
175
177
  const { t } = useTranslation(translationKey);
@@ -258,14 +260,14 @@ var SearchListInput = /* @__PURE__ */ forwardRef(({ classNames, density: propsDe
258
260
  autoFocus: true
259
261
  },
260
262
  type: "text",
261
- value: query,
262
263
  placeholder: placeholder ?? defaultPlaceholder,
263
- className: tx("input.input", "input", {
264
+ className: tx("input.input", {
264
265
  variant,
265
266
  disabled: props.disabled,
266
267
  density,
267
268
  elevation
268
269
  }, classNames),
270
+ value: query,
269
271
  onChange: handleChange,
270
272
  onKeyDown: handleKeyDown,
271
273
  ref: forwardedRef
@@ -358,8 +360,8 @@ var SearchListGroup = /* @__PURE__ */ forwardRef(({ classNames, heading, childre
358
360
  SearchListGroup.displayName = "SearchList.Group";
359
361
  var SearchList = {
360
362
  Root: SearchListRoot,
361
- Viewport: SearchListViewport,
362
363
  Content: SearchListContent,
364
+ Viewport: SearchListViewport,
363
365
  Input: SearchListInput,
364
366
  Item: SearchListItem,
365
367
  Empty: SearchListEmpty,
@@ -542,12 +544,7 @@ var ComboboxContent = /* @__PURE__ */ forwardRef2(({ side = "bottom", collisionP
542
544
  value,
543
545
  defaultValue,
544
546
  debounceMs
545
- }, /* @__PURE__ */ React3.createElement("div", {
546
- className: "contents density-fine",
547
- "aria-label": label,
548
- role: "combobox",
549
- "aria-expanded": "true"
550
- }, children)));
547
+ }, /* @__PURE__ */ React3.createElement(SearchList.Content, null, children)));
551
548
  });
552
549
  ComboboxContent.displayName = COMBOBOX_CONTENT_NAME;
553
550
  var ComboboxTrigger = /* @__PURE__ */ forwardRef2(({ children, onClick, ...props }, forwardedRef) => {
@@ -589,10 +586,10 @@ var ComboboxInput = /* @__PURE__ */ forwardRef2(({ classNames, ...props }, forwa
589
586
  });
590
587
  });
591
588
  var ComboboxList = /* @__PURE__ */ forwardRef2(({ classNames, ...props }, forwardedRef) => {
592
- return /* @__PURE__ */ React3.createElement(SearchList.Content, {
589
+ return /* @__PURE__ */ React3.createElement(SearchList.Viewport, {
593
590
  ...props,
594
591
  classNames: [
595
- "min-bs-0 overflow-y-auto plb-cardSpacingChrome",
592
+ "plb-cardSpacingChrome",
596
593
  classNames
597
594
  ],
598
595
  ref: forwardedRef
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/Combobox/Combobox.tsx", "../../../src/components/SearchList/SearchList.tsx", "../../../src/translations.ts", "../../../src/components/SearchList/context.ts", "../../../src/components/SearchList/hooks/useGlobalFilter.tsx", "../../../src/components/SearchList/hooks/useSearchListInput.ts", "../../../src/components/SearchList/hooks/useSearchListItem.ts", "../../../src/components/SearchList/hooks/useSearchListResults.ts", "../../../src/components/Listbox/Listbox.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { createContext } from '@radix-ui/react-context';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport React, { type PropsWithChildren, forwardRef, useCallback } from 'react';\n\nimport {\n Button,\n type ButtonProps,\n Icon,\n Popover,\n type PopoverArrowProps,\n type PopoverContentProps,\n type PopoverVirtualTriggerProps,\n} from '@dxos/react-ui';\nimport { useId } from '@dxos/react-ui';\nimport { mx, staticPlaceholderText } from '@dxos/ui-theme';\n\nimport {\n SearchList,\n type SearchListContentProps,\n type SearchListEmptyProps,\n type SearchListInputProps,\n type SearchListItemProps,\n type SearchListRootProps,\n} from '../SearchList';\n\nconst COMBOBOX_NAME = 'Combobox';\nconst COMBOBOX_CONTENT_NAME = 'ComboboxContent';\nconst COMBOBOX_ITEM_NAME = 'ComboboxItem';\nconst COMBOBOX_TRIGGER_NAME = 'ComboboxTrigger';\n\n//\n// Context\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<ComboboxContextValue & { modal: boolean; defaultOpen: boolean; defaultValue: string; placeholder: string }>\n>;\n\nconst ComboboxRoot = ({\n modal,\n modalId: propsModalId,\n open: propsOpen,\n defaultOpen,\n onOpenChange: propsOnOpenChange,\n value: propsValue,\n defaultValue,\n onValueChange: propsOnValueChange,\n placeholder,\n children,\n}: ComboboxRootProps) => {\n const modalId = useId(COMBOBOX_NAME, propsModalId);\n const [open = false, onOpenChange] = useControllableState({\n prop: propsOpen,\n onChange: propsOnOpenChange,\n defaultProp: defaultOpen,\n });\n const [value = '', onValueChange] = useControllableState({\n prop: propsValue,\n onChange: propsOnValueChange,\n defaultProp: defaultValue,\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// ContentProps\n//\n\ntype ComboboxContentProps = SearchListRootProps & PopoverContentProps & { label?: string };\n\nconst ComboboxContent = forwardRef<HTMLDivElement, ComboboxContentProps>(\n (\n {\n side = 'bottom',\n collisionPadding = 48,\n sideOffset,\n align,\n alignOffset,\n avoidCollisions,\n collisionBoundary,\n arrowPadding,\n sticky,\n hideWhenDetached,\n onOpenAutoFocus,\n onCloseAutoFocus,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n forceMount,\n children,\n classNames,\n onSearch,\n value,\n defaultValue,\n debounceMs,\n label,\n },\n forwardedRef,\n ) => {\n const { modalId } = useComboboxContext(COMBOBOX_CONTENT_NAME);\n\n return (\n <Popover.Content\n {...{\n side,\n sideOffset,\n align,\n alignOffset,\n avoidCollisions,\n collisionBoundary,\n collisionPadding,\n arrowPadding,\n sticky,\n hideWhenDetached,\n onOpenAutoFocus,\n onCloseAutoFocus,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n forceMount,\n }}\n classNames={[\n 'is-[--radix-popover-trigger-width] max-bs-[--radix-popover-content-available-height] grid grid-rows-[min-content_1fr]',\n classNames,\n ]}\n id={modalId}\n ref={forwardedRef}\n >\n <SearchList.Root onSearch={onSearch} value={value} defaultValue={defaultValue} debounceMs={debounceMs}>\n <div className='contents density-fine' aria-label={label} role='combobox' aria-expanded='true'>\n {children}\n </div>\n </SearchList.Root>\n </Popover.Content>\n );\n },\n);\n\nComboboxContent.displayName = COMBOBOX_CONTENT_NAME;\n\n//\n// Trigger\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\n className={mx('font-normal text-start flex-1 min-is-0 truncate mie-2', !value && staticPlaceholderText)}\n >\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\n//\n\ntype ComboboxInputProps = SearchListInputProps;\n\nconst ComboboxInput = forwardRef<HTMLInputElement, ComboboxInputProps>(({ classNames, ...props }, forwardedRef) => {\n return (\n <SearchList.Input\n {...props}\n classNames={[\n 'mli-cardSpacingChrome mbs-cardSpacingChrome mbe-0 is-[calc(100%-2*var(--dx-cardSpacingChrome))]',\n classNames,\n ]}\n ref={forwardedRef}\n />\n );\n});\n\n//\n// List\n//\n\ntype ComboboxListProps = SearchListContentProps;\n\nconst ComboboxList = forwardRef<HTMLDivElement, ComboboxListProps>(({ classNames, ...props }, forwardedRef) => {\n return (\n <SearchList.Content\n {...props}\n classNames={['min-bs-0 overflow-y-auto plb-cardSpacingChrome', classNames]}\n ref={forwardedRef}\n />\n );\n});\n\n//\n// Item\n//\n\ntype ComboboxItemProps = SearchListItemProps & {\n /** Whether to close the popover when this item is selected. Defaults to true. */\n closeOnSelect?: boolean;\n};\n\nconst ComboboxItem = forwardRef<HTMLDivElement, ComboboxItemProps>(\n ({ classNames, onSelect, value, closeOnSelect = true, ...props }, forwardedRef) => {\n const { onValueChange, onOpenChange } = useComboboxContext(COMBOBOX_ITEM_NAME);\n const handleSelect = useCallback<NonNullable<SearchListItemProps['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 <SearchList.Item\n {...props}\n value={value}\n classNames={['mli-cardSpacingChrome pli-cardSpacingChrome', classNames]}\n onSelect={handleSelect}\n ref={forwardedRef}\n />\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\n//\n\ntype ComboboxEmptyProps = SearchListEmptyProps;\n\nconst ComboboxEmpty = SearchList.Empty;\n\n//\n// Combobox\n// https://www.w3.org/WAI/ARIA/apg/patterns/combobox\n//\n\n//\n// Portal\n//\n\ntype ComboboxPortalProps = React.ComponentPropsWithoutRef<typeof Popover.Portal>;\n\nconst ComboboxPortal = Popover.Portal;\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 2025 DXOS.org\n//\n\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport React, {\n type ChangeEvent,\n type ComponentPropsWithRef,\n type KeyboardEvent,\n type PropsWithChildren,\n type ReactNode,\n forwardRef,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport {\n type Density,\n type Elevation,\n Icon,\n type ThemedClassName,\n useDensityContext,\n useElevationContext,\n useThemeContext,\n useTranslation,\n} from '@dxos/react-ui';\nimport { descriptionText, mx } from '@dxos/ui-theme';\n\nimport { translationKey } from '../../translations';\n\nimport {\n SearchListInputContextProvider,\n SearchListItemContextProvider,\n useSearchListInputContext,\n useSearchListItemContext,\n} from './context';\n\n//\n// Internal types\n//\n\ntype ItemData = {\n element: HTMLElement;\n disabled?: boolean;\n onSelect?: () => void;\n};\n\n//\n// Root\n//\n\ntype SearchListRootProps = PropsWithChildren<{\n /** Controlled query value. */\n value?: string;\n /** Default query value for uncontrolled mode. */\n defaultValue?: string;\n /** Debounce delay in milliseconds. */\n debounceMs?: number;\n /** Callback when search query changes (debounced). */\n onSearch?: (query: string) => void;\n}>;\n\nconst SearchListRoot = ({\n children,\n value: valueProp,\n defaultValue = '',\n debounceMs = 200,\n onSearch,\n}: SearchListRootProps) => {\n const [query = '', setQuery] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue,\n onChange: undefined,\n });\n\n const [selectedValue, setSelectedValue] = useState<string | undefined>(undefined);\n\n // Track registered items: value -> { element, onSelect, disabled }.\n const itemsRef = useRef<Map<string, ItemData>>(new Map());\n\n const debounceRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n const handleQueryChange = useCallback(\n (newQuery: string) => {\n setQuery(newQuery);\n // Don't update selectedValue here - let the effect handle it when items actually change.\n // This prevents unnecessary re-renders of items when query changes.\n\n // Debounce onSearch callback.\n if (debounceRef.current) {\n clearTimeout(debounceRef.current);\n }\n debounceRef.current = setTimeout(() => {\n onSearch?.(newQuery);\n }, debounceMs);\n },\n [setQuery, onSearch, debounceMs],\n );\n\n // Track when items change to trigger first-item selection.\n const [itemVersion, setItemVersion] = useState(0);\n\n // Cleanup debounce on unmount.\n useEffect(() => {\n return () => {\n if (debounceRef.current) {\n clearTimeout(debounceRef.current);\n }\n };\n }, []);\n\n // Auto-select first non-disabled item when items change and no valid selection exists.\n useEffect(() => {\n // Check if current selection is still valid (exists and not disabled).\n const currentItem = selectedValue !== undefined ? itemsRef.current.get(selectedValue) : undefined;\n const isSelectionValid = currentItem !== undefined && !currentItem.disabled;\n if (!isSelectionValid && itemsRef.current.size > 0) {\n // Get first non-disabled item in DOM order.\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 // No valid items available, clear selection\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 // Get item values in DOM order by sorting registered elements (excludes disabled items).\n const getItemValues = useCallback(() => {\n return Array.from(itemsRef.current.entries())\n .filter(([, data]) => !data.disabled)\n .sort(([, a], [, b]) => {\n // Sort by DOM position using compareDocumentPosition.\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 // Item context; stable, doesn't change when query changes.\n const itemContextValue = useMemo(\n () => ({\n selectedValue,\n onSelectedValueChange: setSelectedValue,\n registerItem,\n unregisterItem,\n }),\n [selectedValue, registerItem, unregisterItem],\n );\n\n const inputContextValue = useMemo(\n () => ({\n query,\n onQueryChange: handleQueryChange,\n selectedValue,\n onSelectedValueChange: setSelectedValue,\n getItemValues,\n triggerSelect,\n }),\n [query, handleQueryChange, selectedValue, getItemValues, triggerSelect],\n );\n\n // NOTE: Separate contexts for items and input to avoid unnecessary re-renders of items when query changes.\n return (\n <SearchListInputContextProvider\n query={inputContextValue.query}\n onQueryChange={inputContextValue.onQueryChange}\n selectedValue={inputContextValue.selectedValue}\n onSelectedValueChange={inputContextValue.onSelectedValueChange}\n getItemValues={inputContextValue.getItemValues}\n triggerSelect={inputContextValue.triggerSelect}\n >\n <SearchListItemContextProvider\n selectedValue={itemContextValue.selectedValue}\n onSelectedValueChange={itemContextValue.onSelectedValueChange}\n registerItem={itemContextValue.registerItem}\n unregisterItem={itemContextValue.unregisterItem}\n >\n {children}\n </SearchListItemContextProvider>\n </SearchListInputContextProvider>\n );\n};\n\nSearchListRoot.displayName = 'SearchList.Root';\n\n//\n// Viewport\n//\n\ntype SearchListViewportProps = ThemedClassName<PropsWithChildren<{}>>;\n\n/**\n * Scrollable viewport wrapper for Content.\n * Only Content wrapped in Viewport will be scrollable.\n */\n// TODO(burdon): Reconcile with Mosaic.Viewport.\nconst SearchListViewport = ({ classNames, children }: SearchListViewportProps) => {\n return (\n <div role='none' className={mx('is-full min-bs-0 grow overflow-y-auto', classNames)}>\n {children}\n </div>\n );\n};\n\nSearchListViewport.displayName = 'SearchList.Viewport';\n\n//\n// Content\n//\n\ntype SearchListContentProps = ThemedClassName<PropsWithChildren<{}>>;\n\n/**\n * Container for search results. Does not scroll by default.\n * Wrap in Viewport for scrollable content.\n */\nconst SearchListContent = forwardRef<HTMLDivElement, SearchListContentProps>(\n ({ classNames, children }, forwardedRef) => {\n return (\n <div\n ref={forwardedRef}\n role='listbox'\n className={mx('flex flex-col is-full min-bs-0 grow overflow-hidden', classNames)}\n >\n {children}\n </div>\n );\n },\n);\n\nSearchListContent.displayName = 'SearchList.Content';\n\n//\n// Input\n//\n\ntype InputVariant = 'default' | 'subdued';\n\ntype SearchListInputProps = ThemedClassName<\n Omit<ComponentPropsWithRef<'input'>, 'value'> & {\n density?: Density;\n elevation?: Elevation;\n variant?: InputVariant;\n }\n>;\n\nconst SearchListInput = forwardRef<HTMLInputElement, SearchListInputProps>(\n (\n { classNames, density: propsDensity, elevation: propsElevation, variant, placeholder, onChange, ...props },\n forwardedRef,\n ) => {\n const { query, onQueryChange, selectedValue, onSelectedValueChange, getItemValues, triggerSelect } =\n useSearchListInputContext('SearchList.Input');\n const { t } = useTranslation(translationKey);\n const { hasIosKeyboard, tx } = useThemeContext();\n const density = useDensityContext(propsDensity);\n const elevation = useElevationContext(propsElevation);\n const defaultPlaceholder = t('search.placeholder');\n\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n onQueryChange(event.target.value);\n onChange?.(event);\n },\n [onQueryChange, onChange],\n );\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLInputElement>) => {\n const values = getItemValues();\n if (values.length === 0) {\n if (event.key === 'Escape') {\n onQueryChange('');\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 onQueryChange('');\n }\n break;\n }\n }\n },\n [selectedValue, onSelectedValueChange, getItemValues, triggerSelect, onQueryChange],\n );\n\n return (\n <input\n {...props}\n {...(props.autoFocus && !hasIosKeyboard && { autoFocus: true })}\n type='text'\n value={query}\n placeholder={placeholder ?? defaultPlaceholder}\n className={tx(\n 'input.input',\n 'input',\n {\n variant,\n disabled: props.disabled,\n density,\n elevation,\n },\n classNames,\n )}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n ref={forwardedRef}\n />\n );\n },\n);\n\nSearchListInput.displayName = 'SearchList.Input';\n\n//\n// Item\n//\n\ntype SearchListItemProps = ThemedClassName<{\n /** Unique identifier for the item. */\n value: string;\n /** Display label for the item. */\n label: string;\n /** Icon to display (string identifier for Icon component). */\n icon?: string;\n /** Whether to show a check icon. */\n checked?: boolean;\n /** Suffix text to display after the label. */\n suffix?: string;\n /** Callback when item is selected. */\n onSelect?: () => void;\n /** Whether the item is disabled. */\n disabled?: boolean;\n}>;\n\nconst SearchListItem = forwardRef<HTMLDivElement, SearchListItemProps>(\n ({ classNames, value, label, icon, checked, suffix, onSelect, disabled }, forwardedRef) => {\n const { selectedValue, registerItem, unregisterItem } = useSearchListItemContext('SearchList.Item');\n const internalRef = useRef<HTMLDivElement>(null);\n\n const isSelected = selectedValue === value && !disabled;\n\n // Register this item.\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 // Scroll into view when selected.\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 onSelect?.();\n }\n }, [onSelect, disabled]);\n\n return (\n <div\n ref={(node) => {\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 tabIndex={-1}\n className={mx(\n 'flex gap-2 items-center',\n 'plb-1 pli-2 rounded-sm select-none cursor-pointer data-[selected=true]:bg-hoverOverlay hover:bg-hoverOverlay',\n disabled && 'opacity-50 cursor-not-allowed hover:bg-transparent data-[selected=true]:bg-transparent',\n classNames,\n )}\n onClick={handleClick}\n >\n {icon && <Icon icon={icon} size={5} />}\n <span className='is-0 grow truncate'>{label}</span>\n {suffix && <span className={mx('shrink-0', descriptionText)}>{suffix}</span>}\n {checked && <Icon icon='ph--check--regular' size={5} />}\n </div>\n );\n },\n);\n\nSearchListItem.displayName = 'SearchList.Item';\n\n//\n// Empty\n//\n\ntype SearchListEmptyProps = ThemedClassName<PropsWithChildren<{}>>;\n\nconst SearchListEmpty = ({ classNames, children }: SearchListEmptyProps) => {\n return (\n <div role='status' className={mx('flex flex-col is-full pli-2 plb-1', classNames)}>\n {children}\n </div>\n );\n};\n\nSearchListEmpty.displayName = 'SearchList.Empty';\n\n//\n// Group\n//\n\ntype SearchListGroupProps = ThemedClassName<\n PropsWithChildren<{\n /** Heading for the group. */\n heading?: ReactNode;\n }>\n>;\n\n/**\n * Groups related search items with an optional heading.\n */\nconst SearchListGroup = forwardRef<HTMLDivElement, SearchListGroupProps>(\n ({ classNames, heading, children }, forwardedRef) => {\n return (\n <div ref={forwardedRef} role='group' className={mx('flex flex-col', classNames)}>\n {heading && (\n <div role='presentation' className='pli-2 plb-1 text-xs font-medium text-description'>\n {heading}\n </div>\n )}\n {children}\n </div>\n );\n },\n);\n\nSearchListGroup.displayName = 'SearchList.Group';\n\n//\n// SearchList\n//\n\nexport const SearchList = {\n Root: SearchListRoot,\n Viewport: SearchListViewport,\n Content: SearchListContent,\n Input: SearchListInput,\n Item: SearchListItem,\n Empty: SearchListEmpty,\n Group: SearchListGroup,\n};\n\nexport type {\n SearchListRootProps,\n SearchListViewportProps,\n SearchListContentProps,\n SearchListInputProps,\n SearchListItemProps,\n SearchListEmptyProps,\n SearchListGroupProps,\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Resource } from '@dxos/react-ui';\n\nexport const translationKey = '@dxos/react-ui-searchlist';\n\nexport const translations = [\n {\n 'en-US': {\n [translationKey]: {\n 'search.placeholder': 'Search...',\n },\n },\n },\n] as const satisfies Resource[];\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { createContext } from '@radix-ui/react-context';\n\n/** Context for items - stable, doesn't change when query changes */\nexport type SearchListItemContextValue = {\n /** Currently selected item value for keyboard navigation. */\n selectedValue: string | undefined;\n /** Update the selected value. */\n onSelectedValueChange: (value: string | undefined) => void;\n /** Register an item for keyboard navigation. */\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/** Context for input - can change frequently with query */\nexport type SearchListInputContextValue = {\n /** Current search query. */\n query: string;\n /** Update the query value. */\n onQueryChange: (query: string) => void;\n /** Currently selected item value for keyboard navigation. */\n selectedValue: string | undefined;\n /** Update the selected value. */\n onSelectedValueChange: (value: string | undefined) => void;\n /** Get ordered list of registered item values (excludes disabled items). */\n getItemValues: () => string[];\n /** Trigger selection of the currently highlighted item. */\n triggerSelect: () => void;\n};\n\nexport const [SearchListItemContextProvider, useSearchListItemContext] =\n createContext<SearchListItemContextValue>('SearchListItem');\nexport const [SearchListInputContextProvider, useSearchListInputContext] =\n createContext<SearchListInputContextValue>('SearchListInput');\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { type PropsWithChildren, createContext, useContext, useMemo } from 'react';\n\n/**\n * Type for a filter function that filters an array of objects.\n */\nexport type FilterFunction<T = any> = (objects: T[]) => T[];\n\ntype GlobalFilterContextType = {\n /** The current filter function. */\n filter?: FilterFunction;\n};\n\nconst GlobalFilterContext = createContext<GlobalFilterContextType>({});\n\nexport type GlobalFilterProviderProps = PropsWithChildren<{\n /** The filter function to apply globally. */\n filter?: FilterFunction;\n}>;\n\n/**\n * Provider that makes a filter function available globally.\n * Used by plugin-search to provide its regex-based filtering.\n */\nexport const GlobalFilterProvider = ({ children, filter }: GlobalFilterProviderProps) => {\n const value = useMemo(() => ({ filter }), [filter]);\n return <GlobalFilterContext.Provider value={value}>{children}</GlobalFilterContext.Provider>;\n};\n\n/**\n * Hook to access the global filter context.\n * Returns the filter function if one is provided.\n */\nexport const useGlobalFilter = () => {\n return useContext(GlobalFilterContext);\n};\n\n/**\n * Hook that applies the global filter to an array of objects.\n * If no filter is set, returns the original objects unchanged.\n *\n * @example\n * const objects = useQuery(db, Filter.everything());\n * const filteredObjects = useGlobalFilteredObjects(objects);\n */\nexport const useGlobalFilteredObjects = <T extends Record<string, any>>(objects?: T[]): T[] => {\n const { filter } = useGlobalFilter();\n\n return useMemo(() => {\n if (!objects) {\n return [];\n }\n if (!filter) {\n return objects;\n }\n return filter(objects);\n }, [objects, filter]);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useSearchListInputContext } from '../context';\n\n/**\n * Hook to access the search context for custom input implementations.\n */\nexport const useSearchListInput = () => {\n const { query, onQueryChange, selectedValue, onSelectedValueChange, getItemValues, triggerSelect } =\n useSearchListInputContext('useSearchListInput');\n return { query, onQueryChange, selectedValue, onSelectedValueChange, getItemValues, triggerSelect };\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useSearchListItemContext } from '../context';\n\n/**\n * Hook to access selection state for custom item renderers.\n * Returns the current selected value and registration functions.\n */\nexport const useSearchListItem = () => {\n const { selectedValue, registerItem, unregisterItem } = useSearchListItemContext('useSearchListItem');\n return { selectedValue, registerItem, unregisterItem };\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport commandScore from 'command-score';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nexport type UseSearchListResultsOptions<T> = {\n /** Items to filter. */\n items: T[];\n /** Custom filter function. Defaults to filtering by extracted string. */\n filter?: (item: T, query: string) => boolean;\n /** Enable fuzzy filtering using command-score algorithm. Defaults to true. */\n fuzzy?: boolean;\n /** Custom function to extract the searchable string from an item. Defaults to accessing 'label' property if it exists. */\n extract?: (item: T) => string;\n /** Minimum score threshold for fuzzy matches (0-1). Defaults to 0. */\n minScore?: number;\n};\n\n/**\n * Hook to manage search results with fuzzy filtering (enabled by default).\n * Returns filtered results and a handleSearch function to pass to SearchList.Root.\n *\n * @example\n * // Default fuzzy filtering using command-score (tries to extract from 'label' property)\n * const { results, handleSearch } = useSearchListResults({ items });\n *\n * @example\n * // Disable fuzzy for basic case-insensitive substring match\n * const { results, handleSearch } = useSearchListResults({ items, fuzzy: false });\n *\n * @example\n * // Custom extraction for fuzzy filtering\n * const { results, handleSearch } = useSearchListResults({\n * items,\n * extract: (item) => `${item.name} ${item.description}`,\n * });\n */\nexport const useSearchListResults = <T = unknown>({\n items,\n filter,\n fuzzy = true,\n extract,\n minScore = 0,\n}: UseSearchListResultsOptions<T>) => {\n const [query, setQuery] = useState<string>('');\n const queryRef = useRef<string>('');\n\n // Update results when items change.\n useEffect(() => {\n queryRef.current = '';\n setQuery('');\n }, [items]);\n\n const defaultExtract = useCallback((item: T) => {\n // If item is a string, return it directly\n if (typeof item === 'string') {\n return item;\n }\n // Otherwise, try to access 'label' property\n return (item as any)?.label ?? '';\n }, []);\n const extractFn = extract ?? defaultExtract;\n\n const defaultFilter = useCallback(\n (item: T, query: string) => {\n const searchable = extractFn(item);\n return searchable.toLowerCase().includes(query.toLowerCase());\n },\n [extractFn],\n );\n\n const filterFn = filter ?? defaultFilter;\n\n const handleSearch = useCallback((searchQuery: string) => {\n queryRef.current = searchQuery;\n setQuery(searchQuery);\n }, []);\n\n const results = useMemo(() => {\n const currentQuery = queryRef.current;\n if (!currentQuery) {\n return items;\n }\n\n if (fuzzy) {\n // Score and filter items using command-score.\n const scored = items\n .map((item) => ({\n item,\n score: commandScore(extractFn(item), currentQuery) as number,\n }))\n .filter(({ score }) => score > minScore)\n .sort((a, b) => b.score - a.score);\n\n return scored.map(({ item }) => item);\n } else {\n return items.filter((item) => filterFn(item, currentQuery));\n }\n }, [items, query, filterFn, fuzzy, extractFn, minScore]);\n\n return { results, handleSearch };\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { type Scope, createContextScope } from '@radix-ui/react-context';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport React, { type ComponentPropsWithRef, forwardRef, useCallback, useEffect, useRef } from 'react';\n\nimport { Icon, type IconProps, type ThemedClassName } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\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\n//\n\ntype ListboxScopedProps<P> = P & { __listboxScope?: Scope };\ntype ListboxOptionScopedProps<P> = P & { __listboxOptionScope?: Scope };\n\ntype ListboxOptionProps = ThemedClassName<ComponentPropsWithRef<'li'>> & {\n value: string;\n};\n\nconst [createListboxContext, createListboxScope] = createContextScope(LISTBOX_NAME, []);\nconst [createListboxOptionContext, createListboxOptionScope] = createContextScope(LISTBOX_OPTION_NAME, [\n createListboxScope,\n]);\n\ntype ListboxContextValue = {\n selectedValue: string | undefined;\n onValueChange: (value: string) => void;\n};\n\ntype ListboxOptionContextValue = {\n value: string;\n isSelected: boolean;\n};\n\nconst [ListboxProvider, useListboxContext] = createListboxContext<ListboxContextValue>(LISTBOX_NAME);\nconst [ListboxOptionProvider, useListboxOptionContext] =\n createListboxOptionContext<ListboxOptionContextValue>(LISTBOX_OPTION_NAME);\n\n//\n// Root\n//\n\ntype ListboxRootProps = ThemedClassName<ComponentPropsWithRef<'ul'>> & {\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n autoFocus?: boolean;\n};\n\n// TODO(thure): Note that this overlaps significantly with the the `SelectableListbox` story of `List.tsx` in `react-ui`,\n// making this an exemplar of `List` specifying standard `role=\"listbox\"` interactivity, though it is here because it\n// coheres with SearchList’s styles and norms. This can be promoted to `react-ui`, but doing so should involve clearing\n// the technical- and design-debt in its `List` component.\nconst ListboxRoot = forwardRef<HTMLUListElement, ListboxRootProps>(\n (props: ListboxScopedProps<ListboxRootProps>, forwardedRef) => {\n const {\n __listboxScope,\n children,\n classNames,\n value: propsValue,\n defaultValue,\n onValueChange,\n autoFocus,\n ...rootProps\n } = props;\n\n const arrowGroup = useArrowNavigationGroup({ axis: 'vertical' });\n const ref = useRef<HTMLUListElement | null>(null);\n const rootRef = useComposedRefs<HTMLUListElement>(ref, forwardedRef);\n\n const [selectedValue, setSelectedValue] = useControllableState({\n prop: propsValue,\n defaultProp: defaultValue,\n onChange: onValueChange,\n });\n\n const handleValueChange = (value: string) => {\n setSelectedValue(value);\n };\n\n useEffect(() => {\n // Autofocus the selected option on mount using querySelector\n (ref.current?.querySelector('[aria-selected=\"true\"]') as HTMLLIElement)?.focus();\n }, [autoFocus]);\n\n return (\n <ListboxProvider scope={__listboxScope} selectedValue={selectedValue} onValueChange={handleValueChange}>\n <ul\n role='listbox'\n {...rootProps}\n className={mx('is-full p-cardSpacingChrome', classNames)}\n ref={rootRef}\n {...arrowGroup}\n >\n {children}\n </ul>\n </ListboxProvider>\n );\n },\n);\n\nListboxRoot.displayName = LISTBOX_NAME;\n\n//\n// Option\n//\n\nconst ListboxOption = forwardRef<HTMLLIElement, ListboxOptionProps>(\n (props: ListboxScopedProps<ListboxOptionProps>, forwardedRef) => {\n const { __listboxScope, children, classNames, value, ...rootProps } = props;\n const { selectedValue, onValueChange } = useListboxContext(LISTBOX_OPTION_NAME, __listboxScope);\n\n const isSelected = selectedValue === value;\n\n const handleSelect = useCallback(() => {\n onValueChange(value);\n }, [value, onValueChange]);\n\n return (\n <ListboxOptionProvider scope={__listboxScope} value={value} isSelected={isSelected}>\n <li\n role='option'\n {...rootProps}\n aria-selected={isSelected}\n tabIndex={0}\n className={mx(\n 'dx-focus-ring',\n 'plb-1 pli-2 rounded-sm select-none cursor-pointer data-[selected=true]:bg-hoverOverlay hover:bg-hoverOverlay',\n commandItem,\n classNames,\n )}\n onClick={handleSelect}\n onKeyDown={({ key }) => {\n if (['Enter', ' '].includes(key)) {\n handleSelect();\n }\n }}\n ref={forwardedRef}\n >\n {children}\n </li>\n </ListboxOptionProvider>\n );\n },\n);\n\nListboxOption.displayName = LISTBOX_OPTION_NAME;\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_OPTION_LABEL_NAME;\n\ntype ListboxOptionIndicatorProps = Omit<IconProps, 'icon'> & Partial<Pick<IconProps, 'icon'>>;\n\n//\n// OptionIndicator\n//\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_OPTION_INDICATOR_NAME;\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, useListboxContext };\n\nexport type { ListboxRootProps, ListboxOptionProps, ListboxScopedProps };\n"],
5
- "mappings": ";AAIA,SAASA,iBAAAA,sBAAqB;AAC9B,SAASC,wBAAAA,6BAA4B;AACrC,OAAOC,UAAiCC,cAAAA,aAAYC,eAAAA,oBAAmB;AAEvE,SACEC,QAEAC,QAAAA,OACAC,eAIK;AACP,SAASC,aAAa;AACtB,SAASC,MAAAA,KAAIC,6BAA6B;;;ACd1C,SAASC,4BAA4B;AACrC,OAAOC,SAMLC,YACAC,aACAC,WACAC,SACAC,QACAC,gBACK;AAEP,SAGEC,MAEAC,mBACAC,qBACAC,iBACAC,sBACK;AACP,SAASC,iBAAiBC,UAAU;;;ACvB7B,IAAMC,iBAAiB;AAEvB,IAAM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O5B;IAAgBG;IAAcgC;KAC1D,gBAAAR,OAAA,cAACW,MAAAA;IACCR,MAAK;IACJ,GAAGtB;IACJ+B,iBAAeJ;IACfK,UAAU;IACVT,WAAWC,IACT,iBACA,gHACAlD,aACAoB,UAAAA;IAEFuC,SAASL;IACTM,WAAW,CAAC,EAAEC,IAAG,MAAE;AACjB,UAAI;QAAC;QAAS;QAAKC,SAASD,GAAAA,GAAM;AAChCP,qBAAAA;MACF;IACF;IACAxB,KAAKb;KAEJE,QAAAA,CAAAA;AAIT,CAAA;AAGFiC,cAAcD,cAAcjD;AAM5B,IAAM6D,qBAAqBhD,gBAAAA,YACzB,CAAC,EAAEI,UAAUC,YAAY,GAAGM,UAAAA,GAAaT,iBAAAA;AACvC,SACE,gBAAA4B,OAAA,cAACmB,QAAAA;IAAM,GAAGtC;IAAWuB,WAAWC,IAAG,iBAAiB9B,UAAAA;IAAaU,KAAKb;KACnEE,QAAAA;AAGP,CAAA;AAGF4C,mBAAmBZ,cAAchD;AAQjC,IAAM8D,yBAAyBlD,gBAAAA,YAC7B,CAACC,OAA8DC,iBAAAA;AAC7D,QAAM,EAAEiD,sBAAsB9C,YAAY,GAAGM,UAAAA,IAAcV;AAC3D,QAAM,EAAEqC,WAAU,IAAKxC,wBAAwBT,+BAA+B8D,oBAAAA;AAE9E,SACE,gBAAArB,OAAA,cAACsB,OAAAA;IACCC,MAAK;IACJ,GAAG1C;IACJN,YAAY8B,IAAG,CAACG,cAAc,aAAajC,UAAAA;IAC3CU,KAAKb;;AAGX,CAAA;AAGFgD,uBAAuBd,cAAc/C;AAM9B,IAAMiE,UAAU;EACrBC,MAAMxD;EACNyD,QAAQnB;EACRoB,aAAaT;EACbU,iBAAiBR;AACnB;",
6
- "names": ["createContext", "useControllableState", "React", "forwardRef", "useCallback", "Button", "Icon", "Popover", "useId", "mx", "staticPlaceholderText", "useControllableState", "React", "forwardRef", "useCallback", "useEffect", "useMemo", "useRef", "useState", "Icon", "useDensityContext", "useElevationContext", "useThemeContext", "useTranslation", "descriptionText", "mx", "translationKey", "translations", "createContext", "SearchListItemContextProvider", "useSearchListItemContext", "createContext", "SearchListInputContextProvider", "useSearchListInputContext", "SearchListRoot", "children", "value", "valueProp", "defaultValue", "debounceMs", "onSearch", "query", "setQuery", "useControllableState", "prop", "defaultProp", "onChange", "undefined", "selectedValue", "setSelectedValue", "useState", "itemsRef", "useRef", "Map", "debounceRef", "handleQueryChange", "useCallback", "newQuery", "current", "clearTimeout", "setTimeout", "itemVersion", "setItemVersion", "useEffect", "currentItem", "get", "isSelectionValid", "disabled", "size", "entries", "Array", "from", "filter", "data", "length", "sort", "a", "b", "position", "element", "compareDocumentPosition", "Node", "DOCUMENT_POSITION_FOLLOWING", "DOCUMENT_POSITION_PRECEDING", "firstValue", "registerItem", "onSelect", "set", "v", "unregisterItem", "delete", "getItemValues", "map", "triggerSelect", "item", "itemContextValue", "useMemo", "onSelectedValueChange", "inputContextValue", "onQueryChange", "SearchListInputContextProvider", "SearchListItemContextProvider", "displayName", "SearchListViewport", "classNames", "div", "role", "className", "mx", "SearchListContent", "forwardRef", "forwardedRef", "ref", "SearchListInput", "density", "propsDensity", "elevation", "propsElevation", "variant", "placeholder", "props", "useSearchListInputContext", "t", "useTranslation", "translationKey", "hasIosKeyboard", "tx", "useThemeContext", "useDensityContext", "useElevationContext", "defaultPlaceholder", "handleChange", "event", "target", "handleKeyDown", "values", "key", "currentIndex", "indexOf", "preventDefault", "nextIndex", "Math", "min", "nextValue", "prevIndex", "max", "prevValue", "lastValue", "input", "autoFocus", "type", "onKeyDown", "SearchListItem", "label", "icon", "checked", "suffix", "useSearchListItemContext", "internalRef", "isSelected", "scrollIntoView", "block", "behavior", "handleClick", "node", "aria-selected", "aria-disabled", "data-selected", "data-disabled", "data-value", "tabIndex", "onClick", "Icon", "span", "descriptionText", "SearchListEmpty", "SearchListGroup", "heading", "SearchList", "Root", "Viewport", "Content", "Input", "Item", "Empty", "Group", "React", "createContext", "useContext", "useMemo", "GlobalFilterContext", "createContext", "GlobalFilterProvider", "children", "filter", "value", "useMemo", "React", "Provider", "useGlobalFilter", "useContext", "useGlobalFilteredObjects", "objects", "useSearchListInput", "query", "onQueryChange", "selectedValue", "onSelectedValueChange", "getItemValues", "triggerSelect", "useSearchListInputContext", "useSearchListItem", "selectedValue", "registerItem", "unregisterItem", "useSearchListItemContext", "commandScore", "useCallback", "useEffect", "useMemo", "useRef", "useState", "useSearchListResults", "items", "filter", "fuzzy", "extract", "minScore", "query", "setQuery", "useState", "queryRef", "useRef", "useEffect", "current", "defaultExtract", "useCallback", "item", "label", "extractFn", "defaultFilter", "searchable", "toLowerCase", "includes", "filterFn", "handleSearch", "searchQuery", "results", "useMemo", "currentQuery", "scored", "map", "score", "commandScore", "sort", "a", "b", "COMBOBOX_NAME", "COMBOBOX_CONTENT_NAME", "COMBOBOX_ITEM_NAME", "COMBOBOX_TRIGGER_NAME", "ComboboxProvider", "useComboboxContext", "createContext", "ComboboxRoot", "modal", "modalId", "propsModalId", "open", "propsOpen", "defaultOpen", "onOpenChange", "propsOnOpenChange", "value", "propsValue", "defaultValue", "onValueChange", "propsOnValueChange", "placeholder", "children", "useId", "useControllableState", "prop", "onChange", "defaultProp", "React", "Popover", "Root", "isCombobox", "ComboboxContent", "forwardRef", "side", "collisionPadding", "sideOffset", "align", "alignOffset", "avoidCollisions", "collisionBoundary", "arrowPadding", "sticky", "hideWhenDetached", "onOpenAutoFocus", "onCloseAutoFocus", "onEscapeKeyDown", "onPointerDownOutside", "onFocusOutside", "onInteractOutside", "forceMount", "classNames", "onSearch", "debounceMs", "label", "forwardedRef", "Content", "id", "ref", "SearchList", "div", "className", "aria-label", "role", "aria-expanded", "displayName", "ComboboxTrigger", "onClick", "props", "handleClick", "useCallback", "event", "Trigger", "asChild", "Button", "aria-controls", "aria-haspopup", "span", "mx", "staticPlaceholderText", "Icon", "icon", "size", "ComboboxVirtualTrigger", "VirtualTrigger", "ComboboxInput", "Input", "ComboboxList", "ComboboxItem", "onSelect", "closeOnSelect", "handleSelect", "undefined", "Item", "ComboboxArrow", "Arrow", "ComboboxEmpty", "Empty", "ComboboxPortal", "Portal", "Combobox", "List", "useArrowNavigationGroup", "useComposedRefs", "createContextScope", "useControllableState", "React", "forwardRef", "useCallback", "useEffect", "useRef", "Icon", "mx", "commandItem", "LISTBOX_NAME", "LISTBOX_OPTION_NAME", "LISTBOX_OPTION_LABEL_NAME", "LISTBOX_OPTION_INDICATOR_NAME", "createListboxContext", "createListboxScope", "createContextScope", "createListboxOptionContext", "createListboxOptionScope", "ListboxProvider", "useListboxContext", "ListboxOptionProvider", "useListboxOptionContext", "ListboxRoot", "forwardRef", "props", "forwardedRef", "__listboxScope", "children", "classNames", "value", "propsValue", "defaultValue", "onValueChange", "autoFocus", "rootProps", "arrowGroup", "useArrowNavigationGroup", "axis", "ref", "useRef", "rootRef", "useComposedRefs", "selectedValue", "setSelectedValue", "useControllableState", "prop", "defaultProp", "onChange", "handleValueChange", "useEffect", "current", "querySelector", "focus", "React", "scope", "ul", "role", "className", "mx", "displayName", "ListboxOption", "isSelected", "handleSelect", "useCallback", "li", "aria-selected", "tabIndex", "onClick", "onKeyDown", "key", "includes", "ListboxOptionLabel", "span", "ListboxOptionIndicator", "__listboxOptionScope", "Icon", "icon", "Listbox", "Root", "Option", "OptionLabel", "OptionIndicator"]
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { createContext } from '@radix-ui/react-context';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport React, { type PropsWithChildren, forwardRef, useCallback } from 'react';\n\nimport {\n Button,\n type ButtonProps,\n Icon,\n Popover,\n type PopoverArrowProps,\n type PopoverContentProps,\n type PopoverVirtualTriggerProps,\n} from '@dxos/react-ui';\nimport { useId } from '@dxos/react-ui';\nimport { mx, staticPlaceholderText } from '@dxos/ui-theme';\n\nimport {\n SearchList,\n type SearchListEmptyProps,\n type SearchListInputProps,\n type SearchListItemProps,\n type SearchListRootProps,\n type SearchListViewportProps,\n} from '../SearchList';\n\nconst COMBOBOX_NAME = 'Combobox';\nconst COMBOBOX_CONTENT_NAME = 'ComboboxContent';\nconst COMBOBOX_ITEM_NAME = 'ComboboxItem';\nconst COMBOBOX_TRIGGER_NAME = 'ComboboxTrigger';\n\n//\n// Context\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<ComboboxContextValue & { modal: boolean; defaultOpen: boolean; defaultValue: string; placeholder: string }>\n>;\n\nconst ComboboxRoot = ({\n modal,\n modalId: propsModalId,\n open: propsOpen,\n defaultOpen,\n onOpenChange: propsOnOpenChange,\n value: propsValue,\n defaultValue,\n onValueChange: propsOnValueChange,\n placeholder,\n children,\n}: ComboboxRootProps) => {\n const modalId = useId(COMBOBOX_NAME, propsModalId);\n const [open = false, onOpenChange] = useControllableState({\n prop: propsOpen,\n onChange: propsOnOpenChange,\n defaultProp: defaultOpen,\n });\n const [value = '', onValueChange] = useControllableState({\n prop: propsValue,\n onChange: propsOnValueChange,\n defaultProp: defaultValue,\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// ContentProps\n//\n\ntype ComboboxContentProps = SearchListRootProps & PopoverContentProps & { label?: string };\n\nconst ComboboxContent = forwardRef<HTMLDivElement, ComboboxContentProps>(\n (\n {\n side = 'bottom',\n collisionPadding = 48,\n sideOffset,\n align,\n alignOffset,\n avoidCollisions,\n collisionBoundary,\n arrowPadding,\n sticky,\n hideWhenDetached,\n onOpenAutoFocus,\n onCloseAutoFocus,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n forceMount,\n children,\n classNames,\n onSearch,\n value,\n defaultValue,\n debounceMs,\n label,\n },\n forwardedRef,\n ) => {\n const { modalId } = useComboboxContext(COMBOBOX_CONTENT_NAME);\n\n return (\n <Popover.Content\n {...{\n side,\n sideOffset,\n align,\n alignOffset,\n avoidCollisions,\n collisionBoundary,\n collisionPadding,\n arrowPadding,\n sticky,\n hideWhenDetached,\n onOpenAutoFocus,\n onCloseAutoFocus,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n forceMount,\n }}\n classNames={[\n 'is-[--radix-popover-trigger-width] max-bs-[--radix-popover-content-available-height] grid grid-rows-[min-content_1fr]',\n classNames,\n ]}\n id={modalId}\n ref={forwardedRef}\n >\n <SearchList.Root onSearch={onSearch} value={value} defaultValue={defaultValue} debounceMs={debounceMs}>\n <SearchList.Content>{children}</SearchList.Content>\n </SearchList.Root>\n </Popover.Content>\n );\n },\n);\n\nComboboxContent.displayName = COMBOBOX_CONTENT_NAME;\n\n//\n// Trigger\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\n className={mx('font-normal text-start flex-1 min-is-0 truncate mie-2', !value && staticPlaceholderText)}\n >\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\n//\n\ntype ComboboxInputProps = SearchListInputProps;\n\nconst ComboboxInput = forwardRef<HTMLInputElement, ComboboxInputProps>(({ classNames, ...props }, forwardedRef) => {\n return (\n <SearchList.Input\n {...props}\n classNames={[\n 'mli-cardSpacingChrome mbs-cardSpacingChrome mbe-0 is-[calc(100%-2*var(--dx-cardSpacingChrome))]',\n classNames,\n ]}\n ref={forwardedRef}\n />\n );\n});\n\n//\n// List\n//\n\ntype ComboboxListProps = SearchListViewportProps;\n\nconst ComboboxList = forwardRef<HTMLDivElement, ComboboxListProps>(({ classNames, ...props }, forwardedRef) => {\n return <SearchList.Viewport {...props} classNames={['plb-cardSpacingChrome', classNames]} ref={forwardedRef} />;\n});\n\n//\n// Item\n//\n\ntype ComboboxItemProps = SearchListItemProps & {\n /** Whether to close the popover when this item is selected. Defaults to true. */\n closeOnSelect?: boolean;\n};\n\nconst ComboboxItem = forwardRef<HTMLDivElement, ComboboxItemProps>(\n ({ classNames, onSelect, value, closeOnSelect = true, ...props }, forwardedRef) => {\n const { onValueChange, onOpenChange } = useComboboxContext(COMBOBOX_ITEM_NAME);\n const handleSelect = useCallback<NonNullable<SearchListItemProps['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 <SearchList.Item\n {...props}\n value={value}\n classNames={['mli-cardSpacingChrome pli-cardSpacingChrome', classNames]}\n onSelect={handleSelect}\n ref={forwardedRef}\n />\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\n//\n\ntype ComboboxEmptyProps = SearchListEmptyProps;\n\nconst ComboboxEmpty = SearchList.Empty;\n\n//\n// Combobox\n// https://www.w3.org/WAI/ARIA/apg/patterns/combobox\n//\n\n//\n// Portal\n//\n\ntype ComboboxPortalProps = React.ComponentPropsWithoutRef<typeof Popover.Portal>;\n\nconst ComboboxPortal = Popover.Portal;\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 2025 DXOS.org\n//\n\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport React, {\n type ChangeEvent,\n type ComponentPropsWithRef,\n type KeyboardEvent,\n type PropsWithChildren,\n type ReactNode,\n forwardRef,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport {\n type Density,\n type Elevation,\n Icon,\n type ThemedClassName,\n useDensityContext,\n useElevationContext,\n useThemeContext,\n useTranslation,\n} from '@dxos/react-ui';\nimport { descriptionText, mx } from '@dxos/ui-theme';\n\nimport { translationKey } from '../../translations';\n\nimport {\n SearchListInputContextProvider,\n SearchListItemContextProvider,\n useSearchListInputContext,\n useSearchListItemContext,\n} from './context';\n\n//\n// Internal types\n//\n\ntype ItemData = {\n element: HTMLElement;\n disabled?: boolean;\n onSelect?: () => void;\n};\n\n//\n// Root\n//\n\ntype SearchListRootProps = PropsWithChildren<{\n /** Controlled query value. */\n value?: string;\n\n /** Default query value for uncontrolled mode. */\n defaultValue?: string;\n\n /** Debounce delay in milliseconds. */\n debounceMs?: number;\n\n /** Callback when search query changes (debounced). */\n onSearch?: (query: string) => void;\n}>;\n\nconst SearchListRoot = ({\n children,\n value: valueProp,\n defaultValue = '',\n debounceMs = 200,\n onSearch,\n}: SearchListRootProps) => {\n const [query = '', setQuery] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue,\n onChange: undefined,\n });\n\n const [selectedValue, setSelectedValue] = useState<string | undefined>(undefined);\n\n // Track registered items: value -> { element, onSelect, disabled }.\n const itemsRef = useRef<Map<string, ItemData>>(new Map());\n\n const debounceRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n const handleQueryChange = useCallback(\n (newQuery: string) => {\n setQuery(newQuery);\n // Don't update selectedValue here - let the effect handle it when items actually change.\n // This prevents unnecessary re-renders of items when query changes.\n\n // Debounce onSearch callback.\n if (debounceRef.current) {\n clearTimeout(debounceRef.current);\n }\n debounceRef.current = setTimeout(() => {\n onSearch?.(newQuery);\n }, debounceMs);\n },\n [setQuery, onSearch, debounceMs],\n );\n\n // Track when items change to trigger first-item selection.\n const [itemVersion, setItemVersion] = useState(0);\n\n // Cleanup debounce on unmount.\n useEffect(() => {\n return () => {\n if (debounceRef.current) {\n clearTimeout(debounceRef.current);\n }\n };\n }, []);\n\n // Auto-select first non-disabled item when items change and no valid selection exists.\n useEffect(() => {\n // Check if current selection is still valid (exists and not disabled).\n const currentItem = selectedValue !== undefined ? itemsRef.current.get(selectedValue) : undefined;\n const isSelectionValid = currentItem !== undefined && !currentItem.disabled;\n if (!isSelectionValid && itemsRef.current.size > 0) {\n // Get first non-disabled item in DOM order.\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 // No valid items available, clear selection\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 // Get item values in DOM order by sorting registered elements (excludes disabled items).\n const getItemValues = useCallback(() => {\n return Array.from(itemsRef.current.entries())\n .filter(([, data]) => !data.disabled)\n .sort(([, a], [, b]) => {\n // Sort by DOM position using compareDocumentPosition.\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 // Item context; stable, doesn't change when query changes.\n const itemContextValue = useMemo(\n () => ({\n selectedValue,\n onSelectedValueChange: setSelectedValue,\n registerItem,\n unregisterItem,\n }),\n [selectedValue, registerItem, unregisterItem],\n );\n\n const inputContextValue = useMemo(\n () => ({\n query,\n onQueryChange: handleQueryChange,\n selectedValue,\n onSelectedValueChange: setSelectedValue,\n getItemValues,\n triggerSelect,\n }),\n [query, handleQueryChange, selectedValue, getItemValues, triggerSelect],\n );\n\n // NOTE: Separate contexts for items and input to avoid unnecessary re-renders of items when query changes.\n return (\n <SearchListInputContextProvider\n query={inputContextValue.query}\n onQueryChange={inputContextValue.onQueryChange}\n selectedValue={inputContextValue.selectedValue}\n onSelectedValueChange={inputContextValue.onSelectedValueChange}\n getItemValues={inputContextValue.getItemValues}\n triggerSelect={inputContextValue.triggerSelect}\n >\n <SearchListItemContextProvider\n selectedValue={itemContextValue.selectedValue}\n onSelectedValueChange={itemContextValue.onSelectedValueChange}\n registerItem={itemContextValue.registerItem}\n unregisterItem={itemContextValue.unregisterItem}\n >\n {children}\n </SearchListItemContextProvider>\n </SearchListInputContextProvider>\n );\n};\n\nSearchListRoot.displayName = 'SearchList.Root';\n\n//\n// Content\n//\n\ntype SearchListContentProps = ThemedClassName<PropsWithChildren<{}>>;\n\nconst SearchListContent = forwardRef<HTMLDivElement, SearchListContentProps>(\n ({ classNames, children }, forwardedRef) => {\n return (\n <div\n role='none'\n // TODO(burdon): Remove p-1 hack.\n className={mx('flex flex-col gap-2 bs-full is-full min-bs-0 overflow-hidden p-1', classNames)}\n ref={forwardedRef}\n >\n {children}\n </div>\n );\n },\n);\n\nSearchListContent.displayName = 'SearchList.Content';\n\n//\n// Viewport\n//\n\ntype SearchListViewportProps = ThemedClassName<PropsWithChildren>;\n\n/**\n * Scrollable viewport wrapper for Content.\n * Only Content wrapped in Viewport will be scrollable.\n */\n// TODO(burdon): Reconcile with Mosaic.Viewport (factor out common core?).\nconst SearchListViewport = forwardRef<HTMLDivElement, SearchListViewportProps>(\n ({ classNames, children }, forwardedRef) => {\n return (\n <div role='listbox' className={mx('bs-full is-full min-bs-0 overflow-y-auto', classNames)} ref={forwardedRef}>\n {children}\n </div>\n );\n },\n);\n\nSearchListViewport.displayName = 'SearchList.Viewport';\n\n//\n// Input\n//\n\ntype InputVariant = 'default' | 'subdued';\n\ntype SearchListInputProps = ThemedClassName<\n Omit<ComponentPropsWithRef<'input'>, 'value'> & {\n density?: Density;\n elevation?: Elevation;\n variant?: InputVariant;\n }\n>;\n\nconst SearchListInput = forwardRef<HTMLInputElement, SearchListInputProps>(\n (\n { classNames, density: propsDensity, elevation: propsElevation, variant, placeholder, onChange, ...props },\n forwardedRef,\n ) => {\n const { query, onQueryChange, selectedValue, onSelectedValueChange, getItemValues, triggerSelect } =\n useSearchListInputContext('SearchList.Input');\n const { t } = useTranslation(translationKey);\n const { hasIosKeyboard, tx } = useThemeContext();\n const density = useDensityContext(propsDensity);\n const elevation = useElevationContext(propsElevation);\n const defaultPlaceholder = t('search.placeholder');\n\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n onQueryChange(event.target.value);\n onChange?.(event);\n },\n [onQueryChange, onChange],\n );\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLInputElement>) => {\n const values = getItemValues();\n if (values.length === 0) {\n if (event.key === 'Escape') {\n onQueryChange('');\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 onQueryChange('');\n }\n break;\n }\n }\n },\n [selectedValue, onSelectedValueChange, getItemValues, triggerSelect, onQueryChange],\n );\n\n return (\n <input\n {...props}\n {...(props.autoFocus && !hasIosKeyboard && { autoFocus: true })}\n type='text'\n placeholder={placeholder ?? defaultPlaceholder}\n className={tx(\n 'input.input',\n {\n variant,\n disabled: props.disabled,\n density,\n elevation,\n },\n classNames,\n )}\n value={query}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n ref={forwardedRef}\n />\n );\n },\n);\n\nSearchListInput.displayName = 'SearchList.Input';\n\n//\n// Item\n//\n\ntype SearchListItemProps = ThemedClassName<{\n /** Unique identifier for the item. */\n value: string;\n /** Display label for the item. */\n label: string;\n /** Icon to display (string identifier for Icon component). */\n icon?: string;\n /** Whether to show a check icon. */\n checked?: boolean;\n /** Suffix text to display after the label. */\n suffix?: string;\n /** Callback when item is selected. */\n onSelect?: () => void;\n /** Whether the item is disabled. */\n disabled?: boolean;\n}>;\n\nconst SearchListItem = forwardRef<HTMLDivElement, SearchListItemProps>(\n ({ classNames, value, label, icon, checked, suffix, onSelect, disabled }, forwardedRef) => {\n const { selectedValue, registerItem, unregisterItem } = useSearchListItemContext('SearchList.Item');\n const internalRef = useRef<HTMLDivElement>(null);\n\n const isSelected = selectedValue === value && !disabled;\n\n // Register this item.\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 // Scroll into view when selected.\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 onSelect?.();\n }\n }, [onSelect, disabled]);\n\n return (\n <div\n ref={(node) => {\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 tabIndex={-1}\n className={mx(\n 'flex gap-2 items-center',\n 'plb-1 pli-2 rounded-sm select-none cursor-pointer data-[selected=true]:bg-hoverOverlay hover:bg-hoverOverlay',\n disabled && 'opacity-50 cursor-not-allowed hover:bg-transparent data-[selected=true]:bg-transparent',\n classNames,\n )}\n onClick={handleClick}\n >\n {icon && <Icon icon={icon} size={5} />}\n <span className='is-0 grow truncate'>{label}</span>\n {suffix && <span className={mx('shrink-0', descriptionText)}>{suffix}</span>}\n {checked && <Icon icon='ph--check--regular' size={5} />}\n </div>\n );\n },\n);\n\nSearchListItem.displayName = 'SearchList.Item';\n\n//\n// Empty\n//\n\ntype SearchListEmptyProps = ThemedClassName<PropsWithChildren<{}>>;\n\nconst SearchListEmpty = ({ classNames, children }: SearchListEmptyProps) => {\n return (\n <div role='status' className={mx('flex flex-col is-full pli-2 plb-1', classNames)}>\n {children}\n </div>\n );\n};\n\nSearchListEmpty.displayName = 'SearchList.Empty';\n\n//\n// Group\n//\n\ntype SearchListGroupProps = ThemedClassName<\n PropsWithChildren<{\n /** Heading for the group. */\n heading?: ReactNode;\n }>\n>;\n\n/**\n * Groups related search items with an optional heading.\n */\nconst SearchListGroup = forwardRef<HTMLDivElement, SearchListGroupProps>(\n ({ classNames, heading, children }, forwardedRef) => {\n return (\n <div ref={forwardedRef} role='group' className={mx('flex flex-col', classNames)}>\n {heading && (\n <div role='presentation' className='pli-2 plb-1 text-xs font-medium text-description'>\n {heading}\n </div>\n )}\n {children}\n </div>\n );\n },\n);\n\nSearchListGroup.displayName = 'SearchList.Group';\n\n//\n// SearchList\n//\n\nexport const SearchList = {\n Root: SearchListRoot,\n Content: SearchListContent,\n Viewport: SearchListViewport,\n Input: SearchListInput,\n Item: SearchListItem,\n Empty: SearchListEmpty,\n Group: SearchListGroup,\n};\n\nexport type {\n SearchListRootProps,\n SearchListContentProps,\n SearchListViewportProps,\n SearchListInputProps,\n SearchListItemProps,\n SearchListEmptyProps,\n SearchListGroupProps,\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Resource } from '@dxos/react-ui';\n\nexport const translationKey = '@dxos/react-ui-searchlist';\n\nexport const translations = [\n {\n 'en-US': {\n [translationKey]: {\n 'search.placeholder': 'Search...',\n },\n },\n },\n] as const satisfies Resource[];\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { createContext } from '@radix-ui/react-context';\n\n/** Context for items - stable, doesn't change when query changes */\nexport type SearchListItemContextValue = {\n /** Currently selected item value for keyboard navigation. */\n selectedValue: string | undefined;\n /** Update the selected value. */\n onSelectedValueChange: (value: string | undefined) => void;\n /** Register an item for keyboard navigation. */\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/** Context for input - can change frequently with query */\nexport type SearchListInputContextValue = {\n /** Current search query. */\n query: string;\n /** Update the query value. */\n onQueryChange: (query: string) => void;\n /** Currently selected item value for keyboard navigation. */\n selectedValue: string | undefined;\n /** Update the selected value. */\n onSelectedValueChange: (value: string | undefined) => void;\n /** Get ordered list of registered item values (excludes disabled items). */\n getItemValues: () => string[];\n /** Trigger selection of the currently highlighted item. */\n triggerSelect: () => void;\n};\n\nexport const [SearchListItemContextProvider, useSearchListItemContext] =\n createContext<SearchListItemContextValue>('SearchListItem');\nexport const [SearchListInputContextProvider, useSearchListInputContext] =\n createContext<SearchListInputContextValue>('SearchListInput');\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { type PropsWithChildren, createContext, useContext, useMemo } from 'react';\n\n/**\n * Type for a filter function that filters an array of objects.\n */\nexport type FilterFunction<T = any> = (objects: T[]) => T[];\n\ntype GlobalFilterContextType = {\n /** The current filter function. */\n filter?: FilterFunction;\n};\n\nconst GlobalFilterContext = createContext<GlobalFilterContextType>({});\n\nexport type GlobalFilterProviderProps = PropsWithChildren<{\n /** The filter function to apply globally. */\n filter?: FilterFunction;\n}>;\n\n/**\n * Provider that makes a filter function available globally.\n * Used by plugin-search to provide its regex-based filtering.\n */\nexport const GlobalFilterProvider = ({ children, filter }: GlobalFilterProviderProps) => {\n const value = useMemo(() => ({ filter }), [filter]);\n return <GlobalFilterContext.Provider value={value}>{children}</GlobalFilterContext.Provider>;\n};\n\n/**\n * Hook to access the global filter context.\n * Returns the filter function if one is provided.\n */\nexport const useGlobalFilter = () => {\n return useContext(GlobalFilterContext);\n};\n\n/**\n * Hook that applies the global filter to an array of objects.\n * If no filter is set, returns the original objects unchanged.\n *\n * @example\n * const objects = useQuery(db, Filter.everything());\n * const filteredObjects = useGlobalFilteredObjects(objects);\n */\nexport const useGlobalFilteredObjects = <T extends Record<string, any>>(objects?: T[]): T[] => {\n const { filter } = useGlobalFilter();\n\n return useMemo(() => {\n if (!objects) {\n return [];\n }\n if (!filter) {\n return objects;\n }\n return filter(objects);\n }, [objects, filter]);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useSearchListInputContext } from '../context';\n\n/**\n * Hook to access the search context for custom input implementations.\n */\nexport const useSearchListInput = () => {\n const { query, onQueryChange, selectedValue, onSelectedValueChange, getItemValues, triggerSelect } =\n useSearchListInputContext('useSearchListInput');\n return { query, onQueryChange, selectedValue, onSelectedValueChange, getItemValues, triggerSelect };\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useSearchListItemContext } from '../context';\n\n/**\n * Hook to access selection state for custom item renderers.\n * Returns the current selected value and registration functions.\n */\nexport const useSearchListItem = () => {\n const { selectedValue, registerItem, unregisterItem } = useSearchListItemContext('useSearchListItem');\n return { selectedValue, registerItem, unregisterItem };\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport commandScore from 'command-score';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nexport type UseSearchListResultsOptions<T> = {\n /** Items to filter. */\n items: T[];\n /** Custom filter function. Defaults to filtering by extracted string. */\n filter?: (item: T, query: string) => boolean;\n /** Enable fuzzy filtering using command-score algorithm. Defaults to true. */\n fuzzy?: boolean;\n /** Custom function to extract the searchable string from an item. Defaults to accessing 'label' property if it exists. */\n extract?: (item: T) => string;\n /** Minimum score threshold for fuzzy matches (0-1). Defaults to 0. */\n minScore?: number;\n};\n\n/**\n * Hook to manage search results with fuzzy filtering (enabled by default).\n * Returns filtered results and a handleSearch function to pass to SearchList.Root.\n *\n * @example\n * // Default fuzzy filtering using command-score (tries to extract from 'label' property)\n * const { results, handleSearch } = useSearchListResults({ items });\n *\n * @example\n * // Disable fuzzy for basic case-insensitive substring match\n * const { results, handleSearch } = useSearchListResults({ items, fuzzy: false });\n *\n * @example\n * // Custom extraction for fuzzy filtering\n * const { results, handleSearch } = useSearchListResults({\n * items,\n * extract: (item) => `${item.name} ${item.description}`,\n * });\n */\nexport const useSearchListResults = <T = unknown>({\n items,\n filter,\n fuzzy = true,\n extract,\n minScore = 0,\n}: UseSearchListResultsOptions<T>) => {\n const [query, setQuery] = useState<string>('');\n const queryRef = useRef<string>('');\n\n // Update results when items change.\n useEffect(() => {\n queryRef.current = '';\n setQuery('');\n }, [items]);\n\n const defaultExtract = useCallback((item: T) => {\n // If item is a string, return it directly\n if (typeof item === 'string') {\n return item;\n }\n // Otherwise, try to access 'label' property\n return (item as any)?.label ?? '';\n }, []);\n const extractFn = extract ?? defaultExtract;\n\n const defaultFilter = useCallback(\n (item: T, query: string) => {\n const searchable = extractFn(item);\n return searchable.toLowerCase().includes(query.toLowerCase());\n },\n [extractFn],\n );\n\n const filterFn = filter ?? defaultFilter;\n\n const handleSearch = useCallback((searchQuery: string) => {\n queryRef.current = searchQuery;\n setQuery(searchQuery);\n }, []);\n\n const results = useMemo(() => {\n const currentQuery = queryRef.current;\n if (!currentQuery) {\n return items;\n }\n\n if (fuzzy) {\n // Score and filter items using command-score.\n const scored = items\n .map((item) => ({\n item,\n score: commandScore(extractFn(item), currentQuery) as number,\n }))\n .filter(({ score }) => score > minScore)\n .sort((a, b) => b.score - a.score);\n\n return scored.map(({ item }) => item);\n } else {\n return items.filter((item) => filterFn(item, currentQuery));\n }\n }, [items, query, filterFn, fuzzy, extractFn, minScore]);\n\n return { results, handleSearch };\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { type Scope, createContextScope } from '@radix-ui/react-context';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport React, { type ComponentPropsWithRef, forwardRef, useCallback, useEffect, useRef } from 'react';\n\nimport { Icon, type IconProps, type ThemedClassName } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\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\n//\n\ntype ListboxScopedProps<P> = P & { __listboxScope?: Scope };\ntype ListboxOptionScopedProps<P> = P & { __listboxOptionScope?: Scope };\n\ntype ListboxOptionProps = ThemedClassName<ComponentPropsWithRef<'li'>> & {\n value: string;\n};\n\nconst [createListboxContext, createListboxScope] = createContextScope(LISTBOX_NAME, []);\nconst [createListboxOptionContext, createListboxOptionScope] = createContextScope(LISTBOX_OPTION_NAME, [\n createListboxScope,\n]);\n\ntype ListboxContextValue = {\n selectedValue: string | undefined;\n onValueChange: (value: string) => void;\n};\n\ntype ListboxOptionContextValue = {\n value: string;\n isSelected: boolean;\n};\n\nconst [ListboxProvider, useListboxContext] = createListboxContext<ListboxContextValue>(LISTBOX_NAME);\nconst [ListboxOptionProvider, useListboxOptionContext] =\n createListboxOptionContext<ListboxOptionContextValue>(LISTBOX_OPTION_NAME);\n\n//\n// Root\n//\n\ntype ListboxRootProps = ThemedClassName<ComponentPropsWithRef<'ul'>> & {\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n autoFocus?: boolean;\n};\n\n// TODO(thure): Note that this overlaps significantly with the the `SelectableListbox` story of `List.tsx` in `react-ui`,\n// making this an exemplar of `List` specifying standard `role=\"listbox\"` interactivity, though it is here because it\n// coheres with SearchList’s styles and norms. This can be promoted to `react-ui`, but doing so should involve clearing\n// the technical- and design-debt in its `List` component.\nconst ListboxRoot = forwardRef<HTMLUListElement, ListboxRootProps>(\n (props: ListboxScopedProps<ListboxRootProps>, forwardedRef) => {\n const {\n __listboxScope,\n children,\n classNames,\n value: propsValue,\n defaultValue,\n onValueChange,\n autoFocus,\n ...rootProps\n } = props;\n\n const arrowGroup = useArrowNavigationGroup({ axis: 'vertical' });\n const ref = useRef<HTMLUListElement | null>(null);\n const rootRef = useComposedRefs<HTMLUListElement>(ref, forwardedRef);\n\n const [selectedValue, setSelectedValue] = useControllableState({\n prop: propsValue,\n defaultProp: defaultValue,\n onChange: onValueChange,\n });\n\n const handleValueChange = (value: string) => {\n setSelectedValue(value);\n };\n\n useEffect(() => {\n // Autofocus the selected option on mount using querySelector\n (ref.current?.querySelector('[aria-selected=\"true\"]') as HTMLLIElement)?.focus();\n }, [autoFocus]);\n\n return (\n <ListboxProvider scope={__listboxScope} selectedValue={selectedValue} onValueChange={handleValueChange}>\n <ul\n role='listbox'\n {...rootProps}\n className={mx('is-full p-cardSpacingChrome', classNames)}\n ref={rootRef}\n {...arrowGroup}\n >\n {children}\n </ul>\n </ListboxProvider>\n );\n },\n);\n\nListboxRoot.displayName = LISTBOX_NAME;\n\n//\n// Option\n//\n\nconst ListboxOption = forwardRef<HTMLLIElement, ListboxOptionProps>(\n (props: ListboxScopedProps<ListboxOptionProps>, forwardedRef) => {\n const { __listboxScope, children, classNames, value, ...rootProps } = props;\n const { selectedValue, onValueChange } = useListboxContext(LISTBOX_OPTION_NAME, __listboxScope);\n\n const isSelected = selectedValue === value;\n\n const handleSelect = useCallback(() => {\n onValueChange(value);\n }, [value, onValueChange]);\n\n return (\n <ListboxOptionProvider scope={__listboxScope} value={value} isSelected={isSelected}>\n <li\n role='option'\n {...rootProps}\n aria-selected={isSelected}\n tabIndex={0}\n className={mx(\n 'dx-focus-ring',\n 'plb-1 pli-2 rounded-sm select-none cursor-pointer data-[selected=true]:bg-hoverOverlay hover:bg-hoverOverlay',\n commandItem,\n classNames,\n )}\n onClick={handleSelect}\n onKeyDown={({ key }) => {\n if (['Enter', ' '].includes(key)) {\n handleSelect();\n }\n }}\n ref={forwardedRef}\n >\n {children}\n </li>\n </ListboxOptionProvider>\n );\n },\n);\n\nListboxOption.displayName = LISTBOX_OPTION_NAME;\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_OPTION_LABEL_NAME;\n\ntype ListboxOptionIndicatorProps = Omit<IconProps, 'icon'> & Partial<Pick<IconProps, 'icon'>>;\n\n//\n// OptionIndicator\n//\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_OPTION_INDICATOR_NAME;\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, useListboxContext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AwBT,+BAA+B8D,oBAAAA;AAE9E,SACE,gBAAArB,OAAA,cAACsB,OAAAA;IACCC,MAAK;IACJ,GAAG1C;IACJN,YAAY8B,IAAG,CAACG,cAAc,aAAajC,UAAAA;IAC3CU,KAAKb;;AAGX,CAAA;AAGFgD,uBAAuBd,cAAc/C;AAM9B,IAAMiE,UAAU;EACrBC,MAAMxD;EACNyD,QAAQnB;EACRoB,aAAaT;EACbU,iBAAiBR;AACnB;",
6
+ "names": ["createContext", "useControllableState", "React", "forwardRef", "useCallback", "Button", "Icon", "Popover", "useId", "mx", "staticPlaceholderText", "useControllableState", "React", "forwardRef", "useCallback", "useEffect", "useMemo", "useRef", "useState", "Icon", "useDensityContext", "useElevationContext", "useThemeContext", "useTranslation", "descriptionText", "mx", "translationKey", "translations", "createContext", "SearchListItemContextProvider", "useSearchListItemContext", "createContext", "SearchListInputContextProvider", "useSearchListInputContext", "SearchListRoot", "children", "value", "valueProp", "defaultValue", "debounceMs", "onSearch", "query", "setQuery", "useControllableState", "prop", "defaultProp", "onChange", "undefined", "selectedValue", "setSelectedValue", "useState", "itemsRef", "useRef", "Map", "debounceRef", "handleQueryChange", "useCallback", "newQuery", "current", "clearTimeout", "setTimeout", "itemVersion", "setItemVersion", "useEffect", "currentItem", "get", "isSelectionValid", "disabled", "size", "entries", "Array", "from", "filter", "data", "length", "sort", "a", "b", "position", "element", "compareDocumentPosition", "Node", "DOCUMENT_POSITION_FOLLOWING", "DOCUMENT_POSITION_PRECEDING", "firstValue", "registerItem", "onSelect", "set", "v", "unregisterItem", "delete", "getItemValues", "map", "triggerSelect", "item", "itemContextValue", "useMemo", "onSelectedValueChange", "inputContextValue", "onQueryChange", "SearchListInputContextProvider", "SearchListItemContextProvider", "displayName", "SearchListContent", "forwardRef", "classNames", "forwardedRef", "div", "role", "className", "mx", "ref", "SearchListViewport", "SearchListInput", "density", "propsDensity", "elevation", "propsElevation", "variant", "placeholder", "props", "useSearchListInputContext", "t", "useTranslation", "translationKey", "hasIosKeyboard", "tx", "useThemeContext", "useDensityContext", "useElevationContext", "defaultPlaceholder", "handleChange", "event", "target", "handleKeyDown", "values", "key", "currentIndex", "indexOf", "preventDefault", "nextIndex", "Math", "min", "nextValue", "prevIndex", "max", "prevValue", "lastValue", "input", "autoFocus", "type", "onKeyDown", "SearchListItem", "label", "icon", "checked", "suffix", "useSearchListItemContext", "internalRef", "isSelected", "scrollIntoView", "block", "behavior", "handleClick", "node", "aria-selected", "aria-disabled", "data-selected", "data-disabled", "data-value", "tabIndex", "onClick", "Icon", "span", "descriptionText", "SearchListEmpty", "SearchListGroup", "heading", "SearchList", "Root", "Content", "Viewport", "Input", "Item", "Empty", "Group", "React", "createContext", "useContext", "useMemo", "GlobalFilterContext", "createContext", "GlobalFilterProvider", "children", "filter", "value", "useMemo", "React", "Provider", "useGlobalFilter", "useContext", "useGlobalFilteredObjects", "objects", "useSearchListInput", "query", "onQueryChange", "selectedValue", "onSelectedValueChange", "getItemValues", "triggerSelect", "useSearchListInputContext", "useSearchListItem", "selectedValue", "registerItem", "unregisterItem", "useSearchListItemContext", "commandScore", "useCallback", "useEffect", "useMemo", "useRef", "useState", "useSearchListResults", "items", "filter", "fuzzy", "extract", "minScore", "query", "setQuery", "useState", "queryRef", "useRef", "useEffect", "current", "defaultExtract", "useCallback", "item", "label", "extractFn", "defaultFilter", "searchable", "toLowerCase", "includes", "filterFn", "handleSearch", "searchQuery", "results", "useMemo", "currentQuery", "scored", "map", "score", "commandScore", "sort", "a", "b", "COMBOBOX_NAME", "COMBOBOX_CONTENT_NAME", "COMBOBOX_ITEM_NAME", "COMBOBOX_TRIGGER_NAME", "ComboboxProvider", "useComboboxContext", "createContext", "ComboboxRoot", "modal", "modalId", "propsModalId", "open", "propsOpen", "defaultOpen", "onOpenChange", "propsOnOpenChange", "value", "propsValue", "defaultValue", "onValueChange", "propsOnValueChange", "placeholder", "children", "useId", "useControllableState", "prop", "onChange", "defaultProp", "React", "Popover", "Root", "isCombobox", "ComboboxContent", "forwardRef", "side", "collisionPadding", "sideOffset", "align", "alignOffset", "avoidCollisions", "collisionBoundary", "arrowPadding", "sticky", "hideWhenDetached", "onOpenAutoFocus", "onCloseAutoFocus", "onEscapeKeyDown", "onPointerDownOutside", "onFocusOutside", "onInteractOutside", "forceMount", "classNames", "onSearch", "debounceMs", "label", "forwardedRef", "Content", "id", "ref", "SearchList", "displayName", "ComboboxTrigger", "onClick", "props", "handleClick", "useCallback", "event", "Trigger", "asChild", "Button", "role", "aria-expanded", "aria-controls", "aria-haspopup", "span", "className", "mx", "staticPlaceholderText", "Icon", "icon", "size", "ComboboxVirtualTrigger", "VirtualTrigger", "ComboboxInput", "Input", "ComboboxList", "Viewport", "ComboboxItem", "onSelect", "closeOnSelect", "handleSelect", "undefined", "Item", "ComboboxArrow", "Arrow", "ComboboxEmpty", "Empty", "ComboboxPortal", "Portal", "Combobox", "List", "useArrowNavigationGroup", "useComposedRefs", "createContextScope", "useControllableState", "React", "forwardRef", "useCallback", "useEffect", "useRef", "Icon", "mx", "commandItem", "LISTBOX_NAME", "LISTBOX_OPTION_NAME", "LISTBOX_OPTION_LABEL_NAME", "LISTBOX_OPTION_INDICATOR_NAME", "createListboxContext", "createListboxScope", "createContextScope", "createListboxOptionContext", "createListboxOptionScope", "ListboxProvider", "useListboxContext", "ListboxOptionProvider", "useListboxOptionContext", "ListboxRoot", "forwardRef", "props", "forwardedRef", "__listboxScope", "children", "classNames", "value", "propsValue", "defaultValue", "onValueChange", "autoFocus", "rootProps", "arrowGroup", "useArrowNavigationGroup", "axis", "ref", "useRef", "rootRef", "useComposedRefs", "selectedValue", "setSelectedValue", "useControllableState", "prop", "defaultProp", "onChange", "handleValueChange", "useEffect", "current", "querySelector", "focus", "React", "scope", "ul", "role", "className", "mx", "displayName", "ListboxOption", "isSelected", "handleSelect", "useCallback", "li", "aria-selected", "tabIndex", "onClick", "onKeyDown", "key", "includes", "ListboxOptionLabel", "span", "ListboxOptionIndicator", "__listboxOptionScope", "Icon", "icon", "Listbox", "Root", "Option", "OptionLabel", "OptionIndicator"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"src/translations.ts":{"bytes":1226,"imports":[],"format":"esm"},"src/components/SearchList/context.ts":{"bytes":3162,"imports":[{"path":"@radix-ui/react-context","kind":"import-statement","external":true}],"format":"esm"},"src/components/SearchList/SearchList.tsx":{"bytes":49710,"imports":[{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"src/translations.ts","kind":"import-statement","original":"../../translations"},{"path":"src/components/SearchList/context.ts","kind":"import-statement","original":"./context"}],"format":"esm"},"src/components/SearchList/hooks/useGlobalFilter.tsx":{"bytes":5067,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/components/SearchList/hooks/useSearchListInput.ts":{"bytes":2012,"imports":[{"path":"src/components/SearchList/context.ts","kind":"import-statement","original":"../context"}],"format":"esm"},"src/components/SearchList/hooks/useSearchListItem.ts":{"bytes":1753,"imports":[{"path":"src/components/SearchList/context.ts","kind":"import-statement","original":"../context"}],"format":"esm"},"src/components/SearchList/hooks/useSearchListResults.ts":{"bytes":9665,"imports":[{"path":"command-score","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/components/SearchList/hooks/index.ts":{"bytes":852,"imports":[{"path":"src/components/SearchList/hooks/useGlobalFilter.tsx","kind":"import-statement","original":"./useGlobalFilter"},{"path":"src/components/SearchList/hooks/useSearchListInput.ts","kind":"import-statement","original":"./useSearchListInput"},{"path":"src/components/SearchList/hooks/useSearchListItem.ts","kind":"import-statement","original":"./useSearchListItem"},{"path":"src/components/SearchList/hooks/useSearchListResults.ts","kind":"import-statement","original":"./useSearchListResults"}],"format":"esm"},"src/components/SearchList/index.ts":{"bytes":567,"imports":[{"path":"src/components/SearchList/SearchList.tsx","kind":"import-statement","original":"./SearchList"},{"path":"src/components/SearchList/hooks/index.ts","kind":"import-statement","original":"./hooks"}],"format":"esm"},"src/components/Combobox/Combobox.tsx":{"bytes":24920,"imports":[{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"src/components/SearchList/index.ts","kind":"import-statement","original":"../SearchList"}],"format":"esm"},"src/components/Combobox/index.ts":{"bytes":478,"imports":[{"path":"src/components/Combobox/Combobox.tsx","kind":"import-statement","original":"./Combobox"}],"format":"esm"},"src/components/Listbox/Listbox.tsx":{"bytes":19311,"imports":[{"path":"@fluentui/react-tabster","kind":"import-statement","external":true},{"path":"@radix-ui/react-compose-refs","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true}],"format":"esm"},"src/components/Listbox/index.ts":{"bytes":476,"imports":[{"path":"src/components/Listbox/Listbox.tsx","kind":"import-statement","original":"./Listbox"}],"format":"esm"},"src/components/index.ts":{"bytes":650,"imports":[{"path":"src/components/Combobox/index.ts","kind":"import-statement","original":"./Combobox"},{"path":"src/components/Listbox/index.ts","kind":"import-statement","original":"./Listbox"},{"path":"src/components/SearchList/index.ts","kind":"import-statement","original":"./SearchList"}],"format":"esm"},"src/index.ts":{"bytes":564,"imports":[{"path":"src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"src/translations.ts","kind":"import-statement","original":"./translations"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":62101},"dist/lib/browser/index.mjs":{"imports":[{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"command-score","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@fluentui/react-tabster","kind":"import-statement","external":true},{"path":"@radix-ui/react-compose-refs","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true}],"exports":["Combobox","GlobalFilterProvider","Listbox","SearchList","createListboxScope","translationKey","translations","useGlobalFilter","useGlobalFilteredObjects","useListboxContext","useSearchListInput","useSearchListItem","useSearchListResults"],"entryPoint":"src/index.ts","inputs":{"src/components/Combobox/Combobox.tsx":{"bytesInOutput":5944},"src/components/SearchList/SearchList.tsx":{"bytesInOutput":11344},"src/translations.ts":{"bytesInOutput":179},"src/components/SearchList/context.ts":{"bytesInOutput":254},"src/components/SearchList/hooks/useGlobalFilter.tsx":{"bytesInOutput":737},"src/components/SearchList/hooks/useSearchListInput.ts":{"bytesInOutput":317},"src/components/SearchList/hooks/useSearchListItem.ts":{"bytesInOutput":212},"src/components/SearchList/hooks/useSearchListResults.ts":{"bytesInOutput":1614},"src/components/Listbox/Listbox.tsx":{"bytesInOutput":4368},"src/index.ts":{"bytesInOutput":0}},"bytes":25773}}}
1
+ {"inputs":{"src/translations.ts":{"bytes":1226,"imports":[],"format":"esm"},"src/components/SearchList/context.ts":{"bytes":3162,"imports":[{"path":"@radix-ui/react-context","kind":"import-statement","external":true}],"format":"esm"},"src/components/SearchList/SearchList.tsx":{"bytes":49807,"imports":[{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"src/translations.ts","kind":"import-statement","original":"../../translations"},{"path":"src/components/SearchList/context.ts","kind":"import-statement","original":"./context"}],"format":"esm"},"src/components/SearchList/hooks/useGlobalFilter.tsx":{"bytes":5067,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/components/SearchList/hooks/useSearchListInput.ts":{"bytes":2012,"imports":[{"path":"src/components/SearchList/context.ts","kind":"import-statement","original":"../context"}],"format":"esm"},"src/components/SearchList/hooks/useSearchListItem.ts":{"bytes":1753,"imports":[{"path":"src/components/SearchList/context.ts","kind":"import-statement","original":"../context"}],"format":"esm"},"src/components/SearchList/hooks/useSearchListResults.ts":{"bytes":9665,"imports":[{"path":"command-score","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/components/SearchList/hooks/index.ts":{"bytes":852,"imports":[{"path":"src/components/SearchList/hooks/useGlobalFilter.tsx","kind":"import-statement","original":"./useGlobalFilter"},{"path":"src/components/SearchList/hooks/useSearchListInput.ts","kind":"import-statement","original":"./useSearchListInput"},{"path":"src/components/SearchList/hooks/useSearchListItem.ts","kind":"import-statement","original":"./useSearchListItem"},{"path":"src/components/SearchList/hooks/useSearchListResults.ts","kind":"import-statement","original":"./useSearchListResults"}],"format":"esm"},"src/components/SearchList/index.ts":{"bytes":567,"imports":[{"path":"src/components/SearchList/SearchList.tsx","kind":"import-statement","original":"./SearchList"},{"path":"src/components/SearchList/hooks/index.ts","kind":"import-statement","original":"./hooks"}],"format":"esm"},"src/components/Combobox/Combobox.tsx":{"bytes":24519,"imports":[{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"src/components/SearchList/index.ts","kind":"import-statement","original":"../SearchList"}],"format":"esm"},"src/components/Combobox/index.ts":{"bytes":478,"imports":[{"path":"src/components/Combobox/Combobox.tsx","kind":"import-statement","original":"./Combobox"}],"format":"esm"},"src/components/Listbox/Listbox.tsx":{"bytes":19311,"imports":[{"path":"@fluentui/react-tabster","kind":"import-statement","external":true},{"path":"@radix-ui/react-compose-refs","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true}],"format":"esm"},"src/components/Listbox/index.ts":{"bytes":476,"imports":[{"path":"src/components/Listbox/Listbox.tsx","kind":"import-statement","original":"./Listbox"}],"format":"esm"},"src/components/index.ts":{"bytes":650,"imports":[{"path":"src/components/Combobox/index.ts","kind":"import-statement","original":"./Combobox"},{"path":"src/components/Listbox/index.ts","kind":"import-statement","original":"./Listbox"},{"path":"src/components/SearchList/index.ts","kind":"import-statement","original":"./SearchList"}],"format":"esm"},"src/index.ts":{"bytes":564,"imports":[{"path":"src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"src/translations.ts","kind":"import-statement","original":"./translations"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":61956},"dist/lib/browser/index.mjs":{"imports":[{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"command-score","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@fluentui/react-tabster","kind":"import-statement","external":true},{"path":"@radix-ui/react-compose-refs","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true}],"exports":["Combobox","GlobalFilterProvider","Listbox","SearchList","createListboxScope","translationKey","translations","useGlobalFilter","useGlobalFilteredObjects","useListboxContext","useSearchListInput","useSearchListItem","useSearchListResults"],"entryPoint":"src/index.ts","inputs":{"src/components/Combobox/Combobox.tsx":{"bytesInOutput":5817},"src/components/SearchList/SearchList.tsx":{"bytesInOutput":11454},"src/translations.ts":{"bytesInOutput":179},"src/components/SearchList/context.ts":{"bytesInOutput":254},"src/components/SearchList/hooks/useGlobalFilter.tsx":{"bytesInOutput":737},"src/components/SearchList/hooks/useSearchListInput.ts":{"bytesInOutput":317},"src/components/SearchList/hooks/useSearchListItem.ts":{"bytesInOutput":212},"src/components/SearchList/hooks/useSearchListResults.ts":{"bytesInOutput":1614},"src/components/Listbox/Listbox.tsx":{"bytesInOutput":4368},"src/index.ts":{"bytesInOutput":0}},"bytes":25756}}}
@@ -157,21 +157,23 @@ var SearchListRoot = ({ children, value: valueProp, defaultValue = "", debounceM
157
157
  }, children));
158
158
  };
159
159
  SearchListRoot.displayName = "SearchList.Root";
160
- var SearchListViewport = ({ classNames, children }) => {
160
+ var SearchListContent = /* @__PURE__ */ forwardRef(({ classNames, children }, forwardedRef) => {
161
161
  return /* @__PURE__ */ React.createElement("div", {
162
162
  role: "none",
163
- className: mx("is-full min-bs-0 grow overflow-y-auto", classNames)
163
+ // TODO(burdon): Remove p-1 hack.
164
+ className: mx("flex flex-col gap-2 bs-full is-full min-bs-0 overflow-hidden p-1", classNames),
165
+ ref: forwardedRef
164
166
  }, children);
165
- };
166
- SearchListViewport.displayName = "SearchList.Viewport";
167
- var SearchListContent = /* @__PURE__ */ forwardRef(({ classNames, children }, forwardedRef) => {
167
+ });
168
+ SearchListContent.displayName = "SearchList.Content";
169
+ var SearchListViewport = /* @__PURE__ */ forwardRef(({ classNames, children }, forwardedRef) => {
168
170
  return /* @__PURE__ */ React.createElement("div", {
169
- ref: forwardedRef,
170
171
  role: "listbox",
171
- className: mx("flex flex-col is-full min-bs-0 grow overflow-hidden", classNames)
172
+ className: mx("bs-full is-full min-bs-0 overflow-y-auto", classNames),
173
+ ref: forwardedRef
172
174
  }, children);
173
175
  });
174
- SearchListContent.displayName = "SearchList.Content";
176
+ SearchListViewport.displayName = "SearchList.Viewport";
175
177
  var SearchListInput = /* @__PURE__ */ forwardRef(({ classNames, density: propsDensity, elevation: propsElevation, variant, placeholder, onChange, ...props }, forwardedRef) => {
176
178
  const { query, onQueryChange, selectedValue, onSelectedValueChange, getItemValues, triggerSelect } = useSearchListInputContext("SearchList.Input");
177
179
  const { t } = useTranslation(translationKey);
@@ -260,14 +262,14 @@ var SearchListInput = /* @__PURE__ */ forwardRef(({ classNames, density: propsDe
260
262
  autoFocus: true
261
263
  },
262
264
  type: "text",
263
- value: query,
264
265
  placeholder: placeholder ?? defaultPlaceholder,
265
- className: tx("input.input", "input", {
266
+ className: tx("input.input", {
266
267
  variant,
267
268
  disabled: props.disabled,
268
269
  density,
269
270
  elevation
270
271
  }, classNames),
272
+ value: query,
271
273
  onChange: handleChange,
272
274
  onKeyDown: handleKeyDown,
273
275
  ref: forwardedRef
@@ -360,8 +362,8 @@ var SearchListGroup = /* @__PURE__ */ forwardRef(({ classNames, heading, childre
360
362
  SearchListGroup.displayName = "SearchList.Group";
361
363
  var SearchList = {
362
364
  Root: SearchListRoot,
363
- Viewport: SearchListViewport,
364
365
  Content: SearchListContent,
366
+ Viewport: SearchListViewport,
365
367
  Input: SearchListInput,
366
368
  Item: SearchListItem,
367
369
  Empty: SearchListEmpty,
@@ -544,12 +546,7 @@ var ComboboxContent = /* @__PURE__ */ forwardRef2(({ side = "bottom", collisionP
544
546
  value,
545
547
  defaultValue,
546
548
  debounceMs
547
- }, /* @__PURE__ */ React3.createElement("div", {
548
- className: "contents density-fine",
549
- "aria-label": label,
550
- role: "combobox",
551
- "aria-expanded": "true"
552
- }, children)));
549
+ }, /* @__PURE__ */ React3.createElement(SearchList.Content, null, children)));
553
550
  });
554
551
  ComboboxContent.displayName = COMBOBOX_CONTENT_NAME;
555
552
  var ComboboxTrigger = /* @__PURE__ */ forwardRef2(({ children, onClick, ...props }, forwardedRef) => {
@@ -591,10 +588,10 @@ var ComboboxInput = /* @__PURE__ */ forwardRef2(({ classNames, ...props }, forwa
591
588
  });
592
589
  });
593
590
  var ComboboxList = /* @__PURE__ */ forwardRef2(({ classNames, ...props }, forwardedRef) => {
594
- return /* @__PURE__ */ React3.createElement(SearchList.Content, {
591
+ return /* @__PURE__ */ React3.createElement(SearchList.Viewport, {
595
592
  ...props,
596
593
  classNames: [
597
- "min-bs-0 overflow-y-auto plb-cardSpacingChrome",
594
+ "plb-cardSpacingChrome",
598
595
  classNames
599
596
  ],
600
597
  ref: forwardedRef