@fuf-stack/uniform 2.0.0-next.3 → 2.0.0-next.4

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 (93) hide show
  1. package/dist/Checkboxes/index.d.mts +58 -58
  2. package/dist/Checkboxes/index.d.mts.map +1 -1
  3. package/dist/Checkboxes/index.mjs +10 -8
  4. package/dist/Checkboxes/index.mjs.map +1 -1
  5. package/dist/DatePicker/index.d.mts +46 -109
  6. package/dist/DatePicker/index.d.mts.map +1 -1
  7. package/dist/DatePicker/index.mjs +15 -23
  8. package/dist/DatePicker/index.mjs.map +1 -1
  9. package/dist/FieldArray/index.mjs +9 -7
  10. package/dist/FieldArray/index.mjs.map +1 -1
  11. package/dist/FieldCard/index.mjs +5 -8
  12. package/dist/FieldCard/index.mjs.map +1 -1
  13. package/dist/FieldHelper-B1DWl7eu.mjs +38 -0
  14. package/dist/FieldHelper-B1DWl7eu.mjs.map +1 -0
  15. package/dist/FieldLabel-DMTqq0Jj.mjs +29 -0
  16. package/dist/FieldLabel-DMTqq0Jj.mjs.map +1 -0
  17. package/dist/{FieldLayout-DcvQU0zN.mjs → FieldLayout-C9MEBZAC.mjs} +10 -17
  18. package/dist/FieldLayout-C9MEBZAC.mjs.map +1 -0
  19. package/dist/{FieldValidationError-iAayfTEw.mjs → FieldValidationError-BuLvuRyi.mjs} +3 -3
  20. package/dist/FieldValidationError-BuLvuRyi.mjs.map +1 -0
  21. package/dist/Input/index.d.mts +596 -431
  22. package/dist/Input/index.d.mts.map +1 -1
  23. package/dist/Input/index.mjs +7 -10
  24. package/dist/Input/index.mjs.map +1 -1
  25. package/dist/RadioBoxes/index.d.mts +79 -63
  26. package/dist/RadioBoxes/index.d.mts.map +1 -1
  27. package/dist/RadioBoxes/index.mjs +5 -13
  28. package/dist/RadioBoxes/index.mjs.map +1 -1
  29. package/dist/RadioTabs/index.d.mts +572 -317
  30. package/dist/RadioTabs/index.d.mts.map +1 -1
  31. package/dist/RadioTabs/index.mjs +11 -11
  32. package/dist/RadioTabs/index.mjs.map +1 -1
  33. package/dist/Radios/index.d.mts +44 -41
  34. package/dist/Radios/index.d.mts.map +1 -1
  35. package/dist/Radios/index.mjs +5 -13
  36. package/dist/Radios/index.mjs.map +1 -1
  37. package/dist/Select/index.d.mts +791 -599
  38. package/dist/Select/index.d.mts.map +1 -1
  39. package/dist/Select/index.mjs +7 -8
  40. package/dist/Select/index.mjs.map +1 -1
  41. package/dist/Slider/index.d.mts +664 -354
  42. package/dist/Slider/index.d.mts.map +1 -1
  43. package/dist/Slider/index.mjs +18 -26
  44. package/dist/Slider/index.mjs.map +1 -1
  45. package/dist/Switch/index.d.mts +1 -1
  46. package/dist/Switch/index.mjs +12 -17
  47. package/dist/Switch/index.mjs.map +1 -1
  48. package/dist/Switch-aBYStBoY.d.mts +990 -0
  49. package/dist/{Switch-Db2dpGz7.d.mts.map → Switch-aBYStBoY.d.mts.map} +1 -1
  50. package/dist/SwitchBox/index.d.mts +593 -231
  51. package/dist/SwitchBox/index.d.mts.map +1 -1
  52. package/dist/SwitchBox/index.mjs +14 -18
  53. package/dist/SwitchBox/index.mjs.map +1 -1
  54. package/dist/TextArea/index.d.mts +553 -216
  55. package/dist/TextArea/index.d.mts.map +1 -1
  56. package/dist/TextArea/index.mjs +7 -10
  57. package/dist/TextArea/index.mjs.map +1 -1
  58. package/dist/Time/index.d.mts +45 -45
  59. package/dist/Time/index.d.mts.map +1 -1
  60. package/dist/Time/index.mjs +17 -22
  61. package/dist/Time/index.mjs.map +1 -1
  62. package/dist/fieldHelperVariants-ClP8taiS.mjs +20 -0
  63. package/dist/fieldHelperVariants-ClP8taiS.mjs.map +1 -0
  64. package/dist/fieldLabelVariants-C4ZqECec.mjs +13 -0
  65. package/dist/fieldLabelVariants-C4ZqECec.mjs.map +1 -0
  66. package/dist/{FieldDescription-X_0s1Lhu.mjs → fieldProps-DWfz2jSO.mjs} +2 -13
  67. package/dist/fieldProps-DWfz2jSO.mjs.map +1 -0
  68. package/dist/{Switch-Db2dpGz7.d.mts → partials/FieldHelper/index.d.mts} +309 -408
  69. package/dist/partials/FieldHelper/index.d.mts.map +1 -0
  70. package/dist/partials/FieldHelper/index.mjs +7 -0
  71. package/dist/partials/FieldHelper/index.mjs.map +1 -0
  72. package/dist/partials/FieldLabel/index.d.mts +160 -0
  73. package/dist/partials/FieldLabel/index.d.mts.map +1 -0
  74. package/dist/partials/FieldLabel/index.mjs +7 -0
  75. package/dist/partials/FieldLabel/index.mjs.map +1 -0
  76. package/dist/partials/FieldValidationError/index.d.mts +2 -2
  77. package/dist/partials/FieldValidationError/index.mjs +1 -1
  78. package/dist/{radioControlVariants-BYRfaD6y.mjs → radioControlVariants-CbtG5U4_.mjs} +10 -6
  79. package/dist/radioControlVariants-CbtG5U4_.mjs.map +1 -0
  80. package/dist/{switchVariants-D16b2VaT.mjs → switchVariants-0Xa7TQYg.mjs} +5 -8
  81. package/dist/switchVariants-0Xa7TQYg.mjs.map +1 -0
  82. package/dist/{timeVariants-CtXyNKmW.mjs → timeVariants-Bkt4iwXx.mjs} +12 -10
  83. package/dist/timeVariants-Bkt4iwXx.mjs.map +1 -0
  84. package/dist/{FieldLabel-DrNWJIVh.mjs → useUniformField-TTNPTsVn.mjs} +3 -28
  85. package/dist/useUniformField-TTNPTsVn.mjs.map +1 -0
  86. package/package.json +4 -2
  87. package/dist/FieldDescription-X_0s1Lhu.mjs.map +0 -1
  88. package/dist/FieldLabel-DrNWJIVh.mjs.map +0 -1
  89. package/dist/FieldLayout-DcvQU0zN.mjs.map +0 -1
  90. package/dist/FieldValidationError-iAayfTEw.mjs.map +0 -1
  91. package/dist/radioControlVariants-BYRfaD6y.mjs.map +0 -1
  92. package/dist/switchVariants-D16b2VaT.mjs.map +0 -1
  93. package/dist/timeVariants-CtXyNKmW.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/DatePicker/datePickerVariants.ts","../../src/DatePicker/Dat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-1,6 +1,8 @@
1
- import { n as useUniformField, t as FieldLabel } from "../FieldLabel-DrNWJIVh.mjs";
2
- import { n as getFieldControlProps, t as FieldDescription } from "../FieldDescription-X_0s1Lhu.mjs";
3
- import { t as segmentedInputVariants } from "../timeVariants-CtXyNKmW.mjs";
1
+ import { t as useUniformField } from "../useUniformField-TTNPTsVn.mjs";
2
+ import { t as getFieldControlProps } from "../fieldProps-DWfz2jSO.mjs";
3
+ import { t as FieldLabel } from "../FieldLabel-DMTqq0Jj.mjs";
4
+ import { t as segmentedInputVariants } from "../timeVariants-Bkt4iwXx.mjs";
5
+ import { t as FieldHelper } from "../FieldHelper-B1DWl7eu.mjs";
4
6
  import { useWatchFormReset } from "../hooks/useWatchFormReset/index.mjs";
5
7
  import { useContext } from "react";
6
8
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -154,14 +156,11 @@ const datePickerVariants = tv({
154
156
  gridHeaderCell: "flex w-8 items-center justify-center font-medium text-default-400 text-small",
155
157
  /** Viewport around the calendar grid */
156
158
  gridWrapper: "relative flex h-auto max-w-full overflow-hidden pb-2",
157
- /** Supporting text below the input surface */
158
- helperWrapper: ["p-0"],
159
159
  /** Invalid color for content beside segments */
160
160
  innerWrapper: "group-data-[invalid=true]:text-danger",
161
161
  /** Input surface with a focus indicator */
162
162
  inputWrapper: ["bg-content1 focus-within:border-focus", "group-data-[invalid=true]:border-danger group-data-[invalid=true]:focus-within:border-danger group-data-[invalid=true]:hover:border-danger group-data-[invalid=true]:focus-within:hover:border-danger"],
163
163
  /** Label above the date input */
164
- label: ["cursor-default", "group-data-[invalid=true]:text-danger"],
165
164
  /** Floating surface around the calendar */
166
165
  popoverContent: ["", "z-50 rounded-large bg-content1 shadow-medium outline-none text-small"],
167
166
  /** Invalid editable value and separator states */
@@ -353,11 +352,11 @@ const DatePickerTrigger = ({ className: classNames }) => {
353
352
  */
354
353
  const DatePickerInput = ({ children, className: classNames, field }) => {
355
354
  const { description, errorMessage, ids, invalid, testId } = field;
356
- return /* @__PURE__ */ jsxs(Group, {
355
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Group, {
357
356
  className: classNames.inputWrapper,
358
357
  "data-slot": "input-wrapper",
359
358
  "data-testid": testId,
360
- children: [/* @__PURE__ */ jsxs("div", {
359
+ children: /* @__PURE__ */ jsxs("div", {
361
360
  className: classNames.innerWrapper,
362
361
  "data-slot": "inner-wrapper",
363
362
  children: [/* @__PURE__ */ jsxs(DateField, {
@@ -375,21 +374,14 @@ const DatePickerInput = ({ children, className: classNames, field }) => {
375
374
  }
376
375
  })]
377
376
  }), /* @__PURE__ */ jsx(DatePickerTrigger, { className: classNames })]
378
- }), description || invalid ? /* @__PURE__ */ jsxs("div", {
379
- className: classNames.helperWrapper,
380
- "data-slot": "helper-wrapper",
381
- children: [/* @__PURE__ */ jsx(FieldDescription, {
382
- className: classNames.description,
383
- id: ids.description,
384
- children: description
385
- }), invalid ? /* @__PURE__ */ jsx("div", {
386
- className: classNames.errorMessage,
387
- "data-slot": "error-message",
388
- id: ids.error,
389
- children: errorMessage
390
- }) : null]
391
- }) : null]
392
- });
377
+ })
378
+ }), /* @__PURE__ */ jsx(FieldHelper, {
379
+ className: classNames,
380
+ description,
381
+ errorMessage,
382
+ ids,
383
+ invalid
384
+ })] });
393
385
  };
