@zayne-labs/ui-react 0.9.15 → 0.9.16

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.
@@ -1,5 +1,5 @@
1
1
  import { cnMerge } from './chunk-OHG7GB7O.js';
2
- import { slot_parts_exports } from './chunk-Y5VBSXZS.js';
2
+ import { slot_parts_exports } from './chunk-D6QZA3UT.js';
3
3
  import { __export } from './chunk-PZ5AY32C.js';
4
4
  import * as React from 'react';
5
5
 
@@ -41,5 +41,5 @@ __export(card_parts_exports, {
41
41
  });
42
42
 
43
43
  export { CardContent, CardDescription, CardFooter, CardHeader, CardRoot, CardTitle, card_parts_exports };
44
- //# sourceMappingURL=chunk-KLEJZWKY.js.map
45
- //# sourceMappingURL=chunk-KLEJZWKY.js.map
44
+ //# sourceMappingURL=chunk-6QJYHPBL.js.map
45
+ //# sourceMappingURL=chunk-6QJYHPBL.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/ui/card/card.tsx","../../src/components/ui/card/card-parts.ts"],"names":[],"mappings":";;;;;AAMO,SAAS,SACf,KACC,EAAA;AACD,EAAA,MAAM,EAAE,EAAI,EAAA,OAAA,GAAU,SAAW,EAAA,GAAG,aAAgB,GAAA,KAAA;AAEpD,EAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,OAAS,EAAA,EAAA,GAAG,WAAa,EAAA,CAAA;AAClC;AAEO,SAAS,WACf,KACC,EAAA;AACD,EAAA,MAAM,EAAE,EAAI,EAAA,OAAA,GAAU,QAAU,EAAA,GAAG,aAAgB,GAAA,KAAA;AAEnD,EAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,OAAS,EAAA,EAAA,GAAG,WAAa,EAAA,CAAA;AAClC;AAEO,SAAS,UAAqD,KAAmC,EAAA;AACvG,EAAA,MAAM,EAAE,EAAI,EAAA,OAAA,GAAU,MAAM,SAAW,EAAA,GAAG,aAAgB,GAAA,KAAA;AAE1D,EAAO,uBAAA,KAAA,CAAA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n\";\nimport type { PolymorphicProps } from \"@zayne-labs/toolkit-react/utils\";\n\nexport function CardRoot<TElement extends React.ElementType = \"article\">(\n\tprops: PolymorphicProps<TElement>\n) {\n\tconst { as: Element = \"article\", ...restOfProps } = props;\n\n\treturn <Element {...restOfProps} />;\n}\n\nexport function CardHeader<TElement extends React.ElementType = \"header\">(\n\tprops: PolymorphicProps<TElement>\n) {\n\tconst { as: Element = \"header\", ...restOfProps } = props;\n\n\treturn <Element {...restOfProps} />;\n}\n\nexport function CardTitle<TElement extends React.ElementType = \"h3\">(props: PolymorphicProps<TElement>) {\n\tconst { as: Element = \"h3\", className, ...restOfProps } = props;\n\n\treturn <Element className={cnMerge(\"font-semibold\", className)} {...restOfProps} />;\n}\n\nexport function CardDescription<TElement extends React.ElementType = \"p\">(\n\tprops: PolymorphicProps<TElement>\n) {\n\tconst { as: Element = \"p\", className, ...restOfProps } = props;\n\n\treturn (\n\t\t<Element className={cnMerge(\"text-shadcn-muted-foreground text-sm\", className)} {...restOfProps} />\n\t);\n}\n\nexport function CardContent<TElement extends React.ElementType = \"div\">(\n\tprops: PolymorphicProps<TElement>\n) {\n\tconst { as: Element = \"div\", ...restOfProps } = props;\n\n\treturn <Element {...restOfProps} />;\n}\n\nexport function CardFooter<TElement extends React.ElementType = \"footer\">(\n\tprops: PolymorphicProps<TElement, { asChild?: boolean }>\n) {\n\tconst { as: Element = \"footer\", asChild, ...restOfProps } = props;\n\n\tconst Component = asChild ? Slot.Root : Element;\n\n\treturn <Component {...restOfProps} />;\n}\n","export {\n\tCardContent as Content,\n\tCardDescription as Description,\n\tCardFooter as Footer,\n\tCardHeader as Header,\n\tCardRoot as Root,\n\tCardTitle as Title,\n} from \"./card\";\n"]}
1
+ {"version":3,"sources":["../../src/components/ui/card/card.tsx","../../src/components/ui/card/card-parts.ts"],"names":[],"mappings":";;;;;AAMO,SAAS,SACf,KACC,EAAA;AACD,EAAA,MAAM,EAAE,EAAI,EAAA,OAAA,GAAU,SAAW,EAAA,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ExC,EAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,SAAW,EAAA,EAAA,GAAG,WAAa,EAAA,CAAA;AACpC;;;ACtDA,IAAA,kBAAA,GAAA;AAAA,QAAA,CAAA,kBAAA,EAAA;AAAA,EAAA,OAAA,EAAA,MAAA,WAAA;AAAA,EAAA,WAAA,EAAA,MAAA,eAAA;AAAA,EAAA,MAAA,EAAA,MAAA,UAAA;AAAA,EAAA,MAAA,EAAA,MAAA,UAAA;AAAA,EAAA,IAAA,EAAA,MAAA,QAAA;AAAA,EAAA,KAAA,EAAA,MAAA;AAAA,CAAA,CAAA","file":"chunk-6QJYHPBL.js","sourcesContent":["import * as React from \"react\";\n\nimport { Slot } from \"@/components/common/slot\";\nimport { cnMerge } from \"@/lib/utils/cn\";\nimport type { PolymorphicProps } from \"@zayne-labs/toolkit-react/utils\";\n\nexport function CardRoot<TElement extends React.ElementType = \"article\">(\n\tprops: PolymorphicProps<TElement>\n) {\n\tconst { as: Element = \"article\", ...restOfProps } = props;\n\n\treturn <Element {...restOfProps} />;\n}\n\nexport function CardHeader<TElement extends React.ElementType = \"header\">(\n\tprops: PolymorphicProps<TElement>\n) {\n\tconst { as: Element = \"header\", ...restOfProps } = props;\n\n\treturn <Element {...restOfProps} />;\n}\n\nexport function CardTitle<TElement extends React.ElementType = \"h3\">(props: PolymorphicProps<TElement>) {\n\tconst { as: Element = \"h3\", className, ...restOfProps } = props;\n\n\treturn <Element className={cnMerge(\"font-semibold\", className)} {...restOfProps} />;\n}\n\nexport function CardDescription<TElement extends React.ElementType = \"p\">(\n\tprops: PolymorphicProps<TElement>\n) {\n\tconst { as: Element = \"p\", className, ...restOfProps } = props;\n\n\treturn (\n\t\t<Element className={cnMerge(\"text-shadcn-muted-foreground text-sm\", className)} {...restOfProps} />\n\t);\n}\n\nexport function CardContent<TElement extends React.ElementType = \"div\">(\n\tprops: PolymorphicProps<TElement>\n) {\n\tconst { as: Element = \"div\", ...restOfProps } = props;\n\n\treturn <Element {...restOfProps} />;\n}\n\nexport function CardFooter<TElement extends React.ElementType = \"footer\">(\n\tprops: PolymorphicProps<TElement, { asChild?: boolean }>\n) {\n\tconst { as: Element = \"footer\", asChild, ...restOfProps } = props;\n\n\tconst Component = asChild ? Slot.Root : Element;\n\n\treturn <Component {...restOfProps} />;\n}\n","export {\n\tCardContent as Content,\n\tCardDescription as Description,\n\tCardFooter as Footer,\n\tCardHeader as Header,\n\tCardRoot as Root,\n\tCardTitle as Title,\n} from \"./card\";\n"]}
@@ -31,16 +31,17 @@ function SlotRoot(props) {
31
31
  }
32
32
  function SlotClone(props) {
33
33
  const { children, ref: forwardedRef, ...restOfSlotProps } = props;
34
- if (!isValidElement(children)) {
35
- return Children.count(children) > 1 ? Children.only(null) : null;
34
+ const resolvedChildren = isArray(children) && children.length === 1 ? children[0] : children;
35
+ if (!isValidElement(resolvedChildren)) {
36
+ return Children.count(resolvedChildren) > 1 ? Children.only(null) : null;
36
37
  }
37
- const childRef = children.props.ref ?? children.ref;
38
+ const childRef = resolvedChildren.props.ref ?? resolvedChildren.ref;
38
39
  const mergedRef = forwardedRef ? composeRefs(forwardedRef, childRef) : childRef;
39
40
  const clonedProps = {
40
- ...mergeProps(restOfSlotProps, children.props),
41
- ...children.type !== Fragment && { ref: mergedRef }
41
+ ...mergeProps(restOfSlotProps, resolvedChildren.props),
42
+ ...resolvedChildren.type !== Fragment && { ref: mergedRef }
42
43
  };
43
- return cloneElement(children, clonedProps);
44
+ return cloneElement(resolvedChildren, clonedProps);
44
45
  }
45
46
 
46
47
  // src/components/common/slot/slot-parts.ts
@@ -51,5 +52,5 @@ __export(slot_parts_exports, {
51
52
  });
52
53
 
53
54
  export { SlotRoot, SlotSlottable, slot_parts_exports };
54
- //# sourceMappingURL=chunk-Y5VBSXZS.js.map
55
- //# sourceMappingURL=chunk-Y5VBSXZS.js.map
55
+ //# sourceMappingURL=chunk-D6QZA3UT.js.map
56
+ //# sourceMappingURL=chunk-D6QZA3UT.js.map
@@ -0,0 +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,EAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,SAAA,EAAA,EAAW,GAAG,eAAA,EAAA,EAAkB,QAAS,CAAA;AAClD;AASA,SAAS,UAAU,KAAuB,EAAA;AACzC,EAAA,MAAM,EAAE,QAAU,EAAA,GAAA,EAAK,YAAc,EAAA,GAAG,iBAAoB,GAAA,KAAA;AAE5D,EAAM,MAAA,gBAAA,GAAmB,QAAQ,QAAQ,CAAA,IAAK,SAAS,MAAW,KAAA,CAAA,GAAI,QAAS,CAAA,CAAC,CAAI,GAAA,QAAA;AAEpF,EAAI,IAAA,CAAC,cAA6B,CAAA,gBAAgB,CAAG,EAAA;AACpD,IAAO,OAAA,QAAA,CAAS,MAAM,gBAAgB,CAAA,GAAI,IAAI,QAAS,CAAA,IAAA,CAAK,IAAI,CAAI,GAAA,IAAA;AAAA;AAGrE,EAAA,MAAM,QAAY,GAAA,gBAAA,CAAiB,KAAM,CAAA,GAAA,IACpC,gBAA6C,CAAA,GAAA;AAElD,EAAA,MAAM,SAAY,GAAA,YAAA,GAAe,WAAY,CAAA,YAAA,EAAc,QAAQ,CAAI,GAAA,QAAA;AAEvE,EAAA,MAAM,WAAc,GAAA;AAAA,IACnB,GAAG,UAAA,CAAW,eAAiB,EAAA,gBAAA,CAAiB,KAAK,CAAA;AAAA,IACrD,GAAI,gBAAiB,CAAA,IAAA,KAASA,QAAiB,IAAA,EAAE,KAAK,SAAU;AAAA,GACjE;AAEA,EAAO,OAAA,YAAA,CAAa,kBAAkB,WAAW,CAAA;AAClD;;;ACpFA,IAAA,kBAAA,GAAA;AAAA,QAAA,CAAA,kBAAA,EAAA;AAAA,EAAA,IAAA,EAAA,MAAA,QAAA;AAAA,EAAA,SAAA,EAAA,MAAA;AAAA,CAAA,CAAA","file":"chunk-D6QZA3UT.js","sourcesContent":["import * as React from \"react\";\n\nimport { type InferProps, composeRefs, mergeProps } from \"@zayne-labs/toolkit-react/utils\";\nimport { isArray } from \"@zayne-labs/toolkit-type-helpers\";\nimport { Children, Fragment as ReactFragment, cloneElement, isValidElement } from \"react\";\n\ntype SlotProps = InferProps<HTMLElement>;\n\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * ----------------------------------------------------------------------------------------------- */\n\nexport function SlotSlottable({ children }: Pick<SlotProps, \"children\">) {\n\treturn children;\n}\n\nconst isSlottable = (child: React.ReactNode): child is React.ReactElement => {\n\treturn isValidElement(child) && child.type === SlotSlottable;\n};\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * ----------------------------------------------------------------------------------------------- */\n\nexport function SlotRoot(props: SlotProps) {\n\tconst { children, ...restOfSlotProps } = props;\n\n\tconst childrenArray = isArray<React.ReactNode>(children) ? children : [children];\n\tconst slottable = childrenArray.find((element) => isSlottable(element));\n\n\tif (slottable) {\n\t\t// == The new element to render is the one passed as a child of `Slottable`\n\t\tconst newElement = (slottable.props as SlotProps).children;\n\n\t\tif (Children.count(newElement) > 1) {\n\t\t\treturn Children.only(null);\n\t\t}\n\n\t\tconst newElementChildren = childrenArray.map((child) => {\n\t\t\tif (child === slottable) {\n\t\t\t\t// == Because the new element will be the one rendered, we are only interested in grabbing its children (`newElement.props.children`)\n\t\t\t\treturn isValidElement<SlotProps>(newElement) && newElement.props.children;\n\t\t\t}\n\n\t\t\treturn child;\n\t\t});\n\n\t\treturn (\n\t\t\t<SlotClone {...restOfSlotProps}>\n\t\t\t\t{isValidElement(newElement) && cloneElement(newElement, undefined, newElementChildren)}\n\t\t\t</SlotClone>\n\t\t);\n\t}\n\n\treturn <SlotClone {...restOfSlotProps}>{children}</SlotClone>;\n}\n\ntype SlotCloneProps = {\n\tchildren: React.ReactNode;\n\tref?: React.RefObject<HTMLElement>;\n};\n\ntype UnknownProps = Record<string, unknown>;\n\nfunction SlotClone(props: SlotCloneProps) {\n\tconst { children, ref: forwardedRef, ...restOfSlotProps } = props;\n\n\tconst resolvedChildren = isArray(children) && children.length === 1 ? children[0] : children;\n\n\tif (!isValidElement<UnknownProps>(resolvedChildren)) {\n\t\treturn Children.count(resolvedChildren) > 1 ? Children.only(null) : null;\n\t}\n\n\tconst childRef = (resolvedChildren.props.ref\n\t\t?? (resolvedChildren as unknown as UnknownProps).ref) as React.Ref<HTMLElement>;\n\n\tconst mergedRef = forwardedRef ? composeRefs(forwardedRef, childRef) : childRef;\n\n\tconst clonedProps = {\n\t\t...mergeProps(restOfSlotProps, resolvedChildren.props),\n\t\t...(resolvedChildren.type !== ReactFragment && { ref: mergedRef }),\n\t};\n\n\treturn cloneElement(resolvedChildren, clonedProps);\n}\n","export { SlotRoot as Root, SlotSlottable as Slottable } from \"./slot\";\n"]}
@@ -1,6 +1,6 @@
1
1
  import { cnMerge } from './chunk-OHG7GB7O.js';
2
2
  import { withSlotNameAndSymbol, getSlotMap } from './chunk-N4274N5K.js';
3
- import { slot_parts_exports } from './chunk-Y5VBSXZS.js';
3
+ import { slot_parts_exports } from './chunk-D6QZA3UT.js';
4
4
  import { __export } from './chunk-PZ5AY32C.js';
5
5
  import * as React from 'react';
6
6
  import { isValidElement, Fragment, useRef, useState, useCallback, useMemo } from 'react';
@@ -332,5 +332,5 @@ __export(drop_zone_parts_exports, {
332
332
  });
333
333
 
334
334
  export { DropZoneContainer, DropZoneContext, DropZoneImagePreview, DropZoneInput, DropZoneRoot, drop_zone_parts_exports, useDropZone, useDropZoneContext };
