@fuf-stack/uniform 1.16.0 → 1.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Checkboxes/index.d.cts +1 -1
- package/dist/Checkboxes/index.d.ts +1 -1
- package/dist/FieldArray/index.d.cts +1 -1
- package/dist/FieldArray/index.d.ts +1 -1
- package/dist/FieldCard/index.cjs +1 -1
- package/dist/FieldCard/index.d.cts +1 -1
- package/dist/FieldCard/index.d.ts +1 -1
- package/dist/FieldCard/index.js +1 -1
- package/dist/{FieldCard-DcMORXZR.cjs → FieldCard-38ZBBWyE.cjs} +52 -8
- package/dist/FieldCard-38ZBBWyE.cjs.map +1 -0
- package/dist/{FieldCard-DZSiMFoO.js → FieldCard-7XiCb6jZ.js} +52 -8
- package/dist/FieldCard-7XiCb6jZ.js.map +1 -0
- package/dist/Grid/index.d.cts +1 -1
- package/dist/Grid/index.d.ts +1 -1
- package/dist/Input/index.d.cts +1 -1
- package/dist/Input/index.d.ts +1 -1
- package/dist/RadioBoxes/index.d.cts +1 -1
- package/dist/RadioBoxes/index.d.ts +1 -1
- package/dist/RadioTabs/index.d.ts +1 -1
- package/dist/Radios/index.d.cts +1 -1
- package/dist/Radios/index.d.ts +1 -1
- package/dist/Select/index.d.cts +1 -1
- package/dist/Select/index.d.ts +1 -1
- package/dist/Slider/index.d.cts +1 -1
- package/dist/Slider/index.d.ts +1 -1
- package/dist/SubmitButton/index.d.cts +1 -1
- package/dist/SubmitButton/index.d.ts +1 -1
- package/dist/Switch/index.d.cts +1 -1
- package/dist/Switch/index.d.ts +1 -1
- package/dist/SwitchBox/index.d.cts +1 -1
- package/dist/SwitchBox/index.d.ts +1 -1
- package/dist/TextArea/index.d.cts +1 -1
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/helpers/index.d.cts +186 -2
- package/dist/helpers/index.d.cts.map +1 -0
- package/dist/helpers/index.d.ts +186 -2
- package/dist/helpers/index.d.ts.map +1 -0
- package/dist/hooks/useClientValidation/index.d.cts +1 -1
- package/dist/hooks/useClientValidation/index.d.ts +1 -1
- package/dist/hooks/useController/index.d.cts +1 -1
- package/dist/hooks/useController/index.d.ts +2 -1
- package/dist/hooks/useFormContext/index.d.cts +1 -1
- package/dist/hooks/useFormContext/index.d.ts +1 -1
- package/dist/hooks/useUniformField/index.d.cts +1 -1
- package/dist/hooks/useUniformField/index.d.ts +3 -3
- package/dist/hooks/useUniformFieldArray/index.d.cts +1 -1
- package/dist/hooks/useUniformFieldArray/index.d.ts +4 -24
- package/dist/hooks/useWatchUserChange/index.d.cts +1 -1
- package/dist/hooks/useWatchUserChange/index.d.ts +1 -1
- package/dist/{index-BZrLB2p0.d.cts → index-796vjEop.d.ts} +34 -34
- package/dist/index-796vjEop.d.ts.map +1 -0
- package/dist/{index-2SVlCM0Y.d.cts → index-B62CWrcm.d.ts} +21 -21
- package/dist/index-B62CWrcm.d.ts.map +1 -0
- package/dist/{index-DS4AP9pV.d.ts → index-BD9y--o2.d.cts} +6 -6
- package/dist/{index-DymdaDrj.d.cts.map → index-BD9y--o2.d.cts.map} +1 -1
- package/dist/{index-BbA9HcNa.d.cts → index-BFLKkqA3.d.ts} +3 -3
- package/dist/{index-CCeHSmIe.d.ts.map → index-BFLKkqA3.d.ts.map} +1 -1
- package/dist/{index-CJ90vm9t.d.ts → index-BV_YDI6g.d.ts} +6 -6
- package/dist/{index-CJ90vm9t.d.ts.map → index-BV_YDI6g.d.ts.map} +1 -1
- package/dist/{index-CCeHSmIe.d.ts → index-BW9EUWZE.d.cts} +2 -2
- package/dist/{index-BbA9HcNa.d.cts.map → index-BW9EUWZE.d.cts.map} +1 -1
- package/dist/{index-DymdaDrj.d.cts → index-B_1td56I.d.ts} +6 -6
- package/dist/{index-DS4AP9pV.d.ts.map → index-B_1td56I.d.ts.map} +1 -1
- package/dist/{index-noH6pESQ.d.ts → index-BgXr1v45.d.cts} +34 -34
- package/dist/index-BgXr1v45.d.cts.map +1 -0
- package/dist/{index-tIGuHSXb.d.ts → index-C3CvgmJw.d.ts} +4 -4
- package/dist/{index-tIGuHSXb.d.ts.map → index-C3CvgmJw.d.ts.map} +1 -1
- package/dist/{index-B2IL9Zt7.d.cts → index-C4-1V8jn.d.ts} +3 -3
- package/dist/{index-CPcJGZVS.d.ts.map → index-C4-1V8jn.d.ts.map} +1 -1
- package/dist/{index-D-ucmG60.d.ts → index-CB00FCyi.d.ts} +21 -21
- package/dist/index-CB00FCyi.d.ts.map +1 -0
- package/dist/index-CFBmva_r.d.ts +1 -0
- package/dist/index-COwP53Gx.d.ts +278 -0
- package/dist/{index-CRYEKT3o.d.ts.map → index-COwP53Gx.d.ts.map} +1 -1
- package/dist/{index-Ct2YYfiU.d.cts → index-CUy2EDqc.d.cts} +6 -6
- package/dist/{index-Ct2YYfiU.d.cts.map → index-CUy2EDqc.d.cts.map} +1 -1
- package/dist/{index-CpVfOXNv.d.cts → index-CbAh0Kfo.d.cts} +3 -3
- package/dist/{index-CpVfOXNv.d.cts.map → index-CbAh0Kfo.d.cts.map} +1 -1
- package/dist/{index-FHPC_VE1.d.ts → index-Cj-PU3Ck.d.ts} +35 -35
- package/dist/{index-FHPC_VE1.d.ts.map → index-Cj-PU3Ck.d.ts.map} +1 -1
- package/dist/{index-CdXOAPMb.d.ts → index-CrxSEKKb.d.cts} +48 -48
- package/dist/index-CrxSEKKb.d.cts.map +1 -0
- package/dist/{index-DYErnCVV.d.cts → index-D3RMbKbP.d.cts} +36 -36
- package/dist/{index-DYErnCVV.d.cts.map → index-D3RMbKbP.d.cts.map} +1 -1
- package/dist/{index-DaBgwR1t.d.cts → index-DAeb_8Q4.d.cts} +21 -21
- package/dist/{index-DaBgwR1t.d.cts.map → index-DAeb_8Q4.d.cts.map} +1 -1
- package/dist/{index-CPcJGZVS.d.ts → index-DEJghucW.d.cts} +3 -3
- package/dist/{index-B2IL9Zt7.d.cts.map → index-DEJghucW.d.cts.map} +1 -1
- package/dist/{index-lot50R9R.d.ts → index-DJbdReTK.d.ts} +3 -3
- package/dist/{index-lot50R9R.d.ts.map → index-DJbdReTK.d.ts.map} +1 -1
- package/dist/{index-CZ5EIIjq.d.cts → index-DTURD6sl.d.cts} +6 -6
- package/dist/{index-CZ5EIIjq.d.cts.map → index-DTURD6sl.d.cts.map} +1 -1
- package/dist/{index-BKCiuwim.d.cts → index-DebErIUS.d.ts} +48 -48
- package/dist/{index-CdXOAPMb.d.ts.map → index-DebErIUS.d.ts.map} +1 -1
- package/dist/{index-D5rTKWm9.d.cts → index-DfGCI-K_.d.cts} +99 -99
- package/dist/index-DfGCI-K_.d.cts.map +1 -0
- package/dist/{index-Djc5tmi3.d.ts → index-DjDR6FpI.d.ts} +36 -36
- package/dist/{index-Djc5tmi3.d.ts.map → index-DjDR6FpI.d.ts.map} +1 -1
- package/dist/{index-PU5WNOH9.d.cts → index-DsyY9X04.d.cts} +3 -3
- package/dist/{index-PU5WNOH9.d.cts.map → index-DsyY9X04.d.cts.map} +1 -1
- package/dist/{index-BuX42Bbd.d.ts → index-DxfiwbJb.d.cts} +18 -6
- package/dist/index-DxfiwbJb.d.cts.map +1 -0
- package/dist/{index-DubKudrE.d.ts → index-Dy0m4FQj.d.ts} +6 -6
- package/dist/{index-DubKudrE.d.ts.map → index-Dy0m4FQj.d.ts.map} +1 -1
- package/dist/{index-BDvr4eaz.d.ts → index-Y8XsRdxS.d.cts} +21 -21
- package/dist/{index-2SVlCM0Y.d.cts.map → index-Y8XsRdxS.d.cts.map} +1 -1
- package/dist/{index-DW1uBiAf.d.cts → index-gWYaaO6O.d.ts} +18 -6
- package/dist/index-gWYaaO6O.d.ts.map +1 -0
- package/dist/index-lQ_hGQ08.d.cts +1 -0
- package/dist/{index-hacHTzh4.d.cts → index-nVYabHcT.d.cts} +33 -33
- package/dist/{index-hacHTzh4.d.cts.map → index-nVYabHcT.d.cts.map} +1 -1
- package/dist/{index-CVY05bZf.d.ts → index-pE9osud2.d.ts} +3 -3
- package/dist/{index-CVY05bZf.d.ts.map → index-pE9osud2.d.ts.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +22 -22
- package/dist/index.d.ts +24 -23
- package/dist/index.js +1 -1
- package/dist/partials/FieldCopyTestIdButton/index.d.cts +1 -1
- package/dist/partials/FieldCopyTestIdButton/index.d.ts +1 -1
- package/dist/partials/FieldValidationError/index.d.cts +1 -1
- package/dist/partials/FieldValidationError/index.d.ts +1 -1
- package/dist/{useClientValidation-Bv0yxTyV.d.ts → useClientValidation-Bg0q3Axc.d.ts} +1 -1
- package/dist/{useClientValidation-Bv0yxTyV.d.ts.map → useClientValidation-Bg0q3Axc.d.ts.map} +1 -1
- package/dist/{useClientValidation-DSMw7f-t.d.cts → useClientValidation-BvPDQmf6.d.cts} +1 -1
- package/dist/{useClientValidation-DSMw7f-t.d.cts.map → useClientValidation-BvPDQmf6.d.cts.map} +1 -1
- package/dist/{useController-Co8wbo-Y.d.ts → useController-BJ2SBdky.d.ts} +1 -1
- package/dist/{useController-Co8wbo-Y.d.ts.map → useController-BJ2SBdky.d.ts.map} +1 -1
- package/dist/{useController-B-DhUPpA.d.cts → useController-C6Pg9T_3.d.cts} +1 -1
- package/dist/{useController-B-DhUPpA.d.cts.map → useController-C6Pg9T_3.d.cts.map} +1 -1
- package/dist/{useFormContext-DDx8LD8e.d.ts → useFormContext-B2TS6xq0.d.ts} +3 -3
- package/dist/useFormContext-B2TS6xq0.d.ts.map +1 -0
- package/dist/{useFormContext-oEivkWtB.d.cts → useFormContext-n3WYgGkW.d.cts} +19 -19
- package/dist/useFormContext-n3WYgGkW.d.cts.map +1 -0
- package/dist/{useUniformField-q3GCAV85.d.ts → useUniformField-CXSaAVTt.d.ts} +3 -3
- package/dist/{useUniformField-q3GCAV85.d.ts.map → useUniformField-CXSaAVTt.d.ts.map} +1 -1
- package/dist/{useUniformField-DFXQO9dw.d.cts → useUniformField-ETnay_UI.d.cts} +3 -3
- package/dist/{useUniformField-DFXQO9dw.d.cts.map → useUniformField-ETnay_UI.d.cts.map} +1 -1
- package/dist/{useUniformFieldArray-B3smveBW.d.cts → useUniformFieldArray-4pUdrWYT.d.cts} +14 -14
- package/dist/{useUniformFieldArray-B3smveBW.d.cts.map → useUniformFieldArray-4pUdrWYT.d.cts.map} +1 -1
- package/dist/{useUniformFieldArray-CmACueEO.d.ts → useUniformFieldArray-COtgcAnp.d.ts} +3 -3
- package/dist/{useUniformFieldArray-CmACueEO.d.ts.map → useUniformFieldArray-COtgcAnp.d.ts.map} +1 -1
- package/dist/{useWatchUserChange-JMU-vN92.d.ts → useWatchUserChange-DX6gUHvM.d.ts} +1 -1
- package/dist/{useWatchUserChange-JMU-vN92.d.ts.map → useWatchUserChange-DX6gUHvM.d.ts.map} +1 -1
- package/dist/{useWatchUserChange-DahNCPDG.d.cts → useWatchUserChange-cI5-j6M4.d.cts} +1 -1
- package/dist/{useWatchUserChange-DahNCPDG.d.cts.map → useWatchUserChange-cI5-j6M4.d.cts.map} +1 -1
- package/package.json +2 -2
- package/dist/FieldCard-DZSiMFoO.js.map +0 -1
- package/dist/FieldCard-DcMORXZR.cjs.map +0 -1
- package/dist/index-BDvr4eaz.d.ts.map +0 -1
- package/dist/index-BKCiuwim.d.cts.map +0 -1
- package/dist/index-BPjrrFuM.d.ts +0 -186
- package/dist/index-BPjrrFuM.d.ts.map +0 -1
- package/dist/index-BTr_gid3.d.cts +0 -186
- package/dist/index-BTr_gid3.d.cts.map +0 -1
- package/dist/index-BZrLB2p0.d.cts.map +0 -1
- package/dist/index-BuX42Bbd.d.ts.map +0 -1
- package/dist/index-CRYEKT3o.d.ts +0 -278
- package/dist/index-D-ucmG60.d.ts.map +0 -1
- package/dist/index-D5rTKWm9.d.cts.map +0 -1
- package/dist/index-DW1uBiAf.d.cts.map +0 -1
- package/dist/index-noH6pESQ.d.ts.map +0 -1
- package/dist/useFormContext-DDx8LD8e.d.ts.map +0 -1
- package/dist/useFormContext-oEivkWtB.d.cts.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as Checkboxes, r as CheckboxesProps, t as CheckboxOption } from "../index-
|
|
1
|
+
import { n as Checkboxes, r as CheckboxesProps, t as CheckboxOption } from "../index-DTURD6sl.cjs";
|
|
2
2
|
export { CheckboxOption, Checkboxes, Checkboxes as default, CheckboxesProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as Checkboxes, r as CheckboxesProps, t as CheckboxOption } from "../index-
|
|
1
|
+
import { n as Checkboxes, r as CheckboxesProps, t as CheckboxOption } from "../index-Dy0m4FQj.js";
|
|
2
2
|
export { CheckboxOption, Checkboxes, Checkboxes as default, CheckboxesProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as FieldArrayProps, n as FieldArrayChildrenRenderFn, r as FieldArrayFeatures, t as FieldArray } from "../index-
|
|
1
|
+
import { i as FieldArrayProps, n as FieldArrayChildrenRenderFn, r as FieldArrayFeatures, t as FieldArray } from "../index-CUy2EDqc.cjs";
|
|
2
2
|
export { FieldArray, FieldArray as default, FieldArrayChildrenRenderFn, FieldArrayFeatures, FieldArrayProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as FieldArrayProps, n as FieldArrayChildrenRenderFn, r as FieldArrayFeatures, t as FieldArray } from "../index-
|
|
1
|
+
import { i as FieldArrayProps, n as FieldArrayChildrenRenderFn, r as FieldArrayFeatures, t as FieldArray } from "../index-BV_YDI6g.js";
|
|
2
2
|
export { FieldArray, FieldArray as default, FieldArrayChildrenRenderFn, FieldArrayFeatures, FieldArrayProps };
|
package/dist/FieldCard/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as FieldCardProps, r as fieldCardVariants, t as FieldCard } from "../index-
|
|
1
|
+
import { n as FieldCardProps, r as fieldCardVariants, t as FieldCard } from "../index-DxfiwbJb.cjs";
|
|
2
2
|
export { FieldCard, FieldCardProps, fieldCardVariants };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as FieldCardProps, r as fieldCardVariants, t as FieldCard } from "../index-
|
|
1
|
+
import { n as FieldCardProps, r as fieldCardVariants, t as FieldCard } from "../index-gWYaaO6O.js";
|
|
2
2
|
export { FieldCard, FieldCardProps, fieldCardVariants };
|
package/dist/FieldCard/index.js
CHANGED
|
@@ -12,9 +12,13 @@ let _fuf_stack_pixel_motion = require("@fuf-stack/pixel-motion");
|
|
|
12
12
|
*
|
|
13
13
|
* This component handles displaying field-level validation errors with proper
|
|
14
14
|
* accessibility attributes and animates them in/out using Framer Motion.
|
|
15
|
+
*
|
|
16
|
+
* Note: Object-level errors (_errors) are always shown when they exist,
|
|
17
|
+
* but the danger styling is controlled by the parent FieldCard based on
|
|
18
|
+
* whether child fields have been touched.
|
|
15
19
|
*/
|
|
16
|
-
const FieldCardValidationError = ({ className = void 0, name }) => {
|
|
17
|
-
const {
|
|
20
|
+
const FieldCardValidationError = ({ className = void 0, error = void 0, errorTextClassName = void 0, name }) => {
|
|
21
|
+
const { getErrorMessageProps, getHelperWrapperProps, testId } = require_useUniformField.useUniformField({ name });
|
|
18
22
|
const disableAnimation = (0, _fuf_stack_pixel_motion.useReducedMotion)();
|
|
19
23
|
const hasErrors = !!error?._errors;
|
|
20
24
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_fuf_stack_pixel_motion.AnimatePresence, {
|
|
@@ -42,6 +46,7 @@ const FieldCardValidationError = ({ className = void 0, name }) => {
|
|
|
42
46
|
className: (0, _fuf_stack_pixel_utils.cn)(getHelperWrapperProps()?.className, className),
|
|
43
47
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
44
48
|
...getErrorMessageProps(),
|
|
49
|
+
className: (0, _fuf_stack_pixel_utils.cn)(getErrorMessageProps()?.className, errorTextClassName),
|
|
45
50
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FieldValidationError.FieldValidationError_default$1, {
|
|
46
51
|
error: error._errors,
|
|
47
52
|
testId
|
|
@@ -56,6 +61,38 @@ var FieldCardValidationError_default = FieldCardValidationError;
|
|
|
56
61
|
//#endregion
|
|
57
62
|
//#region src/FieldCard/FieldCard.tsx
|
|
58
63
|
/**
|
|
64
|
+
* Recursively checks if any child field has an error (regardless of touched state).
|
|
65
|
+
* Returns true if at least one child has an error.
|
|
66
|
+
*/
|
|
67
|
+
const hasAnyChildErrors = (errors) => {
|
|
68
|
+
if (!errors) return false;
|
|
69
|
+
return Object.keys(errors).filter((key) => {
|
|
70
|
+
return key !== "_errors";
|
|
71
|
+
}).some((key) => {
|
|
72
|
+
const errorValue = errors[key];
|
|
73
|
+
if (errorValue === void 0) return false;
|
|
74
|
+
if (Array.isArray(errorValue)) return true;
|
|
75
|
+
if (typeof errorValue === "object" && errorValue !== null) return hasAnyChildErrors(errorValue);
|
|
76
|
+
return false;
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Recursively checks if any child field is touched.
|
|
81
|
+
* Returns true if at least one child is touched.
|
|
82
|
+
*/
|
|
83
|
+
const hasAnyChildTouched = (touched) => {
|
|
84
|
+
if (!touched) return false;
|
|
85
|
+
return Object.keys(touched).filter((key) => {
|
|
86
|
+
return key !== "_errors";
|
|
87
|
+
}).some((key) => {
|
|
88
|
+
const touchedValue = touched[key];
|
|
89
|
+
if (touchedValue === void 0) return false;
|
|
90
|
+
if (touchedValue === true) return true;
|
|
91
|
+
if (typeof touchedValue === "object" && touchedValue !== null) return hasAnyChildTouched(touchedValue);
|
|
92
|
+
return false;
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
59
96
|
* Recursively checks if any child field with an error is also touched.
|
|
60
97
|
* Returns true if at least one touched child has an error.
|
|
61
98
|
*/
|
|
@@ -86,18 +123,21 @@ const fieldCardVariants = (0, _fuf_stack_pixel_utils.tv)({
|
|
|
86
123
|
"border-t",
|
|
87
124
|
"block px-3 pb-2 pt-1",
|
|
88
125
|
"transition-colors duration-150 motion-reduce:transition-none"
|
|
89
|
-
]
|
|
126
|
+
],
|
|
127
|
+
errorText: []
|
|
90
128
|
},
|
|
91
129
|
variants: { invalid: {
|
|
92
130
|
true: {
|
|
93
131
|
base: "border-danger-200",
|
|
94
132
|
label: "border-danger-200 text-danger",
|
|
95
|
-
errorFooter: "border-danger-200"
|
|
133
|
+
errorFooter: "border-danger-200",
|
|
134
|
+
errorText: "!text-danger text-tiny"
|
|
96
135
|
},
|
|
97
136
|
false: {
|
|
98
137
|
base: "border-divider",
|
|
99
138
|
label: "border-divider text-foreground",
|
|
100
|
-
errorFooter: "border-divider"
|
|
139
|
+
errorFooter: "border-divider",
|
|
140
|
+
errorText: "!text-foreground-500 text-tiny"
|
|
101
141
|
}
|
|
102
142
|
} },
|
|
103
143
|
defaultVariants: { invalid: false }
|
|
@@ -143,8 +183,10 @@ const FieldCard = ({ children, className: _className = void 0, name, ...uniformF
|
|
|
143
183
|
};
|
|
144
184
|
const fieldTouched = getNestedValue(touchedFields, name);
|
|
145
185
|
const hasObjectErrors = !!error?._errors;
|
|
146
|
-
const
|
|
147
|
-
const
|
|
186
|
+
const errorRecord = error;
|
|
187
|
+
const hasChildErrors = hasAnyChildErrors(errorRecord);
|
|
188
|
+
const isAnyChildTouched = hasAnyChildTouched(fieldTouched);
|
|
189
|
+
const className = (0, _fuf_stack_pixel_utils.variantsToClassNames)(fieldCardVariants({ invalid: hasChildErrors && (hasVisibleChildErrors(errorRecord, fieldTouched) || submitCount > 0) || hasObjectErrors && !hasChildErrors && (isAnyChildTouched || submitCount > 0) }), _className, "base");
|
|
148
190
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
149
191
|
className: className.base,
|
|
150
192
|
children: [
|
|
@@ -165,6 +207,8 @@ const FieldCard = ({ children, className: _className = void 0, name, ...uniformF
|
|
|
165
207
|
}),
|
|
166
208
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(FieldCardValidationError_default, {
|
|
167
209
|
className: className.errorFooter,
|
|
210
|
+
error,
|
|
211
|
+
errorTextClassName: className.errorText,
|
|
168
212
|
name
|
|
169
213
|
})
|
|
170
214
|
]
|
|
@@ -185,4 +229,4 @@ Object.defineProperty(exports, 'fieldCardVariants', {
|
|
|
185
229
|
return fieldCardVariants;
|
|
186
230
|
}
|
|
187
231
|
});
|
|
188
|
-
//# sourceMappingURL=FieldCard-
|
|
232
|
+
//# sourceMappingURL=FieldCard-38ZBBWyE.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldCard-38ZBBWyE.cjs","names":["useUniformField","AnimatePresence","motion","FieldValidationError","useUniformField","useFormContext","checkFieldIsRequired","FieldCardValidationError"],"sources":["../src/FieldCard/subcomponents/FieldCardValidationError.tsx","../src/FieldCard/FieldCard.tsx"],"sourcesContent":["import type { FieldError } from 'react-hook-form';\n\nimport {\n AnimatePresence,\n motion,\n useReducedMotion,\n} from '@fuf-stack/pixel-motion';\nimport { cn } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../../hooks/useUniformField';\nimport FieldValidationError from '../../partials/FieldValidationError/FieldValidationError';\n\nexport interface FieldCardValidationErrorProps {\n /** CSS class name for the error footer wrapper */\n className?: string;\n /** Error object from parent FieldCard (passed directly to avoid duplicate hook calls) */\n error?: FieldError[] | undefined;\n /** CSS class name for the error text (controls color based on invalid state) */\n errorTextClassName?: string;\n /** Field name */\n name: string;\n}\n\n/**\n * Renders validation errors in the footer of a FieldCard component.\n *\n * This component handles displaying field-level validation errors with proper\n * accessibility attributes and animates them in/out using Framer Motion.\n *\n * Note: Object-level errors (_errors) are always shown when they exist,\n * but the danger styling is controlled by the parent FieldCard based on\n * whether child fields have been touched.\n */\nconst FieldCardValidationError = ({\n className = undefined,\n error = undefined,\n errorTextClassName = undefined,\n name,\n}: FieldCardValidationErrorProps) => {\n const { getErrorMessageProps, getHelperWrapperProps, testId } =\n useUniformField({\n name,\n });\n\n // disable all animation if user prefers reduced motion\n const disableAnimation = useReducedMotion();\n\n // Always show object-level errors (_errors) when they exist\n // @ts-expect-error - error._errors exists but not typed\n const hasErrors = !!error?._errors;\n\n return (\n <AnimatePresence initial={!disableAnimation}>\n {hasErrors ? (\n <motion.div\n key=\"field-card-errors\"\n exit={disableAnimation ? undefined : { opacity: 0, height: 0 }}\n initial={disableAnimation ? false : { height: 0, opacity: 0 }}\n style={{ overflow: 'hidden' }}\n transition={{ duration: 0.4, ease: 'circOut' }}\n animate={\n disableAnimation ? undefined : { opacity: 1, height: 'auto' }\n }\n >\n <div\n {...getHelperWrapperProps()}\n className={cn(getHelperWrapperProps()?.className, className)}\n >\n <div\n {...getErrorMessageProps()}\n className={cn(\n getErrorMessageProps()?.className,\n errorTextClassName,\n )}\n >\n <FieldValidationError\n // @ts-expect-error - error._errors exists but not typed\n error={error._errors}\n testId={testId}\n />\n </div>\n </div>\n </motion.div>\n ) : null}\n </AnimatePresence>\n );\n};\n\nexport default FieldCardValidationError;\n","import type { TVClassName } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { checkFieldIsRequired, useFormContext } from '../hooks/useFormContext';\nimport { useUniformField } from '../hooks/useUniformField';\nimport FieldCardValidationError from './subcomponents/FieldCardValidationError';\n\n/**\n * Recursively checks if any child field has an error (regardless of touched state).\n * Returns true if at least one child has an error.\n */\nexport const hasAnyChildErrors = (\n errors: Record<string, unknown> | undefined,\n): boolean => {\n if (!errors) {\n return false;\n }\n\n return Object.keys(errors)\n .filter((key) => {\n return key !== '_errors';\n })\n .some((key) => {\n const errorValue = errors[key];\n if (errorValue === undefined) {\n return false;\n }\n // If errorValue is an array, it's a leaf field error\n if (Array.isArray(errorValue)) {\n return true;\n }\n // Recursively check nested objects\n if (typeof errorValue === 'object' && errorValue !== null) {\n return hasAnyChildErrors(errorValue as Record<string, unknown>);\n }\n return false;\n });\n};\n\n/**\n * Recursively checks if any child field is touched.\n * Returns true if at least one child is touched.\n */\nexport const hasAnyChildTouched = (\n touched: Record<string, unknown> | undefined,\n): boolean => {\n if (!touched) {\n return false;\n }\n\n return Object.keys(touched)\n .filter((key) => {\n return key !== '_errors';\n })\n .some((key) => {\n const touchedValue = touched[key];\n if (touchedValue === undefined) {\n return false;\n }\n // If touchedValue is truthy (boolean true), field is touched\n if (touchedValue === true) {\n return true;\n }\n // Recursively check nested objects\n if (typeof touchedValue === 'object' && touchedValue !== null) {\n return hasAnyChildTouched(touchedValue as Record<string, unknown>);\n }\n return false;\n });\n};\n\n/**\n * Recursively checks if any child field with an error is also touched.\n * Returns true if at least one touched child has an error.\n */\nexport const hasVisibleChildErrors = (\n errors: Record<string, unknown> | undefined,\n touched: Record<string, unknown> | undefined,\n): boolean => {\n if (!errors || !touched) {\n return false;\n }\n\n return Object.keys(errors)\n .filter((key) => {\n // Skip object-level errors (_errors) - those are handled separately\n return key !== '_errors';\n })\n .some((key) => {\n const errorValue = errors[key];\n const touchedValue = touched[key];\n\n // If this key doesn't exist in both errors and touched, skip\n if (errorValue === undefined || touchedValue === undefined) {\n return false;\n }\n\n // If errorValue is an array, it's a leaf field error\n if (Array.isArray(errorValue)) {\n // touchedValue being truthy means the field is touched\n return !!touchedValue;\n }\n\n // Recursively check nested objects\n if (typeof errorValue === 'object' && errorValue !== null) {\n return hasVisibleChildErrors(\n errorValue as Record<string, unknown>,\n touchedValue as Record<string, unknown>,\n );\n }\n\n return false;\n });\n};\n\nexport const fieldCardVariants = tv({\n slots: {\n /** base class for the field card wrapper */\n base: [\n // base styles\n 'overflow-hidden rounded-small border bg-content1',\n // animate border color change, respect reduced motion\n 'transition-colors duration-150 motion-reduce:transition-none',\n ],\n /** class for the label/header */\n label: [\n // override HeroUI label positioning and display\n 'pointer-events-auto! static! z-auto! block! w-full!',\n // reset any transforms or translations\n 'translate-x-0! translate-y-0! transform-none!',\n // card header styling - use text-medium (16px) for proper header size\n 'rounded-t-small border-b p-3 font-semibold text-medium',\n // animate border and text color change, respect reduced motion\n 'transition-colors duration-150 motion-reduce:transition-none',\n ],\n /** class for the content */\n content: [\n // same as p-3 of Card component\n 'p-3',\n // default grid for form components (see Grid component)\n 'grid gap-4',\n ],\n /** class for the error footer wrapper */\n errorFooter: [\n 'border-t',\n // force helper to be visible and add padding (pt-1 to compensate for inner content's top padding)\n 'block px-3 pb-2 pt-1',\n // animate border color change, respect reduced motion\n 'transition-colors duration-150 motion-reduce:transition-none',\n ],\n /** class for the error text (empty base, color controlled by variant) */\n errorText: [],\n },\n variants: {\n invalid: {\n true: {\n base: 'border-danger-200',\n label: 'border-danger-200 text-danger',\n errorFooter: 'border-danger-200',\n errorText: '!text-danger text-tiny',\n },\n false: {\n base: 'border-divider',\n label: 'border-divider text-foreground',\n errorFooter: 'border-divider',\n errorText: '!text-foreground-500 text-tiny',\n },\n },\n },\n defaultVariants: {\n invalid: false,\n },\n});\n\ntype ClassName = TVClassName<typeof fieldCardVariants>;\n\nexport interface FieldCardProps {\n /** Content to render inside the card */\n children: ReactNode;\n /** CSS class name */\n className?: ClassName;\n /** Label content for the card header */\n label: ReactNode;\n /** Field name for validation */\n name: string;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * FieldCard component - A card-styled container with label header and error footer\n *\n * Displays form field content in a card layout with:\n * - Label/title in the header\n * - Content in the body\n * - Validation errors in the footer\n * - Danger outline when validation errors exist\n */\nconst FieldCard = ({\n children,\n className: _className = undefined,\n name,\n ...uniformFieldProps\n}: FieldCardProps) => {\n const { error, getLabelProps, label } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n const {\n control,\n formState: { touchedFields, submitCount },\n validation,\n } = useFormContext();\n\n // Check if any registered child field is required\n const validationInstance = validation?.baseInstance ?? validation?.instance;\n const registeredFields: string[] = Array.from(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (control as any)._names?.mount ?? [],\n );\n const childFieldPrefix = `${name}.`;\n const isRequired = validationInstance\n ? registeredFields\n .filter((f) => {\n return f.startsWith(childFieldPrefix);\n })\n .some((f) => {\n return checkFieldIsRequired(\n validationInstance,\n f.split('.').filter((k) => {\n return k !== '';\n }),\n );\n })\n : false;\n\n // Get touched state for this field's children by traversing the path\n const getNestedValue = (\n obj: Record<string, unknown> | undefined,\n path: string,\n ): Record<string, unknown> | undefined => {\n if (!obj) {\n return undefined;\n }\n const keys = path.split('.');\n let current: unknown = obj;\n keys.every((key) => {\n if (current && typeof current === 'object') {\n current = (current as Record<string, unknown>)[key];\n return true;\n }\n current = undefined;\n return false;\n });\n return current as Record<string, unknown> | undefined;\n };\n\n const fieldTouched = getNestedValue(\n touchedFields as Record<string, unknown>,\n name,\n );\n\n // Check for object-level errors (_errors)\n // @ts-expect-error - error._errors exists but not typed\n const hasObjectErrors = !!error?._errors;\n\n const errorRecord = error as unknown as Record<string, unknown>;\n\n // Check if any child field has errors (regardless of touched state)\n const hasChildErrors = hasAnyChildErrors(errorRecord);\n // Check if any child field is touched\n const isAnyChildTouched = hasAnyChildTouched(fieldTouched);\n\n // Show invalid styling (danger border/header/error text) when:\n // 1. Any child field has an error AND (it's touched OR form was submitted), OR\n // 2. Object-level _errors exists AND no child errors AND (any child touched OR submitted)\n const showInvalid =\n (hasChildErrors &&\n (hasVisibleChildErrors(errorRecord, fieldTouched) || submitCount > 0)) ||\n (hasObjectErrors &&\n !hasChildErrors &&\n (isAnyChildTouched || submitCount > 0));\n\n // className from slots\n const variants = fieldCardVariants({ invalid: showInvalid });\n const className = variantsToClassNames(variants, _className, 'base');\n\n return (\n <div className={className.base}>\n {/* card header with label */}\n {label ? (\n <div\n {...getLabelProps()}\n aria-level={3}\n // Override getLabelProps className to use our own invalid styling based on hasErrors,\n // not HeroUI's which is based on any child field being invalid\n className={className.label}\n role=\"heading\"\n >\n {label}\n {/* Manual asterisk: getLabelProps uses schema-required for the object itself,\n but FieldCard needs asterisk based on whether any CHILD field is required */}\n {isRequired ? (\n <span aria-hidden=\"true\" className=\"ml-0.5 text-danger\">\n *\n </span>\n ) : null}\n </div>\n ) : null}\n\n {/* card content */}\n <div className={className.content}>{children}</div>\n\n {/* card footer with validation errors - always show _errors, but danger styling controlled by showInvalid */}\n <FieldCardValidationError\n className={className.errorFooter}\n error={error}\n errorTextClassName={className.errorText}\n name={name}\n />\n </div>\n );\n};\n\nexport default FieldCard;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAiCA,MAAM,4BAA4B,EAChC,YAAY,QACZ,QAAQ,QACR,qBAAqB,QACrB,WACmC;CACnC,MAAM,EAAE,sBAAsB,uBAAuB,WACnDA,wCAAgB,EACd,MACD,CAAC;CAGJ,MAAM,kEAAqC;CAI3C,MAAM,YAAY,CAAC,CAAC,OAAO;AAE3B,QACE,2CAACC;EAAgB,SAAS,CAAC;YACxB,YACC,2CAACC,+BAAO;GAEN,MAAM,mBAAmB,SAAY;IAAE,SAAS;IAAG,QAAQ;IAAG;GAC9D,SAAS,mBAAmB,QAAQ;IAAE,QAAQ;IAAG,SAAS;IAAG;GAC7D,OAAO,EAAE,UAAU,UAAU;GAC7B,YAAY;IAAE,UAAU;IAAK,MAAM;IAAW;GAC9C,SACE,mBAAmB,SAAY;IAAE,SAAS;IAAG,QAAQ;IAAQ;aAG/D,2CAAC;IACC,GAAI,uBAAuB;IAC3B,0CAAc,uBAAuB,EAAE,WAAW,UAAU;cAE5D,2CAAC;KACC,GAAI,sBAAsB;KAC1B,0CACE,sBAAsB,EAAE,WACxB,mBACD;eAED,2CAACC;MAEC,OAAO,MAAM;MACL;OACR;MACE;KACF;KA1BF,oBA2BO,GACX;GACY;;AAItB,uCAAe;;;;;;;;AC3Ef,MAAa,qBACX,WACY;AACZ,KAAI,CAAC,OACH,QAAO;AAGT,QAAO,OAAO,KAAK,OAAO,CACvB,QAAQ,QAAQ;AACf,SAAO,QAAQ;GACf,CACD,MAAM,QAAQ;EACb,MAAM,aAAa,OAAO;AAC1B,MAAI,eAAe,OACjB,QAAO;AAGT,MAAI,MAAM,QAAQ,WAAW,CAC3B,QAAO;AAGT,MAAI,OAAO,eAAe,YAAY,eAAe,KACnD,Q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AI,WAAW,UAAU;IAAU;KAAe;GAGnD,2CAACC;IACC,WAAW,UAAU;IACd;IACP,oBAAoB,UAAU;IACxB;KACN;;GACE;;AAIV,wBAAe"}
|
|
@@ -11,9 +11,13 @@ import { AnimatePresence, motion, useReducedMotion } from "@fuf-stack/pixel-moti
|
|
|
11
11
|
*
|
|
12
12
|
* This component handles displaying field-level validation errors with proper
|
|
13
13
|
* accessibility attributes and animates them in/out using Framer Motion.
|
|
14
|
+
*
|
|
15
|
+
* Note: Object-level errors (_errors) are always shown when they exist,
|
|
16
|
+
* but the danger styling is controlled by the parent FieldCard based on
|
|
17
|
+
* whether child fields have been touched.
|
|
14
18
|
*/
|
|
15
|
-
const FieldCardValidationError = ({ className = void 0, name }) => {
|
|
16
|
-
const {
|
|
19
|
+
const FieldCardValidationError = ({ className = void 0, error = void 0, errorTextClassName = void 0, name }) => {
|
|
20
|
+
const { getErrorMessageProps, getHelperWrapperProps, testId } = useUniformField({ name });
|
|
17
21
|
const disableAnimation = useReducedMotion();
|
|
18
22
|
const hasErrors = !!error?._errors;
|
|
19
23
|
return /* @__PURE__ */ jsx(AnimatePresence, {
|
|
@@ -41,6 +45,7 @@ const FieldCardValidationError = ({ className = void 0, name }) => {
|
|
|
41
45
|
className: cn(getHelperWrapperProps()?.className, className),
|
|
42
46
|
children: /* @__PURE__ */ jsx("div", {
|
|
43
47
|
...getErrorMessageProps(),
|
|
48
|
+
className: cn(getErrorMessageProps()?.className, errorTextClassName),
|
|
44
49
|
children: /* @__PURE__ */ jsx(FieldValidationError_default, {
|
|
45
50
|
error: error._errors,
|
|
46
51
|
testId
|
|
@@ -55,6 +60,38 @@ var FieldCardValidationError_default = FieldCardValidationError;
|
|
|
55
60
|
//#endregion
|
|
56
61
|
//#region src/FieldCard/FieldCard.tsx
|
|
57
62
|
/**
|
|
63
|
+
* Recursively checks if any child field has an error (regardless of touched state).
|
|
64
|
+
* Returns true if at least one child has an error.
|
|
65
|
+
*/
|
|
66
|
+
const hasAnyChildErrors = (errors) => {
|
|
67
|
+
if (!errors) return false;
|
|
68
|
+
return Object.keys(errors).filter((key) => {
|
|
69
|
+
return key !== "_errors";
|
|
70
|
+
}).some((key) => {
|
|
71
|
+
const errorValue = errors[key];
|
|
72
|
+
if (errorValue === void 0) return false;
|
|
73
|
+
if (Array.isArray(errorValue)) return true;
|
|
74
|
+
if (typeof errorValue === "object" && errorValue !== null) return hasAnyChildErrors(errorValue);
|
|
75
|
+
return false;
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Recursively checks if any child field is touched.
|
|
80
|
+
* Returns true if at least one child is touched.
|
|
81
|
+
*/
|
|
82
|
+
const hasAnyChildTouched = (touched) => {
|
|
83
|
+
if (!touched) return false;
|
|
84
|
+
return Object.keys(touched).filter((key) => {
|
|
85
|
+
return key !== "_errors";
|
|
86
|
+
}).some((key) => {
|
|
87
|
+
const touchedValue = touched[key];
|
|
88
|
+
if (touchedValue === void 0) return false;
|
|
89
|
+
if (touchedValue === true) return true;
|
|
90
|
+
if (typeof touchedValue === "object" && touchedValue !== null) return hasAnyChildTouched(touchedValue);
|
|
91
|
+
return false;
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
58
95
|
* Recursively checks if any child field with an error is also touched.
|
|
59
96
|
* Returns true if at least one touched child has an error.
|
|
60
97
|
*/
|
|
@@ -85,18 +122,21 @@ const fieldCardVariants = tv({
|
|
|
85
122
|
"border-t",
|
|
86
123
|
"block px-3 pb-2 pt-1",
|
|
87
124
|
"transition-colors duration-150 motion-reduce:transition-none"
|
|
88
|
-
]
|
|
125
|
+
],
|
|
126
|
+
errorText: []
|
|
89
127
|
},
|
|
90
128
|
variants: { invalid: {
|
|
91
129
|
true: {
|
|
92
130
|
base: "border-danger-200",
|
|
93
131
|
label: "border-danger-200 text-danger",
|
|
94
|
-
errorFooter: "border-danger-200"
|
|
132
|
+
errorFooter: "border-danger-200",
|
|
133
|
+
errorText: "!text-danger text-tiny"
|
|
95
134
|
},
|
|
96
135
|
false: {
|
|
97
136
|
base: "border-divider",
|
|
98
137
|
label: "border-divider text-foreground",
|
|
99
|
-
errorFooter: "border-divider"
|
|
138
|
+
errorFooter: "border-divider",
|
|
139
|
+
errorText: "!text-foreground-500 text-tiny"
|
|
100
140
|
}
|
|
101
141
|
} },
|
|
102
142
|
defaultVariants: { invalid: false }
|
|
@@ -142,8 +182,10 @@ const FieldCard = ({ children, className: _className = void 0, name, ...uniformF
|
|
|
142
182
|
};
|
|
143
183
|
const fieldTouched = getNestedValue(touchedFields, name);
|
|
144
184
|
const hasObjectErrors = !!error?._errors;
|
|
145
|
-
const
|
|
146
|
-
const
|
|
185
|
+
const errorRecord = error;
|
|
186
|
+
const hasChildErrors = hasAnyChildErrors(errorRecord);
|
|
187
|
+
const isAnyChildTouched = hasAnyChildTouched(fieldTouched);
|
|
188
|
+
const className = variantsToClassNames(fieldCardVariants({ invalid: hasChildErrors && (hasVisibleChildErrors(errorRecord, fieldTouched) || submitCount > 0) || hasObjectErrors && !hasChildErrors && (isAnyChildTouched || submitCount > 0) }), _className, "base");
|
|
147
189
|
return /* @__PURE__ */ jsxs("div", {
|
|
148
190
|
className: className.base,
|
|
149
191
|
children: [
|
|
@@ -164,6 +206,8 @@ const FieldCard = ({ children, className: _className = void 0, name, ...uniformF
|
|
|
164
206
|
}),
|
|
165
207
|
/* @__PURE__ */ jsx(FieldCardValidationError_default, {
|
|
166
208
|
className: className.errorFooter,
|
|
209
|
+
error,
|
|
210
|
+
errorTextClassName: className.errorText,
|
|
167
211
|
name
|
|
168
212
|
})
|
|
169
213
|
]
|
|
@@ -173,4 +217,4 @@ var FieldCard_default = FieldCard;
|
|
|
173
217
|
|
|
174
218
|
//#endregion
|
|
175
219
|
export { fieldCardVariants as n, FieldCard_default as t };
|
|
176
|
-
//# sourceMappingURL=FieldCard-
|
|
220
|
+
//# sourceMappingURL=FieldCard-7XiCb6jZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldCard-7XiCb6jZ.js","names":["FieldValidationError","FieldCardValidationError"],"sources":["../src/FieldCard/subcomponents/FieldCardValidationError.tsx","../src/FieldCard/FieldCard.tsx"],"sourcesContent":["import type { FieldError } from 'react-hook-form';\n\nimport {\n AnimatePresence,\n motion,\n useReducedMotion,\n} from '@fuf-stack/pixel-motion';\nimport { cn } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../../hooks/useUniformField';\nimport FieldValidationError from '../../partials/FieldValidationError/FieldValidationError';\n\nexport interface FieldCardValidationErrorProps {\n /** CSS class name for the error footer wrapper */\n className?: string;\n /** Error object from parent FieldCard (passed directly to avoid duplicate hook calls) */\n error?: FieldError[] | undefined;\n /** CSS class name for the error text (controls color based on invalid state) */\n errorTextClassName?: string;\n /** Field name */\n name: string;\n}\n\n/**\n * Renders validation errors in the footer of a FieldCard component.\n *\n * This component handles displaying field-level validation errors with proper\n * accessibility attributes and animates them in/out using Framer Motion.\n *\n * Note: Object-level errors (_errors) are always shown when they exist,\n * but the danger styling is controlled by the parent FieldCard based on\n * whether child fields have been touched.\n */\nconst FieldCardValidationError = ({\n className = undefined,\n error = undefined,\n errorTextClassName = undefined,\n name,\n}: FieldCardValidationErrorProps) => {\n const { getErrorMessageProps, getHelperWrapperProps, testId } =\n useUniformField({\n name,\n });\n\n // disable all animation if user prefers reduced motion\n const disableAnimation = useReducedMotion();\n\n // Always show object-level errors (_errors) when they exist\n // @ts-expect-error - error._errors exists but not typed\n const hasErrors = !!error?._errors;\n\n return (\n <AnimatePresence initial={!disableAnimation}>\n {hasErrors ? (\n <motion.div\n key=\"field-card-errors\"\n exit={disableAnimation ? undefined : { opacity: 0, height: 0 }}\n initial={disableAnimation ? false : { height: 0, opacity: 0 }}\n style={{ overflow: 'hidden' }}\n transition={{ duration: 0.4, ease: 'circOut' }}\n animate={\n disableAnimation ? undefined : { opacity: 1, height: 'auto' }\n }\n >\n <div\n {...getHelperWrapperProps()}\n className={cn(getHelperWrapperProps()?.className, className)}\n >\n <div\n {...getErrorMessageProps()}\n className={cn(\n getErrorMessageProps()?.className,\n errorTextClassName,\n )}\n >\n <FieldValidationError\n // @ts-expect-error - error._errors exists but not typed\n error={error._errors}\n testId={testId}\n />\n </div>\n </div>\n </motion.div>\n ) : null}\n </AnimatePresence>\n );\n};\n\nexport default FieldCardValidationError;\n","import type { TVClassName } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { checkFieldIsRequired, useFormContext } from '../hooks/useFormContext';\nimport { useUniformField } from '../hooks/useUniformField';\nimport FieldCardValidationError from './subcomponents/FieldCardValidationError';\n\n/**\n * Recursively checks if any child field has an error (regardless of touched state).\n * Returns true if at least one child has an error.\n */\nexport const hasAnyChildErrors = (\n errors: Record<string, unknown> | undefined,\n): boolean => {\n if (!errors) {\n return false;\n }\n\n return Object.keys(errors)\n .filter((key) => {\n return key !== '_errors';\n })\n .some((key) => {\n const errorValue = errors[key];\n if (errorValue === undefined) {\n return false;\n }\n // If errorValue is an array, it's a leaf field error\n if (Array.isArray(errorValue)) {\n return true;\n }\n // Recursively check nested objects\n if (typeof errorValue === 'object' && errorValue !== null) {\n return hasAnyChildErrors(errorValue as Record<string, unknown>);\n }\n return false;\n });\n};\n\n/**\n * Recursively checks if any child field is touched.\n * Returns true if at least one child is touched.\n */\nexport const hasAnyChildTouched = (\n touched: Record<string, unknown> | undefined,\n): boolean => {\n if (!touched) {\n return false;\n }\n\n return Object.keys(touched)\n .filter((key) => {\n return key !== '_errors';\n })\n .some((key) => {\n const touchedValue = touched[key];\n if (touchedValue === undefined) {\n return false;\n }\n // If touchedValue is truthy (boolean true), field is touched\n if (touchedValue === true) {\n return true;\n }\n // Recursively check nested objects\n if (typeof touchedValue === 'object' && touchedValue !== null) {\n return hasAnyChildTouched(touchedValue as Record<string, unknown>);\n }\n return false;\n });\n};\n\n/**\n * Recursively checks if any child field with an error is also touched.\n * Returns true if at least one touched child has an error.\n */\nexport const hasVisibleChildErrors = (\n errors: Record<string, unknown> | undefined,\n touched: Record<string, unknown> | undefined,\n): boolean => {\n if (!errors || !touched) {\n return false;\n }\n\n return Object.keys(errors)\n .filter((key) => {\n // Skip object-level errors (_errors) - those are handled separately\n return key !== '_errors';\n })\n .some((key) => {\n const errorValue = errors[key];\n const touchedValue = touched[key];\n\n // If this key doesn't exist in both errors and touched, skip\n if (errorValue === undefined || touchedValue === undefined) {\n return false;\n }\n\n // If errorValue is an array, it's a leaf field error\n if (Array.isArray(errorValue)) {\n // touchedValue being truthy means the field is touched\n return !!touchedValue;\n }\n\n // Recursively check nested objects\n if (typeof errorValue === 'object' && errorValue !== null) {\n return hasVisibleChildErrors(\n errorValue as Record<string, unknown>,\n touchedValue as Record<string, unknown>,\n );\n }\n\n return false;\n });\n};\n\nexport const fieldCardVariants = tv({\n slots: {\n /** base class for the field card wrapper */\n base: [\n // base styles\n 'overflow-hidden rounded-small border bg-content1',\n // animate border color change, respect reduced motion\n 'transition-colors duration-150 motion-reduce:transition-none',\n ],\n /** class for the label/header */\n label: [\n // override HeroUI label positioning and display\n 'pointer-events-auto! static! z-auto! block! w-full!',\n // reset any transforms or translations\n 'translate-x-0! translate-y-0! transform-none!',\n // card header styling - use text-medium (16px) for proper header size\n 'rounded-t-small border-b p-3 font-semibold text-medium',\n // animate border and text color change, respect reduced motion\n 'transition-colors duration-150 motion-reduce:transition-none',\n ],\n /** class for the content */\n content: [\n // same as p-3 of Card component\n 'p-3',\n // default grid for form components (see Grid component)\n 'grid gap-4',\n ],\n /** class for the error footer wrapper */\n errorFooter: [\n 'border-t',\n // force helper to be visible and add padding (pt-1 to compensate for inner content's top padding)\n 'block px-3 pb-2 pt-1',\n // animate border color change, respect reduced motion\n 'transition-colors duration-150 motion-reduce:transition-none',\n ],\n /** class for the error text (empty base, color controlled by variant) */\n errorText: [],\n },\n variants: {\n invalid: {\n true: {\n base: 'border-danger-200',\n label: 'border-danger-200 text-danger',\n errorFooter: 'border-danger-200',\n errorText: '!text-danger text-tiny',\n },\n false: {\n base: 'border-divider',\n label: 'border-divider text-foreground',\n errorFooter: 'border-divider',\n errorText: '!text-foreground-500 text-tiny',\n },\n },\n },\n defaultVariants: {\n invalid: false,\n },\n});\n\ntype ClassName = TVClassName<typeof fieldCardVariants>;\n\nexport interface FieldCardProps {\n /** Content to render inside the card */\n children: ReactNode;\n /** CSS class name */\n className?: ClassName;\n /** Label content for the card header */\n label: ReactNode;\n /** Field name for validation */\n name: string;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * FieldCard component - A card-styled container with label header and error footer\n *\n * Displays form field content in a card layout with:\n * - Label/title in the header\n * - Content in the body\n * - Validation errors in the footer\n * - Danger outline when validation errors exist\n */\nconst FieldCard = ({\n children,\n className: _className = undefined,\n name,\n ...uniformFieldProps\n}: FieldCardProps) => {\n const { error, getLabelProps, label } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n const {\n control,\n formState: { touchedFields, submitCount },\n validation,\n } = useFormContext();\n\n // Check if any registered child field is required\n const validationInstance = validation?.baseInstance ?? validation?.instance;\n const registeredFields: string[] = Array.from(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (control as any)._names?.mount ?? [],\n );\n const childFieldPrefix = `${name}.`;\n const isRequired = validationInstance\n ? registeredFields\n .filter((f) => {\n return f.startsWith(childFieldPrefix);\n })\n .some((f) => {\n return checkFieldIsRequired(\n validationInstance,\n f.split('.').filter((k) => {\n return k !== '';\n }),\n );\n })\n : false;\n\n // Get touched state for this field's children by traversing the path\n const getNestedValue = (\n obj: Record<string, unknown> | undefined,\n path: string,\n ): Record<string, unknown> | undefined => {\n if (!obj) {\n return undefined;\n }\n const keys = path.split('.');\n let current: unknown = obj;\n keys.every((key) => {\n if (current && typeof current === 'object') {\n current = (current as Record<string, unknown>)[key];\n return true;\n }\n current = undefined;\n return false;\n });\n return current as Record<string, unknown> | undefined;\n };\n\n const fieldTouched = getNestedValue(\n touchedFields as Record<string, unknown>,\n name,\n );\n\n // Check for object-level errors (_errors)\n // @ts-expect-error - error._errors exists but not typed\n const hasObjectErrors = !!error?._errors;\n\n const errorRecord = error as unknown as Record<string, unknown>;\n\n // Check if any child field has errors (regardless of touched state)\n const hasChildErrors = hasAnyChildErrors(errorRecord);\n // Check if any child field is touched\n const isAnyChildTouched = hasAnyChildTouched(fieldTouched);\n\n // Show invalid styling (danger border/header/error text) when:\n // 1. Any child field has an error AND (it's touched OR form was submitted), OR\n // 2. Object-level _errors exists AND no child errors AND (any child touched OR submitted)\n const showInvalid =\n (hasChildErrors &&\n (hasVisibleChildErrors(errorRecord, fieldTouched) || submitCount > 0)) ||\n (hasObjectErrors &&\n !hasChildErrors &&\n (isAnyChildTouched || submitCount > 0));\n\n // className from slots\n const variants = fieldCardVariants({ invalid: showInvalid });\n const className = variantsToClassNames(variants, _className, 'base');\n\n return (\n <div className={className.base}>\n {/* card header with label */}\n {label ? (\n <div\n {...getLabelProps()}\n aria-level={3}\n // Override getLabelProps className to use our own invalid styling based on hasErrors,\n // not HeroUI's which is based on any child field being invalid\n className={className.label}\n role=\"heading\"\n >\n {label}\n {/* Manual asterisk: getLabelProps uses schema-required for the object itself,\n but FieldCard needs asterisk based on whether any CHILD field is required */}\n {isRequired ? (\n <span aria-hidden=\"true\" className=\"ml-0.5 text-danger\">\n *\n </span>\n ) : null}\n </div>\n ) : null}\n\n {/* card content */}\n <div className={className.content}>{children}</div>\n\n {/* card footer with validation errors - always show _errors, but danger styling controlled by showInvalid */}\n <FieldCardValidationError\n className={className.errorFooter}\n error={error}\n errorTextClassName={className.errorText}\n name={name}\n />\n </div>\n );\n};\n\nexport default FieldCard;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAiCA,MAAM,4BAA4B,EAChC,YAAY,QACZ,QAAQ,QACR,qBAAqB,QACrB,WACmC;CACnC,MAAM,EAAE,sBAAsB,uBAAuB,WACnD,gBAAgB,EACd,MACD,CAAC;CAGJ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AACb,SAAO,EAAE,WAAW,iBAAiB;GACrC,CACD,MAAM,MAAM;AACX,SAAO,qBACL,oBACA,EAAE,MAAM,IAAI,CAAC,QAAQ,MAAM;AACzB,UAAO,MAAM;IACb,CACH;GACD,GACJ;CAGJ,MAAM,kBACJ,KACA,SACwC;AACxC,MAAI,CAAC,IACH;EAEF,MAAM,OAAO,KAAK,MAAM,IAAI;EAC5B,IAAI,UAAmB;AACvB,OAAK,OAAO,QAAQ;AAClB,OAAI,WAAW,OAAO,YAAY,UAAU;AAC1C,cAAW,QAAoC;AAC/C,WAAO;;AAET,aAAU;AACV,UAAO;IACP;AACF,SAAO;;CAGT,MAAM,eAAe,eACnB,eACA,KACD;CAID,MAAM,kBAAkB,CAAC,CAAC,OAAO;CAEjC,MAAM,cAAc;CAGpB,MAAM,iBAAiB,kBAAkB,YAAY;CAErD,MAAM,oBAAoB,mBAAmB,aAAa;CAc1D,MAAM,YAAY,qBADD,kBAAkB,EAAE,SAPlC,mBACE,sBAAsB,aAAa,aAAa,IAAI,cAAc,MACpE,mBACC,CAAC,mBACA,qBAAqB,cAAc,IAGmB,CAAC,EACX,YAAY,OAAO;AAEpE,QACE,qBAAC;EAAI,WAAW,UAAU;;GAEvB,QACC,qBAAC;IACC,GAAI,eAAe;IACnB,cAAY;IAGZ,WAAW,UAAU;IACrB,MAAK;eAEJ,OAGA,aACC,oBAAC;KAAK,eAAY;KAAO,WAAU;eAAqB;MAEjD,GACL;KACA,GACJ;GAGJ,oBAAC;IAAI,WAAW,UAAU;IAAU;KAAe;GAGnD,oBAACC;IACC,WAAW,UAAU;IACd;IACP,oBAAoB,UAAU;IACxB;KACN;;GACE;;AAIV,wBAAe"}
|
package/dist/Grid/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as GridProps, t as Grid } from "../index-
|
|
1
|
+
import { n as GridProps, t as Grid } from "../index-BW9EUWZE.cjs";
|
|
2
2
|
export { Grid, Grid as default, GridProps };
|
package/dist/Grid/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as GridProps, t as Grid } from "../index-
|
|
1
|
+
import { n as GridProps, t as Grid } from "../index-BFLKkqA3.js";
|
|
2
2
|
export { Grid, Grid as default, GridProps };
|
package/dist/Input/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as InputProps, t as Input } from "../index-
|
|
1
|
+
import { n as InputProps, t as Input } from "../index-DAeb_8Q4.cjs";
|
|
2
2
|
export { Input, Input as default, InputProps };
|
package/dist/Input/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as InputProps, t as Input } from "../index-
|
|
1
|
+
import { n as InputProps, t as Input } from "../index-CB00FCyi.js";
|
|
2
2
|
export { Input, Input as default, InputProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as RadioBoxes, r as RadioBoxesProps, t as radioBoxVariants } from "../index-
|
|
1
|
+
import { n as RadioBoxes, r as RadioBoxesProps, t as radioBoxVariants } from "../index-nVYabHcT.cjs";
|
|
2
2
|
export { RadioBoxes, RadioBoxes as default, RadioBoxesProps, radioBoxVariants };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as RadioBoxes, r as RadioBoxesProps, t as radioBoxVariants } from "../index-
|
|
1
|
+
import { n as RadioBoxes, r as RadioBoxesProps, t as radioBoxVariants } from "../index-Cj-PU3Ck.js";
|
|
2
2
|
export { RadioBoxes, RadioBoxes as default, RadioBoxesProps, radioBoxVariants };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as RadioTabsProps, t as RadioTabs } from "../index-
|
|
1
|
+
import { n as RadioTabsProps, t as RadioTabs } from "../index-C3CvgmJw.js";
|
|
2
2
|
export { RadioTabs, RadioTabs as default, RadioTabsProps };
|
package/dist/Radios/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as RadiosProps, t as Radios } from "../index-
|
|
1
|
+
import { n as RadiosProps, t as Radios } from "../index-BgXr1v45.cjs";
|
|
2
2
|
export { Radios, Radios as default, RadiosProps };
|
package/dist/Radios/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as RadiosProps, t as Radios } from "../index-
|
|
1
|
+
import { n as RadiosProps, t as Radios } from "../index-796vjEop.js";
|
|
2
2
|
export { Radios, Radios as default, RadiosProps };
|
package/dist/Select/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as SelectProps, t as Select } from "../index-
|
|
1
|
+
import { n as SelectProps, t as Select } from "../index-DfGCI-K_.cjs";
|
|
2
2
|
export { Select, Select as default, SelectProps };
|
package/dist/Select/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as SelectProps, t as Select } from "../index-
|
|
1
|
+
import { n as SelectProps, t as Select } from "../index-COwP53Gx.js";
|
|
2
2
|
export { Select, Select as default, SelectProps };
|
package/dist/Slider/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as SliderProps, t as Slider } from "../index-
|
|
1
|
+
import { n as SliderProps, t as Slider } from "../index-CrxSEKKb.cjs";
|
|
2
2
|
export { Slider, Slider as default, SliderProps };
|
package/dist/Slider/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as SliderProps, t as Slider } from "../index-
|
|
1
|
+
import { n as SliderProps, t as Slider } from "../index-DebErIUS.js";
|
|
2
2
|
export { Slider, Slider as default, SliderProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as SubmitButtonProps, t as SubmitButton } from "../index-
|
|
1
|
+
import { n as SubmitButtonProps, t as SubmitButton } from "../index-CbAh0Kfo.cjs";
|
|
2
2
|
export { SubmitButton, SubmitButton as default, SubmitButtonProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as SubmitButtonProps, t as SubmitButton } from "../index-
|
|
1
|
+
import { n as SubmitButtonProps, t as SubmitButton } from "../index-pE9osud2.js";
|
|
2
2
|
export { SubmitButton, SubmitButton as default, SubmitButtonProps };
|
package/dist/Switch/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as SwitchProps, t as Switch } from "../index-
|
|
1
|
+
import { n as SwitchProps, t as Switch } from "../index-D3RMbKbP.cjs";
|
|
2
2
|
export { Switch, Switch as default, SwitchProps };
|
package/dist/Switch/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as SwitchProps, t as Switch } from "../index-
|
|
1
|
+
import { n as SwitchProps, t as Switch } from "../index-DjDR6FpI.js";
|
|
2
2
|
export { Switch, Switch as default, SwitchProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as SwitchBoxProps, r as switchBoxVariants, t as SwitchBox } from "../index-
|
|
1
|
+
import { n as SwitchBoxProps, r as switchBoxVariants, t as SwitchBox } from "../index-BD9y--o2.cjs";
|
|
2
2
|
export { SwitchBox, SwitchBox as default, SwitchBoxProps, switchBoxVariants };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as SwitchBoxProps, r as switchBoxVariants, t as SwitchBox } from "../index-
|
|
1
|
+
import { n as SwitchBoxProps, r as switchBoxVariants, t as SwitchBox } from "../index-B_1td56I.js";
|
|
2
2
|
export { SwitchBox, SwitchBox as default, SwitchBoxProps, switchBoxVariants };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as TextAreaProps, t as TextArea } from "../index-
|
|
1
|
+
import { n as TextAreaProps, t as TextArea } from "../index-Y8XsRdxS.cjs";
|
|
2
2
|
export { TextArea, TextArea as default, TextAreaProps };
|
package/dist/TextArea/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as TextAreaProps, t as TextArea } from "../index-
|
|
1
|
+
import { n as TextAreaProps, t as TextArea } from "../index-B62CWrcm.js";
|
|
2
2
|
export { TextArea, TextArea as default, TextAreaProps };
|