@fuf-stack/uniform 1.18.1 → 1.18.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Checkboxes/index.d.cts +1 -1
- package/dist/Checkboxes/index.d.ts +1 -1
- package/dist/FieldArray/index.cjs +1 -1
- package/dist/FieldArray/index.d.cts +1 -1
- package/dist/FieldArray/index.d.ts +1 -1
- package/dist/FieldArray/index.js +1 -1
- package/dist/{FieldArray-C53ox8yB.js → FieldArray-Bs2ViU8m.js} +2 -2
- package/dist/{FieldArray-C53ox8yB.js.map → FieldArray-Bs2ViU8m.js.map} +1 -1
- package/dist/{FieldArray-BnZW6fwm.cjs → FieldArray-C6RHZcKa.cjs} +2 -2
- package/dist/{FieldArray-BnZW6fwm.cjs.map → FieldArray-C6RHZcKa.cjs.map} +1 -1
- package/dist/FieldCard/index.d.cts +1 -1
- package/dist/FieldCard/index.d.ts +1 -1
- package/dist/Form/index.d.ts +1 -1
- package/dist/Grid/index.cjs +1 -1
- package/dist/Grid/index.d.cts +1 -1
- package/dist/Grid/index.d.ts +1 -1
- package/dist/Grid/index.js +1 -1
- package/dist/{Grid-CeaybCIF.js → Grid-BaqBa1ku.js} +2 -2
- package/dist/{Grid-CeaybCIF.js.map → Grid-BaqBa1ku.js.map} +1 -1
- package/dist/{Grid-CE1fZKmV.cjs → Grid-D5Yf0nD_.cjs} +2 -2
- package/dist/{Grid-CE1fZKmV.cjs.map → Grid-D5Yf0nD_.cjs.map} +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.cts +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.cjs +1 -1
- package/dist/SwitchBox/index.d.cts +1 -1
- package/dist/SwitchBox/index.d.ts +1 -1
- package/dist/SwitchBox/index.js +1 -1
- package/dist/{SwitchBox-RfkVRDrE.js → SwitchBox-C-aLl2nX.js} +3 -3
- package/dist/SwitchBox-C-aLl2nX.js.map +1 -0
- package/dist/{SwitchBox-4G_qcERZ.cjs → SwitchBox-mGUPvJE0.cjs} +2 -2
- package/dist/SwitchBox-mGUPvJE0.cjs.map +1 -0
- package/dist/TextArea/index.d.cts +1 -1
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/helpers/index.d.cts +2 -224
- package/dist/helpers/index.d.ts +2 -224
- 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 +1 -2
- 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 +24 -4
- package/dist/hooks/useWatchUserChange/index.d.cts +1 -1
- package/dist/hooks/useWatchUserChange/index.d.ts +1 -1
- package/dist/{index-DnTLGTto.d.cts → index--KhDRPu3.d.cts} +6 -6
- package/dist/{index-DnTLGTto.d.cts.map → index--KhDRPu3.d.cts.map} +1 -1
- package/dist/{index-56tHDUPW.d.ts → index--NM5Ctp6.d.ts} +3 -3
- package/dist/{index-56tHDUPW.d.ts.map → index--NM5Ctp6.d.ts.map} +1 -1
- package/dist/{index-BcIWb_HA.d.cts → index-B0rp5NJy.d.cts} +35 -35
- package/dist/{index-BcIWb_HA.d.cts.map → index-B0rp5NJy.d.cts.map} +1 -1
- package/dist/{index-1vFxGdcr.d.cts → index-B7Xz_OY2.d.cts} +3 -3
- package/dist/{index-1vFxGdcr.d.cts.map → index-B7Xz_OY2.d.cts.map} +1 -1
- package/dist/index-BBw9RSKy.d.ts +278 -0
- package/dist/{index-C4g84wZ0.d.ts.map → index-BBw9RSKy.d.ts.map} +1 -1
- package/dist/{index-DjMIqLXa.d.cts → index-BKQc5PQn.d.cts} +34 -34
- package/dist/{index-DjMIqLXa.d.cts.map → index-BKQc5PQn.d.cts.map} +1 -1
- package/dist/index-BLgXFM85.d.cts +224 -0
- package/dist/index-BLgXFM85.d.cts.map +1 -0
- package/dist/{index-VMZv9H68.d.ts → index-BaxXDaOZ.d.ts} +35 -35
- package/dist/{index-VMZv9H68.d.ts.map → index-BaxXDaOZ.d.ts.map} +1 -1
- package/dist/{index-C7QJuPM1.d.ts → index-BgyvEfYZ.d.ts} +6 -6
- package/dist/{index-C7QJuPM1.d.ts.map → index-BgyvEfYZ.d.ts.map} +1 -1
- package/dist/{index-C4g84wZ0.d.ts → index-BjHnNRSC.d.cts} +24 -24
- package/dist/{index-DjBVOB0F.d.cts.map → index-BjHnNRSC.d.cts.map} +1 -1
- package/dist/{index-BrLM_gdn.d.ts → index-Bl1Adhfx.d.ts} +6 -6
- package/dist/{index-BrLM_gdn.d.ts.map → index-Bl1Adhfx.d.ts.map} +1 -1
- package/dist/{index-COpH9BHM.d.cts → index-BlJFGN_o.d.ts} +48 -48
- package/dist/{index-ChWpXvB1.d.ts.map → index-BlJFGN_o.d.ts.map} +1 -1
- package/dist/{index-B1zEVRdz.d.cts → index-BlX_mF6D.d.cts} +21 -21
- package/dist/{index-B1zEVRdz.d.cts.map → index-BlX_mF6D.d.cts.map} +1 -1
- package/dist/{index-HWgtCx2X.d.ts → index-BrMk3Wee.d.ts} +4 -4
- package/dist/{index-HWgtCx2X.d.ts.map → index-BrMk3Wee.d.ts.map} +1 -1
- package/dist/{index-ChWpXvB1.d.ts → index-BsCPUK2g.d.cts} +21 -21
- package/dist/{index-COpH9BHM.d.cts.map → index-BsCPUK2g.d.cts.map} +1 -1
- package/dist/{index-DRjS3QTM.d.cts → index-ByyEP8UR.d.cts} +6 -6
- package/dist/{index-DRjS3QTM.d.cts.map → index-ByyEP8UR.d.cts.map} +1 -1
- package/dist/{index-C1orlKvt.d.cts → index-C1-F9Ga-.d.cts} +4 -4
- package/dist/{index-C1orlKvt.d.cts.map → index-C1-F9Ga-.d.cts.map} +1 -1
- package/dist/{index-BvoD161r.d.ts → index-CI0AWMsR.d.ts} +3 -3
- package/dist/{index-BvoD161r.d.ts.map → index-CI0AWMsR.d.ts.map} +1 -1
- package/dist/{index-D_FydW0h.d.ts → index-CMehV9mc.d.ts} +3 -3
- package/dist/index-CMehV9mc.d.ts.map +1 -0
- package/dist/{index-57YREz--.d.ts → index-CPkTYivq.d.ts} +3 -3
- package/dist/{index-57YREz--.d.ts.map → index-CPkTYivq.d.ts.map} +1 -1
- package/dist/{index-BWb9jMoK.d.ts → index-CZq5eXSP.d.ts} +36 -36
- package/dist/{index-BWb9jMoK.d.ts.map → index-CZq5eXSP.d.ts.map} +1 -1
- package/dist/{index-D-_7aN3r.d.cts → index-CeiIXmAI.d.cts} +36 -36
- package/dist/{index-D-_7aN3r.d.cts.map → index-CeiIXmAI.d.cts.map} +1 -1
- package/dist/{index--Q95aXjA.d.cts → index-DFzyOxvt.d.cts} +6 -6
- package/dist/{index--Q95aXjA.d.cts.map → index-DFzyOxvt.d.cts.map} +1 -1
- package/dist/{index-CsRHsuQk.d.cts → index-DLR8z1lG.d.cts} +3 -3
- package/dist/{index-CsRHsuQk.d.cts.map → index-DLR8z1lG.d.cts.map} +1 -1
- package/dist/{index-D4NhWqMK.d.ts → index-DVZCz730.d.ts} +6 -6
- package/dist/{index-D4NhWqMK.d.ts.map → index-DVZCz730.d.ts.map} +1 -1
- package/dist/{index-CC4Mo34g.d.cts → index-Dr06SNZN.d.cts} +4 -4
- package/dist/{index-CC4Mo34g.d.cts.map → index-Dr06SNZN.d.cts.map} +1 -1
- package/dist/{index-BHXJ0Fjv.d.ts → index-Dty4h2eA.d.ts} +4 -4
- package/dist/{index-BHXJ0Fjv.d.ts.map → index-Dty4h2eA.d.ts.map} +1 -1
- package/dist/{index-8RBnWUts.d.ts → index-E6etS7_8.d.ts} +34 -34
- package/dist/{index-8RBnWUts.d.ts.map → index-E6etS7_8.d.ts.map} +1 -1
- package/dist/{index-BMJC2gNu.d.ts → index-TmijvCD0.d.ts} +21 -21
- package/dist/{index-BMJC2gNu.d.ts.map → index-TmijvCD0.d.ts.map} +1 -1
- package/dist/{index-DMoH0fuj.d.cts → index-ahxY6Q0X.d.cts} +3 -3
- package/dist/index-ahxY6Q0X.d.cts.map +1 -0
- package/dist/{index-CZYfqQm4.d.cts → index-mmk9VKYu.d.ts} +21 -21
- package/dist/{index-Dw3yOYt0.d.ts.map → index-mmk9VKYu.d.ts.map} +1 -1
- package/dist/{index-BZ-1C2Da.d.ts → index-qo0Ta_R3.d.cts} +3 -3
- package/dist/{index-B5dB_r7x.d.cts.map → index-qo0Ta_R3.d.cts.map} +1 -1
- package/dist/{index-B5dB_r7x.d.cts → index-ttNINAv3.d.ts} +3 -3
- package/dist/{index-BZ-1C2Da.d.ts.map → index-ttNINAv3.d.ts.map} +1 -1
- package/dist/index-w8E8Koak.d.ts +224 -0
- package/dist/index-w8E8Koak.d.ts.map +1 -0
- package/dist/{index-Dw3yOYt0.d.ts → index-wwmQClW-.d.cts} +21 -21
- package/dist/{index-CZYfqQm4.d.cts.map → index-wwmQClW-.d.cts.map} +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +23 -23
- package/dist/index.d.ts +24 -25
- package/dist/index.js +3 -3
- 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-DxFgfsEI.d.ts → useClientValidation-B4xrGBJZ.d.ts} +3 -3
- package/dist/{useClientValidation-DxFgfsEI.d.ts.map → useClientValidation-B4xrGBJZ.d.ts.map} +1 -1
- package/dist/{useClientValidation-Dw-dmynu.d.cts → useClientValidation-B_dYQB5o.d.cts} +3 -3
- package/dist/{useClientValidation-Dw-dmynu.d.cts.map → useClientValidation-B_dYQB5o.d.cts.map} +1 -1
- package/dist/{useController-DfiNbuEz.d.ts → useController-CHOpoCoz.d.ts} +1 -1
- package/dist/{useController-DfiNbuEz.d.ts.map → useController-CHOpoCoz.d.ts.map} +1 -1
- package/dist/{useController-CvPWE2Sy.d.cts → useController-D8MEXnmB.d.cts} +1 -1
- package/dist/{useController-CvPWE2Sy.d.cts.map → useController-D8MEXnmB.d.cts.map} +1 -1
- package/dist/{useFormContext-B3Vb5-Rg.d.ts → useFormContext-C6OOtqZ5.d.ts} +3 -3
- package/dist/{useFormContext-B3Vb5-Rg.d.ts.map → useFormContext-C6OOtqZ5.d.ts.map} +1 -1
- package/dist/{useFormContext-Da-czmbI.d.cts → useFormContext-Dh97YG47.d.cts} +3 -3
- package/dist/{useFormContext-Da-czmbI.d.cts.map → useFormContext-Dh97YG47.d.cts.map} +1 -1
- package/dist/{useUniformField-DbYTduie.d.ts → useUniformField-BDKjYBKu.d.ts} +3 -3
- package/dist/{useUniformField-DbYTduie.d.ts.map → useUniformField-BDKjYBKu.d.ts.map} +1 -1
- package/dist/{useUniformField-DkD7QHh3.d.cts → useUniformField-Bd_oDkYE.d.cts} +3 -3
- package/dist/{useUniformField-DkD7QHh3.d.cts.map → useUniformField-Bd_oDkYE.d.cts.map} +1 -1
- package/dist/{useUniformFieldArray-CeMjX0vf.d.cts → useUniformFieldArray-CWiaXKO6.d.cts} +3 -3
- package/dist/{useUniformFieldArray-CeMjX0vf.d.cts.map → useUniformFieldArray-CWiaXKO6.d.cts.map} +1 -1
- package/dist/{useUniformFieldArray-14B50iH3.d.ts → useUniformFieldArray-lV3Nbum2.d.ts} +3 -3
- package/dist/{useUniformFieldArray-14B50iH3.d.ts.map → useUniformFieldArray-lV3Nbum2.d.ts.map} +1 -1
- package/dist/{useWatchUserChange-CYd_8zeN.d.ts → useWatchUserChange-BnnrFjyq.d.ts} +1 -1
- package/dist/{useWatchUserChange-CYd_8zeN.d.ts.map → useWatchUserChange-BnnrFjyq.d.ts.map} +1 -1
- package/dist/{useWatchUserChange-DedTNvGV.d.cts → useWatchUserChange-DalJOKBC.d.cts} +1 -1
- package/dist/{useWatchUserChange-DedTNvGV.d.cts.map → useWatchUserChange-DalJOKBC.d.cts.map} +1 -1
- package/package.json +2 -2
- package/dist/SwitchBox-4G_qcERZ.cjs.map +0 -1
- package/dist/SwitchBox-RfkVRDrE.js.map +0 -1
- package/dist/helpers/index.d.cts.map +0 -1
- package/dist/helpers/index.d.ts.map +0 -1
- package/dist/index-D86jXpHS.d.cts +0 -1
- package/dist/index-DMoH0fuj.d.cts.map +0 -1
- package/dist/index-D_FydW0h.d.ts.map +0 -1
- package/dist/index-DjBVOB0F.d.cts +0 -278
- package/dist/index-hIBrhvnj.d.ts +0 -1
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-BBw9RSKy.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-BsCPUK2g.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-BlJFGN_o.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-DLR8z1lG.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-CPkTYivq.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-CeiIXmAI.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-CZq5eXSP.js";
|
|
2
2
|
export { Switch, Switch as default, SwitchProps };
|
package/dist/SwitchBox/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
const require_SwitchBox = require('../SwitchBox-
|
|
2
|
+
const require_SwitchBox = require('../SwitchBox-mGUPvJE0.cjs');
|
|
3
3
|
|
|
4
4
|
exports.SwitchBox = require_SwitchBox.SwitchBox_default$1;
|
|
5
5
|
exports.default = require_SwitchBox.SwitchBox_default;
|
|
@@ -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--KhDRPu3.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-BgyvEfYZ.js";
|
|
2
2
|
export { SwitchBox, SwitchBox as default, SwitchBoxProps, switchBoxVariants };
|
package/dist/SwitchBox/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as SwitchBox_default, r as switchBoxVariants, t as SwitchBox_default$1 } from "../SwitchBox-
|
|
1
|
+
import { n as SwitchBox_default, r as switchBoxVariants, t as SwitchBox_default$1 } from "../SwitchBox-C-aLl2nX.js";
|
|
2
2
|
|
|
3
3
|
export { SwitchBox_default as SwitchBox, SwitchBox_default$1 as default, switchBoxVariants };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as useUniformField } from "./useUniformField-C-Xyu-8v.js";
|
|
2
2
|
import { cn, tv, variantsToClassNames } from "@fuf-stack/pixel-utils";
|
|
3
3
|
import { useRef } from "react";
|
|
4
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { VisuallyHidden } from "@react-aria/visually-hidden";
|
|
6
6
|
import { useSwitch } from "@heroui/switch";
|
|
7
7
|
|
|
@@ -65,7 +65,7 @@ const SwitchBox = ({ className = void 0, description = void 0, icon = void 0, na
|
|
|
65
65
|
isInvalid: invalid,
|
|
66
66
|
size
|
|
67
67
|
}), className, "box");
|
|
68
|
-
return /* @__PURE__ */ jsxs(
|
|
68
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(Component, {
|
|
69
69
|
...getBaseProps(),
|
|
70
70
|
className: classNames.box,
|
|
71
71
|
"data-invalid": invalid,
|
|
@@ -153,4 +153,4 @@ var SwitchBox_default = SwitchBox_default$1;
|
|
|
153
153
|
|
|
154
154
|
//#endregion
|
|
155
155
|
export { SwitchBox_default$1 as n, switchBoxVariants as r, SwitchBox_default as t };
|
|
156
|
-
//# sourceMappingURL=SwitchBox-
|
|
156
|
+
//# sourceMappingURL=SwitchBox-C-aLl2nX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SwitchBox-C-aLl2nX.js","names":["SwitchBox"],"sources":["../src/SwitchBox/SwitchBox.tsx","../src/SwitchBox/index.ts"],"sourcesContent":["import type { TVClassName } from '@fuf-stack/pixel-utils';\nimport type { SwitchProps as HeroSwitchProps } from '@heroui/switch';\nimport type { ReactNode } from 'react';\n\nimport { useRef } from 'react';\n\nimport { useSwitch } from '@heroui/switch';\nimport { VisuallyHidden } from '@react-aria/visually-hidden';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks/useUniformField';\n\nexport const switchBoxVariants = tv({\n slots: {\n box: 'group inline-flex w-full cursor-pointer items-center justify-between rounded-lg border-2 border-default hover:bg-content2 data-[selected=true]:border-focus',\n description: 'text-foreground opacity-70',\n icon: '',\n label:\n 'font-medium text-foreground group-data-[required=true]:after:ml-0.5 group-data-[required=true]:after:text-danger group-data-[required=true]:after:content-[\"*\"]',\n wrapper: '',\n thumb: '',\n thumbIcon: '',\n },\n variants: {\n isDisabled: {\n true: {\n box: 'pointer-events-none opacity-disabled',\n },\n },\n isInvalid: {\n true: {\n box: '!border-danger',\n label: '!text-danger',\n },\n },\n size: {\n sm: {\n box: 'gap-2 p-3',\n description: 'text-xs',\n label: 'text-xs',\n },\n md: {\n box: 'gap-4 p-4',\n description: 'text-small',\n label: 'text-sm',\n },\n lg: {\n box: 'gap-4 p-5',\n description: 'text-small',\n label: 'text-base',\n },\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\ntype ClassName = TVClassName<typeof switchBoxVariants>;\n\nexport interface SwitchBoxProps {\n /** CSS class name */\n className?: ClassName;\n /** Description text displayed below the label */\n description?: ReactNode;\n /** whether the switch should be disabled */\n disabled?: boolean;\n /** Icon to be displayed in the box */\n icon?: ReactNode;\n /** component displayed as the label */\n label?: ReactNode;\n /** name the field is registered under */\n name: string;\n /** whether the field is required */\n required?: boolean;\n /* Size of the switch */\n size?: 'sm' | 'md' | 'lg';\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** Icon to be displayed inside the thumb */\n thumbIcon?: HeroSwitchProps['thumbIcon'];\n}\n\n/**\n * SwitchBox component - A card-like box with a switch control\n */\nconst SwitchBox = ({\n className = undefined,\n description = undefined,\n icon = undefined,\n name,\n size = undefined,\n thumbIcon = undefined,\n ...uniformFieldProps\n}: SwitchBoxProps) => {\n const {\n defaultValue,\n disabled,\n errorMessage,\n field,\n getErrorMessageProps,\n getHelperWrapperProps,\n invalid,\n label,\n onBlur,\n onChange,\n ref,\n required,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // Ref for the visual switch to forward focus\n const visualSwitchRef = useRef<HTMLInputElement>(null);\n\n // Use the useSwitch hook to get access to all the necessary props\n const {\n Component,\n slots,\n isSelected,\n getBaseProps,\n getInputProps,\n getWrapperProps,\n } = useSwitch({\n defaultSelected: !!defaultValue,\n isDisabled: disabled,\n isSelected: !!field.value,\n name: `${name}_switch`,\n onValueChange: onChange,\n size,\n thumbIcon,\n });\n\n // classNames from slots\n const variants = switchBoxVariants({\n isDisabled: disabled,\n isInvalid: invalid,\n size,\n });\n const classNames = variantsToClassNames(variants, className, 'box');\n\n return (\n <>\n <Component\n {...getBaseProps()}\n className={classNames.box}\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n >\n <VisuallyHidden>\n <input\n ref={ref}\n aria-label={typeof label === 'string' ? label : name}\n checked={!!field.value}\n name={name}\n tabIndex={-1}\n type=\"checkbox\"\n onChange={(e) => {\n onChange(e.target.checked);\n }}\n onFocus={() => {\n // When RHF focuses this hidden input (e.g., on validation error),\n // forward focus to the visual switch to show focus ring\n visualSwitchRef.current?.focus();\n }}\n />\n {/* Visual switch input for focus ring */}\n <input\n ref={visualSwitchRef}\n {...getInputProps()}\n onBlur={(e) => {\n // Call HeroUI's internal onBlur to clear focus state and remove focus ring\n getInputProps().onBlur?.(e);\n // Then call RHF's onBlur to mark field as touched\n onBlur();\n }}\n />\n </VisuallyHidden>\n {!icon ? (\n <span\n {...getWrapperProps()}\n className={cn(getWrapperProps().className, classNames.wrapper)}\n >\n <span className={cn(slots.thumb({ class: classNames.thumb }))}>\n {thumbIcon && typeof thumbIcon === 'function'\n ? thumbIcon({\n isSelected: !!isSelected,\n className: slots.thumbIcon({ class: classNames.thumbIcon }),\n width: '1em',\n height: '1em',\n 'data-checked': isSelected ? 'true' : 'false',\n })\n : thumbIcon}\n </span>\n </span>\n ) : null}\n {icon ? <div className={classNames.icon}>{icon}</div> : null}\n <div className=\"grow\">\n {label ? <div className={classNames.label}>{label}</div> : null}\n {description ? (\n <div className={classNames.description}>{description}</div>\n ) : null}\n </div>\n {icon ? (\n <span\n {...getWrapperProps()}\n className={cn(getWrapperProps().className, classNames.wrapper)}\n >\n <span className={cn(slots.thumb({ class: classNames.thumb }))}>\n {thumbIcon && typeof thumbIcon === 'function'\n ? thumbIcon({\n isSelected: !!isSelected,\n className: slots.thumbIcon({ class: classNames.thumbIcon }),\n width: '1em',\n height: '1em',\n 'data-checked': isSelected ? 'true' : 'false',\n })\n : thumbIcon}\n </span>\n </span>\n ) : null}\n </Component>\n {invalid ? (\n <div\n {...getHelperWrapperProps()}\n className={cn(\n getHelperWrapperProps()?.className,\n // force helper to be visible (for some reason it's hidden by default) and remove margin\n 'ml-0 block',\n )}\n >\n <div {...getErrorMessageProps()}>{errorMessage}</div>\n </div>\n ) : null}\n </>\n );\n};\n\nexport default SwitchBox;\n","import SwitchBox from './SwitchBox';\n\nexport type { SwitchBoxProps } from './SwitchBox';\n\nexport { switchBoxVariants } from './SwitchBox';\nexport { SwitchBox };\n\nexport default SwitchBox;\n"],"mappings":"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"}
|
|
@@ -66,7 +66,7 @@ const SwitchBox = ({ className = void 0, description = void 0, icon = void 0, na
|
|
|
66
66
|
isInvalid: invalid,
|
|
67
67
|
size
|
|
68
68
|
}), className, "box");
|
|
69
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
69
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Component, {
|
|
70
70
|
...getBaseProps(),
|
|
71
71
|
className: classNames.box,
|
|
72
72
|
"data-invalid": invalid,
|
|
@@ -171,4 +171,4 @@ Object.defineProperty(exports, 'switchBoxVariants', {
|
|
|
171
171
|
return switchBoxVariants;
|
|
172
172
|
}
|
|
173
173
|
});
|
|
174
|
-
//# sourceMappingURL=SwitchBox-
|
|
174
|
+
//# sourceMappingURL=SwitchBox-mGUPvJE0.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SwitchBox-mGUPvJE0.cjs","names":["useUniformField","VisuallyHidden","SwitchBox"],"sources":["../src/SwitchBox/SwitchBox.tsx","../src/SwitchBox/index.ts"],"sourcesContent":["import type { TVClassName } from '@fuf-stack/pixel-utils';\nimport type { SwitchProps as HeroSwitchProps } from '@heroui/switch';\nimport type { ReactNode } from 'react';\n\nimport { useRef } from 'react';\n\nimport { useSwitch } from '@heroui/switch';\nimport { VisuallyHidden } from '@react-aria/visually-hidden';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks/useUniformField';\n\nexport const switchBoxVariants = tv({\n slots: {\n box: 'group inline-flex w-full cursor-pointer items-center justify-between rounded-lg border-2 border-default hover:bg-content2 data-[selected=true]:border-focus',\n description: 'text-foreground opacity-70',\n icon: '',\n label:\n 'font-medium text-foreground group-data-[required=true]:after:ml-0.5 group-data-[required=true]:after:text-danger group-data-[required=true]:after:content-[\"*\"]',\n wrapper: '',\n thumb: '',\n thumbIcon: '',\n },\n variants: {\n isDisabled: {\n true: {\n box: 'pointer-events-none opacity-disabled',\n },\n },\n isInvalid: {\n true: {\n box: '!border-danger',\n label: '!text-danger',\n },\n },\n size: {\n sm: {\n box: 'gap-2 p-3',\n description: 'text-xs',\n label: 'text-xs',\n },\n md: {\n box: 'gap-4 p-4',\n description: 'text-small',\n label: 'text-sm',\n },\n lg: {\n box: 'gap-4 p-5',\n description: 'text-small',\n label: 'text-base',\n },\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\ntype ClassName = TVClassName<typeof switchBoxVariants>;\n\nexport interface SwitchBoxProps {\n /** CSS class name */\n className?: ClassName;\n /** Description text displayed below the label */\n description?: ReactNode;\n /** whether the switch should be disabled */\n disabled?: boolean;\n /** Icon to be displayed in the box */\n icon?: ReactNode;\n /** component displayed as the label */\n label?: ReactNode;\n /** name the field is registered under */\n name: string;\n /** whether the field is required */\n required?: boolean;\n /* Size of the switch */\n size?: 'sm' | 'md' | 'lg';\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** Icon to be displayed inside the thumb */\n thumbIcon?: HeroSwitchProps['thumbIcon'];\n}\n\n/**\n * SwitchBox component - A card-like box with a switch control\n */\nconst SwitchBox = ({\n className = undefined,\n description = undefined,\n icon = undefined,\n name,\n size = undefined,\n thumbIcon = undefined,\n ...uniformFieldProps\n}: SwitchBoxProps) => {\n const {\n defaultValue,\n disabled,\n errorMessage,\n field,\n getErrorMessageProps,\n getHelperWrapperProps,\n invalid,\n label,\n onBlur,\n onChange,\n ref,\n required,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // Ref for the visual switch to forward focus\n const visualSwitchRef = useRef<HTMLInputElement>(null);\n\n // Use the useSwitch hook to get access to all the necessary props\n const {\n Component,\n slots,\n isSelected,\n getBaseProps,\n getInputProps,\n getWrapperProps,\n } = useSwitch({\n defaultSelected: !!defaultValue,\n isDisabled: disabled,\n isSelected: !!field.value,\n name: `${name}_switch`,\n onValueChange: onChange,\n size,\n thumbIcon,\n });\n\n // classNames from slots\n const variants = switchBoxVariants({\n isDisabled: disabled,\n isInvalid: invalid,\n size,\n });\n const classNames = variantsToClassNames(variants, className, 'box');\n\n return (\n <>\n <Component\n {...getBaseProps()}\n className={classNames.box}\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n >\n <VisuallyHidden>\n <input\n ref={ref}\n aria-label={typeof label === 'string' ? label : name}\n checked={!!field.value}\n name={name}\n tabIndex={-1}\n type=\"checkbox\"\n onChange={(e) => {\n onChange(e.target.checked);\n }}\n onFocus={() => {\n // When RHF focuses this hidden input (e.g., on validation error),\n // forward focus to the visual switch to show focus ring\n visualSwitchRef.current?.focus();\n }}\n />\n {/* Visual switch input for focus ring */}\n <input\n ref={visualSwitchRef}\n {...getInputProps()}\n onBlur={(e) => {\n // Call HeroUI's internal onBlur to clear focus state and remove focus ring\n getInputProps().onBlur?.(e);\n // Then call RHF's onBlur to mark field as touched\n onBlur();\n }}\n />\n </VisuallyHidden>\n {!icon ? (\n <span\n {...getWrapperProps()}\n className={cn(getWrapperProps().className, classNames.wrapper)}\n >\n <span className={cn(slots.thumb({ class: classNames.thumb }))}>\n {thumbIcon && typeof thumbIcon === 'function'\n ? thumbIcon({\n isSelected: !!isSelected,\n className: slots.thumbIcon({ class: classNames.thumbIcon }),\n width: '1em',\n height: '1em',\n 'data-checked': isSelected ? 'true' : 'false',\n })\n : thumbIcon}\n </span>\n </span>\n ) : null}\n {icon ? <div className={classNames.icon}>{icon}</div> : null}\n <div className=\"grow\">\n {label ? <div className={classNames.label}>{label}</div> : null}\n {description ? (\n <div className={classNames.description}>{description}</div>\n ) : null}\n </div>\n {icon ? (\n <span\n {...getWrapperProps()}\n className={cn(getWrapperProps().className, classNames.wrapper)}\n >\n <span className={cn(slots.thumb({ class: classNames.thumb }))}>\n {thumbIcon && typeof thumbIcon === 'function'\n ? thumbIcon({\n isSelected: !!isSelected,\n className: slots.thumbIcon({ class: classNames.thumbIcon }),\n width: '1em',\n height: '1em',\n 'data-checked': isSelected ? 'true' : 'false',\n })\n : thumbIcon}\n </span>\n </span>\n ) : null}\n </Component>\n {invalid ? (\n <div\n {...getHelperWrapperProps()}\n className={cn(\n getHelperWrapperProps()?.className,\n // force helper to be visible (for some reason it's hidden by default) and remove margin\n 'ml-0 block',\n )}\n >\n <div {...getErrorMessageProps()}>{errorMessage}</div>\n </div>\n ) : null}\n </>\n );\n};\n\nexport default SwitchBox;\n","import SwitchBox from './SwitchBox';\n\nexport type { SwitchBoxProps } from './SwitchBox';\n\nexport { switchBoxVariants } from './SwitchBox';\nexport { SwitchBox };\n\nexport default SwitchBox;\n"],"mappings":"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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as TextAreaProps, t as TextArea } from "../index-
|
|
1
|
+
import { n as TextAreaProps, t as TextArea } from "../index-wwmQClW-.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-mmk9VKYu.js";
|
|
2
2
|
export { TextArea, TextArea as default, TextAreaProps };
|
package/dist/helpers/index.d.cts
CHANGED
|
@@ -1,224 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* Creates a converter function that preserves the original type (string, number, or boolean)
|
|
4
|
-
* of option values when converting from string keys back to their original type.
|
|
5
|
-
*
|
|
6
|
-
* This is useful for radio/select components where the underlying UI library
|
|
7
|
-
* uses string keys internally, but we want to preserve number/boolean values in the form state.
|
|
8
|
-
*
|
|
9
|
-
* @param options - Array of options with a value property that can be string, number, or boolean
|
|
10
|
-
* @returns An object with:
|
|
11
|
-
* - `convertToOriginalType`: Function to convert a string key back to its original type
|
|
12
|
-
* - `numberValueKeys`: Set of string representations of number values (for internal use)
|
|
13
|
-
* - `booleanValueKeys`: Map of string representations to boolean values (for internal use)
|
|
14
|
-
*/
|
|
15
|
-
declare const createOptionValueConverter: <T extends {
|
|
16
|
-
value: string | number | boolean;
|
|
17
|
-
}>(options: T[]) => {
|
|
18
|
-
booleanValueKeys: Map<string, boolean>;
|
|
19
|
-
convertToOriginalType: (key: string | number | boolean) => string | number | boolean;
|
|
20
|
-
numberValueKeys: Set<string>;
|
|
21
|
-
};
|
|
22
|
-
//#endregion
|
|
23
|
-
//#region src/helpers/nullishFields/nullishFields.d.ts
|
|
24
|
-
/** Key used to wrap flat array elements when converting to form format */
|
|
25
|
-
declare const flatArrayKey = "__FLAT__";
|
|
26
|
-
/**
|
|
27
|
-
* Checks if a value is considered "empty" for validation display purposes.
|
|
28
|
-
*
|
|
29
|
-
* Used by useUniformField to determine when to show validation errors.
|
|
30
|
-
* Empty values don't trigger immediate error display (user must interact first).
|
|
31
|
-
*
|
|
32
|
-
* Handles:
|
|
33
|
-
* - Primitives: null, undefined, ''
|
|
34
|
-
* - Marker strings: __NULL__, __FALSE__, __ZERO__ (converted via fromNullishString)
|
|
35
|
-
* - Empty arrays: []
|
|
36
|
-
* - Objects with all empty values: {a: null, b: ''}
|
|
37
|
-
* - Flat array wrappers: {__FLAT__: null} or {__FLAT__: ''}
|
|
38
|
-
*
|
|
39
|
-
* @param value - The value to check (will be converted via fromNullishString first)
|
|
40
|
-
* @returns true if the value is empty
|
|
41
|
-
*
|
|
42
|
-
* @example
|
|
43
|
-
* isValueEmpty(null) // true
|
|
44
|
-
* isValueEmpty('') // true
|
|
45
|
-
* isValueEmpty('__NULL__') // true (marker string)
|
|
46
|
-
* isValueEmpty([]) // true (empty array)
|
|
47
|
-
* isValueEmpty({a: null}) // true (object with all empty values)
|
|
48
|
-
* isValueEmpty({__FLAT__: null}) // true (flat array wrapper with empty value)
|
|
49
|
-
* isValueEmpty({__FLAT__: ''}) // true
|
|
50
|
-
* isValueEmpty('hello') // false
|
|
51
|
-
* isValueEmpty([1, 2]) // false
|
|
52
|
-
* isValueEmpty({a: 'value'}) // false
|
|
53
|
-
* isValueEmpty({__FLAT__: 'value'}) // false
|
|
54
|
-
*/
|
|
55
|
-
declare const isValueEmpty: (value: unknown) => boolean;
|
|
56
|
-
/**
|
|
57
|
-
* Converts marker strings back to their original values when processing arrays
|
|
58
|
-
*/
|
|
59
|
-
declare const fromNullishString: (value: unknown) => unknown;
|
|
60
|
-
/**
|
|
61
|
-
* Converts null/falsy values to marker strings for JSON processing
|
|
62
|
-
*/
|
|
63
|
-
declare const toNullishString: (value: unknown) => unknown;
|
|
64
|
-
/**
|
|
65
|
-
* Converts field values to a format suitable for forms by:
|
|
66
|
-
* - Wrapping arrays of primitives as objects using the flatArrayKey `__FLAT__`
|
|
67
|
-
* to satisfy RHF's requirement that array fields contain objects
|
|
68
|
-
* - Removing empty strings and null values from objects
|
|
69
|
-
*
|
|
70
|
-
* This conversion is required because React Hook Form does not support arrays with
|
|
71
|
-
* flat values (string, number, boolean, null). Array fields must contain objects.
|
|
72
|
-
* We work around this by wrapping primitive entries: `{ __FLAT__: <value> }`.
|
|
73
|
-
*
|
|
74
|
-
* @example
|
|
75
|
-
* const fields = {
|
|
76
|
-
* name: 'John',
|
|
77
|
-
* scores: [0, null, 75, false],
|
|
78
|
-
* scoresDetailed: [
|
|
79
|
-
* { score: 1 },
|
|
80
|
-
* { score: null },
|
|
81
|
-
* { score: 0 },
|
|
82
|
-
* { score: false },
|
|
83
|
-
* { score: '' },
|
|
84
|
-
* ],
|
|
85
|
-
* contact: {
|
|
86
|
-
* email: '',
|
|
87
|
-
* phone: null,
|
|
88
|
-
* address: '123 Main St'
|
|
89
|
-
* }
|
|
90
|
-
* };
|
|
91
|
-
*
|
|
92
|
-
* // Result:
|
|
93
|
-
* {
|
|
94
|
-
* name: 'John',
|
|
95
|
-
* scores: [
|
|
96
|
-
* { __FLAT__: 0 },
|
|
97
|
-
* { __FLAT__: null },
|
|
98
|
-
* { __FLAT__: 75 },
|
|
99
|
-
* { __FLAT__: false }
|
|
100
|
-
* ],
|
|
101
|
-
* // Arrays of objects are left as objects; empty/null properties are removed
|
|
102
|
-
* scoresDetailed: [
|
|
103
|
-
* { score: 1 },
|
|
104
|
-
* {}, // null score removed
|
|
105
|
-
* { score: 0 },
|
|
106
|
-
* { score: false },
|
|
107
|
-
* {}, // empty string removed
|
|
108
|
-
* ],
|
|
109
|
-
* contact: {
|
|
110
|
-
* address: '123 Main St'
|
|
111
|
-
* }
|
|
112
|
-
* }
|
|
113
|
-
*/
|
|
114
|
-
declare const toFormFormat: (fields: Record<string, unknown>) => Record<string, unknown>;
|
|
115
|
-
/**
|
|
116
|
-
* Converts form state to a format suitable for validation by:
|
|
117
|
-
* - Unwrapping flat array wrappers `{ __FLAT__: <value> }` back to primitives
|
|
118
|
-
* - Converting legacy string markers (__NULL__, __FALSE__, __ZERO__) back to their original values
|
|
119
|
-
* - Removing fields whose converted value is empty string or null
|
|
120
|
-
* - Removing empty arrays
|
|
121
|
-
*
|
|
122
|
-
* @example
|
|
123
|
-
* const formState = {
|
|
124
|
-
* name: 'John',
|
|
125
|
-
* scores: [
|
|
126
|
-
* { __FLAT__: 75 },
|
|
127
|
-
* { __FLAT__: 0 },
|
|
128
|
-
* { __FLAT__: null },
|
|
129
|
-
* { __FLAT__: false }
|
|
130
|
-
* ],
|
|
131
|
-
* emptyArray: [],
|
|
132
|
-
* scoresDetailed: [
|
|
133
|
-
* { score: 1 },
|
|
134
|
-
* {},
|
|
135
|
-
* { score: 0 },
|
|
136
|
-
* { score: false },
|
|
137
|
-
* {},
|
|
138
|
-
* ],
|
|
139
|
-
* contact: {
|
|
140
|
-
* address: '123 Main St',
|
|
141
|
-
* fax: null
|
|
142
|
-
* }
|
|
143
|
-
* };
|
|
144
|
-
*
|
|
145
|
-
* // Result:
|
|
146
|
-
* {
|
|
147
|
-
* name: 'John',
|
|
148
|
-
* scores: [75, 0, null, false],
|
|
149
|
-
* // emptyArray is removed
|
|
150
|
-
* // Objects inside arrays remain objects; empty entries remain empty objects
|
|
151
|
-
* scoresDetailed: [
|
|
152
|
-
* { score: 1 },
|
|
153
|
-
* {},
|
|
154
|
-
* { score: 0 },
|
|
155
|
-
* { score: false },
|
|
156
|
-
* {},
|
|
157
|
-
* ],
|
|
158
|
-
* contact: {
|
|
159
|
-
* address: '123 Main St'
|
|
160
|
-
* }
|
|
161
|
-
* }
|
|
162
|
-
*/
|
|
163
|
-
declare const toValidationFormat: (formState: Record<string, unknown> | null | undefined) => Record<string, unknown> | null | undefined;
|
|
164
|
-
/**
|
|
165
|
-
* Converts form state to a format suitable for submission by:
|
|
166
|
-
* - Applying all transformations from toValidationFormat
|
|
167
|
-
* - Additionally removing empty objects from the result
|
|
168
|
-
* - Filtering empty objects from arrays
|
|
169
|
-
* - Recursively cleaning nested structures
|
|
170
|
-
*
|
|
171
|
-
* **Why separate from toValidationFormat?**
|
|
172
|
-
*
|
|
173
|
-
* Empty objects must be preserved during validation so that custom refinements
|
|
174
|
-
* can run. For example, a FieldCard with "at least email or phone required"
|
|
175
|
-
* validation needs the object to exist (even if empty) for the refine to execute.
|
|
176
|
-
*
|
|
177
|
-
* However, for submission, empty objects are meaningless and should be removed
|
|
178
|
-
* to produce clean data for APIs.
|
|
179
|
-
*
|
|
180
|
-
* @example
|
|
181
|
-
* const formState = {
|
|
182
|
-
* name: 'John',
|
|
183
|
-
* contact: {}, // Empty FieldCard - will be removed
|
|
184
|
-
* tags: [{}, {}, {}], // All empty - array will be removed
|
|
185
|
-
* items: [
|
|
186
|
-
* { value: 'a' },
|
|
187
|
-
* {}, // Empty entry - will be filtered out
|
|
188
|
-
* { value: 'b' }
|
|
189
|
-
* ],
|
|
190
|
-
* nested: {
|
|
191
|
-
* deep: {} // Nested empty - will be removed recursively
|
|
192
|
-
* }
|
|
193
|
-
* };
|
|
194
|
-
*
|
|
195
|
-
* // Result:
|
|
196
|
-
* {
|
|
197
|
-
* name: 'John',
|
|
198
|
-
* items: [{ value: 'a' }, { value: 'b' }]
|
|
199
|
-
* }
|
|
200
|
-
*/
|
|
201
|
-
declare const toSubmitFormat: (formState: Record<string, unknown> | null | undefined) => Record<string, unknown> | null | undefined;
|
|
202
|
-
/**
|
|
203
|
-
* Converts a field name to a testId by removing flat array key segments and slugifying.
|
|
204
|
-
* Removes all occurrences of `flatArrayKey` from the field name and applies slugify transformation.
|
|
205
|
-
*
|
|
206
|
-
* This is used to generate stable testIds for form fields that don't include
|
|
207
|
-
* the internal `__FLAT__` marker used for flat arrays.
|
|
208
|
-
*
|
|
209
|
-
* @param name - The field name as a string (e.g., 'tags.0.__FLAT__') or array path (e.g., ['tags', '0', '__FLAT__'])
|
|
210
|
-
* @returns The slugified field name with all flat array key segments removed (e.g., 'tags_0')
|
|
211
|
-
*
|
|
212
|
-
* @example
|
|
213
|
-
* ```ts
|
|
214
|
-
* nameToTestId('tags.0.__FLAT__') // => 'tags_0'
|
|
215
|
-
* nameToTestId('array.0.__FLAT__') // => 'array_0'
|
|
216
|
-
* nameToTestId('nested.array.0.__FLAT__.field') // => 'nested_array_0_field'
|
|
217
|
-
* nameToTestId('simple.field') // => 'simple_field'
|
|
218
|
-
* nameToTestId(['tags', '0', '__FLAT__']) // => 'tags_0'
|
|
219
|
-
* ```
|
|
220
|
-
*/
|
|
221
|
-
declare const nameToTestId: (name: string | readonly string[]) => string;
|
|
222
|
-
//#endregion
|
|
223
|
-
export { createOptionValueConverter, flatArrayKey, fromNullishString, isValueEmpty, nameToTestId, toFormFormat, toNullishString, toSubmitFormat, toValidationFormat };
|
|
224
|
-
//# sourceMappingURL=index.d.cts.map
|
|
1
|
+
import { a as toFormFormat, c as toValidationFormat, i as nameToTestId, l as createOptionValueConverter, n as fromNullishString, o as toNullishString, r as isValueEmpty, s as toSubmitFormat, t as flatArrayKey } from "../index-BLgXFM85.cjs";
|
|
2
|
+
export { createOptionValueConverter, flatArrayKey, fromNullishString, isValueEmpty, nameToTestId, toFormFormat, toNullishString, toSubmitFormat, toValidationFormat };
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -1,224 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* Creates a converter function that preserves the original type (string, number, or boolean)
|
|
4
|
-
* of option values when converting from string keys back to their original type.
|
|
5
|
-
*
|
|
6
|
-
* This is useful for radio/select components where the underlying UI library
|
|
7
|
-
* uses string keys internally, but we want to preserve number/boolean values in the form state.
|
|
8
|
-
*
|
|
9
|
-
* @param options - Array of options with a value property that can be string, number, or boolean
|
|
10
|
-
* @returns An object with:
|
|
11
|
-
* - `convertToOriginalType`: Function to convert a string key back to its original type
|
|
12
|
-
* - `numberValueKeys`: Set of string representations of number values (for internal use)
|
|
13
|
-
* - `booleanValueKeys`: Map of string representations to boolean values (for internal use)
|
|
14
|
-
*/
|
|
15
|
-
declare const createOptionValueConverter: <T extends {
|
|
16
|
-
value: string | number | boolean;
|
|
17
|
-
}>(options: T[]) => {
|
|
18
|
-
booleanValueKeys: Map<string, boolean>;
|
|
19
|
-
convertToOriginalType: (key: string | number | boolean) => string | number | boolean;
|
|
20
|
-
numberValueKeys: Set<string>;
|
|
21
|
-
};
|
|
22
|
-
//#endregion
|
|
23
|
-
//#region src/helpers/nullishFields/nullishFields.d.ts
|
|
24
|
-
/** Key used to wrap flat array elements when converting to form format */
|
|
25
|
-
declare const flatArrayKey = "__FLAT__";
|
|
26
|
-
/**
|
|
27
|
-
* Checks if a value is considered "empty" for validation display purposes.
|
|
28
|
-
*
|
|
29
|
-
* Used by useUniformField to determine when to show validation errors.
|
|
30
|
-
* Empty values don't trigger immediate error display (user must interact first).
|
|
31
|
-
*
|
|
32
|
-
* Handles:
|
|
33
|
-
* - Primitives: null, undefined, ''
|
|
34
|
-
* - Marker strings: __NULL__, __FALSE__, __ZERO__ (converted via fromNullishString)
|
|
35
|
-
* - Empty arrays: []
|
|
36
|
-
* - Objects with all empty values: {a: null, b: ''}
|
|
37
|
-
* - Flat array wrappers: {__FLAT__: null} or {__FLAT__: ''}
|
|
38
|
-
*
|
|
39
|
-
* @param value - The value to check (will be converted via fromNullishString first)
|
|
40
|
-
* @returns true if the value is empty
|
|
41
|
-
*
|
|
42
|
-
* @example
|
|
43
|
-
* isValueEmpty(null) // true
|
|
44
|
-
* isValueEmpty('') // true
|
|
45
|
-
* isValueEmpty('__NULL__') // true (marker string)
|
|
46
|
-
* isValueEmpty([]) // true (empty array)
|
|
47
|
-
* isValueEmpty({a: null}) // true (object with all empty values)
|
|
48
|
-
* isValueEmpty({__FLAT__: null}) // true (flat array wrapper with empty value)
|
|
49
|
-
* isValueEmpty({__FLAT__: ''}) // true
|
|
50
|
-
* isValueEmpty('hello') // false
|
|
51
|
-
* isValueEmpty([1, 2]) // false
|
|
52
|
-
* isValueEmpty({a: 'value'}) // false
|
|
53
|
-
* isValueEmpty({__FLAT__: 'value'}) // false
|
|
54
|
-
*/
|
|
55
|
-
declare const isValueEmpty: (value: unknown) => boolean;
|
|
56
|
-
/**
|
|
57
|
-
* Converts marker strings back to their original values when processing arrays
|
|
58
|
-
*/
|
|
59
|
-
declare const fromNullishString: (value: unknown) => unknown;
|
|
60
|
-
/**
|
|
61
|
-
* Converts null/falsy values to marker strings for JSON processing
|
|
62
|
-
*/
|
|
63
|
-
declare const toNullishString: (value: unknown) => unknown;
|
|
64
|
-
/**
|
|
65
|
-
* Converts field values to a format suitable for forms by:
|
|
66
|
-
* - Wrapping arrays of primitives as objects using the flatArrayKey `__FLAT__`
|
|
67
|
-
* to satisfy RHF's requirement that array fields contain objects
|
|
68
|
-
* - Removing empty strings and null values from objects
|
|
69
|
-
*
|
|
70
|
-
* This conversion is required because React Hook Form does not support arrays with
|
|
71
|
-
* flat values (string, number, boolean, null). Array fields must contain objects.
|
|
72
|
-
* We work around this by wrapping primitive entries: `{ __FLAT__: <value> }`.
|
|
73
|
-
*
|
|
74
|
-
* @example
|
|
75
|
-
* const fields = {
|
|
76
|
-
* name: 'John',
|
|
77
|
-
* scores: [0, null, 75, false],
|
|
78
|
-
* scoresDetailed: [
|
|
79
|
-
* { score: 1 },
|
|
80
|
-
* { score: null },
|
|
81
|
-
* { score: 0 },
|
|
82
|
-
* { score: false },
|
|
83
|
-
* { score: '' },
|
|
84
|
-
* ],
|
|
85
|
-
* contact: {
|
|
86
|
-
* email: '',
|
|
87
|
-
* phone: null,
|
|
88
|
-
* address: '123 Main St'
|
|
89
|
-
* }
|
|
90
|
-
* };
|
|
91
|
-
*
|
|
92
|
-
* // Result:
|
|
93
|
-
* {
|
|
94
|
-
* name: 'John',
|
|
95
|
-
* scores: [
|
|
96
|
-
* { __FLAT__: 0 },
|
|
97
|
-
* { __FLAT__: null },
|
|
98
|
-
* { __FLAT__: 75 },
|
|
99
|
-
* { __FLAT__: false }
|
|
100
|
-
* ],
|
|
101
|
-
* // Arrays of objects are left as objects; empty/null properties are removed
|
|
102
|
-
* scoresDetailed: [
|
|
103
|
-
* { score: 1 },
|
|
104
|
-
* {}, // null score removed
|
|
105
|
-
* { score: 0 },
|
|
106
|
-
* { score: false },
|
|
107
|
-
* {}, // empty string removed
|
|
108
|
-
* ],
|
|
109
|
-
* contact: {
|
|
110
|
-
* address: '123 Main St'
|
|
111
|
-
* }
|
|
112
|
-
* }
|
|
113
|
-
*/
|
|
114
|
-
declare const toFormFormat: (fields: Record<string, unknown>) => Record<string, unknown>;
|
|
115
|
-
/**
|
|
116
|
-
* Converts form state to a format suitable for validation by:
|
|
117
|
-
* - Unwrapping flat array wrappers `{ __FLAT__: <value> }` back to primitives
|
|
118
|
-
* - Converting legacy string markers (__NULL__, __FALSE__, __ZERO__) back to their original values
|
|
119
|
-
* - Removing fields whose converted value is empty string or null
|
|
120
|
-
* - Removing empty arrays
|
|
121
|
-
*
|
|
122
|
-
* @example
|
|
123
|
-
* const formState = {
|
|
124
|
-
* name: 'John',
|
|
125
|
-
* scores: [
|
|
126
|
-
* { __FLAT__: 75 },
|
|
127
|
-
* { __FLAT__: 0 },
|
|
128
|
-
* { __FLAT__: null },
|
|
129
|
-
* { __FLAT__: false }
|
|
130
|
-
* ],
|
|
131
|
-
* emptyArray: [],
|
|
132
|
-
* scoresDetailed: [
|
|
133
|
-
* { score: 1 },
|
|
134
|
-
* {},
|
|
135
|
-
* { score: 0 },
|
|
136
|
-
* { score: false },
|
|
137
|
-
* {},
|
|
138
|
-
* ],
|
|
139
|
-
* contact: {
|
|
140
|
-
* address: '123 Main St',
|
|
141
|
-
* fax: null
|
|
142
|
-
* }
|
|
143
|
-
* };
|
|
144
|
-
*
|
|
145
|
-
* // Result:
|
|
146
|
-
* {
|
|
147
|
-
* name: 'John',
|
|
148
|
-
* scores: [75, 0, null, false],
|
|
149
|
-
* // emptyArray is removed
|
|
150
|
-
* // Objects inside arrays remain objects; empty entries remain empty objects
|
|
151
|
-
* scoresDetailed: [
|
|
152
|
-
* { score: 1 },
|
|
153
|
-
* {},
|
|
154
|
-
* { score: 0 },
|
|
155
|
-
* { score: false },
|
|
156
|
-
* {},
|
|
157
|
-
* ],
|
|
158
|
-
* contact: {
|
|
159
|
-
* address: '123 Main St'
|
|
160
|
-
* }
|
|
161
|
-
* }
|
|
162
|
-
*/
|
|
163
|
-
declare const toValidationFormat: (formState: Record<string, unknown> | null | undefined) => Record<string, unknown> | null | undefined;
|
|
164
|
-
/**
|
|
165
|
-
* Converts form state to a format suitable for submission by:
|
|
166
|
-
* - Applying all transformations from toValidationFormat
|
|
167
|
-
* - Additionally removing empty objects from the result
|
|
168
|
-
* - Filtering empty objects from arrays
|
|
169
|
-
* - Recursively cleaning nested structures
|
|
170
|
-
*
|
|
171
|
-
* **Why separate from toValidationFormat?**
|
|
172
|
-
*
|
|
173
|
-
* Empty objects must be preserved during validation so that custom refinements
|
|
174
|
-
* can run. For example, a FieldCard with "at least email or phone required"
|
|
175
|
-
* validation needs the object to exist (even if empty) for the refine to execute.
|
|
176
|
-
*
|
|
177
|
-
* However, for submission, empty objects are meaningless and should be removed
|
|
178
|
-
* to produce clean data for APIs.
|
|
179
|
-
*
|
|
180
|
-
* @example
|
|
181
|
-
* const formState = {
|
|
182
|
-
* name: 'John',
|
|
183
|
-
* contact: {}, // Empty FieldCard - will be removed
|
|
184
|
-
* tags: [{}, {}, {}], // All empty - array will be removed
|
|
185
|
-
* items: [
|
|
186
|
-
* { value: 'a' },
|
|
187
|
-
* {}, // Empty entry - will be filtered out
|
|
188
|
-
* { value: 'b' }
|
|
189
|
-
* ],
|
|
190
|
-
* nested: {
|
|
191
|
-
* deep: {} // Nested empty - will be removed recursively
|
|
192
|
-
* }
|
|
193
|
-
* };
|
|
194
|
-
*
|
|
195
|
-
* // Result:
|
|
196
|
-
* {
|
|
197
|
-
* name: 'John',
|
|
198
|
-
* items: [{ value: 'a' }, { value: 'b' }]
|
|
199
|
-
* }
|
|
200
|
-
*/
|
|
201
|
-
declare const toSubmitFormat: (formState: Record<string, unknown> | null | undefined) => Record<string, unknown> | null | undefined;
|
|
202
|
-
/**
|
|
203
|
-
* Converts a field name to a testId by removing flat array key segments and slugifying.
|
|
204
|
-
* Removes all occurrences of `flatArrayKey` from the field name and applies slugify transformation.
|
|
205
|
-
*
|
|
206
|
-
* This is used to generate stable testIds for form fields that don't include
|
|
207
|
-
* the internal `__FLAT__` marker used for flat arrays.
|
|
208
|
-
*
|
|
209
|
-
* @param name - The field name as a string (e.g., 'tags.0.__FLAT__') or array path (e.g., ['tags', '0', '__FLAT__'])
|
|
210
|
-
* @returns The slugified field name with all flat array key segments removed (e.g., 'tags_0')
|
|
211
|
-
*
|
|
212
|
-
* @example
|
|
213
|
-
* ```ts
|
|
214
|
-
* nameToTestId('tags.0.__FLAT__') // => 'tags_0'
|
|
215
|
-
* nameToTestId('array.0.__FLAT__') // => 'array_0'
|
|
216
|
-
* nameToTestId('nested.array.0.__FLAT__.field') // => 'nested_array_0_field'
|
|
217
|
-
* nameToTestId('simple.field') // => 'simple_field'
|
|
218
|
-
* nameToTestId(['tags', '0', '__FLAT__']) // => 'tags_0'
|
|
219
|
-
* ```
|
|
220
|
-
*/
|
|
221
|
-
declare const nameToTestId: (name: string | readonly string[]) => string;
|
|
222
|
-
//#endregion
|
|
223
|
-
export { createOptionValueConverter, flatArrayKey, fromNullishString, isValueEmpty, nameToTestId, toFormFormat, toNullishString, toSubmitFormat, toValidationFormat };
|
|
224
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
import { a as toFormFormat, c as toValidationFormat, i as nameToTestId, l as createOptionValueConverter, n as fromNullishString, o as toNullishString, r as isValueEmpty, s as toSubmitFormat, t as flatArrayKey } from "../index-w8E8Koak.js";
|
|
2
|
+
export { createOptionValueConverter, flatArrayKey, fromNullishString, isValueEmpty, nameToTestId, toFormFormat, toNullishString, toSubmitFormat, toValidationFormat };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as useClientValidation, t as clientValidationSchemaByName } from "../../useClientValidation-
|
|
1
|
+
import { n as useClientValidation, t as clientValidationSchemaByName } from "../../useClientValidation-B_dYQB5o.cjs";
|
|
2
2
|
export { clientValidationSchemaByName, useClientValidation };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as useClientValidation, t as clientValidationSchemaByName } from "../../useClientValidation-
|
|
1
|
+
import { n as useClientValidation, t as clientValidationSchemaByName } from "../../useClientValidation-B4xrGBJZ.js";
|
|
2
2
|
export { clientValidationSchemaByName, useClientValidation };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as UseControllerReturn, r as useController, t as UseControllerProps } from "../../useController-
|
|
1
|
+
import { n as UseControllerReturn, r as useController, t as UseControllerProps } from "../../useController-D8MEXnmB.cjs";
|
|
2
2
|
export { UseControllerProps, UseControllerReturn, useController };
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { n as UseControllerReturn, r as useController, t as UseControllerProps } from "../../useController-
|
|
2
|
-
import "../../index-hIBrhvnj.js";
|
|
1
|
+
import { n as UseControllerReturn, r as useController, t as UseControllerProps } from "../../useController-CHOpoCoz.js";
|
|
3
2
|
export { UseControllerProps, UseControllerReturn, useController };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as useFormContext, t as checkFieldIsRequired } from "../../useFormContext-
|
|
1
|
+
import { n as useFormContext, t as checkFieldIsRequired } from "../../useFormContext-Dh97YG47.cjs";
|
|
2
2
|
export { checkFieldIsRequired, useFormContext };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../../FormContext-CCe8drkp.js";
|
|
2
|
-
import { n as useFormContext, t as checkFieldIsRequired } from "../../useFormContext-
|
|
2
|
+
import { n as useFormContext, t as checkFieldIsRequired } from "../../useFormContext-C6OOtqZ5.js";
|
|
3
3
|
import "../../index-BMCcWGYS.js";
|
|
4
4
|
export { checkFieldIsRequired, useFormContext };
|