@fuf-stack/uniform 1.24.1 → 1.24.3

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 (120) hide show
  1. package/dist/Checkboxes/index.cjs.map +1 -1
  2. package/dist/Checkboxes/index.d.cts +1 -1
  3. package/dist/Checkboxes/index.d.cts.map +1 -1
  4. package/dist/Checkboxes/index.d.ts +1 -1
  5. package/dist/Checkboxes/index.d.ts.map +1 -1
  6. package/dist/DatePicker/index.cjs.map +1 -1
  7. package/dist/DatePicker/index.d.cts +1 -1
  8. package/dist/DatePicker/index.d.cts.map +1 -1
  9. package/dist/DatePicker/index.d.ts +1 -1
  10. package/dist/DatePicker/index.d.ts.map +1 -1
  11. package/dist/DatePicker/index.js.map +1 -1
  12. package/dist/FieldArray/index.cjs.map +1 -1
  13. package/dist/FieldArray/index.d.cts +1 -1
  14. package/dist/FieldArray/index.d.cts.map +1 -1
  15. package/dist/FieldArray/index.d.ts +1 -1
  16. package/dist/FieldArray/index.d.ts.map +1 -1
  17. package/dist/FieldArray/index.js.map +1 -1
  18. package/dist/FieldCard/index.cjs.map +1 -1
  19. package/dist/FieldCard/index.d.cts +1 -1
  20. package/dist/FieldCard/index.d.cts.map +1 -1
  21. package/dist/FieldCard/index.d.ts +1 -1
  22. package/dist/FieldCard/index.d.ts.map +1 -1
  23. package/dist/FieldCard/index.js.map +1 -1
  24. package/dist/FieldCopyTestIdButton-CRJBix9D.js.map +1 -1
  25. package/dist/FieldCopyTestIdButton-D3D_LmJh.cjs.map +1 -1
  26. package/dist/FieldValidationError-CfYKzl7P.cjs.map +1 -1
  27. package/dist/Form/index.cjs.map +1 -1
  28. package/dist/Form/index.d.cts +1 -1
  29. package/dist/Form/index.d.cts.map +1 -1
  30. package/dist/Form/index.d.ts +1 -1
  31. package/dist/Form/index.d.ts.map +1 -1
  32. package/dist/FormContext-DjJOJKxj.js.map +1 -1
  33. package/dist/FormContext-EGH0cVnH.cjs.map +1 -1
  34. package/dist/Grid/index.d.cts +1 -1
  35. package/dist/Grid/index.d.cts.map +1 -1
  36. package/dist/Grid/index.d.ts +1 -1
  37. package/dist/Grid/index.d.ts.map +1 -1
  38. package/dist/Grid-BbqCRkuY.cjs.map +1 -1
  39. package/dist/Input/index.cjs.map +1 -1
  40. package/dist/Input/index.d.cts +1 -1
  41. package/dist/Input/index.d.cts.map +1 -1
  42. package/dist/Input/index.d.ts +1 -1
  43. package/dist/Input/index.d.ts.map +1 -1
  44. package/dist/RadioBoxes/index.cjs.map +1 -1
  45. package/dist/RadioBoxes/index.d.cts +11 -11
  46. package/dist/RadioBoxes/index.d.cts.map +1 -1
  47. package/dist/RadioBoxes/index.d.ts +11 -11
  48. package/dist/RadioBoxes/index.d.ts.map +1 -1
  49. package/dist/RadioBoxes/index.js.map +1 -1
  50. package/dist/RadioTabs/index.cjs.map +1 -1
  51. package/dist/RadioTabs/index.js.map +1 -1
  52. package/dist/Radios/index.cjs.map +1 -1
  53. package/dist/Radios/index.d.cts +10 -10
  54. package/dist/Radios/index.d.ts +10 -10
  55. package/dist/Select/index.cjs.map +1 -1
  56. package/dist/Select/index.d.cts +1 -1
  57. package/dist/Select/index.d.cts.map +1 -1
  58. package/dist/Select/index.d.ts +1 -1
  59. package/dist/Select/index.d.ts.map +1 -1
  60. package/dist/Select/index.js.map +1 -1
  61. package/dist/Slider/index.cjs.map +1 -1
  62. package/dist/Slider/index.d.cts +23 -23
  63. package/dist/Slider/index.d.cts.map +1 -1
  64. package/dist/Slider/index.d.ts +23 -23
  65. package/dist/Slider/index.d.ts.map +1 -1
  66. package/dist/Slider/index.js.map +1 -1
  67. package/dist/SubmitButton/index.cjs.map +1 -1
  68. package/dist/SubmitButton/index.d.cts +1 -1
  69. package/dist/SubmitButton/index.d.cts.map +1 -1
  70. package/dist/SubmitButton/index.d.ts +1 -1
  71. package/dist/SubmitButton/index.d.ts.map +1 -1
  72. package/dist/Switch/index.cjs.map +1 -1
  73. package/dist/Switch/index.d.cts +29 -29
  74. package/dist/Switch/index.d.cts.map +1 -1
  75. package/dist/Switch/index.d.ts +29 -29
  76. package/dist/Switch/index.d.ts.map +1 -1
  77. package/dist/Switch/index.js.map +1 -1
  78. package/dist/SwitchBox/index.cjs.map +1 -1
  79. package/dist/SwitchBox/index.d.cts +11 -11
  80. package/dist/SwitchBox/index.d.cts.map +1 -1
  81. package/dist/SwitchBox/index.d.ts +11 -11
  82. package/dist/SwitchBox/index.d.ts.map +1 -1
  83. package/dist/SwitchBox/index.js.map +1 -1
  84. package/dist/TextArea/index.cjs.map +1 -1
  85. package/dist/TextArea/index.d.cts +1 -1
  86. package/dist/TextArea/index.d.cts.map +1 -1
  87. package/dist/TextArea/index.d.ts +1 -1
  88. package/dist/TextArea/index.d.ts.map +1 -1
  89. package/dist/Time/index.cjs.map +1 -1
  90. package/dist/Time/index.d.cts +1 -1
  91. package/dist/Time/index.d.cts.map +1 -1
  92. package/dist/Time/index.d.ts +1 -1
  93. package/dist/Time/index.d.ts.map +1 -1
  94. package/dist/Time/index.js.map +1 -1
  95. package/dist/helpers/index.cjs.map +1 -1
  96. package/dist/helpers/index.js.map +1 -1
  97. package/dist/hooks/useClientValidation/index.cjs.map +1 -1
  98. package/dist/hooks/useClientValidation/index.js.map +1 -1
  99. package/dist/hooks/useInputValueDebounce/index.cjs.map +1 -1
  100. package/dist/hooks/useInputValueDebounce/index.js.map +1 -1
  101. package/dist/hooks/useUniformField/index.cjs.map +1 -1
  102. package/dist/hooks/useUniformField/index.js.map +1 -1
  103. package/dist/hooks/useUniformFieldArray/index.cjs.map +1 -1
  104. package/dist/hooks/useWatchFormReset/index.cjs.map +1 -1
  105. package/dist/hooks/useWatchUserChange/index.cjs.map +1 -1
  106. package/dist/partials/FieldCopyTestIdButton/index.d.cts +1 -1
  107. package/dist/partials/FieldCopyTestIdButton/index.d.cts.map +1 -1
  108. package/dist/partials/FieldCopyTestIdButton/index.d.ts +1 -1
  109. package/dist/partials/FieldCopyTestIdButton/index.d.ts.map +1 -1
  110. package/dist/partials/FieldValidationError/index.d.cts +1 -1
  111. package/dist/partials/FieldValidationError/index.d.cts.map +1 -1
  112. package/dist/partials/FieldValidationError/index.d.ts +1 -1
  113. package/dist/partials/FieldValidationError/index.d.ts.map +1 -1
  114. package/dist/useController-Dbe7ADG6.cjs.map +1 -1
  115. package/dist/useController-DxFS0u7c.js.map +1 -1
  116. package/dist/useFormContext-BJqa1FoT.js.map +1 -1
  117. package/dist/useFormContext-kUHonwgu.cjs.map +1 -1
  118. package/dist/useInputValueTransform-P62UUZBl.cjs.map +1 -1
  119. package/package.json +12 -13
  120. package/LICENSE +0 -21
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["heroCheckboxVariants","useUniformField","HeroCheckbox","HeroCheckboxGroup"],"sources":["../../src/Checkboxes/Checkboxes.tsx","../../src/Checkboxes/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type {\n CheckboxGroupProps as HeroCheckboxGroupProps,\n CheckboxProps as HeroCheckboxProps,\n} from '@heroui/checkbox';\nimport type { ReactNode } from 'react';\nimport type { InputValueTransform } from '../hooks/useInputValueTransform';\n\nimport {\n Checkbox as HeroCheckbox,\n CheckboxGroup as HeroCheckboxGroup,\n} from '@heroui/checkbox';\nimport { checkbox as heroCheckboxVariants } from '@heroui/theme';\n\nimport { slugify, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks/useUniformField';\n\nexport const checkboxesVariants = tv({\n slots: {\n base: [\n // Needs group for group-data condition.\n 'group',\n // Match shared field wrapper layout.\n 'flex w-full flex-col',\n // Keep spacing between label/group consistent.\n 'gap-y-1.5',\n ],\n errorMessage: 'text-tiny',\n // see HeroUI styles for group-data condition,\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/core/theme/src/components/select.ts\n label:\n 'inline-flex cursor-default text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:!text-danger',\n optionBase: '',\n optionIcon: '',\n optionLabel: '',\n optionLabelSubline: 'text-foreground-400 !text-small',\n optionWrapper: '',\n wrapper: '',\n },\n variants: {\n // see: https://github.com/heroui-inc/heroui/blob/canary/packages/core/theme/src/components/checkbox.ts\n color: {\n info: {\n wrapper:\n 'text-info-foreground after:bg-info after:text-info-foreground',\n },\n ...heroCheckboxVariants.variants.color,\n } as const,\n lineThrough: {\n true: {\n optionLabel: [\n ...heroCheckboxVariants.variants.lineThrough.true.label,\n // fix stroke position when used with subline and enable animation\n 'relative before:transition-all before:duration-200',\n ],\n optionLabelSubline: 'group-data-[selected=true]:opacity-60',\n },\n },\n },\n});\n\ntype VariantProps = TVProps<typeof checkboxesVariants>;\ntype ClassName = TVClassName<typeof checkboxesVariants>;\n\nexport interface CheckboxOption {\n /** option label */\n label?: ReactNode;\n /** subline displayed below the label */\n labelSubline?: ReactNode;\n /** Arbitrary option metadata for custom render logic. */\n meta?: Record<string, unknown>;\n /** option value */\n value: string;\n /** disables the option */\n disabled?: boolean;\n /** HTML data-testid attribute of the option */\n testId?: string;\n}\n\ninterface ChildRenderOption {\n /** Prebuilt checkbox element so consumers don't need to recreate HeroCheckbox */\n checkbox: ReactNode;\n /** Option data as provided in `options` */\n option: CheckboxOption;\n /** Render-state flags for this option */\n state: {\n /** Whether this option is currently selected */\n checked: boolean;\n /** Whether this option is disabled */\n disabled: boolean;\n /** Whether the checkbox group is invalid */\n invalid: boolean;\n };\n}\n\nexport interface CheckboxesProps extends VariantProps {\n /** Custom aria-label for accessibility. If not provided, falls back to field name when no visible label exists */\n ariaLabel?: string;\n /** Optional child render function for custom full-list layout rendering. */\n children?: (options: ChildRenderOption[]) => ReactNode;\n /** CSS class name */\n className?: ClassName;\n /** Color scheme of the checkboxes */\n color?: VariantProps['color'];\n /** Sets all checkboxes disabled */\n disabled?: boolean;\n /** Orientation of the checkboxes */\n inline?: boolean;\n /** Label displayed above the checkboxes */\n label?: ReactNode;\n /** Whether the checkboxes label should be crossed out */\n lineThrough?: boolean;\n /** Name the Field is registered on the form */\n name: string;\n /** Checkboxes that should be displayed. */\n options: CheckboxOption[];\n\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** allows disentangled display and form values for a field */\n transform?: InputValueTransform<string[]>;\n}\n\n/**\n * Checkboxes component based on [HeroUI CheckboxGroup](https://www.heroui.com//docs/components/checkbox-group)\n */\nconst Checkboxes = ({\n children = undefined,\n className = undefined,\n color = 'primary',\n inline = false,\n lineThrough = false,\n name,\n options,\n ...uniformFieldProps\n}: CheckboxesProps) => {\n const {\n ariaLabel,\n disabled,\n errorMessage,\n field: { onChange, value: fieldValue, ref, onBlur },\n invalid,\n label,\n required,\n testId,\n } = useUniformField({\n // Checkbox group values are arrays and can produce nested RHF error shapes.\n isArrayValue: true,\n name,\n ...uniformFieldProps,\n });\n\n // Ensure value is always an array (checkboxes need arrays)\n const value = Array.isArray(fieldValue) ? (fieldValue as string[]) : [];\n\n // classNames from slots\n const variants = checkboxesVariants({ lineThrough });\n const classNames = variantsToClassNames(variants, className, 'base');\n\n // map slots to HeroUI class names\n const heroCheckboxGroupClassNames: HeroCheckboxGroupProps['classNames'] = {\n base: classNames.base,\n label: classNames.label,\n wrapper: classNames.wrapper,\n };\n const heroCheckboxClassNames: HeroCheckboxProps['classNames'] = {\n base: classNames.optionBase,\n icon: classNames.optionIcon,\n label: classNames.optionLabel,\n wrapper: classNames.optionWrapper,\n };\n\n // Build option descriptors once so default and custom layouts share the same checkbox nodes/state.\n const renderedOptions = options?.map((option) => {\n const optionTestId = slugify(\n `${testId}_option_${option?.testId ?? option?.value}`,\n {\n replaceDots: true,\n },\n );\n\n // set content and classes depending option has subline\n const hasSubline = !!option.labelSubline;\n let labelContent: ReactNode;\n let optionClassNames = heroCheckboxClassNames;\n if (hasSubline) {\n labelContent = (\n <div className=\"flex grow flex-col items-start\">\n <span className={classNames.optionLabel}>{option.label}</span>\n <span className={classNames.optionLabelSubline}>\n {option.labelSubline}\n </span>\n </div>\n );\n // remove label classes from outer label when subline is used\n optionClassNames = { ...optionClassNames, label: '' };\n } else {\n labelContent = option.label;\n }\n\n const optionIsDisabled = !!disabled || !!option.disabled;\n const checkbox = (\n <HeroCheckbox\n key={`index_${option.value}`}\n aria-label={\n typeof option.label === 'string' ? option.label : option.value\n }\n classNames={optionClassNames}\n data-invalid={invalid}\n data-testid={optionTestId}\n isDisabled={optionIsDisabled}\n value={option?.value}\n >\n {labelContent}\n </HeroCheckbox>\n );\n\n return {\n checkbox,\n option,\n state: {\n checked: value.includes(option.value),\n disabled: optionIsDisabled,\n invalid: !!invalid,\n },\n };\n });\n\n return (\n <HeroCheckboxGroup\n ref={ref}\n aria-label={ariaLabel}\n classNames={heroCheckboxGroupClassNames}\n color={color === 'info' ? 'primary' : color}\n // see HeroUI styles for group-data condition (data-invalid),\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/components/select/src/use-select.ts\n data-invalid={invalid}\n data-testid={testId}\n errorMessage={errorMessage}\n isDisabled={disabled}\n isInvalid={invalid}\n isRequired={required}\n label={label ? <legend>{label}</legend> : null}\n name={name}\n onBlur={onBlur}\n onChange={onChange}\n orientation={inline ? 'horizontal' : 'vertical'}\n value={value}\n >\n {/* Child render function can fully control list layout; fallback keeps default rendering. */}\n {children\n ? children(renderedOptions ?? [])\n : renderedOptions?.map(({ checkbox }) => {\n return checkbox;\n })}\n </HeroCheckboxGroup>\n );\n};\n\nexport default Checkboxes;\n","import Checkboxes from './Checkboxes';\n\nexport type { CheckboxesProps, CheckboxOption } from './Checkboxes';\n\nexport { checkboxesVariants } from './Checkboxes';\n\nexport default Checkboxes;\n"],"mappings":";;;;;;;;;;AAkBA,MAAa,sBAAA,GAAA,uBAAA,IAAwB;CACnC,OAAO;EACL,MAAM;GAEJ;GAEA;GAEA;EACF;EACA,cAAc;EAGd,OACE;EACF,YAAY;EACZ,YAAY;EACZ,aAAa;EACb,oBAAoB;EACpB,eAAe;EACf,SAAS;CACX;CACA,UAAU;EAER,OAAO;GACL,MAAM,EACJ,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GP,mBAAmB;IAAE,GAAG;IAAkB,OAAO;GAAG;EACtD,OACE,eAAe,OAAO;EAGxB,MAAM,mBAAmB,CAAC,CAAC,YAAY,CAAC,CAAC,OAAO;EAiBhD,OAAO;GACL,UAAA,iBAAA,GAAA,kBAAA,KAhBCC,iBAAAA,UAAD;IAEE,cACE,OAAO,OAAO,UAAU,WAAW,OAAO,QAAQ,OAAO;IAE3D,YAAY;IACZ,gBAAc;IACd,eAAa;IACb,YAAY;IACZ,OAAO,QAAQ;cAEd;GACW,GAXP,SAAS,OAAO,OAehB;GACP;GACA,OAAO;IACL,SAAS,MAAM,SAAS,OAAO,KAAK;IACpC,UAAU;IACV,SAAS,CAAC,CAAC;GACb;EACF;CACF,CAAC;CAED,OACE,iBAAA,GAAA,kBAAA,KAACC,iBAAAA,eAAD;EACO;EACL,cAAY;EACZ,YAAY;EACZ,OAAO,UAAU,SAAS,YAAY;EAGtC,gBAAc;EACd,eAAa;EACC;EACd,YAAY;EACZ,WAAW;EACX,YAAY;EACZ,OAAO,QAAQ,iBAAA,GAAA,kBAAA,KAAC,UAAD,EAAA,UAAS,MAAc,CAAA,IAAI;EACpC;EACE;EACE;EACV,aAAa,SAAS,eAAe;EAC9B;YAGN,WACG,SAAS,mBAAmB,CAAC,CAAC,IAC9B,iBAAiB,KAAK,EAAE,eAAe;GACrC,OAAO;EACT,CAAC;CACY,CAAA;AAEvB;;;AC5PA,IAAA,qBAAe"}
1
+ {"version":3,"file":"index.cjs","names":["heroCheckboxVariants","useUniformField","HeroCheckbox","HeroCheckboxGroup"],"sources":["../../src/Checkboxes/Checkboxes.tsx","../../src/Checkboxes/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type {\n CheckboxGroupProps as HeroCheckboxGroupProps,\n CheckboxProps as HeroCheckboxProps,\n} from '@heroui/checkbox';\nimport type { ReactNode } from 'react';\nimport type { InputValueTransform } from '../hooks/useInputValueTransform';\n\nimport {\n Checkbox as HeroCheckbox,\n CheckboxGroup as HeroCheckboxGroup,\n} from '@heroui/checkbox';\nimport { checkbox as heroCheckboxVariants } from '@heroui/theme';\n\nimport { slugify, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks/useUniformField';\n\nexport const checkboxesVariants = tv({\n slots: {\n base: [\n // Needs group for group-data condition.\n 'group',\n // Match shared field wrapper layout.\n 'flex w-full flex-col',\n // Keep spacing between label/group consistent.\n 'gap-y-1.5',\n ],\n errorMessage: 'text-tiny',\n // see HeroUI styles for group-data condition,\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/core/theme/src/components/select.ts\n label:\n 'inline-flex cursor-default text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:!text-danger',\n optionBase: '',\n optionIcon: '',\n optionLabel: '',\n optionLabelSubline: 'text-foreground-400 !text-small',\n optionWrapper: '',\n wrapper: '',\n },\n variants: {\n // see: https://github.com/heroui-inc/heroui/blob/canary/packages/core/theme/src/components/checkbox.ts\n color: {\n info: {\n wrapper:\n 'text-info-foreground after:bg-info after:text-info-foreground',\n },\n ...heroCheckboxVariants.variants.color,\n } as const,\n lineThrough: {\n true: {\n optionLabel: [\n ...heroCheckboxVariants.variants.lineThrough.true.label,\n // fix stroke position when used with subline and enable animation\n 'relative before:transition-all before:duration-200',\n ],\n optionLabelSubline: 'group-data-[selected=true]:opacity-60',\n },\n },\n },\n});\n\ntype VariantProps = TVProps<typeof checkboxesVariants>;\ntype ClassName = TVClassName<typeof checkboxesVariants>;\n\nexport interface CheckboxOption {\n /** option label */\n label?: ReactNode;\n /** subline displayed below the label */\n labelSubline?: ReactNode;\n /** Arbitrary option metadata for custom render logic. */\n meta?: Record<string, unknown>;\n /** option value */\n value: string;\n /** disables the option */\n disabled?: boolean;\n /** HTML data-testid attribute of the option */\n testId?: string;\n}\n\ninterface ChildRenderOption {\n /** Prebuilt checkbox element so consumers don't need to recreate HeroCheckbox */\n checkbox: ReactNode;\n /** Option data as provided in `options` */\n option: CheckboxOption;\n /** Render-state flags for this option */\n state: {\n /** Whether this option is currently selected */\n checked: boolean;\n /** Whether this option is disabled */\n disabled: boolean;\n /** Whether the checkbox group is invalid */\n invalid: boolean;\n };\n}\n\nexport interface CheckboxesProps extends VariantProps {\n /** Custom aria-label for accessibility. If not provided, falls back to field name when no visible label exists */\n ariaLabel?: string;\n /** Optional child render function for custom full-list layout rendering. */\n children?: (options: ChildRenderOption[]) => ReactNode;\n /** CSS class name */\n className?: ClassName;\n /** Color scheme of the checkboxes */\n color?: VariantProps['color'];\n /** Sets all checkboxes disabled */\n disabled?: boolean;\n /** Orientation of the checkboxes */\n inline?: boolean;\n /** Label displayed above the checkboxes */\n label?: ReactNode;\n /** Whether the checkboxes label should be crossed out */\n lineThrough?: boolean;\n /** Name the Field is registered on the form */\n name: string;\n /** Checkboxes that should be displayed. */\n options: CheckboxOption[];\n\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** allows disentangled display and form values for a field */\n transform?: InputValueTransform<string[]>;\n}\n\n/**\n * Checkboxes component based on [HeroUI CheckboxGroup](https://www.heroui.com//docs/components/checkbox-group)\n */\nconst Checkboxes = ({\n children = undefined,\n className = undefined,\n color = 'primary',\n inline = false,\n lineThrough = false,\n name,\n options,\n ...uniformFieldProps\n}: CheckboxesProps) => {\n const {\n ariaLabel,\n disabled,\n errorMessage,\n field: { onChange, value: fieldValue, ref, onBlur },\n invalid,\n label,\n required,\n testId,\n } = useUniformField({\n // Checkbox group values are arrays and can produce nested RHF error shapes.\n isArrayValue: true,\n name,\n ...uniformFieldProps,\n });\n\n // Ensure value is always an array (checkboxes need arrays)\n const value = Array.isArray(fieldValue) ? (fieldValue as string[]) : [];\n\n // classNames from slots\n const variants = checkboxesVariants({ lineThrough });\n const classNames = variantsToClassNames(variants, className, 'base');\n\n // map slots to HeroUI class names\n const heroCheckboxGroupClassNames: HeroCheckboxGroupProps['classNames'] = {\n base: classNames.base,\n label: classNames.label,\n wrapper: classNames.wrapper,\n };\n const heroCheckboxClassNames: HeroCheckboxProps['classNames'] = {\n base: classNames.optionBase,\n icon: classNames.optionIcon,\n label: classNames.optionLabel,\n wrapper: classNames.optionWrapper,\n };\n\n // Build option descriptors once so default and custom layouts share the same checkbox nodes/state.\n const renderedOptions = options?.map((option) => {\n const optionTestId = slugify(\n `${testId}_option_${option?.testId ?? option?.value}`,\n {\n replaceDots: true,\n },\n );\n\n // set content and classes depending option has subline\n const hasSubline = !!option.labelSubline;\n let labelContent: ReactNode;\n let optionClassNames = heroCheckboxClassNames;\n if (hasSubline) {\n labelContent = (\n <div className=\"flex grow flex-col items-start\">\n <span className={classNames.optionLabel}>{option.label}</span>\n <span className={classNames.optionLabelSubline}>\n {option.labelSubline}\n </span>\n </div>\n );\n // remove label classes from outer label when subline is used\n optionClassNames = { ...optionClassNames, label: '' };\n } else {\n labelContent = option.label;\n }\n\n const optionIsDisabled = !!disabled || !!option.disabled;\n const checkbox = (\n <HeroCheckbox\n key={`index_${option.value}`}\n aria-label={\n typeof option.label === 'string' ? option.label : option.value\n }\n classNames={optionClassNames}\n data-invalid={invalid}\n data-testid={optionTestId}\n isDisabled={optionIsDisabled}\n value={option?.value}\n >\n {labelContent}\n </HeroCheckbox>\n );\n\n return {\n checkbox,\n option,\n state: {\n checked: value.includes(option.value),\n disabled: optionIsDisabled,\n invalid: !!invalid,\n },\n };\n });\n\n return (\n <HeroCheckboxGroup\n ref={ref}\n aria-label={ariaLabel}\n classNames={heroCheckboxGroupClassNames}\n color={color === 'info' ? 'primary' : color}\n // see HeroUI styles for group-data condition (data-invalid),\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/components/select/src/use-select.ts\n data-invalid={invalid}\n data-testid={testId}\n errorMessage={errorMessage}\n isDisabled={disabled}\n isInvalid={invalid}\n isRequired={required}\n label={label ? <legend>{label}</legend> : null}\n name={name}\n onBlur={onBlur}\n onChange={onChange}\n orientation={inline ? 'horizontal' : 'vertical'}\n value={value}\n >\n {/* Child render function can fully control list layout; fallback keeps default rendering. */}\n {children\n ? children(renderedOptions ?? [])\n : renderedOptions?.map(({ checkbox }) => {\n return checkbox;\n })}\n </HeroCheckboxGroup>\n );\n};\n\nexport default Checkboxes;\n","import Checkboxes from './Checkboxes';\n\nexport type { CheckboxesProps, CheckboxOption } from './Checkboxes';\n\nexport { checkboxesVariants } from './Checkboxes';\n\nexport default Checkboxes;\n"],"mappings":";;;;;;;;;;AAkBA,MAAa,sBAAA,GAAA,uBAAA,GAAA,CAAwB;CACnC,OAAO;EACL,MAAM;GAEJ;GAEA;GAEA;EACF;EACA,cAAc;EAGd,OACE;EACF,YAAY;EACZ,YAAY;EACZ,aAAa;EACb,oBAAoB;EACpB,eAAe;EACf,SAAS;CACX;CACA,UAAU;EAER,OAAO;GACL,MAAM,EACJ,SACE,gEACJ;GACA,GAAGA,cAAAA,SAAqB,SAAS;EACnC;EACA,aAAa,EACX,MAAM;GACJ,aAAa,CACX,GAAGA,cAAAA,SAAqB,SAAS,YAAY,KAAK,OAElD,oDACF;GACA,oBAAoB;EACtB,EACF;CACF;AACF,CAAC;;;;AAmED,MAAM,cAAc,EAClB,WAAW,KAAA,GACX,YAAY,KAAA,GACZ,QAAQ,WACR,SAAS,OACT,cAAc,OACd,MACA,SACA,GAAG,wBACkB;CACrB,MAAM,EACJ,WACA,UACA,cACA,OAAO,EAAE,UAAU,OAAO,YAAY,KAAK,UAC3C,SACA,OACA,UACA,WACEC,oCAAAA,gBAAgB;EAElB,cAAc;EACd;EACA,GAAG;CACL,CAAC;CAGD,MAAM,QAAQ,MAAM,QAAQ,UAAU,IAAK,aAA0B,CAAC;CAItE,MAAM,cAAA,GAAA,uBAAA,qBAAA,CADW,mBAAmB,EAAE,YAAY,CACH,GAAG,WAAW,MAAM;CAGnE,MAAM,8BAAoE;EACxE,MAAM,WAAW;EACjB,OAAO,WAAW;EAClB,SAAS,WAAW;CACtB;CACA,MAAM,yBAA0D;EAC9D,MAAM,WAAW;EACjB,MAAM,WAAW;EACjB,OAA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,CAAA,IAAI;EACpC;EACE;EACE;EACV,aAAa,SAAS,eAAe;EAC9B;YAGN,WACG,SAAS,mBAAmB,CAAC,CAAC,IAC9B,iBAAiB,KAAK,EAAE,eAAe;GACrC,OAAO;EACT,CAAC;CACY,CAAA;AAEvB;;;AC5PA,IAAA,qBAAe"}
@@ -545,7 +545,7 @@ declare const Checkboxes: ({
545
545
  name,
546
546
  options,
547
547
  ...uniformFieldProps
548
- }: CheckboxesProps) => import("react/jsx-runtime").JSX.Element;
548
+ }: CheckboxesProps) => import("react").JSX.Element;
549
549
  //#endregion