335
- //# sourceMappingURL=chunk-2DHK7TOF.js.map
336
- //# sourceMappingURL=chunk-2DHK7TOF.js.map
335
+ //# sourceMappingURL=chunk-MRYXZN2P.js.map
336
+ //# sourceMappingURL=chunk-MRYXZN2P.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/ui/drop-zone/drop-context.ts","../../src/components/ui/drop-zone/utils.ts","../../src/components/ui/drop-zone/use-drop-zone.ts","../../src/components/ui/drop-zone/drop-zone.tsx","../../src/components/ui/drop-zone/drop-zone-parts.ts"],"names":["ReactFragment"],"mappings":";;;;;;;;;;;AAKO,IAAM,CAAC,uBAAA,EAAyB,kBAAkB,CAAA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,CAAA,aAAA,CAAC,uBAAiB,QAAS,CAAA;AAAA;AAGnC,EAAO,OAAA,QAAA;AACR,CAAC;;;AC9GD,IAAA,uBAAA,GAAA;AAAA,QAAA,CAAA,uBAAA,EAAA;AAAA,EAAA,SAAA,EAAA,MAAA,iBAAA;AAAA,EAAA,OAAA,EAAA,MAAA,eAAA;AAAA,EAAA,YAAA,EAAA,MAAA,oBAAA;AAAA,EAAA,KAAA,EAAA,MAAA,aAAA;AAAA,EAAA,IAAA,EAAA,MAAA;AAAA,CAAA,CAAA","file":"chunk-2DHK7TOF.js","sourcesContent":["import { createCustomContext } from \"@zayne-labs/toolkit-react\";\nimport type { UseDropZoneResult } from \"./use-drop-zone\";\n\ntype DropZoneContext = UseDropZoneResult;\n\nexport const [DropZoneContextProvider, useDropZoneContext] = createCustomContext<DropZoneContext>({\n\thookName: \"useDropZoneContext\",\n\tname: \"DropZoneContext\",\n\tproviderName: \"DropZoneRoot\",\n});\n","import { type FileMeta, createImagePreview } from \"@zayne-labs/toolkit-core\";\nimport { isFile } from \"@zayne-labs/toolkit-type-helpers\";\nimport type { FileWithPreview } from \"./use-drop-zone\";\n\nexport const generateUniqueId = (file: File | FileMeta): string => {\n\tif (!isFile(file)) {\n\t\treturn file.id;\n\t}\n\n\treturn `${file.name}-(${Math.round(performance.now())})-${crypto.randomUUID().slice(0, 8)}`;\n};\n\nexport const createObjectURL = (file: File, disallowPreviewForNonImageFiles: boolean) => {\n\tif (disallowPreviewForNonImageFiles && !file.type.startsWith(\"image/\")) return;\n\n\treturn createImagePreview(file);\n};\n\nexport const clearObjectURL = (\n\tfileWithPreview: FileWithPreview | undefined,\n\tdisallowPreviewForNonImageFiles: boolean\n) => {\n\tif (!isFile(fileWithPreview?.file)) return;\n\n\tif (disallowPreviewForNonImageFiles && !fileWithPreview.file.type.startsWith(\"image/\")) return;\n\n\tif (!fileWithPreview.preview) return;\n\n\tURL.revokeObjectURL(fileWithPreview.preview);\n};\n","import { cnMerge } from \"@/lib/utils/cn\";\nimport { dataAttr } from \"@zayne-labs/toolkit-core\";\nimport {\n\ttype FileMeta,\n\ttype FileValidationErrorContext,\n\ttype FileValidationOptions,\n\thandleFileValidation,\n\ttoArray,\n} from \"@zayne-labs/toolkit-core\";\nimport { useCallbackRef } from \"@zayne-labs/toolkit-react\";\nimport {\n\ttype InferProps,\n\tcomposeRefs,\n\tcomposeTwoEventHandlers,\n\tmergeTwoProps,\n} from \"@zayne-labs/toolkit-react/utils\";\nimport { type Prettify, isString } from \"@zayne-labs/toolkit-type-helpers\";\nimport { useCallback, useMemo, useRef, useState } from \"react\";\nimport { clearObjectURL, createObjectURL, generateUniqueId } from \"./utils\";\n\nexport type ContainerProps = InferProps<HTMLElement> & {\n\tclassNames?: {\n\t\tbase?: string;\n\t\tisDragging?: string;\n\t};\n};\n\nexport type InputProps = InferProps<\"input\">;\n\nexport type FileWithPreview = {\n\t/**\n\t * File object or file metadata\n\t */\n\tfile: File | FileMeta;\n\t/**\n\t * Unique ID for the file\n\t */\n\tid: string;\n\t/**\n\t * Preview URL for the file\n\t * - Will be undefined if `disallowPreviewForNonImageFiles` is set to `true` and the file is not an image\n\t * - Can also be undefined if `URL.createObjectURL` fails\n\t */\n\tpreview: string | undefined;\n};\n\nexport type DropZoneState = {\n\t/**\n\t * List of validation errors\n\t */\n\terrors: FileValidationErrorContext[];\n\t/**\n\t * List of files with their preview URLs and unique IDs\n\t */\n\tfilesWithPreview: FileWithPreview[];\n\t/**\n\t * Whether or not a file is currently being dragged over the drop zone\n\t */\n\tisDragging: boolean;\n};\n\ntype ChangeOrDragEvent = React.ChangeEvent<HTMLInputElement> | React.DragEvent<HTMLElement>;\n\nexport type DropZoneActions = {\n\taddFiles: (fileList: File[] | FileList | null, event?: ChangeOrDragEvent) => void;\n\tclearErrors: () => void;\n\tclearFiles: () => void;\n\thandleDragEnter: (event: React.DragEvent<HTMLElement>) => void;\n\thandleDragLeave: (event: React.DragEvent<HTMLElement>) => void;\n\thandleDragOver: (event: React.DragEvent<HTMLElement>) => void;\n\thandleFileUpload: (event: ChangeOrDragEvent) => void;\n\topenFilePicker: () => void;\n\tremoveFile: (fileToRemoveOrId: string | FileWithPreview) => void;\n};\n\nexport type UseDropZoneResult = {\n\tdropZoneActions: DropZoneActions;\n\tdropZoneState: DropZoneState;\n\tgetContainerProps: (containerProps?: ContainerProps) => ContainerProps;\n\tgetInputProps: (inputProps?: InputProps) => InputProps;\n\tinputRef: React.RefObject<HTMLInputElement | null>;\n};\n\nexport type UseDropZoneProps = {\n\t/**\n\t * Allowed file types to be uploaded.\n\t */\n\tallowedFileTypes?: string[];\n\n\t/**\n\t * CSS classes to apply to the various parts of the drop zone\n\t */\n\tclassNames?: Prettify<ContainerProps[\"classNames\"] & { input?: string }>;\n\n\t/**\n\t * Whether to disallow duplicate files\n\t * @default true\n\t */\n\tdisallowDuplicates?: boolean;\n\n\t/**\n\t * Whether to disallow preview for non-image files\n\t * @default true\n\t */\n\tdisallowPreviewForNonImageFiles?: boolean;\n\n\t/**\n\t * Extra props to pass to the container element\n\t */\n\textraContainerProps?: ContainerProps;\n\n\t/**\n\t * Extra props to pass to the input element\n\t */\n\textraInputProps?: InputProps;\n\n\t/**\n\t * Initial files to populate the drop zone\n\t */\n\tinitialFiles?: FileMeta | FileMeta[] | null;\n\n\t/**\n\t * Maximum number of files that can be uploaded.\n\t */\n\tmaxFileCount?: number;\n\n\t/**\n\t * Maximum file size in MB\n\t */\n\tmaxFileSize?: number;\n\n\t/**\n\t * Whether to allow multiple files to be uploaded\n\t */\n\tmultiple?: boolean;\n\n\t/**\n\t * Callback function to be called when internal files state changes\n\t */\n\tonFilesChange?: (context: { filesWithPreview: FileWithPreview[] }) => void;\n\n\t/**\n\t * Callback function to be called when the render props change\n\t */\n\tonRenderPropsChange?: (props: UseDropZoneResult) => void;\n\n\t/**\n\t * Callback function to be called when new files are uploaded\n\t */\n\tonUpload?: (context: { event: ChangeOrDragEvent; filesWithPreview: FileWithPreview[] }) => void;\n\n\t/**\n\t * Callback function to be called on each file upload as they occur\n\t */\n\tonUploadError?: FileValidationOptions[\"onError\"];\n\n\t/**\n\t * Callback function to be called once after all file upload errors have occurred\n\t */\n\tonUploadErrors?: FileValidationOptions[\"onErrors\"];\n\n\t/**\n\t * Callback function to be called on file upload success\n\t */\n\tonUploadSuccess?: FileValidationOptions[\"onSuccess\"];\n\n\t/**\n\t * Custom validation function.\n\t *\n\t * If the function returns false, the file will be rejected\n\t */\n\tvalidator?: NonNullable<FileValidationOptions[\"validationSettings\"]>[\"validator\"];\n\n\t/**\n\t * Custom validation function that runs after all file validation has occurred\n\t */\n\tvalidatorForAllFiles?: FileValidationOptions[\"validatorForAllFiles\"];\n\n\t/**\n\t * Whether to allow the default file picker via the file input element\n\t * @default true\n\t */\n\twithDefaultFilePicker?: boolean;\n};\n\nexport const useDropZone = (props?: UseDropZoneProps): UseDropZoneResult => {\n\tconst {\n\t\tallowedFileTypes,\n\t\tclassNames,\n\t\tdisallowDuplicates = true,\n\t\tdisallowPreviewForNonImageFiles = true,\n\t\textraContainerProps,\n\t\textraInputProps,\n\t\tinitialFiles,\n\t\tmaxFileCount,\n\t\tmaxFileSize,\n\t\tmultiple,\n\t\tonFilesChange,\n\t\tonRenderPropsChange,\n\t\tonUpload,\n\t\tonUploadError,\n\t\tonUploadErrors,\n\t\tonUploadSuccess,\n\t\tvalidator,\n\t\tvalidatorForAllFiles,\n\t\twithDefaultFilePicker = true,\n\t} = props ?? {};\n\n\tconst inputRef = useRef<HTMLInputElement>(null);\n\n\tconst initialFileArray = toArray(initialFiles).filter(Boolean);\n\n\tconst [dropZoneState, setDropZoneState] = useState<DropZoneState>({\n\t\terrors: [],\n\t\tfilesWithPreview: initialFileArray.map((fileMeta) => ({\n\t\t\tfile: fileMeta,\n\t\t\tid: fileMeta.id,\n\t\t\tpreview: fileMeta.url,\n\t\t})),\n\t\tisDragging: false,\n\t});\n\n\tconst toggleIsDragging = (value: boolean) => {\n\t\tsetDropZoneState((prevState) => ({ ...prevState, isDragging: value }));\n\t};\n\n\tconst addFiles: DropZoneActions[\"addFiles\"] = useCallbackRef((fileList, event) => {\n\t\tif (!fileList || fileList.length === 0) {\n\t\t\tconsole.warn(\"No file selected!\");\n\t\t\treturn;\n\t\t}\n\n\t\t// Clear existing errors when new files are uploaded\n\t\tclearErrors();\n\n\t\t// In single file mode, clear existing files first\n\t\tif (!multiple) {\n\t\t\tclearFiles();\n\t\t}\n\n\t\tconst { errors, validFiles } = handleFileValidation({\n\t\t\texistingFiles: dropZoneState.filesWithPreview.map((fileWithPreview) => fileWithPreview.file),\n\t\t\tnewFiles: fileList,\n\t\t\tonError: onUploadError,\n\t\t\tonErrors: onUploadErrors,\n\t\t\tonSuccess: onUploadSuccess,\n\t\t\tvalidationSettings: {\n\t\t\t\tallowedFileTypes,\n\t\t\t\tdisallowDuplicates,\n\t\t\t\tmaxFileCount,\n\t\t\t\tmaxFileSize,\n\t\t\t\tvalidator,\n\t\t\t},\n\t\t\tvalidatorForAllFiles,\n\t\t});\n\n\t\tif (validFiles.length === 0) {\n\t\t\tsetDropZoneState((prevState) => ({ ...prevState, errors }));\n\t\t\treturn;\n\t\t}\n\n\t\tconst filesWithPreview: FileWithPreview[] = validFiles.map((file) => ({\n\t\t\tfile,\n\t\t\tid: generateUniqueId(file),\n\t\t\tpreview: createObjectURL(file, disallowPreviewForNonImageFiles),\n\t\t}));\n\n\t\t// == Only call onUpload callback if event is provided, which indicates that new files were uploaded from an event handler\n\n\t\tif (event) {\n\t\t\tonUpload?.({ event, filesWithPreview });\n\t\t}\n\n\t\tconst newFileUploadState = {\n\t\t\t...dropZoneState,\n\t\t\terrors,\n\t\t\t...(event?.type === \"drop\" && { isDragging: false }),\n\t\t\tfilesWithPreview: multiple\n\t\t\t\t? [...dropZoneState.filesWithPreview, ...filesWithPreview]\n\t\t\t\t: filesWithPreview,\n\t\t} satisfies DropZoneState;\n\n\t\tonFilesChange?.({ filesWithPreview: newFileUploadState.filesWithPreview });\n\n\t\tsetDropZoneState(newFileUploadState);\n\n\t\t// == Reset input value after adding files\n\t\tinputRef.current && (inputRef.current.value = \"\");\n\t});\n\n\tconst clearFiles: DropZoneActions[\"clearFiles\"] = useCallbackRef(() => {\n\t\t// == Clean up object URLs if any\n\t\tdropZoneState.filesWithPreview.forEach((fileWithPreview) =>\n\t\t\tclearObjectURL(fileWithPreview, disallowPreviewForNonImageFiles)\n\t\t);\n\n\t\tconst newFileUploadState = {\n\t\t\t...dropZoneState,\n\t\t\terrors: [],\n\t\t\tfilesWithPreview: [],\n\t\t} satisfies DropZoneState;\n\n\t\tonFilesChange?.({ filesWithPreview: newFileUploadState.filesWithPreview });\n\n\t\tsetDropZoneState(newFileUploadState);\n\n\t\t// == Reset input value after clearing files\n\t\tinputRef.current && (inputRef.current.value = \"\");\n\t});\n\n\tconst removeFile: DropZoneActions[\"removeFile\"] = useCallbackRef((fileToRemoveOrId) => {\n\t\tconst actualFileToRemove = isString(fileToRemoveOrId)\n\t\t\t? dropZoneState.filesWithPreview.find((file) => file.id === fileToRemoveOrId)\n\t\t\t: fileToRemoveOrId;\n\n\t\tif (!actualFileToRemove) return;\n\n\t\tclearObjectURL(actualFileToRemove, disallowPreviewForNonImageFiles);\n\n\t\tconst newFilesWithPreview = dropZoneState.filesWithPreview.filter(\n\t\t\t(file) => file.id !== actualFileToRemove.id\n\t\t);\n\n\t\tonFilesChange?.({ filesWithPreview: newFilesWithPreview });\n\n\t\tsetDropZoneState({\n\t\t\t...dropZoneState,\n\t\t\terrors: [],\n\t\t\tfilesWithPreview: newFilesWithPreview,\n\t\t});\n\t});\n\n\tconst clearErrors: DropZoneActions[\"clearErrors\"] = useCallbackRef(() => {\n\t\tsetDropZoneState((prevState) => ({ ...prevState, errors: [] }));\n\t});\n\n\tconst handleFileUpload: DropZoneActions[\"handleFileUpload\"] = useCallbackRef((event) => {\n\t\tif (inputRef.current?.disabled) return;\n\n\t\tif (event.type === \"drop\") {\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\t\t}\n\n\t\tconst fileList =\n\t\t\tevent.type === \"drop\"\n\t\t\t\t? (event as React.DragEvent).dataTransfer.files\n\t\t\t\t: (event as React.ChangeEvent<HTMLInputElement>).target.files;\n\n\t\t// == In single file mode, only use the first file\n\t\tif (!multiple) {\n\t\t\tconst firstFile = fileList?.[0];\n\n\t\t\tfirstFile && addFiles([firstFile], event);\n\n\t\t\treturn;\n\t\t}\n\n\t\taddFiles(fileList, event);\n\t});\n\n\tconst handleDragEnter: DropZoneActions[\"handleDragEnter\"] = useCallbackRef((event) => {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t\ttoggleIsDragging(true);\n\t});\n\n\tconst handleDragOver: DropZoneActions[\"handleDragOver\"] = useCallbackRef((event) => {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t\ttoggleIsDragging(true);\n\t});\n\n\tconst handleDragLeave: DropZoneActions[\"handleDragLeave\"] = useCallbackRef((event) => {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t\ttoggleIsDragging(false);\n\t});\n\n\tconst openFilePicker: DropZoneActions[\"openFilePicker\"] = useCallbackRef(() => {\n\t\tinputRef.current?.click();\n\t});\n\n\tconst getContainerProps: UseDropZoneResult[\"getContainerProps\"] = useCallback(\n\t\t(containerProps) => {\n\t\t\tconst mergedContainerProps = mergeTwoProps(extraContainerProps, containerProps);\n\n\t\t\treturn {\n\t\t\t\t...mergedContainerProps,\n\t\t\t\tclassName: cnMerge(\n\t\t\t\t\t\"relative isolate flex flex-col\",\n\t\t\t\t\tmergedContainerProps.className,\n\t\t\t\t\tclassNames?.base,\n\t\t\t\t\tdropZoneState.isDragging && [\n\t\t\t\t\t\t\"opacity-60\",\n\t\t\t\t\t\tclassNames?.isDragging,\n\t\t\t\t\t\tcontainerProps?.classNames?.isDragging,\n\t\t\t\t\t]\n\t\t\t\t),\n\t\t\t\t\"data-dragging\": dataAttr(dropZoneState.isDragging),\n\t\t\t\t\"data-scope\": \"dropzone\",\n\t\t\t\t// eslint-disable-next-line perfectionist/sort-objects -- I need data-scope to be first\n\t\t\t\t\"data-part\": \"container\",\n\t\t\t\t\"data-slot\": \"dropzone-container\",\n\t\t\t\tonDragEnter: composeTwoEventHandlers(handleDragEnter, mergedContainerProps.onDragEnter),\n\t\t\t\tonDragLeave: composeTwoEventHandlers(handleDragLeave, mergedContainerProps.onDragLeave),\n\t\t\t\tonDragOver: composeTwoEventHandlers(handleDragOver, mergedContainerProps.onDragOver),\n\t\t\t\tonDrop: composeTwoEventHandlers(handleFileUpload, mergedContainerProps.onDrop),\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tclassNames?.base,\n\t\t\tclassNames?.isDragging,\n\t\t\textraContainerProps,\n\t\t\tdropZoneState.isDragging,\n\t\t\thandleDragEnter,\n\t\t\thandleDragLeave,\n\t\t\thandleDragOver,\n\t\t\thandleFileUpload,\n\t\t]\n\t);\n\n\tconst getInputProps: UseDropZoneResult[\"getInputProps\"] = useCallback(\n\t\t(inputProps) => {\n\t\t\tconst mergedInputProps = mergeTwoProps(extraInputProps, inputProps);\n\n\t\t\treturn {\n\t\t\t\t...mergedInputProps,\n\t\t\t\taccept: allowedFileTypes ? allowedFileTypes.join(\", \") : mergedInputProps.accept,\n\t\t\t\tclassName: cnMerge(\n\t\t\t\t\twithDefaultFilePicker ? \"absolute inset-0 z-[100] cursor-pointer opacity-0\" : \"hidden\",\n\t\t\t\t\tclassNames?.input,\n\t\t\t\t\tmergedInputProps.className\n\t\t\t\t),\n\t\t\t\t\"data-dragging\": dataAttr(dropZoneState.isDragging),\n\t\t\t\t\"data-scope\": \"dropzone\",\n\t\t\t\t// eslint-disable-next-line perfectionist/sort-objects -- I need data-scope to be first\n\t\t\t\t\"data-part\": \"input\",\n\t\t\t\t\"data-slot\": \"dropzone-input\",\n\t\t\t\tmultiple: multiple ?? mergedInputProps.multiple,\n\t\t\t\tonChange: composeTwoEventHandlers(handleFileUpload, mergedInputProps.onChange),\n\t\t\t\tref: composeRefs(inputRef, mergedInputProps.ref),\n\t\t\t\ttype: \"file\",\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tallowedFileTypes,\n\t\t\tclassNames?.input,\n\t\t\textraInputProps,\n\t\t\tdropZoneState.isDragging,\n\t\t\thandleFileUpload,\n\t\t\tmultiple,\n\t\t\twithDefaultFilePicker,\n\t\t]\n\t);\n\n\tconst savedOnRenderPropsChange = useCallbackRef(onRenderPropsChange);\n\n\tconst dropZoneResult = useMemo(() => {\n\t\tconst propsForRenderFn = {\n\t\t\tdropZoneActions: {\n\t\t\t\taddFiles,\n\t\t\t\tclearErrors,\n\t\t\t\tclearFiles,\n\t\t\t\thandleDragEnter,\n\t\t\t\thandleDragLeave,\n\t\t\t\thandleDragOver,\n\t\t\t\thandleFileUpload,\n\t\t\t\topenFilePicker,\n\t\t\t\tremoveFile,\n\t\t\t},\n\t\t\tdropZoneState,\n\t\t\tgetContainerProps,\n\t\t\tgetInputProps,\n\t\t\tinputRef,\n\t\t} satisfies UseDropZoneResult;\n\n\t\tsavedOnRenderPropsChange(propsForRenderFn);\n\n\t\treturn propsForRenderFn;\n\t}, [\n\t\tsavedOnRenderPropsChange,\n\t\taddFiles,\n\t\tclearErrors,\n\t\tclearFiles,\n\t\tdropZoneState,\n\t\tgetInputProps,\n\t\tgetContainerProps,\n\t\thandleDragEnter,\n\t\thandleDragLeave,\n\t\thandleDragOver,\n\t\thandleFileUpload,\n\t\topenFilePicker,\n\t\tremoveFile,\n\t]);\n\n\treturn dropZoneResult;\n};\n","\"use client\";\n\nimport * as React from \"react\";\n\nimport { Slot } from \"@/components/common\";\nimport { type GetSlotComponentProps, getSlotMap, withSlotNameAndSymbol } from \"@/lib/utils/getSlotMap\";\nimport type { DiscriminatedRenderProps, PolymorphicProps } from \"@zayne-labs/toolkit-react/utils\";\nimport { isArray, isFunction } from \"@zayne-labs/toolkit-type-helpers\";\nimport { Fragment as ReactFragment, isValidElement } from \"react\";\nimport { DropZoneContextProvider, useDropZoneContext } from \"./drop-context\";\nimport {\n\ttype ContainerProps,\n\ttype InputProps,\n\ttype UseDropZoneProps,\n\ttype UseDropZoneResult,\n\tuseDropZone,\n} from \"./use-drop-zone\";\n\nexport type DropZoneRenderPropType = DiscriminatedRenderProps<\n\tReact.ReactNode | ((props: UseDropZoneResult) => React.ReactNode)\n>;\n\nexport type DropZoneRootProps = DropZoneRenderPropType\n\t& UseDropZoneProps & {\n\t\t/**\n\t\t * Controls whether to include internal elements (root and input) or not.\n\t\t */\n\t\twithInternalElements?: boolean;\n\t};\n\nexport function DropZoneRoot(props: DropZoneRootProps) {\n\tconst { children, render, withInternalElements = true, ...restOfProps } = props;\n\n\tconst dropZone = useDropZone(restOfProps);\n\n\tconst ContainerComponent = withInternalElements ? DropZoneContainer : ReactFragment;\n\tconst InputComponent = withInternalElements ? DropZoneInput : ReactFragment;\n\n\tconst selectedChildren = children ?? render;\n\n\tconst resolvedChildren = isFunction(selectedChildren) ? selectedChildren(dropZone) : selectedChildren;\n\n\tconst couldChildrenContainSlots =\n\t\tisArray(resolvedChildren)\n\t\t|| (isValidElement(resolvedChildren) && resolvedChildren.type === ReactFragment);\n\n\tconst slots =\n\t\twithInternalElements && couldChildrenContainSlots\n\t\t\t? getSlotMap<SlotComponentProps>(resolvedChildren)\n\t\t\t: ({ default: resolvedChildren } as ReturnType<typeof getSlotMap<SlotComponentProps>>);\n\n\treturn (\n\t\t<DropZoneContextProvider value={dropZone}>\n\t\t\t<ContainerComponent>\n\t\t\t\t<InputComponent />\n\n\t\t\t\t{slots.default}\n\t\t\t</ContainerComponent>\n\n\t\t\t{slots.preview}\n\t\t</DropZoneContextProvider>\n\t);\n}\n\ntype DropZoneInputProps = InputProps & { asChild?: boolean };\n\nexport function DropZoneInput(props: DropZoneInputProps) {\n\tconst { asChild, ...restOfProps } = props;\n\n\tconst dropZoneContext = useDropZoneContext();\n\n\tconst Component = asChild ? Slot.Root : \"input\";\n\n\treturn <Component {...dropZoneContext.getInputProps(restOfProps)} />;\n}\n\ntype DropZoneContainerProps = ContainerProps & { asChild?: boolean };\n\nexport function DropZoneContainer<TElement extends React.ElementType = \"div\">(\n\tprops: PolymorphicProps<TElement, DropZoneContainerProps>\n) {\n\tconst { as: Element = \"div\", asChild, ...restOfProps } = props;\n\n\tconst dropZoneContext = useDropZoneContext();\n\n\tconst Component = asChild ? Slot.Root : Element;\n\n\treturn <Component {...dropZoneContext.getContainerProps(restOfProps)} />;\n}\n\ntype RenderPropFn = (props: UseDropZoneResult) => React.ReactNode;\n\ntype SlotComponentProps = GetSlotComponentProps<\"preview\", React.ReactNode | RenderPropFn>;\n\nexport function DropZoneContext(props: { children: RenderPropFn }) {\n\tconst { children } = props;\n\n\tconst dropZoneContext = useDropZoneContext();\n\n\treturn children(dropZoneContext);\n}\n\nexport const DropZoneImagePreview = withSlotNameAndSymbol<SlotComponentProps>(\"preview\", (props) => {\n\tconst { children } = props;\n\n\tif (isFunction(children)) {\n\t\treturn <DropZoneContext>{children}</DropZoneContext>;\n\t}\n\n\treturn children;\n});\n","export {\n\tDropZoneRoot as Root,\n\tDropZoneImagePreview as ImagePreview,\n\tDropZoneContext as Context,\n\tDropZoneInput as Input,\n\tDropZoneContainer as Container,\n} from \"./drop-zone\";\n"]}
1
+ {"version":3,"sources":["../../src/components/ui/drop-zone/drop-context.ts","../../src/components/ui/drop-zone/utils.ts","../../src/components/ui/drop-zone/use-drop-zone.ts","../../src/components/ui/drop-zone/drop-zone.tsx","../../src/components/ui/drop-zone/drop-zone-parts.ts"],"names":["ReactFragment"],"mappings":";;;;;;;;;;;AAKO,IAAM,CAAC,uBAAA,EAAyB,kBAAkB,CAAA,GAAI,mBAAqC,CAAA;AAAA,EACjG,QAAU,EAAA,oBAAA;AAAA,EACV,IAAM,EAAA,iBAAA;AAAA,EACN,YAAc,EAAA;AACf,CAAC;ACLM,IAAM,gBAAA,GAAmB,CAAC,IAAkC,KAAA;AAClE,EAAI,IAAA,CAAC,MAAO,CAAA,IAAI,CAAG,E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AA;AAAA,EAAA,YAAA,EAAA,MAAA,oBAAA;AAAA,EAAA,KAAA,EAAA,MAAA,aAAA;AAAA,EAAA,IAAA,EAAA,MAAA;AAAA,CAAA,CAAA","file":"chunk-MRYXZN2P.js","sourcesContent":["import { createCustomContext } from \"@zayne-labs/toolkit-react\";\nimport type { UseDropZoneResult } from \"./use-drop-zone\";\n\ntype DropZoneContext = UseDropZoneResult;\n\nexport const [DropZoneContextProvider, useDropZoneContext] = createCustomContext<DropZoneContext>({\n\thookName: \"useDropZoneContext\",\n\tname: \"DropZoneContext\",\n\tproviderName: \"DropZoneRoot\",\n});\n","import { type FileMeta, createImagePreview } from \"@zayne-labs/toolkit-core\";\nimport { isFile } from \"@zayne-labs/toolkit-type-helpers\";\nimport type { FileWithPreview } from \"./use-drop-zone\";\n\nexport const generateUniqueId = (file: File | FileMeta): string => {\n\tif (!isFile(file)) {\n\t\treturn file.id;\n\t}\n\n\treturn `${file.name}-(${Math.round(performance.now())})-${crypto.randomUUID().slice(0, 8)}`;\n};\n\nexport const createObjectURL = (file: File, disallowPreviewForNonImageFiles: boolean) => {\n\tif (disallowPreviewForNonImageFiles && !file.type.startsWith(\"image/\")) return;\n\n\treturn createImagePreview(file);\n};\n\nexport const clearObjectURL = (\n\tfileWithPreview: FileWithPreview | undefined,\n\tdisallowPreviewForNonImageFiles: boolean\n) => {\n\tif (!isFile(fileWithPreview?.file)) return;\n\n\tif (disallowPreviewForNonImageFiles && !fileWithPreview.file.type.startsWith(\"image/\")) return;\n\n\tif (!fileWithPreview.preview) return;\n\n\tURL.revokeObjectURL(fileWithPreview.preview);\n};\n","import { cnMerge } from \"@/lib/utils/cn\";\nimport { dataAttr } from \"@zayne-labs/toolkit-core\";\nimport {\n\ttype FileMeta,\n\ttype FileValidationErrorContext,\n\ttype FileValidationOptions,\n\thandleFileValidation,\n\ttoArray,\n} from \"@zayne-labs/toolkit-core\";\nimport { useCallbackRef } from \"@zayne-labs/toolkit-react\";\nimport {\n\ttype InferProps,\n\tcomposeRefs,\n\tcomposeTwoEventHandlers,\n\tmergeTwoProps,\n} from \"@zayne-labs/toolkit-react/utils\";\nimport { type Prettify, isString } from \"@zayne-labs/toolkit-type-helpers\";\nimport { useCallback, useMemo, useRef, useState } from \"react\";\nimport { clearObjectURL, createObjectURL, generateUniqueId } from \"./utils\";\n\nexport type ContainerProps = InferProps<HTMLElement> & {\n\tclassNames?: {\n\t\tbase?: string;\n\t\tisDragging?: string;\n\t};\n};\n\nexport type InputProps = InferProps<\"input\">;\n\nexport type FileWithPreview = {\n\t/**\n\t * File object or file metadata\n\t */\n\tfile: File | FileMeta;\n\t/**\n\t * Unique ID for the file\n\t */\n\tid: string;\n\t/**\n\t * Preview URL for the file\n\t * - Will be undefined if `disallowPreviewForNonImageFiles` is set to `true` and the file is not an image\n\t * - Can also be undefined if `URL.createObjectURL` fails\n\t */\n\tpreview: string | undefined;\n};\n\nexport type DropZoneState = {\n\t/**\n\t * List of validation errors\n\t */\n\terrors: FileValidationErrorContext[];\n\t/**\n\t * List of files with their preview URLs and unique IDs\n\t */\n\tfilesWithPreview: FileWithPreview[];\n\t/**\n\t * Whether or not a file is currently being dragged over the drop zone\n\t */\n\tisDragging: boolean;\n};\n\ntype ChangeOrDragEvent = React.ChangeEvent<HTMLInputElement> | React.DragEvent<HTMLElement>;\n\nexport type DropZoneActions = {\n\taddFiles: (fileList: File[] | FileList | null, event?: ChangeOrDragEvent) => void;\n\tclearErrors: () => void;\n\tclearFiles: () => void;\n\thandleDragEnter: (event: React.DragEvent<HTMLElement>) => void;\n\thandleDragLeave: (event: React.DragEvent<HTMLElement>) => void;\n\thandleDragOver: (event: React.DragEvent<HTMLElement>) => void;\n\thandleFileUpload: (event: ChangeOrDragEvent) => void;\n\topenFilePicker: () => void;\n\tremoveFile: (fileToRemoveOrId: string | FileWithPreview) => void;\n};\n\nexport type UseDropZoneResult = {\n\tdropZoneActions: DropZoneActions;\n\tdropZoneState: DropZoneState;\n\tgetContainerProps: (containerProps?: ContainerProps) => ContainerProps;\n\tgetInputProps: (inputProps?: InputProps) => InputProps;\n\tinputRef: React.RefObject<HTMLInputElement | null>;\n};\n\nexport type UseDropZoneProps = {\n\t/**\n\t * Allowed file types to be uploaded.\n\t */\n\tallowedFileTypes?: string[];\n\n\t/**\n\t * CSS classes to apply to the various parts of the drop zone\n\t */\n\tclassNames?: Prettify<ContainerProps[\"classNames\"] & { input?: string }>;\n\n\t/**\n\t * Whether to disallow duplicate files\n\t * @default true\n\t */\n\tdisallowDuplicates?: boolean;\n\n\t/**\n\t * Whether to disallow preview for non-image files\n\t * @default true\n\t */\n\tdisallowPreviewForNonImageFiles?: boolean;\n\n\t/**\n\t * Extra props to pass to the container element\n\t */\n\textraContainerProps?: ContainerProps;\n\n\t/**\n\t * Extra props to pass to the input element\n\t */\n\textraInputProps?: InputProps;\n\n\t/**\n\t * Initial files to populate the drop zone\n\t */\n\tinitialFiles?: FileMeta | FileMeta[] | null;\n\n\t/**\n\t * Maximum number of files that can be uploaded.\n\t */\n\tmaxFileCount?: number;\n\n\t/**\n\t * Maximum file size in MB\n\t */\n\tmaxFileSize?: number;\n\n\t/**\n\t * Whether to allow multiple files to be uploaded\n\t */\n\tmultiple?: boolean;\n\n\t/**\n\t * Callback function to be called when internal files state changes\n\t */\n\tonFilesChange?: (context: { filesWithPreview: FileWithPreview[] }) => void;\n\n\t/**\n\t * Callback function to be called when the render props change\n\t */\n\tonRenderPropsChange?: (props: UseDropZoneResult) => void;\n\n\t/**\n\t * Callback function to be called when new files are uploaded\n\t */\n\tonUpload?: (context: { event: ChangeOrDragEvent; filesWithPreview: FileWithPreview[] }) => void;\n\n\t/**\n\t * Callback function to be called on each file upload as they occur\n\t */\n\tonUploadError?: FileValidationOptions[\"onError\"];\n\n\t/**\n\t * Callback function to be called once after all file upload errors have occurred\n\t */\n\tonUploadErrors?: FileValidationOptions[\"onErrors\"];\n\n\t/**\n\t * Callback function to be called on file upload success\n\t */\n\tonUploadSuccess?: FileValidationOptions[\"onSuccess\"];\n\n\t/**\n\t * Custom validation function.\n\t *\n\t * If the function returns false, the file will be rejected\n\t */\n\tvalidator?: NonNullable<FileValidationOptions[\"validationSettings\"]>[\"validator\"];\n\n\t/**\n\t * Custom validation function that runs after all file validation has occurred\n\t */\n\tvalidatorForAllFiles?: FileValidationOptions[\"validatorForAllFiles\"];\n\n\t/**\n\t * Whether to allow the default file picker via the file input element\n\t * @default true\n\t */\n\twithDefaultFilePicker?: boolean;\n};\n\nexport const useDropZone = (props?: UseDropZoneProps): UseDropZoneResult => {\n\tconst {\n\t\tallowedFileTypes,\n\t\tclassNames,\n\t\tdisallowDuplicates = true,\n\t\tdisallowPreviewForNonImageFiles = true,\n\t\textraContainerProps,\n\t\textraInputProps,\n\t\tinitialFiles,\n\t\tmaxFileCount,\n\t\tmaxFileSize,\n\t\tmultiple,\n\t\tonFilesChange,\n\t\tonRenderPropsChange,\n\t\tonUpload,\n\t\tonUploadError,\n\t\tonUploadErrors,\n\t\tonUploadSuccess,\n\t\tvalidator,\n\t\tvalidatorForAllFiles,\n\t\twithDefaultFilePicker = true,\n\t} = props ?? {};\n\n\tconst inputRef = useRef<HTMLInputElement>(null);\n\n\tconst initialFileArray = toArray(initialFiles).filter(Boolean);\n\n\tconst [dropZoneState, setDropZoneState] = useState<DropZoneState>({\n\t\terrors: [],\n\t\tfilesWithPreview: initialFileArray.map((fileMeta) => ({\n\t\t\tfile: fileMeta,\n\t\t\tid: fileMeta.id,\n\t\t\tpreview: fileMeta.url,\n\t\t})),\n\t\tisDragging: false,\n\t});\n\n\tconst toggleIsDragging = (value: boolean) => {\n\t\tsetDropZoneState((prevState) => ({ ...prevState, isDragging: value }));\n\t};\n\n\tconst addFiles: DropZoneActions[\"addFiles\"] = useCallbackRef((fileList, event) => {\n\t\tif (!fileList || fileList.length === 0) {\n\t\t\tconsole.warn(\"No file selected!\");\n\t\t\treturn;\n\t\t}\n\n\t\t// Clear existing errors when new files are uploaded\n\t\tclearErrors();\n\n\t\t// In single file mode, clear existing files first\n\t\tif (!multiple) {\n\t\t\tclearFiles();\n\t\t}\n\n\t\tconst { errors, validFiles } = handleFileValidation({\n\t\t\texistingFiles: dropZoneState.filesWithPreview.map((fileWithPreview) => fileWithPreview.file),\n\t\t\tnewFiles: fileList,\n\t\t\tonError: onUploadError,\n\t\t\tonErrors: onUploadErrors,\n\t\t\tonSuccess: onUploadSuccess,\n\t\t\tvalidationSettings: {\n\t\t\t\tallowedFileTypes,\n\t\t\t\tdisallowDuplicates,\n\t\t\t\tmaxFileCount,\n\t\t\t\tmaxFileSize,\n\t\t\t\tvalidator,\n\t\t\t},\n\t\t\tvalidatorForAllFiles,\n\t\t});\n\n\t\tif (validFiles.length === 0) {\n\t\t\tsetDropZoneState((prevState) => ({ ...prevState, errors }));\n\t\t\treturn;\n\t\t}\n\n\t\tconst filesWithPreview: FileWithPreview[] = validFiles.map((file) => ({\n\t\t\tfile,\n\t\t\tid: generateUniqueId(file),\n\t\t\tpreview: createObjectURL(file, disallowPreviewForNonImageFiles),\n\t\t}));\n\n\t\t// == Only call onUpload callback if event is provided, which indicates that new files were uploaded from an event handler\n\n\t\tif (event) {\n\t\t\tonUpload?.({ event, filesWithPreview });\n\t\t}\n\n\t\tconst newFileUploadState = {\n\t\t\t...dropZoneState,\n\t\t\terrors,\n\t\t\t...(event?.type === \"drop\" && { isDragging: false }),\n\t\t\tfilesWithPreview: multiple\n\t\t\t\t? [...dropZoneState.filesWithPreview, ...filesWithPreview]\n\t\t\t\t: filesWithPreview,\n\t\t} satisfies DropZoneState;\n\n\t\tonFilesChange?.({ filesWithPreview: newFileUploadState.filesWithPreview });\n\n\t\tsetDropZoneState(newFileUploadState);\n\n\t\t// == Reset input value after adding files\n\t\tinputRef.current && (inputRef.current.value = \"\");\n\t});\n\n\tconst clearFiles: DropZoneActions[\"clearFiles\"] = useCallbackRef(() => {\n\t\t// == Clean up object URLs if any\n\t\tdropZoneState.filesWithPreview.forEach((fileWithPreview) =>\n\t\t\tclearObjectURL(fileWithPreview, disallowPreviewForNonImageFiles)\n\t\t);\n\n\t\tconst newFileUploadState = {\n\t\t\t...dropZoneState,\n\t\t\terrors: [],\n\t\t\tfilesWithPreview: [],\n\t\t} satisfies DropZoneState;\n\n\t\tonFilesChange?.({ filesWithPreview: newFileUploadState.filesWithPreview });\n\n\t\tsetDropZoneState(newFileUploadState);\n\n\t\t// == Reset input value after clearing files\n\t\tinputRef.current && (inputRef.current.value = \"\");\n\t});\n\n\tconst removeFile: DropZoneActions[\"removeFile\"] = useCallbackRef((fileToRemoveOrId) => {\n\t\tconst actualFileToRemove = isString(fileToRemoveOrId)\n\t\t\t? dropZoneState.filesWithPreview.find((file) => file.id === fileToRemoveOrId)\n\t\t\t: fileToRemoveOrId;\n\n\t\tif (!actualFileToRemove) return;\n\n\t\tclearObjectURL(actualFileToRemove, disallowPreviewForNonImageFiles);\n\n\t\tconst newFilesWithPreview = dropZoneState.filesWithPreview.filter(\n\t\t\t(file) => file.id !== actualFileToRemove.id\n\t\t);\n\n\t\tonFilesChange?.({ filesWithPreview: newFilesWithPreview });\n\n\t\tsetDropZoneState({\n\t\t\t...dropZoneState,\n\t\t\terrors: [],\n\t\t\tfilesWithPreview: newFilesWithPreview,\n\t\t});\n\t});\n\n\tconst clearErrors: DropZoneActions[\"clearErrors\"] = useCallbackRef(() => {\n\t\tsetDropZoneState((prevState) => ({ ...prevState, errors: [] }));\n\t});\n\n\tconst handleFileUpload: DropZoneActions[\"handleFileUpload\"] = useCallbackRef((event) => {\n\t\tif (inputRef.current?.disabled) return;\n\n\t\tif (event.type === \"drop\") {\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\t\t}\n\n\t\tconst fileList =\n\t\t\tevent.type === \"drop\"\n\t\t\t\t? (event as React.DragEvent).dataTransfer.files\n\t\t\t\t: (event as React.ChangeEvent<HTMLInputElement>).target.files;\n\n\t\t// == In single file mode, only use the first file\n\t\tif (!multiple) {\n\t\t\tconst firstFile = fileList?.[0];\n\n\t\t\tfirstFile && addFiles([firstFile], event);\n\n\t\t\treturn;\n\t\t}\n\n\t\taddFiles(fileList, event);\n\t});\n\n\tconst handleDragEnter: DropZoneActions[\"handleDragEnter\"] = useCallbackRef((event) => {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t\ttoggleIsDragging(true);\n\t});\n\n\tconst handleDragOver: DropZoneActions[\"handleDragOver\"] = useCallbackRef((event) => {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t\ttoggleIsDragging(true);\n\t});\n\n\tconst handleDragLeave: DropZoneActions[\"handleDragLeave\"] = useCallbackRef((event) => {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t\ttoggleIsDragging(false);\n\t});\n\n\tconst openFilePicker: DropZoneActions[\"openFilePicker\"] = useCallbackRef(() => {\n\t\tinputRef.current?.click();\n\t});\n\n\tconst getContainerProps: UseDropZoneResult[\"getContainerProps\"] = useCallback(\n\t\t(containerProps) => {\n\t\t\tconst mergedContainerProps = mergeTwoProps(extraContainerProps, containerProps);\n\n\t\t\treturn {\n\t\t\t\t...mergedContainerProps,\n\t\t\t\tclassName: cnMerge(\n\t\t\t\t\t\"relative isolate flex flex-col\",\n\t\t\t\t\tmergedContainerProps.className,\n\t\t\t\t\tclassNames?.base,\n\t\t\t\t\tdropZoneState.isDragging && [\n\t\t\t\t\t\t\"opacity-60\",\n\t\t\t\t\t\tclassNames?.isDragging,\n\t\t\t\t\t\tcontainerProps?.classNames?.isDragging,\n\t\t\t\t\t]\n\t\t\t\t),\n\t\t\t\t\"data-dragging\": dataAttr(dropZoneState.isDragging),\n\t\t\t\t\"data-scope\": \"dropzone\",\n\t\t\t\t// eslint-disable-next-line perfectionist/sort-objects -- I need data-scope to be first\n\t\t\t\t\"data-part\": \"container\",\n\t\t\t\t\"data-slot\": \"dropzone-container\",\n\t\t\t\tonDragEnter: composeTwoEventHandlers(handleDragEnter, mergedContainerProps.onDragEnter),\n\t\t\t\tonDragLeave: composeTwoEventHandlers(handleDragLeave, mergedContainerProps.onDragLeave),\n\t\t\t\tonDragOver: composeTwoEventHandlers(handleDragOver, mergedContainerProps.onDragOver),\n\t\t\t\tonDrop: composeTwoEventHandlers(handleFileUpload, mergedContainerProps.onDrop),\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tclassNames?.base,\n\t\t\tclassNames?.isDragging,\n\t\t\textraContainerProps,\n\t\t\tdropZoneState.isDragging,\n\t\t\thandleDragEnter,\n\t\t\thandleDragLeave,\n\t\t\thandleDragOver,\n\t\t\thandleFileUpload,\n\t\t]\n\t);\n\n\tconst getInputProps: UseDropZoneResult[\"getInputProps\"] = useCallback(\n\t\t(inputProps) => {\n\t\t\tconst mergedInputProps = mergeTwoProps(extraInputProps, inputProps);\n\n\t\t\treturn {\n\t\t\t\t...mergedInputProps,\n\t\t\t\taccept: allowedFileTypes ? allowedFileTypes.join(\", \") : mergedInputProps.accept,\n\t\t\t\tclassName: cnMerge(\n\t\t\t\t\twithDefaultFilePicker ? \"absolute inset-0 z-[100] cursor-pointer opacity-0\" : \"hidden\",\n\t\t\t\t\tclassNames?.input,\n\t\t\t\t\tmergedInputProps.className\n\t\t\t\t),\n\t\t\t\t\"data-dragging\": dataAttr(dropZoneState.isDragging),\n\t\t\t\t\"data-scope\": \"dropzone\",\n\t\t\t\t// eslint-disable-next-line perfectionist/sort-objects -- I need data-scope to be first\n\t\t\t\t\"data-part\": \"input\",\n\t\t\t\t\"data-slot\": \"dropzone-input\",\n\t\t\t\tmultiple: multiple ?? mergedInputProps.multiple,\n\t\t\t\tonChange: composeTwoEventHandlers(handleFileUpload, mergedInputProps.onChange),\n\t\t\t\tref: composeRefs(inputRef, mergedInputProps.ref),\n\t\t\t\ttype: \"file\",\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tallowedFileTypes,\n\t\t\tclassNames?.input,\n\t\t\textraInputProps,\n\t\t\tdropZoneState.isDragging,\n\t\t\thandleFileUpload,\n\t\t\tmultiple,\n\t\t\twithDefaultFilePicker,\n\t\t]\n\t);\n\n\tconst savedOnRenderPropsChange = useCallbackRef(onRenderPropsChange);\n\n\tconst dropZoneResult = useMemo(() => {\n\t\tconst propsForRenderFn = {\n\t\t\tdropZoneActions: {\n\t\t\t\taddFiles,\n\t\t\t\tclearErrors,\n\t\t\t\tclearFiles,\n\t\t\t\thandleDragEnter,\n\t\t\t\thandleDragLeave,\n\t\t\t\thandleDragOver,\n\t\t\t\thandleFileUpload,\n\t\t\t\topenFilePicker,\n\t\t\t\tremoveFile,\n\t\t\t},\n\t\t\tdropZoneState,\n\t\t\tgetContainerProps,\n\t\t\tgetInputProps,\n\t\t\tinputRef,\n\t\t} satisfies UseDropZoneResult;\n\n\t\tsavedOnRenderPropsChange(propsForRenderFn);\n\n\t\treturn propsForRenderFn;\n\t}, [\n\t\tsavedOnRenderPropsChange,\n\t\taddFiles,\n\t\tclearErrors,\n\t\tclearFiles,\n\t\tdropZoneState,\n\t\tgetInputProps,\n\t\tgetContainerProps,\n\t\thandleDragEnter,\n\t\thandleDragLeave,\n\t\thandleDragOver,\n\t\thandleFileUpload,\n\t\topenFilePicker,\n\t\tremoveFile,\n\t]);\n\n\treturn dropZoneResult;\n};\n","\"use client\";\n\nimport * as React from \"react\";\n\nimport { Slot } from \"@/components/common\";\nimport { type GetSlotComponentProps, getSlotMap, withSlotNameAndSymbol } from \"@/lib/utils/getSlotMap\";\nimport type { DiscriminatedRenderProps, PolymorphicProps } from \"@zayne-labs/toolkit-react/utils\";\nimport { isArray, isFunction } from \"@zayne-labs/toolkit-type-helpers\";\nimport { Fragment as ReactFragment, isValidElement } from \"react\";\nimport { DropZoneContextProvider, useDropZoneContext } from \"./drop-context\";\nimport {\n\ttype ContainerProps,\n\ttype InputProps,\n\ttype UseDropZoneProps,\n\ttype UseDropZoneResult,\n\tuseDropZone,\n} from \"./use-drop-zone\";\n\nexport type DropZoneRenderPropType = DiscriminatedRenderProps<\n\tReact.ReactNode | ((props: UseDropZoneResult) => React.ReactNode)\n>;\n\nexport type DropZoneRootProps = DropZoneRenderPropType\n\t& UseDropZoneProps & {\n\t\t/**\n\t\t * Controls whether to include internal elements (root and input) or not.\n\t\t */\n\t\twithInternalElements?: boolean;\n\t};\n\nexport function DropZoneRoot(props: DropZoneRootProps) {\n\tconst { children, render, withInternalElements = true, ...restOfProps } = props;\n\n\tconst dropZone = useDropZone(restOfProps);\n\n\tconst ContainerComponent = withInternalElements ? DropZoneContainer : ReactFragment;\n\tconst InputComponent = withInternalElements ? DropZoneInput : ReactFragment;\n\n\tconst selectedChildren = children ?? render;\n\n\tconst resolvedChildren = isFunction(selectedChildren) ? selectedChildren(dropZone) : selectedChildren;\n\n\tconst couldChildrenContainSlots =\n\t\tisArray(resolvedChildren)\n\t\t|| (isValidElement(resolvedChildren) && resolvedChildren.type === ReactFragment);\n\n\tconst slots =\n\t\twithInternalElements && couldChildrenContainSlots\n\t\t\t? getSlotMap<SlotComponentProps>(resolvedChildren)\n\t\t\t: ({ default: resolvedChildren } as ReturnType<typeof getSlotMap<SlotComponentProps>>);\n\n\treturn (\n\t\t<DropZoneContextProvider value={dropZone}>\n\t\t\t<ContainerComponent>\n\t\t\t\t<InputComponent />\n\n\t\t\t\t{slots.default}\n\t\t\t</ContainerComponent>\n\n\t\t\t{slots.preview}\n\t\t</DropZoneContextProvider>\n\t);\n}\n\ntype DropZoneInputProps = InputProps & { asChild?: boolean };\n\nexport function DropZoneInput(props: DropZoneInputProps) {\n\tconst { asChild, ...restOfProps } = props;\n\n\tconst dropZoneContext = useDropZoneContext();\n\n\tconst Component = asChild ? Slot.Root : \"input\";\n\n\treturn <Component {...dropZoneContext.getInputProps(restOfProps)} />;\n}\n\ntype DropZoneContainerProps = ContainerProps & { asChild?: boolean };\n\nexport function DropZoneContainer<TElement extends React.ElementType = \"div\">(\n\tprops: PolymorphicProps<TElement, DropZoneContainerProps>\n) {\n\tconst { as: Element = \"div\", asChild, ...restOfProps } = props;\n\n\tconst dropZoneContext = useDropZoneContext();\n\n\tconst Component = asChild ? Slot.Root : Element;\n\n\treturn <Component {...dropZoneContext.getContainerProps(restOfProps)} />;\n}\n\ntype RenderPropFn = (props: UseDropZoneResult) => React.ReactNode;\n\ntype SlotComponentProps = GetSlotComponentProps<\"preview\", React.ReactNode | RenderPropFn>;\n\nexport function DropZoneContext(props: { children: RenderPropFn }) {\n\tconst { children } = props;\n\n\tconst dropZoneContext = useDropZoneContext();\n\n\treturn children(dropZoneContext);\n}\n\nexport const DropZoneImagePreview = withSlotNameAndSymbol<SlotComponentProps>(\"preview\", (props) => {\n\tconst { children } = props;\n\n\tif (isFunction(children)) {\n\t\treturn <DropZoneContext>{children}</DropZoneContext>;\n\t}\n\n\treturn children;\n});\n","export {\n\tDropZoneRoot as Root,\n\tDropZoneImagePreview as ImagePreview,\n\tDropZoneContext as Context,\n\tDropZoneInput as Input,\n\tDropZoneContainer as Container,\n} from \"./drop-zone\";\n"]}
@@ -1,7 +1,7 @@
1
1
  import { cnMerge } from './chunk-OHG7GB7O.js';
