@zayne-labs/ui-react 0.11.10 → 0.11.12

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.
Files changed (36) hide show
  1. package/dist/components/cn-jNZfGhrk.js.map +1 -1
  2. package/dist/components/common/await/index.d.ts +4 -6
  3. package/dist/components/common/await/index.js.map +1 -1
  4. package/dist/components/common/client-gate/index.d.ts +1 -3
  5. package/dist/components/common/client-gate/index.js.map +1 -1
  6. package/dist/components/common/error-boundary/index.d.ts +2 -2
  7. package/dist/components/common/for/index.d.ts +2 -4
  8. package/dist/components/common/presence/index.d.ts +1 -2
  9. package/dist/components/common/show/index.d.ts +3 -5
  10. package/dist/components/common/slot/index.d.ts +2 -4
  11. package/dist/components/common/suspense-with-boundary/index.d.ts +1 -1
  12. package/dist/components/common/suspense-with-boundary/index.js.map +1 -1
  13. package/dist/components/common/switch/index.d.ts +3 -5
  14. package/dist/components/common/teleport/index.d.ts +1 -2
  15. package/dist/components/common/teleport/index.js.map +1 -1
  16. package/dist/components/error-boundary-BOZ3EvMt.js.map +1 -1
  17. package/dist/components/for-DGTMIS0w.js.map +1 -1
  18. package/dist/components/{index-DgA9ry9R.d.ts → index-CUmHEGwU.d.ts} +3 -6
  19. package/dist/components/{index-BXWyFo6R.d.ts → index-Dvg4OLWa.d.ts} +3 -4
  20. package/dist/components/presence-DDuEcp1q.js.map +1 -1
  21. package/dist/components/show-CMxdpPiN.js.map +1 -1
  22. package/dist/components/slot-B2aEs2RU.js.map +1 -1
  23. package/dist/components/switch-Dwy5Gzsb.js.map +1 -1
  24. package/dist/components/ui/card/index.d.ts +7 -8
  25. package/dist/components/ui/card/index.js.map +1 -1
  26. package/dist/components/ui/carousel/index.d.ts +9 -10
  27. package/dist/components/ui/carousel/index.js.map +1 -1
  28. package/dist/components/ui/drag-scroll/index.d.ts +10 -80
  29. package/dist/components/ui/drag-scroll/index.js.map +1 -1
  30. package/dist/components/ui/drop-zone/index.d.ts +16 -86
  31. package/dist/components/ui/drop-zone/index.js.map +1 -1
  32. package/dist/components/ui/form/index.d.ts +21 -23
  33. package/dist/components/ui/form/index.js +11 -5
  34. package/dist/components/ui/form/index.js.map +1 -1
  35. package/dist/style.css +1 -4
  36. package/package.json +19 -19
@@ -1,7 +1,5 @@
1
1
  import { DiscriminatedRenderItemProps, DiscriminatedRenderProps, InferProps, PolymorphicPropsStrict } from "@zayne-labs/toolkit-react/utils";
2
2
  import { UnionDiscriminator } from "@zayne-labs/toolkit-type-helpers";
3
- import * as _$react from "react";
4
- import * as _$react_jsx_runtime0 from "react/jsx-runtime";
5
3
  import { Control, ControllerProps, FieldPath, FieldValues, FormStateSubscribeProps as FormStateSubscribeProps$1, RegisterOptions, UseFormReturn, UseFormStateReturn, WatchProps, useFormContext as useFormRootContext } from "react-hook-form";
6
4
 
7
5
  //#region src/components/ui/form/form-context.d.ts
@@ -34,7 +32,7 @@ type FormRootProps<TFieldValues extends FieldValues, TTransformedValues> = Infer
34
32
  children: React.ReactNode;
35
33
  form: UseFormReturn<TFieldValues, unknown, TTransformedValues>;
36
34
  };
37
- declare function FormRoot<TFieldValues extends FieldValues, TTransformedValues = TFieldValues>(props: FormRootProps<TFieldValues, TTransformedValues>): _$react_jsx_runtime0.JSX.Element;
35
+ declare function FormRoot<TFieldValues extends FieldValues, TTransformedValues = TFieldValues>(props: FormRootProps<TFieldValues, TTransformedValues>): import("react/jsx-runtime").JSX.Element;
38
36
  type FormFieldProps<TControl, TFieldValues extends FieldValues, TTransformedValues> = (TControl extends Control<infer TValues> ? {
39
37
  control?: never;
40
38
  name: FieldPath<TValues>;
@@ -48,26 +46,26 @@ type FormFieldProps<TControl, TFieldValues extends FieldValues, TTransformedValu
48
46
  className?: never;
49
47
  withWrapper: false;
50
48
  });
51
- declare function FormField<TControl, TFieldValues extends FieldValues = FieldValues, TTransformedValues = TFieldValues>(props: FormFieldProps<TControl, TFieldValues, TTransformedValues>): _$react_jsx_runtime0.JSX.Element;
49
+ declare function FormField<TControl, TFieldValues extends FieldValues = FieldValues, TTransformedValues = TFieldValues>(props: FormFieldProps<TControl, TFieldValues, TTransformedValues>): import("react/jsx-runtime").JSX.Element;
52
50
  type FormFieldWithControllerProps<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>, TTransformedValues = TFieldValues> = ControllerProps<TFieldValues, TName, TTransformedValues>;
53
- declare function FormFieldWithController<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>, TTransformedValues = TFieldValues>(props: FormFieldWithControllerProps<TFieldValues, TName, TTransformedValues>): _$react_jsx_runtime0.JSX.Element;
51
+ declare function FormFieldWithController<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>, TTransformedValues = TFieldValues>(props: FormFieldWithControllerProps<TFieldValues, TName, TTransformedValues>): import("react/jsx-runtime").JSX.Element;
54
52
  type FormFieldBoundControllerProps<TFieldValues extends FieldValues, TTransformedValues> = Omit<ControllerProps<TFieldValues, never, TTransformedValues>, "control" | "name">;
55
- declare function FormFieldBoundController<TFieldValues extends FieldValues = Record<string, never>, TTransformedValues = TFieldValues>(props: FormFieldBoundControllerProps<TFieldValues, TTransformedValues>): _$react_jsx_runtime0.JSX.Element;
53
+ declare function FormFieldBoundController<TFieldValues extends FieldValues = Record<string, never>, TTransformedValues = TFieldValues>(props: FormFieldBoundControllerProps<TFieldValues, TTransformedValues>): import("react/jsx-runtime").JSX.Element;
56
54
  type FormFieldContextProps = DiscriminatedRenderProps<(contextValue: FieldContextType) => React.ReactNode>;
57
- declare function FormFieldContext(props: FormFieldContextProps): _$react.ReactNode;
55
+ declare function FormFieldContext(props: FormFieldContextProps): import("react").ReactNode;
58
56
  type FormLabelProps = InferProps<"label">;
59
- declare function FormLabel(props: FormLabelProps): _$react_jsx_runtime0.JSX.Element;
57
+ declare function FormLabel(props: FormLabelProps): import("react/jsx-runtime").JSX.Element;
60
58
  type FormInputGroupProps = InferProps<"div">;
61
- declare function FormInputGroup(props: FormInputGroupProps): _$react_jsx_runtime0.JSX.Element;
59
+ declare function FormInputGroup(props: FormInputGroupProps): import("react/jsx-runtime").JSX.Element;
62
60
  type FormSideItemProps = {
63
61
  children?: React.ReactNode;
64
62
  className?: string;
65
63
  };
66
- declare function FormInputLeftItem<TElement extends React.ElementType = "span">(props: PolymorphicPropsStrict<TElement, FormSideItemProps>): _$react_jsx_runtime0.JSX.Element;
64
+ declare function FormInputLeftItem<TElement extends React.ElementType = "span">(props: PolymorphicPropsStrict<TElement, FormSideItemProps>): import("react/jsx-runtime").JSX.Element;
67
65
  declare namespace FormInputLeftItem {
68
66
  var slotSymbol: symbol;
69
67
  }
70
- declare function FormInputRightItem<TElement extends React.ElementType = "span">(props: PolymorphicPropsStrict<TElement, FormSideItemProps>): _$react_jsx_runtime0.JSX.Element;
68
+ declare function FormInputRightItem<TElement extends React.ElementType = "span">(props: PolymorphicPropsStrict<TElement, FormSideItemProps>): import("react/jsx-runtime").JSX.Element;
71
69
  declare namespace FormInputRightItem {
72
70
  var slotSymbol: symbol;
73
71
  }
@@ -104,9 +102,9 @@ type FormSelectPrimitiveProps<TFieldValues extends FieldValues> = InferProps<"se
104
102
  fieldState?: FieldState;
105
103
  name?: FieldPath<TFieldValues>;
106
104
  };
107
- declare function FormInputPrimitive<TFieldValues extends FieldValues>(props: FormInputPrimitiveProps<TFieldValues>): _$react_jsx_runtime0.JSX.Element;
108
- declare function FormTextAreaPrimitive<TFieldValues extends FieldValues>(props: FormTextAreaPrimitiveProps<TFieldValues>): _$react_jsx_runtime0.JSX.Element;
109
- declare function FormSelectPrimitive<TFieldValues extends FieldValues>(props: FormSelectPrimitiveProps<TFieldValues>): _$react_jsx_runtime0.JSX.Element;
105
+ declare function FormInputPrimitive<TFieldValues extends FieldValues>(props: FormInputPrimitiveProps<TFieldValues>): import("react/jsx-runtime").JSX.Element;
106
+ declare function FormTextAreaPrimitive<TFieldValues extends FieldValues>(props: FormTextAreaPrimitiveProps<TFieldValues>): import("react/jsx-runtime").JSX.Element;
107
+ declare function FormSelectPrimitive<TFieldValues extends FieldValues>(props: FormSelectPrimitiveProps<TFieldValues>): import("react/jsx-runtime").JSX.Element;
110
108
  type PrimitivePropsToOmit = "control" | "formState" | "name";
111
109
  type FormInputProps = Omit<FormInputPrimitiveProps<FieldValues>, PrimitivePropsToOmit>;
112
110
  type FormTextAreaProps = Omit<FormTextAreaPrimitiveProps<FieldValues>, PrimitivePropsToOmit>;
@@ -118,11 +116,11 @@ type FormInputCombinedProps = (FormInputProps & {
118
116
  }) | (FormTextAreaProps & {
119
117
  type: "textarea";
120
118
  });
121
- declare function FormInput(props: FormInputCombinedProps): _$react_jsx_runtime0.JSX.Element;
122
- declare function FormTextArea(props: FormTextAreaProps): _$react_jsx_runtime0.JSX.Element;
123
- declare function FormSelect(props: FormSelectProps): _$react_jsx_runtime0.JSX.Element;
119
+ declare function FormInput(props: FormInputCombinedProps): import("react/jsx-runtime").JSX.Element;
120
+ declare function FormTextArea(props: FormTextAreaProps): import("react/jsx-runtime").JSX.Element;
121
+ declare function FormSelect(props: FormSelectProps): import("react/jsx-runtime").JSX.Element;
124
122
  type FormDescriptionProps = InferProps<"p">;
125
- declare function FormDescription<TElement extends React.ElementType = "p">(props: PolymorphicPropsStrict<TElement, FormDescriptionProps>): _$react_jsx_runtime0.JSX.Element;
123
+ declare function FormDescription<TElement extends React.ElementType = "p">(props: PolymorphicPropsStrict<TElement, FormDescriptionProps>): import("react/jsx-runtime").JSX.Element;
126
124
  type ErrorMessageRenderProps = {
127
125
  className: string;
128
126
  "data-index": number;
@@ -181,7 +179,7 @@ type FormErrorMessageProps<TControl, TFieldValues extends FieldValues, TTransfor
181
179
  errorField: string;
182
180
  type: "root";
183
181
  };