394
386
  // src/DatePicker/subcomponents/DatePickerControl.tsx
395
387
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["AriaDatePicker","DatePicker","DatePicker"],"sources":["../../src/DatePicker/dateHelpers.ts","../../src/DatePicker/datePickerVariants.ts","../../src/DatePicker/subcomponents/DatePickerChevron.tsx","../../src/DatePicker/subcomponents/DatePickerCalendar.tsx","../../src/DatePicker/subcomponents/DatePickerTrigger.tsx","../../src/DatePicker/subcomponents/DatePickerInput.tsx","../../src/DatePicker/subcomponents/DatePickerControl.tsx","../../src/DatePicker/subcomponents/DatePickerReset.tsx","../../src/DatePicker/DatePicker.tsx","../../src/DatePicker/index.ts"],"sourcesContent":["import type {\n CalendarDate,\n CalendarDateTime,\n ZonedDateTime,\n} from '@internationalized/date';\nimport type { InputValueTransform } from '../hooks/useInputValueTransform';\nimport type { DatePickerProps } from './DatePicker';\n\nimport {\n getLocalTimeZone,\n now,\n parseAbsolute,\n parseAbsoluteToLocal,\n parseDate,\n parseDateTime,\n parseZonedDateTime,\n} from '@internationalized/date';\n\n/** Supported calendar values, including an empty date picker. */\nexport type DatePickerValue =\n CalendarDate | CalendarDateTime | ZonedDateTime | null | undefined;\n\n/** Cast unknown input to the DatePicker value union type. */\nconst asDatePickerValue = (value: unknown): DatePickerValue => {\n return value as DatePickerValue;\n};\n\n/** Check whether a value already looks like an @internationalized/date object. */\nconst isDateValueLike = (value: unknown): value is object => {\n return !!value && typeof value === 'object' && 'calendar' in value;\n};\n\n/** True for ISO datetime strings that do not yet include timezone information. */\nconst isNaiveDateTimeString = (value: string): boolean => {\n return /^\\d{4}-\\d{2}-\\d{2}T/.test(value) && !hasExplicitTimeZone(value);\n};\n\n/** True when an input already carries timezone/offset information. */\nconst hasExplicitTimeZone = (value: string): boolean => {\n if (value.includes('[') && value.includes(']')) {\n return true;\n }\n\n return /(?:[zZ]|[+-]\\d{2}:\\d{2})$/.test(value);\n};\n\n/** Safely run a parser and return `null` on parsing errors. */\nconst tryParse = (parser: () => unknown): DatePickerValue => {\n try {\n return asDatePickerValue(parser());\n } catch {\n return null;\n }\n};\n\n/**\n * Parse a form value into a segmented date control’s `DateValue`\n *\n * Accepts existing `DateValue` objects, native `Date` instances, and ISO-like\n * strings (date, date-time, zoned, and absolute). Returns `null` when the value\n * is empty or cannot be parsed.\n */\nexport const parseDateValue = (\n value: unknown,\n timeZone?: string,\n): DatePickerValue => {\n if (value == null || value === '') {\n return null;\n }\n\n if (isDateValueLike(value)) {\n return asDatePickerValue(value);\n }\n\n if (value instanceof Date) {\n return asDatePickerValue(\n timeZone\n ? parseAbsolute(value.toISOString(), timeZone)\n : parseAbsoluteToLocal(value.toISOString()),\n );\n }\n\n if (typeof value !== 'string') {\n return null;\n }\n\n const normalizedValue = value.trim();\n if (normalizedValue === '') {\n return null;\n }\n\n if (/^\\d{4}-\\d{2}-\\d{2}$/.test(normalizedValue)) {\n return tryParse(() => {\n return parseDate(normalizedValue);\n });\n }\n\n const parsers: (() => unknown)[] = [\n ...(timeZone && isNaiveDateTimeString(normalizedValue)\n ? [\n () => {\n return parseZonedDateTime(`${normalizedValue}[${timeZone}]`);\n },\n ]\n : []),\n () => {\n return timeZone\n ? parseAbsolute(normalizedValue, timeZone)\n : parseAbsoluteToLocal(normalizedValue);\n },\n () => {\n return parseZonedDateTime(normalizedValue);\n },\n () => {\n return parseDateTime(normalizedValue);\n },\n () => {\n return parseDate(normalizedValue);\n },\n ];\n\n return (\n parsers\n .map((parser) => {\n return tryParse(parser);\n })\n .find((parsedValue) => {\n return parsedValue != null;\n }) ?? null\n );\n};\n\n/** Resolve the timezone used by the DatePicker when time fields are enabled. */\nexport const resolveDatePickerTimeZone = (\n withTime: boolean,\n timeZone?: string,\n): string | undefined => {\n if (!withTime) {\n return timeZone;\n }\n\n return timeZone ?? getLocalTimeZone();\n};\n\n/** Build the default placeholder value for time-enabled pickers. */\nexport const getDatePickerPlaceholderValue = (\n withTime: boolean,\n timeZone?: string,\n): DatePickerValue => {\n const resolvedTimeZone = resolveDatePickerTimeZone(withTime, timeZone);\n if (!resolvedTimeZone || !withTime) {\n return undefined;\n }\n\n return asDatePickerValue(now(resolvedTimeZone));\n};\n\n/**\n * Convert a date value into a UTC ISO string.\n *\n * `CalendarDate` and `CalendarDateTime` values are interpreted in the provided\n * timezone. `ZonedDateTime` values use their own timezone and offset.\n */\nexport const dateValueToUtcIsoString = (\n value: DatePickerValue,\n timeZone: string,\n): string | null => {\n if (value == null) {\n return null;\n }\n\n const maybeWithAbsoluteString = value as { toAbsoluteString?: () => string };\n if (typeof maybeWithAbsoluteString.toAbsoluteString === 'function') {\n return maybeWithAbsoluteString.toAbsoluteString();\n }\n\n const maybeWithToDate = value as { toDate?: (zone: string) => Date };\n if (typeof maybeWithToDate.toDate === 'function') {\n return maybeWithToDate.toDate(timeZone).toISOString();\n }\n\n return null;\n};\n\n/** Converts edited dates to the configured form storage format */\nexport const createDatePickerValueTransform = ({\n timeZone,\n valueType,\n withTime,\n}: Pick<\n DatePickerProps,\n 'timeZone' | 'valueType' | 'withTime'\n>): InputValueTransform => {\n const resolvedTimeZone = resolveDatePickerTimeZone(\n withTime ?? false,\n timeZone,\n );\n\n return {\n toDisplayValue: (value) => {\n return value ?? '';\n },\n toFormValue: (value) => {\n const nextValue = value as DatePickerValue;\n if (nextValue == null) {\n return null;\n }\n\n if (valueType === 'dateValue') {\n return nextValue;\n }\n\n // string storage remains UTC regardless of the display timezone\n return (\n dateValueToUtcIsoString(nextValue, resolvedTimeZone ?? 'UTC') ??\n String(nextValue)\n );\n },\n };\n};\n","import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\n\nimport { tv } from '@fuf-stack/pixel-utils';\n\nimport { segmentedInputVariants } from '../Time/timeVariants';\n\nexport const datePickerVariants = tv({\n extend: segmentedInputVariants,\n slots: {\n /** Container for the date input and supporting text */\n base: '',\n /** Calendar panel inside the popup */\n calendar: [\n '',\n 'relative inline-block w-64 max-w-full overflow-hidden rounded-large bg-default-50 dark:bg-background',\n ],\n /** Previous or next month button */\n calendarButton: [\n // navigation button layout and appearance\n 'outline-solid flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-default-400 outline-transparent',\n // hover and disabled states\n 'hover:bg-default/40 data-[disabled=true]:opacity-disabled',\n // keyboard focus outline\n 'data-[focus-visible=true]:outline-2 data-[focus-visible=true]:outline-offset-2 data-[focus-visible=true]:outline-focus',\n ],\n /** Calendar grid and navigation area */\n calendarContent: ['', 'w-full'],\n /** Row containing month navigation */\n calendarHeader:\n 'flex items-center justify-between gap-2 bg-content1 px-4 py-2',\n /** Currently displayed month and year */\n calendarTitle: 'flex-1 text-center font-medium text-default-500 text-small',\n /** Selectable date with interaction states */\n cell: [\n // day cell layout and appearance\n 'outline-solid flex h-8 w-8 cursor-pointer select-none items-center justify-center rounded-full text-foreground outline-transparent transition-colors',\n // focus stacking and unavailable cursors\n 'data-[focus-visible=true]:z-10 data-[disabled=true]:cursor-default data-[unavailable=true]:cursor-default',\n // hover and selection backgrounds\n 'data-[hovered=true]:bg-primary-50 data-[selected=true]:bg-primary data-[selected=true]:data-[hovered=true]:bg-primary',\n // day text states\n 'data-[disabled=true]:text-default-300 data-[hovered=true]:text-primary-400 data-[selected=true]:data-[hovered=true]:text-primary-foreground data-[selected=true]:text-primary-foreground data-[unavailable=true]:text-default-300 data-[unavailable=true]:line-through',\n // keyboard focus outline\n 'data-[focus-visible=true]:outline-2 data-[focus-visible=true]:outline-offset-2 data-[focus-visible=true]:outline-focus',\n // reduced motion\n 'motion-reduce:transition-none',\n ],\n /** Keyboard focus boundary inside the popup */\n dialog: 'flex flex-col outline-none',\n /** Table of selectable dates */\n grid: 'z-0 w-full border-collapse',\n /** Rows containing calendar dates */\n gridBody:\n '[&>tr:first-child]:mt-2 [&>tr>td]:px-0 [&>tr>td]:py-0.5 [&>tr]:flex [&>tr]:items-center [&>tr]:justify-center',\n /** Row containing weekday headings */\n gridHeader:\n 'bg-content1 shadow-[0px_20px_20px_0px_rgb(0_0_0/0.05)] [&>tr]:flex [&>tr]:justify-center [&>tr]:px-4 [&>tr]:pb-2',\n /** Individual weekday heading */\n gridHeaderCell:\n 'flex w-8 items-center justify-center font-medium text-default-400 text-small',\n /** Viewport around the calendar grid */\n gridWrapper: 'relative flex h-auto max-w-full overflow-hidden pb-2',\n /** Supporting text below the input surface */\n helperWrapper: [\n // set padding to 0 for error message exit animation\n 'p-0',\n ],\n /** Invalid color for content beside segments */\n innerWrapper: 'group-data-[invalid=true]:text-danger',\n /** Input surface with a focus indicator */\n inputWrapper: [\n 'bg-content1 focus-within:border-focus',\n 'group-data-[invalid=true]:border-danger group-data-[invalid=true]:focus-within:border-danger group-data-[invalid=true]:hover:border-danger group-data-[invalid=true]:focus-within:hover:border-danger',\n ],\n /** Label above the date input */\n label: ['cursor-default', 'group-data-[invalid=true]:text-danger'],\n /** Floating surface around the calendar */\n popoverContent: [\n '',\n 'z-50 rounded-large bg-content1 shadow-medium outline-none text-small',\n ],\n /** Invalid editable value and separator states */\n segment:\n 'data-[invalid=true]:data-[editable=true]:data-[placeholder=true]:text-danger data-[invalid=true]:data-[editable=true]:text-danger data-[invalid=true]:text-danger-300 data-[invalid=true]:focus:bg-danger-400/50 data-[invalid=true]:data-[editable=true]:focus:text-danger dark:data-[invalid=true]:focus:bg-danger-400/20',\n /** Button opening the calendar popup */\n selectorButton: [\n '',\n // calendar trigger layout and appearance\n 'outline-solid relative -mx-2 inline-flex h-8 min-h-8 w-8 min-w-8 shrink-0 items-center justify-center rounded-full text-inherit outline-transparent text-tiny',\n // hover background\n 'hover:bg-default/40',\n // keyboard focus outline\n 'data-[focus-visible=true]:outline-2 data-[focus-visible=true]:outline-offset-2 data-[focus-visible=true]:outline-focus',\n ],\n /** Icon inside the calendar toggle */\n selectorIcon: ['', 'h-[18px] w-[18px]'],\n /** Time input below the calendar */\n timeInput: [\n '',\n 'group flex w-full flex-row flex-wrap items-center gap-x-6 px-5 pb-4',\n ],\n /** Label beside the calendar time input */\n timeInputLabel: ['', 'relative font-medium text-foreground text-tiny'],\n /** Surface around the calendar time segments */\n timeInputWrapper: [\n // time input frame and surface\n 'shadow-xs relative inline-flex h-8 min-h-8 w-full flex-1 items-center rounded-small bg-default-100 px-2',\n // hover and focus backgrounds\n 'hover:bg-default-200 focus-within:hover:bg-default-100',\n ],\n },\n variants: {\n disabled: { true: { base: 'pointer-events-none opacity-disabled' } },\n readOnly: {\n true: {\n // inner controls set their own cursors, override every descendant\n base: 'cursor-not-allowed opacity-disabled **:cursor-not-allowed',\n },\n },\n },\n});\n\nexport type VariantProps = TVProps<typeof datePickerVariants>;\n\nexport type ClassName = TVClassName<typeof datePickerVariants>;\n\n/** Resolved class names for the date input and calendar slots */\nexport type DatePickerClassNames = Record<\n keyof ReturnType<typeof datePickerVariants>,\n string\n>;\n","interface DatePickerChevronProps {\n /** Points toward the previous month */\n previous?: boolean;\n}\n\n/** Decorative direction indicator for calendar navigation */\nconst DatePickerChevron = ({ previous = false }: DatePickerChevronProps) => {\n return (\n <svg\n aria-hidden\n className={\n previous ? 'h-4 w-4 rtl:rotate-180' : 'h-4 w-4 rotate-180 rtl:rotate-0'\n }\n fill=\"none\"\n viewBox=\"0 0 16 16\"\n >\n <path\n d=\"M10 3.33334L6 8.00001L10 12.6667\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"1.5\"\n />\n </svg>\n );\n};\n\nexport default DatePickerChevron;\n","import type { ComponentProps } from 'react';\nimport type { DatePickerRenderProps } from 'react-aria-components';\nimport type { DatePickerValue } from '../dateHelpers';\nimport type { DatePickerProps } from '../DatePicker';\nimport type { DatePickerClassNames } from '../datePickerVariants';\n\nimport {\n Button,\n Calendar,\n CalendarCell,\n CalendarGrid,\n CalendarGridBody,\n CalendarGridHeader,\n CalendarHeaderCell,\n DateInput,\n DateSegment,\n Dialog,\n Heading,\n Label,\n Popover,\n TimeField,\n} from 'react-aria-components';\n\nimport DatePickerChevron from './DatePickerChevron';\n\ninterface DatePickerCalendarProps extends Pick<\n DatePickerProps,\n 'hideTimeZone' | 'hourCycle' | 'withTime'\n> {\n /** CSS class name */\n className: DatePickerClassNames;\n /** Latest selectable date and time */\n maxValue: DatePickerValue;\n /** Earliest selectable date and time */\n minValue: DatePickerValue;\n /** Date and zone used for an empty time field */\n placeholderValue: DatePickerValue;\n /** Locks the time editor of an already open popup */\n readOnly: boolean;\n /** Calendar selection and popup state */\n state: DatePickerRenderProps['state'];\n}\n\n/**\n * Calendar popup with month navigation and an optional time editor\n *\n * @see https://react-aria.adobe.com/DatePicker\n * @see https://react-aria.adobe.com/Calendar\n */\nconst DatePickerCalendar = ({\n className: classNames,\n hideTimeZone,\n hourCycle,\n maxValue,\n minValue,\n placeholderValue,\n readOnly,\n state,\n withTime,\n}: DatePickerCalendarProps) => {\n // keep the calendar's date while editing its time\n const handleTimeChange: NonNullable<\n ComponentProps<typeof TimeField>['onChange']\n > = (next) => {\n if (next && !readOnly) {\n state.setTimeValue(next);\n }\n };\n\n return (\n <Popover\n className={classNames.popoverContent}\n data-slot=\"popover-content\"\n offset={4}\n placement=\"bottom\"\n >\n <Dialog className={classNames.dialog}>\n <Calendar className={classNames.calendar} data-slot=\"calendar\">\n <div\n className={classNames.calendarContent}\n data-slot=\"calendar-content\"\n >\n <header\n className={classNames.calendarHeader}\n data-slot=\"header-wrapper\"\n >\n <Button\n className={classNames.calendarButton}\n data-slot=\"prev-button\"\n slot=\"previous\"\n >\n <DatePickerChevron previous />\n </Button>\n <Heading className={classNames.calendarTitle} data-slot=\"title\" />\n <Button\n className={classNames.calendarButton}\n data-slot=\"next-button\"\n slot=\"next\"\n >\n <DatePickerChevron />\n </Button>\n </header>\n <div className={classNames.gridWrapper} data-slot=\"grid-wrapper\">\n <CalendarGrid\n className={classNames.grid}\n data-slot=\"grid\"\n weekdayStyle=\"narrow\"\n >\n <CalendarGridHeader className={classNames.gridHeader}>\n {(day) => {\n return (\n <CalendarHeaderCell className={classNames.gridHeaderCell}>\n {day}\n </CalendarHeaderCell>\n );\n }}\n </CalendarGridHeader>\n <CalendarGridBody className={classNames.gridBody}>\n {(date) => {\n return (\n <CalendarCell\n className={classNames.cell}\n data-slot=\"cell-button\"\n date={date}\n />\n );\n }}\n </CalendarGridBody>\n </CalendarGrid>\n </div>\n </div>\n {withTime ? (\n <TimeField\n className={classNames.timeInput}\n data-slot=\"time-input\"\n granularity=\"minute\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n isReadOnly={readOnly}\n maxValue={maxValue && 'hour' in maxValue ? maxValue : undefined}\n minValue={minValue && 'hour' in minValue ? minValue : undefined}\n onChange={handleTimeChange}\n placeholderValue={\n placeholderValue && 'hour' in placeholderValue\n ? placeholderValue\n : undefined\n }\n shouldForceLeadingZeros\n validationBehavior=\"aria\"\n value={state.timeValue ?? null}\n >\n <Label\n className={classNames.timeInputLabel}\n data-slot=\"time-input-label\"\n >\n Time\n </Label>\n <div className={classNames.timeInputWrapper}>\n <DateInput className={classNames.input}>\n {(segment) => {\n return (\n <DateSegment\n className={classNames.segment}\n data-editable={segment.isEditable || undefined}\n segment={segment}\n />\n );\n }}\n </DateInput>\n </div>\n </TimeField>\n ) : null}\n </Calendar>\n </Dialog>\n </Popover>\n );\n};\n\nexport default DatePickerCalendar;\n","import type { DatePickerClassNames } from '../datePickerVariants';\n\nimport { Button } from 'react-aria-components';\n\ninterface DatePickerTriggerProps {\n /** CSS class name */\n className: Pick<DatePickerClassNames, 'selectorButton' | 'selectorIcon'>;\n}\n\n/**\n * Calendar button connected to the surrounding date picker’s popup state\n *\n * @see https://react-aria.adobe.com/DatePicker\n * @see https://react-aria.adobe.com/Button\n */\nconst DatePickerTrigger = ({\n className: classNames,\n}: DatePickerTriggerProps) => {\n return (\n <Button className={classNames.selectorButton} data-slot=\"selector-button\">\n <svg\n aria-hidden\n className={classNames.selectorIcon}\n data-slot=\"selector-icon\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <path\n d=\"M7.75 2.5a.75.75 0 0 0-1.5 0v1.58c-1.44.115-2.384.397-3.078 1.092c-.695.694-.977 1.639-1.093 3.078h19.842c-.116-1.44-.398-2.384-1.093-3.078c-.694-.695-1.639-.977-3.078-1.093V2.5a.75.75 0 0 0-1.5 0v1.513C15.585 4 14.839 4 14 4h-4c-.839 0-1.585 0-2.25.013z\"\n fill=\"currentColor\"\n />\n <path\n clipRule=\"evenodd\"\n d=\"M2 12c0-.839 0-1.585.013-2.25h19.974C22 10.415 22 11.161 22 12v2c0 3.771 0 5.657-1.172 6.828C19.657 22 17.771 22 14 22h-4c-3.771 0-5.657 0-6.828-1.172C2 19.657 2 17.771 2 14zm15 2a1 1 0 1 0 0-2a1 1 0 0 0 0 2m0 4a1 1 0 1 0 0-2a1 1 0 0 0 0 2m-4-5a1 1 0 1 1-2 0a1 1 0 0 1 2 0m0 4a1 1 0 1 1-2 0a1 1 0 0 1 2 0m-6-3a1 1 0 1 0 0-2a1 1 0 0 0 0 2m0 4a1 1 0 1 0 0-2a1 1 0 0 0 0 2\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n />\n </svg>\n </Button>\n );\n};\n\nexport default DatePickerTrigger;\n","import type { ReactNode } from 'react';\nimport type { UniformField } from '../../hooks/useUniformField/types';\nimport type { DatePickerValue } from '../dateHelpers';\nimport type { DatePickerClassNames } from '../datePickerVariants';\n\nimport {\n DateField,\n DateInput,\n DateSegment,\n Group,\n} from 'react-aria-components';\n\nimport FieldDescription from '../../partials/FieldDescription/FieldDescription';\nimport DatePickerTrigger from './DatePickerTrigger';\n\ninterface DatePickerInputProps {\n /** Reset bridge rendered inside the date field */\n children: ReactNode;\n /** CSS class name */\n className: DatePickerClassNames;\n /** Bound field values, interactions and metadata */\n field: UniformField<unknown, DatePickerValue>;\n}\n\n/**\n * Editable date segments with a calendar trigger and supporting messages\n *\n * Keeps the reset bridge inside DateField so partial edits reset with the form\n *\n * @see https://react-aria.adobe.com/DateField\n * @see https://react-aria.adobe.com/DatePicker\n * @see https://react-aria.adobe.com/Group\n */\nconst DatePickerInput = ({\n children,\n className: classNames,\n field,\n}: DatePickerInputProps) => {\n const { description, errorMessage, ids, invalid, testId } = field;\n\n return (\n <Group\n className={classNames.inputWrapper}\n data-slot=\"input-wrapper\"\n data-testid={testId}\n >\n <div className={classNames.innerWrapper} data-slot=\"inner-wrapper\">\n <DateField className=\"flex h-full w-full\">\n {children}\n <DateInput className={classNames.input} data-slot=\"input-field\">\n {(segment) => {\n return (\n <DateSegment\n className={classNames.segment}\n data-editable={segment.isEditable || undefined}\n data-slot=\"segment\"\n segment={segment}\n />\n );\n }}\n </DateInput>\n </DateField>\n <DatePickerTrigger className={classNames} />\n </div>\n\n {/* help text and validation messages */}\n {description || invalid ? (\n <div className={classNames.helperWrapper} data-slot=\"helper-wrapper\">\n <FieldDescription\n className={classNames.description}\n id={ids.description}\n >\n {description}\n </FieldDescription>\n {invalid ? (\n <div\n className={classNames.errorMessage}\n data-slot=\"error-message\"\n id={ids.error}\n >\n {errorMessage}\n </div>\n ) : null}\n </div>\n ) : null}\n </Group>\n );\n};\n\nexport default DatePickerInput;\n","import type { ReactNode } from 'react';\nimport type { UniformField } from '../../hooks/useUniformField/types';\nimport type { DatePickerValue } from '../dateHelpers';\nimport type { DatePickerProps } from '../DatePicker';\n\nimport { DatePicker as AriaDatePicker, Label } from 'react-aria-components';\n\nimport { useStyling } from '@fuf-stack/pixels/StylingProvider';\n\nimport { getFieldControlProps } from '../../helpers/fieldProps/fieldProps';\nimport FieldLabel from '../../partials/FieldLabel/FieldLabel';\nimport {\n getDatePickerPlaceholderValue,\n parseDateValue,\n resolveDatePickerTimeZone,\n} from '../dateHelpers';\nimport { datePickerVariants } from '../datePickerVariants';\nimport DatePickerCalendar from './DatePickerCalendar';\nimport DatePickerInput from './DatePickerInput';\n\ninterface DatePickerControlProps extends Pick<\n DatePickerProps,\n | 'className'\n | 'hideTimeZone'\n | 'hourCycle'\n | 'maxValue'\n | 'minValue'\n | 'timeZone'\n | 'withTime'\n> {\n /** Reset bridge rendered inside the date engine */\n children: ReactNode;\n /** Bound field values, interactions and metadata */\n field: UniformField<unknown, DatePickerValue>;\n}\n\n/**\n * Date input presentation with editable segments, field messages and calendar\n *\n * @see https://react-aria.adobe.com/DatePicker\n */\nconst DatePickerControl = ({\n children,\n className,\n field,\n hideTimeZone,\n hourCycle,\n maxValue,\n minValue,\n timeZone,\n withTime = false,\n}: DatePickerControlProps) => {\n const styling = useStyling();\n\n const {\n disabled,\n ids,\n ref: inputRef,\n invalid,\n label,\n name,\n onBlur,\n onChange: onValueChange,\n readOnly,\n required,\n } = field;\n\n // associate the editable control with its label and messages\n const controlProps = getFieldControlProps(field);\n\n const resolvedTimeZone = resolveDatePickerTimeZone(withTime, timeZone);\n const displayTimeZone = withTime ? resolvedTimeZone : timeZone;\n\n // parse stored values and boundaries for the date engine\n const value = parseDateValue(field.value, displayTimeZone);\n const parsedMinValue = parseDateValue(minValue, displayTimeZone);\n const parsedMaxValue = parseDateValue(maxValue, displayTimeZone);\n\n const placeholderValue = getDatePickerPlaceholderValue(withTime, timeZone);\n\n // classNames from slots\n const variants = styling.resolve(datePickerVariants, { disabled, readOnly });\n const classNames = styling.variantsToClassNames(variants, className, 'base');\n\n // read-only values ignore edits, e.g. from a calendar popup that was\n // already open when the field became read-only\n const handleValueChange = (nextValue: DatePickerValue | null) => {\n if (!readOnly) {\n onValueChange(nextValue);\n }\n };\n\n // route form focus to the first enabled date segment\n const handleControlRef = (element: HTMLDivElement | null) => {\n inputRef(\n element\n ? {\n focus: () => {\n element\n .querySelector<HTMLElement>(\n '[role=\"spinbutton\"]:not([aria-disabled=\"true\"])',\n )\n ?.focus();\n },\n }\n : null,\n );\n };\n\n return (\n <AriaDatePicker\n ref={handleControlRef}\n aria-describedby={controlProps['aria-describedby']}\n aria-invalid={controlProps['aria-invalid']}\n aria-label={controlProps['aria-label']}\n className={classNames.base}\n data-component=\"date-picker\"\n data-slot=\"base\"\n granularity={withTime ? 'minute' : 'day'}\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n id={controlProps.id}\n isDisabled={disabled}\n isInvalid={invalid}\n isReadOnly={readOnly}\n isRequired={required}\n maxValue={parsedMaxValue ?? undefined}\n minValue={parsedMinValue ?? undefined}\n name={name}\n onBlur={onBlur}\n onChange={handleValueChange}\n placeholderValue={placeholderValue ?? undefined}\n shouldCloseOnSelect={!withTime}\n shouldForceLeadingZeros\n validationBehavior=\"aria\"\n value={value ?? null}\n >\n {({ state }) => {\n return (\n <>\n {/* field label */}\n {label ? (\n <FieldLabel\n as={Label}\n className={classNames.label}\n id={ids.label}\n required={required}\n >\n {label}\n </FieldLabel>\n ) : null}\n\n {/* date segments and calendar trigger */}\n <DatePickerInput className={classNames} field={field}>\n {children}\n </DatePickerInput>\n\n {/* calendar popup */}\n <DatePickerCalendar\n className={classNames}\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n maxValue={parsedMaxValue}\n minValue={parsedMinValue}\n placeholderValue={placeholderValue}\n readOnly={readOnly}\n state={state}\n withTime={withTime}\n />\n </>\n );\n }}\n </AriaDatePicker>\n );\n};\n\nexport default DatePickerControl;\n","import { useContext } from 'react';\nimport { DateFieldStateContext } from 'react-aria-components';\n\nimport { useWatchFormReset } from '../../hooks/useWatchFormReset';\n\n/**\n * Clears partial segment edits when the form resets an empty field\n *\n * @see https://react-aria.adobe.com/DatePicker\n */\nconst DatePickerReset = () => {\n const state = useContext(DateFieldStateContext);\n\n useWatchFormReset({\n onReset: () => {\n if (state?.value == null) {\n state?.setValue(null);\n }\n },\n });\n\n return null;\n};\n\nexport default DatePickerReset;\n","import type { ReactNode } from 'react';\nimport type { ClassName } from './datePickerVariants';\n\nimport useUniformField from '../hooks/useUniformField/useUniformField';\nimport { createDatePickerValueTransform } from './dateHelpers';\nimport DatePickerControl from './subcomponents/DatePickerControl';\nimport DatePickerReset from './subcomponents/DatePickerReset';\n\nexport { datePickerVariants } from './datePickerVariants';\n\nexport interface DatePickerProps {\n /** Custom aria-label for accessibility. If not provided, falls back to field name when no visible label exists */\n ariaLabel?: string;\n /** CSS class name */\n className?: ClassName;\n /** Optional help text associated with editable date segments. */\n description?: ReactNode;\n /** date picker is disabled */\n disabled?: boolean;\n /** hide timezone abbreviation for zoned values */\n hideTimeZone?: boolean;\n /**\n * Optional hour cycle override.\n *\n * Defaults to a 24-hour cycle.\n */\n hourCycle?: 12 | 24;\n /** form field label */\n label?: ReactNode;\n /** latest selectable value as ISO string */\n maxValue?: string;\n /** earliest selectable value as ISO string */\n minValue?: string;\n /** form field name */\n name: string;\n /** Prevents changes while keeping the value in validation and submission */\n readOnly?: boolean;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /**\n * Optional advanced override for the display/interpretation timezone.\n *\n * When omitted, the picker uses the current user's local timezone while\n * `withTime` is enabled.\n */\n timeZone?: string;\n /** value format stored in form state (`string` stores UTC ISO values) */\n valueType?: 'dateValue' | 'string';\n /**\n * Enables date-time mode.\n *\n * - `false` (default): date-only input (`day` granularity)\n * - `true`: includes time segments (`minute` granularity)\n */\n withTime?: boolean;\n}\n\n/** Form input field for a date, with an optional time and calendar picker */\nconst DatePicker = ({\n className = undefined,\n hourCycle = 24,\n hideTimeZone = false,\n maxValue = undefined,\n minValue = undefined,\n name,\n timeZone = undefined,\n valueType = 'string',\n withTime = false,\n ...uniformFieldProps\n}: DatePickerProps) => {\n const transform = createDatePickerValueTransform({\n timeZone,\n valueType,\n withTime,\n });\n\n const { field } = useUniformField({\n ...uniformFieldProps,\n name,\n transform,\n });\n\n return (\n <DatePickerControl\n className={className}\n field={field}\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n maxValue={maxValue}\n minValue={minValue}\n timeZone={timeZone}\n withTime={withTime}\n >\n <DatePickerReset />\n </DatePickerControl>\n );\n};\n\nexport default DatePicker;\n","import DatePicker from './DatePicker';\n\nexport type { DatePickerProps } from './DatePicker';\n\nexport { datePickerVariants } from './DatePicker';\n\nexport default DatePicker;\n"],"mappings":";;;;;;;;;;;;AAuBA,MAAM,qBAAqB,UAAoC;CAC7D,OAAO;AACT;;AAGA,MAAM,mBAAmB,UAAoC;CAC3D,OAAO,CAAC,CAAC,SAAS,OAAO,UAAU,YAAY,cAAc;AAC/D;;AAGA,MAAM,yBAAyB,UAA2B;CACxD,OAAO,sBAAsB,KAAK,KAAK,KAAK,CAAC,oBAAoB,KAAK;AACxE;;AAGA,MAAM,uBAAuB,UAA2B;CACtD,IAAI,MAAM,SAAS,GAAG,KAAK,MAAM,SAAS,GAAG,GAC3C,OAAO;CAGT,OAAO,4BAA4B,KAAK,KAAK;AAC/C;;AAGA,MAAM,YAAY,WAA2C;CAC3D,IAA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EAEN;CACc,CAAA;AAEpB;;;;;;;ACpKA,MAAM,wBAAwB;CAC5B,MAAM,QAAQ,WAAW,qBAAqB;CAE9C,kBAAkB,EAChB,eAAe;EACb,IAAI,OAAO,SAAS,MAClB,OAAO,SAAS,IAAI;CAExB,EACF,CAAC;CAED,OAAO;AACT;;;ACoCA,MAAMC,gBAAc,EAClB,YAAY,KAAA,GACZ,YAAY,IACZ,eAAe,OACf,WAAW,KAAA,GACX,WAAW,KAAA,GACX,MACA,WAAW,KAAA,GACX,YAAY,UACZ,WAAW,OACX,GAAG,wBACkB;CACrB,MAAM,YAAY,+BAA+B;EAC/C;EACA;EACA;CACF,CAAC;CAED,MAAM,EAAE,UAAU,gBAAgB;EAChC,GAAG;EACH;EACA;CACF,CAAC;CAED,OACE,oBAAC,mBAAD;EACa;EACJ;EACO;EACH;EACD;EACA;EACA;EACA;EAEV,UAAA,oBAAC,iBAAD,CAAkB,CAAA;CACD,CAAA;AAEvB;;AC1FA,IAAA,qBAAeC"}
1
+ {"version":3,"file":"index.mjs","names":["AriaDatePicker","DatePicker","DatePicker"],"sources":["../../src/DatePicker/dateHelpers.ts","../../src/DatePicker/datePickerVariants.ts","../../src/DatePicker/subcomponents/DatePickerChevron.tsx","../../src/DatePicker/subcomponents/DatePickerCalendar.tsx","../../src/DatePicker/subcomponents/DatePickerTrigger.tsx","../../src/DatePicker/subcomponents/DatePickerInput.tsx","../../src/DatePicker/subcomponents/DatePickerControl.tsx","../../src/DatePicker/subcomponents/DatePickerReset.tsx","../../src/DatePicker/DatePicker.tsx","../../src/DatePicker/index.ts"],"sourcesContent":["import type {\n CalendarDate,\n CalendarDateTime,\n ZonedDateTime,\n} from '@internationalized/date';\nimport type { InputValueTransform } from '../hooks/useInputValueTransform';\nimport type { DatePickerProps } from './DatePicker';\n\nimport {\n getLocalTimeZone,\n now,\n parseAbsolute,\n parseAbsoluteToLocal,\n parseDate,\n parseDateTime,\n parseZonedDateTime,\n} from '@internationalized/date';\n\n/** Supported calendar values, including an empty date picker. */\nexport type DatePickerValue =\n CalendarDate | CalendarDateTime | ZonedDateTime | null | undefined;\n\n/** Cast unknown input to the DatePicker value union type. */\nconst asDatePickerValue = (value: unknown): DatePickerValue => {\n return value as DatePickerValue;\n};\n\n/** Check whether a value already looks like an @internationalized/date object. */\nconst isDateValueLike = (value: unknown): value is object => {\n return !!value && typeof value === 'object' && 'calendar' in value;\n};\n\n/** True for ISO datetime strings that do not yet include timezone information. */\nconst isNaiveDateTimeString = (value: string): boolean => {\n return /^\\d{4}-\\d{2}-\\d{2}T/.test(value) && !hasExplicitTimeZone(value);\n};\n\n/** True when an input already carries timezone/offset information. */\nconst hasExplicitTimeZone = (value: string): boolean => {\n if (value.includes('[') && value.includes(']')) {\n return true;\n }\n\n return /(?:[zZ]|[+-]\\d{2}:\\d{2})$/.test(value);\n};\n\n/** Safely run a parser and return `null` on parsing errors. */\nconst tryParse = (parser: () => unknown): DatePickerValue => {\n try {\n return asDatePickerValue(parser());\n } catch {\n return null;\n }\n};\n\n/**\n * Parse a form value into a segmented date control’s `DateValue`\n *\n * Accepts existing `DateValue` objects, native `Date` instances, and ISO-like\n * strings (date, date-time, zoned, and absolute). Returns `null` when the value\n * is empty or cannot be parsed.\n */\nexport const parseDateValue = (\n value: unknown,\n timeZone?: string,\n): DatePickerValue => {\n if (value == null || value === '') {\n return null;\n }\n\n if (isDateValueLike(value)) {\n return asDatePickerValue(value);\n }\n\n if (value instanceof Date) {\n return asDatePickerValue(\n timeZone\n ? parseAbsolute(value.toISOString(), timeZone)\n : parseAbsoluteToLocal(value.toISOString()),\n );\n }\n\n if (typeof value !== 'string') {\n return null;\n }\n\n const normalizedValue = value.trim();\n if (normalizedValue === '') {\n return null;\n }\n\n if (/^\\d{4}-\\d{2}-\\d{2}$/.test(normalizedValue)) {\n return tryParse(() => {\n return parseDate(normalizedValue);\n });\n }\n\n const parsers: (() => unknown)[] = [\n ...(timeZone && isNaiveDateTimeString(normalizedValue)\n ? [\n () => {\n return parseZonedDateTime(`${normalizedValue}[${timeZone}]`);\n },\n ]\n : []),\n () => {\n return timeZone\n ? parseAbsolute(normalizedValue, timeZone)\n : parseAbsoluteToLocal(normalizedValue);\n },\n () => {\n return parseZonedDateTime(normalizedValue);\n },\n () => {\n return parseDateTime(normalizedValue);\n },\n () => {\n return parseDate(normalizedValue);\n },\n ];\n\n return (\n parsers\n .map((parser) => {\n return tryParse(parser);\n })\n .find((parsedValue) => {\n return parsedValue != null;\n }) ?? null\n );\n};\n\n/** Resolve the timezone used by the DatePicker when time fields are enabled. */\nexport const resolveDatePickerTimeZone = (\n withTime: boolean,\n timeZone?: string,\n): string | undefined => {\n if (!withTime) {\n return timeZone;\n }\n\n return timeZone ?? getLocalTimeZone();\n};\n\n/** Build the default placeholder value for time-enabled pickers. */\nexport const getDatePickerPlaceholderValue = (\n withTime: boolean,\n timeZone?: string,\n): DatePickerValue => {\n const resolvedTimeZone = resolveDatePickerTimeZone(withTime, timeZone);\n if (!resolvedTimeZone || !withTime) {\n return undefined;\n }\n\n return asDatePickerValue(now(resolvedTimeZone));\n};\n\n/**\n * Convert a date value into a UTC ISO string.\n *\n * `CalendarDate` and `CalendarDateTime` values are interpreted in the provided\n * timezone. `ZonedDateTime` values use their own timezone and offset.\n */\nexport const dateValueToUtcIsoString = (\n value: DatePickerValue,\n timeZone: string,\n): string | null => {\n if (value == null) {\n return null;\n }\n\n const maybeWithAbsoluteString = value as { toAbsoluteString?: () => string };\n if (typeof maybeWithAbsoluteString.toAbsoluteString === 'function') {\n return maybeWithAbsoluteString.toAbsoluteString();\n }\n\n const maybeWithToDate = value as { toDate?: (zone: string) => Date };\n if (typeof maybeWithToDate.toDate === 'function') {\n return maybeWithToDate.toDate(timeZone).toISOString();\n }\n\n return null;\n};\n\n/** Converts edited dates to the configured form storage format */\nexport const createDatePickerValueTransform = ({\n timeZone,\n valueType,\n withTime,\n}: Pick<\n DatePickerProps,\n 'timeZone' | 'valueType' | 'withTime'\n>): InputValueTransform => {\n const resolvedTimeZone = resolveDatePickerTimeZone(\n withTime ?? false,\n timeZone,\n );\n\n return {\n toDisplayValue: (value) => {\n return value ?? '';\n },\n toFormValue: (value) => {\n const nextValue = value as DatePickerValue;\n if (nextValue == null) {\n return null;\n }\n\n if (valueType === 'dateValue') {\n return nextValue;\n }\n\n // string storage remains UTC regardless of the display timezone\n return (\n dateValueToUtcIsoString(nextValue, resolvedTimeZone ?? 'UTC') ??\n String(nextValue)\n );\n },\n };\n};\n","import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\n\nimport { tv } from '@fuf-stack/pixel-utils';\n\nimport { segmentedInputVariants } from '../Time/timeVariants';\n\nexport const datePickerVariants = tv({\n extend: segmentedInputVariants,\n slots: {\n /** Container for the date input and supporting text */\n base: '',\n /** Calendar panel inside the popup */\n calendar: [\n '',\n 'relative inline-block w-64 max-w-full overflow-hidden rounded-large bg-default-50 dark:bg-background',\n ],\n /** Previous or next month button */\n calendarButton: [\n // navigation button layout and appearance\n 'outline-solid flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-default-400 outline-transparent',\n // hover and disabled states\n 'hover:bg-default/40 data-[disabled=true]:opacity-disabled',\n // keyboard focus outline\n 'data-[focus-visible=true]:outline-2 data-[focus-visible=true]:outline-offset-2 data-[focus-visible=true]:outline-focus',\n ],\n /** Calendar grid and navigation area */\n calendarContent: ['', 'w-full'],\n /** Row containing month navigation */\n calendarHeader:\n 'flex items-center justify-between gap-2 bg-content1 px-4 py-2',\n /** Currently displayed month and year */\n calendarTitle: 'flex-1 text-center font-medium text-default-500 text-small',\n /** Selectable date with interaction states */\n cell: [\n // day cell layout and appearance\n 'outline-solid flex h-8 w-8 cursor-pointer select-none items-center justify-center rounded-full text-foreground outline-transparent transition-colors',\n // focus stacking and unavailable cursors\n 'data-[focus-visible=true]:z-10 data-[disabled=true]:cursor-default data-[unavailable=true]:cursor-default',\n // hover and selection backgrounds\n 'data-[hovered=true]:bg-primary-50 data-[selected=true]:bg-primary data-[selected=true]:data-[hovered=true]:bg-primary',\n // day text states\n 'data-[disabled=true]:text-default-300 data-[hovered=true]:text-primary-400 data-[selected=true]:data-[hovered=true]:text-primary-foreground data-[selected=true]:text-primary-foreground data-[unavailable=true]:text-default-300 data-[unavailable=true]:line-through',\n // keyboard focus outline\n 'data-[focus-visible=true]:outline-2 data-[focus-visible=true]:outline-offset-2 data-[focus-visible=true]:outline-focus',\n // reduced motion\n 'motion-reduce:transition-none',\n ],\n /** Keyboard focus boundary inside the popup */\n dialog: 'flex flex-col outline-none',\n /** Table of selectable dates */\n grid: 'z-0 w-full border-collapse',\n /** Rows containing calendar dates */\n gridBody:\n '[&>tr:first-child]:mt-2 [&>tr>td]:px-0 [&>tr>td]:py-0.5 [&>tr]:flex [&>tr]:items-center [&>tr]:justify-center',\n /** Row containing weekday headings */\n gridHeader:\n 'bg-content1 shadow-[0px_20px_20px_0px_rgb(0_0_0/0.05)] [&>tr]:flex [&>tr]:justify-center [&>tr]:px-4 [&>tr]:pb-2',\n /** Individual weekday heading */\n gridHeaderCell:\n 'flex w-8 items-center justify-center font-medium text-default-400 text-small',\n /** Viewport around the calendar grid */\n gridWrapper: 'relative flex h-auto max-w-full overflow-hidden pb-2',\n /** Invalid color for content beside segments */\n innerWrapper: 'group-data-[invalid=true]:text-danger',\n /** Input surface with a focus indicator */\n inputWrapper: [\n 'bg-content1 focus-within:border-focus',\n 'group-data-[invalid=true]:border-danger group-data-[invalid=true]:focus-within:border-danger group-data-[invalid=true]:hover:border-danger group-data-[invalid=true]:focus-within:hover:border-danger',\n ],\n /** Label above the date input */\n /** Floating surface around the calendar */\n popoverContent: [\n '',\n 'z-50 rounded-large bg-content1 shadow-medium outline-none text-small',\n ],\n /** Invalid editable value and separator states */\n segment:\n 'data-[invalid=true]:data-[editable=true]:data-[placeholder=true]:text-danger data-[invalid=true]:data-[editable=true]:text-danger data-[invalid=true]:text-danger-300 data-[invalid=true]:focus:bg-danger-400/50 data-[invalid=true]:data-[editable=true]:focus:text-danger dark:data-[invalid=true]:focus:bg-danger-400/20',\n /** Button opening the calendar popup */\n selectorButton: [\n '',\n // calendar trigger layout and appearance\n 'outline-solid relative -mx-2 inline-flex h-8 min-h-8 w-8 min-w-8 shrink-0 items-center justify-center rounded-full text-inherit outline-transparent text-tiny',\n // hover background\n 'hover:bg-default/40',\n // keyboard focus outline\n 'data-[focus-visible=true]:outline-2 data-[focus-visible=true]:outline-offset-2 data-[focus-visible=true]:outline-focus',\n ],\n /** Icon inside the calendar toggle */\n selectorIcon: ['', 'h-[18px] w-[18px]'],\n /** Time input below the calendar */\n timeInput: [\n '',\n 'group flex w-full flex-row flex-wrap items-center gap-x-6 px-5 pb-4',\n ],\n /** Label beside the calendar time input */\n timeInputLabel: ['', 'relative font-medium text-foreground text-tiny'],\n /** Surface around the calendar time segments */\n timeInputWrapper: [\n // time input frame and surface\n 'shadow-xs relative inline-flex h-8 min-h-8 w-full flex-1 items-center rounded-small bg-default-100 px-2',\n // hover and focus backgrounds\n 'hover:bg-default-200 focus-within:hover:bg-default-100',\n ],\n },\n variants: {\n disabled: { true: { base: 'pointer-events-none opacity-disabled' } },\n readOnly: {\n true: {\n // inner controls set their own cursors, override every descendant\n base: 'cursor-not-allowed opacity-disabled **:cursor-not-allowed',\n },\n },\n },\n});\n\nexport type VariantProps = TVProps<typeof datePickerVariants>;\n\nexport type ClassName = TVClassName<typeof datePickerVariants>;\n\n/** Resolved class names for the date input and calendar slots */\nexport type DatePickerClassNames = Record<\n keyof ReturnType<typeof datePickerVariants>,\n string\n>;\n","interface DatePickerChevronProps {\n /** Points toward the previous month */\n previous?: boolean;\n}\n\n/** Decorative direction indicator for calendar navigation */\nconst DatePickerChevron = ({ previous = false }: DatePickerChevronProps) => {\n return (\n <svg\n aria-hidden\n className={\n previous ? 'h-4 w-4 rtl:rotate-180' : 'h-4 w-4 rotate-180 rtl:rotate-0'\n }\n fill=\"none\"\n viewBox=\"0 0 16 16\"\n >\n <path\n d=\"M10 3.33334L6 8.00001L10 12.6667\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"1.5\"\n />\n </svg>\n );\n};\n\nexport default DatePickerChevron;\n","import type { ComponentProps } from 'react';\nimport type { DatePickerRenderProps } from 'react-aria-components';\nimport type { DatePickerValue } from '../dateHelpers';\nimport type { DatePickerProps } from '../DatePicker';\nimport type { DatePickerClassNames } from '../datePickerVariants';\n\nimport {\n Button,\n Calendar,\n CalendarCell,\n CalendarGrid,\n CalendarGridBody,\n CalendarGridHeader,\n CalendarHeaderCell,\n DateInput,\n DateSegment,\n Dialog,\n Heading,\n Label,\n Popover,\n TimeField,\n} from 'react-aria-components';\n\nimport DatePickerChevron from './DatePickerChevron';\n\ninterface DatePickerCalendarProps extends Pick<\n DatePickerProps,\n 'hideTimeZone' | 'hourCycle' | 'withTime'\n> {\n /** CSS class name */\n className: DatePickerClassNames;\n /** Latest selectable date and time */\n maxValue: DatePickerValue;\n /** Earliest selectable date and time */\n minValue: DatePickerValue;\n /** Date and zone used for an empty time field */\n placeholderValue: DatePickerValue;\n /** Locks the time editor of an already open popup */\n readOnly: boolean;\n /** Calendar selection and popup state */\n state: DatePickerRenderProps['state'];\n}\n\n/**\n * Calendar popup with month navigation and an optional time editor\n *\n * @see https://react-aria.adobe.com/DatePicker\n * @see https://react-aria.adobe.com/Calendar\n */\nconst DatePickerCalendar = ({\n className: classNames,\n hideTimeZone,\n hourCycle,\n maxValue,\n minValue,\n placeholderValue,\n readOnly,\n state,\n withTime,\n}: DatePickerCalendarProps) => {\n // keep the calendar's date while editing its time\n const handleTimeChange: NonNullable<\n ComponentProps<typeof TimeField>['onChange']\n > = (next) => {\n if (next && !readOnly) {\n state.setTimeValue(next);\n }\n };\n\n return (\n <Popover\n className={classNames.popoverContent}\n data-slot=\"popover-content\"\n offset={4}\n placement=\"bottom\"\n >\n <Dialog className={classNames.dialog}>\n <Calendar className={classNames.calendar} data-slot=\"calendar\">\n <div\n className={classNames.calendarContent}\n data-slot=\"calendar-content\"\n >\n <header\n className={classNames.calendarHeader}\n data-slot=\"header-wrapper\"\n >\n <Button\n className={classNames.calendarButton}\n data-slot=\"prev-button\"\n slot=\"previous\"\n >\n <DatePickerChevron previous />\n </Button>\n <Heading className={classNames.calendarTitle} data-slot=\"title\" />\n <Button\n className={classNames.calendarButton}\n data-slot=\"next-button\"\n slot=\"next\"\n >\n <DatePickerChevron />\n </Button>\n </header>\n <div className={classNames.gridWrapper} data-slot=\"grid-wrapper\">\n <CalendarGrid\n className={classNames.grid}\n data-slot=\"grid\"\n weekdayStyle=\"narrow\"\n >\n <CalendarGridHeader className={classNames.gridHeader}>\n {(day) => {\n return (\n <CalendarHeaderCell className={classNames.gridHeaderCell}>\n {day}\n </CalendarHeaderCell>\n );\n }}\n </CalendarGridHeader>\n <CalendarGridBody className={classNames.gridBody}>\n {(date) => {\n return (\n <CalendarCell\n className={classNames.cell}\n data-slot=\"cell-button\"\n date={date}\n />\n );\n }}\n </CalendarGridBody>\n </CalendarGrid>\n </div>\n </div>\n {withTime ? (\n <TimeField\n className={classNames.timeInput}\n data-slot=\"time-input\"\n granularity=\"minute\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n isReadOnly={readOnly}\n maxValue={maxValue && 'hour' in maxValue ? maxValue : undefined}\n minValue={minValue && 'hour' in minValue ? minValue : undefined}\n onChange={handleTimeChange}\n placeholderValue={\n placeholderValue && 'hour' in placeholderValue\n ? placeholderValue\n : undefined\n }\n shouldForceLeadingZeros\n validationBehavior=\"aria\"\n value={state.timeValue ?? null}\n >\n <Label\n className={classNames.timeInputLabel}\n data-slot=\"time-input-label\"\n >\n Time\n </Label>\n <div className={classNames.timeInputWrapper}>\n <DateInput className={classNames.input}>\n {(segment) => {\n return (\n <DateSegment\n className={classNames.segment}\n data-editable={segment.isEditable || undefined}\n segment={segment}\n />\n );\n }}\n </DateInput>\n </div>\n </TimeField>\n ) : null}\n </Calendar>\n </Dialog>\n </Popover>\n );\n};\n\nexport default DatePickerCalendar;\n","import type { DatePickerClassNames } from '../datePickerVariants';\n\nimport { Button } from 'react-aria-components';\n\ninterface DatePickerTriggerProps {\n /** CSS class name */\n className: Pick<DatePickerClassNames, 'selectorButton' | 'selectorIcon'>;\n}\n\n/**\n * Calendar button connected to the surrounding date picker’s popup state\n *\n * @see https://react-aria.adobe.com/DatePicker\n * @see https://react-aria.adobe.com/Button\n */\nconst DatePickerTrigger = ({\n className: classNames,\n}: DatePickerTriggerProps) => {\n return (\n <Button className={classNames.selectorButton} data-slot=\"selector-button\">\n <svg\n aria-hidden\n className={classNames.selectorIcon}\n data-slot=\"selector-icon\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <path\n d=\"M7.75 2.5a.75.75 0 0 0-1.5 0v1.58c-1.44.115-2.384.397-3.078 1.092c-.695.694-.977 1.639-1.093 3.078h19.842c-.116-1.44-.398-2.384-1.093-3.078c-.694-.695-1.639-.977-3.078-1.093V2.5a.75.75 0 0 0-1.5 0v1.513C15.585 4 14.839 4 14 4h-4c-.839 0-1.585 0-2.25.013z\"\n fill=\"currentColor\"\n />\n <path\n clipRule=\"evenodd\"\n d=\"M2 12c0-.839 0-1.585.013-2.25h19.974C22 10.415 22 11.161 22 12v2c0 3.771 0 5.657-1.172 6.828C19.657 22 17.771 22 14 22h-4c-3.771 0-5.657 0-6.828-1.172C2 19.657 2 17.771 2 14zm15 2a1 1 0 1 0 0-2a1 1 0 0 0 0 2m0 4a1 1 0 1 0 0-2a1 1 0 0 0 0 2m-4-5a1 1 0 1 1-2 0a1 1 0 0 1 2 0m0 4a1 1 0 1 1-2 0a1 1 0 0 1 2 0m-6-3a1 1 0 1 0 0-2a1 1 0 0 0 0 2m0 4a1 1 0 1 0 0-2a1 1 0 0 0 0 2\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n />\n </svg>\n </Button>\n );\n};\n\nexport default DatePickerTrigger;\n","import type { ReactNode } from 'react';\nimport type { UniformField } from '../../hooks/useUniformField/types';\nimport type { DatePickerValue } from '../dateHelpers';\nimport type { DatePickerClassNames } from '../datePickerVariants';\n\nimport {\n DateField,\n DateInput,\n DateSegment,\n Group,\n} from 'react-aria-components';\n\nimport FieldHelper from '../../partials/FieldHelper/FieldHelper';\nimport DatePickerTrigger from './DatePickerTrigger';\n\ninterface DatePickerInputProps {\n /** Reset bridge rendered inside the date field */\n children: ReactNode;\n /** CSS class name */\n className: DatePickerClassNames;\n /** Bound field values, interactions and metadata */\n field: UniformField<unknown, DatePickerValue>;\n}\n\n/**\n * Editable date segments with a calendar trigger and supporting messages\n *\n * Keeps the reset bridge inside DateField so partial edits reset with the form\n *\n * @see https://react-aria.adobe.com/DateField\n * @see https://react-aria.adobe.com/DatePicker\n * @see https://react-aria.adobe.com/Group\n */\nconst DatePickerInput = ({\n children,\n className: classNames,\n field,\n}: DatePickerInputProps) => {\n const { description, errorMessage, ids, invalid, testId } = field;\n\n return (\n <>\n <Group\n className={classNames.inputWrapper}\n data-slot=\"input-wrapper\"\n data-testid={testId}\n >\n <div className={classNames.innerWrapper} data-slot=\"inner-wrapper\">\n <DateField className=\"flex h-full w-full\">\n {children}\n <DateInput className={classNames.input} data-slot=\"input-field\">\n {(segment) => {\n return (\n <DateSegment\n className={classNames.segment}\n data-editable={segment.isEditable || undefined}\n data-slot=\"segment\"\n segment={segment}\n />\n );\n }}\n </DateInput>\n </DateField>\n <DatePickerTrigger className={classNames} />\n </div>\n </Group>\n\n {/* help text and validation messages, below the input surface */}\n <FieldHelper\n className={classNames}\n description={description}\n errorMessage={errorMessage}\n ids={ids}\n invalid={invalid}\n />\n </>\n );\n};\n\nexport default DatePickerInput;\n","import type { ReactNode } from 'react';\nimport type { UniformField } from '../../hooks/useUniformField/types';\nimport type { DatePickerValue } from '../dateHelpers';\nimport type { DatePickerProps } from '../DatePicker';\n\nimport { DatePicker as AriaDatePicker, Label } from 'react-aria-components';\n\nimport { useStyling } from '@fuf-stack/pixels/StylingProvider';\n\nimport { getFieldControlProps } from '../../helpers/fieldProps/fieldProps';\nimport FieldLabel from '../../partials/FieldLabel/FieldLabel';\nimport {\n getDatePickerPlaceholderValue,\n parseDateValue,\n resolveDatePickerTimeZone,\n} from '../dateHelpers';\nimport { datePickerVariants } from '../datePickerVariants';\nimport DatePickerCalendar from './DatePickerCalendar';\nimport DatePickerInput from './DatePickerInput';\n\ninterface DatePickerControlProps extends Pick<\n DatePickerProps,\n | 'className'\n | 'hideTimeZone'\n | 'hourCycle'\n | 'maxValue'\n | 'minValue'\n | 'timeZone'\n | 'withTime'\n> {\n /** Reset bridge rendered inside the date engine */\n children: ReactNode;\n /** Bound field values, interactions and metadata */\n field: UniformField<unknown, DatePickerValue>;\n}\n\n/**\n * Date input presentation with editable segments, field messages and calendar\n *\n * @see https://react-aria.adobe.com/DatePicker\n */\nconst DatePickerControl = ({\n children,\n className,\n field,\n hideTimeZone,\n hourCycle,\n maxValue,\n minValue,\n timeZone,\n withTime = false,\n}: DatePickerControlProps) => {\n const styling = useStyling();\n\n const {\n disabled,\n ids,\n ref: inputRef,\n invalid,\n label,\n name,\n onBlur,\n onChange: onValueChange,\n readOnly,\n required,\n } = field;\n\n // associate the editable control with its label and messages\n const controlProps = getFieldControlProps(field);\n\n const resolvedTimeZone = resolveDatePickerTimeZone(withTime, timeZone);\n const displayTimeZone = withTime ? resolvedTimeZone : timeZone;\n\n // parse stored values and boundaries for the date engine\n const value = parseDateValue(field.value, displayTimeZone);\n const parsedMinValue = parseDateValue(minValue, displayTimeZone);\n const parsedMaxValue = parseDateValue(maxValue, displayTimeZone);\n\n const placeholderValue = getDatePickerPlaceholderValue(withTime, timeZone);\n\n // classNames from slots\n const variants = styling.resolve(datePickerVariants, { disabled, readOnly });\n const classNames = styling.variantsToClassNames(variants, className, 'base');\n\n // read-only values ignore edits, e.g. from a calendar popup that was\n // already open when the field became read-only\n const handleValueChange = (nextValue: DatePickerValue | null) => {\n if (!readOnly) {\n onValueChange(nextValue);\n }\n };\n\n // route form focus to the first enabled date segment\n const handleControlRef = (element: HTMLDivElement | null) => {\n inputRef(\n element\n ? {\n focus: () => {\n element\n .querySelector<HTMLElement>(\n '[role=\"spinbutton\"]:not([aria-disabled=\"true\"])',\n )\n ?.focus();\n },\n }\n : null,\n );\n };\n\n return (\n <AriaDatePicker\n ref={handleControlRef}\n aria-describedby={controlProps['aria-describedby']}\n aria-invalid={controlProps['aria-invalid']}\n aria-label={controlProps['aria-label']}\n className={classNames.base}\n data-component=\"date-picker\"\n data-slot=\"base\"\n granularity={withTime ? 'minute' : 'day'}\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n id={controlProps.id}\n isDisabled={disabled}\n isInvalid={invalid}\n isReadOnly={readOnly}\n isRequired={required}\n maxValue={parsedMaxValue ?? undefined}\n minValue={parsedMinValue ?? undefined}\n name={name}\n onBlur={onBlur}\n onChange={handleValueChange}\n placeholderValue={placeholderValue ?? undefined}\n shouldCloseOnSelect={!withTime}\n shouldForceLeadingZeros\n validationBehavior=\"aria\"\n value={value ?? null}\n >\n {({ state }) => {\n return (\n <>\n {/* field label */}\n {label ? (\n <FieldLabel\n as={Label}\n className={classNames.label}\n id={ids.label}\n required={required}\n >\n {label}\n </FieldLabel>\n ) : null}\n\n {/* date segments and calendar trigger */}\n <DatePickerInput className={classNames} field={field}>\n {children}\n </DatePickerInput>\n\n {/* calendar popup */}\n <DatePickerCalendar\n className={classNames}\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n maxValue={parsedMaxValue}\n minValue={parsedMinValue}\n placeholderValue={placeholderValue}\n readOnly={readOnly}\n state={state}\n withTime={withTime}\n />\n </>\n );\n }}\n </AriaDatePicker>\n );\n};\n\nexport default DatePickerControl;\n","import { useContext } from 'react';\nimport { DateFieldStateContext } from 'react-aria-components';\n\nimport { useWatchFormReset } from '../../hooks/useWatchFormReset';\n\n/**\n * Clears partial segment edits when the form resets an empty field\n *\n * @see https://react-aria.adobe.com/DatePicker\n */\nconst DatePickerReset = () => {\n const state = useContext(DateFieldStateContext);\n\n useWatchFormReset({\n onReset: () => {\n if (state?.value == null) {\n state?.setValue(null);\n }\n },\n });\n\n return null;\n};\n\nexport default DatePickerReset;\n","import type { ReactNode } from 'react';\nimport type { ClassName } from './datePickerVariants';\n\nimport useUniformField from '../hooks/useUniformField/useUniformField';\nimport { createDatePickerValueTransform } from './dateHelpers';\nimport DatePickerControl from './subcomponents/DatePickerControl';\nimport DatePickerReset from './subcomponents/DatePickerReset';\n\nexport { datePickerVariants } from './datePickerVariants';\n\nexport interface DatePickerProps {\n /** Custom aria-label for accessibility. If not provided, falls back to field name when no visible label exists */\n ariaLabel?: string;\n /** CSS class name */\n className?: ClassName;\n /** Optional help text associated with editable date segments. */\n description?: ReactNode;\n /** date picker is disabled */\n disabled?: boolean;\n /** hide timezone abbreviation for zoned values */\n hideTimeZone?: boolean;\n /**\n * Optional hour cycle override.\n *\n * Defaults to a 24-hour cycle.\n */\n hourCycle?: 12 | 24;\n /** form field label */\n label?: ReactNode;\n /** latest selectable value as ISO string */\n maxValue?: string;\n /** earliest selectable value as ISO string */\n minValue?: string;\n /** form field name */\n name: string;\n /** Prevents changes while keeping the value in validation and submission */\n readOnly?: boolean;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /**\n * Optional advanced override for the display/interpretation timezone.\n *\n * When omitted, the picker uses the current user's local timezone while\n * `withTime` is enabled.\n */\n timeZone?: string;\n /** value format stored in form state (`string` stores UTC ISO values) */\n valueType?: 'dateValue' | 'string';\n /**\n * Enables date-time mode.\n *\n * - `false` (default): date-only input (`day` granularity)\n * - `true`: includes time segments (`minute` granularity)\n */\n withTime?: boolean;\n}\n\n/** Form input field for a date, with an optional time and calendar picker */\nconst DatePicker = ({\n className = undefined,\n hourCycle = 24,\n hideTimeZone = false,\n maxValue = undefined,\n minValue = undefined,\n name,\n timeZone = undefined,\n valueType = 'string',\n withTime = false,\n ...uniformFieldProps\n}: DatePickerProps) => {\n const transform = createDatePickerValueTransform({\n timeZone,\n valueType,\n withTime,\n });\n\n const { field } = useUniformField({\n ...uniformFieldProps,\n name,\n transform,\n });\n\n return (\n <DatePickerControl\n className={className}\n field={field}\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n maxValue={maxValue}\n minValue={minValue}\n timeZone={timeZone}\n withTime={withTime}\n >\n <DatePickerReset />\n </DatePickerControl>\n );\n};\n\nexport default DatePicker;\n","import DatePicker from './DatePicker';\n\nexport type { DatePickerProps } from './DatePicker';\n\nexport { datePickerVariants } from './DatePicker';\n\nexport default DatePicker;\n"],"mappings":";;;;;;;;;;;;;;AAuBA,MAAM,qBAAqB,UAAoC;CAC7D,OAAO;AACT;;AAGA,MAAM,mBAAmB,UAAoC;CAC3D,OAAO,CAAC,CAAC,SAAS,OAAO,UAAU,YAAY,cAAc;AAC/D;;AAGA,MAAM,yBAAyB,UAA2B;CACxD,OAAO,sBAAsB,KAAK,KAAK,KAAK,CAAC,oBAAoB,KAAK;AACxE;;AAGA,MAAM,uBAAuB,UAA2B;CACtD,IAAI,MAAM,SAAS,GAAG,KAAK,MAAM,SAAS,GAAG,GAC3C,OAAO;CAGT,OAAO,4BAA4B,KAAK,KAAK;AAC/C;;AAGA,MAAM,YAAY,WAA2C;CAC3D,IAAI;EACF,OAAO,kBAAkB,OAAO,CAAC;CACnC,QAAQ;EACN,OAAO;CACT;AACF;;;;;;;;AASA,MAAa,kBACX,OACA,aACoB;CACpB,IAAI,SAAS,QAAQ,UAAU,IAC7B,OAAO;CAGT,IAAI,gBAAgB,KAAK,GACvB,OAAO,kBAAkB,KAAK;CAGhC,IAAI,iBAAiB,MACnB,OAAO,kBACL,WACI,cAAc,MAAM,YAAY,GAAG,QAAQ,IAC3C,qBAAqB,MAAM,YAAY,CAAC,CAC9C;CAGF,IAAI,OAAO,UAAU,UACnB,OAAO;CAGT,MAAM,kBAAkB,MAAM,KAAK;CACnC,IAAI,oBAAoB,IACtB,OAAO;CAGT,IAAI,sBAAsB,KAAK,eAAe,GAC5C,OAAO,eAAe;EACpB,OAAO,UA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EACZ,YAAY;EACZ,UAAU,kBAAkB,KAAA;EAC5B,UAAU,kBAAkB,KAAA;EACtB;EACE;EACR,UAAU;EACV,kBAAkB,oBAAoB,KAAA;EACtC,qBAAqB,CAAC;EACtB,yBAAA;EACA,oBAAmB;EACnB,OAAO,SAAS;EAEd,WAAA,EAAE,YAAY;GACd,OACE,qBAAA,UAAA,EAAA,UAAA;IAEG,QACC,oBAAC,YAAD;KACE,IAAI;KACJ,WAAW,WAAW;KACtB,IAAI,IAAI;KACE;KAET,UAAA;IACS,CAAA,IACV;IAGJ,oBAAC,iBAAD;KAAiB,WAAW;KAAmB;KAC5C;IACc,CAAA;IAGjB,oBAAC,oBAAD;KACE,WAAW;KACG;KACH;KACX,UAAU;KACV,UAAU;KACQ;KACR;KACH;KACG;IACX,CAAA;GACD,EAAA,CAAA;EAEN;CACc,CAAA;AAEpB;;;;;;;ACpKA,MAAM,wBAAwB;CAC5B,MAAM,QAAQ,WAAW,qBAAqB;CAE9C,kBAAkB,EAChB,eAAe;EACb,IAAI,OAAO,SAAS,MAClB,OAAO,SAAS,IAAI;CAExB,EACF,CAAC;CAED,OAAO;AACT;;;ACoCA,MAAMC,gBAAc,EAClB,YAAY,KAAA,GACZ,YAAY,IACZ,eAAe,OACf,WAAW,KAAA,GACX,WAAW,KAAA,GACX,MACA,WAAW,KAAA,GACX,YAAY,UACZ,WAAW,OACX,GAAG,wBACkB;CACrB,MAAM,YAAY,+BAA+B;EAC/C;EACA;EACA;CACF,CAAC;CAED,MAAM,EAAE,UAAU,gBAAgB;EAChC,GAAG;EACH;EACA;CACF,CAAC;CAED,OACE,oBAAC,mBAAD;EACa;EACJ;EACO;EACH;EACD;EACA;EACA;EACA;EAEV,UAAA,oBAAC,iBAAD,CAAkB,CAAA;CACD,CAAA;AAEvB;;AC1FA,IAAA,qBAAeC"}
@@ -1,9 +1,11 @@
1
1
  import { flatArrayKey, isValueEmpty } from "../helpers/index.mjs";