2
2
  import { getElementList } from './chunk-NXZZXJRH.js';
3
3
  import { getMultipleSlots } from './chunk-YO5LJ7ZJ.js';
4
- import { slot_parts_exports } from './chunk-Y5VBSXZS.js';
4
+ import { slot_parts_exports } from './chunk-D6QZA3UT.js';
5
5
  import { __export } from './chunk-PZ5AY32C.js';
6
6
  import * as React2 from 'react';
7
7
  import { useMemo, Fragment, useId, useRef, useEffect, createElement } from 'react';
@@ -622,5 +622,5 @@ __export(form_parts_exports, {
622
622
  });
623
623
 
624
624
  export { FormDescription, FormErrorMessage, FormErrorMessagePrimitive, FormField, FormFieldContext, FormFieldControlledField, FormFieldController, FormInput, FormInputGroup, FormInputLeftItem, FormInputPrimitive, FormInputRightItem, FormLabel, FormRoot, FormSelect, FormSelectPrimitive, FormSubmit, FormSubscribeToFieldValue, FormSubscribeToFormState, FormTextArea, FormTextAreaPrimitive, form_parts_exports, useStrictFormFieldContext };
625
- //# sourceMappingURL=chunk-3KZXPREF.js.map
626
- //# sourceMappingURL=chunk-3KZXPREF.js.map
625
+ //# sourceMappingURL=chunk-P5QP73HG.js.map
626
+ //# sourceMappingURL=chunk-P5QP73HG.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/ui/form/icons.tsx","../../src/components/ui/form/utils.ts","../../src/components/ui/form/form-context.ts","../../src/components/ui/form/form.tsx","../../src/components/ui/form/form-parts.ts"],"names":["React","errorMessage","createElement","useHookFormContext","HookFormProvider","ReactFragment","useFormState"],"mappings":";;;;;;;;;;;;;;AAEO,IAAM,aAAgB,GAAA,CAAC,KAC7B,qBAAAA,MAAA,CAAA,aAAA,CAAC,SAAI,KAAM,EAAA,4BAAA,EAA6B,KAAM,EAAA,KAAA,EAAM,MAAO,EAAA,KAAA,EAAM,OAAQ,EAAA,WAAA,EAAa,GAAG,KACxF,EAAA,kBAAAA,MAAA,CAAA,aAAA;AAAA,EAAC,MAAA;AAAA,EAAA;AAAA,IACA,IAAK,EAAA,cAAA;AAAA,IACL,CAAE,EAAA;AAAA;AACH,CACD,CAAA;AAGM,IAAM,WAAc,GAAA,CAAC,KAC3B,qBAAAA,MAAA,CAAA,aAAA,CAAC,SAAI,KAAM,EAAA,4BAAA,EAA6B,KAAM,EAAA,KAAA,EAAM,MAAO,EAAA,KAAA,EAAM,OAAQ,EAAA,WAAA,EAAa,GAAG,KACxF,EAAA,kBAAAA,MAAA,CAAA,aAAA;AAAA,EAAC,MAAA;AAAA,EAAA;AAAA,IACA,IAAK,EAAA,cAAA;AAAA,IACL,CAAE,EAAA;AAAA;AACH,CACD,CAAA;;;ACTM,IAAM,oBAAA,GAAuB,CAAC,OAIO,KAAA;AAC3C,EAAA,MAAM,EAAE,MAAA,EAAQ,SAAW,EAAA,IAAA,EAAS,GAAA,OAAA;AAEpC,EAAI,IAAA,CAAC,aAAa,CAAC,MAAA,IAAU,OAAO,IAAK,CAAA,MAAM,CAAE,CAAA,MAAA,KAAW,CAAG,EAAA;AAE/D,EAAA,IAAI,SAAS,MAAQ,EAAA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["import * as React from \"react\";\n\nexport const EyeIconClosed = (props: React.SVGProps<SVGSVGElement>) => (\n\t<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\" {...props}>\n\t\t<path\n\t\t\tfill=\"currentColor\"\n\t\t\td=\"M15.175 8.325q.725.725 1.063 1.65t.237 1.9q0 .375-.275.638t-.65.262t-.638-.262t-.262-.638q.125-.65-.075-1.25T13.95 9.6t-1.025-.65t-1.275-.1q-.375 0-.638-.275t-.262-.65t.263-.637t.637-.263q.95-.1 1.875.238t1.65 1.062M12 6q-.475 0-.925.037t-.9.138q-.425.075-.763-.125t-.462-.6t.088-.775t.612-.45q.575-.125 1.163-.175T12 4q3.425 0 6.263 1.8t4.337 4.85q.1.2.15.413t.05.437t-.038.438t-.137.412q-.45 1-1.112 1.875t-1.463 1.6q-.3.275-.7.225t-.65-.4t-.212-.763t.337-.687q.6-.575 1.1-1.25t.875-1.45q-1.25-2.525-3.613-4.012T12 6m0 13q-3.35 0-6.125-1.812T1.5 12.425q-.125-.2-.187-.437T1.25 11.5t.05-.475t.175-.45q.5-1 1.163-1.912T4.15 7L2.075 4.9q-.275-.3-.262-.712T2.1 3.5t.7-.275t.7.275l17 17q.275.275.288.688t-.288.712q-.275.275-.7.275t-.7-.275l-3.5-3.45q-.875.275-1.775.413T12 19M5.55 8.4q-.725.65-1.325 1.425T3.2 11.5q1.25 2.525 3.613 4.013T12 17q.5 0 .975-.062t.975-.138l-.9-.95q-.275.075-.525.113T12 16q-1.875 0-3.188-1.312T7.5 11.5q0-.275.038-.525t.112-.525zm4.2 4.2\"\n\t\t/>\n\t</svg>\n);\n\nexport const EyeIconOpen = (props: React.SVGProps<SVGSVGElement>) => (\n\t<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\" {...props}>\n\t\t<path\n\t\t\tfill=\"currentColor\"\n\t\t\td=\"M12 16q1.875 0 3.188-1.312T16.5 11.5t-1.312-3.187T12 7T8.813 8.313T7.5 11.5t1.313 3.188T12 16m0-1.8q-1.125 0-1.912-.788T9.3 11.5t.788-1.912T12 8.8t1.913.788t.787 1.912t-.787 1.913T12 14.2m0 4.8q-3.35 0-6.113-1.8t-4.362-4.75q-.125-.225-.187-.462t-.063-.488t.063-.488t.187-.462q1.6-2.95 4.363-4.75T12 4t6.113 1.8t4.362 4.75q.125.225.188.463t.062.487t-.062.488t-.188.462q-1.6 2.95-4.362 4.75T12 19m0-2q2.825 0 5.188-1.487T20.8 11.5q-1.25-2.525-3.613-4.012T12 6T6.813 7.488T3.2 11.5q1.25 2.525 3.613 4.013T12 17\"\n\t\t/>\n\t</svg>\n);\n","import { cnMerge } from \"@/lib/utils/cn\";\nimport { isObject } from \"@zayne-labs/toolkit-type-helpers\";\nimport { createElement } from \"react\";\nimport type { FieldErrors, FieldValues } from \"react-hook-form\";\nimport type { FormErrorMessagePrimitiveProps, FormInputProps } from \"./form\";\nimport type { FormRootContext, RenderIconProps } from \"./form-context\";\nimport { EyeIconClosed, EyeIconOpen } from \"./icons\";\n\nexport const getFieldErrorMessage = (options: {\n\terrors: FieldErrors | undefined;\n\tfieldName: string | undefined;\n\ttype: FormErrorMessagePrimitiveProps<FieldValues>[\"type\"];\n}): string | string[] | null | undefined => {\n\tconst { errors, fieldName, type } = options;\n\n\tif (!fieldName || !errors || Object.keys(errors).length === 0) return;\n\n\tif (type === \"root\") {\n\t\treturn errors.root?.[fieldName]?.message;\n\t}\n\n\t// == Handle nested paths like `notifications.0`\n\tconst pathParts = fieldName.includes(\".\") ? fieldName.split(\".\") : null;\n\n\t// == If there are no path parts, return the error message\n\tif (!pathParts) {\n\t\tconst errorMessage = errors[fieldName]?.message;\n\n\t\treturn errorMessage as string | string[];\n\t}\n\n\tlet extractedError = errors;\n\n\tfor (const part of pathParts) {\n\t\tconst currentError = extractedError[part];\n\n\t\tif (!isObject(currentError)) break;\n\n\t\textractedError = currentError as never;\n\t}\n\n\tconst errorMessage = extractedError.message as unknown as string | string[];\n\n\treturn errorMessage;\n};\n\nexport const getEyeIcon = (options: {\n\tclassNames: FormInputProps[\"classNames\"];\n\ticonType: \"closed\" | \"open\";\n\trenderIconProps: RenderIconProps;\n\twithEyeIcon: FormRootContext[\"withEyeIcon\"];\n}) => {\n\tconst { classNames, iconType, renderIconProps, withEyeIcon } = options;\n\n\tif (!withEyeIcon) {\n\t\treturn null;\n\t}\n\n\tif (withEyeIcon === true) {\n\t\tconst defaultIconMap = {\n\t\t\tclosed: createElement(EyeIconClosed, {\n\t\t\t\tclassName: cnMerge(\"size-full\", classNames?.eyeIcon),\n\t\t\t}),\n\n\t\t\topen: createElement(EyeIconOpen, {\n\t\t\t\tclassName: cnMerge(\"size-full\", classNames?.eyeIcon),\n\t\t\t}),\n\t\t};\n\n\t\treturn defaultIconMap[iconType];\n\t}\n\n\tif (withEyeIcon.renderIcon) {\n\t\treturn withEyeIcon.renderIcon(renderIconProps);\n\t}\n\n\tif (withEyeIcon[iconType]) {\n\t\treturn withEyeIcon[iconType];\n\t}\n\n\treturn null;\n};\n","import { ContextError, createCustomContext } from \"@zayne-labs/toolkit-react\";\nimport type { DiscriminatedRenderProps } from \"@zayne-labs/toolkit-react/utils\";\nimport type { UnionDiscriminator } from \"@zayne-labs/toolkit-type-helpers\";\nimport {\n\ttype Control,\n\ttype UseFormReturn,\n\ttype UseFormStateReturn,\n\tuseFormState,\n\tuseFormContext as useHookFormContext,\n} from \"react-hook-form\";\nimport type { FieldValues, FormInputProps } from \"./form\";\nimport { getFieldErrorMessage } from \"./utils\";\n\ntype UseFormRootContextResult<TStrict extends boolean = true> = TStrict extends true\n\t? UseFormReturn<FieldValues> & { withEyeIcon?: FormInputProps[\"withEyeIcon\"] }\n\t: (UseFormReturn<FieldValues> & { withEyeIcon?: FormInputProps[\"withEyeIcon\"] }) | null;\n\nexport const useFormMethodsContext = <TStrict extends boolean = true>(\n\toptions: { strict?: TStrict } = {}\n): UseFormRootContextResult<TStrict> => {\n\tconst { strict = true } = options;\n\tconst formContext = useHookFormContext();\n\n\tif (strict && !(formContext as unknown)) {\n\t\tthrow new ContextError(\n\t\t\t`useFormRootContext returned \"null\". Did you forget to wrap the necessary components within FormRoot?`\n\t\t);\n\t}\n\n\treturn formContext;\n};\n\nexport type RenderIconProps = {\n\tisPasswordVisible: boolean;\n};\n\ntype EyeIconObject = UnionDiscriminator<\n\t[\n\t\t{ closed: React.ReactNode; open: React.ReactNode },\n\t\t{ renderIcon: (props: RenderIconProps) => React.ReactNode },\n\t]\n>;\n\nexport type FormRootContext = {\n\twithEyeIcon: boolean | EyeIconObject | undefined;\n};\n\nexport const [LaxFormRootProvider, useLaxFormRootContext] = createCustomContext<FormRootContext, false>({\n\thookName: \"useLaxFormRootContext\",\n\tname: \"LaxFormRootContext\",\n\tproviderName: \"FormRoot\",\n\tstrict: false,\n});\n\n// export const useStrictGetFieldState = () => {\n// \tconst { name } = useStrictFormFieldContext();\n\n// \tconst { getFieldState } = useFormRootContext();\n\n// \tconst fieldState = getFieldState(name);\n\n// \treturn fieldState;\n// };\n\nexport type FieldContextValue = {\n\tformDescriptionId: `${string}-(${string})-form-item-description`;\n\tformItemId: `${string}-(${string})-form-item`;\n\tformMessageId: `${string}-(${string})-form-item-message`;\n\tname: string;\n};\n\nexport type FormFieldContextProps = DiscriminatedRenderProps<\n\t(contextValue: FieldContextValue) => React.ReactNode\n>;\n\nexport const [StrictFormFieldProvider, useStrictFormFieldContext] = createCustomContext<FieldContextValue>(\n\t{\n\t\thookName: \"useFormFieldContext\",\n\t\tname: \"StrictFormFieldContext\",\n\t\tproviderName: \"FormField\",\n\t}\n);\n\nexport const [LaxFormFieldProvider, useLaxFormFieldContext] = createCustomContext<\n\tFieldContextValue,\n\tfalse\n>({\n\thookName: \"useLaxFormFieldContext\",\n\tname: \"LaxFormFieldContext\",\n\tproviderName: \"FormField\",\n\tstrict: false,\n});\n\nexport type FieldState = {\n\terrors?: UseFormStateReturn<FieldValues>[\"errors\"];\n\tisDisabled?: boolean;\n\tisInvalid?: boolean;\n};\n\n// eslint-disable-next-line ts-eslint/no-explicit-any -- any is used here for type compatibility\nexport type AnyControl = Control<any>;\n\ntype FieldStateOptions =\n\t| {\n\t\t\tcontrol: AnyControl | undefined;\n\t\t\tname?: string;\n\t }\n\t| {\n\t\t\tcontrol?: AnyControl;\n\t\t\tname: string | undefined;\n\t };\n\nexport const useLaxFormFieldState = (options?: FieldStateOptions): FieldState => {\n\tconst { control = options?.control } = useFormMethodsContext({ strict: false }) ?? {};\n\tconst { name = options?.name } = useLaxFormFieldContext() ?? {};\n\n\tconst getFormState = control ? useFormState : () => ({}) as Partial<ReturnType<typeof useFormState>>;\n\n\tconst { disabled, errors } = getFormState({ control, name });\n\n\tconst errorMessage = getFieldErrorMessage({ errors, fieldName: name, type: \"regular\" });\n\n\treturn {\n\t\terrors,\n\t\tisDisabled: disabled,\n\t\tisInvalid: Boolean(errorMessage),\n\t};\n};\n","\"use client\";\n\nimport * as React from \"react\";\n\nimport { getElementList } from \"@/components/common/for\";\nimport { Slot } from \"@/components/common/slot\";\nimport { cnMerge } from \"@/lib/utils/cn\";\nimport { getMultipleSlots } from \"@/lib/utils/getSlot\";\nimport { dataAttr, on, toArray } from \"@zayne-labs/toolkit-core\";\nimport { useCallbackRef, useToggle } from \"@zayne-labs/toolkit-react\";\nimport {\n\ttype DiscriminatedRenderProps,\n\ttype InferProps,\n\ttype PolymorphicProps,\n\tcomposeRefs,\n\tcomposeTwoEventHandlers,\n} from \"@zayne-labs/toolkit-react/utils\";\nimport { type AnyString, defineEnum } from \"@zayne-labs/toolkit-type-helpers\";\nimport { Fragment as ReactFragment, useEffect, useId, useMemo, useRef } from \"react\";\nimport {\n\ttype Control,\n\tController,\n\ttype ControllerFieldState,\n\ttype ControllerProps,\n\ttype ControllerRenderProps,\n\ttype FieldPath,\n\ttype FieldPathValue,\n\ttype FieldPathValues,\n\tFormProvider as HookFormProvider,\n\ttype RegisterOptions,\n\ttype UseFormReturn,\n\ttype UseFormStateReturn,\n\tuseFormState,\n\tuseWatch,\n} from \"react-hook-form\";\nimport {\n\ttype FieldContextValue,\n\ttype FieldState,\n\ttype FormFieldContextProps,\n\ttype FormRootContext,\n\tLaxFormFieldProvider,\n\tLaxFormRootProvider,\n\tStrictFormFieldProvider,\n\tuseFormMethodsContext,\n\tuseLaxFormFieldContext,\n\tuseLaxFormFieldState,\n\tuseLaxFormRootContext,\n\tuseStrictFormFieldContext,\n} from \"./form-context\";\nimport { getEyeIcon, getFieldErrorMessage } from \"./utils\";\n\nexport type FieldValues = Record<string, unknown>;\n\ntype FormRootProps<TFieldValues extends FieldValues> = Partial<FormRootContext>\n\t& React.ComponentPropsWithoutRef<\"form\"> & {\n\t\tchildren: React.ReactNode;\n\t\tmethods: UseFormReturn<TFieldValues>;\n\t};\n\nexport function FormRoot<TValues extends FieldValues>(props: FormRootProps<TValues>) {\n\tconst { children, className, methods, withEyeIcon, ...restOfProps } = props;\n\n\tconst formContextValue = useMemo(() => ({ withEyeIcon }), [withEyeIcon]);\n\n\treturn (\n\t\t<HookFormProvider {...methods}>\n\t\t\t<LaxFormRootProvider value={formContextValue}>\n\t\t\t\t<form\n\t\t\t\t\tclassName={cnMerge(\"flex flex-col\", className)}\n\t\t\t\t\t{...restOfProps}\n\t\t\t\t\tdata-scope=\"form\"\n\t\t\t\t\tdata-part=\"root\"\n\t\t\t\t\tdata-slot=\"form-root\"\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</form>\n\t\t\t</LaxFormRootProvider>\n\t\t</HookFormProvider>\n\t);\n}\n\ntype FormFieldProps<TControl, TFieldValues extends FieldValues> = (TControl extends Control<infer TValues>\n\t? {\n\t\t\tcontrol?: never;\n\t\t\tname: FieldPath<TValues>;\n\t\t}\n\t: {\n\t\t\tcontrol?: Control<TFieldValues>;\n\t\t\tname: FieldPath<TFieldValues>;\n\t\t})\n\t& (\n\t\t| (InferProps<\"div\"> & {\n\t\t\t\twithWrapper?: true;\n\t\t })\n\t\t| { children: React.ReactNode; className?: never; withWrapper: false }\n\t);\n\nexport function FormField<TControl, TFieldValues extends FieldValues = FieldValues>(\n\tprops: FormFieldProps<TControl, TFieldValues>\n) {\n\tconst { children, className, name, withWrapper = true } = props;\n\n\tconst { isDisabled, isInvalid } = useLaxFormFieldState({ name });\n\n\tconst uniqueId = useId();\n\n\tconst fieldContextValue = useMemo(\n\t\t() =>\n\t\t\t({\n\t\t\t\tformDescriptionId: `${name}-(${uniqueId})-form-item-description`,\n\t\t\t\tformItemId: `${name}-(${uniqueId})-form-item`,\n\t\t\t\tformMessageId: `${name}-(${uniqueId})-form-item-message`,\n\t\t\t\tname,\n\t\t\t}) satisfies FieldContextValue,\n\t\t[name, uniqueId]\n\t);\n\n\tconst WrapperElement = withWrapper ? \"div\" : ReactFragment;\n\n\tconst wrapperElementProps = withWrapper && {\n\t\tclassName: cnMerge(\"flex flex-col\", className),\n\t\t\"data-part\": \"field\",\n\t\t\"data-scope\": \"form\",\n\t\t\"data-slot\": \"form-field\",\n\t\t/* eslint-disable perfectionist/sort-objects -- order of attributes does not matter */\n\t\t\"data-disabled\": dataAttr(isDisabled),\n\t\t\"data-invalid\": dataAttr(isInvalid),\n\t\t/* eslint-enable perfectionist/sort-objects -- order of attributes does not matter */\n\t};\n\treturn (\n\t\t<StrictFormFieldProvider value={fieldContextValue}>\n\t\t\t<LaxFormFieldProvider value={fieldContextValue}>\n\t\t\t\t<WrapperElement {...wrapperElementProps}>{children}</WrapperElement>\n\t\t\t</LaxFormFieldProvider>\n\t\t</StrictFormFieldProvider>\n\t);\n}\n\ntype FormFieldControllerRenderFn = (props: {\n\tfield: Omit<ControllerRenderProps, \"value\"> & {\n\t\tvalue: never;\n\t};\n\tfieldState: ControllerFieldState;\n\tformState: UseFormStateReturn<never>;\n}) => React.ReactElement;\n\ntype FormFieldControllerProps = Omit<\n\tControllerProps<FieldValues, FieldPath<FieldValues>>,\n\t\"control\" | \"name\" | \"render\"\n> & {\n\trender: FormFieldControllerRenderFn;\n};\n\nexport function FormFieldController(props: FormFieldControllerProps) {\n\tconst { control } = useFormMethodsContext();\n\tconst { name } = useStrictFormFieldContext();\n\tconst { render, ...restOfProps } = props;\n\n\treturn <Controller name={name} control={control} render={render as never} {...restOfProps} />;\n}\n\nexport function FormFieldControlledField<TFieldValues extends FieldValues>(\n\tprops: ControllerProps<TFieldValues>\n) {\n\tconst { name } = props;\n\n\tconst uniqueId = useId();\n\n\tconst fieldContextValue = useMemo(\n\t\t() =>\n\t\t\t({\n\t\t\t\tformDescriptionId: `${name}-(${uniqueId})-form-item-description`,\n\t\t\t\tformItemId: `${name}-(${uniqueId})-form-item`,\n\t\t\t\tformMessageId: `${name}-(${uniqueId})-form-item-message`,\n\t\t\t\tname,\n\t\t\t}) satisfies FieldContextValue,\n\t\t[name, uniqueId]\n\t);\n\n\treturn (\n\t\t<StrictFormFieldProvider value={fieldContextValue}>\n\t\t\t<LaxFormFieldProvider value={fieldContextValue}>\n\t\t\t\t<Controller {...props} />\n\t\t\t</LaxFormFieldProvider>\n\t\t</StrictFormFieldProvider>\n\t);\n}\n\nexport function FormFieldContext(props: FormFieldContextProps) {\n\tconst { children, render } = props;\n\tconst fieldContextValues = useStrictFormFieldContext();\n\n\tif (typeof children === \"function\") {\n\t\treturn children(fieldContextValues);\n\t}\n\n\treturn render(fieldContextValues);\n}\n\nexport function FormLabel(props: InferProps<\"label\">) {\n\tconst { formItemId, name } = useStrictFormFieldContext();\n\tconst { children, className, ...restOfProps } = props;\n\n\tconst { isDisabled, isInvalid } = useLaxFormFieldState({ name });\n\n\treturn (\n\t\t<label\n\t\t\tdata-scope=\"form\"\n\t\t\tdata-part=\"label\"\n\t\t\tdata-slot=\"form-label\"\n\t\t\tdata-disabled={dataAttr(isDisabled)}\n\t\t\tdata-invalid={dataAttr(isInvalid)}\n\t\t\thtmlFor={formItemId}\n\t\t\tclassName={className}\n\t\t\t{...restOfProps}\n\t\t>\n\t\t\t{children}\n\t\t</label>\n\t);\n}\n\nexport function FormInputGroup(props: InferProps<\"div\">) {\n\tconst { children, className, ...restOfProps } = props;\n\n\tconst { isDisabled, isInvalid } = useLaxFormFieldState();\n\n\tconst {\n\t\tregularChildren,\n\t\tslots: [leftItemSlot, rightItemSlot],\n\t} = getMultipleSlots(children, [FormInputLeftItem, FormInputRightItem]);\n\n\treturn (\n\t\t<div\n\t\t\tdata-scope=\"form\"\n\t\t\tdata-part=\"input-group\"\n\t\t\tdata-slot=\"form-input-group\"\n\t\t\tdata-invalid={dataAttr(isInvalid)}\n\t\t\tdata-disabled={dataAttr(isDisabled)}\n\t\t\tclassName={cnMerge(\"flex items-center justify-between gap-2\", className)}\n\t\t\t{...restOfProps}\n\t\t>\n\t\t\t{leftItemSlot}\n\t\t\t{regularChildren}\n\t\t\t{rightItemSlot}\n\t\t</div>\n\t);\n}\n\ntype FormSideItemProps = {\n\tchildren?: React.ReactNode;\n\tclassName?: string;\n};\n\nexport function FormInputLeftItem<TElement extends React.ElementType = \"span\">(\n\tprops: PolymorphicProps<TElement, FormSideItemProps>\n) {\n\tconst { as: Element = \"span\", children, className, ...restOfProps } = props;\n\n\treturn (\n\t\t<Element\n\t\t\tdata-scope=\"form\"\n\t\t\tdata-part=\"left-item\"\n\t\t\tdata-slot=\"form-left-item\"\n\t\t\tclassName={cnMerge(\"inline-flex items-center justify-center\", className)}\n\t\t\t{...restOfProps}\n\t\t>\n\t\t\t{children}\n\t\t</Element>\n\t);\n}\nFormInputLeftItem.slotSymbol = Symbol(\"input-left-item\");\n\nexport function FormInputRightItem<TElement extends React.ElementType = \"span\">(\n\tprops: PolymorphicProps<TElement, FormSideItemProps>\n) {\n\tconst { as: Element = \"span\", children, className, ...restOfProps } = props;\n\n\treturn (\n\t\t<Element\n\t\t\tdata-scope=\"form\"\n\t\t\tdata-part=\"right-item\"\n\t\t\tdata-slot=\"form-right-item\"\n\t\t\tclassName={cnMerge(\"inline-flex items-center justify-center\", className)}\n\t\t\t{...restOfProps}\n\t\t>\n\t\t\t{children}\n\t\t</Element>\n\t);\n}\nFormInputRightItem.slotSymbol = Symbol(\"input-right-item\");\n\ntype FormInputPrimitiveProps<TFieldValues extends FieldValues = FieldValues> = Omit<\n\tReact.ComponentPropsWithRef<\"input\">,\n\t\"children\"\n> & {\n\tclassNames?: { error?: string; eyeIcon?: string; input?: string; inputGroup?: string };\n\tcontrol?: Control<TFieldValues>;\n\tfieldState?: FieldState;\n\tname?: FieldPath<TFieldValues>;\n\twithEyeIcon?: FormRootContext[\"withEyeIcon\"];\n};\n\ntype FormTextAreaPrimitiveProps<TFieldValues extends FieldValues = FieldValues> =\n\tReact.ComponentPropsWithRef<\"textarea\"> & {\n\t\tclassNames?: { base?: string; error?: string };\n\t\tcontrol?: Control<TFieldValues>;\n\t\tfieldState?: FieldState;\n\t\tname?: FieldPath<TFieldValues>;\n\t};\n\ntype FormSelectPrimitiveProps<TFieldValues extends FieldValues = FieldValues> =\n\tReact.ComponentPropsWithRef<\"select\"> & {\n\t\tclassNames?: { base?: string; error?: string };\n\t\tcontrol?: Control<TFieldValues>;\n\t\tfieldState?: FieldState;\n\t\tname?: FieldPath<TFieldValues>;\n\t};\n\nconst inputTypesWithoutFullWith = new Set<React.HTMLInputTypeAttribute>([\"checkbox\", \"radio\"]);\n\nexport function FormInputPrimitive<TFieldValues extends FieldValues>(\n\tprops: FormInputPrimitiveProps<TFieldValues> & { rules?: RegisterOptions }\n) {\n\tconst fieldContextValues = useLaxFormFieldContext();\n\n\tconst formRootContextValues = useLaxFormRootContext();\n\n\tconst {\n\t\tclassName,\n\t\tclassNames,\n\t\tcontrol,\n\t\tfieldState,\n\t\tid = fieldContextValues?.formItemId,\n\t\tname = fieldContextValues?.name,\n\t\trules,\n\t\ttype = \"text\",\n\t\twithEyeIcon = formRootContextValues?.withEyeIcon ?? true,\n\t\t...restOfProps\n\t} = props;\n\n\tconst fieldStateFromLaxFormField = useLaxFormFieldState({ control, name });\n\n\tconst { isDisabled, isInvalid } = fieldState ?? fieldStateFromLaxFormField;\n\n\tconst [isPasswordVisible, toggleVisibility] = useToggle(false);\n\n\tconst shouldHaveEyeIcon = withEyeIcon && type === \"password\";\n\n\tconst WrapperElement = shouldHaveEyeIcon ? FormInputGroup : ReactFragment;\n\n\tconst wrapperElementProps = shouldHaveEyeIcon && {\n\t\tclassName: cnMerge(\"w-full\", classNames?.inputGroup, isInvalid && classNames?.error),\n\t};\n\n\tconst { register } = useFormMethodsContext({ strict: false }) ?? {};\n\n\tconst eyeIcon = getEyeIcon({\n\t\tclassNames,\n\t\ticonType: isPasswordVisible ? \"closed\" : \"open\",\n\t\trenderIconProps: { isPasswordVisible },\n\t\twithEyeIcon,\n\t});\n\n\treturn (\n\t\t<WrapperElement {...wrapperElementProps}>\n\t\t\t<input\n\t\t\t\tdata-scope=\"form\"\n\t\t\t\tdata-part=\"input\"\n\t\t\t\tdata-slot=\"form-input\"\n\t\t\t\taria-describedby={\n\t\t\t\t\t!isInvalid\n\t\t\t\t\t\t? fieldContextValues?.formDescriptionId\n\t\t\t\t\t\t: `${fieldContextValues?.formDescriptionId} ${fieldContextValues?.formMessageId}`\n\t\t\t\t}\n\t\t\t\taria-invalid={dataAttr(isInvalid)}\n\t\t\t\tdata-invalid={dataAttr(isInvalid)}\n\t\t\t\tdata-disabled={dataAttr(isDisabled)}\n\t\t\t\tid={id}\n\t\t\t\tname={name}\n\t\t\t\ttype={type === \"password\" && isPasswordVisible ? \"text\" : type}\n\t\t\t\tclassName={cnMerge(\n\t\t\t\t\t!inputTypesWithoutFullWith.has(type) && \"flex w-full\",\n\t\t\t\t\t`focus-visible:outline-hidden placeholder:text-shadcn-muted-foreground bg-transparent\n\t\t\t\t\ttext-sm file:border-0 file:bg-transparent disabled:cursor-not-allowed disabled:opacity-50`,\n\t\t\t\t\tclassName,\n\t\t\t\t\tclassNames?.input,\n\t\t\t\t\ttype !== \"password\" && isInvalid && classNames?.error\n\t\t\t\t)}\n\t\t\t\t{...(Boolean(name) && register?.(name, rules))}\n\t\t\t\t{...restOfProps}\n\t\t\t/>\n\n\t\t\t{shouldHaveEyeIcon && (\n\t\t\t\t<FormInputRightItem\n\t\t\t\t\tas=\"button\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tonClick={toggleVisibility}\n\t\t\t\t\tclassName=\"size-5 shrink-0 lg:size-6\"\n\t\t\t\t>\n\t\t\t\t\t{eyeIcon}\n\t\t\t\t</FormInputRightItem>\n\t\t\t)}\n\t\t</WrapperElement>\n\t);\n}\n\nexport function FormTextAreaPrimitive<TFieldValues extends FieldValues>(\n\tprops: FormTextAreaPrimitiveProps<TFieldValues> & { rules?: RegisterOptions }\n) {\n\tconst fieldContextValues = useLaxFormFieldContext();\n\n\tconst {\n\t\tclassName,\n\t\tclassNames,\n\t\tcontrol,\n\t\tfieldState,\n\t\tid = fieldContextValues?.formItemId,\n\t\tname = fieldContextValues?.name,\n\t\trules,\n\t\t...restOfProps\n\t} = props;\n\n\tconst fieldStateFromLaxFormField = useLaxFormFieldState({ control, name });\n\n\tconst { isDisabled, isInvalid } = fieldState ?? fieldStateFromLaxFormField;\n\n\tconst { register } = useFormMethodsContext({ strict: false }) ?? {};\n\n\treturn (\n\t\t<textarea\n\t\t\tdata-scope=\"form\"\n\t\t\tdata-part=\"textarea\"\n\t\t\tdata-slot=\"form-textarea\"\n\t\t\taria-describedby={\n\t\t\t\t!isInvalid\n\t\t\t\t\t? fieldContextValues?.formDescriptionId\n\t\t\t\t\t: `${fieldContextValues?.formDescriptionId} ${fieldContextValues?.formMessageId}`\n\t\t\t}\n\t\t\taria-invalid={dataAttr(isInvalid)}\n\t\t\tdata-disabled={dataAttr(isDisabled)}\n\t\t\tdata-invalid={dataAttr(isInvalid)}\n\t\t\tid={id}\n\t\t\tname={name}\n\t\t\tclassName={cnMerge(\n\t\t\t\t`placeholder:text-shadcn-muted-foreground focus-visible:outline-hidden w-full bg-transparent\n\t\t\t\ttext-sm disabled:cursor-not-allowed disabled:opacity-50`,\n\t\t\t\tclassName,\n\t\t\t\tclassNames?.base,\n\t\t\t\tisInvalid && classNames?.error\n\t\t\t)}\n\t\t\t{...(Boolean(name) && register?.(name, rules))}\n\t\t\t{...restOfProps}\n\t\t/>\n\t);\n}\nexport function FormSelectPrimitive<TFieldValues extends FieldValues>(\n\tprops: FormSelectPrimitiveProps<TFieldValues> & { rules?: RegisterOptions }\n) {\n\tconst fieldContextValues = useLaxFormFieldContext();\n\n\tconst {\n\t\tclassName,\n\t\tclassNames,\n\t\tcontrol,\n\t\tfieldState,\n\t\tid = fieldContextValues?.formItemId,\n\t\tname = fieldContextValues?.name,\n\t\trules,\n\t\t...restOfProps\n\t} = props;\n\n\tconst fieldStateFromLaxFormField = useLaxFormFieldState({ control, name });\n\n\tconst { isDisabled, isInvalid } = fieldState ?? fieldStateFromLaxFormField;\n\n\tconst { register } = useFormMethodsContext({ strict: false }) ?? {};\n\n\treturn (\n\t\t<select\n\t\t\tdefaultValue=\"\"\n\t\t\tdata-scope=\"form\"\n\t\t\tdata-part=\"select\"\n\t\t\tdata-slot=\"form-select\"\n\t\t\taria-describedby={\n\t\t\t\t!isInvalid\n\t\t\t\t\t? fieldContextValues?.formDescriptionId\n\t\t\t\t\t: `${fieldContextValues?.formDescriptionId} ${fieldContextValues?.formMessageId}`\n\t\t\t}\n\t\t\taria-invalid={dataAttr(isInvalid)}\n\t\t\tdata-disabled={dataAttr(isDisabled)}\n\t\t\tdata-invalid={dataAttr(isInvalid)}\n\t\t\tid={id}\n\t\t\tname={name}\n\t\t\tclassName={cnMerge(\n\t\t\t\t`placeholder:text-shadcn-muted-foreground focus-visible:outline-hidden w-full bg-transparent\n\t\t\t\ttext-sm disabled:cursor-not-allowed disabled:opacity-50`,\n\t\t\t\tclassName,\n\t\t\t\tclassNames?.base,\n\t\t\t\tisInvalid && classNames?.error\n\t\t\t)}\n\t\t\t{...(Boolean(name) && register?.(name, rules))}\n\t\t\t{...restOfProps}\n\t\t/>\n\t);\n}\n\ntype PrimitivePropsToOmit = \"control\" | \"formState\" | \"name\";\n\nexport type FormInputProps = Omit<FormInputPrimitiveProps, PrimitivePropsToOmit> & {\n\trules?: RegisterOptions;\n};\n\nexport type FormTextAreaProps = Omit<FormTextAreaPrimitiveProps, PrimitivePropsToOmit> & {\n\trules?: RegisterOptions;\n};\n\nexport type FormSelectProps = Omit<FormSelectPrimitiveProps, PrimitivePropsToOmit> & {\n\trules?: RegisterOptions;\n};\n\ntype CombinedFormInputProps =\n\t| (FormSelectProps & { type: \"select\" })\n\t| (FormTextAreaProps & { type: \"textarea\" })\n\t| FormInputProps;\n\nconst InputTypeMap = defineEnum({\n\tselect: FormSelectPrimitive,\n\ttextarea: FormTextAreaPrimitive,\n});\n\nexport function FormInput(props: CombinedFormInputProps & { rules?: RegisterOptions }) {\n\tconst { onBlur, onChange, ref, rules, type, ...restOfProps } = props;\n\n\tconst { name } = useStrictFormFieldContext();\n\tconst { register } = useFormMethodsContext();\n\n\tconst SelectedInput =\n\t\ttype === \"textarea\" || type === \"select\"\n\t\t\t? InputTypeMap[type as Exclude<typeof type, AnyString>]\n\t\t\t: FormInputPrimitive;\n\n\tconst registerProps = name ? register(name, rules) : null;\n\n\treturn (\n\t\t<SelectedInput\n\t\t\ttype={type as never}\n\t\t\tname={name}\n\t\t\t{...registerProps}\n\t\t\t{...(restOfProps as NonNullable<unknown>)}\n\t\t\tref={composeRefs(registerProps?.ref, ref)}\n\t\t\tonChange={composeTwoEventHandlers(registerProps?.onChange, onChange)}\n\t\t\tonBlur={composeTwoEventHandlers(registerProps?.onBlur, onBlur)}\n\t\t/>\n\t);\n}\n\nexport function FormTextArea(props: FormTextAreaProps) {\n\treturn <FormInput {...props} type=\"textarea\" />;\n}\n\nexport function FormSelect(props: FormSelectProps) {\n\treturn <FormInput {...props} type=\"select\" />;\n}\n\nexport function FormDescription(props: InferProps<\"p\">) {\n\tconst { className, ...restOfProps } = props;\n\n\tconst { formDescriptionId } = useLaxFormFieldContext() ?? {};\n\n\treturn <p id={formDescriptionId} className={cnMerge(\"text-[12px]\", className)} {...restOfProps} />;\n}\n\ntype ErrorMessageRenderProps = {\n\tclassName: string;\n\t\"data-index\": number;\n\t\"data-part\": \"error-message\";\n\t\"data-scope\": \"form\";\n\t\"data-slot\": \"form-error-message\";\n\tid: string | undefined;\n\tref: React.RefCallback<HTMLElement>;\n};\n\ntype ErrorMessageRenderState = { errorMessage: string; errorMessageArray: string[]; index: number };\n\ntype ErrorMessageRenderFn = (context: {\n\tprops: ErrorMessageRenderProps;\n\tstate: ErrorMessageRenderState;\n}) => React.ReactNode;\n\nexport type FormErrorMessagePrimitiveProps<TFieldValues extends FieldValues> =\n\tDiscriminatedRenderProps<ErrorMessageRenderFn> & {\n\t\tclassName?: string;\n\t\tclassNames?: {\n\t\t\tcontainer?: string;\n\t\t\terrorMessage?: string;\n\t\t\terrorMessageAnimation?: string;\n\t\t};\n\t\tcontrol?: Control<TFieldValues>; // == Here for type inference of errorField prop\n\t\tdisableErrorAnimation?: boolean;\n\t\tdisableScrollToErrorField?: boolean;\n\t} & (\n\t\t\t| {\n\t\t\t\t\tfieldName: FieldPath<TFieldValues>;\n\t\t\t\t\ttype?: \"regular\";\n\t\t\t }\n\t\t\t| {\n\t\t\t\t\tfieldName: string;\n\t\t\t\t\ttype: \"root\";\n\t\t\t }\n\t\t);\n\ntype FormErrorMessagePrimitiveType = {\n\t<TFieldValues extends FieldValues>(\n\t\tprops: Extract<FormErrorMessagePrimitiveProps<TFieldValues>, { type?: \"regular\" }>\n\t): React.ReactNode;\n\t<TFieldValues extends FieldValues>(\n\t\t// eslint-disable-next-line ts-eslint/unified-signatures -- Using overloads are better because it gives better error messages\n\t\tprops: Extract<FormErrorMessagePrimitiveProps<TFieldValues>, { type: \"root\" }>\n\t): React.ReactNode;\n};\n\nexport const FormErrorMessagePrimitive: FormErrorMessagePrimitiveType = (props) => {\n\tconst fieldContextValues = useLaxFormFieldContext();\n\tconst rootContextValues = useFormMethodsContext({ strict: false });\n\n\tconst {\n\t\tchildren,\n\t\tclassName,\n\t\tclassNames,\n\t\tcontrol = rootContextValues?.control,\n\t\tdisableErrorAnimation = false,\n\t\tdisableScrollToErrorField = false,\n\t\tfieldName = fieldContextValues?.name,\n\t\trender,\n\t\ttype = \"regular\",\n\t} = props;\n\n\tconst { errors } = useLaxFormFieldState({ control, name: fieldName });\n\n\tconst { formMessageId } = useLaxFormFieldContext() ?? {};\n\n\tconst errorParagraphRef = useRef<HTMLElement>(null);\n\n\tconst wrapperRef = useRef<HTMLDivElement>(null);\n\n\tconst errorAnimationClass = classNames?.errorMessageAnimation ?? \"animate-shake\";\n\n\tconst getErrorElements = useCallbackRef(\n\t\t() => wrapperRef.current?.children ?? [errorParagraphRef.current]\n\t);\n\n\tuseEffect(() => {\n\t\tif (disableErrorAnimation) return;\n\n\t\tif (!errors || Object.keys(errors).length === 0) return;\n\n\t\tconst errorMessageElements = getErrorElements();\n\n\t\tif (errorMessageElements.length === 0) return;\n\n\t\tfor (const element of errorMessageElements) {\n\t\t\tif (!element) continue;\n\n\t\t\telement.classList.add(errorAnimationClass);\n\n\t\t\tconst onAnimationEnd = () => element.classList.remove(errorAnimationClass);\n\n\t\t\ton(\"animationend\", element, onAnimationEnd, { once: true });\n\t\t}\n\t}, [disableErrorAnimation, errorAnimationClass, errors, getErrorElements]);\n\n\tuseEffect(() => {\n\t\tif (disableScrollToErrorField) return;\n\n\t\tif (!errors || Object.keys(errors).length === 0) return;\n\n\t\tconst errorMessageElements = getErrorElements();\n\n\t\tconst firstErrorElement = errorMessageElements[0];\n\n\t\tif (!firstErrorElement) return;\n\n\t\t// == Find the input field associated with this error\n\t\tconst inputField = document.querySelector(`[name='${fieldName}']`);\n\t\tconst isFocusableInput = inputField?.matches(\n\t\t\t\":is(input, select, textarea, [contenteditable='true'])\"\n\t\t);\n\n\t\t// == Return early if the input field is focusable (Only scrollIntoView for non-focusable fields)\n\t\tif (isFocusableInput) return;\n\n\t\t// == Schedule the scroll to next frame to ensure DOM is ready\n\t\trequestAnimationFrame(() => {\n\t\t\t// == Get the element's position and scroll in one frame\n\t\t\tconst rect = firstErrorElement.getBoundingClientRect();\n\t\t\tconst topWithOffset = rect.top - 100;\n\n\t\t\twindow.scrollTo({\n\t\t\t\tbehavior: \"smooth\",\n\t\t\t\ttop: window.scrollY + topWithOffset,\n\t\t\t});\n\t\t});\n\t}, [disableScrollToErrorField, fieldName, errors, getErrorElements]);\n\n\tconst fieldErrorMessage = getFieldErrorMessage({ errors, fieldName, type });\n\n\tif (!fieldErrorMessage) {\n\t\treturn null;\n\t}\n\n\tconst errorMessageArray = toArray(fieldErrorMessage);\n\n\tif (errorMessageArray.length === 0) {\n\t\treturn null;\n\t}\n\n\tconst getRenderProps = (options: { index: number }): ErrorMessageRenderProps => {\n\t\tconst { index } = options;\n\n\t\treturn {\n\t\t\tclassName: cnMerge(className, classNames?.errorMessage),\n\t\t\t\"data-index\": index,\n\t\t\t\"data-part\": \"error-message\",\n\t\t\t\"data-scope\": \"form\",\n\t\t\t\"data-slot\": \"form-error-message\",\n\t\t\tid: formMessageId,\n\t\t\tref: (node) => {\n\t\t\t\tif (!node || errorParagraphRef.current) return;\n\n\t\t\t\terrorParagraphRef.current = node;\n\t\t\t},\n\t\t};\n\t};\n\n\tconst getRenderState = (options: { errorMessage: string; index: number }): ErrorMessageRenderState => {\n\t\tconst { errorMessage, index } = options;\n\n\t\treturn {\n\t\t\terrorMessage,\n\t\t\terrorMessageArray,\n\t\t\tindex,\n\t\t};\n\t};\n\n\tconst [ErrorMessageList] = getElementList(\"base\");\n\n\tconst WrapperComponent = \"div\";\n\n\tconst wrapperComponentProps = errorMessageArray.length > 1 && {\n\t\tclassName: cnMerge(\"flex flex-col\", classNames?.container),\n\t\t\"data-part\": \"error-message-container\",\n\t\t\"data-scope\": \"form\",\n\t\t\"data-slot\": \"form-error-message-container\",\n\t\tref: wrapperRef,\n\t};\n\n\tconst selectedChildren = typeof children === \"function\" ? children : render;\n\n\treturn (\n\t\t<WrapperComponent {...wrapperComponentProps}>\n\t\t\t<ErrorMessageList\n\t\t\t\teach={errorMessageArray}\n\t\t\t\trender={(errorMessage, index) => {\n\t\t\t\t\treturn selectedChildren({\n\t\t\t\t\t\tprops: getRenderProps({ index }),\n\t\t\t\t\t\tstate: getRenderState({ errorMessage, index }),\n\t\t\t\t\t});\n\t\t\t\t}}\n\t\t\t/>\n\t\t</WrapperComponent>\n\t);\n};\n\ntype FormErrorMessageProps<TControl, TFieldValues extends FieldValues> =\n\t| (TControl extends Control<infer TValues>\n\t\t\t? {\n\t\t\t\t\tclassName?: string;\n\t\t\t\t\tcontrol?: never;\n\t\t\t\t\terrorField?: FieldPath<TValues>;\n\t\t\t\t\ttype?: \"regular\";\n\t\t\t\t}\n\t\t\t: {\n\t\t\t\t\tclassName?: string;\n\t\t\t\t\tcontrol?: Control<TFieldValues>; // == Here for type inference of errorField prop\n\t\t\t\t\terrorField?: FieldPath<TFieldValues>;\n\t\t\t\t\ttype?: \"regular\";\n\t\t\t\t})\n\t| {\n\t\t\tclassName?: string;\n\t\t\tcontrol?: never;\n\t\t\terrorField: string;\n\t\t\ttype: \"root\";\n\t };\n\nexport function FormErrorMessage<TControl, TFieldValues extends FieldValues = FieldValues>(\n\tprops: FormErrorMessageProps<TControl, TFieldValues>\n) {\n\tconst fieldContextValues = useLaxFormFieldContext();\n\n\tconst { className, errorField = fieldContextValues?.name, type = \"regular\" } = props;\n\n\tconst { control } = useFormMethodsContext();\n\n\treturn (\n\t\t<FormErrorMessagePrimitive\n\t\t\tcontrol={control}\n\t\t\tfieldName={errorField as NonNullable<typeof errorField>}\n\t\t\ttype={type as \"root\"}\n\t\t\trender={({ props: renderProps, state }) => (\n\t\t\t\t<p\n\t\t\t\t\tkey={state.errorMessage}\n\t\t\t\t\t{...renderProps}\n\t\t\t\t\tclassName={cnMerge(\n\t\t\t\t\t\t\"text-[13px] text-red-600\",\n\t\t\t\t\t\t\"data-[index=0]:mt-1\",\n\t\t\t\t\t\trenderProps.className,\n\t\t\t\t\t\tclassName\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t{state.errorMessage}\n\t\t\t\t</p>\n\t\t\t)}\n\t\t/>\n\t);\n}\n\ntype FormSubmitProps = InferProps<\"button\"> & { asChild?: boolean };\n\nexport function FormSubmit<TElement extends React.ElementType = \"button\">(\n\tprops: PolymorphicProps<TElement, FormSubmitProps>\n) {\n\tconst { as: Element = \"button\", asChild, children, type = \"submit\", ...restOfProps } = props;\n\n\tconst Component = asChild ? Slot.Root : Element;\n\n\treturn (\n\t\t<Component data-part=\"submit\" data-scope=\"form\" data-slot=\"form-submit\" type={type} {...restOfProps}>\n\t\t\t{children}\n\t\t</Component>\n\t);\n}\n\ntype GetFieldValue<TFieldPathOrPaths, TFieldValues extends FieldValues> =\n\tTFieldPathOrPaths extends Array<FieldPath<TFieldValues>>\n\t\t? FieldPathValues<TFieldValues, TFieldPathOrPaths>\n\t\t: TFieldPathOrPaths extends FieldPath<TFieldValues>\n\t\t\t? FieldPathValue<TFieldValues, TFieldPathOrPaths>\n\t\t\t: unknown;\n\ntype FormSubscribeToFieldValueRenderFn<TFieldValues extends FieldValues, TFieldPathOrPaths> = (props: {\n\tvalue: GetFieldValue<TFieldPathOrPaths, TFieldValues>;\n}) => React.ReactNode;\n\ntype FormSubscribeToFieldValueProps<\n\tTFieldValues extends FieldValues,\n\tTFieldPathOrPaths,\n> = DiscriminatedRenderProps<FormSubscribeToFieldValueRenderFn<TFieldValues, TFieldPathOrPaths>> & {\n\tcontrol: Control<TFieldValues>;\n\tname?: TFieldPathOrPaths;\n};\n\nexport function FormSubscribeToFieldValue<\n\tTFieldValues extends FieldValues,\n\tconst TFieldPathOrPaths extends Array<FieldPath<TFieldValues>> | FieldPath<TFieldValues>,\n>(props: FormSubscribeToFieldValueProps<TFieldValues, TFieldPathOrPaths>) {\n\tconst fieldContextValues = useLaxFormFieldContext();\n\n\tconst { children, name = fieldContextValues?.name, render } = props;\n\n\tconst { control } = useFormMethodsContext();\n\n\tconst formValue = useWatch({ control, name: name as string });\n\n\tconst fieldProps = { value: formValue };\n\n\tconst selectedChildren = typeof children === \"function\" ? children : render;\n\n\tconst resolvedChildren = selectedChildren(fieldProps as never);\n\n\treturn resolvedChildren;\n}\n\ntype FormSubscribeToFormStateRenderFn<TFieldValues extends FieldValues> = (\n\tprops: UseFormStateReturn<TFieldValues>\n) => React.ReactNode;\n\ntype FormSubscribeToFormStateProps<TFieldValues extends FieldValues> = DiscriminatedRenderProps<\n\tFormSubscribeToFormStateRenderFn<TFieldValues>\n> & {\n\tcontrol?: Control<TFieldValues>;\n\tname?: Array<FieldPath<TFieldValues>> | FieldPath<TFieldValues>;\n};\n\nexport function FormSubscribeToFormState<TFieldValues extends FieldValues = FieldValues>(\n\tprops: FormSubscribeToFormStateProps<TFieldValues>\n) {\n\tconst fieldContextValues = useLaxFormFieldContext();\n\n\tconst { children, control, name = fieldContextValues?.name, render } = props;\n\n\tconst formState = useFormState({ control, name: name as FieldPath<TFieldValues> });\n\n\tconst selectedChildren = typeof children === \"function\" ? children : render;\n\n\tconst resolvedChildren = selectedChildren(formState as never);\n\n\treturn resolvedChildren;\n}\n","export {\n\tFormDescription as Description,\n\tFormErrorMessage as ErrorMessage,\n\tFormErrorMessagePrimitive as ErrorMessagePrimitive,\n\tFormField as Field,\n\tFormFieldContext as FieldContext,\n\tFormFieldController as FieldController,\n\tFormFieldControlledField as ControlledField,\n\tFormInput as Input,\n\tFormInputGroup as InputGroup,\n\tFormInputLeftItem as InputLeftItem,\n\tFormInputPrimitive as InputPrimitive,\n\tFormInputRightItem as InputRightItem,\n\tFormLabel as Label,\n\tFormRoot as Root,\n\tFormSelect as Select,\n\tFormSubmit as Submit,\n\tFormSubscribeToFieldValue as SubscribeToFieldValue,\n\tFormSubscribeToFormState as SubscribeToFormState,\n\tFormTextArea as TextArea,\n\tFormTextAreaPrimitive as TextAreaPrimitive,\n} from \"./form\";\n"]}
1
+ {"version":3,"sources":["../../src/components/ui/form/icons.tsx","../../src/components/ui/form/utils.ts","../../src/components/ui/form/form-context.ts","../../src/components/ui/form/form.tsx","../../src/components/ui/form/form-parts.ts"],"names":["React","errorMessage","createElement","useHookFormContext","HookFormProvider","ReactFragment","useFormState"],"mappings":";;;;;;;;;;;;;;AAEO,IAAM,aAAgB,GAAA,CAAC,KAC7B,qBAAAA,MAAA,CAAA,aAAA,CAAC,SAAI,KAAM,EAAA,4BAAA,EAA6B,KAAM,EAAA,KAAA,EAAM,MAAO,EAAA,KAAA,EAAM,OAAQ,EAAA,WAAA,EAAa,GAAG,KACxF,EAAA,kBAAAA,MAAA,CAAA,aAAA;AAAA,EAAC,MAAA;AAAA,EAAA;AAAA,IACA,IAAK,EAAA,cAAA;AAAA,IACL,CAAE,EAAA;AAAA;AACH,CACD,CAAA;AAGM,IAAM,WAAc,GAAA,CAAC,KAC3B,qBAAAA,MAAA,CAAA,aAAA,CAAC,SAAI,KAAM,EAAA,4BAAA,EAA6B,KAAM,EAAA,KAAA,EAAM,MAAO,EAAA,KAAA,EAAM,OAAQ,EAAA,WAAA,EAAa,GAAG,KACxF,EAAA,kBAAAA,MAAA,CAAA,aAAA;AAAA,EAAC,MAAA;AAAA,EAAA;AAAA,IACA,IAAK,EAAA,cAAA;AAAA,IACL,CAAE,EAAA;AAAA;AACH,CACD,CAAA;;;ACTM,IAAM,oBAAA,GAAuB,CAAC,OAIO,KAAA;AAC3C,EAAA,MAAM,EAAE,MAAA,EAAQ,SAAW,EAAA,IAAA,EAAS,GAAA,OAAA;AAEpC,EAAI,IAAA,CAAC,aAAa,CAAC,MAAA,IAAU,OAAO,IAAK,CAAA,MAAM,CAAE,CAAA,MAAA,KAAW,CAAG,EAAA;AAE/D,EAAA,IAAI,SAAS,MAAQ,EAAA;AACpB,IAAO,OAAA,MAAA,CAAO,IAAO,GAAA,SAAS,CAAG,EAAA,OAAA;AAAA;AAIlC,EAAM,MAAA,SAAA,GAAY,UAAU,QAAS,CAAA,GAAG,IAAI,SAAU,CAAA,KAAA,CAAM,GAAG,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,SAAYC,GAAAA,YAAAA,CAAa,EAAE,OAAA,EAAS,MAAuC,CAAA;AAEjF,EAAA,MAAM,gBAAmB,GAAA,OAAO,QAAa,KAAA,UAAA,GAAa,QAAW,GAAA,MAAA;AAErE,EAAM,MAAA,gBAAA,GAAmB,iBAAiB,SAAkB,CAAA;AAE5D,EAAO,OAAA,gBAAA;AACR;;;AC34BA,IAAA,kBAAA,GAAA;AAAA,QAAA,CAAA,kBAAA,EAAA;AAAA,EAAA,eAAA,EAAA,MAAA,wBAAA;AAAA,EAAA,WAAA,EAAA,MAAA,eAAA;AAAA,EAAA,YAAA,EAAA,MAAA,gBAAA;AAAA,EAAA,qBAAA,EAAA,MAAA,yBAAA;AAAA,EAAA,KAAA,EAAA,MAAA,SAAA;AAAA,EAAA,YAAA,EAAA,MAAA,gBAAA;AAAA,EAAA,eAAA,EAAA,MAAA,mBAAA;AAAA,EAAA,KAAA,EAAA,MAAA,SAAA;AAAA,EAAA,UAAA,EAAA,MAAA,cAAA;AAAA,EAAA,aAAA,EAAA,MAAA,iBAAA;AAAA,EAAA,cAAA,EAAA,MAAA,kBAAA;AAAA,EAAA,cAAA,EAAA,MAAA,kBAAA;AAAA,EAAA,KAAA,EAAA,MAAA,SAAA;AAAA,EAAA,IAAA,EAAA,MAAA,QAAA;AAAA,EAAA,MAAA,EAAA,MAAA,UAAA;AAAA,EAAA,MAAA,EAAA,MAAA,UAAA;AAAA,EAAA,qBAAA,EAAA,MAAA,yBAAA;AAAA,EAAA,oBAAA,EAAA,MAAA,wBAAA;AAAA,EAAA,QAAA,EAAA,MAAA,YAAA;AAAA,EAAA,iBAAA,EAAA,MAAA;AAAA,CAAA,CAAA","file":"chunk-P5QP73HG.js","sourcesContent":["import * as React from \"react\";\n\nexport const EyeIconClosed = (props: React.SVGProps<SVGSVGElement>) => (\n\t<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\" {...props}>\n\t\t<path\n\t\t\tfill=\"currentColor\"\n\t\t\td=\"M15.175 8.325q.725.725 1.063 1.65t.237 1.9q0 .375-.275.638t-.65.262t-.638-.262t-.262-.638q.125-.65-.075-1.25T13.95 9.6t-1.025-.65t-1.275-.1q-.375 0-.638-.275t-.262-.65t.263-.637t.637-.263q.95-.1 1.875.238t1.65 1.062M12 6q-.475 0-.925.037t-.9.138q-.425.075-.763-.125t-.462-.6t.088-.775t.612-.45q.575-.125 1.163-.175T12 4q3.425 0 6.263 1.8t4.337 4.85q.1.2.15.413t.05.437t-.038.438t-.137.412q-.45 1-1.112 1.875t-1.463 1.6q-.3.275-.7.225t-.65-.4t-.212-.763t.337-.687q.6-.575 1.1-1.25t.875-1.45q-1.25-2.525-3.613-4.012T12 6m0 13q-3.35 0-6.125-1.812T1.5 12.425q-.125-.2-.187-.437T1.25 11.5t.05-.475t.175-.45q.5-1 1.163-1.912T4.15 7L2.075 4.9q-.275-.3-.262-.712T2.1 3.5t.7-.275t.7.275l17 17q.275.275.288.688t-.288.712q-.275.275-.7.275t-.7-.275l-3.5-3.45q-.875.275-1.775.413T12 19M5.55 8.4q-.725.65-1.325 1.425T3.2 11.5q1.25 2.525 3.613 4.013T12 17q.5 0 .975-.062t.975-.138l-.9-.95q-.275.075-.525.113T12 16q-1.875 0-3.188-1.312T7.5 11.5q0-.275.038-.525t.112-.525zm4.2 4.2\"\n\t\t/>\n\t</svg>\n);\n\nexport const EyeIconOpen = (props: React.SVGProps<SVGSVGElement>) => (\n\t<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\" {...props}>\n\t\t<path\n\t\t\tfill=\"currentColor\"\n\t\t\td=\"M12 16q1.875 0 3.188-1.312T16.5 11.5t-1.312-3.187T12 7T8.813 8.313T7.5 11.5t1.313 3.188T12 16m0-1.8q-1.125 0-1.912-.788T9.3 11.5t.788-1.912T12 8.8t1.913.788t.787 1.912t-.787 1.913T12 14.2m0 4.8q-3.35 0-6.113-1.8t-4.362-4.75q-.125-.225-.187-.462t-.063-.488t.063-.488t.187-.462q1.6-2.95 4.363-4.75T12 4t6.113 1.8t4.362 4.75q.125.225.188.463t.062.487t-.062.488t-.188.462q-1.6 2.95-4.362 4.75T12 19m0-2q2.825 0 5.188-1.487T20.8 11.5q-1.25-2.525-3.613-4.012T12 6T6.813 7.488T3.2 11.5q1.25 2.525 3.613 4.013T12 17\"\n\t\t/>\n\t</svg>\n);\n","import { cnMerge } from \"@/lib/utils/cn\";\nimport { isObject } from \"@zayne-labs/toolkit-type-helpers\";\nimport { createElement } from \"react\";\nimport type { FieldErrors, FieldValues } from \"react-hook-form\";\nimport type { FormErrorMessagePrimitiveProps, FormInputProps } from \"./form\";\nimport type { FormRootContext, RenderIconProps } from \"./form-context\";\nimport { EyeIconClosed, EyeIconOpen } from \"./icons\";\n\nexport const getFieldErrorMessage = (options: {\n\terrors: FieldErrors | undefined;\n\tfieldName: string | undefined;\n\ttype: FormErrorMessagePrimitiveProps<FieldValues>[\"type\"];\n}): string | string[] | null | undefined => {\n\tconst { errors, fieldName, type } = options;\n\n\tif (!fieldName || !errors || Object.keys(errors).length === 0) return;\n\n\tif (type === \"root\") {\n\t\treturn errors.root?.[fieldName]?.message;\n\t}\n\n\t// == Handle nested paths like `notifications.0`\n\tconst pathParts = fieldName.includes(\".\") ? fieldName.split(\".\") : null;\n\n\t// == If there are no path parts, return the error message\n\tif (!pathParts) {\n\t\tconst errorMessage = errors[fieldName]?.message;\n\n\t\treturn errorMessage as string | string[];\n\t}\n\n\tlet extractedError = errors;\n\n\tfor (const part of pathParts) {\n\t\tconst currentError = extractedError[part];\n\n\t\tif (!isObject(currentError)) break;\n\n\t\textractedError = currentError as never;\n\t}\n\n\tconst errorMessage = extractedError.message as unknown as string | string[];\n\n\treturn errorMessage;\n};\n\nexport const getEyeIcon = (options: {\n\tclassNames: FormInputProps[\"classNames\"];\n\ticonType: \"closed\" | \"open\";\n\trenderIconProps: RenderIconProps;\n\twithEyeIcon: FormRootContext[\"withEyeIcon\"];\n}) => {\n\tconst { classNames, iconType, renderIconProps, withEyeIcon } = options;\n\n\tif (!withEyeIcon) {\n\t\treturn null;\n\t}\n\n\tif (withEyeIcon === true) {\n\t\tconst defaultIconMap = {\n\t\t\tclosed: createElement(EyeIconClosed, {\n\t\t\t\tclassName: cnMerge(\"size-full\", classNames?.eyeIcon),\n\t\t\t}),\n\n\t\t\topen: createElement(EyeIconOpen, {\n\t\t\t\tclassName: cnMerge(\"size-full\", classNames?.eyeIcon),\n\t\t\t}),\n\t\t};\n\n\t\treturn defaultIconMap[iconType];\n\t}\n\n\tif (withEyeIcon.renderIcon) {\n\t\treturn withEyeIcon.renderIcon(renderIconProps);\n\t}\n\n\tif (withEyeIcon[iconType]) {\n\t\treturn withEyeIcon[iconType];\n\t}\n\n\treturn null;\n};\n","import { ContextError, createCustomContext } from \"@zayne-labs/toolkit-react\";\nimport type { DiscriminatedRenderProps } from \"@zayne-labs/toolkit-react/utils\";\nimport type { UnionDiscriminator } from \"@zayne-labs/toolkit-type-helpers\";\nimport {\n\ttype Control,\n\ttype UseFormReturn,\n\ttype UseFormStateReturn,\n\tuseFormState,\n\tuseFormContext as useHookFormContext,\n} from \"react-hook-form\";\nimport type { FieldValues, FormInputProps } from \"./form\";\nimport { getFieldErrorMessage } from \"./utils\";\n\ntype UseFormRootContextResult<TStrict extends boolean = true> = TStrict extends true\n\t? UseFormReturn<FieldValues> & { withEyeIcon?: FormInputProps[\"withEyeIcon\"] }\n\t: (UseFormReturn<FieldValues> & { withEyeIcon?: FormInputProps[\"withEyeIcon\"] }) | null;\n\nexport const useFormMethodsContext = <TStrict extends boolean = true>(\n\toptions: { strict?: TStrict } = {}\n): UseFormRootContextResult<TStrict> => {\n\tconst { strict = true } = options;\n\tconst formContext = useHookFormContext();\n\n\tif (strict && !(formContext as unknown)) {\n\t\tthrow new ContextError(\n\t\t\t`useFormRootContext returned \"null\". Did you forget to wrap the necessary components within FormRoot?`\n\t\t);\n\t}\n\n\treturn formContext;\n};\n\nexport type RenderIconProps = {\n\tisPasswordVisible: boolean;\n};\n\ntype EyeIconObject = UnionDiscriminator<\n\t[\n\t\t{ closed: React.ReactNode; open: React.ReactNode },\n\t\t{ renderIcon: (props: RenderIconProps) => React.ReactNode },\n\t]\n>;\n\nexport type FormRootContext = {\n\twithEyeIcon: boolean | EyeIconObject | undefined;\n};\n\nexport const [LaxFormRootProvider, useLaxFormRootContext] = createCustomContext<FormRootContext, false>({\n\thookName: \"useLaxFormRootContext\",\n\tname: \"LaxFormRootContext\",\n\tproviderName: \"FormRoot\",\n\tstrict: false,\n});\n\n// export const useStrictGetFieldState = () => {\n// \tconst { name } = useStrictFormFieldContext();\n\n// \tconst { getFieldState } = useFormRootContext();\n\n// \tconst fieldState = getFieldState(name);\n\n// \treturn fieldState;\n// };\n\nexport type FieldContextValue = {\n\tformDescriptionId: `${string}-(${string})-form-item-description`;\n\tformItemId: `${string}-(${string})-form-item`;\n\tformMessageId: `${string}-(${string})-form-item-message`;\n\tname: string;\n};\n\nexport type FormFieldContextProps = DiscriminatedRenderProps<\n\t(contextValue: FieldContextValue) => React.ReactNode\n>;\n\nexport const [StrictFormFieldProvider, useStrictFormFieldContext] = createCustomContext<FieldContextValue>(\n\t{\n\t\thookName: \"useFormFieldContext\",\n\t\tname: \"StrictFormFieldContext\",\n\t\tproviderName: \"FormField\",\n\t}\n);\n\nexport const [LaxFormFieldProvider, useLaxFormFieldContext] = createCustomContext<\n\tFieldContextValue,\n\tfalse\n>({\n\thookName: \"useLaxFormFieldContext\",\n\tname: \"LaxFormFieldContext\",\n\tproviderName: \"FormField\",\n\tstrict: false,\n});\n\nexport type FieldState = {\n\terrors?: UseFormStateReturn<FieldValues>[\"errors\"];\n\tisDisabled?: boolean;\n\tisInvalid?: boolean;\n};\n\n// eslint-disable-next-line ts-eslint/no-explicit-any -- any is used here for type compatibility\nexport type AnyControl = Control<any>;\n\ntype FieldStateOptions =\n\t| {\n\t\t\tcontrol: AnyControl | undefined;\n\t\t\tname?: string;\n\t }\n\t| {\n\t\t\tcontrol?: AnyControl;\n\t\t\tname: string | undefined;\n\t };\n\nexport const useLaxFormFieldState = (options?: FieldStateOptions): FieldState => {\n\tconst { control = options?.control } = useFormMethodsContext({ strict: false }) ?? {};\n\tconst { name = options?.name } = useLaxFormFieldContext() ?? {};\n\n\tconst getFormState = control ? useFormState : () => ({}) as Partial<ReturnType<typeof useFormState>>;\n\n\tconst { disabled, errors } = getFormState({ control, name });\n\n\tconst errorMessage = getFieldErrorMessage({ errors, fieldName: name, type: \"regular\" });\n\n\treturn {\n\t\terrors,\n\t\tisDisabled: disabled,\n\t\tisInvalid: Boolean(errorMessage),\n\t};\n};\n","\"use client\";\n\nimport * as React from \"react\";\n\nimport { getElementList } from \"@/components/common/for\";\nimport { Slot } from \"@/components/common/slot\";\nimport { cnMerge } from \"@/lib/utils/cn\";\nimport { getMultipleSlots } from \"@/lib/utils/getSlot\";\nimport { dataAttr, on, toArray } from \"@zayne-labs/toolkit-core\";\nimport { useCallbackRef, useToggle } from \"@zayne-labs/toolkit-react\";\nimport {\n\ttype DiscriminatedRenderProps,\n\ttype InferProps,\n\ttype PolymorphicProps,\n\tcomposeRefs,\n\tcomposeTwoEventHandlers,\n} from \"@zayne-labs/toolkit-react/utils\";\nimport { type AnyString, defineEnum } from \"@zayne-labs/toolkit-type-helpers\";\nimport { Fragment as ReactFragment, useEffect, useId, useMemo, useRef } from \"react\";\nimport {\n\ttype Control,\n\tController,\n\ttype ControllerFieldState,\n\ttype ControllerProps,\n\ttype ControllerRenderProps,\n\ttype FieldPath,\n\ttype FieldPathValue,\n\ttype FieldPathValues,\n\tFormProvider as HookFormProvider,\n\ttype RegisterOptions,\n\ttype UseFormReturn,\n\ttype UseFormStateReturn,\n\tuseFormState,\n\tuseWatch,\n} from \"react-hook-form\";\nimport {\n\ttype FieldContextValue,\n\ttype FieldState,\n\ttype FormFieldContextProps,\n\ttype FormRootContext,\n\tLaxFormFieldProvider,\n\tLaxFormRootProvider,\n\tStrictFormFieldProvider,\n\tuseFormMethodsContext,\n\tuseLaxFormFieldContext,\n\tuseLaxFormFieldState,\n\tuseLaxFormRootContext,\n\tuseStrictFormFieldContext,\n} from \"./form-context\";\nimport { getEyeIcon, getFieldErrorMessage } from \"./utils\";\n\nexport type FieldValues = Record<string, unknown>;\n\ntype FormRootProps<TFieldValues extends FieldValues> = Partial<FormRootContext>\n\t& React.ComponentPropsWithoutRef<\"form\"> & {\n\t\tchildren: React.ReactNode;\n\t\tmethods: UseFormReturn<TFieldValues>;\n\t};\n\nexport function FormRoot<TValues extends FieldValues>(props: FormRootProps<TValues>) {\n\tconst { children, className, methods, withEyeIcon, ...restOfProps } = props;\n\n\tconst formContextValue = useMemo(() => ({ withEyeIcon }), [withEyeIcon]);\n\n\treturn (\n\t\t<HookFormProvider {...methods}>\n\t\t\t<LaxFormRootProvider value={formContextValue}>\n\t\t\t\t<form\n\t\t\t\t\tclassName={cnMerge(\"flex flex-col\", className)}\n\t\t\t\t\t{...restOfProps}\n\t\t\t\t\tdata-scope=\"form\"\n\t\t\t\t\tdata-part=\"root\"\n\t\t\t\t\tdata-slot=\"form-root\"\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</form>\n\t\t\t</LaxFormRootProvider>\n\t\t</HookFormProvider>\n\t);\n}\n\ntype FormFieldProps<TControl, TFieldValues extends FieldValues> = (TControl extends Control<infer TValues>\n\t? {\n\t\t\tcontrol?: never;\n\t\t\tname: FieldPath<TValues>;\n\t\t}\n\t: {\n\t\t\tcontrol?: Control<TFieldValues>;\n\t\t\tname: FieldPath<TFieldValues>;\n\t\t})\n\t& (\n\t\t| (InferProps<\"div\"> & {\n\t\t\t\twithWrapper?: true;\n\t\t })\n\t\t| { children: React.ReactNode; className?: never; withWrapper: false }\n\t);\n\nexport function FormField<TControl, TFieldValues extends FieldValues = FieldValues>(\n\tprops: FormFieldProps<TControl, TFieldValues>\n) {\n\tconst { children, className, name, withWrapper = true } = props;\n\n\tconst { isDisabled, isInvalid } = useLaxFormFieldState({ name });\n\n\tconst uniqueId = useId();\n\n\tconst fieldContextValue = useMemo(\n\t\t() =>\n\t\t\t({\n\t\t\t\tformDescriptionId: `${name}-(${uniqueId})-form-item-description`,\n\t\t\t\tformItemId: `${name}-(${uniqueId})-form-item`,\n\t\t\t\tformMessageId: `${name}-(${uniqueId})-form-item-message`,\n\t\t\t\tname,\n\t\t\t}) satisfies FieldContextValue,\n\t\t[name, uniqueId]\n\t);\n\n\tconst WrapperElement = withWrapper ? \"div\" : ReactFragment;\n\n\tconst wrapperElementProps = withWrapper && {\n\t\tclassName: cnMerge(\"flex flex-col\", className),\n\t\t\"data-part\": \"field\",\n\t\t\"data-scope\": \"form\",\n\t\t\"data-slot\": \"form-field\",\n\t\t/* eslint-disable perfectionist/sort-objects -- order of attributes does not matter */\n\t\t\"data-disabled\": dataAttr(isDisabled),\n\t\t\"data-invalid\": dataAttr(isInvalid),\n\t\t/* eslint-enable perfectionist/sort-objects -- order of attributes does not matter */\n\t};\n\treturn (\n\t\t<StrictFormFieldProvider value={fieldContextValue}>\n\t\t\t<LaxFormFieldProvider value={fieldContextValue}>\n\t\t\t\t<WrapperElement {...wrapperElementProps}>{children}</WrapperElement>\n\t\t\t</LaxFormFieldProvider>\n\t\t</StrictFormFieldProvider>\n\t);\n}\n\ntype FormFieldControllerRenderFn = (props: {\n\tfield: Omit<ControllerRenderProps, \"value\"> & {\n\t\tvalue: never;\n\t};\n\tfieldState: ControllerFieldState;\n\tformState: UseFormStateReturn<never>;\n}) => React.ReactElement;\n\ntype FormFieldControllerProps = Omit<\n\tControllerProps<FieldValues, FieldPath<FieldValues>>,\n\t\"control\" | \"name\" | \"render\"\n> & {\n\trender: FormFieldControllerRenderFn;\n};\n\nexport function FormFieldController(props: FormFieldControllerProps) {\n\tconst { control } = useFormMethodsContext();\n\tconst { name } = useStrictFormFieldContext();\n\tconst { render, ...restOfProps } = props;\n\n\treturn <Controller name={name} control={control} render={render as never} {...restOfProps} />;\n}\n\nexport function FormFieldControlledField<TFieldValues extends FieldValues>(\n\tprops: ControllerProps<TFieldValues>\n) {\n\tconst { name } = props;\n\n\tconst uniqueId = useId();\n\n\tconst fieldContextValue = useMemo(\n\t\t() =>\n\t\t\t({\n\t\t\t\tformDescriptionId: `${name}-(${uniqueId})-form-item-description`,\n\t\t\t\tformItemId: `${name}-(${uniqueId})-form-item`,\n\t\t\t\tformMessageId: `${name}-(${uniqueId})-form-item-message`,\n\t\t\t\tname,\n\t\t\t}) satisfies FieldContextValue,\n\t\t[name, uniqueId]\n\t);\n\n\treturn (\n\t\t<StrictFormFieldProvider value={fieldContextValue}>\n\t\t\t<LaxFormFieldProvider value={fieldContextValue}>\n\t\t\t\t<Controller {...props} />\n\t\t\t</LaxFormFieldProvider>\n\t\t</StrictFormFieldProvider>\n\t);\n}\n\nexport function FormFieldContext(props: FormFieldContextProps) {\n\tconst { children, render } = props;\n\tconst fieldContextValues = useStrictFormFieldContext();\n\n\tif (typeof children === \"function\") {\n\t\treturn children(fieldContextValues);\n\t}\n\n\treturn render(fieldContextValues);\n}\n\nexport function FormLabel(props: InferProps<\"label\">) {\n\tconst { formItemId, name } = useStrictFormFieldContext();\n\tconst { children, className, ...restOfProps } = props;\n\n\tconst { isDisabled, isInvalid } = useLaxFormFieldState({ name });\n\n\treturn (\n\t\t<label\n\t\t\tdata-scope=\"form\"\n\t\t\tdata-part=\"label\"\n\t\t\tdata-slot=\"form-label\"\n\t\t\tdata-disabled={dataAttr(isDisabled)}\n\t\t\tdata-invalid={dataAttr(isInvalid)}\n\t\t\thtmlFor={formItemId}\n\t\t\tclassName={className}\n\t\t\t{...restOfProps}\n\t\t>\n\t\t\t{children}\n\t\t</label>\n\t);\n}\n\nexport function FormInputGroup(props: InferProps<\"div\">) {\n\tconst { children, className, ...restOfProps } = props;\n\n\tconst { isDisabled, isInvalid } = useLaxFormFieldState();\n\n\tconst {\n\t\tregularChildren,\n\t\tslots: [leftItemSlot, rightItemSlot],\n\t} = getMultipleSlots(children, [FormInputLeftItem, FormInputRightItem]);\n\n\treturn (\n\t\t<div\n\t\t\tdata-scope=\"form\"\n\t\t\tdata-part=\"input-group\"\n\t\t\tdata-slot=\"form-input-group\"\n\t\t\tdata-invalid={dataAttr(isInvalid)}\n\t\t\tdata-disabled={dataAttr(isDisabled)}\n\t\t\tclassName={cnMerge(\"flex items-center justify-between gap-2\", className)}\n\t\t\t{...restOfProps}\n\t\t>\n\t\t\t{leftItemSlot}\n\t\t\t{regularChildren}\n\t\t\t{rightItemSlot}\n\t\t</div>\n\t);\n}\n\ntype FormSideItemProps = {\n\tchildren?: React.ReactNode;\n\tclassName?: string;\n};\n\nexport function FormInputLeftItem<TElement extends React.ElementType = \"span\">(\n\tprops: PolymorphicProps<TElement, FormSideItemProps>\n) {\n\tconst { as: Element = \"span\", children, className, ...restOfProps } = props;\n\n\treturn (\n\t\t<Element\n\t\t\tdata-scope=\"form\"\n\t\t\tdata-part=\"left-item\"\n\t\t\tdata-slot=\"form-left-item\"\n\t\t\tclassName={cnMerge(\"inline-flex items-center justify-center\", className)}\n\t\t\t{...restOfProps}\n\t\t>\n\t\t\t{children}\n\t\t</Element>\n\t);\n}\nFormInputLeftItem.slotSymbol = Symbol(\"input-left-item\");\n\nexport function FormInputRightItem<TElement extends React.ElementType = \"span\">(\n\tprops: PolymorphicProps<TElement, FormSideItemProps>\n) {\n\tconst { as: Element = \"span\", children, className, ...restOfProps } = props;\n\n\treturn (\n\t\t<Element\n\t\t\tdata-scope=\"form\"\n\t\t\tdata-part=\"right-item\"\n\t\t\tdata-slot=\"form-right-item\"\n\t\t\tclassName={cnMerge(\"inline-flex items-center justify-center\", className)}\n\t\t\t{...restOfProps}\n\t\t>\n\t\t\t{children}\n\t\t</Element>\n\t);\n}\nFormInputRightItem.slotSymbol = Symbol(\"input-right-item\");\n\ntype FormInputPrimitiveProps<TFieldValues extends FieldValues = FieldValues> = Omit<\n\tReact.ComponentPropsWithRef<\"input\">,\n\t\"children\"\n> & {\n\tclassNames?: { error?: string; eyeIcon?: string; input?: string; inputGroup?: string };\n\tcontrol?: Control<TFieldValues>;\n\tfieldState?: FieldState;\n\tname?: FieldPath<TFieldValues>;\n\twithEyeIcon?: FormRootContext[\"withEyeIcon\"];\n};\n\ntype FormTextAreaPrimitiveProps<TFieldValues extends FieldValues = FieldValues> =\n\tReact.ComponentPropsWithRef<\"textarea\"> & {\n\t\tclassNames?: { base?: string; error?: string };\n\t\tcontrol?: Control<TFieldValues>;\n\t\tfieldState?: FieldState;\n\t\tname?: FieldPath<TFieldValues>;\n\t};\n\ntype FormSelectPrimitiveProps<TFieldValues extends FieldValues = FieldValues> =\n\tReact.ComponentPropsWithRef<\"select\"> & {\n\t\tclassNames?: { base?: string; error?: string };\n\t\tcontrol?: Control<TFieldValues>;\n\t\tfieldState?: FieldState;\n\t\tname?: FieldPath<TFieldValues>;\n\t};\n\nconst inputTypesWithoutFullWith = new Set<React.HTMLInputTypeAttribute>([\"checkbox\", \"radio\"]);\n\nexport function FormInputPrimitive<TFieldValues extends FieldValues>(\n\tprops: FormInputPrimitiveProps<TFieldValues> & { rules?: RegisterOptions }\n) {\n\tconst fieldContextValues = useLaxFormFieldContext();\n\n\tconst formRootContextValues = useLaxFormRootContext();\n\n\tconst {\n\t\tclassName,\n\t\tclassNames,\n\t\tcontrol,\n\t\tfieldState,\n\t\tid = fieldContextValues?.formItemId,\n\t\tname = fieldContextValues?.name,\n\t\trules,\n\t\ttype = \"text\",\n\t\twithEyeIcon = formRootContextValues?.withEyeIcon ?? true,\n\t\t...restOfProps\n\t} = props;\n\n\tconst fieldStateFromLaxFormField = useLaxFormFieldState({ control, name });\n\n\tconst { isDisabled, isInvalid } = fieldState ?? fieldStateFromLaxFormField;\n\n\tconst [isPasswordVisible, toggleVisibility] = useToggle(false);\n\n\tconst shouldHaveEyeIcon = withEyeIcon && type === \"password\";\n\n\tconst WrapperElement = shouldHaveEyeIcon ? FormInputGroup : ReactFragment;\n\n\tconst wrapperElementProps = shouldHaveEyeIcon && {\n\t\tclassName: cnMerge(\"w-full\", classNames?.inputGroup, isInvalid && classNames?.error),\n\t};\n\n\tconst { register } = useFormMethodsContext({ strict: false }) ?? {};\n\n\tconst eyeIcon = getEyeIcon({\n\t\tclassNames,\n\t\ticonType: isPasswordVisible ? \"closed\" : \"open\",\n\t\trenderIconProps: { isPasswordVisible },\n\t\twithEyeIcon,\n\t});\n\n\treturn (\n\t\t<WrapperElement {...wrapperElementProps}>\n\t\t\t<input\n\t\t\t\tdata-scope=\"form\"\n\t\t\t\tdata-part=\"input\"\n\t\t\t\tdata-slot=\"form-input\"\n\t\t\t\taria-describedby={\n\t\t\t\t\t!isInvalid\n\t\t\t\t\t\t? fieldContextValues?.formDescriptionId\n\t\t\t\t\t\t: `${fieldContextValues?.formDescriptionId} ${fieldContextValues?.formMessageId}`\n\t\t\t\t}\n\t\t\t\taria-invalid={dataAttr(isInvalid)}\n\t\t\t\tdata-invalid={dataAttr(isInvalid)}\n\t\t\t\tdata-disabled={dataAttr(isDisabled)}\n\t\t\t\tid={id}\n\t\t\t\tname={name}\n\t\t\t\ttype={type === \"password\" && isPasswordVisible ? \"text\" : type}\n\t\t\t\tclassName={cnMerge(\n\t\t\t\t\t!inputTypesWithoutFullWith.has(type) && \"flex w-full\",\n\t\t\t\t\t`focus-visible:outline-hidden placeholder:text-shadcn-muted-foreground bg-transparent\n\t\t\t\t\ttext-sm file:border-0 file:bg-transparent disabled:cursor-not-allowed disabled:opacity-50`,\n\t\t\t\t\tclassName,\n\t\t\t\t\tclassNames?.input,\n\t\t\t\t\ttype !== \"password\" && isInvalid && classNames?.error\n\t\t\t\t)}\n\t\t\t\t{...(Boolean(name) && register?.(name, rules))}\n\t\t\t\t{...restOfProps}\n\t\t\t/>\n\n\t\t\t{shouldHaveEyeIcon && (\n\t\t\t\t<FormInputRightItem\n\t\t\t\t\tas=\"button\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tonClick={toggleVisibility}\n\t\t\t\t\tclassName=\"size-5 shrink-0 lg:size-6\"\n\t\t\t\t>\n\t\t\t\t\t{eyeIcon}\n\t\t\t\t</FormInputRightItem>\n\t\t\t)}\n\t\t</WrapperElement>\n\t);\n}\n\nexport function FormTextAreaPrimitive<TFieldValues extends FieldValues>(\n\tprops: FormTextAreaPrimitiveProps<TFieldValues> & { rules?: RegisterOptions }\n) {\n\tconst fieldContextValues = useLaxFormFieldContext();\n\n\tconst {\n\t\tclassName,\n\t\tclassNames,\n\t\tcontrol,\n\t\tfieldState,\n\t\tid = fieldContextValues?.formItemId,\n\t\tname = fieldContextValues?.name,\n\t\trules,\n\t\t...restOfProps\n\t} = props;\n\n\tconst fieldStateFromLaxFormField = useLaxFormFieldState({ control, name });\n\n\tconst { isDisabled, isInvalid } = fieldState ?? fieldStateFromLaxFormField;\n\n\tconst { register } = useFormMethodsContext({ strict: false }) ?? {};\n\n\treturn (\n\t\t<textarea\n\t\t\tdata-scope=\"form\"\n\t\t\tdata-part=\"textarea\"\n\t\t\tdata-slot=\"form-textarea\"\n\t\t\taria-describedby={\n\t\t\t\t!isInvalid\n\t\t\t\t\t? fieldContextValues?.formDescriptionId\n\t\t\t\t\t: `${fieldContextValues?.formDescriptionId} ${fieldContextValues?.formMessageId}`\n\t\t\t}\n\t\t\taria-invalid={dataAttr(isInvalid)}\n\t\t\tdata-disabled={dataAttr(isDisabled)}\n\t\t\tdata-invalid={dataAttr(isInvalid)}\n\t\t\tid={id}\n\t\t\tname={name}\n\t\t\tclassName={cnMerge(\n\t\t\t\t`placeholder:text-shadcn-muted-foreground focus-visible:outline-hidden w-full bg-transparent\n\t\t\t\ttext-sm disabled:cursor-not-allowed disabled:opacity-50`,\n\t\t\t\tclassName,\n\t\t\t\tclassNames?.base,\n\t\t\t\tisInvalid && classNames?.error\n\t\t\t)}\n\t\t\t{...(Boolean(name) && register?.(name, rules))}\n\t\t\t{...restOfProps}\n\t\t/>\n\t);\n}\nexport function FormSelectPrimitive<TFieldValues extends FieldValues>(\n\tprops: FormSelectPrimitiveProps<TFieldValues> & { rules?: RegisterOptions }\n) {\n\tconst fieldContextValues = useLaxFormFieldContext();\n\n\tconst {\n\t\tclassName,\n\t\tclassNames,\n\t\tcontrol,\n\t\tfieldState,\n\t\tid = fieldContextValues?.formItemId,\n\t\tname = fieldContextValues?.name,\n\t\trules,\n\t\t...restOfProps\n\t} = props;\n\n\tconst fieldStateFromLaxFormField = useLaxFormFieldState({ control, name });\n\n\tconst { isDisabled, isInvalid } = fieldState ?? fieldStateFromLaxFormField;\n\n\tconst { register } = useFormMethodsContext({ strict: false }) ?? {};\n\n\treturn (\n\t\t<select\n\t\t\tdefaultValue=\"\"\n\t\t\tdata-scope=\"form\"\n\t\t\tdata-part=\"select\"\n\t\t\tdata-slot=\"form-select\"\n\t\t\taria-describedby={\n\t\t\t\t!isInvalid\n\t\t\t\t\t? fieldContextValues?.formDescriptionId\n\t\t\t\t\t: `${fieldContextValues?.formDescriptionId} ${fieldContextValues?.formMessageId}`\n\t\t\t}\n\t\t\taria-invalid={dataAttr(isInvalid)}\n\t\t\tdata-disabled={dataAttr(isDisabled)}\n\t\t\tdata-invalid={dataAttr(isInvalid)}\n\t\t\tid={id}\n\t\t\tname={name}\n\t\t\tclassName={cnMerge(\n\t\t\t\t`placeholder:text-shadcn-muted-foreground focus-visible:outline-hidden w-full bg-transparent\n\t\t\t\ttext-sm disabled:cursor-not-allowed disabled:opacity-50`,\n\t\t\t\tclassName,\n\t\t\t\tclassNames?.base,\n\t\t\t\tisInvalid && classNames?.error\n\t\t\t)}\n\t\t\t{...(Boolean(name) && register?.(name, rules))}\n\t\t\t{...restOfProps}\n\t\t/>\n\t);\n}\n\ntype PrimitivePropsToOmit = \"control\" | \"formState\" | \"name\";\n\nexport type FormInputProps = Omit<FormInputPrimitiveProps, PrimitivePropsToOmit> & {\n\trules?: RegisterOptions;\n};\n\nexport type FormTextAreaProps = Omit<FormTextAreaPrimitiveProps, PrimitivePropsToOmit> & {\n\trules?: RegisterOptions;\n};\n\nexport type FormSelectProps = Omit<FormSelectPrimitiveProps, PrimitivePropsToOmit> & {\n\trules?: RegisterOptions;\n};\n\ntype CombinedFormInputProps =\n\t| (FormSelectProps & { type: \"select\" })\n\t| (FormTextAreaProps & { type: \"textarea\" })\n\t| FormInputProps;\n\nconst InputTypeMap = defineEnum({\n\tselect: FormSelectPrimitive,\n\ttextarea: FormTextAreaPrimitive,\n});\n\nexport function FormInput(props: CombinedFormInputProps & { rules?: RegisterOptions }) {\n\tconst { onBlur, onChange, ref, rules, type, ...restOfProps } = props;\n\n\tconst { name } = useStrictFormFieldContext();\n\tconst { register } = useFormMethodsContext();\n\n\tconst SelectedInput =\n\t\ttype === \"textarea\" || type === \"select\"\n\t\t\t? InputTypeMap[type as Exclude<typeof type, AnyString>]\n\t\t\t: FormInputPrimitive;\n\n\tconst registerProps = name ? register(name, rules) : null;\n\n\treturn (\n\t\t<SelectedInput\n\t\t\ttype={type as never}\n\t\t\tname={name}\n\t\t\t{...registerProps}\n\t\t\t{...(restOfProps as NonNullable<unknown>)}\n\t\t\tref={composeRefs(registerProps?.ref, ref)}\n\t\t\tonChange={composeTwoEventHandlers(registerProps?.onChange, onChange)}\n\t\t\tonBlur={composeTwoEventHandlers(registerProps?.onBlur, onBlur)}\n\t\t/>\n\t);\n}\n\nexport function FormTextArea(props: FormTextAreaProps) {\n\treturn <FormInput {...props} type=\"textarea\" />;\n}\n\nexport function FormSelect(props: FormSelectProps) {\n\treturn <FormInput {...props} type=\"select\" />;\n}\n\nexport function FormDescription(props: InferProps<\"p\">) {\n\tconst { className, ...restOfProps } = props;\n\n\tconst { formDescriptionId } = useLaxFormFieldContext() ?? {};\n\n\treturn <p id={formDescriptionId} className={cnMerge(\"text-[12px]\", className)} {...restOfProps} />;\n}\n\ntype ErrorMessageRenderProps = {\n\tclassName: string;\n\t\"data-index\": number;\n\t\"data-part\": \"error-message\";\n\t\"data-scope\": \"form\";\n\t\"data-slot\": \"form-error-message\";\n\tid: string | undefined;\n\tref: React.RefCallback<HTMLElement>;\n};\n\ntype ErrorMessageRenderState = { errorMessage: string; errorMessageArray: string[]; index: number };\n\ntype ErrorMessageRenderFn = (context: {\n\tprops: ErrorMessageRenderProps;\n\tstate: ErrorMessageRenderState;\n}) => React.ReactNode;\n\nexport type FormErrorMessagePrimitiveProps<TFieldValues extends FieldValues> =\n\tDiscriminatedRenderProps<ErrorMessageRenderFn> & {\n\t\tclassName?: string;\n\t\tclassNames?: {\n\t\t\tcontainer?: string;\n\t\t\terrorMessage?: string;\n\t\t\terrorMessageAnimation?: string;\n\t\t};\n\t\tcontrol?: Control<TFieldValues>; // == Here for type inference of errorField prop\n\t\tdisableErrorAnimation?: boolean;\n\t\tdisableScrollToErrorField?: boolean;\n\t} & (\n\t\t\t| {\n\t\t\t\t\tfieldName: FieldPath<TFieldValues>;\n\t\t\t\t\ttype?: \"regular\";\n\t\t\t }\n\t\t\t| {\n\t\t\t\t\tfieldName: string;\n\t\t\t\t\ttype: \"root\";\n\t\t\t }\n\t\t);\n\ntype FormErrorMessagePrimitiveType = {\n\t<TFieldValues extends FieldValues>(\n\t\tprops: Extract<FormErrorMessagePrimitiveProps<TFieldValues>, { type?: \"regular\" }>\n\t): React.ReactNode;\n\t<TFieldValues extends FieldValues>(\n\t\t// eslint-disable-next-line ts-eslint/unified-signatures -- Using overloads are better because it gives better error messages\n\t\tprops: Extract<FormErrorMessagePrimitiveProps<TFieldValues>, { type: \"root\" }>\n\t): React.ReactNode;\n};\n\nexport const FormErrorMessagePrimitive: FormErrorMessagePrimitiveType = (props) => {\n\tconst fieldContextValues = useLaxFormFieldContext();\n\tconst rootContextValues = useFormMethodsContext({ strict: false });\n\n\tconst {\n\t\tchildren,\n\t\tclassName,\n\t\tclassNames,\n\t\tcontrol = rootContextValues?.control,\n\t\tdisableErrorAnimation = false,\n\t\tdisableScrollToErrorField = false,\n\t\tfieldName = fieldContextValues?.name,\n\t\trender,\n\t\ttype = \"regular\",\n\t} = props;\n\n\tconst { errors } = useLaxFormFieldState({ control, name: fieldName });\n\n\tconst { formMessageId } = useLaxFormFieldContext() ?? {};\n\n\tconst errorParagraphRef = useRef<HTMLElement>(null);\n\n\tconst wrapperRef = useRef<HTMLDivElement>(null);\n\n\tconst errorAnimationClass = classNames?.errorMessageAnimation ?? \"animate-shake\";\n\n\tconst getErrorElements = useCallbackRef(\n\t\t() => wrapperRef.current?.children ?? [errorParagraphRef.current]\n\t);\n\n\tuseEffect(() => {\n\t\tif (disableErrorAnimation) return;\n\n\t\tif (!errors || Object.keys(errors).length === 0) return;\n\n\t\tconst errorMessageElements = getErrorElements();\n\n\t\tif (errorMessageElements.length === 0) return;\n\n\t\tfor (const element of errorMessageElements) {\n\t\t\tif (!element) continue;\n\n\t\t\telement.classList.add(errorAnimationClass);\n\n\t\t\tconst onAnimationEnd = () => element.classList.remove(errorAnimationClass);\n\n\t\t\ton(\"animationend\", element, onAnimationEnd, { once: true });\n\t\t}\n\t}, [disableErrorAnimation, errorAnimationClass, errors, getErrorElements]);\n\n\tuseEffect(() => {\n\t\tif (disableScrollToErrorField) return;\n\n\t\tif (!errors || Object.keys(errors).length === 0) return;\n\n\t\tconst errorMessageElements = getErrorElements();\n\n\t\tconst firstErrorElement = errorMessageElements[0];\n\n\t\tif (!firstErrorElement) return;\n\n\t\t// == Find the input field associated with this error\n\t\tconst inputField = document.querySelector(`[name='${fieldName}']`);\n\t\tconst isFocusableInput = inputField?.matches(\n\t\t\t\":is(input, select, textarea, [contenteditable='true'])\"\n\t\t);\n\n\t\t// == Return early if the input field is focusable (Only scrollIntoView for non-focusable fields)\n\t\tif (isFocusableInput) return;\n\n\t\t// == Schedule the scroll to next frame to ensure DOM is ready\n\t\trequestAnimationFrame(() => {\n\t\t\t// == Get the element's position and scroll in one frame\n\t\t\tconst rect = firstErrorElement.getBoundingClientRect();\n\t\t\tconst topWithOffset = rect.top - 100;\n\n\t\t\twindow.scrollTo({\n\t\t\t\tbehavior: \"smooth\",\n\t\t\t\ttop: window.scrollY + topWithOffset,\n\t\t\t});\n\t\t});\n\t}, [disableScrollToErrorField, fieldName, errors, getErrorElements]);\n\n\tconst fieldErrorMessage = getFieldErrorMessage({ errors, fieldName, type });\n\n\tif (!fieldErrorMessage) {\n\t\treturn null;\n\t}\n\n\tconst errorMessageArray = toArray(fieldErrorMessage);\n\n\tif (errorMessageArray.length === 0) {\n\t\treturn null;\n\t}\n\n\tconst getRenderProps = (options: { index: number }): ErrorMessageRenderProps => {\n\t\tconst { index } = options;\n\n\t\treturn {\n\t\t\tclassName: cnMerge(className, classNames?.errorMessage),\n\t\t\t\"data-index\": index,\n\t\t\t\"data-part\": \"error-message\",\n\t\t\t\"data-scope\": \"form\",\n\t\t\t\"data-slot\": \"form-error-message\",\n\t\t\tid: formMessageId,\n\t\t\tref: (node) => {\n\t\t\t\tif (!node || errorParagraphRef.current) return;\n\n\t\t\t\terrorParagraphRef.current = node;\n\t\t\t},\n\t\t};\n\t};\n\n\tconst getRenderState = (options: { errorMessage: string; index: number }): ErrorMessageRenderState => {\n\t\tconst { errorMessage, index } = options;\n\n\t\treturn {\n\t\t\terrorMessage,\n\t\t\terrorMessageArray,\n\t\t\tindex,\n\t\t};\n\t};\n\n\tconst [ErrorMessageList] = getElementList(\"base\");\n\n\tconst WrapperComponent = \"div\";\n\n\tconst wrapperComponentProps = errorMessageArray.length > 1 && {\n\t\tclassName: cnMerge(\"flex flex-col\", classNames?.container),\n\t\t\"data-part\": \"error-message-container\",\n\t\t\"data-scope\": \"form\",\n\t\t\"data-slot\": \"form-error-message-container\",\n\t\tref: wrapperRef,\n\t};\n\n\tconst selectedChildren = typeof children === \"function\" ? children : render;\n\n\treturn (\n\t\t<WrapperComponent {...wrapperComponentProps}>\n\t\t\t<ErrorMessageList\n\t\t\t\teach={errorMessageArray}\n\t\t\t\trender={(errorMessage, index) => {\n\t\t\t\t\treturn selectedChildren({\n\t\t\t\t\t\tprops: getRenderProps({ index }),\n\t\t\t\t\t\tstate: getRenderState({ errorMessage, index }),\n\t\t\t\t\t});\n\t\t\t\t}}\n\t\t\t/>\n\t\t</WrapperComponent>\n\t);\n};\n\ntype FormErrorMessageProps<TControl, TFieldValues extends FieldValues> =\n\t| (TControl extends Control<infer TValues>\n\t\t\t? {\n\t\t\t\t\tclassName?: string;\n\t\t\t\t\tcontrol?: never;\n\t\t\t\t\terrorField?: FieldPath<TValues>;\n\t\t\t\t\ttype?: \"regular\";\n\t\t\t\t}\n\t\t\t: {\n\t\t\t\t\tclassName?: string;\n\t\t\t\t\tcontrol?: Control<TFieldValues>; // == Here for type inference of errorField prop\n\t\t\t\t\terrorField?: FieldPath<TFieldValues>;\n\t\t\t\t\ttype?: \"regular\";\n\t\t\t\t})\n\t| {\n\t\t\tclassName?: string;\n\t\t\tcontrol?: never;\n\t\t\terrorField: string;\n\t\t\ttype: \"root\";\n\t };\n\nexport function FormErrorMessage<TControl, TFieldValues extends FieldValues = FieldValues>(\n\tprops: FormErrorMessageProps<TControl, TFieldValues>\n) {\n\tconst fieldContextValues = useLaxFormFieldContext();\n\n\tconst { className, errorField = fieldContextValues?.name, type = \"regular\" } = props;\n\n\tconst { control } = useFormMethodsContext();\n\n\treturn (\n\t\t<FormErrorMessagePrimitive\n\t\t\tcontrol={control}\n\t\t\tfieldName={errorField as NonNullable<typeof errorField>}\n\t\t\ttype={type as \"root\"}\n\t\t\trender={({ props: renderProps, state }) => (\n\t\t\t\t<p\n\t\t\t\t\tkey={state.errorMessage}\n\t\t\t\t\t{...renderProps}\n\t\t\t\t\tclassName={cnMerge(\n\t\t\t\t\t\t\"text-[13px] text-red-600\",\n\t\t\t\t\t\t\"data-[index=0]:mt-1\",\n\t\t\t\t\t\trenderProps.className,\n\t\t\t\t\t\tclassName\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t{state.errorMessage}\n\t\t\t\t</p>\n\t\t\t)}\n\t\t/>\n\t);\n}\n\ntype FormSubmitProps = InferProps<\"button\"> & { asChild?: boolean };\n\nexport function FormSubmit<TElement extends React.ElementType = \"button\">(\n\tprops: PolymorphicProps<TElement, FormSubmitProps>\n) {\n\tconst { as: Element = \"button\", asChild, children, type = \"submit\", ...restOfProps } = props;\n\n\tconst Component = asChild ? Slot.Root : Element;\n\n\treturn (\n\t\t<Component data-part=\"submit\" data-scope=\"form\" data-slot=\"form-submit\" type={type} {...restOfProps}>\n\t\t\t{children}\n\t\t</Component>\n\t);\n}\n\ntype GetFieldValue<TFieldPathOrPaths, TFieldValues extends FieldValues> =\n\tTFieldPathOrPaths extends Array<FieldPath<TFieldValues>>\n\t\t? FieldPathValues<TFieldValues, TFieldPathOrPaths>\n\t\t: TFieldPathOrPaths extends FieldPath<TFieldValues>\n\t\t\t? FieldPathValue<TFieldValues, TFieldPathOrPaths>\n\t\t\t: unknown;\n\ntype FormSubscribeToFieldValueRenderFn<TFieldValues extends FieldValues, TFieldPathOrPaths> = (props: {\n\tvalue: GetFieldValue<TFieldPathOrPaths, TFieldValues>;\n}) => React.ReactNode;\n\ntype FormSubscribeToFieldValueProps<\n\tTFieldValues extends FieldValues,\n\tTFieldPathOrPaths,\n> = DiscriminatedRenderProps<FormSubscribeToFieldValueRenderFn<TFieldValues, TFieldPathOrPaths>> & {\n\tcontrol: Control<TFieldValues>;\n\tname?: TFieldPathOrPaths;\n};\n\nexport function FormSubscribeToFieldValue<\n\tTFieldValues extends FieldValues,\n\tconst TFieldPathOrPaths extends Array<FieldPath<TFieldValues>> | FieldPath<TFieldValues>,\n>(props: FormSubscribeToFieldValueProps<TFieldValues, TFieldPathOrPaths>) {\n\tconst fieldContextValues = useLaxFormFieldContext();\n\n\tconst { children, name = fieldContextValues?.name, render } = props;\n\n\tconst { control } = useFormMethodsContext();\n\n\tconst formValue = useWatch({ control, name: name as string });\n\n\tconst fieldProps = { value: formValue };\n\n\tconst selectedChildren = typeof children === \"function\" ? children : render;\n\n\tconst resolvedChildren = selectedChildren(fieldProps as never);\n\n\treturn resolvedChildren;\n}\n\ntype FormSubscribeToFormStateRenderFn<TFieldValues extends FieldValues> = (\n\tprops: UseFormStateReturn<TFieldValues>\n) => React.ReactNode;\n\ntype FormSubscribeToFormStateProps<TFieldValues extends FieldValues> = DiscriminatedRenderProps<\n\tFormSubscribeToFormStateRenderFn<TFieldValues>\n> & {\n\tcontrol?: Control<TFieldValues>;\n\tname?: Array<FieldPath<TFieldValues>> | FieldPath<TFieldValues>;\n};\n\nexport function FormSubscribeToFormState<TFieldValues extends FieldValues = FieldValues>(\n\tprops: FormSubscribeToFormStateProps<TFieldValues>\n) {\n\tconst fieldContextValues = useLaxFormFieldContext();\n\n\tconst { children, control, name = fieldContextValues?.name, render } = props;\n\n\tconst formState = useFormState({ control, name: name as FieldPath<TFieldValues> });\n\n\tconst selectedChildren = typeof children === \"function\" ? children : render;\n\n\tconst resolvedChildren = selectedChildren(formState as never);\n\n\treturn resolvedChildren;\n}\n","export {\n\tFormDescription as Description,\n\tFormErrorMessage as ErrorMessage,\n\tFormErrorMessagePrimitive as ErrorMessagePrimitive,\n\tFormField as Field,\n\tFormFieldContext as FieldContext,\n\tFormFieldController as FieldController,\n\tFormFieldControlledField as ControlledField,\n\tFormInput as Input,\n\tFormInputGroup as InputGroup,\n\tFormInputLeftItem as InputLeftItem,\n\tFormInputPrimitive as InputPrimitive,\n\tFormInputRightItem as InputRightItem,\n\tFormLabel as Label,\n\tFormRoot as Root,\n\tFormSelect as Select,\n\tFormSubmit as Submit,\n\tFormSubscribeToFieldValue as SubscribeToFieldValue,\n\tFormSubscribeToFormState as SubscribeToFormState,\n\tFormTextArea as TextArea,\n\tFormTextAreaPrimitive as TextAreaPrimitive,\n} from \"./form\";\n"]}
@@ -1,6 +1,6 @@
1
1
  import { withSlotNameAndSymbol, getSlotMap } from './chunk-N4274N5K.js';
