diff --git a/src/components/ui/native-select.tsx b/src/components/ui/native-select.tsx new file mode 100644 index 0000000..536e385 --- /dev/null +++ b/src/components/ui/native-select.tsx @@ -0,0 +1,45 @@ +import * as React from "react"; + +import { cn } from "@/lib/utils"; + +/** + * A native `` gets + * the platform picker on a phone, type-to-select on a keyboard and the OS's own + * accessibility affordances for free — a Radix listbox would trade all of that + * for a nicer-looking menu. `src/components/ui/select.tsx` is still there for + * anywhere that genuinely needs a rich menu; nothing does yet. + * + * It exists because eight call sites had each hand-rolled the same control and + * arrived at four different answers: `h-8 rounded border px-1 text-xs`, + * `h-9 rounded border px-2 text-sm`, `h-9 flex-1 rounded ...` and one correct + * `h-9 rounded-md border-input px-2`. So a select and the Input beside it in + * the same row disagreed on radius (4px vs 6px), on border colour (the row + * hairline vs the 3:1 field border) and on text indent (4 or 8px vs 12px). + * + * `className` lands on the ` + ); +} + +export { NativeSelect }; diff --git a/src/index.css b/src/index.css index 901c750..a07e2c9 100755 --- a/src/index.css +++ b/src/index.css @@ -55,6 +55,14 @@ --surplus: #1f6640; /* carried-forward surplus */ --overspend: #a5382a; /* negative balances only */ + /* The chevron a native