@fuf-stack/uniform 1.5.1 → 1.5.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.cjs +5 -5
- package/dist/Checkboxes/index.js +4 -4
- package/dist/FieldArray/index.cjs +5 -5
- package/dist/FieldArray/index.js +4 -4
- package/dist/Form/index.cjs +5 -5
- package/dist/Form/index.js +4 -4
- package/dist/Input/index.cjs +5 -5
- package/dist/Input/index.js +4 -4
- package/dist/RadioBoxes/index.cjs +5 -5
- package/dist/RadioBoxes/index.js +4 -4
- package/dist/RadioTabs/index.cjs +5 -5
- package/dist/RadioTabs/index.js +4 -4
- package/dist/Radios/index.cjs +5 -5
- package/dist/Radios/index.js +4 -4
- package/dist/Select/index.cjs +5 -5
- package/dist/Select/index.js +4 -4
- package/dist/SubmitButton/index.cjs +5 -5
- package/dist/SubmitButton/index.js +4 -4
- package/dist/Switch/index.cjs +5 -5
- package/dist/Switch/index.js +4 -4
- package/dist/TextArea/index.cjs +5 -5
- package/dist/TextArea/index.js +4 -4
- package/dist/{chunk-RW35BB4P.js → chunk-2A74CSGX.js} +2 -2
- package/dist/{chunk-7NWHDCME.cjs → chunk-3FSNNDYZ.cjs} +14 -14
- package/dist/{chunk-7NWHDCME.cjs.map → chunk-3FSNNDYZ.cjs.map} +1 -1
- package/dist/{chunk-HSKFVCTS.js → chunk-3MXAIQKI.js} +3 -3
- package/dist/{chunk-COLAXULB.js → chunk-4DGOOLSO.js} +6 -6
- package/dist/{chunk-COLAXULB.js.map → chunk-4DGOOLSO.js.map} +1 -1
- package/dist/{chunk-TVMCTUQ4.js → chunk-4EZWAVRZ.js} +3 -3
- package/dist/{chunk-TVMCTUQ4.js.map → chunk-4EZWAVRZ.js.map} +1 -1
- package/dist/{chunk-P6HJOG7D.cjs → chunk-4WYC2RBE.cjs} +7 -3
- package/dist/chunk-4WYC2RBE.cjs.map +1 -0
- package/dist/{chunk-Q2BOMFJ5.js → chunk-7KLFK2IT.js} +7 -3
- package/dist/{chunk-Q2BOMFJ5.js.map → chunk-7KLFK2IT.js.map} +1 -1
- package/dist/{chunk-3YDAYNNB.cjs → chunk-BOESKBZN.cjs} +81 -59
- package/dist/chunk-BOESKBZN.cjs.map +1 -0
- package/dist/{chunk-FLK6OPFY.cjs → chunk-BZ5OMN4Y.cjs} +3 -3
- package/dist/{chunk-FLK6OPFY.cjs.map → chunk-BZ5OMN4Y.cjs.map} +1 -1
- package/dist/{chunk-74NPRJVH.js → chunk-BZBA2YGQ.js} +4 -4
- package/dist/{chunk-74NPRJVH.js.map → chunk-BZBA2YGQ.js.map} +1 -1
- package/dist/{chunk-SLTUNYTD.js → chunk-CHG25NCC.js} +4 -4
- package/dist/{chunk-SLTUNYTD.js.map → chunk-CHG25NCC.js.map} +1 -1
- package/dist/{chunk-4GBNXNCZ.js → chunk-CROGVLLB.js} +76 -54
- package/dist/chunk-CROGVLLB.js.map +1 -0
- package/dist/{chunk-RTFM4VRY.cjs → chunk-CUXVVIWS.cjs} +5 -5
- package/dist/{chunk-RTFM4VRY.cjs.map → chunk-CUXVVIWS.cjs.map} +1 -1
- package/dist/{chunk-EAJFV3AD.cjs → chunk-I6CQH42B.cjs} +5 -5
- package/dist/{chunk-EAJFV3AD.cjs.map → chunk-I6CQH42B.cjs.map} +1 -1
- package/dist/{chunk-KBUECB4B.cjs → chunk-JJDPGGYL.cjs} +3 -3
- package/dist/{chunk-KBUECB4B.cjs.map → chunk-JJDPGGYL.cjs.map} +1 -1
- package/dist/{chunk-DHO4HSO7.cjs → chunk-KE3ZO2IJ.cjs} +5 -5
- package/dist/{chunk-DHO4HSO7.cjs.map → chunk-KE3ZO2IJ.cjs.map} +1 -1
- package/dist/{chunk-ZQ64MG7T.js → chunk-L53NZ7S5.js} +4 -4
- package/dist/{chunk-ZQ64MG7T.js.map → chunk-L53NZ7S5.js.map} +1 -1
- package/dist/{chunk-65BN4MRG.cjs → chunk-LZPH7LW5.cjs} +7 -7
- package/dist/{chunk-65BN4MRG.cjs.map → chunk-LZPH7LW5.cjs.map} +1 -1
- package/dist/{chunk-6IU7IYYB.js → chunk-MODD3TFE.js} +2 -2
- package/dist/{chunk-J5FFM7WG.cjs → chunk-O3DDOJTB.cjs} +1 -1
- package/dist/{chunk-J5FFM7WG.cjs.map → chunk-O3DDOJTB.cjs.map} +1 -1
- package/dist/{chunk-4MMOSRT3.cjs → chunk-RNBJT4Y7.cjs} +7 -7
- package/dist/{chunk-4MMOSRT3.cjs.map → chunk-RNBJT4Y7.cjs.map} +1 -1
- package/dist/{chunk-EO4A7QGM.cjs → chunk-SU5WXAC7.cjs} +6 -6
- package/dist/{chunk-EO4A7QGM.cjs.map → chunk-SU5WXAC7.cjs.map} +1 -1
- package/dist/{chunk-JLJB4A4K.js → chunk-SUO4QK32.js} +3 -3
- package/dist/{chunk-TFMVYQGN.cjs → chunk-TED4I5EF.cjs} +5 -5
- package/dist/{chunk-TFMVYQGN.cjs.map → chunk-TED4I5EF.cjs.map} +1 -1
- package/dist/{chunk-62BVHALF.js → chunk-TTKSVOSS.js} +13 -13
- package/dist/{chunk-62BVHALF.js.map → chunk-TTKSVOSS.js.map} +1 -1
- package/dist/{chunk-2QLCCB3L.js → chunk-VRFZFKDM.js} +4 -4
- package/dist/{chunk-2QLCCB3L.js.map → chunk-VRFZFKDM.js.map} +1 -1
- package/dist/{chunk-GVMEDVT5.cjs → chunk-XZLIDJKA.cjs} +4 -4
- package/dist/{chunk-GVMEDVT5.cjs.map → chunk-XZLIDJKA.cjs.map} +1 -1
- package/dist/{chunk-CFH4VPJ4.js → chunk-Y6NHIZ2M.js} +1 -1
- package/dist/{chunk-CFH4VPJ4.js.map → chunk-Y6NHIZ2M.js.map} +1 -1
- package/dist/hooks/index.cjs +4 -4
- package/dist/hooks/index.js +3 -3
- package/dist/hooks/useInputValueDebounce/index.cjs +3 -3
- package/dist/hooks/useInputValueDebounce/index.js +2 -2
- package/dist/hooks/useInputValueTransform/index.cjs +2 -2
- package/dist/hooks/useInputValueTransform/index.js +1 -1
- package/dist/index.cjs +15 -15
- package/dist/index.js +14 -14
- package/package.json +4 -4
- package/dist/chunk-3YDAYNNB.cjs.map +0 -1
- package/dist/chunk-4GBNXNCZ.js.map +0 -1
- package/dist/chunk-P6HJOG7D.cjs.map +0 -1
- /package/dist/{chunk-RW35BB4P.js.map → chunk-2A74CSGX.js.map} +0 -0
- /package/dist/{chunk-HSKFVCTS.js.map → chunk-3MXAIQKI.js.map} +0 -0
- /package/dist/{chunk-6IU7IYYB.js.map → chunk-MODD3TFE.js.map} +0 -0
- /package/dist/{chunk-JLJB4A4K.js.map → chunk-SUO4QK32.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/uniform/dist/chunk-BOESKBZN.cjs","../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"],"names":["jsx","cn","Button","FaTimes","useSortable","AnimatePresence","motion","useFormContext","jsxs"],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACjBA,8BAAkC;AAElC,sDAAiC;AACjC,oDAA6C;ADkB7C;AACA;AEvBA,oCAAuB;AAEvB;AACA,2CAAuB;AAoBnB,+CAAA;AAPJ,IAAM,oBAAA,EAAsB,CAAC;AAAA,EAC3B,iBAAA,EAAmB,aAAA;AA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AA;AACA,gBAAA;AACA,gBAAA;AAGC,gBAAA;AACT,cAAA;AACQ,cAAA;AACC,gBAAA;AACT,cAAA;AACQ,cAAA;AACC,gBAAA;AACT,cAAA;AACF,YAAA;AAGE,YAAA;AAAC,cAAA;AAAA,cAAA;AAEC,gBAAA;AACA,gBAAA;AACA,gBAAA;AACA,gBAAA;AACA,gBAAA;AACU,gBAAA;AACV,gBAAA;AACA,gBAAA;AACA,gBAAA;AACS,gBAAA;AACT,gBAAA;AACQ,gBAAA;AAEP,gBAAA;AACC,kBAAA;AACQ,kBAAA;AACR,kBAAA;AACM,kBAAA;AACE,kBAAA;AACT,gBAAA;AAAA,cAAA;AApBU,cAAA;AAqBb,YAAA;AAGN,UAAA;AAAA,QAAA;AAEJ,MAAA;AACE,IAAA;AAGJA,oBAAAA;AAAC,MAAA;AAAA,MAAA;AACC,QAAA;AACiB,QAAA;AACNC,QAAAA;AACC,UAAA;AAAA;AAAA;AAGR,UAAA;AACJ,QAAA;AACe,QAAA;AACN,UAAA;AACT,QAAA;AAAA,MAAA;AACF,IAAA;AAGC,oBAAA;AACH,EAAA;AAEJ;AAEe;AD4ZW;AACA;AUnrBX;AVqrBW;AACA;AACA;AACA;AACA","file":"/home/runner/work/pixels/pixels/packages/uniform/dist/chunk-BOESKBZN.cjs","sourcesContent":[null,"import type { FieldArrayElementMethods } from './subcomponents/FieldArrayElement';\nimport type { FieldArrayProps } from './types';\n\nimport { useEffect, useRef } from 'react';\n\nimport { useReducedMotion } from '@fuf-stack/pixel-motion';\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { flatArrayKey } from '../helpers';\nimport { useFieldArray, useUniformField } from '../hooks';\nimport { useFormContext } from '../hooks/useFormContext/useFormContext';\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 rounded-b-small rounded-t-none',\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 { control, error, getValues, invalid, testId } = useUniformField({\n name,\n showInvalidWhen: 'immediate',\n ...uniformFieldProps,\n });\n\n const { fields, append, remove, insert, move } = useFieldArray({\n control,\n name,\n });\n\n const { trigger, setValue } = useFormContext();\n\n // Validate array-level constraints immediately when length changes\n useEffect(() => {\n setTimeout(() => {\n // Trigger validation for the array field so max/min errors appear instantly\n trigger(name);\n }, 200);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [fields.length]);\n\n // Prepare initial element value based on mode\n // - flat=true: arrays of primitives → object with flatArrayKey and null value by default\n // - flat=false: arrays of objects → empty object by default\n const elementInitialValue = flat\n ? { [flatArrayKey]: _elementInitialValue ?? null }\n : (_elementInitialValue ?? {});\n\n // When lastElementNotRemovable is set and the field array is empty,\n // add an initial element to ensure there's always at least one visible element\n useEffect(\n () => {\n if (lastElementNotRemovable && fields.length === 0) {\n // use setValue instead of append to avoid focusing added element\n setValue(name, [elementInitialValue]);\n }\n },\n // only run once when the component mounts\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [],\n );\n\n // Track initial render to prevent animating elements on\n // first render cycle or when user prefers reduced motion\n const prefersReducedMotion = useReducedMotion();\n const disableAnimationRef = useRef(true);\n useEffect(() => {\n if (!prefersReducedMotion) {\n disableAnimationRef.current = false;\n }\n }, [prefersReducedMotion]);\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={disableAnimationRef.current}\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 {/* append elements button */}\n <ElementAppendButton\n appendButtonText={appendButtonText}\n testId={`${testId}_append_button`}\n className={cn(\n className.appendButton,\n // only round bottom corners if there are no errors below\n // @ts-expect-error - error._errors exists but not typed\n { 'rounded-none': invalid && error?._errors },\n )}\n onClick={() => {\n append(elementInitialValue);\n }}\n />\n\n {/* top level field array errors */}\n <FieldArrayValidationError name={name} />\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 {lastNotDeletable && fields.length === 1 ? null : (\n <ElementRemoveButton\n className={className.removeButton}\n testId={`${testId}_remove_button`}\n onClick={() => {\n if (disableAnimation) {\n methods.remove();\n } else {\n setIsVisible(false);\n }\n }}\n />\n )}\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 { cn } from '@fuf-stack/pixel-utils';\nimport { Button } from '@fuf-stack/pixels';\n\ninterface ElementRemoveButtonProps {\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 ElementRemoveButton = ({\n className = undefined,\n onClick,\n testId = undefined,\n}: ElementRemoveButtonProps) => {\n return (\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\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/rounded corners\n 'block rounded-b-small 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"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk4WYC2RBEcjs = require('./chunk-4WYC2RBE.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -16,7 +16,7 @@ var useInputValueDebounce = ({
|
|
|
16
16
|
type,
|
|
17
17
|
value
|
|
18
18
|
}) => {
|
|
19
|
-
const { toDisplayValue, toFormValue } =
|
|
19
|
+
const { toDisplayValue, toFormValue } = _chunk4WYC2RBEcjs.useInputValueTransform.call(void 0, {
|
|
20
20
|
transform,
|
|
21
21
|
type
|
|
22
22
|
});
|
|
@@ -78,4 +78,4 @@ var useInputValueDebounce = ({
|
|
|
78
78
|
|
|
79
79
|
|
|
80
80
|
exports.useInputValueDebounce = useInputValueDebounce;
|
|
81
|
-
//# sourceMappingURL=chunk-
|
|
81
|
+
//# sourceMappingURL=chunk-BZ5OMN4Y.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/uniform/dist/chunk-
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/uniform/dist/chunk-BZ5OMN4Y.cjs","../src/hooks/useInputValueDebounce/useInputValueDebounce.ts"],"names":["_a"],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACA;ACNA,8BAAyD;AA6FlD,IAAM,sBAAA,EAAwB,CAAC;AAAA,EACpC,cAAA,EAAgB,GAAA;AAAA,EAChB,MAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA;AAAA,EACA,IAAA;AAAA,EACA;AACF,CAAA,EAAA,GAAiE;AAE/D,EAAA,MAAM,EAAE,cAAA,EAAgB,YAAY,EAAA,EAAI,sDAAA;AAAuB,IAC7D,SAAA;AAAA,IACA;AAAA,EACF,CAAC,CAAA;AAGD,EAAA,MAAM,CAAC,YAAA,EAAc,eAAe,EAAA,EAAI,6BAAA,CAAS,EAAA,GAAM;AACrD,IAAA,OAAO,cAAA,CAAe,KAAK,CAAA;AAAA,EAC7B,CAAC,CAAA;AAED,EAAA,MAAM,WAAA,EAAa,2BAAA,IAAkC,CAAA;AAGrD,EAAA,8BAAA,CAAU,EAAA,GAAM;AACd,IAAA,eAAA,CAAgB,cAAA,CAAe,KAAK,CAAC,CAAA;AAAA,EACvC,CAAA,EAAG,CAAC,KAAA,EAAO,cAAc,CAAC,CAAA;AAG1B,EAAA,MAAM,aAAA,EAAe,gCAAA;AAAA;AAAA,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AAA;AAAA,QAC5C,EAAA,KAAO;AACL,UAAA,QAAA,CAAS,SAAS,CAAA;AAAA,QACpB;AAAA,MACF,CAAA;AAGA,MAAA,GAAA,CAAI,cAAA,GAAiB,CAAA,EAAG;AACtB,QAAA,eAAA,CAAgB,CAAA;AAAA,MAClB,EAAA,KAAO;AACL,QAAA,UAAA,CAAW,QAAA,EAAU,UAAA,CAAW,eAAA,EAAiB,aAAa,CAAA;AAAA,MAChE;AAAA,IACF,CAAA;AAAA,IACA,CAAC,QAAA,EAAU,aAAA,EAAe,cAAA,EAAgB,WAAA,EAAa,SAAS;AAAA,EAClE,CAAA;AAGA,EAAA,MAAM,WAAA,EAAa,gCAAA,CAAY,EAAA,GAAM;AAEnC,IAAA,GAAA,CAAI,UAAA,CAAW,OAAA,EAAS;AACtB,MAAA,YAAA,CAAa,UAAA,CAAW,OAAO,CAAA;AAC/B,MAAA,UAAA,CAAW,QAAA,EAAU,IAAA;AAGrB,MAAA,MAAM,UAAA,EAAY,WAAA,CAAY,YAAY,CAAA;AAC1C,MAAA,QAAA,CAAS,SAAS,CAAA;AAAA,IACpB;AACA,IAAA,MAAA,CAAO,CAAA;AAAA,EACT,CAAA,EAAG,CAAC,QAAA,EAAU,MAAA,EAAQ,WAAA,EAAa,YAAY,CAAC,CAAA;AAEhD,EAAA,OAAO;AAAA,IACL,QAAA,EAAU,YAAA;AAAA,IACV,MAAA,EAAQ,UAAA;AAAA,IACR,KAAA,EAAO;AAAA,EACT,CAAA;AACF,CAAA;AD9GA;AACA;AACE;AACF,sDAAC","file":"/home/runner/work/pixels/pixels/packages/uniform/dist/chunk-BZ5OMN4Y.cjs","sourcesContent":[null,"import type { InputValueTransform } from '../useInputValueTransform/useInputValueTransform';\n\nimport { useCallback, useEffect, useRef, useState } from 'react';\n\nimport { useInputValueTransform } from '../useInputValueTransform/useInputValueTransform';\n\nexport interface UseInputValueDebounceOptions {\n /** Debounce delay in milliseconds (default: 300) */\n debounceDelay?: number;\n /** The onBlur function to call after flushing debounced value */\n onBlur: () => void;\n /** The onChange function to call with debounced value */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onChange: (...event: any[]) => void;\n /** Value transformation functions */\n transform?: InputValueTransform;\n /** Input type to handle number conversion (optional) */\n type?: 'text' | 'number' | 'password';\n /** The initial form value */\n value: string | number;\n}\n\nexport interface UseInputValueDebounceReturn {\n /** Enhanced onChange function with debouncing */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onChange: (...event: any[]) => void;\n /** Enhanced onBlur function that flushes current value immediately */\n onBlur: () => void;\n /** The field value that is displayed - updates immediately */\n value: string | number;\n}\n\n/**\n * Custom hook for debouncing input value changes with immediate blur support.\n *\n * Provides immediate visual feedback by updating the display value instantly,\n * while debouncing the actual form state changes. When the input loses focus,\n * any pending debounced changes are immediately flushed.\n *\n * **Key Features:**\n * - **Debouncing**: Delays form updates until user stops typing\n * - **Transform support**: Optional value transformation between display and form values\n * - **Number conversion**: Automatic conversion for number inputs\n * - **Immediate display updates**: UI stays responsive during debouncing\n * - **Blur flushing**: Immediately applies pending changes on blur\n *\n * @param options Configuration for debounced value handling\n * @param options.debounceDelay Delay in milliseconds (default: 300)\n * @param options.onBlur Function to call after flushing debounced value\n * @param options.onChange Function to call with debounced value\n * @param options.transform Optional transform functions for display ↔ form value conversion\n * @param options.type Input type for number conversion ('text' | 'number' | 'password')\n * @param options.value The initial form value\n * @returns Object containing enhanced onChange, onBlur, and immediate display value\n *\n * @example\n * Basic usage with debouncing:\n * ```tsx\n * const { onChange, onBlur, value } = useInputValueDebounce({\n * debounceDelay: 300,\n * onBlur: field.onBlur,\n * onChange: field.onChange,\n * value: field.value,\n * });\n * ```\n *\n * @example\n * Number input with automatic conversion:\n * ```tsx\n * const { onChange, onBlur, value } = useInputValueDebounce({\n * debounceDelay: 300,\n * onBlur: field.onBlur,\n * onChange: field.onChange,\n * type: 'number',\n * value: field.value, // Display: 123 (number), Form: 123 (number)\n * });\n * ```\n *\n * @example\n * Currency formatting with transforms:\n * ```tsx\n * const currencyTransform = {\n * displayValue: (val) => val ? `$${Number(val).toFixed(2)}` : '',\n * formValue: (val) => Number(val.replace(/[$,]/g, '')) || 0\n * };\n *\n * const { onChange, onBlur, value } = useInputValueDebounce({\n * debounceDelay: 300,\n * onBlur: field.onBlur,\n * onChange: field.onChange,\n * transform: currencyTransform,\n * value: field.value, // Display: \"$100.00\", Form: 100\n * });\n * ```\n */\nexport const useInputValueDebounce = ({\n debounceDelay = 300,\n onBlur,\n onChange,\n transform,\n type,\n value,\n}: UseInputValueDebounceOptions): UseInputValueDebounceReturn => {\n // Get conversion utilities from transform hook\n const { toDisplayValue, toFormValue } = useInputValueTransform({\n transform,\n type,\n });\n\n // Track display value for synchronous updates\n const [displayValue, setDisplayValue] = useState(() => {\n return toDisplayValue(value);\n });\n\n const timeoutRef = useRef<NodeJS.Timeout | null>(null);\n\n // Sync with external value changes\n useEffect(() => {\n setDisplayValue(toDisplayValue(value));\n }, [value, toDisplayValue]);\n\n // Enhanced onChange handler with debouncing\n const handleChange = useCallback(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (...event: any[]) => {\n // Extract the raw input value\n const rawValue = event[0]?.target?.value ?? event[0];\n\n // For transforms, user input is already in display format\n // For number types, convert strings to numbers for display\n const newDisplayValue = transform ? rawValue : toDisplayValue(rawValue);\n setDisplayValue(newDisplayValue);\n\n // Convert to form value using transform utilities\n const formValue = toFormValue(newDisplayValue);\n\n // Clear existing timeout\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n\n const executeOnChange = () => {\n // Preserve event structure if original was an event\n if (event[0]?.target) {\n const convertedEvent = {\n ...event[0],\n target: {\n ...event[0].target,\n value: formValue,\n },\n };\n onChange(convertedEvent, ...event.slice(1));\n } else {\n onChange(formValue);\n }\n };\n\n // Execute immediately or after delay\n if (debounceDelay <= 0) {\n executeOnChange();\n } else {\n timeoutRef.current = setTimeout(executeOnChange, debounceDelay);\n }\n },\n [onChange, debounceDelay, toDisplayValue, toFormValue, transform],\n );\n\n // Enhanced blur handler\n const handleBlur = useCallback(() => {\n // Flush pending changes\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = null;\n\n // Get form value from current display value\n const formValue = toFormValue(displayValue);\n onChange(formValue);\n }\n onBlur();\n }, [onChange, onBlur, toFormValue, displayValue]);\n\n return {\n onChange: handleChange,\n onBlur: handleBlur,\n value: displayValue,\n };\n};\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FormContext_default,
|
|
3
3
|
useFormContext
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-Y6NHIZ2M.js";
|
|
5
5
|
|
|
6
6
|
// src/Form/Form.tsx
|
|
7
7
|
import { cn as cn2, slugify } from "@fuf-stack/pixel-utils";
|
|
@@ -32,7 +32,7 @@ var FormDebugViewer = ({ className = void 0 }) => {
|
|
|
32
32
|
Button,
|
|
33
33
|
{
|
|
34
34
|
ariaLabel: "Enable form debug mode",
|
|
35
|
-
className: "
|
|
35
|
+
className: "fixed bottom-2.5 right-2.5 w-5 text-default-400",
|
|
36
36
|
icon: /* @__PURE__ */ jsx(FaBug, {}),
|
|
37
37
|
variant: "light",
|
|
38
38
|
onClick: () => {
|
|
@@ -67,7 +67,7 @@ var FormDebugViewer = ({ className = void 0 }) => {
|
|
|
67
67
|
/* @__PURE__ */ jsx(
|
|
68
68
|
Button,
|
|
69
69
|
{
|
|
70
|
-
className: "
|
|
70
|
+
className: "mb-4 ml-auto mr-auto",
|
|
71
71
|
icon: /* @__PURE__ */ jsx(FaBullseye, {}),
|
|
72
72
|
variant: showDebugTestIds ? "solid" : "light",
|
|
73
73
|
onClick: () => {
|
|
@@ -148,4 +148,4 @@ export {
|
|
|
148
148
|
Form_default,
|
|
149
149
|
Form_default2
|
|
150
150
|
};
|
|
151
|
-
//# sourceMappingURL=chunk-
|
|
151
|
+
//# sourceMappingURL=chunk-BZBA2YGQ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Form/Form.tsx","../src/Form/subcomponents/FormDebugViewer.tsx","../src/Form/index.ts"],"sourcesContent":["import type { VetoInstance } from '@fuf-stack/veto';\nimport type { ReactNode } from 'react';\nimport type { FieldValues, SubmitHandler } from 'react-hook-form';\nimport type { DebugModeSettings } from './subcomponents/FormContext';\n\nimport { cn, slugify } from '@fuf-stack/pixel-utils';\n\nimport FormProvider from './subcomponents/FormContext';\nimport FormDebugViewer from './subcomponents/FormDebugViewer';\n\nconst IS_TEST = process.env.NODE_ENV === 'test';\n\nexport interface FormProps {\n /** form children */\n children: ReactNode | ReactNode[];\n /** CSS class name */\n className?: string | string[];\n /** settings for from debug mode */\n debug?: DebugModeSettings;\n /** initial form values */\n initialValues?: FieldValues;\n /** name of the form */\n name?: string;\n /** form submit handler */\n onSubmit: SubmitHandler<FieldValues>;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** veto validation schema */\n validation?: VetoInstance;\n /** when the validation should be triggered */\n validationTrigger?: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';\n}\n\n/**\n * Form component that has to wrap every uniform\n */\nconst Form = ({\n children,\n className = undefined,\n debug = undefined,\n initialValues = undefined,\n name = undefined,\n onSubmit,\n testId = undefined,\n validation = undefined,\n validationTrigger = 'all',\n}: FormProps) => {\n return (\n <FormProvider\n debugModeSettings={debug}\n initialValues={initialValues}\n onSubmit={onSubmit}\n validation={validation}\n validationTrigger={validationTrigger}\n >\n {({ handleSubmit, isValid }) => {\n return (\n <div className=\"flex w-full flex-row justify-between gap-6\">\n <form\n className={cn('grow', className)}\n data-form-is-valid={isValid}\n data-testid={slugify(testId ?? name ?? '')}\n name={name}\n onSubmit={handleSubmit}\n >\n {children}\n </form>\n {/* render debug viewer when not in test environment and debug not disabled */}\n {!IS_TEST && !debug?.disable && (\n <FormDebugViewer className=\"w-96 shrink\" />\n )}\n </div>\n );\n }}\n </FormProvider>\n );\n};\n\nexport default Form;\n","import { FaTimes } from 'react-icons/fa';\nimport { FaBug, FaBullseye } from 'react-icons/fa6';\n\nimport { cn } from '@fuf-stack/pixel-utils';\nimport { Button } from '@fuf-stack/pixels/Button';\nimport { Card } from '@fuf-stack/pixels/Card';\nimport { Json } from '@fuf-stack/pixels/Json';\n\nimport { useFormContext } from '../../hooks';\n\n// import Json css (theme)\nimport '@fuf-stack/pixels/Json.css';\n\ninterface FormDebugViewerProps {\n /** CSS class name */\n className?: string;\n}\n\n/** Renders a form debug panel with information about the current form state */\nconst FormDebugViewer = ({ className = undefined }: FormDebugViewerProps) => {\n const {\n debugMode,\n formState: { isValid, isSubmitting, submitCount, isSubmitSuccessful },\n setDebugMode,\n validation: { errors },\n watch,\n } = useFormContext();\n\n const showDebugButton = debugMode === 'off';\n const showDebugCard = debugMode === 'debug' || debugMode === 'debug-testids';\n const showDebugTestIds = debugMode === 'debug-testids';\n\n // TODO: maybe use new Watch component?\n // see: https://github.com/react-hook-form/react-hook-form/pull/12986\n const values = watch();\n\n if (showDebugButton) {\n return (\n <Button\n ariaLabel=\"Enable form debug mode\"\n className=\"
|
|
1
|
+
{"version":3,"sources":["../src/Form/Form.tsx","../src/Form/subcomponents/FormDebugViewer.tsx","../src/Form/index.ts"],"sourcesContent":["import type { VetoInstance } from '@fuf-stack/veto';\nimport type { ReactNode } from 'react';\nimport type { FieldValues, SubmitHandler } from 'react-hook-form';\nimport type { DebugModeSettings } from './subcomponents/FormContext';\n\nimport { cn, slugify } from '@fuf-stack/pixel-utils';\n\nimport FormProvider from './subcomponents/FormContext';\nimport FormDebugViewer from './subcomponents/FormDebugViewer';\n\nconst IS_TEST = process.env.NODE_ENV === 'test';\n\nexport interface FormProps {\n /** form children */\n children: ReactNode | ReactNode[];\n /** CSS class name */\n className?: string | string[];\n /** settings for from debug mode */\n debug?: DebugModeSettings;\n /** initial form values */\n initialValues?: FieldValues;\n /** name of the form */\n name?: string;\n /** form submit handler */\n onSubmit: SubmitHandler<FieldValues>;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** veto validation schema */\n validation?: VetoInstance;\n /** when the validation should be triggered */\n validationTrigger?: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';\n}\n\n/**\n * Form component that has to wrap every uniform\n */\nconst Form = ({\n children,\n className = undefined,\n debug = undefined,\n initialValues = undefined,\n name = undefined,\n onSubmit,\n testId = undefined,\n validation = undefined,\n validationTrigger = 'all',\n}: FormProps) => {\n return (\n <FormProvider\n debugModeSettings={debug}\n initialValues={initialValues}\n onSubmit={onSubmit}\n validation={validation}\n validationTrigger={validationTrigger}\n >\n {({ handleSubmit, isValid }) => {\n return (\n <div className=\"flex w-full flex-row justify-between gap-6\">\n <form\n className={cn('grow', className)}\n data-form-is-valid={isValid}\n data-testid={slugify(testId ?? name ?? '')}\n name={name}\n onSubmit={handleSubmit}\n >\n {children}\n </form>\n {/* render debug viewer when not in test environment and debug not disabled */}\n {!IS_TEST && !debug?.disable && (\n <FormDebugViewer className=\"w-96 shrink\" />\n )}\n </div>\n );\n }}\n </FormProvider>\n );\n};\n\nexport default Form;\n","import { FaTimes } from 'react-icons/fa';\nimport { FaBug, FaBullseye } from 'react-icons/fa6';\n\nimport { cn } from '@fuf-stack/pixel-utils';\nimport { Button } from '@fuf-stack/pixels/Button';\nimport { Card } from '@fuf-stack/pixels/Card';\nimport { Json } from '@fuf-stack/pixels/Json';\n\nimport { useFormContext } from '../../hooks';\n\n// import Json css (theme)\nimport '@fuf-stack/pixels/Json.css';\n\ninterface FormDebugViewerProps {\n /** CSS class name */\n className?: string;\n}\n\n/** Renders a form debug panel with information about the current form state */\nconst FormDebugViewer = ({ className = undefined }: FormDebugViewerProps) => {\n const {\n debugMode,\n formState: { isValid, isSubmitting, submitCount, isSubmitSuccessful },\n setDebugMode,\n validation: { errors },\n watch,\n } = useFormContext();\n\n const showDebugButton = debugMode === 'off';\n const showDebugCard = debugMode === 'debug' || debugMode === 'debug-testids';\n const showDebugTestIds = debugMode === 'debug-testids';\n\n // TODO: maybe use new Watch component?\n // see: https://github.com/react-hook-form/react-hook-form/pull/12986\n const values = watch();\n\n if (showDebugButton) {\n return (\n <Button\n ariaLabel=\"Enable form debug mode\"\n className=\"fixed bottom-2.5 right-2.5 w-5 text-default-400\"\n icon={<FaBug />}\n variant=\"light\"\n onClick={() => {\n setDebugMode('debug');\n }}\n />\n );\n }\n\n // do not show card\n if (!showDebugCard) {\n return null;\n }\n\n return (\n <Card\n className={cn(className)}\n header={\n <div className=\"flex w-full flex-row justify-between\">\n <span className=\"text-lg\">Debug Mode</span>\n <Button\n color=\"danger\"\n icon={<FaTimes />}\n size=\"sm\"\n variant=\"light\"\n onClick={() => {\n setDebugMode('off');\n }}\n />\n </div>\n }\n >\n <Button\n className=\"mb-4 ml-auto mr-auto\"\n icon={<FaBullseye />}\n variant={showDebugTestIds ? 'solid' : 'light'}\n onClick={() => {\n setDebugMode(debugMode === 'debug' ? 'debug-testids' : 'debug');\n }}\n >\n {showDebugTestIds ? 'Hide CopyButton' : 'Show CopyButton'}\n </Button>\n <Json\n value={{\n values,\n errors: errors ?? null,\n submit: {\n isValid,\n isSubmitting,\n isSubmitSuccessful,\n submitCount,\n },\n }}\n />\n </Card>\n );\n};\n\nexport default FormDebugViewer;\n","import Form from './Form';\n\nexport type { FormProps } from './Form';\n\nexport { Form };\n\nexport default Form;\n"],"mappings":";;;;;;AAKA,SAAS,MAAAA,KAAI,eAAe;;;ACL5B,SAAS,eAAe;AACxB,SAAS,OAAO,kBAAkB;AAElC,SAAS,UAAU;AACnB,SAAS,cAAc;AACvB,SAAS,YAAY;AACrB,SAAS,YAAY;AAKrB,OAAO;AA8BO,cAkBN,YAlBM;AAtBd,IAAM,kBAAkB,CAAC,EAAE,YAAY,OAAU,MAA4B;AAC3E,QAAM;AAAA,IACJ;AAAA,IACA,WAAW,EAAE,SAAS,cAAc,aAAa,mBAAmB;AAAA,IACpE;AAAA,IACA,YAAY,EAAE,OAAO;AAAA,IACrB;AA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ADF,QAAAC,aAAA;AA/CV,IAAM,UAAU,QAAQ,IAAI,aAAa;AA0BzC,IAAM,OAAO,CAAC;AAAA,EACZ;AAAA,EACA,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,OAAO;AAAA,EACP;AAAA,EACA,SAAS;AAAA,EACT,aAAa;AAAA,EACb,oBAAoB;AACtB,MAAiB;AACf,SACE,gBAAAD;AAAA,IAAC;AAAA;AAAA,MACC,mBAAmB;AAAA,MACnB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MAEC,WAAC,EAAE,cAAc,QAAQ,MAAM;AAvDtC;AAwDQ,eACE,gBAAAC,MAAC,SAAI,WAAU,8CACb;AAAA,0BAAAD;AAAA,YAAC;AAAA;AAAA,cACC,WAAWE,IAAG,QAAQ,SAAS;AAAA,cAC/B,sBAAoB;AAAA,cACpB,eAAa,SAAQ,+BAAU,SAAV,YAAkB,EAAE;AAAA,cACzC;AAAA,cACA,UAAU;AAAA,cAET;AAAA;AAAA,UACH;AAAA,UAEC,CAAC,WAAW,EAAC,+BAAO,YACnB,gBAAAF,KAAC,2BAAgB,WAAU,eAAc;AAAA,WAE7C;AAAA,MAEJ;AAAA;AAAA,EACF;AAEJ;AAEA,IAAO,eAAQ;;;AExEf,IAAOG,gBAAQ;","names":["cn","jsx","jsxs","cn","Form_default"]}
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
useController,
|
|
3
3
|
useFormContext,
|
|
4
4
|
useInput
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-Y6NHIZ2M.js";
|
|
6
6
|
import {
|
|
7
7
|
FieldCopyTestIdButton_default
|
|
8
8
|
} from "./chunk-NTDKZW4E.js";
|
|
@@ -22,10 +22,10 @@ var switchVariants = tv({
|
|
|
22
22
|
slots: {
|
|
23
23
|
base: "",
|
|
24
24
|
endContent: "",
|
|
25
|
-
errorMessage: "
|
|
25
|
+
errorMessage: "ml-1 mt-1",
|
|
26
26
|
// see HeroUI styles for group-data condition,
|
|
27
27
|
// e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/core/theme/src/components/select.ts
|
|
28
|
-
label: 'text-foreground group-data-[invalid=true]:!text-danger group-data-[required=true]:after:
|
|
28
|
+
label: 'text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:!text-danger group-data-[required=true]:after:ml-0.5 group-data-[required=true]:after:text-danger group-data-[required=true]:after:content-["*"]',
|
|
29
29
|
outerWrapper: "place-content-center",
|
|
30
30
|
startContent: "",
|
|
31
31
|
thumb: "",
|
|
@@ -98,4 +98,4 @@ export {
|
|
|
98
98
|
Switch_default,
|
|
99
99
|
Switch_default2
|
|
100
100
|
};
|
|
101
|
-
//# sourceMappingURL=chunk-
|
|
101
|
+
//# sourceMappingURL=chunk-CHG25NCC.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Switch/Switch.tsx","../src/Switch/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { SwitchProps as HeroSwitchProps } from '@heroui/switch';\nimport type { ReactNode } from 'react';\nimport type { FieldValues } from 'react-hook-form';\n\nimport { Switch as HeroSwitch } from '@heroui/switch';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useController, useFormContext, useInput } from '../hooks';\nimport { FieldCopyTestIdButton } from '../partials/FieldCopyTestIdButton';\nimport { FieldValidationError } from '../partials/FieldValidationError';\n\nexport const switchVariants = tv({\n slots: {\n base: '',\n endContent: '',\n errorMessage: '
|
|
1
|
+
{"version":3,"sources":["../src/Switch/Switch.tsx","../src/Switch/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { SwitchProps as HeroSwitchProps } from '@heroui/switch';\nimport type { ReactNode } from 'react';\nimport type { FieldValues } from 'react-hook-form';\n\nimport { Switch as HeroSwitch } from '@heroui/switch';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useController, useFormContext, useInput } from '../hooks';\nimport { FieldCopyTestIdButton } from '../partials/FieldCopyTestIdButton';\nimport { FieldValidationError } from '../partials/FieldValidationError';\n\nexport const switchVariants = tv({\n slots: {\n base: '',\n endContent: '',\n errorMessage: 'ml-1 mt-1',\n // see HeroUI styles for group-data condition,\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/core/theme/src/components/select.ts\n label:\n 'text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:!text-danger group-data-[required=true]:after:ml-0.5 group-data-[required=true]:after:text-danger group-data-[required=true]:after:content-[\"*\"]',\n outerWrapper: 'place-content-center',\n startContent: '',\n thumb: '',\n thumbIcon: '',\n wrapper: '',\n },\n});\n\ntype VariantProps = TVProps<typeof switchVariants>;\ntype ClassName = TVClassName<typeof switchVariants>;\n\nexport interface SwitchProps extends VariantProps {\n /** CSS class name */\n className?: ClassName;\n /** whether the select should be disabled */\n disabled?: boolean;\n /** Icon to be displayed at the end of the switch (when enabled) */\n endContent?: ReactNode;\n /** component displayed next to the switch */\n label?: ReactNode;\n /** name the field is registered under */\n name: string;\n /* Size of the switch */\n size?: 'sm' | 'md' | 'lg';\n /** Icon to be displayed at the start of the switch (when disabled) */\n startContent?: ReactNode;\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 * Switch component based on [HeroUI Switch](https://www.heroui.com//docs/components/switch)\n */\nconst Switch = ({\n className = undefined,\n disabled = false,\n endContent = undefined,\n label: _label = undefined,\n name,\n size = undefined,\n startContent = undefined,\n testId: _testId = undefined,\n thumbIcon = undefined,\n}: SwitchProps) => {\n const { control, debugMode, getFieldState } = useFormContext();\n const { error, required, testId, invalid } = getFieldState(name, _testId);\n\n const { field } = useController<FieldValues>({ name, control, disabled });\n const { disabled: isDisabled, value, ref, onBlur, onChange } = field;\n\n const { label, getInputProps, getErrorMessageProps } = useInput({\n errorMessage: JSON.stringify(error),\n isInvalid: invalid,\n isRequired: required,\n label: _label,\n labelPlacement: 'outside',\n placeholder: ' ',\n });\n\n const showTestIdCopyButton = debugMode === 'debug-testids';\n\n // classNames from slots\n const variants = switchVariants();\n const classNames = variantsToClassNames(variants, className, 'outerWrapper');\n\n return (\n <div className={classNames.outerWrapper}>\n <HeroSwitch\n ref={ref}\n // see HeroUI styles for group-data condition (data-invalid),\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/components/select/src/use-select.ts\n aria-describedby={getInputProps()['aria-describedby']}\n classNames={classNames}\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n endContent={endContent}\n isDisabled={isDisabled}\n isSelected={!!value}\n name={name}\n onBlur={onBlur}\n onValueChange={onChange}\n required={required}\n size={size}\n startContent={startContent}\n thumbIcon={thumbIcon}\n value={value}\n >\n {label}\n {showTestIdCopyButton ? (\n <FieldCopyTestIdButton testId={testId} />\n ) : null}\n </HeroSwitch>\n {error ? (\n <div className={classNames.errorMessage}>\n <div {...getErrorMessageProps()}>\n <FieldValidationError error={error} testId={testId} />\n </div>\n </div>\n ) : null}\n </div>\n );\n};\n\nexport default Switch;\n","import Switch from './Switch';\n\nexport type { SwitchProps } from './Switch';\n\nexport { Switch };\n\nexport default Switch;\n"],"mappings":";;;;;;;;;;;;;;;;;AAKA,SAAS,UAAU,kBAAkB;AAErC,SAAS,IAAI,4BAA4B;AAoFnC,SAuBI,KAvBJ;AA9EC,IAAM,iBAAiB,GAAG;AAAA,EAC/B,OAAO;AAAA,IACL,MAAM;AAAA,IACN,YAAY;AAAA,IACZ,cAAc;AAAA;AAAA;AAAA,IAGd,OACE;AAAA,IACF,cAAc;AAAA,IACd,cAAc;AAAA,IACd,OAAO;AAAA,IACP,WAAW;AAAA,IACX,SAAS;AAAA,EACX;AACF,CAAC;AA6BD,IAAM,SAAS,CAAC;AAAA,EACd,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,aAAa;AAAA,EACb,OAAO,SAA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AAOA,kBAAQ;","names":["Switch_default"]}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
useFieldArray,
|
|
6
6
|
useFormContext,
|
|
7
7
|
useUniformField
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-Y6NHIZ2M.js";
|
|
9
9
|
import {
|
|
10
10
|
FieldValidationError_default
|
|
11
11
|
} from "./chunk-ELYGQTXB.js";
|
|
@@ -389,6 +389,7 @@ var FieldArrayValidationError = ({
|
|
|
389
389
|
var FieldArrayValidationError_default = FieldArrayValidationError;
|
|
390
390
|
|
|
391
391
|
// src/FieldArray/subcomponents/SortContext.tsx
|
|
392
|
+
import { useFormContext as useFormContext2 } from "react-hook-form";
|
|
392
393
|
import {
|
|
393
394
|
closestCenter,
|
|
394
395
|
DndContext,
|
|
@@ -408,10 +409,12 @@ import {
|
|
|
408
409
|
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
409
410
|
var SortContext = ({
|
|
410
411
|
children,
|
|
411
|
-
sortable,
|
|
412
412
|
fields,
|
|
413
|
-
move
|
|
413
|
+
move,
|
|
414
|
+
name,
|
|
415
|
+
sortable
|
|
414
416
|
}) => {
|
|
417
|
+
const { trigger } = useFormContext2();
|
|
415
418
|
const sensors = useSensors(
|
|
416
419
|
useSensor(PointerSensor),
|
|
417
420
|
useSensor(KeyboardSensor)
|
|
@@ -429,6 +432,7 @@ var SortContext = ({
|
|
|
429
432
|
return field.id === (over == null ? void 0 : over.id);
|
|
430
433
|
});
|
|
431
434
|
move(oldIndex, newIndex);
|
|
435
|
+
trigger(name);
|
|
432
436
|
}
|
|
433
437
|
};
|
|
434
438
|
return /* @__PURE__ */ jsx8(
|
|
@@ -469,7 +473,9 @@ var fieldArrayVariants = tv({
|
|
|
469
473
|
// base styles
|
|
470
474
|
"flex items-center justify-center text-default-600",
|
|
471
475
|
// fixed height/no round corners/center align
|
|
472
|
-
"h-full rounded-none"
|
|
476
|
+
"h-full rounded-none",
|
|
477
|
+
// focus styles - inset ring
|
|
478
|
+
"outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus"
|
|
473
479
|
],
|
|
474
480
|
/** class for the append button */
|
|
475
481
|
appendButton: [
|
|
@@ -582,9 +588,16 @@ var FieldArray = (_a) => {
|
|
|
582
588
|
}, 200);
|
|
583
589
|
}, [fields.length]);
|
|
584
590
|
const elementInitialValue = flat ? { [flatArrayKey]: _elementInitialValue != null ? _elementInitialValue : null } : _elementInitialValue != null ? _elementInitialValue : {};
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
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
|
+
);
|
|
588
601
|
const prefersReducedMotion = useReducedMotion2();
|
|
589
602
|
const disableAnimationRef = useRef(true);
|
|
590
603
|
useEffect(() => {
|
|
@@ -605,52 +618,61 @@ var FieldArray = (_a) => {
|
|
|
605
618
|
),
|
|
606
619
|
fields.length ? (
|
|
607
620
|
/* list wrapper */
|
|
608
|
-
/* @__PURE__ */ jsx9("div", { className: cn8(className.listWrapper), children: /* @__PURE__ */ jsx9(
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
const
|
|
617
|
-
const
|
|
618
|
-
const
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
621
|
+
/* @__PURE__ */ jsx9("div", { className: cn8(className.listWrapper), children: /* @__PURE__ */ jsx9(
|
|
622
|
+
SortContext_default,
|
|
623
|
+
{
|
|
624
|
+
fields,
|
|
625
|
+
move,
|
|
626
|
+
name,
|
|
627
|
+
sortable,
|
|
628
|
+
children: /* @__PURE__ */ jsx9("ul", { className: className.list, "data-testid": testId, children: fields.map((field, index) => {
|
|
629
|
+
const elementName = flat ? `${name}.${index}.${flatArrayKey}` : `${name}.${index}`;
|
|
630
|
+
const elementTestId = `${testId}_${index}`;
|
|
631
|
+
const elementMethods = {
|
|
632
|
+
append: () => {
|
|
633
|
+
append(elementInitialValue);
|
|
634
|
+
},
|
|
635
|
+
duplicate: () => {
|
|
636
|
+
const values = getValues(name);
|
|
637
|
+
const currentValue = values[index];
|
|
638
|
+
const nextValue = flat ? { [flatArrayKey]: currentValue } : currentValue;
|
|
639
|
+
insert(index + 1, nextValue);
|
|
640
|
+
},
|
|
641
|
+
insert: () => {
|
|
642
|
+
insert(index + 1, elementInitialValue);
|
|
643
|
+
},
|
|
644
|
+
remove: () => {
|
|
645
|
+
remove(index);
|
|
646
|
+
}
|
|
647
|
+
};
|
|
648
|
+
return /* @__PURE__ */ jsx9(
|
|
649
|
+
FieldArrayElement_default,
|
|
650
|
+
{
|
|
651
|
+
className,
|
|
652
|
+
disableAnimation: disableAnimationRef.current,
|
|
653
|
+
duplicate,
|
|
654
|
+
elementMarginBottom,
|
|
655
|
+
fields,
|
|
656
|
+
id: field.id,
|
|
657
|
+
index,
|
|
658
|
+
insertAfter,
|
|
659
|
+
lastNotDeletable: lastElementNotRemovable,
|
|
660
|
+
methods: elementMethods,
|
|
661
|
+
sortable,
|
|
662
|
+
testId: elementTestId,
|
|
663
|
+
children: children({
|
|
664
|
+
index,
|
|
665
|
+
length: fields.length,
|
|
666
|
+
methods: elementMethods,
|
|
667
|
+
name: elementName,
|
|
668
|
+
testId: elementTestId
|
|
669
|
+
})
|
|
670
|
+
},
|
|
671
|
+
field.id
|
|
672
|
+
);
|
|
673
|
+
}) })
|
|
674
|
+
}
|
|
675
|
+
) })
|
|
654
676
|
) : null,
|
|
655
677
|
/* @__PURE__ */ jsx9(
|
|
656
678
|
ElementAppendButton_default,
|
|
@@ -680,4 +702,4 @@ export {
|
|
|
680
702
|
FieldArray_default,
|
|
681
703
|
FieldArray_default2
|
|
682
704
|
};
|
|
683
|
-
//# sourceMappingURL=chunk-
|
|
705
|
+
//# sourceMappingURL=chunk-CROGVLLB.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 { useEffect, useRef } from 'react';\n\nimport { useReducedMotion } from '@fuf-stack/pixel-motion';\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { flatArrayKey } from '../helpers';\nimport { useFieldArray, useUniformField } from '../hooks';\nimport { useFormContext } from '../hooks/useFormContext/useFormContext';\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 rounded-b-small rounded-t-none',\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 { control, error, getValues, invalid, testId } = useUniformField({\n name,\n showInvalidWhen: 'immediate',\n ...uniformFieldProps,\n });\n\n const { fields, append, remove, insert, move } = useFieldArray({\n control,\n name,\n });\n\n const { trigger, setValue } = useFormContext();\n\n // Validate array-level constraints immediately when length changes\n useEffect(() => {\n setTimeout(() => {\n // Trigger validation for the array field so max/min errors appear instantly\n trigger(name);\n }, 200);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [fields.length]);\n\n // Prepare initial element value based on mode\n // - flat=true: arrays of primitives → object with flatArrayKey and null value by default\n // - flat=false: arrays of objects → empty object by default\n const elementInitialValue = flat\n ? { [flatArrayKey]: _elementInitialValue ?? null }\n : (_elementInitialValue ?? {});\n\n // When lastElementNotRemovable is set and the field array is empty,\n // add an initial element to ensure there's always at least one visible element\n useEffect(\n () => {\n if (lastElementNotRemovable && fields.length === 0) {\n // use setValue instead of append to avoid focusing added element\n setValue(name, [elementInitialValue]);\n }\n },\n // only run once when the component mounts\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [],\n );\n\n // Track initial render to prevent animating elements on\n // first render cycle or when user prefers reduced motion\n const prefersReducedMotion = useReducedMotion();\n const disableAnimationRef = useRef(true);\n useEffect(() => {\n if (!prefersReducedMotion) {\n disableAnimationRef.current = false;\n }\n }, [prefersReducedMotion]);\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={disableAnimationRef.current}\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 {/* append elements button */}\n <ElementAppendButton\n appendButtonText={appendButtonText}\n testId={`${testId}_append_button`}\n className={cn(\n className.appendButton,\n // only round bottom corners if there are no errors below\n // @ts-expect-error - error._errors exists but not typed\n { 'rounded-none': invalid && error?._errors },\n )}\n onClick={() => {\n append(elementInitialValue);\n }}\n />\n\n {/* top level field array errors */}\n <FieldArrayValidationError name={name} />\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 {lastNotDeletable && fields.length === 1 ? null : (\n <ElementRemoveButton\n className={className.removeButton}\n testId={`${testId}_remove_button`}\n onClick={() => {\n if (disableAnimation) {\n methods.remove();\n } else {\n setIsVisible(false);\n }\n }}\n />\n )}\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 { cn } from '@fuf-stack/pixel-utils';\nimport { Button } from '@fuf-stack/pixels';\n\ninterface ElementRemoveButtonProps {\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 ElementRemoveButton = ({\n className = undefined,\n onClick,\n testId = undefined,\n}: ElementRemoveButtonProps) => {\n return (\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\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/rounded corners\n 'block rounded-b-small 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,WAAW,cAAc;AAElC,SAAS,oBAAAA,yBAAwB;AACjC,SAAS,MAAAC,KAAI,IAAI,4BAA4B;;;ACJ7C,SAAS,cAAc;AAEvB,SAAS,UAAU;AACnB,SAAS,cAAc;AAoBnB,SAQE,KARF;AAPJ,IAAM,sBAAsB,CAAC;AAAA,EAC3B,mBAAmB;AAAA,EACnB,YAAY;AAAA,EACZ;AAAA,EACA,SAAS;AACX,MAAgC;AAC9B,SACE;AAAA,IAAC;AAAA;AAAA,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AM;AACZ,uBAAO,QAAQ,GAAG,mBAAmB;AAAA,cACvC;AAAA,cACA,QAAQ,MAAM;AACZ,uBAAO,KAAK;AAAA,cACd;AAAA,YACF;AAEA,mBACE,gBAAAA;AAAA,cAAC;AAAA;AAAA,gBAEC;AAAA,gBACA,kBAAkB,oBAAoB;AAAA,gBACtC;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;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,QAAQ,GAAG,MAAM;AAAA,QACjB,WAAWG;AAAA,UACT,UAAU;AAAA;AAAA;AAAA,UAGV,EAAE,gBAAgB,YAAW,+BAAO,SAAQ;AAAA,QAC9C;AAAA,QACA,SAAS,MAAM;AACb,iBAAO,mBAAmB;AAAA,QAC5B;AAAA;AAAA,IACF;AAAA,IAGA,gBAAAH,KAAC,qCAA0B,MAAY;AAAA,KACzC;AAEJ;AAEA,IAAO,qBAAQ;;;AStRf,IAAOI,sBAAQ;","names":["useReducedMotion","cn","useSortable","cn","cn","jsx","FaTimes","cn","Button","jsx","cn","jsx","cn","jsx","jsxs","useSortable","cn","cn","jsx","cn","AnimatePresence","motion","cn","jsx","AnimatePresence","motion","cn","useFormContext","jsx","jsx","jsxs","useReducedMotion","cn","FieldArray_default"]}
|