@42-central/ui-react 0.28.0 → 0.29.1

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 (108) hide show
  1. package/dist/{chunk-I53TMAV2.js → chunk-2RQLPN4U.js} +3 -3
  2. package/dist/{chunk-I53TMAV2.js.map → chunk-2RQLPN4U.js.map} +1 -1
  3. package/dist/{chunk-SOUDKESO.js → chunk-37HYN7PC.js} +3 -3
  4. package/dist/{chunk-SOUDKESO.js.map → chunk-37HYN7PC.js.map} +1 -1
  5. package/dist/{chunk-TGGNSSOJ.js → chunk-5EOMSWNO.js} +4 -4
  6. package/dist/{chunk-TGGNSSOJ.js.map → chunk-5EOMSWNO.js.map} +1 -1
  7. package/dist/{chunk-K3FZHYJL.js → chunk-7FPSQBWB.js} +3 -3
  8. package/dist/{chunk-K3FZHYJL.js.map → chunk-7FPSQBWB.js.map} +1 -1
  9. package/dist/{chunk-WERJ44ZN.js → chunk-DTFSCR3U.js} +3 -3
  10. package/dist/{chunk-WERJ44ZN.js.map → chunk-DTFSCR3U.js.map} +1 -1
  11. package/dist/{chunk-PFZMB3US.js → chunk-FQJNQW3G.js} +3 -3
  12. package/dist/{chunk-PFZMB3US.js.map → chunk-FQJNQW3G.js.map} +1 -1
  13. package/dist/{chunk-ASKQ6N5V.js → chunk-FSPS7TVD.js} +4 -4
  14. package/dist/{chunk-ASKQ6N5V.js.map → chunk-FSPS7TVD.js.map} +1 -1
  15. package/dist/{chunk-GJFCIG34.js → chunk-GEZYGBXY.js} +5 -5
  16. package/dist/{chunk-GJFCIG34.js.map → chunk-GEZYGBXY.js.map} +1 -1
  17. package/dist/{chunk-ULF5LOBS.js → chunk-HMNXNKDA.js} +3 -3
  18. package/dist/{chunk-ULF5LOBS.js.map → chunk-HMNXNKDA.js.map} +1 -1
  19. package/dist/{chunk-NF2PBGD3.js → chunk-IANYMDKH.js} +3 -3
  20. package/dist/{chunk-NF2PBGD3.js.map → chunk-IANYMDKH.js.map} +1 -1
  21. package/dist/{chunk-QEMXXQQO.js → chunk-JKFPRQB2.js} +3 -3
  22. package/dist/{chunk-QEMXXQQO.js.map → chunk-JKFPRQB2.js.map} +1 -1
  23. package/dist/{chunk-P7SH3XWY.js → chunk-MQHD3EJE.js} +3 -3
  24. package/dist/{chunk-P7SH3XWY.js.map → chunk-MQHD3EJE.js.map} +1 -1
  25. package/dist/{chunk-IUK7OJXZ.js → chunk-OBSZ4NE2.js} +5 -4
  26. package/dist/chunk-OBSZ4NE2.js.map +1 -0
  27. package/dist/{chunk-DJ72KP32.js → chunk-OXR7BXZA.js} +3 -3
  28. package/dist/{chunk-DJ72KP32.js.map → chunk-OXR7BXZA.js.map} +1 -1
  29. package/dist/{chunk-LIZWCWED.js → chunk-PQZSTI3R.js} +3 -3
  30. package/dist/{chunk-LIZWCWED.js.map → chunk-PQZSTI3R.js.map} +1 -1
  31. package/dist/{chunk-7BY5I2RB.js → chunk-S5CQRCTF.js} +4 -4
  32. package/dist/{chunk-7BY5I2RB.js.map → chunk-S5CQRCTF.js.map} +1 -1
  33. package/dist/{chunk-BGDVUC3B.js → chunk-TUP7WXQE.js} +3 -3
  34. package/dist/{chunk-BGDVUC3B.js.map → chunk-TUP7WXQE.js.map} +1 -1
  35. package/dist/{chunk-KYVXPSNW.js → chunk-V2QZG4IT.js} +3 -3
  36. package/dist/{chunk-KYVXPSNW.js.map → chunk-V2QZG4IT.js.map} +1 -1
  37. package/dist/components/alert/index.js +1 -1
  38. package/dist/components/ambient-background/index.js +1 -1
  39. package/dist/components/app-shell/index.js +3 -3
  40. package/dist/components/avatar/index.js +2 -2
  41. package/dist/components/calendar/index.js +3 -3
  42. package/dist/components/calendar-heatmap/index.js +2 -2
  43. package/dist/components/camera/index.js +3 -3
  44. package/dist/components/carousel/index.js +2 -2
  45. package/dist/components/code-block/index.js +1 -1
  46. package/dist/components/code-block/static.js.map +1 -1
  47. package/dist/components/compare/index.js +2 -2
  48. package/dist/components/data-table/index.js +10 -10
  49. package/dist/components/date-picker/index.js +7 -7
  50. package/dist/components/drawer/index.js +3 -3
  51. package/dist/components/file-item/index.js +4 -4
  52. package/dist/components/file-preview/index.js +3 -3
  53. package/dist/components/file-upload/index.js +4 -4
  54. package/dist/components/gallery/index.js +2 -2
  55. package/dist/components/image-cropper/index.js +4 -4
  56. package/dist/components/indicator/index.js +1 -1
  57. package/dist/components/kbd/index.js +3 -3
  58. package/dist/components/lightbox/index.js +4 -4
  59. package/dist/components/menu/index.js +2 -2
  60. package/dist/components/modal/index.js +3 -3
  61. package/dist/components/multi-select/index.js +3 -3
  62. package/dist/components/overlays/index.js +4 -4
  63. package/dist/components/password-input/index.js +1 -1
  64. package/dist/components/phone-input/flag.d.ts +9 -0
  65. package/dist/components/phone-input/flag.d.ts.map +1 -0
  66. package/dist/components/phone-input/index.d.ts +4 -0
  67. package/dist/components/phone-input/index.d.ts.map +1 -0
  68. package/dist/components/phone-input/index.js +503 -0
  69. package/dist/components/phone-input/index.js.map +1 -0
  70. package/dist/components/phone-input/phone-input.d.ts +125 -0
  71. package/dist/components/phone-input/phone-input.d.ts.map +1 -0
  72. package/dist/components/phone-input/phone.d.ts +117 -0
  73. package/dist/components/phone-input/phone.d.ts.map +1 -0
  74. package/dist/components/photo-capture/index.js +5 -5
  75. package/dist/components/pills-input/index.js +3 -3
  76. package/dist/components/schedule/index.js +3 -3
  77. package/dist/components/segment-group/index.js +3 -3
  78. package/dist/components/spotlight/index.js +5 -5
  79. package/dist/components/tabs/index.js +3 -3
  80. package/dist/components/tags-input/index.js +3 -3
  81. package/dist/components/time-input/index.js +4 -4
  82. package/dist/components/timeline/index.d.ts +1 -1
  83. package/dist/components/timeline/index.d.ts.map +1 -1
  84. package/dist/components/timeline/index.js +48 -12
  85. package/dist/components/timeline/index.js.map +1 -1
  86. package/dist/components/timeline/timeline.d.ts +8 -3
  87. package/dist/components/timeline/timeline.d.ts.map +1 -1
  88. package/dist/components/tree-multi-select/index.js +3 -3
  89. package/dist/index.js +4 -4
  90. package/dist/lib/dev-warn.d.ts +1 -0
  91. package/dist/lib/dev-warn.d.ts.map +1 -1
  92. package/dist/lib/intl.d.ts +5 -0
  93. package/dist/lib/intl.d.ts.map +1 -1
  94. package/package.json +3 -1
  95. package/src/as-child.contract.test.tsx +2 -0
  96. package/src/components/phone-input/flag.tsx +86 -0
  97. package/src/components/phone-input/index.ts +14 -0
  98. package/src/components/phone-input/phone-input.test.tsx +285 -0
  99. package/src/components/phone-input/phone-input.tsx +527 -0
  100. package/src/components/phone-input/phone.test.ts +187 -0
  101. package/src/components/phone-input/phone.ts +298 -0
  102. package/src/components/timeline/index.ts +1 -0
  103. package/src/components/timeline/timeline.test.tsx +127 -4
  104. package/src/components/timeline/timeline.tsx +56 -12
  105. package/src/lib/dev-warn.ts +1 -1
  106. package/src/lib/intl-direction.test.tsx +23 -0
  107. package/src/lib/intl.tsx +8 -2
  108. package/dist/chunk-IUK7OJXZ.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/date-picker/date-time-text.ts","../src/components/date-picker/date-picker.tsx"],"names":["Ark"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,IAAM,SAAA,GAAY,CAAC,EAAE,MAAA,EAAQ,SAAA,EAAW,WAAA,EAAY,EAAwB,QAAA,KAC1E,IAAI,IAAA,CAAK,cAAA,CAAe,MAAA,EAAQ;AAAA,EAC9B,IAAA,EAAM,SAAA;AAAA,EACN,KAAA,EAAO,SAAA;AAAA,EACP,GAAA,EAAK,SAAA;AAAA,EACL,IAAA,EAAM,SAAA;AAAA,EACN,MAAA,EAAQ,SAAA;AAAA,EACR,MAAA,EAAQ,cAAc,SAAA,GAAY,MAAA;AAAA,EAClC,SAAA;AAAA;AAAA,EAEA,eAAA,EAAiB,MAAA;AAAA,EACjB;AACF,CAAC,CAAA;AAEI,IAAM,kBAAA,GAAqB,CAChC,KAAA,EACA,OAAA,EACA,QAAA,KACW,SAAA,CAAU,OAAA,EAAS,QAA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,CAAA,GAAA,CAAA;AAAA,oBACb,KAAA,EACE,GAAA,CAAI,KAAA,CAAM,CAAC,CAAA,GAAI,kBAAA,CAAmB,GAAA,CAAI,KAAA,CAAM,CAAC,CAAA,EAAG,OAAA,CAAQ,QAAQ,CAAC,CAAA,GAAI;AAAA;AAAA;AAEzE,eAAA,EACF,CAAA,mBAEA,GAAA;AAAA,gBAAC,OAAA;AAAA,gBAAA;AAAA,kBACC,IAAA,EAAK,QAAA;AAAA,kBACL,IAAA;AAAA,kBACA,KAAA,EAAO,GAAA,CAAI,KAAA,CAAM,CAAC,CAAA,GAAI,kBAAA,CAAmB,GAAA,CAAI,KAAA,CAAM,CAAC,CAAA,EAAG,OAAA,CAAQ,QAAQ,CAAC,CAAA,GAAI;AAAA;AAAA,eAC9E;AAAA,aAAA,EAEN,CAAA,EAEJ;AAAA;AAAA;AAAA;AACF;AAAA,GACF;AAEJ,CAAA;AAEO,IAAM,UAAA,GAAa,MAAA,CAAO,MAAA,CAAO,cAAA,EAAgB;AAAA,EACtD,MAAMA,YAAA,CAAI,IAAA;AAAA,EACV,SAASA,YAAA,CAAI,OAAA;AAAA,EACb,SAASA,YAAA,CAAI,OAAA;AAAA,EACb,OAAOA,YAAA,CAAI,KAAA;AAAA,EACX,SAASA,YAAA,CAAI,OAAA;AAAA,EACb,cAAcA,YAAA,CAAI,YAAA;AAAA,EAClB,SAASA,YAAA,CAAI,OAAA;AAAA,EACb,OAAA,EAAS,WAAA;AAAA,EACT,QAAA,EAAU,YAAA;AAAA,EACV,SAAA,EAAW,OAAA;AAAA,EACX,YAAA;AAAA,EACA,QAAQ,OAAA,CAAQ;AAClB,CAAC","file":"chunk-GJFCIG34.js","sourcesContent":["import { CalendarDateTime, type DateValue } from \"@internationalized/date\"\nimport { calendarValueToDate } from \"../../lib/date-value\"\nimport {\n dayPeriodLabels,\n fromDisplayHour,\n type HourCycle,\n is12Hour,\n} from \"../time-input/hour-cycle\"\n\n/**\n * The typed text format for `typeable` + `withTime` — all-numeric, in the locale's own field order\n * (`10/20/2026, 02:30 PM` en-US, `20/10/2026 14:30` fr-FR), so what the field shows is exactly\n * what can be typed back. Ark's own `Input` part can't carry a time: it strips every character\n * but digits and the date separator while typing, and re-applies the previous value's time over\n * whatever its `parse` returns (`preserveTime`) — so `DatePicker` renders its own `<input>` on\n * top of these two helpers instead.\n */\n\ntype DateTimeTextOptions = {\n locale: string\n hourCycle: HourCycle\n withSeconds?: boolean\n}\n\nconst formatter = ({ locale, hourCycle, withSeconds }: DateTimeTextOptions, timeZone: string) =>\n new Intl.DateTimeFormat(locale, {\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: withSeconds ? \"2-digit\" : undefined,\n hourCycle,\n // `parseDateTimeText` reads ASCII digits; keep the display in the same digits it can parse.\n numberingSystem: \"latn\",\n timeZone,\n })\n\nexport const formatDateTimeText = (\n value: DateValue,\n options: DateTimeTextOptions,\n timeZone: string,\n): string => formatter(options, timeZone).format(calendarValueToDate(value, timeZone))\n\ntype NumericField = \"year\" | \"month\" | \"day\" | \"hour\" | \"minute\" | \"second\"\nconst NUMERIC_FIELDS = new Set<string>([\"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\"])\n\n/** The locale's numeric field order, read off the same formatter `formatDateTimeText` uses. */\nconst fieldOrder = (options: DateTimeTextOptions): NumericField[] =>\n formatter(options, \"UTC\")\n .formatToParts(new Date(Date.UTC(2001, 10, 22, 13, 44, 55)))\n .map((part) => part.type)\n .filter((type): type is NumericField => NUMERIC_FIELDS.has(type))\n\n/** \"AM\"/\"PM\" from the locale's own labels (`dayPeriodLabels`), falling back to a Latin `a`/`p`. */\nconst readPeriod = (text: string, locale: string): \"AM\" | \"PM\" | undefined => {\n const lower = text.toLowerCase()\n const labels = dayPeriodLabels(locale)\n if (lower.includes(labels.PM.toLowerCase())) return \"PM\"\n if (lower.includes(labels.AM.toLowerCase())) return \"AM\"\n if (/\\bp\\.?\\s?m?\\.?\\b/.test(lower)) return \"PM\"\n if (/\\ba\\.?\\s?m?\\.?\\b/.test(lower)) return \"AM\"\n return undefined\n}\n\nconst inRange = (n: number, min: number, max: number) => Number.isInteger(n) && n >= min && n <= max\n\n/**\n * Parse typed text back into a `CalendarDateTime`. Reads digit runs in the locale's field order\n * (so any separator works — `20/10/2026 14:30`, `20.10.2026 14h30` — but run-together digits like\n * `1430` read as one number); the\n * date is required, the time is optional — omitted fields keep `fallbackTime` (the current\n * value's), else midnight. In 12h mode a missing period reads AM, and a 13–23 hour is taken as\n * 24h as-typed; under `h24`, `24` is midnight. Returns `undefined` for anything that isn't a\n * real date/time (`02/30/2026`, `25:00`), never a silently constrained one.\n */\nexport const parseDateTimeText = (\n text: string,\n options: DateTimeTextOptions,\n fallbackTime?: { hour: number; minute: number; second: number },\n): CalendarDateTime | undefined => {\n const numbers = text.match(/\\d+/g)?.map(Number) ?? []\n const order = fieldOrder(options)\n const field = (name: NumericField) => {\n const index = order.indexOf(name)\n return index === -1 ? undefined : numbers[index]\n }\n\n const rawYear = field(\"year\")\n const month = field(\"month\")\n const day = field(\"day\")\n if (rawYear === undefined || month === undefined || day === undefined) return undefined\n const year = rawYear < 100 ? 2000 + rawYear : rawYear\n\n const typedHour = field(\"hour\")\n let hour = typedHour ?? fallbackTime?.hour ?? 0\n if (typedHour !== undefined && is12Hour(options.hourCycle) && inRange(typedHour, 0, 12)) {\n hour = fromDisplayHour(typedHour, readPeriod(text, options.locale) ?? \"AM\", options.hourCycle)\n } else if (typedHour === 24 && options.hourCycle === \"h24\") {\n // `h24` shows midnight as `24` (and so formats it that way) — read it back as hour 0.\n hour = 0\n }\n const minute = field(\"minute\") ?? (typedHour === undefined ? fallbackTime?.minute : 0) ?? 0\n const second = field(\"second\") ?? (typedHour === undefined ? fallbackTime?.second : 0) ?? 0\n\n if (!inRange(month, 1, 12) || !inRange(day, 1, 31) || !inRange(year, 1, 9999)) return undefined\n if (!inRange(hour, 0, 23) || !inRange(minute, 0, 59) || !inRange(second, 0, 59)) return undefined\n const value = new CalendarDateTime(year, month, day, hour, minute, second)\n // `CalendarDateTime` constrains out-of-range days (Feb 30 → Feb 28) instead of rejecting them.\n return value.day === day ? value : undefined\n}\n","\"use client\"\n\nimport {\n DatePicker as Ark,\n type DatePickerDateRangePreset as DateRangePreset,\n type DateValue,\n type DatePickerDateView as DateView,\n type UseDatePickerContext,\n} from \"@ark-ui/react/date-picker\"\nimport { useFieldContext } from \"@ark-ui/react/field\"\nimport { useLocaleContext } from \"@ark-ui/react/locale\"\nimport { Portal } from \"@ark-ui/react/portal\"\nimport { DateFormatter, toCalendarDateTime, today } from \"@internationalized/date\"\nimport { type FocusEvent, type ReactNode, type Ref, useId, useRef, useState } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { controlOpenProps } from \"../../lib/control-open\"\nimport type { DatePredicate } from \"../../lib/date-predicates\"\nimport {\n calendarValueToDate,\n type DateRangeValue,\n dateToArkValue,\n fromArkValues,\n toArkValues,\n} from \"../../lib/date-value\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport type { FormControlProps } from \"../../lib/form-control\"\nimport { capitalize } from \"../../lib/graphemes\"\nimport { useLocale, useTimeZone } from \"../../lib/intl\"\nimport { useMergedRefs } from \"../../lib/merge-refs\"\nimport { useOverlayContainer } from \"../../lib/overlay-container\"\nimport { NestedLayer } from \"../../lib/overlay-layer\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { Button } from \"../button/button\"\nimport { type CalendarTranslations, resolveCalendarTranslations } from \"../calendar/calendar\"\nimport {\n CalendarBody,\n type CalendarBodyClassNames,\n type CalendarIcons,\n calendarGridWidth,\n} from \"../calendar/calendar-body\"\nimport { CalendarZoneSync, hashArkValues } from \"../calendar/calendar-zone-sync\"\nimport { type FieldProps, FieldShell, fieldA11yProps } from \"../field/field\"\nimport {\n type InputVariant,\n inputControlClasses,\n inputShell,\n inputSlot,\n placeholderColor,\n shellGap,\n} from \"../input/input\"\nimport { CalendarIcon, CloseIcon } from \"../popover/icons\"\nimport { Popover, popoverClearTrigger, popoverPanel } from \"../popover/popover\"\nimport {\n fromDisplayHour,\n type HourCycle,\n resolveHourCycle,\n toDisplayHour,\n} from \"../time-input/hour-cycle\"\nimport { TimeRow, type TimeRowTranslations, timeRowMinWidth } from \"../time-input/time-row\"\nimport { formatDateTimeText, parseDateTimeText } from \"./date-time-text\"\n\n/**\n * DatePicker — a trigger + popover calendar on Ark UI's `date-picker` machine, composing\n * `Calendar`'s shared grid module (`calendar-body.tsx`) and `TimeInput`'s shared time row\n * (`time-row.tsx`). `range` and `withTime` cover all four date combinations; `DateRangePicker`,\n * `DateTimePicker`, and `DateTimeRangePicker` are thin named presets pinning those two flags.\n *\n * - Value is a native `Date | null` (or `{ start, end }` under `range`) — the machine's\n * `DateValue` array contract never leaks out; `lib/date-value.ts` is the one conversion\n * boundary both directions go through, exactly as `Calendar` uses it.\n * - `withConfirm` stages the selection in local state; only Apply calls the outer `onChange`,\n * Cancel reverts. Without it, single dates commit + close on pick and ranges commit on the\n * second click (both Ark-native) — except under `withTime`, where a pick commits but keeps\n * the panel open so the time row can still be set (outside click / Escape closes it).\n * - `presets` renders a sidebar of quick-pick shortcuts — range shortcuts (Ark's own\n * `DateRangePreset` union, or a custom `{ range }`) under `range`; single-date shortcuts\n * (a custom `{ date }`) otherwise. `true` resolves to a mode-appropriate default set.\n * - `isDateUnavailable` / `min` / `max` take native `Date`s; pair with `lib/date-predicates.ts`'s\n * helpers (`disablePast()`, `disableWeekends()`, …), re-exported from this same barrel.\n * - `typeable` swaps the plain button trigger for a text input, so a date can be typed (and\n * parsed on blur / Enter) in addition to picked from the calendar — the leading icon becomes a\n * real open-calendar button alongside it. Opt-in (default `false`); single dates only (see\n * the prop's own doc comment). Under `withTime` the input carries the time too\n * (`date-time-text.ts`).\n *\n * <DatePicker label=\"Start date\" value={date} onChange={setDate} clearable />\n * <DateRangePicker withTime presets withConfirm value={range} onChange={setRange} />\n */\n\nconst datePickerPresets = cn(\n \"flex shrink-0 flex-col gap-0.5 border-e p-1\",\n \"border-brand-900/20 dark:border-white/15\",\n)\n\nconst presetTrigger = cn(\n \"w-full cursor-pointer rounded-xs px-2 py-1.5 text-start text-sm whitespace-nowrap transition-colors\",\n \"hover:bg-brand-900/6 dark:hover:bg-white/8\",\n focusStyles({ offset: false }),\n)\n\nconst timePanelLabel = cn(\"text-xs font-medium\", TEXT_COLOR_CLASSES.muted)\n\n/** `typeable`'s leading calendar icon, promoted from a decorative span (the button-trigger case)\n * to a real open-calendar button — same base look as `inputSlot`, plus the family's interactive-\n * icon treatment (compare `popoverClearTrigger`). `outline-none`: the shell's own `:has()` rule\n * (`shellChrome` in `input.tsx`) already rings the *whole* control on this button's focus-visible\n * state, so its own native outline would just double up. */\nconst datePickerIconTrigger = cn(\n inputSlot,\n \"cursor-pointer rounded-xs outline-none transition-colors hover:text-brand-900/70 dark:hover:text-white/80 disabled:cursor-not-allowed\",\n)\n\n/** The main column (calendar + time row footer) has no explicit width of its own, and neither\n * does the popover above it — deliberately, so the popover sizes to its content. But once the\n * time row's Hour/Minute/(Second) fields are `flex-1` (grow to fill the row), that becomes\n * circular: the row wants to size off \"however much space is available,\" and with nothing\n * concrete above it to measure against, browsers resolve a flex container's own intrinsic width\n * generously when it holds `flex-grow` items — the row (and everything above it) ends up far\n * wider than the calendar actually needs, even for a single time row. Giving the column an\n * explicit width tied to the calendar's own geometry (`calendarGridWidth`, shared with\n * `calendar-body.tsx`'s own month/year grids) breaks that circularity: the row now grows to\n * fill a *real* width instead of an ambiguous one.\n *\n * That width is only ever tied to the *calendar* grid, though — under `withTime`, the column\n * must be at least as wide as the time row itself needs (`timeRowMinWidth`), or the same\n * `flex-1` + `min-w-0` fields that motivated a fixed width in the first place shrink below their\n * content size instead of growing: with the AM/PM toggle present at a single month, the\n * calendar-only width is narrower than Hour+Minute+Period need, and the `<input>`s get starved. */\n\nconst pad = (n: number) => String(n).padStart(2, \"0\")\n\n/** Hidden-input serialization. `DateValue#toString()` isn't safe to call directly here: a\n * `CalendarDateTime` (what our own `dateToArkValue` produces for a `defaultValue`/`value` passed\n * in) stringifies with a time, while a plain `CalendarDate` (what a day-grid click produces)\n * stringifies as a clean date — two different formats for the same picked day depending on\n * provenance. Read the wall-calendar fields directly instead. Whether to append the time portion\n * is driven by the picker's own `withTime` flag, not by whether the value happens to carry an\n * `hour` field — a `CalendarDateTime` always has one (even at local midnight), so that structural\n * check can't tell \"date-only\" from \"with time\" apart. */\nexport const serializeDateValue = (value: DateValue, withTime: boolean): string => {\n const date = `${value.year}-${pad(value.month)}-${pad(value.day)}`\n if (!withTime) return date\n const time = \"hour\" in value ? value : { hour: 0, minute: 0, second: 0 }\n return `${date}T${pad(time.hour)}:${pad(time.minute)}:${pad(time.second)}`\n}\n\nexport type DatePickerClassNames = {\n field?: string\n control?: string\n content?: string\n presets?: string\n calendar?: CalendarBodyClassNames\n timePanel?: { hour?: string; minute?: string; second?: string; period?: string }\n footer?: string\n}\n\n/** `value`/`range`-shaped entries are for `range` mode; `date`-shaped entries are for single-date\n * mode. Nothing prevents mixing them for the picker's current mode — the shape you pass is\n * trusted, not validated at runtime (a mismatched entry just doesn't produce useful behavior;\n * `api.setValue`/`getRangePresetValue` are mode-agnostic in the underlying machine). */\nexport type DatePreset =\n | { label: string; value: DateRangePreset }\n | { label: string; range: { start: Date; end: Date } | null }\n | { label: string; date: Date | null }\n\n/** Identifies each entry `getDefaultPresets` builds for `presets={true}`, so a `translations`\n * override can target one label without redefining the whole set. */\nexport type DatePickerPresetId =\n | \"today\"\n | \"yesterday\"\n | \"tomorrow\"\n | \"nextWeek\"\n | \"thisWeek\"\n | \"lastWeek\"\n | \"thisMonth\"\n | \"lastMonth\"\n | \"thisYear\"\n | \"allTime\"\n\n/** One unified `translations` prop rather than one per string source — Ark's own accessible\n * names, the `presets={true}` default labels, and the embedded time row's strings all belong to\n * the same `DatePicker` instance a consumer is localizing. English defaults throughout;\n * unset keys keep their built-in text. */\nexport type DatePickerTranslations = Partial<CalendarTranslations> &\n TimeRowTranslations & {\n /** The `withConfirm` footer's revert button. Default `\"Cancel\"`. */\n cancel?: string\n /** The `withConfirm` footer's commit button. Default `\"Apply\"`. */\n apply?: string\n /** The embedded time row's label under `range` + `withTime` (first row). Default `\"Start time\"`. */\n startTime?: string\n /** The embedded time row's label under `range` + `withTime` (second row). Default `\"End time\"`. */\n endTime?: string\n /** Individual `presets={true}` default-set labels, keyed by id — override just the ones you\n * need without redefining the whole array. Pass your own `DatePreset[]` for full control.\n * Every label but `allTime` (default `\"All time\"`) is already in the locale's words, from\n * `Intl.RelativeTimeFormat` (\"Aujourd’hui\", \"La semaine dernière\"); an override wins. */\n presets?: Partial<Record<DatePickerPresetId, string>>\n }\n\n/** The calendar's icon slots, one prop for the whole picker. */\nexport type DatePickerIcons = CalendarIcons\n\nexport type DatePickerProps<Range extends boolean = false> = FormControlProps<\n Range extends true ? DateRangeValue : Date | null,\n // Widened from `HTMLButtonElement` alone: under `typeable` the focusable element is Ark's\n // `Input` (a real `<input>`), not the button trigger — `ref`/`onBlur` must be able to land on\n // either depending on that prop, since both are the same generic `DatePickerProps`.\n HTMLButtonElement | HTMLInputElement\n> &\n Pick<FieldProps, \"label\" | \"description\" | \"error\" | \"required\"> &\n WithTestId & {\n /** Select a `{ start, end }` range instead of a single date. */\n range?: Range\n /** Adds an embedded HOUR/MINUTE (+ SECOND) time row; the value carries H/M too. */\n withTime?: boolean\n /** Months shown side by side. Default `1`, regardless of `range` — pass `2` to show a full\n * range without paging (matches `Calendar`'s own plain default). */\n numOfMonths?: number\n /** Always render 6 week rows (padding with adjacent-month days) instead of however many the\n * visible month(s) actually span (4–6) — keeps the popover's height constant while\n * navigating between months. */\n fixedWeeks?: boolean\n /** Preset sidebar — range shortcuts under `range`, single-date shortcuts otherwise. `true`\n * renders a mode-appropriate default set; an array is fully custom. See `DatePreset`. */\n presets?: DatePreset[] | boolean\n /** Stage the selection; commit only on Apply. Cancel reverts to the last committed value. */\n withConfirm?: boolean\n /** Renders a clear trigger once a value is set; emits `null` (or an all-null range). */\n clearable?: boolean\n /** Restriction predicate over a native `Date`. Compose with `lib/date-predicates.ts`'s helpers.\n * Called with this component's own resolved `timeZone` as its second argument, so a predicate\n * reads the candidate day in the same zone the grid renders it in. */\n isDateUnavailable?: DatePredicate\n /** Renders a text input (typing, blur-to-parse, `Enter`-to-commit) alongside the\n * calendar-icon trigger, instead of the plain button-only trigger. Opt-in — default `false`\n * keeps the click-to-open button.\n *\n * Without `withTime` this is Ark's own `Input` anatomy part (a numeric date). Under\n * `withTime` it shows and parses a numeric date + time in the locale's own field order\n * (`10/20/2026, 02:30 PM`, `20/10/2026 14:30`) — typing just a date keeps the current time.\n * `range` (cross-field validation across two inputs) is out of scope and falls back to the\n * button trigger. */\n typeable?: boolean\n min?: Date\n max?: Date\n /** Bounds the view levels reachable via navigation (e.g. `minView=\"month\"`). */\n minView?: DateView\n maxView?: DateView\n /** Overrides the active locale context. Drives month/day names, first-day-of-week, and the\n * embedded time row's 12h/24h default. */\n locale?: string\n /** Overrides the time zone for every `Date ↔ DateValue` conversion. Resolves\n * **prop → `IntlProvider` → host zone**, through `useTimeZone` like `Calendar` and\n * `Schedule` — **not** Ark's own machine default (`\"UTC\"`). Accepts `\"auto\"` to follow the\n * host zone. */\n timeZone?: string\n /** Force 12-hour or 24-hour display for the embedded time row, overriding the locale default. */\n format?: 12 | 24\n /** Force a specific hour cycle, overriding the locale default and `format`. */\n hourCycle?: HourCycle\n minuteStep?: number\n withSeconds?: boolean\n /** Placeholder shown in the embedded time row's empty Hour/Minute/Second fields — see\n * TimeRow's `placeholder`. Default `\"--\"`. */\n timePlaceholder?: string\n /** Overrides built-in English strings — Ark's own accessible names, the `presets={true}`\n * \"All time\" label, Cancel/Apply, Start/End time, and the embedded time row's Hour/Minute/\n * Second/Period labels. The other preset labels already follow `locale`, and an override\n * here still wins over them. Partial — unset keys keep their default. */\n translations?: DatePickerTranslations\n /** Replaces the calendar's default icons: `prev`, `next`, passed through to its grid like\n * `translations`. The kit's chevrons mirror under RTL; an icon passed here is drawn as given. */\n icons?: DatePickerIcons\n /** Placeholder shown while no date is selected. */\n placeholder?: string\n /** Inline-start adornment. Defaults to a calendar icon. */\n startSlot?: ReactNode\n size?: Size\n variant?: InputVariant\n /** Render the panel in a Portal so it escapes clipping ancestors.\n * Default `true`. */\n withinPortal?: boolean\n /** Portal target. Defaults to the enclosing `Modal`/`Drawer` when there is\n * one (so the panel stays above it), else `document.body`. */\n container?: HTMLElement | null\n className?: string\n classNames?: DatePickerClassNames\n }\n\n/** `DatePicker`'s own English wording, merged once per render (`presets` one level deeper, in\n * `presetLabels`). \"All time\" is the one non-derivable preset label; every other\n * `presets={true}` label comes from `Intl.RelativeTimeFormat`. */\nconst DATE_PICKER_DEFAULT_TRANSLATIONS = {\n cancel: \"Cancel\",\n apply: \"Apply\",\n startTime: \"Start time\",\n endTime: \"End time\",\n presets: { allTime: \"All time\" },\n} as const satisfies DatePickerTranslations\n\n/** The `presets={true}` labels: the locale's own words for each relative period\n * (`Intl.RelativeTimeFormat` with `numeric: \"auto\"` — \"Aujourd’hui\", \"La semaine dernière\"),\n * capitalised for a button, then \"All time\" from the defaults, then the consumer's\n * `translations.presets`, which win over both. */\nconst presetLabels = (\n locale: string,\n overrides?: Partial<Record<DatePickerPresetId, string>>,\n): Record<DatePickerPresetId, string> => {\n const relative = new Intl.RelativeTimeFormat(locale, { numeric: \"auto\" })\n const say = (value: number, unit: Intl.RelativeTimeFormatUnit) =>\n capitalize(relative.format(value, unit), locale)\n return {\n today: say(0, \"day\"),\n yesterday: say(-1, \"day\"),\n tomorrow: say(1, \"day\"),\n nextWeek: say(1, \"week\"),\n thisWeek: say(0, \"week\"),\n lastWeek: say(-1, \"week\"),\n thisMonth: say(0, \"month\"),\n lastMonth: say(-1, \"month\"),\n thisYear: say(0, \"year\"),\n ...DATE_PICKER_DEFAULT_TRANSLATIONS.presets,\n ...overrides,\n }\n}\n\n/** Ark's built-in `DateRangePreset` union has no \"today\" / \"yesterday\" / \"all time\" member\n * (confirmed in `@zag-js/date-utils`'s types) — those three are hand-built here from\n * `today(timeZone)`; the rest map straight to Ark's own string presets. The single-date set\n * (non-`range`) is a different shape entirely, not a trimmed-down copy of the range one — \"This\n * week\"/\"This month\"/etc. are inherently range-shaped and don't collapse to one date. */\nconst getDefaultPresets = (\n range: boolean,\n timeZone: string,\n locale: string,\n overrides?: Partial<Record<DatePickerPresetId, string>>,\n): DatePreset[] => {\n const now = today(timeZone)\n const toDate = (value: typeof now) => calendarValueToDate(value, timeZone)\n const label = presetLabels(locale, overrides)\n if (!range) {\n return [\n { label: label.today, date: toDate(now) },\n { label: label.yesterday, date: toDate(now.subtract({ days: 1 })) },\n { label: label.tomorrow, date: toDate(now.add({ days: 1 })) },\n { label: label.nextWeek, date: toDate(now.add({ days: 7 })) },\n ]\n }\n const yesterday = now.subtract({ days: 1 })\n return [\n { label: label.today, range: { start: toDate(now), end: toDate(now) } },\n { label: label.yesterday, range: { start: toDate(yesterday), end: toDate(yesterday) } },\n { label: label.thisWeek, value: \"thisWeek\" },\n { label: label.lastWeek, value: \"lastWeek\" },\n { label: label.thisMonth, value: \"thisMonth\" },\n { label: label.lastMonth, value: \"lastMonth\" },\n { label: label.thisYear, value: \"thisYear\" },\n { label: label.allTime, range: null },\n ]\n}\n\nconst PresetsRail = ({\n presets,\n range,\n timeZone,\n locale,\n withConfirm,\n translations,\n className,\n}: {\n presets: DatePreset[] | boolean\n /** Which default set `presets === true` resolves to — irrelevant once `presets` is a concrete array. */\n range?: boolean\n timeZone: string\n /** Names the `presets === true` periods. Falls back to the `IntlProvider` locale. */\n locale?: string\n withConfirm?: boolean\n /** Overrides individual `presets={true}` default-set labels, keyed by id. No effect on a\n * custom `DatePreset[]`. */\n translations?: Partial<Record<DatePickerPresetId, string>>\n className?: string\n}) => {\n const resolvedLocale = useLocale(locale)\n const resolved =\n presets === true\n ? getDefaultPresets(Boolean(range), timeZone, resolvedLocale, translations)\n : presets === false\n ? []\n : presets\n if (resolved.length === 0) return null\n return (\n <Ark.Context>\n {(api) => (\n <div className={cn(datePickerPresets, className)}>\n {resolved.map((preset) => (\n <button\n key={preset.label}\n type=\"button\"\n // Not `Ark.PresetTrigger`: its own onClick always sends `PRESET.CLICK`, which the\n // machine transitions unconditionally to \"focused\" (closed) regardless of\n // `closeOnSelect` — there's no way to keep it open under `withConfirm`. Resolve the\n // preset's value ourselves and set it via `api.setValue`, which only sets the value\n // (no state-machine transition), then close explicitly only when not staging.\n onClick={() => {\n const values =\n \"value\" in preset\n ? api.getRangePresetValue(preset.value)\n : \"range\" in preset\n ? (toArkValues(preset.range, timeZone) ?? [])\n : (toArkValues(preset.date, timeZone) ?? [])\n api.setValue(values)\n if (!withConfirm) api.setOpen(false)\n }}\n aria-label={preset.label}\n className={presetTrigger}\n >\n {preset.label}\n </button>\n ))}\n </div>\n )}\n </Ark.Context>\n )\n}\n\ntype DisplayTime = {\n hour: number | null\n minute: number | null\n second: number | null\n period: \"AM\" | \"PM\" | null\n}\n\nconst emptyDisplayTime: DisplayTime = { hour: null, minute: null, second: null, period: null }\n\n/** Derive display-space fields (the cycle's own hours, + period) from the machine's own\n * `DateValue` — a plain `CalendarDate` (no time picked yet) has no `hour`, so it reads as all-null. */\nconst toDisplayTime = (value: DateValue | undefined, cycle: HourCycle): DisplayTime => {\n if (!value || !(\"hour\" in value)) return emptyDisplayTime\n const { hour, period } = toDisplayHour(value.hour, cycle)\n return { hour, minute: value.minute, second: value.second ?? null, period }\n}\n\n/** The inverse of `toDisplayTime` — merges a display-space edit into a `setTime`-ready payload.\n * Missing fields default to midnight, same rule `TimeInput` uses for its own first edit. */\nconst fromDisplayTime = (\n display: DisplayTime,\n cycle: HourCycle,\n): { hour: number; minute: number; second?: number } => {\n const hour = fromDisplayHour(display.hour, display.period, cycle)\n const minute = display.minute ?? 0\n return display.second != null ? { hour, minute, second: display.second } : { hour, minute }\n}\n\n/** `api.setTime`, except that a time edit with no day picked yet lands on *today* instead of being\n * dropped — Ark's own `setTime` silently no-ops without a date at that index, so typing a time\n * first used to do nothing at all. Only the first row can hit that (the second is disabled until\n * a range has both ends). `setValue` keeps today within `min`/`max`, like Ark's `selectToday`;\n * a today that `isDateUnavailable` rules out isn't auto-picked. */\nconst setTimeOrToday = (\n api: UseDatePickerContext,\n time: { hour: number; minute: number; second?: number },\n index: number,\n timeZone: string,\n) => {\n if (api.value[index] || index !== 0) return api.setTime(time, index)\n const day = today(timeZone)\n if (api.isUnavailable(day)) return\n api.setValue([toCalendarDateTime(day).set(time)])\n}\n\nexport type TimePanelRowProps = {\n value: DateValue | undefined\n onSetTime: (time: { hour: number; minute: number; second?: number }) => void\n /** Visible label above the row, which also names its `role=\"group\"` (\"Start time\" / \"End\n * time\" under `range`). Without it the group is named `translations.time` (`\"Time\"`). */\n label?: string\n disabled?: boolean\n hourCycle: HourCycle\n minuteStep?: number\n withSeconds?: boolean\n /** Placeholder shown in the row's empty Hour/Minute/Second fields — see TimeRow's\n * `placeholder`. Default `\"--\"`. */\n placeholder?: string\n /** Resolves the locale-correct AM/PM labels + Hour/Minute/Second unit suffixes via `Intl`.\n * Falls back to `useLocaleContext()` when omitted. */\n locale?: string\n /** Overrides the sr-only Hour/Minute/Second/Period accessible names. English by default. */\n translations?: TimeRowTranslations\n size?: Size\n variant?: InputVariant\n classNames?: DatePickerClassNames[\"timePanel\"] & { root?: string }\n}\n\n/** One HOUR/MINUTE(+SECOND)+AM/PM row, bridging `TimeRow`'s display-space props to a specific\n * `api.value` index via `api.setTime(time, index)` — the same shared `TimeRow` `TimeInput`\n * wraps with its own local state, wrapped here with the machine's state instead. */\nconst TimePanelRow = ({\n value,\n onSetTime,\n label,\n disabled,\n hourCycle,\n minuteStep,\n withSeconds,\n placeholder,\n locale,\n translations,\n size,\n variant,\n classNames,\n}: TimePanelRowProps) => {\n const display = toDisplayTime(value, hourCycle)\n const patch = (partial: Partial<DisplayTime>) =>\n onSetTime(fromDisplayTime({ ...display, ...partial }, hourCycle))\n const labelId = useId()\n\n return (\n <div className={cn(\"flex flex-col gap-1\", classNames?.root)}>\n {label && (\n <span id={labelId} className={timePanelLabel}>\n {label}\n </span>\n )}\n <TimeRow\n aria-labelledby={label ? labelId : undefined}\n hour={display.hour}\n minute={display.minute}\n second={display.second}\n onHourChange={(hour) => patch({ hour })}\n onMinuteChange={(minute) => patch({ minute })}\n onSecondChange={withSeconds ? (second) => patch({ second }) : undefined}\n period={display.period}\n onPeriodChange={(period) => patch({ period })}\n hourCycle={hourCycle}\n minuteStep={minuteStep}\n withSeconds={withSeconds}\n placeholder={placeholder}\n locale={locale}\n translations={translations}\n size={size}\n variant={variant}\n disabled={disabled}\n classNames={classNames}\n />\n </div>\n )\n}\n\n/**\n * `typeable` + `withTime`'s own text input, standing in for Ark's `Input` part — which can't carry\n * a time (see `date-time-text.ts`). It still declares `data-part=\"input\"` inside the Control, so\n * the machine treats it as its input: excluded from interact-outside dismissal, focused on close,\n * and kept in sync with every value change (day pick, time row, clear) through the Root's\n * `format`, which is this same numeric text. Left uncontrolled for that reason — the only thing\n * added here is committing typed text: parsed on blur / `Enter`, then set through `api.setValue`;\n * text that doesn't parse (or lands on an unavailable day) reverts to the current value.\n */\nconst DateTimeTextInput = ({\n api,\n options,\n timeZone,\n ref,\n onBlur,\n placeholder,\n disabled,\n readOnly,\n invalid,\n testId,\n}: {\n api: UseDatePickerContext\n options: Parameters<typeof parseDateTimeText>[1]\n timeZone: string\n ref?: Ref<HTMLInputElement>\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n placeholder?: string\n disabled?: boolean\n readOnly?: boolean\n invalid?: boolean\n testId?: string\n}) => {\n const field = useFieldContext()\n const current = api.value[0]\n const show = (input: HTMLInputElement, value: DateValue | undefined) => {\n input.value = value ? formatDateTimeText(value, options, timeZone) : \"\"\n }\n const commit = (input: HTMLInputElement) => {\n const text = input.value.trim()\n if (text === \"\") {\n if (current) api.clearValue({ focus: false })\n return\n }\n const fallback = current && \"hour\" in current ? current : undefined\n const next = parseDateTimeText(text, options, fallback)\n if (!next || api.isUnavailable(next)) return show(input, current)\n api.setValue([next])\n api.setFocusedValue(next)\n // `setValue` is a no-op (and syncs nothing) when the parsed value equals the current one, so\n // normalize the typed text to the canonical format either way.\n show(input, next)\n }\n return (\n <input\n ref={ref}\n type=\"text\"\n data-scope=\"date-picker\"\n data-part=\"input\"\n autoComplete=\"off\"\n defaultValue={current ? formatDateTimeText(current, options, timeZone) : \"\"}\n placeholder={placeholder}\n disabled={disabled}\n readOnly={readOnly}\n {...props({ \"aria-invalid\": invalid })}\n // Ark's own input-click handler, not `api.setOpen`: it opens with `src: \"input.click\"`,\n // which is what stops the machine from moving focus into the grid — typing has to keep\n // landing here. It also honours `openOnClick` and disabled/read-only on its own.\n onClick={api.getInputProps().onClick}\n onKeyDown={(event) => {\n if (event.key !== \"Enter\" || event.nativeEvent.isComposing) return\n event.preventDefault()\n commit(event.currentTarget)\n }}\n onBlur={(event) => {\n if (!readOnly) commit(event.currentTarget)\n onBlur?.(event)\n }}\n {...props({ \"data-testid\": testId })}\n {...fieldA11yProps(field)}\n className={inputControlClasses}\n />\n )\n}\n\nconst DatePickerImpl = <Range extends boolean = false>({\n withinPortal = true,\n container,\n range,\n withTime,\n numOfMonths = 1,\n fixedWeeks,\n presets,\n withConfirm,\n clearable,\n value,\n defaultValue,\n onChange,\n onBlur,\n isDateUnavailable,\n typeable,\n min,\n max,\n minView,\n maxView,\n locale,\n timeZone,\n format,\n hourCycle,\n minuteStep,\n withSeconds,\n timePlaceholder,\n translations,\n icons,\n placeholder = \"Pick a date\",\n startSlot,\n size = \"md\",\n variant = \"default\",\n disabled,\n readOnly,\n required,\n invalid,\n name,\n id,\n ref,\n label,\n description,\n error,\n className,\n classNames,\n testId,\n}: DatePickerProps<Range>) => {\n const portalContainer = useOverlayContainer(container)\n const { locale: contextLocale } = useLocaleContext()\n const resolvedLocale = locale ?? contextLocale\n const resolvedTimeZone = useTimeZone(timeZone)\n const resolvedHourCycle = resolveHourCycle({ locale: resolvedLocale, format, hourCycle })\n const t = { ...DATE_PICKER_DEFAULT_TRANSLATIONS, ...translations }\n const isInvalid = invalid || error != null\n const isRange = Boolean(range)\n // See `typeable`'s own doc comment: single dates only — `range` silently falls back to the\n // button trigger rather than erroring, so `typeable` composes safely with every other prop.\n // Under `withTime` the input is `DateTimeTextInput` instead of Ark's own date-only `Input`.\n const showTypeableInput = Boolean(typeable) && !isRange\n const dateTimeText = { locale: resolvedLocale, hourCycle: resolvedHourCycle, withSeconds }\n const controlRef = useRef<HTMLDivElement>(null)\n const triggerRef = useRef<HTMLButtonElement>(null)\n const inputRef = useRef<HTMLInputElement>(null)\n\n type Value = Range extends true ? DateRangeValue : Date | null\n const emptyValue = (isRange ? { start: null, end: null } : null) as Value\n\n // Reserved for the `withConfirm` staged layer only — the base value needs no local state,\n // Ark's machine natively supports controlled/uncontrolled `value`/`defaultValue`/`onValueChange`\n // the same way `Calendar` relies on it.\n const [committed, setCommitted] = useUncontrolled<Value>({\n value,\n defaultValue,\n finalValue: emptyValue,\n onChange,\n })\n const [staged, setStaged] = useState<Value>(committed)\n const zoneReseed = useRef<string | null>(null)\n\n const inputMergedRef = useMergedRefs<HTMLButtonElement | HTMLInputElement>(inputRef, ref)\n const triggerMergedRef = useMergedRefs<HTMLButtonElement | HTMLInputElement>(triggerRef, ref)\n return (\n <FieldShell\n label={label}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n size={size}\n className={classNames?.field}\n >\n <Ark.Root\n id={id}\n selectionMode={isRange ? \"range\" : \"single\"}\n // Ark's own default (`true`) auto-closes on a completed pick — under `withConfirm`\n // the picker must stay open for review until Apply/Cancel, and under `withTime` the day\n // is only half the value: closing on pick would hide the time row it still needs.\n // Otherwise leave Ark's default (single closes on pick, range on the second click).\n closeOnSelect={withConfirm || withTime ? false : undefined}\n // Ark's own default (`false`) requires the calendar-icon trigger to open the popover —\n // under `typeable` a click into the text field itself should open it too, matching the\n // combined type-or-pick affordance `typeable` is meant to offer. No-op when the Input\n // anatomy part isn't rendered (`!showTypeableInput`).\n openOnClick={showTypeableInput}\n locale={resolvedLocale}\n timeZone={resolvedTimeZone}\n translations={resolveCalendarTranslations(translations)}\n numOfMonths={numOfMonths}\n fixedWeeks={fixedWeeks}\n minView={minView}\n maxView={maxView}\n value={toArkValues(withConfirm ? staged : value, resolvedTimeZone)}\n defaultValue={withConfirm ? undefined : toArkValues(defaultValue, resolvedTimeZone)}\n onValueChange={(details) => {\n // A zone change re-expresses the selection in the new zone; that echo is not a change.\n if (zoneReseed.current === hashArkValues(details.value)) {\n zoneReseed.current = null\n return\n }\n const next = fromArkValues(details.value, isRange, resolvedTimeZone) as Value\n if (withConfirm) setStaged(next)\n else onChange?.(next)\n }}\n onOpenChange={(details) => {\n if (withConfirm && details.open) setStaged(committed)\n }}\n isDateUnavailable={\n isDateUnavailable\n ? (dateValue) =>\n isDateUnavailable(\n calendarValueToDate(dateValue, resolvedTimeZone),\n resolvedTimeZone,\n )\n : undefined\n }\n min={min ? dateToArkValue(min, resolvedTimeZone) : undefined}\n max={max ? dateToArkValue(max, resolvedTimeZone) : undefined}\n // The typed date+time input shows (and Ark syncs into it) the same numeric text it parses.\n format={\n withTime && showTypeableInput\n ? (date) => formatDateTimeText(date, dateTimeText, resolvedTimeZone)\n : withTime\n ? (date, { locale: fmtLocale }) =>\n new DateFormatter(fmtLocale, { dateStyle: \"medium\", timeStyle: \"short\" }).format(\n calendarValueToDate(date, resolvedTimeZone),\n )\n : undefined\n }\n // Anchor to the Control (not `sameWidth`, unlike Select) — the popover hosts a full\n // calendar grid + presets rail, which needs its own intrinsic width, not the trigger's.\n positioning={{ getAnchorRect: () => controlRef.current?.getBoundingClientRect() ?? null }}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n invalid={isInvalid}\n className={cn(\"w-full\", className)}\n >\n {/* Keeps the selection, and the typeable input's text, on the same instant when the zone\n * changes, in place rather than by remounting; see `calendar-zone-sync.tsx`. Under\n * `withConfirm` Ark's value is the staged `Date`, so it is controlled either way. */}\n <CalendarZoneSync\n timeZone={resolvedTimeZone}\n controlled={withConfirm || value !== undefined}\n pendingRef={zoneReseed}\n />\n <Ark.Context>\n {(api) => (\n <>\n <Ark.Control\n ref={controlRef}\n {...props({\n \"data-invalid\": isInvalid,\n \"data-with-start-slot\": true,\n \"data-with-end-slot\": true,\n })}\n {...(disabled || readOnly ? {} : controlOpenProps(() => api.setOpen(true)))}\n className={cn(\n inputShell({ size, variant }),\n // A real `<input>` sits in the shell under `typeable` — leave the shell's own\n // cursor at the browser default (text-cursor over the input, pointer over the\n // icon trigger / clear button) instead of forcing pointer everywhere, matching\n // `Combobox`'s Control (see `combobox.tsx`) rather than `Select`'s button-only one.\n !showTypeableInput && \"cursor-pointer\",\n classNames?.control,\n )}\n >\n {showTypeableInput ? (\n <div className={cn(\"flex min-w-0 flex-1 items-center\", shellGap[size])}>\n {/* Ark sets its own accessible `aria-label` (\"Open calendar\" / \"Close\n calendar\") on the trigger regardless of children, so an icon-only button\n here is still accessible without a manual override. */}\n <Ark.Trigger className={datePickerIconTrigger}>\n {startSlot ?? <CalendarIcon />}\n </Ark.Trigger>\n {withTime ? (\n <DateTimeTextInput\n api={api}\n options={dateTimeText}\n timeZone={resolvedTimeZone}\n ref={inputMergedRef}\n onBlur={onBlur}\n placeholder={placeholder}\n disabled={disabled}\n readOnly={readOnly}\n invalid={isInvalid}\n testId={testId}\n />\n ) : (\n <Ark.Input\n ref={inputMergedRef}\n onBlur={onBlur}\n placeholder={placeholder}\n {...props({ \"data-testid\": testId })}\n className={inputControlClasses}\n />\n )}\n </div>\n ) : (\n <Ark.Trigger\n ref={triggerMergedRef}\n onBlur={onBlur}\n {...props({ \"aria-invalid\": isInvalid, \"data-testid\": testId })}\n className={cn(\n \"flex min-w-0 flex-1 cursor-pointer items-center bg-transparent text-start outline-none disabled:cursor-not-allowed\",\n shellGap[size],\n )}\n >\n <span className={inputSlot} aria-hidden>\n {startSlot ?? <CalendarIcon />}\n </span>\n <span className=\"min-w-0 flex-1 truncate text-start\">\n {isRange ? (\n api.value.length === 0 ? (\n <span className={placeholderColor}>{placeholder}</span>\n ) : (\n // Not `Ark.RangeText`: despite the name, it renders the calendar's\n // *visible* month/year viewport (the same text the header's ViewTrigger\n // shows), not the selected range — `datePicker.visibleRangeText` in Ark's\n // own source. Build the real selected-range text from `valueAsString`\n // instead (the same per-value formatted strings `Ark.ValueText` uses).\n api.valueAsString.join(\" – \")\n )\n ) : (\n <Ark.ValueText placeholder={placeholder} />\n )}\n </span>\n </Ark.Trigger>\n )}\n {clearable && (\n // Ark's own ClearTrigger already self-hides (`hidden`) while empty.\n <Ark.ClearTrigger className={popoverClearTrigger}>\n <CloseIcon />\n </Ark.ClearTrigger>\n )}\n </Ark.Control>\n\n {/* Holds an enclosing Modal/Drawer/Popover open while the calendar is; see `lib/overlay-layer.tsx`. */}\n <NestedLayer open={api.open} />\n <Portal disabled={!withinPortal} container={portalContainer}>\n <Ark.Positioner>\n <Ark.Content\n // `max-content` sizing (no `sameWidth`, see the positioning comment above)\n // means \"as if nothing below ever wraps\" — a `flex-wrap` time-row footer\n // wider than the calendar (two side-by-side \"Start time\"/\"End time\" rows\n // under `range` + `withTime`) would never actually wrap without a real width\n // constraint to shrink against; it'd just overflow off-screen on a narrow\n // viewport instead. `92vw` is generous enough to be a no-op on any normal\n // desktop width, only kicking in once there's genuinely no room.\n className={cn(\n popoverPanel,\n \"max-w-[92vw] flex-row flex-wrap items-stretch\",\n classNames?.content,\n )}\n >\n {presets && (\n <PresetsRail\n presets={presets}\n range={isRange}\n timeZone={resolvedTimeZone}\n locale={resolvedLocale}\n withConfirm={withConfirm}\n translations={translations?.presets}\n className={classNames?.presets}\n />\n )}\n <div\n className=\"flex min-w-0 flex-1 flex-col\"\n style={{\n width:\n Math.max(\n calendarGridWidth(size, numOfMonths),\n withTime ? timeRowMinWidth(size, resolvedHourCycle, withSeconds) : 0,\n ) + 16, // Take the x padding into account\n }}\n >\n <Popover.Body\n className={cn(\"p-2\", withTime || withConfirm ? \"border-b\" : undefined)}\n >\n <CalendarBody\n numOfMonths={numOfMonths}\n size={size}\n timeZone={resolvedTimeZone}\n classNames={classNames?.calendar}\n icons={icons}\n />\n </Popover.Body>\n {withTime && (\n <Popover.Footer\n className={cn(\n \"flex gap-x-2 gap-y-2 pb-2\",\n // Stacked by default — side by side only widens to match the extra\n // room multiple months already provide; with a single month, sitting\n // two time rows side by side would force the popover wider than the\n // calendar above them for no reason.\n numOfMonths > 1 ? \"flex-row flex-wrap\" : \"flex-col\",\n classNames?.footer,\n )}\n >\n <TimePanelRow\n value={api.value[0]}\n onSetTime={(time) => setTimeOrToday(api, time, 0, resolvedTimeZone)}\n label={isRange ? t.startTime : undefined}\n hourCycle={resolvedHourCycle}\n minuteStep={minuteStep}\n withSeconds={withSeconds}\n placeholder={timePlaceholder}\n locale={resolvedLocale}\n translations={translations}\n size={size}\n variant={variant}\n classNames={{ root: \"flex-1\", ...classNames?.timePanel }}\n />\n {isRange && (\n <TimePanelRow\n value={api.value[1]}\n onSetTime={(time) => api.setTime(time, 1)}\n label={t.endTime}\n disabled={api.value.length < 2}\n hourCycle={resolvedHourCycle}\n minuteStep={minuteStep}\n withSeconds={withSeconds}\n placeholder={timePlaceholder}\n locale={resolvedLocale}\n translations={translations}\n size={size}\n variant={variant}\n classNames={{ root: \"flex-1\", ...classNames?.timePanel }}\n />\n )}\n </Popover.Footer>\n )}\n {withConfirm && (\n <Popover.Footer className=\"flex justify-end gap-2 pb-2\">\n <Button\n variant=\"subtle\"\n color=\"neutral\"\n size={size}\n onClick={() => {\n setStaged(committed)\n api.setOpen(false)\n }}\n >\n {t.cancel}\n </Button>\n <Button\n size={size}\n onClick={() => {\n setCommitted(staged)\n api.setOpen(false)\n }}\n >\n {t.apply}\n </Button>\n </Popover.Footer>\n )}\n </div>\n </Ark.Content>\n </Ark.Positioner>\n </Portal>\n\n {name &&\n (isRange ? (\n <>\n <input\n type=\"hidden\"\n name={`${name}Start`}\n value={\n api.value[0] ? serializeDateValue(api.value[0], Boolean(withTime)) : \"\"\n }\n />\n <input\n type=\"hidden\"\n name={`${name}End`}\n value={\n api.value[1] ? serializeDateValue(api.value[1], Boolean(withTime)) : \"\"\n }\n />\n </>\n ) : (\n <input\n type=\"hidden\"\n name={name}\n value={api.value[0] ? serializeDateValue(api.value[0], Boolean(withTime)) : \"\"}\n />\n ))}\n </>\n )}\n </Ark.Context>\n </Ark.Root>\n </FieldShell>\n )\n}\n\nexport const DatePicker = Object.assign(DatePickerImpl, {\n Root: Ark.Root,\n Context: Ark.Context,\n Control: Ark.Control,\n Input: Ark.Input,\n Trigger: Ark.Trigger,\n ClearTrigger: Ark.ClearTrigger,\n Content: Ark.Content,\n Presets: PresetsRail,\n Calendar: CalendarBody,\n TimePanel: TimeRow,\n TimePanelRow: TimePanelRow,\n Footer: Popover.Footer,\n}) as (<Range extends boolean = false>(props: DatePickerProps<Range>) => ReactNode) & {\n Root: typeof Ark.Root\n Context: typeof Ark.Context\n Control: typeof Ark.Control\n Input: typeof Ark.Input\n Trigger: typeof Ark.Trigger\n ClearTrigger: typeof Ark.ClearTrigger\n Content: typeof Ark.Content\n Presets: typeof PresetsRail\n Calendar: typeof CalendarBody\n TimePanel: typeof TimeRow\n TimePanelRow: typeof TimePanelRow\n Footer: typeof Popover.Footer\n}\n"]}