550
550
  export { type CheckboxOption, type CheckboxesProps, checkboxesVariants, Checkboxes as default };
551
551
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/Checkboxes/Checkboxes.tsx"],"mappings":";;;;;cAkBa,kBAAA,IAAkB,KAAA;;;;gbA0C7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;obAEe;;;;wbACH;IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mbAqCA;mbAAiC;obAE7C;2bAAY;sbAEZ;ybAAQ;ybAER;0bAEA;icAEA;4bAAQ;IAAA;;;;ubASR;mbAEA;obAAY;2bAAmB;sbAAA;ybAyI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AAA,GAAY,mBAAA;AAAA;;;;cAMR,UAAA;EAAc,QAAA;EAAA,SAAA;EAAA,KAAA;EAAA,MAAA;EAAA,WAAA;EAAA,IAAA;EAAA,OAAA;EAAA,GAAA;AAAA,GASjB,eAAA,qBAAe,GAAA,CAAA,OAAA"}
@@ -545,7 +545,7 @@ declare const Checkboxes: ({
545
545
  name,
546
546
  options,
547
547
  ...uniformFieldProps
548
- }: CheckboxesProps) => import("react/jsx-runtime").JSX.Element;
548
+ }: CheckboxesProps) => import("react").JSX.Element;
549
549
  //#endregion
550
550
  export { type CheckboxOption, type CheckboxesProps, checkboxesVariants, Checkboxes as default };
