{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "masai-date-selection", "title": "Masai Date Selection", "description": "Native date field with optional label, rounded shell, and calendar affordance (single variation; extensible later).", "dependencies": [ "lucide-react" ], "files": [ { "path": "registry/components/masai-date-selection.tsx", "content": "\"use client\";\n\nimport { Calendar } from \"lucide-react\";\nimport * as React from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nconst fieldShellClassName =\n \"relative flex min-h-[40px] min-w-0 w-full items-center rounded-[8px] border border-gray-200 bg-white px-3 text-gray-900 outline-none transition-[color,border-color,box-shadow] focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-400 focus-within:ring-offset-2 focus-within:ring-offset-background\";\n\nfunction calendarIndicatorClearClasses() {\n return cn(\n \"[&::-webkit-calendar-picker-indicator]:absolute [&::-webkit-calendar-picker-indicator]:right-3 [&::-webkit-calendar-picker-indicator]:top-1/2 [&::-webkit-calendar-picker-indicator]:size-5 [&::-webkit-calendar-picker-indicator]:-translate-y-1/2 [&::-webkit-calendar-picker-indicator]:cursor-pointer [&::-webkit-calendar-picker-indicator]:opacity-0\",\n );\n}\n\nexport type MasaiDateSelectionProps = Omit<\n React.ComponentProps<\"input\">,\n \"type\" | \"className\"\n> & {\n /** Optional label above the control (e.g. “Start Date”). */\n label?: string;\n /** Wrapper layout classes (column: label + field). */\n className?: string;\n shellClassName?: string;\n inputClassName?: string;\n};\n\n/**\n * MasaiDateSelection — native `type=\"date\"` in a Masai-styled shell with optional label\n * and calendar icon. Value is ISO `yyyy-mm-dd` in HTML/React.\n *\n * Single variation for now; add sizes/variants later as needed.\n */\nexport function MasaiDateSelection({\n label,\n id: idProp,\n className,\n shellClassName,\n inputClassName,\n disabled,\n placeholder = \"dd/mm/yyyy\",\n ...inputProps\n}: MasaiDateSelectionProps) {\n const generatedId = React.useId();\n const controlId = idProp ?? generatedId;\n\n return (\n
\n {label ? (\n \n ) : null}\n \n \n \n \n \n
\n \n );\n}\n", "type": "registry:ui" } ], "type": "registry:ui" }