184
- declare function FormErrorMessage<TControl, TFieldValues extends FieldValues = FieldValues, TTransformedValues = TFieldValues>(props: FormErrorMessageProps<TControl, TFieldValues, TTransformedValues>): _$react_jsx_runtime0.JSX.Element;
182
+ declare function FormErrorMessage<TControl, TFieldValues extends FieldValues = FieldValues, TTransformedValues = TFieldValues>(props: FormErrorMessageProps<TControl, TFieldValues, TTransformedValues>): import("react/jsx-runtime").JSX.Element;
185
183
  type FormSubmitProps<TFieldValues extends FieldValues, TTransformedValues> = Omit<InferProps<"button">, "children"> & {
186
184
  asChild?: boolean;
187
185
  } & ({
@@ -191,14 +189,14 @@ type FormSubmitProps<TFieldValues extends FieldValues, TTransformedValues> = Omi
191
189
  children: FormStateSubscribeProps$1<TFieldValues, TTransformedValues>["render"];
192
190
  control?: Control<TFieldValues, unknown, TTransformedValues>;
193
191
  });
194
- declare function FormSubmit<TElement extends React.ElementType = "button", TFieldValues extends FieldValues = Record<string, unknown>, TTransformedValues = TFieldValues>(props: PolymorphicPropsStrict<TElement, FormSubmitProps<TFieldValues, TTransformedValues>>): _$react_jsx_runtime0.JSX.Element;
192
+ declare function FormSubmit<TElement extends React.ElementType = "button", TFieldValues extends FieldValues = Record<string, unknown>, TTransformedValues = TFieldValues>(props: PolymorphicPropsStrict<TElement, FormSubmitProps<TFieldValues, TTransformedValues>>): import("react/jsx-runtime").JSX.Element;
195
193
  type FormWatchProps<TFieldValues extends FieldValues, TFieldName extends Array<FieldPath<TFieldValues>> | FieldPath<TFieldValues> | ReadonlyArray<FieldPath<TFieldValues>> | undefined, TTransformedValues, TComputeValue, TComputedProps extends Omit<WatchProps<TFieldName, TFieldValues, unknown, TTransformedValues, TComputeValue>, "names"> = Omit<WatchProps<TFieldName, TFieldValues, unknown, TTransformedValues, TComputeValue>, "names">> = DiscriminatedRenderProps<TComputedProps["render"]> & Omit<TComputedProps, "render">;
196
- declare function FormWatch<TFieldValues extends FieldValues = Record<string, unknown>, const TFieldName extends Array<FieldPath<TFieldValues>> | FieldPath<TFieldValues> | ReadonlyArray<FieldPath<TFieldValues>> | undefined = FieldPath<TFieldValues>, TTransformedValues = TFieldValues, TComputeValue = undefined>(props: FormWatchProps<TFieldValues, TFieldName, TTransformedValues, TComputeValue>): _$react.ReactNode | _$react.ReactNode[];
194
+ declare function FormWatch<TFieldValues extends FieldValues = Record<string, unknown>, const TFieldName extends Array<FieldPath<TFieldValues>> | FieldPath<TFieldValues> | ReadonlyArray<FieldPath<TFieldValues>> | undefined = FieldPath<TFieldValues>, TTransformedValues = TFieldValues, TComputeValue = undefined>(props: FormWatchProps<TFieldValues, TFieldName, TTransformedValues, TComputeValue>): import("react").ReactNode | import("react").ReactNode[];
197
195
  type FormStateSubscribeProps<TFieldValues extends FieldValues, TTransformedValues, TComputedProps extends FormStateSubscribeProps$1<TFieldValues, TTransformedValues> = FormStateSubscribeProps$1<TFieldValues, TTransformedValues>> = DiscriminatedRenderProps<TComputedProps["render"]> & Omit<TComputedProps, "render">;
198
- declare function FormStateSubscribe<TFieldValues extends FieldValues = Record<string, unknown>, TTransformedValues = TFieldValues>(props: FormStateSubscribeProps<TFieldValues, TTransformedValues>): _$react.ReactNode;
196
+ declare function FormStateSubscribe<TFieldValues extends FieldValues = Record<string, unknown>, TTransformedValues = TFieldValues>(props: FormStateSubscribeProps<TFieldValues, TTransformedValues>): import("react").ReactNode;
199
197
  declare namespace form_parts_d_exports {
200
198
  export { FormDescription as Description, FormErrorMessage as ErrorMessage, FormErrorMessagePrimitive as ErrorMessagePrimitive, FormField as Field, FormFieldBoundController as FieldBoundController, FormFieldContext as FieldContext, FormFieldWithController as FieldWithController, FormDescriptionProps, FormErrorMessagePrimitiveProps, FormErrorMessageProps, FormFieldBoundControllerProps, FormFieldContextProps, FormFieldProps, FormFieldWithControllerProps, FormInputCombinedProps, FormInputGroupProps, FormInputPrimitiveProps, FormInputProps, FormLabelProps, FormRootProps, FormSelectPrimitiveProps, FormSelectProps, FormSideItemProps, FormStateSubscribeProps, FormSubmitProps, FormTextAreaPrimitiveProps, FormTextAreaProps, FormWatchProps, FormInput as Input, FormInputGroup as InputGroup, FormInputLeftItem as InputLeftItem, FormInputPrimitive as InputPrimitive, FormInputRightItem as InputRightItem, FormLabel as Label, FormRoot as Root, FormSelect as Select, FormStateSubscribe as StateSubscribe, FormSubmit as Submit, FormTextArea as TextArea, FormTextAreaPrimitive as TextAreaPrimitive, FormWatch as Watch };
201
199
  }
202
200
  //#endregion
203
- export { form_parts_d_exports as Form, FormDescription, type FormDescriptionProps, FormErrorMessage, FormErrorMessagePrimitive, type FormErrorMessagePrimitiveProps, type FormErrorMessageProps, FormField, FormFieldBoundController, type FormFieldBoundControllerProps, FormFieldContext, type FormFieldContextProps, type FormFieldProps, FormFieldWithController, type FormFieldWithControllerProps, FormInput, type FormInputCombinedProps, FormInputGroup, type FormInputGroupProps, FormInputLeftItem, FormInputPrimitive, type FormInputPrimitiveProps, type FormInputProps, FormInputRightItem, FormLabel, type FormLabelProps, FormRoot, type FormRootProps, FormSelect, FormSelectPrimitive, type FormSelectPrimitiveProps, type FormSelectProps, type FormSideItemProps, FormStateSubscribe, type FormStateSubscribeProps, FormSubmit, type FormSubmitProps, FormTextArea, FormTextAreaPrimitive, type FormTextAreaPrimitiveProps, type FormTextAreaProps, FormWatch, type FormWatchProps, useStrictFormFieldContext as useFormFieldContext, useFormRootContext };
201
+ export { form_parts_d_exports as Form, FormDescription, FormDescriptionProps, FormErrorMessage, FormErrorMessagePrimitive, FormErrorMessagePrimitiveProps, FormErrorMessageProps, FormField, FormFieldBoundController, FormFieldBoundControllerProps, FormFieldContext, FormFieldContextProps, FormFieldProps, FormFieldWithController, FormFieldWithControllerProps, FormInput, FormInputCombinedProps, FormInputGroup, FormInputGroupProps, FormInputLeftItem, FormInputPrimitive, FormInputPrimitiveProps, FormInputProps, FormInputRightItem, FormLabel, FormLabelProps, FormRoot, FormRootProps, FormSelect, FormSelectPrimitive, FormSelectPrimitiveProps, FormSelectProps, FormSideItemProps, FormStateSubscribe, FormStateSubscribeProps, FormSubmit, FormSubmitProps, FormTextArea, FormTextAreaPrimitive, FormTextAreaPrimitiveProps, FormTextAreaProps, FormWatch, FormWatchProps, useStrictFormFieldContext as useFormFieldContext, useFormRootContext };
204
202
  //# sourceMappingURL=index.d.ts.map
@@ -529,16 +529,22 @@ function FormErrorMessage(props) {
529
529
  }
