API and Development
DateInput from @prepared911/ui/date-input wraps an Input-style trigger that opens a Calendar inside a Popover. It supports CalendarMode.Single, Range, and DaysAgo, or a generic mode where you supply children and optional displayValue for bespoke triggers. Optional Apply/Reset flows (cta) work with onApply and onReset.
Shared across picker-backed modes:
| Name | Type | Description |
|---|---|---|
id | string | Required stable id for labels and inputs. |
label | LocalizedMessage | Optional field label. Pass formatMessage output. |
placeholder | LocalizedMessage | Input placeholder. Pass formatMessage output. |
disabled | boolean | Disables the trigger and picker. |
open / onOpenChange | boolean / handler | Controlled popover open state. |
showTooltip | boolean | Show value tooltip on hover (default true). |
hideMonthYearSelect | boolean | Hide month/year dropdowns in the embedded picker. |
disableFuture | boolean | Prevent selecting dates after today. |
minSelectableDate / maxSelectableDate | Date | Inclusive bounds. |
applyLabel / resetLabel | LocalizedMessage | Reset and Apply in the calendar footer. Both are required to enable the footer. |
confirm | boolean | Optional when both footer labels are set. |
onApply | () => void | After Apply commits the draft. |
onReset | () => void | When Reset restores the draft. Escape and an outside press do not fire it. |
mode: Single—value?: Date, onChange?: (Date) => void.
mode: Range—value?: { start: Date; end: Date }, matching onChange.
mode: DaysAgo—daysAgo: number plus single-date value / onChange for relative presets.
Generic—children, optional displayValue, optional tailIconButton; no embedded Calendar mode enum on the generic branch.