@42-central/ui-react 0.20.2 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/dist/{chunk-45QRQKRC.js → chunk-3L5GLI67.js} +12 -8
  2. package/dist/chunk-3L5GLI67.js.map +1 -0
  3. package/dist/{chunk-C74TV64U.js → chunk-4FEOMQYR.js} +4 -4
  4. package/dist/{chunk-C74TV64U.js.map → chunk-4FEOMQYR.js.map} +1 -1
  5. package/dist/{chunk-LFQDB5OD.js → chunk-D3JYDAUZ.js} +3 -3
  6. package/dist/{chunk-LFQDB5OD.js.map → chunk-D3JYDAUZ.js.map} +1 -1
  7. package/dist/{chunk-UVQXRDRO.js → chunk-DHJB4UJD.js} +3 -3
  8. package/dist/{chunk-UVQXRDRO.js.map → chunk-DHJB4UJD.js.map} +1 -1
  9. package/dist/{chunk-UCCJUFOG.js → chunk-F2FSHVO5.js} +3 -3
  10. package/dist/{chunk-UCCJUFOG.js.map → chunk-F2FSHVO5.js.map} +1 -1
  11. package/dist/{chunk-Z4MBCKG5.js → chunk-FB2G4LNH.js} +4 -4
  12. package/dist/{chunk-Z4MBCKG5.js.map → chunk-FB2G4LNH.js.map} +1 -1
  13. package/dist/{chunk-FDCPMUJK.js → chunk-IRNF274I.js} +3 -3
  14. package/dist/chunk-IRNF274I.js.map +1 -0
  15. package/dist/{chunk-O5W3QWJ6.js → chunk-J44FJ7PH.js} +3 -3
  16. package/dist/{chunk-O5W3QWJ6.js.map → chunk-J44FJ7PH.js.map} +1 -1
  17. package/dist/{chunk-WXL5RP6P.js → chunk-MRAJ45IM.js} +3 -3
  18. package/dist/{chunk-WXL5RP6P.js.map → chunk-MRAJ45IM.js.map} +1 -1
  19. package/dist/{chunk-45TG7H5Q.js → chunk-OZMSXYBX.js} +3 -3
  20. package/dist/{chunk-45TG7H5Q.js.map → chunk-OZMSXYBX.js.map} +1 -1
  21. package/dist/{chunk-37VQGKD6.js → chunk-SZEOTXRZ.js} +4 -4
  22. package/dist/{chunk-37VQGKD6.js.map → chunk-SZEOTXRZ.js.map} +1 -1
  23. package/dist/{chunk-2BNIHOMT.js → chunk-YPFSRZ3T.js} +3 -3
  24. package/dist/{chunk-2BNIHOMT.js.map → chunk-YPFSRZ3T.js.map} +1 -1
  25. package/dist/{chunk-5CNVVA7I.js → chunk-YWTOW7PZ.js} +4 -4
  26. package/dist/{chunk-5CNVVA7I.js.map → chunk-YWTOW7PZ.js.map} +1 -1
  27. package/dist/components/autocomplete/index.js +2 -2
  28. package/dist/components/calendar-heatmap/calendar-heatmap-grid.d.ts +94 -0
  29. package/dist/components/calendar-heatmap/calendar-heatmap-grid.d.ts.map +1 -0
  30. package/dist/components/calendar-heatmap/calendar-heatmap.d.ts +76 -0
  31. package/dist/components/calendar-heatmap/calendar-heatmap.d.ts.map +1 -0
  32. package/dist/components/calendar-heatmap/index.d.ts +2 -0
  33. package/dist/components/calendar-heatmap/index.d.ts.map +1 -0
  34. package/dist/components/calendar-heatmap/index.js +311 -0
  35. package/dist/components/calendar-heatmap/index.js.map +1 -0
  36. package/dist/components/camera/index.js +4 -4
  37. package/dist/components/clipboard/index.js +1 -1
  38. package/dist/components/combobox/index.js +2 -2
  39. package/dist/components/combobox-list/index.js +4 -4
  40. package/dist/components/data-table/index.js +13 -13
  41. package/dist/components/date-picker/index.js +5 -5
  42. package/dist/components/geodesic/a11y.d.ts +15 -0
  43. package/dist/components/geodesic/a11y.d.ts.map +1 -0
  44. package/dist/components/geodesic/activity-badge.d.ts +5 -0
  45. package/dist/components/geodesic/activity-badge.d.ts.map +1 -0
  46. package/dist/components/geodesic/badge-frame.d.ts +60 -0
  47. package/dist/components/geodesic/badge-frame.d.ts.map +1 -0
  48. package/dist/components/geodesic/exam-badge.d.ts +5 -0
  49. package/dist/components/geodesic/exam-badge.d.ts.map +1 -0
  50. package/dist/components/geodesic/geometry.d.ts +1089 -0
  51. package/dist/components/geodesic/geometry.d.ts.map +1 -0
  52. package/dist/components/geodesic/gift-box-badge.d.ts +5 -0
  53. package/dist/components/geodesic/gift-box-badge.d.ts.map +1 -0
  54. package/dist/components/geodesic/gift-token.d.ts +23 -0
  55. package/dist/components/geodesic/gift-token.d.ts.map +1 -0
  56. package/dist/components/geodesic/glyph-slot.d.ts +8 -0
  57. package/dist/components/geodesic/glyph-slot.d.ts.map +1 -0
  58. package/dist/components/geodesic/index.d.ts +12 -0
  59. package/dist/components/geodesic/index.d.ts.map +1 -0
  60. package/dist/components/geodesic/index.js +917 -0
  61. package/dist/components/geodesic/index.js.map +1 -0
  62. package/dist/components/geodesic/module-badge.d.ts +5 -0
  63. package/dist/components/geodesic/module-badge.d.ts.map +1 -0
  64. package/dist/components/geodesic/planet.d.ts +30 -0
  65. package/dist/components/geodesic/planet.d.ts.map +1 -0
  66. package/dist/components/geodesic/project-badge.d.ts +5 -0
  67. package/dist/components/geodesic/project-badge.d.ts.map +1 -0
  68. package/dist/components/geodesic/skill-badge.d.ts +5 -0
  69. package/dist/components/geodesic/skill-badge.d.ts.map +1 -0
  70. package/dist/components/geodesic/social-badge.d.ts +8 -0
  71. package/dist/components/geodesic/social-badge.d.ts.map +1 -0
  72. package/dist/components/geodesic/status.d.ts +80 -0
  73. package/dist/components/geodesic/status.d.ts.map +1 -0
  74. package/dist/components/geodesic/styles.css +146 -0
  75. package/dist/components/input/index.js +1 -1
  76. package/dist/components/input/input.d.ts.map +1 -1
  77. package/dist/components/menu/index.js +1 -1
  78. package/dist/components/menu/menu.d.ts +7 -5
  79. package/dist/components/menu/menu.d.ts.map +1 -1
  80. package/dist/components/multi-combobox-list/index.js +4 -4
  81. package/dist/components/multi-select/index.js +3 -3
  82. package/dist/components/navigation-progress/index.d.ts +2 -0
  83. package/dist/components/navigation-progress/index.d.ts.map +1 -0
  84. package/dist/components/navigation-progress/index.js +133 -0
  85. package/dist/components/navigation-progress/index.js.map +1 -0
  86. package/dist/components/navigation-progress/navigation-progress.d.ts +46 -0
  87. package/dist/components/navigation-progress/navigation-progress.d.ts.map +1 -0
  88. package/dist/components/number-input/index.js +2 -2
  89. package/dist/components/number-input/number-input.d.ts.map +1 -1
  90. package/dist/components/password-input/index.js +1 -1
  91. package/dist/components/photo-capture/index.js +4 -4
  92. package/dist/components/pills-input/index.js +2 -2
  93. package/dist/components/pin-input/index.js +1 -1
  94. package/dist/components/select/index.js +3 -3
  95. package/dist/components/spotlight/index.js +3 -3
  96. package/dist/components/tags-input/index.js +2 -2
  97. package/dist/components/text-input/index.js +1 -1
  98. package/dist/components/textarea/index.js +1 -1
  99. package/dist/components/time-input/index.js +3 -3
  100. package/dist/components/tree-multi-select/index.js +3 -3
  101. package/dist/components/tree-select/index.js +2 -2
  102. package/dist/index.js +2 -2
  103. package/package.json +2 -1
  104. package/src/as-child.contract.test.tsx +6 -0
  105. package/src/components/calendar-heatmap/calendar-heatmap-grid.test.ts +186 -0
  106. package/src/components/calendar-heatmap/calendar-heatmap-grid.ts +192 -0
  107. package/src/components/calendar-heatmap/calendar-heatmap.test.tsx +180 -0
  108. package/src/components/calendar-heatmap/calendar-heatmap.tsx +385 -0
  109. package/src/components/calendar-heatmap/index.ts +11 -0
  110. package/src/components/geodesic/a11y.ts +10 -0
  111. package/src/components/geodesic/activity-badge.tsx +17 -0
  112. package/src/components/geodesic/badge-frame.tsx +324 -0
  113. package/src/components/geodesic/exam-badge.tsx +17 -0
  114. package/src/components/geodesic/geometry.test.ts +60 -0
  115. package/src/components/geodesic/geometry.ts +367 -0
  116. package/src/components/geodesic/gift-box-badge.tsx +17 -0
  117. package/src/components/geodesic/gift-token.tsx +104 -0
  118. package/src/components/geodesic/glyph-slot.tsx +28 -0
  119. package/src/components/geodesic/index.ts +13 -0
  120. package/src/components/geodesic/module-badge.tsx +17 -0
  121. package/src/components/geodesic/planet.tsx +131 -0
  122. package/src/components/geodesic/project-badge.tsx +17 -0
  123. package/src/components/geodesic/skill-badge.tsx +17 -0
  124. package/src/components/geodesic/social-badge.tsx +21 -0
  125. package/src/components/geodesic/status.test.ts +66 -0
  126. package/src/components/geodesic/status.ts +176 -0
  127. package/src/components/geodesic/styles.css +146 -0
  128. package/src/components/input/input.test.tsx +23 -0
  129. package/src/components/input/input.tsx +10 -6
  130. package/src/components/menu/menu.tsx +16 -9
  131. package/src/components/navigation-progress/index.ts +14 -0
  132. package/src/components/navigation-progress/navigation-progress.test.tsx +184 -0
  133. package/src/components/navigation-progress/navigation-progress.tsx +228 -0
  134. package/src/components/number-input/number-input.tsx +3 -4
  135. package/src/icon-stroke.test.tsx +5 -0
  136. package/dist/chunk-45QRQKRC.js.map +0 -1
  137. package/dist/chunk-FDCPMUJK.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,QAAQ,CAAA,CAAE,MAAA,CAAO,mBAAA,CAAoB,KAAA,EAAO,QAAQ,CAAC,CAAA;AAGrF,IAAM,cAAA,mBAAiB,IAAI,GAAA,CAAY,CAAC,MAAA,EAAQ,SAAS,KAAA,EAAO,MAAA,EAAQ,QAAA,EAAU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AAA;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-5CNVVA7I.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,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,G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.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,8 +1,8 @@
