@krizaka/ui 3.2.0 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/dist/{chunk-I5RVM5CW.js → chunk-2FRWNSRO.js} +2 -6
  2. package/dist/chunk-2FRWNSRO.js.map +1 -0
  3. package/dist/chunk-BTMFZ66D.js +135 -0
  4. package/dist/chunk-BTMFZ66D.js.map +1 -0
  5. package/dist/chunk-C2BRIFJG.js +13 -0
  6. package/dist/chunk-C2BRIFJG.js.map +1 -0
  7. package/dist/chunk-KDXRYUD3.js +39 -0
  8. package/dist/chunk-KDXRYUD3.js.map +1 -0
  9. package/dist/{chunk-2PUDI7JS.js → chunk-ZKVQGXLD.js} +5 -3
  10. package/dist/{chunk-2PUDI7JS.js.map → chunk-ZKVQGXLD.js.map} +1 -1
  11. package/dist/command.js +1 -1
  12. package/dist/confirm-button.js +1 -1
  13. package/dist/data-table.js +3 -2
  14. package/dist/data-table.js.map +1 -1
  15. package/dist/date-picker.d.ts +3 -1
  16. package/dist/date-picker.js +13 -13
  17. package/dist/date-picker.js.map +1 -1
  18. package/dist/dropdown-menu.js +1 -1
  19. package/dist/filter-bar.js +3 -2
  20. package/dist/form.d.ts +23 -12
  21. package/dist/form.js +11 -47
  22. package/dist/form.js.map +1 -1
  23. package/dist/glow-card.js +1 -1
  24. package/dist/image-cropper.js +3 -1
  25. package/dist/image-cropper.js.map +1 -1
  26. package/dist/marquee.js +1 -1
  27. package/dist/native/form.d.ts +60 -15
  28. package/dist/native/form.js +103 -42
  29. package/dist/native/form.js.map +1 -1
  30. package/dist/native.d.ts +206 -2
  31. package/dist/native.js +1172 -541
  32. package/dist/native.js.map +1 -1
  33. package/dist/nav-bar.js +1 -1
  34. package/dist/popover.js +1 -1
  35. package/dist/radio-group.d.ts +66 -32
  36. package/dist/radio-group.js +54 -10
  37. package/dist/radio-group.js.map +1 -1
  38. package/dist/slider.d.ts +96 -35
  39. package/dist/slider.js +67 -13
  40. package/dist/slider.js.map +1 -1
  41. package/dist/terminal-replay.js +34 -60
  42. package/dist/terminal-replay.js.map +1 -1
  43. package/dist/toast.js +1 -1
  44. package/dist/tooltip.js +1 -1
  45. package/dist/video-player.js +3 -1
  46. package/dist/video-player.js.map +1 -1
  47. package/package.json +6 -6
  48. package/registry/combobox.json +225 -3
  49. package/registry/date-picker.json +16 -2
  50. package/registry/dialog.json +74 -3
  51. package/registry/examples/combobox/native/multiple.d.ts +4 -0
  52. package/registry/examples/combobox/native/multiple.dark.png +0 -0
  53. package/registry/examples/combobox/native/multiple.js +15 -0
  54. package/registry/examples/combobox/native/multiple.light.png +0 -0
  55. package/registry/examples/combobox/native/multiple.tsx +15 -0
  56. package/registry/examples/combobox/native/search.d.ts +4 -0
  57. package/registry/examples/combobox/native/search.dark.png +0 -0
  58. package/registry/examples/combobox/native/search.js +15 -0
  59. package/registry/examples/combobox/native/search.light.png +0 -0
  60. package/registry/examples/combobox/native/search.tsx +15 -0
  61. package/registry/examples/dialog/native/sheet.d.ts +4 -0
  62. package/registry/examples/dialog/native/sheet.dark.png +0 -0
  63. package/registry/examples/dialog/native/sheet.js +21 -0
  64. package/registry/examples/dialog/native/sheet.light.png +0 -0
  65. package/registry/examples/dialog/native/sheet.tsx +18 -0
  66. package/registry/examples/field/native/select.d.ts +4 -0
  67. package/registry/examples/field/native/select.dark.png +0 -0
  68. package/registry/examples/field/native/select.js +29 -0
  69. package/registry/examples/field/native/select.light.png +0 -0
  70. package/registry/examples/field/native/select.tsx +25 -0
  71. package/registry/examples/form/native/audience.dark.png +0 -0
  72. package/registry/examples/form/native/audience.light.png +0 -0
  73. package/registry/examples/form/native/profile.dark.png +0 -0
  74. package/registry/examples/form/native/profile.light.png +0 -0
  75. package/registry/examples/form/native/settings.dark.png +0 -0
  76. package/registry/examples/form/native/settings.light.png +0 -0
  77. package/registry/examples/form/native/sign-up.dark.png +0 -0
  78. package/registry/examples/form/native/sign-up.light.png +0 -0
  79. package/registry/examples/form/native/upload.dark.png +0 -0
  80. package/registry/examples/form/native/upload.light.png +0 -0
  81. package/registry/examples/radio-group/buttons.d.ts +4 -0
  82. package/registry/examples/radio-group/buttons.js +17 -0
  83. package/registry/examples/radio-group/buttons.tsx +21 -0
  84. package/registry/examples/radio-group/cards.js +1 -1
  85. package/registry/examples/radio-group/cards.tsx +2 -2
  86. package/registry/examples/radio-group/native/buttons.d.ts +4 -0
  87. package/registry/examples/radio-group/native/buttons.dark.png +0 -0
  88. package/registry/examples/radio-group/native/buttons.js +25 -0
  89. package/registry/examples/radio-group/native/buttons.light.png +0 -0
  90. package/registry/examples/radio-group/native/buttons.tsx +21 -0
  91. package/registry/examples/radio-group/native/cards.d.ts +4 -0
  92. package/registry/examples/radio-group/native/cards.dark.png +0 -0
  93. package/registry/examples/radio-group/native/cards.js +23 -0
  94. package/registry/examples/radio-group/native/cards.light.png +0 -0
  95. package/registry/examples/radio-group/native/cards.tsx +19 -0
  96. package/registry/examples/radio-group/native/list.d.ts +4 -0
  97. package/registry/examples/radio-group/native/list.dark.png +0 -0
  98. package/registry/examples/radio-group/native/list.js +24 -0
  99. package/registry/examples/radio-group/native/list.light.png +0 -0
  100. package/registry/examples/radio-group/native/list.tsx +20 -0
  101. package/registry/examples/radio-group/native/segmented.d.ts +4 -0
  102. package/registry/examples/radio-group/native/segmented.dark.png +0 -0
  103. package/registry/examples/radio-group/native/segmented.js +24 -0
  104. package/registry/examples/radio-group/native/segmented.light.png +0 -0
  105. package/registry/examples/radio-group/native/segmented.tsx +20 -0
  106. package/registry/examples/radio-group/segmented.d.ts +4 -0
  107. package/registry/examples/radio-group/segmented.js +15 -0
  108. package/registry/examples/radio-group/segmented.tsx +12 -0
  109. package/registry/examples/slider/floating.d.ts +4 -0
  110. package/registry/examples/slider/floating.js +11 -0
  111. package/registry/examples/slider/floating.tsx +12 -0
  112. package/registry/examples/slider/native/default.d.ts +4 -0
  113. package/registry/examples/slider/native/default.dark.png +0 -0
  114. package/registry/examples/slider/native/default.js +14 -0
  115. package/registry/examples/slider/native/default.light.png +0 -0
  116. package/registry/examples/slider/native/default.tsx +13 -0
  117. package/registry/examples/slider/native/range.d.ts +4 -0
  118. package/registry/examples/slider/native/range.dark.png +0 -0
  119. package/registry/examples/slider/native/range.js +12 -0
  120. package/registry/examples/slider/native/range.light.png +0 -0
  121. package/registry/examples/slider/native/range.tsx +11 -0
  122. package/registry/examples/slider/native/stepped.d.ts +4 -0
  123. package/registry/examples/slider/native/stepped.dark.png +0 -0
  124. package/registry/examples/slider/native/stepped.js +28 -0
  125. package/registry/examples/slider/native/stepped.light.png +0 -0
  126. package/registry/examples/slider/native/stepped.tsx +24 -0
  127. package/registry/examples/slider/native/vertical.d.ts +4 -0
  128. package/registry/examples/slider/native/vertical.dark.png +0 -0
  129. package/registry/examples/slider/native/vertical.js +16 -0
  130. package/registry/examples/slider/native/vertical.light.png +0 -0
  131. package/registry/examples/slider/native/vertical.tsx +13 -0
  132. package/registry/examples/slider/price-range.d.ts +4 -0
  133. package/registry/examples/slider/price-range.js +29 -0
  134. package/registry/examples/slider/price-range.tsx +27 -0
  135. package/registry/examples/slider/stepped.d.ts +4 -0
  136. package/registry/examples/slider/stepped.js +28 -0
  137. package/registry/examples/slider/stepped.tsx +24 -0
  138. package/registry/examples/slider/vertical.d.ts +4 -0
  139. package/registry/examples/slider/vertical.js +15 -0
  140. package/registry/examples/slider/vertical.tsx +14 -0
  141. package/registry/examples/switch/native/default.d.ts +4 -0
  142. package/registry/examples/switch/native/default.dark.png +0 -0
  143. package/registry/examples/switch/native/default.js +16 -0
  144. package/registry/examples/switch/native/default.light.png +0 -0
  145. package/registry/examples/switch/native/default.tsx +13 -0
  146. package/registry/examples/switch/native/settings.d.ts +4 -0
  147. package/registry/examples/switch/native/settings.dark.png +0 -0
  148. package/registry/examples/switch/native/settings.js +20 -0
  149. package/registry/examples/switch/native/settings.light.png +0 -0
  150. package/registry/examples/switch/native/settings.tsx +17 -0
  151. package/registry/field.json +15 -3
  152. package/registry/form.json +250 -42
  153. package/registry/index.json +24 -20
  154. package/registry/radio-group.json +227 -15
  155. package/registry/slider.json +314 -13
  156. package/registry/switch.json +115 -3
  157. package/registry/tabs.json +2 -2
  158. package/skills/choice-controls/SKILL.md +39 -0
  159. package/skills/form/SKILL.md +3 -0
  160. package/dist/chunk-I5RVM5CW.js.map +0 -1
  161. package/dist/chunk-RUPRYJ45.js +0 -82
  162. package/dist/chunk-RUPRYJ45.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/date-picker/calendar.tsx","../src/tv.ts","../src/date-picker/month-picker.tsx","../src/date-picker/parts.ts","../src/date-picker/date-field.tsx","../src/date-picker/wheel.tsx","../src/date-picker/date-picker.tsx","../src/popover/popover.tsx","../src/date-picker/day-strip.tsx","../src/date-picker/time-picker.tsx"],"sourcesContent":["// Client. A month as an ARIA grid (the APG date picker): one day in the tab order, the arrows walk the days, Home /\n// End the week, Page Up / Page Down the months (Shift: the years), Enter or Space picks. Dates are ISO calendar dates\n// (`\"2026-10-11\"`): no time zone, nothing to convert, safe in an address. Month and day names come from\n// `@krizaka/intl` for the `locale` given — never the runtime's default.\n//\n// The material (BRAND.md §6): the chosen day is a lit fill (the accent, its shade, its glow), today carries the node —\n// the diamond of the marks — and a range is one continuous band. The month's title opens the months of the year\n// (`MonthPicker`): years are reached in a click, not by paging.\nimport { formatDate, getDateTimeFormat } from \"@krizaka/intl\";\nimport * as React from \"react\";\n\nimport { ChevronGlyph } from \"../glyphs\";\nimport { tv } from \"../tv\";\nimport { MonthPicker } from \"./month-picker\";\nimport { addDays, addMonths, toIsoDate, toLocalDate, weekStartOf } from \"./parts\";\n\nexport { addDays, addMonths, toIsoDate, toLocalDate, weekStartOf };\n\n/** A calendar date, `YYYY-MM-DD`. */\nexport type IsoDate = string;\n/** A range of calendar dates; `end` is `null` while the second date is not chosen. */\nexport type DateRange = { start: IsoDate; end: IsoDate | null };\n\nexport const calendar = tv({\n slots: {\n root: \"inline-flex select-none flex-col text-sm text-fg\",\n header: \"mb-3 flex items-center justify-between gap-2\",\n caption:\n \"inline-flex h-9 items-center gap-1.5 rounded-lg px-2.5 text-sm font-semibold capitalize text-fg transition-colors hover:bg-surface-3 \" +\n \"focus-visible:outline-hidden focus-visible:focus-ring aria-expanded:bg-surface-3\",\n nav:\n \"inline-flex h-9 w-9 items-center justify-center rounded-lg border border-border-subtle bg-surface-2 bg-sheen text-fg-secondary inset-shadow-edge \" +\n \"transition-colors hover:border-border-strong hover:text-fg focus-visible:outline-hidden focus-visible:focus-ring \" +\n \"disabled:pointer-events-none disabled:opacity-35\",\n months: \"flex flex-col gap-6 sm:flex-row\",\n month: \"kz-month flex flex-col gap-2\",\n monthTitle: \"px-1 text-xs font-semibold capitalize text-fg-secondary\",\n grid: \"border-separate border-spacing-y-1\",\n weekday: \"h-7 w-10 pb-1 text-center text-[11px] font-semibold uppercase tracking-wider text-fg-secondary\",\n cell:\n \"p-0 text-center data-[band]:bg-accent-soft data-[band=start]:rounded-l-xl data-[band=end]:rounded-r-xl data-[band=solo]:rounded-xl \" +\n \"data-[band=preview]:bg-surface-3\",\n day:\n \"relative h-10 w-10 rounded-xl text-sm tabular-nums text-fg transition-[background-color,box-shadow,transform] duration-150 \" +\n \"hover:bg-surface-3 active:scale-95 motion-reduce:transition-none motion-reduce:active:scale-100 \" +\n \"focus-visible:z-10 focus-visible:outline-hidden focus-visible:focus-ring \" +\n \"data-[outside]:text-fg-secondary data-[outside]:font-normal data-[weekend]:not-data-[selected]:text-fg-secondary \" +\n \"data-[today]:font-bold data-[today]:not-data-[selected]:text-fg-accent \" +\n \"data-[in-range]:hover:bg-accent/15 \" +\n \"data-[selected]:bg-accent data-[selected]:bg-fill-shade data-[selected]:font-semibold data-[selected]:text-on-accent \" +\n \"data-[selected]:shadow-glow data-[selected]:inset-shadow-edge-fill data-[selected]:hover:bg-accent \" +\n \"disabled:cursor-not-allowed disabled:text-fg-muted disabled:line-through disabled:opacity-50 disabled:hover:bg-transparent\",\n // Today: the node under the number (the marks' diamond), on-accent when today is the chosen day.\n node: \"pointer-events-none absolute bottom-1 left-1/2 h-1 w-1 -translate-x-1/2 rotate-45 rounded-[1px] bg-accent group-data-[selected]:bg-on-accent\",\n live: \"sr-only\",\n },\n variants: {\n variant: {\n plain: {},\n card: { root: \"rounded-2xl border border-border-default bg-surface-1 bg-sheen p-4 shadow-raised inset-shadow-edge\" },\n },\n },\n defaultVariants: { variant: \"plain\" },\n});\n\nconst monthOf = (iso: IsoDate) => `${iso.slice(0, 7)}-01`;\nconst clampIso = (iso: IsoDate, min?: IsoDate, max?: IsoDate) => (min && iso < min ? min : max && iso > max ? max : iso);\nconst monthsBetween = (a: IsoDate, b: IsoDate) => (Number(b.slice(0, 4)) - Number(a.slice(0, 4))) * 12 + Number(b.slice(5, 7)) - Number(a.slice(5, 7));\n\nexport type CalendarLabels = {\n /** The previous-month button (\"Previous month\"). */\n previousMonth: string;\n /** The next-month button (\"Next month\"). */\n nextMonth: string;\n /** The month's title as a button: opens the months of the year (\"Choose month and year\"). */\n chooseMonth: string;\n /** The previous-year button of the months view (\"Previous year\"). */\n previousYear: string;\n /** The next-year button of the months view (\"Next year\"). */\n nextYear: string;\n};\n\nexport const calendarLabels: CalendarLabels = {\n previousMonth: \"Previous month\",\n nextMonth: \"Next month\",\n chooseMonth: \"Choose month and year\",\n previousYear: \"Previous year\",\n nextYear: \"Next year\",\n};\n\nexport type CalendarProps = {\n /** The BCP 47 locale of the month and day names (`\"en-US\"`, `\"fr-CA\"`): always explicit. */\n locale: string;\n /** The chosen date (one-date mode). */\n value?: IsoDate | null;\n /** The chosen range (range mode): its ends are lit, the days between are one band. */\n range?: DateRange | null;\n /** Called with the day picked. */\n onSelect?: (date: IsoDate) => void;\n /** The month shown (the first one, with `numberOfMonths={2}`), any day of it (controlled). */\n month?: IsoDate;\n /** The month shown at first. Default: the value's, or today's. */\n defaultMonth?: IsoDate;\n /** Called when the month shown changes. */\n onMonthChange?: (month: IsoDate) => void;\n /** One month, or two side by side (a period: from a phone's width up, they stack on a phone). */\n numberOfMonths?: 1 | 2;\n /** The earliest date that can be picked. */\n min?: IsoDate;\n /** The latest date that can be picked. */\n max?: IsoDate;\n /** Refuses some dates (`(d) => isWeekend(d)`). */\n isDateDisabled?: (date: IsoDate) => boolean;\n /** The first day of the week, 0 = Sunday. Default: the locale's. */\n weekStartsOn?: number;\n /** Today (marked): inject it for a stable server render or a test. Default: the device's date. */\n today?: IsoDate;\n /** Moves the focus to the active day when it mounts (inside a popover). */\n autoFocus?: boolean;\n /** `plain` (inside a popover, a card of the app) or `card` (the calendar is the interface: its own raised surface). */\n variant?: \"plain\" | \"card\";\n /** The words, passed translated; English by default. */\n labels?: Partial<CalendarLabels>;\n /** Classes merged on the root. */\n className?: string;\n};\n\n/** A month grid to pick a date or the ends of a range, with the full keyboard of the APG date picker. */\nexport function Calendar({\n locale,\n value,\n range,\n onSelect,\n month: monthProp,\n defaultMonth,\n onMonthChange,\n numberOfMonths = 1,\n min,\n max,\n isDateDisabled,\n weekStartsOn,\n today: todayProp,\n autoFocus,\n variant,\n labels: given,\n className,\n}: CalendarProps) {\n const labels = { ...calendarLabels, ...given };\n const s = calendar({ variant });\n const today = todayProp ?? toIsoDate(new Date());\n const anchor = value ?? range?.start ?? clampIso(today, min, max);\n const [innerMonth, setInnerMonth] = React.useState(monthOf(defaultMonth ?? anchor));\n const month = monthProp ? monthOf(monthProp) : innerMonth;\n const shown = Array.from({ length: numberOfMonths }, (_, i) => addMonths(month, i));\n const lastShown = shown[shown.length - 1]!;\n const isShown = (iso: IsoDate) => iso.slice(0, 7) >= month.slice(0, 7) && iso.slice(0, 7) <= lastShown.slice(0, 7);\n const [focused, setFocused] = React.useState<IsoDate>(isShown(anchor) ? anchor : month);\n const [hover, setHover] = React.useState<IsoDate | null>(null);\n const [view, setView] = React.useState<\"days\" | \"months\">(\"days\");\n const [direction, setDirection] = React.useState<\"next\" | \"previous\" | null>(null);\n const root = React.useRef<HTMLDivElement>(null);\n const moved = React.useRef(Boolean(autoFocus));\n const titleId = React.useId();\n\n const setMonth = (next: IsoDate) => {\n const m = monthOf(next);\n setDirection(m > month ? \"next\" : m < month ? \"previous\" : null);\n if (!monthProp) setInnerMonth(m);\n onMonthChange?.(m);\n };\n // The focused day follows the months shown when they are changed from outside (the buttons, a controlled `month`).\n const active = isShown(focused) ? focused : month;\n\n React.useEffect(() => {\n if (!moved.current || view !== \"days\") return;\n moved.current = false;\n root.current?.querySelector<HTMLButtonElement>(`[data-date=\"${active}\"]`)?.focus();\n }, [active, view]);\n\n const disabled = (iso: IsoDate) => Boolean((min && iso < min) || (max && iso > max) || isDateDisabled?.(iso));\n const start = weekStartsOn ?? weekStartOf(locale);\n const weekdayShort = getDateTimeFormat(locale, { weekday: \"short\" });\n const weekdayLong = getDateTimeFormat(locale, { weekday: \"long\" });\n const titleFormat = getDateTimeFormat(locale, { month: \"long\", year: \"numeric\" });\n const title = titleFormat.format(toLocalDate(month));\n const fullTitle = numberOfMonths === 2 ? `${title} – ${titleFormat.format(toLocalDate(lastShown))}` : title;\n\n const rangeEnd = range ? (range.end ?? hover) : null;\n const [lo, hi] = range && rangeEnd ? (range.start <= rangeEnd ? [range.start, rangeEnd] : [rangeEnd, range.start]) : [null, null];\n const previewing = Boolean(range && !range.end);\n\n const focusDay = (iso: IsoDate) => {\n moved.current = true;\n setFocused(iso);\n if (!isShown(iso)) setMonth(iso < month ? iso : addMonths(iso, -(numberOfMonths - 1)));\n };\n\n const onKeyDown = (event: React.KeyboardEvent) => {\n const weekday = (toLocalDate(active).getDay() - start + 7) % 7;\n const moves: Record<string, () => IsoDate> = {\n ArrowLeft: () => addDays(active, -1),\n ArrowRight: () => addDays(active, 1),\n ArrowUp: () => addDays(active, -7),\n ArrowDown: () => addDays(active, 7),\n Home: () => addDays(active, -weekday),\n End: () => addDays(active, 6 - weekday),\n PageUp: () => addMonths(active, event.shiftKey ? -12 : -1),\n PageDown: () => addMonths(active, event.shiftKey ? 12 : 1),\n };\n const move = moves[event.key];\n if (!move) return;\n event.preventDefault();\n focusDay(move());\n };\n\n const prevDisabled = Boolean(min && addDays(month, -1) < min);\n const nextDisabled = Boolean(max && addMonths(lastShown, 1) > max);\n\n const band = (iso: IsoDate): string | undefined => {\n if (!lo || !hi) return undefined;\n if (iso < lo || iso > hi) return undefined;\n if (lo === hi) return undefined;\n if (previewing && iso !== range?.start) return iso === lo ? \"start\" : iso === hi ? \"end\" : \"preview\";\n return iso === lo ? \"start\" : iso === hi ? \"end\" : \"middle\";\n };\n\n const renderMonth = (first: IsoDate, index: number) => {\n const firstDate = toLocalDate(first);\n const lead = (firstDate.getDay() - start + 7) % 7;\n const gridStart = addDays(first, -lead);\n const days = Array.from({ length: 42 }, (_, i) => addDays(gridStart, i));\n const weeks = Array.from({ length: 6 }, (_, w) => days.slice(w * 7, w * 7 + 7)).filter((week, w) => w < 5 || week[0]!.slice(0, 7) === first.slice(0, 7));\n const monthTitle = titleFormat.format(firstDate);\n const gridLabelId = `${titleId}-m${index}`;\n return (\n <div key={first} className={s.month()} data-dir={direction ?? undefined}>\n {numberOfMonths === 2 ? (\n <div id={gridLabelId} className={s.monthTitle()}>\n {monthTitle}\n </div>\n ) : null}\n <table role=\"grid\" aria-label={monthTitle} className={s.grid()} onKeyDown={onKeyDown}>\n <thead>\n <tr>\n {days.slice(0, 7).map((iso) => (\n <th key={iso} scope=\"col\" abbr={weekdayLong.format(toLocalDate(iso))} className={s.weekday()}>\n {weekdayShort.format(toLocalDate(iso)).replace(/\\.$/, \"\")}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {weeks.map((week) => (\n <tr key={week[0]}>\n {week.map((iso) => {\n const outside = iso.slice(0, 7) !== first.slice(0, 7);\n // With two months, a day outside its month is the other month's: drawn once, where it belongs.\n if (outside && numberOfMonths === 2) return <td key={iso} role=\"gridcell\" className={s.cell()} />;\n const selected = iso === value || Boolean(range && (iso === range.start || iso === range.end));\n const inRange = Boolean(lo && hi && iso > lo && iso < hi);\n const dow = toLocalDate(iso).getDay();\n return (\n <td key={iso} role=\"gridcell\" aria-selected={selected || inRange || undefined} data-band={band(iso)} className={s.cell()}>\n <button\n type=\"button\"\n data-date={iso}\n tabIndex={iso === active ? 0 : -1}\n aria-label={formatDate(toLocalDate(iso), { locale, style: \"long\" })}\n aria-current={iso === today ? \"date\" : undefined}\n data-today={iso === today ? \"\" : undefined}\n data-outside={outside ? \"\" : undefined}\n data-weekend={dow === 0 || dow === 6 ? \"\" : undefined}\n data-selected={selected ? \"\" : undefined}\n data-in-range={inRange ? \"\" : undefined}\n disabled={disabled(iso)}\n className={s.day({ className: \"group\" })}\n onClick={() => {\n setFocused(iso);\n onSelect?.(iso);\n }}\n onMouseEnter={previewing ? () => setHover(iso) : undefined}\n onFocus={previewing ? () => setHover(iso) : undefined}\n >\n {Number(iso.slice(8))}\n {iso === today ? <span aria-hidden className={s.node()} /> : null}\n </button>\n </td>\n );\n })}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n );\n };\n\n return (\n <div ref={root} className={s.root({ className })}>\n <div className={s.header()}>\n <button\n type=\"button\"\n className={s.nav()}\n aria-label={view === \"days\" ? labels.previousMonth : labels.previousYear}\n disabled={view === \"days\" ? prevDisabled : Boolean(min && Number(month.slice(0, 4)) - 1 < Number(min.slice(0, 4)))}\n onClick={() => setMonth(addMonths(month, view === \"days\" ? -1 : -12))}\n >\n <ChevronGlyph direction=\"left\" className=\"h-4 w-4\" />\n </button>\n <button type=\"button\" className={s.caption()} aria-expanded={view === \"months\"} aria-label={`${labels.chooseMonth}, ${fullTitle}`} onClick={() => setView(view === \"days\" ? \"months\" : \"days\")}>\n <span aria-hidden>{view === \"days\" ? fullTitle : month.slice(0, 4)}</span>\n <ChevronGlyph direction={view === \"months\" ? \"up\" : \"down\"} className=\"h-3.5 w-3.5 text-fg-secondary\" />\n </button>\n <button\n type=\"button\"\n className={s.nav()}\n aria-label={view === \"days\" ? labels.nextMonth : labels.nextYear}\n disabled={view === \"days\" ? nextDisabled : Boolean(max && Number(month.slice(0, 4)) + 1 > Number(max.slice(0, 4)))}\n onClick={() => setMonth(addMonths(month, view === \"days\" ? 1 : 12))}\n >\n <ChevronGlyph direction=\"right\" className=\"h-4 w-4\" />\n </button>\n </div>\n <span id={titleId} className={s.live()} aria-live=\"polite\">\n {fullTitle}\n </span>\n {view === \"days\" ? (\n <div className={s.months()}>{shown.map(renderMonth)}</div>\n ) : (\n <MonthPicker\n locale={locale}\n bare\n year={Number(month.slice(0, 4))}\n onYearChange={(y) => setMonth(`${y}-${month.slice(5, 7)}-01`)}\n value={month.slice(0, 7)}\n min={min?.slice(0, 7)}\n max={max?.slice(0, 7)}\n autoFocus\n onValueChange={(m) => {\n if (!m) return;\n const target = `${m}-01`;\n setMonth(target);\n setView(\"days\");\n moved.current = true;\n setFocused(clampIso(addMonths(active, monthsBetween(monthOf(active), target)), min, max));\n }}\n />\n )}\n </div>\n );\n}\n","import { createTV } from \"tailwind-variants\";\n\nimport { twMergeConfig } from \"./cn\";\n\n/** `tv` with the preset's utilities known to the merge engine (`twMergeConfig`): what a primitive wearing the material is styled with. */\nexport const tv = createTV({ twMergeConfig });\n","// Client. The twelve months of a year as a grid (three columns): the arrows walk them (Up / Down by a row), Page Up /\n// Page Down change the year, Enter or Space picks. The value is `YYYY-MM` — a billing month, a card's expiry, a report.\n// The calendar's title opens it, so a year away is two clicks, not twelve pages.\nimport * as React from \"react\";\n\nimport { ChevronGlyph } from \"../glyphs\";\nimport { tv } from \"../tv\";\nimport { monthNames } from \"./parts\";\n\n/** A calendar month, `YYYY-MM`. */\nexport type IsoMonth = string;\n\nexport const monthPicker = tv({\n slots: {\n root: \"inline-flex select-none flex-col gap-3 text-sm text-fg\",\n header: \"flex items-center justify-between gap-2\",\n year: \"text-sm font-semibold tabular-nums\",\n nav:\n \"inline-flex h-9 w-9 items-center justify-center rounded-lg border border-border-subtle bg-surface-2 bg-sheen text-fg-secondary inset-shadow-edge \" +\n \"transition-colors hover:border-border-strong hover:text-fg focus-visible:outline-hidden focus-visible:focus-ring disabled:pointer-events-none disabled:opacity-35\",\n grid: \"kz-fade grid grid-cols-3 gap-1.5\",\n month:\n \"relative h-11 min-w-[5.5rem] rounded-xl px-2 text-sm font-medium capitalize text-fg transition-[background-color,box-shadow,transform] duration-150 \" +\n \"hover:bg-surface-3 active:scale-95 motion-reduce:transition-none motion-reduce:active:scale-100 focus-visible:outline-hidden focus-visible:focus-ring \" +\n \"data-[current]:font-bold data-[current]:not-data-[selected]:text-fg-accent \" +\n \"data-[selected]:bg-accent data-[selected]:bg-fill-shade data-[selected]:font-semibold data-[selected]:text-on-accent data-[selected]:shadow-glow data-[selected]:inset-shadow-edge-fill \" +\n \"disabled:cursor-not-allowed disabled:text-fg-muted disabled:opacity-50 disabled:hover:bg-transparent\",\n },\n variants: {\n variant: {\n plain: {},\n card: { root: \"rounded-2xl border border-border-default bg-surface-1 bg-sheen p-4 shadow-raised inset-shadow-edge\" },\n },\n },\n defaultVariants: { variant: \"plain\" },\n});\n\nexport type MonthPickerLabels = {\n /** The previous-year button (\"Previous year\"). */\n previousYear: string;\n /** The next-year button (\"Next year\"). */\n nextYear: string;\n};\n\nexport const monthPickerLabels: MonthPickerLabels = { previousYear: \"Previous year\", nextYear: \"Next year\" };\n\nexport type MonthPickerProps = {\n /** The BCP 47 locale of the month names: always explicit. */\n locale: string;\n /** The chosen month, `YYYY-MM` (controlled); `null` for none. */\n value?: IsoMonth | null;\n /** The chosen month at first, uncontrolled. */\n defaultValue?: IsoMonth | null;\n /** Called with the month picked. */\n onValueChange?: (value: IsoMonth | null) => void;\n /** The year shown (controlled). */\n year?: number;\n /** Called when the year shown changes. */\n onYearChange?: (year: number) => void;\n /** The earliest month that can be picked, `YYYY-MM`. */\n min?: IsoMonth;\n /** The latest month that can be picked, `YYYY-MM`. */\n max?: IsoMonth;\n /** This month (marked): inject it for a stable render or a test. Default: the device's. */\n current?: IsoMonth;\n /** Moves the focus to the active month when it mounts. */\n autoFocus?: boolean;\n /** Without its own year header (inside the calendar, which has one). */\n bare?: boolean;\n /** `plain` or `card` (its own raised surface). */\n variant?: \"plain\" | \"card\";\n /** The words, passed translated; English by default. */\n labels?: Partial<MonthPickerLabels>;\n /** Classes merged on the root. */\n className?: string;\n};\n\n/** A month of a year: twelve months in a grid, the year above them. */\nexport function MonthPicker({ locale, value: valueProp, defaultValue = null, onValueChange, year: yearProp, onYearChange, min, max, current, autoFocus, bare, variant, labels: given, className }: MonthPickerProps) {\n const labels = { ...monthPickerLabels, ...given };\n const s = monthPicker({ variant });\n const [own, setOwn] = React.useState<IsoMonth | null>(defaultValue);\n const value = valueProp !== undefined ? valueProp : own;\n const now = new Date();\n const thisMonth = current ?? `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, \"0\")}`;\n const [ownYear, setOwnYear] = React.useState(() => Number((value ?? thisMonth).slice(0, 4)));\n const year = yearProp ?? ownYear;\n const setYear = (y: number) => {\n if (yearProp === undefined) setOwnYear(y);\n onYearChange?.(y);\n };\n const names = React.useMemo(() => monthNames(locale, \"short\").map((n) => n.replace(/\\.$/, \"\")), [locale]);\n const longNames = React.useMemo(() => monthNames(locale, \"long\"), [locale]);\n const iso = (y: number, m: number) => `${String(y).padStart(4, \"0\")}-${String(m).padStart(2, \"0\")}`;\n const disabled = (m: IsoMonth) => Boolean((min && m < min) || (max && m > max));\n const [focused, setFocused] = React.useState(() => (value && Number(value.slice(0, 4)) === year ? Number(value.slice(5, 7)) : Number(thisMonth.slice(5, 7))));\n const grid = React.useRef<HTMLDivElement>(null);\n const moved = React.useRef(Boolean(autoFocus));\n React.useEffect(() => {\n if (!moved.current) return;\n moved.current = false;\n grid.current?.querySelector<HTMLButtonElement>(`[data-month=\"${iso(year, focused)}\"]`)?.focus();\n }, [year, focused]);\n\n const pick = (m: IsoMonth) => {\n if (valueProp === undefined) setOwn(m);\n onValueChange?.(m);\n };\n const move = (to: number) => {\n moved.current = true;\n const y = year + Math.floor((to - 1) / 12);\n const m = ((((to - 1) % 12) + 12) % 12) + 1;\n if (y !== year) setYear(y);\n setFocused(m);\n };\n const onKeyDown = (event: React.KeyboardEvent) => {\n const moves: Record<string, number> = { ArrowLeft: -1, ArrowRight: 1, ArrowUp: -3, ArrowDown: 3, PageUp: -12, PageDown: 12 };\n if (event.key === \"Home\" || event.key === \"End\") {\n event.preventDefault();\n moved.current = true;\n setFocused(event.key === \"Home\" ? 1 : 12);\n return;\n }\n const by = moves[event.key];\n if (by === undefined) return;\n event.preventDefault();\n move(focused + by);\n };\n const rows = [0, 1, 2, 3].map((r) => [1, 2, 3].map((c) => r * 3 + c));\n return (\n <div className={s.root({ className })}>\n {bare ? null : (\n <div className={s.header()}>\n <button type=\"button\" className={s.nav()} aria-label={labels.previousYear} disabled={Boolean(min && year - 1 < Number(min.slice(0, 4)))} onClick={() => setYear(year - 1)}>\n <ChevronGlyph direction=\"left\" className=\"h-4 w-4\" />\n </button>\n <span className={s.year()} aria-live=\"polite\">\n {year}\n </span>\n <button type=\"button\" className={s.nav()} aria-label={labels.nextYear} disabled={Boolean(max && year + 1 > Number(max.slice(0, 4)))} onClick={() => setYear(year + 1)}>\n <ChevronGlyph direction=\"right\" className=\"h-4 w-4\" />\n </button>\n </div>\n )}\n <div ref={grid} role=\"grid\" aria-label={String(year)} className={s.grid()} key={year} onKeyDown={onKeyDown}>\n {rows.map((row) => (\n <div role=\"row\" key={row[0]} className=\"contents\">\n {row.map((m) => {\n const id = iso(year, m);\n return (\n <div role=\"gridcell\" key={m} aria-selected={id === value || undefined} className=\"flex\">\n <button\n type=\"button\"\n data-month={id}\n tabIndex={m === focused ? 0 : -1}\n aria-current={id === thisMonth ? \"date\" : undefined}\n data-current={id === thisMonth ? \"\" : undefined}\n data-selected={id === value ? \"\" : undefined}\n disabled={disabled(id)}\n className={s.month({ className: \"w-full\" })}\n onClick={() => {\n setFocused(m);\n pick(id);\n }}\n >\n <span aria-hidden>{names[m - 1]}</span>\n <span className=\"sr-only\">{`${longNames[m - 1]} ${year}`}</span>\n </button>\n </div>\n );\n })}\n </div>\n ))}\n </div>\n </div>\n );\n}\n","// Platform-neutral: a date typed as day, month and year (the native `DateField`, the form's `DateField entry=\"parts\"`).\n// Values are ISO calendar dates, `YYYY-MM-DD`, compared as strings.\n\n/** A part of a typed date. */\nexport type DatePart = \"day\" | \"month\" | \"year\";\n\n/** The digits of each part. */\nexport const DATE_PART_LENGTH: Readonly<Record<DatePart, number>> = { day: 2, month: 2, year: 4 };\n\n/** The order of day, month and year in a locale (`en-US` → month, day, year; `fr` → day, month, year). */\nexport function datePartsOrder(locale: string): DatePart[] {\n try {\n const parts = new Intl.DateTimeFormat(locale, { day: \"2-digit\", month: \"2-digit\", year: \"numeric\" }).formatToParts(new Date(2001, 10, 22));\n const order = parts.map((p) => p.type).filter((t): t is DatePart => t === \"day\" || t === \"month\" || t === \"year\");\n if (order.length === 3) return order;\n } catch {\n // An engine without Intl's parts: day, month, year.\n }\n return [\"day\", \"month\", \"year\"];\n}\n\n/** The ISO-ordered value of what was typed: `\"\"` when nothing is, `YYYY-MM-DD` otherwise (not necessarily a real date). */\nexport function composeDate(parts: Readonly<Record<DatePart, string>>): string {\n if (!parts.day && !parts.month && !parts.year) return \"\";\n const pad = (v: string) => (v.length === 1 ? `0${v}` : v);\n return `${parts.year}-${pad(parts.month)}-${pad(parts.day)}`;\n}\n\n/** The parts of a value (`\"\"` → three empty parts). */\nexport function splitDate(value: string | null | undefined): Record<DatePart, string> {\n const m = /^(\\d*)-(\\d*)-(\\d*)$/.exec(value ?? \"\");\n return m ? { year: m[1]!, month: m[2]!, day: m[3]! } : { day: \"\", month: \"\", year: \"\" };\n}\n\n/** True for a real calendar date written `YYYY-MM-DD` (not `2001-02-30`). */\nexport function isRealDate(value: string): boolean {\n if (!/^\\d{4}-\\d{2}-\\d{2}$/.test(value)) return false;\n const date = new Date(`${value}T00:00:00Z`);\n return !Number.isNaN(date.getTime()) && date.toISOString().slice(0, 10) === value;\n}\n\n/** The latest date of birth of someone `age` years old today (`YYYY-MM-DD`): an age gate's `max`, `value <= latestBirthDate(18)`. */\nexport function latestBirthDate(age: number, today = new Date()): string {\n return new Date(Date.UTC(today.getFullYear() - age, today.getMonth(), today.getDate())).toISOString().slice(0, 10);\n}\n\n// ─── Shared by the pickers, web and native (no DOM, no React) ───────────────────────────────────────────────────────\n\n/** The days of a month (`month` 1–12). */\nexport function daysInMonth(year: number, month: number): number {\n return new Date(Date.UTC(year, month, 0)).getUTCDate();\n}\n\n/** `2026-10-11` → `{ year: 2026, month: 10, day: 11 }` (no check: pair it with `isRealDate`). */\nexport function isoParts(iso: string): { year: number; month: number; day: number } {\n const [year = 0, month = 0, day = 0] = iso.split(\"-\").map(Number);\n return { year, month, day };\n}\n\n/** `{ 2026, 10, 11 }` → `2026-10-11`, the day kept inside the month (`2026-02-31` → `2026-02-28`). */\nexport function isoOf(year: number, month: number, day: number): string {\n const d = Math.min(Math.max(day, 1), daysInMonth(year, month));\n return `${String(year).padStart(4, \"0\")}-${String(month).padStart(2, \"0\")}-${String(d).padStart(2, \"0\")}`;\n}\n\n/** The ISO date of today on this device (or of the `Date` given). */\nexport function todayIso(now = new Date()): string {\n return isoOf(now.getFullYear(), now.getMonth() + 1, now.getDate());\n}\n\n/** The age in whole years on `today` of someone born on `birth` (both ISO). */\nexport function ageOn(birth: string, today: string = todayIso()): number {\n const b = isoParts(birth);\n const t = isoParts(today);\n return t.year - b.year - (t.month < b.month || (t.month === b.month && t.day < b.day) ? 1 : 0);\n}\n\n/** The month names of a locale, January first (`long` · `short` · `narrow`). */\nexport function monthNames(locale: string, style: \"long\" | \"short\" | \"narrow\" = \"long\"): string[] {\n const format = new Intl.DateTimeFormat(locale, { month: style, timeZone: \"UTC\" });\n return Array.from({ length: 12 }, (_, i) => format.format(new Date(Date.UTC(2001, i, 1))));\n}\n\n/** The years from `from` to `to`, both included, in that order (descending when `from > to`). */\nexport function yearRange(from: number, to: number): number[] {\n const step = from <= to ? 1 : -1;\n return Array.from({ length: Math.abs(to - from) + 1 }, (_, i) => from + i * step);\n}\n\n/** A time of day, `HH:mm` on 24 hours (`\"09:30\"`, `\"18:00\"`): the value of every time picker. */\nexport type TimeValue = string;\n\n/** `\"9:5\"` / `\"09:05\"` → minutes since midnight; `null` when it is not a time. */\nexport function timeToMinutes(value: string | null | undefined): number | null {\n const m = /^(\\d{1,2}):(\\d{1,2})$/.exec(value ?? \"\");\n if (!m) return null;\n const h = Number(m[1]);\n const min = Number(m[2]);\n return h < 24 && min < 60 ? h * 60 + min : null;\n}\n\n/** Minutes since midnight → `HH:mm`. */\nexport function minutesToTime(minutes: number): TimeValue {\n const m = ((Math.round(minutes) % 1440) + 1440) % 1440;\n return `${String(Math.floor(m / 60)).padStart(2, \"0\")}:${String(m % 60).padStart(2, \"0\")}`;\n}\n\n/** The slots of a day from `start` to `end` (excluded) every `step` minutes: `timeSlots(\"09:00\", \"12:00\", 30)`. */\nexport function timeSlots(start: TimeValue, end: TimeValue, step = 30): TimeValue[] {\n const a = timeToMinutes(start);\n const b = timeToMinutes(end);\n if (a === null || b === null || step <= 0) return [];\n const slots: TimeValue[] = [];\n for (let m = a; m < b; m += step) slots.push(minutesToTime(m));\n return slots;\n}\n\n/** True when the locale writes the time on 12 hours with a day period (`en-US` → true, `fr-CA` → false). */\nexport function uses12Hours(locale: string): boolean {\n try {\n const options = new Intl.DateTimeFormat(locale, { hour: \"numeric\" }).resolvedOptions() as Intl.ResolvedDateTimeFormatOptions & { hourCycle?: string };\n return options.hourCycle ? options.hourCycle === \"h12\" || options.hourCycle === \"h11\" : Boolean(options.hour12);\n } catch {\n return false;\n }\n}\n\n/** The day periods of a locale, morning first (`[\"AM\", \"PM\"]`, `[\"a.m.\", \"p.m.\"]`). */\nexport function dayPeriods(locale: string): [string, string] {\n const format = new Intl.DateTimeFormat(locale, { hour: \"numeric\", hour12: true, timeZone: \"UTC\" });\n const period = (h: number) => format.formatToParts(new Date(Date.UTC(2001, 0, 1, h))).find((p) => p.type === \"dayPeriod\")?.value ?? (h < 12 ? \"AM\" : \"PM\");\n return [period(9), period(15)];\n}\n\n/** A time written the locale's way (`\"18:30\"` → `\"6:30 PM\"` in en-US, `\"18 h 30\"` in fr-CA). */\nexport function formatTime(locale: string, value: TimeValue): string {\n const minutes = timeToMinutes(value);\n if (minutes === null) return \"\";\n return new Intl.DateTimeFormat(locale, { hour: \"numeric\", minute: \"2-digit\", timeZone: \"UTC\" }).format(new Date(Date.UTC(2001, 0, 1, 0, minutes)));\n}\n\n/** A local `Date` at midnight for an ISO date (for formatting). */\nexport const toLocalDate = (iso: string) => {\n const { year, month, day } = isoParts(iso);\n return new Date(year, month - 1, day);\n};\n/** The ISO date of a local `Date`. */\nexport const toIsoDate = (date: Date): string => `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, \"0\")}-${String(date.getDate()).padStart(2, \"0\")}`;\n/** The ISO date `days` later (or earlier). */\nexport const addDays = (iso: string, days: number) => {\n const date = toLocalDate(iso);\n date.setDate(date.getDate() + days);\n return toIsoDate(date);\n};\n/** The ISO date `months` later (or earlier), the day kept inside the shorter months (`01-31` + 1 → `02-28`). */\nexport const addMonths = (iso: string, months: number) => {\n const { year, month, day } = isoParts(iso);\n const first = new Date(year, month - 1 + months, 1);\n return isoOf(first.getFullYear(), first.getMonth() + 1, day);\n};\n\n/** The first day of the week for a locale (0 = Sunday … 6 = Saturday), from `Intl.Locale` week info; Monday otherwise. */\nexport function weekStartOf(locale: string): number {\n try {\n const info = new Intl.Locale(locale) as Intl.Locale & { getWeekInfo?: () => { firstDay: number }; weekInfo?: { firstDay: number } };\n const firstDay = info.getWeekInfo?.().firstDay ?? info.weekInfo?.firstDay;\n return firstDay ? firstDay % 7 : 1;\n } catch {\n return 1;\n }\n}\n\n/** The weeks of a month's grid (six at most), each seven ISO dates from the locale's first day of the week. */\nexport function monthGrid(month: string, weekStartsOn: number): string[][] {\n const first = `${month.slice(0, 7)}-01`;\n const lead = (toLocalDate(first).getDay() - weekStartsOn + 7) % 7;\n const start = addDays(first, -lead);\n const days = Array.from({ length: 42 }, (_, i) => addDays(start, i));\n return Array.from({ length: 6 }, (_, w) => days.slice(w * 7, w * 7 + 7)).filter((week, w) => w < 5 || week[0]!.slice(0, 7) === first.slice(0, 7));\n}\n","// Client. Two ways to give a memorable date — a birth date, an expiry — that a calendar would make slow to reach:\n// `DateField` (day · month · year typed in the locale's order, the next box focused once one is full; the web form's\n// `entry=\"parts\"`) and `DateWheel` (three wheels: the touch idiom, bounded by `min` / `max` — an age gate is\n// `max={latestBirthDate(18)}`). The value is `YYYY-MM-DD` either way, like the native `DateField` and `DateWheel`.\nimport * as React from \"react\";\n\nimport { useControllable } from \"../media\";\nimport { tv } from \"../tv\";\nimport { composeDate, DATE_PART_LENGTH, type DatePart, datePartsOrder, daysInMonth, isoOf, isoParts, monthNames, splitDate, todayIso, yearRange } from \"./parts\";\nimport { Wheel, WheelPicker } from \"./wheel\";\n\nexport const dateField = tv({\n slots: {\n root: \"flex flex-col gap-1.5 border-0 p-0\",\n legend: \"mb-1.5 p-0 text-xs font-semibold text-fg-secondary\",\n row: \"flex gap-2\",\n part: \"flex flex-col gap-1 text-xs text-fg-secondary\",\n input:\n \"h-11 rounded-lg border border-border-default bg-surface-2 px-2 text-center text-base tabular-nums text-fg inset-shadow-well transition-[border-color,box-shadow] \" +\n \"placeholder:text-fg-muted focus-visible:border-accent focus-visible:outline-hidden focus-visible:focus-ring-inset aria-invalid:border-danger disabled:cursor-not-allowed disabled:opacity-50\",\n hint: \"text-xs text-fg-secondary\",\n error: \"flex items-center gap-1.5 text-xs font-medium text-fg-danger before:h-1.5 before:w-1.5 before:shrink-0 before:rounded-full before:bg-danger\",\n },\n});\n\nexport type DateFieldLabels = {\n /** The name of the day (\"Day\"). */\n day: string;\n /** The name of the month (\"Month\"). */\n month: string;\n /** The name of the year (\"Year\"). */\n year: string;\n};\n\nexport const dateFieldLabels: DateFieldLabels = { day: \"Day\", month: \"Month\", year: \"Year\" };\n\ntype Common = {\n /** The visible label, passed translated (the group's name). */\n label: string;\n /** The BCP 47 locale: the order of the parts, the names of the months. */\n locale: string;\n /** A help text under the field (\"For example, 27 3 1990\"). */\n hint?: string;\n /** An error under the field: marks it invalid and is read with it. Replaces the hint. */\n error?: string;\n /** Not available. */\n disabled?: boolean;\n /** The name of a hidden input holding the value, for a plain `<form>` post. */\n name?: string;\n /** The names of the parts, passed translated; English by default. */\n labels?: Partial<DateFieldLabels>;\n /** Classes merged on the root. */\n className?: string;\n};\n\nexport type DateFieldProps = Common & {\n /** The date, `YYYY-MM-DD` (controlled); `\"\"` for none. What is typed comes back as it is, real date or not: the schema decides. */\n value?: string;\n /** The date at first, uncontrolled. */\n defaultValue?: string;\n /** Called on every key with the date typed so far (`\"\"` when the boxes are empty). */\n onValueChange?: (value: string) => void;\n /** Called when the focus leaves the field. */\n onBlur?: () => void;\n /** `bday` for a date of birth: the browser offers to fill it. */\n autoComplete?: \"bday\" | \"off\";\n};\n\nfunction Caption({ id, hint, error }: { id: string; hint?: string; error?: string }) {\n const s = dateField();\n if (error)\n return (\n <p id={`${id}-error`} className={s.error()}>\n {error}\n </p>\n );\n return hint ? (\n <p id={`${id}-hint`} className={s.hint()}>\n {hint}\n </p>\n ) : null;\n}\n\n/** Day · month · year typed in the locale's order: numeric keyboards, the next box focused when one is full. */\nexport function DateField({ label, locale, hint, error, disabled, name, labels: given, className, value: valueProp, defaultValue = \"\", onValueChange, onBlur, autoComplete }: DateFieldProps) {\n const labels = { ...dateFieldLabels, ...given };\n const s = dateField();\n const id = React.useId();\n const [value, setValue] = useControllable<string>(valueProp, defaultValue, onValueChange);\n const order = React.useMemo(() => datePartsOrder(locale), [locale]);\n const [parts, setParts] = React.useState(() => splitDate(value));\n // A value set from outside (a reset, a suggestion) replaces what is in the boxes.\n if ((value ?? \"\") !== composeDate(parts) && composeDate(splitDate(value)) === (value ?? \"\")) setParts(splitDate(value));\n const refs = { day: React.useRef<HTMLInputElement>(null), month: React.useRef<HTMLInputElement>(null), year: React.useRef<HTMLInputElement>(null) };\n const describedBy = error ? `${id}-error` : hint ? `${id}-hint` : undefined;\n return (\n <fieldset className={s.root({ className })} aria-describedby={describedBy} onBlur={(e) => !e.currentTarget.contains(e.relatedTarget as Node | null) && onBlur?.()}>\n <legend className={s.legend()}>{label}</legend>\n <div className={s.row()}>\n {order.map((part: DatePart) => (\n <label key={part} className={s.part()}>\n {labels[part]}\n <input\n ref={refs[part]}\n inputMode=\"numeric\"\n autoComplete={autoComplete === \"bday\" ? `bday-${part}` : \"off\"}\n maxLength={DATE_PART_LENGTH[part]}\n value={parts[part]}\n disabled={disabled}\n aria-invalid={error ? true : undefined}\n className={s.input({ className: part === \"year\" ? \"w-20\" : \"w-14\" })}\n onChange={(e) => {\n const digits = e.target.value.replace(/\\D/g, \"\").slice(0, DATE_PART_LENGTH[part]);\n const next = { ...parts, [part]: digits };\n setParts(next);\n setValue(composeDate(next));\n const following = order[order.indexOf(part) + 1];\n if (digits.length === DATE_PART_LENGTH[part] && following) refs[following].current?.focus();\n }}\n />\n </label>\n ))}\n </div>\n {name ? <input type=\"hidden\" name={name} value={value ?? \"\"} /> : null}\n <Caption id={id} hint={hint} error={error} />\n </fieldset>\n );\n}\n\nexport type DateWheelProps = Common & {\n /** The date, `YYYY-MM-DD` (controlled); `\"\"` or `null` for none (the wheels then rest on `defaultView`). */\n value?: string | null;\n /** The date at first, uncontrolled. */\n defaultValue?: string | null;\n /** Called with the date under the band, always a real date within `min` / `max`. */\n onValueChange?: (value: string) => void;\n /** The earliest date (ISO): the years start there, the days before it are refused. Default: 120 years ago. */\n min?: string;\n /** The latest date (ISO): `latestBirthDate(18)` for an age gate. Default: today. */\n max?: string;\n /** Where the wheels rest while there is no value. Default: `max` (a birth date: the youngest allowed). */\n defaultView?: string;\n};\n\n/** Day, month and year as three wheels in the locale's order, bounded by `min` and `max`: always a real date. */\nexport function DateWheel({ label, locale, hint, error, disabled, name, labels: given, className, value: valueProp, defaultValue = null, onValueChange, min, max, defaultView }: DateWheelProps) {\n const labels = { ...dateFieldLabels, ...given };\n const id = React.useId();\n const [value, setValue] = useControllable<string | null>(valueProp, defaultValue, (v) => v && onValueChange?.(v));\n const today = todayIso();\n const hi = max ?? today;\n const lo = min ?? isoOf(Number(today.slice(0, 4)) - 120, 1, 1);\n const shown = value || defaultView || hi;\n const { year, month, day } = isoParts(shown);\n const order = React.useMemo(() => datePartsOrder(locale), [locale]);\n const months = React.useMemo(() => monthNames(locale, \"long\"), [locale]);\n const number = React.useMemo(() => new Intl.NumberFormat(locale, { useGrouping: false }), [locale]);\n const inBounds = (iso: string) => iso >= lo && iso <= hi;\n const set = (y: number, m: number, d: number) => {\n let next = isoOf(y, m, d);\n if (next > hi) next = hi;\n if (next < lo) next = lo;\n setValue(next);\n };\n const lastDay = daysInMonth(year, month);\n const columns: Record<DatePart, React.ReactNode> = {\n day: (\n <Wheel\n key=\"day\"\n label={labels.day}\n disabled={disabled}\n options={Array.from({ length: lastDay }, (_, i) => ({ value: String(i + 1), label: number.format(i + 1), disabled: !inBounds(isoOf(year, month, i + 1)) }))}\n value={String(Math.min(day, lastDay))}\n onValueChange={(v) => set(year, month, Number(v))}\n className=\"min-w-14\"\n />\n ),\n month: (\n <Wheel\n key=\"month\"\n label={labels.month}\n disabled={disabled}\n options={months.map((n, i) => ({ value: String(i + 1), label: n, disabled: isoOf(year, i + 1, daysInMonth(year, i + 1)) < lo || isoOf(year, i + 1, 1) > hi }))}\n value={String(month)}\n onValueChange={(v) => set(year, Number(v), day)}\n className=\"min-w-32 capitalize\"\n />\n ),\n year: (\n <Wheel\n key=\"year\"\n label={labels.year}\n disabled={disabled}\n options={yearRange(Number(hi.slice(0, 4)), Number(lo.slice(0, 4))).map((y) => ({ value: String(y), label: number.format(y) }))}\n value={String(year)}\n onValueChange={(v) => set(Number(v), month, day)}\n className=\"min-w-20\"\n />\n ),\n };\n return (\n <div className={dateField().root({ className })}>\n <span aria-hidden className={dateField().legend()}>\n {label}\n </span>\n <WheelPicker label={label} aria-describedby={error ? `${id}-error` : hint ? `${id}-hint` : undefined} invalid={Boolean(error)}>{order.map((part) => columns[part])}</WheelPicker>\n {name ? <input type=\"hidden\" name={name} value={value ?? \"\"} /> : null}\n <Caption id={id} hint={hint} error={error} />\n </div>\n );\n}\n","// Client. A wheel: a column of values that turns under a lit band — the touch idiom of a time, a date of birth, a\n// quantity. Each column is a `spinbutton` for assistive technologies and the keyboard (Up / Down, Page Up / Page Down by\n// five, Home / End), its value read as words (`aria-valuetext`); the hand scrolls it (scroll snap) or clicks a value.\n// The curve is a scroll-driven animation (CSS `animation-timeline: view()`): no script per frame, flat where unsupported.\nimport * as React from \"react\";\n\nimport { usePrefersReducedMotion } from \"../media\";\nimport { tv } from \"../tv\";\n\n/** A value of a wheel: what is stored, and its words (passed translated or formatted for the locale). */\nexport type WheelOption = { value: string; label: string; disabled?: boolean };\n\nexport const wheel = tv({\n slots: {\n root: \"relative inline-flex select-none items-stretch gap-1 rounded-2xl border border-border-default data-[invalid]:border-danger bg-surface-1 bg-sheen px-2 shadow-raised inset-shadow-edge\",\n band: \"pointer-events-none absolute inset-x-1.5 top-1/2 -translate-y-1/2 rounded-xl border border-border-subtle bg-surface-3 inset-shadow-well\",\n column:\n \"relative z-[1] min-w-14 flex-1 rounded-xl outline-hidden focus-visible:focus-ring-inset data-[disabled]:pointer-events-none data-[disabled]:opacity-40\",\n scroller:\n \"kz-wheel h-full snap-y snap-mandatory overflow-y-auto overscroll-contain [scrollbar-width:none] [&::-webkit-scrollbar]:hidden \" +\n \"[mask-image:linear-gradient(to_bottom,transparent,#000_30%,#000_70%,transparent)]\",\n item:\n \"kz-wheel-item flex snap-center items-center justify-center px-2 text-base tabular-nums text-fg-secondary transition-colors \" +\n \"data-[selected]:font-semibold data-[selected]:text-fg data-[disabled]:text-fg-muted data-[disabled]:line-through\",\n divider: \"z-[1] self-center text-base font-semibold text-fg-secondary\",\n },\n});\n\nconst ITEM = 40;\n\nexport type WheelProps = {\n /** The column's accessible name (\"Hour\", \"Month\"), passed translated. */\n label: string;\n /** The values, in order. */\n options: readonly WheelOption[];\n /** The chosen value (controlled). */\n value?: string | null;\n /** The chosen value at first, uncontrolled. Default: the first one. */\n defaultValue?: string;\n /** Called with the value that comes to rest under the band. */\n onValueChange?: (value: string) => void;\n /** Not available. */\n disabled?: boolean;\n /** Classes merged on the column (a width: `w-20`). */\n className?: string;\n};\n\nexport type WheelPickerProps = {\n /** The group's accessible name (\"Departure time\"), passed translated. */\n label: string;\n /** The wheels (`Wheel`), and dividers (`WheelDivider`) between them. */\n children: React.ReactNode;\n /** How many values are visible: 3, 5 (default) or 7. */\n visible?: 3 | 5 | 7;\n /** The help text or the error that describes the group (their ids). */\n \"aria-describedby\"?: string;\n /** Marks the group invalid (a danger edge): pair it with an error read through `aria-describedby`. */\n invalid?: boolean;\n /** Classes merged on the root. */\n className?: string;\n};\n\nconst VisibleContext = React.createContext(5);\n\n/** The frame of one or several wheels: a raised surface, the lit band across them, a group named by `label`. */\nexport function WheelPicker({ label, children, visible = 5, \"aria-describedby\": describedBy, invalid, className }: WheelPickerProps) {\n const s = wheel();\n return (\n <VisibleContext.Provider value={visible}>\n <div role=\"group\" aria-label={label} aria-describedby={describedBy} data-invalid={invalid ? \"\" : undefined} className={s.root({ className })} style={{ height: ITEM * visible }}>\n <span aria-hidden className={s.band()} style={{ height: ITEM }} />\n {children}\n </div>\n </VisibleContext.Provider>\n );\n}\n\n/** A divider between two wheels (`:` between the hours and the minutes). */\nexport function WheelDivider({ children }: { children: React.ReactNode }) {\n return (\n <span aria-hidden className={wheel().divider()}>\n {children}\n </span>\n );\n}\n\nconst nearestEnabled = (options: readonly WheelOption[], index: number) => {\n for (let d = 0; d < options.length; d++) {\n if (options[index + d] && !options[index + d]!.disabled) return index + d;\n if (options[index - d] && !options[index - d]!.disabled) return index - d;\n }\n return index;\n};\n\n/** One column of a `WheelPicker`: a spinbutton over a scroll-snapped list of values. */\nexport function Wheel({ label, options, value: valueProp, defaultValue, onValueChange, disabled, className }: WheelProps) {\n const s = wheel();\n const visible = React.useContext(VisibleContext);\n const [own, setOwn] = React.useState(defaultValue ?? options[0]?.value ?? \"\");\n const value = valueProp ?? own;\n const index = Math.max(0, options.findIndex((o) => o.value === value));\n const scroller = React.useRef<HTMLDivElement>(null);\n const settle = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n const programmatic = React.useRef(false);\n const reduce = usePrefersReducedMotion();\n const mounted = React.useRef(false);\n\n const commit = React.useCallback(\n (i: number) => {\n const target = nearestEnabled(options, Math.min(options.length - 1, Math.max(0, i)));\n const option = options[target];\n if (!option) return;\n if (valueProp === undefined) setOwn(option.value);\n if (option.value !== value) onValueChange?.(option.value);\n },\n [options, valueProp, value, onValueChange],\n );\n\n // The list follows the value (a key, a click, a change from outside): at once the first time, smoothly after.\n React.useEffect(() => {\n const el = scroller.current;\n if (!el) return;\n const top = index * ITEM;\n if (Math.abs(el.scrollTop - top) < 1) return;\n programmatic.current = true;\n if (typeof el.scrollTo === \"function\") el.scrollTo({ top, behavior: mounted.current && !reduce ? \"smooth\" : \"auto\" });\n else el.scrollTop = top;\n mounted.current = true;\n const t = setTimeout(() => (programmatic.current = false), 400);\n return () => clearTimeout(t);\n }, [index, reduce]);\n\n const onScroll = () => {\n if (programmatic.current) return;\n if (settle.current) clearTimeout(settle.current);\n settle.current = setTimeout(() => {\n const el = scroller.current;\n if (el) commit(Math.round(el.scrollTop / ITEM));\n }, 90);\n };\n React.useEffect(() => () => void (settle.current && clearTimeout(settle.current)), []);\n\n const onKeyDown = (event: React.KeyboardEvent) => {\n const step = (by: number) => {\n let i = index + by;\n while (options[i]?.disabled) i += Math.sign(by);\n return options[i] ? i : index;\n };\n const moves: Record<string, () => number> = {\n ArrowUp: () => step(-1),\n ArrowDown: () => step(1),\n PageUp: () => Math.max(0, nearestEnabled(options, index - 5)),\n PageDown: () => Math.min(options.length - 1, nearestEnabled(options, index + 5)),\n Home: () => nearestEnabled(options, 0),\n End: () => nearestEnabled(options, options.length - 1),\n };\n const move = moves[event.key];\n if (!move) return;\n event.preventDefault();\n commit(move());\n };\n\n const pad = ((visible - 1) / 2) * ITEM;\n const current = options[index];\n return (\n <div\n role=\"spinbutton\"\n tabIndex={disabled ? -1 : 0}\n aria-label={label}\n aria-valuenow={index}\n aria-valuemin={0}\n aria-valuemax={Math.max(0, options.length - 1)}\n aria-valuetext={current?.label}\n aria-disabled={disabled || undefined}\n data-disabled={disabled ? \"\" : undefined}\n className={s.column({ className })}\n onKeyDown={onKeyDown}\n >\n <div ref={scroller} aria-hidden className={s.scroller()} style={{ paddingBlock: pad, scrollPaddingBlock: pad }} onScroll={onScroll}>\n {options.map((o, i) => (\n <div\n key={o.value}\n data-value={o.value}\n data-selected={i === index ? \"\" : undefined}\n data-disabled={o.disabled ? \"\" : undefined}\n className={s.item()}\n style={{ height: ITEM }}\n onClick={() => !o.disabled && commit(i)}\n >\n {o.label}\n </div>\n ))}\n </div>\n </div>\n );\n}\n","// Client (a portal). A field-like button that opens the `Calendar` in a Popover (Radix: Escape closes, the focus\n// returns to the button). The value is an ISO date (`\"2026-10-11\"`) — the same string in a form, an address and an\n// API; the button reads it in the `locale`'s own format through `@krizaka/intl`.\nimport { formatDate, getDateTimeFormat } from \"@krizaka/intl\";\nimport * as React from \"react\";\n\nimport { CalendarGlyph, CloseGlyph } from \"../glyphs\";\nimport { useControllable } from \"../media\";\nimport { Popover } from \"../popover\";\nimport { tv } from \"../tv\";\nimport { Calendar, type CalendarLabels, calendarLabels, type CalendarProps, type DateRange, type IsoDate, toLocalDate } from \"./calendar\";\n\nexport const datePicker = tv({\n slots: {\n root: \"flex w-full flex-col gap-1.5\",\n label: \"text-xs font-semibold text-fg-secondary\",\n row: \"relative flex w-full\",\n // The field is a well (inset), the calendar opens on a raised, lit surface.\n trigger:\n \"group flex h-11 w-full items-center gap-2.5 rounded-lg border border-border-default bg-surface-2 px-3 text-left text-sm text-fg inset-shadow-well \" +\n \"transition-[border-color,box-shadow] hover:border-border-strong focus-visible:border-accent focus-visible:outline-hidden focus-visible:focus-ring-inset \" +\n \"data-[state=open]:border-accent data-[placeholder]:text-fg-muted aria-invalid:border-danger disabled:cursor-not-allowed disabled:opacity-50 data-[clearable]:pr-10\",\n icon: \"h-4 w-4 shrink-0 text-fg-secondary transition-colors group-data-[state=open]:text-fg-accent\",\n clear:\n \"absolute right-1.5 top-1/2 inline-flex h-8 w-8 -translate-y-1/2 items-center justify-center rounded-md text-fg-secondary hover:bg-surface-3 hover:text-fg \" +\n \"focus-visible:outline-hidden focus-visible:focus-ring\",\n content: \"w-auto rounded-2xl bg-sheen p-4 shadow-floating inset-shadow-edge\",\n layout: \"flex flex-col gap-4 sm:flex-row\",\n presets: \"flex gap-1.5 overflow-x-auto pb-1 sm:w-40 sm:flex-col sm:overflow-visible sm:border-r sm:border-border-subtle sm:pb-0 sm:pr-4\",\n preset:\n \"inline-flex shrink-0 items-center gap-2.5 whitespace-nowrap rounded-lg px-2.5 py-2 text-left text-xs font-semibold text-fg-secondary transition-colors \" +\n \"hover:bg-surface-3 hover:text-fg focus-visible:outline-hidden focus-visible:focus-ring aria-pressed:bg-accent-soft aria-pressed:text-fg\",\n presetNode: \"node shrink-0 group-aria-pressed:node-lit\",\n hint: \"text-xs text-fg-secondary\",\n error: \"flex items-center gap-1.5 text-xs font-medium text-fg-danger before:h-1.5 before:w-1.5 before:shrink-0 before:rounded-full before:bg-danger\",\n },\n});\n\nexport type DatePickerLabels = CalendarLabels & {\n /** The clear button (\"Clear date\"). */\n clear: string;\n};\n\nexport const datePickerLabels: DatePickerLabels = { ...calendarLabels, clear: \"Clear date\" };\n\ntype Shared = Pick<CalendarProps, \"locale\" | \"min\" | \"max\" | \"isDateDisabled\" | \"weekStartsOn\" | \"today\"> & {\n /** The visible label, passed translated (also the button's accessible name, with the value). */\n label: string;\n /** Shown while nothing is chosen (\"Pick a date\"), passed translated. */\n placeholder?: string;\n /** `short` · `medium` (default) · `long`: how the button writes the date. */\n format?: \"short\" | \"medium\" | \"long\";\n /** Adds a button that empties the value. */\n clearable?: boolean;\n /** A help text under the field. */\n hint?: string;\n /** An error under the field: marks it invalid and is read with it. */\n error?: string;\n /** Not available. */\n disabled?: boolean;\n /** The name of a hidden input holding the ISO value, for a plain `<form>` post. */\n name?: string;\n /** Opens the calendar at first (a story, a test). */\n defaultOpen?: boolean;\n /** The words, passed translated; English by default. */\n labels?: Partial<DatePickerLabels>;\n /** Classes merged on the root. */\n className?: string;\n};\n\nexport type DatePickerProps = Shared & {\n /** The chosen date, ISO (controlled); `null` for none. */\n value?: IsoDate | null;\n /** The chosen date at first, uncontrolled. */\n defaultValue?: IsoDate | null;\n /** Called with the date picked, or `null` when cleared. */\n onValueChange?: (value: IsoDate | null) => void;\n};\n\nfunction Field({\n shared,\n text,\n hasValue,\n onClear,\n hidden,\n open,\n setOpen,\n children,\n}: {\n shared: Shared;\n text: string | null;\n hasValue: boolean;\n onClear: () => void;\n hidden: string;\n open: boolean;\n setOpen: (open: boolean) => void;\n children: React.ReactNode;\n}) {\n const { label, placeholder, clearable, hint, error, disabled, name, className } = shared;\n const labels = { ...datePickerLabels, ...shared.labels };\n const s = datePicker();\n const id = React.useId();\n const describedBy = [hint ? `${id}-hint` : null, error ? `${id}-error` : null].filter(Boolean).join(\" \") || undefined;\n return (\n <div className={s.root({ className })}>\n <label htmlFor={`${id}-trigger`} className={s.label()}>\n {label}\n </label>\n <Popover.Root open={open} onOpenChange={setOpen}>\n <div className={s.row()}>\n <Popover.Trigger asChild>\n <button\n id={`${id}-trigger`}\n type=\"button\"\n aria-haspopup=\"dialog\"\n aria-describedby={describedBy}\n aria-invalid={error ? true : undefined}\n disabled={disabled}\n data-placeholder={hasValue ? undefined : \"\"}\n data-clearable={clearable && hasValue ? \"\" : undefined}\n className={s.trigger()}\n >\n <CalendarGlyph className={s.icon()} />\n <span className=\"truncate\">{text ?? placeholder ?? \"\"}</span>\n </button>\n </Popover.Trigger>\n {clearable && hasValue && !disabled ? (\n <button type=\"button\" aria-label={labels.clear} className={s.clear()} onClick={onClear}>\n <CloseGlyph className=\"h-4 w-4\" />\n </button>\n ) : null}\n </div>\n <Popover.Content align=\"start\" aria-label={label} className={s.content()}>\n {children}\n </Popover.Content>\n </Popover.Root>\n {name ? <input type=\"hidden\" name={name} value={hidden} /> : null}\n {hint ? (\n <p id={`${id}-hint`} className={s.hint()}>\n {hint}\n </p>\n ) : null}\n {error ? (\n <p id={`${id}-error`} className={s.error()}>\n {error}\n </p>\n ) : null}\n </div>\n );\n}\n\n/** A date field: a button showing the date in the locale's format, a calendar in a popover, an ISO value. */\nexport function DatePicker({ value: valueProp, defaultValue = null, onValueChange, defaultOpen = false, ...shared }: DatePickerProps) {\n const [value, setValue] = useControllable<IsoDate | null>(valueProp, defaultValue, onValueChange);\n const [open, setOpen] = React.useState(defaultOpen);\n const { locale, format = \"medium\" } = shared;\n return (\n <Field\n shared={shared}\n text={value ? formatDate(toLocalDate(value), { locale, style: format }) : null}\n hasValue={Boolean(value)}\n onClear={() => setValue(null)}\n hidden={value ?? \"\"}\n open={open}\n setOpen={setOpen}\n >\n <Calendar\n {...shared}\n autoFocus\n value={value}\n onSelect={(date) => {\n setValue(date);\n setOpen(false);\n }}\n />\n </Field>\n );\n}\n\nexport type DateRangePreset = {\n /** Its name, passed translated (\"Last 7 days\"). */\n label: string;\n /** The first day, ISO. */\n start: IsoDate;\n /** The last day, ISO. */\n end: IsoDate;\n};\n\nexport type DateRangePickerProps = Shared & {\n /** The chosen range (controlled); `null` for none. `end` is never `null` in a committed value. */\n value?: { start: IsoDate; end: IsoDate } | null;\n /** The range at first, uncontrolled. */\n defaultValue?: { start: IsoDate; end: IsoDate } | null;\n /** Called once both ends are chosen (or with `null` when cleared). */\n onValueChange?: (value: { start: IsoDate; end: IsoDate } | null) => void;\n /** Ranges one click away (\"Last 7 days\", \"This month\"), beside the calendar. */\n presets?: readonly DateRangePreset[];\n /** Two months side by side (default, from a phone's width up) or one. */\n numberOfMonths?: 1 | 2;\n};\n\n/** Formats a range as the locale writes one (\"Oct 1 – 11, 2026\"), through Intl's `formatRange` where available. */\nfunction formatRange(locale: string, start: IsoDate, end: IsoDate, style: \"short\" | \"medium\" | \"long\") {\n const formatter = getDateTimeFormat(locale, { dateStyle: style }) as Intl.DateTimeFormat & { formatRange?: (a: Date, b: Date) => string };\n return formatter.formatRange\n ? formatter.formatRange(toLocalDate(start), toLocalDate(end))\n : `${formatter.format(toLocalDate(start))} – ${formatter.format(toLocalDate(end))}`;\n}\n\n/** A period field: two clicks on one calendar (the days between tinted as you hover), optional presets. */\nexport function DateRangePicker({ value: valueProp, defaultValue = null, onValueChange, presets, numberOfMonths = 2, defaultOpen = false, ...shared }: DateRangePickerProps) {\n const [value, setValue] = useControllable(valueProp, defaultValue, onValueChange);\n const [draft, setDraft] = React.useState<DateRange | null>(null);\n const [open, setOpenState] = React.useState(defaultOpen);\n const { locale, format = \"medium\" } = shared;\n const s = datePicker();\n const setOpen = (next: boolean) => {\n setOpenState(next);\n setDraft(null);\n };\n const shown: DateRange | null = draft ?? value;\n const pick = (date: IsoDate) => {\n if (!draft) setDraft({ start: date, end: null });\n else {\n const [start, end] = date < draft.start ? [date, draft.start] : [draft.start, date];\n setValue({ start, end });\n setOpen(false);\n }\n };\n return (\n <Field\n shared={shared}\n text={value ? formatRange(locale, value.start, value.end, format) : null}\n hasValue={Boolean(value)}\n onClear={() => setValue(null)}\n hidden={value ? `${value.start}/${value.end}` : \"\"}\n open={open}\n setOpen={setOpen}\n >\n <div className={s.layout()}>\n {presets?.length ? (\n <div className={s.presets()}>\n {presets.map((preset) => (\n <button\n key={preset.label}\n type=\"button\"\n aria-pressed={value?.start === preset.start && value?.end === preset.end}\n className={s.preset({ className: \"group\" })}\n onClick={() => {\n setValue({ start: preset.start, end: preset.end });\n setOpen(false);\n }}\n >\n <span aria-hidden className={s.presetNode()} />\n {preset.label}\n </button>\n ))}\n </div>\n ) : null}\n <Calendar {...shared} autoFocus range={shown} onSelect={pick} numberOfMonths={numberOfMonths} />\n </div>\n </Field>\n );\n}\n","// Client (a portal). Radix places the content, traps nothing, closes on Escape and on an outside click, and returns\n// the focus to the trigger.\nimport { Popover as PopoverPrimitive } from \"radix-ui\";\nimport type * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { floating } from \"../floating\";\n\nexport type PopoverContentProps = React.ComponentProps<typeof PopoverPrimitive.Content> & {\n /** The element the portal renders into (default: document.body). */\n container?: HTMLElement | null;\n};\n\nexport function PopoverContent({ sideOffset = 8, collisionPadding = 8, container, className, ...props }: PopoverContentProps) {\n return (\n <PopoverPrimitive.Portal container={container}>\n <PopoverPrimitive.Content\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n className={cn(floating, \"w-72 max-w-(--radix-popover-content-available-width) p-4 origin-(--radix-popover-content-transform-origin)\", className)}\n {...props}\n />\n </PopoverPrimitive.Portal>\n );\n}\n\n/** `Popover.Root/Trigger/Anchor/Content/Close`. `open`/`defaultOpen` + `onOpenChange`. */\nexport const Popover = {\n Root: PopoverPrimitive.Root,\n Trigger: PopoverPrimitive.Trigger,\n Anchor: PopoverPrimitive.Anchor,\n Close: PopoverPrimitive.Close,\n Content: PopoverContent,\n};\n","// Client. The days ahead as a strip that scrolls sideways — the agenda of the next two weeks, a delivery day, a\n// session. A radio group: one tab stop, the arrows move and pick (Home / End: the first and last day), each day named by\n// its full date; a marked day (it has something) says so in its name. The buttons at the ends page by a screen.\nimport { formatDate, getDateTimeFormat } from \"@krizaka/intl\";\nimport * as React from \"react\";\n\nimport { ChevronGlyph } from \"../glyphs\";\nimport { useControllable, usePrefersReducedMotion } from \"../media\";\nimport { tv } from \"../tv\";\nimport { addDays, type IsoDate, toIsoDate, toLocalDate } from \"./calendar\";\n\nexport const dayStrip = tv({\n slots: {\n root: \"flex w-full min-w-0 flex-col gap-2\",\n header: \"flex items-center justify-between gap-2\",\n title: \"text-sm font-semibold capitalize text-fg\",\n navs: \"flex gap-1.5\",\n nav:\n \"inline-flex h-8 w-8 items-center justify-center rounded-lg border border-border-subtle bg-surface-2 bg-sheen text-fg-secondary inset-shadow-edge \" +\n \"transition-colors hover:border-border-strong hover:text-fg focus-visible:outline-hidden focus-visible:focus-ring disabled:pointer-events-none disabled:opacity-35\",\n track:\n \"-mx-1 flex snap-x snap-mandatory gap-2 overflow-x-auto scroll-smooth px-1 py-1.5 [scrollbar-width:none] motion-reduce:scroll-auto [&::-webkit-scrollbar]:hidden\",\n day:\n \"relative flex h-[4.5rem] w-14 shrink-0 snap-start flex-col items-center justify-center gap-0.5 rounded-2xl border border-border-default bg-surface-2 bg-sheen text-fg inset-shadow-edge \" +\n \"transition-[background-color,border-color,box-shadow,transform] duration-150 hover:border-border-strong active:scale-95 \" +\n \"motion-reduce:transition-none motion-reduce:active:scale-100 focus-visible:outline-hidden focus-visible:focus-ring \" +\n \"aria-checked:border-transparent aria-checked:bg-accent aria-checked:bg-fill-shade aria-checked:text-on-accent aria-checked:shadow-glow aria-checked:inset-shadow-edge-fill \" +\n \"disabled:cursor-not-allowed disabled:border-dashed disabled:bg-transparent disabled:bg-none disabled:text-fg-muted disabled:shadow-none\",\n weekday: \"text-[11px] font-semibold uppercase tracking-wider text-fg-secondary group-aria-checked:text-on-accent group-disabled:text-fg-muted\",\n number: \"text-lg font-semibold tabular-nums leading-none\",\n // Today: the node of the marks above the number; a marked day: a dot under it.\n node: \"absolute top-1.5 h-1 w-1 rotate-45 rounded-[1px] bg-accent group-aria-checked:bg-on-accent\",\n mark: \"h-1.5 w-1.5 rounded-full bg-fg-secondary group-aria-checked:bg-on-accent\",\n noMark: \"h-1.5 w-1.5\",\n },\n});\n\nexport type DayStripLabels = {\n /** The button that shows the earlier days (\"Earlier days\"). */\n previous: string;\n /** The button that shows the later days (\"Later days\"). */\n next: string;\n /** Added to the name of a marked day (\"has events\"). */\n marked: string;\n};\n\nexport const dayStripLabels: DayStripLabels = { previous: \"Earlier days\", next: \"Later days\", marked: \"has events\" };\n\nexport type DayStripProps = {\n /** The group's accessible name (\"Delivery day\"), passed translated. */\n label: string;\n /** The BCP 47 locale of the names and the dates: always explicit. */\n locale: string;\n /** The chosen day, ISO (controlled); `null` for none. */\n value?: IsoDate | null;\n /** The chosen day at first, uncontrolled. */\n defaultValue?: IsoDate | null;\n /** Called with the day picked. */\n onValueChange?: (value: IsoDate) => void;\n /** The first day of the strip. Default: today. */\n start?: IsoDate;\n /** How many days. Default 14. */\n days?: number;\n /** Refuses some days (closed, full): drawn dashed, skipped by the arrows. */\n isDateDisabled?: (date: IsoDate) => boolean;\n /** Marks the days that have something (a session, an event): a dot, and `labels.marked` in their name. */\n isDateMarked?: (date: IsoDate) => boolean;\n /** Today (marked by the node): inject it for a stable render or a test. Default: the device's date. */\n today?: IsoDate;\n /** Shows the month of the chosen day (or of the first) and the page buttons above the strip. */\n showHeader?: boolean;\n /** The words, passed translated; English by default. */\n labels?: Partial<DayStripLabels>;\n /** Classes merged on the root. */\n className?: string;\n};\n\n/** The days ahead in a row that scrolls sideways: one picked, today and the marked days shown. */\nexport function DayStrip({ label, locale, value: valueProp, defaultValue = null, onValueChange, start, days = 14, isDateDisabled, isDateMarked, today: todayProp, showHeader = true, labels: given, className }: DayStripProps) {\n const labels = { ...dayStripLabels, ...given };\n const s = dayStrip();\n const today = todayProp ?? toIsoDate(new Date());\n const first = start ?? today;\n const list = React.useMemo(() => Array.from({ length: days }, (_, i) => addDays(first, i)), [first, days]);\n const [value, setValue] = useControllable<IsoDate | null>(valueProp, defaultValue, (v) => v && onValueChange?.(v));\n const enabled = list.filter((d) => !isDateDisabled?.(d));\n const tabStop = value && enabled.includes(value) ? value : enabled[0];\n const track = React.useRef<HTMLDivElement>(null);\n const reduce = usePrefersReducedMotion();\n const weekday = getDateTimeFormat(locale, { weekday: \"short\" });\n const monthTitle = getDateTimeFormat(locale, { month: \"long\", year: \"numeric\" }).format(toLocalDate(value ?? first));\n\n const reveal = (iso: IsoDate, focus: boolean) => {\n const el = track.current?.querySelector<HTMLButtonElement>(`[data-date=\"${iso}\"]`);\n if (!el) return;\n if (focus) el.focus({ preventScroll: true });\n el.scrollIntoView?.({ block: \"nearest\", inline: \"nearest\", behavior: reduce ? \"auto\" : \"smooth\" });\n };\n // The chosen day is in view when the strip appears.\n React.useEffect(() => {\n if (value) track.current?.querySelector<HTMLElement>(`[data-date=\"${value}\"]`)?.scrollIntoView?.({ block: \"nearest\", inline: \"center\" });\n // Only once: afterwards the person scrolls.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const onKeyDown = (event: React.KeyboardEvent) => {\n const i = enabled.indexOf(tabStop ?? \"\");\n const moves: Record<string, number> = { ArrowRight: i + 1, ArrowDown: i + 1, ArrowLeft: i - 1, ArrowUp: i - 1, Home: 0, End: enabled.length - 1 };\n const to = moves[event.key];\n if (to === undefined) return;\n event.preventDefault();\n const next = enabled[Math.min(enabled.length - 1, Math.max(0, to))];\n if (!next) return;\n setValue(next);\n reveal(next, true);\n };\n const page = (by: number) => {\n const el = track.current;\n if (!el) return;\n el.scrollBy?.({ left: by * el.clientWidth * 0.8, behavior: reduce ? \"auto\" : \"smooth\" });\n };\n\n return (\n <div className={s.root({ className })}>\n {showHeader ? (\n <div className={s.header()}>\n <span className={s.title()} aria-hidden>\n {monthTitle}\n </span>\n <span className={s.navs()}>\n <button type=\"button\" className={s.nav()} aria-label={labels.previous} onClick={() => page(-1)}>\n <ChevronGlyph direction=\"left\" className=\"h-4 w-4\" />\n </button>\n <button type=\"button\" className={s.nav()} aria-label={labels.next} onClick={() => page(1)}>\n <ChevronGlyph direction=\"right\" className=\"h-4 w-4\" />\n </button>\n </span>\n </div>\n ) : null}\n <div ref={track} role=\"radiogroup\" aria-label={label} className={s.track()} onKeyDown={onKeyDown}>\n {list.map((iso) => {\n const marked = Boolean(isDateMarked?.(iso));\n const name = formatDate(toLocalDate(iso), { locale, style: \"long\" });\n return (\n <button\n key={iso}\n type=\"button\"\n role=\"radio\"\n data-date={iso}\n aria-checked={iso === value}\n aria-current={iso === today ? \"date\" : undefined}\n aria-label={marked ? `${name}, ${labels.marked}` : name}\n tabIndex={iso === tabStop ? 0 : -1}\n disabled={Boolean(isDateDisabled?.(iso))}\n className={s.day({ className: \"group\" })}\n onClick={() => setValue(iso)}\n >\n {iso === today ? <span aria-hidden className={s.node()} /> : null}\n <span aria-hidden className={s.weekday()}>\n {weekday.format(toLocalDate(iso)).replace(/\\.$/, \"\")}\n </span>\n <span aria-hidden className={s.number()}>\n {Number(iso.slice(8))}\n </span>\n <span aria-hidden className={marked ? s.mark() : s.noMark()} />\n </button>\n );\n })}\n </div>\n </div>\n );\n}\n","// Client. A time of day, `HH:mm` on 24 hours whatever the locale shows: as wheels (hours, minutes by a step, the day\n// period where the locale uses one) or as slots (the free times of an agenda, a radio group: one tab stop, the arrows\n// move and pick). The words come from Intl for the `locale` given.\nimport * as React from \"react\";\n\nimport { useControllable } from \"../media\";\nimport { tv } from \"../tv\";\nimport { dayPeriods, formatTime, timeToMinutes, type TimeValue, uses12Hours } from \"./parts\";\nimport { Wheel, WheelDivider, type WheelOption, WheelPicker } from \"./wheel\";\n\nexport const timePicker = tv({\n slots: {\n slots: \"grid grid-cols-[repeat(auto-fill,minmax(5.5rem,1fr))] gap-2\",\n slot:\n \"h-11 rounded-xl border border-border-default bg-surface-2 bg-sheen px-3 text-sm font-semibold tabular-nums text-fg inset-shadow-edge \" +\n \"transition-[background-color,border-color,box-shadow,transform] duration-150 hover:border-border-strong active:scale-[0.97] \" +\n \"motion-reduce:transition-none motion-reduce:active:scale-100 focus-visible:outline-hidden focus-visible:focus-ring \" +\n \"aria-checked:border-transparent aria-checked:bg-accent aria-checked:bg-fill-shade aria-checked:text-on-accent aria-checked:shadow-glow aria-checked:inset-shadow-edge-fill \" +\n \"disabled:cursor-not-allowed disabled:border-dashed disabled:bg-transparent disabled:bg-none disabled:font-normal disabled:text-fg-muted disabled:line-through disabled:shadow-none\",\n group: \"flex flex-col gap-2\",\n heading: \"text-[11px] font-semibold uppercase tracking-wider text-fg-secondary\",\n },\n});\n\nexport type TimePickerLabels = {\n /** The hours' wheel (\"Hours\"). */\n hours: string;\n /** The minutes' wheel (\"Minutes\"). */\n minutes: string;\n /** The day period's wheel (\"AM/PM\"). */\n period: string;\n};\n\nexport const timePickerLabels: TimePickerLabels = { hours: \"Hours\", minutes: \"Minutes\", period: \"AM/PM\" };\n\ntype Shared = {\n /** The accessible name of the picker (\"Pick-up time\"), passed translated. */\n label: string;\n /** The BCP 47 locale: how times are written, and whether the day has a period (AM/PM). */\n locale: string;\n /** The time, `HH:mm` on 24 hours (controlled); `null` for none. */\n value?: TimeValue | null;\n /** The time at first, uncontrolled. */\n defaultValue?: TimeValue | null;\n /** Called with the time chosen. */\n onValueChange?: (value: TimeValue) => void;\n /** Not available. */\n disabled?: boolean;\n /** Classes merged on the root. */\n className?: string;\n};\n\nexport type TimePickerProps = Shared &\n (\n | {\n /** `wheel`: hours and minutes (and the period) as wheels — a time you set (a reminder, an alarm). */\n variant?: \"wheel\";\n /** The minutes' step: 1, 5 (default), 10, 15, 30. */\n minuteStep?: number;\n /** Forces 12 or 24 hours. Default: the locale's. */\n hour12?: boolean;\n /** The words of the wheels, passed translated; English by default. */\n labels?: Partial<TimePickerLabels>;\n slots?: never;\n isTimeDisabled?: never;\n groupLabels?: never;\n }\n | {\n /** `slots`: the free times as buttons — a booking, a delivery window, an appointment. */\n variant: \"slots\";\n /** The times offered, `HH:mm` (`timeSlots(\"09:00\", \"17:00\", 30)`). */\n slots: readonly TimeValue[];\n /** Refuses some slots (taken, too soon): drawn struck through, skipped by the arrows. */\n isTimeDisabled?: (time: TimeValue) => boolean;\n /** Splits the slots under headings by part of the day: `{ morning: \"Morning\", afternoon: \"Afternoon\", evening: \"Evening\" }`. */\n groupLabels?: { morning: string; afternoon: string; evening: string };\n minuteStep?: never;\n hour12?: never;\n labels?: never;\n }\n );\n\n/** A time of day: wheels to set one, or slots to book one. */\nexport function TimePicker(props: TimePickerProps) {\n return props.variant === \"slots\" ? <TimeSlots {...props} /> : <TimeWheels {...props} />;\n}\n\nfunction TimeWheels({ label, locale, value: valueProp, defaultValue = null, onValueChange, disabled, className, minuteStep = 5, hour12, labels: given }: Extract<TimePickerProps, { variant?: \"wheel\" }>) {\n const labels = { ...timePickerLabels, ...given };\n const [value, setValue] = useControllable<TimeValue | null>(valueProp, defaultValue, (v) => v && onValueChange?.(v));\n const twelve = hour12 ?? uses12Hours(locale);\n const total = timeToMinutes(value) ?? 9 * 60;\n const h24 = Math.floor(total / 60);\n const minute = total % 60;\n const pm = h24 >= 12;\n const two = (n: number) => String(n).padStart(2, \"0\");\n const number = React.useMemo(() => new Intl.NumberFormat(locale, { minimumIntegerDigits: 2, useGrouping: false }), [locale]);\n const hours: WheelOption[] = twelve\n ? Array.from({ length: 12 }, (_, i) => ({ value: String(i === 0 ? 12 : i), label: String(i === 0 ? 12 : i) })).sort((a, b) => (Number(a.value) % 12) - (Number(b.value) % 12))\n : Array.from({ length: 24 }, (_, i) => ({ value: String(i), label: number.format(i) }));\n const minutes: WheelOption[] = Array.from({ length: Math.ceil(60 / minuteStep) }, (_, i) => ({ value: String(i * minuteStep), label: number.format(i * minuteStep) }));\n // A minute that is not on the step (an existing value) is rounded to the nearest one shown.\n const shownMinute = String(Math.min(60 - minuteStep, Math.round(minute / minuteStep) * minuteStep));\n const [am, pmLabel] = dayPeriods(locale);\n const set = (h: number, m: number) => setValue(`${two(h)}:${two(m)}`);\n return (\n <WheelPicker label={`${label}, ${value ? formatTime(locale, value) : \"\"}`.replace(/, $/, \"\")} className={className}>\n <Wheel\n label={labels.hours}\n options={hours}\n disabled={disabled}\n value={twelve ? String(h24 % 12 === 0 ? 12 : h24 % 12) : String(h24)}\n onValueChange={(v) => set(twelve ? (Number(v) % 12) + (pm ? 12 : 0) : Number(v), minute)}\n />\n <WheelDivider>:</WheelDivider>\n <Wheel label={labels.minutes} options={minutes} disabled={disabled} value={shownMinute} onValueChange={(v) => set(h24, Number(v))} />\n {twelve ? (\n <Wheel\n label={labels.period}\n options={[\n { value: \"am\", label: am },\n { value: \"pm\", label: pmLabel },\n ]}\n disabled={disabled}\n value={pm ? \"pm\" : \"am\"}\n onValueChange={(v) => set((h24 % 12) + (v === \"pm\" ? 12 : 0), minute)}\n />\n ) : null}\n </WheelPicker>\n );\n}\n\nfunction TimeSlots({ label, locale, value: valueProp, defaultValue = null, onValueChange, disabled, className, slots, isTimeDisabled, groupLabels }: Extract<TimePickerProps, { variant: \"slots\" }>) {\n const s = timePicker();\n const [value, setValue] = useControllable<TimeValue | null>(valueProp, defaultValue, (v) => v && onValueChange?.(v));\n const enabled = slots.filter((t) => !disabled && !isTimeDisabled?.(t));\n const tabStop = value && enabled.includes(value) ? value : enabled[0];\n const root = React.useRef<HTMLDivElement>(null);\n const onKeyDown = (event: React.KeyboardEvent) => {\n const i = enabled.indexOf(tabStop ?? \"\");\n const moves: Record<string, number> = { ArrowRight: i + 1, ArrowDown: i + 1, ArrowLeft: i - 1, ArrowUp: i - 1, Home: 0, End: enabled.length - 1 };\n const to = moves[event.key];\n if (to === undefined) return;\n event.preventDefault();\n const next = enabled[(to + enabled.length) % enabled.length];\n if (!next) return;\n setValue(next);\n root.current?.querySelector<HTMLButtonElement>(`[data-time=\"${next}\"]`)?.focus();\n };\n const button = (t: TimeValue) => {\n const off = disabled || Boolean(isTimeDisabled?.(t));\n return (\n <button\n key={t}\n type=\"button\"\n role=\"radio\"\n data-time={t}\n aria-checked={t === value}\n tabIndex={t === tabStop ? 0 : -1}\n disabled={off}\n className={s.slot()}\n onClick={() => setValue(t)}\n >\n {formatTime(locale, t)}\n </button>\n );\n };\n const part = (t: TimeValue) => {\n const m = timeToMinutes(t) ?? 0;\n return m < 12 * 60 ? \"morning\" : m < 18 * 60 ? \"afternoon\" : \"evening\";\n };\n return (\n <div ref={root} role=\"radiogroup\" aria-label={label} aria-disabled={disabled || undefined} className={className} onKeyDown={onKeyDown}>\n {groupLabels ? (\n <div className=\"flex flex-col gap-4\">\n {([\"morning\", \"afternoon\", \"evening\"] as const).map((p) => {\n const inPart = slots.filter((t) => part(t) === p);\n if (!inPart.length) return null;\n return (\n <div key={p} role=\"group\" aria-label={groupLabels[p]} className={s.group()}>\n <span aria-hidden className={s.heading()}>\n {groupLabels[p]}\n </span>\n <div className={s.slots()}>{inPart.map(button)}</div>\n </div>\n );\n })}\n </div>\n ) : (\n <div className={s.slots()}>{slots.map(button)}</div>\n )}\n </div>\n );\n}\n\n\n"],"mappings":";;;;;;;;;;;;;;;;;AAQA,SAAS,YAAY,yBAAyB;AAC9C,YAAYA,YAAW;;;ACTvB,SAAS,gBAAgB;AAKlB,IAAM,KAAK,SAAS,EAAE,cAAc,CAAC;;;ACF5C,YAAY,WAAW;;;ACIhB,IAAM,mBAAuD,EAAE,KAAK,GAAG,OAAO,GAAG,MAAM,EAAE;AAGzF,SAAS,eAAe,QAA4B;AACzD,MAAI;AACF,UAAM,QAAQ,IAAI,KAAK,eAAe,QAAQ,EAAE,KAAK,WAAW,OAAO,WAAW,MAAM,UAAU,CAAC,EAAE,cAAc,IAAI,KAAK,MAAM,IAAI,EAAE,CAAC;AACzI,UAAM,QAAQ,MAAM,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,MAAqB,MAAM,SAAS,MAAM,WAAW,MAAM,MAAM;AAChH,QAAI,MAAM,WAAW,EAAG,QAAO;AAAA,EACjC,QAAQ;AAAA,EAER;AACA,SAAO,CAAC,OAAO,SAAS,MAAM;AAChC;AAGO,SAAS,YAAY,OAAmD;AAC7E,MAAI,CAAC,MAAM,OAAO,CAAC,MAAM,SAAS,CAAC,MAAM,KAAM,QAAO;AACtD,QAAM,MAAM,CAAC,MAAe,EAAE,WAAW,IAAI,IAAI,CAAC,KAAK;AACvD,SAAO,GAAG,MAAM,IAAI,IAAI,IAAI,MAAM,KAAK,CAAC,IAAI,IAAI,MAAM,GAAG,CAAC;AAC5D;AAGO,SAAS,UAAU,OAA4D;AACpF,QAAM,IAAI,sBAAsB,KAAK,SAAS,EAAE;AAChD,SA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A,KAAC,SAAI,WAAU,uBACX,WAAC,WAAW,aAAa,SAAS,EAAY,IAAI,CAAC,MAAM;AACzD,UAAM,SAAS,MAAM,OAAO,CAAC,MAAM,KAAK,CAAC,MAAM,CAAC;AAChD,QAAI,CAAC,OAAO,OAAQ,QAAO;AAC3B,WACE,gBAAAC,MAAC,SAAY,MAAK,SAAQ,cAAY,YAAY,CAAC,GAAG,WAAW,EAAE,MAAM,GACvE;AAAA,sBAAAD,KAAC,UAAK,eAAW,MAAC,WAAW,EAAE,QAAQ,GACpC,sBAAY,CAAC,GAChB;AAAA,MACA,gBAAAA,KAAC,SAAI,WAAW,EAAE,MAAM,GAAI,iBAAO,IAAI,MAAM,GAAE;AAAA,SAJvC,CAKV;AAAA,EAEJ,CAAC,GACH,IAEA,gBAAAA,KAAC,SAAI,WAAW,EAAE,MAAM,GAAI,gBAAM,IAAI,MAAM,GAAE,GAElD;AAEJ;","names":["React","jsx","jsxs","jsxs","jsx","React","React","jsx","jsxs","jsx","jsxs","formatDate","getDateTimeFormat","React","jsx","jsx","jsxs","formatDate","getDateTimeFormat","formatDate","getDateTimeFormat","React","jsx","jsxs","getDateTimeFormat","formatDate","React","jsx","jsxs"]}
