@zayne-labs/ui-react 0.10.41 → 0.10.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/common/await/index.d.ts +6 -6
- package/dist/esm/common/client-gate/index.d.ts +2 -2
- package/dist/esm/common/error-boundary/index.d.ts +1 -1
- package/dist/esm/common/for/index.d.ts +3 -3
- package/dist/esm/common/presence/index.d.ts +2 -2
- package/dist/esm/common/show/index.d.ts +4 -4
- package/dist/esm/common/slot/index.d.ts +4 -4
- package/dist/esm/common/suspense-with-boundary/index.d.ts +2 -2
- package/dist/esm/common/teleport/index.d.ts +2 -2
- package/dist/esm/{index-ClrHf6FU.d.ts → index-ByKLVvSM.d.ts} +3 -3
- package/dist/esm/{index-U3_Q7EUG.d.ts → index-C5INi_2l.d.ts} +4 -4
- package/dist/esm/ui/card/index.d.ts +8 -8
- package/dist/esm/ui/carousel/index.d.ts +9 -9
- package/dist/esm/ui/drop-zone/index.d.ts +16 -16
- package/dist/esm/ui/form/index.d.ts +23 -25
- package/dist/esm/ui/form/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as ErrorBoundaryProps } from "../../index-
|
|
2
|
-
import { n as SuspenseWithBoundaryProps } from "../../index-
|
|
1
|
+
import { a as ErrorBoundaryProps } from "../../index-ByKLVvSM.js";
|
|
2
|
+
import { n as SuspenseWithBoundaryProps } from "../../index-C5INi_2l.js";
|
|
3
3
|
import { GetSlotComponentProps } from "@zayne-labs/toolkit-react/utils";
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
4
|
+
import * as react21 from "react";
|
|
5
|
+
import * as react_jsx_runtime20 from "react/jsx-runtime";
|
|
6
6
|
|
|
7
7
|
//#region src/components/common/await/await.d.ts
|
|
8
8
|
type RenderPropFn<TValue> = (result: TValue) => React.ReactNode;
|
|
@@ -14,9 +14,9 @@ type AwaitRootProps<TValue> = Pick<SuspenseWithBoundaryProps, "errorFallback" |
|
|
|
14
14
|
withErrorBoundary?: boolean;
|
|
15
15
|
withSuspense?: boolean;
|
|
16
16
|
};
|
|
17
|
-
declare function AwaitRoot<TValue>(props: AwaitRootProps<TValue>):
|
|
17
|
+
declare function AwaitRoot<TValue>(props: AwaitRootProps<TValue>): react_jsx_runtime20.JSX.Element;
|
|
18
18
|
type AwaitSuccessProps<TValue = unknown> = GetSlotComponentProps<"default", ChildrenType<TValue>>;
|
|
19
|
-
declare function AwaitSuccess<TPromiseOrValue, TValue = Awaited<TPromiseOrValue>>(props: Pick<AwaitSuccessProps<TValue>, "children">):
|
|
19
|
+
declare function AwaitSuccess<TPromiseOrValue, TValue = Awaited<TPromiseOrValue>>(props: Pick<AwaitSuccessProps<TValue>, "children">): react21.ReactNode;
|
|
20
20
|
type AwaitErrorProps = GetSlotComponentProps<"error", ErrorBoundaryProps["fallback"]>;
|
|
21
21
|
declare const AwaitError: {
|
|
22
22
|
(props: Pick<AwaitErrorProps, "children"> & {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react13 from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/components/common/client-gate/client-gate.d.ts
|
|
4
4
|
type ClientGateProps = {
|
|
@@ -27,7 +27,7 @@ type ClientGateProps = {
|
|
|
27
27
|
* );
|
|
28
28
|
* ```
|
|
29
29
|
*/
|
|
30
|
-
declare function ClientGate(props: ClientGateProps):
|
|
30
|
+
declare function ClientGate(props: ClientGateProps): react13.ReactNode;
|
|
31
31
|
//#endregion
|
|
32
32
|
export { ClientGate };
|
|
33
33
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as ErrorBoundaryProps, i as ErrorBoundary, n as ErrorBoundaryContextType, o as FallbackProps, r as useErrorBoundaryContext, t as useErrorBoundary } from "../../index-
|
|
1
|
+
import { a as ErrorBoundaryProps, i as ErrorBoundary, n as ErrorBoundaryContextType, o as FallbackProps, r as useErrorBoundaryContext, t as useErrorBoundary } from "../../index-ByKLVvSM.js";
|
|
2
2
|
export { ErrorBoundary, ErrorBoundaryContextType, ErrorBoundaryProps, FallbackProps, useErrorBoundary, useErrorBoundaryContext };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DiscriminatedRenderItemProps, PolymorphicPropsStrict } from "@zayne-labs/toolkit-react/utils";
|
|
2
2
|
import { Prettify } from "@zayne-labs/toolkit-type-helpers";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react0 from "react";
|
|
4
4
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
5
|
|
|
6
6
|
//#region src/components/common/for/for.d.ts
|
|
@@ -12,10 +12,10 @@ type ForProps<TArray extends ArrayOrNumber> = Prettify<{
|
|
|
12
12
|
each: TArray;
|
|
13
13
|
fallback?: React.ReactNode;
|
|
14
14
|
} & ForRenderProps<TArray>>;
|
|
15
|
-
declare function For<const TArray extends ArrayOrNumber>(props: ForProps<TArray>): string | number | bigint | boolean |
|
|
15
|
+
declare function For<const TArray extends ArrayOrNumber>(props: ForProps<TArray>): string | number | bigint | boolean | react0.ReactElement<unknown, string | react0.JSXElementConstructor<any>> | Iterable<react0.ReactNode> | Promise<string | number | bigint | boolean | react0.ReactPortal | react0.ReactElement<unknown, string | react0.JSXElementConstructor<any>> | Iterable<react0.ReactNode> | null | undefined> | null;
|
|
16
16
|
declare function ForWithWrapper<const TArray extends ArrayOrNumber, TElement extends React.ElementType = "ul">(props: PolymorphicPropsStrict<TElement, ForProps<TArray>> & {
|
|
17
17
|
displayFallBackWhenEmpty?: boolean;
|
|
18
|
-
}): string | number | bigint | boolean | react_jsx_runtime0.JSX.Element | Iterable<
|
|
18
|
+
}): string | number | bigint | boolean | react_jsx_runtime0.JSX.Element | Iterable<react0.ReactNode> | Promise<string | number | bigint | boolean | react0.ReactPortal | react0.ReactElement<unknown, string | react0.JSXElementConstructor<any>> | Iterable<react0.ReactNode> | null | undefined> | null;
|
|
19
19
|
//#endregion
|
|
20
20
|
//#region src/components/common/for/getElementList.d.ts
|
|
21
21
|
type GetElementListResult<TVariant extends "base" | "withWrapper"> = TVariant extends "base" ? [typeof For] : [typeof ForWithWrapper];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InferProps } from "@zayne-labs/toolkit-react/utils";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/common/presence/use-presence.d.ts
|
|
5
5
|
type UsePresenceOptions = {
|
|
@@ -30,7 +30,7 @@ type PresenceProps = UsePresenceOptions & {
|
|
|
30
30
|
className?: string;
|
|
31
31
|
forceMount?: boolean;
|
|
32
32
|
};
|
|
33
|
-
declare function Presence(props: PresenceProps):
|
|
33
|
+
declare function Presence(props: PresenceProps): react_jsx_runtime2.JSX.Element | null;
|
|
34
34
|
//#endregion
|
|
35
35
|
export { Presence };
|
|
36
36
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react26 from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/components/common/show/show.d.ts
|
|
4
4
|
type ShowProps<TWhen> = {
|
|
@@ -12,15 +12,15 @@ type ShowProps<TWhen> = {
|
|
|
12
12
|
fallback?: React.ReactNode;
|
|
13
13
|
when: false | TWhen | null | undefined;
|
|
14
14
|
};
|
|
15
|
-
declare function ShowRoot<TWhen>(props: ShowProps<TWhen>): string | number | bigint | boolean |
|
|
15
|
+
declare function ShowRoot<TWhen>(props: ShowProps<TWhen>): string | number | bigint | boolean | react26.ReactElement<unknown, string | react26.JSXElementConstructor<any>> | Iterable<react26.ReactNode> | Promise<string | number | bigint | boolean | react26.ReactPortal | react26.ReactElement<unknown, string | react26.JSXElementConstructor<any>> | Iterable<react26.ReactNode> | null | undefined> | null;
|
|
16
16
|
type ShowContentProps<TWhen> = Pick<ShowProps<TWhen>, "children" | "when">;
|
|
17
|
-
declare function ShowContent<TWhen>(props: ShowContentProps<TWhen>):
|
|
17
|
+
declare function ShowContent<TWhen>(props: ShowContentProps<TWhen>): react26.ReactNode;
|
|
18
18
|
declare namespace ShowContent {
|
|
19
19
|
var slotSymbol: symbol;
|
|
20
20
|
}
|
|
21
21
|
declare function ShowFallback(props: {
|
|
22
22
|
children: React.ReactNode;
|
|
23
|
-
}):
|
|
23
|
+
}): react26.ReactNode;
|
|
24
24
|
declare namespace ShowFallback {
|
|
25
25
|
var slotSymbol: symbol;
|
|
26
26
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { InferProps } from "@zayne-labs/toolkit-react/utils";
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
2
|
+
import * as react0 from "react";
|
|
3
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/components/common/slot/slot.d.ts
|
|
6
6
|
type SlotProps = InferProps<HTMLElement> & {
|
|
7
7
|
ref?: React.Ref<HTMLElement>;
|
|
8
8
|
};
|
|
9
|
-
declare function SlotRoot(props: SlotProps):
|
|
9
|
+
declare function SlotRoot(props: SlotProps): react_jsx_runtime0.JSX.Element | null;
|
|
10
10
|
declare function SlotSlottable({
|
|
11
11
|
children
|
|
12
|
-
}: Pick<SlotProps, "children">):
|
|
12
|
+
}: Pick<SlotProps, "children">): react0.ReactNode;
|
|
13
13
|
declare namespace slot_parts_d_exports {
|
|
14
14
|
export { SlotRoot as Root, SlotSlottable as Slottable };
|
|
15
15
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "../../index-
|
|
2
|
-
import { n as SuspenseWithBoundaryProps, t as SuspenseWithBoundary } from "../../index-
|
|
1
|
+
import "../../index-ByKLVvSM.js";
|
|
2
|
+
import { n as SuspenseWithBoundaryProps, t as SuspenseWithBoundary } from "../../index-C5INi_2l.js";
|
|
3
3
|
export { SuspenseWithBoundary, SuspenseWithBoundaryProps };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AnyString } from "@zayne-labs/toolkit-type-helpers";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react14 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/common/teleport/teleport.d.ts
|
|
5
5
|
type ValidHtmlTags = keyof HTMLElementTagNameMap;
|
|
@@ -8,7 +8,7 @@ type PortalProps = {
|
|
|
8
8
|
insertPosition?: InsertPosition;
|
|
9
9
|
to: AnyString | HTMLElement | ValidHtmlTags | null;
|
|
10
10
|
};
|
|
11
|
-
declare function Teleport(props: PortalProps):
|
|
11
|
+
declare function Teleport(props: PortalProps): react14.ReactPortal | null;
|
|
12
12
|
//#endregion
|
|
13
13
|
export { Teleport };
|
|
14
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react12 from "react";
|
|
2
2
|
import { Component } from "react";
|
|
3
3
|
import * as _zayne_labs_toolkit_react0 from "@zayne-labs/toolkit-react";
|
|
4
4
|
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
@@ -58,7 +58,7 @@ type ErrorBoundaryContextType = {
|
|
|
58
58
|
hasError: boolean;
|
|
59
59
|
resetErrorBoundary: (...args: unknown[]) => void;
|
|
60
60
|
};
|
|
61
|
-
declare const ErrorBoundaryContext:
|
|
61
|
+
declare const ErrorBoundaryContext: react12.Context<ErrorBoundaryContextType>, useErrorBoundaryContext: _zayne_labs_toolkit_react0.UseCustomContext<ErrorBoundaryContextType, true>;
|
|
62
62
|
//#endregion
|
|
63
63
|
//#region src/components/common/error-boundary/useErrorBoundary.d.ts
|
|
64
64
|
declare const useErrorBoundary: <TError extends Error>() => {
|
|
@@ -67,4 +67,4 @@ declare const useErrorBoundary: <TError extends Error>() => {
|
|
|
67
67
|
};
|
|
68
68
|
//#endregion
|
|
69
69
|
export { ErrorBoundaryProps as a, ErrorBoundary as i, ErrorBoundaryContextType as n, FallbackProps as o, useErrorBoundaryContext as r, useErrorBoundary as t };
|
|
70
|
-
//# sourceMappingURL=index-
|
|
70
|
+
//# sourceMappingURL=index-ByKLVvSM.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as ErrorBoundaryProps } from "./index-
|
|
2
|
-
import * as
|
|
1
|
+
import { a as ErrorBoundaryProps } from "./index-ByKLVvSM.js";
|
|
2
|
+
import * as react_jsx_runtime36 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/common/suspense-with-boundary/suspense-with-boundary.d.ts
|
|
5
5
|
type SuspenseWithBoundaryProps = {
|
|
@@ -7,7 +7,7 @@ type SuspenseWithBoundaryProps = {
|
|
|
7
7
|
errorFallback?: ErrorBoundaryProps["fallback"];
|
|
8
8
|
fallback?: React.ReactNode;
|
|
9
9
|
};
|
|
10
|
-
declare function SuspenseWithBoundary(props: SuspenseWithBoundaryProps):
|
|
10
|
+
declare function SuspenseWithBoundary(props: SuspenseWithBoundaryProps): react_jsx_runtime36.JSX.Element;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { SuspenseWithBoundaryProps as n, SuspenseWithBoundary as t };
|
|
13
|
-
//# sourceMappingURL=index-
|
|
13
|
+
//# sourceMappingURL=index-C5INi_2l.d.ts.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { PolymorphicProps } from "@zayne-labs/toolkit-react/utils";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime29 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/ui/card/card.d.ts
|
|
5
|
-
declare function CardRoot<TElement extends React.ElementType = "article">(props: PolymorphicProps<TElement>):
|
|
6
|
-
declare function CardHeader<TElement extends React.ElementType = "header">(props: PolymorphicProps<TElement>):
|
|
7
|
-
declare function CardTitle<TElement extends React.ElementType = "h3">(props: PolymorphicProps<TElement>):
|
|
8
|
-
declare function CardDescription<TElement extends React.ElementType = "p">(props: PolymorphicProps<TElement>):
|
|
9
|
-
declare function CardContent<TElement extends React.ElementType = "div">(props: PolymorphicProps<TElement>):
|
|
10
|
-
declare function CardAction<TElement extends React.ElementType = "div">(props: PolymorphicProps<TElement>):
|
|
5
|
+
declare function CardRoot<TElement extends React.ElementType = "article">(props: PolymorphicProps<TElement>): react_jsx_runtime29.JSX.Element;
|
|
6
|
+
declare function CardHeader<TElement extends React.ElementType = "header">(props: PolymorphicProps<TElement>): react_jsx_runtime29.JSX.Element;
|
|
7
|
+
declare function CardTitle<TElement extends React.ElementType = "h3">(props: PolymorphicProps<TElement>): react_jsx_runtime29.JSX.Element;
|
|
8
|
+
declare function CardDescription<TElement extends React.ElementType = "p">(props: PolymorphicProps<TElement>): react_jsx_runtime29.JSX.Element;
|
|
9
|
+
declare function CardContent<TElement extends React.ElementType = "div">(props: PolymorphicProps<TElement>): react_jsx_runtime29.JSX.Element;
|
|
10
|
+
declare function CardAction<TElement extends React.ElementType = "div">(props: PolymorphicProps<TElement>): react_jsx_runtime29.JSX.Element;
|
|
11
11
|
declare function CardFooter<TElement extends React.ElementType = "footer">(props: PolymorphicProps<TElement, {
|
|
12
12
|
asChild?: boolean;
|
|
13
|
-
}>):
|
|
13
|
+
}>): react_jsx_runtime29.JSX.Element;
|
|
14
14
|
declare namespace card_parts_d_exports {
|
|
15
15
|
export { CardAction as Action, CardContent as Content, CardDescription as Description, CardFooter as Footer, CardHeader as Header, CardRoot as Root, CardTitle as Title };
|
|
16
16
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PolymorphicPropsStrict } from "@zayne-labs/toolkit-react/utils";
|
|
2
2
|
import { UnionDiscriminator } from "@zayne-labs/toolkit-type-helpers";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime21 from "react/jsx-runtime";
|
|
4
4
|
import { StoreApi } from "@zayne-labs/toolkit-core";
|
|
5
5
|
|
|
6
6
|
//#region src/components/ui/carousel/types.d.ts
|
|
@@ -78,14 +78,14 @@ type OtherCarouselProps = {
|
|
|
78
78
|
};
|
|
79
79
|
//#endregion
|
|
80
80
|
//#region src/components/ui/carousel/carousel.d.ts
|
|
81
|
-
declare function CarouselRoot<TImages extends ImagesType, TElement extends React.ElementType = "div">(props: PolymorphicPropsStrict<TElement, CarouselRootProps<TImages>>):
|
|
82
|
-
declare function CarouselButton(props: CarouselButtonsProps):
|
|
83
|
-
declare function CarouselControls(props: CarouselControlProps):
|
|
84
|
-
declare function CarouselItemList<TArray extends unknown[]>(props: CarouselWrapperProps<TArray[number]>):
|
|
85
|
-
declare function CarouselItem(props: OtherCarouselProps):
|
|
86
|
-
declare function CarouselCaption<TElement extends React.ElementType = "div">(props: PolymorphicPropsStrict<TElement, OtherCarouselProps>):
|
|
87
|
-
declare function CarouselIndicatorList<TArray extends unknown[]>(props: CarouselWrapperProps<TArray[number]>):
|
|
88
|
-
declare function CarouselIndicator(props: CarouselIndicatorProps):
|
|
81
|
+
declare function CarouselRoot<TImages extends ImagesType, TElement extends React.ElementType = "div">(props: PolymorphicPropsStrict<TElement, CarouselRootProps<TImages>>): react_jsx_runtime21.JSX.Element;
|
|
82
|
+
declare function CarouselButton(props: CarouselButtonsProps): react_jsx_runtime21.JSX.Element;
|
|
83
|
+
declare function CarouselControls(props: CarouselControlProps): react_jsx_runtime21.JSX.Element;
|
|
84
|
+
declare function CarouselItemList<TArray extends unknown[]>(props: CarouselWrapperProps<TArray[number]>): react_jsx_runtime21.JSX.Element;
|
|
85
|
+
declare function CarouselItem(props: OtherCarouselProps): react_jsx_runtime21.JSX.Element;
|
|
86
|
+
declare function CarouselCaption<TElement extends React.ElementType = "div">(props: PolymorphicPropsStrict<TElement, OtherCarouselProps>): react_jsx_runtime21.JSX.Element;
|
|
87
|
+
declare function CarouselIndicatorList<TArray extends unknown[]>(props: CarouselWrapperProps<TArray[number]>): react_jsx_runtime21.JSX.Element;
|
|
88
|
+
declare function CarouselIndicator(props: CarouselIndicatorProps): react_jsx_runtime21.JSX.Element;
|
|
89
89
|
declare namespace carousel_parts_d_exports {
|
|
90
90
|
export { CarouselButton as Button, CarouselCaption as Caption, CarouselControls as Controls, CarouselIndicator as Indicator, CarouselIndicatorList as IndicatorList, CarouselItem as Item, CarouselItemList as ItemList, CarouselRoot as Root };
|
|
91
91
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { InferProps, PolymorphicPropsStrict } from "@zayne-labs/toolkit-react/utils";
|
|
2
2
|
import * as _zayne_labs_toolkit_type_helpers0 from "@zayne-labs/toolkit-type-helpers";
|
|
3
3
|
import { Awaitable, SelectorFn } from "@zayne-labs/toolkit-type-helpers";
|
|
4
|
-
import * as
|
|
4
|
+
import * as react36 from "react";
|
|
5
5
|
import "@zayne-labs/toolkit-react";
|
|
6
|
-
import * as
|
|
6
|
+
import * as react_jsx_runtime37 from "react/jsx-runtime";
|
|
7
7
|
import * as _zayne_labs_toolkit_core1 from "@zayne-labs/toolkit-core";
|
|
8
8
|
import { FileMeta, FileOrFileMeta, FileValidationErrorContextEach, FileValidationHooksAsync, FileValidationSettingsAsync } from "@zayne-labs/toolkit-core";
|
|
9
9
|
|
|
@@ -223,7 +223,7 @@ interface UseDropZoneProps extends FileValidationSettingsAsync {
|
|
|
223
223
|
declare const DropZoneStoreContextProvider: (props: {
|
|
224
224
|
children: React.ReactNode;
|
|
225
225
|
store: _zayne_labs_toolkit_core1.StoreApi<DropZoneStore>;
|
|
226
|
-
}) =>
|
|
226
|
+
}) => react36.FunctionComponentElement<react36.ProviderProps<_zayne_labs_toolkit_core1.StoreApi<DropZoneStore>>>, useDropZoneStoreContext: <TResult = DropZoneStore>(selector?: _zayne_labs_toolkit_type_helpers0.SelectorFn<DropZoneStore, TResult> | undefined) => TResult;
|
|
227
227
|
type FileItemContextType = {
|
|
228
228
|
fileState: FileState;
|
|
229
229
|
};
|
|
@@ -232,29 +232,29 @@ type FileItemContextType = {
|
|
|
232
232
|
type DropZoneRootProps = UseDropZoneProps & {
|
|
233
233
|
children: React.ReactNode;
|
|
234
234
|
};
|
|
235
|
-
declare function DropZoneRoot(props: DropZoneRootProps):
|
|
235
|
+
declare function DropZoneRoot(props: DropZoneRootProps): react_jsx_runtime37.JSX.Element;
|
|
236
236
|
type DropZoneContextProps<TSlice> = {
|
|
237
237
|
children: React.ReactNode | ((context: TSlice) => React.ReactNode);
|
|
238
238
|
selector?: SelectorFn<DropZoneStore, TSlice>;
|
|
239
239
|
};
|
|
240
|
-
declare function DropZoneContext<TSlice = DropZoneStore>(props: DropZoneContextProps<TSlice>):
|
|
240
|
+
declare function DropZoneContext<TSlice = DropZoneStore>(props: DropZoneContextProps<TSlice>): react36.ReactNode;
|
|
241
241
|
type DropZoneContainerProps = PartInputProps["container"] & {
|
|
242
242
|
asChild?: boolean;
|
|
243
243
|
};
|
|
244
|
-
declare function DropZoneContainer<TElement extends React.ElementType = "div">(props: PolymorphicPropsStrict<TElement, DropZoneContainerProps>):
|
|
244
|
+
declare function DropZoneContainer<TElement extends React.ElementType = "div">(props: PolymorphicPropsStrict<TElement, DropZoneContainerProps>): react_jsx_runtime37.JSX.Element;
|
|
245
245
|
type DropZoneInputProps = PartInputProps["input"] & {
|
|
246
246
|
asChild?: boolean;
|
|
247
247
|
};
|
|
248
|
-
declare function DropZoneInput(props: DropZoneInputProps):
|
|
248
|
+
declare function DropZoneInput(props: DropZoneInputProps): react_jsx_runtime37.JSX.Element;
|
|
249
249
|
type DropZoneAreaProps<TSlice> = DropZoneContextProps<TSlice> & PartInputProps["container"] & {
|
|
250
250
|
classNames?: Partial<Record<Extract<keyof PartInputProps, "container" | "input">, string>>;
|
|
251
251
|
extraProps?: Partial<Pick<PartInputProps, "container" | "input">>;
|
|
252
252
|
};
|
|
253
|
-
declare function DropZoneArea<TSlice = DropZoneStore>(props: DropZoneAreaProps<TSlice>):
|
|
253
|
+
declare function DropZoneArea<TSlice = DropZoneStore>(props: DropZoneAreaProps<TSlice>): react_jsx_runtime37.JSX.Element;
|
|
254
254
|
type DropZoneTriggerProps = PartInputProps["trigger"] & {
|
|
255
255
|
asChild?: boolean;
|
|
256
256
|
};
|
|
257
|
-
declare function DropZoneTrigger(props: DropZoneTriggerProps):
|
|
257
|
+
declare function DropZoneTrigger(props: DropZoneTriggerProps): react_jsx_runtime37.JSX.Element;
|
|
258
258
|
type ListPerItemContext = Pick<DropZoneStore, "actions"> & {
|
|
259
259
|
array: DropZoneStore["fileStateArray"];
|
|
260
260
|
fileState: DropZoneStore["fileStateArray"][number];
|
|
@@ -273,21 +273,21 @@ type DropZoneFileListProps = Omit<PartInputProps["fileList"], "children"> & {
|
|
|
273
273
|
asChild?: boolean;
|
|
274
274
|
forceMount?: boolean;
|
|
275
275
|
} & (FileListManualListVariant | FileListPerItemVariant);
|
|
276
|
-
declare function DropZoneFileList<TElement extends React.ElementType = "ul">(props: PolymorphicPropsStrict<TElement, DropZoneFileListProps>):
|
|
276
|
+
declare function DropZoneFileList<TElement extends React.ElementType = "ul">(props: PolymorphicPropsStrict<TElement, DropZoneFileListProps>): react_jsx_runtime37.JSX.Element;
|
|
277
277
|
type DropZoneFileItemProps = FileItemContextType & PartInputProps["fileItem"] & {
|
|
278
278
|
asChild?: boolean;
|
|
279
279
|
};
|
|
280
|
-
declare function DropZoneFileItem<TElement extends React.ElementType = "li">(props: PolymorphicPropsStrict<TElement, DropZoneFileItemProps>):
|
|
280
|
+
declare function DropZoneFileItem<TElement extends React.ElementType = "li">(props: PolymorphicPropsStrict<TElement, DropZoneFileItemProps>): react_jsx_runtime37.JSX.Element;
|
|
281
281
|
type DropZoneFileItemDeleteProps = PartInputProps["fileItemDelete"] & {
|
|
282
282
|
asChild?: boolean;
|
|
283
283
|
};
|
|
284
|
-
declare function DropZoneFileItemDelete(props: DropZoneFileItemDeleteProps):
|
|
284
|
+
declare function DropZoneFileItemDelete(props: DropZoneFileItemDeleteProps): react_jsx_runtime37.JSX.Element;
|
|
285
285
|
type DropZoneFileItemProgressProps = PartInputProps["fileItemProgress"] & {
|
|
286
286
|
asChild?: boolean;
|
|
287
287
|
forceMount?: boolean;
|
|
288
288
|
size?: number;
|
|
289
289
|
};
|
|
290
|
-
declare function DropZoneFileItemProgress<TElement extends React.ElementType = "span">(props: PolymorphicPropsStrict<TElement, DropZoneFileItemProgressProps>):
|
|
290
|
+
declare function DropZoneFileItemProgress<TElement extends React.ElementType = "span">(props: PolymorphicPropsStrict<TElement, DropZoneFileItemProgressProps>): react_jsx_runtime37.JSX.Element | null;
|
|
291
291
|
type RenderPreviewDetails<TElement extends React.ElementType = "svg"> = {
|
|
292
292
|
node?: React.ReactNode;
|
|
293
293
|
} & {
|
|
@@ -316,7 +316,7 @@ type DropZoneFileItemPreviewProps = Omit<PartInputProps["fileItemPreview"], "chi
|
|
|
316
316
|
}) => React.ReactNode);
|
|
317
317
|
renderPreview?: boolean | RenderPreview;
|
|
318
318
|
};
|
|
319
|
-
declare function DropZoneFileItemPreview<TElement extends React.ElementType>(props: PolymorphicPropsStrict<TElement, DropZoneFileItemPreviewProps>):
|
|
319
|
+
declare function DropZoneFileItemPreview<TElement extends React.ElementType>(props: PolymorphicPropsStrict<TElement, DropZoneFileItemPreviewProps>): react_jsx_runtime37.JSX.Element | null;
|
|
320
320
|
type DropZoneFileItemMetadataProps = Omit<PartInputProps["fileItemMetadata"], "children"> & Partial<Pick<FileItemContextType, "fileState">> & {
|
|
321
321
|
asChild?: boolean;
|
|
322
322
|
children?: React.ReactNode | ((context: Pick<FileItemContextType, "fileState">) => React.ReactNode);
|
|
@@ -326,12 +326,12 @@ type DropZoneFileItemMetadataProps = Omit<PartInputProps["fileItemMetadata"], "c
|
|
|
326
326
|
};
|
|
327
327
|
size?: "default" | "sm";
|
|
328
328
|
};
|
|
329
|
-
declare function DropZoneFileItemMetadata(props: DropZoneFileItemMetadataProps):
|
|
329
|
+
declare function DropZoneFileItemMetadata(props: DropZoneFileItemMetadataProps): react_jsx_runtime37.JSX.Element | null;
|
|
330
330
|
type DropZoneFileClearProps = PartInputProps["fileItemClear"] & {
|
|
331
331
|
asChild?: boolean;
|
|
332
332
|
forceMount?: boolean;
|
|
333
333
|
};
|
|
334
|
-
declare function DropZoneFileClear(props: DropZoneFileClearProps):
|
|
334
|
+
declare function DropZoneFileClear(props: DropZoneFileClearProps): react_jsx_runtime37.JSX.Element | null;
|
|
335
335
|
declare namespace drop_zone_parts_d_exports {
|
|
336
336
|
export { DropZoneArea as Area, DropZoneContainer as Container, DropZoneContext as Context, DropZoneFileClear as FileClear, DropZoneFileItem as FileItem, DropZoneFileItemDelete as FileItemDelete, DropZoneFileItemMetadata as FileItemMetadata, DropZoneFileItemPreview as FileItemPreview, DropZoneFileItemProgress as FileItemProgress, DropZoneFileList as FileList, DropZoneInput as Input, DropZoneRoot as Root, DropZoneTrigger as Trigger };
|
|
337
337
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
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
|
|
3
|
+
import * as react18 from "react";
|
|
4
4
|
import "@zayne-labs/toolkit-react";
|
|
5
|
-
import * as
|
|
5
|
+
import * as react_jsx_runtime3 from "react/jsx-runtime";
|
|
6
6
|
import { Control, ControllerProps, FieldPath, FormStateSubscribeProps, RegisterOptions, UseFormReturn, UseFormStateReturn, WatchProps, useFormContext as useFormRootContext } from "react-hook-form";
|
|
7
7
|
|
|
8
8
|
//#region src/components/ui/form/form-context.d.ts
|
|
@@ -38,7 +38,7 @@ type FormRootProps<TFieldValues extends FieldValues, TTransformedValues> = Infer
|
|
|
38
38
|
children: React.ReactNode;
|
|
39
39
|
form: UseFormReturn<TFieldValues, unknown, TTransformedValues>;
|
|
40
40
|
};
|
|
41
|
-
declare function FormRoot<TFieldValues extends FieldValues, TTransformedValues = TFieldValues>(props: FormRootProps<TFieldValues, TTransformedValues>):
|
|
41
|
+
declare function FormRoot<TFieldValues extends FieldValues, TTransformedValues = TFieldValues>(props: FormRootProps<TFieldValues, TTransformedValues>): react_jsx_runtime3.JSX.Element;
|
|
42
42
|
type FormFieldProps<TControl, TFieldValues extends FieldValues, TTransformedValues> = (TControl extends (Control<infer TValues>) ? {
|
|
43
43
|
control?: never;
|
|
44
44
|
name: FieldPath<TValues>;
|
|
@@ -52,25 +52,23 @@ type FormFieldProps<TControl, TFieldValues extends FieldValues, TTransformedValu
|
|
|
52
52
|
className?: never;
|
|
53
53
|
withWrapper: false;
|
|
54
54
|
});
|
|
55
|
-
declare function FormField<TControl, TFieldValues extends FieldValues, TTransformedValues>(props: FormFieldProps<TControl, TFieldValues, TTransformedValues>):
|
|
56
|
-
type FormFieldControlledFieldProps<
|
|
57
|
-
|
|
58
|
-
} : ControllerProps<TFieldValues, TName, TTransformedValues>;
|
|
59
|
-
declare function FormFieldWithController<TControl, TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>, TTransformedValues = TFieldValues>(props: FormFieldControlledFieldProps<TControl, TFieldValues, TName, TTransformedValues>): react_jsx_runtime31.JSX.Element;
|
|
55
|
+
declare function FormField<TControl, TFieldValues extends FieldValues = FieldValues, TTransformedValues = TFieldValues>(props: FormFieldProps<TControl, TFieldValues, TTransformedValues>): react_jsx_runtime3.JSX.Element;
|
|
56
|
+
type FormFieldControlledFieldProps<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>, TTransformedValues = TFieldValues> = ControllerProps<TFieldValues, TName, TTransformedValues>;
|
|
57
|
+
declare function FormFieldWithController<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>, TTransformedValues = TFieldValues>(props: FormFieldControlledFieldProps<TFieldValues, TName, TTransformedValues>): react_jsx_runtime3.JSX.Element;
|
|
60
58
|
type FormFieldBoundControllerProps<TFieldValues extends FieldValues, TTransformedValues> = Omit<ControllerProps<TFieldValues, never, TTransformedValues>, "control" | "name">;
|
|
61
|
-
declare function FormFieldBoundController<TFieldValues extends FieldValues = Record<string, never>, TTransformedValues = TFieldValues>(props: FormFieldBoundControllerProps<TFieldValues, TTransformedValues>):
|
|
62
|
-
declare function FormFieldContext(props: FormFieldContextProps):
|
|
63
|
-
declare function FormLabel(props: InferProps<"label">):
|
|
64
|
-
declare function FormInputGroup(props: InferProps<"div">):
|
|
59
|
+
declare function FormFieldBoundController<TFieldValues extends FieldValues = Record<string, never>, TTransformedValues = TFieldValues>(props: FormFieldBoundControllerProps<TFieldValues, TTransformedValues>): react_jsx_runtime3.JSX.Element;
|
|
60
|
+
declare function FormFieldContext(props: FormFieldContextProps): react18.ReactNode;
|
|
61
|
+
declare function FormLabel(props: InferProps<"label">): react_jsx_runtime3.JSX.Element;
|
|
62
|
+
declare function FormInputGroup(props: InferProps<"div">): react_jsx_runtime3.JSX.Element;
|
|
65
63
|
type FormSideItemProps = {
|
|
66
64
|
children?: React.ReactNode;
|
|
67
65
|
className?: string;
|
|
68
66
|
};
|
|
69
|
-
declare function FormInputLeftItem<TElement extends React.ElementType = "span">(props: PolymorphicPropsStrict<TElement, FormSideItemProps>):
|
|
67
|
+
declare function FormInputLeftItem<TElement extends React.ElementType = "span">(props: PolymorphicPropsStrict<TElement, FormSideItemProps>): react_jsx_runtime3.JSX.Element;
|
|
70
68
|
declare namespace FormInputLeftItem {
|
|
71
69
|
var slotSymbol: symbol;
|
|
72
70
|
}
|
|
73
|
-
declare function FormInputRightItem<TElement extends React.ElementType = "span">(props: PolymorphicPropsStrict<TElement, FormSideItemProps>):
|
|
71
|
+
declare function FormInputRightItem<TElement extends React.ElementType = "span">(props: PolymorphicPropsStrict<TElement, FormSideItemProps>): react_jsx_runtime3.JSX.Element;
|
|
74
72
|
declare namespace FormInputRightItem {
|
|
75
73
|
var slotSymbol: symbol;
|
|
76
74
|
}
|
|
@@ -106,13 +104,13 @@ type FormSelectPrimitiveProps<TFieldValues extends FieldValues> = React.Componen
|
|
|
106
104
|
};
|
|
107
105
|
declare function FormInputPrimitive<TFieldValues extends FieldValues>(props: FormInputPrimitiveProps<TFieldValues> & {
|
|
108
106
|
rules?: RegisterOptions;
|
|
109
|
-
}):
|
|
107
|
+
}): react_jsx_runtime3.JSX.Element;
|
|
110
108
|
declare function FormTextAreaPrimitive<TFieldValues extends FieldValues>(props: FormTextAreaPrimitiveProps<TFieldValues> & {
|
|
111
109
|
rules?: RegisterOptions;
|
|
112
|
-
}):
|
|
110
|
+
}): react_jsx_runtime3.JSX.Element;
|
|
113
111
|
declare function FormSelectPrimitive<TFieldValues extends FieldValues>(props: FormSelectPrimitiveProps<TFieldValues> & {
|
|
114
112
|
rules?: RegisterOptions;
|
|
115
|
-
}):
|
|
113
|
+
}): react_jsx_runtime3.JSX.Element;
|
|
116
114
|
type PrimitivePropsToOmit = "control" | "formState" | "name";
|
|
117
115
|
type FormInputProps = Omit<FormInputPrimitiveProps<FieldValues>, PrimitivePropsToOmit> & {
|
|
118
116
|
rules?: RegisterOptions;
|
|
@@ -130,10 +128,10 @@ type CombinedFormInputProps = (FormSelectProps & {
|
|
|
130
128
|
}) | FormInputProps;
|
|
131
129
|
declare function FormInput(props: CombinedFormInputProps & {
|
|
132
130
|
rules?: RegisterOptions;
|
|
133
|
-
}):
|
|
134
|
-
declare function FormTextArea(props: FormTextAreaProps):
|
|
135
|
-
declare function FormSelect(props: FormSelectProps):
|
|
136
|
-
declare function FormDescription(props: InferProps<"p">):
|
|
131
|
+
}): react_jsx_runtime3.JSX.Element;
|
|
132
|
+
declare function FormTextArea(props: FormTextAreaProps): react_jsx_runtime3.JSX.Element;
|
|
133
|
+
declare function FormSelect(props: FormSelectProps): react_jsx_runtime3.JSX.Element;
|
|
134
|
+
declare function FormDescription(props: InferProps<"p">): react_jsx_runtime3.JSX.Element;
|
|
137
135
|
type ErrorMessageRenderProps = {
|
|
138
136
|
className: string;
|
|
139
137
|
"data-index": number;
|
|
@@ -192,15 +190,15 @@ type FormErrorMessageProps<TControl, TFieldValues extends FieldValues, TTransfor
|
|
|
192
190
|
errorField: string;
|
|
193
191
|
type: "root";
|
|
194
192
|
};
|
|
195
|
-
declare function FormErrorMessage<TControl, TFieldValues extends FieldValues = FieldValues, TTransformedValues = TFieldValues>(props: FormErrorMessageProps<TControl, TFieldValues, TTransformedValues>):
|
|
193
|
+
declare function FormErrorMessage<TControl, TFieldValues extends FieldValues = FieldValues, TTransformedValues = TFieldValues>(props: FormErrorMessageProps<TControl, TFieldValues, TTransformedValues>): react_jsx_runtime3.JSX.Element;
|
|
196
194
|
type FormSubmitProps = InferProps<"button"> & {
|
|
197
195
|
asChild?: boolean;
|
|
198
196
|
};
|
|
199
|
-
declare function FormSubmit<TElement extends React.ElementType = "button">(props: PolymorphicPropsStrict<TElement, FormSubmitProps>):
|
|
197
|
+
declare function FormSubmit<TElement extends React.ElementType = "button">(props: PolymorphicPropsStrict<TElement, FormSubmitProps>): react_jsx_runtime3.JSX.Element;
|
|
200
198
|
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">;
|
|
201
|
-
declare function FormWatch<TFieldValues extends FieldValues = FieldValues, const TFieldName extends Array<FieldPath<TFieldValues>> | FieldPath<TFieldValues> | ReadonlyArray<FieldPath<TFieldValues>> | undefined = undefined, TTransformedValues = TFieldValues, TComputeValue = undefined>(props: FormWatchProps<TFieldValues, TFieldName, TTransformedValues, TComputeValue>):
|
|
199
|
+
declare function FormWatch<TFieldValues extends FieldValues = FieldValues, const TFieldName extends Array<FieldPath<TFieldValues>> | FieldPath<TFieldValues> | ReadonlyArray<FieldPath<TFieldValues>> | undefined = undefined, TTransformedValues = TFieldValues, TComputeValue = undefined>(props: FormWatchProps<TFieldValues, TFieldName, TTransformedValues, TComputeValue>): react18.ReactNode;
|
|
202
200
|
type FormStateSubscribeProps$1<TFieldValues extends FieldValues, TTransformedValues, TComputedProps extends FormStateSubscribeProps<TFieldValues, TTransformedValues> = FormStateSubscribeProps<TFieldValues, TTransformedValues>> = DiscriminatedRenderProps<TComputedProps["render"]> & Omit<TComputedProps, "render">;
|
|
203
|
-
declare function FormStateSubscribe<TFieldValues extends FieldValues, TTransformedValues = TFieldValues>(props: FormStateSubscribeProps$1<TFieldValues, TTransformedValues>):
|
|
201
|
+
declare function FormStateSubscribe<TFieldValues extends FieldValues, TTransformedValues = TFieldValues>(props: FormStateSubscribeProps$1<TFieldValues, TTransformedValues>): react18.ReactNode;
|
|
204
202
|
declare namespace form_parts_d_exports {
|
|
205
203
|
export { FormDescription as Description, FormErrorMessage as ErrorMessage, FormErrorMessagePrimitive as ErrorMessagePrimitive, FormField as Field, FormFieldBoundController as FieldBoundController, FormFieldContext as FieldContext, FormFieldWithController as FieldWithController, 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 };
|
|
206
204
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["useHookFormContext","HookFormProvider","ReactFragment","FormErrorMessagePrimitive: FormErrorMessagePrimitiveType","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 { cnMerge } from \"@/lib/utils/cn\";\nimport { isObject } from \"@zayne-labs/toolkit-type-helpers\";\nimport { createElement } from \"react\";\nimport type { FieldErrors, FieldValues } from \"react-hook-form\";\nimport type { FormErrorMessagePrimitiveProps, FormInputProps } from \"./form\";\nimport type { FormRootContext, RenderIconProps } from \"./form-context\";\nimport { EyeIconClosed, EyeIconOpen } from \"./icons\";\n\nexport const getFieldErrorMessage = (options: {\n\terrors: FieldErrors | undefined;\n\tfieldName: string | undefined;\n\ttype: FormErrorMessagePrimitiveProps<FieldValues>[\"type\"];\n}): string | string[] | null | undefined => {\n\tconst { errors, fieldName, type } = options;\n\n\tif (fieldName === 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: FormRootContext[\"withEyeIcon\"];\n}) => {\n\tconst { classNames, iconType, renderIconProps, withEyeIcon } = options;\n\n\tif (!withEyeIcon) {\n\t\treturn null;\n\t}\n\n\tif (withEyeIcon === true) {\n\t\tconst defaultIconMap = {\n\t\t\tclosed: createElement(EyeIconClosed, {\n\t\t\t\tclassName: cnMerge(\"size-full\", classNames?.eyeIcon),\n\t\t\t}),\n\n\t\t\topen: createElement(EyeIconOpen, {\n\t\t\t\tclassName: cnMerge(\"size-full\", classNames?.eyeIcon),\n\t\t\t}),\n\t\t};\n\n\t\treturn defaultIconMap[iconType];\n\t}\n\n\tif (withEyeIcon.renderIcon) {\n\t\treturn withEyeIcon.renderIcon(renderIconProps);\n\t}\n\n\tif (withEyeIcon[iconType]) {\n\t\treturn withEyeIcon[iconType];\n\t}\n\n\treturn null;\n};\n","import { ContextError, createCustomContext } from \"@zayne-labs/toolkit-react\";\nimport type { DiscriminatedRenderProps } from \"@zayne-labs/toolkit-react/utils\";\nimport type { UnionDiscriminator } from \"@zayne-labs/toolkit-type-helpers\";\nimport {\n\ttype Control,\n\ttype UseFormReturn,\n\ttype UseFormStateReturn,\n\tuseFormState,\n\tuseFormContext as useHookFormContext,\n} from \"react-hook-form\";\nimport type { FieldValues, FormInputProps } from \"./form\";\nimport { getFieldErrorMessage } from \"./utils\";\n\ntype FormReturn = UseFormReturn<FieldValues> & { withEyeIcon?: FormInputProps[\"withEyeIcon\"] };\n\ntype UseFormRootContextResult<TStrict extends boolean = true> =\n\tTStrict extends true ? FormReturn : FormReturn | 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`useFormRootContext returned \"null\". Did you forget to wrap the necessary components within FormRoot?`\n\t\t);\n\t}\n\n\treturn formContext;\n};\n\nexport type RenderIconProps = {\n\tisPasswordVisible: boolean;\n};\n\ntype EyeIconObject = UnionDiscriminator<\n\t[\n\t\t{ closed: React.ReactNode; open: React.ReactNode },\n\t\t{ renderIcon: (props: RenderIconProps) => React.ReactNode },\n\t]\n>;\n\nexport type FormRootContext = {\n\twithEyeIcon: boolean | EyeIconObject | undefined;\n};\n\nexport const [LaxFormRootProvider, useLaxFormRootContext] = createCustomContext({\n\tdefaultValue: null as unknown as FormRootContext,\n\thookName: \"useLaxFormRootContext\",\n\tname: \"LaxFormRootContext\",\n\tproviderName: \"FormRoot\",\n\tstrict: false,\n});\n\n// export const useStrictGetFieldState = () => {\n// \tconst { name } = useStrictFormFieldContext();\n\n// \tconst { getFieldState } = useFormRootContext();\n\n// \tconst fieldState = getFieldState(name);\n\n// \treturn fieldState;\n// };\n\nexport type FieldContextValue = {\n\tformDescriptionId: `${string}-(${string})-form-item-description`;\n\tformItemId: `${string}-(${string})-form-item`;\n\tformMessageId: `${string}-(${string})-form-item-message`;\n\tname: string;\n};\n\nexport type FormFieldContextProps = DiscriminatedRenderProps<\n\t(contextValue: FieldContextValue) => React.ReactNode\n>;\n\nexport const [StrictFormFieldProvider, useStrictFormFieldContext] = createCustomContext<FieldContextValue>(\n\t{\n\t\thookName: \"useFormFieldContext\",\n\t\tname: \"StrictFormFieldContext\",\n\t\tproviderName: \"FormField\",\n\t}\n);\n\nexport const [LaxFormFieldProvider, useLaxFormFieldContext] = createCustomContext({\n\tdefaultValue: null as unknown as FieldContextValue,\n\thookName: \"useLaxFormFieldContext\",\n\tname: \"LaxFormFieldContext\",\n\tproviderName: \"FormField\",\n\tstrict: false,\n});\n\nexport type FieldState = {\n\terrors?: UseFormStateReturn<FieldValues>[\"errors\"];\n\tisDisabled?: boolean;\n\tisInvalid?: boolean;\n};\n\n// eslint-disable-next-line ts-eslint/no-explicit-any -- any is used here for type compatibility\nexport type AnyControl = Control<any>;\n\ntype FieldStateOptions =\n\t| {\n\t\t\tcontrol: AnyControl | undefined;\n\t\t\tname?: string;\n\t }\n\t| {\n\t\t\tcontrol?: AnyControl;\n\t\t\tname: string | undefined;\n\t };\n\nexport const useLaxFormFieldState = (options?: FieldStateOptions): FieldState => {\n\tconst { control = options?.control } = useFormMethodsContext({ strict: false }) ?? {};\n\tconst { name = options?.name } = useLaxFormFieldContext() ?? {};\n\n\tconst getFormState = control ? useFormState : () => ({}) as Partial<ReturnType<typeof useFormState>>;\n\n\tconst { disabled, errors } = getFormState({ control, name });\n\n\tconst errorMessage = getFieldErrorMessage({ errors, fieldName: name, type: \"regular\" });\n\n\treturn {\n\t\terrors,\n\t\tisDisabled: disabled,\n\t\tisInvalid: Boolean(errorMessage),\n\t};\n};\n","\"use client\";\n\nimport { ForWithWrapper } from \"@/components/common/for\";\nimport { Slot } from \"@/components/common/slot\";\nimport { cnMerge } from \"@/lib/utils/cn\";\nimport { dataAttr, on, toArray } from \"@zayne-labs/toolkit-core\";\nimport { useCallbackRef, useToggle } from \"@zayne-labs/toolkit-react\";\nimport {\n\tcomposeRefs,\n\tcomposeTwoEventHandlers,\n\ttype DiscriminatedRenderItemProps,\n\ttype DiscriminatedRenderProps,\n\tgetMultipleSlots,\n\ttype InferProps,\n\ttype PolymorphicPropsStrict,\n} from \"@zayne-labs/toolkit-react/utils\";\nimport { type AnyString, defineEnum } from \"@zayne-labs/toolkit-type-helpers\";\nimport { Fragment as ReactFragment, useEffect, useId, useMemo, useRef } from \"react\";\nimport {\n\ttype Control,\n\tController,\n\ttype ControllerProps,\n\ttype FieldPath,\n\tFormProvider as HookFormProvider,\n\ttype RegisterOptions,\n\ttype FormStateSubscribeProps as StateSubscribeProps,\n\ttype UseFormReturn,\n\tuseFormState,\n\tuseWatch,\n\ttype WatchProps,\n} from \"react-hook-form\";\nimport {\n\ttype FieldContextValue,\n\ttype FieldState,\n\ttype FormFieldContextProps,\n\ttype FormRootContext,\n\tLaxFormFieldProvider,\n\tLaxFormRootProvider,\n\tStrictFormFieldProvider,\n\tuseFormMethodsContext,\n\tuseLaxFormFieldContext,\n\tuseLaxFormFieldState,\n\tuseLaxFormRootContext,\n\tuseStrictFormFieldContext,\n} from \"./form-context\";\nimport { getEyeIcon, getFieldErrorMessage } from \"./utils\";\n\n// eslint-disable-next-line ts-eslint/no-explicit-any -- Necessary so that arrays can also be accepted\nexport type FieldValues = Record<string, any>;\n\ntype FormRootProps<TFieldValues extends FieldValues, TTransformedValues> = InferProps<\"form\">\n\t& Partial<FormRootContext> & {\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 formContextValue = useMemo(() => ({ withEyeIcon }), [withEyeIcon]);\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\ntype FormFieldProps<TControl, TFieldValues extends FieldValues, TTransformedValues> = (TControl extends (\n\tControl<infer TValues>\n) ?\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<TControl, TFieldValues extends FieldValues, TTransformedValues>(\n\tprops: FormFieldProps<TControl, TFieldValues, TTransformedValues>\n) {\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 FieldContextValue,\n\t\t[name, uniqueId]\n\t);\n\n\tconst WrapperElement = withWrapper ? \"div\" : ReactFragment;\n\n\tconst wrapperElementProps = withWrapper && {\n\t\tclassName: cnMerge(\"flex flex-col 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\ntype FormFieldControlledFieldProps<\n\tTControl,\n\tTFieldValues extends FieldValues,\n\tTName extends FieldPath<TFieldValues>,\n\tTTransformedValues = TFieldValues,\n> =\n\tTControl extends Control<infer TValues> ?\n\t\tOmit<ControllerProps<TValues, FieldPath<TValues>, TTransformedValues>, \"control\"> & {\n\t\t\tcontrol?: never;\n\t\t}\n\t:\tControllerProps<TFieldValues, TName, TTransformedValues>;\n\nexport function FormFieldWithController<\n\tTControl,\n\tTFieldValues extends FieldValues,\n\tTName extends FieldPath<TFieldValues>,\n\tTTransformedValues = TFieldValues,\n>(props: FormFieldControlledFieldProps<TControl, TFieldValues, TName, TTransformedValues>) {\n\tconst formMethods = useFormMethodsContext({ strict: false });\n\n\tconst { control = formMethods?.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 FieldContextValue,\n\t\t[name, uniqueId]\n\t);\n\n\treturn (\n\t\t<StrictFormFieldProvider value={fieldContextValue}>\n\t\t\t<LaxFormFieldProvider value={fieldContextValue}>\n\t\t\t\t<Controller\n\t\t\t\t\tcontrol={control 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\ntype 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 function FormFieldContext(props: FormFieldContextProps) {\n\tconst { children, render } = props;\n\tconst fieldContextValues = useStrictFormFieldContext();\n\n\tif (typeof children === \"function\") {\n\t\treturn children(fieldContextValues);\n\t}\n\n\treturn render(fieldContextValues);\n}\n\nexport function FormLabel(props: InferProps<\"label\">) {\n\tconst fieldContextValues = useStrictFormFieldContext();\n\n\tconst { children, htmlFor = fieldContextValues.formItemId, ...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={htmlFor}\n\t\t\t{...restOfProps}\n\t\t>\n\t\t\t{children}\n\t\t</label>\n\t);\n}\n\nexport function FormInputGroup(props: InferProps<\"div\">) {\n\tconst { children, className, ...restOfProps } = props;\n\n\tconst { isDisabled, isInvalid } = useLaxFormFieldState();\n\n\tconst {\n\t\tregularChildren,\n\t\tslots: [leftItemSlot, rightItemSlot],\n\t} = getMultipleSlots(children, [FormInputLeftItem, FormInputRightItem]);\n\n\treturn (\n\t\t<div\n\t\t\tdata-scope=\"form\"\n\t\t\tdata-part=\"input-group\"\n\t\t\tdata-slot=\"form-input-group\"\n\t\t\tdata-invalid={dataAttr(isInvalid)}\n\t\t\tdata-disabled={dataAttr(isDisabled)}\n\t\t\tclassName={cnMerge(\"flex items-center justify-between gap-2\", className)}\n\t\t\t{...restOfProps}\n\t\t>\n\t\t\t{leftItemSlot}\n\t\t\t{regularChildren}\n\t\t\t{rightItemSlot}\n\t\t</div>\n\t);\n}\n\ntype FormSideItemProps = {\n\tchildren?: React.ReactNode;\n\tclassName?: string;\n};\n\nexport function FormInputLeftItem<TElement extends React.ElementType = \"span\">(\n\tprops: 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 FormInputPrimitiveProps<TFieldValues extends FieldValues> = Omit<\n\tReact.ComponentPropsWithRef<\"input\">,\n\t\"children\"\n> & {\n\tclassNames?: { error?: string; eyeIcon?: string; input?: string; inputGroup?: string };\n\tcontrol?: Control<TFieldValues>;\n\tfieldState?: FieldState;\n\tname?: FieldPath<TFieldValues>;\n\twithEyeIcon?: FormRootContext[\"withEyeIcon\"];\n};\n\ntype FormTextAreaPrimitiveProps<TFieldValues extends FieldValues> =\n\tReact.ComponentPropsWithRef<\"textarea\"> & {\n\t\tclassNames?: { base?: string; error?: string };\n\t\tcontrol?: Control<TFieldValues>;\n\t\tfieldState?: FieldState;\n\t\tname?: FieldPath<TFieldValues>;\n\t};\n\ntype FormSelectPrimitiveProps<TFieldValues extends FieldValues> = React.ComponentPropsWithRef<\"select\"> & {\n\tclassNames?: { base?: string; error?: string };\n\tcontrol?: Control<TFieldValues>;\n\tfieldState?: FieldState;\n\tname?: FieldPath<TFieldValues>;\n};\n\nconst inputTypesWithoutFullWidth = new Set<React.HTMLInputTypeAttribute>([\"checkbox\", \"radio\"]);\n\nexport function FormInputPrimitive<TFieldValues extends FieldValues>(\n\tprops: FormInputPrimitiveProps<TFieldValues> & { rules?: RegisterOptions }\n) {\n\tconst fieldContextValues = useLaxFormFieldContext();\n\n\tconst formRootContextValues = useLaxFormRootContext();\n\n\tconst {\n\t\tclassName,\n\t\tclassNames,\n\t\tcontrol,\n\t\tfieldState,\n\t\tid = fieldContextValues?.formItemId,\n\t\tname = fieldContextValues?.name,\n\t\trules,\n\t\ttype = \"text\",\n\t\twithEyeIcon = formRootContextValues?.withEyeIcon ?? true,\n\t\t...restOfProps\n\t} = props;\n\n\tconst fieldStateFromLaxFormField = useLaxFormFieldState({ control, name });\n\n\tconst { isDisabled, isInvalid } = fieldState ?? fieldStateFromLaxFormField;\n\n\tconst [isPasswordVisible, toggleIsPasswordVisible] = useToggle(false);\n\n\tconst shouldHaveEyeIcon = withEyeIcon && type === \"password\";\n\n\tconst WrapperElement = shouldHaveEyeIcon ? FormInputGroup : ReactFragment;\n\n\tconst wrapperElementProps = shouldHaveEyeIcon && {\n\t\tclassName: cnMerge(\"w-full\", classNames?.inputGroup, isInvalid && classNames?.error),\n\t};\n\n\tconst { register } = useFormMethodsContext({ strict: false }) ?? {};\n\n\tconst eyeIcon = getEyeIcon({\n\t\tclassNames,\n\t\ticonType: isPasswordVisible ? \"closed\" : \"open\",\n\t\trenderIconProps: { isPasswordVisible },\n\t\twithEyeIcon,\n\t});\n\n\treturn (\n\t\t<WrapperElement {...wrapperElementProps}>\n\t\t\t<input\n\t\t\t\tdata-scope=\"form\"\n\t\t\t\tdata-part=\"input\"\n\t\t\t\tdata-slot=\"form-input\"\n\t\t\t\taria-describedby={\n\t\t\t\t\t!isInvalid ?\n\t\t\t\t\t\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={id}\n\t\t\t\tname={name}\n\t\t\t\ttype={type === \"password\" && isPasswordVisible ? \"text\" : type}\n\t\t\t\tclassName={cnMerge(\n\t\t\t\t\t!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> & { rules?: RegisterOptions }\n) {\n\tconst fieldContextValues = useLaxFormFieldContext();\n\n\tconst {\n\t\tclassName,\n\t\tclassNames,\n\t\tcontrol,\n\t\tfieldState,\n\t\tid = fieldContextValues?.formItemId,\n\t\tname = fieldContextValues?.name,\n\t\trules,\n\t\t...restOfProps\n\t} = props;\n\n\tconst fieldStateFromLaxFormField = useLaxFormFieldState({ control, name });\n\n\tconst { isDisabled, isInvalid } = fieldState ?? fieldStateFromLaxFormField;\n\n\tconst { register } = useFormMethodsContext({ strict: false }) ?? {};\n\n\treturn (\n\t\t<textarea\n\t\t\tdata-scope=\"form\"\n\t\t\tdata-part=\"textarea\"\n\t\t\tdata-slot=\"form-textarea\"\n\t\t\taria-describedby={\n\t\t\t\t!isInvalid ?\n\t\t\t\t\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}\n\t\t\tname={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> & { rules?: RegisterOptions }\n) {\n\tconst fieldContextValues = useLaxFormFieldContext();\n\n\tconst {\n\t\tclassName,\n\t\tclassNames,\n\t\tcontrol,\n\t\tfieldState,\n\t\tid = fieldContextValues?.formItemId,\n\t\tname = fieldContextValues?.name,\n\t\trules,\n\t\t...restOfProps\n\t} = props;\n\n\tconst fieldStateFromLaxFormField = useLaxFormFieldState({ control, name });\n\n\tconst { isDisabled, isInvalid } = fieldState ?? fieldStateFromLaxFormField;\n\n\tconst { register } = useFormMethodsContext({ strict: false }) ?? {};\n\n\treturn (\n\t\t<select\n\t\t\tdefaultValue=\"\"\n\t\t\tdata-scope=\"form\"\n\t\t\tdata-part=\"select\"\n\t\t\tdata-slot=\"form-select\"\n\t\t\taria-describedby={\n\t\t\t\t!isInvalid ?\n\t\t\t\t\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}\n\t\t\tname={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\trules?: RegisterOptions;\n};\n\nexport type FormTextAreaProps = Omit<FormTextAreaPrimitiveProps<FieldValues>, PrimitivePropsToOmit> & {\n\trules?: RegisterOptions;\n};\n\nexport type FormSelectProps = Omit<FormSelectPrimitiveProps<FieldValues>, PrimitivePropsToOmit> & {\n\trules?: RegisterOptions;\n};\n\ntype CombinedFormInputProps =\n\t| (FormSelectProps & { type: \"select\" })\n\t| (FormTextAreaProps & { type: \"textarea\" })\n\t| FormInputProps;\n\nconst InputTypeMap = defineEnum({\n\tselect: FormSelectPrimitive,\n\ttextarea: FormTextAreaPrimitive,\n});\n\nexport function FormInput(props: CombinedFormInputProps & { rules?: RegisterOptions }) {\n\tconst { onBlur, onChange, ref, rules, type, ...restOfProps } = props;\n\n\tconst { name } = useStrictFormFieldContext();\n\tconst { register } = useFormMethodsContext();\n\n\tconst SelectedInput =\n\t\ttype === \"textarea\" || type === \"select\" ?\n\t\t\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 as never}\n\t\t\tname={name}\n\t\t\t{...registerProps}\n\t\t\t{...(restOfProps as NonNullable<unknown>)}\n\t\t\tref={composeRefs(registerProps?.ref, ref)}\n\t\t\tonChange={composeTwoEventHandlers(registerProps?.onChange, onChange)}\n\t\t\tonBlur={composeTwoEventHandlers(registerProps?.onBlur, onBlur)}\n\t\t/>\n\t);\n}\n\nexport function FormTextArea(props: FormTextAreaProps) {\n\treturn <FormInput {...props} type=\"textarea\" />;\n}\n\nexport function FormSelect(props: FormSelectProps) {\n\treturn <FormInput {...props} type=\"select\" />;\n}\n\nexport function FormDescription(props: InferProps<\"p\">) {\n\tconst { className, ...restOfProps } = props;\n\n\tconst { formDescriptionId } = useLaxFormFieldContext() ?? {};\n\n\treturn <p id={formDescriptionId} className={cnMerge(\"text-[12px]\", className)} {...restOfProps} />;\n}\n\ntype ErrorMessageRenderProps = {\n\tclassName: string;\n\t\"data-index\": number;\n\t\"data-part\": \"error-message\";\n\t\"data-scope\": \"form\";\n\t\"data-slot\": \"form-error-message\";\n\tid: string | undefined;\n};\n\ntype ErrorMessageRenderState = { errorMessage: string; errorMessageArray: string[]; index: number };\n\ntype ErrorMessageRenderFn = (context: {\n\tprops: ErrorMessageRenderProps;\n\tstate: ErrorMessageRenderState;\n}) => React.ReactNode;\n\nexport type FormErrorMessagePrimitiveProps<TFieldValues extends FieldValues> =\n\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 FormErrorMessagePrimitiveType = {\n\t<TFieldValues extends FieldValues>(\n\t\tprops: Extract<FormErrorMessagePrimitiveProps<TFieldValues>, { type?: \"regular\" }>\n\t): React.ReactNode;\n\t<TFieldValues extends FieldValues>(\n\t\t// eslint-disable-next-line ts-eslint/unified-signatures -- Using overloads are better because it gives better error messages\n\t\tprops: Extract<FormErrorMessagePrimitiveProps<TFieldValues>, { type: \"root\" }>\n\t): React.ReactNode;\n};\n\nexport const FormErrorMessagePrimitive: FormErrorMessagePrimitiveType = (props) => {\n\tconst fieldContextValues = useLaxFormFieldContext();\n\tconst rootContextValues = useFormMethodsContext({ strict: false });\n\n\tconst {\n\t\tchildren,\n\t\tclassName,\n\t\tclassNames,\n\t\tcontrol = rootContextValues?.control,\n\t\tdisableErrorAnimation = false,\n\t\tdisableScrollToErrorField = false,\n\t\tfieldName = fieldContextValues?.name,\n\t\trenderItem,\n\t\ttype = \"regular\",\n\t} = props;\n\n\tconst { errors } = useLaxFormFieldState({ control, name: fieldName });\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(\"animationend\", element, 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\"data-index\": index,\n\t\t\t\"data-part\": \"error-message\",\n\t\t\t\"data-scope\": \"form\",\n\t\t\t\"data-slot\": \"form-error-message\",\n\t\t\tid: formMessageId,\n\t\t};\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-part=\"error-message-container\"\n\t\t\tdata-scope=\"form\"\n\t\t\tdata-slot=\"form-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\ntype 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 = fieldContextValues?.name, type = \"regular\" } = props;\n\n\tconst { control } = useFormMethodsContext();\n\n\treturn (\n\t\t<FormErrorMessagePrimitive\n\t\t\tcontrol={control}\n\t\t\tfieldName={errorField as NonNullable<typeof errorField>}\n\t\t\ttype={type as \"root\"}\n\t\t\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\ntype FormSubmitProps = InferProps<\"button\"> & { asChild?: boolean };\n\nexport function FormSubmit<TElement extends React.ElementType = \"button\">(\n\tprops: PolymorphicPropsStrict<TElement, FormSubmitProps>\n) {\n\tconst { as: Element = \"button\", asChild, children, type = \"submit\", ...restOfProps } = props;\n\n\tconst Component = asChild ? Slot.Root : Element;\n\n\treturn (\n\t\t<Component data-part=\"submit\" data-scope=\"form\" data-slot=\"form-submit\" type={type} {...restOfProps}>\n\t\t\t{children}\n\t\t</Component>\n\t);\n}\n\ntype 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 = FieldValues,\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 = undefined,\n\tTTransformedValues = TFieldValues,\n\tTComputeValue = undefined,\n>(props: FormWatchProps<TFieldValues, TFieldName, TTransformedValues, TComputeValue>) {\n\tconst fieldContextValues = useLaxFormFieldContext();\n\n\tconst { children, compute, disabled, exact, name = fieldContextValues?.name, render } = props;\n\n\tconst { control } = useFormMethodsContext();\n\n\tconst formValue = useWatch({\n\t\tcompute: compute as never,\n\t\tcontrol,\n\t\tdisabled,\n\t\texact,\n\t\tname: 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\ntype 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<TFieldValues extends FieldValues, TTransformedValues = TFieldValues>(\n\tprops: FormStateSubscribeProps<TFieldValues, TTransformedValues>\n) {\n\tconst fieldContextValues = useLaxFormFieldContext();\n\n\tconst { children, control, disabled, exact, name = fieldContextValues?.name, render } = props;\n\n\tconst formState = useFormState({ control, disabled, exact, name: name as never });\n\n\tconst selectedChildren = typeof children === \"function\" ? children : render;\n\n\tconst resolvedChildren = selectedChildren(formState as never);\n\n\treturn resolvedChildren;\n}\n","export {\n\tFormDescription as Description,\n\tFormErrorMessage as ErrorMessage,\n\tFormErrorMessagePrimitive as ErrorMessagePrimitive,\n\tFormField as Field,\n\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"],"mappings":";;;;;;;;;;;;;;;AAAA,MAAa,iBAAiB,UAC7B,oBAAC;CAAI,OAAM;CAA6B,OAAM;CAAM,QAAO;CAAM,SAAQ;CAAY,GAAI;WACxF,oBAAC;EACA,MAAK;EACL,GAAE;GACD;EACG;AAGP,MAAa,eAAe,UAC3B,oBAAC;CAAI,OAAM;CAA6B,OAAM;CAAM,QAAO;CAAM,SAAQ;CAAY,GAAI;WACxF,oBAAC;EACA,MAAK;EACL,GAAE;GACD;EACG;;;;ACPP,MAAa,wBAAwB,YAIO;CAC3C,MAAM,EAAE,QAAQ,WAAW,SAAS;AAEpC,KAAI,cAAc,UAAa,CAAC,UAAU,OAAO,KAAK,OAAO,CAAC,WAAW,EAAG;AAE5E,KAAI,SAAS,OACZ,QAAO,OAAO,OAAO,YAAY;CAIlC,MAAM,YAAY,UAAU,SAAS,IAAI,GAAG,UAAU,MAAM,IAAI,GAAG;AAGnE,KAAI,CAAC,UAGJ,QAFqB,OAAO,YAAY;CAKzC,IAAI,iBAAiB;AAErB,MAAK,MAAM,QAAQ,WAAW;EAC7B,MAAM,eAAe,eAAe;AAEpC,MAAI,CAAC,SAAS,aAAa,CAAE;AAE7B,mBAAiB;;AAKlB,QAFqB,eAAe;;AAKrC,MAAa,cAAc,YAKrB;CACL,MAAM,EAAE,YAAY,UAAU,iBAAiB,gBAAgB;AAE/D,KAAI,CAAC,YACJ,QAAO;AAGR,KAAI,gBAAgB,KAWnB,QAVuB;EACtB,QAAQ,cAAc,eAAe,EACpC,WAAW,QAAQ,aAAa,YAAY,QA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,WAAW;EACL;EACN,aAAa,EAAE,OAAO,aAAa,YAClC,oBAAC;GAEA,GAAI;GACJ,WAAW,QACV,mCACA,uBACA,YAAY,WACZ,UACA;aAEA,MAAM;KATF,MAAM,aAUP;GAEL;;AAMJ,SAAgB,WACf,OACC;CACD,MAAM,EAAE,IAAI,UAAU,UAAU,SAAS,UAAU,OAAO,UAAU,GAAG,gBAAgB;AAIvF,QACC,oBAHiB,UAAUC,WAAY;EAG5B,aAAU;EAAS,cAAW;EAAO,aAAU;EAAoB;EAAM,GAAI;EACtF;GACU;;AAmBd,SAAgB,UASd,OAAoF;CACrF,MAAM,qBAAqB,wBAAwB;CAEnD,MAAM,EAAE,UAAU,SAAS,UAAU,OAAO,OAAO,oBAAoB,MAAM,WAAW;CAExF,MAAM,EAAE,YAAY,uBAAuB;CAE3C,MAAM,YAAY,SAAS;EACjB;EACT;EACA;EACA;EACM;EACN,CAAC;AAMF,SAJyB,OAAO,aAAa,aAAa,WAAW,QAE3B,UAAmB;;AAc9D,SAAgB,mBACf,OACC;CACD,MAAM,qBAAqB,wBAAwB;CAEnD,MAAM,EAAE,UAAU,SAAS,UAAU,OAAO,OAAO,oBAAoB,MAAM,WAAW;CAExF,MAAM,YAAY,aAAa;EAAE;EAAS;EAAU;EAAa;EAAe,CAAC;AAMjF,SAJyB,OAAO,aAAa,aAAa,WAAW,QAE3B,UAAmB"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["useHookFormContext","HookFormProvider","ReactFragment","FormErrorMessagePrimitive: FormErrorMessagePrimitiveType","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 { cnMerge } from \"@/lib/utils/cn\";\nimport { isObject } from \"@zayne-labs/toolkit-type-helpers\";\nimport { createElement } from \"react\";\nimport type { FieldErrors, FieldValues } from \"react-hook-form\";\nimport type { FormErrorMessagePrimitiveProps, FormInputProps } from \"./form\";\nimport type { FormRootContext, RenderIconProps } from \"./form-context\";\nimport { EyeIconClosed, EyeIconOpen } from \"./icons\";\n\nexport const getFieldErrorMessage = (options: {\n\terrors: FieldErrors | undefined;\n\tfieldName: string | undefined;\n\ttype: FormErrorMessagePrimitiveProps<FieldValues>[\"type\"];\n}): string | string[] | null | undefined => {\n\tconst { errors, fieldName, type } = options;\n\n\tif (fieldName === 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: FormRootContext[\"withEyeIcon\"];\n}) => {\n\tconst { classNames, iconType, renderIconProps, withEyeIcon } = options;\n\n\tif (!withEyeIcon) {\n\t\treturn null;\n\t}\n\n\tif (withEyeIcon === true) {\n\t\tconst defaultIconMap = {\n\t\t\tclosed: createElement(EyeIconClosed, {\n\t\t\t\tclassName: cnMerge(\"size-full\", classNames?.eyeIcon),\n\t\t\t}),\n\n\t\t\topen: createElement(EyeIconOpen, {\n\t\t\t\tclassName: cnMerge(\"size-full\", classNames?.eyeIcon),\n\t\t\t}),\n\t\t};\n\n\t\treturn defaultIconMap[iconType];\n\t}\n\n\tif (withEyeIcon.renderIcon) {\n\t\treturn withEyeIcon.renderIcon(renderIconProps);\n\t}\n\n\tif (withEyeIcon[iconType]) {\n\t\treturn withEyeIcon[iconType];\n\t}\n\n\treturn null;\n};\n","import { ContextError, createCustomContext } from \"@zayne-labs/toolkit-react\";\nimport type { DiscriminatedRenderProps } from \"@zayne-labs/toolkit-react/utils\";\nimport type { UnionDiscriminator } from \"@zayne-labs/toolkit-type-helpers\";\nimport {\n\ttype Control,\n\ttype UseFormReturn,\n\ttype UseFormStateReturn,\n\tuseFormState,\n\tuseFormContext as useHookFormContext,\n} from \"react-hook-form\";\nimport type { FieldValues, FormInputProps } from \"./form\";\nimport { getFieldErrorMessage } from \"./utils\";\n\ntype FormReturn = UseFormReturn<FieldValues> & { withEyeIcon?: FormInputProps[\"withEyeIcon\"] };\n\ntype UseFormRootContextResult<TStrict extends boolean = true> =\n\tTStrict extends true ? FormReturn : FormReturn | 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`useFormRootContext returned \"null\". Did you forget to wrap the necessary components within FormRoot?`\n\t\t);\n\t}\n\n\treturn formContext;\n};\n\nexport type RenderIconProps = {\n\tisPasswordVisible: boolean;\n};\n\ntype EyeIconObject = UnionDiscriminator<\n\t[\n\t\t{ closed: React.ReactNode; open: React.ReactNode },\n\t\t{ renderIcon: (props: RenderIconProps) => React.ReactNode },\n\t]\n>;\n\nexport type FormRootContext = {\n\twithEyeIcon: boolean | EyeIconObject | undefined;\n};\n\nexport const [LaxFormRootProvider, useLaxFormRootContext] = createCustomContext({\n\tdefaultValue: null as unknown as FormRootContext,\n\thookName: \"useLaxFormRootContext\",\n\tname: \"LaxFormRootContext\",\n\tproviderName: \"FormRoot\",\n\tstrict: false,\n});\n\n// export const useStrictGetFieldState = () => {\n// \tconst { name } = useStrictFormFieldContext();\n\n// \tconst { getFieldState } = useFormRootContext();\n\n// \tconst fieldState = getFieldState(name);\n\n// \treturn fieldState;\n// };\n\nexport type FieldContextValue = {\n\tformDescriptionId: `${string}-(${string})-form-item-description`;\n\tformItemId: `${string}-(${string})-form-item`;\n\tformMessageId: `${string}-(${string})-form-item-message`;\n\tname: string;\n};\n\nexport type FormFieldContextProps = DiscriminatedRenderProps<\n\t(contextValue: FieldContextValue) => React.ReactNode\n>;\n\nexport const [StrictFormFieldProvider, useStrictFormFieldContext] = createCustomContext<FieldContextValue>(\n\t{\n\t\thookName: \"useFormFieldContext\",\n\t\tname: \"StrictFormFieldContext\",\n\t\tproviderName: \"FormField\",\n\t}\n);\n\nexport const [LaxFormFieldProvider, useLaxFormFieldContext] = createCustomContext({\n\tdefaultValue: null as unknown as FieldContextValue,\n\thookName: \"useLaxFormFieldContext\",\n\tname: \"LaxFormFieldContext\",\n\tproviderName: \"FormField\",\n\tstrict: false,\n});\n\nexport type FieldState = {\n\terrors?: UseFormStateReturn<FieldValues>[\"errors\"];\n\tisDisabled?: boolean;\n\tisInvalid?: boolean;\n};\n\n// eslint-disable-next-line ts-eslint/no-explicit-any -- any is used here for type compatibility\nexport type AnyControl = Control<any>;\n\ntype FieldStateOptions =\n\t| {\n\t\t\tcontrol: AnyControl | undefined;\n\t\t\tname?: string;\n\t }\n\t| {\n\t\t\tcontrol?: AnyControl;\n\t\t\tname: string | undefined;\n\t };\n\nexport const useLaxFormFieldState = (options?: FieldStateOptions): FieldState => {\n\tconst { control = options?.control } = useFormMethodsContext({ strict: false }) ?? {};\n\tconst { name = options?.name } = useLaxFormFieldContext() ?? {};\n\n\tconst getFormState = control ? useFormState : () => ({}) as Partial<ReturnType<typeof useFormState>>;\n\n\tconst { disabled, errors } = getFormState({ control, name });\n\n\tconst errorMessage = getFieldErrorMessage({ errors, fieldName: name, type: \"regular\" });\n\n\treturn {\n\t\terrors,\n\t\tisDisabled: disabled,\n\t\tisInvalid: Boolean(errorMessage),\n\t};\n};\n","\"use client\";\n\nimport { ForWithWrapper } from \"@/components/common/for\";\nimport { Slot } from \"@/components/common/slot\";\nimport { cnMerge } from \"@/lib/utils/cn\";\nimport { dataAttr, on, toArray } from \"@zayne-labs/toolkit-core\";\nimport { useCallbackRef, useToggle } from \"@zayne-labs/toolkit-react\";\nimport {\n\tcomposeRefs,\n\tcomposeTwoEventHandlers,\n\ttype DiscriminatedRenderItemProps,\n\ttype DiscriminatedRenderProps,\n\tgetMultipleSlots,\n\ttype InferProps,\n\ttype PolymorphicPropsStrict,\n} from \"@zayne-labs/toolkit-react/utils\";\nimport { type AnyString, defineEnum } from \"@zayne-labs/toolkit-type-helpers\";\nimport { Fragment as ReactFragment, useEffect, useId, useMemo, useRef } from \"react\";\nimport {\n\ttype Control,\n\tController,\n\ttype ControllerProps,\n\ttype FieldPath,\n\tFormProvider as HookFormProvider,\n\ttype RegisterOptions,\n\ttype FormStateSubscribeProps as StateSubscribeProps,\n\ttype UseFormReturn,\n\tuseFormState,\n\tuseWatch,\n\ttype WatchProps,\n} from \"react-hook-form\";\nimport {\n\ttype FieldContextValue,\n\ttype FieldState,\n\ttype FormFieldContextProps,\n\ttype FormRootContext,\n\tLaxFormFieldProvider,\n\tLaxFormRootProvider,\n\tStrictFormFieldProvider,\n\tuseFormMethodsContext,\n\tuseLaxFormFieldContext,\n\tuseLaxFormFieldState,\n\tuseLaxFormRootContext,\n\tuseStrictFormFieldContext,\n} from \"./form-context\";\nimport { getEyeIcon, getFieldErrorMessage } from \"./utils\";\n\n// eslint-disable-next-line ts-eslint/no-explicit-any -- Necessary so that arrays can also be accepted\nexport type FieldValues = Record<string, any>;\n\ntype FormRootProps<TFieldValues extends FieldValues, TTransformedValues> = InferProps<\"form\">\n\t& Partial<FormRootContext> & {\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 formContextValue = useMemo(() => ({ withEyeIcon }), [withEyeIcon]);\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\ntype FormFieldProps<TControl, TFieldValues extends FieldValues, TTransformedValues> = (TControl extends (\n\tControl<infer TValues>\n) ?\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 FieldContextValue,\n\t\t[name, uniqueId]\n\t);\n\n\tconst WrapperElement = withWrapper ? \"div\" : ReactFragment;\n\n\tconst wrapperElementProps = withWrapper && {\n\t\tclassName: cnMerge(\"flex flex-col 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\ntype FormFieldControlledFieldProps<\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: FormFieldControlledFieldProps<TFieldValues, TName, TTransformedValues>) {\n\tconst formMethods = useFormMethodsContext({ strict: false });\n\n\tconst { control = formMethods?.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 FieldContextValue,\n\t\t[name, uniqueId]\n\t);\n\n\treturn (\n\t\t<StrictFormFieldProvider value={fieldContextValue}>\n\t\t\t<LaxFormFieldProvider value={fieldContextValue}>\n\t\t\t\t<Controller\n\t\t\t\t\tcontrol={control 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\ntype 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 function FormFieldContext(props: FormFieldContextProps) {\n\tconst { children, render } = props;\n\tconst fieldContextValues = useStrictFormFieldContext();\n\n\tif (typeof children === \"function\") {\n\t\treturn children(fieldContextValues);\n\t}\n\n\treturn render(fieldContextValues);\n}\n\nexport function FormLabel(props: InferProps<\"label\">) {\n\tconst fieldContextValues = useStrictFormFieldContext();\n\n\tconst { children, htmlFor = fieldContextValues.formItemId, ...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={htmlFor}\n\t\t\t{...restOfProps}\n\t\t>\n\t\t\t{children}\n\t\t</label>\n\t);\n}\n\nexport function FormInputGroup(props: InferProps<\"div\">) {\n\tconst { children, className, ...restOfProps } = props;\n\n\tconst { isDisabled, isInvalid } = useLaxFormFieldState();\n\n\tconst {\n\t\tregularChildren,\n\t\tslots: [leftItemSlot, rightItemSlot],\n\t} = getMultipleSlots(children, [FormInputLeftItem, FormInputRightItem]);\n\n\treturn (\n\t\t<div\n\t\t\tdata-scope=\"form\"\n\t\t\tdata-part=\"input-group\"\n\t\t\tdata-slot=\"form-input-group\"\n\t\t\tdata-invalid={dataAttr(isInvalid)}\n\t\t\tdata-disabled={dataAttr(isDisabled)}\n\t\t\tclassName={cnMerge(\"flex items-center justify-between gap-2\", className)}\n\t\t\t{...restOfProps}\n\t\t>\n\t\t\t{leftItemSlot}\n\t\t\t{regularChildren}\n\t\t\t{rightItemSlot}\n\t\t</div>\n\t);\n}\n\ntype FormSideItemProps = {\n\tchildren?: React.ReactNode;\n\tclassName?: string;\n};\n\nexport function FormInputLeftItem<TElement extends React.ElementType = \"span\">(\n\tprops: 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 FormInputPrimitiveProps<TFieldValues extends FieldValues> = Omit<\n\tReact.ComponentPropsWithRef<\"input\">,\n\t\"children\"\n> & {\n\tclassNames?: { error?: string; eyeIcon?: string; input?: string; inputGroup?: string };\n\tcontrol?: Control<TFieldValues>;\n\tfieldState?: FieldState;\n\tname?: FieldPath<TFieldValues>;\n\twithEyeIcon?: FormRootContext[\"withEyeIcon\"];\n};\n\ntype FormTextAreaPrimitiveProps<TFieldValues extends FieldValues> =\n\tReact.ComponentPropsWithRef<\"textarea\"> & {\n\t\tclassNames?: { base?: string; error?: string };\n\t\tcontrol?: Control<TFieldValues>;\n\t\tfieldState?: FieldState;\n\t\tname?: FieldPath<TFieldValues>;\n\t};\n\ntype FormSelectPrimitiveProps<TFieldValues extends FieldValues> = React.ComponentPropsWithRef<\"select\"> & {\n\tclassNames?: { base?: string; error?: string };\n\tcontrol?: Control<TFieldValues>;\n\tfieldState?: FieldState;\n\tname?: FieldPath<TFieldValues>;\n};\n\nconst inputTypesWithoutFullWidth = new Set<React.HTMLInputTypeAttribute>([\"checkbox\", \"radio\"]);\n\nexport function FormInputPrimitive<TFieldValues extends FieldValues>(\n\tprops: FormInputPrimitiveProps<TFieldValues> & { rules?: RegisterOptions }\n) {\n\tconst fieldContextValues = useLaxFormFieldContext();\n\n\tconst formRootContextValues = useLaxFormRootContext();\n\n\tconst {\n\t\tclassName,\n\t\tclassNames,\n\t\tcontrol,\n\t\tfieldState,\n\t\tid = fieldContextValues?.formItemId,\n\t\tname = fieldContextValues?.name,\n\t\trules,\n\t\ttype = \"text\",\n\t\twithEyeIcon = formRootContextValues?.withEyeIcon ?? true,\n\t\t...restOfProps\n\t} = props;\n\n\tconst fieldStateFromLaxFormField = useLaxFormFieldState({ control, name });\n\n\tconst { isDisabled, isInvalid } = fieldState ?? fieldStateFromLaxFormField;\n\n\tconst [isPasswordVisible, toggleIsPasswordVisible] = useToggle(false);\n\n\tconst shouldHaveEyeIcon = withEyeIcon && type === \"password\";\n\n\tconst WrapperElement = shouldHaveEyeIcon ? FormInputGroup : ReactFragment;\n\n\tconst wrapperElementProps = shouldHaveEyeIcon && {\n\t\tclassName: cnMerge(\"w-full\", classNames?.inputGroup, isInvalid && classNames?.error),\n\t};\n\n\tconst { register } = useFormMethodsContext({ strict: false }) ?? {};\n\n\tconst eyeIcon = getEyeIcon({\n\t\tclassNames,\n\t\ticonType: isPasswordVisible ? \"closed\" : \"open\",\n\t\trenderIconProps: { isPasswordVisible },\n\t\twithEyeIcon,\n\t});\n\n\treturn (\n\t\t<WrapperElement {...wrapperElementProps}>\n\t\t\t<input\n\t\t\t\tdata-scope=\"form\"\n\t\t\t\tdata-part=\"input\"\n\t\t\t\tdata-slot=\"form-input\"\n\t\t\t\taria-describedby={\n\t\t\t\t\t!isInvalid ?\n\t\t\t\t\t\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={id}\n\t\t\t\tname={name}\n\t\t\t\ttype={type === \"password\" && isPasswordVisible ? \"text\" : type}\n\t\t\t\tclassName={cnMerge(\n\t\t\t\t\t!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> & { rules?: RegisterOptions }\n) {\n\tconst fieldContextValues = useLaxFormFieldContext();\n\n\tconst {\n\t\tclassName,\n\t\tclassNames,\n\t\tcontrol,\n\t\tfieldState,\n\t\tid = fieldContextValues?.formItemId,\n\t\tname = fieldContextValues?.name,\n\t\trules,\n\t\t...restOfProps\n\t} = props;\n\n\tconst fieldStateFromLaxFormField = useLaxFormFieldState({ control, name });\n\n\tconst { isDisabled, isInvalid } = fieldState ?? fieldStateFromLaxFormField;\n\n\tconst { register } = useFormMethodsContext({ strict: false }) ?? {};\n\n\treturn (\n\t\t<textarea\n\t\t\tdata-scope=\"form\"\n\t\t\tdata-part=\"textarea\"\n\t\t\tdata-slot=\"form-textarea\"\n\t\t\taria-describedby={\n\t\t\t\t!isInvalid ?\n\t\t\t\t\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}\n\t\t\tname={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> & { rules?: RegisterOptions }\n) {\n\tconst fieldContextValues = useLaxFormFieldContext();\n\n\tconst {\n\t\tclassName,\n\t\tclassNames,\n\t\tcontrol,\n\t\tfieldState,\n\t\tid = fieldContextValues?.formItemId,\n\t\tname = fieldContextValues?.name,\n\t\trules,\n\t\t...restOfProps\n\t} = props;\n\n\tconst fieldStateFromLaxFormField = useLaxFormFieldState({ control, name });\n\n\tconst { isDisabled, isInvalid } = fieldState ?? fieldStateFromLaxFormField;\n\n\tconst { register } = useFormMethodsContext({ strict: false }) ?? {};\n\n\treturn (\n\t\t<select\n\t\t\tdefaultValue=\"\"\n\t\t\tdata-scope=\"form\"\n\t\t\tdata-part=\"select\"\n\t\t\tdata-slot=\"form-select\"\n\t\t\taria-describedby={\n\t\t\t\t!isInvalid ?\n\t\t\t\t\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}\n\t\t\tname={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\trules?: RegisterOptions;\n};\n\nexport type FormTextAreaProps = Omit<FormTextAreaPrimitiveProps<FieldValues>, PrimitivePropsToOmit> & {\n\trules?: RegisterOptions;\n};\n\nexport type FormSelectProps = Omit<FormSelectPrimitiveProps<FieldValues>, PrimitivePropsToOmit> & {\n\trules?: RegisterOptions;\n};\n\ntype CombinedFormInputProps =\n\t| (FormSelectProps & { type: \"select\" })\n\t| (FormTextAreaProps & { type: \"textarea\" })\n\t| FormInputProps;\n\nconst InputTypeMap = defineEnum({\n\tselect: FormSelectPrimitive,\n\ttextarea: FormTextAreaPrimitive,\n});\n\nexport function FormInput(props: CombinedFormInputProps & { rules?: RegisterOptions }) {\n\tconst { onBlur, onChange, ref, rules, type, ...restOfProps } = props;\n\n\tconst { name } = useStrictFormFieldContext();\n\tconst { register } = useFormMethodsContext();\n\n\tconst SelectedInput =\n\t\ttype === \"textarea\" || type === \"select\" ?\n\t\t\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 as never}\n\t\t\tname={name}\n\t\t\t{...registerProps}\n\t\t\t{...(restOfProps as NonNullable<unknown>)}\n\t\t\tref={composeRefs(registerProps?.ref, ref)}\n\t\t\tonChange={composeTwoEventHandlers(registerProps?.onChange, onChange)}\n\t\t\tonBlur={composeTwoEventHandlers(registerProps?.onBlur, onBlur)}\n\t\t/>\n\t);\n}\n\nexport function FormTextArea(props: FormTextAreaProps) {\n\treturn <FormInput {...props} type=\"textarea\" />;\n}\n\nexport function FormSelect(props: FormSelectProps) {\n\treturn <FormInput {...props} type=\"select\" />;\n}\n\nexport function FormDescription(props: InferProps<\"p\">) {\n\tconst { className, ...restOfProps } = props;\n\n\tconst { formDescriptionId } = useLaxFormFieldContext() ?? {};\n\n\treturn <p id={formDescriptionId} className={cnMerge(\"text-[12px]\", className)} {...restOfProps} />;\n}\n\ntype ErrorMessageRenderProps = {\n\tclassName: string;\n\t\"data-index\": number;\n\t\"data-part\": \"error-message\";\n\t\"data-scope\": \"form\";\n\t\"data-slot\": \"form-error-message\";\n\tid: string | undefined;\n};\n\ntype ErrorMessageRenderState = { errorMessage: string; errorMessageArray: string[]; index: number };\n\ntype ErrorMessageRenderFn = (context: {\n\tprops: ErrorMessageRenderProps;\n\tstate: ErrorMessageRenderState;\n}) => React.ReactNode;\n\nexport type FormErrorMessagePrimitiveProps<TFieldValues extends FieldValues> =\n\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 FormErrorMessagePrimitiveType = {\n\t<TFieldValues extends FieldValues>(\n\t\tprops: Extract<FormErrorMessagePrimitiveProps<TFieldValues>, { type?: \"regular\" }>\n\t): React.ReactNode;\n\t<TFieldValues extends FieldValues>(\n\t\t// eslint-disable-next-line ts-eslint/unified-signatures -- Using overloads are better because it gives better error messages\n\t\tprops: Extract<FormErrorMessagePrimitiveProps<TFieldValues>, { type: \"root\" }>\n\t): React.ReactNode;\n};\n\nexport const FormErrorMessagePrimitive: FormErrorMessagePrimitiveType = (props) => {\n\tconst fieldContextValues = useLaxFormFieldContext();\n\tconst rootContextValues = useFormMethodsContext({ strict: false });\n\n\tconst {\n\t\tchildren,\n\t\tclassName,\n\t\tclassNames,\n\t\tcontrol = rootContextValues?.control,\n\t\tdisableErrorAnimation = false,\n\t\tdisableScrollToErrorField = false,\n\t\tfieldName = fieldContextValues?.name,\n\t\trenderItem,\n\t\ttype = \"regular\",\n\t} = props;\n\n\tconst { errors } = useLaxFormFieldState({ control, name: fieldName });\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(\"animationend\", element, 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\"data-index\": index,\n\t\t\t\"data-part\": \"error-message\",\n\t\t\t\"data-scope\": \"form\",\n\t\t\t\"data-slot\": \"form-error-message\",\n\t\t\tid: formMessageId,\n\t\t};\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-part=\"error-message-container\"\n\t\t\tdata-scope=\"form\"\n\t\t\tdata-slot=\"form-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\ntype 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 = fieldContextValues?.name, type = \"regular\" } = props;\n\n\tconst { control } = useFormMethodsContext();\n\n\treturn (\n\t\t<FormErrorMessagePrimitive\n\t\t\tcontrol={control}\n\t\t\tfieldName={errorField as NonNullable<typeof errorField>}\n\t\t\ttype={type as \"root\"}\n\t\t\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\ntype FormSubmitProps = InferProps<\"button\"> & { asChild?: boolean };\n\nexport function FormSubmit<TElement extends React.ElementType = \"button\">(\n\tprops: PolymorphicPropsStrict<TElement, FormSubmitProps>\n) {\n\tconst { as: Element = \"button\", asChild, children, type = \"submit\", ...restOfProps } = props;\n\n\tconst Component = asChild ? Slot.Root : Element;\n\n\treturn (\n\t\t<Component data-part=\"submit\" data-scope=\"form\" data-slot=\"form-submit\" type={type} {...restOfProps}>\n\t\t\t{children}\n\t\t</Component>\n\t);\n}\n\ntype 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 = FieldValues,\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 = undefined,\n\tTTransformedValues = TFieldValues,\n\tTComputeValue = undefined,\n>(props: FormWatchProps<TFieldValues, TFieldName, TTransformedValues, TComputeValue>) {\n\tconst fieldContextValues = useLaxFormFieldContext();\n\n\tconst { children, compute, disabled, exact, name = fieldContextValues?.name, render } = props;\n\n\tconst { control } = useFormMethodsContext();\n\n\tconst formValue = useWatch({\n\t\tcompute: compute as never,\n\t\tcontrol,\n\t\tdisabled,\n\t\texact,\n\t\tname: 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\ntype 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<TFieldValues extends FieldValues, TTransformedValues = TFieldValues>(\n\tprops: FormStateSubscribeProps<TFieldValues, TTransformedValues>\n) {\n\tconst fieldContextValues = useLaxFormFieldContext();\n\n\tconst { children, control, disabled, exact, name = fieldContextValues?.name, render } = props;\n\n\tconst formState = useFormState({ control, disabled, exact, name: name as never });\n\n\tconst selectedChildren = typeof children === \"function\" ? children : render;\n\n\tconst resolvedChildren = selectedChildren(formState as never);\n\n\treturn resolvedChildren;\n}\n","export {\n\tFormDescription as Description,\n\tFormErrorMessage as ErrorMessage,\n\tFormErrorMessagePrimitive as ErrorMessagePrimitive,\n\tFormField as Field,\n\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"],"mappings":";;;;;;;;;;;;;;;AAAA,MAAa,iBAAiB,UAC7B,oBAAC;CAAI,OAAM;CAA6B,OAAM;CAAM,QAAO;CAAM,SAAQ;CAAY,GAAI;WACxF,oBAAC;EACA,MAAK;EACL,GAAE;GACD;EACG;AAGP,MAAa,eAAe,UAC3B,oBAAC;CAAI,OAAM;CAA6B,OAAM;CAAM,QAAO;CAAM,SAAQ;CAAY,GAAI;WACxF,oBAAC;EACA,MAAK;EACL,GAAE;GACD;EACG;;;;ACPP,MAAa,wBAAwB,YAIO;CAC3C,MAAM,EAAE,QAAQ,WAAW,SAAS;AAEpC,KAAI,cAAc,UAAa,CAAC,UAAU,OAAO,KAAK,OAAO,CAAC,WAAW,EAAG;AAE5E,KAAI,SAAS,OACZ,QAAO,OAAO,OAAO,YAAY;CAIlC,MAAM,YAAY,UAAU,SAAS,IAAI,GAAG,UAAU,MAAM,IAAI,GAAG;AAGnE,KAAI,CAAC,UAGJ,QAFqB,OAAO,YAAY;CAKzC,IAAI,iBAAiB;AAErB,MAAK,MAAM,QAAQ,WAAW;EAC7B,MAAM,eAAe,eAAe;AAEpC,MAAI,CAAC,SAAS,aAAa,CAAE;AAE7B,mBAAiB;;AAKlB,QAFqB,eAAe;;AAKrC,MAAa,cAAc,YAKrB;CACL,MAAM,EAAE,YAAY,UAAU,iBAAiB,gBAAgB;AAE/D,KAAI,CAAC,YACJ,QAAO;AAGR,KAAI,gBAAgB,KAWnB,QAVuB;EACtB,QAAQ,cAAc,eAAe,EACpC,WAAW,QAAQ,aAAa,YAAY,QAAQ,EACpD,CAAC;EAEF,MAAM,cAAc,aAAa,EAChC,WAAW,QAAQ,aAAa,YAAY,QAAQ,EACp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