2
2
  import { n as useFormContext$1 } from "../useFormContext-piqnN2L-.mjs";
3
- import { n as useUniformField, t as FieldLabel } from "../FieldLabel-DrNWJIVh.mjs";
3
+ import { t as useUniformField } from "../useUniformField-TTNPTsVn.mjs";
4
4
  import { useWatchFormReset } from "../hooks/useWatchFormReset/index.mjs";
5
5
  import { t as Grid_default } from "../Grid-DBL29Kwb.mjs";
6
- import { n as FieldValidationError } from "../FieldValidationError-iAayfTEw.mjs";
6
+ import { t as FieldLabel } from "../FieldLabel-DMTqq0Jj.mjs";
7
+ import { n as FieldValidationError } from "../FieldValidationError-BuLvuRyi.mjs";
8
+ import { t as fieldHelperVariants } from "../fieldHelperVariants-ClP8taiS.mjs";
7
9
  import { useEffect, useId, useMemo, useRef, useState } from "react";
8
10
  import { Button, Menu } from "@fuf-stack/pixels";
9
11
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -430,12 +432,12 @@ const FieldArrayLabel = ({ className = void 0, id = void 0, label, invalid, requ
430
432
  });
431
433
  };
432
434
  // src/FieldArray/subcomponents/fieldArrayValidationErrorVariants.ts
433
- const fieldArrayValidationErrorVariants = tv({ slots: {
434
- /** Container for array-level validation messages */
435
- errorMessage: "text-danger text-tiny",
435
+ const fieldArrayValidationErrorVariants = tv({
436
+ extend: fieldHelperVariants,
437
+ slots: {
436
438
  /** Padded footer containing array-level validation */
437
- helperWrapper: ["relative flex-col gap-1.5", "block px-3 pb-2 pt-1"]
438
- } });
439
+ helperWrapper: "px-3 pb-2 pt-1" }
440
+ });
439
441
  // src/FieldArray/subcomponents/FieldArrayValidationError.tsx
440
442
  /**
441
443
  * Renders array-level validation errors for FieldArray.