{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "select",
  "type": "registry:ui",
  "title": "Select",
  "description": "A flexible dropdown select component built on Radix UI primitives.",
  "dependencies": [
    "@radix-ui/react-dropdown-menu@^2.1.16",
    "@radix-ui/react-select@^2.2.6",
    "@remixicon/react@^4.9.0",
    "class-variance-authority@^0.7.1"
  ],
  "registryDependencies": [
    "https://wideset.co/r/dropdown-menu.json",
    "https://wideset.co/r/icon-button.json",
    "https://wideset.co/r/list-item.json",
    "https://wideset.co/r/motion.json",
    "https://wideset.co/r/search.json",
    "https://wideset.co/r/styles.json",
    "https://wideset.co/r/utils.json"
  ],
  "files": [
    {
      "path": "src/components/select/Select.context.ts",
      "type": "registry:ui",
      "target": "components/ui/wideset/select/Select.context.ts",
      "content": "'use client';\n\nimport { createContext, useContext } from 'react';\n\nimport type { SelectContextValue } from './Select.types';\n\nexport const SelectContext = createContext<SelectContextValue>({});\n\nexport const useSelectContext = () => useContext(SelectContext);\n"
    },
    {
      "path": "src/components/select/Select.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/select/Select.tsx",
      "content": "'use client';\n\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport { RiCloseLine } from '@remixicon/react';\nimport React, { useCallback, useMemo, useRef, useState } from 'react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport { useDefaultMotion } from '@/lib/wideset/motion/MotionProvider';\nimport { IconButton } from '../button/IconButton';\nimport { ListItem } from '../list-item/ListItem';\nimport { Search } from '../search/Search';\nimport { SelectContext } from './Select.context';\nimport type {\n  SelectGroupProps,\n  SelectItemIndicatorProps,\n  SelectItemTextProps,\n  SelectProps,\n  SelectValueProps,\n} from './Select.types';\nimport {\n  selectClearButtonIconVariants,\n  selectClearButtonVariants,\n  selectValuePrefixVariants,\n  selectValueRightPaddingVariants,\n} from './Select.variants';\nimport { SelectContent } from './SelectContent';\nimport { SelectLabel } from './SelectLabel';\nimport { SelectOption } from './SelectOption';\nimport { SelectSearch } from './SelectSearch';\nimport { SelectSeparator } from './SelectSeparator';\nimport { SelectTrigger } from './SelectTrigger';\n\nexport const Select = ({\n  options,\n  placeholder,\n  className,\n  variant = 'primary',\n  size,\n  preset,\n  hideArrow,\n  clearable,\n  id,\n  name,\n  children,\n  onClear,\n  onValueChange,\n  value,\n  defaultValue,\n  open,\n  defaultOpen,\n  onOpenChange,\n  dir,\n  required,\n  disabled,\n  hasSearch = false,\n  clearSelectionAriaLabel = 'Clear selection',\n  defaultMotion,\n  ...triggerProps\n}: SelectProps) => {\n  const motion = useDefaultMotion(defaultMotion);\n  const isControlled = value !== undefined;\n  const [internalValue, setInternalValue] = useState<string>(defaultValue ?? '');\n  const [searchQuery, setSearchQuery] = useState('');\n\n  const currentValue = isControlled ? value : internalValue;\n\n  const filteredOptions = useMemo(() => {\n    if (!hasSearch || !searchQuery) return options ?? [];\n    return (options ?? []).filter((o) => o.label.toLowerCase().includes(searchQuery.toLowerCase()));\n  }, [options, searchQuery, hasSearch]);\n\n  const searchInputRef = useRef<HTMLInputElement | null>(null);\n\n  const searchRef = useCallback((input: HTMLInputElement | null) => {\n    searchInputRef.current = input;\n    // setTimeout defers focus past Radix's FocusScope.onMountAutoFocus, which otherwise\n    // moves focus to the first/selected option and overrides our focus call.\n    if (input) setTimeout(() => input.focus(), 0);\n  }, []);\n\n  const handleValueChange = (newValue: string) => {\n    if (!isControlled) {\n      setInternalValue(newValue);\n    }\n    onValueChange?.(newValue);\n  };\n\n  const handleOpenChange = (nextOpen: boolean) => {\n    if (!nextOpen) {\n      setSearchQuery('');\n    }\n    onOpenChange?.(nextOpen);\n  };\n\n  const triggerRef = useRef<HTMLButtonElement>(null);\n\n  const handleClear = () => {\n    handleValueChange('');\n    handleOpenChange(false);\n    onClear?.();\n    triggerRef.current?.focus();\n  };\n\n  const handleSearchKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n    if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n      event.preventDefault();\n      const viewport = event.currentTarget.closest('[data-radix-select-viewport]');\n      const items = Array.from(\n        viewport?.querySelectorAll<HTMLElement>('[role=\"option\"]:not([aria-disabled=\"true\"])') ??\n          [],\n      );\n      if (items.length === 0) return;\n      (event.key === 'ArrowDown' ? items[0] : items[items.length - 1]).focus();\n      return;\n    }\n    event.stopPropagation();\n  };\n\n  const handleContentKeyDown = (event: React.KeyboardEvent) => {\n    if (\n      hasSearch &&\n      event.shiftKey &&\n      event.key === 'Tab' &&\n      event.target !== searchInputRef.current\n    ) {\n      event.preventDefault();\n      searchInputRef.current?.focus();\n      return;\n    }\n\n    if (hasSearch && event.key === 'ArrowUp' && event.target !== searchInputRef.current) {\n      const viewport = (event.currentTarget as HTMLElement).querySelector(\n        '[data-radix-select-viewport]',\n      );\n      const items = Array.from(\n        viewport?.querySelectorAll<HTMLElement>('[role=\"option\"]:not([aria-disabled=\"true\"])') ??\n          [],\n      );\n      if (items.length > 0 && event.target === items[0]) {\n        event.preventDefault();\n        searchInputRef.current?.focus();\n      }\n    }\n  };\n\n  const optionsList = filteredOptions.map((option) => (\n    <SelectOption\n      key={option.value}\n      value={option.value}\n      textValue={option.label}\n      disabled={option.disabled}\n      variant={option.variant}\n    >\n      {option.prefix && <ListItem.Prefix>{option.prefix}</ListItem.Prefix>}\n      <ListItem.Label>{option.label}</ListItem.Label>\n    </SelectOption>\n  ));\n\n  const hasValue = Boolean(currentValue) && currentValue !== '';\n  const selectedOption = options?.find((option) => option.value === currentValue);\n  const hasPrefix = Boolean(selectedOption?.prefix);\n  const hasClearButton = clearable && hasValue && !disabled;\n\n  const trigger = (\n    <SelectTrigger\n      ref={triggerRef}\n      className={className}\n      variant={variant}\n      size={size}\n      preset={preset}\n      disabled={disabled}\n      hideArrow={hideArrow}\n      id={id}\n      name={name}\n      {...triggerProps}\n    >\n      <div className={cn(hasPrefix ? 'flex h-full items-center' : 'truncate')}>\n        {hasPrefix && (\n          <div className={cn(selectValuePrefixVariants({ size }))} data-disabled={disabled}>\n            {selectedOption?.prefix}\n          </div>\n        )}\n        {hasValue ? (\n          <span\n            className={cn(\n              'min-w-0 flex-1',\n              hasClearButton && selectValueRightPaddingVariants({ size }),\n            )}\n          >\n            {selectedOption?.label}\n          </span>\n        ) : (\n          <SelectValue\n            placeholder={placeholder}\n            className={cn(\n              'min-w-0 flex-1',\n              hasClearButton && selectValueRightPaddingVariants({ size }),\n            )}\n          />\n        )}\n      </div>\n    </SelectTrigger>\n  );\n\n  const isComposable = React.Children.toArray(children).some(\n    (child) =>\n      React.isValidElement(child) && (child.type === SelectTrigger || child.type === SelectContent),\n  );\n\n  return (\n    <SelectContext.Provider value={{ motion }}>\n      {isComposable ? (\n        <SelectPrimitive.Root\n          onValueChange={handleValueChange}\n          value={currentValue}\n          open={open}\n          defaultOpen={defaultOpen}\n          onOpenChange={onOpenChange}\n          dir={dir}\n          required={required}\n          disabled={disabled}\n          name={name}\n        >\n          {children}\n        </SelectPrimitive.Root>\n      ) : (\n        <SelectPrimitive.Root\n          onValueChange={handleValueChange}\n          value={currentValue}\n          open={open}\n          defaultOpen={defaultOpen}\n          onOpenChange={handleOpenChange}\n          dir={dir}\n          required={required}\n          disabled={disabled}\n          name={name}\n        >\n          {clearable ? (\n            <div data-slot=\"select-wrapper\" className=\"flex items-center\">\n              {trigger}\n              {hasClearButton && (\n                <IconButton\n                  onClick={handleClear}\n                  aria-label={clearSelectionAriaLabel}\n                  defaultMotion={motion}\n                  icon={RiCloseLine}\n                  preset=\"ghost\"\n                  variant=\"secondary\"\n                  className={selectClearButtonVariants({ size, hideArrow })}\n                  iconClassName={selectClearButtonIconVariants({ size })}\n                />\n              )}\n            </div>\n          ) : (\n            trigger\n          )}\n          <SelectContent onKeyDown={handleContentKeyDown}>\n            {hasSearch && (\n              <>\n                <Search\n                  ref={searchRef}\n                  data-slot=\"select-search\"\n                  className=\"m-ws-5 w-auto shrink-0\"\n                  value={searchQuery}\n                  size=\"sm\"\n                  onChange={(e) => {\n                    setSearchQuery(e.target.value);\n                    setTimeout(() => searchInputRef.current?.focus(), 0);\n                  }}\n                  onClear={() => {\n                    setSearchQuery('');\n                    setTimeout(() => searchInputRef.current?.focus(), 0);\n                  }}\n                  onKeyDown={handleSearchKeyDown}\n                  defaultMotion={motion}\n                />\n                <SelectSeparator className=\"-mx-ws-3 shrink-0\" />\n              </>\n            )}\n            {optionsList}\n          </SelectContent>\n        </SelectPrimitive.Root>\n      )}\n    </SelectContext.Provider>\n  );\n};\n\nSelect.displayName = 'Select';\n\nexport const SelectGroup = React.forwardRef<\n  React.ComponentRef<typeof SelectPrimitive.Group>,\n  SelectGroupProps\n>((props, ref) => <SelectPrimitive.Group ref={ref} data-slot=\"select-group\" {...props} />);\nSelectGroup.displayName = 'Select.Group';\nSelect.Group = SelectGroup;\nexport const SelectValue = React.forwardRef<\n  React.ComponentRef<typeof SelectPrimitive.Value>,\n  SelectValueProps\n>((props, ref) => <SelectPrimitive.Value ref={ref} data-slot=\"select-value\" {...props} />);\nSelectValue.displayName = 'Select.Value';\nSelect.Value = SelectValue;\nexport const SelectItemText = React.forwardRef<\n  React.ComponentRef<typeof SelectPrimitive.ItemText>,\n  SelectItemTextProps\n>((props, ref) => <SelectPrimitive.ItemText ref={ref} data-slot=\"select-item-text\" {...props} />);\nSelectItemText.displayName = 'Select.ItemText';\nSelect.ItemText = SelectItemText;\nexport const SelectItemIndicator = React.forwardRef<\n  React.ComponentRef<typeof SelectPrimitive.ItemIndicator>,\n  SelectItemIndicatorProps\n>((props, ref) => (\n  <SelectPrimitive.ItemIndicator ref={ref} data-slot=\"select-item-indicator\" {...props} />\n));\nSelectItemIndicator.displayName = 'Select.ItemIndicator';\nSelect.ItemIndicator = SelectItemIndicator;\nSelect.Content = SelectContent;\nSelect.Option = SelectOption;\nSelect.Label = SelectLabel;\nSelect.Search = SelectSearch;\nSelect.Separator = SelectSeparator;\nSelect.Trigger = SelectTrigger;\n"
    },
    {
      "path": "src/components/select/Select.types.ts",
      "type": "registry:ui",
      "target": "components/ui/wideset/select/Select.types.ts",
      "content": "import type * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport type * as SelectPrimitive from '@radix-ui/react-select';\nimport type { VariantProps } from 'class-variance-authority';\nimport type * as React from 'react';\n\nimport type { MotionProps } from '@/lib/wideset/motion/Motion.types';\nimport type { ListItemProps } from '../list-item/ListItem.types';\nimport type { selectContentVariants, selectTriggerVariants } from './Select.variants';\n\n/** Props for the Radix Select root, which holds open and value state and renders no DOM. */\nexport type SelectRootProps = React.ComponentProps<typeof SelectPrimitive.Root>;\n\nexport type SelectContextValue = {\n  motion?: boolean;\n};\n\n/** The control that opens or toggles the associated content. */\nexport type SelectTriggerProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger> &\n  MotionProps & {\n    /** Controls the height, padding, and typography size of the trigger. */\n    size?: VariantProps<typeof selectTriggerVariants>['size'];\n    /** Visual style preset. `border` adds a visible border and background; `ghost` uses a transparent background. */\n    preset?: VariantProps<typeof selectTriggerVariants>['preset'];\n    /** Color variant. `danger` applies error styling for form validation feedback. */\n    variant?: VariantProps<typeof selectTriggerVariants>['variant'];\n    /** Whether to hide the dropdown arrow icon on the right side of the trigger. */\n    hideArrow?: boolean;\n    /** Placeholder text shown when no value is selected. Also used as the accessible label fallback. */\n    placeholder?: string;\n    /** HTML `id` attribute forwarded to the trigger element for form label association. */\n    id?: string;\n    /** HTML `name` attribute forwarded for form submission. */\n    name?: string;\n    /** Internal flag — set to `false` to render a plain `<button>` instead of the Radix Select trigger (used inside Dropdown). */\n    shouldUsePrimitive?: boolean;\n  };\n\n/** The content surface rendered within `Select`. */\nexport type SelectContentProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content> &\n  MotionProps & {\n    /** Controls how the dropdown is positioned relative to the trigger. */\n    position?: VariantProps<typeof selectContentVariants>['position'];\n    /** Internal flag — set to `false` to render as a `DropdownMenu.Content` instead of the Radix Select portal (used inside Dropdown). */\n    shouldUsePrimitive?: boolean;\n    /** DOM node to portal the dropdown content into. Defaults to `document.body`. */\n    portalContainer?:\n      | React.ComponentProps<typeof DropdownMenuPrimitive.Portal>['container']\n      | React.ComponentProps<typeof SelectPrimitive.Portal>['container'];\n  };\n\n/** Props shared by both option renderings. */\ntype SelectOptionSharedProps = MotionProps & {\n  /** Color variant applied to the option row. `danger` renders red text for destructive choices. */\n  variant?: ListItemProps['variant'];\n  /** Whether to show a checkmark indicator on the selected option. */\n  shouldDisplayCheckmark?: boolean;\n};\n\n/** Option rendered as a Radix Select item (the default). */\ntype SelectOptionPrimitiveProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item> &\n  SelectOptionSharedProps & {\n    /** Internal flag — omit or set to `true` to use the Radix Select item primitive. */\n    shouldUsePrimitive?: true;\n  };\n\n/** Option rendered as a plain `<div>`, used inside Dropdown. */\ntype SelectOptionNonPrimitiveProps = React.ComponentPropsWithoutRef<'div'> &\n  SelectOptionSharedProps & {\n    /** Internal flag — set to `false` to render as a plain `<div>` (used inside Dropdown). */\n    shouldUsePrimitive: false;\n    /** Disables interaction with the control. */\n    disabled?: boolean;\n    value?: never;\n    textValue?: never;\n  };\n\n/** A selectable option within the dropdown. */\nexport type SelectOptionProps = SelectOptionPrimitiveProps | SelectOptionNonPrimitiveProps;\n\n/** The option row content. */\nexport type SelectOptionBodyProps = React.ComponentPropsWithoutRef<'div'> &\n  MotionProps & {\n    /** Color variant applied to the list item row. */\n    variant?: SelectOptionProps['variant'];\n    /** Whether the option is disabled visually and functionally. */\n    disabled?: boolean;\n    /** Whether to render the checkmark indicator when the option is selected. */\n    shouldDisplayCheckmark?: boolean;\n  };\n\n/** The content area within an option. */\nexport type SelectOptionContentProps = Pick<SelectOptionProps, 'children'> &\n  Omit<React.ComponentPropsWithoutRef<'div'>, 'children'>;\n\n/** Props passed to the Radix Select item when the option uses the primitive. */\nexport type SelectPrimitiveItemProps = Omit<\n  React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>,\n  'children' | 'className' | 'disabled' | 'value' | 'textValue'\n>;\n\n/** Props passed to the plain `<div>` when the option renders outside Radix Select. */\nexport type SelectOptionBodyElementProps = Omit<\n  React.ComponentPropsWithoutRef<'div'>,\n  'children' | 'className' | 'disabled'\n>;\n\n/** The text label associated with `Select`. */\nexport type SelectLabelProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>;\n\n/** A visual separator between groups of items. */\nexport type SelectSeparatorProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>;\n\n/** Props for `Select.Group` — the Radix Select group. */\nexport type SelectGroupProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Group>;\n\n/** Props for `Select.Value` — renders the selected value inside the trigger. */\nexport type SelectValueProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Value>;\n\n/** Props for `Select.ItemText`. */\nexport type SelectItemTextProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.ItemText>;\n\n/** Props for `Select.ItemIndicator`. */\nexport type SelectItemIndicatorProps = React.ComponentPropsWithoutRef<\n  typeof SelectPrimitive.ItemIndicator\n>;\n\n/** Search input inside the dropdown for filtering options. */\nexport type SelectSearchProps = {\n  /** Current search query value for controlled usage. */\n  value?: string;\n  /** Called when the search input value changes. */\n  onChange?: React.ChangeEventHandler<HTMLInputElement>;\n  /** Called when the clear button inside the search input is clicked. */\n  onClear?: () => void;\n  /** Additional CSS classes applied to the search wrapper. */\n  className?: string;\n};\n\n/** Button that scrolls the option list up when it overflows. */\nexport type SelectScrollUpButtonProps = React.ComponentPropsWithoutRef<\n  typeof SelectPrimitive.ScrollUpButton\n>;\n\n/** Button that scrolls the option list down when it overflows. */\nexport type SelectScrollDownButtonProps = React.ComponentPropsWithoutRef<\n  typeof SelectPrimitive.ScrollDownButton\n>;\n\nexport type SelectOptionType<T extends Record<string, unknown> = Record<string, unknown>> = {\n  /** Unique identifier submitted to `onValueChange` when this option is selected. */\n  value: React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>['value'];\n  /** Display text shown in the dropdown list and in the trigger once selected. */\n  label: string;\n  /** Whether this option is disabled and unselectable. */\n  disabled?: boolean;\n  /** Optional element (icon, avatar, or text) rendered before the label. */\n  prefix?: React.ReactNode;\n  /** Color variant for the option row. `danger` renders red text for destructive choices. */\n  variant?: ListItemProps['variant'];\n} & T;\n\n/** A dropdown selection control for one value. */\nexport type SelectProps = {\n  /** Sub-components for composable usage (`Select.Trigger`, `Select.Content`, `Select.Option`, etc.). Use instead of `options` when you need grouped options, custom layouts, or full rendering control. */\n  children?: React.ReactNode;\n  /** Array of options to display in the dropdown. Each item requires `value` and `label`. */\n  options?: SelectOptionType[];\n  /** Placeholder text shown in the trigger when no option is selected. */\n  placeholder?: string;\n  /** Additional CSS classes applied to the trigger element. Width utilities (e.g. `w-[20rem]`) override the default width. */\n  className?: string;\n  /** Controls the height, padding, and typography size of the trigger. */\n  size?: SelectTriggerProps['size'];\n  /** Visual style preset. `border` adds a visible border and background; `ghost` uses a transparent background. */\n  preset?: SelectTriggerProps['preset'];\n  /** Color variant. `danger` applies error styling for form validation feedback. */\n  variant?: SelectTriggerProps['variant'];\n  /** Whether to hide the dropdown arrow icon on the right side of the trigger. */\n  hideArrow?: boolean;\n  /** Whether to show a clear button in the trigger when a value is selected. */\n  clearable?: boolean;\n  /** Called when the clear button is clicked. Use for custom reset logic beyond clearing the value. */\n  onClear?: () => void;\n  /** HTML `id` attribute for the trigger element, useful for form label association. */\n  id?: string;\n  /** HTML `name` attribute forwarded for form submission. */\n  name?: string;\n  /** Whether to show a search input at the top of the dropdown that filters options by label. */\n  hasSearch?: boolean;\n  /** Accessible label for the clear-selection button. Defaults to `'Clear selection'`. */\n  clearSelectionAriaLabel?: string;\n} & MotionProps &\n  SelectRootProps &\n  Omit<\n    React.HTMLAttributes<HTMLButtonElement>,\n    'onValueChange' | 'value' | 'defaultValue' | 'disabled' | 'onClear' | 'onChange' | 'name' | 'id'\n  >;\n"
    },
    {
      "path": "src/components/select/Select.variants.ts",
      "type": "registry:ui",
      "target": "components/ui/wideset/select/Select.variants.ts",
      "content": "import { cva } from 'class-variance-authority';\nimport { cn } from '@/lib/wideset/utils';\n\nimport { hoverTintMotion, pressMotion } from '@/lib/wideset/motion/recipes';\n\nexport const selectTriggerVariants = cva(\n  cn(\n    'text-ws-static-strong relative flex w-[16rem] cursor-pointer items-center justify-between overflow-hidden outline-hidden',\n    'data-[placeholder]:text-ws-static-subtle',\n    'data-[disabled=true]:text-ws-static-subtle data-[disabled=true]:cursor-default',\n    'data-[disabled=true]:border-ws-dynamic-secondary-disabled data-[disabled=true]:bg-ws-static-alpha-subtle',\n    'data-[disabled=true]:hover:not-focus-visible:border-ws-dynamic-secondary-disabled',\n    'data-[disabled=true]:active:border-ws-dynamic-secondary-disabled',\n    'data-[disabled=true]:focus-visible:not-active:border-ws-dynamic-secondary-disabled',\n  ),\n  {\n    variants: {\n      preset: {\n        border: cn(\n          'bg-ws-static-highlight-base border-ws-dynamic-secondary-default shadow-ws-forms-base border',\n        ),\n        ghost: cn('border border-transparent bg-transparent'),\n      },\n      variant: {\n        primary: cn(\n          'hover:not-focus-visible:not-data-[disabled=true]:border-ws-dynamic-secondary-hover',\n          'active:not-data-[disabled=true]:border-ws-dynamic-secondary-pressed',\n          'focus-visible:not-active:border-ws-dynamic-primary-strong-default focus-visible:not-active:shadow-ws-forms-active',\n        ),\n        danger: cn(\n          'hover:not-focus-visible:not-data-[disabled=true]:border-ws-dynamic-danger-strong-hover',\n          'active:not-data-[disabled=true]:border-ws-dynamic-danger-strong-pressed',\n          'focus-visible:not-active:border-ws-dynamic-danger-strong-default focus-visible:not-active:shadow-ws-forms-active-danger',\n        ),\n      },\n      size: {\n        sm: 'typography-label-sm h-ws-forms-sm max-h-ws-forms-sm rounded-ws-control-lg px-ws-7',\n        md: 'typography-label-sm h-ws-forms-md max-h-ws-forms-md rounded-ws-control-lg px-ws-9',\n        lg: 'typography-label-md h-ws-forms-lg max-h-ws-forms-lg rounded-ws-control-xl px-ws-9',\n      },\n    },\n    compoundVariants: [\n      {\n        preset: 'border',\n        variant: 'danger',\n        className: 'border-ws-dynamic-danger-strong-default',\n      },\n      {\n        preset: 'ghost',\n        variant: 'danger',\n        className: 'not-data-[disabled=true]:border-ws-dynamic-danger-strong-default',\n      },\n    ],\n    defaultVariants: {\n      preset: 'border',\n      variant: 'primary',\n      size: 'md',\n    },\n  },\n);\n\nexport const selectTriggerMotionVariants = cva('', {\n  variants: {\n    enabled: { true: cn(hoverTintMotion, pressMotion), false: '' },\n  },\n  defaultVariants: { enabled: true },\n});\n\nexport const selectTriggerIconVariants = cva(\n  'text-ws-dynamic-secondary-default data-[disabled=true]:text-ws-dynamic-secondary-disabled size-ws-9 shrink-0',\n  {\n    variants: {\n      size: {\n        sm: '-mr-ws-3 ml-ws-5',\n        md: '-mr-ws-4 ml-ws-6',\n        lg: '-mr-ws-3 ml-ws-7',\n      },\n    },\n    defaultVariants: {\n      size: 'md',\n    },\n  },\n);\n\nexport const selectTriggerSuffixVariants = cva('flex h-full shrink-0 items-center justify-center', {\n  variants: {\n    size: {\n      sm: '-mr-ws-7 w-ws-14',\n      md: '-mr-ws-9 w-ws-16',\n      lg: '-mr-ws-9 w-ws-18',\n    },\n    preset: {\n      border: 'border-ws-static-base border-l',\n      ghost: '',\n    },\n  },\n  defaultVariants: {\n    size: 'md',\n    preset: 'border',\n  },\n});\n\nexport const selectTriggerSuffixIconVariants = cva(\n  'text-ws-dynamic-secondary-default data-[disabled=true]:text-ws-dynamic-secondary-disabled shrink-0',\n  {\n    variants: {\n      size: {\n        sm: 'size-ws-8',\n        md: 'size-ws-9',\n        lg: 'size-ws-11',\n      },\n    },\n    defaultVariants: {\n      size: 'md',\n    },\n  },\n);\n\nexport const selectContentVariants = cva(\n  cn(\n    'rounded-ws-container-sm z-ws-popout overflow-hidden',\n    'bg-ws-static-overlay shadow-ws-medium',\n  ),\n  {\n    variants: {\n      position: {\n        popper: cn(\n          'data-[side=bottom]:translate-y-ws-1 data-[side=left]:-translate-x-ws-1 data-[side=right]:translate-x-ws-1 data-[side=top]:-translate-y-ws-1',\n          // Width floor: never narrower than the trigger nor the Size/28 menu\n          // minimum; grows freely with content past that.\n          'min-w-[max(var(--radix-select-trigger-width),var(--spacing-ws-28))]',\n        ),\n        'item-aligned': '',\n      },\n    },\n    defaultVariants: {\n      position: 'popper',\n    },\n  },\n);\n\nexport const selectContentMotionVariants = cva('', {\n  variants: {\n    enabled: {\n      true: cn(\n        'origin-radix-select',\n        'transition-none',\n        'animate-in fade-in-0 zoom-in-95',\n        'duration-(--ws-motion-duration-fast) ease-(--ws-motion-ease-smooth-out)',\n        'data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95',\n        'data-[state=closed]:duration-(--ws-motion-duration-quick)',\n      ),\n      false: '',\n    },\n  },\n  defaultVariants: { enabled: true },\n});\n\nexport const selectClearButtonVariants = cva('relative shrink-0 rounded-full p-0', {\n  variants: {\n    size: {\n      sm: 'size-ws-11',\n      md: 'size-ws-13',\n      lg: 'size-ws-14',\n    },\n    hideArrow: {\n      true: '',\n      false: '',\n    },\n  },\n  compoundVariants: [\n    {\n      size: 'sm',\n      hideArrow: true,\n      className:\n        'mr-[calc(var(--spacing-ws-6)+1px)] -ml-[calc(var(--spacing-ws-6)+var(--spacing-ws-11)+1px)]',\n    },\n    {\n      size: 'sm',\n      hideArrow: false,\n      className:\n        'mr-[calc(var(--spacing-ws-13)+1px)] -ml-[calc(var(--spacing-ws-13)+var(--spacing-ws-11)+1px)]',\n    },\n    {\n      size: 'md',\n      hideArrow: true,\n      className:\n        'mr-[calc(var(--spacing-ws-7)+1px)] -ml-[calc(var(--spacing-ws-7)+var(--spacing-ws-13)+1px)]',\n    },\n    {\n      size: 'md',\n      hideArrow: false,\n      className:\n        'mr-[calc(var(--spacing-ws-15)+1px)] -ml-[calc(var(--spacing-ws-15)+var(--spacing-ws-13)+1px)]',\n    },\n    {\n      size: 'lg',\n      hideArrow: true,\n      className:\n        'mr-[calc(var(--spacing-ws-7)+1px)] -ml-[calc(var(--spacing-ws-7)+var(--spacing-ws-14)+1px)]',\n    },\n    {\n      size: 'lg',\n      hideArrow: false,\n      className:\n        'mr-[calc(var(--spacing-ws-17)+1px)] -ml-[calc(var(--spacing-ws-17)+var(--spacing-ws-14)+1px)]',\n    },\n  ],\n  defaultVariants: {\n    size: 'md',\n    hideArrow: false,\n  },\n});\n\nexport const selectClearButtonIconVariants = cva('w-auto p-0', {\n  variants: {\n    size: {\n      sm: 'size-ws-9',\n      md: 'size-ws-9',\n      lg: 'size-ws-11',\n    },\n  },\n  defaultVariants: {\n    size: 'md',\n  },\n});\n\nexport const selectValueLeftPaddingVariants = cva('', {\n  variants: {\n    size: {\n      sm: 'pl-ws-5',\n      md: 'pl-ws-7',\n      lg: 'pl-ws-7',\n    },\n  },\n  defaultVariants: {\n    size: 'md',\n  },\n});\n\nexport const selectValueRightPaddingVariants = cva('', {\n  variants: {\n    size: {\n      sm: 'pr-ws-11',\n      md: 'pr-ws-16',\n      lg: 'pr-ws-19',\n    },\n  },\n  defaultVariants: {\n    size: 'md',\n  },\n});\n\nexport const selectValuePrefixVariants = cva(\n  'text-ws-static-subtle border-ws-static-base data-[disabled=true]:border-ws-static-base flex h-full shrink-0 items-center justify-center border-r data-[disabled=true]:opacity-50',\n  {\n    variants: {\n      size: {\n        sm: 'mr-ws-5 -ml-ws-6 px-ws-4',\n        md: 'mr-ws-7 -ml-ws-8 px-ws-5',\n        lg: 'mr-ws-7 -ml-ws-8 px-ws-7',\n      },\n    },\n    defaultVariants: {\n      size: 'md',\n    },\n  },\n);\n"
    },
    {
      "path": "src/components/select/SelectContent.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/select/SelectContent.tsx",
      "content": "'use client';\n\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport * as React from 'react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport { useDefaultMotion } from '@/lib/wideset/motion/MotionProvider';\nimport { DropdownMenu } from '../dropdown/DropdownMenu';\nimport { useSelectContext } from './Select.context';\nimport type { SelectContentProps } from './Select.types';\nimport { selectContentMotionVariants, selectContentVariants } from './Select.variants';\n\nexport const SelectContent = React.forwardRef<\n  React.ComponentRef<typeof SelectPrimitive.Content>,\n  SelectContentProps\n>(\n  (\n    {\n      className,\n      children,\n      position = 'popper',\n      shouldUsePrimitive = true,\n      portalContainer,\n      defaultMotion,\n      ...props\n    },\n    ref,\n  ) => {\n    const { motion: selectMotion } = useSelectContext();\n    const motion = useDefaultMotion(defaultMotion ?? selectMotion);\n\n    if (!shouldUsePrimitive) {\n      return (\n        <DropdownMenu.Content\n          ref={ref as React.Ref<React.ComponentRef<typeof DropdownMenu.Content>>}\n          data-slot=\"select-content\"\n          portalContainer={portalContainer}\n          defaultMotion={motion}\n          className={cn(\n            // Figma's Dropdown Menu container: Gap/3 (4px) inset, Gap/0 between rows.\n            // Width floor: never narrower than the trigger nor the Size/28 menu\n            // minimum (min-width beats DropdownMenu.Content's max-w cap).\n            'p-ws-3 flex max-h-[18rem] min-w-[max(var(--radix-dropdown-menu-trigger-width),var(--spacing-ws-28))] flex-col overflow-auto',\n            className,\n          )}\n          {...props}\n        >\n          {children}\n        </DropdownMenu.Content>\n      );\n    }\n\n    // Portals to document.body by default; z-index comes from selectContentVariants (z-ws-popout),\n    // so the list clears Modal (z-ws-modal) and Sidepanel (z-ws-drawer) with no setup. Do not\n    // point portalContainer at a modal: inside it the list is clipped by the modal's overflow.\n    return (\n      <SelectPrimitive.Portal container={portalContainer}>\n        <SelectPrimitive.Content\n          ref={ref}\n          data-slot=\"select-content\"\n          className={cn(\n            selectContentVariants({ position }),\n            selectContentMotionVariants({ enabled: motion }),\n            'max-h-[var(--radix-select-content-available-height)]',\n            className,\n          )}\n          sideOffset={12}\n          position={position}\n          {...props}\n        >\n          <SelectPrimitive.Viewport className=\"p-ws-3 flex max-h-[18rem] flex-col overflow-y-auto\">\n            {children}\n          </SelectPrimitive.Viewport>\n        </SelectPrimitive.Content>\n      </SelectPrimitive.Portal>\n    );\n  },\n);\n\nSelectContent.displayName = 'Select.Content';\n"
    },
    {
      "path": "src/components/select/SelectLabel.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/select/SelectLabel.tsx",
      "content": "'use client';\n\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport * as React from 'react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport type { SelectLabelProps } from './Select.types';\n\nexport const SelectLabel = React.forwardRef<\n  React.ComponentRef<typeof SelectPrimitive.Label>,\n  SelectLabelProps\n>(({ className, ...props }, ref) => (\n  <SelectPrimitive.Label\n    ref={ref}\n    data-slot=\"select-label\"\n    // Label/Small + Font/Weight/Normal + Dynamic/Text/Secondary/Default to match\n    // DropdownMenu.Label, rather than the Figma Group component's\n    // Caption/Strong/Medium + Static/Text/Subtle.\n    className={cn(\n      'text-ws-dynamic-secondary-default typography-label-sm px-ws-5 py-ws-3',\n      className,\n    )}\n    {...props}\n  />\n));\n\nSelectLabel.displayName = 'Select.Label';\n"
    },
    {
      "path": "src/components/select/SelectOption.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/select/SelectOption.tsx",
      "content": "'use client';\n\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport * as React from 'react';\n\nimport { useDefaultMotion } from '@/lib/wideset/motion/MotionProvider';\nimport { useSelectContext } from './Select.context';\nimport type {\n  SelectOptionBodyElementProps,\n  SelectOptionProps,\n  SelectPrimitiveItemProps,\n} from './Select.types';\nimport { SelectOptionBody } from './SelectOptionBody';\nimport { SelectOptionContent } from './SelectOptionContent';\n\nexport const SelectOption = React.forwardRef<\n  React.ComponentRef<typeof SelectPrimitive.Item>,\n  SelectOptionProps\n>((optionProps, ref) => {\n  const {\n    className,\n    children,\n    variant,\n    disabled,\n    shouldDisplayCheckmark = true,\n    shouldUsePrimitive = true,\n    value,\n    textValue,\n    defaultMotion,\n    ...props\n  } = optionProps;\n\n  const { motion: selectMotion } = useSelectContext();\n  const motion = useDefaultMotion(defaultMotion ?? selectMotion);\n\n  const primitiveProps = props as SelectPrimitiveItemProps;\n  const optionBodyProps = props as SelectOptionBodyElementProps;\n\n  return shouldUsePrimitive ? (\n    <SelectPrimitive.Item\n      ref={ref}\n      data-slot=\"select-option\"\n      value={value as React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>['value']}\n      textValue={textValue}\n      disabled={disabled}\n      {...primitiveProps}\n      asChild\n    >\n      <SelectOptionBody\n        variant={variant}\n        disabled={disabled}\n        shouldDisplayCheckmark={shouldDisplayCheckmark}\n        className={className}\n        defaultMotion={motion}\n      >\n        <SelectPrimitive.ItemText asChild>\n          <SelectOptionContent>{children}</SelectOptionContent>\n        </SelectPrimitive.ItemText>\n      </SelectOptionBody>\n    </SelectPrimitive.Item>\n  ) : (\n    <SelectOptionBody\n      ref={ref as React.Ref<HTMLDivElement>}\n      data-slot=\"select-option\"\n      variant={variant}\n      disabled={disabled}\n      shouldDisplayCheckmark={shouldDisplayCheckmark}\n      className={className}\n      defaultMotion={motion}\n      {...optionBodyProps}\n    >\n      <SelectOptionContent>{children}</SelectOptionContent>\n    </SelectOptionBody>\n  );\n});\n\nSelectOption.displayName = 'Select.Option';\n"
    },
    {
      "path": "src/components/select/SelectOptionBody.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/select/SelectOptionBody.tsx",
      "content": "'use client';\n\nimport * as React from 'react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport { ListItem } from '../list-item/ListItem';\nimport type { SelectOptionBodyProps } from './Select.types';\n\nexport const SelectOptionBody = React.forwardRef<HTMLDivElement, SelectOptionBodyProps>(\n  ({ className, children, variant, disabled, shouldDisplayCheckmark = true, ...props }, ref) => (\n    <ListItem\n      data-slot=\"select-option-body\"\n      ref={ref}\n      variant={variant}\n      disabled={disabled}\n      shouldDisplayCheckmark={shouldDisplayCheckmark}\n      className={cn('min-h-ws-14 self-stretch', className)}\n      {...props}\n    >\n      {children}\n    </ListItem>\n  ),\n);\n\nSelectOptionBody.displayName = 'Select.OptionBody';\n"
    },
    {
      "path": "src/components/select/SelectOptionContent.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/select/SelectOptionContent.tsx",
      "content": "'use client';\n\nimport * as React from 'react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport type { SelectOptionContentProps } from './Select.types';\n\nexport const SelectOptionContent = React.forwardRef<HTMLDivElement, SelectOptionContentProps>(\n  ({ children, className, ...props }, ref) => (\n    <div\n      data-slot=\"select-option-content\"\n      ref={ref}\n      className={cn(\n        'gap-ws-5 flex min-w-0 flex-1 flex-row items-center overflow-hidden',\n        className,\n      )}\n      {...props}\n    >\n      {children}\n    </div>\n  ),\n);\n\nSelectOptionContent.displayName = 'SelectOptionContent';\n"
    },
    {
      "path": "src/components/select/SelectSearch.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/select/SelectSearch.tsx",
      "content": "'use client';\n\nimport type React from 'react';\nimport { useCallback } from 'react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport { Search } from '../search/Search';\nimport type { SelectSearchProps } from './Select.types';\n\nexport const SelectSearch = ({ value, onChange, onClear, className }: SelectSearchProps) => {\n  const searchRef = useCallback((input: HTMLInputElement | null) => {\n    input?.focus();\n  }, []);\n\n  const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n    if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n      event.preventDefault();\n      const viewport = event.currentTarget.closest('[data-radix-select-viewport]');\n      const items = Array.from(\n        viewport?.querySelectorAll<HTMLElement>('[role=\"option\"]:not([aria-disabled=\"true\"])') ??\n          [],\n      );\n      if (items.length === 0) return;\n      (event.key === 'ArrowDown' ? items[0] : items[items.length - 1]).focus();\n      return;\n    }\n    event.stopPropagation();\n  };\n\n  return (\n    <Search\n      ref={searchRef}\n      data-slot=\"select-search\"\n      className={cn('m-ws-5 w-auto shrink-0', className)}\n      value={value}\n      size=\"sm\"\n      onChange={onChange}\n      onClear={onClear}\n      onKeyDown={handleKeyDown}\n    />\n  );\n};\n\nSelectSearch.displayName = 'Select.Search';\n"
    },
    {
      "path": "src/components/select/SelectSeparator.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/select/SelectSeparator.tsx",
      "content": "'use client';\n\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport * as React from 'react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport type { SelectSeparatorProps } from './Select.types';\n\nexport const SelectSeparator = React.forwardRef<\n  React.ComponentRef<typeof SelectPrimitive.Separator>,\n  SelectSeparatorProps\n>(({ className, ...props }, ref) => (\n  <SelectPrimitive.Separator\n    ref={ref}\n    data-slot=\"select-separator\"\n    className={cn('border-ws-static-base my-ws-3 border-t', className)}\n    {...props}\n  />\n));\n\nSelectSeparator.displayName = 'Select.Separator';\n"
    },
    {
      "path": "src/components/select/SelectTrigger.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/select/SelectTrigger.tsx",
      "content": "'use client';\n\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport { RiArrowDownSLine } from '@remixicon/react';\nimport * as React from 'react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport { useDefaultMotion } from '@/lib/wideset/motion/MotionProvider';\nimport { useSelectContext } from './Select.context';\nimport type { SelectTriggerProps } from './Select.types';\nimport {\n  selectTriggerIconVariants,\n  selectTriggerMotionVariants,\n  selectTriggerVariants,\n} from './Select.variants';\n\nexport const SelectTrigger = React.forwardRef<\n  React.ComponentRef<typeof SelectPrimitive.Trigger>,\n  SelectTriggerProps\n>(\n  (\n    {\n      className,\n      children,\n      size,\n      preset,\n      variant = 'primary',\n      hideArrow,\n      placeholder,\n      shouldUsePrimitive = true,\n      defaultMotion,\n      'aria-label': ariaLabel,\n      ...props\n    },\n    ref,\n  ) => {\n    const { motion: selectMotion } = useSelectContext();\n    const motion = useDefaultMotion(defaultMotion ?? selectMotion);\n    const triggerClassName = cn(\n      selectTriggerVariants({ size, preset, variant }),\n      selectTriggerMotionVariants({ enabled: motion }),\n      className,\n    );\n\n    const icon = (\n      <RiArrowDownSLine\n        aria-hidden=\"true\"\n        focusable=\"false\"\n        className={cn(selectTriggerIconVariants({ size }))}\n        data-disabled={props.disabled}\n      />\n    );\n\n    if (!shouldUsePrimitive) {\n      return (\n        <button\n          ref={ref}\n          data-slot=\"select-trigger\"\n          aria-label={ariaLabel}\n          className={triggerClassName}\n          data-disabled={props.disabled}\n          data-placeholder={!children && placeholder ? '' : undefined}\n          {...props}\n        >\n          {children || placeholder}\n          {!hideArrow && icon}\n        </button>\n      );\n    }\n\n    return (\n      <SelectPrimitive.Trigger\n        ref={ref}\n        data-slot=\"select-trigger\"\n        aria-label={ariaLabel}\n        className={triggerClassName}\n        data-disabled={props.disabled}\n        data-danger={variant === 'danger'}\n        {...props}\n      >\n        {children || (placeholder && <SelectPrimitive.Value placeholder={placeholder} />)}\n        {!hideArrow && <SelectPrimitive.Icon asChild>{icon}</SelectPrimitive.Icon>}\n      </SelectPrimitive.Trigger>\n    );\n  },\n);\n\nSelectTrigger.displayName = 'Select.Trigger';\n"
    }
  ],
  "meta": {
    "version": "1.0.0",
    "commit": "8bb3627"
  }
}