2
2
  import { useErrorBoundaryContext, ErrorBoundary } from './chunk-JC52CA2O.js';
3
- import { slot_parts_exports } from './chunk-Y5VBSXZS.js';
3
+ import { slot_parts_exports } from './chunk-D6QZA3UT.js';
4
4
  import { __export } from './chunk-PZ5AY32C.js';
5
5
  import * as React from 'react';
6
6
  import { Fragment, Suspense, use, useMemo } from 'react';
@@ -64,5 +64,5 @@ __export(await_parts_exports, {
64
64
  });
65
65
 
66
66
  export { AwaitError, AwaitPending, AwaitRoot, AwaitSuccess, await_parts_exports, useAwaitContext };
67
- //# sourceMappingURL=chunk-Z6JJE4G6.js.map
68
- //# sourceMappingURL=chunk-Z6JJE4G6.js.map
67
+ //# sourceMappingURL=chunk-YSDKXBU7.js.map
68
+ //# sourceMappingURL=chunk-YSDKXBU7.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/common/await/await-context.ts","../../src/components/common/await/await.tsx","../../src/components/common/await/await-parts.ts"],"names":["ReactFragment"],"mappings":";;;;;;;;;AAOO,IAAM,CAAC,oBAAA,EAAsB,mBAAmB,CAAA,GAAI,mBAAsC,CAAA;AAAA,EAChG,QAAU,EAAA,iBAAA;AAAA,EACV,IAAM,EAAA,cAAA;AAAA,EACN,YAAc,EAAA;AACf,CAAC,CAAA;AAEY,IAAA,eAAA,GAAkB,MAAc,mBAAoB;;;ACU1D,SAAS,UAAkB,KAA+B,EAAA;AAChE,EAAM,MAAA,EAAE,UAAU,aAAe,EAAA,QAAA,EAAU,iBAAiB,KAAO,EAAA,GAAG,aAAgB,GAAA,KAAA;AAEtF,EAAM,MAAA,iBAAA,GAAoB,cAAmB,KAAA,KAAA,IAAS,cAAmB,KAAA,oBAAA;AACzE,EAAM,MAAA,YAAA,GAAe,cAAmB,KAAA,KAAA,IAAS,cAAmB,KAAA,eAAA;AAEpE,EAAM,MAAA,iBAAA,GAAoB,oBAAoB,aAAgB,GAAAA,QAAA;AAC9D,EAAM,MAAA,YAAA,GAAe,eAAe,QAAW,GAAAA,QAAA;AAE/C,EAAM,MAAA,KAAA,GAAQ,CAAC,UAAA,CAAW,QAAQ,CAAA,GAC/B,WAA+B,QAAQ,CAAA,GACtC,EAAE,OAAA,EAAS,QAAS,EAAA;AAExB,EAAM,MAAA,u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O,EAAA,GAAI,eAAwB,EAAA;AAE3C,IAAO,OAAA,KAAA,CAAM,SAAS,MAAM,CAAA;AAAA;AAG7B,EAAA,OAAO,KAAM,CAAA,QAAA;AACd;AAEA,MAAA,CAAO,MAAO,CAAA,YAAA,EAAc,qBAAyC,CAAA,SAAS,CAAC,CAAA;AAIlE,IAAA,YAAA,GAAe,sBAAyC,SAAS;AAIvE,IAAM,UAAa,GAAA,qBAAA;AAAA,EACzB,OAAA;AAAA,EACA,CAAC,KAAU,KAAA;AACV,IAAM,MAAA,EAAE,OAAS,EAAA,QAAA,EAAa,GAAA,KAAA;AAE9B,IAAA,MAAM,uBAAuB,uBAAwB,EAAA;AAErD,IAAM,MAAA,SAAA,GAAY,OAAU,GAAA,kBAAA,CAAK,IAAO,GAAAA,QAAA;AAExC,IAAA,MAAM,mBAAmB,UAAW,CAAA,QAAQ,CAAI,GAAA,QAAA,CAAS,oBAAoB,CAAI,GAAA,QAAA;AAEjF,IAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,SAAA,EAAA,EAAW,GAAI,OAAA,IAAW,wBAAwB,gBAAiB,CAAA;AAAA;AAE7E;;;AC1GA,IAAA,mBAAA,GAAA;AAAA,QAAA,CAAA,mBAAA,EAAA;AAAA,EAAA,KAAA,EAAA,MAAA,UAAA;AAAA,EAAA,OAAA,EAAA,MAAA,YAAA;AAAA,EAAA,IAAA,EAAA,MAAA,SAAA;AAAA,EAAA,OAAA,EAAA,MAAA;AAAA,CAAA,CAAA","file":"chunk-Z6JJE4G6.js","sourcesContent":["import { createCustomContext } from \"@zayne-labs/toolkit-react\";\n\nexport type AwaitContextType<TValue = unknown> = {\n\tpromise: Promise<TValue>;\n\tresult: TValue;\n};\n\nexport const [AwaitContextProvider, useAwaitContextImpl] = createCustomContext<AwaitContextType>({\n\thookName: \"useAwaitContext\",\n\tname: \"AwaitContext\",\n\tproviderName: \"AwaitInner\",\n});\n\nexport const useAwaitContext = <TValue>() => useAwaitContextImpl() as AwaitContextType<TValue>;\n","\"use client\";\n\nimport * as React from \"react\";\n\nimport { type GetSlotComponentProps, getSlotMap, withSlotNameAndSymbol } from \"@/lib/utils\";\nimport { isFunction } from \"@zayne-labs/toolkit-type-helpers\";\nimport { Fragment as ReactFragment, Suspense, use, useMemo } from \"react\";\nimport { ErrorBoundary, type ErrorBoundaryProps, useErrorBoundaryContext } from \"../error-boundary\";\nimport { Slot } from \"../slot\";\nimport type { SuspenseWithBoundaryProps } from \"../suspense-with-boundary\";\nimport { AwaitContextProvider, useAwaitContext } from \"./await-context\";\n\ntype RenderPropFn<TValue> = (result: TValue) => React.ReactNode;\n\ntype ChildrenType<TValue> = React.ReactNode | RenderPropFn<TValue>;\n\ntype AwaitRootProps<TValue> = Pick<SuspenseWithBoundaryProps, \"errorFallback\" | \"fallback\"> & {\n\tasChild?: boolean;\n\tchildren: ChildrenType<TValue>;\n\tpromise: Promise<TValue>;\n\twrapperVariant?: \"all\" | \"none\" | \"only-errorBoundary\" | \"only-suspense\";\n};\n\nexport function AwaitRoot<TValue>(props: AwaitRootProps<TValue>) {\n\tconst { children, errorFallback, fallback, wrapperVariant = \"all\", ...restOfProps } = props;\n\n\tconst withErrorBoundary = wrapperVariant === \"all\" || wrapperVariant === \"only-errorBoundary\";\n\tconst withSuspense = wrapperVariant === \"all\" || wrapperVariant === \"only-suspense\";\n\n\tconst WithErrorBoundary = withErrorBoundary ? ErrorBoundary : ReactFragment;\n\tconst WithSuspense = withSuspense ? Suspense : ReactFragment;\n\n\tconst slots = !isFunction(children)\n\t\t? getSlotMap<SlotComponentProps>(children)\n\t\t: ({ default: children } as unknown as ReturnType<typeof getSlotMap<SlotComponentProps>>);\n\n\tconst selectedPendingFallback = slots.pending ?? fallback;\n\tconst selectedErrorFallback = slots.error ?? errorFallback;\n\n\treturn (\n\t\t<WithErrorBoundary {...(Boolean(selectedErrorFallback) && { fallback: selectedErrorFallback })}>\n\t\t\t<WithSuspense {...(Boolean(selectedPendingFallback) && { fallback: selectedPendingFallback })}>\n\t\t\t\t<AwaitRootInner {...restOfProps}>{slots.default}</AwaitRootInner>\n\t\t\t</WithSuspense>\n\t\t</WithErrorBoundary>\n\t);\n}\n\ntype AwaitRootInnerProps<TValue> = Pick<AwaitRootProps<TValue>, \"asChild\" | \"children\" | \"promise\">;\n\nfunction AwaitRootInner<TValue>(props: AwaitRootInnerProps<TValue>) {\n\tconst { asChild, children, promise } = props;\n\n\tconst result = use(promise);\n\n\tconst resolvedChildren = isFunction(children) ? children(result) : children;\n\n\tconst Component = asChild ? Slot.Root : ReactFragment;\n\n\tconst contextValue = useMemo(() => ({ promise, result }), [promise, result]);\n\n\treturn (\n\t\t<AwaitContextProvider value={contextValue}>\n\t\t\t<Component {...(asChild && contextValue)}>{resolvedChildren}</Component>\n\t\t</AwaitContextProvider>\n\t);\n}\n\ntype SlotComponentProps = AwaitErrorProps | AwaitPendingProps | AwaitSuccessProps;\n\ntype AwaitSuccessProps<TValue = unknown> = GetSlotComponentProps<\"default\", ChildrenType<TValue>>;\n\nexport function AwaitSuccess<TPromiseOrValue, TValue = Awaited<TPromiseOrValue>>(\n\tprops: Pick<AwaitSuccessProps<TValue>, \"children\">\n) {\n\tif (isFunction(props.children)) {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks -- This hook only uses `use` under the hood so this is safe\n\t\tconst { result } = useAwaitContext<TValue>();\n\n\t\treturn props.children(result);\n\t}\n\n\treturn props.children;\n}\n\nObject.assign(AwaitSuccess, withSlotNameAndSymbol<AwaitSuccessProps>(\"default\"));\n\ntype AwaitPendingProps = GetSlotComponentProps<\"pending\", React.SuspenseProps[\"fallback\"]>;\n\nexport const AwaitPending = withSlotNameAndSymbol<AwaitPendingProps>(\"pending\");\n\ntype AwaitErrorProps = GetSlotComponentProps<\"error\", ErrorBoundaryProps[\"fallback\"]>;\n\nexport const AwaitError = withSlotNameAndSymbol<AwaitErrorProps, { asChild?: boolean }>(\n\t\"error\",\n\t(props) => {\n\t\tconst { asChild, children } = props;\n\n\t\tconst errorBoundaryContext = useErrorBoundaryContext();\n\n\t\tconst Component = asChild ? Slot.Root : ReactFragment;\n\n\t\tconst resolvedChildren = isFunction(children) ? children(errorBoundaryContext) : children;\n\n\t\treturn <Component {...(asChild && errorBoundaryContext)}>{resolvedChildren}</Component>;\n\t}\n);\n","export {\n\tAwaitRoot as Root,\n\tAwaitError as Error,\n\tAwaitPending as Pending,\n\tAwaitSuccess as Success,\n} from \"./await\";\n"]}
1
+ {"version":3,"sources":["../../src/components/common/await/await-context.ts","../../src/components/common/await/await.tsx","../../src/components/common/await/await-parts.ts"],"names":["ReactFragment"],"mappings":";;;;;;;;;AAOO,IAAM,CAAC,oBAAA,EAAsB,mBAAmB,CAAA,GAAI,mBAAsC,CAAA;AAAA,EAChG,QAAU,EAAA,iBAAA;AAAA,EACV,IAAM,EAAA,cAAA;AAAA,EACN,YAAc,EAAA;AACf,CAAC,CAAA;AAEY,IAAA,eAAA,GAAkB,MAAc,mBAAoB;;;ACU1D,SAAS,UAAkB,KAA+B,EAAA;AAChE,EAAM,MAAA,EAAE,UAAU,aAAe,EAAA,QAAA,EAAU,iBAAiB,KAAO,EAAA,GAAG,aAAgB,GAAA,KAAA;AAEtF,EAAM,MAAA,iBAAA,GAAoB,cAAmB,KAAA,KAAA,IAAS,cAAmB,KAAA,oBAAA;AACzE,EAAM,MAAA,YAAA,GAAe,cAAmB,KAAA,KAAA,IAAS,cAAmB,KAAA,eAAA;AAEpE,EAAM,MAAA,iBAAA,GAAoB,oBAAoB,aAAgB,GAAAA,QAAA;AAC9D,EAAM,MAAA,YAAA,GAAe,eAAe,QAAW,GAAAA,QAAA;AAE/C,EAAM,MAAA,KAAA,GAAQ,CAAC,UAAA,CAAW,QAAQ,CAAA,GAC/B,WAA+B,QAAQ,CAAA,GACtC,EAAE,OAAA,EAAS,QAAS,EAAA;AAExB,EAAM,MAAA,uBAAA,GAA0B,MAAM,OAAW,IAAA,QAAA;AACjD,EAAM,MAAA,qBAAA,GAAwB,MAAM,K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AAAA;AAG7B,EAAA,OAAO,KAAM,CAAA,QAAA;AACd;AAEA,MAAA,CAAO,MAAO,CAAA,YAAA,EAAc,qBAAyC,CAAA,SAAS,CAAC,CAAA;AAIlE,IAAA,YAAA,GAAe,sBAAyC,SAAS;AAIvE,IAAM,UAAa,GAAA,qBAAA;AAAA,EACzB,OAAA;AAAA,EACA,CAAC,KAAU,KAAA;AACV,IAAM,MAAA,EAAE,OAAS,EAAA,QAAA,EAAa,GAAA,KAAA;AAE9B,IAAA,MAAM,uBAAuB,uBAAwB,EAAA;AAErD,IAAM,MAAA,SAAA,GAAY,OAAU,GAAA,kBAAA,CAAK,IAAO,GAAAA,QAAA;AAExC,IAAA,MAAM,mBAAmB,UAAW,CAAA,QAAQ,CAAI,GAAA,QAAA,CAAS,oBAAoB,CAAI,GAAA,QAAA;AAEjF,IAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,SAAA,EAAA,EAAW,GAAI,OAAA,IAAW,wBAAwB,gBAAiB,CAAA;AAAA;AAE7E;;;AC1GA,IAAA,mBAAA,GAAA;AAAA,QAAA,CAAA,mBAAA,EAAA;AAAA,EAAA,KAAA,EAAA,MAAA,UAAA;AAAA,EAAA,OAAA,EAAA,MAAA,YAAA;AAAA,EAAA,IAAA,EAAA,MAAA,SAAA;AAAA,EAAA,OAAA,EAAA,MAAA;AAAA,CAAA,CAAA","file":"chunk-YSDKXBU7.js","sourcesContent":["import { createCustomContext } from \"@zayne-labs/toolkit-react\";\n\nexport type AwaitContextType<TValue = unknown> = {\n\tpromise: Promise<TValue>;\n\tresult: TValue;\n};\n\nexport const [AwaitContextProvider, useAwaitContextImpl] = createCustomContext<AwaitContextType>({\n\thookName: \"useAwaitContext\",\n\tname: \"AwaitContext\",\n\tproviderName: \"AwaitInner\",\n});\n\nexport const useAwaitContext = <TValue>() => useAwaitContextImpl() as AwaitContextType<TValue>;\n","\"use client\";\n\nimport * as React from \"react\";\n\nimport { type GetSlotComponentProps, getSlotMap, withSlotNameAndSymbol } from \"@/lib/utils\";\nimport { isFunction } from \"@zayne-labs/toolkit-type-helpers\";\nimport { Fragment as ReactFragment, Suspense, use, useMemo } from \"react\";\nimport { ErrorBoundary, type ErrorBoundaryProps, useErrorBoundaryContext } from \"../error-boundary\";\nimport { Slot } from \"../slot\";\nimport type { SuspenseWithBoundaryProps } from \"../suspense-with-boundary\";\nimport { AwaitContextProvider, useAwaitContext } from \"./await-context\";\n\ntype RenderPropFn<TValue> = (result: TValue) => React.ReactNode;\n\ntype ChildrenType<TValue> = React.ReactNode | RenderPropFn<TValue>;\n\ntype AwaitRootProps<TValue> = Pick<SuspenseWithBoundaryProps, \"errorFallback\" | \"fallback\"> & {\n\tasChild?: boolean;\n\tchildren: ChildrenType<TValue>;\n\tpromise: Promise<TValue>;\n\twrapperVariant?: \"all\" | \"none\" | \"only-errorBoundary\" | \"only-suspense\";\n};\n\nexport function AwaitRoot<TValue>(props: AwaitRootProps<TValue>) {\n\tconst { children, errorFallback, fallback, wrapperVariant = \"all\", ...restOfProps } = props;\n\n\tconst withErrorBoundary = wrapperVariant === \"all\" || wrapperVariant === \"only-errorBoundary\";\n\tconst withSuspense = wrapperVariant === \"all\" || wrapperVariant === \"only-suspense\";\n\n\tconst WithErrorBoundary = withErrorBoundary ? ErrorBoundary : ReactFragment;\n\tconst WithSuspense = withSuspense ? Suspense : ReactFragment;\n\n\tconst slots = !isFunction(children)\n\t\t? getSlotMap<SlotComponentProps>(children)\n\t\t: ({ default: children } as unknown as ReturnType<typeof getSlotMap<SlotComponentProps>>);\n\n\tconst selectedPendingFallback = slots.pending ?? fallback;\n\tconst selectedErrorFallback = slots.error ?? errorFallback;\n\n\treturn (\n\t\t<WithErrorBoundary {...(Boolean(selectedErrorFallback) && { fallback: selectedErrorFallback })}>\n\t\t\t<WithSuspense {...(Boolean(selectedPendingFallback) && { fallback: selectedPendingFallback })}>\n\t\t\t\t<AwaitRootInner {...restOfProps}>{slots.default}</AwaitRootInner>\n\t\t\t</WithSuspense>\n\t\t</WithErrorBoundary>\n\t);\n}\n\ntype AwaitRootInnerProps<TValue> = Pick<AwaitRootProps<TValue>, \"asChild\" | \"children\" | \"promise\">;\n\nfunction AwaitRootInner<TValue>(props: AwaitRootInnerProps<TValue>) {\n\tconst { asChild, children, promise } = props;\n\n\tconst result = use(promise);\n\n\tconst resolvedChildren = isFunction(children) ? children(result) : children;\n\n\tconst Component = asChild ? Slot.Root : ReactFragment;\n\n\tconst contextValue = useMemo(() => ({ promise, result }), [promise, result]);\n\n\treturn (\n\t\t<AwaitContextProvider value={contextValue}>\n\t\t\t<Component {...(asChild && contextValue)}>{resolvedChildren}</Component>\n\t\t</AwaitContextProvider>\n\t);\n}\n\ntype SlotComponentProps = AwaitErrorProps | AwaitPendingProps | AwaitSuccessProps;\n\ntype AwaitSuccessProps<TValue = unknown> = GetSlotComponentProps<\"default\", ChildrenType<TValue>>;\n\nexport function AwaitSuccess<TPromiseOrValue, TValue = Awaited<TPromiseOrValue>>(\n\tprops: Pick<AwaitSuccessProps<TValue>, \"children\">\n) {\n\tif (isFunction(props.children)) {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks -- This hook only uses `use` under the hood so this is safe\n\t\tconst { result } = useAwaitContext<TValue>();\n\n\t\treturn props.children(result);\n\t}\n\n\treturn props.children;\n}\n\nObject.assign(AwaitSuccess, withSlotNameAndSymbol<AwaitSuccessProps>(\"default\"));\n\ntype AwaitPendingProps = GetSlotComponentProps<\"pending\", React.SuspenseProps[\"fallback\"]>;\n\nexport const AwaitPending = withSlotNameAndSymbol<AwaitPendingProps>(\"pending\");\n\ntype AwaitErrorProps = GetSlotComponentProps<\"error\", ErrorBoundaryProps[\"fallback\"]>;\n\nexport const AwaitError = withSlotNameAndSymbol<AwaitErrorProps, { asChild?: boolean }>(\n\t\"error\",\n\t(props) => {\n\t\tconst { asChild, children } = props;\n\n\t\tconst errorBoundaryContext = useErrorBoundaryContext();\n\n\t\tconst Component = asChild ? Slot.Root : ReactFragment;\n\n\t\tconst resolvedChildren = isFunction(children) ? children(errorBoundaryContext) : children;\n\n\t\treturn <Component {...(asChild && errorBoundaryContext)}>{resolvedChildren}</Component>;\n\t}\n);\n","export {\n\tAwaitRoot as Root,\n\tAwaitError as Error,\n\tAwaitPending as Pending,\n\tAwaitSuccess as Success,\n} from \"./await\";\n"]}
@@ -1,8 +1,8 @@
1
- export { await_parts_exports as Await, AwaitError, AwaitPending, AwaitRoot, AwaitSuccess, useAwaitContext } from '../../../chunk-Z6JJE4G6.js';
1
+ export { await_parts_exports as Await, AwaitError, AwaitPending, AwaitRoot, AwaitSuccess, useAwaitContext } from '../../../chunk-YSDKXBU7.js';
2
2
  import '../../../chunk-N4274N5K.js';