530
530
  function FormSubmit(props) {
531
531
  const { as: Element = "button", asChild, children, control, type = "submit", ...restOfProps } = props;
532
- return /* @__PURE__ */ jsx(asChild ? SlotRoot : Element, {
532
+ const Component = asChild ? SlotRoot : Element;
533
+ const methodsContextValue = useFormMethodsContext({ strict: false });
534
+ const resolvedControl = control ?? methodsContextValue?.control;
535
+ if (isFunction(children) && !resolvedControl) throw new ContextError("<Form.Submit> must be provided with an explicit 'control' prop or used within <Form.Root> if a render prop is passed as children");
536
+ const formState = (isFunction(children) && resolvedControl ? useFormState : () => ({}))({
537
+ control: resolvedControl,
538
+ disabled: restOfProps.disabled
539
+ });
540
+ const resolvedChildren = isFunction(children) ? children(formState) : children;
541
+ return /* @__PURE__ */ jsx(Component, {
533
542
  "data-slot": "form-submit",
534
543
  "data-part": "submit",
535
544
  "data-scope": "form",
536
545
  type,
537
546
  ...restOfProps,
538
- children: isFunction(children) ? /* @__PURE__ */ jsx(FormStateSubscribe, {
539
- control,
540
- render: children
541
- }) : children
547
+ children: resolvedChildren
542
548
  });
543
549
  }
544
550
  function FormWatch(props) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["useHookFormContext","HookFormProvider","ReactFragment","Slot.Root"],"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"],"sourcesContent":["export 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 { isObject } from \"@zayne-labs/toolkit-type-helpers\";\nimport { createElement } from \"react\";\nimport type { FieldErrors, FieldValues } from \"react-hook-form\";\nimport { cnMerge } from \"@/lib/utils/cn\";\nimport type { FormErrorMessagePrimitiveProps, FormInputProps } from \"./form\";\nimport type { FormRootContextType, 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 === undefined || !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: FormRootContextType[\"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 { UnionDiscriminator } from \"@zayne-labs/toolkit-type-helpers\";\nimport {\n\tuseFormState,\n\tuseFormContext as useHookFormContext,\n\ttype Control,\n\ttype FieldValues,\n\ttype UseFormReturn,\n\ttype UseFormStateReturn,\n} from \"react-hook-form\";\nimport { getFieldErrorMessage } from \"./utils\";\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 FormRootContextType = {\n\twithEyeIcon: boolean | EyeIconObject | undefined;\n};\n\nexport const [LaxFormRootProvider, useLaxFormRootContext] = createCustomContext({\n\tdefaultValue: null as unknown as FormRootContextType,\n\thookName: \"useLaxFormRootContext\",\n\tname: \"LaxFormRootContext\",\n\tproviderName: \"FormRoot\",\n\tstrict: false,\n});\n\nexport type UseFormRootContextResult<TStrict extends boolean = true> =\n\tTStrict extends true ? UseFormReturn : UseFormReturn | null;\n\nexport const useFormMethodsContext = <TStrict extends boolean = true>(\n\toptions: { strict?: TStrict } = {}\n): UseFormRootContextResult<TStrict> => {\n\tconst { strict = true } = options;\n\n\tconst formContext = useHookFormContext();\n\n\t// eslint-disable-next-line ts-eslint/no-unnecessary-condition -- Allow\n\tif (strict && !formContext) {\n\t\tthrow new ContextError(\n\t\t\t`useFormMethodsContext 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 FieldContextType = {\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 const [StrictFormFieldProvider, useStrictFormFieldContext] = createCustomContext<FieldContextType>({\n\thookName: \"useFormFieldContext\",\n\tname: \"StrictFormFieldContext\",\n\tproviderName: \"FormField\",\n});\n\nexport const [LaxFormFieldProvider, useLaxFormFieldContext] = createCustomContext({\n\tdefaultValue: null as unknown as FieldContextType,\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\ntype FieldStateOptions<TFieldValues extends FieldValues, TTransformedValues = TFieldValues> =\n\t| {\n\t\t\tcontrol: Control<TFieldValues, unknown, TTransformedValues> | undefined;\n\t\t\tname?: string;\n\t }\n\t| {\n\t\t\tcontrol?: Control<TFieldValues, unknown, TTransformedValues>;\n\t\t\tname: string | undefined;\n\t };\n\nexport const useLaxFormFieldState = <TFieldValues extends FieldValues, TTransformedValues = TFieldValues>(\n\toptions?: FieldStateOptions<TFieldValues, TTransformedValues>\n): FieldState => {\n\tconst { control } = useFormMethodsContext({ strict: false }) ?? {};\n\tconst { name } = useLaxFormFieldContext() ?? {};\n\n\tconst resolvedControl = control ?? options?.control;\n\n\tconst getFormState =\n\t\t// eslint-disable-next-line react-hooks/hooks -- Ignore\n\t\tresolvedControl ? useFormState : ((() => ({})) as typeof useFormState);\n\n\t// eslint-disable-next-line react-hooks/hooks -- Ignore\n\tconst { disabled, errors } = getFormState({\n\t\tcontrol: resolvedControl as never,\n\t\tname: name ?? options?.name,\n\t});\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 { dataAttr, on, toArray } from \"@zayne-labs/toolkit-core\";\nimport { ContextError, useCallbackRef, useCompareValue, useToggle } from \"@zayne-labs/toolkit-react\";\nimport {\n\tcomposeRefs,\n\tcomposeTwoEventHandlers,\n\tgetMultipleSlots,\n\ttype DiscriminatedRenderItemProps,\n\ttype DiscriminatedRenderProps,\n\ttype InferProps,\n\ttype PolymorphicPropsStrict,\n} from \"@zayne-labs/toolkit-react/utils\";\nimport { defineEnum, isFunction, type AnyString } from \"@zayne-labs/toolkit-type-helpers\";\nimport { Fragment as ReactFragment, useEffect, useId, useMemo, useRef } from \"react\";\nimport {\n\tController,\n\tFormProvider as HookFormProvider,\n\tuseFormState,\n\tuseWatch,\n\ttype Control,\n\ttype ControllerProps,\n\ttype FieldPath,\n\ttype FieldValues,\n\ttype RegisterOptions,\n\ttype FormStateSubscribeProps as StateSubscribeProps,\n\ttype UseFormReturn,\n\ttype WatchProps,\n} from \"react-hook-form\";\nimport { ForWithWrapper } from \"@/components/common/for\";\nimport { Slot } from \"@/components/common/slot\";\nimport { cnMerge } from \"@/lib/utils/cn\";\nimport {\n\tLaxFormFieldProvider,\n\tLaxFormRootProvider,\n\tStrictFormFieldProvider,\n\tuseFormMethodsContext,\n\tuseLaxFormFieldContext,\n\tuseLaxFormFieldState,\n\tuseLaxFormRootContext,\n\tuseStrictFormFieldContext,\n\ttype FieldContextType,\n\ttype FieldState,\n\ttype FormRootContextType,\n} from \"./form-context\";\nimport { getEyeIcon, getFieldErrorMessage } from \"./utils\";\n\nexport type FormRootProps<TFieldValues extends FieldValues, TTransformedValues> = InferProps<\"form\">\n\t& Partial<FormRootContextType> & {\n\t\tchildren: React.ReactNode;\n\t\tform: UseFormReturn<TFieldValues, unknown, TTransformedValues>;\n\t};\n\nexport function FormRoot<TFieldValues extends FieldValues, TTransformedValues = TFieldValues>(\n\tprops: FormRootProps<TFieldValues, TTransformedValues>\n) {\n\tconst { children, className, form, withEyeIcon, ...restOfProps } = props;\n\n\tconst shallowedComparedWithEyeIcon = useCompareValue(withEyeIcon);\n\n\tconst formContextValue = useMemo(\n\t\t() => ({ withEyeIcon: shallowedComparedWithEyeIcon }),\n\t\t[shallowedComparedWithEyeIcon]\n\t);\n\n\treturn (\n\t\t<HookFormProvider {...form}>\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\nexport type FormFieldProps<\n\tTControl,\n\tTFieldValues extends FieldValues,\n\tTTransformedValues,\n> = (TControl extends Control<infer TValues> ?\n\t{\n\t\tcontrol?: never;\n\t\tname: FieldPath<TValues>;\n\t}\n:\t{\n\t\tcontrol?: Control<TFieldValues, unknown, TTransformedValues>;\n\t\tname: FieldPath<TFieldValues>;\n\t})\n\t& (\n\t\t| (InferProps<\"div\"> & { withWrapper?: true })\n\t\t| { children: React.ReactNode; className?: never; withWrapper: false }\n\t);\n\nexport function FormField<\n\tTControl,\n\tTFieldValues extends FieldValues = FieldValues,\n\tTTransformedValues = TFieldValues,\n>(props: FormFieldProps<TControl, TFieldValues, TTransformedValues>) {\n\tconst { children, className, control, name, withWrapper = true } = props;\n\n\tconst { isDisabled, isInvalid } = useLaxFormFieldState({ control, 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 FieldContextType,\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 gap-2\", 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\nexport type FormFieldWithControllerProps<\n\tTFieldValues extends FieldValues,\n\tTName extends FieldPath<TFieldValues>,\n\tTTransformedValues = TFieldValues,\n> = ControllerProps<TFieldValues, TName, TTransformedValues>;\n\nexport function FormFieldWithController<\n\tTFieldValues extends FieldValues,\n\tTName extends FieldPath<TFieldValues>,\n\tTTransformedValues = TFieldValues,\n>(props: FormFieldWithControllerProps<TFieldValues, TName, TTransformedValues>) {\n\tconst methodsContextValue = useFormMethodsContext({ strict: false });\n\n\tconst { control, name, render, ...restOfProps } = 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 FieldContextType,\n\t\t[name, uniqueId]\n\t);\n\n\tconst resolvedControl = control ?? methodsContextValue?.control;\n\n\tif (!resolvedControl) {\n\t\tthrow new ContextError(\n\t\t\t\"<Form.FormFieldWithController> must be provided with an explicit 'control' prop or used within <Form.Root>\"\n\t\t);\n\t}\n\n\treturn (\n\t\t<StrictFormFieldProvider value={fieldContextValue}>\n\t\t\t<LaxFormFieldProvider value={fieldContextValue}>\n\t\t\t\t<Controller\n\t\t\t\t\tcontrol={resolvedControl as never}\n\t\t\t\t\tname={name}\n\t\t\t\t\trender={render as never}\n\t\t\t\t\t{...(restOfProps as object)}\n\t\t\t\t/>\n\t\t\t</LaxFormFieldProvider>\n\t\t</StrictFormFieldProvider>\n\t);\n}\n\nexport type FormFieldBoundControllerProps<TFieldValues extends FieldValues, TTransformedValues> = Omit<\n\tControllerProps<TFieldValues, never, TTransformedValues>,\n\t\"control\" | \"name\"\n>;\n\nexport function FormFieldBoundController<\n\tTFieldValues extends FieldValues = Record<string, never>,\n\tTTransformedValues = TFieldValues,\n>(props: FormFieldBoundControllerProps<TFieldValues, TTransformedValues>) {\n\tconst { control } = useFormMethodsContext();\n\tconst { name } = useStrictFormFieldContext();\n\tconst { render, ...restOfProps } = props;\n\n\treturn (\n\t\t<Controller name={name} control={control} render={render as never} {...(restOfProps as object)} />\n\t);\n}\n\nexport type FormFieldContextProps = DiscriminatedRenderProps<\n\t(contextValue: FieldContextType) => React.ReactNode\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 type FormLabelProps = InferProps<\"label\">;\n\nexport function FormLabel(props: FormLabelProps) {\n\tconst fieldContextValues = useStrictFormFieldContext();\n\n\tconst { children, htmlFor, ...restOfProps } = props;\n\n\tconst { isDisabled, isInvalid } = useLaxFormFieldState({ name: fieldContextValues.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={Object.hasOwn(props, \"htmlFor\") ? htmlFor : fieldContextValues.formItemId}\n\t\t\t{...restOfProps}\n\t\t>\n\t\t\t{children}\n\t\t</label>\n\t);\n}\n\nexport type FormInputGroupProps = InferProps<\"div\">;\n\nexport function FormInputGroup(props: FormInputGroupProps) {\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\nexport type FormSideItemProps = {\n\tchildren?: React.ReactNode;\n\tclassName?: string;\n};\n\nexport function FormInputLeftItem<TElement extends React.ElementType = \"span\">(\n\tprops: PolymorphicPropsStrict<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: PolymorphicPropsStrict<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 RulesProp = {\n\trules?: RegisterOptions;\n};\n\nexport type FormInputPrimitiveProps<TFieldValues extends FieldValues> = Omit<\n\tInferProps<\"input\">,\n\t\"children\"\n>\n\t& RulesProp & {\n\t\tclassNames?: { error?: string; eyeIcon?: string; input?: string; inputGroup?: string };\n\t\tcontrol?: Control<TFieldValues>;\n\t\tfieldState?: FieldState;\n\t\tname?: FieldPath<TFieldValues>;\n\t\twithEyeIcon?: FormRootContextType[\"withEyeIcon\"];\n\t};\n\nexport type FormTextAreaPrimitiveProps<TFieldValues extends FieldValues> = InferProps<\"textarea\">\n\t& RulesProp & {\n\t\tclassNames?: { base?: string; error?: string };\n\t\tcontrol?: Control<TFieldValues>;\n\t\tfieldState?: FieldState;\n\t\tname?: FieldPath<TFieldValues>;\n\t};\n\nexport type FormSelectPrimitiveProps<TFieldValues extends FieldValues> = InferProps<\"select\">\n\t& RulesProp & {\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 inputTypesWithoutFullWidth = new Set<React.HTMLInputTypeAttribute>([\"checkbox\", \"radio\"]);\n\nexport function FormInputPrimitive<TFieldValues extends FieldValues>(\n\tprops: FormInputPrimitiveProps<TFieldValues>\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,\n\t\tname,\n\t\trules,\n\t\ttype = \"text\",\n\t\twithEyeIcon,\n\t\t...restOfProps\n\t} = props;\n\n\tconst resolvedWithEyeIcon = withEyeIcon ?? formRootContextValues?.withEyeIcon ?? true;\n\n\tconst fieldStateFromLaxFormField = useLaxFormFieldState({ control, name });\n\n\tconst { isDisabled, isInvalid } = fieldState ?? fieldStateFromLaxFormField;\n\n\tconst [isPasswordVisible, toggleIsPasswordVisible] = useToggle(false);\n\n\tconst shouldHaveEyeIcon = Boolean(resolvedWithEyeIcon) && type === \"password\";\n\n\tconst WrapperElement = shouldHaveEyeIcon ? FormInputGroup : ReactFragment;\n\n\tconst wrapperElementProps =\n\t\tshouldHaveEyeIcon\n\t\t&& ({\n\t\t\tclassName: cnMerge(\"w-full\", classNames?.inputGroup, isInvalid && classNames?.error),\n\t\t} satisfies InferProps<typeof FormInputGroup>);\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: resolvedWithEyeIcon,\n\t});\n\n\treturn (\n\t\t<WrapperElement {...wrapperElementProps}>\n\t\t\t<input\n\t\t\t\tdata-slot=\"form-input\"\n\t\t\t\tdata-scope=\"form\"\n\t\t\t\tdata-part=\"input\"\n\t\t\t\taria-describedby={\n\t\t\t\t\t!isInvalid ?\n\t\t\t\t\t\tfieldContextValues?.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={Object.hasOwn(props, \"id\") ? id : fieldContextValues?.formItemId}\n\t\t\t\tname={Object.hasOwn(props, \"name\") ? name : fieldContextValues?.name}\n\t\t\t\ttype={type === \"password\" && isPasswordVisible ? \"text\" : type}\n\t\t\t\tclassName={cnMerge(\n\t\t\t\t\t!inputTypesWithoutFullWidth.has(type) && \"w-full min-w-0\",\n\t\t\t\t\t`bg-transparent text-sm outline-hidden transition-[color,box-shadow] selection:bg-zu-primary\n\t\t\t\t\tselection:text-zu-primary-foreground file:inline-flex file:h-7 file:border-0\n\t\t\t\t\tfile:bg-transparent file:font-medium file:text-zu-foreground\n\t\t\t\t\tplaceholder:text-zu-muted-foreground focus-visible:outline-hidden\n\t\t\t\t\tdisabled:pointer-events-none 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={toggleIsPasswordVisible}\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>\n) {\n\tconst fieldContextValues = useLaxFormFieldContext();\n\n\tconst { className, classNames, control, fieldState, id, name, rules, ...restOfProps } = 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-slot=\"form-textarea\"\n\t\t\tdata-scope=\"form\"\n\t\t\tdata-part=\"textarea\"\n\t\t\taria-describedby={\n\t\t\t\t!isInvalid ?\n\t\t\t\t\tfieldContextValues?.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={Object.hasOwn(props, \"id\") ? id : fieldContextValues?.formItemId}\n\t\t\tname={Object.hasOwn(props, \"name\") ? name : fieldContextValues?.name}\n\t\t\tclassName={cnMerge(\n\t\t\t\t`w-full bg-transparent text-sm placeholder:text-zu-muted-foreground\n\t\t\t\tfocus-visible:outline-hidden 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>\n) {\n\tconst fieldContextValues = useLaxFormFieldContext();\n\n\tconst { className, classNames, control, fieldState, id, name, rules, ...restOfProps } = 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-slot=\"form-select\"\n\t\t\tdata-scope=\"form\"\n\t\t\tdata-part=\"select\"\n\t\t\taria-describedby={\n\t\t\t\t!isInvalid ?\n\t\t\t\t\tfieldContextValues?.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 ?? fieldContextValues?.formItemId}\n\t\t\tname={name ?? fieldContextValues?.name}\n\t\t\tclassName={cnMerge(\n\t\t\t\t`w-full bg-transparent text-sm placeholder:text-zu-muted-foreground\n\t\t\t\tfocus-visible:outline-hidden 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<FieldValues>, PrimitivePropsToOmit>;\n\nexport type FormTextAreaProps = Omit<FormTextAreaPrimitiveProps<FieldValues>, PrimitivePropsToOmit>;\n\nexport type FormSelectProps = Omit<FormSelectPrimitiveProps<FieldValues>, PrimitivePropsToOmit>;\n\nexport type FormInputCombinedProps =\n\t| (FormInputProps & { type?: FormInputProps[\"type\"] })\n\t| (FormSelectProps & { type: \"select\" })\n\t| (FormTextAreaProps & { type: \"textarea\" });\n\nconst InputTypeMap = defineEnum({\n\tselect: FormSelectPrimitive,\n\ttextarea: FormTextAreaPrimitive,\n});\n\nexport function FormInput(props: FormInputCombinedProps) {\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\tInputTypeMap[type as Exclude<typeof type, AnyString>]\n\t\t:\tFormInputPrimitive;\n\n\tconst registerProps = name ? register(name, rules) : null;\n\n\treturn (\n\t\t<SelectedInput\n\t\t\ttype={type}\n\t\t\tname={name}\n\t\t\t{...registerProps}\n\t\t\t{...(restOfProps as NonNullable<unknown>)}\n\t\t\t// eslint-disable-next-line react/refs -- Ignore\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 type FormDescriptionProps = InferProps<\"p\">;\n\nexport function FormDescription<TElement extends React.ElementType = \"p\">(\n\tprops: PolymorphicPropsStrict<TElement, FormDescriptionProps>\n) {\n\tconst { as: Element = \"p\", className, ...restOfProps } = props;\n\n\tconst { formDescriptionId } = useLaxFormFieldContext() ?? {};\n\n\treturn (\n\t\t<Element\n\t\t\tdata-slot=\"form-description\"\n\t\t\tdata-scope=\"form\"\n\t\t\tdata-part=\"description\"\n\t\t\tid={formDescriptionId}\n\t\t\tclassName={cnMerge(\"text-[12px]\", className)}\n\t\t\t{...restOfProps}\n\t\t/>\n\t);\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};\n\ntype ErrorMessageRenderState = {\n\terrorMessage: string;\n\terrorMessageArray: string[];\n\tindex: number;\n};\n\ntype ErrorMessageRenderFn = (context: {\n\tprops: ErrorMessageRenderProps;\n\tstate: ErrorMessageRenderState;\n}) => React.ReactNode;\n\nexport type FormErrorMessagePrimitiveProps<TFieldValues extends FieldValues> =\n\tDiscriminatedRenderItemProps<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 FormErrorMessagePrimitiveOverloadType = {\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: FormErrorMessagePrimitiveOverloadType = (props) => {\n\tconst methodsContextValues = useFormMethodsContext({ strict: false });\n\n\tconst {\n\t\tchildren,\n\t\tclassName,\n\t\tclassNames,\n\t\tcontrol,\n\t\tdisableErrorAnimation = false,\n\t\tdisableScrollToErrorField = false,\n\t\tfieldName,\n\t\trenderItem,\n\t\ttype = \"regular\",\n\t} = props;\n\n\tconst resolvedControl = control ?? methodsContextValues?.control;\n\n\tif (!resolvedControl) {\n\t\tthrow new ContextError(\n\t\t\t\"<Form.ErrorMessagePrimitive> must be provided with an explicit 'control' prop or used within <Form.Root>\"\n\t\t);\n\t}\n\n\tconst { errors } = useLaxFormFieldState({\n\t\tcontrol: resolvedControl as never,\n\t\tname: fieldName,\n\t});\n\n\tconst { formMessageId } = useLaxFormFieldContext() ?? {};\n\n\tconst containerRef = useRef<HTMLUListElement>(null);\n\n\tconst errorAnimationClass = classNames?.errorMessageAnimation ?? \"animate-shake\";\n\n\tconst getErrorElements = useCallbackRef(() => containerRef.current?.children ?? []);\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\tconst controller = new AbortController();\n\n\t\tfor (const element of errorMessageElements) {\n\t\t\telement.classList.add(errorAnimationClass);\n\n\t\t\tconst onAnimationEnd = () => element.classList.remove(errorAnimationClass);\n\n\t\t\ton(element, \"animationend\", onAnimationEnd, { once: true, signal: controller.signal });\n\t\t}\n\n\t\treturn () => {\n\t\t\tcontroller.abort();\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\tif (errorMessageElements.length === 0) return;\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\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// == Get the element's position and scroll in one frame\n\t\tconst frameID = requestAnimationFrame(() => {\n\t\t\tconst elementRect = firstErrorElement.getBoundingClientRect();\n\n\t\t\tif (elementRect.top === 0) return;\n\n\t\t\tconst topWithOffset = elementRect.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\n\t\treturn () => {\n\t\t\tcancelAnimationFrame(frameID);\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/* eslint-disable perfectionist/sort-objects -- Ignore */\n\t\t\t\"data-slot\": \"form-error-message\",\n\t\t\t\"data-part\": \"error-message\",\n\t\t\t\"data-scope\": \"form\",\n\t\t\t\"data-index\": index,\n\t\t\t/* eslint-enable perfectionist/sort-objects -- Ignore */\n\t\t\tid: formMessageId,\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 selectedChildren = typeof children === \"function\" ? children : renderItem;\n\n\treturn (\n\t\t<ForWithWrapper\n\t\t\tref={containerRef}\n\t\t\tclassName={cnMerge(\"flex flex-col\", classNames?.container)}\n\t\t\tdata-slot=\"form-error-message-container\"\n\t\t\tdata-scope=\"form\"\n\t\t\tdata-part=\"error-message-container\"\n\t\t\teach={errorMessageArray}\n\t\t\trenderItem={(errorMessage, index) => {\n\t\t\t\treturn selectedChildren({\n\t\t\t\t\tprops: getRenderProps({ index }),\n\t\t\t\t\tstate: getRenderState({ errorMessage, index }),\n\t\t\t\t});\n\t\t\t}}\n\t\t/>\n\t);\n};\n\nexport type FormErrorMessageProps<TControl, TFieldValues extends FieldValues, TTransformedValues> =\n\t| (TControl extends Control<infer TValues> ?\n\t\t\t{\n\t\t\t\tclassName?: string;\n\t\t\t\tcontrol?: never;\n\t\t\t\terrorField?: FieldPath<TValues>;\n\t\t\t\ttype?: \"regular\";\n\t\t\t}\n\t :\t{\n\t\t\t\tclassName?: string;\n\t\t\t\tcontrol?: Control<TFieldValues, unknown, TTransformedValues>; // == Here for type inference of errorField prop\n\t\t\t\terrorField?: FieldPath<TFieldValues>;\n\t\t\t\ttype?: \"regular\";\n\t\t\t})\n\t| {\n\t\t\tclassName?: string;\n\t\t\terrorField: string;\n\t\t\ttype: \"root\";\n\t };\n\nexport function FormErrorMessage<\n\tTControl,\n\tTFieldValues extends FieldValues = FieldValues,\n\tTTransformedValues = TFieldValues,\n>(props: FormErrorMessageProps<TControl, TFieldValues, TTransformedValues>) {\n\tconst fieldContextValues = useLaxFormFieldContext();\n\n\tconst { className, errorField, type = \"regular\" } = props;\n\n\tconst { control } = useFormMethodsContext();\n\n\treturn (\n\t\t<FormErrorMessagePrimitive\n\t\t\ttype={type as \"root\"}\n\t\t\tcontrol={control}\n\t\t\tfieldName={errorField ?? (fieldContextValues?.name as NonNullable<typeof errorField>)}\n\t\t\trenderItem={({ props: renderProps, state }) => (\n\t\t\t\t<li\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-zu-destructive\",\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</li>\n\t\t\t)}\n\t\t/>\n\t);\n}\n\nexport type FormSubmitProps<TFieldValues extends FieldValues, TTransformedValues> = Omit<\n\tInferProps<\"button\">,\n\t\"children\"\n> & {\n\tasChild?: boolean;\n} & (\n\t\t| {\n\t\t\t\tchildren: React.ReactNode;\n\t\t\t\tcontrol?: never;\n\t\t }\n\t\t| {\n\t\t\t\tchildren: StateSubscribeProps<TFieldValues, TTransformedValues>[\"render\"];\n\t\t\t\tcontrol?: Control<TFieldValues, unknown, TTransformedValues>;\n\t\t }\n\t);\n\nexport function FormSubmit<\n\tTElement extends React.ElementType = \"button\",\n\tTFieldValues extends FieldValues = Record<string, unknown>,\n\tTTransformedValues = TFieldValues,\n>(props: PolymorphicPropsStrict<TElement, FormSubmitProps<TFieldValues, TTransformedValues>>) {\n\tconst { as: Element = \"button\", asChild, children, control, type = \"submit\", ...restOfProps } = props;\n\n\tconst Component = asChild ? Slot.Root : Element;\n\n\treturn (\n\t\t<Component data-slot=\"form-submit\" data-part=\"submit\" data-scope=\"form\" type={type} {...restOfProps}>\n\t\t\t{isFunction(children) ?\n\t\t\t\t<FormStateSubscribe control={control} render={children} />\n\t\t\t:\tchildren}\n\t\t</Component>\n\t);\n}\n\nexport type FormWatchProps<\n\tTFieldValues extends FieldValues,\n\tTFieldName extends\n\t\t| Array<FieldPath<TFieldValues>>\n\t\t| FieldPath<TFieldValues>\n\t\t| ReadonlyArray<FieldPath<TFieldValues>>\n\t\t| undefined,\n\tTTransformedValues,\n\tTComputeValue,\n\tTComputedProps extends Omit<\n\t\tWatchProps<TFieldName, TFieldValues, unknown, TTransformedValues, TComputeValue>,\n\t\t\"names\"\n\t> = Omit<WatchProps<TFieldName, TFieldValues, unknown, TTransformedValues, TComputeValue>, \"names\">,\n> = DiscriminatedRenderProps<TComputedProps[\"render\"]> & Omit<TComputedProps, \"render\">;\n\nexport function FormWatch<\n\tTFieldValues extends FieldValues = Record<string, unknown>,\n\tconst TFieldName extends\n\t\t| Array<FieldPath<TFieldValues>>\n\t\t| FieldPath<TFieldValues>\n\t\t| ReadonlyArray<FieldPath<TFieldValues>>\n\t\t| undefined = FieldPath<TFieldValues>,\n\tTTransformedValues = TFieldValues,\n\tTComputeValue = undefined,\n>(props: FormWatchProps<TFieldValues, TFieldName, TTransformedValues, TComputeValue>) {\n\tconst fieldContextValue = useLaxFormFieldContext();\n\n\tconst { children, compute, control, defaultValue, disabled, exact, name, render } = props;\n\n\tconst methodsContextValue = useFormMethodsContext({ strict: false });\n\n\tconst resolvedControl = control ?? methodsContextValue?.control;\n\n\tif (!resolvedControl) {\n\t\tthrow new ContextError(\n\t\t\t\"<Form.Watch> must be provided with an explicit 'control' prop or used within <Form.Root>\"\n\t\t);\n\t}\n\n\tconst formValue = useWatch({\n\t\tcompute: compute as never,\n\t\tcontrol: resolvedControl as never,\n\t\tdefaultValue,\n\t\tdisabled,\n\t\texact,\n\t\tname: (name ?? fieldContextValue?.name) as string,\n\t}) as unknown;\n\n\tconst selectedChildren = typeof children === \"function\" ? children : render;\n\n\tconst resolvedChildren = selectedChildren(formValue as never);\n\n\treturn resolvedChildren;\n}\n\nexport type FormStateSubscribeProps<\n\tTFieldValues extends FieldValues,\n\tTTransformedValues,\n\tTComputedProps extends StateSubscribeProps<TFieldValues, TTransformedValues> = StateSubscribeProps<\n\t\tTFieldValues,\n\t\tTTransformedValues\n\t>,\n> = DiscriminatedRenderProps<TComputedProps[\"render\"]> & Omit<TComputedProps, \"render\">;\n\nexport function FormStateSubscribe<\n\tTFieldValues extends FieldValues = Record<string, unknown>,\n\tTTransformedValues = TFieldValues,\n>(props: FormStateSubscribeProps<TFieldValues, TTransformedValues>) {\n\tconst fieldContextValues = useLaxFormFieldContext();\n\n\tconst { children, control, disabled, exact, name, render } = props;\n\n\tconst methodsContextValue = useFormMethodsContext({ strict: false });\n\n\tconst resolvedControl = control ?? methodsContextValue?.control;\n\n\tif (!resolvedControl) {\n\t\tthrow new ContextError(\n\t\t\t\"<Form.StateSubscribe> must be provided with an explicit 'control' prop or used within <Form.Root>\"\n\t\t);\n\t}\n\n\tconst formState = useFormState({\n\t\tcontrol: resolvedControl as never,\n\t\tdisabled,\n\t\texact,\n\t\tname: name ?? (fieldContextValues?.name as never),\n\t});\n\n\tconst selectedChildren = typeof children === \"function\" ? children : render;\n\n\tconst resolvedChildren = selectedChildren(formState);\n\n\treturn resolvedChildren;\n}\n\n<FormStateSubscribe>{(formState) => <p>{formState.isValid ? \"Valid\" : \"Invalid\"}</p>}</FormStateSubscribe>;\n","export {\n\tFormDescription as Description,\n\tFormErrorMessage as ErrorMessage,\n\tFormErrorMessagePrimitive as ErrorMessagePrimitive,\n\tFormField as Field,\n\tFormFieldBoundController as FieldBoundController,\n\tFormFieldContext as FieldContext,\n\tFormFieldWithController as FieldWithController,\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\tFormStateSubscribe as StateSubscribe,\n\tFormSubmit as Submit,\n\tFormTextArea as TextArea,\n\tFormTextAreaPrimitive as TextAreaPrimitive,\n\tFormWatch as Watch,\n} from \"./form\";\n\nexport type {\n\tFormDescriptionProps,\n\tFormErrorMessagePrimitiveProps,\n\tFormErrorMessageProps,\n\tFormFieldBoundControllerProps,\n\tFormFieldContextProps,\n\tFormFieldProps,\n\tFormFieldWithControllerProps,\n\tFormInputCombinedProps,\n\tFormInputGroupProps,\n\tFormInputPrimitiveProps,\n\tFormInputProps,\n\tFormLabelProps,\n\tFormRootProps,\n\tFormSelectPrimitiveProps,\n\tFormSelectProps,\n\tFormSideItemProps,\n\tFormStateSubscribeProps,\n\tFormSubmitProps,\n\tFormTextAreaPrimitiveProps,\n\tFormTextAreaProps,\n\tFormWatchProps,\n} from \"./form\";\n"],"mappings":";;;;;;;;;;;;;AAAA,MAAa,iBAAiB,UAC7B,oBAAC,OAAD;CAAK,OAAM;CAA6B,OAAM;CAAM,QAAO;CAAM,SAAQ;CAAY,GAAI;WACxF,oBAAC,QAAD;EACC,MAAK;EACL,GAAE;EACD,CAAA;CACG,CAAA;AAGP,MAAa,eAAe,UAC3B,oBAAC,OAAD;CAAK,OAAM;CAA6B,OAAM;CAAM,QAAO;CAAM,SAAQ;CAAY,GAAI;WACxF,oBAAC,QAAD;EACC,MAAK;EACL,GAAE;EACD,CAAA;CACG,CAAA;;;ACPP,MAAa,wBAAwB,YAIO;CAC3C,MAAM,EAAE,QAAQ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AAqB;AAExD,KAAI,CAAC,gBACJ,OAAM,IAAI,aACT,oGACA;CAGF,MAAM,YAAY,aAAa;EAC9B,SAAS;EACT;EACA;EACA,MAAM,QAAS,oBAAoB;EACnC,CAAC;AAMF,SAJyB,OAAO,aAAa,aAAa,WAAW,QAE3B,UAEnB"}