1
+ {"version":3,"sources":["../src/components/date-picker/date-time-text.ts","../src/components/date-picker/date-picker.tsx"],"names":["Ark"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,IAAM,SAAA,GAAY,CAAC,EAAE,MAAA,EAAQ,SAAA,EAAW,WAAA,EAAY,EAAwB,QAAA,KAC1E,IAAI,IAAA,CAAK,cAAA,CAAe,MAAA,EAAQ;AAAA,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A,CAAI,OAAA;AAAA,EACb,OAAA,EAAS,WAAA;AAAA,EACT,QAAA,EAAU,YAAA;AAAA,EACV,SAAA,EAAW,OAAA;AAAA,EACX,YAAA;AAAA,EACA,QAAQ,OAAA,CAAQ;AAClB,CAAC","file":"chunk-GEZYGBXY.js","sourcesContent":["import { CalendarDateTime, type DateValue } from \"@internationalized/date\"\nimport { calendarValueToDate } from \"../../lib/date-value\"\nimport {\n dayPeriodLabels,\n fromDisplayHour,\n type HourCycle,\n is12Hour,\n} from \"../time-input/hour-cycle\"\n\n/**\n * The typed text format for `typeable` + `withTime` — all-numeric, in the locale's own field order\n * (`10/20/2026, 02:30 PM` en-US, `20/10/2026 14:30` fr-FR), so what the field shows is exactly\n * what can be typed back. Ark's own `Input` part can't carry a time: it strips every character\n * but digits and the date separator while typing, and re-applies the previous value's time over\n * whatever its `parse` returns (`preserveTime`) — so `DatePicker` renders its own `<input>` on\n * top of these two helpers instead.\n */\n\ntype DateTimeTextOptions = {\n locale: string\n hourCycle: HourCycle\n withSeconds?: boolean\n}\n\nconst formatter = ({ locale, hourCycle, withSeconds }: DateTimeTextOptions, timeZone: string) =>\n new Intl.DateTimeFormat(locale, {\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: withSeconds ? \"2-digit\" : undefined,\n hourCycle,\n // `parseDateTimeText` reads ASCII digits; keep the display in the same digits it can parse.\n numberingSystem: \"latn\",\n timeZone,\n })\n\nexport const formatDateTimeText = (\n value: DateValue,\n options: DateTimeTextOptions,\n timeZone: string,\n): string => formatter(options, timeZone).format(calendarValueToDate(value, timeZone))\n\ntype NumericField = \"year\" | \"month\" | \"day\" | \"hour\" | \"minute\" | \"second\"\nconst NUMERIC_FIELDS = new Set<string>([\"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\"])\n\n/** The locale's numeric field order, read off the same formatter `formatDateTimeText` uses. */\nconst fieldOrder = (options: DateTimeTextOptions): NumericField[] =>\n formatter(options, \"UTC\")\n .formatToParts(new Date(Date.UTC(2001, 10, 22, 13, 44, 55)))\n .map((part) => part.type)\n .filter((type): type is NumericField => NUMERIC_FIELDS.has(type))\n\n/** \"AM\"/\"PM\" from the locale's own labels (`dayPeriodLabels`), falling back to a Latin `a`/`p`. */\nconst readPeriod = (text: string, locale: string): \"AM\" | \"PM\" | undefined => {\n const lower = text.toLowerCase()\n const labels = dayPeriodLabels(locale)\n if (lower.includes(labels.PM.toLowerCase())) return \"PM\"\n if (lower.includes(labels.AM.toLowerCase())) return \"AM\"\n if (/\\bp\\.?\\s?m?\\.?\\b/.test(lower)) return \"PM\"\n if (/\\ba\\.?\\s?m?\\.?\\b/.test(lower)) return \"AM\"\n return undefined\n}\n\nconst inRange = (n: number, min: number, max: number) => Number.isInteger(n) && n >= min && n <= max\n\n/**\n * Parse typed text back into a `CalendarDateTime`. Reads digit runs in the locale's field order\n * (so any separator works — `20/10/2026 14:30`, `20.10.2026 14h30` — but run-together digits like\n * `1430` read as one number); the\n * date is required, the time is optional — omitted fields keep `fallbackTime` (the current\n * value's), else midnight. In 12h mode a missing period reads AM, and a 13–23 hour is taken as\n * 24h as-typed; under `h24`, `24` is midnight. Returns `undefined` for anything that isn't a\n * real date/time (`02/30/2026`, `25:00`), never a silently constrained one.\n */\nexport const parseDateTimeText = (\n text: string,\n options: DateTimeTextOptions,\n fallbackTime?: { hour: number; minute: number; second: number },\n): CalendarDateTime | undefined => {\n const numbers = text.match(/\\d+/g)?.map(Number) ?? []\n const order = fieldOrder(options)\n const field = (name: NumericField) => {\n const index = order.indexOf(name)\n return index === -1 ? undefined : numbers[index]\n }\n\n const rawYear = field(\"year\")\n const month = field(\"month\")\n const day = field(\"day\")\n if (rawYear === undefined || month === undefined || day === undefined) return undefined\n const year = rawYear < 100 ? 2000 + rawYear : rawYear\n\n const typedHour = field(\"hour\")\n let hour = typedHour ?? fallbackTime?.hour ?? 0\n if (typedHour !== undefined && is12Hour(options.hourCycle) && inRange(typedHour, 0, 12)) {\n hour = fromDisplayHour(typedHour, readPeriod(text, options.locale) ?? \"AM\", options.hourCycle)\n } else if (typedHour === 24 && options.hourCycle === \"h24\") {\n // `h24` shows midnight as `24` (and so formats it that way) — read it back as hour 0.\n hour = 0\n }\n const minute = field(\"minute\") ?? (typedHour === undefined ? fallbackTime?.minute : 0) ?? 0\n const second = field(\"second\") ?? (typedHour === undefined ? fallbackTime?.second : 0) ?? 0\n\n if (!inRange(month, 1, 12) || !inRange(day, 1, 31) || !inRange(year, 1, 9999)) return undefined\n if (!inRange(hour, 0, 23) || !inRange(minute, 0, 59) || !inRange(second, 0, 59)) return undefined\n const value = new CalendarDateTime(year, month, day, hour, minute, second)\n // `CalendarDateTime` constrains out-of-range days (Feb 30 → Feb 28) instead of rejecting them.\n return value.day === day ? value : undefined\n}\n","\"use client\"\n\nimport {\n DatePicker as Ark,\n type DatePickerDateRangePreset as DateRangePreset,\n type DateValue,\n type DatePickerDateView as DateView,\n type UseDatePickerContext,\n} from \"@ark-ui/react/date-picker\"\nimport { useFieldContext } from \"@ark-ui/react/field\"\nimport { useLocaleContext } from \"@ark-ui/react/locale\"\nimport { Portal } from \"@ark-ui/react/portal\"\nimport { DateFormatter, toCalendarDateTime, today } from \"@internationalized/date\"\nimport { type FocusEvent, type ReactNode, type Ref, useId, useRef, useState } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { controlOpenProps } from \"../../lib/control-open\"\nimport type { DatePredicate } from \"../../lib/date-predicates\"\nimport {\n calendarValueToDate,\n type DateRangeValue,\n dateToArkValue,\n fromArkValues,\n toArkValues,\n} from \"../../lib/date-value\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport type { FormControlProps } from \"../../lib/form-control\"\nimport { capitalize } from \"../../lib/graphemes\"\nimport { useLocale, useTimeZone } from \"../../lib/intl\"\nimport { useMergedRefs } from \"../../lib/merge-refs\"\nimport { useOverlayContainer } from \"../../lib/overlay-container\"\nimport { NestedLayer } from \"../../lib/overlay-layer\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { Button } from \"../button/button\"\nimport { type CalendarTranslations, resolveCalendarTranslations } from \"../calendar/calendar\"\nimport {\n CalendarBody,\n type CalendarBodyClassNames,\n type CalendarIcons,\n calendarGridWidth,\n} from \"../calendar/calendar-body\"\nimport { CalendarZoneSync, hashArkValues } from \"../calendar/calendar-zone-sync\"\nimport { type FieldProps, FieldShell, fieldA11yProps } from \"../field/field\"\nimport {\n type InputVariant,\n inputControlClasses,\n inputShell,\n inputSlot,\n placeholderColor,\n shellGap,\n} from \"../input/input\"\nimport { CalendarIcon, CloseIcon } from \"../popover/icons\"\nimport { Popover, popoverClearTrigger, popoverPanel } from \"../popover/popover\"\nimport {\n fromDisplayHour,\n type HourCycle,\n resolveHourCycle,\n toDisplayHour,\n} from \"../time-input/hour-cycle\"\nimport { TimeRow, type TimeRowTranslations, timeRowMinWidth } from \"../time-input/time-row\"\nimport { formatDateTimeText, parseDateTimeText } from \"./date-time-text\"\n\n/**\n * DatePicker — a trigger + popover calendar on Ark UI's `date-picker` machine, composing\n * `Calendar`'s shared grid module (`calendar-body.tsx`) and `TimeInput`'s shared time row\n * (`time-row.tsx`). `range` and `withTime` cover all four date combinations; `DateRangePicker`,\n * `DateTimePicker`, and `DateTimeRangePicker` are thin named presets pinning those two flags.\n *\n * - Value is a native `Date | null` (or `{ start, end }` under `range`) — the machine's\n * `DateValue` array contract never leaks out; `lib/date-value.ts` is the one conversion\n * boundary both directions go through, exactly as `Calendar` uses it.\n * - `withConfirm` stages the selection in local state; only Apply calls the outer `onChange`,\n * Cancel reverts. Without it, single dates commit + close on pick and ranges commit on the\n * second click (both Ark-native) — except under `withTime`, where a pick commits but keeps\n * the panel open so the time row can still be set (outside click / Escape closes it).\n * - `presets` renders a sidebar of quick-pick shortcuts — range shortcuts (Ark's own\n * `DateRangePreset` union, or a custom `{ range }`) under `range`; single-date shortcuts\n * (a custom `{ date }`) otherwise. `true` resolves to a mode-appropriate default set.\n * - `isDateUnavailable` / `min` / `max` take native `Date`s; pair with `lib/date-predicates.ts`'s\n * helpers (`disablePast()`, `disableWeekends()`, …), re-exported from this same barrel.\n * - `typeable` swaps the plain button trigger for a text input, so a date can be typed (and\n * parsed on blur / Enter) in addition to picked from the calendar — the leading icon becomes a\n * real open-calendar button alongside it. Opt-in (default `false`); single dates only (see\n * the prop's own doc comment). Under `withTime` the input carries the time too\n * (`date-time-text.ts`).\n *\n * <DatePicker label=\"Start date\" value={date} onChange={setDate} clearable />\n * <DateRangePicker withTime presets withConfirm value={range} onChange={setRange} />\n */\n\nconst datePickerPresets = cn(\n \"flex shrink-0 flex-col gap-0.5 border-e p-1\",\n \"border-brand-900/20 dark:border-white/15\",\n)\n\nconst presetTrigger = cn(\n \"w-full cursor-pointer rounded-xs px-2 py-1.5 text-start text-sm whitespace-nowrap transition-colors\",\n \"hover:bg-brand-900/6 dark:hover:bg-white/8\",\n focusStyles({ offset: false }),\n)\n\nconst timePanelLabel = cn(\"text-xs font-medium\", TEXT_COLOR_CLASSES.muted)\n\n/** `typeable`'s leading calendar icon, promoted from a decorative span (the button-trigger case)\n * to a real open-calendar button — same base look as `inputSlot`, plus the family's interactive-\n * icon treatment (compare `popoverClearTrigger`). `outline-none`: the shell's own `:has()` rule\n * (`shellChrome` in `input.tsx`) already rings the *whole* control on this button's focus-visible\n * state, so its own native outline would just double up. */\nconst datePickerIconTrigger = cn(\n inputSlot,\n \"cursor-pointer rounded-xs outline-none transition-colors hover:text-brand-900/70 dark:hover:text-white/80 disabled:cursor-not-allowed\",\n)\n\n/** The main column (calendar + time row footer) has no explicit width of its own, and neither\n * does the popover above it — deliberately, so the popover sizes to its content. But once the\n * time row's Hour/Minute/(Second) fields are `flex-1` (grow to fill the row), that becomes\n * circular: the row wants to size off \"however much space is available,\" and with nothing\n * concrete above it to measure against, browsers resolve a flex container's own intrinsic width\n * generously when it holds `flex-grow` items — the row (and everything above it) ends up far\n * wider than the calendar actually needs, even for a single time row. Giving the column an\n * explicit width tied to the calendar's own geometry (`calendarGridWidth`, shared with\n * `calendar-body.tsx`'s own month/year grids) breaks that circularity: the row now grows to\n * fill a *real* width instead of an ambiguous one.\n *\n * That width is only ever tied to the *calendar* grid, though — under `withTime`, the column\n * must be at least as wide as the time row itself needs (`timeRowMinWidth`), or the same\n * `flex-1` + `min-w-0` fields that motivated a fixed width in the first place shrink below their\n * content size instead of growing: with the AM/PM toggle present at a single month, the\n * calendar-only width is narrower than Hour+Minute+Period need, and the `<input>`s get starved. */\n\nconst pad = (n: number) => String(n).padStart(2, \"0\")\n\n/** Hidden-input serialization. `DateValue#toString()` isn't safe to call directly here: a\n * `CalendarDateTime` (what our own `dateToArkValue` produces for a `defaultValue`/`value` passed\n * in) stringifies with a time, while a plain `CalendarDate` (what a day-grid click produces)\n * stringifies as a clean date — two different formats for the same picked day depending on\n * provenance. Read the wall-calendar fields directly instead. Whether to append the time portion\n * is driven by the picker's own `withTime` flag, not by whether the value happens to carry an\n * `hour` field — a `CalendarDateTime` always has one (even at local midnight), so that structural\n * check can't tell \"date-only\" from \"with time\" apart. */\nexport const serializeDateValue = (value: DateValue, withTime: boolean): string => {\n const date = `${value.year}-${pad(value.month)}-${pad(value.day)}`\n if (!withTime) return date\n const time = \"hour\" in value ? value : { hour: 0, minute: 0, second: 0 }\n return `${date}T${pad(time.hour)}:${pad(time.minute)}:${pad(time.second)}`\n}\n\nexport type DatePickerClassNames = {\n field?: string\n control?: string\n content?: string\n presets?: string\n calendar?: CalendarBodyClassNames\n timePanel?: { hour?: string; minute?: string; second?: string; period?: string }\n footer?: string\n}\n\n/** `value`/`range`-shaped entries are for `range` mode; `date`-shaped entries are for single-date\n * mode. Nothing prevents mixing them for the picker's current mode — the shape you pass is\n * trusted, not validated at runtime (a mismatched entry just doesn't produce useful behavior;\n * `api.setValue`/`getRangePresetValue` are mode-agnostic in the underlying machine). */\nexport type DatePreset =\n | { label: string; value: DateRangePreset }\n | { label: string; range: { start: Date; end: Date } | null }\n | { label: string; date: Date | null }\n\n/** Identifies each entry `getDefaultPresets` builds for `presets={true}`, so a `translations`\n * override can target one label without redefining the whole set. */\nexport type DatePickerPresetId =\n | \"today\"\n | \"yesterday\"\n | \"tomorrow\"\n | \"nextWeek\"\n | \"thisWeek\"\n | \"lastWeek\"\n | \"thisMonth\"\n | \"lastMonth\"\n | \"thisYear\"\n | \"allTime\"\n\n/** One unified `translations` prop rather than one per string source — Ark's own accessible\n * names, the `presets={true}` default labels, and the embedded time row's strings all belong to\n * the same `DatePicker` instance a consumer is localizing. English defaults throughout;\n * unset keys keep their built-in text. */\nexport type DatePickerTranslations = Partial<CalendarTranslations> &\n TimeRowTranslations & {\n /** The `withConfirm` footer's revert button. Default `\"Cancel\"`. */\n cancel?: string\n /** The `withConfirm` footer's commit button. Default `\"Apply\"`. */\n apply?: string\n /** The embedded time row's label under `range` + `withTime` (first row). Default `\"Start time\"`. */\n startTime?: string\n /** The embedded time row's label under `range` + `withTime` (second row). Default `\"End time\"`. */\n endTime?: string\n /** Individual `presets={true}` default-set labels, keyed by id — override just the ones you\n * need without redefining the whole array. Pass your own `DatePreset[]` for full control.\n * Every label but `allTime` (default `\"All time\"`) is already in the locale's words, from\n * `Intl.RelativeTimeFormat` (\"Aujourd’hui\", \"La semaine dernière\"); an override wins. */\n presets?: Partial<Record<DatePickerPresetId, string>>\n }\n\n/** The calendar's icon slots, one prop for the whole picker. */\nexport type DatePickerIcons = CalendarIcons\n\nexport type DatePickerProps<Range extends boolean = false> = FormControlProps<\n Range extends true ? DateRangeValue : Date | null,\n // Widened from `HTMLButtonElement` alone: under `typeable` the focusable element is Ark's\n // `Input` (a real `<input>`), not the button trigger — `ref`/`onBlur` must be able to land on\n // either depending on that prop, since both are the same generic `DatePickerProps`.\n HTMLButtonElement | HTMLInputElement\n> &\n Pick<FieldProps, \"label\" | \"description\" | \"error\" | \"required\"> &\n WithTestId & {\n /** Select a `{ start, end }` range instead of a single date. */\n range?: Range\n /** Adds an embedded HOUR/MINUTE (+ SECOND) time row; the value carries H/M too. */\n withTime?: boolean\n /** Months shown side by side. Default `1`, regardless of `range` — pass `2` to show a full\n * range without paging (matches `Calendar`'s own plain default). */\n numOfMonths?: number\n /** Always render 6 week rows (padding with adjacent-month days) instead of however many the\n * visible month(s) actually span (4–6) — keeps the popover's height constant while\n * navigating between months. */\n fixedWeeks?: boolean\n /** Preset sidebar — range shortcuts under `range`, single-date shortcuts otherwise. `true`\n * renders a mode-appropriate default set; an array is fully custom. See `DatePreset`. */\n presets?: DatePreset[] | boolean\n /** Stage the selection; commit only on Apply. Cancel reverts to the last committed value. */\n withConfirm?: boolean\n /** Renders a clear trigger once a value is set; emits `null` (or an all-null range). */\n clearable?: boolean\n /** Restriction predicate over a native `Date`. Compose with `lib/date-predicates.ts`'s helpers.\n * Called with this component's own resolved `timeZone` as its second argument, so a predicate\n * reads the candidate day in the same zone the grid renders it in. */\n isDateUnavailable?: DatePredicate\n /** Renders a text input (typing, blur-to-parse, `Enter`-to-commit) alongside the\n * calendar-icon trigger, instead of the plain button-only trigger. Opt-in — default `false`\n * keeps the click-to-open button.\n *\n * Without `withTime` this is Ark's own `Input` anatomy part (a numeric date). Under\n * `withTime` it shows and parses a numeric date + time in the locale's own field order\n * (`10/20/2026, 02:30 PM`, `20/10/2026 14:30`) — typing just a date keeps the current time.\n * `range` (cross-field validation across two inputs) is out of scope and falls back to the\n * button trigger. */\n typeable?: boolean\n min?: Date\n max?: Date\n /** Bounds the view levels reachable via navigation (e.g. `minView=\"month\"`). */\n minView?: DateView\n maxView?: DateView\n /** Overrides the active locale context. Drives month/day names, first-day-of-week, and the\n * embedded time row's 12h/24h default. */\n locale?: string\n /** Overrides the time zone for every `Date ↔ DateValue` conversion. Resolves\n * **prop → `IntlProvider` → host zone**, through `useTimeZone` like `Calendar` and\n * `Schedule` — **not** Ark's own machine default (`\"UTC\"`). Accepts `\"auto\"` to follow the\n * host zone. */\n timeZone?: string\n /** Force 12-hour or 24-hour display for the embedded time row, overriding the locale default. */\n format?: 12 | 24\n /** Force a specific hour cycle, overriding the locale default and `format`. */\n hourCycle?: HourCycle\n minuteStep?: number\n withSeconds?: boolean\n /** Placeholder shown in the embedded time row's empty Hour/Minute/Second fields — see\n * TimeRow's `placeholder`. Default `\"--\"`. */\n timePlaceholder?: string\n /** Overrides built-in English strings — Ark's own accessible names, the `presets={true}`\n * \"All time\" label, Cancel/Apply, Start/End time, and the embedded time row's Hour/Minute/\n * Second/Period labels. The other preset labels already follow `locale`, and an override\n * here still wins over them. Partial — unset keys keep their default. */\n translations?: DatePickerTranslations\n /** Replaces the calendar's default icons: `prev`, `next`, passed through to its grid like\n * `translations`. The kit's chevrons mirror under RTL; an icon passed here is drawn as given. */\n icons?: DatePickerIcons\n /** Placeholder shown while no date is selected. */\n placeholder?: string\n /** Inline-start adornment. Defaults to a calendar icon. */\n startSlot?: ReactNode\n size?: Size\n variant?: InputVariant\n /** Render the panel in a Portal so it escapes clipping ancestors.\n * Default `true`. */\n withinPortal?: boolean\n /** Portal target. Defaults to the enclosing `Modal`/`Drawer` when there is\n * one (so the panel stays above it), else `document.body`. */\n container?: HTMLElement | null\n className?: string\n classNames?: DatePickerClassNames\n }\n\n/** `DatePicker`'s own English wording, merged once per render (`presets` one level deeper, in\n * `presetLabels`). \"All time\" is the one non-derivable preset label; every other\n * `presets={true}` label comes from `Intl.RelativeTimeFormat`. */\nconst DATE_PICKER_DEFAULT_TRANSLATIONS = {\n cancel: \"Cancel\",\n apply: \"Apply\",\n startTime: \"Start time\",\n endTime: \"End time\",\n presets: { allTime: \"All time\" },\n} as const satisfies DatePickerTranslations\n\n/** The `presets={true}` labels: the locale's own words for each relative period\n * (`Intl.RelativeTimeFormat` with `numeric: \"auto\"` — \"Aujourd’hui\", \"La semaine dernière\"),\n * capitalised for a button, then \"All time\" from the defaults, then the consumer's\n * `translations.presets`, which win over both. */\nconst presetLabels = (\n locale: string,\n overrides?: Partial<Record<DatePickerPresetId, string>>,\n): Record<DatePickerPresetId, string> => {\n const relative = new Intl.RelativeTimeFormat(locale, { numeric: \"auto\" })\n const say = (value: number, unit: Intl.RelativeTimeFormatUnit) =>\n capitalize(relative.format(value, unit), locale)\n return {\n today: say(0, \"day\"),\n yesterday: say(-1, \"day\"),\n tomorrow: say(1, \"day\"),\n nextWeek: say(1, \"week\"),\n thisWeek: say(0, \"week\"),\n lastWeek: say(-1, \"week\"),\n thisMonth: say(0, \"month\"),\n lastMonth: say(-1, \"month\"),\n thisYear: say(0, \"year\"),\n ...DATE_PICKER_DEFAULT_TRANSLATIONS.presets,\n ...overrides,\n }\n}\n\n/** Ark's built-in `DateRangePreset` union has no \"today\" / \"yesterday\" / \"all time\" member\n * (confirmed in `@zag-js/date-utils`'s types) — those three are hand-built here from\n * `today(timeZone)`; the rest map straight to Ark's own string presets. The single-date set\n * (non-`range`) is a different shape entirely, not a trimmed-down copy of the range one — \"This\n * week\"/\"This month\"/etc. are inherently range-shaped and don't collapse to one date. */\nconst getDefaultPresets = (\n range: boolean,\n timeZone: string,\n locale: string,\n overrides?: Partial<Record<DatePickerPresetId, string>>,\n): DatePreset[] => {\n const now = today(timeZone)\n const toDate = (value: typeof now) => calendarValueToDate(value, timeZone)\n const label = presetLabels(locale, overrides)\n if (!range) {\n return [\n { label: label.today, date: toDate(now) },\n { label: label.yesterday, date: toDate(now.subtract({ days: 1 })) },\n { label: label.tomorrow, date: toDate(now.add({ days: 1 })) },\n { label: label.nextWeek, date: toDate(now.add({ days: 7 })) },\n ]\n }\n const yesterday = now.subtract({ days: 1 })\n return [\n { label: label.today, range: { start: toDate(now), end: toDate(now) } },\n { label: label.yesterday, range: { start: toDate(yesterday), end: toDate(yesterday) } },\n { label: label.thisWeek, value: \"thisWeek\" },\n { label: label.lastWeek, value: \"lastWeek\" },\n { label: label.thisMonth, value: \"thisMonth\" },\n { label: label.lastMonth, value: \"lastMonth\" },\n { label: label.thisYear, value: \"thisYear\" },\n { label: label.allTime, range: null },\n ]\n}\n\nconst PresetsRail = ({\n presets,\n range,\n timeZone,\n locale,\n withConfirm,\n translations,\n className,\n}: {\n presets: DatePreset[] | boolean\n /** Which default set `presets === true` resolves to — irrelevant once `presets` is a concrete array. */\n range?: boolean\n timeZone: string\n /** Names the `presets === true` periods. Falls back to the `IntlProvider` locale. */\n locale?: string\n withConfirm?: boolean\n /** Overrides individual `presets={true}` default-set labels, keyed by id. No effect on a\n * custom `DatePreset[]`. */\n translations?: Partial<Record<DatePickerPresetId, string>>\n className?: string\n}) => {\n const resolvedLocale = useLocale(locale)\n const resolved =\n presets === true\n ? getDefaultPresets(Boolean(range), timeZone, resolvedLocale, translations)\n : presets === false\n ? []\n : presets\n if (resolved.length === 0) return null\n return (\n <Ark.Context>\n {(api) => (\n <div className={cn(datePickerPresets, className)}>\n {resolved.map((preset) => (\n <button\n key={preset.label}\n type=\"button\"\n // Not `Ark.PresetTrigger`: its own onClick always sends `PRESET.CLICK`, which the\n // machine transitions unconditionally to \"focused\" (closed) regardless of\n // `closeOnSelect` — there's no way to keep it open under `withConfirm`. Resolve the\n // preset's value ourselves and set it via `api.setValue`, which only sets the value\n // (no state-machine transition), then close explicitly only when not staging.\n onClick={() => {\n const values =\n \"value\" in preset\n ? api.getRangePresetValue(preset.value)\n : \"range\" in preset\n ? (toArkValues(preset.range, timeZone) ?? [])\n : (toArkValues(preset.date, timeZone) ?? [])\n api.setValue(values)\n if (!withConfirm) api.setOpen(false)\n }}\n aria-label={preset.label}\n className={presetTrigger}\n >\n {preset.label}\n </button>\n ))}\n </div>\n )}\n </Ark.Context>\n )\n}\n\ntype DisplayTime = {\n hour: number | null\n minute: number | null\n second: number | null\n period: \"AM\" | \"PM\" | null\n}\n\nconst emptyDisplayTime: DisplayTime = { hour: null, minute: null, second: null, period: null }\n\n/** Derive display-space fields (the cycle's own hours, + period) from the machine's own\n * `DateValue` — a plain `CalendarDate` (no time picked yet) has no `hour`, so it reads as all-null. */\nconst toDisplayTime = (value: DateValue | undefined, cycle: HourCycle): DisplayTime => {\n if (!value || !(\"hour\" in value)) return emptyDisplayTime\n const { hour, period } = toDisplayHour(value.hour, cycle)\n return { hour, minute: value.minute, second: value.second ?? null, period }\n}\n\n/** The inverse of `toDisplayTime` — merges a display-space edit into a `setTime`-ready payload.\n * Missing fields default to midnight, same rule `TimeInput` uses for its own first edit. */\nconst fromDisplayTime = (\n display: DisplayTime,\n cycle: HourCycle,\n): { hour: number; minute: number; second?: number } => {\n const hour = fromDisplayHour(display.hour, display.period, cycle)\n const minute = display.minute ?? 0\n return display.second != null ? { hour, minute, second: display.second } : { hour, minute }\n}\n\n/** `api.setTime`, except that a time edit with no day picked yet lands on *today* instead of being\n * dropped — Ark's own `setTime` silently no-ops without a date at that index, so typing a time\n * first used to do nothing at all. Only the first row can hit that (the second is disabled until\n * a range has both ends). `setValue` keeps today within `min`/`max`, like Ark's `selectToday`;\n * a today that `isDateUnavailable` rules out isn't auto-picked. */\nconst setTimeOrToday = (\n api: UseDatePickerContext,\n time: { hour: number; minute: number; second?: number },\n index: number,\n timeZone: string,\n) => {\n if (api.value[index] || index !== 0) return api.setTime(time, index)\n const day = today(timeZone)\n if (api.isUnavailable(day)) return\n api.setValue([toCalendarDateTime(day).set(time)])\n}\n\nexport type TimePanelRowProps = {\n value: DateValue | undefined\n onSetTime: (time: { hour: number; minute: number; second?: number }) => void\n /** Visible label above the row, which also names its `role=\"group\"` (\"Start time\" / \"End\n * time\" under `range`). Without it the group is named `translations.time` (`\"Time\"`). */\n label?: string\n disabled?: boolean\n hourCycle: HourCycle\n minuteStep?: number\n withSeconds?: boolean\n /** Placeholder shown in the row's empty Hour/Minute/Second fields — see TimeRow's\n * `placeholder`. Default `\"--\"`. */\n placeholder?: string\n /** Resolves the locale-correct AM/PM labels + Hour/Minute/Second unit suffixes via `Intl`.\n * Falls back to `useLocaleContext()` when omitted. */\n locale?: string\n /** Overrides the sr-only Hour/Minute/Second/Period accessible names. English by default. */\n translations?: TimeRowTranslations\n size?: Size\n variant?: InputVariant\n classNames?: DatePickerClassNames[\"timePanel\"] & { root?: string }\n}\n\n/** One HOUR/MINUTE(+SECOND)+AM/PM row, bridging `TimeRow`'s display-space props to a specific\n * `api.value` index via `api.setTime(time, index)` — the same shared `TimeRow` `TimeInput`\n * wraps with its own local state, wrapped here with the machine's state instead. */\nconst TimePanelRow = ({\n value,\n onSetTime,\n label,\n disabled,\n hourCycle,\n minuteStep,\n withSeconds,\n placeholder,\n locale,\n translations,\n size,\n variant,\n classNames,\n}: TimePanelRowProps) => {\n const display = toDisplayTime(value, hourCycle)\n const patch = (partial: Partial<DisplayTime>) =>\n onSetTime(fromDisplayTime({ ...display, ...partial }, hourCycle))\n const labelId = useId()\n\n return (\n <div className={cn(\"flex flex-col gap-1\", classNames?.root)}>\n {label && (\n <span id={labelId} className={timePanelLabel}>\n {label}\n </span>\n )}\n <TimeRow\n aria-labelledby={label ? labelId : undefined}\n hour={display.hour}\n minute={display.minute}\n second={display.second}\n onHourChange={(hour) => patch({ hour })}\n onMinuteChange={(minute) => patch({ minute })}\n onSecondChange={withSeconds ? (second) => patch({ second }) : undefined}\n period={display.period}\n onPeriodChange={(period) => patch({ period })}\n hourCycle={hourCycle}\n minuteStep={minuteStep}\n withSeconds={withSeconds}\n placeholder={placeholder}\n locale={locale}\n translations={translations}\n size={size}\n variant={variant}\n disabled={disabled}\n classNames={classNames}\n />\n </div>\n )\n}\n\n/**\n * `typeable` + `withTime`'s own text input, standing in for Ark's `Input` part — which can't carry\n * a time (see `date-time-text.ts`). It still declares `data-part=\"input\"` inside the Control, so\n * the machine treats it as its input: excluded from interact-outside dismissal, focused on close,\n * and kept in sync with every value change (day pick, time row, clear) through the Root's\n * `format`, which is this same numeric text. Left uncontrolled for that reason — the only thing\n * added here is committing typed text: parsed on blur / `Enter`, then set through `api.setValue`;\n * text that doesn't parse (or lands on an unavailable day) reverts to the current value.\n */\nconst DateTimeTextInput = ({\n api,\n options,\n timeZone,\n ref,\n onBlur,\n placeholder,\n disabled,\n readOnly,\n invalid,\n testId,\n}: {\n api: UseDatePickerContext\n options: Parameters<typeof parseDateTimeText>[1]\n timeZone: string\n ref?: Ref<HTMLInputElement>\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n placeholder?: string\n disabled?: boolean\n readOnly?: boolean\n invalid?: boolean\n testId?: string\n}) => {\n const field = useFieldContext()\n const current = api.value[0]\n const show = (input: HTMLInputElement, value: DateValue | undefined) => {\n input.value = value ? formatDateTimeText(value, options, timeZone) : \"\"\n }\n const commit = (input: HTMLInputElement) => {\n const text = input.value.trim()\n if (text === \"\") {\n if (current) api.clearValue({ focus: false })\n return\n }\n const fallback = current && \"hour\" in current ? current : undefined\n const next = parseDateTimeText(text, options, fallback)\n if (!next || api.isUnavailable(next)) return show(input, current)\n api.setValue([next])\n api.setFocusedValue(next)\n // `setValue` is a no-op (and syncs nothing) when the parsed value equals the current one, so\n // normalize the typed text to the canonical format either way.\n show(input, next)\n }\n return (\n <input\n ref={ref}\n type=\"text\"\n data-scope=\"date-picker\"\n data-part=\"input\"\n autoComplete=\"off\"\n defaultValue={current ? formatDateTimeText(current, options, timeZone) : \"\"}\n placeholder={placeholder}\n disabled={disabled}\n readOnly={readOnly}\n {...props({ \"aria-invalid\": invalid })}\n // Ark's own input-click handler, not `api.setOpen`: it opens with `src: \"input.click\"`,\n // which is what stops the machine from moving focus into the grid — typing has to keep\n // landing here. It also honours `openOnClick` and disabled/read-only on its own.\n onClick={api.getInputProps().onClick}\n onKeyDown={(event) => {\n if (event.key !== \"Enter\" || event.nativeEvent.isComposing) return\n event.preventDefault()\n commit(event.currentTarget)\n }}\n onBlur={(event) => {\n if (!readOnly) commit(event.currentTarget)\n onBlur?.(event)\n }}\n {...props({ \"data-testid\": testId })}\n {...fieldA11yProps(field)}\n className={inputControlClasses}\n />\n )\n}\n\nconst DatePickerImpl = <Range extends boolean = false>({\n withinPortal = true,\n container,\n range,\n withTime,\n numOfMonths = 1,\n fixedWeeks,\n presets,\n withConfirm,\n clearable,\n value,\n defaultValue,\n onChange,\n onBlur,\n isDateUnavailable,\n typeable,\n min,\n max,\n minView,\n maxView,\n locale,\n timeZone,\n format,\n hourCycle,\n minuteStep,\n withSeconds,\n timePlaceholder,\n translations,\n icons,\n placeholder = \"Pick a date\",\n startSlot,\n size = \"md\",\n variant = \"default\",\n disabled,\n readOnly,\n required,\n invalid,\n name,\n id,\n ref,\n label,\n description,\n error,\n className,\n classNames,\n testId,\n}: DatePickerProps<Range>) => {\n const portalContainer = useOverlayContainer(container)\n const { locale: contextLocale } = useLocaleContext()\n const resolvedLocale = locale ?? contextLocale\n const resolvedTimeZone = useTimeZone(timeZone)\n const resolvedHourCycle = resolveHourCycle({ locale: resolvedLocale, format, hourCycle })\n const t = { ...DATE_PICKER_DEFAULT_TRANSLATIONS, ...translations }\n const isInvalid = invalid || error != null\n const isRange = Boolean(range)\n // See `typeable`'s own doc comment: single dates only — `range` silently falls back to the\n // button trigger rather than erroring, so `typeable` composes safely with every other prop.\n // Under `withTime` the input is `DateTimeTextInput` instead of Ark's own date-only `Input`.\n const showTypeableInput = Boolean(typeable) && !isRange\n const dateTimeText = { locale: resolvedLocale, hourCycle: resolvedHourCycle, withSeconds }\n const controlRef = useRef<HTMLDivElement>(null)\n const triggerRef = useRef<HTMLButtonElement>(null)\n const inputRef = useRef<HTMLInputElement>(null)\n\n type Value = Range extends true ? DateRangeValue : Date | null\n const emptyValue = (isRange ? { start: null, end: null } : null) as Value\n\n // Reserved for the `withConfirm` staged layer only — the base value needs no local state,\n // Ark's machine natively supports controlled/uncontrolled `value`/`defaultValue`/`onValueChange`\n // the same way `Calendar` relies on it.\n const [committed, setCommitted] = useUncontrolled<Value>({\n value,\n defaultValue,\n finalValue: emptyValue,\n onChange,\n })\n const [staged, setStaged] = useState<Value>(committed)\n const zoneReseed = useRef<string | null>(null)\n\n const inputMergedRef = useMergedRefs<HTMLButtonElement | HTMLInputElement>(inputRef, ref)\n const triggerMergedRef = useMergedRefs<HTMLButtonElement | HTMLInputElement>(triggerRef, ref)\n return (\n <FieldShell\n label={label}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n size={size}\n className={classNames?.field}\n >\n <Ark.Root\n id={id}\n selectionMode={isRange ? \"range\" : \"single\"}\n // Ark's own default (`true`) auto-closes on a completed pick — under `withConfirm`\n // the picker must stay open for review until Apply/Cancel, and under `withTime` the day\n // is only half the value: closing on pick would hide the time row it still needs.\n // Otherwise leave Ark's default (single closes on pick, range on the second click).\n closeOnSelect={withConfirm || withTime ? false : undefined}\n // Ark's own default (`false`) requires the calendar-icon trigger to open the popover —\n // under `typeable` a click into the text field itself should open it too, matching the\n // combined type-or-pick affordance `typeable` is meant to offer. No-op when the Input\n // anatomy part isn't rendered (`!showTypeableInput`).\n openOnClick={showTypeableInput}\n locale={resolvedLocale}\n timeZone={resolvedTimeZone}\n translations={resolveCalendarTranslations(translations)}\n numOfMonths={numOfMonths}\n fixedWeeks={fixedWeeks}\n minView={minView}\n maxView={maxView}\n value={toArkValues(withConfirm ? staged : value, resolvedTimeZone)}\n defaultValue={withConfirm ? undefined : toArkValues(defaultValue, resolvedTimeZone)}\n onValueChange={(details) => {\n // A zone change re-expresses the selection in the new zone; that echo is not a change.\n if (zoneReseed.current === hashArkValues(details.value)) {\n zoneReseed.current = null\n return\n }\n const next = fromArkValues(details.value, isRange, resolvedTimeZone) as Value\n if (withConfirm) setStaged(next)\n else onChange?.(next)\n }}\n onOpenChange={(details) => {\n if (withConfirm && details.open) setStaged(committed)\n }}\n isDateUnavailable={\n isDateUnavailable\n ? (dateValue) =>\n isDateUnavailable(\n calendarValueToDate(dateValue, resolvedTimeZone),\n resolvedTimeZone,\n )\n : undefined\n }\n min={min ? dateToArkValue(min, resolvedTimeZone) : undefined}\n max={max ? dateToArkValue(max, resolvedTimeZone) : undefined}\n // The typed date+time input shows (and Ark syncs into it) the same numeric text it parses.\n format={\n withTime && showTypeableInput\n ? (date) => formatDateTimeText(date, dateTimeText, resolvedTimeZone)\n : withTime\n ? (date, { locale: fmtLocale }) =>\n new DateFormatter(fmtLocale, { dateStyle: \"medium\", timeStyle: \"short\" }).format(\n calendarValueToDate(date, resolvedTimeZone),\n )\n : undefined\n }\n // Anchor to the Control (not `sameWidth`, unlike Select) — the popover hosts a full\n // calendar grid + presets rail, which needs its own intrinsic width, not the trigger's.\n positioning={{ getAnchorRect: () => controlRef.current?.getBoundingClientRect() ?? null }}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n invalid={isInvalid}\n className={cn(\"w-full\", className)}\n >\n {/* Keeps the selection, and the typeable input's text, on the same instant when the zone\n * changes, in place rather than by remounting; see `calendar-zone-sync.tsx`. Under\n * `withConfirm` Ark's value is the staged `Date`, so it is controlled either way. */}\n <CalendarZoneSync\n timeZone={resolvedTimeZone}\n controlled={withConfirm || value !== undefined}\n pendingRef={zoneReseed}\n />\n <Ark.Context>\n {(api) => (\n <>\n <Ark.Control\n ref={controlRef}\n {...props({\n \"data-invalid\": isInvalid,\n \"data-with-start-slot\": true,\n \"data-with-end-slot\": true,\n })}\n {...(disabled || readOnly ? {} : controlOpenProps(() => api.setOpen(true)))}\n className={cn(\n inputShell({ size, variant }),\n // A real `<input>` sits in the shell under `typeable` — leave the shell's own\n // cursor at the browser default (text-cursor over the input, pointer over the\n // icon trigger / clear button) instead of forcing pointer everywhere, matching\n // `Combobox`'s Control (see `combobox.tsx`) rather than `Select`'s button-only one.\n !showTypeableInput && \"cursor-pointer\",\n classNames?.control,\n )}\n >\n {showTypeableInput ? (\n <div className={cn(\"flex min-w-0 flex-1 items-center\", shellGap[size])}>\n {/* Ark sets its own accessible `aria-label` (\"Open calendar\" / \"Close\n calendar\") on the trigger regardless of children, so an icon-only button\n here is still accessible without a manual override. */}\n <Ark.Trigger className={datePickerIconTrigger}>\n {startSlot ?? <CalendarIcon />}\n </Ark.Trigger>\n {withTime ? (\n <DateTimeTextInput\n api={api}\n options={dateTimeText}\n timeZone={resolvedTimeZone}\n ref={inputMergedRef}\n onBlur={onBlur}\n placeholder={placeholder}\n disabled={disabled}\n readOnly={readOnly}\n invalid={isInvalid}\n testId={testId}\n />\n ) : (\n <Ark.Input\n ref={inputMergedRef}\n onBlur={onBlur}\n placeholder={placeholder}\n {...props({ \"data-testid\": testId })}\n className={inputControlClasses}\n />\n )}\n </div>\n ) : (\n <Ark.Trigger\n ref={triggerMergedRef}\n onBlur={onBlur}\n {...props({ \"aria-invalid\": isInvalid, \"data-testid\": testId })}\n className={cn(\n \"flex min-w-0 flex-1 cursor-pointer items-center bg-transparent text-start outline-none disabled:cursor-not-allowed\",\n shellGap[size],\n )}\n >\n <span className={inputSlot} aria-hidden>\n {startSlot ?? <CalendarIcon />}\n </span>\n <span className=\"min-w-0 flex-1 truncate text-start\">\n {isRange ? (\n api.value.length === 0 ? (\n <span className={placeholderColor}>{placeholder}</span>\n ) : (\n // Not `Ark.RangeText`: despite the name, it renders the calendar's\n // *visible* month/year viewport (the same text the header's ViewTrigger\n // shows), not the selected range — `datePicker.visibleRangeText` in Ark's\n // own source. Build the real selected-range text from `valueAsString`\n // instead (the same per-value formatted strings `Ark.ValueText` uses).\n api.valueAsString.join(\" – \")\n )\n ) : (\n <Ark.ValueText placeholder={placeholder} />\n )}\n </span>\n </Ark.Trigger>\n )}\n {clearable && (\n // Ark's own ClearTrigger already self-hides (`hidden`) while empty.\n <Ark.ClearTrigger className={popoverClearTrigger}>\n <CloseIcon />\n </Ark.ClearTrigger>\n )}\n </Ark.Control>\n\n {/* Holds an enclosing Modal/Drawer/Popover open while the calendar is; see `lib/overlay-layer.tsx`. */}\n <NestedLayer open={api.open} />\n <Portal disabled={!withinPortal} container={portalContainer}>\n <Ark.Positioner>\n <Ark.Content\n // `max-content` sizing (no `sameWidth`, see the positioning comment above)\n // means \"as if nothing below ever wraps\" — a `flex-wrap` time-row footer\n // wider than the calendar (two side-by-side \"Start time\"/\"End time\" rows\n // under `range` + `withTime`) would never actually wrap without a real width\n // constraint to shrink against; it'd just overflow off-screen on a narrow\n // viewport instead. `92vw` is generous enough to be a no-op on any normal\n // desktop width, only kicking in once there's genuinely no room.\n className={cn(\n popoverPanel,\n \"max-w-[92vw] flex-row flex-wrap items-stretch\",\n classNames?.content,\n )}\n >\n {presets && (\n <PresetsRail\n presets={presets}\n range={isRange}\n timeZone={resolvedTimeZone}\n locale={resolvedLocale}\n withConfirm={withConfirm}\n translations={translations?.presets}\n className={classNames?.presets}\n />\n )}\n <div\n className=\"flex min-w-0 flex-1 flex-col\"\n style={{\n width:\n Math.max(\n calendarGridWidth(size, numOfMonths),\n withTime ? timeRowMinWidth(size, resolvedHourCycle, withSeconds) : 0,\n ) + 16, // Take the x padding into account\n }}\n >\n <Popover.Body\n className={cn(\"p-2\", withTime || withConfirm ? \"border-b\" : undefined)}\n >\n <CalendarBody\n numOfMonths={numOfMonths}\n size={size}\n timeZone={resolvedTimeZone}\n classNames={classNames?.calendar}\n icons={icons}\n />\n </Popover.Body>\n {withTime && (\n <Popover.Footer\n className={cn(\n \"flex gap-x-2 gap-y-2 pb-2\",\n // Stacked by default — side by side only widens to match the extra\n // room multiple months already provide; with a single month, sitting\n // two time rows side by side would force the popover wider than the\n // calendar above them for no reason.\n numOfMonths > 1 ? \"flex-row flex-wrap\" : \"flex-col\",\n classNames?.footer,\n )}\n >\n <TimePanelRow\n value={api.value[0]}\n onSetTime={(time) => setTimeOrToday(api, time, 0, resolvedTimeZone)}\n label={isRange ? t.startTime : undefined}\n hourCycle={resolvedHourCycle}\n minuteStep={minuteStep}\n withSeconds={withSeconds}\n placeholder={timePlaceholder}\n locale={resolvedLocale}\n translations={translations}\n size={size}\n variant={variant}\n classNames={{ root: \"flex-1\", ...classNames?.timePanel }}\n />\n {isRange && (\n <TimePanelRow\n value={api.value[1]}\n onSetTime={(time) => api.setTime(time, 1)}\n label={t.endTime}\n disabled={api.value.length < 2}\n hourCycle={resolvedHourCycle}\n minuteStep={minuteStep}\n withSeconds={withSeconds}\n placeholder={timePlaceholder}\n locale={resolvedLocale}\n translations={translations}\n size={size}\n variant={variant}\n classNames={{ root: \"flex-1\", ...classNames?.timePanel }}\n />\n )}\n </Popover.Footer>\n )}\n {withConfirm && (\n <Popover.Footer className=\"flex justify-end gap-2 pb-2\">\n <Button\n variant=\"subtle\"\n color=\"neutral\"\n size={size}\n onClick={() => {\n setStaged(committed)\n api.setOpen(false)\n }}\n >\n {t.cancel}\n </Button>\n <Button\n size={size}\n onClick={() => {\n setCommitted(staged)\n api.setOpen(false)\n }}\n >\n {t.apply}\n </Button>\n </Popover.Footer>\n )}\n </div>\n </Ark.Content>\n </Ark.Positioner>\n </Portal>\n\n {name &&\n (isRange ? (\n <>\n <input\n type=\"hidden\"\n name={`${name}Start`}\n value={\n api.value[0] ? serializeDateValue(api.value[0], Boolean(withTime)) : \"\"\n }\n />\n <input\n type=\"hidden\"\n name={`${name}End`}\n value={\n api.value[1] ? serializeDateValue(api.value[1], Boolean(withTime)) : \"\"\n }\n />\n </>\n ) : (\n <input\n type=\"hidden\"\n name={name}\n value={api.value[0] ? serializeDateValue(api.value[0], Boolean(withTime)) : \"\"}\n />\n ))}\n </>\n )}\n </Ark.Context>\n </Ark.Root>\n </FieldShell>\n )\n}\n\nexport const DatePicker = Object.assign(DatePickerImpl, {\n Root: Ark.Root,\n Context: Ark.Context,\n Control: Ark.Control,\n Input: Ark.Input,\n Trigger: Ark.Trigger,\n ClearTrigger: Ark.ClearTrigger,\n Content: Ark.Content,\n Presets: PresetsRail,\n Calendar: CalendarBody,\n TimePanel: TimeRow,\n TimePanelRow: TimePanelRow,\n Footer: Popover.Footer,\n}) as (<Range extends boolean = false>(props: DatePickerProps<Range>) => ReactNode) & {\n Root: typeof Ark.Root\n Context: typeof Ark.Context\n Control: typeof Ark.Control\n Input: typeof Ark.Input\n Trigger: typeof Ark.Trigger\n ClearTrigger: typeof Ark.ClearTrigger\n Content: typeof Ark.Content\n Presets: typeof PresetsRail\n Calendar: typeof CalendarBody\n TimePanel: typeof TimeRow\n TimePanelRow: typeof TimePanelRow\n Footer: typeof Popover.Footer\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { SegmentGroup } from './chunk-NF2PBGD3.js';
1
+ import { SegmentGroup } from './chunk-IANYMDKH.js';
2
2
  import { NumberInput } from './chunk-SBZJGFZ6.js';
3
3
  import { cn } from './chunk-4ASNIDV7.js';
4
4
  import { useLocaleContext } from '@ark-ui/react/locale';
@@ -246,5 +246,5 @@ var TimeRow = ({
246
246
  };
247
247
 
248
248
  export { TimeRow, dayPeriodLabels, fromDisplayHour, is12Hour, resolveHourCycle, timeRowMinWidth, toDisplayHour };
249
- //# sourceMappingURL=chunk-ULF5LOBS.js.map
250
- //# sourceMappingURL=chunk-ULF5LOBS.js.map
249
+ //# sourceMappingURL=chunk-HMNXNKDA.js.map
250
+ //# sourceMappingURL=chunk-HMNXNKDA.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/time-input/hour-cycle.ts","../src/components/time-input/time-row.tsx"],"names":[],"mappings":";;;;;;;AAQO,IAAM,mBAAmB,CAAC;AAAA,EAC/B,MAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,KAIiB;AACf,EAAA,IAAI,WAAW,OAAO,SAAA;AACtB,EAAA,IAAI,MAAA,KAAW,MAAA,EAAW,OAAO,MAAA,KAAW,KAAK,KAAA,GAAQ,KAAA;AACzD,EAAA,OAAO,IAAA,CAAK,eAAe,MAAA,EAAQ,EAAE,MAAM,SAAA,EAAW,CAAA,CAAE,eAAA,EAAgB,CAAE,SAAA;AAC5E;AAGO,IAAM,QAAA,GAAW,CAAC,KAAA,KAA8B,KAAA,KAAU,SAAS,KAAA,KAAU;AAI7E,IAAM,WAAA,GAA+D;AAAA,EAC1E,GAAA,EAAK,EAAE,GAAA,EAAK,CAAA,EAAG,KAAK,EAAA,EAAG;AAAA,EACvB,GAAA,EAAK,EAAE,GAAA,EAAK,C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EJ;AAEJ","file":"chunk-ULF5LOBS.js","sourcesContent":["export type HourCycle = \"h11\" | \"h12\" | \"h23\" | \"h24\"\n\n/**\n * Resolve 12h vs 24h display (Req #6): an explicit `hourCycle` wins, then\n * `format`, else the locale's own convention via `Intl.DateTimeFormat`. Shared\n * by `TimeInput` and `DatePicker`'s embedded time panel so both pick the same\n * cycle for the same locale.\n */\nexport const resolveHourCycle = ({\n locale,\n format,\n hourCycle,\n}: {\n locale: string\n format?: 12 | 24\n hourCycle?: HourCycle\n}): HourCycle => {\n if (hourCycle) return hourCycle\n if (format !== undefined) return format === 12 ? \"h12\" : \"h23\"\n return Intl.DateTimeFormat(locale, { hour: \"numeric\" }).resolvedOptions().hourCycle as HourCycle\n}\n\n/** Whether a resolved cycle displays 12 hours + AM/PM (`h11`/`h12`) rather than all 24. */\nexport const is12Hour = (cycle: HourCycle): boolean => cycle === \"h11\" || cycle === \"h12\"\n\n/** The hours each cycle displays: `h11` 0–11, `h12` 1–12, `h23` 0–23, `h24` 1–24. In the two\n * cycles that start at 1, midnight (and, for `h12`, noon) reads as the top of the range. */\nexport const HOUR_RANGES: Record<HourCycle, { min: number; max: number }> = {\n h11: { min: 0, max: 11 },\n h12: { min: 1, max: 12 },\n h23: { min: 0, max: 23 },\n h24: { min: 1, max: 24 },\n}\n\n/** Convert a stored 24h hour (`0`–`23`) to the hour `cycle` displays, plus its period in the\n * 12-hour cycles (`null` otherwise) — e.g. midnight is `12` AM in `h12`, `0` AM in `h11`, `0` in\n * `h23` and `24` in `h24`. */\nexport const toDisplayHour = (\n hour24: number,\n cycle: HourCycle,\n): { hour: number; period: \"AM\" | \"PM\" | null } => {\n const twelveHour = is12Hour(cycle)\n const hour = twelveHour ? hour24 % 12 : hour24\n return {\n hour: hour === 0 && HOUR_RANGES[cycle].min === 1 ? HOUR_RANGES[cycle].max : hour,\n period: twelveHour ? (hour24 < 12 ? \"AM\" : \"PM\") : null,\n }\n}\n\n/** The inverse of `toDisplayHour`: a displayed hour (+ period in the 12-hour cycles) back to a\n * stored 24h hour. A missing hour reads as the start of its half of the day — midnight, or noon\n * once PM is picked — and a missing period as AM. */\nexport const fromDisplayHour = (\n hour: number | null,\n period: \"AM\" | \"PM\" | null,\n cycle: HourCycle,\n): number => {\n const offset = is12Hour(cycle) && period === \"PM\" ? 12 : 0\n if (hour === null) return offset\n return is12Hour(cycle) ? (hour % 12) + offset : hour % 24\n}\n\n/** Locale-correct AM/PM display strings (e.g. \"AM\"/\"PM\" en-US, \"午前\"/\"午後\" ja-JP), read via\n * `Intl.DateTimeFormat`'s own `dayPeriod` part rather than a hardcoded English literal. Keyed by\n * the same `\"AM\" | \"PM\"` domain value `toDisplayHour`/`fromDisplayHour` use throughout, so this only ever\n * changes what's *displayed*, never what's stored/serialized. */\nexport const dayPeriodLabels = (locale: string): Record<\"AM\" | \"PM\", string> => {\n const dayPeriod = (hour: number) =>\n new Intl.DateTimeFormat(locale, { hour: \"numeric\", hour12: true })\n .formatToParts(new Date(2000, 0, 1, hour))\n .find((part) => part.type === \"dayPeriod\")?.value ?? (hour < 12 ? \"AM\" : \"PM\")\n return { AM: dayPeriod(9), PM: dayPeriod(21) }\n}\n\n/** Locale-correct narrow unit abbreviations for the Hour/Minute/Second suffix (e.g. \"h\"/\"m\"/\"s\"\n * en-US, \"h\"/\"min\"/\"s\" fr-FR), read via `Intl.NumberFormat`'s own unit formatting rather than\n * hardcoded English literals. */\nconst UNIT_FALLBACK = { hour: \"h\", minute: \"m\", second: \"s\" } as const\n\nexport const timeUnitLabels = (\n locale: string,\n): { hour: string; minute: string; second: string } => {\n const unit = (u: \"hour\" | \"minute\" | \"second\") =>\n new Intl.NumberFormat(locale, { style: \"unit\", unit: u, unitDisplay: \"narrow\" })\n .formatToParts(1)\n .find((part) => part.type === \"unit\")?.value ?? UNIT_FALLBACK[u]\n return { hour: unit(\"hour\"), minute: unit(\"minute\"), second: unit(\"second\") }\n}\n","\"use client\"\n\nimport { useLocaleContext } from \"@ark-ui/react/locale\"\nimport type { FocusEvent, KeyboardEvent, Ref } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { InputVariant } from \"../input/input\"\nimport { NumberInput, type NumberInputTranslations } from \"../number-input/number-input\"\nimport { SegmentGroup } from \"../segment-group/segment-group\"\nimport {\n dayPeriodLabels,\n HOUR_RANGES,\n type HourCycle,\n is12Hour,\n timeUnitLabels,\n} from \"./hour-cycle\"\n\n/**\n * The HOUR/MINUTE (+ SECOND) + AM/PM row — the piece `TimeInput` wraps with\n * state, and `DatePicker`'s embedded time panel wraps with `api.setTime()`\n * (one implementation, two call sites). Operates entirely in *display* units\n * (the cycle's own hours — 0–11, 1–12, 0–23 or 1–24) — the always-24h stored `hour` conversion\n * happens at the caller's boundary, not here.\n */\n\ntype TimeRowClassNames = {\n hour?: string\n minute?: string\n second?: string\n period?: string\n}\n\n/** Overrides the sr-only accessible names for Hour/Minute/Second/Period — English by default.\n * Arbitrary microcopy with no locale-derivation path (unlike AM/PM and the unit suffixes,\n * which read from `Intl` instead). `incrementLabel`/`decrementLabel` are `NumberInput`'s own\n * keys, forwarded to each field's steppers (defaults `\"Increment\"` / `\"Decrement\"`). */\nexport type TimeRowTranslations = Pick<\n NumberInputTranslations,\n \"incrementLabel\" | \"decrementLabel\"\n> & {\n /** The whole row's group name when nothing visible labels it. Default `\"Time\"`. */\n time?: string\n hour?: string\n minute?: string\n second?: string\n period?: string\n}\n\n/** The row's English accessible names, merged once under `translations`. `NumberInput` keeps\n * its own stepper defaults. */\nconst TIME_ROW_DEFAULT_TRANSLATIONS = {\n time: \"Time\",\n hour: \"Hour\",\n minute: \"Minute\",\n second: \"Second\",\n period: \"Period\",\n} as const satisfies TimeRowTranslations\n\n/** Starting *and floor* size for the Hour/Minute/Second fields, per `size` — `flex-1`'s basis so\n * each field still grows to fill the row, plus an equal `min-width` so it never shrinks back\n * below that. Without the `min-width`, the field's inner `<input>` has `min-w-0` (needed so the\n * value can shrink instead of forcing the row to overflow when it's genuinely too narrow), which\n * otherwise lets `flex-1` starve it arbitrarily close to zero — that's exactly how the `<input>`\n * was measured shrinking to ~11px in a too-narrow `DatePicker` popover column, clipping the\n * 2-digit value. A too-narrow row now genuinely overflows (or wraps, if a wrapping ancestor\n * provides one) instead of silently clipping — the honest failure mode; `DatePicker`'s own\n * column-width fix (`timeRowMinWidth` below) is what actually prevents hitting it in practice.\n *\n * Calibrated against a real measurement, minus `shellGap`'s own per-size pixel value (6/6/8/10/12px\n * for xs/sm/md/lg/xl) — `NumberInput`'s value↔suffix pair no longer carries that gap (glued\n * together in their own nested row, see its own comment), so each field's true minimum content\n * width shrank by exactly that much. */\nexport const TIME_FIELD_BASIS_PX: Record<Size, number> = { xs: 64, sm: 72, md: 78, lg: 86, xl: 100 }\n/** The same widths as Tailwind classes, written out in full: Tailwind finds classes by scanning\n * source text (a consumer's build scans the shipped `dist`), so a class assembled from a template\n * literal is never generated. `time-row.test.ts` keeps these in step with `TIME_FIELD_BASIS_PX`. */\nexport const timeFieldBasis: Record<Size, string> = {\n xs: \"basis-[64px] min-w-[64px]\",\n sm: \"basis-[72px] min-w-[72px]\",\n md: \"basis-[78px] min-w-[78px]\",\n lg: \"basis-[86px] min-w-[86px]\",\n xl: \"basis-[100px] min-w-[100px]\",\n}\n\n/** The row's own gap between Hour/Minute/Second/Period (`gap-2` below) — flat across `size`,\n * unlike each field's *internal* value↔suffix↔steppers gap (`shellGap`, size-dependent). */\nconst ROW_GAP_PX = 8\n\n/** The AM/PM toggle's own natural (unstretched — it's `shrink-0`, not `flex-1`) rendered width\n * per `size`, measured directly rather than estimated. It wraps onto its own line below\n * Hour/Minute (the row's `flex-wrap` below) instead of forcing the whole row wider, so this\n * only matters for `timeRowMinWidth` as a floor *in case* it's ever wider than Hour+Minute\n * themselves — not as an unconditional addition to their combined width (see below). */\nconst PERIOD_WIDTH_PX: Record<Size, number> = { xs: 60, sm: 74, md: 88, lg: 110, xl: 133 }\n\n/** The row's own minimum rendered width for a given configuration. `DatePicker` uses this (see\n * its own `calendarColumnWidth` comment) to keep its popover column at least as wide as the\n * embedded time row needs, instead of only ever sizing off the calendar grid — otherwise the\n * row's `flex-1` + `min-w-0` fields silently shrink below their content size to fit.\n *\n * This is deliberately just Hour/Minute/[Second] at their basis plus the gaps *between* them —\n * not the AM/PM toggle's width added on top. The toggle wraps onto its own line (the row's\n * `flex-wrap` below) rather than forcing the row wider, so at a single narrow month it drops\n * below Hour/Minute instead of pushing the popover past the calendar's own width — the row only\n * needs to be as wide as the toggle itself in the (currently never hit — Hour+Minute together\n * are wider than the toggle at every size) case where that's the larger requirement. */\nexport const timeRowMinWidth = (\n size: Size,\n hourCycle: HourCycle,\n withSeconds: boolean | undefined,\n): number => {\n const fieldCount = 2 + (withSeconds ? 1 : 0)\n const fieldsWidth = fieldCount * TIME_FIELD_BASIS_PX[size] + (fieldCount - 1) * ROW_GAP_PX\n return is12Hour(hourCycle) ? Math.max(fieldsWidth, PERIOD_WIDTH_PX[size]) : fieldsWidth\n}\n\n/** ArrowLeft/ArrowRight at the edge of a field's text moves to the neighbouring field — caret at\n * its far side, so the motion reads as one continuous caret across the row — and from the last\n * number field \"next\" lands on the AM/PM toggle's checked (or first) radio. Inside the toggle the\n * arrows stay the radio group's own (switching AM/PM); Shift+Tab leaves it. `dir=\"rtl\"` mirrors\n * the keys, since the row's visual order is mirrored too. Anything else — a modifier, a\n * selection, a caret mid-text — keeps the native caret movement. */\nconst moveAcrossFields = (event: KeyboardEvent<HTMLDivElement>, dir: \"ltr\" | \"rtl\") => {\n if (event.key !== \"ArrowLeft\" && event.key !== \"ArrowRight\") return\n if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return\n const input = event.target\n if (!(input instanceof HTMLInputElement) || input.type !== \"text\") return\n const { selectionStart, selectionEnd, value } = input\n if (selectionStart !== selectionEnd) return\n const forward = (event.key === \"ArrowRight\") !== (dir === \"rtl\")\n if (forward ? selectionEnd !== value.length : selectionStart !== 0) return\n\n const row = event.currentTarget\n const fields = [...row.querySelectorAll<HTMLInputElement>('input[type=\"text\"]:not(:disabled)')]\n const next =\n fields[fields.indexOf(input) + (forward ? 1 : -1)] ??\n (forward\n ? (row.querySelector<HTMLInputElement>('input[type=\"radio\"]:checked:not(:disabled)') ??\n row.querySelector<HTMLInputElement>('input[type=\"radio\"]:not(:disabled)'))\n : null)\n if (!next) return\n event.preventDefault()\n next.focus()\n if (next.type === \"text\") {\n const caret = forward ? 0 : next.value.length\n next.setSelectionRange(caret, caret)\n }\n}\n\nexport type TimeRowProps = {\n hour: number | null\n minute: number | null\n second?: number | null\n onHourChange: (hour: number | null) => void\n onMinuteChange: (minute: number | null) => void\n onSecondChange?: (second: number | null) => void\n period: \"AM\" | \"PM\" | null\n onPeriodChange: (period: \"AM\" | \"PM\") => void\n hourCycle: HourCycle\n minuteStep?: number\n withSeconds?: boolean\n /** Placeholder shown in each empty Hour/Minute/Second field. Default `\"--\"`. */\n placeholder?: string\n /** Resolves the locale-correct AM/PM labels + Hour/Minute/Second unit suffixes via `Intl`.\n * Falls back to `useLocaleContext()` when omitted. */\n locale?: string\n /** Overrides the sr-only Hour/Minute/Second/Period accessible names. English by default. */\n translations?: TimeRowTranslations\n size?: Size\n variant?: InputVariant\n disabled?: boolean\n readOnly?: boolean\n invalid?: boolean\n /** Lands on the hour field's `<input>` for focus-on-error. */\n ref?: Ref<HTMLInputElement>\n /** Forwarded to the hour field's `<input>`; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n /** Names the row's `role=\"group\"` directly when no visible label points at it. Defaults to\n * `translations.time` (`\"Time\"`), so the group is never anonymous. */\n \"aria-label\"?: string\n /** Names the row's `role=\"group\"` from a visible label, e.g. `TimeInput`'s field label or\n * `DatePicker`'s \"Start time\" / \"End time\". Without a name a screen reader enters the group\n * hearing only \"Hour\". */\n \"aria-labelledby\"?: string\n /** Helper / error text read after the group's name. */\n \"aria-describedby\"?: string\n className?: string\n classNames?: TimeRowClassNames\n}\n\nexport const TimeRow = ({\n hour,\n minute,\n second,\n onHourChange,\n onMinuteChange,\n onSecondChange,\n period,\n onPeriodChange,\n hourCycle,\n minuteStep = 1,\n withSeconds,\n placeholder = \"--\",\n locale,\n translations,\n size = \"md\",\n variant = \"default\",\n disabled,\n readOnly,\n invalid,\n ref,\n onBlur,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n className,\n classNames,\n}: TimeRowProps) => {\n const { locale: contextLocale, dir } = useLocaleContext()\n const resolvedLocale = locale ?? contextLocale\n const twelveHour = is12Hour(hourCycle)\n const units = timeUnitLabels(resolvedLocale)\n const periodLabels = twelveHour ? dayPeriodLabels(resolvedLocale) : null\n const t = { ...TIME_ROW_DEFAULT_TRANSLATIONS, ...translations }\n\n return (\n // `flex-wrap`: at a single narrow month under `DatePicker`, Hour/Minute/[Second] fit the\n // calendar's own width but the AM/PM toggle doesn't (see `timeRowMinWidth`'s comment) — this\n // drops it to its own line there instead of forcing the whole popover wider than the\n // calendar to fit it on the same line. No visual change wherever there's already enough\n // width (every other context) — wrapping only kicks in once it's genuinely too narrow.\n // `role=\"group\"`: Hour/Minute/[Second]/Period are the parts of one time value — and the\n // row owns keyboard behaviour across them (`moveAcrossFields`), which a bare `<div>` can't.\n // biome-ignore lint/a11y/useSemanticElements: a `<fieldset>` brings UA border/padding/`min-inline-size` that fight this wrapping flex row, for the same `group` semantics\n <div\n role=\"group\"\n aria-label={ariaLabelledBy ? undefined : (ariaLabel ?? t.time)}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n className={cn(\"flex flex-wrap items-end gap-2\", className)}\n onKeyDown={(event) => moveAcrossFields(event, dir)}\n >\n <NumberInput\n ref={ref}\n onBlur={onBlur}\n label={t.hour}\n placeholder={placeholder}\n value={hour}\n onChange={onHourChange}\n min={HOUR_RANGES[hourCycle].min}\n max={HOUR_RANGES[hourCycle].max}\n step={1}\n wrap\n formatOptions={{ minimumIntegerDigits: 2 }}\n size={size}\n variant={variant}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n // \"Hour\" stays the accessible name (sr-only keeps it in the a11y tree,\n // just visually hidden) — the unit suffix is a decorative stand-in,\n // right next to the value once it's right-aligned (`text-end`).\n translations={t}\n suffix={units.hour}\n className={classNames?.hour}\n classNames={{\n field: cn(\"flex-1\", timeFieldBasis[size]),\n label: \"sr-only\",\n input: \"text-end\",\n }}\n />\n <NumberInput\n label={t.minute}\n placeholder={placeholder}\n value={minute}\n onChange={onMinuteChange}\n min={0}\n max={59}\n step={minuteStep}\n wrap\n formatOptions={{ minimumIntegerDigits: 2 }}\n size={size}\n variant={variant}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n translations={t}\n suffix={units.minute}\n className={classNames?.minute}\n classNames={{\n field: cn(\"flex-1\", timeFieldBasis[size]),\n label: \"sr-only\",\n input: \"text-end\",\n }}\n />\n {withSeconds && (\n <NumberInput\n label={t.second}\n placeholder={placeholder}\n value={second ?? null}\n onChange={onSecondChange}\n min={0}\n max={59}\n step={1}\n wrap\n formatOptions={{ minimumIntegerDigits: 2 }}\n size={size}\n variant={variant}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n translations={t}\n suffix={units.second}\n className={classNames?.second}\n classNames={{\n field: cn(\"flex-1\", timeFieldBasis[size]),\n label: \"sr-only\",\n input: \"text-end\",\n }}\n />\n )}\n {twelveHour && periodLabels && (\n <SegmentGroup\n data={[\n { value: \"AM\", label: periodLabels.AM },\n { value: \"PM\", label: periodLabels.PM },\n ]}\n label={t.period}\n value={period}\n onChange={(value) => onPeriodChange(value as \"AM\" | \"PM\")}\n // `SegmentGroup`'s sizes match `NumberInput`'s box height exactly, so\n // the AM/PM toggle sits flush with the Hour/Minute fields.\n size={size}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n className={classNames?.period}\n // Unlike Hour/Minute/Second, the AM/PM toggle has a fixed, small set of labels — it\n // doesn't need (or look right) stretching to share the row's leftover width. `w-auto`\n // cancels the Field wrapper's own default `w-full` (which would otherwise still set its\n // flex-basis to the full row width even without `flex-1`); `shrink-0` keeps it stable.\n // \"Period\" keeps the accessible name (sr-only) but no visible label or suffix — the\n // segment control itself already shows \"AM\"/\"PM\", self-descriptive.\n classNames={{ field: \"w-auto shrink-0\", label: \"sr-only\" }}\n />\n )}\n </div>\n )\n}\n"]}
1
+ {"version":3,"sources":["../src/components/time-input/hour-cycle.ts","../src/components/time-input/time-row.tsx"],"names":[],"mappings":";;;;;;;AAQO,IAAM,mBAAmB,CAAC;AAAA,EAC/B,MAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,KAIiB;AACf,EAAA,IAAI,WAAW,OAAO,SAAA;AACtB,EAAA,IAAI,MAAA,KAAW,MAAA,EAAW,OAAO,MAAA,KAAW,KAAK,KAAA,GAAQ,KAAA;AACzD,EAAA,OAAO,IAAA,CAAK,eAAe,MAAA,EAAQ,EAAE,MAAM,SAAA,EAAW,CAAA,CAAE,eAAA,EAAgB,CAAE,SAAA;AAC5E;AAGO,IAAM,QAAA,GAAW,CAAC,KAAA,KAA8B,KAAA,KAAU,SAAS,KAAA,KAAU;AAI7E,IAAM,WAAA,GAA+D;AAAA,EAC1E,GAAA,EAAK,EAAE,GAAA,EAAK,CAAA,EAAG,KAAK,EAAA,EAAG;AAAA,EACvB,GAAA,EAAK,EAAE,GAAA,EAAK,CAAA,EAAG,KAAK,EAAA,EAAG;AAAA,EACvB,GAAA,EAAK,EAAE,GAAA,EAAK,CAAA,EAAG,KAAK,EAAA,EAAG;AAAA,EACvB,GAAA,EAAK,EAAE,GAAA,EAAK,CAAA,EAAG,KAAK,EAAA;AACtB,CAAA;AAKO,IAAM,aAAA,GAAgB,CAC3B,MAAA,EACA,KAAA,KACiD;AACjD,EAAA,MAAM,UAAA,GAAa,SAAS,KAAK,CAAA;AACjC,EAAA,MAAM,IAAA,GAAO,UAAA,GAAa,MAAA,GAAS,EAAA,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AA,cACA,QAAA;AAAA,cACA,OAAA;AAAA,cACA,YAAA,EAAc,CAAA;AAAA,cACd,QAAQ,KAAA,CAAM,MAAA;AAAA,cACd,WAAW,UAAA,EAAY,MAAA;AAAA,cACvB,UAAA,EAAY;AAAA,gBACV,KAAA,EAAO,EAAA,CAAG,QAAA,EAAU,cAAA,CAAe,IAAI,CAAC,CAAA;AAAA,gBACxC,KAAA,EAAO,SAAA;AAAA,gBACP,KAAA,EAAO;AAAA;AACT;AAAA,WACF;AAAA,UAED,cAAc,YAAA,oBACb,GAAA;AAAA,YAAC,YAAA;AAAA,YAAA;AAAA,cACC,IAAA,EAAM;AAAA,gBACJ,EAAE,KAAA,EAAO,IAAA,EAAM,KAAA,EAAO,aAAa,EAAA,EAAG;AAAA,gBACtC,EAAE,KAAA,EAAO,IAAA,EAAM,KAAA,EAAO,aAAa,EAAA;AAAG,eACxC;AAAA,cACA,OAAO,CAAA,CAAE,MAAA;AAAA,cACT,KAAA,EAAO,MAAA;AAAA,cACP,QAAA,EAAU,CAAC,KAAA,KAAU,cAAA,CAAe,KAAoB,CAAA;AAAA,cAGxD,IAAA;AAAA,cACA,QAAA;AAAA,cACA,QAAA;AAAA,cACA,OAAA;AAAA,cACA,WAAW,UAAA,EAAY,MAAA;AAAA,cAOvB,UAAA,EAAY,EAAE,KAAA,EAAO,iBAAA,EAAmB,OAAO,SAAA;AAAU;AAAA;AAC3D;AAAA;AAAA;AAEJ;AAEJ","file":"chunk-HMNXNKDA.js","sourcesContent":["export type HourCycle = \"h11\" | \"h12\" | \"h23\" | \"h24\"\n\n/**\n * Resolve 12h vs 24h display (Req #6): an explicit `hourCycle` wins, then\n * `format`, else the locale's own convention via `Intl.DateTimeFormat`. Shared\n * by `TimeInput` and `DatePicker`'s embedded time panel so both pick the same\n * cycle for the same locale.\n */\nexport const resolveHourCycle = ({\n locale,\n format,\n hourCycle,\n}: {\n locale: string\n format?: 12 | 24\n hourCycle?: HourCycle\n}): HourCycle => {\n if (hourCycle) return hourCycle\n if (format !== undefined) return format === 12 ? \"h12\" : \"h23\"\n return Intl.DateTimeFormat(locale, { hour: \"numeric\" }).resolvedOptions().hourCycle as HourCycle\n}\n\n/** Whether a resolved cycle displays 12 hours + AM/PM (`h11`/`h12`) rather than all 24. */\nexport const is12Hour = (cycle: HourCycle): boolean => cycle === \"h11\" || cycle === \"h12\"\n\n/** The hours each cycle displays: `h11` 0–11, `h12` 1–12, `h23` 0–23, `h24` 1–24. In the two\n * cycles that start at 1, midnight (and, for `h12`, noon) reads as the top of the range. */\nexport const HOUR_RANGES: Record<HourCycle, { min: number; max: number }> = {\n h11: { min: 0, max: 11 },\n h12: { min: 1, max: 12 },\n h23: { min: 0, max: 23 },\n h24: { min: 1, max: 24 },\n}\n\n/** Convert a stored 24h hour (`0`–`23`) to the hour `cycle` displays, plus its period in the\n * 12-hour cycles (`null` otherwise) — e.g. midnight is `12` AM in `h12`, `0` AM in `h11`, `0` in\n * `h23` and `24` in `h24`. */\nexport const toDisplayHour = (\n hour24: number,\n cycle: HourCycle,\n): { hour: number; period: \"AM\" | \"PM\" | null } => {\n const twelveHour = is12Hour(cycle)\n const hour = twelveHour ? hour24 % 12 : hour24\n return {\n hour: hour === 0 && HOUR_RANGES[cycle].min === 1 ? HOUR_RANGES[cycle].max : hour,\n period: twelveHour ? (hour24 < 12 ? \"AM\" : \"PM\") : null,\n }\n}\n\n/** The inverse of `toDisplayHour`: a displayed hour (+ period in the 12-hour cycles) back to a\n * stored 24h hour. A missing hour reads as the start of its half of the day — midnight, or noon\n * once PM is picked — and a missing period as AM. */\nexport const fromDisplayHour = (\n hour: number | null,\n period: \"AM\" | \"PM\" | null,\n cycle: HourCycle,\n): number => {\n const offset = is12Hour(cycle) && period === \"PM\" ? 12 : 0\n if (hour === null) return offset\n return is12Hour(cycle) ? (hour % 12) + offset : hour % 24\n}\n\n/** Locale-correct AM/PM display strings (e.g. \"AM\"/\"PM\" en-US, \"午前\"/\"午後\" ja-JP), read via\n * `Intl.DateTimeFormat`'s own `dayPeriod` part rather than a hardcoded English literal. Keyed by\n * the same `\"AM\" | \"PM\"` domain value `toDisplayHour`/`fromDisplayHour` use throughout, so this only ever\n * changes what's *displayed*, never what's stored/serialized. */\nexport const dayPeriodLabels = (locale: string): Record<\"AM\" | \"PM\", string> => {\n const dayPeriod = (hour: number) =>\n new Intl.DateTimeFormat(locale, { hour: \"numeric\", hour12: true })\n .formatToParts(new Date(2000, 0, 1, hour))\n .find((part) => part.type === \"dayPeriod\")?.value ?? (hour < 12 ? \"AM\" : \"PM\")\n return { AM: dayPeriod(9), PM: dayPeriod(21) }\n}\n\n/** Locale-correct narrow unit abbreviations for the Hour/Minute/Second suffix (e.g. \"h\"/\"m\"/\"s\"\n * en-US, \"h\"/\"min\"/\"s\" fr-FR), read via `Intl.NumberFormat`'s own unit formatting rather than\n * hardcoded English literals. */\nconst UNIT_FALLBACK = { hour: \"h\", minute: \"m\", second: \"s\" } as const\n\nexport const timeUnitLabels = (\n locale: string,\n): { hour: string; minute: string; second: string } => {\n const unit = (u: \"hour\" | \"minute\" | \"second\") =>\n new Intl.NumberFormat(locale, { style: \"unit\", unit: u, unitDisplay: \"narrow\" })\n .formatToParts(1)\n .find((part) => part.type === \"unit\")?.value ?? UNIT_FALLBACK[u]\n return { hour: unit(\"hour\"), minute: unit(\"minute\"), second: unit(\"second\") }\n}\n","\"use client\"\n\nimport { useLocaleContext } from \"@ark-ui/react/locale\"\nimport type { FocusEvent, KeyboardEvent, Ref } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { InputVariant } from \"../input/input\"\nimport { NumberInput, type NumberInputTranslations } from \"../number-input/number-input\"\nimport { SegmentGroup } from \"../segment-group/segment-group\"\nimport {\n dayPeriodLabels,\n HOUR_RANGES,\n type HourCycle,\n is12Hour,\n timeUnitLabels,\n} from \"./hour-cycle\"\n\n/**\n * The HOUR/MINUTE (+ SECOND) + AM/PM row — the piece `TimeInput` wraps with\n * state, and `DatePicker`'s embedded time panel wraps with `api.setTime()`\n * (one implementation, two call sites). Operates entirely in *display* units\n * (the cycle's own hours — 0–11, 1–12, 0–23 or 1–24) — the always-24h stored `hour` conversion\n * happens at the caller's boundary, not here.\n */\n\ntype TimeRowClassNames = {\n hour?: string\n minute?: string\n second?: string\n period?: string\n}\n\n/** Overrides the sr-only accessible names for Hour/Minute/Second/Period — English by default.\n * Arbitrary microcopy with no locale-derivation path (unlike AM/PM and the unit suffixes,\n * which read from `Intl` instead). `incrementLabel`/`decrementLabel` are `NumberInput`'s own\n * keys, forwarded to each field's steppers (defaults `\"Increment\"` / `\"Decrement\"`). */\nexport type TimeRowTranslations = Pick<\n NumberInputTranslations,\n \"incrementLabel\" | \"decrementLabel\"\n> & {\n /** The whole row's group name when nothing visible labels it. Default `\"Time\"`. */\n time?: string\n hour?: string\n minute?: string\n second?: string\n period?: string\n}\n\n/** The row's English accessible names, merged once under `translations`. `NumberInput` keeps\n * its own stepper defaults. */\nconst TIME_ROW_DEFAULT_TRANSLATIONS = {\n time: \"Time\",\n hour: \"Hour\",\n minute: \"Minute\",\n second: \"Second\",\n period: \"Period\",\n} as const satisfies TimeRowTranslations\n\n/** Starting *and floor* size for the Hour/Minute/Second fields, per `size` — `flex-1`'s basis so\n * each field still grows to fill the row, plus an equal `min-width` so it never shrinks back\n * below that. Without the `min-width`, the field's inner `<input>` has `min-w-0` (needed so the\n * value can shrink instead of forcing the row to overflow when it's genuinely too narrow), which\n * otherwise lets `flex-1` starve it arbitrarily close to zero — that's exactly how the `<input>`\n * was measured shrinking to ~11px in a too-narrow `DatePicker` popover column, clipping the\n * 2-digit value. A too-narrow row now genuinely overflows (or wraps, if a wrapping ancestor\n * provides one) instead of silently clipping — the honest failure mode; `DatePicker`'s own\n * column-width fix (`timeRowMinWidth` below) is what actually prevents hitting it in practice.\n *\n * Calibrated against a real measurement, minus `shellGap`'s own per-size pixel value (6/6/8/10/12px\n * for xs/sm/md/lg/xl) — `NumberInput`'s value↔suffix pair no longer carries that gap (glued\n * together in their own nested row, see its own comment), so each field's true minimum content\n * width shrank by exactly that much. */\nexport const TIME_FIELD_BASIS_PX: Record<Size, number> = { xs: 64, sm: 72, md: 78, lg: 86, xl: 100 }\n/** The same widths as Tailwind classes, written out in full: Tailwind finds classes by scanning\n * source text (a consumer's build scans the shipped `dist`), so a class assembled from a template\n * literal is never generated. `time-row.test.ts` keeps these in step with `TIME_FIELD_BASIS_PX`. */\nexport const timeFieldBasis: Record<Size, string> = {\n xs: \"basis-[64px] min-w-[64px]\",\n sm: \"basis-[72px] min-w-[72px]\",\n md: \"basis-[78px] min-w-[78px]\",\n lg: \"basis-[86px] min-w-[86px]\",\n xl: \"basis-[100px] min-w-[100px]\",\n}\n\n/** The row's own gap between Hour/Minute/Second/Period (`gap-2` below) — flat across `size`,\n * unlike each field's *internal* value↔suffix↔steppers gap (`shellGap`, size-dependent). */\nconst ROW_GAP_PX = 8\n\n/** The AM/PM toggle's own natural (unstretched — it's `shrink-0`, not `flex-1`) rendered width\n * per `size`, measured directly rather than estimated. It wraps onto its own line below\n * Hour/Minute (the row's `flex-wrap` below) instead of forcing the whole row wider, so this\n * only matters for `timeRowMinWidth` as a floor *in case* it's ever wider than Hour+Minute\n * themselves — not as an unconditional addition to their combined width (see below). */\nconst PERIOD_WIDTH_PX: Record<Size, number> = { xs: 60, sm: 74, md: 88, lg: 110, xl: 133 }\n\n/** The row's own minimum rendered width for a given configuration. `DatePicker` uses this (see\n * its own `calendarColumnWidth` comment) to keep its popover column at least as wide as the\n * embedded time row needs, instead of only ever sizing off the calendar grid — otherwise the\n * row's `flex-1` + `min-w-0` fields silently shrink below their content size to fit.\n *\n * This is deliberately just Hour/Minute/[Second] at their basis plus the gaps *between* them —\n * not the AM/PM toggle's width added on top. The toggle wraps onto its own line (the row's\n * `flex-wrap` below) rather than forcing the row wider, so at a single narrow month it drops\n * below Hour/Minute instead of pushing the popover past the calendar's own width — the row only\n * needs to be as wide as the toggle itself in the (currently never hit — Hour+Minute together\n * are wider than the toggle at every size) case where that's the larger requirement. */\nexport const timeRowMinWidth = (\n size: Size,\n hourCycle: HourCycle,\n withSeconds: boolean | undefined,\n): number => {\n const fieldCount = 2 + (withSeconds ? 1 : 0)\n const fieldsWidth = fieldCount * TIME_FIELD_BASIS_PX[size] + (fieldCount - 1) * ROW_GAP_PX\n return is12Hour(hourCycle) ? Math.max(fieldsWidth, PERIOD_WIDTH_PX[size]) : fieldsWidth\n}\n\n/** ArrowLeft/ArrowRight at the edge of a field's text moves to the neighbouring field — caret at\n * its far side, so the motion reads as one continuous caret across the row — and from the last\n * number field \"next\" lands on the AM/PM toggle's checked (or first) radio. Inside the toggle the\n * arrows stay the radio group's own (switching AM/PM); Shift+Tab leaves it. `dir=\"rtl\"` mirrors\n * the keys, since the row's visual order is mirrored too. Anything else — a modifier, a\n * selection, a caret mid-text — keeps the native caret movement. */\nconst moveAcrossFields = (event: KeyboardEvent<HTMLDivElement>, dir: \"ltr\" | \"rtl\") => {\n if (event.key !== \"ArrowLeft\" && event.key !== \"ArrowRight\") return\n if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return\n const input = event.target\n if (!(input instanceof HTMLInputElement) || input.type !== \"text\") return\n const { selectionStart, selectionEnd, value } = input\n if (selectionStart !== selectionEnd) return\n const forward = (event.key === \"ArrowRight\") !== (dir === \"rtl\")\n if (forward ? selectionEnd !== value.length : selectionStart !== 0) return\n\n const row = event.currentTarget\n const fields = [...row.querySelectorAll<HTMLInputElement>('input[type=\"text\"]:not(:disabled)')]\n const next =\n fields[fields.indexOf(input) + (forward ? 1 : -1)] ??\n (forward\n ? (row.querySelector<HTMLInputElement>('input[type=\"radio\"]:checked:not(:disabled)') ??\n row.querySelector<HTMLInputElement>('input[type=\"radio\"]:not(:disabled)'))\n : null)\n if (!next) return\n event.preventDefault()\n next.focus()\n if (next.type === \"text\") {\n const caret = forward ? 0 : next.value.length\n next.setSelectionRange(caret, caret)\n }\n}\n\nexport type TimeRowProps = {\n hour: number | null\n minute: number | null\n second?: number | null\n onHourChange: (hour: number | null) => void\n onMinuteChange: (minute: number | null) => void\n onSecondChange?: (second: number | null) => void\n period: \"AM\" | \"PM\" | null\n onPeriodChange: (period: \"AM\" | \"PM\") => void\n hourCycle: HourCycle\n minuteStep?: number\n withSeconds?: boolean\n /** Placeholder shown in each empty Hour/Minute/Second field. Default `\"--\"`. */\n placeholder?: string\n /** Resolves the locale-correct AM/PM labels + Hour/Minute/Second unit suffixes via `Intl`.\n * Falls back to `useLocaleContext()` when omitted. */\n locale?: string\n /** Overrides the sr-only Hour/Minute/Second/Period accessible names. English by default. */\n translations?: TimeRowTranslations\n size?: Size\n variant?: InputVariant\n disabled?: boolean\n readOnly?: boolean\n invalid?: boolean\n /** Lands on the hour field's `<input>` for focus-on-error. */\n ref?: Ref<HTMLInputElement>\n /** Forwarded to the hour field's `<input>`; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n /** Names the row's `role=\"group\"` directly when no visible label points at it. Defaults to\n * `translations.time` (`\"Time\"`), so the group is never anonymous. */\n \"aria-label\"?: string\n /** Names the row's `role=\"group\"` from a visible label, e.g. `TimeInput`'s field label or\n * `DatePicker`'s \"Start time\" / \"End time\". Without a name a screen reader enters the group\n * hearing only \"Hour\". */\n \"aria-labelledby\"?: string\n /** Helper / error text read after the group's name. */\n \"aria-describedby\"?: string\n className?: string\n classNames?: TimeRowClassNames\n}\n\nexport const TimeRow = ({\n hour,\n minute,\n second,\n onHourChange,\n onMinuteChange,\n onSecondChange,\n period,\n onPeriodChange,\n hourCycle,\n minuteStep = 1,\n withSeconds,\n placeholder = \"--\",\n locale,\n translations,\n size = \"md\",\n variant = \"default\",\n disabled,\n readOnly,\n invalid,\n ref,\n onBlur,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n className,\n classNames,\n}: TimeRowProps) => {\n const { locale: contextLocale, dir } = useLocaleContext()\n const resolvedLocale = locale ?? contextLocale\n const twelveHour = is12Hour(hourCycle)\n const units = timeUnitLabels(resolvedLocale)\n const periodLabels = twelveHour ? dayPeriodLabels(resolvedLocale) : null\n const t = { ...TIME_ROW_DEFAULT_TRANSLATIONS, ...translations }\n\n return (\n // `flex-wrap`: at a single narrow month under `DatePicker`, Hour/Minute/[Second] fit the\n // calendar's own width but the AM/PM toggle doesn't (see `timeRowMinWidth`'s comment) — this\n // drops it to its own line there instead of forcing the whole popover wider than the\n // calendar to fit it on the same line. No visual change wherever there's already enough\n // width (every other context) — wrapping only kicks in once it's genuinely too narrow.\n // `role=\"group\"`: Hour/Minute/[Second]/Period are the parts of one time value — and the\n // row owns keyboard behaviour across them (`moveAcrossFields`), which a bare `<div>` can't.\n // biome-ignore lint/a11y/useSemanticElements: a `<fieldset>` brings UA border/padding/`min-inline-size` that fight this wrapping flex row, for the same `group` semantics\n <div\n role=\"group\"\n aria-label={ariaLabelledBy ? undefined : (ariaLabel ?? t.time)}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n className={cn(\"flex flex-wrap items-end gap-2\", className)}\n onKeyDown={(event) => moveAcrossFields(event, dir)}\n >\n <NumberInput\n ref={ref}\n onBlur={onBlur}\n label={t.hour}\n placeholder={placeholder}\n value={hour}\n onChange={onHourChange}\n min={HOUR_RANGES[hourCycle].min}\n max={HOUR_RANGES[hourCycle].max}\n step={1}\n wrap\n formatOptions={{ minimumIntegerDigits: 2 }}\n size={size}\n variant={variant}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n // \"Hour\" stays the accessible name (sr-only keeps it in the a11y tree,\n // just visually hidden) — the unit suffix is a decorative stand-in,\n // right next to the value once it's right-aligned (`text-end`).\n translations={t}\n suffix={units.hour}\n className={classNames?.hour}\n classNames={{\n field: cn(\"flex-1\", timeFieldBasis[size]),\n label: \"sr-only\",\n input: \"text-end\",\n }}\n />\n <NumberInput\n label={t.minute}\n placeholder={placeholder}\n value={minute}\n onChange={onMinuteChange}\n min={0}\n max={59}\n step={minuteStep}\n wrap\n formatOptions={{ minimumIntegerDigits: 2 }}\n size={size}\n variant={variant}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n translations={t}\n suffix={units.minute}\n className={classNames?.minute}\n classNames={{\n field: cn(\"flex-1\", timeFieldBasis[size]),\n label: \"sr-only\",\n input: \"text-end\",\n }}\n />\n {withSeconds && (\n <NumberInput\n label={t.second}\n placeholder={placeholder}\n value={second ?? null}\n onChange={onSecondChange}\n min={0}\n max={59}\n step={1}\n wrap\n formatOptions={{ minimumIntegerDigits: 2 }}\n size={size}\n variant={variant}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n translations={t}\n suffix={units.second}\n className={classNames?.second}\n classNames={{\n field: cn(\"flex-1\", timeFieldBasis[size]),\n label: \"sr-only\",\n input: \"text-end\",\n }}\n />\n )}\n {twelveHour && periodLabels && (\n <SegmentGroup\n data={[\n { value: \"AM\", label: periodLabels.AM },\n { value: \"PM\", label: periodLabels.PM },\n ]}\n label={t.period}\n value={period}\n onChange={(value) => onPeriodChange(value as \"AM\" | \"PM\")}\n // `SegmentGroup`'s sizes match `NumberInput`'s box height exactly, so\n // the AM/PM toggle sits flush with the Hour/Minute fields.\n size={size}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n className={classNames?.period}\n // Unlike Hour/Minute/Second, the AM/PM toggle has a fixed, small set of labels — it\n // doesn't need (or look right) stretching to share the row's leftover width. `w-auto`\n // cancels the Field wrapper's own default `w-full` (which would otherwise still set its\n // flex-basis to the full row width even without `flex-1`); `shrink-0` keeps it stable.\n // \"Period\" keeps the accessible name (sr-only) but no visible label or suffix — the\n // segment control itself already shows \"AM\"/\"PM\", self-descriptive.\n classNames={{ field: \"w-auto shrink-0\", label: \"sr-only\" }}\n />\n )}\n </div>\n )\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { FieldShell, fieldA11yProps } from './chunk-X6DESK37.js';
2
2
  import { useMergedRefs } from './chunk-HBWV5EPU.js';
3
- import { useDirectionCheck } from './chunk-IUK7OJXZ.js';
3
+ import { useDirectionCheck } from './chunk-OBSZ4NE2.js';
4
4
  import { useUncontrolled } from './chunk-PMUCGFY5.js';
5
5
  import { props } from './chunk-WYCMIIRR.js';
6
6
  import { TEXT_COLOR_CLASSES } from './chunk-GIPQUKCN.js';
@@ -311,5 +311,5 @@ var SegmentGroup = ({
311
311
  };
312
312
 
313
313
  export { SegmentGroup };
314
- //# sourceMappingURL=chunk-NF2PBGD3.js.map
315
- //# sourceMappingURL=chunk-NF2PBGD3.js.map
314
+ //# sourceMappingURL=chunk-IANYMDKH.js.map
315
+ //# sourceMappingURL=chunk-IANYMDKH.js.map