3
3
  import '../../../chunk-JC52CA2O.js';
4
4
  import '../../../chunk-YO5LJ7ZJ.js';
5
- import '../../../chunk-Y5VBSXZS.js';
5
+ import '../../../chunk-D6QZA3UT.js';
6
6
  import '../../../chunk-PZ5AY32C.js';
7
7
  //# sourceMappingURL=index.js.map
8
8
  //# sourceMappingURL=index.js.map
@@ -2,13 +2,13 @@ import '../../chunk-CWUEUCR5.js';
2
2
  export { SuspenseWithBoundary } from '../../chunk-MT2MQDK2.js';
3
3
  export { switch_parts_exports as Switch } from '../../chunk-EYWTW54R.js';
4
4
  export { Teleport } from '../../chunk-G5BNZM66.js';
5
- export { await_parts_exports as Await } from '../../chunk-Z6JJE4G6.js';
5
+ export { await_parts_exports as Await } from '../../chunk-YSDKXBU7.js';
6
6
  import '../../chunk-N4274N5K.js';
7
7
  export { ErrorBoundary } from '../../chunk-JC52CA2O.js';
8
8
  export { For, ForWithWrapper } from '../../chunk-NXZZXJRH.js';
9
9
  export { show_parts_exports as Show } from '../../chunk-M7YXNGT6.js';
