{"version":3,"file":"chunk-Combobox.mjs","names":["createRootContext","ComboboxPrimitive","_Fragment","Icon.Icon","ScrollArea.Root","ScrollArea.Viewport"],"sources":["../../src/components/Combobox/Combobox.tsx"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport { createListCollection } from '@ark-ui/react/collection';\nimport { Combobox as ComboboxPrimitive, useComboboxContext } from '@ark-ui/react/combobox';\nimport { Portal } from '@ark-ui/react/portal';\nimport React, {\n  Children,\n  type ComponentPropsWithoutRef,\n  Fragment,\n  type PointerEvent,\n  type ReactNode,\n  type RefObject,\n  createContext,\n  forwardRef,\n  isValidElement,\n  useContext,\n  useEffect,\n  useId,\n  useLayoutEffect,\n  useMemo,\n  useRef,\n  useState,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\n\nimport { createContext as createRootContext, useComposedRefs } from '@dxos/react-hooks';\nimport { mx } from '@dxos/ui-theme';\nimport { type ThemedClassName } from '@dxos/ui-types';\n\nimport { translationKey } from '#translations';\n\nimport { recipes } from '../../recipes.ts';\nimport { type Size } from '../../sizes.ts';\nimport { composable, composableProps } from '../../util/slots.ts';\nimport * as Icon from '../Icon/Icon.tsx';\nimport { PopupScroll, popupPositioning, usePopupSize } from '../ScrollArea/PopupScroll.tsx';\nimport * as ScrollArea from '../ScrollArea/ScrollArea.tsx';\nimport type * as Select from '../Select/Select.tsx';\n\n/** Gap between control and popup, in px (positioning takes a number, not a CSS variable). */\nconst POPUP_GUTTER = 2;\n\n/** The value of the create row's option, which the Root appends to the collection and never selects. */\nconst CREATE_VALUE = '\\u0000nx-combobox-create';\n\ntype ComboboxOption = Select.Option & {\n  /** A second line under the label, in the description tone. */\n  description?: string;\n};\n\ntype ComboboxFilter = (option: ComboboxOption, query: string) => boolean;\n\n/** Case-insensitive substring match on the label. */\nconst containsFilter: ComboboxFilter = (option, query) => option.label.toLowerCase().includes(query.toLowerCase());\n\n//\n// Root\n//\n\ntype ComboboxRootContextValue = {\n  /** The text typed into the input (a selection or clear does not count). */\n  query: string;\n  loading: boolean;\n  /** The create row's option, while there is one. */\n  create?: ComboboxOption;\n  /** The create row's text for a query and its icon, when the Root overrides the defaults. */\n  createLabel?: (query: string) => string;\n  createIcon?: string;\n  /** Whether the input is the popup's search field (a button `Trigger` or an `Input` inside `Content`). */\n  search: boolean;\n  registerTrigger: (present: boolean) => void;\n  registerSearch: (present: boolean) => void;\n};\n\nconst [ComboboxRootProvider, useComboboxRootContext] = createRootContext<ComboboxRootContextValue>('Combobox');\n\ntype ComboboxRootProps = ThemedClassName<Omit<ComboboxPrimitive.RootProps<ComboboxOption>, 'collection'>> & {\n  items: ComboboxOption[];\n  /**\n   * Keeps an option while the user types `query`; defaults to a case-insensitive substring match on the label. `null`\n   * keeps every item, for results the caller loads for the query (`onInputValueChange`).\n   */\n  filter?: ComboboxFilter | null;\n  /** Results are loading: the popup shows a spinner row instead of its empty state, and the button trigger is busy. */\n  loading?: boolean;\n  /** Offers a create row while the typed query matches no label exactly; choosing it calls this instead of selecting. */\n  onCreate?: (query: string) => void;\n  /** The create row's text for the query (e.g. `Add tag “{query}”`); `Create “{query}”` by default. */\n  createLabel?: (query: string) => string;\n  /** The create row's icon; a plus by default. */\n  createIcon?: string;\n};\n\n/**\n * Ark combobox over a flat option list, filtered as the user types; the root takes no box, like Select's. The input\n * sits in a Control beside a caret, or, with a button `Trigger` (or an `Input` placed in `Content`), in the popup.\n */\nconst ComboboxRoot = forwardRef<HTMLDivElement, ComboboxRootProps>(\n  (\n    {\n      classNames,\n      items,\n      filter = containsFilter,\n      loading = false,\n      onCreate,\n      createLabel,\n      createIcon,\n      positioning,\n      lazyMount = true,\n      unmountOnExit = true,\n      inputBehavior = 'autohighlight',\n      loopFocus = false,\n      composite,\n      selectionBehavior,\n      value: valueProp,\n      defaultValue,\n      onValueChange,\n      onInputValueChange,\n      highlightedValue: highlightedValueProp,\n      onHighlightChange,\n      children,\n      ...props\n    },\n    forwardedRef,\n  ) => {\n    const [query, setQuery] = useState('');\n    const [trigger, registerTrigger] = useState(false);\n    const [searchInput, registerSearch] = useState(false);\n    const search = trigger || searchInput;\n\n    const create = useMemo<ComboboxOption | undefined>(() => {\n      const text = query.trim();\n      if (!onCreate || !text || items.some((item) => item.label.toLowerCase() === text.toLowerCase())) {\n        return undefined;\n      }\n\n      return { value: CREATE_VALUE, label: text };\n    }, [items, query, onCreate]);\n\n    const collection = useMemo(() => {\n      const matches = filter && query ? items.filter((item) => filter(item, query)) : items;\n      return createListCollection<ComboboxOption>({ items: create ? [...matches, create] : matches });\n    }, [items, filter, query, create]);\n\n    // zag moves the highlight off an option the filter removed only in a passive effect, which an Enter typed in the same\n    // frame beats (selecting nothing); so a filtered-out highlight is replaced here, as the collection itself narrows.\n    const [highlight, setHighlight] = useState<string | null>(null);\n    const highlightedValue =\n      highlightedValueProp !== undefined\n        ? highlightedValueProp\n        : highlight !== null && !collection.has(highlight)\n          ? inputBehavior === 'autohighlight' && query\n            ? collection.firstValue\n            : null\n          : highlight;\n\n    // Controlled, so choosing the create row never becomes the value.\n    const [uncontrolled, setUncontrolled] = useState<string[]>(defaultValue ?? []);\n    const value = valueProp ?? uncontrolled;\n\n    return (\n      <ComboboxPrimitive.Root\n        {...props}\n        // Mounting the popup on open keeps it out of a modal Dialog's one-time `aria-hidden` sweep of its siblings.\n        lazyMount={lazyMount}\n        unmountOnExit={unmountOnExit}\n        // zag pins the popup to its anchor's width by default; like Select's, it is at least that wide and grows to its\n        // options (a virtual anchor such as a caret can be a few pixels wide), keeping its start edge on the anchor.\n        positioning={popupPositioning(POPUP_GUTTER, { sameWidth: false, placement: 'bottom-start', ...positioning })}\n        // Typing highlights the first match, so Enter picks it without an arrow key first.\n        inputBehavior={inputBehavior}\n        // The options scroll in the content itself or, under a search field, in a ScrollArea inside it; zag scrolls only\n        // a scrolling content, so the highlighted option is scrolled into whichever viewport holds it.\n        scrollToIndexFn={({ getElement }) => getElement()?.scrollIntoView({ block: 'nearest' })}\n        // Arrow keys stop at the first and last option rather than wrapping, as in Select and Listbox.\n        loopFocus={loopFocus}\n        // A popup holding the search field is a dialog around a `List` listbox, since a listbox cannot hold an input.\n        composite={composite ?? !search}\n        // The search field starts empty each time; the button trigger shows the value.\n        selectionBehavior={selectionBehavior ?? (search ? 'clear' : 'replace')}\n        collection={collection}\n        highlightedValue={highlightedValue}\n        onHighlightChange={(details) => {\n          setHighlight(details.highlightedValue);\n          onHighlightChange?.(details);\n        }}\n        value={value}\n        onValueChange={(details) => {\n          if (details.value.includes(CREATE_VALUE)) {\n            onCreate?.(query.trim());\n            return;\n          }\n\n          setUncontrolled(details.value);\n          onValueChange?.(details);\n        }}\n        onInputValueChange={(details) => {\n          // Only typing narrows the list; a selection or clear fills the input but reopening should show every option.\n          setQuery(details.reason === 'input-change' ? details.inputValue : '');\n          onInputValueChange?.(details);\n        }}\n        className={mx(recipes.combobox(), classNames)}\n        ref={forwardedRef}\n      >\n        <ComboboxRootProvider\n          query={query}\n          loading={loading}\n          create={create}\n          createLabel={createLabel}\n          createIcon={createIcon}\n          search={search}\n          registerTrigger={registerTrigger}\n          registerSearch={registerSearch}\n        >\n          <ComboboxSyncInput search={search} />\n          {children}\n        </ComboboxRootProvider>\n      </ComboboxPrimitive.Root>\n    );\n  },\n);\n\nComboboxRoot.displayName = 'Combobox.Root';\n\n/**\n * zag keeps a preselected value when items arrive later but not the input text, so fill it from the selected option;\n * a popup search field is emptied on close instead, so it reopens on every option.\n */\nconst ComboboxSyncInput = ({ search }: { search: boolean }) => {\n  const combobox = useComboboxContext();\n  const label: string | undefined = combobox.selectedItems[0]?.label;\n  useEffect(() => {\n    if (search) {\n      if (!combobox.open && combobox.inputValue) {\n        combobox.setInputValue('');\n      }\n    } else if (label && !combobox.open && combobox.inputValue !== label) {\n      combobox.setInputValue(label);\n    }\n  }, [search, label, combobox.open]);\n  return null;\n};\n\n//\n// Label\n//\n\ntype ComboboxLabelProps = ThemedClassName<ComboboxPrimitive.LabelProps>;\n\nconst ComboboxLabel = forwardRef<HTMLLabelElement, ComboboxLabelProps>(({ classNames, ...props }, forwardedRef) => (\n  <ComboboxPrimitive.Label {...props} className={mx(recipes.label(), classNames)} ref={forwardedRef} />\n));\n\nComboboxLabel.displayName = 'Combobox.Label';\n\n//\n// Control\n//\n\n// Inside a Control the Trigger is its caret square; elsewhere it is the button that shows the value.\nconst ControlContext = createContext(false);\n\ntype ComboboxControlProps = ThemedClassName<ComboboxPrimitive.ControlProps> & {\n  /**\n   * Wraps its children (e.g. the chips of a multiple selection) onto further lines, growing from control height; the\n   * trailing caret stays at the end of the last line.\n   */\n  wrap?: boolean;\n};\n\n/** A control-sized row; without children it holds the text `Input` and a trailing caret `Trigger`. */\nconst ComboboxControl = forwardRef<HTMLDivElement, ComboboxControlProps>(\n  ({ classNames, wrap, children, ...props }, forwardedRef) => (\n    <ComboboxPrimitive.Control\n      {...props}\n      data-wrap={wrap ? '' : undefined}\n      className={mx(recipes.comboboxControl(), classNames)}\n      ref={forwardedRef}\n    >\n      <ControlContext.Provider value={true}>\n        {children ?? (\n          <>\n            <ComboboxInput />\n            <ComboboxTrigger />\n          </>\n        )}\n      </ControlContext.Provider>\n    </ComboboxPrimitive.Control>\n  ),\n);\n\nComboboxControl.displayName = 'Combobox.Control';\n\n//\n// Input\n//\n\n// Inside Content the Input is the popup's search field.\nconst ContentContext = createContext(false);\n\ntype ComboboxInputProps = ThemedClassName<ComboboxPrimitive.InputProps>;\n\n/**\n * The text input: in a Control it takes the free space; in `Content` it is the popup's search field, pinned above the\n * options and focused when the popup opens.\n */\nconst ComboboxInput = forwardRef<HTMLInputElement, ComboboxInputProps>(\n  ({ classNames, placeholder, ...props }, forwardedRef) => {\n    const inContent = useContext(ContentContext);\n    const { registerSearch } = useComboboxRootContext('Combobox.Input');\n    const { t } = useTranslation(translationKey);\n    const localRef = useRef<HTMLInputElement>(null);\n    const ref = useComposedRefs(localRef, forwardedRef);\n    useLayoutEffect(() => {\n      if (inContent) {\n        registerSearch(true);\n        // zag focuses the input a frame after opening, which can precede the lazily mounted content; the popup is not\n        // yet positioned, so scrolling to it would move the page.\n        localRef.current?.focus({ preventScroll: true });\n        return () => registerSearch(false);\n      }\n    }, [inContent, registerSearch]);\n    const text = placeholder ?? (inContent ? t('combobox.search.label') : undefined);\n    return (\n      <ComboboxPrimitive.Input\n        {...props}\n        {...(text === undefined ? {} : { placeholder: text })}\n        className={mx(inContent ? recipes.comboboxSearch() : recipes.comboboxInput(), classNames)}\n        ref={ref}\n      />\n    );\n  },\n);\n\nComboboxInput.displayName = 'Combobox.Input';\n\n//\n// Trigger\n//\n\ntype ComboboxTriggerProps = ThemedClassName<ComboboxPrimitive.TriggerProps> & {\n  /** Shown by the button trigger while nothing is selected. */\n  placeholder?: string;\n};\n\n/**\n * In a Control, a control-sized square that toggles the listbox (a caret by default). Elsewhere, a control-sized\n * button like `Select.Trigger` that shows the selected option and a caret, and opens a popup whose search field takes\n * focus; closing returns focus to it. With `asChild` the child (e.g. an icon-only `Button` in a toolbar) is the trigger\n * as it is, named and styled by itself.\n */\nconst ComboboxTrigger = forwardRef<HTMLButtonElement, ComboboxTriggerProps>((props, forwardedRef) =>\n  useContext(ControlContext) ? (\n    <ComboboxCaretTrigger {...props} ref={forwardedRef} />\n  ) : (\n    <ComboboxButtonTrigger {...props} ref={forwardedRef} />\n  ),\n);\n\nComboboxTrigger.displayName = 'Combobox.Trigger';\n\nconst ComboboxCaretTrigger = forwardRef<HTMLButtonElement, ComboboxTriggerProps>(\n  ({ classNames, children, placeholder: _placeholder, ...props }, forwardedRef) => (\n    <ComboboxPrimitive.Trigger {...props} className={mx(recipes.comboboxTrigger(), classNames)} ref={forwardedRef}>\n      {children ?? <Icon.Icon icon='ph--caret-up-down--regular' />}\n    </ComboboxPrimitive.Trigger>\n  ),\n);\n\nconst ComboboxButtonTrigger = forwardRef<HTMLButtonElement, ComboboxTriggerProps>(\n  ({ classNames, children, placeholder, onClick, asChild, ...props }, forwardedRef) => {\n    const combobox = useComboboxContext();\n    const { loading, registerTrigger } = useComboboxRootContext('Combobox.Trigger');\n    useLayoutEffect(() => {\n      registerTrigger(true);\n      return () => registerTrigger(false);\n    }, [registerTrigger]);\n    const valueId = useId();\n    const selected: ComboboxOption[] = combobox.selectedItems;\n    const single = selected.length === 1 ? selected[0] : undefined;\n    const text = selected.map((item) => item.label).join(', ');\n    return (\n      <ComboboxPrimitive.Trigger\n        {...props}\n        asChild={asChild}\n        // A tab stop that zag returns focus to on close.\n        focusable\n        aria-busy={loading || undefined}\n        // Named by the Label and the value, not zag's generic \"Toggle suggestions\"; a child (`asChild`) names itself.\n        aria-labelledby={asChild ? undefined : `${combobox.getLabelProps().id} ${valueId}`}\n        onClick={(event) => {\n          onClick?.(event);\n          // zag closes on a trigger click without restoring focus, and the focused search field unmounts.\n          const button = event.currentTarget;\n          if (combobox.open) {\n            requestAnimationFrame(() => button.focus());\n          }\n        }}\n        className={asChild ? mx(classNames) : mx(recipes.selectTrigger(), classNames)}\n        ref={forwardedRef}\n      >\n        {children ?? (\n          <>\n            {single?.icon && <Icon.Icon icon={single.icon} hue={single.iconHue} />}\n            <span id={valueId} data-scope='combobox' data-part='value-text'>\n              {text || placeholder}\n            </span>\n            {loading ? (\n              <Icon.Icon icon='ph--spinner-gap--regular' spin />\n            ) : (\n              <Icon.Icon icon='ph--caret-up-down--regular' />\n            )}\n          </>\n        )}\n      </ComboboxPrimitive.Trigger>\n    );\n  },\n);\n\n//\n// ClearTrigger\n//\n\ntype ComboboxClearTriggerProps = ThemedClassName<ComboboxPrimitive.ClearTriggerProps>;\n\n/** A control-sized square that clears the value, shown only while there is one; an x by default. */\nconst ComboboxClearTrigger = forwardRef<HTMLButtonElement, ComboboxClearTriggerProps>(\n  ({ classNames, children, ...props }, forwardedRef) => (\n    <ComboboxPrimitive.ClearTrigger {...props} className={mx(recipes.comboboxTrigger(), classNames)} ref={forwardedRef}>\n      {children ?? <Icon.Icon icon='ph--x--regular' />}\n    </ComboboxPrimitive.ClearTrigger>\n  ),\n);\n\nComboboxClearTrigger.displayName = 'Combobox.ClearTrigger';\n\n//\n// Content\n//\n\ntype ComboboxContentProps = ThemedClassName<ComboboxPrimitive.ContentProps> & {\n  /** Overrides the size inherited from the control's nearest sized ancestor (Phase 4 decision 2). */\n  size?: Size;\n  /** Portals into this element instead of the body (e.g. a sized scope, AUDIT 2.2). */\n  container?: RefObject<HTMLElement | null>;\n};\n\n/**\n * Ark's content as a composable part, so the ScrollArea viewport slot merges onto it (a plain Ark part gets the dev\n * warning wrapper, which breaks the frame's child rules); it restates Ark's scope and part, which the slot's replace.\n */\nconst ComboboxViewport = composable<HTMLDivElement, ComboboxPrimitive.ContentProps>((props, forwardedRef) => (\n  <ComboboxPrimitive.Content {...composableProps(props)} data-scope='combobox' data-part='content' ref={forwardedRef} />\n));\n\nconst COMPOSED_FIELD = 'input, textarea, select, [contenteditable=\"true\"]';\n\n/**\n * zag cancels pointerdown on the popup to keep focus in its search field, which also stops a click focusing a field\n * composed into the Content (e.g. an inline create form), so focus that field explicitly.\n */\nconst focusComposedField = (event: PointerEvent<HTMLDivElement>) => {\n  const field = event.target instanceof Element ? event.target.closest<HTMLElement>(COMPOSED_FIELD) : null;\n  if (field && field.dataset.scope !== 'combobox' && event.currentTarget.contains(field)) {\n    field.focus();\n  }\n};\n\n/** The top-level children, with fragments opened, so a caller's `<>Input, List</>` reads as two parts. */\nconst flattenChildren = (node: ReactNode): ReactNode[] =>\n  Children.toArray(node).flatMap((child) =>\n    isValidElement<{ children?: ReactNode }>(child) && child.type === Fragment\n      ? flattenChildren(child.props.children)\n      : [child],\n  );\n\n/** Splits a Content's parts into its search `Input`, which the frame pins above the scrolling options, and the rest. */\nconst splitSearch = (node: ReactNode): [ReactNode[], ReactNode[]] => {\n  const parts = flattenChildren(node);\n  const isSearch = (part: ReactNode) => isValidElement(part) && part.type === ComboboxInput;\n  return [parts.filter(isSearch), parts.filter((part) => !isSearch(part))];\n};\n\n/**\n * Portalled popup at `level='popup'`. Without children it lists the options that match the typed text, then the create\n * row, loading row and `Empty`; with a button `Trigger` it first holds the search `Input` and lists them in a `List`.\n * Without a search field the popup is itself the viewport of a thin ScrollArea; with one (the default for a button\n * `Trigger`, or an `Input` among the children) it is a dialog framing the field above a ScrollArea of the rest, so the\n * options never scroll beneath the field. Anchor it to a caret or any other rect with the Root's\n * `positioning.getAnchorRect` (Ark has no virtual-trigger part).\n */\nconst ComboboxContent = forwardRef<HTMLDivElement, ComboboxContentProps>(\n  ({ classNames, size, container, children, ...props }, forwardedRef) => {\n    const combobox = useComboboxContext();\n    const { loading, search: searchField } = useComboboxRootContext('Combobox.Content');\n    const popupSize = usePopupSize(\n      size,\n      combobox.open,\n      [combobox.getControlProps().id, combobox.getTriggerProps().id],\n      'md',\n    );\n    const [search, items] = splitSearch(\n      children ??\n        (searchField ? (\n          <>\n            <ComboboxInput />\n            <ComboboxList />\n          </>\n        ) : (\n          <ComboboxOptions />\n        )),\n    );\n    // Once framed, the popup stays framed until it closes: children that swap the search for a create form must not\n    // remount the content mid-interaction.\n    const framed = useRef(false);\n    framed.current = combobox.open && (framed.current || search.length > 0 || searchField);\n    const contentProps = {\n      ...props,\n      'aria-busy': loading || undefined,\n      'onPointerDown': (event: PointerEvent<HTMLDivElement>) => {\n        props.onPointerDown?.(event);\n        focusComposedField(event);\n      },\n      'ref': forwardedRef,\n    };\n    return (\n      <Portal container={container}>\n        <ComboboxPrimitive.Positioner>\n          {!framed.current ? (\n            <PopupScroll size={popupSize} classNames={mx(classNames)}>\n              <ComboboxViewport {...contentProps}>\n                <ContentContext.Provider value={true}>{items}</ContentContext.Provider>\n              </ComboboxViewport>\n            </PopupScroll>\n          ) : (\n            <ComboboxViewport\n              {...contentProps}\n              data-surface='popup'\n              data-size={popupSize}\n              classNames={mx(recipes.popup(), recipes.comboboxFrame(), classNames)}\n            >\n              <ContentContext.Provider value={true}>\n                {search}\n                <ScrollArea.Root width='thin'>\n                  <ScrollArea.Viewport>{items}</ScrollArea.Viewport>\n                </ScrollArea.Root>\n              </ContentContext.Provider>\n            </ComboboxViewport>\n          )}\n        </ComboboxPrimitive.Positioner>\n      </Portal>\n    );\n  },\n);\n\nComboboxContent.displayName = 'Combobox.Content';\n\n/** The matching options, then the create row, the loading row and the empty state. */\nconst ComboboxOptions = () => {\n  const { collection } = useComboboxContext();\n  return (\n    <>\n      {collection.items\n        .filter((item: ComboboxOption) => item.value !== CREATE_VALUE)\n        .map((item: ComboboxOption) => (\n          <ComboboxItem key={item.value} item={item} />\n        ))}\n      <ComboboxCreateItem />\n      <ComboboxLoading />\n      <ComboboxEmpty />\n    </>\n  );\n};\n\n/** A spinner row while results load; presentational, since the popup itself is `aria-busy`. */\nconst ComboboxLoading = () => {\n  const { loading } = useComboboxRootContext('Combobox.Content');\n  const { t } = useTranslation(translationKey);\n  return loading ? (\n    <div role='presentation' data-scope='combobox' data-part='loading' className={recipes.comboboxEmpty()}>\n      <Icon.Icon icon='ph--spinner-gap--regular' spin />\n      {t('combobox.loading.label')}\n    </div>\n  ) : null;\n};\n\n//\n// List\n//\n\ntype ComboboxListProps = ThemedClassName<ComboboxPrimitive.ListProps>;\n\n/**\n * The listbox under a popup search field (the Content is then a dialog); without children, the matching options,\n * create row, loading row and `Empty`.\n */\nconst ComboboxList = forwardRef<HTMLDivElement, ComboboxListProps>(\n  ({ classNames, children, ...props }, forwardedRef) => (\n    <ComboboxPrimitive.List {...props} className={mx(recipes.comboboxList(), classNames)} ref={forwardedRef}>\n      {children ?? <ComboboxOptions />}\n    </ComboboxPrimitive.List>\n  ),\n);\n\nComboboxList.displayName = 'Combobox.List';\n\n//\n// Empty\n//\n\ntype ComboboxEmptyProps = ThemedClassName<ComboboxPrimitive.EmptyProps>;\n\n/** Shown when no option matches and nothing is loading; \"No results\" by default. */\nconst ComboboxEmpty = forwardRef<HTMLDivElement, ComboboxEmptyProps>(\n  ({ classNames, children, ...props }, forwardedRef) => {\n    const { loading } = useComboboxRootContext('Combobox.Empty');\n    const { t } = useTranslation(translationKey);\n    return loading ? null : (\n      <ComboboxPrimitive.Empty {...props} className={mx(recipes.comboboxEmpty(), classNames)} ref={forwardedRef}>\n        {children ?? t('combobox.empty.label')}\n      </ComboboxPrimitive.Empty>\n    );\n  },\n);\n\nComboboxEmpty.displayName = 'Combobox.Empty';\n\n//\n// Item\n//\n\n// The option an Item renders, so its parts default to the option's icon, label and description.\nconst ItemContext = createContext<ComboboxOption | undefined>(undefined);\n\nconst useItem = (part: string) => {\n  const item = useContext(ItemContext);\n  if (!item) {\n    throw new Error(`Combobox.${part} must be inside Combobox.Item`);\n  }\n  return item;\n};\n\ntype ComboboxItemProps = ThemedClassName<Omit<ComboboxPrimitive.ItemProps, 'item' | 'children'>> & {\n  item: ComboboxOption;\n  /**\n   * Replaces the whole row, composed from `ItemIcon`, `ItemText`, `ItemDescription` and `ItemIndicator`; the input\n   * still shows the label.\n   */\n  children?: ReactNode;\n};\n\n/**\n * A block-tall row: without children, the option's icon, its label (over its description, when it has one, growing\n * the row by a line) and the check shown while it is selected.\n */\nconst ComboboxItem = forwardRef<HTMLDivElement, ComboboxItemProps>(\n  ({ classNames, item, children, ...props }, forwardedRef) => (\n    <ItemContext.Provider value={item}>\n      <ComboboxPrimitive.Item\n        {...props}\n        item={item}\n        className={mx(recipes.comboboxItem(), classNames)}\n        ref={forwardedRef}\n      >\n        {children ?? (\n          <>\n            {item.icon && <ComboboxItemIcon />}\n            <ComboboxItemText />\n            {item.description && <ComboboxItemDescription />}\n            <ComboboxItemIndicator />\n          </>\n        )}\n      </ComboboxPrimitive.Item>\n    </ItemContext.Provider>\n  ),\n);\n\nComboboxItem.displayName = 'Combobox.Item';\n\n//\n// CreateItem\n//\n\ntype ComboboxCreateItemProps = Omit<ComboboxItemProps, 'item'>;\n\n/**\n * The row the Root's `onCreate` offers while the query matches no label exactly: `Create “{query}”` by default. It is\n * an option like any other, last in keyboard order, so place it after the other items when composing a list.\n */\nconst ComboboxCreateItem = forwardRef<HTMLDivElement, ComboboxCreateItemProps>(\n  ({ children, ...props }, forwardedRef) => {\n    const { create, createLabel, createIcon } = useComboboxRootContext('Combobox.CreateItem');\n    const { t } = useTranslation(translationKey);\n    if (!create) {\n      return null;\n    }\n\n    return (\n      <ComboboxItem {...props} item={create} data-create='' ref={forwardedRef}>\n        {children ?? (\n          <>\n            <ComboboxItemIcon icon={createIcon ?? 'ph--plus--regular'} />\n            <ComboboxItemText>\n              {createLabel?.(create.label) ??\n                t('combobox.create.label', { query: create.label, interpolation: { escapeValue: false } })}\n            </ComboboxItemText>\n          </>\n        )}\n      </ComboboxItem>\n    );\n  },\n);\n\nComboboxCreateItem.displayName = 'Combobox.CreateItem';\n\n//\n// ItemIcon\n//\n\ntype ComboboxItemIconProps = Omit<Icon.IconProps, 'icon'> & {\n  /** Defaults to the option's `icon`. */\n  icon?: string;\n};\n\n/** The leading icon, in the option's `iconHue` unless given a `hue`. */\nconst ComboboxItemIcon = forwardRef<SVGSVGElement, ComboboxItemIconProps>(({ icon, hue, ...props }, forwardedRef) => {\n  const item = useItem('ItemIcon');\n  const glyph = icon ?? item.icon;\n  return glyph ? <Icon.Icon {...props} icon={glyph} hue={hue ?? item.iconHue} ref={forwardedRef} /> : null;\n});\n\nComboboxItemIcon.displayName = 'Combobox.ItemIcon';\n\n//\n// ItemText\n//\n\ntype ComboboxItemTextProps = ThemedClassName<ComboboxPrimitive.ItemTextProps>;\n\n/** The row's label, taking the free space; the option's `label` by default. */\nconst ComboboxItemText = forwardRef<HTMLDivElement, ComboboxItemTextProps>(\n  ({ classNames, children, ...props }, forwardedRef) => {\n    const item = useItem('ItemText');\n    return (\n      <ComboboxPrimitive.ItemText {...props} className={mx(classNames)} ref={forwardedRef}>\n        {children ?? item.label}\n      </ComboboxPrimitive.ItemText>\n    );\n  },\n);\n\nComboboxItemText.displayName = 'Combobox.ItemText';\n\n//\n// ItemDescription\n//\n\ntype ComboboxItemDescriptionProps = ThemedClassName<ComponentPropsWithoutRef<'div'>>;\n\n/** A second line under the text in `--color-fg-muted`; the option's `description` by default. */\nconst ComboboxItemDescription = forwardRef<HTMLDivElement, ComboboxItemDescriptionProps>(\n  ({ classNames, children, ...props }, forwardedRef) => {\n    const item = useItem('ItemDescription');\n    return (\n      <div\n        {...props}\n        data-scope='combobox'\n        data-part='item-description'\n        className={mx(recipes.comboboxItemDescription(), classNames)}\n        ref={forwardedRef}\n      >\n        {children ?? item.description}\n      </div>\n    );\n  },\n);\n\nComboboxItemDescription.displayName = 'Combobox.ItemDescription';\n\n//\n// ItemIndicator\n//\n\ntype ComboboxItemIndicatorProps = ThemedClassName<ComboboxPrimitive.ItemIndicatorProps>;\n\n/** Shown while its item is selected: a check by default. */\nconst ComboboxItemIndicator = forwardRef<HTMLDivElement, ComboboxItemIndicatorProps>(\n  ({ classNames, children, ...props }, forwardedRef) => (\n    <ComboboxPrimitive.ItemIndicator {...props} className={mx(classNames)} ref={forwardedRef}>\n      {children ?? <Icon.Icon icon='ph--check--regular' />}\n    </ComboboxPrimitive.ItemIndicator>\n  ),\n);\n\nComboboxItemIndicator.displayName = 'Combobox.ItemIndicator';\n\n//\n// ItemGroup\n//\n\ntype ComboboxItemGroupProps = ThemedClassName<ComboboxPrimitive.ItemGroupProps>;\n\n/**\n * A `group` of options, named by the `ItemGroupLabel` inside it; order groups as the Root's `items` are ordered, or\n * keyboard order and reading order diverge.\n */\nconst ComboboxItemGroup = forwardRef<HTMLDivElement, ComboboxItemGroupProps>(\n  ({ classNames, ...props }, forwardedRef) => (\n    <ComboboxPrimitive.ItemGroup {...props} className={mx(classNames)} ref={forwardedRef} />\n  ),\n);\n\nComboboxItemGroup.displayName = 'Combobox.ItemGroup';\n\n//\n// ItemGroupLabel\n//\n\ntype ComboboxItemGroupLabelProps = ThemedClassName<ComboboxPrimitive.ItemGroupLabelProps>;\n\n/** A small caption naming the group, like `Select.ItemGroupLabel`. */\nconst ComboboxItemGroupLabel = forwardRef<HTMLDivElement, ComboboxItemGroupLabelProps>(\n  ({ classNames, ...props }, forwardedRef) => (\n    <ComboboxPrimitive.ItemGroupLabel\n      {...props}\n      className={mx(recipes.popupGroupLabel(), classNames)}\n      ref={forwardedRef}\n    />\n  ),\n);\n\nComboboxItemGroupLabel.displayName = 'Combobox.ItemGroupLabel';\nexport type {\n  ComboboxClearTriggerProps as ClearTriggerProps,\n  ComboboxContentProps as ContentProps,\n  ComboboxControlProps as ControlProps,\n  ComboboxCreateItemProps as CreateItemProps,\n  ComboboxEmptyProps as EmptyProps,\n  ComboboxInputProps as InputProps,\n  ComboboxItemDescriptionProps as ItemDescriptionProps,\n  ComboboxItemGroupLabelProps as ItemGroupLabelProps,\n  ComboboxItemGroupProps as ItemGroupProps,\n  ComboboxItemIconProps as ItemIconProps,\n  ComboboxItemIndicatorProps as ItemIndicatorProps,\n  ComboboxItemProps as ItemProps,\n  ComboboxItemTextProps as ItemTextProps,\n  ComboboxLabelProps as LabelProps,\n  ComboboxListProps as ListProps,\n  ComboboxRootProps as RootProps,\n  ComboboxTriggerProps as TriggerProps,\n};\n\nexport {\n  ComboboxClearTrigger as ClearTrigger,\n  ComboboxContent as Content,\n  ComboboxControl as Control,\n  ComboboxCreateItem as CreateItem,\n  ComboboxEmpty as Empty,\n  ComboboxInput as Input,\n  ComboboxItem as Item,\n  ComboboxItemDescription as ItemDescription,\n  ComboboxItemGroup as ItemGroup,\n  ComboboxItemGroupLabel as ItemGroupLabel,\n  ComboboxItemIcon as ItemIcon,\n  ComboboxItemIndicator as ItemIndicator,\n  ComboboxItemText as ItemText,\n  ComboboxLabel as Label,\n  ComboboxList as List,\n  ComboboxRoot as Root,\n  ComboboxTrigger as Trigger,\n};\nexport type { ComboboxFilter as Filter, ComboboxOption as Option };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,IAAM,eAAe;;AAGrB,IAAM,eAAe;;AAUrB,IAAM,kBAAkC,QAAQ,UAAU,OAAO,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,YAAY,CAAC;AAqBjH,IAAM,CAAC,s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