@customafk/lunas-ui 0.2.26 → 0.2.27
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/{alert-Dsq6vAs6.d.cts → alert-Bbooe3K0.d.cts} +7 -7
- package/dist/{badge-DwSr25mK.d.mts → badge-BUDQIgSz.d.mts} +3 -3
- package/dist/{badge-BluO4Nx_.d.cts → badge-Dxa365-r.d.cts} +5 -5
- package/dist/{button-BnV_vesk.d.cts → button-C7IuBgb_.d.cts} +5 -5
- package/dist/{button-DYdNy15v.d.mts → button-u7M3BQF5.d.mts} +3 -3
- package/dist/{dialog-C0DdEwn5.d.cts → dialog-CvPMWn6Y.d.mts} +12 -12
- package/dist/{dialog-enbWwzaM.d.mts → dialog-DE7tIKD6.d.cts} +12 -12
- package/dist/dialogs/detail-dialog/components/sidebar.d.cts +24 -24
- package/dist/dialogs/detail-dialog/components/sidebar.d.mts +26 -26
- package/dist/features/descriptions/index.d.cts +1 -1
- package/dist/features/descriptions/index.d.mts +1 -1
- package/dist/features/search-modal/index.d.cts +2 -2
- package/dist/features/tables/index.d.cts +1 -1
- package/dist/features/tanstack-form/index.cjs +1 -1
- package/dist/features/tanstack-form/index.d.cts +1 -1
- package/dist/features/tanstack-form/index.d.mts +1 -1
- package/dist/features/tanstack-form/index.mjs +1 -1
- package/dist/features/text-editor/index.d.mts +1 -1
- package/dist/{index-C4PMwFiL.d.mts → index-C3dXDjdR.d.mts} +4 -4
- package/dist/{index-CVbUzeOi.d.cts → index-CyBWPhx7.d.cts} +2 -2
- package/dist/{index-Cek8sD8Z.d.mts → index-DPnJrJS9.d.mts} +43 -2
- package/dist/{index-C35BNdrJ.d.cts → index-UfOfYRNf.d.cts} +43 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +1 -1
- package/dist/{input-AU25j62E.d.cts → input-B9XN8dsE.d.cts} +5 -5
- package/dist/layouts/flex.d.cts +5 -5
- package/dist/layouts/flex.d.mts +5 -5
- package/dist/pages/FeatureDeveloping.d.cts +2 -2
- package/dist/pages/FeatureDeveloping.d.mts +2 -2
- package/dist/pages/FeatureFixing.d.cts +2 -2
- package/dist/pages/FeatureFixing.d.mts +2 -2
- package/dist/pages/LoginPage.d.cts +2 -2
- package/dist/pages/LoginPage.d.mts +2 -2
- package/dist/pages/NotAuthorized.d.cts +2 -2
- package/dist/pages/NotFound.d.cts +2 -2
- package/dist/pages/NotFound.d.mts +2 -2
- package/dist/pages/RegisterPage.d.cts +2 -2
- package/dist/pages/VerifyEmailPage.d.cts +2 -2
- package/dist/pages/VerifyEmailPage.d.mts +2 -2
- package/dist/tanstack-form--I4H53bf.cjs +2 -0
- package/dist/tanstack-form--I4H53bf.cjs.map +1 -0
- package/dist/tanstack-form-DKIudGKP.mjs +2 -0
- package/dist/tanstack-form-DKIudGKP.mjs.map +1 -0
- package/dist/typography/paragraph.d.cts +4 -4
- package/dist/ui/alert-dialog.d.cts +12 -12
- package/dist/ui/alert-dialog.d.mts +12 -12
- package/dist/ui/alert.d.cts +1 -1
- 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 +1 -1
- package/dist/ui/badge.d.mts +1 -1
- package/dist/ui/breadcrumb.d.cts +8 -8
- package/dist/ui/button-group.d.cts +6 -6
- package/dist/ui/button-group.d.mts +4 -4
- package/dist/ui/button.d.cts +1 -1
- package/dist/ui/button.d.mts +1 -1
- package/dist/ui/calendar.d.cts +4 -4
- package/dist/ui/calendar.d.mts +4 -4
- package/dist/ui/card.d.cts +8 -8
- package/dist/ui/card.d.mts +8 -8
- package/dist/ui/carousel.d.cts +7 -7
- package/dist/ui/carousel.d.mts +7 -7
- 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.d.cts +11 -11
- package/dist/ui/command.d.mts +11 -11
- package/dist/ui/context-menu.d.cts +16 -16
- package/dist/ui/context-menu.d.mts +16 -16
- package/dist/ui/dialog.d.cts +1 -1
- package/dist/ui/dialog.d.mts +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 +7 -7
- package/dist/ui/field.d.cts +23 -23
- package/dist/ui/field.d.mts +21 -21
- package/dist/ui/file-uploader.d.cts +2 -2
- package/dist/ui/file-uploader.d.mts +2 -2
- package/dist/ui/form.d.cts +10 -10
- package/dist/ui/form.d.mts +10 -10
- 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/inputs/search-input.d.cts +3 -3
- package/dist/ui/inputs/search-input.d.mts +2 -2
- package/dist/ui/item.d.cts +14 -14
- package/dist/ui/item.d.mts +11 -11
- 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.d.cts +2 -2
- package/dist/ui/multi-select.d.mts +3 -3
- package/dist/ui/navigation-menu.d.cts +11 -11
- package/dist/ui/navigation-menu.d.mts +9 -9
- package/dist/ui/pagination.d.cts +9 -9
- package/dist/ui/pagination.d.mts +9 -9
- 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 +9 -9
- package/dist/ui/resizable.d.mts +9 -9
- package/dist/ui/scroll-area.d.cts +5 -5
- package/dist/ui/scroll-area.d.mts +5 -5
- 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.d.cts +28 -28
- package/dist/ui/sidebar.d.mts +27 -27
- 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 +17 -17
- package/dist/ui/table.d.mts +17 -17
- 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.d.cts +4 -4
- package/dist/ui/toggle.d.mts +4 -4
- package/dist/ui/tooltip.d.cts +5 -5
- package/package.json +1 -1
- package/dist/tanstack-form-Bi87PL6v.mjs +0 -2
- package/dist/tanstack-form-Bi87PL6v.mjs.map +0 -1
- package/dist/tanstack-form-CaHoSFUA.cjs +0 -2
- package/dist/tanstack-form-CaHoSFUA.cjs.map +0 -1
package/dist/layouts/flex.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react25 from "react";
|
|
2
2
|
import { VariantProps } from "class-variance-authority";
|
|
3
|
-
import * as
|
|
3
|
+
import * as class_variance_authority_types1 from "class-variance-authority/types";
|
|
4
4
|
|
|
5
5
|
//#region packages/components/layouts/flex.d.ts
|
|
6
6
|
declare const flexVariants: (props?: ({
|
|
@@ -12,7 +12,7 @@ declare const flexVariants: (props?: ({
|
|
|
12
12
|
gap?: "xs" | "sm" | "md" | "lg" | "xl" | "none" | null | undefined;
|
|
13
13
|
justify?: "start" | "center" | "end" | "between" | "around" | "evenly" | "stretch" | null | undefined;
|
|
14
14
|
align?: "start" | "center" | "end" | "stretch" | "baseline" | null | undefined;
|
|
15
|
-
} &
|
|
15
|
+
} & class_variance_authority_types1.ClassProp) | undefined) => string;
|
|
16
16
|
type Props = {
|
|
17
17
|
/** Additional Tailwind classes merged on top of the variant-generated classes. */
|
|
18
18
|
className?: string;
|
|
@@ -100,7 +100,7 @@ type Props = {
|
|
|
100
100
|
* </Flex>
|
|
101
101
|
* ```
|
|
102
102
|
*/
|
|
103
|
-
declare const Flex:
|
|
103
|
+
declare const Flex: react25.MemoExoticComponent<({
|
|
104
104
|
vertical,
|
|
105
105
|
wrap,
|
|
106
106
|
width,
|
|
@@ -111,7 +111,7 @@ declare const Flex: react3.MemoExoticComponent<({
|
|
|
111
111
|
align,
|
|
112
112
|
className,
|
|
113
113
|
children
|
|
114
|
-
}: React.PropsWithChildren<Props>) =>
|
|
114
|
+
}: React.PropsWithChildren<Props>) => react25.JSX.Element>;
|
|
115
115
|
//#endregion
|
|
116
116
|
export { Flex };
|
|
117
117
|
//# sourceMappingURL=flex.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react32 from "react";
|
|
2
2
|
|
|
3
3
|
//#region packages/components/pages/FeatureDeveloping.d.ts
|
|
4
4
|
interface FeatureDevelopingProps {
|
|
@@ -37,7 +37,7 @@ declare const FeatureDeveloping: ({
|
|
|
37
37
|
onButtonClick,
|
|
38
38
|
className,
|
|
39
39
|
iconClassName
|
|
40
|
-
}: FeatureDevelopingProps) =>
|
|
40
|
+
}: FeatureDevelopingProps) => react32.JSX.Element;
|
|
41
41
|
//#endregion
|
|
42
42
|
export { FeatureDeveloping, FeatureDeveloping as default, FeatureDevelopingProps };
|
|
43
43
|
//# sourceMappingURL=FeatureDeveloping.d.cts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react27 from "react";
|
|
2
2
|
|
|
3
3
|
//#region packages/components/pages/FeatureDeveloping.d.ts
|
|
4
4
|
interface FeatureDevelopingProps {
|
|
@@ -37,7 +37,7 @@ declare const FeatureDeveloping: ({
|
|
|
37
37
|
onButtonClick,
|
|
38
38
|
className,
|
|
39
39
|
iconClassName
|
|
40
|
-
}: FeatureDevelopingProps) =>
|
|
40
|
+
}: FeatureDevelopingProps) => react27.JSX.Element;
|
|
41
41
|
//#endregion
|
|
42
42
|
export { FeatureDeveloping, FeatureDeveloping as default, FeatureDevelopingProps };
|
|
43
43
|
//# sourceMappingURL=FeatureDeveloping.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react27 from "react";
|
|
2
2
|
|
|
3
3
|
//#region packages/components/pages/FeatureFixing.d.ts
|
|
4
4
|
interface FeatureFixingProps {
|
|
@@ -37,7 +37,7 @@ declare const FeatureFixing: ({
|
|
|
37
37
|
onButtonClick,
|
|
38
38
|
className,
|
|
39
39
|
iconClassName
|
|
40
|
-
}: FeatureFixingProps) =>
|
|
40
|
+
}: FeatureFixingProps) => react27.JSX.Element;
|
|
41
41
|
//#endregion
|
|
42
42
|
export { FeatureFixing, FeatureFixing as default, FeatureFixingProps };
|
|
43
43
|
//# sourceMappingURL=FeatureFixing.d.cts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react29 from "react";
|
|
2
2
|
|
|
3
3
|
//#region packages/components/pages/FeatureFixing.d.ts
|
|
4
4
|
interface FeatureFixingProps {
|
|
@@ -37,7 +37,7 @@ declare const FeatureFixing: ({
|
|
|
37
37
|
onButtonClick,
|
|
38
38
|
className,
|
|
39
39
|
iconClassName
|
|
40
|
-
}: FeatureFixingProps) =>
|
|
40
|
+
}: FeatureFixingProps) => react29.JSX.Element;
|
|
41
41
|
//#endregion
|
|
42
42
|
export { FeatureFixing, FeatureFixing as default, FeatureFixingProps };
|
|
43
43
|
//# sourceMappingURL=FeatureFixing.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react30 from "react";
|
|
2
2
|
|
|
3
3
|
//#region packages/components/pages/LoginPage.d.ts
|
|
4
4
|
interface LoginPageProps {
|
|
@@ -49,7 +49,7 @@ declare const LoginPage: ({
|
|
|
49
49
|
errorMessage,
|
|
50
50
|
title,
|
|
51
51
|
subtitle
|
|
52
|
-
}: LoginPageProps) =>
|
|
52
|
+
}: LoginPageProps) => react30.JSX.Element;
|
|
53
53
|
//#endregion
|
|
54
54
|
export { LoginPage, LoginPageProps };
|
|
55
55
|
//# sourceMappingURL=LoginPage.d.cts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react31 from "react";
|
|
2
2
|
|
|
3
3
|
//#region packages/components/pages/LoginPage.d.ts
|
|
4
4
|
interface LoginPageProps {
|
|
@@ -49,7 +49,7 @@ declare const LoginPage: ({
|
|
|
49
49
|
errorMessage,
|
|
50
50
|
title,
|
|
51
51
|
subtitle
|
|
52
|
-
}: LoginPageProps) =>
|
|
52
|
+
}: LoginPageProps) => react31.JSX.Element;
|
|
53
53
|
//#endregion
|
|
54
54
|
export { LoginPage, LoginPageProps };
|
|
55
55
|
//# sourceMappingURL=LoginPage.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react29 from "react";
|
|
2
2
|
|
|
3
3
|
//#region packages/components/pages/NotAuthorized.d.ts
|
|
4
4
|
interface NotAuthorizedProps {
|
|
@@ -37,7 +37,7 @@ declare const NotAuthorized: ({
|
|
|
37
37
|
onButtonClick,
|
|
38
38
|
className,
|
|
39
39
|
iconClassName
|
|
40
|
-
}: NotAuthorizedProps) =>
|
|
40
|
+
}: NotAuthorizedProps) => react29.JSX.Element;
|
|
41
41
|
//#endregion
|
|
42
42
|
export { NotAuthorized, NotAuthorized as default, NotAuthorizedProps };
|
|
43
43
|
//# sourceMappingURL=NotAuthorized.d.cts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react28 from "react";
|
|
2
2
|
|
|
3
3
|
//#region packages/components/pages/NotFound.d.ts
|
|
4
4
|
interface NotFoundProps {
|
|
@@ -37,7 +37,7 @@ declare const NotFound: ({
|
|
|
37
37
|
onButtonClick,
|
|
38
38
|
className,
|
|
39
39
|
iconClassName
|
|
40
|
-
}: NotFoundProps) =>
|
|
40
|
+
}: NotFoundProps) => react28.JSX.Element;
|
|
41
41
|
//#endregion
|
|
42
42
|
export { NotFound, NotFound as default, NotFoundProps };
|
|
43
43
|
//# sourceMappingURL=NotFound.d.cts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react28 from "react";
|
|
2
2
|
|
|
3
3
|
//#region packages/components/pages/NotFound.d.ts
|
|
4
4
|
interface NotFoundProps {
|
|
@@ -37,7 +37,7 @@ declare const NotFound: ({
|
|
|
37
37
|
onButtonClick,
|
|
38
38
|
className,
|
|
39
39
|
iconClassName
|
|
40
|
-
}: NotFoundProps) =>
|
|
40
|
+
}: NotFoundProps) => react28.JSX.Element;
|
|
41
41
|
//#endregion
|
|
42
42
|
export { NotFound, NotFound as default, NotFoundProps };
|
|
43
43
|
//# sourceMappingURL=NotFound.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react33 from "react";
|
|
2
2
|
|
|
3
3
|
//#region packages/components/pages/RegisterPage.d.ts
|
|
4
4
|
interface RegisterPageProps {
|
|
@@ -46,7 +46,7 @@ declare const RegisterPage: ({
|
|
|
46
46
|
errorMessage,
|
|
47
47
|
title,
|
|
48
48
|
subtitle
|
|
49
|
-
}: RegisterPageProps) =>
|
|
49
|
+
}: RegisterPageProps) => react33.JSX.Element;
|
|
50
50
|
//#endregion
|
|
51
51
|
export { RegisterPage, RegisterPageProps };
|
|
52
52
|
//# sourceMappingURL=RegisterPage.d.cts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react59 from "react";
|
|
2
2
|
|
|
3
3
|
//#region packages/components/pages/VerifyEmailPage.d.ts
|
|
4
4
|
interface VerifyEmailPageProps {
|
|
@@ -58,7 +58,7 @@ declare const VerifyEmailPage: ({
|
|
|
58
58
|
title,
|
|
59
59
|
subtitle,
|
|
60
60
|
resendCooldownSeconds
|
|
61
|
-
}: VerifyEmailPageProps) =>
|
|
61
|
+
}: VerifyEmailPageProps) => react59.JSX.Element;
|
|
62
62
|
//#endregion
|
|
63
63
|
export { VerifyEmailPage, VerifyEmailPageProps };
|
|
64
64
|
//# sourceMappingURL=VerifyEmailPage.d.cts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react32 from "react";
|
|
2
2
|
|
|
3
3
|
//#region packages/components/pages/VerifyEmailPage.d.ts
|
|
4
4
|
interface VerifyEmailPageProps {
|
|
@@ -58,7 +58,7 @@ declare const VerifyEmailPage: ({
|
|
|
58
58
|
title,
|
|
59
59
|
subtitle,
|
|
60
60
|
resendCooldownSeconds
|
|
61
|
-
}: VerifyEmailPageProps) =>
|
|
61
|
+
}: VerifyEmailPageProps) => react32.JSX.Element;
|
|
62
62
|
//#endregion
|
|
63
63
|
export { VerifyEmailPage, VerifyEmailPageProps };
|
|
64
64
|
//# sourceMappingURL=VerifyEmailPage.d.mts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require(`./chunk-Bmb41Sf3.cjs`),t=require(`./button-Bu4ejNOW.cjs`),n=require(`./tooltip-DC6i1A25.cjs`),r=require(`./separator-jytY1CPq.cjs`),i=require(`./close-DUBEKxhw.cjs`),a=require(`./dialog-DEnyBH2X.cjs`),o=require(`./command-CTdjZi1F.cjs`),s=require(`./checkbox-BQ_TclX9.cjs`),c=require(`./input-1ceJxxFI.cjs`),l=require(`./popover-Bnrgg4do.cjs`),u=require(`./select-DHiTqZeX.cjs`),d=require(`./label-BHbqbBtO.cjs`),f=require(`./textarea-SPXNe-iZ.cjs`),p=require(`./calendar-ChaYPTJO.cjs`),m=require(`./radio-group-KMvVXCIk.cjs`),h=require(`./text-editor-Dy3_hyNw.cjs`);let g=require(`lucide-react`),_=require(`react`),v=require(`@customafk/react-toolkit/utils`),y=require(`class-variance-authority`),b=require(`react/jsx-runtime`),x=require(`@customafk/react-toolkit/date-fns`),S=require(`radix-ui`),C=require(`@tanstack/react-form`);function w({width:e,className:t,children:n}){let r=e?{width:typeof e==`number`?`${e}px`:e,flexShrink:0}:{flex:1,minWidth:0};return(0,b.jsx)(`div`,{"data-slot":`array-col`,style:r,className:t,children:n})}function T({defaultRow:e,children:n,addLabel:r=`Add row`,className:i}){let a=Q(),o=a.state.value??[],s=(0,_.useCallback)(()=>{a.pushValue({...e})},[a,e]),c=(0,_.useCallback)(e=>{a.removeValue(e)},[a]);return(0,b.jsxs)(`div`,{"data-slot":`simple-array-field`,className:(0,v.cn)(`flex flex-col gap-2`,i),children:[o.map((e,t)=>(0,b.jsxs)(`div`,{className:`flex items-start gap-2`,children:[n(t),(0,b.jsx)(`button`,{type:`button`,title:`Remove row`,className:`mt-auto mb-0.5 flex size-7 shrink-0 items-center justify-center rounded text-muted transition-colors hover:text-danger-strong`,onClick:()=>c(t),children:(0,b.jsx)(g.Trash2Icon,{size:14})})]},t)),(0,b.jsx)(`div`,{children:(0,b.jsxs)(t.t,{type:`button`,variant:`ghost`,color:`muted`,size:`sm`,className:`gap-1.5`,onClick:s,children:[(0,b.jsx)(g.PlusIcon,{size:13}),r]})})]})}const E=(0,y.cva)([`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`}}),D=({label:e,color:t,size:n,className:r,children:i})=>(0,b.jsx)(`div`,{"data-slot":`required-indicator`,className:E({color:t,size:n,className:r}),children:e||i});function O({className:e,children:t,...n}){return(0,b.jsxs)(S.Label.Root,{"data-slot":`label`,className:(0,v.cn)(`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:[(0,b.jsx)(`span`,{className:`flex items-center gap-1`,children:t}),(0,b.jsx)(D,{label:`Required`,color:`danger`,size:`xs`,className:`hidden shrink-0`})]})}const k=(0,y.cva)(`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`}}),A=(0,_.memo)(({className:e,...t})=>(0,b.jsx)(`fieldset`,{"data-slot":`field-set`,className:(0,v.cn)(`flex flex-col gap-6 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3`,e),...t}));A.displayName=`FieldSet`;const j=(0,_.memo)(({className:e,variant:t=`legend`,...n})=>(0,b.jsx)(`legend`,{"data-slot":`field-legend`,"data-variant":t,className:(0,v.cn)(`mb-3 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base`,e),...n}));j.displayName=`FieldLegend`;const M=(0,_.memo)(({className:e,...t})=>(0,b.jsx)(`div`,{"data-slot":`field-group`,className:(0,v.cn)(`group/field-group @container/field-group`,`flex flex-col gap-7 pt-4`,`data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,e),...t}));M.displayName=`FieldGroup`;const N=(0,_.memo)(({className:e,orientation:t=`vertical`,...n})=>(0,b.jsx)(`div`,{"data-slot":`field`,"data-orientation":t,className:(0,v.cn)(k({orientation:t}),e),...n}));N.displayName=`Field`;const P=(0,_.memo)(({className:e,...t})=>(0,b.jsx)(`div`,{"data-slot":`field-content`,className:(0,v.cn)(`group/field-content flex flex-col gap-1.5 leading-snug`,e),...t}));P.displayName=`FieldContent`;const F=(0,_.memo)(({className:e,...t})=>(0,b.jsx)(`div`,{"data-slot":`field-content-main`,className:(0,v.cn)(`relative`,e),...t}));F.displayName=`FieldContentMain`;const I=(0,_.memo)(({className:e,...t})=>(0,b.jsx)(O,{"data-slot":`field-label`,className:(0,v.cn)(`group/field-label peer/field-label min-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}));I.displayName=`FieldLabel`;const L=(0,_.memo)(({className:e,...t})=>(0,b.jsx)(`div`,{"data-slot":`field-label`,className:(0,v.cn)(`flex w-fit items-center gap-2 font-medium text-sm leading-snug group-data-[disabled=true]/field:opacity-50`,e),...t}));L.displayName=`FieldTitle`;const R=(0,_.memo)(({className:e,...t})=>(0,b.jsx)(`p`,{"data-slot":`field-description`,className:(0,v.cn)(`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}));R.displayName=`FieldDescription`;const z=(0,_.memo)(({isShow:e=!0,className:t,children:n,...r})=>e===!1?null:(0,b.jsxs)(`div`,{"data-slot":`field-note`,className:(0,v.cn)(`flex items-start gap-1.5 rounded border border-primary-muted/60 bg-primary-bg-subtle/80 px-2.5 py-2 text-text-positive-weak text-xs`,t),...r,children:[(0,b.jsx)(g.InfoIcon,{size:12,className:`mt-0.5 shrink-0 text-primary/70`}),(0,b.jsx)(`span`,{children:n})]}));z.displayName=`FieldNote`;const B=(0,_.memo)(({tooltip:e})=>(0,b.jsxs)(n.t,{children:[(0,b.jsx)(n.i,{asChild:!0,children:(0,b.jsxs)(`button`,{type:`button`,tabIndex:-1,className:`inline-flex cursor-default items-center text-text-positive-weak/70 hover:text-text-positive focus:outline-none`,children:[(0,b.jsx)(g.HelpCircleIcon,{size:13,"aria-hidden":`true`}),(0,b.jsx)(`span`,{className:`sr-only`,children:`More information`})]})}),(0,b.jsx)(n.n,{side:`top`,className:`max-w-xs text-balance`,children:e})]}));B.displayName=`FieldTooltip`;const V=(0,_.memo)(({children:e,className:t,...n})=>(0,b.jsxs)(`div`,{"data-slot":`field-separator`,"data-content":!!e,className:(0,v.cn)(`relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2`,t),...n,children:[(0,b.jsx)(r.t,{className:`absolute inset-0 top-1/2`}),e&&(0,b.jsx)(`span`,{className:`relative mx-auto block w-fit bg-background px-2 text-text-positive-weak`,"data-slot":`field-separator-content`,children:e})]}));V.displayName=`FieldSeparator`;const H=(0,_.memo)(({className:e,children:t,errors:n,...r})=>{let i=(0,_.useMemo)(()=>t||(n?n?.length===1&&n[0]?.message?(0,b.jsx)(`div`,{className:`flex flex-row items-center justify-start gap-x-0.5`,children:(0,b.jsx)(`p`,{children:n[0]?.code===`invalid_type`?`Invalid format`:n[0].message})}):(0,b.jsx)(`ul`,{className:`flex list-none flex-col`,children:n.map(e=>typeof e==`string`?(0,b.jsx)(`li`,{children:e},e):e?.message?(0,b.jsx)(`li`,{children:e.message},e.message):null)}):null),[t,n]);return i?(0,b.jsx)(`div`,{role:`alert`,"data-slot":`field-error`,className:(0,v.cn)(`w-full font-medium text-danger-strong text-xs`,e),...r,children:i}):null});H.displayName=`FieldError`;const U=({label:e,placeholder:t,required:n,maxLength:r,disabled:i})=>{let a=(0,_.useId)(),{form:o,name:s,state:l,handleBlur:u,handleChange:f}=Q(),p=(0,C.useStore)(o.store,({isSubmitting:e})=>e),m=l.meta.isTouched&&!l.meta.isValid,h=(0,_.useCallback)(({target:{value:e}})=>{p||r&&e.length>r||f(e||null)},[p,r,f]);return(0,b.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,b.jsxs)(d.t,{htmlFor:a,children:[e,n&&(0,b.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]}),(0,b.jsxs)(`div`,{className:`relative`,children:[(0,b.jsx)(c.t,{id:a,name:s,type:`email`,value:l.value??``,"aria-invalid":m,autoComplete:`email`,placeholder:t,disabled:i||p,className:(0,v.cn)(`pl-9`),onBlur:u,onChange:h}),(0,b.jsx)(`div`,{className:`pointer-events-none absolute inset-y-0 left-0 flex size-9 items-center justify-center text-muted`,children:(0,b.jsx)(g.AtSignIcon,{size:14})})]}),m&&(0,b.jsx)(H,{errors:l.meta.errors})]})},ee=e=>e?/^-?\d*\.?\d*$/:/^\d*\.?\d*$/,te=e=>Number(e).toLocaleString(),ne=(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}},W=({disabled:e=!1,readOnly:t=!1,allowNegative:n=!1,numberAfterDecimalPoint:r=2,roundingRule:i=`none`,value:a=null,unitText:o,decimal:s,placeholder:l,precision:u,wrapperClassName:d,className:f,onChange:p,onValueChange:m,onFocus:h,onBlur:g,...y})=>{let x=(0,_.useRef)(null),S=(0,_.useRef)(null),[C,w]=(0,_.useState)(a?.toString()??null),T=(0,_.useMemo)(()=>s?.[1]??r,[s,r]),E=(0,_.useMemo)(()=>s&&s[0]-s[1],[s]),D=(0,_.useMemo)(()=>ee(n),[n]),O=(0,_.useCallback)(e=>{if(!T||e===`-`)return!0;let[t,n=``]=e.split(`.`),r=t.startsWith(`-`)?t.length-1:t.length;return n.length<=T&&r<=(E??1/0)},[T,E]),k=(0,_.useCallback)(e=>{if(e===`0`)return`0`;if(!Number(e))return null;let[t,n=``]=ne(parseFloat(e),Math.min(T-1,u||0),i).toString().split(`.`),r=te(t);return n?`${r}.${n}`:r},[T,u,i]),A=(0,_.useCallback)(e=>{let t=e===`0`,n=e===`-`||/^-0+(\.0+)?$/.test(e)||/^-0*\.$/.test(e);if(t){m?.(0),w(e);return}if(n){w(()=>(m?.(0),e));return}},[m]),j=(0,_.useCallback)(e=>{p?.(e);let{value:t}=e.target;if(t===``||t===void 0){m?.(null),w(null);return}A(t),!(!D.test(t)||!O(t))&&(m?.(parseFloat(t)||0),w(t))},[O,p,m,A,D]),M=(0,_.useCallback)(e=>{t||(h?.(e),w(e=>typeof e==`string`?e.replace(/,/g,``):null))},[t,h]),N=(0,_.useCallback)(e=>{t||(g?.(e),w(e=>e===null?null:e===`0`||e===`-`||/^-0+(\.0+)?$/.test(e)||/^-0*\.$/.test(e)?`0`:typeof e==`string`?k(e):null))},[t,k,g]);return(0,_.useEffect)(()=>{let e=document.activeElement===S.current;if(a==null||!D.test(a.toString())||!O(a.toString())){w(null);return}w(t=>e?t:k(a.toString()))},[k,a,O,D]),(0,_.useEffect)(()=>{if(!x.current||!S.current||!o)return;let e=x.current.offsetWidth;S.current.style.setProperty(`padding-right`,`${(e+10)/16}rem`)},[o]),(0,b.jsxs)(`div`,{className:(0,v.cn)(`relative`,d),children:[(0,b.jsx)(c.t,{...y,ref:S,value:C||(t?`0`:``),placeholder:l,disabled:e,readOnly:t,className:(0,v.cn)(`text-end font-number text-sm slashed-zero lining-nums tabular-nums`,t&&`bg-muted text-muted-foreground`,f),onChange:j,onFocus:M,onBlur:N}),o&&(0,b.jsx)(`span`,{ref:x,className:`-translate-y-1/2 pointer-events-none absolute top-1/2 right-2 text-muted-foreground text-sm`,children:o})]})},re=({label:e,placeholder:t,required:n,unit:r,allowNegative:i,disabled:a})=>{let o=(0,_.useId)(),{form:s,state:c,handleBlur:l,handleChange:u}=Q(),f=(0,C.useStore)(s.store,({isSubmitting:e})=>e),p=c.meta.isTouched&&!c.meta.isValid,m=(0,_.useCallback)(e=>{f||u(e)},[f,u]);return(0,b.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,b.jsxs)(d.t,{htmlFor:o,children:[e,n&&(0,b.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]}),(0,b.jsx)(W,{id:o,value:c.value,placeholder:t,unitText:r,allowNegative:i,disabled:a||f,onBlur:l,onValueChange:m}),p&&(0,b.jsx)(H,{errors:c.meta.errors})]})},ie=({label:e,placeholder:t,required:n,disabled:r})=>{let i=(0,_.useId)(),{form:a,name:o,state:s,handleBlur:l,handleChange:u}=Q(),f=(0,C.useStore)(a.store,({isSubmitting:e})=>e),[p,m]=(0,_.useState)(!1),h=s.meta.isTouched&&!s.meta.isValid,v=(0,_.useCallback)(()=>m(e=>!e),[]),y=(0,_.useCallback)(({target:{value:e}})=>{f||u(e||null)},[f,u]);return(0,b.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,b.jsxs)(d.t,{htmlFor:i,children:[e,n&&(0,b.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]}),(0,b.jsxs)(`div`,{className:`relative`,children:[(0,b.jsx)(c.t,{id:i,name:o,type:p?`text`:`password`,value:s.value??``,"aria-invalid":h,autoComplete:`current-password`,placeholder:t,disabled:r||f,className:`pr-9`,onBlur:l,onChange:y}),(0,b.jsx)(`button`,{type:`button`,tabIndex:-1,"aria-label":p?`Hide password`:`Show password`,"aria-pressed":p,"aria-controls":i,className:`absolute inset-y-0 right-0 flex size-9 items-center justify-center text-muted outline-none transition-colors hover:text-text-positive focus-visible:text-text-positive disabled:pointer-events-none disabled:opacity-50`,disabled:r||f,onClick:v,children:p?(0,b.jsx)(g.EyeOffIcon,{size:16,"aria-hidden":`true`}):(0,b.jsx)(g.EyeIcon,{size:16,"aria-hidden":`true`})})]}),h&&(0,b.jsx)(H,{errors:s.meta.errors})]})},ae=({label:e,placeholder:t,required:n,options:r})=>{let i=(0,_.useId)(),{state:a,handleBlur:o,handleChange:s}=Q(),c=a.meta.isTouched&&!a.meta.isValid;return(0,b.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[e&&(0,b.jsxs)(d.t,{htmlFor:i,children:[e,n&&(0,b.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]}),(0,b.jsxs)(u.t,{value:a.value??``,onValueChange:s,children:[(0,b.jsx)(u.s,{id:i,"aria-invalid":c?`true`:void 0,onBlur:o,children:(0,b.jsx)(u.c,{placeholder:t})}),(0,b.jsx)(u.n,{children:r.length>0?r.map(e=>(0,b.jsx)(u.i,{value:e.value,children:e.label},e.value)):(0,b.jsxs)(`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:[(0,b.jsx)(g.PackagePlusIcon,{strokeWidth:1}),`No options available`]})})]}),c&&(0,b.jsx)(H,{errors:a.meta.errors})]})},oe=({label:e,placeholder:t,required:n,maxLength:r,rows:i,disabled:a})=>{let o=(0,_.useId)(),{form:s,name:c,state:l,handleBlur:u,handleChange:p}=Q(),m=(0,C.useStore)(s.store,({isSubmitting:e})=>e),h=l.meta.isTouched&&!l.meta.isValid,g=(0,_.useCallback)(({target:{value:e}})=>{m||r&&e.length>r||p(e||null)},[m,r,p]);return(0,b.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,b.jsxs)(d.t,{htmlFor:o,children:[e,n&&(0,b.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]}),(0,b.jsx)(f.t,{id:o,name:c,value:l.value??``,"aria-invalid":h,placeholder:t,rows:i,disabled:a||m,onBlur:u,onChange:g}),h&&(0,b.jsx)(H,{errors:l.meta.errors})]})},se=({label:e,placeholder:t,required:n,maxLength:r,disabled:i})=>{let a=(0,_.useId)(),{form:o,name:s,state:l,handleBlur:u,handleChange:f}=Q(),p=(0,C.useStore)(o.store,({isSubmitting:e})=>e),m=l.meta.isTouched&&!l.meta.isValid,h=(0,_.useCallback)(({target:{value:e}})=>{p||r&&e.length>r||f(e||null)},[p,r,f]);return(0,b.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,b.jsxs)(d.t,{htmlFor:a,children:[e,n&&(0,b.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]}),(0,b.jsx)(c.t,{id:a,name:s,value:l.value??``,"aria-invalid":m,placeholder:t,autoComplete:`off`,disabled:i||p,onBlur:u,onChange:h}),m&&(0,b.jsx)(H,{errors:l.meta.errors})]})},ce=({label:e,description:t,options:n,tooltip:r,helperText:i,orientation:a})=>{let o=Q(),c=(0,C.useStore)(o.form.store,({isSubmitting:e})=>e);return(0,b.jsxs)(M,{className:`gap-y-4 px-4`,children:[(0,b.jsxs)(N,{orientation:a,children:[(0,b.jsxs)(P,{children:[(0,b.jsxs)(I,{children:[e,r&&(0,b.jsx)(B,{tooltip:r})]}),(0,b.jsx)(R,{children:t}),(0,b.jsx)(z,{isShow:!!i,children:i})]}),(0,b.jsx)(F,{children:(0,b.jsx)(M,{className:`flex flex-col gap-y-2`,children:n.map(e=>(0,b.jsxs)(N,{orientation:`horizontal`,children:[(0,b.jsx)(s.t,{id:`${o.name}-${e.value}`,name:o.name,checked:o.state.value?.includes(e.value)??!1,disabled:c,onCheckedChange:t=>{if(t&&o.state.value!==null)o.pushValue(e.value);else if(t&&o.state.value===null)o.setValue([e.value]);else if(!t&&o.state.value!==null){let t=o.state.value.indexOf(e.value);t>-1&&o.removeValue(t)}else o.setValue(null)}}),(0,b.jsx)(I,{htmlFor:`${o.name}-${e.value}`,className:`text-text-positive`,children:e.label})]},e.value))})})]}),(0,b.jsx)(V,{})]})},G=({label:e,description:n,placeholder:r,tooltip:i,orientation:a=`responsive`,options:s})=>{let c=Q(),u=(0,_.useMemo)(()=>c.state.meta.isTouched&&!c.state.meta.isValid,[c.state.meta.isTouched,c.state.meta.isValid]),d=(0,_.useMemo)(()=>c.state.meta.errors,[c.state.meta.errors]),f=s.find(({value:e})=>e===c.state.value)?.label;return(0,b.jsxs)(M,{className:`px-4`,children:[(0,b.jsxs)(N,{orientation:a,"data-invalid":u,children:[(0,b.jsxs)(P,{children:[(0,b.jsxs)(I,{htmlFor:c.name,children:[e,i&&(0,b.jsx)(B,{tooltip:i})]}),(0,b.jsx)(R,{children:n})]}),(0,b.jsx)(F,{className:`flex justify-end`,children:(0,b.jsxs)(`div`,{className:`flex w-full max-w-60 flex-col`,children:[(0,b.jsxs)(l.t,{children:[(0,b.jsx)(l.a,{asChild:!0,children:(0,b.jsx)(t.t,{variant:`outline`,color:`muted`,size:`lg`,className:(0,v.cn)(`flex items-center justify-start rounded 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`,!c.state.value&&`text-text-positive-muted`),children:f?(0,b.jsx)(`p`,{className:`flex min-w-0 flex-1 items-center gap-2 text-start`,children:f}):(0,b.jsx)(`p`,{className:`flex-1 text-start text-text-positive-muted`,children:r})})}),(0,b.jsx)(l.i,{align:`end`,side:`bottom`,className:`flex w-fit rounded p-0`,onBlur:c.handleBlur,children:(0,b.jsxs)(o.t,{className:`border-none`,children:[(0,b.jsx)(o.a,{placeholder:r??`Search…`}),(0,b.jsx)(o.s,{children:(0,b.jsx)(o.i,{className:`max-h-40 overflow-y-auto`,children:s.map(({value:e,label:t})=>(0,b.jsx)(o.o,{value:t,onSelect:()=>c.handleChange(e),children:t},e))})}),(0,b.jsx)(o.r,{children:`No results found.`})]})})]}),(0,b.jsx)(`div`,{className:`mt-1 flex w-full flex-col items-end justify-end`,children:(0,b.jsx)(H,{errors:d})})]})})]}),(0,b.jsx)(V,{})]})},le=({label:e,description:n,placeholder:r,orientation:i=`responsive`,tooltip:a,helperText:o,minDate:s,maxDate:c,required:u})=>{let d=Q(),f=(0,_.useMemo)(()=>u?d.state.value===null:!1,[u,d.state.value]),m=(0,_.useMemo)(()=>d.state.meta.isTouched&&!d.state.meta.isValid,[d.state.meta.isTouched,d.state.meta.isValid]);return(0,b.jsxs)(M,{className:`px-4`,children:[(0,b.jsxs)(N,{orientation:i,"data-invalid":m,children:[(0,b.jsxs)(P,{children:[(0,b.jsxs)(I,{htmlFor:d.name,"aria-required":f,children:[e,a&&(0,b.jsx)(B,{tooltip:a})]}),(0,b.jsx)(R,{children:n})]}),(0,b.jsxs)(F,{className:`flex flex-col space-y-1`,children:[(0,b.jsx)(`div`,{className:`flex w-full flex-col`,children:(0,b.jsxs)(l.t,{children:[(0,b.jsx)(l.a,{asChild:!0,children:(0,b.jsxs)(t.t,{variant:`outline`,color:`muted`,size:`lg`,className:(0,v.cn)(`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`,d.state.value===null&&`text-text-positive-muted`),children:[(0,b.jsx)(`p`,{children:d.state.value===null?r||`Select date`:(0,x.format)(d.state.value,`PPPP`)}),(0,b.jsx)(g.CalendarDaysIcon,{strokeWidth:1})]})}),(0,b.jsxs)(l.i,{align:`start`,side:`bottom`,className:`flex w-fit min-w-0 overflow-y-auto rounded p-0`,onBlur:d.handleBlur,children:[(0,b.jsxs)(`div`,{className:`flex h-full flex-col space-y-2 border-r border-r-border p-2 [&>button]:justify-start [&>button]:text-sm`,children:[(0,b.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,x.endOfToday)())},children:`Today`}),(0,b.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,x.endOfTomorrow)())},children:`Tomorrow`}),(0,b.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,x.endOfYesterday)())},children:`Yesterday`}),(0,b.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,x.subDays)((0,x.endOfToday)(),3))},children:`Last 3 Days`}),(0,b.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,x.subDays)((0,x.endOfToday)(),7))},children:`Last 7 Days`}),(0,b.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,x.subDays)((0,x.endOfToday)(),30))},children:`Last 30 Days`}),(0,b.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,x.startOfMonth)((0,x.endOfToday)()))},children:`This Month`}),(0,b.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,x.lastDayOfMonth)((0,x.endOfToday)()))},children:`Last Month`})]}),(0,b.jsx)(`div`,{className:`flex flex-1 flex-col`,children:(0,b.jsx)(`div`,{className:`min-w-73 border-b border-b-border p-2`,children:(0,b.jsx)(p.t,{mode:`single`,selected:d.state.value??void 0,hidden:{before:s??new Date(1900,0,1),after:c??new Date(2100,11,31)},onSelect:e=>{e&&d.handleChange(e)}})})})]})]})}),(0,b.jsx)(z,{isShow:!!o,children:o})]})]}),(0,b.jsx)(V,{})]})},ue=({label:e,description:t,placeholder:n,tooltip:r,helperText:i,orientation:a=`responsive`,showErrorMessage:o=!0,required:s=!1,maxLength:l})=>{let{form:u,name:d,state:f,handleBlur:p,handleChange:m}=Q(),h=(0,C.useStore)(u.store,({isSubmitting:e})=>e),y=f.meta.isDirty&&f.meta.isTouched&&!f.meta.isValid,x=s&&f.value===null,S=!h&&!!f.value,w=(0,_.useCallback)(({target:{value:e}})=>{h||l&&e.length>l||m(e||null)},[h,l,m]),T=(0,_.useCallback)(()=>{h||m(null)},[h,m]);return(0,b.jsxs)(M,{className:`gap-y-4 px-4`,children:[(0,b.jsxs)(N,{"data-invalid":y,orientation:a,children:[(0,b.jsxs)(P,{children:[(0,b.jsxs)(I,{htmlFor:d,"aria-required":x,children:[e,r&&(0,b.jsx)(B,{tooltip:r})]}),(0,b.jsx)(R,{children:t})]}),(0,b.jsxs)(F,{children:[(0,b.jsx)(c.t,{id:d,name:d,value:f.value===null?``:f.value,"aria-invalid":y,autoComplete:`email`,placeholder:n,className:(0,v.cn)(`pl-9`,S&&`pr-9`,h&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:p,onChange:w}),(0,b.jsx)(`div`,{className:`absolute top-0 left-0 flex size-9 items-center justify-center text-muted`,children:(0,b.jsx)(g.AtSignIcon,{size:14})}),S&&(0,b.jsx)(`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:T,children:(0,b.jsx)(g.XIcon,{size:14,"aria-hidden":`true`})}),(0,b.jsx)(`div`,{className:`mt-1 flex w-full items-start justify-start`,children:o&&f.meta.isDirty&&(0,b.jsx)(H,{errors:f.meta.errors})}),(0,b.jsx)(z,{isShow:!!i,children:i})]})]}),(0,b.jsx)(V,{})]})},de=({label:e,description:t,placeholder:n,tooltip:r,helperText:i,orientation:a=`responsive`,showErrorMessage:o=!0,rounding:s,decimalPlaces:c,percision:l,unit:u,required:d,allowNegative:f})=>{let p=Q(),m=(0,C.useStore)(p.form.store,({isSubmitting:e})=>e),h=p.state.meta.errors,y=d?p.state.value===null:!1,x=(0,_.useCallback)(e=>{m||p.handleChange(e)},[m,p.handleChange]);return(0,b.jsxs)(M,{className:`gap-y-4 px-4`,children:[(0,b.jsxs)(N,{orientation:a,"data-invalid":p.state.meta.isTouched&&!p.state.meta.isValid,children:[(0,b.jsxs)(P,{children:[(0,b.jsxs)(I,{htmlFor:p.name,"aria-required":y,children:[e,r&&(0,b.jsx)(B,{tooltip:r})]}),(0,b.jsx)(R,{children:t})]}),(0,b.jsxs)(F,{children:[(0,b.jsxs)(`div`,{className:`relative w-full`,children:[(0,b.jsx)(W,{id:p.name,value:p.state.value,"aria-invalid":p.state.meta.isTouched&&!p.state.meta.isValid&&p.state.meta.isDirty,placeholder:n,roundingRule:s,numberAfterDecimalPoint:c,precision:l,unitText:u,allowNegative:f,className:(0,v.cn)(m&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:p.handleBlur,onValueChange:x}),m&&(0,b.jsx)(`div`,{className:`absolute inset-s-2 inset-y-0 top-2.5 text-muted-weak [&>svg]:size-3.5`,children:(0,b.jsx)(g.Loader2Icon,{className:`animate-spin text-primary-strong`})}),p.state.meta.isDirty&&o&&!!h.length&&(0,b.jsx)(`div`,{className:`absolute inset-s-2 inset-y-0 top-2.75 text-danger-strong [&>svg]:size-3.5`,children:(0,b.jsx)(g.BanIcon,{})}),(0,b.jsx)(`div`,{className:`mt-1 flex w-full flex-col items-end justify-end`,children:p.state.meta.isDirty&&o&&(0,b.jsx)(H,{errors:h})})]}),(0,b.jsx)(z,{isShow:!!i,children:i})]})]}),(0,b.jsx)(V,{})]})},fe=({label:e,description:t,placeholder:n,orientation:r=`responsive`,tooltip:i,helperText:a,showErrorMessage:o=!0})=>{let s=(0,_.useId)(),{form:l,name:u,state:d,handleBlur:f,handleChange:p}=Q(),m=(0,C.useStore)(l.store,({isSubmitting:e})=>e),[h,v]=(0,_.useState)(!1),y=d.meta.isDirty&&d.meta.isTouched&&!d.meta.isValid,x=(0,_.useCallback)(()=>v(e=>!e),[]),S=(0,_.useCallback)(({target:{value:e}})=>{m||p(e||null)},[m,p]);return(0,b.jsxs)(M,{className:`gap-y-4 px-4`,children:[(0,b.jsxs)(N,{"data-invalid":y,orientation:r,children:[(0,b.jsxs)(P,{children:[(0,b.jsxs)(I,{htmlFor:s,children:[e,i&&(0,b.jsx)(B,{tooltip:i})]}),(0,b.jsx)(R,{children:t})]}),(0,b.jsxs)(F,{children:[(0,b.jsx)(c.t,{id:s,name:u,type:h?`text`:`password`,placeholder:n,value:d.value??``,"aria-invalid":y,autoComplete:`new-password`,onBlur:f,onChange:S}),(0,b.jsx)(`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:x,"aria-label":h?`Hide password`:`Show password`,"aria-pressed":h,"aria-controls":s,children:h?(0,b.jsx)(g.EyeOffIcon,{size:16,"aria-hidden":`true`}):(0,b.jsx)(g.EyeIcon,{size:16,"aria-hidden":`true`})}),(0,b.jsx)(`div`,{className:`mt-1 flex w-full items-start justify-start`,children:o&&d.meta.isDirty&&(0,b.jsx)(H,{errors:d.meta.errors})}),(0,b.jsx)(z,{isShow:!!a,children:a})]})]}),(0,b.jsx)(V,{})]})},pe=({label:e,description:t,orientation:n,options:r,tooltip:i,helperText:a})=>{let o=Q(),s=(0,C.useStore)(o.form.store,({isSubmitting:e})=>e);return(0,b.jsxs)(M,{className:`px-4`,children:[(0,b.jsxs)(N,{orientation:n,className:`flex-col gap-2`,children:[(0,b.jsxs)(P,{children:[(0,b.jsxs)(I,{children:[e,i&&(0,b.jsx)(B,{tooltip:i})]}),(0,b.jsx)(R,{children:t}),(0,b.jsx)(z,{isShow:!!a,children:a})]}),(0,b.jsx)(F,{children:(0,b.jsx)(m.t,{value:o.state.value??``,className:`w-full`,onValueChange:o.handleChange,children:r.map(e=>(0,b.jsx)(I,{className:(0,v.cn)(`h-fit`,o.state.value===e.value&&`border-primary-weak! bg-primary-bg-subtle`,s&&`pointer-events-none bg-muted-muted opacity-60`,o.state.value===e.value&&s&&`border-border-strong!`),children:(0,b.jsxs)(N,{orientation:`horizontal`,className:`items-start gap-3 rounded p-2!`,children:[(0,b.jsx)(m.n,{value:e.value,className:`mt-0.5 shrink-0`}),(0,b.jsxs)(P,{className:`gap-0.5!`,children:[(0,b.jsx)(L,{children:e.label}),(0,b.jsx)(R,{className:`text-xs`,children:e.description})]})]})},e.value))})})]}),(0,b.jsx)(V,{})]})},me=({label:e,description:t,placeholder:n,orientation:r=`responsive`,tooltip:i,options:a,helperText:o,required:s=!1})=>{let c=Q(),l=c.state.meta.isTouched&&!c.state.meta.isValid,d=s&&c.state.value===null,f=c.state.meta.errors;return(0,b.jsxs)(M,{className:`gap-y-4 px-4`,children:[(0,b.jsxs)(N,{orientation:r,"data-invalid":l,children:[(0,b.jsxs)(P,{children:[(0,b.jsxs)(I,{htmlFor:c.name,"aria-required":d,children:[e,i&&(0,b.jsx)(B,{tooltip:i})]}),(0,b.jsx)(R,{children:t})]}),(0,b.jsxs)(F,{className:`flex flex-col`,children:[(0,b.jsxs)(u.t,{value:c.state.value??``,onValueChange:c.handleChange,children:[(0,b.jsx)(u.s,{"aria-invalid":l?`true`:void 0,onBlur:c.handleBlur,children:(0,b.jsx)(u.c,{placeholder:n})}),(0,b.jsxs)(u.n,{children:[!!a.length&&a.map(e=>(0,b.jsx)(u.i,{value:e.value,children:e.label},e.value)),!a.length&&(0,b.jsxs)(`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:[(0,b.jsx)(g.PackagePlusIcon,{strokeWidth:1}),`No options available`]})]})]}),(0,b.jsx)(`div`,{className:`mt-1 flex w-full flex-col items-end justify-end`,children:(0,b.jsx)(H,{errors:f})}),(0,b.jsx)(z,{isShow:!!o,children:o})]})]}),(0,b.jsx)(V,{})]})};function he({className:e,...t}){return(0,b.jsx)(S.Switch.Root,{"data-slot":`switch`,className:(0,v.cn)(`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:(0,b.jsx)(S.Switch.Thumb,{"data-slot":`switch-thumb`,className:(0,v.cn)(`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 ge=({label:e,description:t,helperText:n})=>{let r=Q();return(0,b.jsxs)(M,{className:`gap-y-4 px-4`,children:[(0,b.jsxs)(N,{orientation:`vertical`,className:`relative justify-between gap-y-1`,children:[(0,b.jsxs)(P,{children:[(0,b.jsx)(L,{className:`cursor-pointer`,children:(0,b.jsx)(`label`,{htmlFor:r.name,children:e})}),(0,b.jsx)(R,{children:t}),(0,b.jsx)(he,{id:r.name,checked:r.state.value??!1,className:`absolute top-1 right-1`,onBlur:r.handleBlur,onCheckedChange:r.handleChange})]}),(0,b.jsx)(z,{isShow:!!n,children:n})]}),(0,b.jsx)(V,{})]})},_e=({label:e,description:t,placeholder:n,tooltip:r,helperText:i,counter:a=!1,orientation:o=`responsive`,showClearButton:s=!1,showErrorMessage:l=!0,required:u=!1,maxLength:d})=>{let f=(0,_.useId)(),p=(0,_.useRef)(null),{form:m,name:h,state:y,handleBlur:x,handleChange:S}=Q(),w=(0,C.useStore)(m.store,({isSubmitting:e})=>e),T=s&&!w&&!!y.value,E=y.value?y.value.length:0,D=(0,_.useMemo)(()=>{if(!a)return``;let e=`character${[0,1].includes(E)?``:`s`}`;return a&&d?`${E} / ${d} character${E?`s`:``}`:`${E} ${e}`},[E,a,d]),O=y.meta.isDirty&&y.meta.isTouched&&!y.meta.isValid,k=u&&y.value===null,A=d&&E>=d*.8,j=d&&E>=d,L=(0,_.useCallback)(({target:{value:e}})=>{w||a&&d&&e.length>d||S(e||null)},[w,a,d,S]),U=(0,_.useCallback)(()=>{w||(S(null),p.current?.focus())},[w,S]);return(0,b.jsxs)(M,{className:`gap-y-4 px-4`,children:[(0,b.jsxs)(N,{orientation:o,"data-invalid":O,children:[(0,b.jsxs)(P,{children:[(0,b.jsxs)(I,{"aria-required":k,htmlFor:f,children:[e,r&&(0,b.jsx)(B,{tooltip:r})]}),(0,b.jsx)(R,{children:t})]}),(0,b.jsxs)(F,{children:[(0,b.jsx)(c.t,{ref:p,id:f,name:h,value:y.value??``,"aria-invalid":O,autoComplete:`off`,placeholder:n,autoCapitalize:`none`,autoCorrect:`off`,className:(0,v.cn)(`pr-6`,w&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:x,onChange:L}),T&&(0,b.jsx)(`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:U,children:(0,b.jsx)(g.XIcon,{"aria-hidden":`true`})}),w&&(0,b.jsx)(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-muted-weak`,children:(0,b.jsx)(g.Loader2Icon,{size:14,className:`animate-spin text-primary-strong`})}),!T&&y.meta.isDirty&&l&&!!y.meta.errors.length&&(0,b.jsx)(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-danger-strong`,children:(0,b.jsx)(g.BanIcon,{"aria-hidden":`true`,size:14})}),(0,b.jsxs)(`div`,{className:`my-1 flex w-full items-start justify-between gap-x-2`,children:[y.meta.isDirty&&l?(0,b.jsx)(H,{className:`flex-1`,errors:y.meta.errors}):(0,b.jsx)(`div`,{}),!!a&&(0,b.jsx)(`p`,{className:(0,v.cn)(`h-4 flex-0 text-nowrap text-end text-xs tabular-nums transition-colors`,j?`font-medium text-danger-strong`:A?`text-warning-strong`:`text-text-positive-weak`),children:D})]}),(0,b.jsx)(z,{isShow:!!i,children:i})]})]}),(0,b.jsx)(V,{})]})},K=(0,_.memo)(({label:e,description:t,placeholder:n,tooltip:r,helperText:i,counter:a=!1,orientation:o=`responsive`,showErrorMessage:s=!0,required:c=!1,maxLength:l})=>{let u=(0,_.useId)(),{form:d,state:p,name:m,handleBlur:h,handleChange:y}=Q(),x=(0,C.useStore)(d.store,({isSubmitting:e})=>e),S=p.value?p.value.length:0,w=(0,_.useMemo)(()=>{if(!a)return``;let e=`character${[0,1].includes(S)?``:`s`}`;return a&&l?`${S} / ${l} character${S?`s`:``}`:`${S} ${e}`},[S,a,l]),T=p.meta.isDirty&&p.meta.isTouched&&!p.meta.isValid,E=c&&p.value===null,D=p.meta.errors,O=l&&S>=l*.8,k=l&&S>=l,A=(0,_.useCallback)(({target:{value:e}})=>{x||a&&l&&e.length>l||y(e||null)},[x,a,l,y]);return(0,b.jsxs)(M,{className:`gap-y-4 px-4`,children:[(0,b.jsxs)(N,{orientation:o,"data-invalid":T,children:[(0,b.jsxs)(P,{children:[(0,b.jsxs)(I,{"aria-required":E,htmlFor:u,children:[e,r&&(0,b.jsx)(B,{tooltip:r})]}),(0,b.jsx)(R,{children:t})]}),(0,b.jsxs)(F,{children:[(0,b.jsx)(f.t,{id:u,name:m,value:p.value===null?``:p.value,"aria-invalid":T,autoCapitalize:`none`,autoComplete:`off`,placeholder:n,className:(0,v.cn)(x&&`pointer-events-none bg-muted-muted opacity-60`),onChange:A,onBlur:h}),x&&(0,b.jsx)(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-muted-weak`,children:(0,b.jsx)(g.Loader2Icon,{size:14,className:`animate-spin text-primary-strong`})}),p.meta.isDirty&&s&&!!D.length&&(0,b.jsx)(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-danger-strong`,children:(0,b.jsx)(g.BanIcon,{size:14})}),(0,b.jsxs)(`div`,{className:`my-1 flex w-full items-start justify-between gap-x-2`,children:[p.meta.isDirty&&s?(0,b.jsx)(H,{className:`flex-1`,errors:p.meta.errors}):(0,b.jsx)(`div`,{}),!!a&&(0,b.jsx)(`p`,{className:(0,v.cn)(`h-4 flex-0 text-nowrap text-end text-xs tabular-nums transition-colors`,k?`font-medium text-danger-strong`:O?`text-warning-strong`:`text-text-positive-weak`),children:w})]}),(0,b.jsx)(z,{isShow:!!i,children:i})]})]}),(0,b.jsx)(V,{})]})});K.displayName=`TextareaField`;const q=(0,_.memo)(({label:e,description:t,placeholder:n,tooltip:r,helperText:i,showErrorMessage:a=!0,required:o=!1})=>{let{form:s,state:c,handleChange:l}=Q(),u=(0,C.useStore)(s.store,({isSubmitting:e})=>e),d=c.meta.isDirty&&c.meta.isTouched&&!c.meta.isValid,f=o&&c.value===null,p=(0,_.useCallback)(e=>{u||l(e||null)},[u,l]);return(0,b.jsxs)(M,{className:`gap-y-4 px-4`,children:[(0,b.jsxs)(N,{orientation:`vertical`,"data-invalid":d,children:[(0,b.jsxs)(P,{children:[(0,b.jsxs)(I,{"aria-required":f,children:[e,r&&(0,b.jsx)(B,{tooltip:r})]}),(0,b.jsx)(R,{children:t})]}),(0,b.jsx)(h.t,{value:c.value??``,placeholder:n,readOnly:u,onChange:p}),c.meta.isDirty&&a&&!!c.meta.errors.length&&(0,b.jsx)(H,{errors:c.meta.errors}),(0,b.jsx)(z,{isShow:!!i,children:i})]}),(0,b.jsx)(V,{})]})});q.displayName=`TextEditorField`;const J=({label:e,className:n})=>{let r=$(),i=(0,_.useCallback)(async()=>{await r.handleSubmit({submitAction:`submit`}),r.state.isSubmitSuccessful&&r.reset()},[r]);return(0,b.jsx)(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})=>(0,b.jsx)(t.t,{type:`button`,size:`md`,disabled:r,isLoading:a,className:(0,v.cn)(`min-h-8 min-w-32`,n),onClick:i,children:e??`Submit`})})},ve=({type:e=`create`})=>{let n=$();return(0,b.jsxs)(`div`,{className:`flex h-8 items-center justify-between`,children:[(0,b.jsx)(n.Subscribe,{selector:e=>({disabled:e.isPristine||e.isSubmitting}),children:({disabled:e})=>(0,b.jsx)(t.t,{color:`muted`,variant:`outline`,type:`button`,size:`md`,disabled:e,className:`h-full min-w-32`,onClick:()=>n.reset(),children:`Cancel`})}),e===`create`&&(0,b.jsx)(n.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:e,isSubmitting:r})=>(0,b.jsxs)(t.t,{type:`submit`,size:`md`,disabled:e,isLoading:r,className:`h-full min-w-32`,onClick:async()=>{await n.handleSubmit({submitAction:`create`}),n.state.isSubmitSuccessful&&n.reset()},children:[(0,b.jsx)(g.PlusIcon,{}),`Add New`]})}),e===`update`&&(0,b.jsx)(n.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:e,isSubmitting:r})=>(0,b.jsxs)(t.t,{type:`submit`,size:`md`,disabled:e,isLoading:r,className:`h-full min-w-32`,onClick:async()=>{await n.handleSubmit({submitAction:`update`}),n.state.isSubmitSuccessful&&n.reset()},children:[(0,b.jsx)(g.ArrowDownToLine,{}),`Update`]})})]})};function Y({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return(0,b.jsx)(S.Separator.Root,{"data-slot":`separator`,decorative:n,orientation:t,className:(0,v.cn)(`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 ye=({title:e,description:n,onDelete:r,children:i})=>(0,b.jsxs)(`section`,{"data-slot":`card-form`,className:`relative flex flex-col rounded-md bg-card pb-4 shadow-card ring-1 ring-border`,children:[(0,b.jsxs)(`div`,{"data-slot":`card-form-header`,className:`flex flex-col space-y-0.5 px-4 py-3`,children:[(0,b.jsx)(`p`,{className:`font-semibold text-base tracking-tight`,children:e}),!!n&&(0,b.jsx)(`p`,{className:`text-text-positive-weak text-sm`,children:n})]}),(0,b.jsx)(Y,{}),(0,b.jsx)(`div`,{"data-slot":`card-form-main`,className:`flex flex-col py-4`,children:i}),!!r&&(0,b.jsxs)(t.t,{color:`danger`,variant:`ghost`,size:`sm`,className:`absolute top-2.5 right-3`,onClick:e=>{r?.(),e.preventDefault(),e.stopPropagation()},children:[(0,b.jsx)(g.Trash2Icon,{}),`Remove`]})]}),be=({children:e})=>(0,b.jsx)(`div`,{"data-slot":`section-form`,className:`flex flex-col space-y-4`,children:e}),X=({disabled:e,className:n,onClick:r,children:i})=>(0,b.jsx)(t.t,{type:`button`,variant:`outline`,color:`muted`,disabled:e,className:(0,v.cn)(`min-w-40`,n),onClick:r,children:i??`Cancel`}),Z=({isSubmitting:e,submitText:n=`Submit`,disabled:r,className:i,onClick:a})=>(0,b.jsx)(t.t,{type:`button`,isLoading:e,disabled:r||e,className:(0,v.cn)(`min-w-40`,i),onClick:a,children:n}),xe=({title:e,submitText:t,className:n,open:i,onOpenChange:o,children:s})=>{let c=$(),l=(0,_.useCallback)(e=>{e||c.reset(),o?.(e)},[c.reset,o]);return(0,b.jsx)(a.t,{open:i,onOpenChange:l,children:(0,b.jsxs)(a.c,{"data-slot":`dialog-portal`,children:[(0,b.jsx)(a.s,{}),(0,b.jsxs)(a.r,{className:(0,v.cn)(`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-5xl sm:rounded-md`,n),children:[(0,b.jsx)(`div`,{"data-slot":`dialog-header`,className:`flex items-center justify-center gap-2 px-6 py-5 text-center sm:text-left`,children:(0,b.jsx)(a.l,{"data-slot":`dialog-title`,className:`text-lg font-semibold tracking-tight`,children:e})}),(0,b.jsx)(r.t,{}),(0,b.jsx)(`div`,{"data-slot":`dialog-content`,className:`relative flex flex-col overflow-y-auto p-0 pt-4 max-sm:flex-1 sm:p-4`,children:s}),(0,b.jsx)(r.t,{}),(0,b.jsxs)(`div`,{"data-slot":`dialog-footer`,className:`flex flex-col-reverse items-center justify-end gap-2 px-6 py-4 sm:flex-row max-sm:[&>button]:w-full`,children:[(0,b.jsx)(c.Subscribe,{selector:e=>({disabled:e.isSubmitting}),children:({disabled:e})=>(0,b.jsx)(X,{disabled:e,onClick:()=>{c.reset(),l(!1)}})}),(0,b.jsx)(c.Subscribe,{selector:e=>({isSubmitting:e.isSubmitting,disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit}),children:({isSubmitting:e,disabled:n})=>(0,b.jsx)(Z,{isSubmitting:e,disabled:n,submitText:t,onClick:()=>c.handleSubmit()})})]})]})]})})},Se=({label:e,description:t,helperText:n,orientation:r=`responsive`,children:i})=>(0,b.jsxs)(M,{className:`gap-y-4 px-4`,children:[(0,b.jsxs)(N,{orientation:r,children:[(0,b.jsxs)(P,{children:[(0,b.jsx)(I,{children:e}),(0,b.jsx)(R,{children:t})]}),(0,b.jsxs)(F,{children:[i,(0,b.jsx)(z,{isShow:!!n,children:n})]})]}),(0,b.jsx)(V,{})]}),Ce=({title:e,open:t,contentClassName:n,onOpenChange:r,children:a})=>{let o=$();return(0,b.jsx)(S.Dialog.Root,{"data-slot":`dialog`,open:t,onOpenChange:r,children:(0,b.jsxs)(S.Dialog.Portal,{"data-slot":`dialog-portal`,children:[(0,b.jsx)(S.Dialog.Overlay,{"data-slot":`dialog-overlay`,className:(0,v.cn)(`fixed inset-0 z-40 bg-black/40 backdrop-blur-sm`,`data-[state=open]:animate-in data-[state=open]:fade-in`,`data-[state=closed]:animate-out data-[state=closed]:fade-out`)}),(0,b.jsx)(S.Dialog.Content,{"data-slot":`dialog-content`,className:(0,v.cn)(`fixed top-4 right-4 z-50 h-[calc(100dvh-2rem)] min-w-sm max-w-xl rounded-md bg-background shadow-lg ring-1 ring-border`,`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:(0,b.jsxs)(`section`,{className:`relative flex size-full flex-col`,children:[(0,b.jsx)(`header`,{className:`flex h-14 shrink-0 items-center border-b border-border px-5`,children:(0,b.jsx)(`h2`,{className:`font-semibold text-base tracking-tight text-text-positive`,children:e})}),(0,b.jsx)(`div`,{className:(0,v.cn)(`flex flex-1 flex-col overflow-y-auto py-4`,n),children:a}),(0,b.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2 border-t border-border px-4 py-3`,children:[(0,b.jsx)(o.Subscribe,{selector:e=>({isSubmitting:e.isSubmitting,disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit}),children:({isSubmitting:e,disabled:t})=>(0,b.jsx)(Z,{isSubmitting:e,disabled:t,className:`w-full`,onClick:()=>o.handleSubmit()})}),(0,b.jsx)(o.Subscribe,{selector:e=>({disabled:e.isPristine||e.isSubmitting}),children:({disabled:e})=>(0,b.jsx)(X,{disabled:e,className:`w-full`,onClick:()=>{o.reset(),r?.(!1)}})})]}),(0,b.jsx)(S.Dialog.Close,{asChild:!0,children:(0,b.jsx)(i.t,{className:`absolute top-2.5 right-3`})})]})})]})})},we=({children:e})=>(0,b.jsx)(`header`,{"data-slot":`section-header`,className:`flex items-center px-4 py-3 font-semibold text-base text-text-positive tracking-tight`,children:e}),Te=({children:e})=>(0,b.jsx)(`main`,{"data-slot":`section-main`,className:`relative flex flex-col py-4`,children:e}),Ee=({title:e,children:t})=>(0,b.jsxs)(`section`,{"data-slot":`section-form`,className:`flex flex-col rounded-md bg-background shadow-card ring-1 ring-border`,children:[(0,b.jsx)(we,{children:e}),(0,b.jsx)(Y,{}),(0,b.jsx)(Te,{children:t})]}),De=({title:e,description:t,helperText:n})=>(0,b.jsxs)(M,{className:`gap-y-4 px-4`,children:[(0,b.jsxs)(N,{className:`gap-0`,children:[(0,b.jsxs)(P,{children:[(0,b.jsx)(j,{className:`mb-1`,children:e}),(0,b.jsx)(R,{children:t})]}),(0,b.jsx)(z,{isShow:!!n,children:n})]}),(0,b.jsx)(V,{})]}),{fieldContext:Oe,formContext:ke,useFieldContext:Q,useFormContext:$}=(0,C.createFormHookContexts)(),{useAppForm:Ae,withForm:je,withFieldGroup:Me}=(0,C.createFormHook)({fieldContext:Oe,formContext:ke,fieldComponents:{TextField:_e,TextareaField:K,TextEditorField:q,NumberField:de,EmailField:ue,PasswordField:fe,SelectField:me,ComboboxField:G,DateField:le,SwitchField:ge,RadioGroupField:pe,CheckboxField:ce,SimpleTextField:se,SimpleEmailField:U,SimplePasswordField:ie,SimpleTextareaField:oe,SimpleNumberField:re,SimpleSelectField:ae,SimpleArrayField:T,FieldGroup:M,Field:N,FieldContent:P,FieldLabel:I,FieldContentMain:F,FieldSeparator:V,FieldError:H},formComponents:{TanStackDialogForm:xe,TanStackPopoverForm:Ce,TanStackContainerForm:be,TanStackSectionForm:Ee,TanStackCardForm:ye,TanStackFieldGroup:Se,TanStackTitleField:De,TanStackActionsForm:ve,TanStackActionSubmit:J,ArrayCol:w}});Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return je}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return Me}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return M}});
|
|
2
|
+
//# sourceMappingURL=tanstack-form--I4H53bf.cjs.map
|