Files
CatoandClaude Sonnet 5.5 0173ac305c feat: DateInput — a drop-in for input type=date / datetime-local (0.3.0) (#4)
Same props and onChange(event) as the native input, so a call site changes
its tag and nothing else. The value shows in words in the app's OWN styling
(className lands on the visible box); the real input stays on top,
transparent, so the picker, keyboard, autofill, validation and form
submission keep working. Controlled or uncontrolled; locale and empty-state
words follow <html lang>.

The look is in @layer base so an app's classes win: unlayered defaults would
have beaten Tailwind v4's layered utilities. A browser check proves both a
plain class and a layered utility win, and fails without the layer.
DateField is now a labelled wrapper on DateInput.

Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-08 05:13:34 -07:00

20 lines
801 B
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { describeValue } from "./DateInput.js";
export interface DateFieldProps {
label: string;
/** `YYYY-MM-DD` (date) or `YYYY-MM-DDTHH:MM` (withTime), or "" when empty. */
value: string;
onChange: (value: string) => void;
withTime?: boolean;
min?: string;
max?: string;
required?: boolean;
name?: string;
placeholder?: string;
locale?: string;
hint?: string;
className?: string;
}
/** Kept for callers of 0.1–0.2: the words for a value, or "" if invalid. */
export declare const describeFieldValue: typeof describeValue;
export declare function DateField({ label, value, onChange, withTime, min, max, required, name, placeholder, locale, hint, className, }: DateFieldProps): import("react").JSX.Element;
//# sourceMappingURL=DateField.d.ts.map