@fuf-stack/uniform 1.5.3 → 1.5.5
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.cjs +3 -3
- package/dist/Checkboxes/index.js +2 -2
- package/dist/FieldArray/index.cjs +3 -3
- package/dist/FieldArray/index.js +2 -2
- package/dist/Form/index.cjs +3 -3
- package/dist/Form/index.js +2 -2
- package/dist/Input/index.cjs +3 -3
- package/dist/Input/index.js +2 -2
- package/dist/RadioBoxes/index.cjs +3 -3
- package/dist/RadioBoxes/index.js +2 -2
- package/dist/RadioTabs/index.cjs +3 -3
- package/dist/RadioTabs/index.js +2 -2
- package/dist/Radios/index.cjs +3 -3
- package/dist/Radios/index.js +2 -2
- package/dist/Select/index.cjs +3 -3
- package/dist/Select/index.js +2 -2
- package/dist/SubmitButton/index.cjs +3 -3
- package/dist/SubmitButton/index.js +2 -2
- package/dist/Switch/index.cjs +3 -3
- package/dist/Switch/index.js +2 -2
- package/dist/TextArea/index.cjs +3 -3
- package/dist/TextArea/index.js +2 -2
- package/dist/{chunk-BOESKBZN.cjs → chunk-263G4JAA.cjs} +49 -54
- package/dist/chunk-263G4JAA.cjs.map +1 -0
- package/dist/{chunk-SUO4QK32.js → chunk-3GAELJ2V.js} +2 -2
- package/dist/{chunk-XZLIDJKA.cjs → chunk-3QUPBPC4.cjs} +3 -3
- package/dist/{chunk-XZLIDJKA.cjs.map → chunk-3QUPBPC4.cjs.map} +1 -1
- package/dist/{chunk-VRFZFKDM.js → chunk-6FZ7EYJV.js} +2 -2
- package/dist/{chunk-CUXVVIWS.cjs → chunk-7WT4JCGS.cjs} +3 -3
- package/dist/{chunk-CUXVVIWS.cjs.map → chunk-7WT4JCGS.cjs.map} +1 -1
- package/dist/{chunk-4DGOOLSO.js → chunk-ASCGKJH2.js} +2 -2
- package/dist/{chunk-4EZWAVRZ.js → chunk-D2JPS3GR.js} +2 -2
- package/dist/{chunk-3FSNNDYZ.cjs → chunk-DBVFPFUE.cjs} +6 -3
- package/dist/chunk-DBVFPFUE.cjs.map +1 -0
- package/dist/{chunk-I6CQH42B.cjs → chunk-DIVVP6PT.cjs} +3 -3
- package/dist/{chunk-I6CQH42B.cjs.map → chunk-DIVVP6PT.cjs.map} +1 -1
- package/dist/{chunk-3MXAIQKI.js → chunk-DSUSI47C.js} +2 -2
- package/dist/{chunk-LZPH7LW5.cjs → chunk-F5UPZGEY.cjs} +5 -5
- package/dist/{chunk-LZPH7LW5.cjs.map → chunk-F5UPZGEY.cjs.map} +1 -1
- package/dist/{chunk-CHG25NCC.js → chunk-HFYNTR6H.js} +2 -2
- package/dist/{chunk-O3DDOJTB.cjs → chunk-HI677N7G.cjs} +90 -6
- package/dist/chunk-HI677N7G.cjs.map +1 -0
- package/dist/{chunk-TED4I5EF.cjs → chunk-IONFOB6T.cjs} +3 -3
- package/dist/{chunk-TED4I5EF.cjs.map → chunk-IONFOB6T.cjs.map} +1 -1
- package/dist/{chunk-KE3ZO2IJ.cjs → chunk-KBWRXYOJ.cjs} +3 -3
- package/dist/{chunk-KE3ZO2IJ.cjs.map → chunk-KBWRXYOJ.cjs.map} +1 -1
- package/dist/{chunk-SU5WXAC7.cjs → chunk-PE5GBKV4.cjs} +4 -4
- package/dist/{chunk-SU5WXAC7.cjs.map → chunk-PE5GBKV4.cjs.map} +1 -1
- package/dist/{chunk-L53NZ7S5.js → chunk-S7WOLTWD.js} +2 -2
- package/dist/{chunk-RNBJT4Y7.cjs → chunk-SMIIVASZ.cjs} +3 -3
- package/dist/{chunk-RNBJT4Y7.cjs.map → chunk-SMIIVASZ.cjs.map} +1 -1
- package/dist/{chunk-2A74CSGX.js → chunk-SUT7AMXT.js} +2 -2
- package/dist/{chunk-Y6NHIZ2M.js → chunk-WVTLXBTO.js} +92 -8
- package/dist/chunk-WVTLXBTO.js.map +1 -0
- package/dist/{chunk-JJDPGGYL.cjs → chunk-XZUDH3I3.cjs} +3 -3
- package/dist/{chunk-JJDPGGYL.cjs.map → chunk-XZUDH3I3.cjs.map} +1 -1
- package/dist/{chunk-TTKSVOSS.js → chunk-Y5Q5CGS3.js} +6 -3
- package/dist/chunk-Y5Q5CGS3.js.map +1 -0
- package/dist/{chunk-BZBA2YGQ.js → chunk-ZAHSRYDI.js} +2 -2
- package/dist/{chunk-CROGVLLB.js → chunk-ZQQUG4OK.js} +53 -58
- package/dist/chunk-ZQQUG4OK.js.map +1 -0
- package/dist/hooks/index.cjs +2 -2
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.cts +69 -5
- package/dist/hooks/index.d.ts +69 -5
- package/dist/hooks/index.js +5 -5
- package/dist/index.cjs +13 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +16 -16
- package/package.json +2 -2
- package/dist/chunk-3FSNNDYZ.cjs.map +0 -1
- package/dist/chunk-BOESKBZN.cjs.map +0 -1
- package/dist/chunk-CROGVLLB.js.map +0 -1
- package/dist/chunk-O3DDOJTB.cjs.map +0 -1
- package/dist/chunk-TTKSVOSS.js.map +0 -1
- package/dist/chunk-Y6NHIZ2M.js.map +0 -1
- /package/dist/{chunk-SUO4QK32.js.map → chunk-3GAELJ2V.js.map} +0 -0
- /package/dist/{chunk-VRFZFKDM.js.map → chunk-6FZ7EYJV.js.map} +0 -0
- /package/dist/{chunk-4DGOOLSO.js.map → chunk-ASCGKJH2.js.map} +0 -0
- /package/dist/{chunk-4EZWAVRZ.js.map → chunk-D2JPS3GR.js.map} +0 -0
- /package/dist/{chunk-3MXAIQKI.js.map → chunk-DSUSI47C.js.map} +0 -0
- /package/dist/{chunk-CHG25NCC.js.map → chunk-HFYNTR6H.js.map} +0 -0
- /package/dist/{chunk-L53NZ7S5.js.map → chunk-S7WOLTWD.js.map} +0 -0
- /package/dist/{chunk-2A74CSGX.js.map → chunk-SUT7AMXT.js.map} +0 -0
- /package/dist/{chunk-BZBA2YGQ.js.map → chunk-ZAHSRYDI.js.map} +0 -0
|
@@ -2,10 +2,9 @@ import {
|
|
|
2
2
|
Grid_default
|
|
3
3
|
} from "./chunk-B62HKKMS.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} from "./chunk-Y6NHIZ2M.js";
|
|
5
|
+
useUniformField,
|
|
6
|
+
useUniformFieldArray
|
|
7
|
+
} from "./chunk-WVTLXBTO.js";
|
|
9
8
|
import {
|
|
10
9
|
FieldValidationError_default
|
|
11
10
|
} from "./chunk-ELYGQTXB.js";
|
|
@@ -19,8 +18,6 @@ import {
|
|
|
19
18
|
} from "./chunk-K2V4ULA2.js";
|
|
20
19
|
|
|
21
20
|
// src/FieldArray/FieldArray.tsx
|
|
22
|
-
import { useEffect, useRef } from "react";
|
|
23
|
-
import { useReducedMotion as useReducedMotion2 } from "@fuf-stack/pixel-motion";
|
|
24
21
|
import { cn as cn8, tv, variantsToClassNames } from "@fuf-stack/pixel-utils";
|
|
25
22
|
|
|
26
23
|
// src/FieldArray/subcomponents/ElementAppendButton.tsx
|
|
@@ -56,7 +53,7 @@ var ElementAppendButton_default = ElementAppendButton;
|
|
|
56
53
|
import { useState } from "react";
|
|
57
54
|
import { useSortable as useSortable2 } from "@dnd-kit/sortable";
|
|
58
55
|
import { CSS } from "@dnd-kit/utilities";
|
|
59
|
-
import { AnimatePresence, motion } from "@fuf-stack/pixel-motion";
|
|
56
|
+
import { AnimatePresence, motion as motion2 } from "@fuf-stack/pixel-motion";
|
|
60
57
|
import { cn as cn5 } from "@fuf-stack/pixel-utils";
|
|
61
58
|
|
|
62
59
|
// src/FieldArray/subcomponents/ElementActionsMenu.tsx
|
|
@@ -132,15 +129,17 @@ var ElementActionsMenu_default = ElementActionsMenu;
|
|
|
132
129
|
|
|
133
130
|
// src/FieldArray/subcomponents/ElementRemoveButton.tsx
|
|
134
131
|
import { FaTimes as FaTimes2 } from "react-icons/fa";
|
|
132
|
+
import { motion } from "@fuf-stack/pixel-motion";
|
|
135
133
|
import { cn as cn3 } from "@fuf-stack/pixel-utils";
|
|
136
134
|
import { Button as Button2 } from "@fuf-stack/pixels";
|
|
137
135
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
138
136
|
var ElementRemoveButton = ({
|
|
139
137
|
className = void 0,
|
|
138
|
+
disableAnimation = false,
|
|
140
139
|
onClick,
|
|
141
140
|
testId = void 0
|
|
142
141
|
}) => {
|
|
143
|
-
|
|
142
|
+
const button = /* @__PURE__ */ jsx3(
|
|
144
143
|
Button2,
|
|
145
144
|
{
|
|
146
145
|
ariaLabel: "remove element",
|
|
@@ -153,6 +152,20 @@ var ElementRemoveButton = ({
|
|
|
153
152
|
variant: "light"
|
|
154
153
|
}
|
|
155
154
|
);
|
|
155
|
+
if (disableAnimation) {
|
|
156
|
+
return button;
|
|
157
|
+
}
|
|
158
|
+
return /* @__PURE__ */ jsx3(
|
|
159
|
+
motion.div,
|
|
160
|
+
{
|
|
161
|
+
animate: { opacity: 1, width: "auto" },
|
|
162
|
+
className: "flex",
|
|
163
|
+
exit: { opacity: 0, width: 0 },
|
|
164
|
+
initial: { opacity: 0, width: 0 },
|
|
165
|
+
transition: { duration: 0.2 },
|
|
166
|
+
children: button
|
|
167
|
+
}
|
|
168
|
+
);
|
|
156
169
|
};
|
|
157
170
|
var ElementRemoveButton_default = ElementRemoveButton;
|
|
158
171
|
|
|
@@ -231,7 +244,7 @@ var FieldArrayElement = ({
|
|
|
231
244
|
methods.remove();
|
|
232
245
|
},
|
|
233
246
|
children: isVisible ? /* @__PURE__ */ jsx5(
|
|
234
|
-
|
|
247
|
+
motion2.li,
|
|
235
248
|
{
|
|
236
249
|
ref: setNodeRef,
|
|
237
250
|
animate: disableAnimation ? void 0 : "visible",
|
|
@@ -277,10 +290,11 @@ var FieldArrayElement = ({
|
|
|
277
290
|
}
|
|
278
291
|
})
|
|
279
292
|
}
|
|
280
|
-
) : /* @__PURE__ */ jsx5(Fragment, { children: lastNotDeletable && fields.length === 1 ? null : /* @__PURE__ */ jsx5(
|
|
293
|
+
) : /* @__PURE__ */ jsx5(Fragment, { children: /* @__PURE__ */ jsx5(AnimatePresence, { initial: false, children: lastNotDeletable && fields.length === 1 ? null : /* @__PURE__ */ jsx5(
|
|
281
294
|
ElementRemoveButton_default,
|
|
282
295
|
{
|
|
283
296
|
className: className.removeButton,
|
|
297
|
+
disableAnimation,
|
|
284
298
|
testId: `${testId}_remove_button`,
|
|
285
299
|
onClick: () => {
|
|
286
300
|
if (disableAnimation) {
|
|
@@ -289,8 +303,9 @@ var FieldArrayElement = ({
|
|
|
289
303
|
setIsVisible(false);
|
|
290
304
|
}
|
|
291
305
|
}
|
|
292
|
-
}
|
|
293
|
-
|
|
306
|
+
},
|
|
307
|
+
"remove-button"
|
|
308
|
+
) }) })
|
|
294
309
|
] })
|
|
295
310
|
},
|
|
296
311
|
id
|
|
@@ -336,7 +351,7 @@ var FieldArrayLabel_default = FieldArrayLabel;
|
|
|
336
351
|
// src/FieldArray/subcomponents/FieldArrayValidationError.tsx
|
|
337
352
|
import {
|
|
338
353
|
AnimatePresence as AnimatePresence2,
|
|
339
|
-
motion as
|
|
354
|
+
motion as motion3,
|
|
340
355
|
useReducedMotion
|
|
341
356
|
} from "@fuf-stack/pixel-motion";
|
|
342
357
|
import { cn as cn7 } from "@fuf-stack/pixel-utils";
|
|
@@ -358,7 +373,7 @@ var FieldArrayValidationError = ({
|
|
|
358
373
|
const disableAnimation = useReducedMotion();
|
|
359
374
|
const hasErrors = invalid && (error == null ? void 0 : error._errors);
|
|
360
375
|
return /* @__PURE__ */ jsx7(AnimatePresence2, { initial: !disableAnimation, children: hasErrors ? /* @__PURE__ */ jsx7(
|
|
361
|
-
|
|
376
|
+
motion3.div,
|
|
362
377
|
{
|
|
363
378
|
exit: disableAnimation ? void 0 : { opacity: 0, height: 0 },
|
|
364
379
|
initial: disableAnimation ? false : { height: 0, opacity: 0 },
|
|
@@ -370,8 +385,8 @@ var FieldArrayValidationError = ({
|
|
|
370
385
|
__spreadProps(__spreadValues({}, getHelperWrapperProps()), {
|
|
371
386
|
className: cn7(
|
|
372
387
|
(_a = getHelperWrapperProps()) == null ? void 0 : _a.className,
|
|
373
|
-
// force helper to be visible (for some reason it's hidden by default) and add padding
|
|
374
|
-
"block
|
|
388
|
+
// force helper to be visible (for some reason it's hidden by default) and add padding
|
|
389
|
+
"block px-3 py-2"
|
|
375
390
|
),
|
|
376
391
|
children: /* @__PURE__ */ jsx7("div", __spreadProps(__spreadValues({}, getErrorMessageProps()), { children: /* @__PURE__ */ jsx7(
|
|
377
392
|
FieldValidationError_default,
|
|
@@ -389,7 +404,7 @@ var FieldArrayValidationError = ({
|
|
|
389
404
|
var FieldArrayValidationError_default = FieldArrayValidationError;
|
|
390
405
|
|
|
391
406
|
// src/FieldArray/subcomponents/SortContext.tsx
|
|
392
|
-
import { useFormContext
|
|
407
|
+
import { useFormContext } from "react-hook-form";
|
|
393
408
|
import {
|
|
394
409
|
closestCenter,
|
|
395
410
|
DndContext,
|
|
@@ -414,7 +429,7 @@ var SortContext = ({
|
|
|
414
429
|
name,
|
|
415
430
|
sortable
|
|
416
431
|
}) => {
|
|
417
|
-
const { trigger } =
|
|
432
|
+
const { trigger } = useFormContext();
|
|
418
433
|
const sensors = useSensors(
|
|
419
434
|
useSensor(PointerSensor),
|
|
420
435
|
useSensor(KeyboardSensor)
|
|
@@ -480,7 +495,7 @@ var fieldArrayVariants = tv({
|
|
|
480
495
|
/** class for the append button */
|
|
481
496
|
appendButton: [
|
|
482
497
|
// base styles
|
|
483
|
-
"w-full rounded-b-small rounded-t-none",
|
|
498
|
+
"w-full justify-start rounded-b-small rounded-t-none font-semibold",
|
|
484
499
|
// match label height (p-3 = 12px vertical padding + text-base line height)
|
|
485
500
|
"!h-[48px] !min-h-0",
|
|
486
501
|
// focus styles - inset ring with rounded bottom corners to match container
|
|
@@ -573,38 +588,23 @@ var FieldArray = (_a) => {
|
|
|
573
588
|
"name",
|
|
574
589
|
"sortable"
|
|
575
590
|
]);
|
|
576
|
-
const {
|
|
591
|
+
const {
|
|
592
|
+
fields,
|
|
593
|
+
append,
|
|
594
|
+
remove,
|
|
595
|
+
insert,
|
|
596
|
+
move,
|
|
597
|
+
disableAnimation,
|
|
598
|
+
elementInitialValue,
|
|
599
|
+
getValues,
|
|
600
|
+
testId
|
|
601
|
+
} = useUniformFieldArray(__spreadValues({
|
|
577
602
|
name,
|
|
603
|
+
flat,
|
|
604
|
+
elementInitialValue: _elementInitialValue,
|
|
605
|
+
lastElementNotRemovable,
|
|
578
606
|
showInvalidWhen: "immediate"
|
|
579
607
|
}, uniformFieldProps));
|
|
580
|
-
const { fields, append, remove, insert, move } = useFieldArray({
|
|
581
|
-
control,
|
|
582
|
-
name
|
|
583
|
-
});
|
|
584
|
-
const { trigger, setValue } = useFormContext();
|
|
585
|
-
useEffect(() => {
|
|
586
|
-
setTimeout(() => {
|
|
587
|
-
trigger(name);
|
|
588
|
-
}, 200);
|
|
589
|
-
}, [fields.length]);
|
|
590
|
-
const elementInitialValue = flat ? { [flatArrayKey]: _elementInitialValue != null ? _elementInitialValue : null } : _elementInitialValue != null ? _elementInitialValue : {};
|
|
591
|
-
useEffect(
|
|
592
|
-
() => {
|
|
593
|
-
if (lastElementNotRemovable && fields.length === 0) {
|
|
594
|
-
setValue(name, [elementInitialValue]);
|
|
595
|
-
}
|
|
596
|
-
},
|
|
597
|
-
// only run once when the component mounts
|
|
598
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
599
|
-
[]
|
|
600
|
-
);
|
|
601
|
-
const prefersReducedMotion = useReducedMotion2();
|
|
602
|
-
const disableAnimationRef = useRef(true);
|
|
603
|
-
useEffect(() => {
|
|
604
|
-
if (!prefersReducedMotion) {
|
|
605
|
-
disableAnimationRef.current = false;
|
|
606
|
-
}
|
|
607
|
-
}, [prefersReducedMotion]);
|
|
608
608
|
const variants = fieldArrayVariants({ hasLabel: !!uniformFieldProps.label });
|
|
609
609
|
const className = variantsToClassNames(variants, _className, "base");
|
|
610
610
|
return /* @__PURE__ */ jsxs3("div", { className: className.base, children: [
|
|
@@ -649,7 +649,7 @@ var FieldArray = (_a) => {
|
|
|
649
649
|
FieldArrayElement_default,
|
|
650
650
|
{
|
|
651
651
|
className,
|
|
652
|
-
disableAnimation
|
|
652
|
+
disableAnimation,
|
|
653
653
|
duplicate,
|
|
654
654
|
elementMarginBottom,
|
|
655
655
|
fields,
|
|
@@ -674,23 +674,18 @@ var FieldArray = (_a) => {
|
|
|
674
674
|
}
|
|
675
675
|
) })
|
|
676
676
|
) : null,
|
|
677
|
+
/* @__PURE__ */ jsx9(FieldArrayValidationError_default, { name }),
|
|
677
678
|
/* @__PURE__ */ jsx9(
|
|
678
679
|
ElementAppendButton_default,
|
|
679
680
|
{
|
|
680
681
|
appendButtonText,
|
|
682
|
+
className: className.appendButton,
|
|
681
683
|
testId: `${testId}_append_button`,
|
|
682
|
-
className: cn8(
|
|
683
|
-
className.appendButton,
|
|
684
|
-
// only round bottom corners if there are no errors below
|
|
685
|
-
// @ts-expect-error - error._errors exists but not typed
|
|
686
|
-
{ "rounded-none": invalid && (error == null ? void 0 : error._errors) }
|
|
687
|
-
),
|
|
688
684
|
onClick: () => {
|
|
689
685
|
append(elementInitialValue);
|
|
690
686
|
}
|
|
691
687
|
}
|
|
692
|
-
)
|
|
693
|
-
/* @__PURE__ */ jsx9(FieldArrayValidationError_default, { name })
|
|
688
|
+
)
|
|
694
689
|
] });
|
|
695
690
|
};
|
|
696
691
|
var FieldArray_default = FieldArray;
|
|
@@ -702,4 +697,4 @@ export {
|
|
|
702
697
|
FieldArray_default,
|
|
703
698
|
FieldArray_default2
|
|
704
699
|
};
|
|
705
|
-
//# sourceMappingURL=chunk-
|
|
700
|
+
//# sourceMappingURL=chunk-ZQQUG4OK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/FieldArray/FieldArray.tsx","../src/FieldArray/subcomponents/ElementAppendButton.tsx","../src/FieldArray/subcomponents/FieldArrayElement.tsx","../src/FieldArray/subcomponents/ElementActionsMenu.tsx","../src/FieldArray/subcomponents/ElementRemoveButton.tsx","../src/FieldArray/subcomponents/SortDragHandle.tsx","../src/FieldArray/subcomponents/FieldArrayLabel.tsx","../src/FieldArray/subcomponents/FieldArrayValidationError.tsx","../src/FieldArray/subcomponents/SortContext.tsx","../src/FieldArray/index.ts"],"sourcesContent":["import type { FieldArrayElementMethods } from './subcomponents/FieldArrayElement';\nimport type { FieldArrayProps } from './types';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { flatArrayKey } from '../helpers';\nimport { useUniformFieldArray } from '../hooks/useUniformFieldArray/useUniformFieldArray';\nimport ElementAppendButton from './subcomponents/ElementAppendButton';\nimport FieldArrayElement from './subcomponents/FieldArrayElement';\nimport FieldArrayLabel from './subcomponents/FieldArrayLabel';\nimport FieldArrayValidationError from './subcomponents/FieldArrayValidationError';\nimport SortContext from './subcomponents/SortContext';\n\nexport const fieldArrayVariants = tv({\n slots: {\n /** base class for the field array wrapper */\n base: [\n // base styles\n 'overflow-hidden rounded-small border border-divider bg-content1',\n // divider between items\n 'divide-y divide-divider',\n ],\n /** class for the actions menu button */\n actionsMenuButton: [\n // base styles\n 'flex items-center justify-center text-default-600',\n // fixed height/no round corners/center align\n 'h-full rounded-none',\n // focus styles - inset ring\n 'outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus',\n ],\n /** class for the append button */\n appendButton: [\n // base styles\n 'w-full justify-start rounded-b-small rounded-t-none font-semibold',\n // match label height (p-3 = 12px vertical padding + text-base line height)\n '!h-[48px] !min-h-0',\n // focus styles - inset ring with rounded bottom corners to match container\n 'outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus',\n ],\n /** class for the element fields grid */\n elementFieldsGrid: ['w-full grow p-3'],\n /** class for the label */\n label: [\n // override HeroUI label positioning and display\n 'pointer-events-auto! static! z-auto! block! w-full!',\n // reset any transforms or translations\n 'translate-x-0! translate-y-0! transform-none!',\n // card header styling - use text-medium (16px) instead of text-base for correct 48px height\n 'rounded-t-small p-3 font-semibold text-medium',\n ],\n /** class for the list */\n list: ['overflow-hidden'],\n /** class for the list wrapper */\n listWrapper: ['overflow-hidden'],\n /** class for the list item (performs motion animations) */\n listItem: [\n // base styles\n 'group relative flex flex-row',\n // overlap borders by shifting first item up 1px (similar to how last item overlaps with append button)\n 'first:-mt-px',\n ],\n /** class for the list item inner */\n listItemInner: [\n // base styles\n 'flex w-full flex-row items-stretch divide-divider bg-content1',\n // x division and borders\n 'divide-x divide-solid border-b border-t border-divider',\n ],\n /** class for the remove button */\n removeButton: [\n // base styles\n 'flex items-center justify-center',\n // fixed height/no round corners\n '!h-full !min-h-0 !rounded-none px-3',\n // focus styles - inset ring\n 'outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus',\n ],\n /** class for the sort drag handle */\n sortDragHandle: [\n // base styles\n 'flex cursor-grab items-center justify-center px-2 text-default-600 transition-colors',\n // hover and dragging state\n 'hover:bg-default-100 active:cursor-grabbing group-data-[dragging=true]:bg-default-100',\n // focus styles - inset ring\n 'outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus',\n ],\n },\n variants: {\n hasLabel: {\n false: {\n // focus styles - when there is no label, the first item actions menu button should have rounded top right corners\n actionsMenuButton:\n 'group-[:first-child]:!rounded-tr-small group-[:first-child]:group-data-[dragging=true]:!rounded-tr-none',\n // focus styles - when there is no label, the first item remove button focus ring should have rounded top right corners\n removeButton:\n 'group-[:first-child]:!rounded-tr-small group-[:first-child]:group-data-[dragging=true]:!rounded-tr-none',\n // focus styles - when there is no label, the first item sort drag handle focus ring should have rounded top left corners\n sortDragHandle:\n 'group-[:first-child]:rounded-tl-small group-[:first-child]:group-data-[dragging=true]:rounded-tl-none',\n },\n },\n },\n});\n\n/**\n * FieldArray component based in [RHF useFieldArray](https://react-hook-form.com/docs/usefieldarray)\n */\nconst FieldArray = ({\n appendButtonText = 'Add Element',\n children,\n className: _className = undefined,\n duplicate = false,\n elementInitialValue: _elementInitialValue = null,\n elementMarginBottom = undefined,\n flat = false,\n insertAfter = false,\n lastElementNotRemovable = false,\n name,\n sortable = false,\n ...uniformFieldProps\n}: FieldArrayProps) => {\n const {\n fields,\n append,\n remove,\n insert,\n move,\n disableAnimation,\n elementInitialValue,\n getValues,\n testId,\n } = useUniformFieldArray({\n name,\n flat,\n elementInitialValue: _elementInitialValue,\n lastElementNotRemovable,\n showInvalidWhen: 'immediate',\n ...uniformFieldProps,\n });\n\n // className from slots\n const variants = fieldArrayVariants({ hasLabel: !!uniformFieldProps.label });\n const className = variantsToClassNames(variants, _className, 'base');\n\n return (\n <div className={className.base}>\n {/* field array label */}\n <FieldArrayLabel\n className={className.label}\n label={uniformFieldProps.label}\n name={name}\n />\n\n {fields.length ? (\n /* list wrapper */\n <div className={cn(className.listWrapper)}>\n {/* sortable context */}\n <SortContext\n fields={fields}\n move={move}\n name={name}\n sortable={sortable}\n >\n {/* list container */}\n <ul className={className.list} data-testid={testId}>\n {/* fields / list elements */}\n {fields.map((field, index) => {\n const elementName = flat\n ? `${name}.${index}.${flatArrayKey}`\n : `${name}.${index}`;\n const elementTestId = `${testId}_${index}`;\n\n // create methods for element\n const elementMethods: FieldArrayElementMethods = {\n append: () => {\n append(elementInitialValue);\n },\n duplicate: () => {\n const values = getValues(name);\n const currentValue = (values as unknown[])[index];\n const nextValue = flat\n ? { [flatArrayKey]: currentValue }\n : currentValue;\n insert(index + 1, nextValue);\n },\n insert: () => {\n insert(index + 1, elementInitialValue);\n },\n remove: () => {\n remove(index);\n },\n };\n\n return (\n <FieldArrayElement\n key={field.id}\n className={className}\n disableAnimation={disableAnimation}\n duplicate={duplicate}\n elementMarginBottom={elementMarginBottom}\n fields={fields}\n id={field.id}\n index={index}\n insertAfter={insertAfter}\n lastNotDeletable={lastElementNotRemovable}\n methods={elementMethods}\n sortable={sortable}\n testId={elementTestId}\n >\n {children({\n index,\n length: fields.length,\n methods: elementMethods,\n name: elementName,\n testId: elementTestId,\n })}\n </FieldArrayElement>\n );\n })}\n </ul>\n </SortContext>\n </div>\n ) : null}\n\n {/* top level field array errors */}\n <FieldArrayValidationError name={name} />\n\n {/* append elements button */}\n <ElementAppendButton\n appendButtonText={appendButtonText}\n className={className.appendButton}\n testId={`${testId}_append_button`}\n onClick={() => {\n append(elementInitialValue);\n }}\n />\n </div>\n );\n};\n\nexport default FieldArray;\n","import type { ClassValue } from '@fuf-stack/pixel-utils';\n\nimport { FaPlus } from 'react-icons/fa';\n\nimport { cn } from '@fuf-stack/pixel-utils';\nimport { Button } from '@fuf-stack/pixels';\n\ninterface ElementAppendButtonProps {\n /** text of the append element button */\n appendButtonText?: string;\n /** CSS class name */\n className?: ClassValue;\n /** click handler */\n onClick: () => void;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\nconst ElementAppendButton = ({\n appendButtonText = 'Add Element',\n className = undefined,\n onClick,\n testId = undefined,\n}: ElementAppendButtonProps) => {\n return (\n <Button\n disableAnimation\n className={cn(className)}\n onClick={onClick}\n size=\"sm\"\n testId={testId}\n variant=\"light\"\n >\n <FaPlus />\n <span>{appendButtonText}</span>\n </Button>\n );\n};\n\nexport default ElementAppendButton;\n","import type { Variants as MotionVariants } from '@fuf-stack/pixel-motion';\nimport type { ClassValue } from '@fuf-stack/pixel-utils';\nimport type { FieldArrayFeatures } from '../types';\n\nimport { useState } from 'react';\n\nimport { useSortable } from '@dnd-kit/sortable';\nimport { CSS } from '@dnd-kit/utilities';\n\nimport { AnimatePresence, motion } from '@fuf-stack/pixel-motion';\nimport { cn } from '@fuf-stack/pixel-utils';\n\nimport { Grid } from '../../Grid';\nimport ElementActionsMenu from './ElementActionsMenu';\nimport ElementRemoveButton from './ElementRemoveButton';\nimport SortDragHandle from './SortDragHandle';\n\nexport interface FieldArrayElementMethods {\n /** Add new element at end */\n append: () => void;\n /** Clone current element */\n duplicate: () => void;\n /** Add new element after current */\n insert: () => void;\n /** Remove current element */\n remove: () => void;\n}\n\ninterface FieldArrayElementProps extends FieldArrayFeatures {\n /** Form elements to render inside array element */\n children: React.ReactNode;\n /** CSS class names for component parts */\n className: {\n /** Class of wrapper grid inside the li that wraps the rendered element fields directly */\n elementFieldsGrid?: ClassValue;\n /** Class for the li (performs motion animations) */\n listItem?: ClassValue;\n /** Class for the li inner div (wraps the rendered element fields) */\n listItemInner?: ClassValue;\n /** Class for the actions menu button */\n actionsMenuButton?: ClassValue;\n /** Class for the remove element button (when menu is not used) */\n removeButton?: ClassValue;\n /** Class for the drag handle when sorting enabled */\n sortDragHandle?: ClassValue;\n };\n /** Globally disable animations for this item (used for first render or prefers-reduced-motion) */\n disableAnimation?: boolean;\n /** Bottom margin for elements (for backwards compatibility) */\n elementMarginBottom?: React.CSSProperties['marginBottom'];\n /** All fields in the form array */\n fields: Record<'id', string>[];\n /** Unique identifier for drag/drop */\n id: string | number;\n /** Field index in array */\n index: number;\n /** Prevent deletion of last remaining element */\n lastNotDeletable?: boolean;\n /** Field array operation methods */\n methods: FieldArrayElementMethods;\n /** HTML data-testid of the element */\n testId?: string;\n}\n\n/**\n * Form array element component using react-hook-form with drag-drop sorting\n * and validation capabilities. Animations when elements are added or removed\n * improve the user experience and provide a better visual feedback.\n */\nconst FieldArrayElement = ({\n children,\n className,\n disableAnimation = false,\n duplicate = false,\n elementMarginBottom: _elementMarginBottom = undefined,\n fields,\n id,\n index: _index,\n insertAfter = false,\n lastNotDeletable = true,\n methods,\n sortable = false,\n testId = undefined,\n}: FieldArrayElementProps) => {\n // Apply transform styles when sortable is enabled for smooth drag animations\n // transform: handles the item's position during drag\n // transition: controls the animation timing when dropping\n const { setNodeRef, transform, transition, isDragging } = useSortable({ id });\n const sortingStyle = sortable\n ? {\n transform: CSS.Translate.toString(transform),\n transition,\n zIndex: isDragging ? 50 : undefined,\n }\n : undefined;\n\n // Local visibility to allow exit animation before removing from RHF state\n const [isVisible, setIsVisible] = useState(true);\n\n // Motion variants for the list item\n const listItemMotionVariants: MotionVariants = {\n hidden: { opacity: 0, height: 0, marginBottom: 0 },\n visible: {\n opacity: 1,\n height: 'auto',\n transition: { duration: 0.2, ease: 'circOut' },\n // push last visible item down to overlap with append button (hide double border)\n marginBottom: '-1px',\n },\n exit: {\n opacity: 0,\n height: 0,\n marginBottom: 0,\n transition: {\n // on exit first fade out, then shrink\n opacity: { duration: 0.1, ease: 'circOut' },\n height: { delay: 0.1, duration: 0.2, ease: 'circOut' },\n },\n },\n };\n\n // Height animation handled on <motion.li> using overflow hidden\n return (\n <AnimatePresence\n mode=\"wait\"\n // remove from RHF state after exit animation\n onExitComplete={() => {\n methods.remove();\n }}\n >\n {isVisible ? (\n <motion.li\n key={id}\n ref={setNodeRef}\n animate={disableAnimation ? undefined : 'visible'}\n className={cn(className.listItem)}\n data-dragging={isDragging}\n data-testid={`${testId}_element`}\n exit={disableAnimation ? undefined : 'exit'}\n initial={disableAnimation ? false : 'hidden'}\n style={sortingStyle}\n variants={disableAnimation ? undefined : listItemMotionVariants}\n >\n <div className={cn(className.listItemInner)}>\n {/** sorting drag handle */}\n {sortable ? (\n <SortDragHandle\n className={className.sortDragHandle}\n id={id}\n testId={`${testId}_sort_drag_handle`}\n />\n ) : null}\n\n {/** render element fields in Grid component */}\n <Grid\n className={cn(className.elementFieldsGrid)}\n testId={`${testId}_element_fields_grid`}\n >\n {/* render actual fields */}\n {children}\n </Grid>\n\n {/** actions menu when duplicate or insertAfter is enabled */}\n {duplicate || insertAfter ? (\n <ElementActionsMenu\n className={className.actionsMenuButton}\n duplicate={duplicate}\n insertAfter={insertAfter}\n showRemove={!(lastNotDeletable && fields.length === 1)}\n testId={`${testId}_actions_menu`}\n methods={{\n ...methods,\n remove: () => {\n if (disableAnimation) {\n methods.remove();\n } else {\n setIsVisible(false);\n }\n },\n }}\n />\n ) : (\n <>\n {/** remove element button (when menu is not used) */}\n <AnimatePresence initial={false}>\n {lastNotDeletable && fields.length === 1 ? null : (\n <ElementRemoveButton\n key=\"remove-button\"\n className={className.removeButton}\n disableAnimation={disableAnimation}\n testId={`${testId}_remove_button`}\n onClick={() => {\n if (disableAnimation) {\n methods.remove();\n } else {\n setIsVisible(false);\n }\n }}\n />\n )}\n </AnimatePresence>\n </>\n )}\n </div>\n </motion.li>\n ) : null}\n </AnimatePresence>\n );\n};\n\nexport default FieldArrayElement;\n","import type { ClassValue } from '@fuf-stack/pixel-utils';\nimport type { MenuItem } from '@fuf-stack/pixels';\nimport type { Key } from 'react';\nimport type { FieldArrayElementMethods } from './FieldArrayElement';\n\nimport { FaCopy, FaTimes } from 'react-icons/fa';\nimport { VscInsert } from 'react-icons/vsc';\n\nimport { cn } from '@fuf-stack/pixel-utils';\nimport { Menu } from '@fuf-stack/pixels';\n\nexport interface ElementActionsMenuProps {\n /** CSS class name */\n className?: ClassValue;\n /** Whether duplicate action is available */\n duplicate?: boolean;\n /** Whether insert after action is available */\n insertAfter?: boolean;\n /** Whether to show remove button (false when last element is not deletable) */\n showRemove?: boolean;\n /** Field array operation methods */\n methods: FieldArrayElementMethods;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * Menu component for field array element actions (remove, duplicate, insert after)\n */\nconst ElementActionsMenu = ({\n className = undefined,\n duplicate = false,\n insertAfter = false,\n showRemove = true,\n methods,\n testId = undefined,\n}: ElementActionsMenuProps) => {\n const handleAction = (key: Key) => {\n switch (key) {\n case 'remove':\n methods.remove();\n break;\n case 'duplicate':\n methods.duplicate();\n break;\n case 'insertAfter':\n methods.insert();\n break;\n default:\n break;\n }\n };\n\n // Build menu items based on available actions\n const menuItems: MenuItem[] = [];\n\n if (duplicate) {\n menuItems.push({\n key: 'duplicate',\n label: 'Duplicate',\n icon: <FaCopy />,\n });\n }\n\n if (insertAfter) {\n menuItems.push({\n key: 'insertAfter',\n label: 'Insert After',\n icon: <VscInsert />,\n });\n }\n\n if (showRemove) {\n menuItems.push({\n key: 'remove',\n className: 'text-danger',\n label: 'Remove',\n icon: <FaTimes />,\n });\n }\n\n return (\n <Menu\n ariaLabel=\"Element actions\"\n items={menuItems}\n onAction={handleAction}\n placement=\"right\"\n testId={testId}\n triggerButtonProps={{\n className: cn(className),\n disableRipple: true,\n size: 'md',\n variant: 'light',\n }}\n />\n );\n};\n\nexport default ElementActionsMenu;\n","import type { ClassValue } from '@fuf-stack/pixel-utils';\n\nimport { FaTimes } from 'react-icons/fa';\n\nimport { motion } from '@fuf-stack/pixel-motion';\nimport { cn } from '@fuf-stack/pixel-utils';\nimport { Button } from '@fuf-stack/pixels';\n\ninterface ElementRemoveButtonProps {\n /** CSS class name */\n className?: ClassValue;\n /** Globally disable animations (used for first render or prefers-reduced-motion) */\n disableAnimation?: boolean;\n /** click handler */\n onClick: () => void;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\nconst ElementRemoveButton = ({\n className = undefined,\n disableAnimation = false,\n onClick,\n testId = undefined,\n}: ElementRemoveButtonProps) => {\n const button = (\n <Button\n ariaLabel=\"remove element\"\n className={cn(className)}\n color=\"danger\"\n icon={<FaTimes />}\n onClick={onClick}\n size=\"sm\"\n testId={testId}\n variant=\"light\"\n />\n );\n\n if (disableAnimation) {\n return button;\n }\n\n return (\n <motion.div\n animate={{ opacity: 1, width: 'auto' }}\n className=\"flex\"\n exit={{ opacity: 0, width: 0 }}\n initial={{ opacity: 0, width: 0 }}\n transition={{ duration: 0.2 }}\n >\n {button}\n </motion.div>\n );\n};\n\nexport default ElementRemoveButton;\n","import type { ClassValue } from '@fuf-stack/pixel-utils';\n\nimport { FaGripVertical } from 'react-icons/fa';\n\nimport { useSortable } from '@dnd-kit/sortable';\n\nimport { cn } from '@fuf-stack/pixel-utils';\n\ninterface SortDragHandleProps {\n /** Optional CSS class name */\n className?: ClassValue;\n /** Unique identifier for sortable item */\n id: string | number;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * Drag handle component that integrates with dnd-kit sortable functionality.\n * Renders a vertical grip icon that can be used to reorder items.\n */\nconst SortDragHandle = ({\n className = undefined,\n id,\n testId = undefined,\n}: SortDragHandleProps) => {\n // Get dnd-kit sortable attributes and listeners\n const { attributes, listeners } = useSortable({ id });\n\n return (\n <div\n className={cn(className)}\n data-testid={testId}\n {...attributes}\n {...listeners}\n >\n <FaGripVertical />\n </div>\n );\n};\n\nexport default SortDragHandle;\n","import type { ReactNode } from 'react';\n\nimport { cn } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../../hooks';\n\nexport interface FieldArrayLabelProps {\n /** CSS class name */\n className?: string;\n /** Label content */\n label: ReactNode;\n /** Field name */\n name: string;\n}\n\n/**\n * Renders the label for a FieldArray component.\n *\n * This component handles displaying the array label with proper accessibility\n * attributes using the label props from useUniformField.\n */\nconst FieldArrayLabel = ({\n className = undefined,\n label: _label,\n name,\n}: FieldArrayLabelProps) => {\n const { error, getLabelProps, invalid, label } = useUniformField({\n name,\n showInvalidWhen: 'immediate',\n label: _label,\n });\n\n // when no label is provided, don't render anything\n if (!_label) {\n return null;\n }\n\n // @ts-expect-error - error._errors exists but not typed\n const hasErrors = invalid && error?._errors;\n\n return (\n <div\n {...getLabelProps()}\n aria-level={3}\n role=\"heading\"\n className={cn(getLabelProps()?.className, className, {\n // when there are no array level errors, the label should have foreground color\n 'text-foreground!': !hasErrors,\n })}\n >\n {label}\n </div>\n );\n};\n\nexport default FieldArrayLabel;\n","import {\n AnimatePresence,\n motion,\n useReducedMotion,\n} from '@fuf-stack/pixel-motion';\nimport { cn } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../../hooks';\nimport FieldValidationError from '../../partials/FieldValidationError/FieldValidationError';\n\nexport interface FieldArrayValidationErrorProps {\n /** Field name */\n name: string;\n}\n\n/**\n * Renders array-level validation errors for FieldArray.\n *\n * This component handles validation errors that apply to the entire array\n * (e.g., \"Array must contain at least 3 elements\", \"Array elements are not unique\"),\n * as opposed to field-level errors which apply to individual array elements.\n *\n * The component wraps errors in the proper accessibility markup and animates\n * them in/out using Framer Motion when they appear or are resolved.\n */\nconst FieldArrayValidationError = ({\n name,\n}: FieldArrayValidationErrorProps) => {\n const {\n error,\n getErrorMessageProps,\n getHelperWrapperProps,\n invalid,\n testId,\n } = useUniformField({\n name,\n showInvalidWhen: 'immediate',\n });\n\n // disable all animation if user prefers reduced motion\n const disableAnimation = useReducedMotion();\n\n // @ts-expect-error - error._errors exists but not typed\n const hasErrors = invalid && error?._errors;\n\n return (\n <AnimatePresence initial={!disableAnimation}>\n {hasErrors ? (\n <motion.div\n key=\"field-array-errors\"\n exit={disableAnimation ? undefined : { opacity: 0, height: 0 }}\n initial={disableAnimation ? false : { height: 0, opacity: 0 }}\n style={{ overflow: 'hidden' }}\n transition={{ duration: 0.2, ease: 'circOut' }}\n animate={\n disableAnimation ? undefined : { opacity: 1, height: 'auto' }\n }\n >\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 add padding\n 'block px-3 py-2',\n )}\n >\n <div {...getErrorMessageProps()}>\n <FieldValidationError\n // @ts-expect-error - error._errors exists but not typed\n error={error._errors}\n testId={testId}\n />\n </div>\n </div>\n </motion.div>\n ) : null}\n </AnimatePresence>\n );\n};\n\nexport default FieldArrayValidationError;\n","import type { DragEndEvent } from '@dnd-kit/core';\nimport type { ReactNode } from 'react';\nimport type { UseFieldArrayMove } from 'react-hook-form';\n\nimport { useFormContext } from 'react-hook-form';\n\nimport {\n closestCenter,\n DndContext,\n KeyboardSensor,\n PointerSensor,\n useSensor,\n useSensors,\n} from '@dnd-kit/core';\nimport {\n restrictToVerticalAxis,\n restrictToWindowEdges,\n} from '@dnd-kit/modifiers';\nimport {\n SortableContext,\n verticalListSortingStrategy,\n} from '@dnd-kit/sortable';\n\ninterface SortContextProps {\n /** child components */\n children: ReactNode;\n /** Array of objects containing unique IDs for sortable items */\n fields: Record<'id', string>[];\n /** name of the field array */\n name: string;\n /** react-hook-form's move function to update field array indices */\n move: UseFieldArrayMove;\n /** enable/disable sorting functionality */\n sortable: boolean;\n}\n\n/**\n * A wrapper component that provides drag-and-drop sorting functionality for field arrays\n * using dnd-kit and react-hook-form.\n *\n * This component integrates with react-hook-form's field arrays to enable vertical\n * drag-and-drop reordering of form fields. It supports both pointer (mouse/touch)\n * and keyboard interactions for accessibility.\n */\nconst SortContext = ({\n children,\n fields,\n move,\n name,\n sortable,\n}: SortContextProps): ReactNode => {\n const { trigger } = useFormContext();\n\n // Initialize sensors for both pointer (mouse/touch) and keyboard interactions\n const sensors = useSensors(\n useSensor(PointerSensor),\n useSensor(KeyboardSensor),\n );\n\n // Early return if sorting is disabled\n if (!sortable) {\n return children;\n }\n\n /**\n * Handles the end of a drag operation by updating field positions\n * @param event - The drag end event containing active and over elements\n */\n const handleDragEnd = (event: DragEndEvent) => {\n const { active, over } = event;\n\n // Only move if dropping over a different item\n if (active.id !== over?.id) {\n // Find the indices of the dragged item and drop target\n const oldIndex = fields.findIndex((field) => {\n return field.id === active.id;\n });\n const newIndex = fields.findIndex((field) => {\n return field.id === over?.id;\n });\n // Update the field array order using react-hook-form's move function\n move(oldIndex, newIndex);\n\n // Finally trigger validation for the array field,\n // so validation errors are updated for the new order\n trigger(name);\n }\n };\n\n return (\n <DndContext\n collisionDetection={closestCenter}\n modifiers={[restrictToVerticalAxis, restrictToWindowEdges]}\n onDragEnd={handleDragEnd}\n sensors={sensors}\n >\n <SortableContext\n strategy={verticalListSortingStrategy}\n items={fields.map((field) => {\n return field.id;\n })}\n >\n {children}\n </SortableContext>\n </DndContext>\n );\n};\n\nexport default SortContext;\n","import FieldArray from './FieldArray';\n\nexport type * from './types';\n\nexport { FieldArray };\n\nexport default FieldArray;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAGA,SAAS,MAAAA,KAAI,IAAI,4BAA4B;;;ACD7C,SAAS,cAAc;AAEvB,SAAS,UAAU;AACnB,SAAS,cAAc;AAoBnB,SAQE,KARF;AAPJ,IAAM,sBAAsB,CAAC;AAAA,EAC3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vC;AAAA,cACA,QAAQ,MAAM;AACZ,uBAAO,KAAK;AAAA,cACd;AAAA,YACF;AAEA,mBACE,gBAAAA;AAAA,cAAC;AAAA;AAAA,gBAEC;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA,IAAI,MAAM;AAAA,gBACV;AAAA,gBACA;AAAA,gBACA,kBAAkB;AAAA,gBAClB,SAAS;AAAA,gBACT;AAAA,gBACA,QAAQ;AAAA,gBAEP,mBAAS;AAAA,kBACR;AAAA,kBACA,QAAQ,OAAO;AAAA,kBACf,SAAS;AAAA,kBACT,MAAM;AAAA,kBACN,QAAQ;AAAA,gBACV,CAAC;AAAA;AAAA,cApBI,MAAM;AAAA,YAqBb;AAAA,UAEJ,CAAC,GACH;AAAA;AAAA,MACF,GACF;AAAA,QACE;AAAA,IAGJ,gBAAAA,KAAC,qCAA0B,MAAY;AAAA,IAGvC,gBAAAA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAW,UAAU;AAAA,QACrB,QAAQ,GAAG,MAAM;AAAA,QACjB,SAAS,MAAM;AACb,iBAAO,mBAAmB;AAAA,QAC5B;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;AAEA,IAAO,qBAAQ;;;AS3Of,IAAOG,sBAAQ;","names":["cn","useSortable","motion","cn","cn","jsx","FaTimes","cn","Button","jsx","cn","jsx","cn","jsx","jsxs","useSortable","motion","cn","cn","jsx","cn","AnimatePresence","motion","cn","jsx","AnimatePresence","motion","cn","jsx","jsx","jsxs","cn","FieldArray_default"]}
|
package/dist/hooks/index.cjs
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkHI677N7Gcjs = require('../chunk-HI677N7G.cjs');
|
|
10
10
|
require('../chunk-OE5BOGGX.cjs');
|
|
11
11
|
require('../chunk-NHEZXA4H.cjs');
|
|
12
12
|
require('../chunk-Z353BLWI.cjs');
|
|
@@ -27,5 +27,5 @@ require('../chunk-555JRYCS.cjs');
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
exports.checkFieldIsRequired =
|
|
30
|
+
exports.checkFieldIsRequired = _chunkHI677N7Gcjs.checkFieldIsRequired; exports.useClientValidation = _chunkHI677N7Gcjs.useClientValidation; exports.useController = _chunkHI677N7Gcjs.useController; exports.useFormContext = _chunkHI677N7Gcjs.useFormContext; exports.useInput = _chunkHI677N7Gcjs.useInput; exports.useInputValueDebounce = _chunkBZ5OMN4Ycjs.useInputValueDebounce; exports.useInputValueTransform = _chunk4WYC2RBEcjs.useInputValueTransform; exports.useUniformField = _chunkHI677N7Gcjs.useUniformField; exports.useUniformFieldArray = _chunkHI677N7Gcjs.useUniformFieldArray;
|
|
31
31
|
//# sourceMappingURL=index.cjs.map
|
package/dist/hooks/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/uniform/dist/hooks/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACF,yDAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B;AACE;AACF,yDAA8B;AAC9B;AACE;AACF,yDAA8B;AAC9B,iCAA8B;AAC9B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/uniform/dist/hooks/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACF,yDAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B;AACE;AACF,yDAA8B;AAC9B;AACE;AACF,yDAA8B;AAC9B,iCAA8B;AAC9B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,skBAAC","file":"/home/runner/work/pixels/pixels/packages/uniform/dist/hooks/index.cjs"}
|
package/dist/hooks/index.d.cts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as _fuf_stack_veto from '@fuf-stack/veto';
|
|
2
2
|
import { VetoTypeAny, VetoInstance, VetoFormattedError } from '@fuf-stack/veto';
|
|
3
3
|
import * as react_hook_form from 'react-hook-form';
|
|
4
|
-
import { UseControllerProps as UseControllerProps$1, ControllerRenderProps, UseFormStateReturn, ControllerFieldState, FieldValues, Path, FieldError } from 'react-hook-form';
|
|
5
|
-
|
|
4
|
+
import { UseControllerProps as UseControllerProps$1, ControllerRenderProps, UseFormStateReturn, ControllerFieldState, FieldValues, Path, FieldError, ArrayPath } from 'react-hook-form';
|
|
5
|
+
import * as _heroui_input from '@heroui/input';
|
|
6
|
+
import { useInput } from '@heroui/input';
|
|
7
|
+
export { useInput } from '@heroui/input';
|
|
6
8
|
import * as React from 'react';
|
|
7
9
|
import { ReactNode } from 'react';
|
|
8
10
|
import { D as DebugModeSettings } from '../FormContext-LRho0tno.cjs';
|
|
9
|
-
import { useInput } from '@heroui/input';
|
|
10
|
-
export { useInput } from '@heroui/input';
|
|
11
11
|
export { UseInputValueDebounceOptions, UseInputValueDebounceReturn, useInputValueDebounce } from './useInputValueDebounce/index.cjs';
|
|
12
12
|
export { InputValueTransform, UseInputValueTransformOptions, UseInputValueTransformReturn, useInputValueTransform } from './useInputValueTransform/index.cjs';
|
|
13
13
|
|
|
@@ -106,6 +106,70 @@ declare const useFormContext: <TFieldValues extends FieldValues = FieldValues, T
|
|
|
106
106
|
setFocus: react_hook_form.UseFormSetFocus<TFieldValues>;
|
|
107
107
|
};
|
|
108
108
|
|
|
109
|
+
interface UseUniformFieldArrayProps<TFieldValues extends FieldValues = FieldValues> {
|
|
110
|
+
/** Field name for the array */
|
|
111
|
+
name: ArrayPath<TFieldValues>;
|
|
112
|
+
/** Whether this is a flat array (array of primitives) */
|
|
113
|
+
flat?: boolean;
|
|
114
|
+
/** Initial value for new array elements */
|
|
115
|
+
elementInitialValue?: unknown;
|
|
116
|
+
/** Whether the last element cannot be removed (always maintain at least one element) */
|
|
117
|
+
lastElementNotRemovable?: boolean;
|
|
118
|
+
/** Disable the field */
|
|
119
|
+
disabled?: boolean;
|
|
120
|
+
/** Optional explicit test id used to build stable test ids */
|
|
121
|
+
testId?: string;
|
|
122
|
+
/** Optional label content; pass false to suppress label entirely */
|
|
123
|
+
label?: ReactNode | false;
|
|
124
|
+
/**
|
|
125
|
+
* When to show the invalid state to users.
|
|
126
|
+
* - 'touched': Only show errors after field is touched or form is submitted (default, good for text inputs)
|
|
127
|
+
* - 'immediate': Show errors as soon as they occur (good for checkboxes, radios, arrays)
|
|
128
|
+
*/
|
|
129
|
+
showInvalidWhen?: 'touched' | 'immediate';
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Enhanced useFieldArray hook with initialization and animation logic.
|
|
133
|
+
* Based on React Hook Form's useFieldArray with additional features:
|
|
134
|
+
* - Automatic initialization when lastElementNotRemovable is set
|
|
135
|
+
* - Animation control (disabled during initialization)
|
|
136
|
+
* - Automatic validation triggering
|
|
137
|
+
* - Support for flat arrays (arrays of primitives)
|
|
138
|
+
*
|
|
139
|
+
* @see https://react-hook-form.com/docs/usefieldarray
|
|
140
|
+
*/
|
|
141
|
+
declare const useUniformFieldArray: <TFieldValues extends FieldValues = FieldValues>({ name, flat, elementInitialValue: _elementInitialValue, lastElementNotRemovable, disabled, testId: explicitTestId, label, showInvalidWhen, }: UseUniformFieldArrayProps<TFieldValues>) => {
|
|
142
|
+
control: react_hook_form.Control<TFieldValues, any, TFieldValues>;
|
|
143
|
+
debugMode: ReturnType<typeof useFormContext<TFieldValues_1>>["debugMode"];
|
|
144
|
+
defaultValue: unknown;
|
|
145
|
+
disabled: boolean | undefined;
|
|
146
|
+
error: react_hook_form.FieldError[] | undefined;
|
|
147
|
+
errorMessage: ReactNode | null;
|
|
148
|
+
field: Omit<react_hook_form.ControllerRenderProps<TFieldValues>, "value" | "onChange"> & {
|
|
149
|
+
onChange: (... /** Initial value for new array elements */event: any[]) => void;
|
|
150
|
+
value: string;
|
|
151
|
+
};
|
|
152
|
+
getErrorMessageProps: ReturnType<typeof _heroui_input.useInput>["getErrorMessageProps"];
|
|
153
|
+
getHelperWrapperProps: ReturnType<typeof _heroui_input.useInput>["getHelperWrapperProps"];
|
|
154
|
+
getLabelProps: ReturnType<typeof _heroui_input.useInput>["getLabelProps"];
|
|
155
|
+
getValues: react_hook_form.UseFormGetValues<TFieldValues>;
|
|
156
|
+
invalid: boolean;
|
|
157
|
+
label: ReactNode | null;
|
|
158
|
+
onBlur: ReturnType<typeof useController>["field"]["onBlur"];
|
|
159
|
+
onChange: ReturnType<typeof useController>["field"]["onChange"];
|
|
160
|
+
ref: ReturnType<typeof useController>["field"]["ref"];
|
|
161
|
+
required: boolean;
|
|
162
|
+
resetField: react_hook_form.UseFormResetField<TFieldValues>;
|
|
163
|
+
testId: string;
|
|
164
|
+
fields: react_hook_form.FieldArrayWithId<TFieldValues, ArrayPath<TFieldValues>, "id">[];
|
|
165
|
+
append: react_hook_form.UseFieldArrayAppend<TFieldValues, ArrayPath<TFieldValues>>;
|
|
166
|
+
remove: react_hook_form.UseFieldArrayRemove;
|
|
167
|
+
insert: react_hook_form.UseFieldArrayInsert<TFieldValues, ArrayPath<TFieldValues>>;
|
|
168
|
+
move: react_hook_form.UseFieldArrayMove;
|
|
169
|
+
disableAnimation: boolean;
|
|
170
|
+
elementInitialValue: {};
|
|
171
|
+
};
|
|
172
|
+
|
|
109
173
|
interface UseUniformFieldParams<TFieldValues extends FieldValues = FieldValues> {
|
|
110
174
|
/** Form field name */
|
|
111
175
|
name: Path<TFieldValues> & string;
|
|
@@ -186,4 +250,4 @@ interface UseUniformFieldReturn<TFieldValues extends FieldValues = FieldValues>
|
|
|
186
250
|
*/
|
|
187
251
|
declare function useUniformField<TFieldValues extends FieldValues = FieldValues>(params: UseUniformFieldParams<TFieldValues>): UseUniformFieldReturn<TFieldValues>;
|
|
188
252
|
|
|
189
|
-
export { type UseControllerProps, type UseControllerReturn, type UseUniformFieldParams, type UseUniformFieldReturn, checkFieldIsRequired, useClientValidation, useController, useFormContext, useUniformField };
|
|
253
|
+
export { type UseControllerProps, type UseControllerReturn, type UseUniformFieldArrayProps, type UseUniformFieldParams, type UseUniformFieldReturn, checkFieldIsRequired, useClientValidation, useController, useFormContext, useUniformField, useUniformFieldArray };
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as _fuf_stack_veto from '@fuf-stack/veto';
|
|
2
2
|
import { VetoTypeAny, VetoInstance, VetoFormattedError } from '@fuf-stack/veto';
|
|
3
3
|
import * as react_hook_form from 'react-hook-form';
|
|
4
|
-
import { UseControllerProps as UseControllerProps$1, ControllerRenderProps, UseFormStateReturn, ControllerFieldState, FieldValues, Path, FieldError } from 'react-hook-form';
|
|
5
|
-
|
|
4
|
+
import { UseControllerProps as UseControllerProps$1, ControllerRenderProps, UseFormStateReturn, ControllerFieldState, FieldValues, Path, FieldError, ArrayPath } from 'react-hook-form';
|
|
5
|
+
import * as _heroui_input from '@heroui/input';
|
|
6
|
+
import { useInput } from '@heroui/input';
|
|
7
|
+
export { useInput } from '@heroui/input';
|
|
6
8
|
import * as React from 'react';
|
|
7
9
|
import { ReactNode } from 'react';
|
|
8
10
|
import { D as DebugModeSettings } from '../FormContext-LRho0tno.js';
|
|
9
|
-
import { useInput } from '@heroui/input';
|
|
10
|
-
export { useInput } from '@heroui/input';
|
|
11
11
|
export { UseInputValueDebounceOptions, UseInputValueDebounceReturn, useInputValueDebounce } from './useInputValueDebounce/index.js';
|
|
12
12
|
export { InputValueTransform, UseInputValueTransformOptions, UseInputValueTransformReturn, useInputValueTransform } from './useInputValueTransform/index.js';
|
|
13
13
|
|
|
@@ -106,6 +106,70 @@ declare const useFormContext: <TFieldValues extends FieldValues = FieldValues, T
|
|
|
106
106
|
setFocus: react_hook_form.UseFormSetFocus<TFieldValues>;
|
|
107
107
|
};
|
|
108
108
|
|
|
109
|
+
interface UseUniformFieldArrayProps<TFieldValues extends FieldValues = FieldValues> {
|
|
110
|
+
/** Field name for the array */
|
|
111
|
+
name: ArrayPath<TFieldValues>;
|
|
112
|
+
/** Whether this is a flat array (array of primitives) */
|
|
113
|
+
flat?: boolean;
|
|
114
|
+
/** Initial value for new array elements */
|
|
115
|
+
elementInitialValue?: unknown;
|
|
116
|
+
/** Whether the last element cannot be removed (always maintain at least one element) */
|
|
117
|
+
lastElementNotRemovable?: boolean;
|
|
118
|
+
/** Disable the field */
|
|
119
|
+
disabled?: boolean;
|
|
120
|
+
/** Optional explicit test id used to build stable test ids */
|
|
121
|
+
testId?: string;
|
|
122
|
+
/** Optional label content; pass false to suppress label entirely */
|
|
123
|
+
label?: ReactNode | false;
|
|
124
|
+
/**
|
|
125
|
+
* When to show the invalid state to users.
|
|
126
|
+
* - 'touched': Only show errors after field is touched or form is submitted (default, good for text inputs)
|
|
127
|
+
* - 'immediate': Show errors as soon as they occur (good for checkboxes, radios, arrays)
|
|
128
|
+
*/
|
|
129
|
+
showInvalidWhen?: 'touched' | 'immediate';
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Enhanced useFieldArray hook with initialization and animation logic.
|
|
133
|
+
* Based on React Hook Form's useFieldArray with additional features:
|
|
134
|
+
* - Automatic initialization when lastElementNotRemovable is set
|
|
135
|
+
* - Animation control (disabled during initialization)
|
|
136
|
+
* - Automatic validation triggering
|
|
137
|
+
* - Support for flat arrays (arrays of primitives)
|
|
138
|
+
*
|
|
139
|
+
* @see https://react-hook-form.com/docs/usefieldarray
|
|
140
|
+
*/
|
|
141
|
+
declare const useUniformFieldArray: <TFieldValues extends FieldValues = FieldValues>({ name, flat, elementInitialValue: _elementInitialValue, lastElementNotRemovable, disabled, testId: explicitTestId, label, showInvalidWhen, }: UseUniformFieldArrayProps<TFieldValues>) => {
|
|
142
|
+
control: react_hook_form.Control<TFieldValues, any, TFieldValues>;
|
|
143
|
+
debugMode: ReturnType<typeof useFormContext<TFieldValues_1>>["debugMode"];
|
|
144
|
+
defaultValue: unknown;
|
|
145
|
+
disabled: boolean | undefined;
|
|
146
|
+
error: react_hook_form.FieldError[] | undefined;
|
|
147
|
+
errorMessage: ReactNode | null;
|
|
148
|
+
field: Omit<react_hook_form.ControllerRenderProps<TFieldValues>, "value" | "onChange"> & {
|
|
149
|
+
onChange: (... /** Initial value for new array elements */event: any[]) => void;
|
|
150
|
+
value: string;
|
|
151
|
+
};
|
|
152
|
+
getErrorMessageProps: ReturnType<typeof _heroui_input.useInput>["getErrorMessageProps"];
|
|
153
|
+
getHelperWrapperProps: ReturnType<typeof _heroui_input.useInput>["getHelperWrapperProps"];
|
|
154
|
+
getLabelProps: ReturnType<typeof _heroui_input.useInput>["getLabelProps"];
|
|
155
|
+
getValues: react_hook_form.UseFormGetValues<TFieldValues>;
|
|
156
|
+
invalid: boolean;
|
|
157
|
+
label: ReactNode | null;
|
|
158
|
+
onBlur: ReturnType<typeof useController>["field"]["onBlur"];
|
|
159
|
+
onChange: ReturnType<typeof useController>["field"]["onChange"];
|
|
160
|
+
ref: ReturnType<typeof useController>["field"]["ref"];
|
|
161
|
+
required: boolean;
|
|
162
|
+
resetField: react_hook_form.UseFormResetField<TFieldValues>;
|
|
163
|
+
testId: string;
|
|
164
|
+
fields: react_hook_form.FieldArrayWithId<TFieldValues, ArrayPath<TFieldValues>, "id">[];
|
|
165
|
+
append: react_hook_form.UseFieldArrayAppend<TFieldValues, ArrayPath<TFieldValues>>;
|
|
166
|
+
remove: react_hook_form.UseFieldArrayRemove;
|
|
167
|
+
insert: react_hook_form.UseFieldArrayInsert<TFieldValues, ArrayPath<TFieldValues>>;
|
|
168
|
+
move: react_hook_form.UseFieldArrayMove;
|
|
169
|
+
disableAnimation: boolean;
|
|
170
|
+
elementInitialValue: {};
|
|
171
|
+
};
|
|
172
|
+
|
|
109
173
|
interface UseUniformFieldParams<TFieldValues extends FieldValues = FieldValues> {
|
|
110
174
|
/** Form field name */
|
|
111
175
|
name: Path<TFieldValues> & string;
|
|
@@ -186,4 +250,4 @@ interface UseUniformFieldReturn<TFieldValues extends FieldValues = FieldValues>
|
|
|
186
250
|
*/
|
|
187
251
|
declare function useUniformField<TFieldValues extends FieldValues = FieldValues>(params: UseUniformFieldParams<TFieldValues>): UseUniformFieldReturn<TFieldValues>;
|
|
188
252
|
|
|
189
|
-
export { type UseControllerProps, type UseControllerReturn, type UseUniformFieldParams, type UseUniformFieldReturn, checkFieldIsRequired, useClientValidation, useController, useFormContext, useUniformField };
|
|
253
|
+
export { type UseControllerProps, type UseControllerReturn, type UseUniformFieldArrayProps, type UseUniformFieldParams, type UseUniformFieldReturn, checkFieldIsRequired, useClientValidation, useController, useFormContext, useUniformField, useUniformFieldArray };
|
package/dist/hooks/index.js
CHANGED
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
checkFieldIsRequired,
|
|
3
3
|
useClientValidation,
|
|
4
4
|
useController,
|
|
5
|
-
useFieldArray,
|
|
6
5
|
useFormContext,
|
|
7
6
|
useInput,
|
|
8
|
-
useUniformField
|
|
9
|
-
|
|
7
|
+
useUniformField,
|
|
8
|
+
useUniformFieldArray
|
|
9
|
+
} from "../chunk-WVTLXBTO.js";
|
|
10
10
|
import "../chunk-NTDKZW4E.js";
|
|
11
11
|
import "../chunk-ELYGQTXB.js";
|
|
12
12
|
import "../chunk-76KOVUDN.js";
|
|
@@ -21,11 +21,11 @@ export {
|
|
|
21
21
|
checkFieldIsRequired,
|
|
22
22
|
useClientValidation,
|
|
23
23
|
useController,
|
|
24
|
-
useFieldArray,
|
|
25
24
|
useFormContext,
|
|
26
25
|
useInput,
|
|
27
26
|
useInputValueDebounce,
|
|
28
27
|
useInputValueTransform,
|
|
29
|
-
useUniformField
|
|
28
|
+
useUniformField,
|
|
29
|
+
useUniformFieldArray
|
|
30
30
|
};
|
|
31
31
|
//# sourceMappingURL=index.js.map
|