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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/dist/Checkboxes/index.d.mts +47 -27
  2. package/dist/Checkboxes/index.d.mts.map +1 -1
  3. package/dist/Checkboxes/index.mjs +26 -25
  4. package/dist/Checkboxes/index.mjs.map +1 -1
  5. package/dist/DatePicker/index.d.mts +63 -86
  6. package/dist/DatePicker/index.d.mts.map +1 -1
  7. package/dist/DatePicker/index.mjs +43 -49
  8. package/dist/DatePicker/index.mjs.map +1 -1
  9. package/dist/FieldArray/index.d.mts +8 -16
  10. package/dist/FieldArray/index.d.mts.map +1 -1
  11. package/dist/FieldArray/index.mjs +25 -37
  12. package/dist/FieldArray/index.mjs.map +1 -1
  13. package/dist/FieldCard/index.d.mts +0 -4
  14. package/dist/FieldCard/index.d.mts.map +1 -1
  15. package/dist/FieldCard/index.mjs +14 -25
  16. package/dist/FieldCard/index.mjs.map +1 -1
  17. package/dist/{FieldCopyTestIdButton-DV0tkdh2.mjs → FieldCopyTestIdButton-D3_jZYJ1.mjs} +3 -5
  18. package/dist/{FieldCopyTestIdButton-DV0tkdh2.mjs.map → FieldCopyTestIdButton-D3_jZYJ1.mjs.map} +1 -1
  19. package/dist/FieldHelper-B1DWl7eu.mjs +38 -0
  20. package/dist/FieldHelper-B1DWl7eu.mjs.map +1 -0
  21. package/dist/FieldLabel-DMTqq0Jj.mjs +29 -0
  22. package/dist/FieldLabel-DMTqq0Jj.mjs.map +1 -0
  23. package/dist/{FieldLayout-BLW5S-Jm.mjs → FieldLayout-C9MEBZAC.mjs} +11 -19
  24. package/dist/FieldLayout-C9MEBZAC.mjs.map +1 -0
  25. package/dist/FieldReset/index.d.mts +420 -0
  26. package/dist/FieldReset/index.d.mts.map +1 -0
  27. package/dist/FieldReset/index.mjs +258 -0
  28. package/dist/FieldReset/index.mjs.map +1 -0
  29. package/dist/{FieldValidationError-DgkCL3cC.mjs → FieldValidationError-BuLvuRyi.mjs} +5 -7
  30. package/dist/FieldValidationError-BuLvuRyi.mjs.map +1 -0
  31. package/dist/Form/index.d.mts +12 -14
  32. package/dist/Form/index.d.mts.map +1 -1
  33. package/dist/Form/index.mjs +7 -10
  34. package/dist/Form/index.mjs.map +1 -1
  35. package/dist/FormContext-BnNJYZOo.d.mts +124 -0
  36. package/dist/FormContext-BnNJYZOo.d.mts.map +1 -0
  37. package/dist/{FormContext-CHctWFAP.mjs → FormContext-PXkVlBdU.mjs} +5 -9
  38. package/dist/{FormContext-CHctWFAP.mjs.map → FormContext-PXkVlBdU.mjs.map} +1 -1
  39. package/dist/Grid/index.d.mts +0 -2
  40. package/dist/Grid/index.d.mts.map +1 -1
  41. package/dist/Grid/index.mjs +1 -1
  42. package/dist/{Grid-DfcZeuib.mjs → Grid-DBL29Kwb.mjs} +3 -5
  43. package/dist/{Grid-DfcZeuib.mjs.map → Grid-DBL29Kwb.mjs.map} +1 -1
  44. package/dist/Input/index.d.mts +610 -393
  45. package/dist/Input/index.d.mts.map +1 -1
  46. package/dist/Input/index.mjs +24 -31
  47. package/dist/Input/index.mjs.map +1 -1
  48. package/dist/RadioBoxes/index.d.mts +247 -2227
  49. package/dist/RadioBoxes/index.d.mts.map +1 -1
  50. package/dist/RadioBoxes/index.mjs +25 -37
  51. package/dist/RadioBoxes/index.mjs.map +1 -1
  52. package/dist/RadioTabs/index.d.mts +599 -289
  53. package/dist/RadioTabs/index.d.mts.map +1 -1
  54. package/dist/RadioTabs/index.mjs +24 -27
  55. package/dist/RadioTabs/index.mjs.map +1 -1
  56. package/dist/Radios/index.d.mts +164 -2077
  57. package/dist/Radios/index.d.mts.map +1 -1
  58. package/dist/Radios/index.mjs +12 -23
  59. package/dist/Radios/index.mjs.map +1 -1
  60. package/dist/Select/index.d.mts +809 -484
  61. package/dist/Select/index.d.mts.map +1 -1
  62. package/dist/Select/index.mjs +69 -54
  63. package/dist/Select/index.mjs.map +1 -1
  64. package/dist/Slider/index.d.mts +657 -281
  65. package/dist/Slider/index.d.mts.map +1 -1
  66. package/dist/Slider/index.mjs +42 -42
  67. package/dist/Slider/index.mjs.map +1 -1
  68. package/dist/SubmitButton/index.d.mts +0 -2
  69. package/dist/SubmitButton/index.d.mts.map +1 -1
  70. package/dist/SubmitButton/index.mjs +2 -4
  71. package/dist/SubmitButton/index.mjs.map +1 -1
  72. package/dist/Switch/index.d.mts +1 -1
  73. package/dist/Switch/index.mjs +25 -32
  74. package/dist/Switch/index.mjs.map +1 -1
  75. package/dist/Switch-aBYStBoY.d.mts +990 -0
  76. package/dist/Switch-aBYStBoY.d.mts.map +1 -0
  77. package/dist/SwitchBox/index.d.mts +606 -201
  78. package/dist/SwitchBox/index.d.mts.map +1 -1
  79. package/dist/SwitchBox/index.mjs +29 -33
  80. package/dist/SwitchBox/index.mjs.map +1 -1
  81. package/dist/TextArea/index.d.mts +565 -185
  82. package/dist/TextArea/index.d.mts.map +1 -1
  83. package/dist/TextArea/index.mjs +18 -23
  84. package/dist/TextArea/index.mjs.map +1 -1
  85. package/dist/Time/index.d.mts +60 -44
  86. package/dist/Time/index.d.mts.map +1 -1
  87. package/dist/Time/index.mjs +27 -36
  88. package/dist/Time/index.mjs.map +1 -1
  89. package/dist/fieldHelperVariants-ClP8taiS.mjs +20 -0
  90. package/dist/fieldHelperVariants-ClP8taiS.mjs.map +1 -0
  91. package/dist/fieldLabelVariants-C4ZqECec.mjs +13 -0
  92. package/dist/fieldLabelVariants-C4ZqECec.mjs.map +1 -0
  93. package/dist/{FieldDescription-C4l0HKGL.mjs → fieldProps-DWfz2jSO.mjs} +5 -17
  94. package/dist/fieldProps-DWfz2jSO.mjs.map +1 -0
  95. package/dist/helpers/index.d.mts +0 -6
  96. package/dist/helpers/index.d.mts.map +1 -1
  97. package/dist/helpers/index.mjs +3 -6
  98. package/dist/helpers/index.mjs.map +1 -1
  99. package/dist/hooks/useClientValidation/index.d.mts +0 -2
  100. package/dist/hooks/useClientValidation/index.d.mts.map +1 -1
  101. package/dist/hooks/useClientValidation/index.mjs +3 -5
  102. package/dist/hooks/useController/index.d.mts +0 -2
  103. package/dist/hooks/useController/index.d.mts.map +1 -1
  104. package/dist/hooks/useController/index.mjs +2 -3
  105. package/dist/hooks/useFormContext/index.d.mts +31 -52
  106. package/dist/hooks/useFormContext/index.d.mts.map +1 -1
  107. package/dist/hooks/useFormContext/index.mjs +2 -3
  108. package/dist/hooks/useInputValueDebounce/index.d.mts +0 -2
  109. package/dist/hooks/useInputValueDebounce/index.d.mts.map +1 -1
  110. package/dist/hooks/useInputValueDebounce/index.mjs +3 -5
  111. package/dist/hooks/useInputValueTransform/index.d.mts +1 -1
  112. package/dist/hooks/useInputValueTransform/index.mjs +2 -3
  113. package/dist/hooks/useWatchFormReset/index.d.mts +0 -2
  114. package/dist/hooks/useWatchFormReset/index.d.mts.map +1 -1
  115. package/dist/hooks/useWatchFormReset/index.mjs +3 -5
  116. package/dist/hooks/useWatchUserChange/index.d.mts +0 -2
  117. package/dist/hooks/useWatchUserChange/index.d.mts.map +1 -1
  118. package/dist/hooks/useWatchUserChange/index.mjs +3 -5
  119. package/dist/{index-BS8IoBOn.d.mts → index-cevZBrIN.d.mts} +1 -3
  120. package/dist/index-cevZBrIN.d.mts.map +1 -0
  121. package/dist/partials/FieldCopyTestIdButton/index.d.mts +0 -2
  122. package/dist/partials/FieldCopyTestIdButton/index.d.mts.map +1 -1
  123. package/dist/partials/FieldCopyTestIdButton/index.mjs +1 -1
  124. package/dist/{Switch-CvPO8IF9.d.mts → partials/FieldHelper/index.d.mts} +309 -361
  125. package/dist/partials/FieldHelper/index.d.mts.map +1 -0
  126. package/dist/partials/FieldHelper/index.mjs +7 -0
  127. package/dist/partials/FieldHelper/index.mjs.map +1 -0
  128. package/dist/partials/FieldLabel/index.d.mts +160 -0
  129. package/dist/partials/FieldLabel/index.d.mts.map +1 -0
  130. package/dist/partials/FieldLabel/index.mjs +7 -0
  131. package/dist/partials/FieldLabel/index.mjs.map +1 -0
  132. package/dist/partials/FieldValidationError/index.d.mts +13 -15
  133. package/dist/partials/FieldValidationError/index.d.mts.map +1 -1
  134. package/dist/partials/FieldValidationError/index.mjs +1 -1
  135. package/dist/{radioControlVariants-Cm6WufWo.mjs → radioControlVariants-CbtG5U4_.mjs} +28 -25
  136. package/dist/radioControlVariants-CbtG5U4_.mjs.map +1 -0
  137. package/dist/{switchVariants-BaQw2DA7.mjs → switchVariants-0Xa7TQYg.mjs} +8 -11
  138. package/dist/switchVariants-0Xa7TQYg.mjs.map +1 -0
  139. package/dist/{timeVariants-B9HDfNYt.mjs → timeVariants-Bkt4iwXx.mjs} +14 -12
  140. package/dist/timeVariants-Bkt4iwXx.mjs.map +1 -0
  141. package/dist/{useController-BCFeZbBZ.mjs → useController-JtIeurpw.mjs} +3 -4
  142. package/dist/{useController-BCFeZbBZ.mjs.map → useController-JtIeurpw.mjs.map} +1 -1
  143. package/dist/{useFormContext-BPjJjNnM.mjs → useFormContext-piqnN2L-.mjs} +3 -4
  144. package/dist/useFormContext-piqnN2L-.mjs.map +1 -0
  145. package/dist/{useInputValueTransform-Mw8YEOXT.mjs → useInputValueTransform-CXWWFhy_.mjs} +2 -3
  146. package/dist/{useInputValueTransform-Mw8YEOXT.mjs.map → useInputValueTransform-CXWWFhy_.mjs.map} +1 -1
  147. package/dist/{FieldLabel-DKzqkuY1.mjs → useUniformField-TTNPTsVn.mjs} +15 -37
  148. package/dist/useUniformField-TTNPTsVn.mjs.map +1 -0
  149. package/package.json +10 -7
  150. package/dist/FieldDescription-C4l0HKGL.mjs.map +0 -1
  151. package/dist/FieldLabel-DKzqkuY1.mjs.map +0 -1
  152. package/dist/FieldLayout-BLW5S-Jm.mjs.map +0 -1
  153. package/dist/FieldValidationError-DgkCL3cC.mjs.map +0 -1
  154. package/dist/FormContext-CsFiNvuJ.d.mts +0 -19
  155. package/dist/FormContext-CsFiNvuJ.d.mts.map +0 -1
  156. package/dist/Switch-CvPO8IF9.d.mts.map +0 -1
  157. package/dist/index-BS8IoBOn.d.mts.map +0 -1
  158. package/dist/radioControlVariants-Cm6WufWo.mjs.map +0 -1
  159. package/dist/switchVariants-BaQw2DA7.mjs.map +0 -1
  160. package/dist/timeVariants-B9HDfNYt.mjs.map +0 -1
  161. package/dist/useFormContext-BPjJjNnM.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"switchVariants-0Xa7TQYg.mjs","names":[],"sources":["../src/Switch/switchVariants.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\n\nimport { tv } from '@fuf-stack/pixel-utils';\n\nimport { fieldHelperVariants } from '../partials/FieldHelper/fieldHelperVariants';\nimport { fieldLabelVariants } from '../partials/FieldLabel/fieldLabelVariants';\n\nexport const switchVariants = tv({\n extend: fieldHelperVariants,\n slots: {\n /** Container for the field control and supporting text */\n base: 'group relative inline-flex max-w-fit cursor-pointer touch-none select-none items-center justify-start tap-highlight-transparent',\n /** Content at the end of the control */\n endContent: [\n // end icon position and fade transition\n 'absolute end-1.5 z-0 text-default-600 opacity-100 transition-transform-opacity text-small',\n // move and hide the selected end icon\n 'group-data-[selected=true]:translate-x-3 group-data-[selected=true]:opacity-0',\n // reduced motion\n 'motion-reduce:transition-none',\n ],\n /** Visible field label */\n label: [\n fieldLabelVariants.base,\n // beside the control, without the spacing below a stacked label\n 'relative ms-2 cursor-pointer select-none pb-0',\n ],\n /** Container grouping the toggle and field messages */\n outerWrapper: 'place-content-center',\n /** Content at the start of the control */\n startContent: [\n // start icon position and fade transition\n 'absolute start-1.5 z-0 scale-50 text-current opacity-0 transition-transform-opacity text-small',\n // reveal the selected start icon\n 'group-data-[selected=true]:scale-100 group-data-[selected=true]:opacity-100',\n // reduced motion\n 'motion-reduce:transition-none',\n ],\n /** Movable indicator showing the current value */\n thumb: [\n // thumb layout and surface\n 'pointer-events-none z-10 flex h-5 w-5 origin-right items-center justify-center rounded-full bg-white shadow-small transition-all text-small',\n // selected position and pressed width\n 'group-data-[selected=true]:group-data-[pressed=true]:ms-4 group-data-[selected=true]:ms-5 group-data-[pressed=true]:w-6',\n // reduced motion\n 'motion-reduce:transition-none',\n ],\n /** Content inside the toggle thumb */\n thumbIcon: 'text-black',\n /** Container arranging the selectable content */\n wrapper: [\n // switch track layout and surface\n 'relative inline-flex h-7 w-12 shrink-0 items-center justify-start overflow-hidden rounded-full bg-default-200 px-1 transition-background',\n // selected track colors\n 'group-data-[selected=true]:bg-primary group-data-[selected=true]:text-primary-foreground',\n // keyboard focus ring\n 'group-data-[focus-visible=true]:ring-2 group-data-[focus-visible=true]:ring-focus group-data-[focus-visible=true]:ring-offset-2 group-data-[focus-visible=true]:ring-offset-background',\n // reduced motion\n 'motion-reduce:transition-none',\n ],\n },\n variants: {\n size: {\n lg: {\n endContent: 'text-medium',\n startContent: 'text-medium',\n thumb:\n 'h-6 w-6 text-medium group-data-[selected=true]:group-data-[pressed=true]:ms-5 group-data-[selected=true]:ms-6 group-data-[pressed=true]:w-7',\n wrapper: 'h-8 w-14',\n },\n md: {},\n sm: {\n endContent: 'text-tiny',\n startContent: 'text-tiny',\n thumb:\n 'h-4 w-4 text-tiny group-data-[selected=true]:group-data-[pressed=true]:ms-3 group-data-[selected=true]:ms-4 group-data-[pressed=true]:w-5',\n wrapper: 'h-6 w-10',\n },\n },\n disabled: { true: { base: 'pointer-events-none opacity-disabled' } },\n readOnly: {\n true: {\n // inner controls set their own cursors, override every descendant\n base: 'cursor-not-allowed opacity-disabled **:cursor-not-allowed',\n },\n },\n },\n});\n\nexport type VariantProps = TVProps<typeof switchVariants>;\n\nexport type ClassName = TVClassName<typeof switchVariants>;\n"],"mappings":";;;;AAOA,MAAa,iBAAiB,GAAG;CAC/B,QAAQ;CACR,OAAO;;EAEL,MAAM;;EAEN,YAAY;GAEV;GAEA;GAEA;EACF;;EAEA,OAAO,CACL,mBAAmB,MAEnB,+CACF;;EAEA,cAAc;;EAEd,cAAc;GAEZ;GAEA;GAEA;EACF;;EAEA,OAAO;GAEL;GAEA;GAEA;EACF;;EAEA,WAAW;;EAEX,SAAS;GAEP;GAEA;GAEA;GAEA;EACF;CACF;CACA,UAAU;EACR,MAAM;GACJ,IAAI;IACF,YAAY;IACZ,cAAc;IACd,OACE;IACF,SAAS;GACX;GACA,IAAI,CAAC;GACL,IAAI;IACF,YAAY;IACZ,cAAc;IACd,OACE;IACF,SAAS;GACX;EACF;EACA,UAAU,EAAE,MAAM,EAAE,MAAM,uCAAuC,EAAE;EACnE,UAAU,EACR,MAAM,EAEJ,MAAM,4DACR,EACF;CACF;AACF,CAAC"}