1
1
  "use client";
2
2
  import { normalizeSelectData, useLabelSearch, filterSelectData } from '../../chunk-7TDHT3QD.js';
3
+ import { resolveComboboxTranslations, Combobox } from '../../chunk-YPFSRZ3T.js';
3
4
  import { controlOpenProps } from '../../chunk-5FDOOG4J.js';
4
- import { resolveComboboxTranslations, Combobox } from '../../chunk-2BNIHOMT.js';
5
- import { inputControlClasses, inputSlot } from '../../chunk-45QRQKRC.js';
5
+ import { inputControlClasses, inputSlot } from '../../chunk-3L5GLI67.js';
6
6
  import { FieldShell } from '../../chunk-VD6PB3VA.js';
7
7
  import { popoverClearTrigger } from '../../chunk-N66NC6QK.js';
8
8
  import '../../chunk-V6PY7C6S.js';
@@ -0,0 +1,94 @@
1
+ import { type CalendarDate } from "@internationalized/date";
2
+ import type { FirstDayOfWeek } from "../schedule/schedule-types";
3
+ /**
4
+ * The calendar heatmap's layout, kept free of React so every edge (week start,
5
+ * a range starting mid-week, DST, time zones) is tested as plain data.
6
+ *
7
+ * All arithmetic is on `CalendarDate`, a zone-free wall-calendar day, so a
8
+ * 23- or 25-hour DST day is still exactly one day. `timeZone` is only read at
9
+ * the two crossings: bucketing the consumer's `Date` instants into days, and
10
+ * turning each day back into the `Date` handed to callbacks and formatters.
11
+ */
12
+ export type CalendarHeatmapDatum = {
13
+ date: Date;
14
+ value: number;
15
+ };
16
+ /** Lower bounds of levels 1–4, ascending. A value below the first is level 0. */
17
+ export type CalendarHeatmapThresholds = readonly [number] | readonly [number, number] | readonly [number, number, number] | readonly [number, number, number, number];
18
+ export type HeatmapDay = {
19
+ /** Midnight of the day, in the heatmap's time zone. */
20
+ date: Date;
21
+ /** `YYYY-MM-DD`: a stable key, and the cell's `data-date`. */
22
+ key: string;
23
+ value: number;
24
+ /** 0 for nothing, else 1–4 on the four-step ramp (see `intensity`). */
25
+ level: number;
26
+ };
27
+ export type HeatmapLayout = {
28
+ /** One column per week, seven slots each. `null` pads the days outside the range. */
29
+ weeks: (HeatmapDay | null)[][];
30
+ /** The column each month label sits above. */
31
+ months: {
32
+ column: number;
33
+ date: Date;
34
+ }[];
35
+ /** The first week's seven days, one per row, for the weekday labels. */
36
+ weekdays: Date[];
37
+ /** The thresholds actually applied, after defaulting. */
38
+ thresholds: readonly number[];
39
+ first: CalendarDate;
40
+ last: CalendarDate;
41
+ };
42
+ export declare const toDay: (date: Date, timeZone: string) => CalendarDate;
43
+ /** The year ending on `now`'s day: 365 or 366 days, today last. */
44
+ export declare function defaultRange(now: Date, timeZone: string): {
45
+ start: Date;
46
+ end: Date;
47
+ };
48
+ /**
49
+ * GitHub's split: the busiest day's value cut into quarters, so each level
50
+ * covers a quarter of the range. Duplicates collapse, so a sparse dataset
51
+ * (a maximum of 2) gets two levels rather than four that all mean "1 or 2".
52
+ * Counts are whole numbers, so the bounds are too: data on another scale
53
+ * (hours, a score) passes its own `thresholds`.
54
+ */
55
+ export declare function defaultThresholds(max: number): readonly number[];
56
+ /** How many of `thresholds` the value reaches: 0 below the first. */
57
+ export declare const levelOf: (value: number, thresholds: readonly number[]) => number;
58
+ /**
59
+ * Which of the four color steps a level paints with. With fewer than four
60
+ * levels they spread across the ramp, ending on the strongest, so the
61
+ * busiest days always read as the full color.
62
+ */
63
+ export declare const intensity: (level: number, levels: number) => number;
64
+ /** Each level's value range, for the legend. `max` is `null` on the open top level. */
65
+ export declare function legendLevels(thresholds: readonly number[]): {
66
+ level: number;
67
+ min: number;
68
+ max: number | null;
69
+ }[];
70
+ export declare function buildHeatmap(options: {
71
+ data: readonly CalendarHeatmapDatum[];
72
+ start: Date;
73
+ end: Date;
74
+ timeZone: string;
75
+ locale: string;
76
+ startOfWeek?: FirstDayOfWeek;
77
+ thresholds?: readonly number[];
78
+ }): HeatmapLayout;
79
+ /**
80
+ * Where an arrow key sends focus. Columns are weeks and rows are weekdays, so
81
+ * the horizontal arrows move a week and the vertical ones a day. Every target
82
+ * is clamped to the range, so focus never lands on a padding slot. `null` for
83
+ * a key the grid doesn't handle.
84
+ */
85
+ export declare function nextHeatmapDay(key: string, day: CalendarDate, options: {
86
+ dir: "ltr" | "rtl";
87
+ ctrlKey: boolean;
88
+ /** The day's week index (its column). */
89
+ column: number;
90
+ columns: number;
91
+ first: CalendarDate;
92
+ last: CalendarDate;
93
+ }): CalendarDate | null;
94
+ //# sourceMappingURL=calendar-heatmap-grid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar-heatmap-grid.d.ts","sourceRoot":"","sources":["../../../src/components/calendar-heatmap/calendar-heatmap-grid.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EAKlB,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAEhE;;;;;;;;GAQG;AAEH,MAAM,MAAM,oBAAoB,GAAG;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAEhE,iFAAiF;AACjF,MAAM,MAAM,yBAAyB,GACjC,SAAS,CAAC,MAAM,CAAC,GACjB,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,GACzB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GACjC,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;AAE7C,MAAM,MAAM,UAAU,GAAG;IACvB,uDAAuD;IACvD,IAAI,EAAE,IAAI,CAAA;IACV,8DAA8D;IAC9D,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,uEAAuE;IACvE,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,qFAAqF;IACrF,KAAK,EAAE,CAAC,UAAU,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAC9B,8CAA8C;IAC9C,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,IAAI,CAAA;KAAE,EAAE,CAAA;IACxC,wEAAwE;IACxE,QAAQ,EAAE,IAAI,EAAE,CA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AA;IACnB,IAAI,EAAE,YAAY,CAAA;CACnB,GACA,YAAY,GAAG,IAAI,CAkBrB"}
@@ -0,0 +1,76 @@
1
+ import { type HTMLArkProps } from "@ark-ui/react";
2
+ import type { NoAsChild } from "../../lib/as-child";
3
+ import type { Color } from "../../lib/colors";
4
+ import type { WithTestId } from "../../lib/test-id";
5
+ import type { FirstDayOfWeek } from "../schedule/schedule-types";
6
+ import { type CalendarHeatmapDatum, type CalendarHeatmapThresholds } from "./calendar-heatmap-grid";
7
+ export type { CalendarHeatmapDatum, CalendarHeatmapThresholds };
8
+ /**
9
+ * Everything the heatmap says that `Intl` can't: the grid's name, the legend's
10
+ * ends, and the sentence that names a day. Dates, weekdays, months and numbers
11
+ * are never here, they come from the resolved locale.
12
+ */
13
+ export type CalendarHeatmapTranslations = {
14
+ /** The grid's accessible name. */
15
+ label: string;
16
+ /** A day's tooltip and accessible name. One sentence, so word order is the
17
+ * translation's own: "3 activités le lundi 26 octobre 2026". */
18
+ day: (details: {
19
+ value: number;
20
+ formattedValue: string;
21
+ formattedDate: string;
22
+ }) => string;
23
+ less: string;
24
+ more: string;
25
+ };
26
+ export declare const CALENDAR_HEATMAP_DEFAULT_TRANSLATIONS: CalendarHeatmapTranslations;
27
+ export type CalendarHeatmapClassNames = {
28
+ grid?: string;
29
+ cell?: string;
30
+ legend?: string;
31
+ tooltip?: string;
32
+ };
33
+ export type CalendarHeatmapProps = Omit<NoAsChild<HTMLArkProps<"div">>, "color" | "children"> & WithTestId & {
34
+ /** One entry per day, or per event: entries on the same day add up. */
35
+ data: readonly CalendarHeatmapDatum[];
36
+ /** The first and last day shown, both included. Defaults to the year ending today. */
37
+ range?: {
38
+ start: Date;
39
+ end: Date;
40
+ };
41
+ /** The ramp's palette. Inherits the nearest `data-color` when omitted. */
42
+ color?: Color;
43
+ /**
44
+ * Lower bounds of levels 1 to 4, ascending: `[1, 5, 10, 20]` paints 1–4
45
+ * at level 1 and 20 or more at level 4. One to four of them, never more:
46
+ * past four steps a reader can't rank the shades. Defaults to the busiest
47
+ * day split into quarters.
48
+ */
49
+ thresholds?: CalendarHeatmapThresholds;
50
+ /** The day each column starts on. Defaults to the locale's. */
51
+ startOfWeek?: FirstDayOfWeek;
52
+ /** BCP-47 tag, or `"auto"`. Inherits `IntlProvider`'s when omitted. */
53
+ locale?: "auto" | (string & {});
54
+ /** IANA zone the data's instants are bucketed in, or `"auto"`. Inherits `IntlProvider`'s. */
55
+ timeZone?: "auto" | (string & {});
56
+ /** Makes days activatable, by click, Enter or Space. */
57
+ onDayClick?: (date: Date, value: number) => void;
58
+ translations?: Partial<CalendarHeatmapTranslations>;
59
+ classNames?: CalendarHeatmapClassNames;
60
+ };
61
+ /**
62
+ * A GitHub-style activity grid: one square per day, a column per week, the
63
+ * shade saying how much happened.
64
+ *
65
+ * <CalendarHeatmap data={commits} color="green" />
66
+ *
67
+ * It is a real ARIA grid: one tab stop, arrows move a day (↑↓) or a week
68
+ * (←→, mirrored in RTL), Home/End go along the row, Ctrl+Home/End to the
69
+ * ends, PageUp/PageDown a month. Every day is named in full ("3 activities on
70
+ * Monday, October 26, 2026"), and one shared tooltip follows hover and focus.
71
+ *
72
+ * The squares keep their size: a range wider than the container scrolls, the
73
+ * latest week in view and the weekday labels pinned beside it.
74
+ */
75
+ export declare const CalendarHeatmap: ({ data, range, color, thresholds, startOfWeek, locale: localeProp, timeZone: timeZoneProp, onDayClick, translations, className, classNames, style, testId, ...rest }: CalendarHeatmapProps) => import("react").JSX.Element;
76
+ //# sourceMappingURL=calendar-heatmap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar-heatmap.d.ts","sourceRoot":"","sources":["../../../src/components/calendar-heatmap/calendar-heatmap.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAKtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAEnD,OAAO,KAAK,EAAE,KAAK,EAAE,MAA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IACtC,+DAA+D;IAC/D,WAAW,CAAC,EAAE,cAAc,CAAA;IAC5B,uEAAuE;IACvE,MAAM,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;IAC/B,6FAA6F;IAC7F,QAAQ,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;IACjC,wDAAwD;IACxD,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAChD,YAAY,CAAC,EAAE,OAAO,CAAC,2BAA2B,CAAC,CAAA;IACnD,UAAU,CAAC,EAAE,yBAAyB,CAAA;CACvC,CAAA;AA0CH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,eAAe,yKAezB,oBAAoB,gCAmNtB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { CALENDAR_HEATMAP_DEFAULT_TRANSLATIONS, CalendarHeatmap, type CalendarHeatmapClassNames, type CalendarHeatmapDatum, type CalendarHeatmapProps, type CalendarHeatmapThresholds, type CalendarHeatmapTranslations, } from "./calendar-heatmap";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/calendar-heatmap/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,qCAAqC,EACrC,eAAe,EACf,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,2BAA2B,GACjC,MAAM,oBAAoB,CAAA"}