551
551
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/Checkboxes/Checkboxes.tsx"],"mappings":";;;;;cAkBa,kBAAA,IAAkB,KAAA;;;;gbA0C7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;obAEe;;;;wbACH;IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mbAqCA;mbAAiC;obAE7C;2bAAY;sbAEZ;ybAAQ;ybAER;0bAEA;icAEA;4bAAQ;IAAA;;;;ubASR;mbAEA;obAAY;2bAAmB;sbAAA;ybAyIhC;ybAAA;0bA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AA;AAAA;;;;cAMR,UAAA;EAAc,QAAA;EAAA,SAAA;EAAA,KAAA;EAAA,MAAA;EAAA,WAAA;EAAA,IAAA;EAAA,OAAA;EAAA,GAAA;AAAA,GASjB,eAAA,qBAAe,GAAA,CAAA,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["useUniformField","HeroDatePicker"],"sources":["../../src/DatePicker/dateHelpers.ts","../../src/DatePicker/DatePicker.tsx","../../src/DatePicker/index.ts"],"sourcesContent":["import type { DatePicker as HeroDatePicker } from '@heroui/date-picker';\nimport type { ComponentProps } from 'react';\n\nimport {\n getLocalTimeZone,\n now,\n parseAbsolute,\n parseAbsoluteToLocal,\n parseDate,\n parseDateTime,\n parseZonedDateTime,\n} from '@internationalized/date';\n\n/** Value type accepted by the HeroUI DatePicker */\nexport type DatePickerValue = ComponentProps<typeof HeroDatePicker>['value'];\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 HeroUI DatePicker compatible `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","import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { DatePickerProps as HeroDatePickerProps } from '@heroui/date-picker';\nimport type { ReactNode } from 'react';\nimport type { DatePickerValue } from './dateHelpers';\n\nimport { DatePicker as HeroDatePicker } from '@heroui/date-picker';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks/useUniformField';\nimport {\n dateValueToUtcIsoString,\n getDatePickerPlaceholderValue,\n parseDateValue,\n resolveDatePickerTimeZone,\n} from './dateHelpers';\n\nexport const datePickerVariants = tv({\n slots: {\n /** wrapper around the whole date picker */\n base: '',\n /** helper wrapper for error/description */\n helperWrapper: [\n // set padding to 0 for error message exit animation\n 'p-0',\n ],\n /** the calendar element */\n calendar: '',\n /** the calendar's content element */\n calendarContent: '',\n /**\n * inner wrapper (HeroUI inputWrapper slot)\n *\n * NOTE: Unlike HeroUI Input, the DatePicker does not expose a\n * `data-focus` indicator on the group, so the focus border has to be\n * driven by the native `focus-within` state of the segment inputs.\n */\n inputWrapper: 'bg-content1 focus-within:border-focus',\n /** field label */\n label: 'cursor-default',\n /** the calendar popover element */\n popoverContent: '',\n /** selector button element */\n selectorButton: '',\n /** selector icon element */\n selectorIcon: '',\n /** the time-input component element */\n timeInput: '',\n /** the time-input component's label element */\n timeInputLabel: '',\n },\n});\n\ntype VariantProps = TVProps<typeof datePickerVariants>;\ntype ClassName = TVClassName<typeof datePickerVariants>;\n\nexport interface DatePickerProps extends VariantProps {\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 /** date picker is disabled */\n disabled?: boolean;\n /**\n * Optional hour cycle override.\n *\n * When omitted, the picker uses the user's locale default (12-hour or 24-hour).\n */\n hourCycle?: 12 | 24;\n /** hide timezone abbreviation for zoned values */\n hideTimeZone?: boolean;\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 /** 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 /**\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 /** value format stored in form state (`string` stores UTC ISO values) */\n valueType?: 'dateValue' | 'string';\n}\n\n/**\n * DatePicker component based on [HeroUI DatePicker](https://v2.heroui.com/docs/components/date-picker)\n */\nconst DatePicker = ({\n className: _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 {\n ariaLabel,\n disabled,\n errorMessage,\n field: { onBlur, onChange, ref, value },\n invalid,\n label,\n required,\n testId,\n } = useUniformField({ name, ...uniformFieldProps });\n\n // classNames from slots\n const variants = datePickerVariants();\n const classNames = variantsToClassNames(variants, _className, 'base');\n const resolvedTimeZone = resolveDatePickerTimeZone(withTime, timeZone);\n\n // Normalize incoming form value into HeroUI's DateValue shape so the field can\n // render consistently from UTC strings, local strings, Date instances, or DateValue objects.\n const parsedValue = parseDateValue(\n value,\n withTime ? resolvedTimeZone : timeZone,\n );\n\n // Build the default placeholder value for time-enabled pickers.\n const placeholderValue = getDatePickerPlaceholderValue(withTime, timeZone);\n\n // Parse ISO boundary strings into HeroUI DateValue objects.\n const parsedMinValue = parseDateValue(\n minValue,\n withTime ? resolvedTimeZone : timeZone,\n ) as unknown as HeroDatePickerProps['minValue'];\n const parsedMaxValue = parseDateValue(\n maxValue,\n withTime ? resolvedTimeZone : timeZone,\n ) as unknown as HeroDatePickerProps['maxValue'];\n\n // Normalize DatePicker output into the configured storage format before writing to form state.\n const handleChange = (nextValue: DatePickerValue) => {\n if (nextValue == null) {\n onChange(null);\n return;\n }\n\n if (valueType === 'dateValue') {\n onChange(nextValue);\n return;\n }\n\n // String mode always stores UTC ISO values so form state is timezone-neutral\n // and comparable across users/locales.\n onChange(\n dateValueToUtcIsoString(nextValue, resolvedTimeZone ?? 'UTC') ??\n String(nextValue),\n );\n };\n\n return (\n <HeroDatePicker\n ref={ref}\n aria-label={label ? undefined : ariaLabel}\n classNames={{\n base: classNames.base,\n calendar: classNames.calendar,\n calendarContent: classNames.calendarContent,\n helperWrapper: classNames.helperWrapper,\n inputWrapper: classNames.inputWrapper,\n label: classNames.label,\n popoverContent: classNames.popoverContent,\n selectorButton: classNames.selectorButton,\n selectorIcon: classNames.selectorIcon,\n timeInput: classNames.timeInput,\n timeInputLabel: classNames.timeInputLabel,\n }}\n data-testid={testId}\n errorMessage={errorMessage}\n granularity={withTime ? 'minute' : 'day'}\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n id={testId}\n isDisabled={disabled}\n isInvalid={invalid}\n isRequired={required}\n label={label}\n labelPlacement=\"outside\"\n maxValue={parsedMaxValue}\n minValue={parsedMinValue}\n name={name}\n onBlur={onBlur}\n onChange={handleChange}\n placeholderValue={placeholderValue}\n radius=\"sm\"\n value={parsedValue}\n variant=\"bordered\"\n />\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 DatePic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"],"sources":["../../src/DatePicker/dateHelpers.ts","../../src/DatePicker/DatePicker.tsx","../../src/DatePicker/index.ts"],"sourcesContent":["import type { DatePicker as HeroDatePicker } from '@heroui/date-picker';\nimport type { ComponentProps } from 'react';\n\nimport {\n getLocalTimeZone,\n now,\n parseAbsolute,\n parseAbsoluteToLocal,\n parseDate,\n parseDateTime,\n parseZonedDateTime,\n} from '@internationalized/date';\n\n/** Value type accepted by the HeroUI DatePicker */\nexport type DatePickerValue = ComponentProps<typeof HeroDatePicker>['value'];\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 HeroUI DatePicker compatible `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","import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { DatePickerProps as HeroDatePickerProps } from '@heroui/date-picker';\nimport type { ReactNode } from 'react';\nimport type { DatePickerValue } from './dateHelpers';\n\nimport { DatePicker as HeroDatePicker } from '@heroui/date-picker';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks/useUniformField';\nimport {\n dateValueToUtcIsoString,\n getDatePickerPlaceholderValue,\n parseDateValue,\n resolveDatePickerTimeZone,\n} from './dateHelpers';\n\nexport const datePickerVariants = tv({\n slots: {\n /** wrapper around the whole date picker */\n base: '',\n /** helper wrapper for error/description */\n helperWrapper: [\n // set padding to 0 for error message exit animation\n 'p-0',\n ],\n /** the calendar element */\n calendar: '',\n /** the calendar's content element */\n calendarContent: '',\n /**\n * inner wrapper (HeroUI inputWrapper slot)\n *\n * NOTE: Unlike HeroUI Input, the DatePicker does not expose a\n * `data-focus` indicator on the group, so the focus border has to be\n * driven by the native `focus-within` state of the segment inputs.\n */\n inputWrapper: 'bg-content1 focus-within:border-focus',\n /** field label */\n label: 'cursor-default',\n /** the calendar popover element */\n popoverContent: '',\n /** selector button element */\n selectorButton: '',\n /** selector icon element */\n selectorIcon: '',\n /** the time-input component element */\n timeInput: '',\n /** the time-input component's label element */\n timeInputLabel: '',\n },\n});\n\ntype VariantProps = TVProps<typeof datePickerVariants>;\ntype ClassName = TVClassName<typeof datePickerVariants>;\n\nexport interface DatePickerProps extends VariantProps {\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 /** date picker is disabled */\n disabled?: boolean;\n /**\n * Optional hour cycle override.\n *\n * When omitted, the picker uses the user's locale default (12-hour or 24-hour).\n */\n hourCycle?: 12 | 24;\n /** hide timezone abbreviation for zoned values */\n hideTimeZone?: boolean;\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 /** 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 /**\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 /** value format stored in form state (`string` stores UTC ISO values) */\n valueType?: 'dateValue' | 'string';\n}\n\n/**\n * DatePicker component based on [HeroUI DatePicker](https://v2.heroui.com/docs/components/date-picker)\n */\nconst DatePicker = ({\n className: _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 {\n ariaLabel,\n disabled,\n errorMessage,\n field: { onBlur, onChange, ref, value },\n invalid,\n label,\n required,\n testId,\n } = useUniformField({ name, ...uniformFieldProps });\n\n // classNames from slots\n const variants = datePickerVariants();\n const classNames = variantsToClassNames(variants, _className, 'base');\n const resolvedTimeZone = resolveDatePickerTimeZone(withTime, timeZone);\n\n // Normalize incoming form value into HeroUI's DateValue shape so the field can\n // render consistently from UTC strings, local strings, Date instances, or DateValue objects.\n const parsedValue = parseDateValue(\n value,\n withTime ? resolvedTimeZone : timeZone,\n );\n\n // Build the default placeholder value for time-enabled pickers.\n const placeholderValue = getDatePickerPlaceholderValue(withTime, timeZone);\n\n // Parse ISO boundary strings into HeroUI DateValue objects.\n const parsedMinValue = parseDateValue(\n minValue,\n withTime ? resolvedTimeZone : timeZone,\n ) as unknown as HeroDatePickerProps['minValue'];\n const parsedMaxValue = parseDateValue(\n maxValue,\n withTime ? resolvedTimeZone : timeZone,\n ) as unknown as HeroDatePickerProps['maxValue'];\n\n // Normalize DatePicker output into the configured storage format before writing to form state.\n const handleChange = (nextValue: DatePickerValue) => {\n if (nextValue == null) {\n onChange(null);\n return;\n }\n\n if (valueType === 'dateValue') {\n onChange(nextValue);\n return;\n }\n\n // String mode always stores UTC ISO values so form state is timezone-neutral\n // and comparable across users/locales.\n onChange(\n dateValueToUtcIsoString(nextValue, resolvedTimeZone ?? 'UTC') ??\n String(nextValue),\n );\n };\n\n return (\n <HeroDatePicker\n ref={ref}\n aria-label={label ? undefined : ariaLabel}\n classNames={{\n base: classNames.base,\n calendar: classNames.calendar,\n calendarContent: classNames.calendarContent,\n helperWrapper: classNames.helperWrapper,\n inputWrapper: classNames.inputWrapper,\n label: classNames.label,\n popoverContent: classNames.popoverContent,\n selectorButton: classNames.selectorButton,\n selectorIcon: classNames.selectorIcon,\n timeInput: classNames.timeInput,\n timeInputLabel: classNames.timeInputLabel,\n }}\n data-testid={testId}\n errorMessage={errorMessage}\n granularity={withTime ? 'minute' : 'day'}\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n id={testId}\n isDisabled={disabled}\n isInvalid={invalid}\n isRequired={required}\n label={label}\n labelPlacement=\"outside\"\n maxValue={parsedMaxValue}\n minValue={parsedMinValue}\n name={name}\n onBlur={onBlur}\n onChange={handleChange}\n placeholderValue={placeholderValue}\n radius=\"sm\"\n value={parsedValue}\n variant=\"bordered\"\n />\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":";;;;;;;;;;;AAiBA,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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AAM,cAAA,GAAA,uBAAA,qBAAA,CADW,mBAC8B,GAAG,YAAY,MAAM;CACpE,MAAM,mBAAmB,0BAA0B,UAAU,QAAQ;CAIrE,MAAM,cAAc,eAClB,OACA,WAAW,mBAAmB,QAChC;CAGA,MAAM,mBAAmB,8BAA8B,UAAU,QAAQ;CAGzE,MAAM,iBAAiB,eACrB,UACA,WAAW,mBAAmB,QAChC;CACA,MAAM,iBAAiB,eACrB,UACA,WAAW,mBAAmB,QAChC;CAGA,MAAM,gBAAgB,cAA+B;EACnD,IAAI,aAAa,MAAM;GACrB,SAAS,IAAI;GACb;EACF;EAEA,IAAI,cAAc,aAAa;GAC7B,SAAS,SAAS;GAClB;EACF;EAIA,SACE,wBAAwB,WAAW,oBAAoB,KAAK,KAC1D,OAAO,SAAS,CACpB;CACF;CAEA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,oBAAAA,YAAD;EACO;EACL,cAAY,QAAQ,KAAA,IAAY;EAChC,YAAY;GACV,MAAM,WAAW;GACjB,UAAU,WAAW;GACrB,iBAAiB,WAAW;GAC5B,eAAe,WAAW;GAC1B,cAAc,WAAW;GACzB,OAAO,WAAW;GAClB,gBAAgB,WAAW;GAC3B,gBAAgB,WAAW;GAC3B,cAAc,WAAW;GACzB,WAAW,WAAW;GACtB,gBAAgB,WAAW;EAC7B;EACA,eAAa;EACC;EACd,aAAa,WAAW,WAAW;EACrB;EACH;EACX,IAAI;EACJ,YAAY;EACZ,WAAW;EACX,YAAY;EACL;EACP,gBAAe;EACf,UAAU;EACV,UAAU;EACJ;EACE;EACR,UAAU;EACQ;EAClB,QAAO;EACP,OAAO;EACP,SAAQ;CACT,CAAA;AAEL;;;AC3MA,IAAA,qBAAe"}
@@ -1526,7 +1526,7 @@ declare const DatePicker: ({
1526
1526
  valueType,
1527
1527
  withTime,
1528
1528
  ...uniformFieldProps
1529
- }: DatePickerProps) => import("react/jsx-runtime").JSX.Element;
1529
+ }: DatePickerProps) => import("react").JSX.Element;
1530
1530
  //#endregion
1531
1531
  export { type DatePickerProps, datePickerVariants, DatePicker as default };
1532
1532
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/DatePicker/DatePicker.tsx"],"mappings":";;;;cAiBa,kBAAA,IAAkB,KAAA;EAAA;;;gbAkC7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gbAlC6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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A;;;;;;EAMA,SAAA;;EAEA,YAAA;;EAEA,KAAA,GAAQ,SAAA;;EAER,QAAA;;EAEA,QAAA;;EAEA,IAAA;;EAEA,MAAA;;;;;;;EAOA,QAAA;;;;;;;EAOA,QAAA;;EAEA,SAAA;AAAA;;;;cAMI,UAAA;EAAc,SAAA,EAAA,UAAA;EAAA,SAAA;EAAA,YAAA;EAAA,QAAA;EAAA,QAAA;EAAA,IAAA;EAAA,QAAA;EAAA,SAAA;EAAA,QAAA;EAAA,GAAA;AAAA,GAWjB,eAAA,qBAAe,GAAA,CAAA,OAAA"}
@@ -1526,7 +1526,7 @@ declare const DatePicker: ({
1526
1526
  valueType,
1527
1527
  withTime,
1528
1528
  ...uniformFieldProps
1529
- }: DatePickerProps) => import("react/jsx-runtime").JSX.Element;
1529
+ }: DatePickerProps) => import("react").JSX.Element;
1530
1530
  //#endregion
1531
1531
  export { type DatePickerProps, datePickerVariants, DatePicker as default };
