{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "select",
  "title": "select",
  "dependencies": [
    "@radix-ui/react-select",
    "class-variance-authority@^0.7"
  ],
  "registryDependencies": [
    "@dwellir/dwellir-theme",
    "@dwellir/utils",
    "@dwellir/input-modality",
    "@dwellir/portal-container",
    "@dwellir/rune-icons"
  ],
  "files": [
    {
      "path": "components/ui/select.tsx",
      "content": "'use client';\n\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport type { ComponentProps } from 'react';\nimport { RuneCheck, RuneChevronDown, RuneChevronUp } from '@/components/brand/rune-icons';\nimport { useInputModality } from '@/lib/input-modality';\nimport { usePortalContainer } from '@/lib/portal-container';\nimport { cn } from '@/lib/utils';\n\nfunction Select(props: ComponentProps<typeof SelectPrimitive.Root>) {\n  return <SelectPrimitive.Root data-slot=\"select\" {...props} />;\n}\n\nfunction SelectGroup(props: ComponentProps<typeof SelectPrimitive.Group>) {\n  return <SelectPrimitive.Group data-slot=\"select-group\" {...props} />;\n}\n\nfunction SelectValue(props: ComponentProps<typeof SelectPrimitive.Value>) {\n  return <SelectPrimitive.Value data-slot=\"select-value\" {...props} />;\n}\n\n/**\n * The select look, with SelectTrigger's 44px coarse tap (half-gap capped).\n * Pass touch: false where a larger tap area or an input group already holds the trigger.\n */\nconst selectTriggerVariants = cva('ui-select-trigger w-fit text-lg md:pointer-fine:text-sm', {\n  variants: {\n    size: {\n      default: 'h-10 pointer-coarse:h-11 pr-3 pl-4',\n      sm: 'h-8 pr-2.5 pl-3.5',\n    },\n    touch: { true: 'ui-select-trigger-touch', false: '' },\n  },\n  defaultVariants: { size: 'default', touch: true },\n});\n\nfunction SelectTrigger({\n  className,\n  size,\n  children,\n  ...props\n}: ComponentProps<typeof SelectPrimitive.Trigger> &\n  Pick<VariantProps<typeof selectTriggerVariants>, 'size'>) {\n  useInputModality();\n  return (\n    <SelectPrimitive.Trigger\n      data-slot=\"select-trigger\"\n      data-size={size ?? 'default'}\n      className={cn(selectTriggerVariants({ size }), className)}\n      {...props}\n    >\n      {children}\n      <SelectPrimitive.Icon asChild>\n        <RuneChevronDown className=\"size-4 text-muted-foreground\" />\n      </SelectPrimitive.Icon>\n    </SelectPrimitive.Trigger>\n  );\n}\n\nfunction SelectContent({\n  className,\n  children,\n  position = 'popper',\n  collisionPadding = 12,\n  container,\n  ...props\n}: ComponentProps<typeof SelectPrimitive.Content> &\n  /* The element to render into; else the PortalContainer landmark, else the page body. */\n  Pick<ComponentProps<typeof SelectPrimitive.Portal>, 'container'>) {\n  return (\n    <SelectPrimitive.Portal container={usePortalContainer(container)}>\n      <SelectPrimitive.Content\n        data-slot=\"select-content\"\n        position={position}\n        collisionPadding={collisionPadding}\n        className={cn(\n          'ui-popup-motion relative z-popover max-h-(--radix-select-content-available-height) min-w-44 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-2xl border border-border bg-popover text-popover-foreground shadow-popover data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95',\n          position === 'popper' &&\n            'data-[side=bottom]:translate-y-1.5 data-[side=left]:-translate-x-1.5 data-[side=right]:translate-x-1.5 data-[side=top]:-translate-y-1.5',\n          className,\n        )}\n        {...props}\n      >\n        <SelectScrollUpButton />\n        <SelectPrimitive.Viewport\n          className={cn(\n            'p-2',\n            position === 'popper' &&\n              'h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width) scroll-my-2',\n          )}\n        >\n          {children}\n        </SelectPrimitive.Viewport>\n        <SelectScrollDownButton />\n      </SelectPrimitive.Content>\n    </SelectPrimitive.Portal>\n  );\n}\n\nfunction SelectLabel({ className, ...props }: ComponentProps<typeof SelectPrimitive.Label>) {\n  return (\n    <SelectPrimitive.Label\n      data-slot=\"select-label\"\n      className={cn('px-3 pt-2 pb-1 text-xs font-medium text-muted-foreground', className)}\n      {...props}\n    />\n  );\n}\n\nfunction SelectItem({\n  className,\n  children,\n  ...props\n}: ComponentProps<typeof SelectPrimitive.Item>) {\n  return (\n    <SelectPrimitive.Item\n      data-slot=\"select-item\"\n      className={cn(\n        \"relative flex w-full cursor-pointer items-center gap-2 rounded-lg py-2 pr-9 pl-3 text-sm outline-hidden select-none focus:bg-secondary in-data-[input=keyboard]:focus:outline-solid in-data-[input=keyboard]:focus:outline-2 in-data-[input=keyboard]:focus:-outline-offset-2 in-data-[input=keyboard]:focus:outline-ring data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2\",\n        className,\n      )}\n      {...props}\n    >\n      <span\n        data-slot=\"select-item-indicator\"\n        className=\"absolute right-3 flex size-4 items-center justify-center text-accent-ink\"\n      >\n        <SelectPrimitive.ItemIndicator>\n          <RuneCheck className=\"size-4\" />\n        </SelectPrimitive.ItemIndicator>\n      </span>\n      <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n    </SelectPrimitive.Item>\n  );\n}\n\nfunction SelectSeparator({\n  className,\n  ...props\n}: ComponentProps<typeof SelectPrimitive.Separator>) {\n  return (\n    <SelectPrimitive.Separator\n      data-slot=\"select-separator\"\n      className={cn('pointer-events-none -mx-2 my-2 h-px bg-border', className)}\n      {...props}\n    />\n  );\n}\n\n/* Shown when the list is taller than the room on screen: hover one to scroll. */\nfunction SelectScrollUpButton({\n  className,\n  ...props\n}: ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {\n  return (\n    <SelectPrimitive.ScrollUpButton\n      data-slot=\"select-scroll-up-button\"\n      className={cn('flex cursor-default items-center justify-center py-1', className)}\n      {...props}\n    >\n      <RuneChevronUp className=\"size-4\" />\n    </SelectPrimitive.ScrollUpButton>\n  );\n}\n\nfunction SelectScrollDownButton({\n  className,\n  ...props\n}: ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {\n  return (\n    <SelectPrimitive.ScrollDownButton\n      data-slot=\"select-scroll-down-button\"\n      className={cn('flex cursor-default items-center justify-center py-1', className)}\n      {...props}\n    >\n      <RuneChevronDown className=\"size-4\" />\n    </SelectPrimitive.ScrollDownButton>\n  );\n}\n\nexport {\n  Select,\n  SelectContent,\n  SelectGroup,\n  SelectItem,\n  SelectLabel,\n  SelectScrollDownButton,\n  SelectScrollUpButton,\n  SelectSeparator,\n  SelectTrigger,\n  SelectValue,\n  selectTriggerVariants,\n};\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}