1
+ {"version":3,"file":"index.js","names":["useHookFormContext","HookFormProvider","ReactFragment","Slot.Root"],"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"],"sourcesContent":["export 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 { isObject } from \"@zayne-labs/toolkit-type-helpers\";\nimport { createElement } from \"react\";\nimport type { FieldErrors, FieldValues } from \"react-hook-form\";\nimport { cnMerge } from \"@/lib/utils/cn\";\nimport type { FormErrorMessagePrimitiveProps, FormInputProps } from \"./form\";\nimport type { FormRootContextType, 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 === undefined || !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: FormRootContextType[\"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 { UnionDiscriminator } from \"@zayne-labs/toolkit-type-helpers\";\nimport {\n\tuseFormState,\n\tuseFormContext as useHookFormContext,\n\ttype Control,\n\ttype FieldValues,\n\ttype UseFormReturn,\n\ttype UseFormStateReturn,\n} from \"react-hook-form\";\nimport { getFieldErrorMessage } from \"./utils\";\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 FormRootContextType = {\n\twithEyeIcon: boolean | EyeIconObject | undefined;\n};\n\nexport const [LaxFormRootProvider, useLaxFormRootContext] = createCustomContext({\n\tdefaultValue: null as unknown as FormRootContextType,\n\thookName: \"useLaxFormRootContext\",\n\tname: \"LaxFormRootContext\",\n\tproviderName: \"FormRoot\",\n\tstrict: false,\n});\n\nexport type UseFormRootContextResult<TStrict extends boolean = true> =\n\tTStrict extends true ? UseFormReturn : UseFormReturn | null;\n\nexport const useFormMethodsContext = <TStrict extends boolean = true>(\n\toptions: { strict?: TStrict } = {}\n): UseFormRootContextResult<TStrict> => {\n\tconst { strict = true } = options;\n\n\tconst formContext = useHookFormContext();\n\n\t// eslint-disable-next-line ts-eslint/no-unnecessary-condition -- Allow\n\tif (strict && !formContext) {\n\t\tthrow new ContextError(\n\t\t\t`useFormMethodsContext 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 FieldContextType = {\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 const [StrictFormFieldProvider, useStrictFormFieldContext] = createCustomContext<FieldContextType>({\n\thookName: \"useFormFieldContext\",\n\tname: \"StrictFormFieldContext\",\n\tproviderName: \"FormField\",\n});\n\nexport const [LaxFormFieldProvider, useLaxFormFieldContext] = createCustomContext({\n\tdefaultValue: null as unknown as FieldContextType,\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\ntype FieldStateOptions<TFieldValues extends FieldValues, TTransformedValues = TFieldValues> =\n\t| {\n\t\t\tcontrol: Control<TFieldValues, unknown, TTransformedValues> | undefined;\n\t\t\tname?: string;\n\t }\n\t| {\n\t\t\tcontrol?: Control<TFieldValues, unknown, TTransformedValues>;\n\t\t\tname: string | undefined;\n\t };\n\nexport const useLaxFormFieldState = <TFieldValues extends FieldValues, TTransformedValues = TFieldValues>(\n\toptions?: FieldStateOptions<TFieldValues, TTransformedValues>\n): FieldState => {\n\tconst { control } = useFormMethodsContext({ strict: false }) ?? {};\n\tconst { name } = useLaxFormFieldContext() ?? {};\n\n\tconst resolvedControl = control ?? options?.control;\n\n\tconst getFormState =\n\t\t// eslint-disable-next-line react-hooks/hooks -- Ignore\n\t\tresolvedControl ? useFormState : ((() => ({})) as typeof useFormState);\n\n\t// eslint-disable-next-line react-hooks/hooks -- Ignore\n\tconst { disabled, errors } = getFormState({\n\t\tcontrol: resolvedControl as never,\n\t\tname: name ?? options?.name,\n\t});\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 { dataAttr, on, toArray } from \"@zayne-labs/toolkit-core\";\nimport { ContextError, useCallbackRef, useCompareValue, useToggle } from \"@zayne-labs/toolkit-react\";\nimport {\n\tcomposeRefs,\n\tcomposeTwoEventHandlers,\n\tgetMultipleSlots,\n\ttype DiscriminatedRenderItemProps,\n\ttype DiscriminatedRenderProps,\n\ttype InferProps,\n\ttype PolymorphicPropsStrict,\n} from \"@zayne-labs/toolkit-react/utils\";\nimport { defineEnum, isFunction, type AnyString } from \"@zayne-labs/toolkit-type-helpers\";\nimport { Fragment as ReactFragment, useEffect, useId, useMemo, useRef } from \"react\";\nimport {\n\tController,\n\tFormProvider as HookFormProvider,\n\tuseFormState,\n\tuseWatch,\n\ttype Control,\n\ttype ControllerProps,\n\ttype FieldPath,\n\ttype FieldValues,\n\ttype RegisterOptions,\n\ttype FormStateSubscribeProps as StateSubscribeProps,\n\ttype UseFormReturn,\n\ttype WatchProps,\n} from \"react-hook-form\";\nimport { ForWithWrapper } from \"@/components/common/for\";\nimport { Slot } from \"@/components/common/slot\";\nimport { cnMerge } from \"@/lib/utils/cn\";\nimport {\n\tLaxFormFieldProvider,\n\tLaxFormRootProvider,\n\tStrictFormFieldProvider,\n\tuseFormMethodsContext,\n\tuseLaxFormFieldContext,\n\tuseLaxFormFieldState,\n\tuseLaxFormRootContext,\n\tuseStrictFormFieldContext,\n\ttype FieldContextType,\n\ttype FieldState,\n\ttype FormRootContextType,\n} from \"./form-context\";\nimport { getEyeIcon, getFieldErrorMessage } from \"./utils\";\n\nexport type FormRootProps<TFieldValues extends FieldValues, TTransformedValues> = InferProps<\"form\">\n\t& Partial<FormRootContextType> & {\n\t\tchildren: React.ReactNode;\n\t\tform: UseFormReturn<TFieldValues, unknown, TTransformedValues>;\n\t};\n\nexport function FormRoot<TFieldValues extends FieldValues, TTransformedValues = TFieldValues>(\n\tprops: FormRootProps<TFieldValues, TTransformedValues>\n) {\n\tconst { children, className, form, withEyeIcon, ...restOfProps } = props;\n\n\tconst shallowedComparedWithEyeIcon = useCompareValue(withEyeIcon);\n\n\tconst formContextValue = useMemo(\n\t\t() => ({ withEyeIcon: shallowedComparedWithEyeIcon }),\n\t\t[shallowedComparedWithEyeIcon]\n\t);\n\n\treturn (\n\t\t<HookFormProvider {...form}>\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\nexport type FormFieldProps<\n\tTControl,\n\tTFieldValues extends FieldValues,\n\tTTransformedValues,\n> = (TControl extends Control<infer TValues> ?\n\t{\n\t\tcontrol?: never;\n\t\tname: FieldPath<TValues>;\n\t}\n:\t{\n\t\tcontrol?: Control<TFieldValues, unknown, TTransformedValues>;\n\t\tname: FieldPath<TFieldValues>;\n\t})\n\t& (\n\t\t| (InferProps<\"div\"> & { withWrapper?: true })\n\t\t| { children: React.ReactNode; className?: never; withWrapper: false }\n\t);\n\nexport function FormField<\n\tTControl,\n\tTFieldValues extends FieldValues = FieldValues,\n\tTTransformedValues = TFieldValues,\n>(props: FormFieldProps<TControl, TFieldValues, TTransformedValues>) {\n\tconst { children, className, control, name, withWrapper = true } = props;\n\n\tconst { isDisabled, isInvalid } = useLaxFormFieldState({ control, 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 FieldContextType,\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 gap-2\", 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\nexport type FormFieldWithControllerProps<\n\tTFieldValues extends FieldValues,\n\tTName extends FieldPath<TFieldValues>,\n\tTTransformedValues = TFieldValues,\n> = ControllerProps<TFieldValues, TName, TTransformedValues>;\n\nexport function FormFieldWithController<\n\tTFieldValues extends FieldValues,\n\tTName extends FieldPath<TFieldValues>,\n\tTTransformedValues = TFieldValues,\n>(props: FormFieldWithControllerProps<TFieldValues, TName, TTransformedValues>) {\n\tconst methodsContextValue = useFormMethodsContext({ strict: false });\n\n\tconst { control, name, render, ...restOfProps } = 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 FieldContextType,\n\t\t[name, uniqueId]\n\t);\n\n\tconst resolvedControl = control ?? methodsContextValue?.control;\n\n\tif (!resolvedControl) {\n\t\tthrow new ContextError(\n\t\t\t\"<Form.FormFieldWithController> must be provided with an explicit 'control' prop or used within <Form.Root>\"\n\t\t);\n\t}\n\n\treturn (\n\t\t<StrictFormFieldProvider value={fieldContextValue}>\n\t\t\t<LaxFormFieldProvider value={fieldContextValue}>\n\t\t\t\t<Controller\n\t\t\t\t\tcontrol={resolvedControl as never}\n\t\t\t\t\tname={name}\n\t\t\t\t\trender={render as never}\n\t\t\t\t\t{...(restOfProps as object)}\n\t\t\t\t/>\n\t\t\t</LaxFormFieldProvider>\n\t\t</StrictFormFieldProvider>\n\t);\n}\n\nexport type FormFieldBoundControllerProps<TFieldValues extends FieldValues, TTransformedValues> = Omit<\n\tControllerProps<TFieldValues, never, TTransformedValues>,\n\t\"control\" | \"name\"\n>;\n\nexport function FormFieldBoundController<\n\tTFieldValues extends FieldValues = Record<string, never>,\n\tTTransformedValues = TFieldValues,\n>(props: FormFieldBoundControllerProps<TFieldValues, TTransformedValues>) {\n\tconst { control } = useFormMethodsContext();\n\tconst { name } = useStrictFormFieldContext();\n\tconst { render, ...restOfProps } = props;\n\n\treturn (\n\t\t<Controller name={name} control={control} render={render as never} {...(restOfProps as object)} />\n\t);\n}\n\nexport type FormFieldContextProps = DiscriminatedRenderProps<\n\t(contextValue: FieldContextType) => React.ReactNode\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 type FormLabelProps = InferProps<\"label\">;\n\nexport function FormLabel(props: FormLabelProps) {\n\tconst fieldContextValues = useStrictFormFieldContext();\n\n\tconst { children, htmlFor, ...restOfProps } = props;\n\n\tconst { isDisabled, isInvalid } = useLaxFormFieldState({ name: fieldContextValues.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={Object.hasOwn(props, \"htmlFor\") ? htmlFor : fieldContextValues.formItemId}\n\t\t\t{...restOfProps}\n\t\t>\n\t\t\t{children}\n\t\t</label>\n\t);\n}\n\nexport type FormInputGroupProps = InferProps<\"div\">;\n\nexport function FormInputGroup(props: FormInputGroupProps) {\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\nexport type FormSideItemProps = {\n\tchildren?: React.ReactNode;\n\tclassName?: string;\n};\n\nexport function FormInputLeftItem<TElement extends React.ElementType = \"span\">(\n\tprops: PolymorphicPropsStrict<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: PolymorphicPropsStrict<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 RulesProp = {\n\trules?: RegisterOptions;\n};\n\nexport type FormInputPrimitiveProps<TFieldValues extends FieldValues> = Omit<\n\tInferProps<\"input\">,\n\t\"children\"\n>\n\t& RulesProp & {\n\t\tclassNames?: { error?: string; eyeIcon?: string; input?: string; inputGroup?: string };\n\t\tcontrol?: Control<TFieldValues>;\n\t\tfieldState?: FieldState;\n\t\tname?: FieldPath<TFieldValues>;\n\t\twithEyeIcon?: FormRootContextType[\"withEyeIcon\"];\n\t};\n\nexport type FormTextAreaPrimitiveProps<TFieldValues extends FieldValues> = InferProps<\"textarea\">\n\t& RulesProp & {\n\t\tclassNames?: { base?: string; error?: string };\n\t\tcontrol?: Control<TFieldValues>;\n\t\tfieldState?: FieldState;\n\t\tname?: FieldPath<TFieldValues>;\n\t};\n\nexport type FormSelectPrimitiveProps<TFieldValues extends FieldValues> = InferProps<\"select\">\n\t& RulesProp & {\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 inputTypesWithoutFullWidth = new Set<React.HTMLInputTypeAttribute>([\"checkbox\", \"radio\"]);\n\nexport function FormInputPrimitive<TFieldValues extends FieldValues>(\n\tprops: FormInputPrimitiveProps<TFieldValues>\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,\n\t\tname,\n\t\trules,\n\t\ttype = \"text\",\n\t\twithEyeIcon,\n\t\t...restOfProps\n\t} = props;\n\n\tconst resolvedWithEyeIcon = withEyeIcon ?? formRootContextValues?.withEyeIcon ?? true;\n\n\tconst fieldStateFromLaxFormField = useLaxFormFieldState({ control, name });\n\n\tconst { isDisabled, isInvalid } = fieldState ?? fieldStateFromLaxFormField;\n\n\tconst [isPasswordVisible, toggleIsPasswordVisible] = useToggle(false);\n\n\tconst shouldHaveEyeIcon = Boolean(resolvedWithEyeIcon) && type === \"password\";\n\n\tconst WrapperElement = shouldHaveEyeIcon ? FormInputGroup : ReactFragment;\n\n\tconst wrapperElementProps =\n\t\tshouldHaveEyeIcon\n\t\t&& ({\n\t\t\tclassName: cnMerge(\"w-full\", classNames?.inputGroup, isInvalid && classNames?.error),\n\t\t} satisfies InferProps<typeof FormInputGroup>);\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: resolvedWithEyeIcon,\n\t});\n\n\treturn (\n\t\t<WrapperElement {...wrapperElementProps}>\n\t\t\t<input\n\t\t\t\tdata-slot=\"form-input\"\n\t\t\t\tdata-scope=\"form\"\n\t\t\t\tdata-part=\"input\"\n\t\t\t\taria-describedby={\n\t\t\t\t\t!isInvalid ?\n\t\t\t\t\t\tfieldContextValues?.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={Object.hasOwn(props, \"id\") ? id : fieldContextValues?.formItemId}\n\t\t\t\tname={Object.hasOwn(props, \"name\") ? name : fieldContextValues?.name}\n\t\t\t\ttype={type === \"password\" && isPasswordVisible ? \"text\" : type}\n\t\t\t\tclassName={cnMerge(\n\t\t\t\t\t!inputTypesWithoutFullWidth.has(type) && \"w-full min-w-0\",\n\t\t\t\t\t`bg-transparent text-sm outline-hidden transition-[color,box-shadow] selection:bg-zu-primary\n\t\t\t\t\tselection:text-zu-primary-foreground file:inline-flex file:h-7 file:border-0\n\t\t\t\t\tfile:bg-transparent file:font-medium file:text-zu-foreground\n\t\t\t\t\tplaceholder:text-zu-muted-foreground focus-visible:outline-hidden\n\t\t\t\t\tdisabled:pointer-events-none 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={toggleIsPasswordVisible}\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>\n) {\n\tconst fieldContextValues = useLaxFormFieldContext();\n\n\tconst { className, classNames, control, fieldState, id, name, rules, ...restOfProps } = 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-slot=\"form-textarea\"\n\t\t\tdata-scope=\"form\"\n\t\t\tdata-part=\"textarea\"\n\t\t\taria-describedby={\n\t\t\t\t!isInvalid ?\n\t\t\t\t\tfieldContextValues?.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={Object.hasOwn(props, \"id\") ? id : fieldContextValues?.formItemId}\n\t\t\tname={Object.hasOwn(props, \"name\") ? name : fieldContextValues?.name}\n\t\t\tclassName={cnMerge(\n\t\t\t\t`w-full bg-transparent text-sm placeholder:text-zu-muted-foreground\n\t\t\t\tfocus-visible:outline-hidden 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>\n) {\n\tconst fieldContextValues = useLaxFormFieldContext();\n\n\tconst { className, classNames, control, fieldState, id, name, rules, ...restOfProps } = 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-slot=\"form-select\"\n\t\t\tdata-scope=\"form\"\n\t\t\tdata-part=\"select\"\n\t\t\taria-describedby={\n\t\t\t\t!isInvalid ?\n\t\t\t\t\tfieldContextValues?.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 ?? fieldContextValues?.formItemId}\n\t\t\tname={name ?? fieldContextValues?.name}\n\t\t\tclassName={cnMerge(\n\t\t\t\t`w-full bg-transparent text-sm placeholder:text-zu-muted-foreground\n\t\t\t\tfocus-visible:outline-hidden 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<FieldValues>, PrimitivePropsToOmit>;\n\nexport type FormTextAreaProps = Omit<FormTextAreaPrimitiveProps<FieldValues>, PrimitivePropsToOmit>;\n\nexport type FormSelectProps = Omit<FormSelectPrimitiveProps<FieldValues>, PrimitivePropsToOmit>;\n\nexport type FormInputCombinedProps =\n\t| (FormInputProps & { type?: FormInputProps[\"type\"] })\n\t| (FormSelectProps & { type: \"select\" })\n\t| (FormTextAreaProps & { type: \"textarea\" });\n\nconst InputTypeMap = defineEnum({\n\tselect: FormSelectPrimitive,\n\ttextarea: FormTextAreaPrimitive,\n});\n\nexport function FormInput(props: FormInputCombinedProps) {\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\tInputTypeMap[type as Exclude<typeof type, AnyString>]\n\t\t:\tFormInputPrimitive;\n\n\tconst registerProps = name ? register(name, rules) : null;\n\n\treturn (\n\t\t<SelectedInput\n\t\t\ttype={type}\n\t\t\tname={name}\n\t\t\t{...registerProps}\n\t\t\t{...(restOfProps as NonNullable<unknown>)}\n\t\t\t// eslint-disable-next-line react/refs -- Ignore\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 type FormDescriptionProps = InferProps<\"p\">;\n\nexport function FormDescription<TElement extends React.ElementType = \"p\">(\n\tprops: PolymorphicPropsStrict<TElement, FormDescriptionProps>\n) {\n\tconst { as: Element = \"p\", className, ...restOfProps } = props;\n\n\tconst { formDescriptionId } = useLaxFormFieldContext() ?? {};\n\n\treturn (\n\t\t<Element\n\t\t\tdata-slot=\"form-description\"\n\t\t\tdata-scope=\"form\"\n\t\t\tdata-part=\"description\"\n\t\t\tid={formDescriptionId}\n\t\t\tclassName={cnMerge(\"text-[12px]\", className)}\n\t\t\t{...restOfProps}\n\t\t/>\n\t);\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};\n\ntype ErrorMessageRenderState = {\n\terrorMessage: string;\n\terrorMessageArray: string[];\n\tindex: number;\n};\n\ntype ErrorMessageRenderFn = (context: {\n\tprops: ErrorMessageRenderProps;\n\tstate: ErrorMessageRenderState;\n}) => React.ReactNode;\n\nexport type FormErrorMessagePrimitiveProps<TFieldValues extends FieldValues> =\n\tDiscriminatedRenderItemProps<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 FormErrorMessagePrimitiveOverloadType = {\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: FormErrorMessagePrimitiveOverloadType = (props) => {\n\tconst methodsContextValues = useFormMethodsContext({ strict: false });\n\n\tconst {\n\t\tchildren,\n\t\tclassName,\n\t\tclassNames,\n\t\tcontrol,\n\t\tdisableErrorAnimation = false,\n\t\tdisableScrollToErrorField = false,\n\t\tfieldName,\n\t\trenderItem,\n\t\ttype = \"regular\",\n\t} = props;\n\n\tconst resolvedControl = control ?? methodsContextValues?.control;\n\n\tif (!resolvedControl) {\n\t\tthrow new ContextError(\n\t\t\t\"<Form.ErrorMessagePrimitive> must be provided with an explicit 'control' prop or used within <Form.Root>\"\n\t\t);\n\t}\n\n\tconst { errors } = useLaxFormFieldState({\n\t\tcontrol: resolvedControl as never,\n\t\tname: fieldName,\n\t});\n\n\tconst { formMessageId } = useLaxFormFieldContext() ?? {};\n\n\tconst containerRef = useRef<HTMLUListElement>(null);\n\n\tconst errorAnimationClass = classNames?.errorMessageAnimation ?? \"animate-shake\";\n\n\tconst getErrorElements = useCallbackRef(() => containerRef.current?.children ?? []);\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\tconst controller = new AbortController();\n\n\t\tfor (const element of errorMessageElements) {\n\t\t\telement.classList.add(errorAnimationClass);\n\n\t\t\tconst onAnimationEnd = () => element.classList.remove(errorAnimationClass);\n\n\t\t\ton(element, \"animationend\", onAnimationEnd, { once: true, signal: controller.signal });\n\t\t}\n\n\t\treturn () => {\n\t\t\tcontroller.abort();\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\tif (errorMessageElements.length === 0) return;\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\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// == Get the element's position and scroll in one frame\n\t\tconst frameID = requestAnimationFrame(() => {\n\t\t\tconst elementRect = firstErrorElement.getBoundingClientRect();\n\n\t\t\tif (elementRect.top === 0) return;\n\n\t\t\tconst topWithOffset = elementRect.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\n\t\treturn () => {\n\t\t\tcancelAnimationFrame(frameID);\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/* eslint-disable perfectionist/sort-objects -- Ignore */\n\t\t\t\"data-slot\": \"form-error-message\",\n\t\t\t\"data-part\": \"error-message\",\n\t\t\t\"data-scope\": \"form\",\n\t\t\t\"data-index\": index,\n\t\t\t/* eslint-enable perfectionist/sort-objects -- Ignore */\n\t\t\tid: formMessageId,\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 selectedChildren = typeof children === \"function\" ? children : renderItem;\n\n\treturn (\n\t\t<ForWithWrapper\n\t\t\tref={containerRef}\n\t\t\tclassName={cnMerge(\"flex flex-col\", classNames?.container)}\n\t\t\tdata-slot=\"form-error-message-container\"\n\t\t\tdata-scope=\"form\"\n\t\t\tdata-part=\"error-message-container\"\n\t\t\teach={errorMessageArray}\n\t\t\trenderItem={(errorMessage, index) => {\n\t\t\t\treturn selectedChildren({\n\t\t\t\t\tprops: getRenderProps({ index }),\n\t\t\t\t\tstate: getRenderState({ errorMessage, index }),\n\t\t\t\t});\n\t\t\t}}\n\t\t/>\n\t);\n};\n\nexport type FormErrorMessageProps<TControl, TFieldValues extends FieldValues, TTransformedValues> =\n\t| (TControl extends Control<infer TValues> ?\n\t\t\t{\n\t\t\t\tclassName?: string;\n\t\t\t\tcontrol?: never;\n\t\t\t\terrorField?: FieldPath<TValues>;\n\t\t\t\ttype?: \"regular\";\n\t\t\t}\n\t :\t{\n\t\t\t\tclassName?: string;\n\t\t\t\tcontrol?: Control<TFieldValues, unknown, TTransformedValues>; // == Here for type inference of errorField prop\n\t\t\t\terrorField?: FieldPath<TFieldValues>;\n\t\t\t\ttype?: \"regular\";\n\t\t\t})\n\t| {\n\t\t\tclassName?: string;\n\t\t\terrorField: string;\n\t\t\ttype: \"root\";\n\t };\n\nexport function FormErrorMessage<\n\tTControl,\n\tTFieldValues extends FieldValues = FieldValues,\n\tTTransformedValues = TFieldValues,\n>(props: FormErrorMessageProps<TControl, TFieldValues, TTransformedValues>) {\n\tconst fieldContextValues = useLaxFormFieldContext();\n\n\tconst { className, errorField, type = \"regular\" } = props;\n\n\tconst { control } = useFormMethodsContext();\n\n\treturn (\n\t\t<FormErrorMessagePrimitive\n\t\t\ttype={type as \"root\"}\n\t\t\tcontrol={control}\n\t\t\tfieldName={errorField ?? (fieldContextValues?.name as NonNullable<typeof errorField>)}\n\t\t\trenderItem={({ props: renderProps, state }) => (\n\t\t\t\t<li\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-zu-destructive\",\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</li>\n\t\t\t)}\n\t\t/>\n\t);\n}\n\nexport type FormSubmitProps<TFieldValues extends FieldValues, TTransformedValues> = Omit<\n\tInferProps<\"button\">,\n\t\"children\"\n> & {\n\tasChild?: boolean;\n} & (\n\t\t| {\n\t\t\t\tchildren: React.ReactNode;\n\t\t\t\tcontrol?: never;\n\t\t }\n\t\t| {\n\t\t\t\tchildren: StateSubscribeProps<TFieldValues, TTransformedValues>[\"render\"];\n\t\t\t\tcontrol?: Control<TFieldValues, unknown, TTransformedValues>;\n\t\t }\n\t);\n\nexport function FormSubmit<\n\tTElement extends React.ElementType = \"button\",\n\tTFieldValues extends FieldValues = Record<string, unknown>,\n\tTTransformedValues = TFieldValues,\n>(props: PolymorphicPropsStrict<TElement, FormSubmitProps<TFieldValues, TTransformedValues>>) {\n\tconst { as: Element = \"button\", asChild, children, control, type = \"submit\", ...restOfProps } = props;\n\n\tconst Component = asChild ? Slot.Root : Element;\n\n\tconst methodsContextValue = useFormMethodsContext({ strict: false });\n\n\tconst resolvedControl = control ?? methodsContextValue?.control;\n\n\tif (isFunction(children) && !resolvedControl) {\n\t\tthrow new ContextError(\n\t\t\t\"<Form.Submit> must be provided with an explicit 'control' prop or used within <Form.Root> if a render prop is passed as children\"\n\t\t);\n\t}\n\n\t// eslint-disable-next-line react-hooks/hooks -- Ignore for now\n\tconst getFormState = isFunction(children) && resolvedControl ? useFormState : () => ({}) as never;\n\n\t// eslint-disable-next-line react-hooks/hooks -- Ignore for now\n\tconst formState = getFormState<TFieldValues>({\n\t\tcontrol: resolvedControl as never,\n\t\tdisabled: restOfProps.disabled,\n\t});\n\n\tconst resolvedChildren = isFunction(children) ? children(formState) : children;\n\n\treturn (\n\t\t<Component data-slot=\"form-submit\" data-part=\"submit\" data-scope=\"form\" type={type} {...restOfProps}>\n\t\t\t{resolvedChildren}\n\t\t</Component>\n\t);\n}\n\nexport type FormWatchProps<\n\tTFieldValues extends FieldValues,\n\tTFieldName extends\n\t\t| Array<FieldPath<TFieldValues>>\n\t\t| FieldPath<TFieldValues>\n\t\t| ReadonlyArray<FieldPath<TFieldValues>>\n\t\t| undefined,\n\tTTransformedValues,\n\tTComputeValue,\n\tTComputedProps extends Omit<\n\t\tWatchProps<TFieldName, TFieldValues, unknown, TTransformedValues, TComputeValue>,\n\t\t\"names\"\n\t> = Omit<WatchProps<TFieldName, TFieldValues, unknown, TTransformedValues, TComputeValue>, \"names\">,\n> = DiscriminatedRenderProps<TComputedProps[\"render\"]> & Omit<TComputedProps, \"render\">;\n\nexport function FormWatch<\n\tTFieldValues extends FieldValues = Record<string, unknown>,\n\tconst TFieldName extends\n\t\t| Array<FieldPath<TFieldValues>>\n\t\t| FieldPath<TFieldValues>\n\t\t| ReadonlyArray<FieldPath<TFieldValues>>\n\t\t| undefined = FieldPath<TFieldValues>,\n\tTTransformedValues = TFieldValues,\n\tTComputeValue = undefined,\n>(props: FormWatchProps<TFieldValues, TFieldName, TTransformedValues, TComputeValue>) {\n\tconst fieldContextValue = useLaxFormFieldContext();\n\n\tconst { children, compute, control, defaultValue, disabled, exact, name, render } = props;\n\n\tconst methodsContextValue = useFormMethodsContext({ strict: false });\n\n\tconst resolvedControl = control ?? methodsContextValue?.control;\n\n\tif (!resolvedControl) {\n\t\tthrow new ContextError(\n\t\t\t\"<Form.Watch> must be provided with an explicit 'control' prop or used within <Form.Root>\"\n\t\t);\n\t}\n\n\tconst formValue = useWatch({\n\t\tcompute: compute as never,\n\t\tcontrol: resolvedControl as never,\n\t\tdefaultValue,\n\t\tdisabled,\n\t\texact,\n\t\tname: (name ?? fieldContextValue?.name) as string,\n\t}) as unknown;\n\n\tconst selectedChildren = typeof children === \"function\" ? children : render;\n\n\tconst resolvedChildren = selectedChildren(formValue as never);\n\n\treturn resolvedChildren;\n}\n\nexport type FormStateSubscribeProps<\n\tTFieldValues extends FieldValues,\n\tTTransformedValues,\n\tTComputedProps extends StateSubscribeProps<TFieldValues, TTransformedValues> = StateSubscribeProps<\n\t\tTFieldValues,\n\t\tTTransformedValues\n\t>,\n> = DiscriminatedRenderProps<TComputedProps[\"render\"]> & Omit<TComputedProps, \"render\">;\n\nexport function FormStateSubscribe<\n\tTFieldValues extends FieldValues = Record<string, unknown>,\n\tTTransformedValues = TFieldValues,\n>(props: FormStateSubscribeProps<TFieldValues, TTransformedValues>) {\n\tconst fieldContextValues = useLaxFormFieldContext();\n\n\tconst { children, control, disabled, exact, name, render } = props;\n\n\tconst methodsContextValue = useFormMethodsContext({ strict: false });\n\n\tconst resolvedControl = control ?? methodsContextValue?.control;\n\n\tif (!resolvedControl) {\n\t\tthrow new ContextError(\n\t\t\t\"<Form.StateSubscribe> must be provided with an explicit 'control' prop or used within <Form.Root>\"\n\t\t);\n\t}\n\n\tconst formState = useFormState({\n\t\tcontrol: resolvedControl as never,\n\t\tdisabled,\n\t\texact,\n\t\tname: name ?? (fieldContextValues?.name as never),\n\t});\n\n\tconst selectedChildren = typeof children === \"function\" ? children : render;\n\n\tconst resolvedChildren = selectedChildren(formState);\n\n\treturn resolvedChildren;\n}\n","export {\n\tFormDescription as Description,\n\tFormErrorMessage as ErrorMessage,\n\tFormErrorMessagePrimitive as ErrorMessagePrimitive,\n\tFormField as Field,\n\tFormFieldBoundController as FieldBoundController,\n\tFormFieldContext as FieldContext,\n\tFormFieldWithController as FieldWithController,\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\tFormStateSubscribe as StateSubscribe,\n\tFormSubmit as Submit,\n\tFormTextArea as TextArea,\n\tFormTextAreaPrimitive as TextAreaPrimitive,\n\tFormWatch as Watch,\n} from \"./form\";\n\nexport type {\n\tFormDescriptionProps,\n\tFormErrorMessagePrimitiveProps,\n\tFormErrorMessageProps,\n\tFormFieldBoundControllerProps,\n\tFormFieldContextProps,\n\tFormFieldProps,\n\tFormFieldWithControllerProps,\n\tFormInputCombinedProps,\n\tFormInputGroupProps,\n\tFormInputPrimitiveProps,\n\tFormInputProps,\n\tFormLabelProps,\n\tFormRootProps,\n\tFormSelectPrimitiveProps,\n\tFormSelectProps,\n\tFormSideItemProps,\n\tFormStateSubscribeProps,\n\tFormSubmitProps,\n\tFormTextAreaPrimitiveProps,\n\tFormTextAreaProps,\n\tFormWatchProps,\n} from \"./form\";\n"],"mappings":";;;;;;;;;;;;;AAAA,MAAa,iBAAiB,UAC7B,oBAAC,OAAD;CAAK,OAAM;CAA6B,OAAM;CAAM,QAAO;CAAM,SAAQ;CAAY,GAAI;WACxF,oBAAC,QAAD;EACC,MAAK;EACL,GAAE;CACF,CAAA;AACG,CAAA;AAGN,MAAa,eAAe,UAC3B,oBAAC,OAAD;CAAK,OAAM;CAA6B,OAAM;CAAM,QAAO;CAAM,SAAQ;CAAY,GAAI;WACxF,oBAAC,QAAD;EACC,MAAK;EACL,GAAE;CACF,CAAA;AACG,CAAA;;;ACPN,MAAa,wBAAwB,YAIO;CAC3C,MAAM,EAAE,QAAQ,WAAW,SAAS;CAEpC,IAAI,cAAc,KAAA,KAAa,CAAC,UAAU,OAAO,KAAK,MAAM,EAAE,WAAW,GAAG;CAE5E,IAAI,SAAS,QACZ,OAAO,OAAO,OAAO,YAAY;CAIlC,MAAM,YAAY,UAAU,SAAS,GAAG,IAAI,UAA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ACvB;AAWA,SAAgB,mBAGd,OAAkE;CACnE,MAAM,qBAAqB,uBAAuB;CAElD,MAAM,EAAE,UAAU,SAAS,UAAU,OAAO,MAAM,WAAW;CAE7D,MAAM,sBAAsB,sBAAsB,EAAE,QAAQ,MAAM,CAAC;CAEnE,MAAM,kBAAkB,WAAW,qBAAqB;CAExD,IAAI,CAAC,iBACJ,MAAM,IAAI,aACT,mGACD;CAGD,MAAM,YAAY,aAAa;EAC9B,SAAS;EACT;EACA;EACA,MAAM,QAAS,oBAAoB;CACpC,CAAC;CAMD,QAJyB,OAAO,aAAa,aAAa,WAAW,QAE3B,SAEpB;AACvB"}
package/dist/style.css CHANGED
@@ -1,4 +1,4 @@
1
- /*! tailwindcss v4.2.4 | MIT License | https://tailwindcss.com */
1
+ /*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
2
2
  @layer properties;
3
3
  @layer theme, base, components, utilities;
4
4
  @layer theme {
@@ -202,9 +202,6 @@
202
202
  .inset-y-0 {
203
203
  inset-block: calc(var(--spacing) * 0);
204
204
  }
205
- .end {
206
- inset-inline-end: var(--spacing);
207
- }
208
205
  .top-0 {
209
206
  top: calc(var(--spacing) * 0);
210
207
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zayne-labs/ui-react",
3
3
  "type": "module",
4
- "version": "0.11.10",
4
+ "version": "0.11.12",
5
5
  "description": "A composable UI/UI-utilities components library. ",
6
6
  "author": "Ryan Zayne",
7
7
  "license": "MIT",
@@ -30,11 +30,11 @@
30
30
  "node": ">=18.x"
31
31
  },
32
32
  "peerDependencies": {
33
- "react": "^19.2.5",
34
- "react-dom": "^19.2.5",
35
- "react-hook-form": "^7.75.0",
36
- "tailwind-merge": "^3.5.0",
37
- "tailwindcss": "^4.2.4"
33
+ "react": "^19.2.6",
34
+ "react-dom": "^19.2.6",
35
+ "react-hook-form": "^7.76.0",
36
+ "tailwind-merge": "^3.6.0",
37
+ "tailwindcss": "^4.3.0"
38
38
  },
39
39
  "peerDependenciesMeta": {
40
40
  "react-hook-form": {
@@ -45,34 +45,34 @@
45
45
  }
46
46
  },
47
47
  "dependencies": {
48
- "@zayne-labs/toolkit-core": "0.12.50",
49
- "@zayne-labs/toolkit-react": "0.12.50",
50
- "@zayne-labs/toolkit-type-helpers": "0.12.50"
48
+ "@zayne-labs/toolkit-core": "0.12.54",
49
+ "@zayne-labs/toolkit-react": "0.12.54",
50
+ "@zayne-labs/toolkit-type-helpers": "0.12.54"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@arethetypeswrong/cli": "0.18.2",
54
54
  "@size-limit/esbuild-why": "12.1.0",
55
55
  "@size-limit/preset-small-lib": "12.1.0",
56
- "@tailwindcss/cli": "4.2.4",
56
+ "@tailwindcss/cli": "4.3.0",
57
57
  "@total-typescript/ts-reset": "0.6.1",
58
58
  "@types/react": "19.2.14",
59
59
  "@types/react-dom": "19.2.3",
60
- "@zayne-labs/prettier-config": "0.13.11",
61
- "@zayne-labs/tsconfig": "0.13.11",
60
+ "@zayne-labs/prettier-config": "0.13.12",
61
+ "@zayne-labs/tsconfig": "0.13.12",
62
62
  "concurrently": "9.2.1",
63
63
  "cross-env": "10.1.0",
64
64
  "prettier": "3.8.3",
65
65
  "prettier-plugin-classnames": "0.10.1",
66
66
  "prettier-plugin-merge": "0.10.1",
67
67
  "prettier-plugin-tailwindcss": "0.8.0",
68
- "publint": "0.3.18",
69
- "react": "^19.2.5",
70
- "react-dom": "^19.2.5",
71
- "react-hook-form": "^7.75.0",
68
+ "publint": "0.3.21",
69
+ "react": "^19.2.6",
70
+ "react-dom": "^19.2.6",
71
+ "react-hook-form": "^7.76.0",
72
72
  "size-limit": "12.1.0",
73
- "tailwind-merge": "^3.5.0",
74
- "tailwindcss": "^4.2.4",
75
- "tsdown": "0.21.10",
73
+ "tailwind-merge": "^3.6.0",
74
+ "tailwindcss": "^4.3.0",
75
+ "tsdown": "0.22.0",
76
76
  "typescript": "6.0.3"
77
77
  },
78
78
  "publishConfig": {