/** * Unstyled Carbon `DatePicker` (React Aria `DatePicker` / `DateRangePicker` parts; the rules of * core/date-picker, keyboard and focus traced on Carbon; WAI-ARIA APG date picker dialog): type the * date or pick it. The calendar `Popup` opens when an `Input` gets focus (or a mouse press) and focus * stays there; ↓ moves into the calendar and Tab on to the next field; in the calendar Tab and Shift+Tab go * round its controls (Cally, the APG dialog), Esc closes. Typed text is committed on blur / Enter: an * incomplete, impossible, out-of-range or refused date stays, and the box carries the problem * (`problems` / `errors` in the context, the form's own validation) — nothing is guessed. Thai * digits become 0–9. `range` gives two boxes (`field="start" | "end"`) sharing one calendar * (flatpickr rules: an end before the start swaps them). Values are ISO yyyy-mm-dd, submitted under * `name` / `endName`. A tap on a touch screen opens the calendar with a day focused (no on-screen keyboard over it; a * second tap on the box types); `picker="native"` opens the OS date picker through the box's `NativeInput` instead. * On a phone (a touch screen under 42rem, core/sheet SHEET_MEDIA) `auto` opens the calendar in a bottom sheet: `Popup` * renders inside a modal `` (top layer, the page behind inert and held still, focus kept inside) that * Esc, a `SheetClose`, a swipe down on a `SheetGrip` or a tap on the scrim closes; focus alone doesn't open it there (the * box keeps focus, so you can type). `custom` keeps the popover on phones; `sheet` uses the sheet on every device. * * Put a `Calendar.Root` (with its parts) in the `Popup`: it takes the picker's state by itself. * Keep the boxes (and a `Trigger`, a `Clear`) inside `Group`: focus and presses there are not * leaving the picker. * * State shows as data attributes: `data-open` on `Group`, `Trigger` and `Popup`; `data-disabled` on * `Group`; on `Input` `data-open` (the calendar picks for this box), `data-invalid`, `data-disabled`, * `data-readonly`; `data-side` on `Popup`, written by the positioning while open: `bottom`, or `top` * when it flipped. * * ```tsx * * * * … * * ``` */ export type { DateField } from '../core/date-picker.js'; export { useDatePickerContext } from './date-picker-context.js'; export { Root, type RootProps } from './date-picker-root.tsx'; export { Clear, Group, Input, NativeInput, Trigger, type InputProps } from './date-picker-input.tsx'; export { Popup, SheetClose, SheetGrip } from './date-picker-popup.tsx';