10
10
  import '../../chunk-YO5LJ7ZJ.js';
11
- export { slot_parts_exports as Slot } from '../../chunk-Y5VBSXZS.js';
11
+ export { slot_parts_exports as Slot } from '../../chunk-D6QZA3UT.js';
12
12
  import '../../chunk-PZ5AY32C.js';
13
13
  //# sourceMappingURL=index.js.map
14
14
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- export { slot_parts_exports as Slot, SlotRoot, SlotSlottable } from '../../../chunk-Y5VBSXZS.js';
1
+ export { slot_parts_exports as Slot, SlotRoot, SlotSlottable } from '../../../chunk-D6QZA3UT.js';
2
2
  import '../../../chunk-PZ5AY32C.js';
3
3
  //# sourceMappingURL=index.js.map
4
4
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
- export { card_parts_exports as Card, CardContent, CardDescription, CardFooter, CardHeader, CardRoot, CardTitle } from '../../../chunk-KLEJZWKY.js';
1
+ export { card_parts_exports as Card, CardContent, CardDescription, CardFooter, CardHeader, CardRoot, CardTitle } from '../../../chunk-6QJYHPBL.js';
2
2
  import '../../../chunk-OHG7GB7O.js';
3
- import '../../../chunk-Y5VBSXZS.js';
3
+ import '../../../chunk-D6QZA3UT.js';
4
4
  import '../../../chunk-PZ5AY32C.js';