@@ -1,15 +1,17 @@
1
+ import { t as fieldHelperVariants } from "./fieldHelperVariants-ClP8taiS.mjs";
2
+ import { t as fieldLabelVariants } from "./fieldLabelVariants-C4ZqECec.mjs";
1
3
  import { tv } from "@fuf-stack/pixel-utils";
2
- //#region src/Time/timeVariants.ts
4
+ // src/Time/timeVariants.ts
3
5
  /** Shared segmented input defaults, also extended by DatePicker */
4
6
  const segmentedInputVariants = tv({ slots: {
5
- /** Field container with space for supporting text */
6
- base: "group flex w-full flex-col gap-y-1.5 pb-5",
7
- /** Field description text */
8
- description: "text-foreground-500 text-tiny",
9
- /** Validation message text */
10
- errorMessage: "text-danger text-tiny",
11
- /** Supporting text below the input surface */
12
- helperWrapper: ["absolute start-0 top-[calc(100%_+_2px)] flex flex-col gap-1.5", "p-0"],
7
+ /** Field container */
8
+ base: "group flex w-full flex-col",
9
+ /** Help text below the control */
10
+ description: fieldHelperVariants.slots.description,
11
+ /** Validation message container */
12
+ errorMessage: fieldHelperVariants.slots.errorMessage,
13
+ /** Container for help text and validation messages */
14
+ helperWrapper: fieldHelperVariants.slots.helperWrapper,
13
15
  /** Row containing segments and optional controls */
14
16
  innerWrapper: "flex h-6 w-full items-center gap-x-2 text-default-400",
15
17
  /** Editable date or time segment group */
@@ -24,7 +26,7 @@ const segmentedInputVariants = tv({ slots: {
24
26
  "bg-content1 focus-within:border-focus"
25
27
  ],
26
28
  /** Label above the segmented input */
27
- label: ["block w-full text-foreground subpixel-antialiased text-small", "cursor-default"],
29
+ label: [fieldLabelVariants.base, "block w-full"],
28
30
  /** Individual editable value or separator */
29
31
  segment: [
30
32
  "outline-solid focus:shadow-xs",
@@ -40,6 +42,7 @@ const timeVariants = tv({
40
42
  extend: segmentedInputVariants,
41
43
  variants: {
42
44
  disabled: { true: { base: "pointer-events-none opacity-disabled" } },
45
+ readOnly: { true: { base: "cursor-not-allowed opacity-disabled **:cursor-not-allowed" } },
43
46
  invalid: { true: {
44
47
  innerWrapper: "text-danger",
45
48
  inputWrapper: "border-danger focus-within:border-danger hover:border-danger focus-within:hover:border-danger",
@@ -52,7 +55,6 @@ const timeVariants = tv({
52
55
  } }
53
56
  }
54
57
  });
55
- //#endregion
56
58
  export { timeVariants as n, segmentedInputVariants as t };
57
59
 
58
- //# sourceMappingURL=timeVariants-B9HDfNYt.mjs.map
60
+ //# sourceMappingURL=timeVariants-Bkt4iwXx.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeVariants-Bkt4iwXx.mjs","names":[],"sources":["../src/Time/timeVariants.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\n\nimport { tv } from '@fuf-stack/pixel-utils';\n\nimport { fieldHelperVariants } from '../partials/FieldHelper/fieldHelperVariants';\nimport { fieldLabelVariants } from '../partials/FieldLabel/fieldLabelVariants';\n\n/** Shared segmented input defaults, also extended by DatePicker */\nexport const segmentedInputVariants = tv({\n // reference slots instead of extending, tv types follow only one extend level\n slots: {\n /** Field container */\n base: 'group flex w-full flex-col',\n /** Help text below the control */\n description: fieldHelperVariants.slots.description,\n /** Validation message container */\n errorMessage: fieldHelperVariants.slots.errorMessage,\n /** Container for help text and validation messages */\n helperWrapper: fieldHelperVariants.slots.helperWrapper,\n /** Row containing segments and optional controls */\n innerWrapper: 'flex h-6 w-full items-center gap-x-2 text-default-400',\n /** Editable date or time segment group */\n input: 'flex h-full w-full gap-x-0.5 font-normal text-small',\n /** Bordered surface around the editable segments */\n inputWrapper: [\n // segmented control frame and layout\n 'shadow-xs relative inline-flex h-10 min-h-10 w-full cursor-text flex-row items-center gap-3',\n // border and padding\n 'rounded-small border-2 border-default-200 px-3',\n // color transitions\n 'transition-colors duration-150',\n // hover and focus borders\n 'hover:border-default-400 focus-within:hover:border-default-foreground',\n // reduced motion\n 'motion-reduce:transition-none',\n // surface color and focused border\n 'bg-content1 focus-within:border-focus',\n ],\n /** Label above the segmented input */\n label: [fieldLabelVariants.base, 'block w-full'],\n /** Individual editable value or separator */\n segment: [\n // segment focus outline and shadow\n 'outline-solid focus:shadow-xs',\n // segment spacing and typography\n 'group my-auto box-content inline-block rounded-md px-0.5 text-start tabular-nums text-foreground-500 outline-transparent',\n // color transition\n 'transition-colors',\n // first segment alignment and focus background\n 'first:-ml-0.5 focus:bg-default-400/50',\n // editable values and empty placeholders\n 'data-[editable=true]:data-[placeholder=true]:text-foreground-500 data-[editable=true]:text-foreground data-[editable=true]:focus:text-default-foreground',\n // reduced motion\n 'motion-reduce:transition-none',\n // spacing between subsequent segments\n '[&:not(:first-child)]:-ml-1',\n ],\n },\n});\n\nexport const timeVariants = tv({\n extend: segmentedInputVariants,\n variants: {\n disabled: { true: { base: 'pointer-events-none opacity-disabled' } },\n readOnly: {\n true: {\n // inner controls set their own cursors, override every descendant\n base: 'cursor-not-allowed opacity-disabled **:cursor-not-allowed',\n },\n },\n invalid: {\n true: {\n innerWrapper: 'text-danger',\n inputWrapper:\n 'border-danger focus-within:border-danger hover:border-danger focus-within:hover:border-danger',\n label: 'text-danger',\n segment: [\n // invalid text and focus background\n 'text-danger-300 focus:bg-danger-400/50',\n // editable values and empty placeholders\n 'data-[editable=true]:data-[placeholder=true]:text-danger data-[editable=true]:text-danger data-[editable=true]:focus:text-danger',\n // dark theme focus background\n 'dark:focus:bg-danger-400/20',\n ],\n },\n },\n },\n});\n\nexport type VariantProps = TVProps<typeof timeVariants>;\n\nexport type ClassName = TVClassName<typeof timeVariants>;\n\n/** Resolved class names for the segmented time slots */\nexport type TimeClassNames = Record<\n keyof ReturnType<typeof timeVariants>,\n string\n>;\n"],"mappings":";;;;;AAQA,MAAa,yBAAyB,GAAG,EAEvC,OAAO;;CAEL,MAAM;;CAEN,aAAa,oBAAoB,MAAM;;CAEvC,cAAc,oBAAoB,MAAM;;CAExC,eAAe,oBAAoB,MAAM;;CAEzC,cAAc;;CAEd,OAAO;;CAEP,cAAc;EAEZ;EAEA;EAEA;EAEA;EAEA;EAEA;CACF;;CAEA,OAAO,CAAC,mBAAmB,MAAM,cAAc;;CAE/C,SAAS;EAEP;EAEA;EAEA;EAEA;EAEA;EAEA;EAEA;CACF;AACF,EACF,CAAC;AAED,MAAa,eAAe,GAAG;CAC7B,QAAQ;CACR,UAAU;EACR,UAAU,EAAE,MAAM,EAAE,MAAM,uCAAuC,EAAE;EACnE,UAAU,EACR,MAAM,EAEJ,MAAM,4DACR,EACF;EACA,SAAS,EACP,MAAM;GACJ,cAAc;GACd,cACE;GACF,OAAO;GACP,SAAS;IAEP;IAEA;IAEA;GACF;EACF,EACF;CACF;AACF,CAAC"}
@@ -1,8 +1,8 @@
1
- import { n as UniformContext } from "./FormContext-CHctWFAP.mjs";
1
+ import { n as UniformContext } from "./FormContext-PXkVlBdU.mjs";
2
2
  import { fromNullishString, toNullishString } from "./helpers/index.mjs";
3
3
  import { useContext } from "react";
4
4
  import { useController } from "react-hook-form";
5
- //#region src/hooks/useController/useController.ts
5
+ // src/hooks/useController/useController.ts
6
6
  /**
7
7
  * A wrapper around react-hook-form's useController that transparently handles nullish string conversions.
8
8
  *
@@ -39,7 +39,6 @@ const useController$1 = (props) => {
39
39
  fieldState
40
40
  };
41
41
  };
42
- //#endregion
43
42
  export { useController$1 as t };
44
43
 
45
- //# sourceMappingURL=useController-BCFeZbBZ.mjs.map
44
+ //# sourceMappingURL=useController-JtIeurpw.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useController-BCFeZbBZ.mjs","names":["useController","useRHFController"],"sources":["../src/hooks/useController/useController.ts"],"sourcesContent":["import type {\n ControllerFieldState,\n ControllerRenderProps,\n UseControllerProps as RHFUseControllerProps,\n UseFormStateReturn,\n} from 'react-hook-form';\n\nimport { useContext } from 'react';\nimport { useController as useRHFController } from 'react-hook-form';\n\nimport { UniformContext } from '../../Form/subcomponents/FormContext';\nimport { fromNullishString, toNullishString } from '../../helpers';\n\nexport type UseControllerProps<TFieldValues extends object = object> =\n RHFUseControllerProps<TFieldValues>;\n\nexport interface UseControllerReturn<TFieldValues extends object = object> {\n field: Omit<ControllerRenderProps<TFieldValues>, 'onChange' | 'value'> & {\n // Using any[] to support both direct value changes and React synthetic events\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onChange: (...event: any[]) => void;\n value: string;\n };\n fieldState: ControllerFieldState;\n formState: UseFormStateReturn<TFieldValues>;\n}\n\n/**\n * A wrapper around react-hook-form's useController that transparently handles nullish string conversions.\n *\n * Key features:\n * 1. Empty strings ('') in the UI are stored as null in form state\n * 2. Null/undefined values in form state are displayed as empty strings in the UI\n * 3. Handles both direct value changes and React synthetic events\n * 4. Maintains the same API as react-hook-form's useController\n * 5. Notifies UniformContext's userChange listeners on field changes (enables useWatchUserChange hook)\n * 6. No-op when value unchanged: onChange is ignored if the new value equals the current value\n * (prevents unnecessary re-renders and spurious useWatchUserChange triggers)\n *\n * This enables consistent handling of empty/null values while keeping a clean API\n * for form inputs that expect string values.\n *\n * @see https://react-hook-form.com/docs/usecontroller\n */\nexport const useController = <TFieldValues extends object = object>(\n props: UseControllerProps<TFieldValues>,\n): UseControllerReturn<TFieldValues> => {\n const { field, formState, fieldState } = useRHFController(props);\n const { userChange } = useContext(UniformContext);\n\n return {\n field: {\n ...field,\n // Handles both direct values (onChange(\"value\")) and events (onChange(event))\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onChange: (...event: any[]) => {\n const value = event[0]?.target?.value ?? event[0];\n const formattedValue = value === '' ? '' : toNullishString(value);\n\n // Skip if value hasn't changed (e.g., user re-selects same option)\n // We compare formattedValue (the new value after nullish conversion) with\n // field.value (the current stored value, also in nullish format)\n if (formattedValue === field.value) {\n return;\n }\n\n // Update form state first\n field.onChange(formattedValue);\n\n // Then notify userChange listeners (for useWatchUserChange hook)\n // This ensures getValues() in listeners returns the updated value\n // Guard against undefined userChange (when used outside FormProvider)\n // NOTE: We notify with the original value (not formattedValue) so that\n // listeners receive the actual value (false, 0, null) instead of marker\n // strings like '__FALSE__', '__ZERO__', '__NULL__'\n userChange?.notify(field.name, value);\n },\n // Convert null/undefined to empty string for UI display\n value: fromNullishString(field.value) as string,\n },\n formState,\n fieldState,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA4CA,MAAaA,mBACX,UACsC;CACtC,MAAM,EAAE,OAAO,WAAW,eAAeC,cAAiB,KAAK;CAC/D,MAAM,EAAE,eAAe,WAAW,cAAc;CAEhD,OAAO;EACL,OAAO;GACL,GAAG;GAGH,WAAW,GAAG,UAAiB;IAC7B,MAAM,QAAQ,MAAM,EAAE,EAAE,QAAQ,SAAS,MAAM;IAC/C,MAAM,iBAAiB,UAAU,KAAK,KAAK,gBAAgB,KAAK;IAKhE,IAAI,mBAAmB,MAAM,OAC3B;IAIF,MAAM,SAAS,cAAc;IAQ7B,YAAY,OAAO,MAAM,MAAM,KAAK;GACtC;GAEA,OAAO,kBAAkB,MAAM,KAAK;EACtC;EACA;EACA;CACF;AACF"}
1
+ {"version":3,"file":"useController-JtIeurpw.mjs","names":["useController","useRHFController"],"sources":["../src/hooks/useController/useController.ts"],"sourcesContent":["import type {\n ControllerFieldState,\n ControllerRenderProps,\n UseControllerProps as RHFUseControllerProps,\n UseFormStateReturn,\n} from 'react-hook-form';\n\nimport { useContext } from 'react';\nimport { useController as useRHFController } from 'react-hook-form';\n\nimport { UniformContext } from '../../Form/subcomponents/FormContext';\nimport { fromNullishString, toNullishString } from '../../helpers';\n\nexport type UseControllerProps<TFieldValues extends object = object> =\n RHFUseControllerProps<TFieldValues>;\n\nexport interface UseControllerReturn<TFieldValues extends object = object> {\n field: Omit<ControllerRenderProps<TFieldValues>, 'onChange' | 'value'> & {\n // Using any[] to support both direct value changes and React synthetic events\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onChange: (...event: any[]) => void;\n value: string;\n };\n fieldState: ControllerFieldState;\n formState: UseFormStateReturn<TFieldValues>;\n}\n\n/**\n * A wrapper around react-hook-form's useController that transparently handles nullish string conversions.\n *\n * Key features:\n * 1. Empty strings ('') in the UI are stored as null in form state\n * 2. Null/undefined values in form state are displayed as empty strings in the UI\n * 3. Handles both direct value changes and React synthetic events\n * 4. Maintains the same API as react-hook-form's useController\n * 5. Notifies UniformContext's userChange listeners on field changes (enables useWatchUserChange hook)\n * 6. No-op when value unchanged: onChange is ignored if the new value equals the current value\n * (prevents unnecessary re-renders and spurious useWatchUserChange triggers)\n *\n * This enables consistent handling of empty/null values while keeping a clean API\n * for form inputs that expect string values.\n *\n * @see https://react-hook-form.com/docs/usecontroller\n */\nexport const useController = <TFieldValues extends object = object>(\n props: UseControllerProps<TFieldValues>,\n): UseControllerReturn<TFieldValues> => {\n const { field, formState, fieldState } = useRHFController(props);\n const { userChange } = useContext(UniformContext);\n\n return {\n field: {\n ...field,\n // Handles both direct values (onChange(\"value\")) and events (onChange(event))\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onChange: (...event: any[]) => {\n const value = event[0]?.target?.value ?? event[0];\n const formattedValue = value === '' ? '' : toNullishString(value);\n\n // Skip if value hasn't changed (e.g., user re-selects same option)\n // We compare formattedValue (the new value after nullish conversion) with\n // field.value (the current stored value, also in nullish format)\n if (formattedValue === field.value) {\n return;\n }\n\n // Update form state first\n field.onChange(formattedValue);\n\n // Then notify userChange listeners (for useWatchUserChange hook)\n // This ensures getValues() in listeners returns the updated value\n // Guard against undefined userChange (when used outside FormProvider)\n // NOTE: We notify with the original value (not formattedValue) so that\n // listeners receive the actual value (false, 0, null) instead of marker\n // strings like '__FALSE__', '__ZERO__', '__NULL__'\n userChange?.notify(field.name, value);\n },\n // Convert null/undefined to empty string for UI display\n value: fromNullishString(field.value) as string,\n },\n formState,\n fieldState,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA4CA,MAAaA,mBACX,UACsC;CACtC,MAAM,EAAE,OAAO,WAAW,eAAeC,cAAiB,KAAK;CAC/D,MAAM,EAAE,eAAe,WAAW,cAAc;CAEhD,OAAO;EACL,OAAO;GACL,GAAG;GAGH,WAAW,GAAG,UAAiB;IAC7B,MAAM,QAAQ,MAAM,EAAE,EAAE,QAAQ,SAAS,MAAM;IAC/C,MAAM,iBAAiB,UAAU,KAAK,KAAK,gBAAgB,KAAK;IAKhE,IAAI,mBAAmB,MAAM,OAC3B;IAIF,MAAM,SAAS,cAAc;IAQ7B,YAAY,OAAO,MAAM,MAAM,KAAK;GACtC;GAEA,OAAO,kBAAkB,MAAM,KAAK;EACtC;EACA;EACA;CACF;AACF"}
@@ -1,8 +1,8 @@
1
- import { n as UniformContext } from "./FormContext-CHctWFAP.mjs";
1
+ import { n as UniformContext } from "./FormContext-PXkVlBdU.mjs";
2
2
  import { flatArrayKey, nameToTestId, toValidationFormat } from "./helpers/index.mjs";
3
3
  import { useContext } from "react";
4
4
  import { useFormContext } from "react-hook-form";
5
- //#region src/hooks/useFormContext/useFormContext.ts
5
+ // src/hooks/useFormContext/useFormContext.ts
6
6
  /** Schema check whether a field is required or optional */
7
7
  const checkFieldIsRequired = (validation, path) => {
8
8
  const checkPath = path[path.length - 1] === "__FLAT__" ? path.slice(0, -1) : path;
@@ -131,7 +131,6 @@ const useFormContext$1 = () => {
131
131
  watch
132
132
  };
133
133
  };
134
- //#endregion
135
134
  export { useFormContext$1 as n, checkFieldIsRequired as t };
136
135
 
137
- //# sourceMappingURL=useFormContext-BPjJjNnM.mjs.map
136
+ //# sourceMappingURL=useFormContext-piqnN2L-.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFormContext-piqnN2L-.mjs","names":["useFormContext","useHookFormContext"],"sources":["../src/hooks/useFormContext/useFormContext.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { VetoFormattedError, VetoInstance } from '@fuf-stack/veto';\nimport type { ContextType } from 'react';\nimport type {\n FieldError,\n FieldValues,\n Path,\n UseFormReturn,\n} from 'react-hook-form';\n\nimport { useContext } from 'react';\nimport { useFormContext as useHookFormContext } from 'react-hook-form';\n\nimport { UniformContext } from '../../Form/subcomponents/FormContext';\nimport { flatArrayKey, nameToTestId, toValidationFormat } from '../../helpers';\n\n/** Schema check whether a field is required or optional */\nexport const checkFieldIsRequired = (\n validation: VetoInstance,\n path: string[],\n): boolean => {\n // Handle flat array paths: strip the flatArrayKey to check the array element schema\n // e.g., ['arrayField', '0', '__FLAT__'] -> check schema at ['arrayField', '0']\n const checkPath =\n path[path.length - 1] === flatArrayKey ? path.slice(0, -1) : path;\n\n const checkRequired = (schema: any) => {\n // arrays ...\n if (schema.type === 'array') {\n // ... if array is optional or nullable it is not required\n if (schema.isOptional || schema.isNullable) {\n return false;\n }\n // ... otherwise arrays are required (display logic wise -> no asterisk in the label)\n return true;\n }\n\n // all other fields are required if they are\n // not optional and not nullable\n return !schema.isOptional && !schema.isNullable;\n };\n\n return validation.checkSchemaPath(checkRequired, checkPath);\n};\n\n/**\n * Resolve validation errors for a given field path.\n *\n * Traverses a nested `VetoFormattedError` structure using a dotted path\n * (for example: \"user.address.0.street\") and returns the matching\n * `FieldError[]` if present. If no error exists at the path, returns\n * `undefined`.\n *\n * @param errors - The formatted validation errors from Uniform's context\n * @param name - The dotted field path to resolve\n * @returns An array of `FieldError` entries for the field, or `undefined`\n */\nconst getValidationErrorsByName = (\n errors: VetoFormattedError,\n name: string,\n) => {\n // Traverse nested error structure; ignore flat array wrapper key\n const keys = name.split('.').filter((k) => {\n return k !== flatArrayKey;\n });\n let current: unknown = errors;\n keys.forEach((key) => {\n if (current && typeof current === 'object') {\n current = (current as Record<string, unknown>)[key];\n } else {\n current = undefined;\n }\n });\n return current as FieldError[] | undefined;\n};\n\n/** Field state returned by the enhanced `getFieldState` */\nexport interface UniformFieldState {\n /** Validation errors for the field from the Uniform validation schema */\n error: FieldError[] | undefined;\n /** Whether the field has validation errors */\n invalid: boolean;\n /** Whether the field value differs from its default value */\n isDirty: boolean;\n /** Whether the field has been touched */\n isTouched: boolean;\n /** Whether the field is currently being validated */\n isValidating: boolean;\n /** Whether the validation schema requires the field */\n required: boolean;\n /** Generated HTML data-testid for the field */\n testId: string;\n}\n\n/**\n * Return type of `useFormContext`.\n *\n * Declared explicitly so the published declarations only reference types that\n * react-hook-form exports from its package root.\n */\nexport type UseFormContextReturn<\n TFieldValues extends FieldValues = FieldValues,\n TContext = any,\n TTransformedValues = TFieldValues,\n> = Omit<\n UseFormReturn<TFieldValues, TContext, TTransformedValues>,\n 'getFieldState'\n> &\n ContextType<typeof UniformContext> & {\n getFieldState: (\n name: Path<TFieldValues>,\n testId?: string,\n ) => UniformFieldState;\n };\n\n/**\n * Custom hook that extends react-hook-form's useFormContext to add validation and state management.\n *\n * Key features:\n * - Enhanced `getFieldState` that includes validation schema-based \"required\" status and testId generation\n * - Automatic conversion of form values via `getValues`, `watch`, and `subscribe`:\n * - Unwraps flat array wrappers (`{ __FLAT__: value }` → `value`)\n * - Converts nullish string markers (`__NULL__` → `null`, `__FALSE__` → `false`, `__ZERO__` → `0`)\n * - Filters out empty/null values\n */\nexport const useFormContext = <\n TFieldValues extends FieldValues = FieldValues,\n TContext = any,\n TTransformedValues = TFieldValues,\n>(): UseFormContextReturn<TFieldValues, TContext, TTransformedValues> => {\n const {\n formState,\n // some methods that will be enhanced below\n getFieldState: getFieldStateOrig,\n getValues: getValuesOrig,\n watch: watchOrig,\n subscribe: subscribeOrig,\n reset: resetOrig,\n // the rest of the methods pass through unchanged\n ...otherMethods\n } = useHookFormContext<TFieldValues, TContext, TTransformedValues>();\n\n const uniformContext = useContext(UniformContext);\n\n /**\n * Wrap react-hook-form's `reset` so the uniform context is notified about\n * programmatic resets. Field components (e.g. FieldArray) use this signal to\n * normalize their state on reset instead of inferring it from field contents.\n */\n const notifyReset = uniformContext?.formReset?.notify;\n const reset = ((...args: Parameters<typeof resetOrig>) => {\n resetOrig(...args);\n notifyReset?.();\n }) as typeof resetOrig;\n\n /**\n * Updated getFieldState method which returns:\n * - Whether the field is required by checking the validation schema\n * - Existing field state information (errors, etc.)\n * - A testId generated from the field name (with flat array keys removed and slugified)\n *\n * @param name - The field path (string or array)\n * @param testId - Optional explicit testId. If provided, will be slugified. If not provided, generated from name.\n */\n const getFieldState = (\n name: Path<TFieldValues>,\n testId?: string,\n ): UniformFieldState => {\n const fieldPath =\n typeof name === 'string' ? name.replace(/\\[\\d+\\]/g, '').split('.') : name;\n\n // Use base validation instance for checking \"required\" status\n // Client validation often uses .nullish() which would incorrectly mark fields as optional\n const validationInstance =\n uniformContext?.validation.baseInstance ??\n uniformContext?.validation.instance;\n\n // Check if the field is required using the validation schema\n const required = validationInstance\n ? checkFieldIsRequired(validationInstance, fieldPath)\n : false;\n\n const error = getValidationErrorsByName(\n uniformContext?.validation.errors ?? {},\n name,\n );\n\n // Get everything but the error from the original field state\n const fieldState = getFieldStateOrig(name, formState);\n\n return {\n ...fieldState,\n error,\n invalid: !!error,\n required,\n testId: nameToTestId(testId ?? name),\n };\n };\n\n /**\n * Wrap form value accessor methods to automatically convert from internal storage format\n * to component-friendly format:\n *\n * - Unwrap flat array wrappers: `{ __FLAT__: value }` → `value`\n * - Convert nullish string markers: `__NULL__` → `null`, `__FALSE__` → `false`, `__ZERO__` → `0`\n * - Filter out empty/null values: fields with converted null/empty values are removed entirely\n *\n * This ensures components receive clean, predictable data without needing to handle\n * the internal nullish string conversion system or flat array wrapping manually.\n */\n const getValues = ((...args: any[]) => {\n const result = (getValuesOrig as any)(...args);\n return toValidationFormat(result);\n }) as typeof getValuesOrig;\n\n const watch = ((...args: any[]) => {\n const result = (watchOrig as any)(...args);\n return toValidationFormat(result);\n }) as typeof watchOrig;\n\n const subscribe = ((...args: any[]) => {\n // For subscribe, we need to wrap the callback to convert the values property\n const [options] = args;\n if (options?.callback) {\n const originalCallback = options.callback;\n const wrappedOptions = {\n ...options,\n callback: (subscribeFormState: any) => {\n // Convert the values property if it exists\n const convertedFormState = {\n ...subscribeFormState,\n ...(subscribeFormState.values && {\n values: toValidationFormat(subscribeFormState.values),\n }),\n };\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return originalCallback(convertedFormState);\n },\n };\n return subscribeOrig(wrappedOptions);\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return (subscribeOrig as any)(...args);\n }) as typeof subscribeOrig;\n\n return {\n ...otherMethods,\n ...uniformContext,\n formState,\n getFieldState,\n getValues,\n reset,\n subscribe,\n watch,\n };\n};\n"],"mappings":";;;;;;AAkBA,MAAa,wBACX,YACA,SACY;CAGZ,MAAM,YACJ,KAAK,KAAK,SAAS,OAAA,aAAsB,KAAK,MAAM,GAAG,EAAE,IAAI;CAE/D,MAAM,iBAAiB,WAAgB;EAErC,IAAI,OAAO,SAAS,SAAS;GAE3B,IAAI,OAAO,cAAc,OAAO,YAC9B,OAAO;GAGT,OAAO;EACT;EAIA,OAAO,CAAC,OAAO,cAAc,CAAC,OAAO;CACvC;CAEA,OAAO,WAAW,gBAAgB,eAAe,SAAS;AAC5D;;;;;;;;;;;;;AAcA,MAAM,6BACJ,QACA,SACG;CAEH,MAAM,OAAO,KAAK,MAAM,GAAG,CAAC,CAAC,QAAQ,MAAM;EACzC,OAAO,MAAM;CACf,CAAC;CACD,IAAI,UAAmB;CACvB,KAAK,SAAS,QAAQ;EACpB,IAAI,WAAW,OAAO,YAAY,UAChC,UAAW,QAAoC;OAE/C,UAAU,KAAA;CAEd,CAAC;CACD,OAAO;AACT;;;;;;;;;;;AAmDA,MAAaA,yBAI4D;CACvE,MAAM,EACJ,WAEA,eAAe,mBACf,WAAW,eACX,OAAO,WAC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AG;EACH,GAAG;EACH;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
@@ -1,5 +1,5 @@
1
1
  import { useCallback } from "react";
2
- //#region src/hooks/useInputValueTransform/useInputValueTransform.ts
2
+ // src/hooks/useInputValueTransform/useInputValueTransform.ts
3
3
  /**
4
4
  * Custom hook providing utility functions for value transformations between display and form values.
5
5
  *
@@ -104,7 +104,6 @@ const useInputValueTransform = ({ type, transform }) => {
104
104
  }, [type, transform])
105
105
  };
106
106
  };
107
- //#endregion
108
107
  export { useInputValueTransform as t };
109
108
 
110
- //# sourceMappingURL=useInputValueTransform-Mw8YEOXT.mjs.map
109
+ //# sourceMappingURL=useInputValueTransform-CXWWFhy_.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useInputValueTransform-Mw8YEOXT.mjs","names":[],"sources":["../src/hooks/useInputValueTransform/useInputValueTransform.ts"],"sourcesContent":["import { useCallback } from 'react';\n\nexport interface InputValueTransform<TDisplay = unknown> {\n /** Transforms the form value to display value (e.g., 1000 → \"$1,000\" or 'a' → ['a']) */\n toDisplayValue: (value: unknown) => TDisplay;\n /** Transforms the display value to form value (e.g., \"$1,000\" → 1000 or ['a'] → 'a') */\n toFormValue: (value: TDisplay) => unknown;\n}\n\nexport interface UseInputValueTransformOptions<TDisplay = unknown> {\n /** Value transformation functions */\n transform?: InputValueTransform<TDisplay>;\n /** Input type for special number handling */\n type?: 'text' | 'number' | 'password';\n}\n\nexport interface UseInputValueTransformReturn<TDisplay = unknown> {\n /** Converts any form value to display value */\n toDisplayValue: (formValue: unknown) => TDisplay;\n /** Converts any display value to form value */\n toFormValue: (displayValue: TDisplay) => unknown;\n}\n\n/**\n * Custom hook providing utility functions for value transformations between display and form values.\n *\n * This hook provides pure conversion functions without any state management. It's useful for:\n * - Currency formatting ($1,000 display vs 1000 stored)\n * - Number inputs with special handling\n * - Date formatting (MM/DD/YYYY display vs ISO date stored)\n * - Phone number formatting ((555) 123-4567 display vs 5551234567 stored)\n * - Array/Object transformations (single value ↔ array, nested structures)\n *\n * **Key Features:**\n * - Pure conversion functions (no state)\n * - Generic support for any data type (strings, numbers, arrays, objects)\n * - Special number input handling (empty string preservation)\n * - Bidirectional value transformations\n * - Memoized functions for performance\n *\n * @param options Configuration for value transformation\n * @returns Pure conversion utility functions\n *\n * @example\n * ```tsx\n * // Currency formatting\n * const currencyTransform = {\n * toDisplayValue: (val) => val ? `$${Number(val).toLocaleString()}` : '',\n * toFormValue: (val) => parseFloat(val.replace(/[$,]/g, '')) || 0\n * };\n *\n * const { toDisplayValue, toFormValue } = useInputValueTransform({\n * transform: currencyTransform\n * });\n *\n * const displayVal = toDisplayValue(1000); // \"$1,000\"\n * const formVal = toFormValue(\"$1,500\"); // 1500\n * ```\n *\n * @example\n * ```tsx\n * // Number input (no transforms needed)\n * const { toDisplayValue, toFormValue } = useInputValueTransform({\n * type: 'number'\n * });\n *\n * // Handles empty string → empty string (not NaN)\n * // Handles \"123\" → 123 (string to number conversion)\n * ```\n *\n * @example\n * ```tsx\n * // Array to single value (for single checkbox)\n * const singleValueTransform = {\n * toDisplayValue: (val: string[]) => val?.[0] || '',\n * toFormValue: (val: string) => val ? [val] : []\n * };\n *\n * const { toDisplayValue, toFormValue } = useInputValueTransform({\n * transform: singleValueTransform\n * });\n *\n * const displayVal = toDisplayValue(['option1']); // \"option1\"\n * const formVal = toFormValue(\"option2\"); // [\"option2\"]\n * ```\n *\n * @example\n * ```tsx\n * // Integration with debouncing\n * const MyInput = ({ field, transform }) => {\n * const transform = useInputValueTransform({ transform });\n *\n * const { onChange, onBlur, value } = useInputValueDebounce({\n * ...transform,\n * debounceDelay: 300,\n * name: 'fieldName',\n * onBlur: field.onBlur,\n * onChange: field.onChange,\n * value: field.value,\n * });\n *\n * return <input value={value} onChange={onChange} onBlur={onBlur} />;\n * };\n * ```\n */\nexport const useInputValueTransform = <TDisplay = unknown>({\n type,\n transform,\n}: UseInputValueTransformOptions<TDisplay>): UseInputValueTransformReturn<TDisplay> => {\n /**\n * Converts any form value to display value\n */\n const toDisplayValue = useCallback(\n (formValue: unknown): TDisplay => {\n if (transform?.toDisplayValue) {\n return transform.toDisplayValue(formValue);\n }\n\n // For number type, convert valid strings to numbers for display\n if (type === 'number') {\n if (formValue === '' || formValue === null || formValue === undefined) {\n return '' as TDisplay;\n }\n const numValue = Number(formValue);\n return (Number.isNaN(numValue) ? formValue : numValue) as TDisplay;\n }\n\n // Default: pass through (handles primitives, arrays, objects, etc.)\n return (formValue ?? '') as TDisplay;\n },\n [type, transform],\n );\n\n /**\n * Converts any display value to form value\n */\n const toFormValue = useCallback(\n (displayValue: TDisplay): unknown => {\n if (transform?.toFormValue) {\n return transform.toFormValue(displayValue);\n }\n\n // For number type, convert strings to numbers\n if (type === 'number') {\n if (displayValue === '') {\n return '';\n }\n const numValue = Number(displayValue);\n return Number.isNaN(numValue) ? displayValue : numValue;\n }\n\n // Default: pass through (handles primitives, arrays, objects, etc.)\n return displayValue;\n },\n [type, transform],\n );\n\n return {\n toDisplayValue,\n toFormValue,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyGA,MAAa,0BAA8C,EACzD,MACA,gBACqF;CAiDrF,OAAO;EACL,gBA9CqB,aACpB,cAAiC;GAChC,IAAI,WAAW,gBACb,OAAO,UAAU,eAAe,SAAS;GAI3C,IAAI,SAAS,UAAU;IACrB,IAAI,cAAc,MAAM,cAAc,QAAQ,cAAc,KAAA,GAC1D,OAAO;IAET,MAAM,WAAW,OAAO,SAAS;IACjC,OAAQ,OAAO,MAAM,QAAQ,IAAI,YAAY;GAC/C;GAGA,OAAQ,aAAa;EACvB,GACA,CAAC,MAAM,SAAS,CA4BH;EACb,aAvBkB,aACjB,iBAAoC;GACnC,IAAI,WAAW,aACb,OAAO,UAAU,YAAY,YAAY;GAI3C,IAAI,SAAS,UAAU;IACrB,IAAI,iBAAiB,IACnB,OAAO;IAET,MAAM,WAAW,OAAO,YAAY;IACpC,OAAO,OAAO,MAAM,QAAQ,IAAI,eAAe;GACjD;GAGA,OAAO;EACT,GACA,CAAC,MAAM,SAAS,CAKN;CACZ;AACF"}
1
+ {"version":3,"file":"useInputValueTransform-CXWWFhy_.mjs","names":[],"sources":["../src/hooks/useInputValueTransform/useInputValueTransform.ts"],"sourcesContent":["import { useCallback } from 'react';\n\nexport interface InputValueTransform<TDisplay = unknown> {\n /** Transforms the form value to display value (e.g., 1000 → \"$1,000\" or 'a' → ['a']) */\n toDisplayValue: (value: unknown) => TDisplay;\n /** Transforms the display value to form value (e.g., \"$1,000\" → 1000 or ['a'] → 'a') */\n toFormValue: (value: TDisplay) => unknown;\n}\n\nexport interface UseInputValueTransformOptions<TDisplay = unknown> {\n /** Value transformation functions */\n transform?: InputValueTransform<TDisplay>;\n /** Input type for special number handling */\n type?: 'text' | 'number' | 'password';\n}\n\nexport interface UseInputValueTransformReturn<TDisplay = unknown> {\n /** Converts any form value to display value */\n toDisplayValue: (formValue: unknown) => TDisplay;\n /** Converts any display value to form value */\n toFormValue: (displayValue: TDisplay) => unknown;\n}\n\n/**\n * Custom hook providing utility functions for value transformations between display and form values.\n *\n * This hook provides pure conversion functions without any state management. It's useful for:\n * - Currency formatting ($1,000 display vs 1000 stored)\n * - Number inputs with special handling\n * - Date formatting (MM/DD/YYYY display vs ISO date stored)\n * - Phone number formatting ((555) 123-4567 display vs 5551234567 stored)\n * - Array/Object transformations (single value ↔ array, nested structures)\n *\n * **Key Features:**\n * - Pure conversion functions (no state)\n * - Generic support for any data type (strings, numbers, arrays, objects)\n * - Special number input handling (empty string preservation)\n * - Bidirectional value transformations\n * - Memoized functions for performance\n *\n * @param options Configuration for value transformation\n * @returns Pure conversion utility functions\n *\n * @example\n * ```tsx\n * // Currency formatting\n * const currencyTransform = {\n * toDisplayValue: (val) => val ? `$${Number(val).toLocaleString()}` : '',\n * toFormValue: (val) => parseFloat(val.replace(/[$,]/g, '')) || 0\n * };\n *\n * const { toDisplayValue, toFormValue } = useInputValueTransform({\n * transform: currencyTransform\n * });\n *\n * const displayVal = toDisplayValue(1000); // \"$1,000\"\n * const formVal = toFormValue(\"$1,500\"); // 1500\n * ```\n *\n * @example\n * ```tsx\n * // Number input (no transforms needed)\n * const { toDisplayValue, toFormValue } = useInputValueTransform({\n * type: 'number'\n * });\n *\n * // Handles empty string → empty string (not NaN)\n * // Handles \"123\" → 123 (string to number conversion)\n * ```\n *\n * @example\n * ```tsx\n * // Array to single value (for single checkbox)\n * const singleValueTransform = {\n * toDisplayValue: (val: string[]) => val?.[0] || '',\n * toFormValue: (val: string) => val ? [val] : []\n * };\n *\n * const { toDisplayValue, toFormValue } = useInputValueTransform({\n * transform: singleValueTransform\n * });\n *\n * const displayVal = toDisplayValue(['option1']); // \"option1\"\n * const formVal = toFormValue(\"option2\"); // [\"option2\"]\n * ```\n *\n * @example\n * ```tsx\n * // Integration with debouncing\n * const MyInput = ({ field, transform }) => {\n * const transform = useInputValueTransform({ transform });\n *\n * const { onChange, onBlur, value } = useInputValueDebounce({\n * ...transform,\n * debounceDelay: 300,\n * name: 'fieldName',\n * onBlur: field.onBlur,\n * onChange: field.onChange,\n * value: field.value,\n * });\n *\n * return <input value={value} onChange={onChange} onBlur={onBlur} />;\n * };\n * ```\n */\nexport const useInputValueTransform = <TDisplay = unknown>({\n type,\n transform,\n}: UseInputValueTransformOptions<TDisplay>): UseInputValueTransformReturn<TDisplay> => {\n /**\n * Converts any form value to display value\n */\n const toDisplayValue = useCallback(\n (formValue: unknown): TDisplay => {\n if (transform?.toDisplayValue) {\n return transform.toDisplayValue(formValue);\n }\n\n // For number type, convert valid strings to numbers for display\n if (type === 'number') {\n if (formValue === '' || formValue === null || formValue === undefined) {\n return '' as TDisplay;\n }\n const numValue = Number(formValue);\n return (Number.isNaN(numValue) ? formValue : numValue) as TDisplay;\n }\n\n // Default: pass through (handles primitives, arrays, objects, etc.)\n return (formValue ?? '') as TDisplay;\n },\n [type, transform],\n );\n\n /**\n * Converts any display value to form value\n */\n const toFormValue = useCallback(\n (displayValue: TDisplay): unknown => {\n if (transform?.toFormValue) {\n return transform.toFormValue(displayValue);\n }\n\n // For number type, convert strings to numbers\n if (type === 'number') {\n if (displayValue === '') {\n return '';\n }\n const numValue = Number(displayValue);\n return Number.isNaN(numValue) ? displayValue : numValue;\n }\n\n // Default: pass through (handles primitives, arrays, objects, etc.)\n return displayValue;\n },\n [type, transform],\n );\n\n return {\n toDisplayValue,\n toFormValue,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyGA,MAAa,0BAA8C,EACzD,MACA,gBACqF;CAiDrF,OAAO;EACL,gBA9CqB,aACpB,cAAiC;GAChC,IAAI,WAAW,gBACb,OAAO,UAAU,eAAe,SAAS;GAI3C,IAAI,SAAS,UAAU;IACrB,IAAI,cAAc,MAAM,cAAc,QAAQ,cAAc,KAAA,GAC1D,OAAO;IAET,MAAM,WAAW,OAAO,SAAS;IACjC,OAAQ,OAAO,MAAM,QAAQ,IAAI,YAAY;GAC/C;GAGA,OAAQ,aAAa;EACvB,GACA,CAAC,MAAM,SAAS,CA4BH;EACb,aAvBkB,aACjB,iBAAoC;GACnC,IAAI,WAAW,aACb,OAAO,UAAU,YAAY,YAAY;GAI3C,IAAI,SAAS,UAAU;IACrB,IAAI,iBAAiB,IACnB,OAAO;IAET,MAAM,WAAW,OAAO,YAAY;IACpC,OAAO,OAAO,MAAM,QAAQ,IAAI,eAAe;GACjD;GAGA,OAAO;EACT,GACA,CAAC,MAAM,SAAS,CAKN;CACZ;AACF"}
@@ -1,14 +1,14 @@
1
- import { a as useSensitiveField } from "./FormContext-CHctWFAP.mjs";
1
+ import { a as useSensitiveField } from "./FormContext-PXkVlBdU.mjs";
2
2
  import { flattenFieldErrors, isValueEmpty } from "./helpers/index.mjs";
3
- import { t as FieldCopyTestIdButton_default } from "./FieldCopyTestIdButton-DV0tkdh2.mjs";
4
- import { t as FieldValidationError_default } from "./FieldValidationError-DgkCL3cC.mjs";
5
- import { t as useController } from "./useController-BCFeZbBZ.mjs";
6
- import { n as useFormContext } from "./useFormContext-BPjJjNnM.mjs";
7
- import { t as useInputValueTransform } from "./useInputValueTransform-Mw8YEOXT.mjs";
3
+ import { t as FieldCopyTestIdButton_default } from "./FieldCopyTestIdButton-D3_jZYJ1.mjs";
4
+ import { t as FieldValidationError_default } from "./FieldValidationError-BuLvuRyi.mjs";
5
+ import { t as useController } from "./useController-JtIeurpw.mjs";
6
+ import { n as useFormContext } from "./useFormContext-piqnN2L-.mjs";
7
+ import { t as useInputValueTransform } from "./useInputValueTransform-CXWWFhy_.mjs";
8
8
  import React from "react";
9
9
  import { useDebounce } from "@fuf-stack/pixels";
10
10
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
- //#region src/hooks/useUniformField/useUniformField.tsx
11
+ // src/hooks/useUniformField/useUniformField.tsx
12
12
  /**
13
13
  * Binds a form field's value, interactions, validation and label metadata
14
14
  *
@@ -23,9 +23,13 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
23
23
  * messages and label content, including the test ID action in debug mode
24
24
  * Stable IDs and accessible-name metadata support associations in controls
25
25
  * Form operations remain separate from the field bundle
26
+ *
27
+ * Only `disabled` reaches the form controller, so disabled values are omitted
28
+ * from validation and submission. Read-only fields stay registered, controls
29
+ * prevent changes while their value is still validated and submitted
26
30
  */
27
31
  const useUniformField = (params) => {
28
- const { name, ariaLabel: customAriaLabel, disabled = false, description, isArrayValue = false, testId: explicitTestId, label, placeholder, sensitive = false, type, transform } = params;
32
+ const { name, ariaLabel: customAriaLabel, disabled = false, description, isArrayValue = false, testId: explicitTestId, label, placeholder, readOnly = false, sensitive = false, type, transform } = params;
29
33
  useSensitiveField(name, type === "password" || sensitive);
30
34
  const associationId = React.useId();
31
35
  const ids = {
@@ -83,6 +87,7 @@ const useUniformField = (params) => {
83
87
  name: controllerField.name,
84
88
  onBlur,
85
89
  onChange: transformedOnChange,
90
+ readOnly,
86
91
  ref,
87
92
  required,
88
93
  testId,
@@ -93,33 +98,6 @@ const useUniformField = (params) => {
93
98
  resetField
94
99
  };
95
100
  };
96
- //#endregion
97
- //#region src/partials/FieldLabel/FieldLabel.tsx
98
- /**
99
- * Shared field label and required indicator
100
- *
101
- * Uses a native label by default, with span/div hosts for nested labels and
102
- * headings, or React Aria Label for fields that supply label context
103
- *
104
- * @see https://react-aria.adobe.com/TextField
105
- * @see https://react-aria.adobe.com/CheckboxGroup
106
- */
107
- const FieldLabel = ({ as: Component = "label", children, className = void 0, htmlFor = void 0, id = void 0, required = false, requiredClassName = "ml-0.5 text-danger", ...props }) => {
108
- if (!children) return null;
109
- return /* @__PURE__ */ jsxs(Component, {
110
- ...props,
111
- className,
112
- "data-slot": "label",
113
- htmlFor,
114
- id,
115
- children: [children, required ? /* @__PURE__ */ jsx("span", {
116
- "aria-hidden": true,
117
- className: requiredClassName,
118
- children: "*"
119
- }) : null]
120
- });
121
- };
122
- //#endregion
123
- export { useUniformField as n, FieldLabel as t };
101
+ export { useUniformField as t };
124
102
 
125
- //# sourceMappingURL=FieldLabel-DKzqkuY1.mjs.map
103
+ //# sourceMappingURL=useUniformField-TTNPTsVn.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useUniformField-TTNPTsVn.mjs","names":["FieldCopyTestIdButton","FieldValidationError"],"sources":["../src/hooks/useUniformField/useUniformField.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { FieldValues } from 'react-hook-form';\nimport type { UniformFieldState, UseUniformFieldParams } from './types';\n\nimport React from 'react';\n\nimport { useDebounce } from '@fuf-stack/pixels';\n\nimport { useSensitiveField } from '../../Form/subcomponents/SensitiveFields';\nimport { flattenFieldErrors, isValueEmpty } from '../../helpers';\nimport FieldCopyTestIdButton from '../../partials/FieldCopyTestIdButton';\nimport FieldValidationError from '../../partials/FieldValidationError';\nimport { useController } from '../useController/useController';\nimport { useFormContext } from '../useFormContext/useFormContext';\nimport { useInputValueTransform } from '../useInputValueTransform/useInputValueTransform';\n\n/**\n * Binds a form field's value, interactions, validation and label metadata\n *\n * Converts stored values for display and edited values back to form values\n * through `transform`, with automatic number conversion for numeric inputs\n *\n * Reveals validation errors after editing a nonempty value, blur or submission,\n * keeping pristine fields quiet. Debounces invalid-state changes to avoid\n * flickering during validation updates\n *\n * Returns a bound `field` with callbacks, a focus ref, rendered validation\n * messages and label content, including the test ID action in debug mode\n * Stable IDs and accessible-name metadata support associations in controls\n * Form operations remain separate from the field bundle\n *\n * Only `disabled` reaches the form controller, so disabled values are omitted\n * from validation and submission. Read-only fields stay registered, controls\n * prevent changes while their value is still validated and submitted\n */\nconst useUniformField = <\n TFieldValues extends FieldValues = FieldValues,\n TDisplay = unknown,\n>(\n params: UseUniformFieldParams<TFieldValues, TDisplay>,\n): UniformFieldState<TFieldValues, TDisplay> => {\n // field configuration\n const {\n name,\n ariaLabel: customAriaLabel,\n disabled = false,\n description,\n isArrayValue = false,\n testId: explicitTestId,\n label,\n placeholder,\n readOnly = false,\n sensitive = false,\n type,\n transform,\n } = params;\n\n // revealing a password never changes its diagnostic redaction\n useSensitiveField(name, type === 'password' || sensitive);\n\n // stable associations between the control, label and messages\n const associationId = React.useId();\n const ids = {\n control: `uniform-${associationId}`,\n label: `uniform-${associationId}-label`,\n description: `uniform-${associationId}-description`,\n error: `uniform-${associationId}-error`,\n };\n\n // form operations and submission state\n const {\n control,\n debugMode,\n formState: { submitCount },\n formReset,\n getFieldState,\n getValues,\n resetField,\n } = useFormContext<TFieldValues>();\n\n // validation and interaction state\n const {\n error: rawError,\n invalid: rawInvalid,\n isDirty,\n isTouched,\n required,\n testId,\n } = getFieldState(name, explicitTestId);\n\n // register the field and connect its value and callbacks\n const { field: controllerField } = useController<TFieldValues>({\n control,\n disabled,\n name,\n });\n\n const {\n onChange: fieldOnChange,\n value: fieldValue,\n disabled: isDisabled,\n onBlur,\n ref,\n } = controllerField;\n\n // convert between stored form values and displayed values\n const { toDisplayValue, toFormValue } = useInputValueTransform<TDisplay>({\n transform,\n type,\n });\n\n const transformedValue = toDisplayValue(fieldValue);\n const transformedOnChange = (eventOrValue: TDisplay | React.ChangeEvent) => {\n // accept native events as well as direct values\n const displayValue =\n (eventOrValue as React.ChangeEvent<HTMLInputElement>)?.target?.value ??\n eventOrValue;\n const formValue = toFormValue(displayValue as TDisplay);\n fieldOnChange(formValue);\n };\n\n const defaultValue = (getValues() as Record<string, unknown>)?.[\n name as string\n ];\n\n // show errors after editing a nonempty value, blur or submission\n const hasValue = !isValueEmpty(fieldValue);\n const showInvalid =\n rawInvalid && ((isDirty && hasValue) || isTouched || submitCount > 0);\n\n // allow validation messages to finish their exit animation\n const invalid = useDebounce(showInvalid, 200);\n\n // include the test ID action when debugging fields\n const showTestIdCopyButton = debugMode === 'debug-testids';\n const labelNode: ReactNode | null =\n !!label || showTestIdCopyButton ? (\n <>\n {label !== false ? label : null}\n {showTestIdCopyButton ? (\n <FieldCopyTestIdButton testId={testId} />\n ) : null}\n </>\n ) : null;\n\n // preserve nested errors for groups, flatten messages for rendering\n const error = isArrayValue ? flattenFieldErrors(rawError) : rawError;\n const normalizedError = flattenFieldErrors(rawError);\n const errorMessage = (\n <FieldValidationError error={normalizedError} testId={testId} />\n );\n\n // prefer a visible label, use placeholder text only when the field has no label\n const fallbackLabel = !label && placeholder?.trim() ? placeholder : name;\n const ariaLabel =\n customAriaLabel ??\n (label && typeof label === 'string' ? label : fallbackLabel);\n\n // collect the bound field without exposing controller internals\n const field = {\n ariaLabel,\n customAriaLabel,\n defaultValue,\n description,\n disabled: isDisabled,\n error,\n errorMessage,\n hasErrors: normalizedError.length > 0,\n hasLabel: !!label,\n ids,\n invalid,\n label: labelNode,\n name: controllerField.name,\n onBlur,\n onChange: transformedOnChange,\n readOnly,\n ref,\n required,\n testId,\n value: transformedValue,\n };\n\n return {\n control,\n debugMode,\n field,\n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IACtC,IACJ,EAAA,CAAA,IACA;CAGN,MAAM,QAAQ,eAAe,mBAAmB,QAAQ,IAAI;CAC5D,MAAM,kBAAkB,mBAAmB,QAAQ;CACnD,MAAM,eACJ,oBAACC,8BAAD;EAAsB,OAAO;EAAyB;CAAS,CAAA;CAIjE,MAAM,gBAAgB,CAAC,SAAS,aAAa,KAAK,IAAI,cAAc;CA6BpE,OAAO;EACL;EACA;EACA,OAAA;GAzBA,WALA,oBACC,SAAS,OAAO,UAAU,WAAW,QAAQ;GAK9C;GACA;GACA;GACA,UAAU;GACV;GACA;GACA,WAAW,gBAAgB,SAAS;GACpC,UAAU,CAAC,CAAC;GACZ;GACA;GACA,OAAO;GACP,MAAM,gBAAgB;GACtB;GACA,UAAU;GACV;GACA;GACA;GACA;GACA,OAAO;EAMH;EACJ;EACA;EACA;CACF;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fuf-stack/uniform",
3
- "version": "2.0.0-next.1",
3
+ "version": "2.0.0-next.4",
4
4
  "description": "fuf react form library",
5
5
  "author": "Fröhlich ∧ Frei",
6
6
  "homepage": "https://github.com/fuf-stack/pixels#readme",
@@ -12,6 +12,7 @@
12
12
  "./DatePicker": "./dist/DatePicker/index.mjs",
13
13
  "./FieldArray": "./dist/FieldArray/index.mjs",
14
14
  "./FieldCard": "./dist/FieldCard/index.mjs",
15
+ "./FieldReset": "./dist/FieldReset/index.mjs",
15
16
  "./Form": "./dist/Form/index.mjs",
16
17
  "./Grid": "./dist/Grid/index.mjs",
17
18
  "./helpers": "./dist/helpers/index.mjs",
@@ -24,6 +25,8 @@
24
25
  "./hooks/useWatchUserChange": "./dist/hooks/useWatchUserChange/index.mjs",
25
26
  "./Input": "./dist/Input/index.mjs",
26
27
  "./partials/FieldCopyTestIdButton": "./dist/partials/FieldCopyTestIdButton/index.mjs",
28
+ "./partials/FieldHelper": "./dist/partials/FieldHelper/index.mjs",
29
+ "./partials/FieldLabel": "./dist/partials/FieldLabel/index.mjs",
27
30
  "./partials/FieldValidationError": "./dist/partials/FieldValidationError/index.mjs",
28
31
  "./RadioBoxes": "./dist/RadioBoxes/index.mjs",
29
32
  "./Radios": "./dist/Radios/index.mjs",
@@ -68,13 +71,13 @@
68
71
  "@dnd-kit/utilities": "3.2.2",
69
72
  "@fuf-stack/pixel-motion": "2.0.0-next.1",
70
73
  "@fuf-stack/pixel-utils": "2.0.0-next.1",
71
- "@fuf-stack/pixels": "2.0.0-next.1",
72
- "@fuf-stack/veto": "2.0.0-next.1",
74
+ "@fuf-stack/pixels": "2.0.0-next.3",
75
+ "@fuf-stack/veto": "2.0.0-next.3",
73
76
  "@internationalized/date": "3.12.4",
74
77
  "debug": "4.4.3",
75
78
  "react-aria": "3.50.0",
76
79
  "react-aria-components": "1.19.0",
77
- "react-hook-form": "7.81.0",
80
+ "react-hook-form": "7.91.0",
78
81
  "react-icons": "5.7.0",
79
82
  "react-select": "5.10.2",
80
83
  "react-stately": "3.48.0",
@@ -84,8 +87,8 @@
84
87
  "@types/debug": "4.1.13",
85
88
  "@types/react": "19.3.0",
86
89
  "@types/react-dom": "19.3.0",
87
- "react": "19.3.0",
88
- "react-dom": "19.3.0"
90
+ "react": "19.3.1",
91
+ "react-dom": "19.3.1"
89
92
  },
90
- "gitHead": "ec69356cdafe4e2399405b7e5e1b970022bbbbc6"
93
+ "gitHead": "90f8a3935fb30fb27ffb6ef1174f0d371b233769"
91
94
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"FieldDescription-C4l0HKGL.mjs","names":[],"sources":["../src/helpers/fieldProps/fieldProps.ts","../src/partials/FieldDescription/FieldDescription.tsx"],"sourcesContent":["import type { UniformField } from '../../hooks/useUniformField/types';\nimport type { FieldControlProps } from '../../partials/types';\n\ninterface FieldDataState {\n /** Disables interaction with the field */\n disabled?: boolean;\n /** Marks visible validation failure */\n invalid?: boolean;\n /** Marks a required field */\n required?: boolean;\n}\n\n/** Shared styling attributes for field state, inactive flags are omitted */\nexport const getFieldDataAttributes = ({\n disabled,\n invalid,\n required,\n}: FieldDataState) => {\n return {\n 'data-disabled': disabled ? true : undefined,\n 'data-invalid': invalid ? true : undefined,\n 'data-required': required ? true : undefined,\n };\n};\n\n/** Field metadata needed to associate an editable control with its content */\ntype FieldControlState = Pick<\n UniformField,\n | 'ariaLabel'\n | 'customAriaLabel'\n | 'description'\n | 'hasErrors'\n | 'hasLabel'\n | 'ids'\n | 'invalid'\n | 'required'\n>;\n\n/** ID and ARIA associations for the editable control or selection group */\nexport const getFieldControlProps = ({\n ariaLabel,\n customAriaLabel,\n description,\n hasErrors,\n hasLabel,\n ids,\n invalid,\n required,\n}: FieldControlState): FieldControlProps => {\n return {\n id: ids.control,\n 'aria-label': customAriaLabel ?? (!hasLabel ? ariaLabel : undefined),\n 'aria-labelledby': !customAriaLabel && hasLabel ? ids.label : undefined,\n 'aria-describedby':\n [\n description ? ids.description : undefined,\n invalid && hasErrors ? ids.error : undefined,\n ]\n .filter(Boolean)\n .join(' ') || undefined,\n 'aria-invalid': invalid || undefined,\n 'aria-required': required || undefined,\n };\n};\n","import type { HTMLAttributes, ReactNode } from 'react';\n\ninterface FieldDescriptionProps extends HTMLAttributes<HTMLDivElement> {\n /** Help text */\n children: ReactNode;\n /** CSS class name */\n className?: string;\n}\n\n/** Help text associated with a field through its description ID */\nconst FieldDescription = ({ children, ...props }: FieldDescriptionProps) => {\n if (!children) {\n return null;\n }\n\n return (\n <div data-slot=\"description\" {...props}>\n {children}\n </div>\n );\n};\n\nexport default FieldDescription;\n"],"mappings":";;;AAaA,MAAa,0BAA0B,EACrC,UACA,SACA,eACoB;CACpB,OAAO;EACL,iBAAiB,WAAW,OAAO,KAAA;EACnC,gBAAgB,UAAU,OAAO,KAAA;EACjC,iBAAiB,WAAW,OAAO,KAAA;CACrC;AACF;;AAgBA,MAAa,wBAAwB,EACnC,WACA,iBACA,aACA,WACA,UACA,KACA,SACA,eAC0C;CAC1C,OAAO;EACL,IAAI,IAAI;EACR,cAAc,oBAAoB,CAAC,WAAW,YAAY,KAAA;EAC1D,mBAAmB,CAAC,mBAAmB,WAAW,IAAI,QAAQ,KAAA;EAC9D,oBACE,CACE,cAAc,IAAI,cAAc,KAAA,GAChC,WAAW,YAAY,IAAI,QAAQ,KAAA,CACrC,CAAC,CACE,OAAO,OAAO,CAAC,CACf,KAAK,GAAG,KAAK,KAAA;EAClB,gBAAgB,WAAW,KAAA;EAC3B,iBAAiB,YAAY,KAAA;CAC/B;AACF;;;;ACrDA,MAAM,oBAAoB,EAAE,UAAU,GAAG,YAAmC;CAC1E,IAAI,CAAC,UACH,OAAO;CAGT,OACE,oBAAC,OAAD;EAAK,aAAU;EAAc,GAAI;EAC9B;CACE,CAAA;AAET"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"FieldLabel-DKzqkuY1.mjs","names":["FieldCopyTestIdButton","FieldValidationError"],"sources":["../src/hooks/useUniformField/useUniformField.tsx","../src/partials/FieldLabel/FieldLabel.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { FieldValues } from 'react-hook-form';\nimport type { UniformFieldState, UseUniformFieldParams } from './types';\n\nimport React from 'react';\n\nimport { useDebounce } from '@fuf-stack/pixels';\n\nimport { useSensitiveField } from '../../Form/subcomponents/SensitiveFields';\nimport { flattenFieldErrors, isValueEmpty } from '../../helpers';\nimport FieldCopyTestIdButton from '../../partials/FieldCopyTestIdButton';\nimport FieldValidationError from '../../partials/FieldValidationError';\nimport { useController } from '../useController/useController';\nimport { useFormContext } from '../useFormContext/useFormContext';\nimport { useInputValueTransform } from '../useInputValueTransform/useInputValueTransform';\n\n/**\n * Binds a form field's value, interactions, validation and label metadata\n *\n * Converts stored values for display and edited values back to form values\n * through `transform`, with automatic number conversion for numeric inputs\n *\n * Reveals validation errors after editing a nonempty value, blur or submission,\n * keeping pristine fields quiet. Debounces invalid-state changes to avoid\n * flickering during validation updates\n *\n * Returns a bound `field` with callbacks, a focus ref, rendered validation\n * messages and label content, including the test ID action in debug mode\n * Stable IDs and accessible-name metadata support associations in controls\n * Form operations remain separate from the field bundle\n */\nconst useUniformField = <\n TFieldValues extends FieldValues = FieldValues,\n TDisplay = unknown,\n>(\n params: UseUniformFieldParams<TFieldValues, TDisplay>,\n): UniformFieldState<TFieldValues, TDisplay> => {\n // field configuration\n const {\n name,\n ariaLabel: customAriaLabel,\n disabled = false,\n description,\n isArrayValue = false,\n testId: explicitTestId,\n label,\n placeholder,\n sensitive = false,\n type,\n transform,\n } = params;\n\n // revealing a password never changes its diagnostic redaction\n useSensitiveField(name, type === 'password' || sensitive);\n\n // stable associations between the control, label and messages\n const associationId = React.useId();\n const ids = {\n control: `uniform-${associationId}`,\n label: `uniform-${associationId}-label`,\n description: `uniform-${associationId}-description`,\n error: `uniform-${associationId}-error`,\n };\n\n // form operations and submission state\n const {\n control,\n debugMode,\n formState: { submitCount },\n formReset,\n getFieldState,\n getValues,\n resetField,\n } = useFormContext<TFieldValues>();\n\n // validation and interaction state\n const {\n error: rawError,\n invalid: rawInvalid,\n isDirty,\n isTouched,\n required,\n testId,\n } = getFieldState(name, explicitTestId);\n\n // register the field and connect its value and callbacks\n const { field: controllerField } = useController<TFieldValues>({\n control,\n disabled,\n name,\n });\n\n const {\n onChange: fieldOnChange,\n value: fieldValue,\n disabled: isDisabled,\n onBlur,\n ref,\n } = controllerField;\n\n // convert between stored form values and displayed values\n const { toDisplayValue, toFormValue } = useInputValueTransform<TDisplay>({\n transform,\n type,\n });\n\n const transformedValue = toDisplayValue(fieldValue);\n const transformedOnChange = (eventOrValue: TDisplay | React.ChangeEvent) => {\n // accept native events as well as direct values\n const displayValue =\n (eventOrValue as React.ChangeEvent<HTMLInputElement>)?.target?.value ??\n eventOrValue;\n const formValue = toFormValue(displayValue as TDisplay);\n fieldOnChange(formValue);\n };\n\n const defaultValue = (getValues() as Record<string, unknown>)?.[\n name as string\n ];\n\n // show errors after editing a nonempty value, blur or submission\n const hasValue = !isValueEmpty(fieldValue);\n const showInvalid =\n rawInvalid && ((isDirty && hasValue) || isTouched || submitCount > 0);\n\n // allow validation messages to finish their exit animation\n const invalid = useDebounce(showInvalid, 200);\n\n // include the test ID action when debugging fields\n const showTestIdCopyButton = debugMode === 'debug-testids';\n const labelNode: ReactNode | null =\n !!label || showTestIdCopyButton ? (\n <>\n {label !== false ? label : null}\n {showTestIdCopyButton ? (\n <FieldCopyTestIdButton testId={testId} />\n ) : null}\n </>\n ) : null;\n\n // preserve nested errors for groups, flatten messages for rendering\n const error = isArrayValue ? flattenFieldErrors(rawError) : rawError;\n const normalizedError = flattenFieldErrors(rawError);\n const errorMessage = (\n <FieldValidationError error={normalizedError} testId={testId} />\n );\n\n // prefer a visible label, use placeholder text only when the field has no label\n const fallbackLabel = !label && placeholder?.trim() ? placeholder : name;\n const ariaLabel =\n customAriaLabel ??\n (label && typeof label === 'string' ? label : fallbackLabel);\n\n // collect the bound field without exposing controller internals\n const field = {\n ariaLabel,\n customAriaLabel,\n defaultValue,\n description,\n disabled: isDisabled,\n error,\n errorMessage,\n hasErrors: normalizedError.length > 0,\n hasLabel: !!label,\n ids,\n invalid,\n label: labelNode,\n name: controllerField.name,\n onBlur,\n onChange: transformedOnChange,\n ref,\n required,\n testId,\n value: transformedValue,\n };\n\n return {\n control,\n debugMode,\n field,\n formReset,\n getValues,\n resetField,\n };\n};\n\nexport default useUniformField;\n","import type { HTMLAttributes, ReactNode } from 'react';\nimport type { Label as AriaLabel } from 'react-aria-components';\n\ninterface FieldLabelProps extends Pick<\n HTMLAttributes<HTMLElement>,\n 'aria-level' | 'role'\n> {\n /** Label element, React Aria Label preserves the surrounding field context */\n as?: 'label' | 'div' | 'span' | typeof AriaLabel;\n /** Label content */\n children: ReactNode;\n /** CSS class name */\n className?: string;\n /** ID of the labeled control */\n htmlFor?: string;\n /** Label ID */\n id?: string;\n /** Shows the required indicator */\n required?: boolean;\n /** Required indicator CSS class name */\n requiredClassName?: string;\n}\n\n/**\n * Shared field label and required indicator\n *\n * Uses a native label by default, with span/div hosts for nested labels and\n * headings, or React Aria Label for fields that supply label context\n *\n * @see https://react-aria.adobe.com/TextField\n * @see https://react-aria.adobe.com/CheckboxGroup\n */\nconst FieldLabel = ({\n as: Component = 'label',\n children,\n className = undefined,\n htmlFor = undefined,\n id = undefined,\n required = false,\n requiredClassName = 'ml-0.5 text-danger',\n ...props\n}: FieldLabelProps) => {\n if (!children) {\n return null;\n }\n\n return (\n <Component\n {...props}\n className={className}\n data-slot=\"label\"\n htmlFor={htmlFor}\n id={id}\n >\n {children}\n {required ? (\n <span aria-hidden className={requiredClassName}>\n *\n </span>\n ) : null}\n </Component>\n );\n};\n\nexport default FieldLabel;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAM,mBAIJ,WAC8C;CAE9C,MAAM,EACJ,MACA,WAAW,iBACX,WAAW,OACX,aACA,eAAe,OACf,QAAQ,gBACR,OACA,aACA,YAAY,OACZ,MACA,cACE;CAGJ,kBAAkB,MAAM,SAAS,cAAc,SAAS;CAGxD,MAAM,gBAAgB,MAAM,MAAM;CAClC,MAAM,MAAM;EACV,SAAS,WAAW;EACpB,OAAO,WAAW,cAAc;EAChC,aAAa,WAAW,cAAc;EACtC,OAAO,WAAW,cAAc;CAClC;CAGA,MAAM,EACJ,SACA,WACA,WAAW,EAAE,eACb,WACA,eACA,WACA,eACE,eAA6B;CAGjC,MAAM,EACJ,OAAO,UACP,SAAS,YACT,SACA,WACA,UACA,WACE,cAAc,MAAM,cAAc;CAGtC,MAAM,EAAE,OAAO,oBAAoB,cAA4B;EAC7D;EACA;EACA;CACF,CAAC;CAED,MAAM,EACJ,UAAU,eACV,OAAO,YACP,UAAU,YACV,QACA,QACE;CAGJ,MAAM,EAAE,gBAAgB,gBAAgB,uBAAiC;EACvE;EACA;CACF,CAAC;CAED,MAAM,mBAAmB,eAAe,UAAU;CAClD,MAAM,uBAAuB,iBAA+C;EAE1E,MAAM,eACH,cAAsD,QAAQ,SAC/D;EACF,MAAM,YAAY,YAAY,YAAwB;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version":3,"file":"FieldLayout-BLW5S-Jm.mjs","names":[],"sources":["../src/partials/FieldLayout/FieldLayout.tsx"],"sourcesContent":["import type {\n ComponentProps,\n ComponentPropsWithRef,\n ElementType,\n ReactNode,\n} from 'react';\nimport type { FieldIds } from '../types';\n\nimport FieldDescription from '../FieldDescription/FieldDescription';\nimport FieldLabel from '../FieldLabel/FieldLabel';\n\ntype ClassName = Partial<\n Record<\n 'base' | 'description' | 'errorMessage' | 'helperWrapper' | 'label',\n string\n >\n>;\n\ntype BaseProps<TBase extends ElementType> = Omit<\n ComponentPropsWithRef<TBase>,\n 'children' | 'className' | 'dangerouslySetInnerHTML'\n> &\n Record<`data-${string}`, string | number | boolean | undefined>;\n\n// require the configuration when the base has props the layout cannot supply\ntype BaseConfiguration<TBase extends ElementType> =\n Record<never, never> extends BaseProps<TBase>\n ? { baseProps?: BaseProps<TBase> }\n : { baseProps: BaseProps<TBase> };\n\ninterface FieldLayoutProps<TBase extends ElementType> {\n /** Component or element used for the base slot */\n baseAs?: TBase;\n /** Attributes, interactions and ref for the base element */\n baseProps?: BaseProps<NoInfer<TBase>>;\n /** Editable field content */\n children: ReactNode;\n /** CSS class name */\n className: ClassName;\n /** Help text */\n description?: ReactNode;\n /** Rendered validation messages */\n errorMessage: ReactNode;\n /** IDs shared with the editable control */\n ids: FieldIds;\n /** Shows the validation message */\n invalid: boolean;\n /** Field label */\n label?: ReactNode;\n /** Label element, use React Aria Label inside group engines */\n labelAs?: ComponentProps<typeof FieldLabel>['as'];\n /** Shows the required indicator */\n required?: boolean;\n}\n\n/**\n * Default arrangement of a field label, editable content and supporting messages\n *\n * Renders the base component around the label, content and messages\n * Receives IDs, resolved classes and validation state\n */\nconst FieldLayout = <TBase extends ElementType = 'div'>({\n baseAs = undefined,\n baseProps = undefined,\n children,\n className,\n description = undefined,\n errorMessage,\n ids,\n invalid,\n label = undefined,\n labelAs = 'label',\n required = false,\n}: FieldLayoutProps<TBase> & BaseConfiguration<NoInfer<TBase>>) => {\n const Base = baseAs ?? 'div';\n\n return (\n <Base {...baseProps} className={className.base} data-slot=\"base\">\n {/* field label */}\n <FieldLabel\n as={labelAs}\n className={className.label}\n htmlFor={labelAs === 'label' ? ids.control : undefined}\n id={ids.label}\n required={required}\n >\n {label}\n </FieldLabel>\n\n {/* editable content */}\n {children}\n\n {/* help text and validation messages */}\n {description || invalid ? (\n <div className={className.helperWrapper} data-slot=\"helper-wrapper\">\n <FieldDescription\n className={className.description}\n id={ids.description}\n >\n {description}\n </FieldDescription>\n {invalid ? (\n <div\n className={className.errorMessage}\n data-slot=\"error-message\"\n id={ids.error}\n >\n {errorMessage}\n </div>\n ) : null}\n </div>\n ) : null}\n </Base>\n );\n};\n\nexport default FieldLayout;\n"],"mappings":";;;;;;;;;;AA6DA,MAAM,eAAkD,EACtD,SAAS,KAAA,GACT,YAAY,KAAA,GACZ,UACA,WACA,cAAc,KAAA,GACd,cACA,KACA,SACA,QAAQ,KAAA,GACR,UAAU,SACV,WAAW,YACsD;CAGjE,OACE,qBAHW,UAAU,OAGrB;EAAM,GAAI;EAAW,WAAW,UAAU;EAAM,aAAU;EAA1D,UAAA;GAEE,oBAAC,YAAD;IACE,IAAI;IACJ,WAAW,UAAU;IACrB,SAAS,YAAY,UAAU,IAAI,UAAU,KAAA;IAC7C,IAAI,IAAI;IACE;IAET,UAAA;GACS,CAAA;GAGX;GAGA,eAAe,UACd,qBAAC,OAAD;IAAK,WAAW,UAAU;IAAe,aAAU;IAAnD,UAAA,CACE,oBAAC,kBAAD;KACE,WAAW,UAAU;KACrB,IAAI,IAAI;KAEP,UAAA;IACe,CAAA,GACjB,UACC,oBAAC,OAAD;KACE,WAAW,UAAU;KACrB,aAAU;KACV,IAAI,IAAI;KAEP,UAAA;IACE,CAAA,IACH,IACD;GACH,CAAA,IAAA;EACA;;AAEV"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"FieldValidationError-DgkCL3cC.mjs","names":[],"sources":["../src/partials/FieldValidationError/FieldValidationError.tsx","../src/partials/FieldValidationError/index.ts"],"sourcesContent":["import type { TVClassName } from '@fuf-stack/pixel-utils';\nimport type { FieldError } from 'react-hook-form';\n\nimport {\n AnimatePresence,\n motion,\n useReducedMotion,\n} from '@fuf-stack/pixel-motion';\nimport { slugify, tv } from '@fuf-stack/pixel-utils';\nimport { useStyling } from '@fuf-stack/pixels/StylingProvider';\n\nconst fieldValidationErrorVariants = tv({\n slots: {\n /** List of validation messages */\n base: '',\n /** Animated entry for one validation message */\n item: '',\n /** Padded content inside an animated entry */\n message: 'px-1 pt-1',\n /** Associated error container rendered when an ID is supplied */\n wrapper: '',\n },\n});\n\ntype ClassName = TVClassName<typeof fieldValidationErrorVariants>;\n\nexport interface FieldValidationErrorProps {\n /** CSS class name */\n className?: ClassName;\n /** Field errors */\n error?: FieldError[];\n /** Error association ID, adds a wrapper referenced by the editable control */\n id?: string;\n /** HTML data-testid attribute used in e2e tests */\n testId: string;\n}\n\n/**\n * Animated validation messages for a form field\n *\n * The owning field controls visibility. Supplying an ID adds an associated\n * error wrapper, otherwise the component renders the standalone list\n */\nconst FieldValidationError = ({\n className = undefined,\n error = undefined,\n id = undefined,\n testId,\n}: FieldValidationErrorProps) => {\n const styling = useStyling();\n // disable all animation if user prefers reduced motion\n const disableAnimation = useReducedMotion();\n\n // classNames from slots\n const variants = styling.resolve(fieldValidationErrorVariants);\n const classNames = styling.variantsToClassNames(variants, className, 'base');\n\n const errorList = (\n <ul\n aria-label={`Validation errors of field ${testId}`}\n className={classNames.base}\n data-component={id === undefined ? 'field-validation-error' : undefined}\n data-testid={slugify(`${testId}_error`)}\n >\n <AnimatePresence initial={!disableAnimation}>\n {error?.map(({ message }, i) => {\n return (\n <motion.li\n key={slugify(`${testId}_error_${i}`)}\n animate={\n disableAnimation ? undefined : { opacity: 1, height: 'auto' }\n }\n className={classNames.item}\n exit={disableAnimation ? undefined : { opacity: 0, height: 0 }}\n initial={disableAnimation ? false : { height: 0, opacity: 0 }}\n style={{ overflow: 'hidden' }}\n transition={{ duration: 0.2, ease: 'circOut' }}\n >\n {/* wrap in div to apply padding and animation does not jump */}\n <div className={classNames.message}>{message}</div>\n </motion.li>\n );\n })}\n </AnimatePresence>\n </ul>\n );\n\n if (id === undefined) {\n return errorList;\n }\n\n return (\n <div\n className={classNames.wrapper}\n data-component=\"field-validation-error\"\n data-slot=\"error-message\"\n id={id}\n >\n {errorList}\n </div>\n );\n};\n\nexport default FieldValidationError;\n","import FieldValidationError from './FieldValidationError';\n\nexport type { FieldValidationErrorProps } from './FieldValidationError';\n\nexport default FieldValidationError;\n"],"mappings":";;;;;AAWA,MAAM,+BAA+B,GAAG,EACtC,OAAO;;CAEL,MAAM;;CAEN,MAAM;;CAEN,SAAS;;CAET,SAAS;AACX,EACF,CAAC;;;;;;;AAqBD,MAAM,wBAAwB,EAC5B,YAAY,KAAA,GACZ,QAAQ,KAAA,GACR,KAAK,KAAA,GACL,aAC+B;CAC/B,MAAM,UAAU,WAAW;CAE3B,MAAM,mBAAmB,iBAAiB;CAG1C,MAAM,WAAW,QAAQ,QAAQ,4BAA4B;CAC7D,MAAM,aAAa,QAAQ,qBAAqB,UAAU,WAAW,MAAM;CAE3E,MAAM,YACJ,oBAAC,MAAD;EACE,cAAY,8BAA8B;EAC1C,WAAW,WAAW;EACtB,kBAAgB,OAAO,KAAA,IAAY,2BAA2B,KAAA;EAC9D,eAAa,QAAQ,GAAG,OAAO,OAAO;EAEtC,UAAA,oBAAC,iBAAD;GAAiB,SAAS,CAAC;GACxB,UAAA,OAAO,KAAK,EAAE,WAAW,MAAM;IAC9B,OACE,oBAAC,OAAO,IAAR;KAEE,SACE,mBAAmB,KAAA,IAAY;MAAE,SAAS;MAAG,QAAQ;KAAO;KAE9D,WAAW,WAAW;KACtB,MAAM,mBAAmB,KAAA,IAAY;MAAE,SAAS;MAAG,QAAQ;KAAE;KAC7D,SAAS,mBAAmB,QAAQ;MAAE,QAAQ;MAAG,SAAS;KAAE;KAC5D,OAAO,EAAE,UAAU,SAAS;KAC5B,YAAY;MAAE,UAAU;MAAK,MAAM;KAAU;KAG7C,UAAA,oBAAC,OAAD;MAAK,WAAW,WAAW;MAAU,UAAA;KAAa,CAAA;IACzC,GAZJ,QAAQ,GAAG,OAAO,SAAS,GAAG,CAY1B;GAEf,CAAC;EACc,CAAA;CACf,CAAA;CAGN,IAAI,OAAO,KAAA,GACT,OAAO;CAGT,OACE,oBAAC,OAAD;EACE,WAAW,WAAW;EACtB,kBAAe;EACf,aAAU;EACN;EAEH,UAAA;CACE,CAAA;AAET;;;ACjGA,IAAA,+BAAe"}
@@ -1,19 +0,0 @@
1
- import React, { ReactNode } from "react";
2
- import { FieldValues, Path, SubmitHandler } from "react-hook-form";
3
- import { VetoFormattedError, VetoInstance, VetoTypeAny } from "@fuf-stack/veto";
4
- //#region src/Form/subcomponents/FormContext.d.ts
5
- interface DebugModeSettings {
6
- /** disable form debug completely */
7
- disable?: boolean;
8
- /** custom localStorage key to save debug mode state */
9
- localStorageKey?: string;
10
- }
11
- /** Listener function that gets called when a form reset is triggered */
12
- type FormResetListener = () => void;
13
- /**
14
- * Listener function that gets called when a field changes due to user input
15
- */
16
- type UserChangeListener<TFieldValues extends object = object> = (fieldName: Path<TFieldValues>, value: unknown) => void;
17
- //#endregion
18
- export { FormResetListener as n, UserChangeListener as r, DebugModeSettings as t };
19
- //# sourceMappingURL=FormContext-CsFiNvuJ.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FormContext-CsFiNvuJ.d.mts","names":[],"sources":["../src/Form/subcomponents/FormContext.tsx"],"mappings":";;;;UAgCiB;;EAEf;;EAEA;;;KAIU;;;;KAKA,mBAAmB,yCAC7B,WAAW,KAAK,eAChB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Switch-CvPO8IF9.d.mts","names":[],"sources":["../src/Switch/subcomponents/SwitchThumb.tsx","../src/Switch/switchVariants.ts","../src/Switch/Switch.tsx"],"mappings":";;;UAIiB;;EAEf;;EAEA;;EAEA;;EAEA;;EA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAqFjB,yBAA0B,sBAAoB,MAAA,aAGxD,8BAA8B,cAAY,6BAA6B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"radioControlVariants-Cm6WufWo.mjs","names":[],"sources":["../src/partials/RadioGroupField/RadioGroupDescriptionContext.ts","../src/partials/RadioGroupField/RadioGroupField.tsx","../src/partials/RadioGroupField/radioGroupFieldVariants.ts","../src/Radios/subcomponents/RadioControl.tsx","../src/Radios/subcomponents/radioControlVariants.ts"],"sourcesContent":["import { createContext } from 'react';\n\n/** Supporting message IDs inherited by each option */\nconst RadioGroupDescriptionContext = createContext<string | undefined>(\n undefined,\n);\n\nexport default RadioGroupDescriptionContext;\n","import type { ReactNode } from 'react';\nimport type { RadioGroupProps } from 'react-aria-components';\nimport type { FieldControlProps } from '../types';\n\nimport { useRef } from 'react';\nimport { RadioGroup } from 'react-aria-components';\n\nimport RadioGroupDescriptionContext from './RadioGroupDescriptionContext';\n\ninterface RadioGroupFieldProps {\n /** Group content, including its label and options */\n children: ReactNode;\n /** CSS class name */\n className?: string;\n /** Control ID, explicit accessible name and supporting message IDs */\n controlProps: Pick<\n FieldControlProps,\n 'id' | 'aria-label' | 'aria-describedby'\n >;\n /** Identifies the public component owning the radio group */\n dataComponent?: string;\n /** Disables every option */\n disabled?: boolean;\n /** Arranges options horizontally */\n inline: boolean;\n /** Connects form focus requests to the selected or first enabled option */\n inputRef: (control: Pick<HTMLElement, 'focus'> | null) => void;\n /** Marks visible validation failure */\n invalid: boolean;\n /** Field name */\n name: string;\n /** Callback when focus leaves the group */\n onBlur: () => void;\n /** Callback with the selected option's string value */\n onChange: (value: string) => void;\n /** Marks the group as required */\n required: boolean;\n /** HTML data-testid attribute */\n testId: string;\n /** Selected value, nullish values become an empty selection */\n value: unknown;\n}\n\n/**\n * React Aria radio-group engine with option focus routing and shared descriptions\n *\n * Receives bound values and callbacks, without registering a form field.\n * Its children own the field layout and option presentation.\n *\n * @see https://react-aria.adobe.com/RadioGroup\n */\nconst RadioGroupField = ({\n children,\n className = undefined,\n controlProps,\n dataComponent = undefined,\n disabled = undefined,\n inputRef,\n invalid,\n inline,\n name,\n onBlur,\n onChange,\n required,\n testId,\n value,\n}: RadioGroupFieldProps) => {\n const groupRef = useRef<HTMLDivElement>(null);\n\n // focus the selected enabled option, otherwise the first enabled option\n const handleFocus = () => {\n const input =\n groupRef.current?.querySelector<HTMLInputElement>(\n 'input:checked:not(:disabled)',\n ) ??\n groupRef.current?.querySelector<HTMLInputElement>('input:not(:disabled)');\n input?.focus();\n };\n\n // expose option focus through the binding ref\n const setControlRef = (node: HTMLDivElement | null) => {\n groupRef.current = node;\n inputRef(node ? { focus: handleFocus } : null);\n };\n\n // preserve the group's existing state selectors on the actual root\n const renderGroup: NonNullable<RadioGroupProps['render']> = (props) => {\n return (\n <div {...props} data-invalid={invalid} data-required={required}>\n {props.children}\n </div>\n );\n };\n\n return (\n <RadioGroup\n ref={setControlRef}\n aria-describedby={controlProps['aria-describedby']}\n aria-label={controlProps['aria-label']}\n className={className}\n data-component={dataComponent}\n data-invalid={invalid}\n data-required={required}\n data-slot=\"base\"\n data-testid={testId}\n id={controlProps.id}\n isDisabled={disabled}\n isInvalid={invalid}\n isRequired={required}\n name={name}\n onBlur={onBlur}\n onChange={onChange}\n orientation={inline ? 'horizontal' : 'vertical'}\n render={renderGroup}\n validationBehavior=\"aria\"\n value={value != null ? String(value) : ''}\n >\n <RadioGroupDescriptionContext.Provider\n value={controlProps['aria-describedby']}\n >\n {children}\n </RadioGroupDescriptionContext.Provider>\n </RadioGroup>\n );\n};\n\nexport default RadioGroupField;\n","import { tv } from '@fuf-stack/pixel-utils';\n\nconst radioGroupFieldVariants = tv({\n slots: {\n /** Container grouping the label, options and hints */\n base: 'relative',\n /** Supporting text below the options */\n description: 'text-foreground-400 text-tiny',\n /** Container for validation messages */\n errorMessage: '',\n /** Label above the options */\n label: 'relative',\n /** Container around the selectable options */\n wrapper: '',\n },\n});\n\nexport default radioGroupFieldVariants;\n","import type { ReactNode } from 'react';\nimport type { RadioButtonProps } from 'react-aria-components';\nimport type { RadioControlClassNames } from './radioControlVariants';\n\nimport { useContext, useId } from 'react';\nimport { RadioButton, RadioField } from 'react-aria-components';\n\nimport RadioGroupDescriptionContext from '../../partials/RadioGroupField/RadioGroupDescriptionContext';\n\ninterface RadioControlProps {\n /** Option label */\n children: ReactNode;\n /** CSS class name */\n className: RadioControlClassNames;\n /** Help text associated with the field */\n description?: ReactNode;\n /** Disables the field */\n disabled?: boolean;\n /** Decorative option icon */\n icon?: ReactNode;\n /** Marks visible validation failure */\n invalid: boolean;\n /** HTML data-testid attribute for e2e tests */\n testId?: string;\n /** String value managed by the containing group */\n value: string;\n}\n\n/**\n * React Aria radio option with an indicator, label and optional supporting text\n *\n * Inherits selection and disabled state from its RadioGroup, and supporting\n * message IDs from RadioGroupField when composed inside that engine.\n *\n * @see https://react-aria.adobe.com/RadioGroup\n */\nconst RadioControl = ({\n children,\n className: classNames,\n description = undefined,\n disabled = undefined,\n icon = undefined,\n invalid,\n testId = undefined,\n value,\n}: RadioControlProps) => {\n const id = useId();\n const groupDescription = useContext(RadioGroupDescriptionContext);\n\n const describedBy =\n [groupDescription, description ? `${id}-description` : undefined]\n .filter(Boolean)\n .join(' ') || undefined;\n\n const control = (\n <span aria-hidden className={classNames.wrapper} data-slot=\"wrapper\">\n <span className={classNames.control} data-slot=\"control\" />\n </span>\n );\n\n // preserve option state selectors on the visible label\n const renderOption: NonNullable<RadioButtonProps['render']> = (\n props,\n state,\n ) => {\n return (\n <label\n {...props}\n data-focus={state.isFocused || undefined}\n data-hover={state.isHovered || undefined}\n data-hover-unselected={\n (state.isHovered && !state.isSelected) || undefined\n }\n htmlFor={`${id}-control`}\n >\n {props.children}\n </label>\n );\n };\n\n return (\n <RadioField\n aria-describedby={describedBy}\n aria-labelledby={`${id}-label`}\n className={classNames.field}\n id={`${id}-control`}\n isDisabled={disabled}\n value={value}\n >\n <RadioButton\n className={classNames.base}\n data-invalid={invalid}\n data-slot=\"base\"\n data-testid={testId}\n render={renderOption}\n >\n {!icon ? control : null}\n {icon ? <div className={classNames.icon}>{icon}</div> : null}\n <div className={classNames.labelWrapper} data-slot=\"label-wrapper\">\n <span\n className={classNames.label}\n data-slot=\"label\"\n id={`${id}-label`}\n >\n {children}\n </span>\n {description ? (\n <div\n className={classNames.description}\n data-slot=\"description\"\n id={`${id}-description`}\n >\n {description}\n </div>\n ) : null}\n </div>\n {icon ? control : null}\n </RadioButton>\n </RadioField>\n );\n};\n\nexport default RadioControl;\n","import type { TVClassName } from '@fuf-stack/pixel-utils';\n\nimport { tv } from '@fuf-stack/pixel-utils';\n\nconst radioControlVariants = tv({\n slots: {\n /** Clickable option containing the indicator and label */\n base: [\n // option layout and pointer behavior\n 'group relative -m-2 inline-flex max-w-fit cursor-pointer select-none items-center justify-start p-2 tap-highlight-transparent',\n // disabled interaction and opacity\n 'data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-disabled',\n ],\n /** Dot marking the selected option */\n control: [\n // selection dot appearance and animation\n 'z-10 h-2 w-2 origin-center scale-0 rounded-full bg-primary text-primary-foreground opacity-0 transition-transform-opacity',\n // selection and validation states\n 'group-data-[selected=true]:scale-100 group-data-[invalid=true]:bg-danger group-data-[invalid=true]:text-danger-foreground group-data-[selected=true]:opacity-100',\n // reduced motion\n 'motion-reduce:transition-none',\n ],\n /** Supporting text below the option label */\n description:\n 'relative text-foreground-400 transition-colors text-small motion-reduce:transition-none',\n /** Option state boundary without an additional layout box */\n field: 'contents',\n /** Container for a decorative option icon */\n icon: '',\n /** Primary option text */\n label:\n 'relative select-none text-foreground transition-colors text-medium motion-reduce:transition-none',\n /** Container grouping the option label and description */\n labelWrapper: 'ml-1 ms-2 flex flex-col',\n /** Circular outline around the selection indicator */\n wrapper: [\n // indicator dimensions and layout\n 'relative box-border inline-flex h-5 w-5 shrink-0 items-center justify-center overflow-hidden',\n // circular border and transitions\n 'rounded-full border-2 border-solid border-default transition-transform-colors',\n // pressed, selected and invalid states\n 'group-data-[pressed=true]:scale-95 group-data-[invalid=true]:border-danger group-data-[invalid=true]:group-data-[selected=true]:border-danger group-data-[selected=true]:border-primary group-data-[hover-unselected=true]:bg-default-100',\n // keyboard focus ring\n 'group-data-[focus-visible=true]:ring-2 group-data-[focus-visible=true]:ring-focus group-data-[focus-visible=true]:ring-offset-2 group-data-[focus-visible=true]:ring-offset-background',\n // reduced motion\n 'motion-reduce:transition-none',\n ],\n },\n variants: {\n invalid: {\n true: {\n control: 'bg-danger text-danger-foreground',\n description: 'text-danger-300',\n label: 'text-danger',\n wrapper: 'border-danger group-data-[selected=true]:border-danger',\n },\n },\n },\n});\n\nexport type RadioControlClassNames = Partial<\n Record<keyof ReturnType<typeof radioControlVariants>, string>\n>;\n\nexport type ClassName = TVClassName<typeof radioControlVariants>;\n\nexport default radioControlVariants;\n"],"mappings":";;;;;;AAGA,MAAM,+BAA+B,cACnC,KAAA,CACF;;;;;;;;;;;AC8CA,MAAM,mBAAmB,EACvB,UACA,YAAY,KAAA,GACZ,cACA,gBAAgB,KAAA,GAChB,WAAW,KAAA,GACX,UACA,SACA,QACA,MACA,QACA,UACA,UACA,QACA,YAC0B;CAC1B,MAAM,WAAW,OAAuB,IAAI;CAG5C,MAAM,oBAAoB;EAMxB,CAJE,SAAS,SAAS,cAChB,8BACF,KACA,SAAS,SAAS,cAAgC,sBAAsB,EAAA,EACnE,MAAM;CACf;CAGA,MAAM,iBAAiB,SAAgC;EACrD,SAAS,UAAU;EACnB,SAAS,OAAO,EAAE,OAAO,YAAY,IAAI,IAAI;CAC/C;CAGA,MAAM,eAAuD,UAAU;EACrE,OACE,oBAAC,OAAD;GAAK,GAAI;GAAO,gBAAc;GAAS,iBAAe;GACnD,UAAA,MAAM;EACJ,CAAA;CAET;CAEA,OACE,oBAAC,YAAD;EACE,KAAK;EACL,oBAAkB,aAAa;EAC/B,cAAY,aAA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AAG;EACV,YAAY;EACL;EAEP,UAAA,qBAAC,aAAD;GACE,WAAW,WAAW;GACtB,gBAAc;GACd,aAAU;GACV,eAAa;GACb,QAAQ;GALV,UAAA;IAOG,CAAC,OAAO,UAAU;IAClB,OAAO,oBAAC,OAAD;KAAK,WAAW,WAAW;KAAO,UAAA;IAAU,CAAA,IAAI;IACxD,qBAAC,OAAD;KAAK,WAAW,WAAW;KAAc,aAAU;KAAnD,UAAA,CACE,oBAAC,QAAD;MACE,WAAW,WAAW;MACtB,aAAU;MACV,IAAI,GAAG,GAAG;MAET;KACG,CAAA,GACL,cACC,oBAAC,OAAD;MACE,WAAW,WAAW;MACtB,aAAU;MACV,IAAI,GAAG,GAAG;MAET,UAAA;KACE,CAAA,IACH,IACD;;IACJ,OAAO,UAAU;GACP;;CACH,CAAA;AAEhB;;;ACpHA,MAAM,uBAAuB,GAAG;CAC9B,OAAO;;EAEL,MAAM,CAEJ,iIAEA,gFACF;;EAEA,SAAS;GAEP;GAEA;GAEA;EACF;;EAEA,aACE;;EAEF,OAAO;;EAEP,MAAM;;EAEN,OACE;;EAEF,cAAc;;EAEd,SAAS;GAEP;GAEA;GAEA;GAEA;GAEA;EACF;CACF;CACA,UAAU,EACR,SAAS,EACP,MAAM;EACJ,SAAS;EACT,aAAa;EACb,OAAO;EACP,SAAS;CACX,EACF,EACF;AACF,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"switchVariants-BaQw2DA7.mjs","names":[],"sources":["../src/Switch/switchVariants.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\n\nimport { tv } from '@fuf-stack/pixel-utils';\n\nexport const switchVariants = tv({\n slots: {\n /** Container for the field control and supporting text */\n base: 'group relative inline-flex max-w-fit cursor-pointer touch-none select-none items-center justify-start tap-highlight-transparent',\n /** Supporting text for the field */\n description: 'text-foreground-500 text-tiny',\n /** Content at the end of the control */\n endContent: [\n // end icon position and fade transition\n 'absolute end-1.5 z-0 text-default-600 opacity-100 transition-transform-opacity text-small',\n // move and hide the selected end icon\n 'group-data-[selected=true]:translate-x-3 group-data-[selected=true]:opacity-0',\n // reduced motion\n 'motion-reduce:transition-none',\n ],\n /** Container for validation messages */\n errorMessage: 'text-danger text-tiny',\n /** Container for help text and validation messages */\n helperWrapper: 'relative ml-0 block p-0',\n /** Visible field label */\n label:\n 'group-data-[invalid=true]:text-danger! relative ms-2 select-none text-sm text-foreground subpixel-antialiased',\n /** Container grouping the toggle and field messages */\n outerWrapper: 'place-content-center',\n /** Content at the start of the control */\n startContent: [\n // start icon position and fade transition\n 'absolute start-1.5 z-0 scale-50 text-current opacity-0 transition-transform-opacity text-small',\n // reveal the selected start icon\n 'group-data-[selected=true]:scale-100 group-data-[selected=true]:opacity-100',\n // reduced motion\n 'motion-reduce:transition-none',\n ],\n /** Movable indicator showing the current value */\n thumb: [\n // thumb layout and surface\n 'pointer-events-none z-10 flex h-5 w-5 origin-right items-center justify-center rounded-full bg-white shadow-small transition-all text-small',\n // selected position and pressed width\n 'group-data-[selected=true]:group-data-[pressed=true]:ms-4 group-data-[selected=true]:ms-5 group-data-[pressed=true]:w-6',\n // reduced motion\n 'motion-reduce:transition-none',\n ],\n /** Content inside the toggle thumb */\n thumbIcon: 'text-black',\n /** Container arranging the selectable content */\n wrapper: [\n // switch track layout and surface\n 'relative inline-flex h-7 w-12 shrink-0 items-center justify-start overflow-hidden rounded-full bg-default-200 px-1 transition-background',\n // selected track colors\n 'group-data-[selected=true]:bg-primary group-data-[selected=true]:text-primary-foreground',\n // keyboard focus ring\n 'group-data-[focus-visible=true]:ring-2 group-data-[focus-visible=true]:ring-focus group-data-[focus-visible=true]:ring-offset-2 group-data-[focus-visible=true]:ring-offset-background',\n // reduced motion\n 'motion-reduce:transition-none',\n ],\n },\n variants: {\n size: {\n lg: {\n endContent: 'text-medium',\n startContent: 'text-medium',\n thumb:\n 'h-6 w-6 text-medium group-data-[selected=true]:group-data-[pressed=true]:ms-5 group-data-[selected=true]:ms-6 group-data-[pressed=true]:w-7',\n wrapper: 'h-8 w-14',\n },\n md: {},\n sm: {\n endContent: 'text-tiny',\n startContent: 'text-tiny',\n thumb:\n 'h-4 w-4 text-tiny group-data-[selected=true]:group-data-[pressed=true]:ms-3 group-data-[selected=true]:ms-4 group-data-[pressed=true]:w-5',\n wrapper: 'h-6 w-10',\n },\n },\n disabled: { true: { base: 'pointer-events-none opacity-disabled' } },\n },\n});\n\nexport type VariantProps = TVProps<typeof switchVariants>;\n\nexport type ClassName = TVClassName<typeof switchVariants>;\n"],"mappings":";;AAIA,MAAa,iBAAiB,GAAG;CAC/B,OAAO;;EAEL,MAAM;;EAEN,aAAa;;EAEb,YAAY;GAEV;GAEA;GAEA;EACF;;EAEA,cAAc;;EAEd,eAAe;;EAEf,OACE;;EAEF,cAAc;;EAEd,cAAc;GAEZ;GAEA;GAEA;EACF;;EAEA,OAAO;GAEL;GAEA;GAEA;EACF;;EAEA,WAAW;;EAEX,SAAS;GAEP;GAEA;GAEA;GAEA;EACF;CACF;CACA,UAAU;EACR,MAAM;GACJ,IAAI;IACF,YAAY;IACZ,cAAc;IACd,OACE;IACF,SAAS;GACX;GACA,IAAI,CAAC;GACL,IAAI;IACF,YAAY;IACZ,cAAc;IACd,OACE;IACF,SAAS;GACX;EACF;EACA,UAAU,EAAE,MAAM,EAAE,MAAM,uCAAuC,EAAE;CACrE;AACF,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"timeVariants-B9HDfNYt.mjs","names":[],"sources":["../src/Time/timeVariants.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\n\nimport { tv } from '@fuf-stack/pixel-utils';\n\n/** Shared segmented input defaults, also extended by DatePicker */\nexport const segmentedInputVariants = tv({\n slots: {\n /** Field container with space for supporting text */\n base: 'group flex w-full flex-col gap-y-1.5 pb-5',\n /** Field description text */\n description: 'text-foreground-500 text-tiny',\n /** Validation message text */\n errorMessage: 'text-danger text-tiny',\n /** Supporting text below the input surface */\n helperWrapper: [\n 'absolute start-0 top-[calc(100%_+_2px)] flex flex-col gap-1.5',\n 'p-0',\n ],\n /** Row containing segments and optional controls */\n innerWrapper: 'flex h-6 w-full items-center gap-x-2 text-default-400',\n /** Editable date or time segment group */\n input: 'flex h-full w-full gap-x-0.5 font-normal text-small',\n /** Bordered surface around the editable segments */\n inputWrapper: [\n // segmented control frame and layout\n 'shadow-xs relative inline-flex h-10 min-h-10 w-full cursor-text flex-row items-center gap-3',\n // border and padding\n 'rounded-small border-2 border-default-200 px-3',\n // color transitions\n 'transition-colors duration-150',\n // hover and focus borders\n 'hover:border-default-400 focus-within:hover:border-default-foreground',\n // reduced motion\n 'motion-reduce:transition-none',\n // surface color and focused border\n 'bg-content1 focus-within:border-focus',\n ],\n /** Label above the segmented input */\n label: [\n 'block w-full text-foreground subpixel-antialiased text-small',\n 'cursor-default',\n ],\n /** Individual editable value or separator */\n segment: [\n // segment focus outline and shadow\n 'outline-solid focus:shadow-xs',\n // segment spacing and typography\n 'group my-auto box-content inline-block rounded-md px-0.5 text-start tabular-nums text-foreground-500 outline-transparent',\n // color transition\n 'transition-colors',\n // first segment alignment and focus background\n 'first:-ml-0.5 focus:bg-default-400/50',\n // editable values and empty placeholders\n 'data-[editable=true]:data-[placeholder=true]:text-foreground-500 data-[editable=true]:text-foreground data-[editable=true]:focus:text-default-foreground',\n // reduced motion\n 'motion-reduce:transition-none',\n // spacing between subsequent segments\n '[&:not(:first-child)]:-ml-1',\n ],\n },\n});\n\nexport const timeVariants = tv({\n extend: segmentedInputVariants,\n variants: {\n disabled: { true: { base: 'pointer-events-none opacity-disabled' } },\n invalid: {\n true: {\n innerWrapper: 'text-danger',\n inputWrapper:\n 'border-danger focus-within:border-danger hover:border-danger focus-within:hover:border-danger',\n label: 'text-danger',\n segment: [\n // invalid text and focus background\n 'text-danger-300 focus:bg-danger-400/50',\n // editable values and empty placeholders\n 'data-[editable=true]:data-[placeholder=true]:text-danger data-[editable=true]:text-danger data-[editable=true]:focus:text-danger',\n // dark theme focus background\n 'dark:focus:bg-danger-400/20',\n ],\n },\n },\n },\n});\n\nexport type VariantProps = TVProps<typeof timeVariants>;\n\nexport type ClassName = TVClassName<typeof timeVariants>;\n\n/** Resolved class names for the segmented time slots */\nexport type TimeClassNames = Record<\n keyof ReturnType<typeof timeVariants>,\n string\n>;\n"],"mappings":";;;AAKA,MAAa,yBAAyB,GAAG,EACvC,OAAO;;CAEL,MAAM;;CAEN,aAAa;;CAEb,cAAc;;CAEd,eAAe,CACb,iEACA,KACF;;CAEA,cAAc;;CAEd,OAAO;;CAEP,cAAc;EAEZ;EAEA;EAEA;EAEA;EAEA;EAEA;CACF;;CAEA,OAAO,CACL,gEACA,gBACF;;CAEA,SAAS;EAEP;EAEA;EAEA;EAEA;EAEA;EAEA;EAEA;CACF;AACF,EACF,CAAC;AAED,MAAa,eAAe,GAAG;CAC7B,QAAQ;CACR,UAAU;EACR,UAAU,EAAE,MAAM,EAAE,MAAM,uCAAuC,EAAE;EACnE,SAAS,EACP,MAAM;GACJ,cAAc;GACd,cACE;GACF,OAAO;GACP,SAAS;IAEP;IAEA;IAEA;GACF;EACF,EACF;CACF;AACF,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useFormContext-BPjJjNnM.mjs","names":["useFormContext","useHookFormContext"],"sources":["../src/hooks/useFormContext/useFormContext.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { VetoFormattedError, VetoInstance } from '@fuf-stack/veto';\nimport type { FieldError, FieldValues, Path } from 'react-hook-form';\n\nimport { useContext } from 'react';\nimport { useFormContext as useHookFormContext } from 'react-hook-form';\n\nimport { UniformContext } from '../../Form/subcomponents/FormContext';\nimport { flatArrayKey, nameToTestId, toValidationFormat } from '../../helpers';\n\n/** Schema check whether a field is required or optional */\nexport const checkFieldIsRequired = (\n validation: VetoInstance,\n path: string[],\n): boolean => {\n // Handle flat array paths: strip the flatArrayKey to check the array element schema\n // e.g., ['arrayField', '0', '__FLAT__'] -> check schema at ['arrayField', '0']\n const checkPath =\n path[path.length - 1] === flatArrayKey ? path.slice(0, -1) : path;\n\n const checkRequired = (schema: any) => {\n // arrays ...\n if (schema.type === 'array') {\n // ... if array is optional or nullable it is not required\n if (schema.isOptional || schema.isNullable) {\n return false;\n }\n // ... otherwise arrays are required (display logic wise -> no asterisk in the label)\n return true;\n }\n\n // all other fields are required if they are\n // not optional and not nullable\n return !schema.isOptional && !schema.isNullable;\n };\n\n return validation.checkSchemaPath(checkRequired, checkPath);\n};\n\n/**\n * Resolve validation errors for a given field path.\n *\n * Traverses a nested `VetoFormattedError` structure using a dotted path\n * (for example: \"user.address.0.street\") and returns the matching\n * `FieldError[]` if present. If no error exists at the path, returns\n * `undefined`.\n *\n * @param errors - The formatted validation errors from Uniform's context\n * @param name - The dotted field path to resolve\n * @returns An array of `FieldError` entries for the field, or `undefined`\n */\nconst getValidationErrorsByName = (\n errors: VetoFormattedError,\n name: string,\n) => {\n // Traverse nested error structure; ignore flat array wrapper key\n const keys = name.split('.').filter((k) => {\n return k !== flatArrayKey;\n });\n let current: unknown = errors;\n keys.forEach((key) => {\n if (current && typeof current === 'object') {\n current = (current as Record<string, unknown>)[key];\n } else {\n current = undefined;\n }\n });\n return current as FieldError[] | undefined;\n};\n\n/**\n * Custom hook that extends react-hook-form's useFormContext to add validation and state management.\n *\n * Key features:\n * - Enhanced `getFieldState` that includes validation schema-based \"required\" status and testId generation\n * - Automatic conversion of form values via `getValues`, `watch`, and `subscribe`:\n * - Unwraps flat array wrappers (`{ __FLAT__: value }` → `value`)\n * - Converts nullish string markers (`__NULL__` → `null`, `__FALSE__` → `false`, `__ZERO__` → `0`)\n * - Filters out empty/null values\n */\nexport const useFormContext = <\n TFieldValues extends FieldValues = FieldValues,\n TContext = any,\n TTransformedValues = TFieldValues,\n>() => {\n const {\n formState,\n // some methods that will be enhanced below\n getFieldState: getFieldStateOrig,\n getValues: getValuesOrig,\n watch: watchOrig,\n subscribe: subscribeOrig,\n reset: resetOrig,\n // the rest of the methods pass through unchanged\n ...otherMethods\n } = useHookFormContext<TFieldValues, TContext, TTransformedValues>();\n\n const uniformContext = useContext(UniformContext);\n\n /**\n * Wrap react-hook-form's `reset` so the uniform context is notified about\n * programmatic resets. Field components (e.g. FieldArray) use this signal to\n * normalize their state on reset instead of inferring it from field contents.\n */\n const notifyReset = uniformContext?.formReset?.notify;\n const reset = ((...args: Parameters<typeof resetOrig>) => {\n resetOrig(...args);\n notifyReset?.();\n }) as typeof resetOrig;\n\n /**\n * Updated getFieldState method which returns:\n * - Whether the field is required by checking the validation schema\n * - Existing field state information (errors, etc.)\n * - A testId generated from the field name (with flat array keys removed and slugified)\n *\n * @param name - The field path (string or array)\n * @param testId - Optional explicit testId. If provided, will be slugified. If not provided, generated from name.\n */\n const getFieldState = (name: Path<TFieldValues>, testId?: string) => {\n const fieldPath =\n typeof name === 'string' ? name.replace(/\\[\\d+\\]/g, '').split('.') : name;\n\n // Use base validation instance for checking \"required\" status\n // Client validation often uses .nullish() which would incorrectly mark fields as optional\n const validationInstance =\n uniformContext?.validation.baseInstance ??\n uniformContext?.validation.instance;\n\n // Check if the field is required using the validation schema\n const required = validationInstance\n ? checkFieldIsRequired(validationInstance, fieldPath)\n : false;\n\n const error = getValidationErrorsByName(\n uniformContext?.validation.errors ?? {},\n name,\n );\n\n // Get everything but the error from the original field state\n const fieldState = getFieldStateOrig(name, formState);\n\n return {\n ...fieldState,\n error,\n invalid: !!error,\n required,\n testId: nameToTestId(testId ?? name),\n };\n };\n\n /**\n * Wrap form value accessor methods to automatically convert from internal storage format\n * to component-friendly format:\n *\n * - Unwrap flat array wrappers: `{ __FLAT__: value }` → `value`\n * - Convert nullish string markers: `__NULL__` → `null`, `__FALSE__` → `false`, `__ZERO__` → `0`\n * - Filter out empty/null values: fields with converted null/empty values are removed entirely\n *\n * This ensures components receive clean, predictable data without needing to handle\n * the internal nullish string conversion system or flat array wrapping manually.\n */\n const getValues = ((...args: any[]) => {\n const result = (getValuesOrig as any)(...args);\n return toValidationFormat(result);\n }) as typeof getValuesOrig;\n\n const watch = ((...args: any[]) => {\n const result = (watchOrig as any)(...args);\n return toValidationFormat(result);\n }) as typeof watchOrig;\n\n const subscribe = ((...args: any[]) => {\n // For subscribe, we need to wrap the callback to convert the values property\n const [options] = args;\n if (options?.callback) {\n const originalCallback = options.callback;\n const wrappedOptions = {\n ...options,\n callback: (subscribeFormState: any) => {\n // Convert the values property if it exists\n const convertedFormState = {\n ...subscribeFormState,\n ...(subscribeFormState.values && {\n values: toValidationFormat(subscribeFormState.values),\n }),\n };\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return originalCallback(convertedFormState);\n },\n };\n return subscribeOrig(wrappedOptions);\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return (subscribeOrig as any)(...args);\n }) as typeof subscribeOrig;\n\n return {\n ...otherMethods,\n ...uniformContext,\n formState,\n getFieldState,\n getValues,\n reset,\n subscribe,\n watch,\n };\n};\n"],"mappings":";;;;;;AAYA,MAAa,wBACX,YACA,SACY;CAGZ,MAAM,YACJ,KAAK,KAAK,SAAS,OAAA,aAAsB,KAAK,MAAM,GAAG,EAAE,IAAI;CAE/D,MAAM,iBAAiB,WAAgB;EAErC,IAAI,OAAO,SAAS,SAAS;GAE3B,IAAI,OAAO,cAAc,OAAO,YAC9B,OAAO;GAGT,OAAO;EACT;EAIA,OAAO,CAAC,OAAO,cAAc,CAAC,OAAO;CACvC;CAEA,OAAO,WAAW,gBAAgB,eAAe,SAAS;AAC5D;;;;;;;;;;;;;AAcA,MAAM,6BACJ,QACA,SACG;CAEH,MAAM,OAAO,KAAK,MAAM,GAAG,CAAC,CAAC,QAAQ,MAAM;EACzC,OAAO,MAAM;CACf,CAAC;CACD,IAAI,UAAmB;CACvB,KAAK,SAAS,QAAQ;EACpB,IAAI,WAAW,OAAO,YAAY,UAChC,UAAW,QAAoC;OAE/C,UAAU,KAAA;CAEd,CAAC;CACD,OAAO;AACT;;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