{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "select-glass", "type": "registry:ui", "title": "Select Glass", "description": "Glass-themed select dropdown with compound component API for flexible composition.\n * Built on @radix-ui/react-select for accessibility, keyboard navigation, and robust selection behavior.\n *\n * ## Features", "dependencies": [ "@radix-ui/react-select", "lucide-react", "react", "shadcn-glass-ui" ], "registryDependencies": [ "cn", "variants" ], "files": [ { "path": "components/glass/ui/select-glass.tsx", "type": "registry:component", "content": "/**\n * SelectGlass Component\n *\n * Glass-themed select dropdown with compound component API for flexible composition.\n * Built on @radix-ui/react-select for accessibility, keyboard navigation, and robust selection behavior.\n *\n * ## Features\n * - Compound API with 9 sub-components for maximum flexibility\n * - Full shadcn/ui API compatibility (drop-in replacement)\n * - Keyboard navigation (Arrow keys, Enter, Escape, Home/End)\n * - Grouped options with labels and separators\n * - Custom scroll buttons for long lists\n * - Glass morphism styling with theme-aware CSS variables\n * - Accessible ARIA attributes and focus management\n * - Type-safe value handling with TypeScript generics\n *\n * ## CSS Variables\n * - `--input-bg` - Trigger button background\n * - `--input-border` - Trigger button border color\n * - `--input-text` - Trigger button text color\n * - `--dropdown-bg` - Content background\n * - `--dropdown-border` - Content border color\n * - `--dropdown-item-hover` - Item hover background\n * - `--dropdown-item-text` - Item text color\n * - `--dropdown-glow` - Content box shadow\n * - `--text-secondary` - Scroll button icon color\n *\n * @example Basic usage\n * ```tsx\n * import { SelectGlass, SelectGlassTrigger, SelectGlassValue, SelectGlassContent, SelectGlassItem } from 'shadcn-glass-ui'\n *\n * \n * \n * \n * \n * \n * Apple\n * Banana\n * Orange\n * \n * \n * ```\n *\n * @example With groups and labels\n * ```tsx\n * \n * \n * \n * \n * \n * \n * Frontend\n * React\n * Vue\n * \n * \n * \n * Backend\n * Node.js\n * Python\n * \n * \n * \n * ```\n *\n * @example Controlled state\n * ```tsx\n * const [value, setValue] = useState('react')\n *\n * \n * \n * \n * \n * \n * React\n * Vue\n * \n * \n * ```\n *\n * @example shadcn/ui compatible aliases\n * ```tsx\n * import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from 'shadcn-glass-ui'\n *\n * \n * ```\n *\n * @accessibility\n * - WCAG 2.1 AA compliant via Radix UI primitives\n * - Full keyboard navigation support (Arrow keys, Enter, Space, Escape)\n * - Proper ARIA roles: `combobox`, `listbox`, `option`\n * - Screen reader announcements for selection changes\n * - Focus management with visible focus indicators\n * - Disabled state properly communicated to assistive technologies\n *\n * @since v1.0.0\n * @see https://www.radix-ui.com/primitives/docs/components/select\n */\n\n'use client';\n\nimport * as React from 'react';\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport { Check, ChevronDown, ChevronUp } from 'lucide-react';\nimport { cn } from '@/lib/utils';\nimport {\n getDropdownContentStyles,\n dropdownContentClasses,\n getDropdownItemClasses,\n dropdownSeparatorClasses,\n dropdownLabelClasses,\n} from '@/lib/variants/dropdown-content-styles';\nimport '@/glass-theme.css';\n\n// ========================================\n// ROOT\n// ========================================\n\nconst SelectGlass = SelectPrimitive.Root;\n\n// ========================================\n// GROUP\n// ========================================\n\nconst SelectGlassGroup = SelectPrimitive.Group;\n\n// ========================================\n// VALUE\n// ========================================\n\nconst SelectGlassValue = SelectPrimitive.Value;\n\n// ========================================\n// TRIGGER\n// ========================================\n\nconst SelectGlassTrigger = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, children, ...props }, ref) => (\n span]:line-clamp-1',\n className\n )}\n style={{\n background: 'var(--input-bg)',\n borderColor: 'var(--input-border)',\n color: 'var(--input-text)',\n }}\n {...props}\n >\n {children}\n \n \n \n \n));\nSelectGlassTrigger.displayName = 'SelectGlassTrigger';\n\n// ========================================\n// SCROLL UP BUTTON\n// ========================================\n\nconst SelectGlassScrollUpButton = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n \n \n));\nSelectGlassScrollUpButton.displayName = 'SelectGlassScrollUpButton';\n\n// ========================================\n// SCROLL DOWN BUTTON\n// ========================================\n\nconst SelectGlassScrollDownButton = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n \n \n));\nSelectGlassScrollDownButton.displayName = 'SelectGlassScrollDownButton';\n\n// ========================================\n// CONTENT\n// ========================================\n\nconst SelectGlassContent = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, children, position = 'popper', ...props }, ref) => (\n \n \n \n \n {children}\n \n \n \n \n));\nSelectGlassContent.displayName = 'SelectGlassContent';\n\n// ========================================\n// LABEL\n// ========================================\n\nconst SelectGlassLabel = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n));\nSelectGlassLabel.displayName = 'SelectGlassLabel';\n\n// ========================================\n// ITEM\n// ========================================\n\nconst SelectGlassItem = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, children, ...props }, ref) => (\n \n \n \n \n \n \n {children}\n \n));\nSelectGlassItem.displayName = 'SelectGlassItem';\n\n// ========================================\n// SEPARATOR\n// ========================================\n\nconst SelectGlassSeparator = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n));\nSelectGlassSeparator.displayName = 'SelectGlassSeparator';\n\n// ========================================\n// EXPORTS\n// ========================================\n\nexport {\n SelectGlass,\n SelectGlassGroup,\n SelectGlassValue,\n SelectGlassTrigger,\n SelectGlassScrollUpButton,\n SelectGlassScrollDownButton,\n SelectGlassContent,\n SelectGlassLabel,\n SelectGlassItem,\n SelectGlassSeparator,\n};\n\n// ========================================\n// SHADCN/UI COMPATIBLE ALIASES\n// ========================================\n\n/**\n * shadcn/ui compatible aliases for SelectGlass components\n *\n * @example\n * ```tsx\n * import {\n * Select,\n * SelectTrigger,\n * SelectValue,\n * SelectContent,\n * SelectItem,\n * } from 'shadcn-glass-ui'\n *\n * \n * ```\n * @since v2.5.0\n */\nexport const Select = SelectGlass;\nexport const SelectGroup = SelectGlassGroup;\nexport const SelectValue = SelectGlassValue;\nexport const SelectTrigger = SelectGlassTrigger;\nexport const SelectScrollUpButton = SelectGlassScrollUpButton;\nexport const SelectScrollDownButton = SelectGlassScrollDownButton;\nexport const SelectContent = SelectGlassContent;\nexport const SelectLabel = SelectGlassLabel;\nexport const SelectItem = SelectGlassItem;\nexport const SelectSeparator = SelectGlassSeparator;\n" } ], "categories": [ "ui" ], "cssVars": { "light": { "--glass-bg": "rgba(255, 255, 255, 0.1)", "--glass-border": "rgba(255, 255, 255, 0.2)", "--blur-sm": "8px", "--blur-md": "16px", "--blur-lg": "24px" }, "dark": { "--glass-bg": "rgba(255, 255, 255, 0.05)", "--glass-border": "rgba(255, 255, 255, 0.1)", "--blur-sm": "8px", "--blur-md": "16px", "--blur-lg": "24px" } } }