5
5
  //# sourceMappingURL=index.js.map
6
6
  //# sourceMappingURL=index.js.map
@@ -4,13 +4,13 @@ import '../../../chunk-CWUEUCR5.js';
4
4
  import '../../../chunk-MT2MQDK2.js';
5
5
  import '../../../chunk-EYWTW54R.js';
6
6
  import '../../../chunk-G5BNZM66.js';
7
- import '../../../chunk-Z6JJE4G6.js';
7
+ import '../../../chunk-YSDKXBU7.js';
8
8
  import '../../../chunk-N4274N5K.js';
9
9
  import '../../../chunk-JC52CA2O.js';
10
10
  import '../../../chunk-NXZZXJRH.js';
11
11
  import '../../../chunk-M7YXNGT6.js';
12
12
  import '../../../chunk-YO5LJ7ZJ.js';
13
- import '../../../chunk-Y5VBSXZS.js';
13
+ import '../../../chunk-D6QZA3UT.js';
14
14
  import '../../../chunk-PZ5AY32C.js';
15
15
  //# sourceMappingURL=index.js.map
16
16
  //# sourceMappingURL=index.js.map
@@ -1,16 +1,16 @@
1
- export { drop_zone_parts_exports as DropZone, DropZoneContainer, DropZoneContext, DropZoneImagePreview, DropZoneInput, DropZoneRoot, useDropZone, useDropZoneContext } from '../../../chunk-2DHK7TOF.js';
1
+ export { drop_zone_parts_exports as DropZone, DropZoneContainer, DropZoneContext, DropZoneImagePreview, DropZoneInput, DropZoneRoot, useDropZone, useDropZoneContext } from '../../../chunk-MRYXZN2P.js';
2
2
  import '../../../chunk-OHG7GB7O.js';
