{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "command",
  "type": "registry:ui",
  "title": "Command",
  "description": "Searchable lists of actions for pickers and palettes.",
  "categories": [
    "overlays"
  ],
  "dependencies": [
    "@hugeicons/core-free-icons@4.4.0",
    "@hugeicons/react@1.1.10"
  ],
  "registryDependencies": [
    "https://sprout.tulipfarm.ai/r/sprout-base.json",
    "https://sprout.tulipfarm.ai/r/dialog.json"
  ],
  "files": [
    {
      "path": "registry/sprout/components/ui/command.tsx",
      "type": "registry:ui",
      "target": "components/ui/command.tsx",
      "content": "'use client';\n\nimport {\n  createContext,\n  isValidElement,\n  useContext,\n  useId,\n  useLayoutEffect,\n  useRef,\n  useState,\n  useSyncExternalStore,\n  type ChangeEvent,\n  type ComponentProps,\n  type KeyboardEvent,\n  type ReactNode,\n} from 'react';\nimport { CheckIcon } from '@/lib/sprout/icons/check-icon';\nimport { SearchIcon } from '@/lib/sprout/icons/search-icon';\nimport { cn } from '@/lib/sprout/classes';\nimport {\n  Dialog,\n  DialogContent,\n  DialogDescription,\n  DialogTitle,\n  type DialogContentProps,\n  type DialogProps,\n} from '@/components/ui/dialog';\n\nexport type CommandFilter = (value: string, search: string, keywords?: readonly string[]) => number;\n\nconst normalize = (text: string) =>\n  text\n    .normalize('NFD')\n    .replace(/\\p{Diacritic}/gu, '')\n    .toLowerCase();\n\nfunction tokenScore(haystack: string, token: string) {\n  const index = haystack.indexOf(token);\n  if (index === 0) return 1;\n  if (index > 0) return /[\\s\\-_/.(]/.test(haystack[index - 1]!) ? 0.9 : 0.7;\n  let from = 0;\n  let last = -1;\n  let gaps = 0;\n  for (const char of token) {\n    const found = haystack.indexOf(char, from);\n    if (found === -1) return 0;\n    if (last >= 0) gaps += found - last - 1;\n    last = found;\n    from = found + 1;\n  }\n  return Math.max(0.05, 0.5 - gaps * 0.02);\n}\n\nexport const defaultCommandFilter: CommandFilter = (value, search, keywords = []) => {\n  const haystack = normalize([value, ...keywords].join(' '));\n  const tokens = normalize(search).trim().split(/\\s+/).filter(Boolean);\n  let score = 1;\n  for (const token of tokens) score = Math.min(score, tokenScore(haystack, token));\n  return score;\n};\n\ninterface Entry {\n  value: string;\n  keywords: readonly string[];\n  group: string | null;\n  select: () => void;\n}\n\ninterface Options {\n  filter: CommandFilter;\n  shouldFilter: boolean;\n}\n\nclass CommandStore {\n  search = '';\n  active: string | null = null;\n  ready = false;\n  count = 0;\n  version = 0;\n  needsFirst = true;\n  options: Options = { filter: defaultCommandFilter, shouldFilter: true };\n  readonly items = new Map<string, Entry>();\n  readonly scores = new Map<string, number>();\n  readonly groupScores = new Map<string, number>();\n  private readonly listeners = new Set<() => void>();\n  private scheduled = false;\n\n  subscribe = (listener: () => void) => {\n    this.listeners.add(listener);\n    return () => this.listeners.delete(listener);\n  };\n\n  get filtering() {\n    return this.options.shouldFilter && this.search.trim() !== '';\n  }\n\n  emit() {\n    this.version++;\n    for (const listener of this.listeners) listener();\n  }\n\n  refilter() {\n    this.scores.clear();\n    this.groupScores.clear();\n    let count = 0;\n    for (const [id, entry] of this.items) {\n      const score = this.filtering ? this.options.filter(entry.value, this.search, entry.keywords) : 1;\n      if (score <= 0) continue;\n      count++;\n      this.scores.set(id, score);\n      if (entry.group) this.groupScores.set(entry.group, Math.max(score, this.groupScores.get(entry.group) ?? 0));\n    }\n    this.count = count;\n  }\n\n  schedule() {\n    if (this.scheduled) return;\n    this.scheduled = true;\n    queueMicrotask(() => {\n      this.scheduled = false;\n      this.refilter();\n      if (this.active && !this.scores.has(this.active)) this.needsFirst = true;\n      this.emit();\n    });\n  }\n\n  setSearch(search: string) {\n    if (search === this.search) return;\n    this.search = search;\n    this.refilter();\n    this.needsFirst = true;\n    this.emit();\n  }\n\n  setActive(id: string | null) {\n    if (id === this.active) return;\n    this.active = id;\n    this.emit();\n  }\n\n  isVisible(id: string) {\n    return !this.filtering || this.scores.has(id);\n  }\n\n  order(score: number | undefined) {\n    return this.filtering && score ? -Math.round(score * 1000) : undefined;\n  }\n}\n\ninterface CommandContextValue {\n  store: CommandStore;\n  listId: string;\n  inputId: string;\n  labelId: string;\n  label: string | undefined;\n}\n\nconst CommandContext = createContext<CommandContextValue | null>(null);\nconst GroupContext = createContext<string | null>(null);\n\nfunction useCommandContext(part: string) {\n  const context = useContext(CommandContext);\n  if (!context) throw new Error(`${part} must be inside Command.`);\n  return context;\n}\n\nfunction useStore<T>(store: CommandStore, read: () => T) {\n  return useSyncExternalStore(store.subscribe, read, read);\n}\n\nconst ITEM = '[data-slot=\"command-item\"]';\n\nfunction orderOf(element: Element | null) {\n  return element instanceof HTMLElement ? Number(element.style.order || 0) : 0;\n}\n\nfunction enabledItems(root: HTMLElement) {\n  const items = [...root.querySelectorAll<HTMLElement>(`${ITEM}:not([aria-disabled=\"true\"])`)].filter(\n    item => item.closest('[data-slot=\"command\"]') === root,\n  );\n  const keyed = items.map(item => {\n    const group = item.closest<HTMLElement>('[data-slot=\"command-group\"]');\n    return group && root.contains(group)\n      ? { item, group, outer: orderOf(group), inner: orderOf(item) }\n      : { item, group: null, outer: orderOf(item), inner: 0 };\n  });\n  return keyed.sort((a, b) => a.outer - b.outer || a.inner - b.inner);\n}\n\nexport interface CommandProps extends ComponentProps<'div'> {\n  label?: string;\n  shouldFilter?: boolean;\n  filter?: CommandFilter;\n  loop?: boolean;\n}\n\nexport function Command({\n  label,\n  shouldFilter = true,\n  filter = defaultCommandFilter,\n  loop = false,\n  className,\n  children,\n  onKeyDown,\n  ref,\n  ...props\n}: CommandProps) {\n  const [store] = useState(() => new CommandStore());\n  const root = useRef<HTMLDivElement | null>(null);\n  const id = useId();\n  const context = useRef<CommandContextValue>({\n    store,\n    listId: `${id}-list`,\n    inputId: `${id}-input`,\n    labelId: `${id}-label`,\n    label,\n  }).current;\n  context.label = label;\n\n  const version = useStore(store, () => store.version);\n\n  useLayoutEffect(() => {\n    const changed = store.options.filter !== filter || store.options.shouldFilter !== shouldFilter;\n    store.options = { filter, shouldFilter };\n    if (changed && store.ready) {\n      store.refilter();\n      store.needsFirst = true;\n      store.emit();\n    }\n  }, [store, filter, shouldFilter]);\n\n  useLayoutEffect(() => {\n    if (!store.ready) {\n      store.ready = true;\n      store.refilter();\n      store.emit();\n      return;\n    }\n    if (!store.needsFirst || !root.current) return;\n    store.needsFirst = false;\n    const first = enabledItems(root.current)[0]?.item;\n    store.setActive(first?.id ?? null);\n    root.current.querySelector('[data-slot=\"command-list\"]')?.scrollTo({ top: 0 });\n  }, [store, version]);\n\n  const move = (to: (items: ReturnType<typeof enabledItems>, index: number) => number) => {\n    if (!root.current) return;\n    const items = enabledItems(root.current);\n    if (!items.length) return;\n    const index = items.findIndex(({ item }) => item.id === store.active);\n    const next = items[to(items, index)];\n    if (!next) return;\n    store.setActive(next.item.id);\n    const firstInGroup = next.group && items.find(({ group }) => group === next.group) === next;\n    const heading = firstInGroup ? next.group!.querySelector('[data-slot=\"command-group-heading\"]') : null;\n    (heading ?? next.item).scrollIntoView({ block: 'nearest' });\n    if (heading) next.item.scrollIntoView({ block: 'nearest' });\n  };\n\n  const step = (delta: 1 | -1) =>\n    move((items, index) => {\n      if (index === -1) return delta === 1 ? 0 : items.length - 1;\n      const next = index + delta;\n      if (loop) return (next + items.length) % items.length;\n      return Math.min(Math.max(next, 0), items.length - 1);\n    });\n\n  const jumpGroup = (delta: 1 | -1) =>\n    move((items, index) => {\n      const current = items[index];\n      if (!current) return 0;\n      const groups = [...new Set(items.map(({ group }) => group))];\n      const next = groups[groups.indexOf(current.group) + delta];\n      if (next === undefined) return index;\n      return items.findIndex(({ group }) => group === next);\n    });\n\n  const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n    onKeyDown?.(event);\n    if (event.defaultPrevented || event.nativeEvent.isComposing) return;\n    const target = event.target as HTMLElement;\n    const fromInput = target.dataset.slot === 'command-input';\n    if (!fromInput && target.closest('button, a[href], input, textarea, select, [contenteditable]')) return;\n    const vim = event.ctrlKey && !event.metaKey && !event.altKey;\n    switch (event.key) {\n      case 'ArrowDown':\n      case 'ArrowUp': {\n        const delta = event.key === 'ArrowDown' ? 1 : -1;\n        if (event.metaKey) move(items => (delta === 1 ? items.length - 1 : 0));\n        else if (event.altKey) jumpGroup(delta);\n        else step(delta);\n        break;\n      }\n      case 'n':\n      case 'j':\n        if (!vim) return;\n        step(1);\n        break;\n      case 'p':\n      case 'k':\n        if (!vim) return;\n        step(-1);\n        break;\n      case 'Home':\n        move(() => 0);\n        break;\n      case 'End':\n        move(items => items.length - 1);\n        break;\n      case 'Enter': {\n        if (!store.active) return;\n        const entry = store.items.get(store.active);\n        if (!entry) return;\n        event.preventDefault();\n        entry.select();\n        return;\n      }\n      default:\n        return;\n    }\n    event.preventDefault();\n  };\n\n  return (\n    <CommandContext.Provider value={context}>\n      <div\n        data-slot=\"command\"\n        {...props}\n        ref={node => {\n          root.current = node;\n          if (typeof ref === 'function') return ref(node);\n          if (ref) ref.current = node;\n        }}\n        className={cn('sprout-command', className)}\n        onKeyDown={handleKeyDown}\n      >\n        {label && (\n          <label id={context.labelId} htmlFor={context.inputId} className=\"sprout-command-sr-only\">\n            {label}\n          </label>\n        )}\n        {children}\n      </div>\n    </CommandContext.Provider>\n  );\n}\n\nexport interface CommandInputProps extends Omit<\n  ComponentProps<'input'>,\n  'value' | 'defaultValue' | 'onChange' | 'type'\n> {\n  value?: string;\n  onValueChange?: (search: string) => void;\n  onChange?: (event: ChangeEvent<HTMLInputElement>) => void;\n}\n\nexport function CommandInput({ value, onValueChange, onChange, className, id, ...props }: CommandInputProps) {\n  const { store, listId, inputId, labelId, label } = useCommandContext('CommandInput');\n  const search = useStore(store, () => store.search);\n  const active = useStore(store, () => store.active);\n  const empty = useStore(store, () => store.ready && store.count === 0);\n\n  useLayoutEffect(() => {\n    if (value !== undefined) store.setSearch(value);\n  }, [store, value]);\n\n  return (\n    <div data-slot=\"command-input-wrapper\" className=\"sprout-command-input-wrapper\">\n      <div data-slot=\"command-input-group\" className=\"sprout-command-input-group\">\n        <SearchIcon size=\"md\" aria-hidden=\"true\" className=\"sprout-command-input-icon\" />\n        <input\n          id={id ?? inputId}\n          type=\"text\"\n          role=\"combobox\"\n          autoComplete=\"off\"\n          autoCorrect=\"off\"\n          spellCheck={false}\n          aria-autocomplete=\"list\"\n          aria-expanded={!empty}\n          aria-controls={listId}\n          aria-labelledby={label && !props['aria-label'] ? labelId : undefined}\n          aria-activedescendant={active ?? undefined}\n          data-slot=\"command-input\"\n          {...props}\n          value={value ?? search}\n          onChange={event => {\n            onChange?.(event);\n            onValueChange?.(event.target.value);\n            if (value === undefined) store.setSearch(event.target.value);\n          }}\n          className={cn('sprout-command-input', className)}\n        />\n      </div>\n    </div>\n  );\n}\n\nexport type CommandListProps = ComponentProps<'div'>;\n\nexport function CommandList({ className, children, ...props }: CommandListProps) {\n  const { store, listId, label } = useCommandContext('CommandList');\n  const empty = useStore(store, () => store.ready && store.count === 0);\n  const {\n    'aria-label': ariaLabel = props['aria-labelledby'] ? undefined : (label ?? 'Suggestions'),\n    'aria-labelledby': ariaLabelledBy,\n    ...rest\n  } = props;\n  return (\n    <div\n      id={listId}\n      role={empty ? undefined : 'listbox'}\n      tabIndex={empty ? undefined : -1}\n      aria-label={empty ? undefined : ariaLabel}\n      aria-labelledby={empty ? undefined : ariaLabelledBy}\n      data-slot=\"command-list\"\n      data-empty={empty || undefined}\n      {...rest}\n      className={cn('sprout-command-list', className)}\n    >\n      <div data-slot=\"command-list-sizer\" className=\"sprout-command-list-sizer\">\n        {children}\n      </div>\n    </div>\n  );\n}\n\nexport type CommandEmptyProps = ComponentProps<'div'>;\n\nexport function CommandEmpty({ className, ...props }: CommandEmptyProps) {\n  const { store } = useCommandContext('CommandEmpty');\n  const empty = useStore(store, () => store.ready && store.count === 0);\n  if (!empty) return null;\n  return (\n    <div role=\"presentation\" data-slot=\"command-empty\" {...props} className={cn('sprout-command-empty', className)} />\n  );\n}\n\nexport interface CommandGroupProps extends Omit<ComponentProps<'div'>, 'value'> {\n  heading?: ReactNode;\n  forceMount?: boolean;\n}\n\nexport function CommandGroup({ heading, forceMount = false, className, children, style, ...props }: CommandGroupProps) {\n  const { store } = useCommandContext('CommandGroup');\n  const id = useId();\n  const headingId = `${id}-heading`;\n  const matched = useStore(store, () => store.groupScores.has(id));\n  const filtering = useStore(store, () => store.filtering);\n  const order = useStore(store, () => store.order(store.groupScores.get(id)));\n  const hidden = filtering && !matched && !forceMount;\n  return (\n    <div\n      role=\"presentation\"\n      data-slot=\"command-group\"\n      hidden={hidden || undefined}\n      {...props}\n      style={{ order, ...style }}\n      className={cn('sprout-command-group', className)}\n    >\n      {heading != null && heading !== false && (\n        <div\n          id={headingId}\n          aria-hidden=\"true\"\n          data-slot=\"command-group-heading\"\n          className=\"sprout-command-group-heading\"\n        >\n          {heading}\n        </div>\n      )}\n      <div\n        role=\"group\"\n        aria-labelledby={heading != null && heading !== false ? headingId : undefined}\n        data-slot=\"command-group-items\"\n        className=\"sprout-command-group-items\"\n      >\n        <GroupContext.Provider value={id}>{children}</GroupContext.Provider>\n      </div>\n    </div>\n  );\n}\n\nexport interface CommandSeparatorProps extends ComponentProps<'div'> {\n  alwaysRender?: boolean;\n}\n\nexport function CommandSeparator({ alwaysRender = false, className, ...props }: CommandSeparatorProps) {\n  const { store } = useCommandContext('CommandSeparator');\n  const searching = useStore(store, () => store.search !== '');\n  if (searching && !alwaysRender) return null;\n  return (\n    <div\n      aria-hidden=\"true\"\n      data-slot=\"command-separator\"\n      {...props}\n      className={cn('sprout-command-separator', className)}\n    />\n  );\n}\n\nfunction textOf(node: ReactNode): string {\n  if (typeof node === 'string' || typeof node === 'number') return String(node);\n  if (Array.isArray(node)) return node.map(textOf).join('');\n  if (isValidElement<{ children?: ReactNode }>(node)) return textOf(node.props.children);\n  return '';\n}\n\nexport interface CommandItemProps extends Omit<ComponentProps<'div'>, 'value' | 'onSelect'> {\n  value?: string;\n  keywords?: readonly string[];\n  disabled?: boolean;\n  onSelect?: (value: string) => void;\n  forceMount?: boolean;\n  'data-checked'?: boolean;\n}\n\nexport function CommandItem({\n  value,\n  keywords,\n  disabled = false,\n  onSelect,\n  forceMount = false,\n  className,\n  children,\n  style,\n  onClick,\n  onPointerMove,\n  onPointerDown,\n  ...props\n}: CommandItemProps) {\n  const { store } = useCommandContext('CommandItem');\n  const group = useContext(GroupContext);\n  const id = useId();\n  const resolved = (value ?? textOf(children)).trim();\n  const select = useRef(() => {});\n  select.current = () => {\n    if (!disabled) onSelect?.(resolved);\n  };\n  const keywordKey = (keywords ?? []).join('\\u0000');\n\n  useLayoutEffect(() => {\n    store.items.set(id, {\n      value: resolved,\n      keywords: keywordKey ? keywordKey.split('\\u0000') : [],\n      group,\n      select: () => select.current(),\n    });\n    store.schedule();\n    return () => {\n      store.items.delete(id);\n      if (store.active === id) store.needsFirst = true;\n      store.schedule();\n    };\n  }, [store, id, resolved, keywordKey, group]);\n\n  const visible = useStore(store, () => forceMount || store.isVisible(id));\n  const active = useStore(store, () => store.active === id);\n  const order = useStore(store, () => store.order(store.scores.get(id)));\n  if (!visible) return null;\n\n  return (\n    <div\n      id={id}\n      role=\"option\"\n      aria-selected={active}\n      aria-disabled={disabled || undefined}\n      data-selected={active || undefined}\n      data-disabled={disabled || undefined}\n      data-value={resolved}\n      data-slot=\"command-item\"\n      {...props}\n      style={{ order, ...style }}\n      className={cn('sprout-command-item', className)}\n      onPointerDown={event => {\n        onPointerDown?.(event);\n        if (!event.defaultPrevented) event.preventDefault();\n      }}\n      onPointerMove={event => {\n        onPointerMove?.(event);\n        if (!disabled && !event.defaultPrevented) store.setActive(id);\n      }}\n      onClick={event => {\n        onClick?.(event);\n        if (!event.defaultPrevented) select.current();\n      }}\n    >\n      {children}\n      <CheckIcon size=\"md\" aria-hidden=\"true\" className=\"sprout-command-item-check\" />\n    </div>\n  );\n}\n\nexport type CommandShortcutProps = ComponentProps<'span'>;\n\nexport function CommandShortcut({ className, ...props }: CommandShortcutProps) {\n  return <span data-slot=\"command-shortcut\" {...props} className={cn('sprout-command-shortcut', className)} />;\n}\n\nexport interface CommandDialogProps extends Omit<DialogProps, 'children'> {\n  title?: string;\n  description?: string;\n  className?: string;\n  showCloseButton?: boolean;\n  closeLabel?: string;\n  container?: DialogContentProps['container'];\n  children: ReactNode;\n}\n\nexport function CommandDialog({\n  title = 'Command Palette',\n  description = 'Search for a command to run...',\n  className,\n  showCloseButton = false,\n  closeLabel,\n  container,\n  children,\n  ...props\n}: CommandDialogProps) {\n  return (\n    <Dialog {...props}>\n      <DialogContent\n        placement=\"top\"\n        showCloseButton={showCloseButton}\n        closeLabel={closeLabel}\n        container={container}\n        className={cn('sprout-command-dialog', className)}\n      >\n        <DialogTitle className=\"sprout-command-sr-only\">{title}</DialogTitle>\n        <DialogDescription className=\"sprout-command-sr-only\">{description}</DialogDescription>\n        {children}\n      </DialogContent>\n    </Dialog>\n  );\n}\n"
    },
    {
      "path": "registry/sprout/lib/sprout/icons/check-icon.tsx",
      "type": "registry:lib",
      "target": "lib/sprout/icons/check-icon.tsx",
      "content": "import { Tick02Icon as glyph } from '@hugeicons/core-free-icons';\nimport { createIcon } from '@/lib/sprout/icons/create-icon';\n\nexport const CheckIcon = /* @__PURE__ */ createIcon(glyph, 'CheckIcon');\n"
    },
    {
      "path": "registry/sprout/lib/sprout/icons/create-icon.tsx",
      "type": "registry:lib",
      "target": "lib/sprout/icons/create-icon.tsx",
      "content": "import { HugeiconsIcon, type IconSvgElement } from '@hugeicons/react';\nimport type { ReactElement, Ref, SVGProps } from 'react';\n\nexport const iconSizes = {\n  xs: 12,\n  sm: 14,\n  md: 16,\n  lg: 18,\n  xl: 20,\n  '2xl': 24,\n} as const;\n\nexport type IconSize = keyof typeof iconSizes;\n\nexport const iconStrokeWidth = 1.5;\n\nexport type IconProps = Omit<SVGProps<SVGSVGElement>, 'ref'> & {\n  size?: IconSize | number;\n  ref?: Ref<SVGSVGElement>;\n};\n\nexport type IconComponent = (props: IconProps) => ReactElement;\n\nexport function createIcon(glyph: IconSvgElement, name: string): IconComponent {\n  const Icon = ({ size = '2xl', strokeWidth = iconStrokeWidth, ...props }: IconProps) => (\n    <HugeiconsIcon\n      icon={glyph}\n      size={typeof size === 'number' ? size : iconSizes[size]}\n      strokeWidth={Number(strokeWidth)}\n      {...props}\n    />\n  );\n  Icon.displayName = name;\n  return Icon;\n}\n"
    },
    {
      "path": "registry/sprout/lib/sprout/icons/search-icon.tsx",
      "type": "registry:lib",
      "target": "lib/sprout/icons/search-icon.tsx",
      "content": "import { Search01Icon as glyph } from '@hugeicons/core-free-icons';\nimport { createIcon } from '@/lib/sprout/icons/create-icon';\n\nexport const SearchIcon = /* @__PURE__ */ createIcon(glyph, 'SearchIcon');\n"
    }
  ],
  "css": {
    "@layer components": {
      ".sprout-command": {
        "box-sizing": "border-box",
        "border-radius": "var(--sprout-radius-panel)",
        "background": "var(--sprout-surface)",
        "width": "100%",
        "min-width": "0",
        "height": "100%",
        "color": "var(--sprout-text)",
        "font-family": "var(--sprout-font)",
        "font-size": "var(--sprout-text-sm)",
        "outline": "none",
        "flex-direction": "column",
        "padding": "4px",
        "line-height": "1.25rem",
        "display": "flex",
        "overflow": "hidden"
      },
      ".sprout-command :where(p)": {
        "margin": "0"
      },
      ".sprout-command-sr-only": {
        "clip-path": "inset(50%)",
        "white-space": "nowrap",
        "border": "0",
        "width": "1px",
        "height": "1px",
        "margin": "-1px",
        "padding": "0",
        "position": "absolute",
        "overflow": "hidden"
      },
      ".sprout-command-input-wrapper": {
        "padding": "4px 4px 0"
      },
      ".sprout-command-input-group": {
        "box-sizing": "border-box",
        "height": "var(--sprout-control-height)",
        "border": "1px solid color-mix(in oklab, var(--sprout-input) 30%, transparent)",
        "border-radius": "calc(var(--sprout-radius-panel) - 4px)",
        "background": "color-mix(in oklab, var(--sprout-input) 30%, transparent)",
        "cursor": "text",
        "align-items": "center",
        "gap": "6px",
        "min-width": "0",
        "padding-inline": "8px",
        "display": "flex"
      },
      ".sprout-command-input-group:has(.sprout-command-input:focus-visible)": {
        "border-color": "var(--sprout-border)"
      },
      ".sprout-command-input-group:has(.sprout-command-input:disabled)": {
        "opacity": ".5",
        "cursor": "not-allowed"
      },
      ".sprout-command-input-icon": {
        "width": "16px",
        "height": "16px",
        "color": "var(--sprout-muted)",
        "pointer-events": "none",
        "flex-shrink": "0"
      },
      ".sprout-command-input": {
        "min-width": "0",
        "height": "100%",
        "color": "var(--sprout-text)",
        "font": "inherit",
        "background": "none",
        "border": "0",
        "outline": "none",
        "flex": "1",
        "margin": "0",
        "padding": "0"
      },
      ".sprout-command-input::placeholder": {
        "color": "var(--sprout-muted)",
        "opacity": "1"
      },
      ".sprout-command-input:disabled": {
        "cursor": "not-allowed"
      },
      ".sprout-command-list": {
        "overscroll-behavior": "contain",
        "scrollbar-width": "none",
        "outline": "none",
        "max-height": "18rem",
        "scroll-padding-block": "4px",
        "overflow": "hidden auto"
      },
      ".sprout-command-list::-webkit-scrollbar": {
        "display": "none"
      },
      ".sprout-command-list-sizer, .sprout-command-group-items": {
        "flex-direction": "column",
        "min-width": "0",
        "display": "flex"
      },
      ".sprout-command-empty": {
        "color": "var(--sprout-muted)",
        "text-align": "center",
        "overflow-wrap": "anywhere",
        "padding": "24px 8px"
      },
      ".sprout-command-group": {
        "min-width": "0",
        "color": "var(--sprout-text)",
        "padding": "4px",
        "overflow": "hidden"
      },
      ".sprout-command-group[hidden]": {
        "display": "none"
      },
      ".sprout-command-group-heading": {
        "color": "var(--sprout-muted)",
        "font-size": "var(--sprout-text-xs)",
        "overflow-wrap": "anywhere",
        "padding": "6px 8px",
        "font-weight": "500",
        "line-height": "1rem"
      },
      ".sprout-command-separator": {
        "background": "var(--sprout-line)",
        "flex-shrink": "0",
        "height": "1px",
        "margin-inline": "-4px"
      },
      ".sprout-command-item": {
        "box-sizing": "border-box",
        "min-width": "0",
        "min-height": "var(--sprout-control-height)",
        "border-radius": "calc(var(--sprout-radius-control) - 2px)",
        "color": "var(--sprout-text)",
        "overflow-wrap": "anywhere",
        "cursor": "pointer",
        "user-select": "none",
        "-webkit-tap-highlight-color": "transparent",
        "outline": "none",
        "align-items": "center",
        "gap": "8px",
        "padding": "6px 8px",
        "display": "flex",
        "position": "relative"
      },
      "[data-slot=\"dialog-content\"] .sprout-command-item": {
        "border-radius": "calc(var(--sprout-radius-panel) - 4px)"
      },
      ".sprout-command-item > :where(svg), .sprout-command-item > :where(span) > :where(svg:only-child)": {
        "pointer-events": "none",
        "flex-shrink": "0",
        "width": "16px",
        "height": "16px"
      },
      ".sprout-command-item[data-selected]": {
        "background": "var(--sprout-hover)",
        "color": "var(--sprout-text)"
      },
      ".sprout-command-item[data-disabled]": {
        "opacity": ".5",
        "cursor": "default",
        "pointer-events": "none"
      },
      ".sprout-command-item-check": {
        "color": "var(--sprout-text)",
        "opacity": "0",
        "margin-inline-start": "auto"
      },
      ".sprout-command-item[data-checked=\"true\"] > .sprout-command-item-check": {
        "opacity": "1"
      },
      ".sprout-command-item:has( > .sprout-command-shortcut) > .sprout-command-item-check": {
        "display": "none"
      },
      ".sprout-command-shortcut": {
        "color": "var(--sprout-muted)",
        "font-size": "var(--sprout-text-xs)",
        "letter-spacing": ".1em",
        "white-space": "nowrap",
        "flex-shrink": "0",
        "margin-inline-start": "auto",
        "padding-inline-start": "12px"
      },
      ".sprout-command-item[data-selected] .sprout-command-shortcut": {
        "color": "var(--sprout-text)"
      },
      ".sprout-dialog-content.sprout-command-dialog": {
        "--sprout-dialog-padding": "0px",
        "border-radius": "calc(var(--sprout-radius-panel) + 4px)",
        "gap": "0",
        "padding": "0",
        "overflow": "hidden"
      },
      ".sprout-command-dialog > .sprout-command": {
        "border-radius": "inherit"
      },
      ".sprout-command-dialog .sprout-command-list": {
        "max-height": "min(20rem, 76dvh - 3rem)"
      },
      "@media (pointer: coarse)": {
        ".sprout-command-item": {
          "min-height": "2.75rem"
        }
      },
      "@media (forced-colors: active)": {
        ".sprout-command-item[data-selected]": {
          "outline-offset": "-1px",
          "outline": "2px solid highlight"
        },
        ".sprout-command-input-group": {
          "border-color": "canvastext"
        }
      },
      "@media (prefers-reduced-motion: no-preference)": {
        ".sprout-command-item": {
          "transition": "background-color var(--sprout-motion-fast) var(--sprout-motion-ease)"
        },
        ".sprout-command-item-check": {
          "transition": "opacity var(--sprout-motion-fast) var(--sprout-motion-ease)"
        },
        ".sprout-command-input-group": {
          "transition": "border-color var(--sprout-motion-fast) var(--sprout-motion-ease)"
        }
      }
    }
  },
  "docs": "Docs and examples: https://sprout.tulipfarm.ai/components/command/",
  "meta": {
    "source": "packages/sprout/src/components/command.tsx"
  }
}