1532
1532
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/DatePicker/DatePicker.tsx"],"mappings":";;;;cAiBa,kBAAA,IAAkB,KAAA;EAAA;;;gbAkC7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gbAlC6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA5Db,YAAA,GAAe,OAAO,QAAQ,kBAAA;AAAA,KAC9B,SAAA,GAAY,WAAW,QAAQ,kBAAA;AAAA,UAEnB,eAAA,SAAwB,YAAA;;EAEvC,SAAA;;EAEA,SAAA,GAAY,SAAA;;EAEZ,QAAA;;;;;;EAMA,SAAA;;EAEA,YAAA;;EAEA,KAAA,GAAQ,SAAA;;EAER,QAAA;;EAEA,QAAA;;EAEA,IAAA;;EAEA,MAAA;;;;;;;EAOA,QAAA;;;;;;;EAOA,QAAA;;EAEA,SAAA;AAAA;;;;cAMI,UAAA;EAAc,SAAA,EAAA,UAAA;EAAA,SAAA;EAAA,YAAA;EAAA,QAAA;EAAA,QAAA;EAAA,IAAA;EAAA,QAAA;EAAA,SAAA;EAAA,QAAA;EAAA,GAAA;AAAA,GAWjB,eAAA,qBAAe,GAAA,CAAA,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["DatePicker","HeroDatePicker","DatePicker"],"sources":["../../src/DatePicker/dateHelpers.ts","../../src/DatePicker/DatePicker.tsx","../../src/DatePicker/index.ts"],"sourcesContent":["import type { DatePicker as HeroDatePicker } from '@heroui/date-picker';\nimport type { ComponentProps } from 'react';\n\nimport {\n getLocalTimeZone,\n now,\n parseAbsolute,\n parseAbsoluteToLocal,\n parseDate,\n parseDateTime,\n parseZonedDateTime,\n} from '@internationalized/date';\n\n/** Value type accepted by the HeroUI DatePicker */\nexport type DatePickerValue = ComponentProps<typeof HeroDatePicker>['value'];\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 HeroUI DatePicker compatible `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","import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { DatePickerProps as HeroDatePickerProps } from '@heroui/date-picker';\nimport type { ReactNode } from 'react';\nimport type { DatePickerValue } from './dateHelpers';\n\nimport { DatePicker as HeroDatePicker } from '@heroui/date-picker';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks/useUniformField';\nimport {\n dateValueToUtcIsoString,\n getDatePickerPlaceholderValue,\n parseDateValue,\n resolveDatePickerTimeZone,\n} from './dateHelpers';\n\nexport const datePickerVariants = tv({\n slots: {\n /** wrapper around the whole date picker */\n base: '',\n /** helper wrapper for error/description */\n helperWrapper: [\n // set padding to 0 for error message exit animation\n 'p-0',\n ],\n /** the calendar element */\n calendar: '',\n /** the calendar's content element */\n calendarContent: '',\n /**\n * inner wrapper (HeroUI inputWrapper slot)\n *\n * NOTE: Unlike HeroUI Input, the DatePicker does not expose a\n * `data-focus` indicator on the group, so the focus border has to be\n * driven by the native `focus-within` state of the segment inputs.\n */\n inputWrapper: 'bg-content1 focus-within:border-focus',\n /** field label */\n label: 'cursor-default',\n /** the calendar popover element */\n popoverContent: '',\n /** selector button element */\n selectorButton: '',\n /** selector icon element */\n selectorIcon: '',\n /** the time-input component element */\n timeInput: '',\n /** the time-input component's label element */\n timeInputLabel: '',\n },\n});\n\ntype VariantProps = TVProps<typeof datePickerVariants>;\ntype ClassName = TVClassName<typeof datePickerVariants>;\n\nexport interface DatePickerProps extends VariantProps {\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 /** date picker is disabled */\n disabled?: boolean;\n /**\n * Optional hour cycle override.\n *\n * When omitted, the picker uses the user's locale default (12-hour or 24-hour).\n */\n hourCycle?: 12 | 24;\n /** hide timezone abbreviation for zoned values */\n hideTimeZone?: boolean;\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 /** 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 /**\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 /** value format stored in form state (`string` stores UTC ISO values) */\n valueType?: 'dateValue' | 'string';\n}\n\n/**\n * DatePicker component based on [HeroUI DatePicker](https://v2.heroui.com/docs/components/date-picker)\n */\nconst DatePicker = ({\n className: _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 {\n ariaLabel,\n disabled,\n errorMessage,\n field: { onBlur, onChange, ref, value },\n invalid,\n label,\n required,\n testId,\n } = useUniformField({ name, ...uniformFieldProps });\n\n // classNames from slots\n const variants = datePickerVariants();\n const classNames = variantsToClassNames(variants, _className, 'base');\n const resolvedTimeZone = resolveDatePickerTimeZone(withTime, timeZone);\n\n // Normalize incoming form value into HeroUI's DateValue shape so the field can\n // render consistently from UTC strings, local strings, Date instances, or DateValue objects.\n const parsedValue = parseDateValue(\n value,\n withTime ? resolvedTimeZone : timeZone,\n );\n\n // Build the default placeholder value for time-enabled pickers.\n const placeholderValue = getDatePickerPlaceholderValue(withTime, timeZone);\n\n // Parse ISO boundary strings into HeroUI DateValue objects.\n const parsedMinValue = parseDateValue(\n minValue,\n withTime ? resolvedTimeZone : timeZone,\n ) as unknown as HeroDatePickerProps['minValue'];\n const parsedMaxValue = parseDateValue(\n maxValue,\n withTime ? resolvedTimeZone : timeZone,\n ) as unknown as HeroDatePickerProps['maxValue'];\n\n // Normalize DatePicker output into the configured storage format before writing to form state.\n const handleChange = (nextValue: DatePickerValue) => {\n if (nextValue == null) {\n onChange(null);\n return;\n }\n\n if (valueType === 'dateValue') {\n onChange(nextValue);\n return;\n }\n\n // String mode always stores UTC ISO values so form state is timezone-neutral\n // and comparable across users/locales.\n onChange(\n dateValueToUtcIsoString(nextValue, resolvedTimeZone ?? 'UTC') ??\n String(nextValue),\n );\n };\n\n return (\n <HeroDatePicker\n ref={ref}\n aria-label={label ? undefined : ariaLabel}\n classNames={{\n base: classNames.base,\n calendar: classNames.calendar,\n calendarContent: classNames.calendarContent,\n helperWrapper: classNames.helperWrapper,\n inputWrapper: classNames.inputWrapper,\n label: classNames.label,\n popoverContent: classNames.popoverContent,\n selectorButton: classNames.selectorButton,\n selectorIcon: classNames.selectorIcon,\n timeInput: classNames.timeInput,\n timeInputLabel: classNames.timeInputLabel,\n }}\n data-testid={testId}\n errorMessage={errorMessage}\n granularity={withTime ? 'minute' : 'day'}\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n id={testId}\n isDisabled={disabled}\n isInvalid={invalid}\n isRequired={required}\n label={label}\n labelPlacement=\"outside\"\n maxValue={parsedMaxValue}\n minValue={parsedMinValue}\n name={name}\n onBlur={onBlur}\n onChange={handleChange}\n placeholderValue={placeholderValue}\n radius=\"sm\"\n value={parsedValue}\n variant=\"bordered\"\n />\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":";;;;;;;AAiBA,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;;;;;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IAAY;EAChC,YAAY;GACV,MAAM,WAAW;GACjB,UAAU,WAAW;GACrB,iBAAiB,WAAW;GAC5B,eAAe,WAAW;GAC1B,cAAc,WAAW;GACzB,OAAO,WAAW;GAClB,gBAAgB,WAAW;GAC3B,gBAAgB,WAAW;GAC3B,cAAc,WAAW;GACzB,WAAW,WAAW;GACtB,gBAAgB,WAAW;EAC7B;EACA,eAAa;EACC;EACd,aAAa,WAAW,WAAW;EACrB;EACH;EACX,IAAI;EACJ,YAAY;EACZ,WAAW;EACX,YAAY;EACL;EACP,gBAAe;EACf,UAAU;EACV,UAAU;EACJ;EACE;EACR,UAAU;EACQ;EAClB,QAAO;EACP,OAAO;EACP,SAAQ;CACT,CAAA;AAEL;;;AC3MA,IAAA,qBAAeC"}
1
+ {"version":3,"file":"index.js","names":["DatePicker","HeroDatePicker","DatePicker"],"sources":["../../src/DatePicker/dateHelpers.ts","../../src/DatePicker/DatePicker.tsx","../../src/DatePicker/index.ts"],"sourcesContent":["import type { DatePicker as HeroDatePicker } from '@heroui/date-picker';\nimport type { ComponentProps } from 'react';\n\nimport {\n getLocalTimeZone,\n now,\n parseAbsolute,\n parseAbsoluteToLocal,\n parseDate,\n parseDateTime,\n parseZonedDateTime,\n} from '@internationalized/date';\n\n/** Value type accepted by the HeroUI DatePicker */\nexport type DatePickerValue = ComponentProps<typeof HeroDatePicker>['value'];\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 HeroUI DatePicker compatible `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","import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { DatePickerProps as HeroDatePickerProps } from '@heroui/date-picker';\nimport type { ReactNode } from 'react';\nimport type { DatePickerValue } from './dateHelpers';\n\nimport { DatePicker as HeroDatePicker } from '@heroui/date-picker';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks/useUniformField';\nimport {\n dateValueToUtcIsoString,\n getDatePickerPlaceholderValue,\n parseDateValue,\n resolveDatePickerTimeZone,\n} from './dateHelpers';\n\nexport const datePickerVariants = tv({\n slots: {\n /** wrapper around the whole date picker */\n base: '',\n /** helper wrapper for error/description */\n helperWrapper: [\n // set padding to 0 for error message exit animation\n 'p-0',\n ],\n /** the calendar element */\n calendar: '',\n /** the calendar's content element */\n calendarContent: '',\n /**\n * inner wrapper (HeroUI inputWrapper slot)\n *\n * NOTE: Unlike HeroUI Input, the DatePicker does not expose a\n * `data-focus` indicator on the group, so the focus border has to be\n * driven by the native `focus-within` state of the segment inputs.\n */\n inputWrapper: 'bg-content1 focus-within:border-focus',\n /** field label */\n label: 'cursor-default',\n /** the calendar popover element */\n popoverContent: '',\n /** selector button element */\n selectorButton: '',\n /** selector icon element */\n selectorIcon: '',\n /** the time-input component element */\n timeInput: '',\n /** the time-input component's label element */\n timeInputLabel: '',\n },\n});\n\ntype VariantProps = TVProps<typeof datePickerVariants>;\ntype ClassName = TVClassName<typeof datePickerVariants>;\n\nexport interface DatePickerProps extends VariantProps {\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 /** date picker is disabled */\n disabled?: boolean;\n /**\n * Optional hour cycle override.\n *\n * When omitted, the picker uses the user's locale default (12-hour or 24-hour).\n */\n hourCycle?: 12 | 24;\n /** hide timezone abbreviation for zoned values */\n hideTimeZone?: boolean;\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 /** 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 /**\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 /** value format stored in form state (`string` stores UTC ISO values) */\n valueType?: 'dateValue' | 'string';\n}\n\n/**\n * DatePicker component based on [HeroUI DatePicker](https://v2.heroui.com/docs/components/date-picker)\n */\nconst DatePicker = ({\n className: _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 {\n ariaLabel,\n disabled,\n errorMessage,\n field: { onBlur, onChange, ref, value },\n invalid,\n label,\n required,\n testId,\n } = useUniformField({ name, ...uniformFieldProps });\n\n // classNames from slots\n const variants = datePickerVariants();\n const classNames = variantsToClassNames(variants, _className, 'base');\n const resolvedTimeZone = resolveDatePickerTimeZone(withTime, timeZone);\n\n // Normalize incoming form value into HeroUI's DateValue shape so the field can\n // render consistently from UTC strings, local strings, Date instances, or DateValue objects.\n const parsedValue = parseDateValue(\n value,\n withTime ? resolvedTimeZone : timeZone,\n );\n\n // Build the default placeholder value for time-enabled pickers.\n const placeholderValue = getDatePickerPlaceholderValue(withTime, timeZone);\n\n // Parse ISO boundary strings into HeroUI DateValue objects.\n const parsedMinValue = parseDateValue(\n minValue,\n withTime ? resolvedTimeZone : timeZone,\n ) as unknown as HeroDatePickerProps['minValue'];\n const parsedMaxValue = parseDateValue(\n maxValue,\n withTime ? resolvedTimeZone : timeZone,\n ) as unknown as HeroDatePickerProps['maxValue'];\n\n // Normalize DatePicker output into the configured storage format before writing to form state.\n const handleChange = (nextValue: DatePickerValue) => {\n if (nextValue == null) {\n onChange(null);\n return;\n }\n\n if (valueType === 'dateValue') {\n onChange(nextValue);\n return;\n }\n\n // String mode always stores UTC ISO values so form state is timezone-neutral\n // and comparable across users/locales.\n onChange(\n dateValueToUtcIsoString(nextValue, resolvedTimeZone ?? 'UTC') ??\n String(nextValue),\n );\n };\n\n return (\n <HeroDatePicker\n ref={ref}\n aria-label={label ? undefined : ariaLabel}\n classNames={{\n base: classNames.base,\n calendar: classNames.calendar,\n calendarContent: classNames.calendarContent,\n helperWrapper: classNames.helperWrapper,\n inputWrapper: classNames.inputWrapper,\n label: classNames.label,\n popoverContent: classNames.popoverContent,\n selectorButton: classNames.selectorButton,\n selectorIcon: classNames.selectorIcon,\n timeInput: classNames.timeInput,\n timeInputLabel: classNames.timeInputLabel,\n }}\n data-testid={testId}\n errorMessage={errorMessage}\n granularity={withTime ? 'minute' : 'day'}\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n id={testId}\n isDisabled={disabled}\n isInvalid={invalid}\n isRequired={required}\n label={label}\n labelPlacement=\"outside\"\n maxValue={parsedMaxValue}\n minValue={parsedMinValue}\n name={name}\n onBlur={onBlur}\n onChange={handleChange}\n placeholderValue={placeholderValue}\n radius=\"sm\"\n value={parsedValue}\n variant=\"bordered\"\n />\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":";;;;;;;AAiBA,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,UAAU,eAAe;CAClC,CAA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P,OAAO;EACP,SAAQ;CACT,CAAA;AAEL;;;AC3MA,IAAA,qBAAeC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["Button","FaPlus","FaCopy","VscInsert","FaTimes","Menu","Button","FaTimes","motion","FaGripVertical","CSS","AnimatePresence","motion","Grid","useUniformField","useUniformField","AnimatePresence","motion","FieldValidationError","PointerSensor","KeyboardSensor","DndContext","closestCenter","restrictToVerticalAxis","restrictToWindowEdges","SortableContext","verticalListSortingStrategy","useUniformFieldArray","flatArrayKey"],"sources":["../../src/FieldArray/subcomponents/ElementAppendButton.tsx","../../src/FieldArray/subcomponents/ElementActionsMenu.tsx","../../src/FieldArray/subcomponents/ElementRemoveButton.tsx","../../src/FieldArray/subcomponents/SortDragHandle.tsx","../../src/FieldArray/subcomponents/FieldArrayElement.tsx","../../src/FieldArray/subcomponents/FieldArrayLabel.tsx","../../src/FieldArray/subcomponents/FieldArrayValidationError.tsx","../../src/FieldArray/subcomponents/SortContext.tsx","../../src/FieldArray/FieldArray.tsx","../../src/FieldArray/index.ts"],"sourcesContent":["import type { ClassValue } from '@fuf-stack/pixel-utils';\n\nimport { FaPlus } from 'react-icons/fa';\n\nimport { cn } from '@fuf-stack/pixel-utils';\nimport { Button } from '@fuf-stack/pixels';\n\ninterface ElementAppendButtonProps {\n /** text of the append element button */\n appendButtonText?: string;\n /** CSS class name */\n className?: ClassValue;\n /** click handler */\n onClick: () => void;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\nconst ElementAppendButton = ({\n appendButtonText = 'Add Element',\n className = undefined,\n onClick,\n testId = undefined,\n}: ElementAppendButtonProps) => {\n return (\n <Button\n className={cn(className)}\n disableAnimation\n onClick={onClick}\n size=\"sm\"\n testId={testId}\n variant=\"light\"\n >\n <FaPlus />\n <span>{appendButtonText}</span>\n </Button>\n );\n};\n\nexport default ElementAppendButton;\n","import type { ClassValue } from '@fuf-stack/pixel-utils';\nimport type { MenuItem } from '@fuf-stack/pixels';\nimport type { Key } from 'react';\nimport type { FieldArrayElementMethods } from './FieldArrayElement';\n\nimport { FaCopy, FaTimes } from 'react-icons/fa';\nimport { VscInsert } from 'react-icons/vsc';\n\nimport { cn } from '@fuf-stack/pixel-utils';\nimport { Menu } from '@fuf-stack/pixels';\n\nexport interface ElementActionsMenuProps {\n /** CSS class name */\n className?: ClassValue;\n /** Whether duplicate action is available */\n duplicate?: boolean;\n /** Whether insert after action is available */\n insertAfter?: boolean;\n /** Whether to show remove button (false when last element is not deletable) */\n showRemove?: boolean;\n /** Field array operation methods */\n methods: FieldArrayElementMethods;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * Menu component for field array element actions (remove, duplicate, insert after)\n */\nconst ElementActionsMenu = ({\n className = undefined,\n duplicate = false,\n insertAfter = false,\n showRemove = true,\n methods,\n testId = undefined,\n}: ElementActionsMenuProps) => {\n const handleAction = (key: Key) => {\n switch (key) {\n case 'remove':\n methods.remove();\n break;\n case 'duplicate':\n methods.duplicate();\n break;\n case 'insertAfter':\n methods.insert();\n break;\n default:\n break;\n }\n };\n\n // Build menu items based on available actions\n const menuItems: MenuItem[] = [];\n\n if (duplicate) {\n menuItems.push({\n key: 'duplicate',\n label: 'Duplicate',\n icon: <FaCopy />,\n });\n }\n\n if (insertAfter) {\n menuItems.push({\n key: 'insertAfter',\n label: 'Insert After',\n icon: <VscInsert />,\n });\n }\n\n if (showRemove) {\n menuItems.push({\n key: 'remove',\n className: 'text-danger',\n label: 'Remove',\n icon: <FaTimes />,\n });\n }\n\n return (\n <Menu\n ariaLabel=\"Element actions\"\n items={menuItems}\n onAction={handleAction}\n placement=\"right\"\n testId={testId}\n triggerButtonProps={{\n className: cn(className),\n disableRipple: true,\n size: 'md',\n variant: 'light',\n }}\n />\n );\n};\n\nexport default ElementActionsMenu;\n","import type { ClassValue } from '@fuf-stack/pixel-utils';\n\nimport { FaTimes } from 'react-icons/fa';\n\nimport { motion } from '@fuf-stack/pixel-motion';\nimport { cn } from '@fuf-stack/pixel-utils';\nimport { Button } from '@fuf-stack/pixels';\n\ninterface ElementRemoveButtonProps {\n /** CSS class name */\n className?: ClassValue;\n /** Globally disable animations (used for first render or prefers-reduced-motion) */\n disableAnimation?: boolean;\n /** click handler */\n onClick: () => void;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\nconst ElementRemoveButton = ({\n className = undefined,\n disableAnimation = false,\n onClick,\n testId = undefined,\n}: ElementRemoveButtonProps) => {\n const button = (\n <Button\n ariaLabel=\"remove element\"\n className={cn(className)}\n color=\"danger\"\n icon={<FaTimes />}\n onClick={onClick}\n size=\"sm\"\n testId={testId}\n variant=\"light\"\n />\n );\n\n if (disableAnimation) {\n return button;\n }\n\n return (\n <motion.div\n animate={{ opacity: 1, width: 'auto' }}\n className=\"flex\"\n exit={{ opacity: 0, width: 0 }}\n initial={{ opacity: 0, width: 0 }}\n transition={{ duration: 0.2 }}\n >\n {button}\n </motion.div>\n );\n};\n\nexport default ElementRemoveButton;\n","import type { ClassValue } from '@fuf-stack/pixel-utils';\n\nimport { FaGripVertical } from 'react-icons/fa';\n\nimport { useSortable } from '@dnd-kit/sortable';\n\nimport { cn } from '@fuf-stack/pixel-utils';\n\ninterface SortDragHandleProps {\n /** Optional CSS class name */\n className?: ClassValue;\n /** Unique identifier for sortable item */\n id: string | number;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * Drag handle component that integrates with dnd-kit sortable functionality.\n * Renders a vertical grip icon that can be used to reorder items.\n */\nconst SortDragHandle = ({\n className = undefined,\n id,\n testId = undefined,\n}: SortDragHandleProps) => {\n // Get dnd-kit sortable attributes and listeners\n const { attributes, listeners } = useSortable({ id });\n\n return (\n <div\n className={cn(className)}\n data-testid={testId}\n {...attributes}\n {...listeners}\n >\n <FaGripVertical />\n </div>\n );\n};\n\nexport default SortDragHandle;\n","import type { Variants as MotionVariants } from '@fuf-stack/pixel-motion';\nimport type { ClassValue } from '@fuf-stack/pixel-utils';\nimport type { FieldArrayFeatures } from '../types';\n\nimport { useState } from 'react';\n\nimport { useSortable } from '@dnd-kit/sortable';\nimport { CSS } from '@dnd-kit/utilities';\n\nimport { AnimatePresence, motion } from '@fuf-stack/pixel-motion';\nimport { cn } from '@fuf-stack/pixel-utils';\n\nimport Grid from '../../Grid';\nimport ElementActionsMenu from './ElementActionsMenu';\nimport ElementRemoveButton from './ElementRemoveButton';\nimport SortDragHandle from './SortDragHandle';\n\nexport interface FieldArrayElementMethods {\n /** Add new element at end */\n append: () => void;\n /** Clone current element */\n duplicate: () => void;\n /** Add new element after current */\n insert: () => void;\n /** Remove current element */\n remove: () => void;\n}\n\ninterface FieldArrayElementProps extends FieldArrayFeatures {\n /** Form elements to render inside array element */\n children: React.ReactNode;\n /** CSS class names for component parts */\n className: {\n /** Class of wrapper grid inside the li that wraps the rendered element fields directly */\n elementFieldsGrid?: ClassValue;\n /** Class for the li (performs motion animations) */\n listItem?: ClassValue;\n /** Class for the li inner div (wraps the rendered element fields) */\n listItemInner?: ClassValue;\n /** Class for the actions menu button */\n actionsMenuButton?: ClassValue;\n /** Class for the remove element button (when menu is not used) */\n removeButton?: ClassValue;\n /** Class for the drag handle when sorting enabled */\n sortDragHandle?: ClassValue;\n };\n /** Globally disable animations for this item (used for first render or prefers-reduced-motion) */\n disableAnimation?: boolean;\n /** Bottom margin for elements (for backwards compatibility) */\n elementMarginBottom?: React.CSSProperties['marginBottom'];\n /** All fields in the form array */\n fields: Record<'id', string>[];\n /** Unique identifier for drag/drop */\n id: string | number;\n /** Field index in array */\n index: number;\n /** Prevent deletion of last remaining element */\n lastNotDeletable?: boolean;\n /** Field array operation methods */\n methods: FieldArrayElementMethods;\n /** HTML data-testid of the element */\n testId?: string;\n}\n\n/**\n * Form array element component using react-hook-form with drag-drop sorting\n * and validation capabilities. Animations when elements are added or removed\n * improve the user experience and provide a better visual feedback.\n */\nconst FieldArrayElement = ({\n children,\n className,\n disableAnimation = false,\n duplicate = false,\n elementMarginBottom: _elementMarginBottom = undefined,\n fields,\n id,\n index: _index,\n insertAfter = false,\n lastNotDeletable = true,\n methods,\n sortable = false,\n testId = undefined,\n}: FieldArrayElementProps) => {\n // Apply transform styles when sortable is enabled for smooth drag animations\n // transform: handles the item's position during drag\n // transition: controls the animation timing when dropping\n const { setNodeRef, transform, transition, isDragging } = useSortable({ id });\n const sortingStyle = sortable\n ? {\n transform: CSS.Translate.toString(transform),\n transition,\n zIndex: isDragging ? 50 : undefined,\n }\n : undefined;\n\n // Local visibility to allow exit animation before removing from RHF state\n const [isVisible, setIsVisible] = useState(true);\n\n // Motion variants for the list item\n const listItemMotionVariants: MotionVariants = {\n hidden: { opacity: 0, height: 0, marginBottom: 0 },\n visible: {\n opacity: 1,\n height: 'auto',\n transition: { duration: 0.2, ease: 'circOut' },\n // push last visible item down to overlap with append button (hide double border)\n marginBottom: '-1px',\n },\n exit: {\n opacity: 0,\n height: 0,\n marginBottom: 0,\n transition: {\n // on exit first fade out, then shrink\n opacity: { duration: 0.1, ease: 'circOut' },\n height: { delay: 0.1, duration: 0.2, ease: 'circOut' },\n },\n },\n };\n\n // Height animation handled on <motion.li> using overflow hidden\n return (\n <AnimatePresence\n mode=\"wait\"\n // remove from RHF state after exit animation\n onExitComplete={() => {\n methods.remove();\n }}\n >\n {isVisible ? (\n <motion.li\n key={id}\n ref={setNodeRef}\n animate={disableAnimation ? undefined : 'visible'}\n className={cn(className.listItem)}\n data-dragging={isDragging}\n data-testid={`${testId}_element`}\n exit={disableAnimation ? undefined : 'exit'}\n initial={disableAnimation ? false : 'hidden'}\n style={sortingStyle}\n variants={disableAnimation ? undefined : listItemMotionVariants}\n >\n <div className={cn(className.listItemInner)}>\n {/** sorting drag handle */}\n {sortable ? (\n <SortDragHandle\n className={className.sortDragHandle}\n id={id}\n testId={`${testId}_sort_drag_handle`}\n />\n ) : null}\n\n {/** render element fields in Grid component */}\n <Grid\n className={cn(className.elementFieldsGrid)}\n testId={`${testId}_element_fields_grid`}\n >\n {/* render actual fields */}\n {children}\n </Grid>\n\n {/** actions menu when duplicate or insertAfter is enabled */}\n {duplicate || insertAfter ? (\n <ElementActionsMenu\n className={className.actionsMenuButton}\n duplicate={duplicate}\n insertAfter={insertAfter}\n methods={{\n ...methods,\n remove: () => {\n if (disableAnimation) {\n methods.remove();\n } else {\n setIsVisible(false);\n }\n },\n }}\n showRemove={!(lastNotDeletable && fields.length === 1)}\n testId={`${testId}_actions_menu`}\n />\n ) : (\n <>\n {/** remove element button (when menu is not used) */}\n <AnimatePresence initial={false}>\n {lastNotDeletable && fields.length === 1 ? null : (\n <ElementRemoveButton\n key=\"remove-button\"\n className={className.removeButton}\n disableAnimation={disableAnimation}\n onClick={() => {\n if (disableAnimation) {\n methods.remove();\n } else {\n setIsVisible(false);\n }\n }}\n testId={`${testId}_remove_button`}\n />\n )}\n </AnimatePresence>\n </>\n )}\n </div>\n </motion.li>\n ) : null}\n </AnimatePresence>\n );\n};\n\nexport default FieldArrayElement;\n","import type { ReactNode } from 'react';\n\nimport { cn } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../../hooks/useUniformField';\n\nexport interface FieldArrayLabelProps {\n /** CSS class name */\n className?: string;\n /** Label content */\n label: ReactNode;\n /** Field name */\n name: string;\n}\n\n/**\n * Renders the label for a FieldArray component.\n *\n * This component handles displaying the array label with proper accessibility\n * attributes using the label props from useUniformField.\n */\nconst FieldArrayLabel = ({\n className = undefined,\n label: _label,\n name,\n}: FieldArrayLabelProps) => {\n const { error, getLabelProps, invalid, label } = useUniformField({\n name,\n label: _label,\n });\n\n // when no label is provided, don't render anything\n if (!_label) {\n return null;\n }\n\n // @ts-expect-error - error._errors exists but not typed\n const hasErrors = invalid && error?._errors;\n\n return (\n <div\n {...getLabelProps()}\n aria-level={3}\n className={cn(getLabelProps()?.className, className, {\n // when there are no array level errors, the label should have foreground color\n 'text-foreground!': !hasErrors,\n })}\n role=\"heading\"\n >\n {label}\n </div>\n );\n};\n\nexport default FieldArrayLabel;\n","import {\n AnimatePresence,\n motion,\n useReducedMotion,\n} from '@fuf-stack/pixel-motion';\nimport { cn } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../../hooks/useUniformField';\nimport FieldValidationError from '../../partials/FieldValidationError/FieldValidationError';\n\nexport interface FieldArrayValidationErrorProps {\n /** Field name */\n name: string;\n}\n\n/**\n * Renders array-level validation errors for FieldArray.\n *\n * This component handles validation errors that apply to the entire array\n * (e.g., \"Array must contain at least 3 elements\", \"Array elements are not unique\"),\n * as opposed to field-level errors which apply to individual array elements.\n *\n * The component wraps errors in the proper accessibility markup and animates\n * them in/out using Framer Motion when they appear or are resolved.\n */\nconst FieldArrayValidationError = ({\n name,\n}: FieldArrayValidationErrorProps) => {\n const {\n error,\n getErrorMessageProps,\n getHelperWrapperProps,\n invalid,\n testId,\n } = useUniformField({\n name,\n });\n\n // disable all animation if user prefers reduced motion\n const disableAnimation = useReducedMotion();\n\n // @ts-expect-error - error._errors exists but not typed\n const hasErrors = invalid && error?._errors;\n\n return (\n <AnimatePresence initial={!disableAnimation}>\n {hasErrors ? (\n <motion.div\n key=\"field-array-errors\"\n animate={\n disableAnimation ? undefined : { opacity: 1, height: 'auto' }\n }\n exit={disableAnimation ? undefined : { opacity: 0, height: 0 }}\n initial={disableAnimation ? false : { height: 0, opacity: 0 }}\n style={{ overflow: 'hidden' }}\n transition={{ duration: 0.4, ease: 'circOut' }}\n >\n <div\n {...getHelperWrapperProps()}\n className={cn(\n getHelperWrapperProps()?.className,\n // force helper to be visible and add padding (pt-1 to compensate for inner content's top padding)\n 'block px-3 pb-2 pt-1',\n )}\n >\n <div {...getErrorMessageProps()}>\n <FieldValidationError\n // @ts-expect-error - error._errors exists but not typed\n error={error._errors}\n testId={testId}\n />\n </div>\n </div>\n </motion.div>\n ) : null}\n </AnimatePresence>\n );\n};\n\nexport default FieldArrayValidationError;\n","import type { DragEndEvent } from '@dnd-kit/core';\nimport type { ReactNode } from 'react';\nimport type { UseFieldArrayMove } from 'react-hook-form';\n\nimport { useFormContext } from 'react-hook-form';\n\nimport {\n closestCenter,\n DndContext,\n KeyboardSensor,\n PointerSensor,\n useSensor,\n useSensors,\n} from '@dnd-kit/core';\nimport {\n restrictToVerticalAxis,\n restrictToWindowEdges,\n} from '@dnd-kit/modifiers';\nimport {\n SortableContext,\n verticalListSortingStrategy,\n} from '@dnd-kit/sortable';\n\ninterface SortContextProps {\n /** child components */\n children: ReactNode;\n /** Array of objects containing unique IDs for sortable items */\n fields: Record<'id', string>[];\n /** name of the field array */\n name: string;\n /** react-hook-form's move function to update field array indices */\n move: UseFieldArrayMove;\n /** enable/disable sorting functionality */\n sortable: boolean;\n}\n\n/**\n * A wrapper component that provides drag-and-drop sorting functionality for field arrays\n * using dnd-kit and react-hook-form.\n *\n * This component integrates with react-hook-form's field arrays to enable vertical\n * drag-and-drop reordering of form fields. It supports both pointer (mouse/touch)\n * and keyboard interactions for accessibility.\n */\nconst SortContext = ({\n children,\n fields,\n move,\n name,\n sortable,\n}: SortContextProps): ReactNode => {\n const { trigger } = useFormContext();\n\n // Initialize sensors for both pointer (mouse/touch) and keyboard interactions\n const sensors = useSensors(\n useSensor(PointerSensor),\n useSensor(KeyboardSensor),\n );\n\n // Early return if sorting is disabled\n if (!sortable) {\n return children;\n }\n\n /**\n * Handles the end of a drag operation by updating field positions\n * @param event - The drag end event containing active and over elements\n */\n const handleDragEnd = (event: DragEndEvent) => {\n const { active, over } = event;\n\n // Only move if dropping over a different item\n if (active.id !== over?.id) {\n // Find the indices of the dragged item and drop target\n const oldIndex = fields.findIndex((field) => {\n return field.id === active.id;\n });\n const newIndex = fields.findIndex((field) => {\n return field.id === over?.id;\n });\n // Update the field array order using react-hook-form's move function\n move(oldIndex, newIndex);\n\n // Finally trigger validation for the array field,\n // so validation errors are updated for the new order\n trigger(name);\n }\n };\n\n return (\n <DndContext\n collisionDetection={closestCenter}\n modifiers={[restrictToVerticalAxis, restrictToWindowEdges]}\n onDragEnd={handleDragEnd}\n sensors={sensors}\n >\n <SortableContext\n items={fields.map((field) => {\n return field.id;\n })}\n strategy={verticalListSortingStrategy}\n >\n {children}\n </SortableContext>\n </DndContext>\n );\n};\n\nexport default SortContext;\n","import type { FieldArrayElementMethods } from './subcomponents/FieldArrayElement';\nimport type { FieldArrayProps } from './types';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { flatArrayKey } from '../helpers';\nimport { useUniformFieldArray } from '../hooks/useUniformFieldArray';\nimport ElementAppendButton from './subcomponents/ElementAppendButton';\nimport FieldArrayElement from './subcomponents/FieldArrayElement';\nimport FieldArrayLabel from './subcomponents/FieldArrayLabel';\nimport FieldArrayValidationError from './subcomponents/FieldArrayValidationError';\nimport SortContext from './subcomponents/SortContext';\n\nexport const fieldArrayVariants = tv({\n slots: {\n /** base class for the field array wrapper */\n base: [\n // base styles\n 'overflow-hidden rounded-small border border-divider bg-content1',\n // divider between items\n 'divide-y divide-divider',\n ],\n /** class for the actions menu button */\n actionsMenuButton: [\n // base styles\n 'flex items-center justify-center text-default-600',\n // fixed height/no round corners/center align\n 'h-full rounded-none',\n // focus styles - inset ring\n 'outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus',\n ],\n /** class for the append button */\n appendButton: [\n // base styles\n 'w-full justify-start rounded-b-small rounded-t-none font-semibold',\n // match label height (p-3 = 12px vertical padding + text-base line height)\n '!h-[48px] !min-h-0',\n // focus styles - inset ring with rounded bottom corners to match container\n 'outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus',\n ],\n /** class for the element fields grid */\n elementFieldsGrid: ['w-full grow p-3'],\n /** class for the label */\n label: [\n // override HeroUI label positioning and display\n 'pointer-events-auto! static! z-auto! block! w-full!',\n // reset any transforms or translations\n 'translate-x-0! translate-y-0! transform-none!',\n // card header styling - use text-medium (16px) instead of text-base for correct 48px height\n 'rounded-t-small p-3 font-semibold text-medium',\n ],\n /** class for the list */\n list: ['overflow-hidden'],\n /** class for the list wrapper */\n listWrapper: ['overflow-hidden'],\n /** class for the list item (performs motion animations) */\n listItem: [\n // base styles\n 'group relative flex flex-row',\n // overlap borders by shifting first item up 1px (similar to how last item overlaps with append button)\n 'first:-mt-px',\n ],\n /** class for the list item inner */\n listItemInner: [\n // base styles\n 'flex w-full flex-row items-stretch divide-divider bg-content1',\n // x division and borders\n 'divide-x divide-solid border-b border-t border-divider',\n ],\n /** class for the remove button */\n removeButton: [\n // base styles\n 'flex items-center justify-center',\n // fixed height/no round corners\n '!h-full !min-h-0 !rounded-none px-3',\n // focus styles - inset ring\n 'outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus',\n ],\n /** class for the sort drag handle */\n sortDragHandle: [\n // base styles\n 'flex cursor-grab items-center justify-center px-2 text-default-600 transition-colors',\n // hover and dragging state\n 'hover:bg-default-100 active:cursor-grabbing group-data-[dragging=true]:bg-default-100',\n // focus styles - inset ring\n 'outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus',\n ],\n },\n variants: {\n hasLabel: {\n false: {\n // focus styles - when there is no label, the first item actions menu button should have rounded top right corners\n actionsMenuButton:\n 'group-[:first-child]:!rounded-tr-small group-[:first-child]:group-data-[dragging=true]:!rounded-tr-none',\n // focus styles - when there is no label, the first item remove button focus ring should have rounded top right corners\n removeButton:\n 'group-[:first-child]:!rounded-tr-small group-[:first-child]:group-data-[dragging=true]:!rounded-tr-none',\n // focus styles - when there is no label, the first item sort drag handle focus ring should have rounded top left corners\n sortDragHandle:\n 'group-[:first-child]:rounded-tl-small group-[:first-child]:group-data-[dragging=true]:rounded-tl-none',\n },\n },\n },\n});\n\n/**\n * FieldArray component based in [RHF useFieldArray](https://react-hook-form.com/docs/usefieldarray)\n */\nconst FieldArray = ({\n appendButtonText = 'Add Element',\n children,\n className: _className = undefined,\n duplicate = false,\n elementInitialValue: _elementInitialValue = null,\n elementMarginBottom = undefined,\n flat = false,\n insertAfter = false,\n lastElementNotRemovable = false,\n name,\n sortable = false,\n ...uniformFieldProps\n}: FieldArrayProps) => {\n const {\n fields,\n append,\n remove,\n insert,\n move,\n disableAnimation,\n elementInitialValue,\n getValues,\n testId,\n } = useUniformFieldArray({\n name,\n flat,\n elementInitialValue: _elementInitialValue,\n lastElementNotRemovable,\n ...uniformFieldProps,\n });\n\n // className from slots\n const variants = fieldArrayVariants({ hasLabel: !!uniformFieldProps.label });\n const className = variantsToClassNames(variants, _className, 'base');\n\n return (\n <div className={className.base}>\n {/* field array label */}\n <FieldArrayLabel\n className={className.label}\n label={uniformFieldProps.label}\n name={name}\n />\n\n {fields.length ? (\n /* list wrapper */\n <div className={cn(className.listWrapper)}>\n {/* sortable context */}\n <SortContext\n fields={fields}\n move={move}\n name={name}\n sortable={sortable}\n >\n {/* list container */}\n <ul className={className.list} data-testid={testId}>\n {/* fields / list elements */}\n {fields.map((field, index) => {\n const elementName = flat\n ? `${name}.${index}.${flatArrayKey}`\n : `${name}.${index}`;\n const elementTestId = `${testId}_${index}`;\n\n // create methods for element\n const elementMethods: FieldArrayElementMethods = {\n append: () => {\n append(elementInitialValue);\n },\n duplicate: () => {\n const values = getValues(name);\n const currentValue = (values as unknown[])[index];\n const nextValue = flat\n ? { [flatArrayKey]: currentValue }\n : currentValue;\n insert(index + 1, nextValue);\n },\n insert: () => {\n insert(index + 1, elementInitialValue);\n },\n remove: () => {\n remove(index);\n },\n };\n\n return (\n <FieldArrayElement\n key={field.id}\n className={className}\n disableAnimation={disableAnimation}\n duplicate={duplicate}\n elementMarginBottom={elementMarginBottom}\n fields={fields}\n id={field.id}\n index={index}\n insertAfter={insertAfter}\n lastNotDeletable={lastElementNotRemovable}\n methods={elementMethods}\n sortable={sortable}\n testId={elementTestId}\n >\n {children({\n index,\n length: fields.length,\n methods: elementMethods,\n name: elementName,\n testId: elementTestId,\n })}\n </FieldArrayElement>\n );\n })}\n </ul>\n </SortContext>\n </div>\n ) : null}\n\n {/* top level field array errors */}\n <FieldArrayValidationError name={name} />\n\n {/* append elements button */}\n <ElementAppendButton\n appendButtonText={appendButtonText}\n className={className.appendButton}\n onClick={() => {\n append(elementInitialValue);\n }}\n testId={`${testId}_append_button`}\n />\n </div>\n );\n};\n\nexport default FieldArray;\n","import FieldArray from './FieldArray';\n\nexport type * from './types';\n\nexport { fieldArrayVariants } from './FieldArray';\n\nexport default FieldArray;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAM,uBAAuB,EAC3B,mBAAmB,eACnB,YAAY,KAAA,GACZ,SACA,SAAS,KAAA,QACqB;CAC9B,OACE,iBAAA,GAAA,kBAAA,MAACA,kBAAAA,QAAD;EACE,YAAA,GAAA,uBAAA,IAAc,SAAS;EACvB,kBAAA;EACS;EACT,MAAK;EACG;EACR,SAAQ;YANV,CAQE,iBAAA,GAAA,kBAAA,KAACC,eAAAA,QAAD,CAAS,CAAA,GACT,iBAAA,GAAA,kBAAA,KAAC,QAAD,EAAA,UAAO,iBAAuB,CAAA,CACxB;;AAEZ;;;;;;ACRA,MAAM,sBAAsB,EAC1B,YAAY,KAAA,GACZ,YAAY,OACZ,cAAc,OACd,aAAa,MACb,SACA,SAAS,KAAA,QACoB;CAC7B,MAAM,gBAAgB,QAAa;EACjC,QAAQ,KAAR;GACE,KAAK;IACH,QAAQ,OAAO;IACf;GACF,KAAK;IACH,QAAQ,UAAU;IAClB;GACF,KAAK;IACH,QAAQ,OAAO;IACf;GACF,SACE;EACJ;CACF;CAGA,MAAM,YAAwB,CAAC;CAE/B,IAAI,WACF,UAAU,KAAK;EACb,KAAK;EACL,OAAO;EACP,MAAM,iBAAA,GAAA,kBAAA,KAACC,eAAAA,QAAD,CAAS,CAAA;CACjB,CAAC;CAGH,IAAI,aACF,UAAU,KAAK;EACb,KAAK;EACL,OAAO;EACP,MAAM,iBAAA,GAAA,kBAAA,KAACC,gBAAAA,WAAD,CAAY,CAAA;CACpB,CAAC;CAGH,IAAI,YACF,UAAU,KAAK;EACb,KAAK;EACL,WAAW;EACX,OAAO;EACP,MAAM,iBAAA,GAAA,kB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kBAAkB;QAClB,SAAS;QACC;QACV,QAAQ;kBAEP,SAAS;SACR;SACA,QAAQ,OAAO;SACf,SAAS;SACT,MAAM;SACN,QAAQ;QACV,CAAC;OACgB,GArBZ,MAAM,EAqBM;MAEvB,CAAC;KACC,CAAA;IACO,CAAA;GACV,CAAA,IACH;GAGJ,iBAAA,GAAA,kBAAA,KAAC,2BAAD,EAAiC,KAAO,CAAA;GAGxC,iBAAA,GAAA,kBAAA,KAAC,qBAAD;IACoB;IAClB,WAAW,UAAU;IACrB,eAAe;KACb,OAAO,mBAAmB;IAC5B;IACA,QAAQ,GAAG,OAAO;GACnB,CAAA;EACE;;AAET;;;ACxOA,IAAA,qBAAe"}
1
+ {"version":3,"file":"index.cjs","names":["Button","FaPlus","FaCopy","VscInsert","FaTimes","Menu","Button","FaTimes","motion","FaGripVertical","CSS","AnimatePresence","motion","Grid","useUniformField","useUniformField","AnimatePresence","motion","FieldValidationError","PointerSensor","KeyboardSensor","DndContext","closestCenter","restrictToVerticalAxis","restrictToWindowEdges","SortableContext","verticalListSortingStrategy","useUniformFieldArray","flatArrayKey"],"sources":["../../src/FieldArray/subcomponents/ElementAppendButton.tsx","../../src/FieldArray/subcomponents/ElementActionsMenu.tsx","../../src/FieldArray/subcomponents/ElementRemoveButton.tsx","../../src/FieldArray/subcomponents/SortDragHandle.tsx","../../src/FieldArray/subcomponents/FieldArrayElement.tsx","../../src/FieldArray/subcomponents/FieldArrayLabel.tsx","../../src/FieldArray/subcomponents/FieldArrayValidationError.tsx","../../src/FieldArray/subcomponents/SortContext.tsx","../../src/FieldArray/FieldArray.tsx","../../src/FieldArray/index.ts"],"sourcesContent":["import type { ClassValue } from '@fuf-stack/pixel-utils';\n\nimport { FaPlus } from 'react-icons/fa';\n\nimport { cn } from '@fuf-stack/pixel-utils';\nimport { Button } from '@fuf-stack/pixels';\n\ninterface ElementAppendButtonProps {\n /** text of the append element button */\n appendButtonText?: string;\n /** CSS class name */\n className?: ClassValue;\n /** click handler */\n onClick: () => void;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\nconst ElementAppendButton = ({\n appendButtonText = 'Add Element',\n className = undefined,\n onClick,\n testId = undefined,\n}: ElementAppendButtonProps) => {\n return (\n <Button\n className={cn(className)}\n disableAnimation\n onClick={onClick}\n size=\"sm\"\n testId={testId}\n variant=\"light\"\n >\n <FaPlus />\n <span>{appendButtonText}</span>\n </Button>\n );\n};\n\nexport default ElementAppendButton;\n","import type { ClassValue } from '@fuf-stack/pixel-utils';\nimport type { MenuItem } from '@fuf-stack/pixels';\nimport type { Key } from 'react';\nimport type { FieldArrayElementMethods } from './FieldArrayElement';\n\nimport { FaCopy, FaTimes } from 'react-icons/fa';\nimport { VscInsert } from 'react-icons/vsc';\n\nimport { cn } from '@fuf-stack/pixel-utils';\nimport { Menu } from '@fuf-stack/pixels';\n\nexport interface ElementActionsMenuProps {\n /** CSS class name */\n className?: ClassValue;\n /** Whether duplicate action is available */\n duplicate?: boolean;\n /** Whether insert after action is available */\n insertAfter?: boolean;\n /** Whether to show remove button (false when last element is not deletable) */\n showRemove?: boolean;\n /** Field array operation methods */\n methods: FieldArrayElementMethods;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * Menu component for field array element actions (remove, duplicate, insert after)\n */\nconst ElementActionsMenu = ({\n className = undefined,\n duplicate = false,\n insertAfter = false,\n showRemove = true,\n methods,\n testId = undefined,\n}: ElementActionsMenuProps) => {\n const handleAction = (key: Key) => {\n switch (key) {\n case 'remove':\n methods.remove();\n break;\n case 'duplicate':\n methods.duplicate();\n break;\n case 'insertAfter':\n methods.insert();\n break;\n default:\n break;\n }\n };\n\n // Build menu items based on available actions\n const menuItems: MenuItem[] = [];\n\n if (duplicate) {\n menuItems.push({\n key: 'duplicate',\n label: 'Duplicate',\n icon: <FaCopy />,\n });\n }\n\n if (insertAfter) {\n menuItems.push({\n key: 'insertAfter',\n label: 'Insert After',\n icon: <VscInsert />,\n });\n }\n\n if (showRemove) {\n menuItems.push({\n key: 'remove',\n className: 'text-danger',\n label: 'Remove',\n icon: <FaTimes />,\n });\n }\n\n return (\n <Menu\n ariaLabel=\"Element actions\"\n items={menuItems}\n onAction={handleAction}\n placement=\"right\"\n testId={testId}\n triggerButtonProps={{\n className: cn(className),\n disableRipple: true,\n size: 'md',\n variant: 'light',\n }}\n />\n );\n};\n\nexport default ElementActionsMenu;\n","import type { ClassValue } from '@fuf-stack/pixel-utils';\n\nimport { FaTimes } from 'react-icons/fa';\n\nimport { motion } from '@fuf-stack/pixel-motion';\nimport { cn } from '@fuf-stack/pixel-utils';\nimport { Button } from '@fuf-stack/pixels';\n\ninterface ElementRemoveButtonProps {\n /** CSS class name */\n className?: ClassValue;\n /** Globally disable animations (used for first render or prefers-reduced-motion) */\n disableAnimation?: boolean;\n /** click handler */\n onClick: () => void;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\nconst ElementRemoveButton = ({\n className = undefined,\n disableAnimation = false,\n onClick,\n testId = undefined,\n}: ElementRemoveButtonProps) => {\n const button = (\n <Button\n ariaLabel=\"remove element\"\n className={cn(className)}\n color=\"danger\"\n icon={<FaTimes />}\n onClick={onClick}\n size=\"sm\"\n testId={testId}\n variant=\"light\"\n />\n );\n\n if (disableAnimation) {\n return button;\n }\n\n return (\n <motion.div\n animate={{ opacity: 1, width: 'auto' }}\n className=\"flex\"\n exit={{ opacity: 0, width: 0 }}\n initial={{ opacity: 0, width: 0 }}\n transition={{ duration: 0.2 }}\n >\n {button}\n </motion.div>\n );\n};\n\nexport default ElementRemoveButton;\n","import type { ClassValue } from '@fuf-stack/pixel-utils';\n\nimport { FaGripVertical } from 'react-icons/fa';\n\nimport { useSortable } from '@dnd-kit/sortable';\n\nimport { cn } from '@fuf-stack/pixel-utils';\n\ninterface SortDragHandleProps {\n /** Optional CSS class name */\n className?: ClassValue;\n /** Unique identifier for sortable item */\n id: string | number;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * Drag handle component that integrates with dnd-kit sortable functionality.\n * Renders a vertical grip icon that can be used to reorder items.\n */\nconst SortDragHandle = ({\n className = undefined,\n id,\n testId = undefined,\n}: SortDragHandleProps) => {\n // Get dnd-kit sortable attributes and listeners\n const { attributes, listeners } = useSortable({ id });\n\n return (\n <div\n className={cn(className)}\n data-testid={testId}\n {...attributes}\n {...listeners}\n >\n <FaGripVertical />\n </div>\n );\n};\n\nexport default SortDragHandle;\n","import type { Variants as MotionVariants } from '@fuf-stack/pixel-motion';\nimport type { ClassValue } from '@fuf-stack/pixel-utils';\nimport type { FieldArrayFeatures } from '../types';\n\nimport { useState } from 'react';\n\nimport { useSortable } from '@dnd-kit/sortable';\nimport { CSS } from '@dnd-kit/utilities';\n\nimport { AnimatePresence, motion } from '@fuf-stack/pixel-motion';\nimport { cn } from '@fuf-stack/pixel-utils';\n\nimport Grid from '../../Grid';\nimport ElementActionsMenu from './ElementActionsMenu';\nimport ElementRemoveButton from './ElementRemoveButton';\nimport SortDragHandle from './SortDragHandle';\n\nexport interface FieldArrayElementMethods {\n /** Add new element at end */\n append: () => void;\n /** Clone current element */\n duplicate: () => void;\n /** Add new element after current */\n insert: () => void;\n /** Remove current element */\n remove: () => void;\n}\n\ninterface FieldArrayElementProps extends FieldArrayFeatures {\n /** Form elements to render inside array element */\n children: React.ReactNode;\n /** CSS class names for component parts */\n className: {\n /** Class of wrapper grid inside the li that wraps the rendered element fields directly */\n elementFieldsGrid?: ClassValue;\n /** Class for the li (performs motion animations) */\n listItem?: ClassValue;\n /** Class for the li inner div (wraps the rendered element fields) */\n listItemInner?: ClassValue;\n /** Class for the actions menu button */\n actionsMenuButton?: ClassValue;\n /** Class for the remove element button (when menu is not used) */\n removeButton?: ClassValue;\n /** Class for the drag handle when sorting enabled */\n sortDragHandle?: ClassValue;\n };\n /** Globally disable animations for this item (used for first render or prefers-reduced-motion) */\n disableAnimation?: boolean;\n /** Bottom margin for elements (for backwards compatibility) */\n elementMarginBottom?: React.CSSProperties['marginBottom'];\n /** All fields in the form array */\n fields: Record<'id', string>[];\n /** Unique identifier for drag/drop */\n id: string | number;\n /** Field index in array */\n index: number;\n /** Prevent deletion of last remaining element */\n lastNotDeletable?: boolean;\n /** Field array operation methods */\n methods: FieldArrayElementMethods;\n /** HTML data-testid of the element */\n testId?: string;\n}\n\n/**\n * Form array element component using react-hook-form with drag-drop sorting\n * and validation capabilities. Animations when elements are added or removed\n * improve the user experience and provide a better visual feedback.\n */\nconst FieldArrayElement = ({\n children,\n className,\n disableAnimation = false,\n duplicate = false,\n elementMarginBottom: _elementMarginBottom = undefined,\n fields,\n id,\n index: _index,\n insertAfter = false,\n lastNotDeletable = true,\n methods,\n sortable = false,\n testId = undefined,\n}: FieldArrayElementProps) => {\n // Apply transform styles when sortable is enabled for smooth drag animations\n // transform: handles the item's position during drag\n // transition: controls the animation timing when dropping\n const { setNodeRef, transform, transition, isDragging } = useSortable({ id });\n const sortingStyle = sortable\n ? {\n transform: CSS.Translate.toString(transform),\n transition,\n zIndex: isDragging ? 50 : undefined,\n }\n : undefined;\n\n // Local visibility to allow exit animation before removing from RHF state\n const [isVisible, setIsVisible] = useState(true);\n\n // Motion variants for the list item\n const listItemMotionVariants: MotionVariants = {\n hidden: { opacity: 0, height: 0, marginBottom: 0 },\n visible: {\n opacity: 1,\n height: 'auto',\n transition: { duration: 0.2, ease: 'circOut' },\n // push last visible item down to overlap with append button (hide double border)\n marginBottom: '-1px',\n },\n exit: {\n opacity: 0,\n height: 0,\n marginBottom: 0,\n transition: {\n // on exit first fade out, then shrink\n opacity: { duration: 0.1, ease: 'circOut' },\n height: { delay: 0.1, duration: 0.2, ease: 'circOut' },\n },\n },\n };\n\n // Height animation handled on <motion.li> using overflow hidden\n return (\n <AnimatePresence\n mode=\"wait\"\n // remove from RHF state after exit animation\n onExitComplete={() => {\n methods.remove();\n }}\n >\n {isVisible ? (\n <motion.li\n key={id}\n ref={setNodeRef}\n animate={disableAnimation ? undefined : 'visible'}\n className={cn(className.listItem)}\n data-dragging={isDragging}\n data-testid={`${testId}_element`}\n exit={disableAnimation ? undefined : 'exit'}\n initial={disableAnimation ? false : 'hidden'}\n style={sortingStyle}\n variants={disableAnimation ? undefined : listItemMotionVariants}\n >\n <div className={cn(className.listItemInner)}>\n {/** sorting drag handle */}\n {sortable ? (\n <SortDragHandle\n className={className.sortDragHandle}\n id={id}\n testId={`${testId}_sort_drag_handle`}\n />\n ) : null}\n\n {/** render element fields in Grid component */}\n <Grid\n className={cn(className.elementFieldsGrid)}\n testId={`${testId}_element_fields_grid`}\n >\n {/* render actual fields */}\n {children}\n </Grid>\n\n {/** actions menu when duplicate or insertAfter is enabled */}\n {duplicate || insertAfter ? (\n <ElementActionsMenu\n className={className.actionsMenuButton}\n duplicate={duplicate}\n insertAfter={insertAfter}\n methods={{\n ...methods,\n remove: () => {\n if (disableAnimation) {\n methods.remove();\n } else {\n setIsVisible(false);\n }\n },\n }}\n showRemove={!(lastNotDeletable && fields.length === 1)}\n testId={`${testId}_actions_menu`}\n />\n ) : (\n <>\n {/** remove element button (when menu is not used) */}\n <AnimatePresence initial={false}>\n {lastNotDeletable && fields.length === 1 ? null : (\n <ElementRemoveButton\n key=\"remove-button\"\n className={className.removeButton}\n disableAnimation={disableAnimation}\n onClick={() => {\n if (disableAnimation) {\n methods.remove();\n } else {\n setIsVisible(false);\n }\n }}\n testId={`${testId}_remove_button`}\n />\n )}\n </AnimatePresence>\n </>\n )}\n </div>\n </motion.li>\n ) : null}\n </AnimatePresence>\n );\n};\n\nexport default FieldArrayElement;\n","import type { ReactNode } from 'react';\n\nimport { cn } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../../hooks/useUniformField';\n\nexport interface FieldArrayLabelProps {\n /** CSS class name */\n className?: string;\n /** Label content */\n label: ReactNode;\n /** Field name */\n name: string;\n}\n\n/**\n * Renders the label for a FieldArray component.\n *\n * This component handles displaying the array label with proper accessibility\n * attributes using the label props from useUniformField.\n */\nconst FieldArrayLabel = ({\n className = undefined,\n label: _label,\n name,\n}: FieldArrayLabelProps) => {\n const { error, getLabelProps, invalid, label } = useUniformField({\n name,\n label: _label,\n });\n\n // when no label is provided, don't render anything\n if (!_label) {\n return null;\n }\n\n // @ts-expect-error - error._errors exists but not typed\n const hasErrors = invalid && error?._errors;\n\n return (\n <div\n {...getLabelProps()}\n aria-level={3}\n className={cn(getLabelProps()?.className, className, {\n // when there are no array level errors, the label should have foreground color\n 'text-foreground!': !hasErrors,\n })}\n role=\"heading\"\n >\n {label}\n </div>\n );\n};\n\nexport default FieldArrayLabel;\n","import {\n AnimatePresence,\n motion,\n useReducedMotion,\n} from '@fuf-stack/pixel-motion';\nimport { cn } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../../hooks/useUniformField';\nimport FieldValidationError from '../../partials/FieldValidationError/FieldValidationError';\n\nexport interface FieldArrayValidationErrorProps {\n /** Field name */\n name: string;\n}\n\n/**\n * Renders array-level validation errors for FieldArray.\n *\n * This component handles validation errors that apply to the entire array\n * (e.g., \"Array must contain at least 3 elements\", \"Array elements are not unique\"),\n * as opposed to field-level errors which apply to individual array elements.\n *\n * The component wraps errors in the proper accessibility markup and animates\n * them in/out using Framer Motion when they appear or are resolved.\n */\nconst FieldArrayValidationError = ({\n name,\n}: FieldArrayValidationErrorProps) => {\n const {\n error,\n getErrorMessageProps,\n getHelperWrapperProps,\n invalid,\n testId,\n } = useUniformField({\n name,\n });\n\n // disable all animation if user prefers reduced motion\n const disableAnimation = useReducedMotion();\n\n // @ts-expect-error - error._errors exists but not typed\n const hasErrors = invalid && error?._errors;\n\n return (\n <AnimatePresence initial={!disableAnimation}>\n {hasErrors ? (\n <motion.div\n key=\"field-array-errors\"\n animate={\n disableAnimation ? undefined : { opacity: 1, height: 'auto' }\n }\n exit={disableAnimation ? undefined : { opacity: 0, height: 0 }}\n initial={disableAnimation ? false : { height: 0, opacity: 0 }}\n style={{ overflow: 'hidden' }}\n transition={{ duration: 0.4, ease: 'circOut' }}\n >\n <div\n {...getHelperWrapperProps()}\n className={cn(\n getHelperWrapperProps()?.className,\n // force helper to be visible and add padding (pt-1 to compensate for inner content's top padding)\n 'block px-3 pb-2 pt-1',\n )}\n >\n <div {...getErrorMessageProps()}>\n <FieldValidationError\n // @ts-expect-error - error._errors exists but not typed\n error={error._errors}\n testId={testId}\n />\n </div>\n </div>\n </motion.div>\n ) : null}\n </AnimatePresence>\n );\n};\n\nexport default FieldArrayValidationError;\n","import type { DragEndEvent } from '@dnd-kit/core';\nimport type { ReactNode } from 'react';\nimport type { UseFieldArrayMove } from 'react-hook-form';\n\nimport { useFormContext } from 'react-hook-form';\n\nimport {\n closestCenter,\n DndContext,\n KeyboardSensor,\n PointerSensor,\n useSensor,\n useSensors,\n} from '@dnd-kit/core';\nimport {\n restrictToVerticalAxis,\n restrictToWindowEdges,\n} from '@dnd-kit/modifiers';\nimport {\n SortableContext,\n verticalListSortingStrategy,\n} from '@dnd-kit/sortable';\n\ninterface SortContextProps {\n /** child components */\n children: ReactNode;\n /** Array of objects containing unique IDs for sortable items */\n fields: Record<'id', string>[];\n /** name of the field array */\n name: string;\n /** react-hook-form's move function to update field array indices */\n move: UseFieldArrayMove;\n /** enable/disable sorting functionality */\n sortable: boolean;\n}\n\n/**\n * A wrapper component that provides drag-and-drop sorting functionality for field arrays\n * using dnd-kit and react-hook-form.\n *\n * This component integrates with react-hook-form's field arrays to enable vertical\n * drag-and-drop reordering of form fields. It supports both pointer (mouse/touch)\n * and keyboard interactions for accessibility.\n */\nconst SortContext = ({\n children,\n fields,\n move,\n name,\n sortable,\n}: SortContextProps): ReactNode => {\n const { trigger } = useFormContext();\n\n // Initialize sensors for both pointer (mouse/touch) and keyboard interactions\n const sensors = useSensors(\n useSensor(PointerSensor),\n useSensor(KeyboardSensor),\n );\n\n // Early return if sorting is disabled\n if (!sortable) {\n return children;\n }\n\n /**\n * Handles the end of a drag operation by updating field positions\n * @param event - The drag end event containing active and over elements\n */\n const handleDragEnd = (event: DragEndEvent) => {\n const { active, over } = event;\n\n // Only move if dropping over a different item\n if (active.id !== over?.id) {\n // Find the indices of the dragged item and drop target\n const oldIndex = fields.findIndex((field) => {\n return field.id === active.id;\n });\n const newIndex = fields.findIndex((field) => {\n return field.id === over?.id;\n });\n // Update the field array order using react-hook-form's move function\n move(oldIndex, newIndex);\n\n // Finally trigger validation for the array field,\n // so validation errors are updated for the new order\n trigger(name);\n }\n };\n\n return (\n <DndContext\n collisionDetection={closestCenter}\n modifiers={[restrictToVerticalAxis, restrictToWindowEdges]}\n onDragEnd={handleDragEnd}\n sensors={sensors}\n >\n <SortableContext\n items={fields.map((field) => {\n return field.id;\n })}\n strategy={verticalListSortingStrategy}\n >\n {children}\n </SortableContext>\n </DndContext>\n );\n};\n\nexport default SortContext;\n","import type { FieldArrayElementMethods } from './subcomponents/FieldArrayElement';\nimport type { FieldArrayProps } from './types';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { flatArrayKey } from '../helpers';\nimport { useUniformFieldArray } from '../hooks/useUniformFieldArray';\nimport ElementAppendButton from './subcomponents/ElementAppendButton';\nimport FieldArrayElement from './subcomponents/FieldArrayElement';\nimport FieldArrayLabel from './subcomponents/FieldArrayLabel';\nimport FieldArrayValidationError from './subcomponents/FieldArrayValidationError';\nimport SortContext from './subcomponents/SortContext';\n\nexport const fieldArrayVariants = tv({\n slots: {\n /** base class for the field array wrapper */\n base: [\n // base styles\n 'overflow-hidden rounded-small border border-divider bg-content1',\n // divider between items\n 'divide-y divide-divider',\n ],\n /** class for the actions menu button */\n actionsMenuButton: [\n // base styles\n 'flex items-center justify-center text-default-600',\n // fixed height/no round corners/center align\n 'h-full rounded-none',\n // focus styles - inset ring\n 'outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus',\n ],\n /** class for the append button */\n appendButton: [\n // base styles\n 'w-full justify-start rounded-b-small rounded-t-none font-semibold',\n // match label height (p-3 = 12px vertical padding + text-base line height)\n '!h-[48px] !min-h-0',\n // focus styles - inset ring with rounded bottom corners to match container\n 'outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus',\n ],\n /** class for the element fields grid */\n elementFieldsGrid: ['w-full grow p-3'],\n /** class for the label */\n label: [\n // override HeroUI label positioning and display\n 'pointer-events-auto! static! z-auto! block! w-full!',\n // reset any transforms or translations\n 'translate-x-0! translate-y-0! transform-none!',\n // card header styling - use text-medium (16px) instead of text-base for correct 48px height\n 'rounded-t-small p-3 font-semibold text-medium',\n ],\n /** class for the list */\n list: ['overflow-hidden'],\n /** class for the list wrapper */\n listWrapper: ['overflow-hidden'],\n /** class for the list item (performs motion animations) */\n listItem: [\n // base styles\n 'group relative flex flex-row',\n // overlap borders by shifting first item up 1px (similar to how last item overlaps with append button)\n 'first:-mt-px',\n ],\n /** class for the list item inner */\n listItemInner: [\n // base styles\n 'flex w-full flex-row items-stretch divide-divider bg-content1',\n // x division and borders\n 'divide-x divide-solid border-b border-t border-divider',\n ],\n /** class for the remove button */\n removeButton: [\n // base styles\n 'flex items-center justify-center',\n // fixed height/no round corners\n '!h-full !min-h-0 !rounded-none px-3',\n // focus styles - inset ring\n 'outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus',\n ],\n /** class for the sort drag handle */\n sortDragHandle: [\n // base styles\n 'flex cursor-grab items-center justify-center px-2 text-default-600 transition-colors',\n // hover and dragging state\n 'hover:bg-default-100 active:cursor-grabbing group-data-[dragging=true]:bg-default-100',\n // focus styles - inset ring\n 'outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus',\n ],\n },\n variants: {\n hasLabel: {\n false: {\n // focus styles - when there is no label, the first item actions menu button should have rounded top right corners\n actionsMenuButton:\n 'group-[:first-child]:!rounded-tr-small group-[:first-child]:group-data-[dragging=true]:!rounded-tr-none',\n // focus styles - when there is no label, the first item remove button focus ring should have rounded top right corners\n removeButton:\n 'group-[:first-child]:!rounded-tr-small group-[:first-child]:group-data-[dragging=true]:!rounded-tr-none',\n // focus styles - when there is no label, the first item sort drag handle focus ring should have rounded top left corners\n sortDragHandle:\n 'group-[:first-child]:rounded-tl-small group-[:first-child]:group-data-[dragging=true]:rounded-tl-none',\n },\n },\n },\n});\n\n/**\n * FieldArray component based in [RHF useFieldArray](https://react-hook-form.com/docs/usefieldarray)\n */\nconst FieldArray = ({\n appendButtonText = 'Add Element',\n children,\n className: _className = undefined,\n duplicate = false,\n elementInitialValue: _elementInitialValue = null,\n elementMarginBottom = undefined,\n flat = false,\n insertAfter = false,\n lastElementNotRemovable = false,\n name,\n sortable = false,\n ...uniformFieldProps\n}: FieldArrayProps) => {\n const {\n fields,\n append,\n remove,\n insert,\n move,\n disableAnimation,\n elementInitialValue,\n getValues,\n testId,\n } = useUniformFieldArray({\n name,\n flat,\n elementInitialValue: _elementInitialValue,\n lastElementNotRemovable,\n ...uniformFieldProps,\n });\n\n // className from slots\n const variants = fieldArrayVariants({ hasLabel: !!uniformFieldProps.label });\n const className = variantsToClassNames(variants, _className, 'base');\n\n return (\n <div className={className.base}>\n {/* field array label */}\n <FieldArrayLabel\n className={className.label}\n label={uniformFieldProps.label}\n name={name}\n />\n\n {fields.length ? (\n /* list wrapper */\n <div className={cn(className.listWrapper)}>\n {/* sortable context */}\n <SortContext\n fields={fields}\n move={move}\n name={name}\n sortable={sortable}\n >\n {/* list container */}\n <ul className={className.list} data-testid={testId}>\n {/* fields / list elements */}\n {fields.map((field, index) => {\n const elementName = flat\n ? `${name}.${index}.${flatArrayKey}`\n : `${name}.${index}`;\n const elementTestId = `${testId}_${index}`;\n\n // create methods for element\n const elementMethods: FieldArrayElementMethods = {\n append: () => {\n append(elementInitialValue);\n },\n duplicate: () => {\n const values = getValues(name);\n const currentValue = (values as unknown[])[index];\n const nextValue = flat\n ? { [flatArrayKey]: currentValue }\n : currentValue;\n insert(index + 1, nextValue);\n },\n insert: () => {\n insert(index + 1, elementInitialValue);\n },\n remove: () => {\n remove(index);\n },\n };\n\n return (\n <FieldArrayElement\n key={field.id}\n className={className}\n disableAnimation={disableAnimation}\n duplicate={duplicate}\n elementMarginBottom={elementMarginBottom}\n fields={fields}\n id={field.id}\n index={index}\n insertAfter={insertAfter}\n lastNotDeletable={lastElementNotRemovable}\n methods={elementMethods}\n sortable={sortable}\n testId={elementTestId}\n >\n {children({\n index,\n length: fields.length,\n methods: elementMethods,\n name: elementName,\n testId: elementTestId,\n })}\n </FieldArrayElement>\n );\n })}\n </ul>\n </SortContext>\n </div>\n ) : null}\n\n {/* top level field array errors */}\n <FieldArrayValidationError name={name} />\n\n {/* append elements button */}\n <ElementAppendButton\n appendButtonText={appendButtonText}\n className={className.appendButton}\n onClick={() => {\n append(elementInitialValue);\n }}\n testId={`${testId}_append_button`}\n />\n </div>\n );\n};\n\nexport default FieldArray;\n","import FieldArray from './FieldArray';\n\nexport type * from './types';\n\nexport { fieldArrayVariants } from './FieldArray';\n\nexport default FieldArray;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAM,uBAAuB,EAC3B,mBAAmB,eACnB,YAAY,KAAA,GACZ,SACA,SAAS,KAAA,QACqB;CAC9B,OACE,iBAAA,GAAA,kBAAA,KAAA,CAACA,kBAAAA,QAAD;EACE,YAAA,GAAA,uBAAA,GAAA,CAAc,SAAS;EACvB,kBAAA;EACS;EACT,MAAK;EACG;EACR,SAAQ;YANV,CAQE,iBAAA,GAAA,kBAAA,IAAA,CAACC,eAAAA,QAAD,CAAS,CAAA,GACT,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD,EAAA,UAAO,iBAAuB,CAAA,CACxB;;AAEZ;;;;;;ACRA,MAAM,sBAAsB,EAC1B,YAAY,KAAA,GACZ,YAAY,OACZ,cAAc,OACd,aAAa,MACb,SACA,SAAS,KAAA,QACoB;CAC7B,MAAM,gBAAgB,QAAa;EACjC,QAAQ,KAAR;GACE,KAAK;IACH,QAAQ,OAAO;IACf;GACF,KAAK;IACH,QAAQ,UAAU;IAClB;GACF,KAAK;IACH,QAAQ,OAAO;IACf;GACF,SACE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BAAA,GAAA,kBAAA,IAAA,CAAC,aAAD;KACU;KACF;KACA;KACI;eAGV,iBAAA,GAAA,kBAAA,IAAA,CAAC,MAAD;MAAI,WAAW,UAAU;MAAM,eAAa;gBAEzC,OAAO,KAAK,OAAO,UAAU;OAC5B,MAAM,cAAc,OAChB,GAAG,KAAK,GAAG,MAAM,GAAGC,sBAAAA,iBACpB,GAAG,KAAK,GAAG;OACf,MAAM,gBAAgB,GAAG,OAAO,GAAG;OAGnC,MAAM,iBAA2C;QAC/C,cAAc;SACZ,OAAO,mBAAmB;QAC5B;QACA,iBAAiB;SAEf,MAAM,eADS,UAAU,IACE,CAAC,CAAe;SAC3C,MAAM,YAAY,OACd,GAAGA,sBAAAA,eAAe,aAAa,IAC/B;SACJ,OAAO,QAAQ,GAAG,SAAS;QAC7B;QACA,cAAc;SACZ,OAAO,QAAQ,GAAG,mBAAmB;QACvC;QACA,cAAc;SACZ,OAAO,KAAK;QACd;OACF;OAEA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,mBAAD;QAEa;QACO;QACP;QACU;QACb;QACR,IAAI,MAAM;QACH;QACM;QACb,kBAAkB;QAClB,SAAS;QACC;QACV,QAAQ;kBAEP,SAAS;SACR;SACA,QAAQ,OAAO;SACf,SAAS;SACT,MAAM;SACN,QAAQ;QACV,CAAC;OACgB,GArBZ,MAAM,EAqBM;MAEvB,CAAC;KACC,CAAA;IACO,CAAA;GACV,CAAA,IACH;GAGJ,iBAAA,GAAA,kBAAA,IAAA,CAAC,2BAAD,EAAiC,KAAO,CAAA;GAGxC,iBAAA,GAAA,kBAAA,IAAA,CAAC,qBAAD;IACoB;IAClB,WAAW,UAAU;IACrB,eAAe;KACb,OAAO,mBAAmB;IAC5B;IACA,QAAQ,GAAG,OAAO;GACnB,CAAA;EACE;;AAET;;;ACxOA,IAAA,qBAAe"}
@@ -533,7 +533,7 @@ declare const FieldArray: ({
533
533
  name,
534
534
  sortable,
535
535
  ...uniformFieldProps
536
- }: FieldArrayProps) => import("react/jsx-runtime").JSX.Element;
536
+ }: FieldArrayProps) => import("react").JSX.Element;
537
537
  //#endregion
538
538
  export { type FieldArrayChildrenRenderFn, type FieldArrayFeatures, type FieldArrayProps, FieldArray as default, fieldArrayVariants };
539
539
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/FieldArray/subcomponents/FieldArrayElement.tsx","../../src/FieldArray/types.ts","../../src/FieldArray/FieldArray.tsx"],"mappings":";;;;UAiBiB,wBAAA;;EAEf,MAAA;EAFuC;EAIvC,SAAA;EAJuC;EAMvC,MAAA;EAFA;EAIA,MAAA;AAAA;;;KCpBG,YAAA,GAAe,OAAO,QAAQ,kBAAA;AAAA,KAC9B,SAAA,GAAY,WAAW,QAAQ,kBAAA;;KAGxB,0BAAA,IAA8B,IAAA;EDUxC,sDCRA,KAAA,UDYA;ECVA,MAAA,UDYM;ECVN,OAAA,EAAS,wBAAA;EAET,IAAA;EAEA,MAAA;AAAA,MACI,GAAA,CAAI,OAAO;AAAA,UAEA,kBAAA;EAjBG;EAmBlB,SAAA;EAlBG;EAoBH,WAAA;;EAEA,QAAA;AAAA;AAAA,UAGe,eAAA,SAAwB,kBAAA,EAAoB,YAAA;EAtBvB;EAwBpC,gBAAA;EAbe;EAef,QAAA,EAAU,0BAAA;EAtBV;EAwBA,SAAA,GAAY,SAAA;EAEZ,mBAAA;EAKA,mBAAA,GAAsB,aAAA;EAzBtB;EA2BA,IAAA;EA1BI;EA4BJ,KAAA,GAAQ,SAAA;EA5BO;EA8Bf,uBAAA;EA5Be;EA8Bf,IAAA;;EAEA,MAAA;AAAA;;;cCzCW,kBAAA,IAAkB,KAAA;;;gbFIU;;;;obAEvC;AAAA;;;;kbAMM;;;;sbCpBS;EAAA;;;;kbACH;;;;sbAAwC;EAAA;;;;kbAKpD;;;;sbAMA;EAAA;;;;kbAGe;;;;sbAEkB;EAAA;;;;kbAMzB;;;;sbAGuB;EAAA;;;;kbAAQ;;;;sbAAA;EAAA;;;;kbAMvC;;;;sbAOsB;EAAA;;;;kbAQtB;;;;;;;;;kbCmDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2bAuID;gcAAA;0bAAA;ubAlImB;4bAAA;2bAAA;6bAAA;IAAA;;;;ubAAA;mbAAA;obAAA;mbAajB;gcAAe;2bAAA;gcAbE;0bAAA;ubAAA;4bAAA;2bAAA;6bAAA;IAAA;EAAA;;;;;;kbAAA;;;;sbAAA;EAAA;;;;;;cAAd,UAAA;EAAc,gBAAA;EAAA,QAAA;EAAA,SAAA,EAAA,UAAA;EAAA,SAAA;EAAA,mBAAA,EAAA,oBAAA;EAAA,mBAAA;EAAA,IAAA;EAAA,WAAA;EAAA,uBAAA;EAAA,IAAA;EAAA,QAAA;EAAA,GAAA;AAAA,GAajB,eAAA,iCAAe,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/FieldArray/subcomponents/FieldArrayElement.tsx","../../src/FieldArray/types.ts","../../src/FieldArray/FieldArray.tsx"],"mappings":";;;;UAiBiB,wBAAA;;EAEf,MAAA;EAFuC;EAIvC,SAAA;EAJuC;EAMvC,MAAA;EAFA;EAIA,MAAA;AAAA;;;KCpBG,YAAA,GAAe,OAAO,QAAQ,kBAAA;AAAA,KAC9B,SAAA,GAAY,WAAW,QAAQ,kBAAA;;KA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A;0bAAA;ubAlImB;4bAAA;2bAAA;6bAAA;IAAA;;;;ubAAA;mbAAA;obAAA;mbAajB;gcAAe;2bAAA;gcAbE;0bAAA;ubAAA;4bAAA;2bAAA;6bAAA;IAAA;EAAA;;;;;;kbAAA;;;;sbAAA;EAAA;;;;;;cAAd,UAAA;EAAc,gBAAA;EAAA,QAAA;EAAA,SAAA,EAAA,UAAA;EAAA,SAAA;EAAA,mBAAA,EAAA,oBAAA;EAAA,mBAAA;EAAA,IAAA;EAAA,WAAA;EAAA,uBAAA;EAAA,IAAA;EAAA,QAAA;EAAA,GAAA;AAAA,GAajB,eAAA,qBAAe,GAAA,CAAA,OAAA"}
@@ -533,7 +533,7 @@ declare const FieldArray: ({
533
533
  name,
534
534
  sortable,
535
535
  ...uniformFieldProps
536
- }: FieldArrayProps) => import("react/jsx-runtime").JSX.Element;
536
+ }: FieldArrayProps) => import("react").JSX.Element;
537
537
  //#endregion
538
538
  export { type FieldArrayChildrenRenderFn, type FieldArrayFeatures, type FieldArrayProps, FieldArray as default, fieldArrayVariants };
539
539
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/FieldArray/subcomponents/FieldArrayElement.tsx","../../src/FieldArray/types.ts","../../src/FieldArray/FieldArray.tsx"],"mappings":";;;;UAiBiB,wBAAA;;EAEf,MAAA;EAFuC;EAIvC,SAAA;EAJuC;EAMvC,MAAA;EAFA;EAIA,MAAA;AAAA;;;KCpBG,YAAA,GAAe,OAAO,QAAQ,kBAAA;AAAA,KAC9B,SAAA,GAAY,WAAW,QAAQ,kBAAA;;KAGxB,0BAAA,IAA8B,IAAA;EDUxC,sDCRA,KAAA,UDYA;ECVA,MAAA,UDYM;ECVN,OAAA,EAAS,wBAAA;EAET,IAAA;EAEA,MAAA;AAAA,MACI,GAAA,CAAI,OAAO;AAAA,UAEA,kBAAA;EAjBG;EAmBlB,SAAA;EAlBG;EAoBH,WAAA;;EAEA,QAAA;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