3
3
  import '../../../chunk-CWUEUCR5.js';
4
4
  import '../../../chunk-MT2MQDK2.js';
5
5
  import '../../../chunk-EYWTW54R.js';
6
6
  import '../../../chunk-G5BNZM66.js';
7
- import '../../../chunk-Z6JJE4G6.js';
7
+ import '../../../chunk-YSDKXBU7.js';
8
8
  import '../../../chunk-N4274N5K.js';
9
9
  import '../../../chunk-JC52CA2O.js';
10
10
  import '../../../chunk-NXZZXJRH.js';
11
11
  import '../../../chunk-M7YXNGT6.js';
12
12
  import '../../../chunk-YO5LJ7ZJ.js';
13
- import '../../../chunk-Y5VBSXZS.js';
13
+ import '../../../chunk-D6QZA3UT.js';
14
14
  import '../../../chunk-PZ5AY32C.js';
15
15
  //# sourceMappingURL=index.js.map
16
16
  //# sourceMappingURL=index.js.map
@@ -1,8 +1,8 @@
1
- export { form_parts_exports as Form, FormDescription, FormErrorMessage, FormErrorMessagePrimitive, FormField, FormFieldContext, FormFieldControlledField, FormFieldController, FormInput, FormInputGroup, FormInputLeftItem, FormInputPrimitive, FormInputRightItem, FormLabel, FormRoot, FormSelect, FormSelectPrimitive, FormSubmit, FormSubscribeToFieldValue, FormSubscribeToFormState, FormTextArea, FormTextAreaPrimitive, useStrictFormFieldContext as useFormFieldContext, useFormContext as useFormRootContext } from '../../../chunk-3KZXPREF.js';
1
+ export { form_parts_exports as Form, FormDescription, FormErrorMessage, FormErrorMessagePrimitive, FormField, FormFieldContext, FormFieldControlledField, FormFieldController, FormInput, FormInputGroup, FormInputLeftItem, FormInputPrimitive, FormInputRightItem, FormLabel, FormRoot, FormSelect, FormSelectPrimitive, FormSubmit, FormSubscribeToFieldValue, FormSubscribeToFormState, FormTextArea, FormTextAreaPrimitive, useStrictFormFieldContext as useFormFieldContext, useFormContext as useFormRootContext } from '../../../chunk-P5QP73HG.js';
2
2
  import '../../../chunk-OHG7GB7O.js';
3
3
  import '../../../chunk-NXZZXJRH.js';
4
4
  import '../../../chunk-YO5LJ7ZJ.js';
5
- import '../../../chunk-Y5VBSXZS.js';
5
+ import '../../../chunk-D6QZA3UT.js';
6
6
  import '../../../chunk-PZ5AY32C.js';
7
7
  //# sourceMappingURL=index.js.map
8
8
  //# sourceMappingURL=index.js.map
@@ -1,20 +1,20 @@
1
- export { card_parts_exports as Card } from '../../chunk-KLEJZWKY.js';
1
+ export { card_parts_exports as Card } from '../../chunk-6QJYHPBL.js';
2
2
  export { carousel_parts_exports as Carousel } from '../../chunk-BJ7WR4XW.js';
3
3
  export { useDragScroll } from '../../chunk-V5ZPMMIH.js';
4
- export { drop_zone_parts_exports as DropZone, useDropZone } from '../../chunk-2DHK7TOF.js';
5
- export { form_parts_exports as Form } from '../../chunk-3KZXPREF.js';
4
+ export { drop_zone_parts_exports as DropZone, useDropZone } from '../../chunk-MRYXZN2P.js';
5
+ export { form_parts_exports as Form } from '../../chunk-P5QP73HG.js';
6
6
  import '../../chunk-OHG7GB7O.js';
7
7
  import '../../chunk-CWUEUCR5.js';
8
8
  import '../../chunk-MT2MQDK2.js';
9
9
  import '../../chunk-EYWTW54R.js';
10
10
  import '../../chunk-G5BNZM66.js';
11
- import '../../chunk-Z6JJE4G6.js';
11
+ import '../../chunk-YSDKXBU7.js';
12
12
  import '../../chunk-N4274N5K.js';
13
13
  import '../../chunk-JC52CA2O.js';
14
14
  import '../../chunk-NXZZXJRH.js';
15
15
  import '../../chunk-M7YXNGT6.js';
16
16
  import '../../chunk-YO5LJ7ZJ.js';
17
- import '../../chunk-Y5VBSXZS.js';
17
+ import '../../chunk-D6QZA3UT.js';
18
18
  import '../../chunk-PZ5AY32C.js';
19
19
  //# sourceMappingURL=index.js.map
20
20
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zayne-labs/ui-react",
3
3
  "type": "module",
4
- "version": "0.9.15",
4
+ "version": "0.9.16",
5
5
  "description": "A composable UI/UI-utilities components library. ",
6
6
  "author": "Ryan Zayne",
7
7
  "license": "MIT",
@@ -64,7 +64,7 @@
64
64
  "@total-typescript/ts-reset": "0.6.1",
65
65
  "@types/react": "19.1.5",
66
66
  "@types/react-dom": "19.1.5",
67
- "@zayne-labs/tsconfig": "0.8.2",
67
+ "@zayne-labs/tsconfig": "0.9.1",
68
68
  "concurrently": "9.1.2",
69
69
  "cross-env": "7.0.3",
70
70
  "publint": "0.3.12",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/components/common/slot/slot.tsx","../../src/components/common/slot/slot-parts.ts"],"names":["ReactFragment"],"mappings":";;;;;;AAYO,SAAS,aAAA,CAAc,EAAE,QAAA,EAAyC,EAAA;AACxE,EAAO,OAAA,QAAA;AACR;AAEA,IAAM,WAAA,GAAc,CAAC,KAAwD,KAAA;AAC5E,EAAA,OAAO,cAAe,CAAA,KAAK,CAAK,IAAA,KAAA,CAAM,IAAS,KAAA,aAAA;AAChD,CAAA;AAMO,SAAS,SAAS,KAAkB,EAAA;AAC1C,EAAA,MAAM,EAAE,QAAA,EAAU,GAAG,eAAA,EAAoB,GAAA,KAAA;AAEzC,EAAA,MAAM,gBAAgB,OAAyB,CAAA,QAAQ,CAAI,GAAA,QAAA,GAAW,CAAC,QAAQ,CAAA;AAC/E,EAAA,MAAM,YAAY,aAAc,CAAA,IAAA,CAAK,CAAC,OAAY,KAAA,WAAA,CAAY,OAAO,CAAC,CAAA;AAEtE,EAAA,IAAI,SAAW,EAAA;AAEd,IAAM,MAAA,UAAA,GAAc,UAAU,KAAoB,CAAA,QAAA;AAElD,IAAA,IAAI,QAAS,CAAA,KAAA,CAAM,UAAU,CAAA,GAAI,CAAG,EAAA;AACnC,MAAO,OAAA,QAAA,CAAS,KAAK,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AAW,CAAA;AAC1C;;;AClFA,IAAA,kBAAA,GAAA;AAAA,QAAA,CAAA,kBAAA,EAAA;AAAA,EAAA,IAAA,EAAA,MAAA,QAAA;AAAA,EAAA,SAAA,EAAA,MAAA;AAAA,CAAA,CAAA","file":"chunk-Y5VBSXZS.js","sourcesContent":["import * as React from \"react\";\n\nimport { type InferProps, composeRefs, mergeProps } from \"@zayne-labs/toolkit-react/utils\";\nimport { isArray } from \"@zayne-labs/toolkit-type-helpers\";\nimport { Children, Fragment as ReactFragment, cloneElement, isValidElement } from \"react\";\n\ntype SlotProps = InferProps<HTMLElement>;\n\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * ----------------------------------------------------------------------------------------------- */\n\nexport function SlotSlottable({ children }: Pick<SlotProps, \"children\">) {\n\treturn children;\n}\n\nconst isSlottable = (child: React.ReactNode): child is React.ReactElement => {\n\treturn isValidElement(child) && child.type === SlotSlottable;\n};\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * ----------------------------------------------------------------------------------------------- */\n\nexport function SlotRoot(props: SlotProps) {\n\tconst { children, ...restOfSlotProps } = props;\n\n\tconst childrenArray = isArray<React.ReactNode>(children) ? children : [children];\n\tconst slottable = childrenArray.find((element) => isSlottable(element));\n\n\tif (slottable) {\n\t\t// == The new element to render is the one passed as a child of `Slottable`\n\t\tconst newElement = (slottable.props as SlotProps).children;\n\n\t\tif (Children.count(newElement) > 1) {\n\t\t\treturn Children.only(null);\n\t\t}\n\n\t\tconst newElementChildren = childrenArray.map((child) => {\n\t\t\tif (child === slottable) {\n\t\t\t\t// == Because the new element will be the one rendered, we are only interested in grabbing its children (`newElement.props.children`)\n\t\t\t\treturn isValidElement<SlotProps>(newElement) && newElement.props.children;\n\t\t\t}\n\n\t\t\treturn child;\n\t\t});\n\n\t\treturn (\n\t\t\t<SlotClone {...restOfSlotProps}>\n\t\t\t\t{isValidElement(newElement) && cloneElement(newElement, undefined, newElementChildren)}\n\t\t\t</SlotClone>\n\t\t);\n\t}\n\n\treturn <SlotClone {...restOfSlotProps}>{children}</SlotClone>;\n}\n\ntype SlotCloneProps = {\n\tchildren: React.ReactNode;\n\tref?: React.RefObject<HTMLElement>;\n};\n\ntype UnknownProps = Record<string, unknown>;\n\nfunction SlotClone(props: SlotCloneProps) {\n\tconst { children, ref: forwardedRef, ...restOfSlotProps } = props;\n\n\tif (!isValidElement<UnknownProps>(children)) {\n\t\treturn Children.count(children) > 1 ? Children.only(null) : null;\n\t}\n\n\tconst childRef = (children.props.ref\n\t\t?? (children as unknown as UnknownProps).ref) as React.Ref<HTMLElement>;\n\n\tconst mergedRef = forwardedRef ? composeRefs(forwardedRef, childRef) : childRef;\n\n\tconst clonedProps = {\n\t\t...mergeProps(restOfSlotProps, children.props),\n\t\t...(children.type !== ReactFragment && { ref: mergedRef }),\n\t};\n\n\treturn cloneElement(children, clonedProps);\n}\n","export { SlotRoot as Root, SlotSlottable as Slottable } from \"./slot\";\n"]}