1
+ {"version":3,"sources":["../src/date-picker/calendar.tsx","../src/date-picker/month-picker.tsx","../src/date-picker/parts.ts","../src/date-picker/date-field.tsx","../src/date-picker/wheel.tsx","../src/date-picker/date-picker.tsx","../src/popover/popover.tsx","../src/date-picker/day-strip.tsx","../src/date-picker/time-picker.tsx"],"sourcesContent":["// Client. A month as an ARIA grid (the APG date picker): one day in the tab order, the arrows walk the days, Home /\n// End the week, Page Up / Page Down the months (Shift: the years), Enter or Space picks. Dates are ISO calendar dates\n// (`\"2026-10-11\"`): no time zone, nothing to convert, safe in an address. Month and day names come from\n// `@krizaka/intl` for the `locale` given — never the runtime's default.\n//\n// The material (BRAND.md §6): the chosen day is a lit fill (the accent, its shade, its glow), today carries the node —\n// the diamond of the marks — and a range is one continuous band. The month's title opens the months of the year\n// (`MonthPicker`): years are reached in a click, not by paging.\nimport { formatDate, getDateTimeFormat } from \"@krizaka/intl\";\nimport * as React from \"react\";\n\nimport { ChevronGlyph } from \"../glyphs\";\nimport { tv } from \"../tv\";\nimport { MonthPicker } from \"./month-picker\";\nimport { addDays, addMonths, toIsoDate, toLocalDate, weekStartOf } from \"./parts\";\n\nexport { addDays, addMonths, toIsoDate, toLocalDate, weekStartOf };\n\n/** A calendar date, `YYYY-MM-DD`. */\nexport type IsoDate = string;\n/** A range of calendar dates; `end` is `null` while the second date is not chosen. */\nexport type DateRange = { start: IsoDate; end: IsoDate | null };\n\nexport const calendar = tv({\n slots: {\n root: \"inline-flex select-none flex-col text-sm text-fg\",\n header: \"mb-3 flex items-center justify-between gap-2\",\n caption:\n \"inline-flex h-9 items-center gap-1.5 rounded-lg px-2.5 text-sm font-semibold capitalize text-fg transition-colors hover:bg-surface-3 \" +\n \"focus-visible:outline-hidden focus-visible:focus-ring aria-expanded:bg-surface-3\",\n nav:\n \"inline-flex h-9 w-9 items-center justify-center rounded-lg border border-border-subtle bg-surface-2 bg-sheen text-fg-secondary inset-shadow-edge \" +\n \"transition-colors hover:border-border-strong hover:text-fg focus-visible:outline-hidden focus-visible:focus-ring \" +\n \"disabled:pointer-events-none disabled:opacity-35\",\n months: \"flex flex-col gap-6 sm:flex-row\",\n month: \"kz-month flex flex-col gap-2\",\n monthTitle: \"px-1 text-xs font-semibold capitalize text-fg-secondary\",\n grid: \"border-separate border-spacing-y-1\",\n weekday: \"h-7 w-10 pb-1 text-center text-[11px] font-semibold uppercase tracking-wider text-fg-secondary\",\n cell:\n \"p-0 text-center data-[band]:bg-accent-soft data-[band=start]:rounded-l-xl data-[band=end]:rounded-r-xl data-[band=solo]:rounded-xl \" +\n \"data-[band=preview]:bg-surface-3\",\n day:\n \"relative h-10 w-10 rounded-xl text-sm tabular-nums text-fg transition-[background-color,box-shadow,transform] duration-150 \" +\n \"hover:bg-surface-3 active:scale-95 motion-reduce:transition-none motion-reduce:active:scale-100 \" +\n \"focus-visible:z-10 focus-visible:outline-hidden focus-visible:focus-ring \" +\n \"data-[outside]:text-fg-secondary data-[outside]:font-normal data-[weekend]:not-data-[selected]:text-fg-secondary \" +\n \"data-[today]:font-bold data-[today]:not-data-[selected]:text-fg-accent \" +\n \"data-[in-range]:hover:bg-accent/15 \" +\n \"data-[selected]:bg-accent data-[selected]:bg-fill-shade data-[selected]:font-semibold data-[selected]:text-on-accent \" +\n \"data-[selected]:shadow-glow data-[selected]:inset-shadow-edge-fill data-[selected]:hover:bg-accent \" +\n \"disabled:cursor-not-allowed disabled:text-fg-muted disabled:line-through disabled:opacity-50 disabled:hover:bg-transparent\",\n // Today: the node under the number (the marks' diamond), on-accent when today is the chosen day.\n node: \"pointer-events-none absolute bottom-1 left-1/2 h-1 w-1 -translate-x-1/2 rotate-45 rounded-[1px] bg-accent group-data-[selected]:bg-on-accent\",\n live: \"sr-only\",\n },\n variants: {\n variant: {\n plain: {},\n card: { root: \"rounded-2xl border border-border-default bg-surface-1 bg-sheen p-4 shadow-raised inset-shadow-edge\" },\n },\n },\n defaultVariants: { variant: \"plain\" },\n});\n\nconst monthOf = (iso: IsoDate) => `${iso.slice(0, 7)}-01`;\nconst clampIso = (iso: IsoDate, min?: IsoDate, max?: IsoDate) => (min && iso < min ? min : max && iso > max ? max : iso);\nconst monthsBetween = (a: IsoDate, b: IsoDate) => (Number(b.slice(0, 4)) - Number(a.slice(0, 4))) * 12 + Number(b.slice(5, 7)) - Number(a.slice(5, 7));\n\nexport type CalendarLabels = {\n /** The previous-month button (\"Previous month\"). */\n previousMonth: string;\n /** The next-month button (\"Next month\"). */\n nextMonth: string;\n /** The month's title as a button: opens the months of the year (\"Choose month and year\"). */\n chooseMonth: string;\n /** The previous-year button of the months view (\"Previous year\"). */\n previousYear: string;\n /** The next-year button of the months view (\"Next year\"). */\n nextYear: string;\n};\n\nexport const calendarLabels: CalendarLabels = {\n previousMonth: \"Previous month\",\n nextMonth: \"Next month\",\n chooseMonth: \"Choose month and year\",\n previousYear: \"Previous year\",\n nextYear: \"Next year\",\n};\n\nexport type CalendarProps = {\n /** The BCP 47 locale of the month and day names (`\"en-US\"`, `\"fr-CA\"`): always explicit. */\n locale: string;\n /** The chosen date (one-date mode). */\n value?: IsoDate | null;\n /** The chosen range (range mode): its ends are lit, the days between are one band. */\n range?: DateRange | null;\n /** Called with the day picked. */\n onSelect?: (date: IsoDate) => void;\n /** The month shown (the first one, with `numberOfMonths={2}`), any day of it (controlled). */\n month?: IsoDate;\n /** The month shown at first. Default: the value's, or today's. */\n defaultMonth?: IsoDate;\n /** Called when the month shown changes. */\n onMonthChange?: (month: IsoDate) => void;\n /** One month, or two side by side (a period: from a phone's width up, they stack on a phone). */\n numberOfMonths?: 1 | 2;\n /** The earliest date that can be picked. */\n min?: IsoDate;\n /** The latest date that can be picked. */\n max?: IsoDate;\n /** Refuses some dates (`(d) => isWeekend(d)`). */\n isDateDisabled?: (date: IsoDate) => boolean;\n /** The first day of the week, 0 = Sunday. Default: the locale's. */\n weekStartsOn?: number;\n /** Today (marked): inject it for a stable server render or a test. Default: the device's date. */\n today?: IsoDate;\n /** Moves the focus to the active day when it mounts (inside a popover). */\n autoFocus?: boolean;\n /** `plain` (inside a popover, a card of the app) or `card` (the calendar is the interface: its own raised surface). */\n variant?: \"plain\" | \"card\";\n /** The words, passed translated; English by default. */\n labels?: Partial<CalendarLabels>;\n /** Classes merged on the root. */\n className?: string;\n};\n\n/** A month grid to pick a date or the ends of a range, with the full keyboard of the APG date picker. */\nexport function Calendar({\n locale,\n value,\n range,\n onSelect,\n month: monthProp,\n defaultMonth,\n onMonthChange,\n numberOfMonths = 1,\n min,\n max,\n isDateDisabled,\n weekStartsOn,\n today: todayProp,\n autoFocus,\n variant,\n labels: given,\n className,\n}: CalendarProps) {\n const labels = { ...calendarLabels, ...given };\n const s = calendar({ variant });\n const today = todayProp ?? toIsoDate(new Date());\n const anchor = value ?? range?.start ?? clampIso(today, min, max);\n const [innerMonth, setInnerMonth] = React.useState(monthOf(defaultMonth ?? anchor));\n const month = monthProp ? monthOf(monthProp) : innerMonth;\n const shown = Array.from({ length: numberOfMonths }, (_, i) => addMonths(month, i));\n const lastShown = shown[shown.length - 1]!;\n const isShown = (iso: IsoDate) => iso.slice(0, 7) >= month.slice(0, 7) && iso.slice(0, 7) <= lastShown.slice(0, 7);\n const [focused, setFocused] = React.useState<IsoDate>(isShown(anchor) ? anchor : month);\n const [hover, setHover] = React.useState<IsoDate | null>(null);\n const [view, setView] = React.useState<\"days\" | \"months\">(\"days\");\n const [direction, setDirection] = React.useState<\"next\" | \"previous\" | null>(null);\n const root = React.useRef<HTMLDivElement>(null);\n const moved = React.useRef(Boolean(autoFocus));\n const titleId = React.useId();\n\n const setMonth = (next: IsoDate) => {\n const m = monthOf(next);\n setDirection(m > month ? \"next\" : m < month ? \"previous\" : null);\n if (!monthProp) setInnerMonth(m);\n onMonthChange?.(m);\n };\n // The focused day follows the months shown when they are changed from outside (the buttons, a controlled `month`).\n const active = isShown(focused) ? focused : month;\n\n React.useEffect(() => {\n if (!moved.current || view !== \"days\") return;\n moved.current = false;\n root.current?.querySelector<HTMLButtonElement>(`[data-date=\"${active}\"]`)?.focus();\n }, [active, view]);\n\n const disabled = (iso: IsoDate) => Boolean((min && iso < min) || (max && iso > max) || isDateDisabled?.(iso));\n const start = weekStartsOn ?? weekStartOf(locale);\n const weekdayShort = getDateTimeFormat(locale, { weekday: \"short\" });\n const weekdayLong = getDateTimeFormat(locale, { weekday: \"long\" });\n const titleFormat = getDateTimeFormat(locale, { month: \"long\", year: \"numeric\" });\n const title = titleFormat.format(toLocalDate(month));\n const fullTitle = numberOfMonths === 2 ? `${title} – ${titleFormat.format(toLocalDate(lastShown))}` : title;\n\n const rangeEnd = range ? (range.end ?? hover) : null;\n const [lo, hi] = range && rangeEnd ? (range.start <= rangeEnd ? [range.start, rangeEnd] : [rangeEnd, range.start]) : [null, null];\n const previewing = Boolean(range && !range.end);\n\n const focusDay = (iso: IsoDate) => {\n moved.current = true;\n setFocused(iso);\n if (!isShown(iso)) setMonth(iso < month ? iso : addMonths(iso, -(numberOfMonths - 1)));\n };\n\n const onKeyDown = (event: React.KeyboardEvent) => {\n const weekday = (toLocalDate(active).getDay() - start + 7) % 7;\n const moves: Record<string, () => IsoDate> = {\n ArrowLeft: () => addDays(active, -1),\n ArrowRight: () => addDays(active, 1),\n ArrowUp: () => addDays(active, -7),\n ArrowDown: () => addDays(active, 7),\n Home: () => addDays(active, -weekday),\n End: () => addDays(active, 6 - weekday),\n PageUp: () => addMonths(active, event.shiftKey ? -12 : -1),\n PageDown: () => addMonths(active, event.shiftKey ? 12 : 1),\n };\n const move = moves[event.key];\n if (!move) return;\n event.preventDefault();\n focusDay(move());\n };\n\n const prevDisabled = Boolean(min && addDays(month, -1) < min);\n const nextDisabled = Boolean(max && addMonths(lastShown, 1) > max);\n\n const band = (iso: IsoDate): string | undefined => {\n if (!lo || !hi) return undefined;\n if (iso < lo || iso > hi) return undefined;\n if (lo === hi) return undefined;\n if (previewing && iso !== range?.start) return iso === lo ? \"start\" : iso === hi ? \"end\" : \"preview\";\n return iso === lo ? \"start\" : iso === hi ? \"end\" : \"middle\";\n };\n\n const renderMonth = (first: IsoDate, index: number) => {\n const firstDate = toLocalDate(first);\n const lead = (firstDate.getDay() - start + 7) % 7;\n const gridStart = addDays(first, -lead);\n const days = Array.from({ length: 42 }, (_, i) => addDays(gridStart, i));\n const weeks = Array.from({ length: 6 }, (_, w) => days.slice(w * 7, w * 7 + 7)).filter((week, w) => w < 5 || week[0]!.slice(0, 7) === first.slice(0, 7));\n const monthTitle = titleFormat.format(firstDate);\n const gridLabelId = `${titleId}-m${index}`;\n return (\n <div key={first} className={s.month()} data-dir={direction ?? undefined}>\n {numberOfMonths === 2 ? (\n <div id={gridLabelId} className={s.monthTitle()}>\n {monthTitle}\n </div>\n ) : null}\n <table role=\"grid\" aria-label={monthTitle} className={s.grid()} onKeyDown={onKeyDown}>\n <thead>\n <tr>\n {days.slice(0, 7).map((iso) => (\n <th key={iso} scope=\"col\" abbr={weekdayLong.format(toLocalDate(iso))} className={s.weekday()}>\n {weekdayShort.format(toLocalDate(iso)).replace(/\\.$/, \"\")}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {weeks.map((week) => (\n <tr key={week[0]}>\n {week.map((iso) => {\n const outside = iso.slice(0, 7) !== first.slice(0, 7);\n // With two months, a day outside its month is the other month's: drawn once, where it belongs.\n if (outside && numberOfMonths === 2) return <td key={iso} role=\"gridcell\" className={s.cell()} />;\n const selected = iso === value || Boolean(range && (iso === range.start || iso === range.end));\n const inRange = Boolean(lo && hi && iso > lo && iso < hi);\n const dow = toLocalDate(iso).getDay();\n return (\n <td key={iso} role=\"gridcell\" aria-selected={selected || inRange || undefined} data-band={band(iso)} className={s.cell()}>\n <button\n type=\"button\"\n data-date={iso}\n tabIndex={iso === active ? 0 : -1}\n aria-label={formatDate(toLocalDate(iso), { locale, style: \"long\" })}\n aria-current={iso === today ? \"date\" : undefined}\n data-today={iso === today ? \"\" : undefined}\n data-outside={outside ? \"\" : undefined}\n data-weekend={dow === 0 || dow === 6 ? \"\" : undefined}\n data-selected={selected ? \"\" : undefined}\n data-in-range={inRange ? \"\" : undefined}\n disabled={disabled(iso)}\n className={s.day({ className: \"group\" })}\n onClick={() => {\n setFocused(iso);\n onSelect?.(iso);\n }}\n onMouseEnter={previewing ? () => setHover(iso) : undefined}\n onFocus={previewing ? () => setHover(iso) : undefined}\n >\n {Number(iso.slice(8))}\n {iso === today ? <span aria-hidden className={s.node()} /> : null}\n </button>\n </td>\n );\n })}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n );\n };\n\n return (\n <div ref={root} className={s.root({ className })}>\n <div className={s.header()}>\n <button\n type=\"button\"\n className={s.nav()}\n aria-label={view === \"days\" ? labels.previousMonth : labels.previousYear}\n disabled={view === \"days\" ? prevDisabled : Boolean(min && Number(month.slice(0, 4)) - 1 < Number(min.slice(0, 4)))}\n onClick={() => setMonth(addMonths(month, view === \"days\" ? -1 : -12))}\n >\n <ChevronGlyph direction=\"left\" className=\"h-4 w-4\" />\n </button>\n <button type=\"button\" className={s.caption()} aria-expanded={view === \"months\"} aria-label={`${labels.chooseMonth}, ${fullTitle}`} onClick={() => setView(view === \"days\" ? \"months\" : \"days\")}>\n <span aria-hidden>{view === \"days\" ? fullTitle : month.slice(0, 4)}</span>\n <ChevronGlyph direction={view === \"months\" ? \"up\" : \"down\"} className=\"h-3.5 w-3.5 text-fg-secondary\" />\n </button>\n <button\n type=\"button\"\n className={s.nav()}\n aria-label={view === \"days\" ? labels.nextMonth : labels.nextYear}\n disabled={view === \"days\" ? nextDisabled : Boolean(max && Number(month.slice(0, 4)) + 1 > Number(max.slice(0, 4)))}\n onClick={() => setMonth(addMonths(month, view === \"days\" ? 1 : 12))}\n >\n <ChevronGlyph direction=\"right\" className=\"h-4 w-4\" />\n </button>\n </div>\n <span id={titleId} className={s.live()} aria-live=\"polite\">\n {fullTitle}\n </span>\n {view === \"days\" ? (\n <div className={s.months()}>{shown.map(renderMonth)}</div>\n ) : (\n <MonthPicker\n locale={locale}\n bare\n year={Number(month.slice(0, 4))}\n onYearChange={(y) => setMonth(`${y}-${month.slice(5, 7)}-01`)}\n value={month.slice(0, 7)}\n min={min?.slice(0, 7)}\n max={max?.slice(0, 7)}\n autoFocus\n onValueChange={(m) => {\n if (!m) return;\n const target = `${m}-01`;\n setMonth(target);\n setView(\"days\");\n moved.current = true;\n setFocused(clampIso(addMonths(active, monthsBetween(monthOf(active), target)), min, max));\n }}\n />\n )}\n </div>\n );\n}\n","// Client. The twelve months of a year as a grid (three columns): the arrows walk them (Up / Down by a row), Page Up /\n// Page Down change the year, Enter or Space picks. The value is `YYYY-MM` — a billing month, a card's expiry, a report.\n// The calendar's title opens it, so a year away is two clicks, not twelve pages.\nimport * as React from \"react\";\n\nimport { ChevronGlyph } from \"../glyphs\";\nimport { tv } from \"../tv\";\nimport { monthNames } from \"./parts\";\n\n/** A calendar month, `YYYY-MM`. */\nexport type IsoMonth = string;\n\nexport const monthPicker = tv({\n slots: {\n root: \"inline-flex select-none flex-col gap-3 text-sm text-fg\",\n header: \"flex items-center justify-between gap-2\",\n year: \"text-sm font-semibold tabular-nums\",\n nav:\n \"inline-flex h-9 w-9 items-center justify-center rounded-lg border border-border-subtle bg-surface-2 bg-sheen text-fg-secondary inset-shadow-edge \" +\n \"transition-colors hover:border-border-strong hover:text-fg focus-visible:outline-hidden focus-visible:focus-ring disabled:pointer-events-none disabled:opacity-35\",\n grid: \"kz-fade grid grid-cols-3 gap-1.5\",\n month:\n \"relative h-11 min-w-[5.5rem] rounded-xl px-2 text-sm font-medium capitalize text-fg transition-[background-color,box-shadow,transform] duration-150 \" +\n \"hover:bg-surface-3 active:scale-95 motion-reduce:transition-none motion-reduce:active:scale-100 focus-visible:outline-hidden focus-visible:focus-ring \" +\n \"data-[current]:font-bold data-[current]:not-data-[selected]:text-fg-accent \" +\n \"data-[selected]:bg-accent data-[selected]:bg-fill-shade data-[selected]:font-semibold data-[selected]:text-on-accent data-[selected]:shadow-glow data-[selected]:inset-shadow-edge-fill \" +\n \"disabled:cursor-not-allowed disabled:text-fg-muted disabled:opacity-50 disabled:hover:bg-transparent\",\n },\n variants: {\n variant: {\n plain: {},\n card: { root: \"rounded-2xl border border-border-default bg-surface-1 bg-sheen p-4 shadow-raised inset-shadow-edge\" },\n },\n },\n defaultVariants: { variant: \"plain\" },\n});\n\nexport type MonthPickerLabels = {\n /** The previous-year button (\"Previous year\"). */\n previousYear: string;\n /** The next-year button (\"Next year\"). */\n nextYear: string;\n};\n\nexport const monthPickerLabels: MonthPickerLabels = { previousYear: \"Previous year\", nextYear: \"Next year\" };\n\nexport type MonthPickerProps = {\n /** The BCP 47 locale of the month names: always explicit. */\n locale: string;\n /** The chosen month, `YYYY-MM` (controlled); `null` for none. */\n value?: IsoMonth | null;\n /** The chosen month at first, uncontrolled. */\n defaultValue?: IsoMonth | null;\n /** Called with the month picked. */\n onValueChange?: (value: IsoMonth | null) => void;\n /** The year shown (controlled). */\n year?: number;\n /** Called when the year shown changes. */\n onYearChange?: (year: number) => void;\n /** The earliest month that can be picked, `YYYY-MM`. */\n min?: IsoMonth;\n /** The latest month that can be picked, `YYYY-MM`. */\n max?: IsoMonth;\n /** This month (marked): inject it for a stable render or a test. Default: the device's. */\n current?: IsoMonth;\n /** Moves the focus to the active month when it mounts. */\n autoFocus?: boolean;\n /** Without its own year header (inside the calendar, which has one). */\n bare?: boolean;\n /** `plain` or `card` (its own raised surface). */\n variant?: \"plain\" | \"card\";\n /** The words, passed translated; English by default. */\n labels?: Partial<MonthPickerLabels>;\n /** Classes merged on the root. */\n className?: string;\n};\n\n/** A month of a year: twelve months in a grid, the year above them. */\nexport function MonthPicker({ locale, value: valueProp, defaultValue = null, onValueChange, year: yearProp, onYearChange, min, max, current, autoFocus, bare, variant, labels: given, className }: MonthPickerProps) {\n const labels = { ...monthPickerLabels, ...given };\n const s = monthPicker({ variant });\n const [own, setOwn] = React.useState<IsoMonth | null>(defaultValue);\n const value = valueProp !== undefined ? valueProp : own;\n const now = new Date();\n const thisMonth = current ?? `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, \"0\")}`;\n const [ownYear, setOwnYear] = React.useState(() => Number((value ?? thisMonth).slice(0, 4)));\n const year = yearProp ?? ownYear;\n const setYear = (y: number) => {\n if (yearProp === undefined) setOwnYear(y);\n onYearChange?.(y);\n };\n const names = React.useMemo(() => monthNames(locale, \"short\").map((n) => n.replace(/\\.$/, \"\")), [locale]);\n const longNames = React.useMemo(() => monthNames(locale, \"long\"), [locale]);\n const iso = (y: number, m: number) => `${String(y).padStart(4, \"0\")}-${String(m).padStart(2, \"0\")}`;\n const disabled = (m: IsoMonth) => Boolean((min && m < min) || (max && m > max));\n const [focused, setFocused] = React.useState(() => (value && Number(value.slice(0, 4)) === year ? Number(value.slice(5, 7)) : Number(thisMonth.slice(5, 7))));\n const grid = React.useRef<HTMLDivElement>(null);\n const moved = React.useRef(Boolean(autoFocus));\n React.useEffect(() => {\n if (!moved.current) return;\n moved.current = false;\n grid.current?.querySelector<HTMLButtonElement>(`[data-month=\"${iso(year, focused)}\"]`)?.focus();\n }, [year, focused]);\n\n const pick = (m: IsoMonth) => {\n if (valueProp === undefined) setOwn(m);\n onValueChange?.(m);\n };\n const move = (to: number) => {\n moved.current = true;\n const y = year + Math.floor((to - 1) / 12);\n const m = ((((to - 1) % 12) + 12) % 12) + 1;\n if (y !== year) setYear(y);\n setFocused(m);\n };\n const onKeyDown = (event: React.KeyboardEvent) => {\n const moves: Record<string, number> = { ArrowLeft: -1, ArrowRight: 1, ArrowUp: -3, ArrowDown: 3, PageUp: -12, PageDown: 12 };\n if (event.key === \"Home\" || event.key === \"End\") {\n event.preventDefault();\n moved.current = true;\n setFocused(event.key === \"Home\" ? 1 : 12);\n return;\n }\n const by = moves[event.key];\n if (by === undefined) return;\n event.preventDefault();\n move(focused + by);\n };\n const rows = [0, 1, 2, 3].map((r) => [1, 2, 3].map((c) => r * 3 + c));\n return (\n <div className={s.root({ className })}>\n {bare ? null : (\n <div className={s.header()}>\n <button type=\"button\" className={s.nav()} aria-label={labels.previousYear} disabled={Boolean(min && year - 1 < Number(min.slice(0, 4)))} onClick={() => setYear(year - 1)}>\n <ChevronGlyph direction=\"left\" className=\"h-4 w-4\" />\n </button>\n <span className={s.year()} aria-live=\"polite\">\n {year}\n </span>\n <button type=\"button\" className={s.nav()} aria-label={labels.nextYear} disabled={Boolean(max && year + 1 > Number(max.slice(0, 4)))} onClick={() => setYear(year + 1)}>\n <ChevronGlyph direction=\"right\" className=\"h-4 w-4\" />\n </button>\n </div>\n )}\n <div ref={grid} role=\"grid\" aria-label={String(year)} className={s.grid()} key={year} onKeyDown={onKeyDown}>\n {rows.map((row) => (\n <div role=\"row\" key={row[0]} className=\"contents\">\n {row.map((m) => {\n const id = iso(year, m);\n return (\n <div role=\"gridcell\" key={m} aria-selected={id === value || undefined} className=\"flex\">\n <button\n type=\"button\"\n data-month={id}\n tabIndex={m === focused ? 0 : -1}\n aria-current={id === thisMonth ? \"date\" : undefined}\n data-current={id === thisMonth ? \"\" : undefined}\n data-selected={id === value ? \"\" : undefined}\n disabled={disabled(id)}\n className={s.month({ className: \"w-full\" })}\n onClick={() => {\n setFocused(m);\n pick(id);\n }}\n >\n <span aria-hidden>{names[m - 1]}</span>\n <span className=\"sr-only\">{`${longNames[m - 1]} ${year}`}</span>\n </button>\n </div>\n );\n })}\n </div>\n ))}\n </div>\n </div>\n );\n}\n","// Platform-neutral: a date typed as day, month and year (the native `DateField`, the form's `DateField entry=\"parts\"`).\n// Values are ISO calendar dates, `YYYY-MM-DD`, compared as strings.\n\n/** A part of a typed date. */\nexport type DatePart = \"day\" | \"month\" | \"year\";\n\n/** The digits of each part. */\nexport const DATE_PART_LENGTH: Readonly<Record<DatePart, number>> = { day: 2, month: 2, year: 4 };\n\n/** The order of day, month and year in a locale (`en-US` → month, day, year; `fr` → day, month, year). */\nexport function datePartsOrder(locale: string): DatePart[] {\n try {\n const parts = new Intl.DateTimeFormat(locale, { day: \"2-digit\", month: \"2-digit\", year: \"numeric\" }).formatToParts(new Date(2001, 10, 22));\n const order = parts.map((p) => p.type).filter((t): t is DatePart => t === \"day\" || t === \"month\" || t === \"year\");\n if (order.length === 3) return order;\n } catch {\n // An engine without Intl's parts: day, month, year.\n }\n return [\"day\", \"month\", \"year\"];\n}\n\n/** The ISO-ordered value of what was typed: `\"\"` when nothing is, `YYYY-MM-DD` otherwise (not necessarily a real date). */\nexport function composeDate(parts: Readonly<Record<DatePart, string>>): string {\n if (!parts.day && !parts.month && !parts.year) return \"\";\n const pad = (v: string) => (v.length === 1 ? `0${v}` : v);\n return `${parts.year}-${pad(parts.month)}-${pad(parts.day)}`;\n}\n\n/** The parts of a value (`\"\"` → three empty parts). */\nexport function splitDate(value: string | null | undefined): Record<DatePart, string> {\n const m = /^(\\d*)-(\\d*)-(\\d*)$/.exec(value ?? \"\");\n return m ? { year: m[1]!, month: m[2]!, day: m[3]! } : { day: \"\", month: \"\", year: \"\" };\n}\n\n/** True for a real calendar date written `YYYY-MM-DD` (not `2001-02-30`). */\nexport function isRealDate(value: string): boolean {\n if (!/^\\d{4}-\\d{2}-\\d{2}$/.test(value)) return false;\n const date = new Date(`${value}T00:00:00Z`);\n return !Number.isNaN(date.getTime()) && date.toISOString().slice(0, 10) === value;\n}\n\n/** The latest date of birth of someone `age` years old today (`YYYY-MM-DD`): an age gate's `max`, `value <= latestBirthDate(18)`. */\nexport function latestBirthDate(age: number, today = new Date()): string {\n return new Date(Date.UTC(today.getFullYear() - age, today.getMonth(), today.getDate())).toISOString().slice(0, 10);\n}\n\n// ─── Shared by the pickers, web and native (no DOM, no React) ───────────────────────────────────────────────────────\n\n/** The days of a month (`month` 1–12). */\nexport function daysInMonth(year: number, month: number): number {\n return new Date(Date.UTC(year, month, 0)).getUTCDate();\n}\n\n/** `2026-10-11` → `{ year: 2026, month: 10, day: 11 }` (no check: pair it with `isRealDate`). */\nexport function isoParts(iso: string): { year: number; month: number; day: number } {\n const [year = 0, month = 0, day = 0] = iso.split(\"-\").map(Number);\n return { year, month, day };\n}\n\n/** `{ 2026, 10, 11 }` → `2026-10-11`, the day kept inside the month (`2026-02-31` → `2026-02-28`). */\nexport function isoOf(year: number, month: number, day: number): string {\n const d = Math.min(Math.max(day, 1), daysInMonth(year, month));\n return `${String(year).padStart(4, \"0\")}-${String(month).padStart(2, \"0\")}-${String(d).padStart(2, \"0\")}`;\n}\n\n/** The ISO date of today on this device (or of the `Date` given). */\nexport function todayIso(now = new Date()): string {\n return isoOf(now.getFullYear(), now.getMonth() + 1, now.getDate());\n}\n\n/** The age in whole years on `today` of someone born on `birth` (both ISO). */\nexport function ageOn(birth: string, today: string = todayIso()): number {\n const b = isoParts(birth);\n const t = isoParts(today);\n return t.year - b.year - (t.month < b.month || (t.month === b.month && t.day < b.day) ? 1 : 0);\n}\n\n/** The month names of a locale, January first (`long` · `short` · `narrow`). */\nexport function monthNames(locale: string, style: \"long\" | \"short\" | \"narrow\" = \"long\"): string[] {\n const format = new Intl.DateTimeFormat(locale, { month: style, timeZone: \"UTC\" });\n return Array.from({ length: 12 }, (_, i) => format.format(new Date(Date.UTC(2001, i, 1))));\n}\n\n/** The years from `from` to `to`, both included, in that order (descending when `from > to`). */\nexport function yearRange(from: number, to: number): number[] {\n const step = from <= to ? 1 : -1;\n return Array.from({ length: Math.abs(to - from) + 1 }, (_, i) => from + i * step);\n}\n\n/** A time of day, `HH:mm` on 24 hours (`\"09:30\"`, `\"18:00\"`): the value of every time picker. */\nexport type TimeValue = string;\n\n/** `\"9:5\"` / `\"09:05\"` → minutes since midnight; `null` when it is not a time. */\nexport function timeToMinutes(value: string | null | undefined): number | null {\n const m = /^(\\d{1,2}):(\\d{1,2})$/.exec(value ?? \"\");\n if (!m) return null;\n const h = Number(m[1]);\n const min = Number(m[2]);\n return h < 24 && min < 60 ? h * 60 + min : null;\n}\n\n/** Minutes since midnight → `HH:mm`. */\nexport function minutesToTime(minutes: number): TimeValue {\n const m = ((Math.round(minutes) % 1440) + 1440) % 1440;\n return `${String(Math.floor(m / 60)).padStart(2, \"0\")}:${String(m % 60).padStart(2, \"0\")}`;\n}\n\n/** The slots of a day from `start` to `end` (excluded) every `step` minutes: `timeSlots(\"09:00\", \"12:00\", 30)`. */\nexport function timeSlots(start: TimeValue, end: TimeValue, step = 30): TimeValue[] {\n const a = timeToMinutes(start);\n const b = timeToMinutes(end);\n if (a === null || b === null || step <= 0) return [];\n const slots: TimeValue[] = [];\n for (let m = a; m < b; m += step) slots.push(minutesToTime(m));\n return slots;\n}\n\n/** True when the locale writes the time on 12 hours with a day period (`en-US` → true, `fr-CA` → false). */\nexport function uses12Hours(locale: string): boolean {\n try {\n const options = new Intl.DateTimeFormat(locale, { hour: \"numeric\" }).resolvedOptions() as Intl.ResolvedDateTimeFormatOptions & { hourCycle?: string };\n return options.hourCycle ? options.hourCycle === \"h12\" || options.hourCycle === \"h11\" : Boolean(options.hour12);\n } catch {\n return false;\n }\n}\n\n/** The day periods of a locale, morning first (`[\"AM\", \"PM\"]`, `[\"a.m.\", \"p.m.\"]`). */\nexport function dayPeriods(locale: string): [string, string] {\n const format = new Intl.DateTimeFormat(locale, { hour: \"numeric\", hour12: true, timeZone: \"UTC\" });\n const period = (h: number) => format.formatToParts(new Date(Date.UTC(2001, 0, 1, h))).find((p) => p.type === \"dayPeriod\")?.value ?? (h < 12 ? \"AM\" : \"PM\");\n return [period(9), period(15)];\n}\n\n/** A time written the locale's way (`\"18:30\"` → `\"6:30 PM\"` in en-US, `\"18 h 30\"` in fr-CA). */\nexport function formatTime(locale: string, value: TimeValue): string {\n const minutes = timeToMinutes(value);\n if (minutes === null) return \"\";\n return new Intl.DateTimeFormat(locale, { hour: \"numeric\", minute: \"2-digit\", timeZone: \"UTC\" }).format(new Date(Date.UTC(2001, 0, 1, 0, minutes)));\n}\n\n/** A local `Date` at midnight for an ISO date (for formatting). */\nexport const toLocalDate = (iso: string) => {\n const { year, month, day } = isoParts(iso);\n return new Date(year, month - 1, day);\n};\n/** The ISO date of a local `Date`. */\nexport const toIsoDate = (date: Date): string => `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, \"0\")}-${String(date.getDate()).padStart(2, \"0\")}`;\n/** The ISO date `days` later (or earlier). */\nexport const addDays = (iso: string, days: number) => {\n const date = toLocalDate(iso);\n date.setDate(date.getDate() + days);\n return toIsoDate(date);\n};\n/** The ISO date `months` later (or earlier), the day kept inside the shorter months (`01-31` + 1 → `02-28`). */\nexport const addMonths = (iso: string, months: number) => {\n const { year, month, day } = isoParts(iso);\n const first = new Date(year, month - 1 + months, 1);\n return isoOf(first.getFullYear(), first.getMonth() + 1, day);\n};\n\n/** The first day of the week for a locale (0 = Sunday … 6 = Saturday), from `Intl.Locale` week info; Monday otherwise. */\nexport function weekStartOf(locale: string): number {\n try {\n const info = new Intl.Locale(locale) as Intl.Locale & { getWeekInfo?: () => { firstDay: number }; weekInfo?: { firstDay: number } };\n const firstDay = info.getWeekInfo?.().firstDay ?? info.weekInfo?.firstDay;\n return firstDay ? firstDay % 7 : 1;\n } catch {\n return 1;\n }\n}\n\n/** The weeks of a month's grid (six at most), each seven ISO dates from the locale's first day of the week. */\nexport function monthGrid(month: string, weekStartsOn: number): string[][] {\n const first = `${month.slice(0, 7)}-01`;\n const lead = (toLocalDate(first).getDay() - weekStartsOn + 7) % 7;\n const start = addDays(first, -lead);\n const days = Array.from({ length: 42 }, (_, i) => addDays(start, i));\n return Array.from({ length: 6 }, (_, w) => days.slice(w * 7, w * 7 + 7)).filter((week, w) => w < 5 || week[0]!.slice(0, 7) === first.slice(0, 7));\n}\n","// Client. Two ways to give a memorable date — a birth date, an expiry — that a calendar would make slow to reach:\n// `DateField` (day · month · year typed in the locale's order, the next box focused once one is full; the web form's\n// `entry=\"parts\"`) and `DateWheel` (three wheels: the touch idiom, bounded by `min` / `max` — an age gate is\n// `max={latestBirthDate(18)}`). The value is `YYYY-MM-DD` either way, like the native `DateField` and `DateWheel`.\nimport * as React from \"react\";\n\nimport { useControllable } from \"../media\";\nimport { tv } from \"../tv\";\nimport { composeDate, DATE_PART_LENGTH, type DatePart, datePartsOrder, daysInMonth, isoOf, isoParts, monthNames, splitDate, todayIso, yearRange } from \"./parts\";\nimport { Wheel, WheelPicker } from \"./wheel\";\n\nexport const dateField = tv({\n slots: {\n root: \"flex flex-col gap-1.5 border-0 p-0\",\n legend: \"mb-1.5 p-0 text-xs font-semibold text-fg-secondary\",\n row: \"flex gap-2\",\n part: \"flex flex-col gap-1 text-xs text-fg-secondary\",\n input:\n \"h-11 rounded-lg border border-border-default bg-surface-2 px-2 text-center text-base tabular-nums text-fg inset-shadow-well transition-[border-color,box-shadow] \" +\n \"placeholder:text-fg-muted focus-visible:border-accent focus-visible:outline-hidden focus-visible:focus-ring-inset aria-invalid:border-danger disabled:cursor-not-allowed disabled:opacity-50\",\n hint: \"text-xs text-fg-secondary\",\n error: \"flex items-center gap-1.5 text-xs font-medium text-fg-danger before:h-1.5 before:w-1.5 before:shrink-0 before:rounded-full before:bg-danger\",\n },\n});\n\nexport type DateFieldLabels = {\n /** The name of the day (\"Day\"). */\n day: string;\n /** The name of the month (\"Month\"). */\n month: string;\n /** The name of the year (\"Year\"). */\n year: string;\n};\n\nexport const dateFieldLabels: DateFieldLabels = { day: \"Day\", month: \"Month\", year: \"Year\" };\n\ntype Common = {\n /** The visible label, passed translated (the group's name). */\n label: string;\n /** The BCP 47 locale: the order of the parts, the names of the months. */\n locale: string;\n /** A help text under the field (\"For example, 27 3 1990\"). */\n hint?: string;\n /** An error under the field: marks it invalid and is read with it. Replaces the hint. */\n error?: string;\n /** Not available. */\n disabled?: boolean;\n /** The name of a hidden input holding the value, for a plain `<form>` post. */\n name?: string;\n /** The names of the parts, passed translated; English by default. */\n labels?: Partial<DateFieldLabels>;\n /** Classes merged on the root. */\n className?: string;\n};\n\nexport type DateFieldProps = Common & {\n /** The date, `YYYY-MM-DD` (controlled); `\"\"` for none. What is typed comes back as it is, real date or not: the schema decides. */\n value?: string;\n /** The date at first, uncontrolled. */\n defaultValue?: string;\n /** Called on every key with the date typed so far (`\"\"` when the boxes are empty). */\n onValueChange?: (value: string) => void;\n /** Called when the focus leaves the field. */\n onBlur?: () => void;\n /** `bday` for a date of birth: the browser offers to fill it. */\n autoComplete?: \"bday\" | \"off\";\n};\n\nfunction Caption({ id, hint, error }: { id: string; hint?: string; error?: string }) {\n const s = dateField();\n if (error)\n return (\n <p id={`${id}-error`} className={s.error()}>\n {error}\n </p>\n );\n return hint ? (\n <p id={`${id}-hint`} className={s.hint()}>\n {hint}\n </p>\n ) : null;\n}\n\n/** Day · month · year typed in the locale's order: numeric keyboards, the next box focused when one is full. */\nexport function DateField({ label, locale, hint, error, disabled, name, labels: given, className, value: valueProp, defaultValue = \"\", onValueChange, onBlur, autoComplete }: DateFieldProps) {\n const labels = { ...dateFieldLabels, ...given };\n const s = dateField();\n const id = React.useId();\n const [value, setValue] = useControllable<string>(valueProp, defaultValue, onValueChange);\n const order = React.useMemo(() => datePartsOrder(locale), [locale]);\n const [parts, setParts] = React.useState(() => splitDate(value));\n // A value set from outside (a reset, a suggestion) replaces what is in the boxes.\n if ((value ?? \"\") !== composeDate(parts) && composeDate(splitDate(value)) === (value ?? \"\")) setParts(splitDate(value));\n const refs = { day: React.useRef<HTMLInputElement>(null), month: React.useRef<HTMLInputElement>(null), year: React.useRef<HTMLInputElement>(null) };\n const describedBy = error ? `${id}-error` : hint ? `${id}-hint` : undefined;\n return (\n <fieldset className={s.root({ className })} aria-describedby={describedBy} onBlur={(e) => !e.currentTarget.contains(e.relatedTarget as Node | null) && onBlur?.()}>\n <legend className={s.legend()}>{label}</legend>\n <div className={s.row()}>\n {order.map((part: DatePart) => (\n <label key={part} className={s.part()}>\n {labels[part]}\n <input\n ref={refs[part]}\n inputMode=\"numeric\"\n autoComplete={autoComplete === \"bday\" ? `bday-${part}` : \"off\"}\n maxLength={DATE_PART_LENGTH[part]}\n value={parts[part]}\n disabled={disabled}\n aria-invalid={error ? true : undefined}\n className={s.input({ className: part === \"year\" ? \"w-20\" : \"w-14\" })}\n onChange={(e) => {\n const digits = e.target.value.replace(/\\D/g, \"\").slice(0, DATE_PART_LENGTH[part]);\n const next = { ...parts, [part]: digits };\n setParts(next);\n setValue(composeDate(next));\n const following = order[order.indexOf(part) + 1];\n if (digits.length === DATE_PART_LENGTH[part] && following) refs[following].current?.focus();\n }}\n />\n </label>\n ))}\n </div>\n {name ? <input type=\"hidden\" name={name} value={value ?? \"\"} /> : null}\n <Caption id={id} hint={hint} error={error} />\n </fieldset>\n );\n}\n\nexport type DateWheelProps = Common & {\n /** The date, `YYYY-MM-DD` (controlled); `\"\"` or `null` for none (the wheels then rest on `defaultView`). */\n value?: string | null;\n /** The date at first, uncontrolled. */\n defaultValue?: string | null;\n /** Called with the date under the band, always a real date within `min` / `max`. */\n onValueChange?: (value: string) => void;\n /** The earliest date (ISO): the years start there, the days before it are refused. Default: 120 years ago. */\n min?: string;\n /** The latest date (ISO): `latestBirthDate(18)` for an age gate. Default: today. */\n max?: string;\n /** Where the wheels rest while there is no value. Default: `max` (a birth date: the youngest allowed). */\n defaultView?: string;\n};\n\n/** Day, month and year as three wheels in the locale's order, bounded by `min` and `max`: always a real date. */\nexport function DateWheel({ label, locale, hint, error, disabled, name, labels: given, className, value: valueProp, defaultValue = null, onValueChange, min, max, defaultView }: DateWheelProps) {\n const labels = { ...dateFieldLabels, ...given };\n const id = React.useId();\n const [value, setValue] = useControllable<string | null>(valueProp, defaultValue, (v) => v && onValueChange?.(v));\n const today = todayIso();\n const hi = max ?? today;\n const lo = min ?? isoOf(Number(today.slice(0, 4)) - 120, 1, 1);\n const shown = value || defaultView || hi;\n const { year, month, day } = isoParts(shown);\n const order = React.useMemo(() => datePartsOrder(locale), [locale]);\n const months = React.useMemo(() => monthNames(locale, \"long\"), [locale]);\n const number = React.useMemo(() => new Intl.NumberFormat(locale, { useGrouping: false }), [locale]);\n const inBounds = (iso: string) => iso >= lo && iso <= hi;\n const set = (y: number, m: number, d: number) => {\n let next = isoOf(y, m, d);\n if (next > hi) next = hi;\n if (next < lo) next = lo;\n setValue(next);\n };\n const lastDay = daysInMonth(year, month);\n const columns: Record<DatePart, React.ReactNode> = {\n day: (\n <Wheel\n key=\"day\"\n label={labels.day}\n disabled={disabled}\n options={Array.from({ length: lastDay }, (_, i) => ({ value: String(i + 1), label: number.format(i + 1), disabled: !inBounds(isoOf(year, month, i + 1)) }))}\n value={String(Math.min(day, lastDay))}\n onValueChange={(v) => set(year, month, Number(v))}\n className=\"min-w-14\"\n />\n ),\n month: (\n <Wheel\n key=\"month\"\n label={labels.month}\n disabled={disabled}\n options={months.map((n, i) => ({ value: String(i + 1), label: n, disabled: isoOf(year, i + 1, daysInMonth(year, i + 1)) < lo || isoOf(year, i + 1, 1) > hi }))}\n value={String(month)}\n onValueChange={(v) => set(year, Number(v), day)}\n className=\"min-w-32 capitalize\"\n />\n ),\n year: (\n <Wheel\n key=\"year\"\n label={labels.year}\n disabled={disabled}\n options={yearRange(Number(hi.slice(0, 4)), Number(lo.slice(0, 4))).map((y) => ({ value: String(y), label: number.format(y) }))}\n value={String(year)}\n onValueChange={(v) => set(Number(v), month, day)}\n className=\"min-w-20\"\n />\n ),\n };\n return (\n <div className={dateField().root({ className })}>\n <span aria-hidden className={dateField().legend()}>\n {label}\n </span>\n <WheelPicker label={label} aria-describedby={error ? `${id}-error` : hint ? `${id}-hint` : undefined} invalid={Boolean(error)} unset={!value}>{order.map((part) => columns[part])}</WheelPicker>\n {name ? <input type=\"hidden\" name={name} value={value ?? \"\"} /> : null}\n <Caption id={id} hint={hint} error={error} />\n </div>\n );\n}\n","// Client. A wheel: a column of values that turns under a lit band — the touch idiom of a time, a date of birth, a\n// quantity. Each column is a `spinbutton` for assistive technologies and the keyboard (Up / Down, Page Up / Page Down by\n// five, Home / End), its value read as words (`aria-valuetext`); the hand scrolls it (scroll snap) or clicks a value.\n// The curve is a scroll-driven animation (CSS `animation-timeline: view()`): no script per frame, flat where unsupported.\nimport * as React from \"react\";\n\nimport { usePrefersReducedMotion } from \"../media\";\nimport { tv } from \"../tv\";\n\n/** A value of a wheel: what is stored, and its words (passed translated or formatted for the locale). */\nexport type WheelOption = { value: string; label: string; disabled?: boolean };\n\nexport const wheel = tv({\n slots: {\n root: \"group/wheel relative inline-flex select-none items-stretch gap-1 rounded-2xl border border-border-default data-[invalid]:border-danger bg-surface-1 bg-sheen px-2 shadow-raised inset-shadow-edge\",\n band: \"pointer-events-none absolute inset-x-1.5 top-1/2 -translate-y-1/2 rounded-xl border border-border-subtle bg-surface-3 inset-shadow-well\",\n column:\n \"relative z-[1] min-w-14 flex-1 rounded-xl outline-hidden focus-visible:focus-ring-inset data-[disabled]:pointer-events-none data-[disabled]:opacity-40\",\n scroller:\n \"kz-wheel h-full snap-y snap-mandatory overflow-y-auto overscroll-contain [scrollbar-width:none] [&::-webkit-scrollbar]:hidden \" +\n \"[mask-image:linear-gradient(to_bottom,transparent,#000_30%,#000_70%,transparent)]\",\n item:\n \"kz-wheel-item flex snap-center items-center justify-center px-2 text-base tabular-nums text-fg-secondary transition-colors \" +\n \"data-[selected]:font-semibold data-[selected]:text-fg data-[disabled]:text-fg-muted data-[disabled]:line-through \" +\n \"group-data-[unset]/wheel:data-[selected]:font-normal group-data-[unset]/wheel:data-[selected]:text-fg-secondary\",\n divider: \"z-[1] self-center text-base font-semibold text-fg-secondary\",\n },\n});\n\nconst ITEM = 40;\n\nexport type WheelProps = {\n /** The column's accessible name (\"Hour\", \"Month\"), passed translated. */\n label: string;\n /** The values, in order. */\n options: readonly WheelOption[];\n /** The chosen value (controlled). */\n value?: string | null;\n /** The chosen value at first, uncontrolled. Default: the first one. */\n defaultValue?: string;\n /** Called with the value that comes to rest under the band. */\n onValueChange?: (value: string) => void;\n /** Not available. */\n disabled?: boolean;\n /** Classes merged on the column (a width: `w-20`). */\n className?: string;\n};\n\nexport type WheelPickerProps = {\n /** The group's accessible name (\"Departure time\"), passed translated. */\n label: string;\n /** The wheels (`Wheel`), and dividers (`WheelDivider`) between them. */\n children: React.ReactNode;\n /** How many values are visible: 3, 5 (default) or 7. */\n visible?: 3 | 5 | 7;\n /** The help text or the error that describes the group (their ids). */\n \"aria-describedby\"?: string;\n /** Marks the group invalid (a danger edge): pair it with an error read through `aria-describedby`. */\n invalid?: boolean;\n /** Nothing is chosen yet: the values under the band stay quiet until a wheel is turned. */\n unset?: boolean;\n /** Classes merged on the root. */\n className?: string;\n};\n\nconst VisibleContext = React.createContext(5);\n\n/** The frame of one or several wheels: a raised surface, the lit band across them, a group named by `label`. */\nexport function WheelPicker({ label, children, visible = 5, \"aria-describedby\": describedBy, invalid, unset, className }: WheelPickerProps) {\n const s = wheel();\n return (\n <VisibleContext.Provider value={visible}>\n <div role=\"group\" aria-label={label} aria-describedby={describedBy} data-invalid={invalid ? \"\" : undefined} data-unset={unset ? \"\" : undefined} className={s.root({ className })} style={{ height: ITEM * visible }}>\n <span aria-hidden className={s.band()} style={{ height: ITEM }} />\n {children}\n </div>\n </VisibleContext.Provider>\n );\n}\n\n/** A divider between two wheels (`:` between the hours and the minutes). */\nexport function WheelDivider({ children }: { children: React.ReactNode }) {\n return (\n <span aria-hidden className={wheel().divider()}>\n {children}\n </span>\n );\n}\n\nconst nearestEnabled = (options: readonly WheelOption[], index: number) => {\n for (let d = 0; d < options.length; d++) {\n if (options[index + d] && !options[index + d]!.disabled) return index + d;\n if (options[index - d] && !options[index - d]!.disabled) return index - d;\n }\n return index;\n};\n\n/** One column of a `WheelPicker`: a spinbutton over a scroll-snapped list of values. */\nexport function Wheel({ label, options, value: valueProp, defaultValue, onValueChange, disabled, className }: WheelProps) {\n const s = wheel();\n const visible = React.useContext(VisibleContext);\n const [own, setOwn] = React.useState(defaultValue ?? options[0]?.value ?? \"\");\n const value = valueProp ?? own;\n const index = Math.max(0, options.findIndex((o) => o.value === value));\n const scroller = React.useRef<HTMLDivElement>(null);\n const settle = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n const programmatic = React.useRef(false);\n const reduce = usePrefersReducedMotion();\n const mounted = React.useRef(false);\n\n const commit = React.useCallback(\n (i: number) => {\n const target = nearestEnabled(options, Math.min(options.length - 1, Math.max(0, i)));\n const option = options[target];\n if (!option) return;\n if (valueProp === undefined) setOwn(option.value);\n if (option.value !== value) onValueChange?.(option.value);\n },\n [options, valueProp, value, onValueChange],\n );\n\n // The list follows the value (a key, a click, a change from outside): at once the first time, smoothly after.\n React.useEffect(() => {\n const el = scroller.current;\n if (!el) return;\n const top = index * ITEM;\n if (Math.abs(el.scrollTop - top) < 1) return;\n programmatic.current = true;\n if (typeof el.scrollTo === \"function\") el.scrollTo({ top, behavior: mounted.current && !reduce ? \"smooth\" : \"auto\" });\n else el.scrollTop = top;\n mounted.current = true;\n const t = setTimeout(() => (programmatic.current = false), 400);\n return () => clearTimeout(t);\n }, [index, reduce]);\n\n const onScroll = () => {\n if (programmatic.current) return;\n if (settle.current) clearTimeout(settle.current);\n settle.current = setTimeout(() => {\n const el = scroller.current;\n if (el) commit(Math.round(el.scrollTop / ITEM));\n }, 90);\n };\n React.useEffect(() => () => void (settle.current && clearTimeout(settle.current)), []);\n\n const onKeyDown = (event: React.KeyboardEvent) => {\n const step = (by: number) => {\n let i = index + by;\n while (options[i]?.disabled) i += Math.sign(by);\n return options[i] ? i : index;\n };\n const moves: Record<string, () => number> = {\n ArrowUp: () => step(-1),\n ArrowDown: () => step(1),\n PageUp: () => Math.max(0, nearestEnabled(options, index - 5)),\n PageDown: () => Math.min(options.length - 1, nearestEnabled(options, index + 5)),\n Home: () => nearestEnabled(options, 0),\n End: () => nearestEnabled(options, options.length - 1),\n };\n const move = moves[event.key];\n if (!move) return;\n event.preventDefault();\n commit(move());\n };\n\n const pad = ((visible - 1) / 2) * ITEM;\n const current = options[index];\n return (\n <div\n role=\"spinbutton\"\n tabIndex={disabled ? -1 : 0}\n aria-label={label}\n aria-valuenow={index}\n aria-valuemin={0}\n aria-valuemax={Math.max(0, options.length - 1)}\n aria-valuetext={current?.label}\n aria-disabled={disabled || undefined}\n data-disabled={disabled ? \"\" : undefined}\n className={s.column({ className })}\n onKeyDown={onKeyDown}\n >\n <div ref={scroller} aria-hidden className={s.scroller()} style={{ paddingBlock: pad, scrollPaddingBlock: pad }} onScroll={onScroll}>\n {options.map((o, i) => (\n <div\n key={o.value}\n data-value={o.value}\n data-selected={i === index ? \"\" : undefined}\n data-disabled={o.disabled ? \"\" : undefined}\n className={s.item()}\n style={{ height: ITEM }}\n onClick={() => !o.disabled && commit(i)}\n >\n {o.label}\n </div>\n ))}\n </div>\n </div>\n );\n}\n","// Client (a portal). A field-like button that opens the `Calendar` in a Popover (Radix: Escape closes, the focus\n// returns to the button). The value is an ISO date (`\"2026-10-11\"`) — the same string in a form, an address and an\n// API; the button reads it in the `locale`'s own format through `@krizaka/intl`.\nimport { formatDate, getDateTimeFormat } from \"@krizaka/intl\";\nimport * as React from \"react\";\n\nimport { CalendarGlyph, CloseGlyph } from \"../glyphs\";\nimport { useControllable } from \"../media\";\nimport { Popover } from \"../popover\";\nimport { tv } from \"../tv\";\nimport { Calendar, type CalendarLabels, calendarLabels, type CalendarProps, type DateRange, type IsoDate, toLocalDate } from \"./calendar\";\n\nexport const datePicker = tv({\n slots: {\n root: \"flex w-full flex-col gap-1.5\",\n label: \"text-xs font-semibold text-fg-secondary\",\n row: \"relative flex w-full\",\n // The field is a well (inset), the calendar opens on a raised, lit surface.\n trigger:\n \"group flex h-11 w-full items-center gap-2.5 rounded-lg border border-border-default bg-surface-2 px-3 text-left text-sm text-fg inset-shadow-well \" +\n \"transition-[border-color,box-shadow] hover:border-border-strong focus-visible:border-accent focus-visible:outline-hidden focus-visible:focus-ring-inset \" +\n \"data-[state=open]:border-accent data-[placeholder]:text-fg-muted aria-invalid:border-danger disabled:cursor-not-allowed disabled:opacity-50 data-[clearable]:pr-10\",\n icon: \"h-4 w-4 shrink-0 text-fg-secondary transition-colors group-data-[state=open]:text-fg-accent\",\n clear:\n \"absolute right-1.5 top-1/2 inline-flex h-8 w-8 -translate-y-1/2 items-center justify-center rounded-md text-fg-secondary hover:bg-surface-3 hover:text-fg \" +\n \"focus-visible:outline-hidden focus-visible:focus-ring\",\n content: \"w-auto rounded-2xl bg-sheen p-4 shadow-floating inset-shadow-edge\",\n layout: \"flex flex-col gap-4 sm:flex-row\",\n presets: \"flex gap-1.5 overflow-x-auto pb-1 sm:w-40 sm:flex-col sm:overflow-visible sm:border-r sm:border-border-subtle sm:pb-0 sm:pr-4\",\n preset:\n \"inline-flex shrink-0 items-center gap-2.5 whitespace-nowrap rounded-lg px-2.5 py-2 text-left text-xs font-semibold text-fg-secondary transition-colors \" +\n \"hover:bg-surface-3 hover:text-fg focus-visible:outline-hidden focus-visible:focus-ring aria-pressed:bg-accent-soft aria-pressed:text-fg\",\n presetNode: \"node shrink-0 group-aria-pressed:node-lit\",\n hint: \"text-xs text-fg-secondary\",\n error: \"flex items-center gap-1.5 text-xs font-medium text-fg-danger before:h-1.5 before:w-1.5 before:shrink-0 before:rounded-full before:bg-danger\",\n },\n});\n\nexport type DatePickerLabels = CalendarLabels & {\n /** The clear button (\"Clear date\"). */\n clear: string;\n};\n\nexport const datePickerLabels: DatePickerLabels = { ...calendarLabels, clear: \"Clear date\" };\n\ntype Shared = Pick<CalendarProps, \"locale\" | \"min\" | \"max\" | \"isDateDisabled\" | \"weekStartsOn\" | \"today\"> & {\n /** The visible label, passed translated (also the button's accessible name, with the value). */\n label: string;\n /** Shown while nothing is chosen (\"Pick a date\"), passed translated. */\n placeholder?: string;\n /** `short` · `medium` (default) · `long`: how the button writes the date. */\n format?: \"short\" | \"medium\" | \"long\";\n /** Adds a button that empties the value. */\n clearable?: boolean;\n /** A help text under the field. */\n hint?: string;\n /** An error under the field: marks it invalid and is read with it. */\n error?: string;\n /** Not available. */\n disabled?: boolean;\n /** The name of a hidden input holding the ISO value, for a plain `<form>` post. */\n name?: string;\n /** Opens the calendar at first (a story, a test). */\n defaultOpen?: boolean;\n /** The words, passed translated; English by default. */\n labels?: Partial<DatePickerLabels>;\n /** Classes merged on the root. */\n className?: string;\n};\n\nexport type DatePickerProps = Shared & {\n /** The chosen date, ISO (controlled); `null` for none. */\n value?: IsoDate | null;\n /** The chosen date at first, uncontrolled. */\n defaultValue?: IsoDate | null;\n /** Called with the date picked, or `null` when cleared. */\n onValueChange?: (value: IsoDate | null) => void;\n};\n\nfunction Field({\n shared,\n text,\n hasValue,\n onClear,\n hidden,\n open,\n setOpen,\n children,\n}: {\n shared: Shared;\n text: string | null;\n hasValue: boolean;\n onClear: () => void;\n hidden: string;\n open: boolean;\n setOpen: (open: boolean) => void;\n children: React.ReactNode;\n}) {\n const { label, placeholder, clearable, hint, error, disabled, name, className } = shared;\n const labels = { ...datePickerLabels, ...shared.labels };\n const s = datePicker();\n const id = React.useId();\n const describedBy = [hint ? `${id}-hint` : null, error ? `${id}-error` : null].filter(Boolean).join(\" \") || undefined;\n return (\n <div className={s.root({ className })}>\n <label htmlFor={`${id}-trigger`} className={s.label()}>\n {label}\n </label>\n <Popover.Root open={open} onOpenChange={setOpen}>\n <div className={s.row()}>\n <Popover.Trigger asChild>\n <button\n id={`${id}-trigger`}\n type=\"button\"\n aria-haspopup=\"dialog\"\n aria-describedby={describedBy}\n aria-invalid={error ? true : undefined}\n disabled={disabled}\n data-placeholder={hasValue ? undefined : \"\"}\n data-clearable={clearable && hasValue ? \"\" : undefined}\n className={s.trigger()}\n >\n <CalendarGlyph className={s.icon()} />\n <span className=\"truncate\">{text ?? placeholder ?? \"\"}</span>\n </button>\n </Popover.Trigger>\n {clearable && hasValue && !disabled ? (\n <button type=\"button\" aria-label={labels.clear} className={s.clear()} onClick={onClear}>\n <CloseGlyph className=\"h-4 w-4\" />\n </button>\n ) : null}\n </div>\n <Popover.Content align=\"start\" aria-label={label} className={s.content()}>\n {children}\n </Popover.Content>\n </Popover.Root>\n {name ? <input type=\"hidden\" name={name} value={hidden} /> : null}\n {hint ? (\n <p id={`${id}-hint`} className={s.hint()}>\n {hint}\n </p>\n ) : null}\n {error ? (\n <p id={`${id}-error`} className={s.error()}>\n {error}\n </p>\n ) : null}\n </div>\n );\n}\n\n/** A date field: a button showing the date in the locale's format, a calendar in a popover, an ISO value. */\nexport function DatePicker({ value: valueProp, defaultValue = null, onValueChange, defaultOpen = false, ...shared }: DatePickerProps) {\n const [value, setValue] = useControllable<IsoDate | null>(valueProp, defaultValue, onValueChange);\n const [open, setOpen] = React.useState(defaultOpen);\n const { locale, format = \"medium\" } = shared;\n return (\n <Field\n shared={shared}\n text={value ? formatDate(toLocalDate(value), { locale, style: format }) : null}\n hasValue={Boolean(value)}\n onClear={() => setValue(null)}\n hidden={value ?? \"\"}\n open={open}\n setOpen={setOpen}\n >\n <Calendar\n {...shared}\n autoFocus\n value={value}\n onSelect={(date) => {\n setValue(date);\n setOpen(false);\n }}\n />\n </Field>\n );\n}\n\nexport type DateRangePreset = {\n /** Its name, passed translated (\"Last 7 days\"). */\n label: string;\n /** The first day, ISO. */\n start: IsoDate;\n /** The last day, ISO. */\n end: IsoDate;\n};\n\nexport type DateRangePickerProps = Shared & {\n /** The chosen range (controlled); `null` for none. `end` is never `null` in a committed value. */\n value?: { start: IsoDate; end: IsoDate } | null;\n /** The range at first, uncontrolled. */\n defaultValue?: { start: IsoDate; end: IsoDate } | null;\n /** Called once both ends are chosen (or with `null` when cleared). */\n onValueChange?: (value: { start: IsoDate; end: IsoDate } | null) => void;\n /** Ranges one click away (\"Last 7 days\", \"This month\"), beside the calendar. */\n presets?: readonly DateRangePreset[];\n /** Two months side by side (default, from a phone's width up) or one. */\n numberOfMonths?: 1 | 2;\n};\n\n/** Formats a range as the locale writes one (\"Oct 1 – 11, 2026\"), through Intl's `formatRange` where available. */\nfunction formatRange(locale: string, start: IsoDate, end: IsoDate, style: \"short\" | \"medium\" | \"long\") {\n const formatter = getDateTimeFormat(locale, { dateStyle: style }) as Intl.DateTimeFormat & { formatRange?: (a: Date, b: Date) => string };\n return formatter.formatRange\n ? formatter.formatRange(toLocalDate(start), toLocalDate(end))\n : `${formatter.format(toLocalDate(start))} – ${formatter.format(toLocalDate(end))}`;\n}\n\n/** A period field: two clicks on one calendar (the days between tinted as you hover), optional presets. */\nexport function DateRangePicker({ value: valueProp, defaultValue = null, onValueChange, presets, numberOfMonths = 2, defaultOpen = false, ...shared }: DateRangePickerProps) {\n const [value, setValue] = useControllable(valueProp, defaultValue, onValueChange);\n const [draft, setDraft] = React.useState<DateRange | null>(null);\n const [open, setOpenState] = React.useState(defaultOpen);\n const { locale, format = \"medium\" } = shared;\n const s = datePicker();\n const setOpen = (next: boolean) => {\n setOpenState(next);\n setDraft(null);\n };\n const shown: DateRange | null = draft ?? value;\n const pick = (date: IsoDate) => {\n if (!draft) setDraft({ start: date, end: null });\n else {\n const [start, end] = date < draft.start ? [date, draft.start] : [draft.start, date];\n setValue({ start, end });\n setOpen(false);\n }\n };\n return (\n <Field\n shared={shared}\n text={value ? formatRange(locale, value.start, value.end, format) : null}\n hasValue={Boolean(value)}\n onClear={() => setValue(null)}\n hidden={value ? `${value.start}/${value.end}` : \"\"}\n open={open}\n setOpen={setOpen}\n >\n <div className={s.layout()}>\n {presets?.length ? (\n <div className={s.presets()}>\n {presets.map((preset) => (\n <button\n key={preset.label}\n type=\"button\"\n aria-pressed={value?.start === preset.start && value?.end === preset.end}\n className={s.preset({ className: \"group\" })}\n onClick={() => {\n setValue({ start: preset.start, end: preset.end });\n setOpen(false);\n }}\n >\n <span aria-hidden className={s.presetNode()} />\n {preset.label}\n </button>\n ))}\n </div>\n ) : null}\n <Calendar {...shared} autoFocus range={shown} onSelect={pick} numberOfMonths={numberOfMonths} />\n </div>\n </Field>\n );\n}\n","// Client (a portal). Radix places the content, traps nothing, closes on Escape and on an outside click, and returns\n// the focus to the trigger.\nimport { Popover as PopoverPrimitive } from \"radix-ui\";\nimport type * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { floating } from \"../floating\";\n\nexport type PopoverContentProps = React.ComponentProps<typeof PopoverPrimitive.Content> & {\n /** The element the portal renders into (default: document.body). */\n container?: HTMLElement | null;\n};\n\nexport function PopoverContent({ sideOffset = 8, collisionPadding = 8, container, className, ...props }: PopoverContentProps) {\n return (\n <PopoverPrimitive.Portal container={container}>\n <PopoverPrimitive.Content\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n className={cn(floating, \"w-72 max-w-(--radix-popover-content-available-width) p-4 origin-(--radix-popover-content-transform-origin)\", className)}\n {...props}\n />\n </PopoverPrimitive.Portal>\n );\n}\n\n/** `Popover.Root/Trigger/Anchor/Content/Close`. `open`/`defaultOpen` + `onOpenChange`. */\nexport const Popover = {\n Root: PopoverPrimitive.Root,\n Trigger: PopoverPrimitive.Trigger,\n Anchor: PopoverPrimitive.Anchor,\n Close: PopoverPrimitive.Close,\n Content: PopoverContent,\n};\n","// Client. The days ahead as a strip that scrolls sideways — the agenda of the next two weeks, a delivery day, a\n// session. A radio group: one tab stop, the arrows move and pick (Home / End: the first and last day), each day named by\n// its full date; a marked day (it has something) says so in its name. The buttons at the ends page by a screen.\nimport { formatDate, getDateTimeFormat } from \"@krizaka/intl\";\nimport * as React from \"react\";\n\nimport { ChevronGlyph } from \"../glyphs\";\nimport { useControllable, usePrefersReducedMotion } from \"../media\";\nimport { tv } from \"../tv\";\nimport { addDays, type IsoDate, toIsoDate, toLocalDate } from \"./calendar\";\n\nexport const dayStrip = tv({\n slots: {\n root: \"flex w-full min-w-0 flex-col gap-2\",\n header: \"flex items-center justify-between gap-2\",\n title: \"text-sm font-semibold capitalize text-fg\",\n navs: \"flex gap-1.5\",\n nav:\n \"inline-flex h-8 w-8 items-center justify-center rounded-lg border border-border-subtle bg-surface-2 bg-sheen text-fg-secondary inset-shadow-edge \" +\n \"transition-colors hover:border-border-strong hover:text-fg focus-visible:outline-hidden focus-visible:focus-ring disabled:pointer-events-none disabled:opacity-35\",\n track:\n \"-mx-1 flex snap-x snap-mandatory gap-2 overflow-x-auto scroll-smooth px-1 py-1.5 [scrollbar-width:none] motion-reduce:scroll-auto [&::-webkit-scrollbar]:hidden\",\n day:\n \"relative flex h-[4.5rem] w-14 shrink-0 snap-start flex-col items-center justify-center gap-0.5 rounded-2xl border border-border-default bg-surface-2 bg-sheen text-fg inset-shadow-edge \" +\n \"transition-[background-color,border-color,box-shadow,transform] duration-150 hover:border-border-strong active:scale-95 \" +\n \"motion-reduce:transition-none motion-reduce:active:scale-100 focus-visible:outline-hidden focus-visible:focus-ring \" +\n \"aria-checked:border-transparent aria-checked:bg-accent aria-checked:bg-fill-shade aria-checked:text-on-accent aria-checked:shadow-glow aria-checked:inset-shadow-edge-fill \" +\n \"disabled:cursor-not-allowed disabled:border-dashed disabled:bg-transparent disabled:bg-none disabled:text-fg-muted disabled:shadow-none\",\n weekday: \"text-[11px] font-semibold uppercase tracking-wider text-fg-secondary group-aria-checked:text-on-accent group-disabled:text-fg-muted\",\n number: \"text-lg font-semibold tabular-nums leading-none\",\n // Today: the node of the marks above the number; a marked day: a dot under it.\n node: \"absolute top-1.5 h-1 w-1 rotate-45 rounded-[1px] bg-accent group-aria-checked:bg-on-accent\",\n mark: \"h-1.5 w-1.5 rounded-full bg-fg-secondary group-aria-checked:bg-on-accent\",\n noMark: \"h-1.5 w-1.5\",\n },\n});\n\nexport type DayStripLabels = {\n /** The button that shows the earlier days (\"Earlier days\"). */\n previous: string;\n /** The button that shows the later days (\"Later days\"). */\n next: string;\n /** Added to the name of a marked day (\"has events\"). */\n marked: string;\n};\n\nexport const dayStripLabels: DayStripLabels = { previous: \"Earlier days\", next: \"Later days\", marked: \"has events\" };\n\nexport type DayStripProps = {\n /** The group's accessible name (\"Delivery day\"), passed translated. */\n label: string;\n /** The BCP 47 locale of the names and the dates: always explicit. */\n locale: string;\n /** The chosen day, ISO (controlled); `null` for none. */\n value?: IsoDate | null;\n /** The chosen day at first, uncontrolled. */\n defaultValue?: IsoDate | null;\n /** Called with the day picked. */\n onValueChange?: (value: IsoDate) => void;\n /** The first day of the strip. Default: today. */\n start?: IsoDate;\n /** How many days. Default 14. */\n days?: number;\n /** Refuses some days (closed, full): drawn dashed, skipped by the arrows. */\n isDateDisabled?: (date: IsoDate) => boolean;\n /** Marks the days that have something (a session, an event): a dot, and `labels.marked` in their name. */\n isDateMarked?: (date: IsoDate) => boolean;\n /** Today (marked by the node): inject it for a stable render or a test. Default: the device's date. */\n today?: IsoDate;\n /** Shows the month of the chosen day (or of the first) and the page buttons above the strip. */\n showHeader?: boolean;\n /** The words, passed translated; English by default. */\n labels?: Partial<DayStripLabels>;\n /** Classes merged on the root. */\n className?: string;\n};\n\n/** The days ahead in a row that scrolls sideways: one picked, today and the marked days shown. */\nexport function DayStrip({ label, locale, value: valueProp, defaultValue = null, onValueChange, start, days = 14, isDateDisabled, isDateMarked, today: todayProp, showHeader = true, labels: given, className }: DayStripProps) {\n const labels = { ...dayStripLabels, ...given };\n const s = dayStrip();\n const today = todayProp ?? toIsoDate(new Date());\n const first = start ?? today;\n const list = React.useMemo(() => Array.from({ length: days }, (_, i) => addDays(first, i)), [first, days]);\n const [value, setValue] = useControllable<IsoDate | null>(valueProp, defaultValue, (v) => v && onValueChange?.(v));\n const enabled = list.filter((d) => !isDateDisabled?.(d));\n const tabStop = value && enabled.includes(value) ? value : enabled[0];\n const track = React.useRef<HTMLDivElement>(null);\n const reduce = usePrefersReducedMotion();\n const weekday = getDateTimeFormat(locale, { weekday: \"short\" });\n const monthTitle = getDateTimeFormat(locale, { month: \"long\", year: \"numeric\" }).format(toLocalDate(value ?? first));\n\n const reveal = (iso: IsoDate, focus: boolean) => {\n const el = track.current?.querySelector<HTMLButtonElement>(`[data-date=\"${iso}\"]`);\n if (!el) return;\n if (focus) el.focus({ preventScroll: true });\n el.scrollIntoView?.({ block: \"nearest\", inline: \"nearest\", behavior: reduce ? \"auto\" : \"smooth\" });\n };\n // The chosen day is in view when the strip appears.\n React.useEffect(() => {\n if (value) track.current?.querySelector<HTMLElement>(`[data-date=\"${value}\"]`)?.scrollIntoView?.({ block: \"nearest\", inline: \"center\" });\n // Only once: afterwards the person scrolls.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const onKeyDown = (event: React.KeyboardEvent) => {\n const i = enabled.indexOf(tabStop ?? \"\");\n const moves: Record<string, number> = { ArrowRight: i + 1, ArrowDown: i + 1, ArrowLeft: i - 1, ArrowUp: i - 1, Home: 0, End: enabled.length - 1 };\n const to = moves[event.key];\n if (to === undefined) return;\n event.preventDefault();\n const next = enabled[Math.min(enabled.length - 1, Math.max(0, to))];\n if (!next) return;\n setValue(next);\n reveal(next, true);\n };\n const page = (by: number) => {\n const el = track.current;\n if (!el) return;\n el.scrollBy?.({ left: by * el.clientWidth * 0.8, behavior: reduce ? \"auto\" : \"smooth\" });\n };\n\n return (\n <div className={s.root({ className })}>\n {showHeader ? (\n <div className={s.header()}>\n <span className={s.title()} aria-hidden>\n {monthTitle}\n </span>\n <span className={s.navs()}>\n <button type=\"button\" className={s.nav()} aria-label={labels.previous} onClick={() => page(-1)}>\n <ChevronGlyph direction=\"left\" className=\"h-4 w-4\" />\n </button>\n <button type=\"button\" className={s.nav()} aria-label={labels.next} onClick={() => page(1)}>\n <ChevronGlyph direction=\"right\" className=\"h-4 w-4\" />\n </button>\n </span>\n </div>\n ) : null}\n <div ref={track} role=\"radiogroup\" aria-label={label} className={s.track()} onKeyDown={onKeyDown}>\n {list.map((iso) => {\n const marked = Boolean(isDateMarked?.(iso));\n const name = formatDate(toLocalDate(iso), { locale, style: \"long\" });\n return (\n <button\n key={iso}\n type=\"button\"\n role=\"radio\"\n data-date={iso}\n aria-checked={iso === value}\n aria-current={iso === today ? \"date\" : undefined}\n aria-label={marked ? `${name}, ${labels.marked}` : name}\n tabIndex={iso === tabStop ? 0 : -1}\n disabled={Boolean(isDateDisabled?.(iso))}\n className={s.day({ className: \"group\" })}\n onClick={() => setValue(iso)}\n >\n {iso === today ? <span aria-hidden className={s.node()} /> : null}\n <span aria-hidden className={s.weekday()}>\n {weekday.format(toLocalDate(iso)).replace(/\\.$/, \"\")}\n </span>\n <span aria-hidden className={s.number()}>\n {Number(iso.slice(8))}\n </span>\n <span aria-hidden className={marked ? s.mark() : s.noMark()} />\n </button>\n );\n })}\n </div>\n </div>\n );\n}\n","// Client. A time of day, `HH:mm` on 24 hours whatever the locale shows: as wheels (hours, minutes by a step, the day\n// period where the locale uses one) or as slots (the free times of an agenda, a radio group: one tab stop, the arrows\n// move and pick). The words come from Intl for the `locale` given.\nimport * as React from \"react\";\n\nimport { useControllable } from \"../media\";\nimport { tv } from \"../tv\";\nimport { dayPeriods, formatTime, timeToMinutes, type TimeValue, uses12Hours } from \"./parts\";\nimport { Wheel, WheelDivider, type WheelOption, WheelPicker } from \"./wheel\";\n\nexport const timePicker = tv({\n slots: {\n slots: \"grid grid-cols-[repeat(auto-fill,minmax(5.5rem,1fr))] gap-2\",\n slot:\n \"h-11 rounded-xl border border-border-default bg-surface-2 bg-sheen px-3 text-sm font-semibold tabular-nums text-fg inset-shadow-edge \" +\n \"transition-[background-color,border-color,box-shadow,transform] duration-150 hover:border-border-strong active:scale-[0.97] \" +\n \"motion-reduce:transition-none motion-reduce:active:scale-100 focus-visible:outline-hidden focus-visible:focus-ring \" +\n \"aria-checked:border-transparent aria-checked:bg-accent aria-checked:bg-fill-shade aria-checked:text-on-accent aria-checked:shadow-glow aria-checked:inset-shadow-edge-fill \" +\n \"disabled:cursor-not-allowed disabled:border-dashed disabled:bg-transparent disabled:bg-none disabled:font-normal disabled:text-fg-muted disabled:line-through disabled:shadow-none\",\n group: \"flex flex-col gap-2\",\n heading: \"text-[11px] font-semibold uppercase tracking-wider text-fg-secondary\",\n },\n});\n\nexport type TimePickerLabels = {\n /** The hours' wheel (\"Hours\"). */\n hours: string;\n /** The minutes' wheel (\"Minutes\"). */\n minutes: string;\n /** The day period's wheel (\"AM/PM\"). */\n period: string;\n};\n\nexport const timePickerLabels: TimePickerLabels = { hours: \"Hours\", minutes: \"Minutes\", period: \"AM/PM\" };\n\ntype Shared = {\n /** The accessible name of the picker (\"Pick-up time\"), passed translated. */\n label: string;\n /** The BCP 47 locale: how times are written, and whether the day has a period (AM/PM). */\n locale: string;\n /** The time, `HH:mm` on 24 hours (controlled); `null` for none. */\n value?: TimeValue | null;\n /** The time at first, uncontrolled. */\n defaultValue?: TimeValue | null;\n /** Called with the time chosen. */\n onValueChange?: (value: TimeValue) => void;\n /** Not available. */\n disabled?: boolean;\n /** Classes merged on the root. */\n className?: string;\n};\n\nexport type TimePickerProps = Shared &\n (\n | {\n /** `wheel`: hours and minutes (and the period) as wheels — a time you set (a reminder, an alarm). */\n variant?: \"wheel\";\n /** The minutes' step: 1, 5 (default), 10, 15, 30. */\n minuteStep?: number;\n /** Forces 12 or 24 hours. Default: the locale's. */\n hour12?: boolean;\n /** The words of the wheels, passed translated; English by default. */\n labels?: Partial<TimePickerLabels>;\n slots?: never;\n isTimeDisabled?: never;\n groupLabels?: never;\n }\n | {\n /** `slots`: the free times as buttons — a booking, a delivery window, an appointment. */\n variant: \"slots\";\n /** The times offered, `HH:mm` (`timeSlots(\"09:00\", \"17:00\", 30)`). */\n slots: readonly TimeValue[];\n /** Refuses some slots (taken, too soon): drawn struck through, skipped by the arrows. */\n isTimeDisabled?: (time: TimeValue) => boolean;\n /** Splits the slots under headings by part of the day: `{ morning: \"Morning\", afternoon: \"Afternoon\", evening: \"Evening\" }`. */\n groupLabels?: { morning: string; afternoon: string; evening: string };\n minuteStep?: never;\n hour12?: never;\n labels?: never;\n }\n );\n\n/** A time of day: wheels to set one, or slots to book one. */\nexport function TimePicker(props: TimePickerProps) {\n return props.variant === \"slots\" ? <TimeSlots {...props} /> : <TimeWheels {...props} />;\n}\n\nfunction TimeWheels({ label, locale, value: valueProp, defaultValue = null, onValueChange, disabled, className, minuteStep = 5, hour12, labels: given }: Extract<TimePickerProps, { variant?: \"wheel\" }>) {\n const labels = { ...timePickerLabels, ...given };\n const [value, setValue] = useControllable<TimeValue | null>(valueProp, defaultValue, (v) => v && onValueChange?.(v));\n const twelve = hour12 ?? uses12Hours(locale);\n const total = timeToMinutes(value) ?? 9 * 60;\n const h24 = Math.floor(total / 60);\n const minute = total % 60;\n const pm = h24 >= 12;\n const two = (n: number) => String(n).padStart(2, \"0\");\n const number = React.useMemo(() => new Intl.NumberFormat(locale, { minimumIntegerDigits: 2, useGrouping: false }), [locale]);\n const hours: WheelOption[] = twelve\n ? Array.from({ length: 12 }, (_, i) => ({ value: String(i === 0 ? 12 : i), label: String(i === 0 ? 12 : i) })).sort((a, b) => (Number(a.value) % 12) - (Number(b.value) % 12))\n : Array.from({ length: 24 }, (_, i) => ({ value: String(i), label: number.format(i) }));\n const minutes: WheelOption[] = Array.from({ length: Math.ceil(60 / minuteStep) }, (_, i) => ({ value: String(i * minuteStep), label: number.format(i * minuteStep) }));\n // A minute that is not on the step (an existing value) is rounded to the nearest one shown.\n const shownMinute = String(Math.min(60 - minuteStep, Math.round(minute / minuteStep) * minuteStep));\n const [am, pmLabel] = dayPeriods(locale);\n const set = (h: number, m: number) => setValue(`${two(h)}:${two(m)}`);\n return (\n <WheelPicker label={`${label}, ${value ? formatTime(locale, value) : \"\"}`.replace(/, $/, \"\")} className={className}>\n <Wheel\n label={labels.hours}\n options={hours}\n disabled={disabled}\n value={twelve ? String(h24 % 12 === 0 ? 12 : h24 % 12) : String(h24)}\n onValueChange={(v) => set(twelve ? (Number(v) % 12) + (pm ? 12 : 0) : Number(v), minute)}\n />\n <WheelDivider>:</WheelDivider>\n <Wheel label={labels.minutes} options={minutes} disabled={disabled} value={shownMinute} onValueChange={(v) => set(h24, Number(v))} />\n {twelve ? (\n <Wheel\n label={labels.period}\n options={[\n { value: \"am\", label: am },\n { value: \"pm\", label: pmLabel },\n ]}\n disabled={disabled}\n value={pm ? \"pm\" : \"am\"}\n onValueChange={(v) => set((h24 % 12) + (v === \"pm\" ? 12 : 0), minute)}\n />\n ) : null}\n </WheelPicker>\n );\n}\n\nfunction TimeSlots({ label, locale, value: valueProp, defaultValue = null, onValueChange, disabled, className, slots, isTimeDisabled, groupLabels }: Extract<TimePickerProps, { variant: \"slots\" }>) {\n const s = timePicker();\n const [value, setValue] = useControllable<TimeValue | null>(valueProp, defaultValue, (v) => v && onValueChange?.(v));\n const enabled = slots.filter((t) => !disabled && !isTimeDisabled?.(t));\n const tabStop = value && enabled.includes(value) ? value : enabled[0];\n const root = React.useRef<HTMLDivElement>(null);\n const onKeyDown = (event: React.KeyboardEvent) => {\n const i = enabled.indexOf(tabStop ?? \"\");\n const moves: Record<string, number> = { ArrowRight: i + 1, ArrowDown: i + 1, ArrowLeft: i - 1, ArrowUp: i - 1, Home: 0, End: enabled.length - 1 };\n const to = moves[event.key];\n if (to === undefined) return;\n event.preventDefault();\n const next = enabled[(to + enabled.length) % enabled.length];\n if (!next) return;\n setValue(next);\n root.current?.querySelector<HTMLButtonElement>(`[data-time=\"${next}\"]`)?.focus();\n };\n const button = (t: TimeValue) => {\n const off = disabled || Boolean(isTimeDisabled?.(t));\n return (\n <button\n key={t}\n type=\"button\"\n role=\"radio\"\n data-time={t}\n aria-checked={t === value}\n tabIndex={t === tabStop ? 0 : -1}\n disabled={off}\n className={s.slot()}\n onClick={() => setValue(t)}\n >\n {formatTime(locale, t)}\n </button>\n );\n };\n const part = (t: TimeValue) => {\n const m = timeToMinutes(t) ?? 0;\n return m < 12 * 60 ? \"morning\" : m < 18 * 60 ? \"afternoon\" : \"evening\";\n };\n return (\n <div ref={root} role=\"radiogroup\" aria-label={label} aria-disabled={disabled || undefined} className={className} onKeyDown={onKeyDown}>\n {groupLabels ? (\n <div className=\"flex flex-col gap-4\">\n {([\"morning\", \"afternoon\", \"evening\"] as const).map((p) => {\n const inPart = slots.filter((t) => part(t) === p);\n if (!inPart.length) return null;\n return (\n <div key={p} role=\"group\" aria-label={groupLabels[p]} className={s.group()}>\n <span aria-hidden className={s.heading()}>\n {groupLabels[p]}\n </span>\n <div className={s.slots()}>{inPart.map(button)}</div>\n </div>\n );\n })}\n </div>\n ) : (\n <div className={s.slots()}>{slots.map(button)}</div>\n )}\n </div>\n );\n}\n\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAQA,SAAS,YAAY,yBAAyB;AAC9C,YAAYA,YAAW;;;ACNvB,YAAY,WAAW;;;ACIhB,IAAM,mBAAuD,EAAE,KAAK,GAAG,OAAO,GAAG,MAAM,EAAE;AAGzF,SAAS,eAAe,QAA4B;AACzD,MAAI;AACF,UAAM,QAAQ,IAAI,KAAK,eAAe,QAAQ,EAAE,KAAK,WAAW,OAAO,WAAW,MAAM,UAAU,CAAC,EAAE,cAAc,IAAI,KAAK,MAAM,IAAI,EAAE,CAAC;AACzI,UAAM,QAAQ,MAAM,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,MAAqB,MAAM,SAAS,MAAM,WAAW,MAAM,MAAM;AAChH,QAAI,MAAM,WAAW,EAAG,QAAO;AAAA,EACjC,QAAQ;AAAA,EAER;AAC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M,UAAU,IAAI;AAAA,QAC9B,UAAU;AAAA,QACV,WAAW,EAAE,KAAK;AAAA,QAClB,SAAS,MAAM,SAAS,CAAC;AAAA,QAExB,qBAAW,QAAQ,CAAC;AAAA;AAAA,MAVhB;AAAA,IAWP;AAAA,EAEJ;AACA,QAAM,OAAO,CAAC,MAAiB;AAC7B,UAAM,IAAI,cAAc,CAAC,KAAK;AAC9B,WAAO,IAAI,KAAK,KAAK,YAAY,IAAI,KAAK,KAAK,cAAc;AAAA,EAC/D;AACA,SACE,gBAAAA,KAAC,SAAI,KAAK,MAAM,MAAK,cAAa,cAAY,OAAO,iBAAe,YAAY,QAAW,WAAsB,WAC9G,wBACC,gBAAAA,KAAC,SAAI,WAAU,uBACX,WAAC,WAAW,aAAa,SAAS,EAAY,IAAI,CAAC,MAAM;AACzD,UAAM,SAAS,MAAM,OAAO,CAAC,MAAM,KAAK,CAAC,MAAM,CAAC;AAChD,QAAI,CAAC,OAAO,OAAQ,QAAO;AAC3B,WACE,gBAAAC,MAAC,SAAY,MAAK,SAAQ,cAAY,YAAY,CAAC,GAAG,WAAW,EAAE,MAAM,GACvE;AAAA,sBAAAD,KAAC,UAAK,eAAW,MAAC,WAAW,EAAE,QAAQ,GACpC,sBAAY,CAAC,GAChB;AAAA,MACA,gBAAAA,KAAC,SAAI,WAAW,EAAE,MAAM,GAAI,iBAAO,IAAI,MAAM,GAAE;AAAA,SAJvC,CAKV;AAAA,EAEJ,CAAC,GACH,IAEA,gBAAAA,KAAC,SAAI,WAAW,EAAE,MAAM,GAAI,gBAAM,IAAI,MAAM,GAAE,GAElD;AAEJ;","names":["React","jsx","jsxs","jsxs","jsx","React","React","jsx","jsxs","jsx","jsxs","formatDate","getDateTimeFormat","React","jsx","jsx","jsxs","formatDate","getDateTimeFormat","formatDate","getDateTimeFormat","React","jsx","jsxs","getDateTimeFormat","formatDate","React","jsx","jsxs"]}