{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "sort-select", "title": "Sort Select", "description": "A sort-order dropdown with a sensible default set of e-commerce options (featured, price, rating, newest). Bring your own items to customize.", "dependencies": [ "lucide-react" ], "files": [ { "path": "packages/core/src/components/lumo/sort-select.tsx", "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { ArrowUpDown, ChevronDown } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface SortItem {\n value: string\n label: string\n}\n\n/** A sensible default set of e-commerce sort options. */\nexport const defaultSortItems: SortItem[] = [\n { value: \"featured\", label: \"Featured\" },\n { value: \"newest\", label: \"Newest\" },\n { value: \"price-asc\", label: \"Price: Low to High\" },\n { value: \"price-desc\", label: \"Price: High to Low\" },\n { value: \"rating\", label: \"Highest rated\" },\n { value: \"name-asc\", label: \"Name: A to Z\" },\n]\n\nexport interface SortSelectProps extends Omit, \"onChange\"> {\n value: string\n onValueChange: (value: string) => void\n items?: SortItem[]\n /** Accessible label. Defaults to \"Sort by\". */\n label?: string\n size?: \"sm\" | \"md\"\n}\n\nconst SortSelect = React.forwardRef(\n ({ className, value, onValueChange, items = defaultSortItems, label = \"Sort by\", size = \"md\", ...props }, ref) => {\n const height = size === \"sm\" ? \"h-9\" : \"h-11\"\n\n return (\n \n \n onValueChange(event.target.value)}\n className=\"h-full cursor-pointer appearance-none rounded-full bg-transparent pl-11 pr-10 font-medium focus-visible:outline-none\"\n >\n {items.map((item) => (\n \n ))}\n \n \n \n )\n }\n)\nSortSelect.displayName = \"SortSelect\"\n\nexport { SortSelect }\n", "type": "registry:ui", "target": "components/lumo/sort-select.tsx" } ], "type": "registry:ui" }