@customafk/lunas-ui 0.1.99 → 0.2.1
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/{button-8vMj-_no.d.mts → button-Bji_SqMI.d.cts} +6 -6
- package/dist/button-C58TS8Pc.cjs +2 -0
- package/dist/button-C58TS8Pc.cjs.map +1 -0
- package/dist/button-DXPSlb3I.mjs +2 -0
- package/dist/button-DXPSlb3I.mjs.map +1 -0
- package/dist/{button-Dy39kE9k.d.cts → button-PV-Xnryv.d.mts} +6 -6
- package/dist/button.variants-DuuH1O0_.mjs +2 -0
- package/dist/button.variants-DuuH1O0_.mjs.map +1 -0
- package/dist/button.variants-rdXrPUao.cjs +2 -0
- package/dist/button.variants-rdXrPUao.cjs.map +1 -0
- package/dist/{calendar-e9Pu8pNj.mjs → calendar-CEF9LSd4.mjs} +2 -2
- package/dist/{calendar-e9Pu8pNj.mjs.map → calendar-CEF9LSd4.mjs.map} +1 -1
- package/dist/{calendar-DgLMLD8R.cjs → calendar-DT0NPRhB.cjs} +2 -2
- package/dist/{calendar-DgLMLD8R.cjs.map → calendar-DT0NPRhB.cjs.map} +1 -1
- package/dist/cards/grid-product-card.cjs +1 -1
- package/dist/cards/grid-product-card.mjs +1 -1
- package/dist/cards/product-card.cjs +1 -1
- package/dist/cards/product-card.mjs +1 -1
- package/dist/cards/simple-card.cjs +1 -1
- package/dist/cards/simple-card.d.mts +2 -2
- package/dist/cards/simple-card.mjs +1 -1
- package/dist/{command-Uq5FAdtW.mjs → command-DhBTNTqz.mjs} +2 -2
- package/dist/{command-Uq5FAdtW.mjs.map → command-DhBTNTqz.mjs.map} +1 -1
- package/dist/{command-Dd4OnuB0.cjs → command-_zpTaaIk.cjs} +2 -2
- package/dist/{command-Dd4OnuB0.cjs.map → command-_zpTaaIk.cjs.map} +1 -1
- package/dist/data-display/country.cjs +1 -1
- package/dist/data-display/country.mjs +1 -1
- package/dist/data-display/date-tooltip.cjs +1 -1
- package/dist/data-display/date-tooltip.mjs +1 -1
- package/dist/data-display/date.cjs +1 -1
- package/dist/data-display/date.mjs +1 -1
- package/dist/data-display/name.cjs +1 -1
- package/dist/data-display/name.mjs +1 -1
- package/dist/data-display/statistic.d.cts +2 -2
- package/dist/data-display/statistic.d.mts +2 -2
- package/dist/data-display/user.cjs +1 -1
- package/dist/data-display/user.mjs +1 -1
- package/dist/date-By93kONr.mjs +2 -0
- package/dist/date-By93kONr.mjs.map +1 -0
- package/dist/date-em5f7hCx.cjs +2 -0
- package/dist/date-em5f7hCx.cjs.map +1 -0
- package/dist/{dialog-BtlJFvlf.d.cts → dialog-7127ChM2.d.cts} +12 -12
- package/dist/{dialog-DTz8ngeU.mjs → dialog-CxELDK98.mjs} +2 -2
- package/dist/{dialog-DTz8ngeU.mjs.map → dialog-CxELDK98.mjs.map} +1 -1
- package/dist/{dialog-ArqTBRVT.d.mts → dialog-DKZ8BLxc.d.mts} +12 -12
- package/dist/{dialog-2N-D9B9o.cjs → dialog-DjRiV5vR.cjs} +2 -2
- package/dist/{dialog-2N-D9B9o.cjs.map → dialog-DjRiV5vR.cjs.map} +1 -1
- package/dist/dialogs/confirm-dialog.cjs +1 -1
- package/dist/dialogs/confirm-dialog.mjs +1 -1
- package/dist/dialogs/detail-dialog/components/sidebar.cjs +1 -1
- package/dist/dialogs/detail-dialog/components/sidebar.d.cts +26 -26
- package/dist/dialogs/detail-dialog/components/sidebar.d.mts +26 -26
- package/dist/dialogs/detail-dialog/components/sidebar.mjs +1 -1
- package/dist/dialogs/detail-dialog/index.cjs +1 -1
- package/dist/dialogs/detail-dialog/index.mjs +1 -1
- package/dist/dialogs/error-dialog.cjs +1 -1
- package/dist/dialogs/error-dialog.mjs +1 -1
- package/dist/dialogs/loading-dialog.cjs +1 -1
- package/dist/dialogs/loading-dialog.mjs +1 -1
- package/dist/features/descriptions/index.cjs +1 -1
- package/dist/features/descriptions/index.mjs +1 -1
- package/dist/features/search-modal/index.cjs +1 -1
- package/dist/features/search-modal/index.d.cts +2 -2
- package/dist/features/search-modal/index.d.mts +2 -2
- package/dist/features/search-modal/index.mjs +1 -1
- package/dist/features/tables/index.cjs +1 -1
- package/dist/features/tables/index.cjs.map +1 -1
- package/dist/features/tables/index.d.cts +1 -1
- package/dist/features/tables/index.d.mts +1 -1
- package/dist/features/tables/index.mjs +1 -1
- package/dist/features/tables/index.mjs.map +1 -1
- package/dist/features/tanstack-form/index.cjs +1 -1
- package/dist/features/tanstack-form/index.cjs.map +1 -1
- package/dist/features/tanstack-form/index.d.cts +58 -51
- package/dist/features/tanstack-form/index.d.mts +58 -51
- package/dist/features/tanstack-form/index.mjs +1 -1
- package/dist/features/tanstack-form/index.mjs.map +1 -1
- package/dist/{input-DqoSygui.d.cts → input-D0enZTLC.d.cts} +6 -6
- package/dist/{input-DERBzcV_.d.mts → input-DkvHV_UU.d.mts} +4 -4
- package/dist/layouts/cms-layout/index.cjs +1 -1
- package/dist/layouts/cms-layout/index.cjs.map +1 -1
- package/dist/layouts/cms-layout/index.mjs +1 -1
- package/dist/layouts/cms-layout/index.mjs.map +1 -1
- package/dist/layouts/flex.d.cts +2 -2
- package/dist/layouts/flex.d.mts +4 -4
- package/dist/layouts/payment-layout/index.cjs +1 -1
- package/dist/layouts/payment-layout/index.mjs +1 -1
- package/dist/pages/FeatureDeveloping.cjs +1 -1
- package/dist/pages/FeatureDeveloping.d.cts +2 -2
- package/dist/pages/FeatureDeveloping.d.mts +2 -2
- package/dist/pages/FeatureDeveloping.mjs +1 -1
- package/dist/pages/FeatureFixing.cjs +1 -1
- package/dist/pages/FeatureFixing.d.cts +2 -2
- package/dist/pages/FeatureFixing.d.mts +2 -2
- package/dist/pages/FeatureFixing.mjs +1 -1
- package/dist/pages/NotAuthorized.cjs +1 -1
- package/dist/pages/NotAuthorized.d.cts +2 -2
- package/dist/pages/NotAuthorized.d.mts +2 -2
- package/dist/pages/NotAuthorized.mjs +1 -1
- package/dist/pages/NotFound.cjs +1 -1
- package/dist/pages/NotFound.d.cts +2 -2
- package/dist/pages/NotFound.d.mts +2 -2
- package/dist/pages/NotFound.mjs +1 -1
- package/dist/{paragraph-BBye8n4M.cjs → paragraph-B72bHMf7.cjs} +2 -2
- package/dist/paragraph-B72bHMf7.cjs.map +1 -0
- package/dist/{paragraph-BS88Xdo7.mjs → paragraph-moBSTPmT.mjs} +2 -2
- package/dist/paragraph-moBSTPmT.mjs.map +1 -0
- package/dist/typography/paragraph.cjs +1 -1
- package/dist/typography/paragraph.d.cts +6 -6
- package/dist/typography/paragraph.d.mts +4 -4
- package/dist/typography/paragraph.mjs +1 -1
- package/dist/typography/title.d.cts +2 -2
- package/dist/typography/title.d.mts +2 -2
- package/dist/ui/alert-dialog.cjs +1 -1
- package/dist/ui/alert-dialog.d.cts +12 -12
- package/dist/ui/alert-dialog.d.mts +12 -12
- package/dist/ui/alert-dialog.mjs +1 -1
- package/dist/ui/alert.d.cts +7 -7
- package/dist/ui/alert.d.mts +7 -7
- package/dist/ui/aspect-ratio.d.cts +2 -2
- package/dist/ui/aspect-ratio.d.mts +2 -2
- package/dist/ui/avatar.d.cts +4 -4
- package/dist/ui/avatar.d.mts +4 -4
- package/dist/ui/badge.d.cts +4 -4
- package/dist/ui/badge.d.mts +4 -4
- package/dist/ui/breadcrumb.d.cts +8 -8
- package/dist/ui/breadcrumb.d.mts +8 -8
- package/dist/ui/button-group.d.cts +6 -6
- package/dist/ui/button-group.d.mts +6 -6
- package/dist/ui/button.cjs +1 -1
- package/dist/ui/button.d.cts +1 -1
- package/dist/ui/button.d.mts +1 -1
- package/dist/ui/button.mjs +1 -1
- package/dist/ui/buttons/add-new.cjs +1 -1
- package/dist/ui/buttons/add-new.mjs +1 -1
- package/dist/ui/buttons/edit.cjs +1 -1
- package/dist/ui/buttons/edit.mjs +1 -1
- package/dist/ui/buttons/refresh.cjs +1 -1
- package/dist/ui/buttons/refresh.mjs +1 -1
- package/dist/ui/buttons/trash.cjs +1 -1
- package/dist/ui/buttons/trash.mjs +1 -1
- package/dist/ui/buttons/upload-image.cjs +1 -1
- package/dist/ui/buttons/upload-image.mjs +1 -1
- package/dist/ui/calendar.cjs +1 -1
- package/dist/ui/calendar.d.cts +4 -4
- package/dist/ui/calendar.d.mts +4 -4
- package/dist/ui/calendar.mjs +1 -1
- package/dist/ui/card.cjs +1 -1
- package/dist/ui/card.d.cts +8 -8
- package/dist/ui/card.d.mts +8 -8
- package/dist/ui/card.mjs +1 -1
- package/dist/ui/carousel.cjs +1 -1
- package/dist/ui/carousel.d.cts +7 -7
- package/dist/ui/carousel.d.mts +7 -7
- package/dist/ui/carousel.mjs +1 -1
- package/dist/ui/checkbox.d.cts +2 -2
- package/dist/ui/checkbox.d.mts +2 -2
- package/dist/ui/collapsible.d.cts +4 -4
- package/dist/ui/collapsible.d.mts +4 -4
- package/dist/ui/command.cjs +1 -1
- package/dist/ui/command.d.cts +11 -11
- package/dist/ui/command.d.mts +11 -11
- package/dist/ui/command.mjs +1 -1
- package/dist/ui/context-menu.d.cts +16 -16
- package/dist/ui/context-menu.d.mts +16 -16
- package/dist/ui/dialog.cjs +1 -1
- package/dist/ui/dialog.d.cts +1 -1
- package/dist/ui/dialog.d.mts +1 -1
- package/dist/ui/dialog.mjs +1 -1
- package/dist/ui/drawer.d.cts +11 -11
- package/dist/ui/drawer.d.mts +11 -11
- package/dist/ui/dropdown-menu.d.cts +16 -16
- package/dist/ui/dropdown-menu.d.mts +16 -16
- package/dist/ui/empty.d.cts +9 -9
- package/dist/ui/empty.d.mts +9 -9
- package/dist/ui/field.d.cts +13 -13
- package/dist/ui/field.d.mts +13 -13
- package/dist/ui/file-uploader.cjs +1 -1
- package/dist/ui/file-uploader.d.cts +2 -2
- package/dist/ui/file-uploader.d.mts +2 -2
- package/dist/ui/file-uploader.mjs +1 -1
- package/dist/ui/form.d.cts +7 -7
- package/dist/ui/form.d.mts +11 -11
- package/dist/ui/hover-card.d.cts +4 -4
- package/dist/ui/hover-card.d.mts +4 -4
- package/dist/ui/input-otp.d.cts +5 -5
- package/dist/ui/input-otp.d.mts +5 -5
- package/dist/ui/input.d.cts +1 -1
- package/dist/ui/input.d.mts +1 -1
- package/dist/ui/inputs/search-input.d.cts +3 -3
- package/dist/ui/inputs/search-input.d.mts +3 -3
- package/dist/ui/item.d.cts +12 -12
- package/dist/ui/item.d.mts +15 -15
- package/dist/ui/label.d.cts +2 -2
- package/dist/ui/label.d.mts +2 -2
- package/dist/ui/menubar.d.cts +17 -17
- package/dist/ui/menubar.d.mts +17 -17
- package/dist/ui/multi-select.cjs +1 -1
- package/dist/ui/multi-select.d.cts +2 -2
- package/dist/ui/multi-select.d.mts +1 -1
- package/dist/ui/multi-select.mjs +1 -1
- package/dist/ui/navigation-menu.d.cts +11 -11
- package/dist/ui/navigation-menu.d.mts +11 -11
- package/dist/ui/pagination.cjs +1 -1
- package/dist/ui/pagination.d.cts +9 -9
- package/dist/ui/pagination.d.mts +9 -9
- package/dist/ui/pagination.mjs +1 -1
- package/dist/ui/popover.d.cts +6 -6
- package/dist/ui/popover.d.mts +6 -6
- package/dist/ui/progress.d.cts +2 -2
- package/dist/ui/progress.d.mts +2 -2
- package/dist/ui/radio-group.d.cts +3 -3
- package/dist/ui/radio-group.d.mts +3 -3
- package/dist/ui/resizable.d.cts +1 -1
- package/dist/ui/resizable.d.mts +9 -9
- package/dist/ui/scroll-area.d.cts +3 -3
- package/dist/ui/scroll-area.d.mts +6 -6
- package/dist/ui/select.d.cts +9 -9
- package/dist/ui/select.d.mts +9 -9
- package/dist/ui/separator.d.cts +2 -2
- package/dist/ui/separator.d.mts +2 -2
- package/dist/ui/sheet.d.cts +9 -9
- package/dist/ui/sheet.d.mts +9 -9
- package/dist/ui/sidebar.cjs +1 -1
- package/dist/ui/sidebar.d.cts +26 -26
- package/dist/ui/sidebar.d.mts +26 -26
- package/dist/ui/sidebar.mjs +1 -1
- package/dist/ui/skeleton.d.cts +2 -2
- package/dist/ui/skeleton.d.mts +2 -2
- package/dist/ui/slider.d.cts +2 -2
- package/dist/ui/slider.d.mts +2 -2
- package/dist/ui/sonner.d.cts +2 -2
- package/dist/ui/sonner.d.mts +2 -2
- package/dist/ui/spinner.d.cts +2 -2
- package/dist/ui/spinner.d.mts +2 -2
- package/dist/ui/switch.d.cts +2 -2
- package/dist/ui/switch.d.mts +2 -2
- package/dist/ui/table.d.cts +18 -18
- package/dist/ui/table.d.mts +9 -9
- package/dist/ui/tabs.d.cts +5 -5
- package/dist/ui/tabs.d.mts +5 -5
- package/dist/ui/textarea.d.cts +2 -2
- package/dist/ui/textarea.d.mts +2 -2
- package/dist/ui/toggle-group.d.cts +3 -3
- package/dist/ui/toggle-group.d.mts +3 -3
- package/dist/ui/toggle.d.cts +2 -2
- package/dist/ui/toggle.d.mts +4 -4
- package/dist/ui/tooltip.d.cts +5 -5
- package/dist/ui/tooltip.d.mts +5 -5
- package/package.json +2 -2
- package/dist/button-8Snjc8iT.cjs +0 -2
- package/dist/button-8Snjc8iT.cjs.map +0 -1
- package/dist/button-C_yZHudZ.mjs +0 -2
- package/dist/button-C_yZHudZ.mjs.map +0 -1
- package/dist/button.variants-8QOIR433.cjs +0 -2
- package/dist/button.variants-8QOIR433.cjs.map +0 -1
- package/dist/button.variants-CL2rLGYO.mjs +0 -2
- package/dist/button.variants-CL2rLGYO.mjs.map +0 -1
- package/dist/date-CK7XBqG9.mjs +0 -2
- package/dist/date-CK7XBqG9.mjs.map +0 -1
- package/dist/date-CTmoK8tv.cjs +0 -2
- package/dist/date-CTmoK8tv.cjs.map +0 -1
- package/dist/paragraph-BBye8n4M.cjs.map +0 -1
- package/dist/paragraph-BS88Xdo7.mjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as class_variance_authority0 from "class-variance-authority";
|
|
2
2
|
import { VariantProps } from "class-variance-authority";
|
|
3
3
|
import * as react255 from "react";
|
|
4
|
-
import * as
|
|
4
|
+
import * as react_jsx_runtime333 from "react/jsx-runtime";
|
|
5
5
|
import { Label } from "radix-ui";
|
|
6
6
|
import * as _tanstack_react_form0 from "@tanstack/react-form";
|
|
7
7
|
import * as class_variance_authority_types21 from "class-variance-authority/types";
|
|
@@ -12,7 +12,7 @@ declare function Label$1({
|
|
|
12
12
|
className,
|
|
13
13
|
children,
|
|
14
14
|
...props
|
|
15
|
-
}: React.ComponentProps<typeof Label.Root>):
|
|
15
|
+
}: React.ComponentProps<typeof Label.Root>): react_jsx_runtime333.JSX.Element;
|
|
16
16
|
//#endregion
|
|
17
17
|
//#region packages/components/features/tanstack-form/components/ui/field.d.ts
|
|
18
18
|
declare const fieldVariants: (props?: ({
|
|
@@ -21,29 +21,29 @@ declare const fieldVariants: (props?: ({
|
|
|
21
21
|
declare const FieldGroup: react255.MemoExoticComponent<({
|
|
22
22
|
className,
|
|
23
23
|
...props
|
|
24
|
-
}: React.ComponentProps<"div">) =>
|
|
24
|
+
}: React.ComponentProps<"div">) => react_jsx_runtime333.JSX.Element>;
|
|
25
25
|
declare const Field: react255.MemoExoticComponent<({
|
|
26
26
|
className,
|
|
27
27
|
orientation,
|
|
28
28
|
...props
|
|
29
|
-
}: React.ComponentProps<"div"> & VariantProps<typeof fieldVariants>) =>
|
|
29
|
+
}: React.ComponentProps<"div"> & VariantProps<typeof fieldVariants>) => react_jsx_runtime333.JSX.Element>;
|
|
30
30
|
declare const FieldContent: react255.MemoExoticComponent<({
|
|
31
31
|
className,
|
|
32
32
|
...props
|
|
33
|
-
}: React.ComponentProps<"div">) =>
|
|
33
|
+
}: React.ComponentProps<"div">) => react_jsx_runtime333.JSX.Element>;
|
|
34
34
|
declare const FieldContentMain: react255.MemoExoticComponent<({
|
|
35
35
|
className,
|
|
36
36
|
...props
|
|
37
|
-
}: React.ComponentProps<"div">) =>
|
|
37
|
+
}: React.ComponentProps<"div">) => react_jsx_runtime333.JSX.Element>;
|
|
38
38
|
declare const FieldLabel: react255.MemoExoticComponent<({
|
|
39
39
|
className,
|
|
40
40
|
...props
|
|
41
|
-
}: React.ComponentProps<typeof Label$1>) =>
|
|
41
|
+
}: React.ComponentProps<typeof Label$1>) => react_jsx_runtime333.JSX.Element>;
|
|
42
42
|
declare const FieldSeparator: react255.MemoExoticComponent<({
|
|
43
43
|
children,
|
|
44
44
|
className,
|
|
45
45
|
...props
|
|
46
|
-
}: React.PropsWithChildren<React.ComponentProps<"div">>) =>
|
|
46
|
+
}: React.PropsWithChildren<React.ComponentProps<"div">>) => react_jsx_runtime333.JSX.Element>;
|
|
47
47
|
declare const FieldError: react255.MemoExoticComponent<({
|
|
48
48
|
className,
|
|
49
49
|
children,
|
|
@@ -51,9 +51,10 @@ declare const FieldError: react255.MemoExoticComponent<({
|
|
|
51
51
|
...props
|
|
52
52
|
}: React.ComponentProps<"div"> & {
|
|
53
53
|
errors?: Array<{
|
|
54
|
+
code?: string;
|
|
54
55
|
message?: string;
|
|
55
56
|
} | undefined>;
|
|
56
|
-
}) =>
|
|
57
|
+
}) => react_jsx_runtime333.JSX.Element | null>;
|
|
57
58
|
//#endregion
|
|
58
59
|
//#region packages/components/features/tanstack-form/tanstack-form.d.ts
|
|
59
60
|
declare const useTanStackFieldContext: <TData>() => _tanstack_form_core0.FieldApi<any, string, TData, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>, useTanStackFormContext: () => _tanstack_react_form0.ReactFormExtendedApi<Record<string, never>, any, any, any, any, any, any, any, any, any, any, any>;
|
|
@@ -264,31 +265,31 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
|
|
|
264
265
|
readonly FieldGroup: react255.MemoExoticComponent<({
|
|
265
266
|
className,
|
|
266
267
|
...props
|
|
267
|
-
}: React.ComponentProps<"div">) =>
|
|
268
|
+
}: React.ComponentProps<"div">) => react_jsx_runtime333.JSX.Element>;
|
|
268
269
|
readonly Field: react255.MemoExoticComponent<({
|
|
269
270
|
className,
|
|
270
271
|
orientation,
|
|
271
272
|
...props
|
|
272
273
|
}: React.ComponentProps<"div"> & class_variance_authority0.VariantProps<(props?: ({
|
|
273
274
|
orientation?: "vertical" | "horizontal" | "responsive" | null | undefined;
|
|
274
|
-
} & class_variance_authority_types21.ClassProp) | undefined) => string>) =>
|
|
275
|
+
} & class_variance_authority_types21.ClassProp) | undefined) => string>) => react_jsx_runtime333.JSX.Element>;
|
|
275
276
|
readonly FieldContent: react255.MemoExoticComponent<({
|
|
276
277
|
className,
|
|
277
278
|
...props
|
|
278
|
-
}: React.ComponentProps<"div">) =>
|
|
279
|
+
}: React.ComponentProps<"div">) => react_jsx_runtime333.JSX.Element>;
|
|
279
280
|
readonly FieldLabel: react255.MemoExoticComponent<({
|
|
280
281
|
className,
|
|
281
282
|
...props
|
|
282
|
-
}: React.ComponentProps<typeof Label$1>) =>
|
|
283
|
+
}: React.ComponentProps<typeof Label$1>) => react_jsx_runtime333.JSX.Element>;
|
|
283
284
|
readonly FieldContentMain: react255.MemoExoticComponent<({
|
|
284
285
|
className,
|
|
285
286
|
...props
|
|
286
|
-
}: React.ComponentProps<"div">) =>
|
|
287
|
+
}: React.ComponentProps<"div">) => react_jsx_runtime333.JSX.Element>;
|
|
287
288
|
readonly FieldSeparator: react255.MemoExoticComponent<({
|
|
288
289
|
children,
|
|
289
290
|
className,
|
|
290
291
|
...props
|
|
291
|
-
}: React.PropsWithChildren<React.ComponentProps<"div">>) =>
|
|
292
|
+
}: React.PropsWithChildren<React.ComponentProps<"div">>) => react_jsx_runtime333.JSX.Element>;
|
|
292
293
|
readonly FieldError: react255.MemoExoticComponent<({
|
|
293
294
|
className,
|
|
294
295
|
children,
|
|
@@ -296,9 +297,10 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
|
|
|
296
297
|
...props
|
|
297
298
|
}: React.ComponentProps<"div"> & {
|
|
298
299
|
errors?: Array<{
|
|
300
|
+
code?: string;
|
|
299
301
|
message?: string;
|
|
300
302
|
} | undefined>;
|
|
301
|
-
}) =>
|
|
303
|
+
}) => react_jsx_runtime333.JSX.Element | null>;
|
|
302
304
|
}, {
|
|
303
305
|
readonly TanStackDialogForm: react255.FC<react255.PropsWithChildren<{
|
|
304
306
|
title: string;
|
|
@@ -551,31 +553,31 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
|
|
|
551
553
|
readonly FieldGroup: react255.MemoExoticComponent<({
|
|
552
554
|
className,
|
|
553
555
|
...props
|
|
554
|
-
}: React.ComponentProps<"div">) =>
|
|
556
|
+
}: React.ComponentProps<"div">) => react_jsx_runtime333.JSX.Element>;
|
|
555
557
|
readonly Field: react255.MemoExoticComponent<({
|
|
556
558
|
className,
|
|
557
559
|
orientation,
|
|
558
560
|
...props
|
|
559
561
|
}: React.ComponentProps<"div"> & class_variance_authority0.VariantProps<(props?: ({
|
|
560
562
|
orientation?: "vertical" | "horizontal" | "responsive" | null | undefined;
|
|
561
|
-
} & class_variance_authority_types21.ClassProp) | undefined) => string>) =>
|
|
563
|
+
} & class_variance_authority_types21.ClassProp) | undefined) => string>) => react_jsx_runtime333.JSX.Element>;
|
|
562
564
|
readonly FieldContent: react255.MemoExoticComponent<({
|
|
563
565
|
className,
|
|
564
566
|
...props
|
|
565
|
-
}: React.ComponentProps<"div">) =>
|
|
567
|
+
}: React.ComponentProps<"div">) => react_jsx_runtime333.JSX.Element>;
|
|
566
568
|
readonly FieldLabel: react255.MemoExoticComponent<({
|
|
567
569
|
className,
|
|
568
570
|
...props
|
|
569
|
-
}: React.ComponentProps<typeof Label$1>) =>
|
|
571
|
+
}: React.ComponentProps<typeof Label$1>) => react_jsx_runtime333.JSX.Element>;
|
|
570
572
|
readonly FieldContentMain: react255.MemoExoticComponent<({
|
|
571
573
|
className,
|
|
572
574
|
...props
|
|
573
|
-
}: React.ComponentProps<"div">) =>
|
|
575
|
+
}: React.ComponentProps<"div">) => react_jsx_runtime333.JSX.Element>;
|
|
574
576
|
readonly FieldSeparator: react255.MemoExoticComponent<({
|
|
575
577
|
children,
|
|
576
578
|
className,
|
|
577
579
|
...props
|
|
578
|
-
}: React.PropsWithChildren<React.ComponentProps<"div">>) =>
|
|
580
|
+
}: React.PropsWithChildren<React.ComponentProps<"div">>) => react_jsx_runtime333.JSX.Element>;
|
|
579
581
|
readonly FieldError: react255.MemoExoticComponent<({
|
|
580
582
|
className,
|
|
581
583
|
children,
|
|
@@ -583,9 +585,10 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
|
|
|
583
585
|
...props
|
|
584
586
|
}: React.ComponentProps<"div"> & {
|
|
585
587
|
errors?: Array<{
|
|
588
|
+
code?: string;
|
|
586
589
|
message?: string;
|
|
587
590
|
} | undefined>;
|
|
588
|
-
}) =>
|
|
591
|
+
}) => react_jsx_runtime333.JSX.Element | null>;
|
|
589
592
|
}, {
|
|
590
593
|
readonly TanStackDialogForm: react255.FC<react255.PropsWithChildren<{
|
|
591
594
|
title: string;
|
|
@@ -836,31 +839,31 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
|
|
|
836
839
|
readonly FieldGroup: react255.MemoExoticComponent<({
|
|
837
840
|
className,
|
|
838
841
|
...props
|
|
839
|
-
}: React.ComponentProps<"div">) =>
|
|
842
|
+
}: React.ComponentProps<"div">) => react_jsx_runtime333.JSX.Element>;
|
|
840
843
|
readonly Field: react255.MemoExoticComponent<({
|
|
841
844
|
className,
|
|
842
845
|
orientation,
|
|
843
846
|
...props
|
|
844
847
|
}: React.ComponentProps<"div"> & class_variance_authority0.VariantProps<(props?: ({
|
|
845
848
|
orientation?: "vertical" | "horizontal" | "responsive" | null | undefined;
|
|
846
|
-
} & class_variance_authority_types21.ClassProp) | undefined) => string>) =>
|
|
849
|
+
} & class_variance_authority_types21.ClassProp) | undefined) => string>) => react_jsx_runtime333.JSX.Element>;
|
|
847
850
|
readonly FieldContent: react255.MemoExoticComponent<({
|
|
848
851
|
className,
|
|
849
852
|
...props
|
|
850
|
-
}: React.ComponentProps<"div">) =>
|
|
853
|
+
}: React.ComponentProps<"div">) => react_jsx_runtime333.JSX.Element>;
|
|
851
854
|
readonly FieldLabel: react255.MemoExoticComponent<({
|
|
852
855
|
className,
|
|
853
856
|
...props
|
|
854
|
-
}: React.ComponentProps<typeof Label$1>) =>
|
|
857
|
+
}: React.ComponentProps<typeof Label$1>) => react_jsx_runtime333.JSX.Element>;
|
|
855
858
|
readonly FieldContentMain: react255.MemoExoticComponent<({
|
|
856
859
|
className,
|
|
857
860
|
...props
|
|
858
|
-
}: React.ComponentProps<"div">) =>
|
|
861
|
+
}: React.ComponentProps<"div">) => react_jsx_runtime333.JSX.Element>;
|
|
859
862
|
readonly FieldSeparator: react255.MemoExoticComponent<({
|
|
860
863
|
children,
|
|
861
864
|
className,
|
|
862
865
|
...props
|
|
863
|
-
}: React.PropsWithChildren<React.ComponentProps<"div">>) =>
|
|
866
|
+
}: React.PropsWithChildren<React.ComponentProps<"div">>) => react_jsx_runtime333.JSX.Element>;
|
|
864
867
|
readonly FieldError: react255.MemoExoticComponent<({
|
|
865
868
|
className,
|
|
866
869
|
children,
|
|
@@ -868,9 +871,10 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
|
|
|
868
871
|
...props
|
|
869
872
|
}: React.ComponentProps<"div"> & {
|
|
870
873
|
errors?: Array<{
|
|
874
|
+
code?: string;
|
|
871
875
|
message?: string;
|
|
872
876
|
} | undefined>;
|
|
873
|
-
}) =>
|
|
877
|
+
}) => react_jsx_runtime333.JSX.Element | null>;
|
|
874
878
|
}, {
|
|
875
879
|
readonly TanStackDialogForm: react255.FC<react255.PropsWithChildren<{
|
|
876
880
|
title: string;
|
|
@@ -1125,31 +1129,31 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
|
|
|
1125
1129
|
readonly FieldGroup: react255.MemoExoticComponent<({
|
|
1126
1130
|
className,
|
|
1127
1131
|
...props
|
|
1128
|
-
}: React.ComponentProps<"div">) =>
|
|
1132
|
+
}: React.ComponentProps<"div">) => react_jsx_runtime333.JSX.Element>;
|
|
1129
1133
|
readonly Field: react255.MemoExoticComponent<({
|
|
1130
1134
|
className,
|
|
1131
1135
|
orientation,
|
|
1132
1136
|
...props
|
|
1133
1137
|
}: React.ComponentProps<"div"> & class_variance_authority0.VariantProps<(props?: ({
|
|
1134
1138
|
orientation?: "vertical" | "horizontal" | "responsive" | null | undefined;
|
|
1135
|
-
} & class_variance_authority_types21.ClassProp) | undefined) => string>) =>
|
|
1139
|
+
} & class_variance_authority_types21.ClassProp) | undefined) => string>) => react_jsx_runtime333.JSX.Element>;
|
|
1136
1140
|
readonly FieldContent: react255.MemoExoticComponent<({
|
|
1137
1141
|
className,
|
|
1138
1142
|
...props
|
|
1139
|
-
}: React.ComponentProps<"div">) =>
|
|
1143
|
+
}: React.ComponentProps<"div">) => react_jsx_runtime333.JSX.Element>;
|
|
1140
1144
|
readonly FieldLabel: react255.MemoExoticComponent<({
|
|
1141
1145
|
className,
|
|
1142
1146
|
...props
|
|
1143
|
-
}: React.ComponentProps<typeof Label$1>) =>
|
|
1147
|
+
}: React.ComponentProps<typeof Label$1>) => react_jsx_runtime333.JSX.Element>;
|
|
1144
1148
|
readonly FieldContentMain: react255.MemoExoticComponent<({
|
|
1145
1149
|
className,
|
|
1146
1150
|
...props
|
|
1147
|
-
}: React.ComponentProps<"div">) =>
|
|
1151
|
+
}: React.ComponentProps<"div">) => react_jsx_runtime333.JSX.Element>;
|
|
1148
1152
|
readonly FieldSeparator: react255.MemoExoticComponent<({
|
|
1149
1153
|
children,
|
|
1150
1154
|
className,
|
|
1151
1155
|
...props
|
|
1152
|
-
}: React.PropsWithChildren<React.ComponentProps<"div">>) =>
|
|
1156
|
+
}: React.PropsWithChildren<React.ComponentProps<"div">>) => react_jsx_runtime333.JSX.Element>;
|
|
1153
1157
|
readonly FieldError: react255.MemoExoticComponent<({
|
|
1154
1158
|
className,
|
|
1155
1159
|
children,
|
|
@@ -1157,9 +1161,10 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
|
|
|
1157
1161
|
...props
|
|
1158
1162
|
}: React.ComponentProps<"div"> & {
|
|
1159
1163
|
errors?: Array<{
|
|
1164
|
+
code?: string;
|
|
1160
1165
|
message?: string;
|
|
1161
1166
|
} | undefined>;
|
|
1162
|
-
}) =>
|
|
1167
|
+
}) => react_jsx_runtime333.JSX.Element | null>;
|
|
1163
1168
|
}, {
|
|
1164
1169
|
readonly TanStackDialogForm: react255.FC<react255.PropsWithChildren<{
|
|
1165
1170
|
title: string;
|
|
@@ -1410,31 +1415,31 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
|
|
|
1410
1415
|
readonly FieldGroup: react255.MemoExoticComponent<({
|
|
1411
1416
|
className,
|
|
1412
1417
|
...props
|
|
1413
|
-
}: React.ComponentProps<"div">) =>
|
|
1418
|
+
}: React.ComponentProps<"div">) => react_jsx_runtime333.JSX.Element>;
|
|
1414
1419
|
readonly Field: react255.MemoExoticComponent<({
|
|
1415
1420
|
className,
|
|
1416
1421
|
orientation,
|
|
1417
1422
|
...props
|
|
1418
1423
|
}: React.ComponentProps<"div"> & class_variance_authority0.VariantProps<(props?: ({
|
|
1419
1424
|
orientation?: "vertical" | "horizontal" | "responsive" | null | undefined;
|
|
1420
|
-
} & class_variance_authority_types21.ClassProp) | undefined) => string>) =>
|
|
1425
|
+
} & class_variance_authority_types21.ClassProp) | undefined) => string>) => react_jsx_runtime333.JSX.Element>;
|
|
1421
1426
|
readonly FieldContent: react255.MemoExoticComponent<({
|
|
1422
1427
|
className,
|
|
1423
1428
|
...props
|
|
1424
|
-
}: React.ComponentProps<"div">) =>
|
|
1429
|
+
}: React.ComponentProps<"div">) => react_jsx_runtime333.JSX.Element>;
|
|
1425
1430
|
readonly FieldLabel: react255.MemoExoticComponent<({
|
|
1426
1431
|
className,
|
|
1427
1432
|
...props
|
|
1428
|
-
}: React.ComponentProps<typeof Label$1>) =>
|
|
1433
|
+
}: React.ComponentProps<typeof Label$1>) => react_jsx_runtime333.JSX.Element>;
|
|
1429
1434
|
readonly FieldContentMain: react255.MemoExoticComponent<({
|
|
1430
1435
|
className,
|
|
1431
1436
|
...props
|
|
1432
|
-
}: React.ComponentProps<"div">) =>
|
|
1437
|
+
}: React.ComponentProps<"div">) => react_jsx_runtime333.JSX.Element>;
|
|
1433
1438
|
readonly FieldSeparator: react255.MemoExoticComponent<({
|
|
1434
1439
|
children,
|
|
1435
1440
|
className,
|
|
1436
1441
|
...props
|
|
1437
|
-
}: React.PropsWithChildren<React.ComponentProps<"div">>) =>
|
|
1442
|
+
}: React.PropsWithChildren<React.ComponentProps<"div">>) => react_jsx_runtime333.JSX.Element>;
|
|
1438
1443
|
readonly FieldError: react255.MemoExoticComponent<({
|
|
1439
1444
|
className,
|
|
1440
1445
|
children,
|
|
@@ -1442,9 +1447,10 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
|
|
|
1442
1447
|
...props
|
|
1443
1448
|
}: React.ComponentProps<"div"> & {
|
|
1444
1449
|
errors?: Array<{
|
|
1450
|
+
code?: string;
|
|
1445
1451
|
message?: string;
|
|
1446
1452
|
} | undefined>;
|
|
1447
|
-
}) =>
|
|
1453
|
+
}) => react_jsx_runtime333.JSX.Element | null>;
|
|
1448
1454
|
}, {
|
|
1449
1455
|
readonly TanStackDialogForm: react255.FC<react255.PropsWithChildren<{
|
|
1450
1456
|
title: string;
|
|
@@ -1694,31 +1700,31 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
|
|
|
1694
1700
|
readonly FieldGroup: react255.MemoExoticComponent<({
|
|
1695
1701
|
className,
|
|
1696
1702
|
...props
|
|
1697
|
-
}: React.ComponentProps<"div">) =>
|
|
1703
|
+
}: React.ComponentProps<"div">) => react_jsx_runtime333.JSX.Element>;
|
|
1698
1704
|
readonly Field: react255.MemoExoticComponent<({
|
|
1699
1705
|
className,
|
|
1700
1706
|
orientation,
|
|
1701
1707
|
...props
|
|
1702
1708
|
}: React.ComponentProps<"div"> & class_variance_authority0.VariantProps<(props?: ({
|
|
1703
1709
|
orientation?: "vertical" | "horizontal" | "responsive" | null | undefined;
|
|
1704
|
-
} & class_variance_authority_types21.ClassProp) | undefined) => string>) =>
|
|
1710
|
+
} & class_variance_authority_types21.ClassProp) | undefined) => string>) => react_jsx_runtime333.JSX.Element>;
|
|
1705
1711
|
readonly FieldContent: react255.MemoExoticComponent<({
|
|
1706
1712
|
className,
|
|
1707
1713
|
...props
|
|
1708
|
-
}: React.ComponentProps<"div">) =>
|
|
1714
|
+
}: React.ComponentProps<"div">) => react_jsx_runtime333.JSX.Element>;
|
|
1709
1715
|
readonly FieldLabel: react255.MemoExoticComponent<({
|
|
1710
1716
|
className,
|
|
1711
1717
|
...props
|
|
1712
|
-
}: React.ComponentProps<typeof Label$1>) =>
|
|
1718
|
+
}: React.ComponentProps<typeof Label$1>) => react_jsx_runtime333.JSX.Element>;
|
|
1713
1719
|
readonly FieldContentMain: react255.MemoExoticComponent<({
|
|
1714
1720
|
className,
|
|
1715
1721
|
...props
|
|
1716
|
-
}: React.ComponentProps<"div">) =>
|
|
1722
|
+
}: React.ComponentProps<"div">) => react_jsx_runtime333.JSX.Element>;
|
|
1717
1723
|
readonly FieldSeparator: react255.MemoExoticComponent<({
|
|
1718
1724
|
children,
|
|
1719
1725
|
className,
|
|
1720
1726
|
...props
|
|
1721
|
-
}: React.PropsWithChildren<React.ComponentProps<"div">>) =>
|
|
1727
|
+
}: React.PropsWithChildren<React.ComponentProps<"div">>) => react_jsx_runtime333.JSX.Element>;
|
|
1722
1728
|
readonly FieldError: react255.MemoExoticComponent<({
|
|
1723
1729
|
className,
|
|
1724
1730
|
children,
|
|
@@ -1726,9 +1732,10 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
|
|
|
1726
1732
|
...props
|
|
1727
1733
|
}: React.ComponentProps<"div"> & {
|
|
1728
1734
|
errors?: Array<{
|
|
1735
|
+
code?: string;
|
|
1729
1736
|
message?: string;
|
|
1730
1737
|
} | undefined>;
|
|
1731
|
-
}) =>
|
|
1738
|
+
}) => react_jsx_runtime333.JSX.Element | null>;
|
|
1732
1739
|
}, {
|
|
1733
1740
|
readonly TanStackDialogForm: react255.FC<react255.PropsWithChildren<{
|
|
1734
1741
|
title: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../../heading--VmdIi7C.mjs";import"../../paragraph-BS88Xdo7.mjs";import"../../button.variants-CL2rLGYO.mjs";import{t as e}from"../../button-C_yZHudZ.mjs";import{t}from"../../separator-Bf0gymN4.mjs";import{t as n}from"../../close-DfuHB7kq.mjs";import{c as r,l as i,r as a,s as o,t as s}from"../../dialog-DTz8ngeU.mjs";import{t as c}from"../../checkbox-Bg2FiuQw.mjs";import{t as l}from"../../input-DBtIgQB6.mjs";import{a as u,i as d,t as f}from"../../popover-BckwBuuD.mjs";import{t as p}from"../../calendar-e9Pu8pNj.mjs";import{n as m,t as h}from"../../radio-group-Cem8O6BK.mjs";import{c as g,i as _,n as v,s as y,t as b}from"../../select-CivtMKTM.mjs";import{t as x}from"../../textarea-bLtmb71c.mjs";import{cn as S}from"@customafk/react-toolkit/utils";import{cva as C}from"class-variance-authority";import{memo as w,useCallback as T,useEffect as ee,useMemo as E,useRef as te,useState as D}from"react";import{jsx as O,jsxs as k}from"react/jsx-runtime";import{ArrowDownToLine as A,AtSignIcon as j,BanIcon as M,CalendarDaysIcon as N,EyeIcon as ne,EyeOffIcon as P,Loader2 as re,Loader2Icon as F,PackagePlusIcon as ie,PlusIcon as ae,Trash2Icon as oe,XIcon as se}from"lucide-react";import{endOfToday as I,endOfTomorrow as ce,endOfYesterday as le,format as ue,lastDayOfMonth as de,startOfMonth as fe,subDays as L}from"@customafk/react-toolkit/date-fns";import{Dialog as R,Label as pe,Separator as me,Switch as z}from"radix-ui";import{createFormHook as he,createFormHookContexts as ge,useStore as B}from"@tanstack/react-form";const _e=C([`flex w-fit items-center justify-center rounded-full font-bold text-text-negative-strong`],{variants:{color:{default:`bg-primary-strong`,secondary:`bg-secondary-strong`,success:`bg-success-strong`,info:`bg-info-strong`,warning:`bg-warning-strong`,danger:`border border-danger-strong bg-linear-to-b from-danger-strong/90 via-danger-strong to-danger-strong/90`},size:{xs:`px-1.5 py-0.5 text-xs`,sm:`px-2 py-0.75 text-xs`,md:`px-2.5 py-0.75 text-sm`,lg:`px-3 py-1 text-sm`}},defaultVariants:{color:`default`,size:`sm`}}),ve=({label:e,color:t,size:n,className:r,children:i})=>O(`div`,{"data-slot":`required-indicator`,className:_e({color:t,size:n,className:r}),children:e||i});function ye({className:e,children:t,...n}){return k(pe.Root,{"data-slot":`label`,className:S(`text-text-positive`,`flex w-full items-center justify-between`,`select-none font-medium text-sm/6 leading-none`,`group-data-[disabled=true]:pointer-events-none`,`group-data-[disabled=true]:opacity-50`,`peer-disabled:cursor-not-allowed`,`peer-disabled:opacity-50`,`aria-required:*:data-[slot=required-indicator]:inline-block`,e),...n,children:[t,O(ve,{label:`Required`,color:`danger`,size:`sm`,className:`hidden`})]})}const be=C(`group/field flex w-full gap-2 data-[invalid=true]:text-danger *:data-[slot=field-content]:gap-0 @md/field-group:*:data-[slot=field-content]:gap-2`,{variants:{orientation:{vertical:[`flex-col *:w-full [&>.sr-only]:w-auto`],horizontal:[`flex-row items-center`,`*:data-[slot=field-label]:flex-auto`,`has-[>[data-slot=field-content]]:items-start`,`has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`],responsive:[`flex-col *:w-full [&>.sr-only]:w-auto`,`@md/field-group:flex-row`,`@md/field-group:items-center`,`@md/field-group:gap-4`,`@md/field-group:*:w-auto`,`@md/field-group:*:data-[slot=field-content]:basis-1/2`,`@md/field-group:*:data-[slot=field-content-main]:basis-1/2`,`@md/field-group:*:data-[slot=field-label]:flex-auto`,`@md/field-group:has-[>[data-slot=field-content]]:items-start`,`@md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`]}},defaultVariants:{orientation:`vertical`}}),xe=w(({className:e,...t})=>O(`fieldset`,{"data-slot":`field-set`,className:S(`flex flex-col gap-6 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3`,e),...t}));xe.displayName=`FieldSet`;const Se=w(({className:e,variant:t=`legend`,...n})=>O(`legend`,{"data-slot":`field-legend`,"data-variant":t,className:S(`mb-3 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base`,e),...n}));Se.displayName=`FieldLegend`;const V=w(({className:e,...t})=>O(`div`,{"data-slot":`field-group`,className:S(`group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,e),...t}));V.displayName=`FieldGroup`;const H=w(({className:e,orientation:t=`vertical`,...n})=>O(`div`,{"data-slot":`field`,"data-orientation":t,className:S(be({orientation:t}),e),...n}));H.displayName=`Field`;const U=w(({className:e,...t})=>O(`div`,{"data-slot":`field-content`,className:S(`group/field-content flex flex-col gap-1.5 leading-snug`,e),...t}));U.displayName=`FieldContent`;const W=w(({className:e,...t})=>O(`div`,{"data-slot":`field-content-main`,className:S(`relative`,e),...t})),G=w(({className:e,...t})=>O(ye,{"data-slot":`field-label`,className:S(`group/field-label peer/field-label flex h-6 gap-1 font-medium leading-snug`,`has-[>[data-slot=field]]:w-full`,`has-[>[data-slot=field]]:flex-col`,`has-[>[data-slot=field]]:rounded-md`,`has-[>[data-slot=field]]:border`,`has-[>[data-slot=field]]:border-border`,`has-data-[state=checked]:border-primary`,`*:data-[slot=field]:p-4 group-data-[disabled=true]/field:opacity-50`,e),...t}));G.displayName=`FieldLabel`;const K=w(({className:e,...t})=>O(`div`,{"data-slot":`field-label`,className:S(`flex w-fit items-center gap-2 font-medium text-sm leading-snug group-data-[disabled=true]/field:opacity-50`,e),...t}));K.displayName=`FieldTitle`;const q=w(({className:e,...t})=>O(`p`,{"data-slot":`field-description`,className:S(`nth-last-2:-mt-1 font-normal text-sm text-text-positive-weak leading-normal last:mt-0 [&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4 [[data-variant=legend]+&]:-mt-1.5`,e),...t}));q.displayName=`FieldDescription`;const J=w(({isShow:e=!0,className:t,...n})=>e===!1?null:O(`div`,{"data-slot":`field-note`,className:S(`text-wrap rounded border border-primary-muted bg-primary-bg-subtle p-2 text-text-positive-weak text-xs`,t),...n}));J.displayName=`FieldNote`;const Y=w(({children:e,className:n,...r})=>k(`div`,{"data-slot":`field-separator`,"data-content":!!e,className:S(`relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2`,n),...r,children:[O(t,{className:`absolute inset-0 top-1/2`}),e&&O(`span`,{className:`relative mx-auto block w-fit bg-background px-2 text-text-positive-weak`,"data-slot":`field-separator-content`,children:e})]}));Y.displayName=`FieldSeparator`;const X=w(({className:e,children:t,errors:n,...r})=>{let i=E(()=>t||(n?n?.length===1&&n[0]?.message?O(`div`,{className:`flex flex-row items-center justify-start gap-x-0.5`,children:O(`p`,{children:n[0].message})}):O(`ul`,{className:`flex list-none flex-col`,children:n.map(e=>typeof e==`string`?O(`li`,{children:e},e):e?.message?O(`li`,{children:e.message},e.message):null)}):null),[t,n]);return i?O(`div`,{role:`alert`,"data-slot":`field-error`,className:S(`w-full font-semibold text-danger-strong text-xs`,e),...r,children:i}):null});X.displayName=`FieldError`;const Ce=({label:e,description:t,options:n,helperText:r,orientation:i})=>{let a=Q(),o=B(a.form.store,({isSubmitting:e})=>e);return k(V,{className:`gap-y-4 px-4`,children:[k(H,{orientation:i,children:[k(U,{children:[O(G,{children:e}),O(q,{children:t}),O(J,{isShow:!!r,children:r})]}),O(W,{children:O(V,{className:`flex flex-col gap-y-2`,children:n.map(e=>k(H,{orientation:`horizontal`,children:[O(c,{id:`${a.name}-${e.value}`,name:a.name,checked:a.state.value?.includes(e.value)??!1,disabled:o,onCheckedChange:t=>{if(t&&a.state.value!==null)a.pushValue(e.value);else if(t&&a.state.value===null)a.setValue([e.value]);else if(!t&&a.state.value!==null){let t=a.state.value.indexOf(e.value);t>-1&&a.removeValue(t)}else !t&&a.state.value===null&&a.setValue(null)}}),O(G,{htmlFor:`${a.name}-${e.value}`,className:`text-text-positive`,children:e.label})]},e.value))})})]}),O(Y,{})]})},we=({label:t,description:n,placeholder:r,orientation:i=`responsive`,helperText:a,minDate:o,maxDate:s,required:c})=>{let l=Q(),m=E(()=>c?l.state.value===null:!1,[c,l.state.value]),h=E(()=>l.state.meta.isTouched&&!l.state.meta.isValid,[l.state.meta.isTouched,l.state.meta.isValid]);return k(V,{className:`px-4`,children:[k(H,{orientation:i,"data-invalid":h,children:[k(U,{children:[O(G,{htmlFor:l.name,"aria-required":m,children:t}),O(q,{children:n})]}),k(W,{className:`flex flex-col space-y-1`,children:[O(`div`,{className:`flex w-full flex-col`,children:k(f,{children:[O(u,{asChild:!0,children:k(e,{variant:`outline`,color:`muted`,size:`lg`,className:S(`flex items-center justify-between rounded font-normal outline-border`,`hover:bg-transparent`,`focus:outline-1 focus:outline-primary-strong focus:ring-4 focus:ring-primary-weak`,`data-[state=open]:text-text-positive-muted`,`data-[state=open]:outline-1`,`data-[state=open]:outline-primary-strong`,`data-[state=open]:ring-4`,`data-[state=open]:ring-primary-weak`,l.state.value===null&&`text-text-positive-muted`),children:[O(`p`,{children:l.state.value===null?r||`Select date`:ue(l.state.value,`PPPP`)}),O(N,{strokeWidth:1})]})}),k(d,{align:`start`,side:`bottom`,className:`flex w-fit min-w-0 overflow-y-auto rounded p-0`,onBlur:l.handleBlur,children:[k(`div`,{className:`flex h-full flex-col space-y-2 border-r border-r-border p-2 [&>button]:justify-start [&>button]:text-sm`,children:[O(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{l.handleChange(I())},children:`Today`}),O(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{l.handleChange(ce())},children:`Tomorrow`}),O(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{l.handleChange(le())},children:`Yesterday`}),O(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{l.handleChange(L(I(),3))},children:`Last 3 Days`}),O(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{l.handleChange(L(I(),7))},children:`Last 7 Days`}),O(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{l.handleChange(L(I(),30))},children:`Last 30 Days`}),O(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{l.handleChange(fe(I()))},children:`This Month`}),O(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{l.handleChange(de(I()))},children:`Last Month`})]}),O(`div`,{className:`flex flex-1 flex-col`,children:O(`div`,{className:`min-w-73 border-b border-b-border p-2`,children:O(p,{mode:`single`,selected:l.state.value??void 0,hidden:{before:o??new Date(1900,0,1),after:s??new Date(2100,11,31)},onSelect:e=>{e&&l.handleChange(e)}})})})]})]})}),O(J,{isShow:!!a,children:a})]})]}),O(Y,{})]})},Te=({label:e,description:t,placeholder:n,orientation:r=`responsive`,helperText:i,showErrorMessage:a=!0,maxLength:o})=>{let{form:s,name:c,state:u,handleBlur:d,handleChange:f}=Q(),p=B(s.store,({isSubmitting:e})=>e),m=E(()=>u.meta.isTouched&&!u.meta.isValid,[u.meta.isTouched,u.meta.isValid]),h=T(({target:{value:e}})=>{p||o&&e.length>o||f(e||null)},[p,o,f]),g=T(()=>{p||f(null)},[p,f]);return k(V,{className:`gap-y-4 px-4`,children:[k(H,{"data-invalid":m,orientation:r,children:[k(U,{children:[O(G,{htmlFor:c,children:e}),O(q,{children:t})]}),k(W,{children:[O(l,{id:c,name:c,value:u.value===null?``:u.value,"aria-invalid":m,autoComplete:`email`,placeholder:n,className:S(`pl-9`,p&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:d,onChange:h}),O(`div`,{className:`absolute top-0 left-0 flex size-9 items-center justify-center text-muted`,children:O(j,{size:14})}),O(`button`,{type:`button`,"aria-label":`Clear`,className:`absolute inset-y-0 inset-e-0 top-3 flex h-fit w-8 cursor-pointer items-center justify-center rounded-e-md text-text-positive-weak outline-none transition-[color,box-shadow] hover:text-text-positive focus:text-text-positive-strong`,onClick:g,children:O(se,{size:14,"aria-hidden":`true`})}),O(`div`,{className:`mt-1 flex w-full items-start justify-start`,children:a&&O(X,{errors:u.meta.errors})}),O(J,{isShow:!!i,children:i})]})]}),O(Y,{})]})},Ee=e=>e?/^-?\d*\.?\d*$/:/^\d*\.?\d*$/,De=e=>Number(e).toLocaleString(),Oe=(e,t,n)=>{if(n===`none`)return e;let r=10**t,i=e*r;switch(n){case`up`:return Math.ceil(i)/r;case`down`:return Math.floor(i)/r;case`nearest`:return i%1<.1?Math.floor(i)/r:i%1>=.59?Math.ceil(i)/r:(Math.floor(i)+.5)/r;default:return e}},ke=({disabled:e=!1,readOnly:t=!1,allowNegative:n=!1,numberAfterDecimalPoint:r=2,roundingRule:i=`none`,value:a=null,unitText:o,decimal:s,placeholder:c,precision:u,wrapperClassName:d,className:f,onChange:p,onValueChange:m,onFocus:h,onBlur:g,..._})=>{let v=te(null),y=te(null),[b,x]=D(a?.toString()??null),C=E(()=>s?.[1]??r,[s,r]),w=E(()=>s&&s[0]-s[1],[s]),A=E(()=>Ee(n),[n]),j=T(e=>{if(!C||e===`-`)return!0;let[t,n=``]=e.split(`.`),r=t.startsWith(`-`)?t.length-1:t.length;return n.length<=C&&r<=(w??1/0)},[C,w]),M=T(e=>{if(e===`0`)return`0`;if(!Number(e))return null;let[t,n=``]=Oe(parseFloat(e),Math.min(C-1,u||0),i).toString().split(`.`),r=De(t);return n?`${r}.${n}`:r},[C,u,i]),N=T(e=>{let t=e===`0`,n=e===`-`||/^-0+(\.0+)?$/.test(e)||/^-0*\.$/.test(e);if(t){m?.(0),x(e);return}if(n){x(()=>(m?.(0),e));return}},[m]),ne=T(e=>{p?.(e);let{value:t}=e.target;if(t===``||t===void 0){m?.(null),x(null);return}N(t),!(!A.test(t)||!j(t))&&(m?.(parseFloat(t)||0),x(t))},[j,p,m,N,A]),P=T(e=>{t||(h?.(e),x(e=>typeof e==`string`?e.replace(/,/g,``):null))},[t,h]),re=T(e=>{t||(g?.(e),x(e=>e===null?null:e===`0`||e===`-`||/^-0+(\.0+)?$/.test(e)||/^-0*\.$/.test(e)?`0`:typeof e==`string`?M(e):null))},[t,M,g]);return ee(()=>{let e=document.activeElement===y.current;if(a==null||!A.test(a.toString())||!j(a.toString())){x(null);return}x(t=>e?t:M(a.toString()))},[M,a,j,A]),ee(()=>{if(!v.current||!y.current||!o)return;let e=v.current.offsetWidth;y.current.style.setProperty(`padding-right`,`${(e+10)/16}rem`)},[o]),k(`div`,{className:S(`relative`,d),children:[O(l,{..._,ref:y,value:b||(t?`0`:``),placeholder:c,disabled:e,readOnly:t,className:S(`text-end font-number text-sm slashed-zero lining-nums tabular-nums`,t&&`bg-muted text-muted-foreground`,f),onChange:ne,onFocus:P,onBlur:re}),o&&O(`span`,{ref:v,className:`-translate-y-1/2 pointer-events-none absolute top-1/2 right-2 text-muted-foreground text-sm`,children:o})]})},Ae=({label:e,description:t,placeholder:n,helperText:r,orientation:i=`responsive`,showErrorMessage:a=!0,rounding:o,decimalPlaces:s,percision:c,unit:l,required:u,allowNegative:d})=>{let f=Q(),p=B(f.form.store,({isSubmitting:e})=>e),m=E(()=>f.state.meta.errors,[f.state.meta.errors]),h=E(()=>u?f.state.value===null:!1,[u,f.state.value]),g=T(e=>{p||f.handleChange(e)},[p,f.handleChange]);return k(V,{className:`gap-y-4 px-4`,children:[k(H,{orientation:i,"data-invalid":f.state.meta.isTouched&&!f.state.meta.isValid,children:[k(U,{children:[O(G,{htmlFor:f.name,"aria-required":h,children:e}),O(q,{children:t})]}),k(W,{children:[k(`div`,{className:`relative w-full`,children:[O(ke,{id:f.name,value:f.state.value,"aria-invalid":f.state.meta.isTouched&&!f.state.meta.isValid&&f.state.meta.isDirty,placeholder:n,roundingRule:o,numberAfterDecimalPoint:s,precision:c,unitText:l,allowNegative:d,className:S(p&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:f.handleBlur,onValueChange:g}),p&&O(`div`,{className:`absolute inset-s-2 inset-y-0 top-2.5 text-muted-weak [&>svg]:size-3.5`,children:O(F,{className:`animate-spin text-primary-strong`})}),f.state.meta.isDirty&&a&&!!m.length&&O(`div`,{className:`absolute inset-s-2 inset-y-0 top-2.75 text-danger-strong [&>svg]:size-3.5`,children:O(M,{})}),O(`div`,{className:`mt-1 flex w-full flex-col items-end justify-end`,children:f.state.meta.isDirty&&a&&O(X,{errors:m})})]}),O(J,{isShow:!!r,children:r})]})]}),O(Y,{})]})},je=({label:e,description:t,placeholder:n,orientation:r=`responsive`,helperText:i,showErrorMessage:a=!0})=>{let{form:o,name:s,state:c,handleBlur:u,handleChange:d}=Q(),f=B(o.store,({isSubmitting:e})=>e),[p,m]=D(!1),h=E(()=>c.meta.isTouched&&!c.meta.isValid,[c.meta.isTouched,c.meta.isValid]),g=T(()=>m(e=>!e),[]),_=T(({target:{value:e}})=>{f||d(e||null)},[f,d]);return O(V,{className:`gap-y-4 px-4`,children:k(H,{"data-invalid":h,orientation:r,children:[k(U,{children:[O(G,{htmlFor:s,children:e}),O(q,{children:t})]}),k(W,{children:[O(l,{id:s,type:p?`text`:`password`,placeholder:n,value:c.value??``,"aria-invalid":h,autoComplete:`new-password`,onBlur:u,onChange:_}),O(`button`,{className:`absolute inset-y-0 inset-e-0 flex size-9 items-center justify-center rounded-e-md text-muted outline-none transition-[color,box-shadow] focus:z-10 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,type:`button`,onClick:g,"aria-label":p?`Hide password`:`Show password`,"aria-pressed":p,"aria-controls":`password`,children:O(p?P:ne,{size:16,"aria-hidden":`true`})}),O(`div`,{className:`mt-1 flex w-full items-start justify-start`,children:a&&O(X,{errors:c.meta.errors})}),O(J,{isShow:!!i,children:i})]})]})})},Me=({label:e,description:t,orientation:n,options:r,helperText:i})=>{let a=Q(),o=B(a.form.store,({isSubmitting:e})=>e);return k(V,{className:`px-4`,children:[k(H,{orientation:n,className:`flex-col gap-2`,children:[k(U,{children:[O(G,{children:e}),O(q,{children:t}),O(J,{isShow:!!i,children:i})]}),O(W,{children:O(h,{defaultValue:a.state.value??void 0,className:`w-full`,onValueChange:a.handleChange,children:r.map(e=>O(G,{className:S(`h-fit`,a.state.value===e.value&&`border-primary-weak! bg-primary-bg-subtle`,o&&`pointer-events-none bg-muted-muted opacity-60`,a.state.value===e.value&&o&&`border-border-strong!`),children:k(H,{orientation:`horizontal`,className:`justify-between rounded p-2!`,children:[k(U,{className:`gap-1!`,children:[O(K,{children:e.label}),O(q,{className:`text-xs`,children:e.description})]}),O(m,{value:e.value})]})},e.value))})})]}),O(Y,{})]})},Ne=({label:e,description:t,placeholder:n,orientation:r=`responsive`,options:i,helperText:a,required:o=!1})=>{let s=Q(),c=E(()=>s.state.meta.isTouched&&!s.state.meta.isValid,[s.state.meta.isTouched,s.state.meta.isValid]),l=E(()=>o?s.state.value===null:!1,[o,s.state.value]),u=E(()=>s.state.meta.errors,[s.state.meta.errors]);return k(V,{className:`gap-y-4 px-4`,children:[k(H,{orientation:r,"data-invalid":s.state.meta.isTouched&&!s.state.meta.isValid,children:[k(U,{children:[O(G,{htmlFor:s.name,"aria-required":l,children:e}),O(q,{children:t})]}),k(W,{className:`flex flex-col`,children:[k(b,{defaultValue:s.state.value||void 0,onValueChange:s.handleChange,children:[O(y,{"aria-invalid":c?`true`:void 0,onBlur:s.handleBlur,children:O(g,{placeholder:n})}),k(v,{children:[!!i.length&&i.map(e=>O(_,{value:e.value,children:e.label},e.value)),!i.length&&k(`div`,{className:`flex items-center justify-center gap-x-2 rounded border border-border bg-muted-muted px-4 py-6.5 text-center text-sm text-text-positive-weak`,children:[O(ie,{strokeWidth:1}),`No options available`]})]})]}),O(`div`,{className:`mt-1 flex w-full flex-col items-end justify-end`,children:O(X,{errors:u})}),O(J,{isShow:!!a,children:a})]})]}),O(Y,{})]})};function Pe({className:e,...t}){return O(z.Root,{"data-slot":`switch`,className:S(`peer`,`w-8 shrink-0 cursor-pointer items-center rounded-full shadow-xs transition-all`,`inline-flex h-5`,`focus-visible:border-primary-strong`,`focus-visible:ring-primary-weak`,`focus-visible:ring-4`,`disabled:cursor-not-allowed`,`disabled:opacity-50`,`-outline-offset-1 inset-shadow-2xs outline-1`,`data-[state=checked]:bg-primary`,`data-[state=checked]:outline-primary-strong`,`data-[state=unchecked]:bg-muted-weak`,`data-[state=unchecked]:outline-border`,`data-[state=unchecked]:[&_span]:size-4`,`data-[state=unchecked]:[&_span]:translate-x-0.5`,`data-[state=unchecked]:[&_span]:rtl:-translate-x-0.5`,e),...t,children:O(z.Thumb,{"data-slot":`switch-thumb`,className:S(`block size-4 bg-card shadow-xs`,`pointer-events-none rounded-full ring-0 transition-transform`,`data-[state=checked]:translate-x-[calc(100%-3px)]`,`data-[state=unchecked]:translate-x-0`)})})}const Fe=({label:e,description:t,helperText:n})=>{let r=Q();return k(V,{className:`gap-y-4 px-4`,children:[k(H,{orientation:`vertical`,className:`relative justify-between gap-y-1`,children:[k(U,{children:[O(K,{className:`cursor-pointer`,children:O(`label`,{htmlFor:r.name,children:e})}),O(q,{children:t}),O(Pe,{id:r.name,checked:r.state.value??!1,className:`absolute top-1 right-1`,onBlur:r.handleBlur,onCheckedChange:r.handleChange})]}),O(J,{isShow:!!n,children:n})]}),O(Y,{})]})},Ie=({label:e,description:t,placeholder:n,helperText:r,counter:i=!1,orientation:a=`responsive`,showClearButton:o=!1,showErrorMessage:s=!0,required:c=!1,maxLength:u})=>{let{form:d,name:f,state:p,handleBlur:m,handleChange:h}=Q(),g=B(d.store,({isSubmitting:e})=>e),_=E(()=>o&&!g,[o,g]),v=E(()=>p.value?p.value.length:0,[p.value]),y=E(()=>{if(!i)return``;let e=`character${[0,1].includes(v)?``:`s`}`;return i&&u?`${v} / ${u} ${e}`:`${v} ${e}`},[v,i,u]),b=E(()=>p.meta.isDirty&&p.meta.isTouched&&!p.meta.isValid,[p.meta.isDirty,p.meta.isTouched,p.meta.isValid]),x=E(()=>c?p.value===null:!1,[c,p.value]),C=T(({target:{value:e}})=>{g||i&&u&&e.length>u||h(e||null)},[g,i,u,h]),w=T(()=>{g||h(``)},[g,h]);return k(V,{className:`gap-y-4 px-4`,children:[k(H,{orientation:a,"data-invalid":b,children:[k(U,{children:[O(G,{"aria-required":x,htmlFor:f,children:e}),O(q,{children:t})]}),k(W,{children:[O(l,{id:f,name:f,value:p.value===null?``:p.value,"aria-invalid":b,autoComplete:`off`,placeholder:n,className:S(`pr-6`,g&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:m,onChange:C}),_&&!p.meta.errors.length&&O(`button`,{type:`button`,"aria-label":`Clear`,className:`absolute inset-e-0 inset-y-0 top-3 flex h-fit w-8 cursor-pointer items-center justify-center rounded-e-md text-text-positive-weak outline-none transition-[color,box-shadow] hover:text-text-positive focus:text-text-positive-intense [&>svg]:size-3.5`,onClick:w,children:O(se,{"aria-hidden":`true`})}),g&&O(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-muted-weak`,children:O(F,{size:14,className:`animate-spin text-primary-strong`})}),p.meta.isDirty&&s&&!!p.meta.errors.length&&O(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-danger-strong`,children:O(M,{size:14})}),k(`div`,{className:`mt-1 flex w-full items-start gap-x-2`,children:[p.meta.isDirty&&s&&O(X,{className:`flex-1`,errors:p.meta.errors}),!!i&&O(`p`,{className:`h-4 flex-0 text-nowrap text-end text-text-positive-weak text-xs tabular-nums`,children:y})]}),O(J,{isShow:!!r,children:r})]})]}),O(Y,{})]})},Le=({label:e,description:t,placeholder:n,helperText:r,counter:i=!1,orientation:a=`responsive`,showErrorMessage:o=!0,required:s=!1,maxLength:c})=>{let{form:l,state:u,name:d,handleBlur:f,handleChange:p}=Q(),m=B(l.store,({isSubmitting:e})=>e),h=E(()=>u.value?u.value.length:0,[u.value]),g=E(()=>{if(!i)return``;let e=`character${[0,1].includes(h)?``:`s`}`;return i&&c?`${h} / ${c} ${e}`:`${h} ${e}`},[h,i,c]),_=E(()=>u.meta.isDirty&&u.meta.isTouched&&!u.meta.isValid,[u.meta.isDirty,u.meta.isTouched,u.meta.isValid]),v=E(()=>u.meta.errors,[u.meta.errors]),y=E(()=>s?u.value===null:!1,[s,u.value]),b=T(({target:{value:e}})=>{m||i&&c&&e.length>c||p(e||null)},[m,i,c,p]);return k(V,{className:`px-4`,children:[k(H,{orientation:a,"data-invalid":_,children:[k(U,{children:[O(G,{"aria-required":y,htmlFor:d,children:e}),O(q,{children:t})]}),k(W,{children:[O(x,{id:d,name:d,value:u.value===null?``:u.value,"aria-invalid":_,autoComplete:`off`,placeholder:n,className:S(m&&`pointer-events-none bg-muted-muted opacity-60`),onChange:b,onBlur:f}),m&&O(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-muted-weak`,children:O(F,{size:14,className:`animate-spin text-primary-strong`})}),u.meta.isDirty&&o&&!!v.length&&O(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-danger-strong`,children:O(M,{size:14})}),k(`div`,{className:`mt-1 flex w-full items-start gap-x-2`,children:[u.meta.isDirty&&o&&O(X,{className:`flex-1`,errors:v}),!!i&&O(`p`,{className:`h-4 flex-0 text-nowrap text-end text-text-positive-weak text-xs tabular-nums`,children:g})]}),O(J,{isShow:!!r,children:r})]})]}),O(Y,{})]})},Re=({label:t,className:n})=>{let r=$(),i=T(async()=>{await r.handleSubmit({submitAction:`submit`}),r.state.isSubmitSuccessful&&r.reset()},[r]);return O(r.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:r,isSubmitting:a})=>O(e,{type:`button`,size:`md`,disabled:r,isLoading:a,className:S(`min-h-8 min-w-32`,n),onClick:i,children:t??`Submit`})})},ze=({type:t=`create`})=>{let n=$();return k(`div`,{className:`flex h-8 items-center justify-between`,children:[O(n.Subscribe,{selector:e=>({disabled:e.isPristine||e.isSubmitting}),children:({disabled:t})=>O(e,{color:`muted`,variant:`outline`,type:`button`,size:`md`,disabled:t,className:`h-full min-w-32`,onClick:()=>n.reset(),children:`Cancel`})}),t===`create`&&O(n.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:t,isSubmitting:r})=>k(e,{type:`submit`,size:`md`,disabled:t,isLoading:r,className:`h-full min-w-32`,onClick:async()=>{await n.handleSubmit({submitAction:`create`}),n.state.isSubmitSuccessful&&n.reset()},children:[O(ae,{}),`Add New`]})}),t===`update`&&O(n.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:t,isSubmitting:r})=>k(e,{type:`submit`,size:`md`,disabled:t,isLoading:r,className:`h-full min-w-32`,onClick:async()=>{await n.handleSubmit({submitAction:`update`}),n.state.isSubmitSuccessful&&n.reset()},children:[O(A,{}),`Update`]})})]})};function Z({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return O(me.Root,{"data-slot":`separator`,decorative:n,orientation:t,className:S(`shrink-0 bg-border-weak`,`data-[orientation=horizontal]:h-px`,`data-[orientation=horizontal]:w-full`,`data-[orientation=vertical]:h-full`,`data-[orientation=vertical]:w-px`,e),...r})}const Be=({title:t,description:n,onDelete:r,children:i})=>k(`section`,{"data-slot":`card-form`,className:`relative flex flex-col rounded-md bg-card pb-4 shadow-card ring-4 ring-border-weak`,children:[k(`div`,{"data-slot":`card-form-header`,className:`flex flex-col space-y-1 p-4`,children:[O(`p`,{className:`font-semibold text-lg`,children:t}),!!n&&O(`p`,{className:`text-muted text-sm`,children:n})]}),O(Z,{}),O(`div`,{"data-slot":`card-form-main`,className:`flex flex-col space-y-4 py-4`,children:i}),!!r&&k(e,{color:`danger`,variant:`outline`,size:`sm`,className:`absolute top-2 right-2`,onClick:e=>{r?.(),e.preventDefault(),e.stopPropagation()},children:[O(oe,{}),`Remove`]})]}),Ve=({children:e})=>O(`div`,{"data-slot":`section-form`,className:`flex flex-col space-y-4`,children:e}),He=({...e})=>O(`button`,{...e,type:`button`,className:`min-w-40 cursor-pointer rounded-sm border border-border bg-card px-4 py-2 font-semibold text-sm text-text-positive shadow-xs outline-none transition-all hover:opacity-90 focus:border-border focus:ring-3 focus:ring-border/80 focus:ring-offset-2 focus:drop-shadow-none disabled:pointer-events-none disabled:opacity-60 disabled:drop-shadow-none`,children:`Hủy`}),Ue=({isSubmitting:e,submitText:t=`Submit`,...n})=>O(`button`,{...n,type:`button`,"data-loading":e?`true`:void 0,className:`relative min-h-9.5 min-w-40 cursor-pointer rounded-sm border border-primary-strong bg-primary px-4 py-2 font-semibold text-sm text-text-negative shadow-card outline-none transition-all hover:opacity-90 focus:border-transparent focus:ring-3 focus:ring-primary/80 focus:ring-offset-2 focus:drop-shadow-none disabled:pointer-events-none disabled:opacity-60 disabled:drop-shadow-none data-[loading=true]:pointer-events-none data-[loading=true]:opacity-80`,children:e?O(re,{size:16,strokeWidth:3,className:`absolute top-1/2 left-1/2 z-10 -translate-x-1/2 -translate-y-1/2 animate-spin`}):t}),We=({title:e,submitText:n,open:c,onOpenChange:l,children:u})=>{let d=$(),f=T(e=>{e||d.reset(),l?.(e)},[d.reset,l]);return O(s,{open:c,onOpenChange:f,children:k(r,{"data-slot":`dialog-portal`,children:[O(o,{}),k(a,{className:`flex size-full max-h-dvh max-w-dvw flex-col gap-0 overflow-y-auto p-0 shadow-dialog sm:h-auto sm:max-h-[85dvh] sm:max-w-2xl sm:rounded-sm`,children:[O(`div`,{"data-slot":`dialog-header`,className:`flex flex-col items-center justify-center gap-2 px-4 py-6 text-center shadow-sm sm:text-left`,children:O(i,{"data-slot":`dialog-title`,children:e})}),O(t,{}),O(`div`,{"data-slot":`dialog-content`,className:`relative flex flex-col space-y-4 overflow-y-auto p-0 pt-6 max-sm:flex-1 sm:p-4`,children:u}),O(t,{}),k(`div`,{"data-slot":`dialog-footer`,className:`flex flex-col-reverse items-center justify-between gap-2 px-6 py-4 shadow-sm sm:flex-row sm:justify-end max-sm:[&>button]:w-full`,children:[O(d.Subscribe,{selector:e=>({disabled:e.isSubmitting}),children:({disabled:e})=>O(He,{disabled:e,onClick:()=>{d.reset(),f(!1)}})}),O(d.Subscribe,{selector:e=>({isSubmitting:e.isSubmitting,disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit}),children:({isSubmitting:e,disabled:t})=>O(Ue,{isSubmitting:e,disabled:t,submitText:n,onClick:()=>d.handleSubmit()})})]})]})]})})},Ge=({label:e,description:t,helperText:n,orientation:r=`responsive`,children:i})=>k(V,{className:`gap-y-4 px-4`,children:[k(H,{orientation:r,children:[k(U,{children:[O(G,{children:e}),O(q,{children:t})]}),k(W,{children:[i,O(J,{isShow:!!n,children:n})]})]}),O(Y,{})]}),Ke=({title:e,open:t,contentClassName:r,onOpenChange:i,children:a})=>{let o=$();return O(R.Root,{"data-slot":`dialog`,open:t,onOpenChange:i,children:k(R.Portal,{"data-slot":`dialog-portal`,children:[O(R.Overlay,{"data-slot":`dialog-overlay`,className:S(`fixed inset-0 z-40 bg-black/50 backdrop-blur-sm`,`data-[state=open]:animate-in`,`data-[state=open]:fade-in`,`data-[state=closed]:animate-out`,`data-[state=closed]:fade-out`)}),O(R.Content,{"data-slot":`dialog-content`,className:S(`fixed top-4 right-4 z-50 h-[calc(100dvh-2rem)] min-w-sm max-w-xl rounded-md bg-background drop-shadow-lg`,`duration-300`,`data-[state=open]:animate-in`,`data-[state=open]:slide-in-from-right`,`data-[state=open]:fade-in`,`data-[state=closed]:animate-out`,`data-[state=closed]:slide-out-to-right`,`data-[state=closed]:fade-out`),children:k(`section`,{className:`relative flex size-full flex-col`,children:[O(`header`,{className:`flex h-14 items-center border-border border-b px-4`,children:O(`h2`,{className:`font-semibold text-lg text-primary-strong`,children:e})}),O(`div`,{className:S(`flex flex-1 flex-col overflow-y-auto py-4`,r),children:a}),k(`div`,{className:`flex flex-col space-y-4 border-border border-t px-4 py-2`,children:[O(o.Subscribe,{selector:e=>({isSubmitting:e.isSubmitting,disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit}),children:({isSubmitting:e,disabled:t})=>O(Ue,{isSubmitting:e,disabled:t,className:`w-full`,onClick:()=>o.handleSubmit()})}),O(o.Subscribe,{selector:e=>({disabled:e.isPristine||e.isSubmitting}),children:({disabled:e})=>O(He,{disabled:e,className:`w-full`,onClick:()=>{o.reset(),i?.(!1)}})})]}),O(R.Close,{asChild:!0,children:O(n,{className:`absolute top-2 right-2`})})]})})]})})},qe=({children:e})=>O(`header`,{"data-slot":`section-header`,className:`px-4 pt-2.5 pb-2 font-medium text-base text-primary-strong`,children:e}),Je=({children:e})=>O(`main`,{"data-slot":`section-main`,className:`relative flex flex-col space-y-4 py-4`,children:e}),Ye=({title:e,children:t})=>k(`section`,{"data-slot":`section-form`,className:`flex flex-col rounded-md bg-background shadow-card ring-4 ring-border-weak`,children:[O(qe,{children:e}),O(Z,{}),O(Je,{children:t})]}),Xe=({title:e,description:t,helperText:n})=>k(V,{className:`gap-y-4 px-4`,children:[k(H,{className:`gap-0`,children:[k(U,{children:[O(Se,{className:`mb-1`,children:e}),O(q,{children:t})]}),O(J,{isShow:!!n,children:n})]}),O(Y,{})]}),{fieldContext:Ze,formContext:Qe,useFieldContext:Q,useFormContext:$}=ge(),{useAppForm:$e,withForm:et,withFieldGroup:tt}=he({fieldContext:Ze,formContext:Qe,fieldComponents:{TextField:Ie,TextareaField:Le,NumberField:Ae,EmailField:Te,PasswordField:je,SelectField:Ne,DateField:we,SwitchField:Fe,RadioGroupField:Me,CheckboxField:Ce,FieldGroup:V,Field:H,FieldContent:U,FieldLabel:G,FieldContentMain:W,FieldSeparator:Y,FieldError:X},formComponents:{TanStackDialogForm:We,TanStackPopoverForm:Ke,TanStackContainerForm:Ve,TanStackSectionForm:Ye,TanStackCardForm:Be,TanStackFieldGroup:Ge,TanStackTitleField:Xe,TanStackActionsForm:ze,TanStackActionSubmit:Re}});export{H as Field,U as FieldContent,W as FieldContentMain,X as FieldError,V as FieldGroup,G as FieldLabel,Y as FieldSeparator,Q as useTanStackFieldContext,$e as useTanStackForm,$ as useTanStackFormContext,tt as withTanStackFieldGroup,et as withTanStackForm};
|
|
1
|
+
import"../../heading--VmdIi7C.mjs";import"../../paragraph-moBSTPmT.mjs";import"../../button.variants-DuuH1O0_.mjs";import{t as e}from"../../button-DXPSlb3I.mjs";import{t}from"../../separator-Bf0gymN4.mjs";import{t as n}from"../../close-DfuHB7kq.mjs";import{c as r,l as i,r as a,s as o,t as s}from"../../dialog-CxELDK98.mjs";import{t as c}from"../../checkbox-Bg2FiuQw.mjs";import{t as l}from"../../input-DBtIgQB6.mjs";import{a as u,i as d,t as f}from"../../popover-BckwBuuD.mjs";import{t as p}from"../../calendar-CEF9LSd4.mjs";import{n as m,t as h}from"../../radio-group-Cem8O6BK.mjs";import{c as g,i as _,n as v,s as y,t as b}from"../../select-CivtMKTM.mjs";import{t as x}from"../../textarea-bLtmb71c.mjs";import{cn as S}from"@customafk/react-toolkit/utils";import{cva as C}from"class-variance-authority";import{memo as w,useCallback as T,useEffect as E,useId as D,useMemo as O,useRef as k,useState as A}from"react";import{jsx as j,jsxs as M}from"react/jsx-runtime";import{ArrowDownToLine as N,AtSignIcon as P,BanIcon as F,CalendarDaysIcon as I,EyeIcon as ee,EyeOffIcon as te,Loader2 as ne,Loader2Icon as L,PackagePlusIcon as re,PlusIcon as ie,Trash2Icon as ae,XIcon as oe}from"lucide-react";import{endOfToday as R,endOfTomorrow as se,endOfYesterday as ce,format as le,lastDayOfMonth as ue,startOfMonth as de,subDays as z}from"@customafk/react-toolkit/date-fns";import{Dialog as B,Label as fe,Separator as pe,Switch as me}from"radix-ui";import{createFormHook as he,createFormHookContexts as ge,useStore as V}from"@tanstack/react-form";const _e=C([`flex w-fit items-center justify-center rounded-full font-bold text-text-negative-strong`],{variants:{color:{default:`bg-primary-strong`,secondary:`bg-secondary-strong`,success:`bg-success-strong`,info:`bg-info-strong`,warning:`bg-warning-strong`,danger:`border border-danger-strong bg-linear-to-b from-danger-strong/90 via-danger-strong to-danger-strong/90`},size:{xs:`px-1.5 py-0.5 text-xs`,sm:`px-2 py-0.75 text-xs`,md:`px-2.5 py-0.75 text-sm`,lg:`px-3 py-1 text-sm`}},defaultVariants:{color:`default`,size:`sm`}}),ve=({label:e,color:t,size:n,className:r,children:i})=>j(`div`,{"data-slot":`required-indicator`,className:_e({color:t,size:n,className:r}),children:e||i});function ye({className:e,children:t,...n}){return M(fe.Root,{"data-slot":`label`,className:S(`text-text-positive`,`flex w-full items-center justify-between`,`select-none font-medium text-sm/6 leading-none`,`group-data-[disabled=true]:pointer-events-none`,`group-data-[disabled=true]:opacity-50`,`peer-disabled:cursor-not-allowed`,`peer-disabled:opacity-50`,`aria-required:*:data-[slot=required-indicator]:inline-block`,e),...n,children:[t,j(ve,{label:`Required`,color:`danger`,size:`sm`,className:`hidden`})]})}const be=C(`group/field flex w-full gap-2 data-[invalid=true]:text-danger *:data-[slot=field-content]:gap-0`,{variants:{orientation:{vertical:[`flex-col *:w-full [&>.sr-only]:w-auto`],horizontal:[`flex-row items-center`,`*:data-[slot=field-label]:flex-auto`,`has-[>[data-slot=field-content]]:items-start`,`has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`],responsive:[`flex-col *:w-full [&>.sr-only]:w-auto`,`@md/field-group:flex-row`,`@md/field-group:items-center`,`@md/field-group:gap-4`,`@md/field-group:*:w-auto`,`@md/field-group:*:data-[slot=field-content]:basis-1/2`,`@md/field-group:*:data-[slot=field-content-main]:basis-1/2`,`@md/field-group:*:data-[slot=field-label]:flex-auto`,`@md/field-group:has-[>[data-slot=field-content]]:items-start`,`@md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`]}},defaultVariants:{orientation:`vertical`}}),xe=w(({className:e,...t})=>j(`fieldset`,{"data-slot":`field-set`,className:S(`flex flex-col gap-6 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3`,e),...t}));xe.displayName=`FieldSet`;const Se=w(({className:e,variant:t=`legend`,...n})=>j(`legend`,{"data-slot":`field-legend`,"data-variant":t,className:S(`mb-3 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base`,e),...n}));Se.displayName=`FieldLegend`;const H=w(({className:e,...t})=>j(`div`,{"data-slot":`field-group`,className:S(`group/field-group @container/field-group`,`flex flex-col gap-7`,`data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,e),...t}));H.displayName=`FieldGroup`;const U=w(({className:e,orientation:t=`vertical`,...n})=>j(`div`,{"data-slot":`field`,"data-orientation":t,className:S(be({orientation:t}),e),...n}));U.displayName=`Field`;const W=w(({className:e,...t})=>j(`div`,{"data-slot":`field-content`,className:S(`group/field-content flex flex-col gap-1.5 leading-snug`,e),...t}));W.displayName=`FieldContent`;const G=w(({className:e,...t})=>j(`div`,{"data-slot":`field-content-main`,className:S(`relative`,e),...t})),K=w(({className:e,...t})=>j(ye,{"data-slot":`field-label`,className:S(`group/field-label peer/field-label flex h-6 gap-1 font-medium leading-snug`,`has-[>[data-slot=field]]:w-full`,`has-[>[data-slot=field]]:flex-col`,`has-[>[data-slot=field]]:rounded-md`,`has-[>[data-slot=field]]:border`,`has-[>[data-slot=field]]:border-border`,`has-data-[state=checked]:border-primary`,`*:data-[slot=field]:p-4 group-data-[disabled=true]/field:opacity-50`,e),...t}));K.displayName=`FieldLabel`;const q=w(({className:e,...t})=>j(`div`,{"data-slot":`field-label`,className:S(`flex w-fit items-center gap-2 font-medium text-sm leading-snug group-data-[disabled=true]/field:opacity-50`,e),...t}));q.displayName=`FieldTitle`;const J=w(({className:e,...t})=>j(`p`,{"data-slot":`field-description`,className:S(`nth-last-2:-mt-1 font-normal text-text-positive-weak text-xs leading-normal last:mt-0 [&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4 [[data-variant=legend]+&]:-mt-1.5`,e),...t}));J.displayName=`FieldDescription`;const Y=w(({isShow:e=!0,className:t,...n})=>e===!1?null:j(`div`,{"data-slot":`field-note`,className:S(`text-wrap rounded border border-primary-muted bg-primary-bg-subtle p-2 text-text-positive-weak text-xs`,t),...n}));Y.displayName=`FieldNote`;const X=w(({children:e,className:n,...r})=>M(`div`,{"data-slot":`field-separator`,"data-content":!!e,className:S(`relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2`,n),...r,children:[j(t,{className:`absolute inset-0 top-1/2`}),e&&j(`span`,{className:`relative mx-auto block w-fit bg-background px-2 text-text-positive-weak`,"data-slot":`field-separator-content`,children:e})]}));X.displayName=`FieldSeparator`;const Z=w(({className:e,children:t,errors:n,...r})=>{let i=O(()=>t||(n?n?.length===1&&n[0]?.message?j(`div`,{className:`flex flex-row items-center justify-start gap-x-0.5`,children:j(`p`,{children:n[0]?.code===`invalid_type`?`Không đúng định dạng`:n[0].message})}):j(`ul`,{className:`flex list-none flex-col`,children:n.map(e=>typeof e==`string`?j(`li`,{children:e},e):e?.message?j(`li`,{children:e.message},e.message):null)}):null),[t,n]);return i?j(`div`,{role:`alert`,"data-slot":`field-error`,className:S(`w-full font-semibold text-danger-strong text-xs`,e),...r,children:i}):null});Z.displayName=`FieldError`;const Ce=({label:e,description:t,options:n,helperText:r,orientation:i})=>{let a=Q(),o=V(a.form.store,({isSubmitting:e})=>e);return M(H,{className:`gap-y-4 px-4`,children:[M(U,{orientation:i,children:[M(W,{children:[j(K,{children:e}),j(J,{children:t}),j(Y,{isShow:!!r,children:r})]}),j(G,{children:j(H,{className:`flex flex-col gap-y-2`,children:n.map(e=>M(U,{orientation:`horizontal`,children:[j(c,{id:`${a.name}-${e.value}`,name:a.name,checked:a.state.value?.includes(e.value)??!1,disabled:o,onCheckedChange:t=>{if(t&&a.state.value!==null)a.pushValue(e.value);else if(t&&a.state.value===null)a.setValue([e.value]);else if(!t&&a.state.value!==null){let t=a.state.value.indexOf(e.value);t>-1&&a.removeValue(t)}else !t&&a.state.value===null&&a.setValue(null)}}),j(K,{htmlFor:`${a.name}-${e.value}`,className:`text-text-positive`,children:e.label})]},e.value))})})]}),j(X,{})]})},we=({label:t,description:n,placeholder:r,orientation:i=`responsive`,helperText:a,minDate:o,maxDate:s,required:c})=>{let l=Q(),m=O(()=>c?l.state.value===null:!1,[c,l.state.value]),h=O(()=>l.state.meta.isTouched&&!l.state.meta.isValid,[l.state.meta.isTouched,l.state.meta.isValid]);return M(H,{className:`px-4`,children:[M(U,{orientation:i,"data-invalid":h,children:[M(W,{children:[j(K,{htmlFor:l.name,"aria-required":m,children:t}),j(J,{children:n})]}),M(G,{className:`flex flex-col space-y-1`,children:[j(`div`,{className:`flex w-full flex-col`,children:M(f,{children:[j(u,{asChild:!0,children:M(e,{variant:`outline`,color:`muted`,size:`lg`,className:S(`flex items-center justify-between rounded font-normal outline-border`,`hover:bg-transparent`,`focus:outline-1 focus:outline-primary-strong focus:ring-4 focus:ring-primary-weak`,`data-[state=open]:text-text-positive-muted`,`data-[state=open]:outline-1`,`data-[state=open]:outline-primary-strong`,`data-[state=open]:ring-4`,`data-[state=open]:ring-primary-weak`,l.state.value===null&&`text-text-positive-muted`),children:[j(`p`,{children:l.state.value===null?r||`Select date`:le(l.state.value,`PPPP`)}),j(I,{strokeWidth:1})]})}),M(d,{align:`start`,side:`bottom`,className:`flex w-fit min-w-0 overflow-y-auto rounded p-0`,onBlur:l.handleBlur,children:[M(`div`,{className:`flex h-full flex-col space-y-2 border-r border-r-border p-2 [&>button]:justify-start [&>button]:text-sm`,children:[j(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{l.handleChange(R())},children:`Today`}),j(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{l.handleChange(se())},children:`Tomorrow`}),j(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{l.handleChange(ce())},children:`Yesterday`}),j(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{l.handleChange(z(R(),3))},children:`Last 3 Days`}),j(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{l.handleChange(z(R(),7))},children:`Last 7 Days`}),j(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{l.handleChange(z(R(),30))},children:`Last 30 Days`}),j(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{l.handleChange(de(R()))},children:`This Month`}),j(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{l.handleChange(ue(R()))},children:`Last Month`})]}),j(`div`,{className:`flex flex-1 flex-col`,children:j(`div`,{className:`min-w-73 border-b border-b-border p-2`,children:j(p,{mode:`single`,selected:l.state.value??void 0,hidden:{before:o??new Date(1900,0,1),after:s??new Date(2100,11,31)},onSelect:e=>{e&&l.handleChange(e)}})})})]})]})}),j(Y,{isShow:!!a,children:a})]})]}),j(X,{})]})},Te=({label:e,description:t,placeholder:n,helperText:r,orientation:i=`responsive`,showErrorMessage:a=!0,maxLength:o})=>{let{form:s,name:c,state:u,handleBlur:d,handleChange:f}=Q(),p=V(s.store,({isSubmitting:e})=>e),m=O(()=>u.meta.isDirty&&u.meta.isTouched&&!u.meta.isValid,[u.meta.isDirty,u.meta.isTouched,u.meta.isValid]),h=T(({target:{value:e}})=>{p||o&&e.length>o||f(e||null)},[p,o,f]),g=T(()=>{p||f(null)},[p,f]);return M(H,{className:`gap-y-4 px-4`,children:[M(U,{"data-invalid":m,orientation:i,children:[M(W,{children:[j(K,{htmlFor:c,children:e}),j(J,{children:t})]}),M(G,{children:[j(l,{id:c,name:c,value:u.value===null?``:u.value,"aria-invalid":m,autoComplete:`email`,placeholder:n,className:S(`pl-9`,p&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:d,onChange:h}),j(`div`,{className:`absolute top-0 left-0 flex size-9 items-center justify-center text-muted`,children:j(P,{size:14})}),j(`button`,{type:`button`,"aria-label":`Clear`,className:`absolute inset-e-0 inset-y-0 top-3 flex h-fit w-8 cursor-pointer items-center justify-center rounded-e-md text-text-positive-weak outline-none transition-[color,box-shadow] hover:text-text-positive focus:text-text-positive-strong`,onClick:g,children:j(oe,{size:14,"aria-hidden":`true`})}),j(`div`,{className:`mt-1 flex w-full items-start justify-start`,children:a&&u.meta.isDirty&&j(Z,{errors:u.meta.errors})}),j(Y,{isShow:!!r,children:r})]})]}),j(X,{})]})},Ee=e=>e?/^-?\d*\.?\d*$/:/^\d*\.?\d*$/,De=e=>Number(e).toLocaleString(),Oe=(e,t,n)=>{if(n===`none`)return e;let r=10**t,i=e*r;switch(n){case`up`:return Math.ceil(i)/r;case`down`:return Math.floor(i)/r;case`nearest`:return i%1<.1?Math.floor(i)/r:i%1>=.59?Math.ceil(i)/r:(Math.floor(i)+.5)/r;default:return e}},ke=({disabled:e=!1,readOnly:t=!1,allowNegative:n=!1,numberAfterDecimalPoint:r=2,roundingRule:i=`none`,value:a=null,unitText:o,decimal:s,placeholder:c,precision:u,wrapperClassName:d,className:f,onChange:p,onValueChange:m,onFocus:h,onBlur:g,..._})=>{let v=k(null),y=k(null),[b,x]=A(a?.toString()??null),C=O(()=>s?.[1]??r,[s,r]),w=O(()=>s&&s[0]-s[1],[s]),D=O(()=>Ee(n),[n]),N=T(e=>{if(!C||e===`-`)return!0;let[t,n=``]=e.split(`.`),r=t.startsWith(`-`)?t.length-1:t.length;return n.length<=C&&r<=(w??1/0)},[C,w]),P=T(e=>{if(e===`0`)return`0`;if(!Number(e))return null;let[t,n=``]=Oe(parseFloat(e),Math.min(C-1,u||0),i).toString().split(`.`),r=De(t);return n?`${r}.${n}`:r},[C,u,i]),F=T(e=>{let t=e===`0`,n=e===`-`||/^-0+(\.0+)?$/.test(e)||/^-0*\.$/.test(e);if(t){m?.(0),x(e);return}if(n){x(()=>(m?.(0),e));return}},[m]),I=T(e=>{p?.(e);let{value:t}=e.target;if(t===``||t===void 0){m?.(null),x(null);return}F(t),!(!D.test(t)||!N(t))&&(m?.(parseFloat(t)||0),x(t))},[N,p,m,F,D]),ee=T(e=>{t||(h?.(e),x(e=>typeof e==`string`?e.replace(/,/g,``):null))},[t,h]),te=T(e=>{t||(g?.(e),x(e=>e===null?null:e===`0`||e===`-`||/^-0+(\.0+)?$/.test(e)||/^-0*\.$/.test(e)?`0`:typeof e==`string`?P(e):null))},[t,P,g]);return E(()=>{let e=document.activeElement===y.current;if(a==null||!D.test(a.toString())||!N(a.toString())){x(null);return}x(t=>e?t:P(a.toString()))},[P,a,N,D]),E(()=>{if(!v.current||!y.current||!o)return;let e=v.current.offsetWidth;y.current.style.setProperty(`padding-right`,`${(e+10)/16}rem`)},[o]),M(`div`,{className:S(`relative`,d),children:[j(l,{..._,ref:y,value:b||(t?`0`:``),placeholder:c,disabled:e,readOnly:t,className:S(`text-end font-number text-sm slashed-zero lining-nums tabular-nums`,t&&`bg-muted text-muted-foreground`,f),onChange:I,onFocus:ee,onBlur:te}),o&&j(`span`,{ref:v,className:`-translate-y-1/2 pointer-events-none absolute top-1/2 right-2 text-muted-foreground text-sm`,children:o})]})},Ae=({label:e,description:t,placeholder:n,helperText:r,orientation:i=`responsive`,showErrorMessage:a=!0,rounding:o,decimalPlaces:s,percision:c,unit:l,required:u,allowNegative:d})=>{let f=Q(),p=V(f.form.store,({isSubmitting:e})=>e),m=O(()=>f.state.meta.errors,[f.state.meta.errors]),h=O(()=>u?f.state.value===null:!1,[u,f.state.value]),g=T(e=>{p||f.handleChange(e)},[p,f.handleChange]);return M(H,{className:`gap-y-4 px-4`,children:[M(U,{orientation:i,"data-invalid":f.state.meta.isTouched&&!f.state.meta.isValid,children:[M(W,{children:[j(K,{htmlFor:f.name,"aria-required":h,children:e}),j(J,{children:t})]}),M(G,{children:[M(`div`,{className:`relative w-full`,children:[j(ke,{id:f.name,value:f.state.value,"aria-invalid":f.state.meta.isTouched&&!f.state.meta.isValid&&f.state.meta.isDirty,placeholder:n,roundingRule:o,numberAfterDecimalPoint:s,precision:c,unitText:l,allowNegative:d,className:S(p&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:f.handleBlur,onValueChange:g}),p&&j(`div`,{className:`absolute inset-s-2 inset-y-0 top-2.5 text-muted-weak [&>svg]:size-3.5`,children:j(L,{className:`animate-spin text-primary-strong`})}),f.state.meta.isDirty&&a&&!!m.length&&j(`div`,{className:`absolute inset-s-2 inset-y-0 top-2.75 text-danger-strong [&>svg]:size-3.5`,children:j(F,{})}),j(`div`,{className:`mt-1 flex w-full flex-col items-end justify-end`,children:f.state.meta.isDirty&&a&&j(Z,{errors:m})})]}),j(Y,{isShow:!!r,children:r})]})]}),j(X,{})]})},je=({label:e,description:t,placeholder:n,orientation:r=`responsive`,helperText:i,showErrorMessage:a=!0})=>{let{form:o,name:s,state:c,handleBlur:u,handleChange:d}=Q(),f=V(o.store,({isSubmitting:e})=>e),[p,m]=A(!1),h=O(()=>c.meta.isDirty&&c.meta.isTouched&&!c.meta.isValid,[c.meta.isDirty,c.meta.isTouched,c.meta.isValid]),g=T(()=>m(e=>!e),[]),_=T(({target:{value:e}})=>{f||d(e||null)},[f,d]);return j(H,{className:`gap-y-4 px-4`,children:M(U,{"data-invalid":h,orientation:r,children:[M(W,{children:[j(K,{htmlFor:s,children:e}),j(J,{children:t})]}),M(G,{children:[j(l,{id:s,type:p?`text`:`password`,placeholder:n,value:c.value??``,"aria-invalid":h,autoComplete:`new-password`,onBlur:u,onChange:_}),j(`button`,{className:`absolute inset-e-0 inset-y-0 flex size-9 items-center justify-center rounded-e-md text-muted outline-none transition-[color,box-shadow] focus:z-10 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,type:`button`,onClick:g,"aria-label":p?`Hide password`:`Show password`,"aria-pressed":p,"aria-controls":`password`,children:j(p?te:ee,{size:16,"aria-hidden":`true`})}),j(`div`,{className:`mt-1 flex w-full items-start justify-start`,children:a&&c.meta.isDirty&&j(Z,{errors:c.meta.errors})}),j(Y,{isShow:!!i,children:i})]})]})})},Me=({label:e,description:t,orientation:n,options:r,helperText:i})=>{let a=Q(),o=V(a.form.store,({isSubmitting:e})=>e);return M(H,{className:`px-4`,children:[M(U,{orientation:n,className:`flex-col gap-2`,children:[M(W,{children:[j(K,{children:e}),j(J,{children:t}),j(Y,{isShow:!!i,children:i})]}),j(G,{children:j(h,{defaultValue:a.state.value??void 0,className:`w-full`,onValueChange:a.handleChange,children:r.map(e=>j(K,{className:S(`h-fit`,a.state.value===e.value&&`border-primary-weak! bg-primary-bg-subtle`,o&&`pointer-events-none bg-muted-muted opacity-60`,a.state.value===e.value&&o&&`border-border-strong!`),children:M(U,{orientation:`horizontal`,className:`justify-between rounded p-2!`,children:[M(W,{className:`gap-1!`,children:[j(q,{children:e.label}),j(J,{className:`text-xs`,children:e.description})]}),j(m,{value:e.value})]})},e.value))})})]}),j(X,{})]})},Ne=({label:e,description:t,placeholder:n,orientation:r=`responsive`,options:i,helperText:a,required:o=!1})=>{let s=Q(),c=O(()=>s.state.meta.isTouched&&!s.state.meta.isValid,[s.state.meta.isTouched,s.state.meta.isValid]),l=O(()=>o?s.state.value===null:!1,[o,s.state.value]),u=O(()=>s.state.meta.errors,[s.state.meta.errors]);return M(H,{className:`gap-y-4 px-4`,children:[M(U,{orientation:r,"data-invalid":s.state.meta.isTouched&&!s.state.meta.isValid,children:[M(W,{children:[j(K,{htmlFor:s.name,"aria-required":l,children:e}),j(J,{children:t})]}),M(G,{className:`flex flex-col`,children:[M(b,{defaultValue:s.state.value||void 0,onValueChange:s.handleChange,children:[j(y,{"aria-invalid":c?`true`:void 0,onBlur:s.handleBlur,children:j(g,{placeholder:n})}),M(v,{children:[!!i.length&&i.map(e=>j(_,{value:e.value,children:e.label},e.value)),!i.length&&M(`div`,{className:`flex items-center justify-center gap-x-2 rounded border border-border bg-muted-muted px-4 py-6.5 text-center text-sm text-text-positive-weak`,children:[j(re,{strokeWidth:1}),`No options available`]})]})]}),j(`div`,{className:`mt-1 flex w-full flex-col items-end justify-end`,children:j(Z,{errors:u})}),j(Y,{isShow:!!a,children:a})]})]}),j(X,{})]})};function Pe({className:e,...t}){return j(me.Root,{"data-slot":`switch`,className:S(`peer`,`w-8 shrink-0 cursor-pointer items-center rounded-full shadow-xs transition-all`,`inline-flex h-5`,`focus-visible:border-primary-strong`,`focus-visible:ring-primary-weak`,`focus-visible:ring-4`,`disabled:cursor-not-allowed`,`disabled:opacity-50`,`-outline-offset-1 inset-shadow-2xs outline-1`,`data-[state=checked]:bg-primary`,`data-[state=checked]:outline-primary-strong`,`data-[state=unchecked]:bg-muted-weak`,`data-[state=unchecked]:outline-border`,`data-[state=unchecked]:[&_span]:size-4`,`data-[state=unchecked]:[&_span]:translate-x-0.5`,`data-[state=unchecked]:[&_span]:rtl:-translate-x-0.5`,e),...t,children:j(me.Thumb,{"data-slot":`switch-thumb`,className:S(`block size-4 bg-card shadow-xs`,`pointer-events-none rounded-full ring-0 transition-transform`,`data-[state=checked]:translate-x-[calc(100%-3px)]`,`data-[state=unchecked]:translate-x-0`)})})}const Fe=({label:e,description:t,helperText:n})=>{let r=Q();return M(H,{className:`gap-y-4 px-4`,children:[M(U,{orientation:`vertical`,className:`relative justify-between gap-y-1`,children:[M(W,{children:[j(q,{className:`cursor-pointer`,children:j(`label`,{htmlFor:r.name,children:e})}),j(J,{children:t}),j(Pe,{id:r.name,checked:r.state.value??!1,className:`absolute top-1 right-1`,onBlur:r.handleBlur,onCheckedChange:r.handleChange})]}),j(Y,{isShow:!!n,children:n})]}),j(X,{})]})},Ie=({label:e,description:t,placeholder:n,helperText:r,counter:i=!1,orientation:a=`responsive`,showClearButton:o=!1,showErrorMessage:s=!0,required:c=!1,maxLength:u})=>{let d=D(),f=k(null),{form:p,name:m,state:h,handleBlur:g,handleChange:_}=Q(),v=V(p.store,({isSubmitting:e})=>e),y=o&&!v&&!!h.value&&!h.meta.errors.length,b=h.value?h.value.length:0,x=O(()=>{if(!i)return``;let e=`character${[0,1].includes(b)?``:`s`}`;return i&&u?`${b} / ${u} character${b?`s`:``}`:`${b} ${e}`},[b,i,u]),C=h.meta.isDirty&&h.meta.isTouched&&!h.meta.isValid,w=c?h.value===null:!1,E=u&&b>=u*.8,A=u&&b>=u,N=T(({target:{value:e}})=>{v||i&&u&&e.length>u||_(e||null)},[v,i,u,_]),P=T(()=>{v||(_(null),f.current?.focus())},[v,_]);return M(H,{className:`gap-y-4 px-4`,children:[M(U,{orientation:a,"data-invalid":C,children:[M(W,{children:[j(K,{"aria-required":w,htmlFor:d,children:M(`p`,{children:[e,c&&j(`span`,{className:`text-danger-strong`,children:` *`})]})}),j(J,{children:t})]}),M(G,{children:[j(l,{ref:f,id:d,name:m,value:h.value??``,"aria-invalid":C,autoComplete:`off`,placeholder:n,autoCapitalize:`none`,autoCorrect:`off`,className:S(`pr-6`,v&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:g,onChange:N}),y&&j(`button`,{type:`button`,"aria-label":`Clear`,className:`absolute inset-e-0 inset-y-0 top-3 flex h-fit w-8 cursor-pointer items-center justify-center rounded-e-md text-text-positive-weak outline-none transition-[color,box-shadow] hover:text-text-positive focus:text-text-positive-intense [&>svg]:size-3.5`,onClick:P,children:j(oe,{"aria-hidden":`true`})}),v&&j(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-muted-weak`,children:j(L,{size:14,className:`animate-spin text-primary-strong`})}),h.meta.isDirty&&s&&!!h.meta.errors.length&&j(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-danger-strong`,children:j(F,{"aria-hidden":`true`,size:14})}),M(`div`,{className:`my-1 flex w-full items-start justify-between gap-x-2`,children:[h.meta.isDirty&&s?j(Z,{className:`flex-1`,errors:h.meta.errors}):j(`div`,{}),!!i&&j(`p`,{className:S(`h-4 flex-0 text-nowrap text-end text-xs tabular-nums transition-colors`,A?`font-medium text-danger-strong`:E?`text-warning-strong`:`text-text-positive-weak`),children:x})]}),j(Y,{isShow:!!r,children:r})]})]}),j(X,{})]})},Le=w(({label:e,description:t,placeholder:n,helperText:r,counter:i=!1,orientation:a=`responsive`,showErrorMessage:o=!0,required:s=!1,maxLength:c})=>{let l=D(),{form:u,state:d,name:f,handleBlur:p,handleChange:m}=Q(),h=V(u.store,({isSubmitting:e})=>e),g=d.value?d.value.length:0,_=O(()=>{if(!i)return``;let e=`character${[0,1].includes(g)?``:`s`}`;return i&&c?`${g} / ${c} character${g?`s`:``}`:`${g} ${e}`},[g,i,c]),v=d.meta.isDirty&&d.meta.isTouched&&!d.meta.isValid,y=s?d.value===null:!1,b=d.meta.errors,C=c&&g>=c*.8,w=c&&g>=c,E=T(({target:{value:e}})=>{h||i&&c&&e.length>c||m(e||null)},[h,i,c,m]);return M(H,{className:`gap-y-4 px-4`,children:[M(U,{orientation:a,"data-invalid":v,children:[M(W,{children:[j(K,{"aria-required":y,htmlFor:l,children:M(`p`,{children:[e,s&&j(`span`,{className:`text-danger-strong`,children:` *`})]})}),j(J,{children:t})]}),M(G,{children:[j(x,{id:l,name:f,value:d.value===null?``:d.value,"aria-invalid":v,autoCapitalize:`none`,autoComplete:`off`,placeholder:n,className:S(h&&`pointer-events-none bg-muted-muted opacity-60`),onChange:E,onBlur:p}),h&&j(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-muted-weak`,children:j(L,{size:14,className:`animate-spin text-primary-strong`})}),d.meta.isDirty&&o&&!!b.length&&j(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-danger-strong`,children:j(F,{size:14})}),M(`div`,{className:`my-1 flex w-full items-start justify-between gap-x-2`,children:[d.meta.isDirty&&o?j(Z,{className:`flex-1`,errors:d.meta.errors}):j(`div`,{}),!!i&&j(`p`,{className:S(`h-4 flex-0 text-nowrap text-end text-xs tabular-nums transition-colors`,w?`font-medium text-danger-strong`:C?`text-warning-strong`:`text-text-positive-weak`),children:_})]}),j(Y,{isShow:!!r,children:r})]})]}),j(X,{})]})}),Re=({label:t,className:n})=>{let r=$(),i=T(async()=>{await r.handleSubmit({submitAction:`submit`}),r.state.isSubmitSuccessful&&r.reset()},[r]);return j(r.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:r,isSubmitting:a})=>j(e,{type:`button`,size:`md`,disabled:r,isLoading:a,className:S(`min-h-8 min-w-32`,n),onClick:i,children:t??`Submit`})})},ze=({type:t=`create`})=>{let n=$();return M(`div`,{className:`flex h-8 items-center justify-between`,children:[j(n.Subscribe,{selector:e=>({disabled:e.isPristine||e.isSubmitting}),children:({disabled:t})=>j(e,{color:`muted`,variant:`outline`,type:`button`,size:`md`,disabled:t,className:`h-full min-w-32`,onClick:()=>n.reset(),children:`Cancel`})}),t===`create`&&j(n.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:t,isSubmitting:r})=>M(e,{type:`submit`,size:`md`,disabled:t,isLoading:r,className:`h-full min-w-32`,onClick:async()=>{await n.handleSubmit({submitAction:`create`}),n.state.isSubmitSuccessful&&n.reset()},children:[j(ie,{}),`Add New`]})}),t===`update`&&j(n.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:t,isSubmitting:r})=>M(e,{type:`submit`,size:`md`,disabled:t,isLoading:r,className:`h-full min-w-32`,onClick:async()=>{await n.handleSubmit({submitAction:`update`}),n.state.isSubmitSuccessful&&n.reset()},children:[j(N,{}),`Update`]})})]})};function Be({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return j(pe.Root,{"data-slot":`separator`,decorative:n,orientation:t,className:S(`shrink-0 bg-border-weak`,`data-[orientation=horizontal]:h-px`,`data-[orientation=horizontal]:w-full`,`data-[orientation=vertical]:h-full`,`data-[orientation=vertical]:w-px`,e),...r})}const Ve=({title:t,description:n,onDelete:r,children:i})=>M(`section`,{"data-slot":`card-form`,className:`relative flex flex-col rounded-md bg-card pb-4 shadow-card ring-4 ring-border-weak`,children:[M(`div`,{"data-slot":`card-form-header`,className:`flex flex-col space-y-1 p-4`,children:[j(`p`,{className:`font-semibold text-lg`,children:t}),!!n&&j(`p`,{className:`text-muted text-sm`,children:n})]}),j(Be,{}),j(`div`,{"data-slot":`card-form-main`,className:`flex flex-col space-y-4 py-4`,children:i}),!!r&&M(e,{color:`danger`,variant:`outline`,size:`sm`,className:`absolute top-2 right-2`,onClick:e=>{r?.(),e.preventDefault(),e.stopPropagation()},children:[j(ae,{}),`Remove`]})]}),He=({children:e})=>j(`div`,{"data-slot":`section-form`,className:`flex flex-col space-y-4`,children:e}),Ue=({...e})=>j(`button`,{...e,type:`button`,className:`min-w-40 cursor-pointer rounded-sm border border-border bg-card px-4 py-2 font-semibold text-sm text-text-positive shadow-xs outline-none transition-all hover:opacity-90 focus:border-border focus:ring-3 focus:ring-border/80 focus:ring-offset-2 focus:drop-shadow-none disabled:pointer-events-none disabled:opacity-60 disabled:drop-shadow-none`,children:`Hủy`}),We=({isSubmitting:e,submitText:t=`Submit`,...n})=>j(`button`,{...n,type:`button`,"data-loading":e?`true`:void 0,className:`relative min-h-9.5 min-w-40 cursor-pointer rounded-sm border border-primary-strong bg-primary px-4 py-2 font-semibold text-sm text-text-negative shadow-card outline-none transition-all hover:opacity-90 focus:border-transparent focus:ring-3 focus:ring-primary/80 focus:ring-offset-2 focus:drop-shadow-none disabled:pointer-events-none disabled:opacity-60 disabled:drop-shadow-none data-[loading=true]:pointer-events-none data-[loading=true]:opacity-80`,children:e?j(ne,{size:16,strokeWidth:3,className:`absolute top-1/2 left-1/2 z-10 -translate-x-1/2 -translate-y-1/2 animate-spin`}):t}),Ge=({title:e,submitText:n,open:c,onOpenChange:l,children:u})=>{let d=$(),f=T(e=>{e||d.reset(),l?.(e)},[d.reset,l]);return j(s,{open:c,onOpenChange:f,children:M(r,{"data-slot":`dialog-portal`,children:[j(o,{}),M(a,{className:`flex size-full max-h-dvh max-w-dvw flex-col gap-0 overflow-y-auto p-0 shadow-dialog sm:h-auto sm:max-h-[85dvh] sm:max-w-2xl sm:rounded-sm`,children:[j(`div`,{"data-slot":`dialog-header`,className:`flex flex-col items-center justify-center gap-2 px-4 py-6 text-center shadow-sm sm:text-left`,children:j(i,{"data-slot":`dialog-title`,children:e})}),j(t,{}),j(`div`,{"data-slot":`dialog-content`,className:`relative flex flex-col space-y-4 overflow-y-auto p-0 pt-6 max-sm:flex-1 sm:p-4`,children:u}),j(t,{}),M(`div`,{"data-slot":`dialog-footer`,className:`flex flex-col-reverse items-center justify-between gap-2 px-6 py-4 shadow-sm sm:flex-row sm:justify-end max-sm:[&>button]:w-full`,children:[j(d.Subscribe,{selector:e=>({disabled:e.isSubmitting}),children:({disabled:e})=>j(Ue,{disabled:e,onClick:()=>{d.reset(),f(!1)}})}),j(d.Subscribe,{selector:e=>({isSubmitting:e.isSubmitting,disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit}),children:({isSubmitting:e,disabled:t})=>j(We,{isSubmitting:e,disabled:t,submitText:n,onClick:()=>d.handleSubmit()})})]})]})]})})},Ke=({label:e,description:t,helperText:n,orientation:r=`responsive`,children:i})=>M(H,{className:`gap-y-4 px-4`,children:[M(U,{orientation:r,children:[M(W,{children:[j(K,{children:e}),j(J,{children:t})]}),M(G,{children:[i,j(Y,{isShow:!!n,children:n})]})]}),j(X,{})]}),qe=({title:e,open:t,contentClassName:r,onOpenChange:i,children:a})=>{let o=$();return j(B.Root,{"data-slot":`dialog`,open:t,onOpenChange:i,children:M(B.Portal,{"data-slot":`dialog-portal`,children:[j(B.Overlay,{"data-slot":`dialog-overlay`,className:S(`fixed inset-0 z-40 bg-black/50 backdrop-blur-sm`,`data-[state=open]:animate-in`,`data-[state=open]:fade-in`,`data-[state=closed]:animate-out`,`data-[state=closed]:fade-out`)}),j(B.Content,{"data-slot":`dialog-content`,className:S(`fixed top-4 right-4 z-50 h-[calc(100dvh-2rem)] min-w-sm max-w-xl rounded-md bg-background drop-shadow-lg`,`duration-300`,`data-[state=open]:animate-in`,`data-[state=open]:slide-in-from-right`,`data-[state=open]:fade-in`,`data-[state=closed]:animate-out`,`data-[state=closed]:slide-out-to-right`,`data-[state=closed]:fade-out`),children:M(`section`,{className:`relative flex size-full flex-col`,children:[j(`header`,{className:`flex h-14 items-center border-border border-b px-4`,children:j(`h2`,{className:`font-semibold text-lg text-primary-strong`,children:e})}),j(`div`,{className:S(`flex flex-1 flex-col overflow-y-auto py-4`,r),children:a}),M(`div`,{className:`flex flex-col space-y-4 border-border border-t px-4 py-2`,children:[j(o.Subscribe,{selector:e=>({isSubmitting:e.isSubmitting,disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit}),children:({isSubmitting:e,disabled:t})=>j(We,{isSubmitting:e,disabled:t,className:`w-full`,onClick:()=>o.handleSubmit()})}),j(o.Subscribe,{selector:e=>({disabled:e.isPristine||e.isSubmitting}),children:({disabled:e})=>j(Ue,{disabled:e,className:`w-full`,onClick:()=>{o.reset(),i?.(!1)}})})]}),j(B.Close,{asChild:!0,children:j(n,{className:`absolute top-2 right-2`})})]})})]})})},Je=({children:e})=>j(`header`,{"data-slot":`section-header`,className:`px-4 pt-2.5 pb-2 font-medium text-base text-text-positive`,children:e}),Ye=({children:e})=>j(`main`,{"data-slot":`section-main`,className:`relative flex flex-col space-y-4 py-4`,children:e}),Xe=({title:e,children:t})=>M(`section`,{"data-slot":`section-form`,className:`flex flex-col rounded-md bg-background shadow-card ring-4 ring-border-weak`,children:[j(Je,{children:e}),j(Be,{}),j(Ye,{children:t})]}),Ze=({title:e,description:t,helperText:n})=>M(H,{className:`gap-y-4 px-4`,children:[M(U,{className:`gap-0`,children:[M(W,{children:[j(Se,{className:`mb-1`,children:e}),j(J,{children:t})]}),j(Y,{isShow:!!n,children:n})]}),j(X,{})]}),{fieldContext:Qe,formContext:$e,useFieldContext:Q,useFormContext:$}=ge(),{useAppForm:et,withForm:tt,withFieldGroup:nt}=he({fieldContext:Qe,formContext:$e,fieldComponents:{TextField:Ie,TextareaField:Le,NumberField:Ae,EmailField:Te,PasswordField:je,SelectField:Ne,DateField:we,SwitchField:Fe,RadioGroupField:Me,CheckboxField:Ce,FieldGroup:H,Field:U,FieldContent:W,FieldLabel:K,FieldContentMain:G,FieldSeparator:X,FieldError:Z},formComponents:{TanStackDialogForm:Ge,TanStackPopoverForm:qe,TanStackContainerForm:He,TanStackSectionForm:Xe,TanStackCardForm:Ve,TanStackFieldGroup:Ke,TanStackTitleField:Ze,TanStackActionsForm:ze,TanStackActionSubmit:Re}});export{U as Field,W as FieldContent,G as FieldContentMain,Z as FieldError,H as FieldGroup,K as FieldLabel,X as FieldSeparator,Q as useTanStackFieldContext,et as useTanStackForm,$ as useTanStackFormContext,nt as withTanStackFieldGroup,tt as withTanStackForm};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|