@saas-ui/react 3.0.0-alpha.4 → 3.0.0-alpha.6
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/CHANGELOG.md +19 -0
- package/dist/chunk-2EUACKRH.js +26 -0
- package/dist/chunk-3Z2C27LI.js +51 -0
- package/dist/chunk-4TR3AOMG.js +33 -0
- package/dist/chunk-6LOMIKR5.js +69 -0
- package/dist/chunk-6ZNR6N2K.js +45 -0
- package/dist/chunk-7C3IZBNJ.js +38 -0
- package/dist/chunk-BCNPBZZK.js +45 -0
- package/dist/{chunk-KHRLZUV4.js → chunk-BFA5FCA2.js} +16 -1
- package/dist/chunk-CTOVNZVS.js +1 -0
- package/dist/chunk-DPMEXCSG.js +137 -0
- package/dist/chunk-F3CVOMG5.js +160 -0
- package/dist/chunk-FJFNGSPL.js +23 -0
- package/dist/chunk-GEPWRHHH.js +65 -0
- package/dist/chunk-HELHPHIQ.js +35 -0
- package/dist/chunk-I2RXEKTB.js +38 -0
- package/dist/chunk-L356FPLY.js +20 -0
- package/dist/chunk-LIYUBUOP.js +119 -0
- package/dist/chunk-M7FOBCOV.js +184 -0
- package/dist/chunk-NSD5HRIP.js +46 -0
- package/dist/chunk-QMG6HP7Z.js +87 -0
- package/dist/chunk-QSNSWCTM.js +32 -0
- package/dist/chunk-S3CQW7GD.js +100 -0
- package/dist/chunk-SA3OGTOO.js +23 -0
- package/dist/chunk-UCQ3LZIE.js +43 -0
- package/dist/chunk-ULAJ3JEO.js +32 -0
- package/dist/chunk-VF3BV2BY.js +87 -0
- package/dist/chunk-WYLMBMAH.js +22 -0
- package/dist/chunk-YWJZWB6I.js +1892 -0
- package/dist/chunk-ZWSZQZ5G.js +73 -0
- package/dist/components/app-shell/index.js +3 -40
- package/dist/components/avatar/index.cjs +69 -0
- package/dist/components/avatar/index.d.cts +18 -0
- package/dist/components/avatar/index.d.ts +18 -0
- package/dist/components/avatar/index.js +10 -0
- package/dist/components/breadcrumbs/index.js +3 -32
- package/dist/components/button/index.js +3 -40
- package/dist/components/checkbox/index.js +3 -15
- package/dist/components/command/index.js +3 -28
- package/dist/components/dialog/index.js +5 -67
- package/dist/components/drawer/index.d.cts +2 -2
- package/dist/components/drawer/index.d.ts +2 -2
- package/dist/components/drawer/index.js +5 -59
- package/dist/components/empty-state/index.js +3 -18
- package/dist/components/grid-list/index.js +3 -40
- package/dist/components/icon-badge/index.js +3 -33
- package/dist/components/link/index.js +2 -14
- package/dist/components/loading-overlay/index.js +5 -1885
- package/dist/components/menu/index.cjs +263 -0
- package/dist/components/menu/index.d.cts +30 -0
- package/dist/components/menu/index.d.ts +30 -0
- package/dist/components/menu/index.js +9 -0
- package/dist/components/navbar/index.d.cts +4 -4
- package/dist/components/navbar/index.d.ts +4 -4
- package/dist/components/navbar/index.js +3 -45
- package/dist/components/number-input/index.js +3 -26
- package/dist/components/password-input/index.js +4 -225
- package/dist/components/persona/index.js +6 -178
- package/dist/components/pin-input/index.js +3 -21
- package/dist/components/radio/index.js +4 -16
- package/dist/components/search-input/index.js +4 -114
- package/dist/components/segmented-control/index.cjs +2 -0
- package/dist/components/segmented-control/index.d.cts +2 -0
- package/dist/components/segmented-control/index.d.ts +2 -0
- package/dist/components/segmented-control/index.js +2 -0
- package/dist/components/select/index.js +4 -94
- package/dist/components/sidebar/index.d.cts +11 -11
- package/dist/components/sidebar/index.d.ts +11 -11
- package/dist/components/sidebar/index.js +7 -129
- package/dist/components/steps/index.js +5 -64
- package/dist/components/switch/index.js +3 -18
- package/dist/components/toaster/index.cjs +54 -0
- package/dist/components/toaster/index.d.cts +10 -0
- package/dist/components/toaster/index.d.ts +10 -0
- package/dist/components/toaster/index.js +10 -0
- package/dist/components/tooltip/index.cjs +57 -0
- package/dist/components/tooltip/index.d.cts +14 -0
- package/dist/components/tooltip/index.d.ts +14 -0
- package/dist/components/tooltip/index.js +8 -0
- package/dist/index.cjs +3707 -8
- package/dist/index.d.cts +37 -2
- package/dist/index.d.ts +37 -2
- package/dist/index.js +285 -4
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
@@ -17,7 +17,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
17
17
|
}
|
18
18
|
return to;
|
19
19
|
};
|
20
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
21
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
22
21
|
// If the importer is in node compatibility mode or this is not an ESM
|
23
22
|
// file that has been converted to a CommonJS file using a Babel-
|
@@ -31,16 +30,54 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
31
30
|
// src/index.ts
|
32
31
|
var src_exports = {};
|
33
32
|
__export(src_exports, {
|
33
|
+
AppShell: () => AppShell,
|
34
|
+
Avatar: () => Avatar,
|
35
|
+
AvatarGroup: () => AvatarGroup,
|
36
|
+
Breadcrumb: () => namespace_exports,
|
37
|
+
Button: () => Button,
|
38
|
+
Checkbox: () => Checkbox,
|
39
|
+
CloseButton: () => CloseButton,
|
40
|
+
Command: () => Command,
|
41
|
+
Dialog: () => namespace_exports2,
|
42
|
+
Drawer: () => namespace_exports3,
|
43
|
+
EmptyState: () => EmptyState,
|
44
|
+
GridList: () => grid_list_exports,
|
45
|
+
IconBadge: () => IconBadge,
|
46
|
+
InputGroup: () => InputGroup,
|
47
|
+
Link: () => Link,
|
48
|
+
LoadingOverlay: () => loading_overlay_exports,
|
49
|
+
Menu: () => menu_exports,
|
50
|
+
Navbar: () => navbar_exports,
|
51
|
+
NumberInput: () => NumberInput,
|
52
|
+
PasswordInput: () => PasswordInput,
|
53
|
+
Persona: () => Persona,
|
54
|
+
PersonaAvatar: () => PersonaAvatar2,
|
55
|
+
PinInput: () => PinInput,
|
56
|
+
Radio: () => Radio,
|
57
|
+
RadioGroup: () => RadioGroup,
|
58
|
+
SearchInput: () => SearchInput,
|
59
|
+
Select: () => namespace_exports4,
|
60
|
+
Sidebar: () => sidebar_exports,
|
61
|
+
Spinner: () => Spinner2,
|
62
|
+
Steps: () => steps_exports,
|
34
63
|
SuiContext: () => SuiContext,
|
35
64
|
SuiProvider: () => SuiProvider,
|
36
|
-
|
65
|
+
Switch: () => Switch,
|
66
|
+
Toaster: () => Toaster,
|
67
|
+
Tooltip: () => Tooltip,
|
68
|
+
createSystem: () => import_react166.createSystem,
|
37
69
|
defaultConfig: () => defaultConfig,
|
70
|
+
defaultPresenceOptions: () => defaultPresenceOptions,
|
38
71
|
defaultSystem: () => defaultSystem,
|
72
|
+
toast: () => toast,
|
39
73
|
useLink: () => useLink,
|
74
|
+
useLoadingOverlayStyles: () => useLoadingOverlayStyles,
|
75
|
+
useSidebar: () => import_sidebar2.useSidebar,
|
76
|
+
useSidebarItemStyles: () => useSidebarItemStyles,
|
77
|
+
useSidebarStyles: () => useSidebarStyles,
|
40
78
|
useSui: () => useSui
|
41
79
|
});
|
42
80
|
module.exports = __toCommonJS(src_exports);
|
43
|
-
__reExport(src_exports, require("@saas-ui/core"), module.exports);
|
44
81
|
|
45
82
|
// src/preset.ts
|
46
83
|
var import_react97 = require("@chakra-ui/react");
|
@@ -7931,6 +7968,149 @@ var colors = import_react82.defineTokens.colors({
|
|
7931
7968
|
800: { value: "#6d0e34" },
|
7932
7969
|
900: { value: "#45061f" },
|
7933
7970
|
950: { value: "#2c0514" }
|
7971
|
+
},
|
7972
|
+
slate: {
|
7973
|
+
50: { value: "#f8fafc" },
|
7974
|
+
100: { value: "#f1f5f9" },
|
7975
|
+
200: { value: "#e2e8f0" },
|
7976
|
+
300: { value: "#cbd5e1" },
|
7977
|
+
400: { value: "#94a3b8" },
|
7978
|
+
500: { value: "#64748b" },
|
7979
|
+
600: { value: "#475569" },
|
7980
|
+
700: { value: "#334155" },
|
7981
|
+
800: { value: "#1e293b" },
|
7982
|
+
900: { value: "#0f172a" },
|
7983
|
+
950: { value: "#020617" }
|
7984
|
+
},
|
7985
|
+
zinc: {
|
7986
|
+
50: { value: "#fafafa" },
|
7987
|
+
100: { value: "#f4f4f5" },
|
7988
|
+
200: { value: "#e4e4e7" },
|
7989
|
+
300: { value: "#d4d4d8" },
|
7990
|
+
400: { value: "#a1a1aa" },
|
7991
|
+
500: { value: "#71717a" },
|
7992
|
+
600: { value: "#52525b" },
|
7993
|
+
700: { value: "#3f3f46" },
|
7994
|
+
800: { value: "#27272a" },
|
7995
|
+
900: { value: "#18181b" },
|
7996
|
+
950: { value: "#09090b" }
|
7997
|
+
},
|
7998
|
+
neutral: {
|
7999
|
+
50: { value: "#fafafa" },
|
8000
|
+
100: { value: "#f5f5f5" },
|
8001
|
+
200: { value: "#e5e5e5" },
|
8002
|
+
300: { value: "#d4d4d4" },
|
8003
|
+
400: { value: "#a3a3a3" },
|
8004
|
+
500: { value: "#737373" },
|
8005
|
+
600: { value: "#525252" },
|
8006
|
+
700: { value: "#404040" },
|
8007
|
+
800: { value: "#262626" },
|
8008
|
+
900: { value: "#171717" },
|
8009
|
+
950: { value: "#0a0a0a" }
|
8010
|
+
},
|
8011
|
+
stone: {
|
8012
|
+
50: { value: "#fafaf9" },
|
8013
|
+
100: { value: "#f5f5f4" },
|
8014
|
+
200: { value: "#e7e5e4" },
|
8015
|
+
300: { value: "#d6d3d1" },
|
8016
|
+
400: { value: "#a8a29e" },
|
8017
|
+
500: { value: "#78716c" },
|
8018
|
+
600: { value: "#57534e" },
|
8019
|
+
700: { value: "#44403c" },
|
8020
|
+
800: { value: "#292524" },
|
8021
|
+
900: { value: "#1c1917" },
|
8022
|
+
950: { value: "#0c0a09" }
|
8023
|
+
},
|
8024
|
+
amber: {
|
8025
|
+
50: { value: "#fffbeb" },
|
8026
|
+
100: { value: "#fef3c7" },
|
8027
|
+
200: { value: "#fde68a" },
|
8028
|
+
300: { value: "#fcd34d" },
|
8029
|
+
400: { value: "#fbbf24" },
|
8030
|
+
500: { value: "#f59e0b" },
|
8031
|
+
600: { value: "#d97706" },
|
8032
|
+
700: { value: "#b45309" },
|
8033
|
+
800: { value: "#92400e" },
|
8034
|
+
900: { value: "#78350f" },
|
8035
|
+
950: { value: "#451a03" }
|
8036
|
+
},
|
8037
|
+
lime: {
|
8038
|
+
50: { value: "#f7fee7" },
|
8039
|
+
100: { value: "#ecfccb" },
|
8040
|
+
200: { value: "#d9f99d" },
|
8041
|
+
300: { value: "#bef264" },
|
8042
|
+
400: { value: "#a3e635" },
|
8043
|
+
500: { value: "#84cc16" },
|
8044
|
+
600: { value: "#65a30d" },
|
8045
|
+
700: { value: "#4d7c0f" },
|
8046
|
+
800: { value: "#3f6212" },
|
8047
|
+
900: { value: "#365314" },
|
8048
|
+
950: { value: "#1a2e05" }
|
8049
|
+
},
|
8050
|
+
emerald: {
|
8051
|
+
50: { value: "#ecfdf5" },
|
8052
|
+
100: { value: "#d1fae5" },
|
8053
|
+
200: { value: "#a7f3d0" },
|
8054
|
+
300: { value: "#6ee7b7" },
|
8055
|
+
400: { value: "#34d399" },
|
8056
|
+
500: { value: "#10b981" },
|
8057
|
+
600: { value: "#059669" },
|
8058
|
+
700: { value: "#047857" },
|
8059
|
+
800: { value: "#065f46" },
|
8060
|
+
900: { value: "#064e3b" },
|
8061
|
+
950: { value: "#022c22" }
|
8062
|
+
},
|
8063
|
+
sky: {
|
8064
|
+
50: { value: "#f0f9ff" },
|
8065
|
+
100: { value: "#e0f2fe" },
|
8066
|
+
200: { value: "#bae6fd" },
|
8067
|
+
300: { value: "#7dd3fc" },
|
8068
|
+
400: { value: "#38bdf8" },
|
8069
|
+
500: { value: "#0ea5e9" },
|
8070
|
+
600: { value: "#0284c7" },
|
8071
|
+
700: { value: "#0369a1" },
|
8072
|
+
800: { value: "#075985" },
|
8073
|
+
900: { value: "#0c4a6e" },
|
8074
|
+
950: { value: "#082f49" }
|
8075
|
+
},
|
8076
|
+
violet: {
|
8077
|
+
50: { value: "#f5f3ff" },
|
8078
|
+
100: { value: "#ede9fe" },
|
8079
|
+
200: { value: "#ddd6fe" },
|
8080
|
+
300: { value: "#c4b5fd" },
|
8081
|
+
400: { value: "#a78bfa" },
|
8082
|
+
500: { value: "#8b5cf6" },
|
8083
|
+
600: { value: "#7c3aed" },
|
8084
|
+
700: { value: "#6d28d9" },
|
8085
|
+
800: { value: "#5b21b6" },
|
8086
|
+
900: { value: "#4c1d95" },
|
8087
|
+
950: { value: "#2e1065" }
|
8088
|
+
},
|
8089
|
+
fuchsia: {
|
8090
|
+
50: { value: "#fdf4ff" },
|
8091
|
+
100: { value: "#fae8ff" },
|
8092
|
+
200: { value: "#f5d0fe" },
|
8093
|
+
300: { value: "#f0abfc" },
|
8094
|
+
400: { value: "#e879f9" },
|
8095
|
+
500: { value: "#d946ef" },
|
8096
|
+
600: { value: "#c026d3" },
|
8097
|
+
700: { value: "#a21caf" },
|
8098
|
+
800: { value: "#86198f" },
|
8099
|
+
900: { value: "#701a75" },
|
8100
|
+
950: { value: "#4a044e" }
|
8101
|
+
},
|
8102
|
+
rose: {
|
8103
|
+
50: { value: "#fff1f2" },
|
8104
|
+
100: { value: "#ffe4e6" },
|
8105
|
+
200: { value: "#fecdd3" },
|
8106
|
+
300: { value: "#fda4af" },
|
8107
|
+
400: { value: "#fb7185" },
|
8108
|
+
500: { value: "#f43f5e" },
|
8109
|
+
600: { value: "#e11d48" },
|
8110
|
+
700: { value: "#be123c" },
|
8111
|
+
800: { value: "#9f1239" },
|
8112
|
+
900: { value: "#881337" },
|
8113
|
+
950: { value: "#4c0519" }
|
7934
8114
|
}
|
7935
8115
|
});
|
7936
8116
|
|
@@ -8409,15 +8589,15 @@ var defaultConfig = (0, import_react97.mergeConfigs)(import_react97.defaultBaseC
|
|
8409
8589
|
var defaultSystem = (0, import_react97.createSystem)(defaultConfig);
|
8410
8590
|
|
8411
8591
|
// src/index.ts
|
8412
|
-
var
|
8592
|
+
var import_react166 = require("@chakra-ui/react");
|
8413
8593
|
|
8414
8594
|
// src/provider/sui-provider.tsx
|
8415
8595
|
var React = __toESM(require("react"), 1);
|
8416
8596
|
var import_react98 = require("@chakra-ui/react");
|
8417
8597
|
var import_jsx_runtime = require("react/jsx-runtime");
|
8418
8598
|
var SuiContext = React.createContext({});
|
8419
|
-
function SuiProvider(
|
8420
|
-
const { linkComponent, onError, children, ...rest } =
|
8599
|
+
function SuiProvider(props2) {
|
8600
|
+
const { linkComponent, onError, children, ...rest } = props2;
|
8421
8601
|
const context = React.useMemo(
|
8422
8602
|
() => ({
|
8423
8603
|
linkComponent
|
@@ -8437,14 +8617,3533 @@ function useLink() {
|
|
8437
8617
|
}
|
8438
8618
|
return import_react99.chakra.a;
|
8439
8619
|
}
|
8620
|
+
|
8621
|
+
// src/components/app-shell/app-shell.tsx
|
8622
|
+
var import_react100 = require("react");
|
8623
|
+
var import_react101 = require("@chakra-ui/react");
|
8624
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
8625
|
+
var {
|
8626
|
+
withProvider,
|
8627
|
+
withContext,
|
8628
|
+
useStyles: useAppShellStyles
|
8629
|
+
} = (0, import_react101.createSlotRecipeContext)({
|
8630
|
+
key: "suiAppShell"
|
8631
|
+
});
|
8632
|
+
var AppShellRoot = withProvider(
|
8633
|
+
"div",
|
8634
|
+
"root",
|
8635
|
+
{ forwardAsChild: true }
|
8636
|
+
);
|
8637
|
+
var AppShellContent = withContext("div", "content", { forwardAsChild: true });
|
8638
|
+
var AppShellMain = withContext(
|
8639
|
+
"div",
|
8640
|
+
"main",
|
8641
|
+
{ forwardAsChild: true }
|
8642
|
+
);
|
8643
|
+
var AppShell = (0, import_react100.forwardRef)(
|
8644
|
+
(props2, ref2) => {
|
8645
|
+
const { header, sidebar, aside, footer, children, ...rootProps } = props2;
|
8646
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(AppShellRoot, { ref: ref2, ...rootProps, children: [
|
8647
|
+
header,
|
8648
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(AppShellContent, { children: [
|
8649
|
+
sidebar,
|
8650
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(AppShellMain, { children }),
|
8651
|
+
aside
|
8652
|
+
] }),
|
8653
|
+
footer
|
8654
|
+
] });
|
8655
|
+
}
|
8656
|
+
);
|
8657
|
+
AppShell.displayName = "AppShell";
|
8658
|
+
|
8659
|
+
// src/components/avatar/avatar.tsx
|
8660
|
+
var import_react102 = require("react");
|
8661
|
+
var import_react103 = require("@chakra-ui/react");
|
8662
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
8663
|
+
var Avatar = (0, import_react102.forwardRef)(
|
8664
|
+
function Avatar2(props2, ref2) {
|
8665
|
+
const { name, src, srcSet, loading, icon, fallback: fallback2, children, ...rest } = props2;
|
8666
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react103.Avatar.Root, { ref: ref2, ...rest, children: [
|
8667
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(AvatarFallback, { name, icon, children: fallback2 }),
|
8668
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react103.Avatar.Image, { src, srcSet, loading }),
|
8669
|
+
children
|
8670
|
+
] });
|
8671
|
+
}
|
8672
|
+
);
|
8673
|
+
var AvatarFallback = (0, import_react102.forwardRef)(
|
8674
|
+
function AvatarFallback2(props2, ref2) {
|
8675
|
+
const { name, icon, children, ...rest } = props2;
|
8676
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react103.Avatar.Fallback, { ref: ref2, ...rest, children: [
|
8677
|
+
children,
|
8678
|
+
name != null && children == null && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: getInitials(name) }),
|
8679
|
+
name == null && children == null && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react103.Avatar.Icon, { asChild: !!icon, children: icon })
|
8680
|
+
] });
|
8681
|
+
}
|
8682
|
+
);
|
8683
|
+
function getInitials(name) {
|
8684
|
+
const names = name.trim().split(" ");
|
8685
|
+
const firstName = names[0] != null ? names[0] : "";
|
8686
|
+
const lastName = names.length > 1 ? names[names.length - 1] : "";
|
8687
|
+
return firstName && lastName ? `${firstName.charAt(0)}${lastName.charAt(0)}` : firstName.charAt(0);
|
8688
|
+
}
|
8689
|
+
var AvatarGroup = (0, import_react102.forwardRef)(
|
8690
|
+
function AvatarGroup2(props2, ref2) {
|
8691
|
+
const { size, variant, borderless, ...rest } = props2;
|
8692
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react103.Avatar.PropsProvider, { value: { size, variant, borderless }, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react103.Group, { gap: "0", spaceX: "-3", ref: ref2, ...rest }) });
|
8693
|
+
}
|
8694
|
+
);
|
8695
|
+
|
8696
|
+
// src/components/breadcrumbs/namespace.ts
|
8697
|
+
var namespace_exports = {};
|
8698
|
+
__export(namespace_exports, {
|
8699
|
+
CurrentLink: () => BreadcrumbCurrentLink,
|
8700
|
+
Ellipsis: () => BreadcrumbEllipsis,
|
8701
|
+
Link: () => BreadcrumbLink,
|
8702
|
+
Root: () => BreadcrumbRoot
|
8703
|
+
});
|
8704
|
+
|
8705
|
+
// src/components/breadcrumbs/breadcrumb.tsx
|
8706
|
+
var import_react104 = require("react");
|
8707
|
+
var import_react105 = require("@chakra-ui/react");
|
8708
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
8709
|
+
var BreadcrumbRoot = (0, import_react104.forwardRef)(
|
8710
|
+
function BreadcrumbRoot2(props2, ref2) {
|
8711
|
+
const { separator = "/", separatorGap, children, ...rest } = props2;
|
8712
|
+
const validChildren = import_react104.Children.toArray(children).filter(import_react104.isValidElement);
|
8713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react105.Breadcrumb.Root, { ref: ref2, ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react105.Breadcrumb.List, { gap: separatorGap, children: validChildren.map((child, index) => {
|
8714
|
+
const last = index === validChildren.length - 1;
|
8715
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react104.Fragment, { children: [
|
8716
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react105.Breadcrumb.Item, { children: child }),
|
8717
|
+
!last && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react105.Breadcrumb.Separator, { children: separator })
|
8718
|
+
] }, index);
|
8719
|
+
}) }) });
|
8720
|
+
}
|
8721
|
+
);
|
8722
|
+
var BreadcrumbLink = import_react105.Breadcrumb.Link;
|
8723
|
+
var BreadcrumbCurrentLink = import_react105.Breadcrumb.CurrentLink;
|
8724
|
+
var BreadcrumbEllipsis = import_react105.Breadcrumb.Ellipsis;
|
8725
|
+
|
8726
|
+
// src/components/button/button.tsx
|
8727
|
+
var import_react106 = require("react");
|
8728
|
+
var import_react107 = require("@chakra-ui/react");
|
8729
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
8730
|
+
var Button = (0, import_react106.forwardRef)(
|
8731
|
+
function Button2(props2, ref2) {
|
8732
|
+
const {
|
8733
|
+
loading,
|
8734
|
+
disabled,
|
8735
|
+
loadingText,
|
8736
|
+
children,
|
8737
|
+
variant = "glass",
|
8738
|
+
colorPalette = variant === "glass" ? "accent" : "gray",
|
8739
|
+
...rest
|
8740
|
+
} = props2;
|
8741
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
8742
|
+
import_react107.Button,
|
8743
|
+
{
|
8744
|
+
colorPalette,
|
8745
|
+
disabled: loading || disabled,
|
8746
|
+
variant,
|
8747
|
+
ref: ref2,
|
8748
|
+
...rest,
|
8749
|
+
children: loading && !loadingText ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
8750
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react107.AbsoluteCenter, { display: "inline-flex", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react107.Spinner, { size: "inherit", color: "inherit" }) }),
|
8751
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react107.Span, { opacity: 0, children })
|
8752
|
+
] }) : loading && loadingText ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
8753
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react107.Spinner, { size: "inherit", color: "inherit" }),
|
8754
|
+
loadingText
|
8755
|
+
] }) : children
|
8756
|
+
}
|
8757
|
+
);
|
8758
|
+
}
|
8759
|
+
);
|
8760
|
+
|
8761
|
+
// src/components/checkbox/checkbox.tsx
|
8762
|
+
var import_react108 = require("react");
|
8763
|
+
var import_react109 = require("@chakra-ui/react");
|
8764
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
8765
|
+
var Checkbox = (0, import_react108.forwardRef)(
|
8766
|
+
function Checkbox2(props2, ref2) {
|
8767
|
+
const { icon, children, inputProps, rootRef, ...rest } = props2;
|
8768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react109.Checkbox.Root, { ref: rootRef, ...rest, children: [
|
8769
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react109.Checkbox.HiddenInput, { ref: ref2, ...inputProps }),
|
8770
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react109.Checkbox.Control, { children: icon || /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react109.Checkbox.Indicator, {}) }),
|
8771
|
+
children != null && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react109.Checkbox.Label, { children })
|
8772
|
+
] });
|
8773
|
+
}
|
8774
|
+
);
|
8775
|
+
|
8776
|
+
// src/components/close-button/close-button.tsx
|
8777
|
+
var import_react111 = require("react");
|
8778
|
+
var import_react112 = require("@chakra-ui/react");
|
8779
|
+
|
8780
|
+
// src/components/icons/create-icon.tsx
|
8781
|
+
var import_react110 = require("@chakra-ui/react");
|
8782
|
+
var createIcon = (props2) => {
|
8783
|
+
return (0, import_react110.createIcon)({
|
8784
|
+
viewBox: "0 0 24 24",
|
8785
|
+
defaultProps: {
|
8786
|
+
fill: "none",
|
8787
|
+
stroke: "currentColor",
|
8788
|
+
strokeWidth: "2",
|
8789
|
+
strokeLinecap: "round",
|
8790
|
+
strokeLinejoin: "round"
|
8791
|
+
},
|
8792
|
+
...props2
|
8793
|
+
});
|
8794
|
+
};
|
8795
|
+
|
8796
|
+
// src/components/icons/icons.tsx
|
8797
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
8798
|
+
var ChevronUpIcon = createIcon({
|
8799
|
+
displayName: "ChevronUpIcon",
|
8800
|
+
path: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("polyline", { points: "18 15 12 9 6 15" })
|
8801
|
+
});
|
8802
|
+
var ChevronDownIcon = createIcon({
|
8803
|
+
displayName: "ChevronDownIcon",
|
8804
|
+
path: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("polyline", { points: "6 9 12 15 18 9" })
|
8805
|
+
});
|
8806
|
+
var ChevronLeftIcon = createIcon({
|
8807
|
+
displayName: "ChevronLeftIcon",
|
8808
|
+
path: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("polyline", { points: "15 18 9 12 15 6" })
|
8809
|
+
});
|
8810
|
+
var ChevronRightIcon = createIcon({
|
8811
|
+
displayName: "ChevronRightIcon",
|
8812
|
+
path: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("polyline", { points: "9 18 15 12 9 6" })
|
8813
|
+
});
|
8814
|
+
var HamburgerIcon = createIcon({
|
8815
|
+
displayName: "ChevronDownIcon",
|
8816
|
+
path: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("g", { fill: "none", children: [
|
8817
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("line", { x1: "3", y1: "12", x2: "21", y2: "12" }),
|
8818
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("line", { x1: "3", y1: "6", x2: "21", y2: "6" }),
|
8819
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("line", { x1: "3", y1: "18", x2: "21", y2: "18" })
|
8820
|
+
] })
|
8821
|
+
});
|
8822
|
+
var CloseIcon = createIcon({
|
8823
|
+
displayName: "CloseIcon",
|
8824
|
+
path: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("g", { children: [
|
8825
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
8826
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
8827
|
+
] })
|
8828
|
+
});
|
8829
|
+
var FilterIcon = createIcon({
|
8830
|
+
displayName: "FilterIcon",
|
8831
|
+
path: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("polygon", { points: "22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3" })
|
8832
|
+
});
|
8833
|
+
var CalendarIcon = createIcon({
|
8834
|
+
displayName: "CalendarIcon",
|
8835
|
+
path: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("g", { children: [
|
8836
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }),
|
8837
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("line", { x1: "16", y1: "2", x2: "16", y2: "6" }),
|
8838
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("line", { x1: "8", y1: "2", x2: "8", y2: "6" }),
|
8839
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("line", { x1: "3", y1: "10", x2: "21", y2: "10" })
|
8840
|
+
] })
|
8841
|
+
});
|
8842
|
+
var PlusIcon = createIcon({
|
8843
|
+
displayName: "PlusIcon",
|
8844
|
+
path: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("g", { children: [
|
8845
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("line", { x1: "12", y1: "5", x2: "12", y2: "19" }),
|
8846
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("line", { x1: "5", y1: "12", x2: "19", y2: "12" })
|
8847
|
+
] })
|
8848
|
+
});
|
8849
|
+
var MinusIcon = createIcon({
|
8850
|
+
displayName: "MinusIcon",
|
8851
|
+
path: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) })
|
8852
|
+
});
|
8853
|
+
var ViewOffIcon = createIcon({
|
8854
|
+
displayName: "ViewOffIcon",
|
8855
|
+
path: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("g", { children: [
|
8856
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24" }),
|
8857
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
|
8858
|
+
] })
|
8859
|
+
});
|
8860
|
+
var ViewIcon = createIcon({
|
8861
|
+
displayName: "ViewOffIcon",
|
8862
|
+
path: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("g", { children: [
|
8863
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
|
8864
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("circle", { cx: "12", cy: "12", r: "3" })
|
8865
|
+
] })
|
8866
|
+
});
|
8867
|
+
var SearchIcon = createIcon({
|
8868
|
+
displayName: "SearchIcon",
|
8869
|
+
path: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("g", { children: [
|
8870
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("circle", { cx: "11", cy: "11", r: "8" }),
|
8871
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })
|
8872
|
+
] })
|
8873
|
+
});
|
8874
|
+
var CheckIcon = createIcon({
|
8875
|
+
displayName: "CheckIcon",
|
8876
|
+
path: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("polyline", { points: "20 6 9 17 4 12" }) })
|
8877
|
+
});
|
8878
|
+
|
8879
|
+
// src/components/close-button/close-button.tsx
|
8880
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
8881
|
+
var CloseButton = (0, import_react111.forwardRef)(
|
8882
|
+
function CloseButton2(props2, ref2) {
|
8883
|
+
var _a7;
|
8884
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react112.IconButton, { variant: "ghost", "aria-label": "Close", ref: ref2, ...props2, children: (_a7 = props2.children) != null ? _a7 : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(CloseIcon, {}) });
|
8885
|
+
}
|
8886
|
+
);
|
8887
|
+
|
8888
|
+
// src/components/command/command.tsx
|
8889
|
+
var import_react113 = require("@chakra-ui/react");
|
8890
|
+
var import_react114 = require("@chakra-ui/react");
|
8891
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
8892
|
+
var { withContext: withContext2 } = (0, import_react114.createRecipeContext)({
|
8893
|
+
key: "suiCommand"
|
8894
|
+
});
|
8895
|
+
var Key = ({ children }) => {
|
8896
|
+
if (typeof children !== "string") {
|
8897
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, { children });
|
8898
|
+
}
|
8899
|
+
if (["then", "or", "+"].includes(children)) {
|
8900
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children });
|
8901
|
+
}
|
8902
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react113.Kbd, { children });
|
8903
|
+
};
|
8904
|
+
var Command = (props2) => {
|
8905
|
+
const { children, ...rest } = props2;
|
8906
|
+
if (typeof children !== "string") {
|
8907
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, { children });
|
8908
|
+
}
|
8909
|
+
const keys = children.split(/\s|\+/);
|
8910
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CommandRoot, { ...rest, children: keys.map((key) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Key, { children: key }, key)) });
|
8911
|
+
};
|
8912
|
+
var CommandRoot = withContext2("span");
|
8913
|
+
|
8914
|
+
// src/components/dialog/namespace.ts
|
8915
|
+
var namespace_exports2 = {};
|
8916
|
+
__export(namespace_exports2, {
|
8917
|
+
ActionTrigger: () => DialogActionTrigger,
|
8918
|
+
Backdrop: () => DialogBackdrop,
|
8919
|
+
Body: () => DialogBody,
|
8920
|
+
CloseTrigger: () => DialogCloseTrigger,
|
8921
|
+
Content: () => DialogContent,
|
8922
|
+
Context: () => DialogContext,
|
8923
|
+
Description: () => DialogDescription,
|
8924
|
+
Footer: () => DialogFooter,
|
8925
|
+
Header: () => DialogHeader,
|
8926
|
+
Root: () => DialogRoot,
|
8927
|
+
Title: () => DialogTitle,
|
8928
|
+
Trigger: () => DialogTrigger
|
8929
|
+
});
|
8930
|
+
|
8931
|
+
// src/components/dialog/dialog.tsx
|
8932
|
+
var import_react121 = require("react");
|
8933
|
+
var import_react122 = require("@chakra-ui/react");
|
8934
|
+
|
8935
|
+
// ../../node_modules/proxy-compare/dist/index.js
|
8936
|
+
var TRACK_MEMO_SYMBOL = Symbol();
|
8937
|
+
var GET_ORIGINAL_SYMBOL = Symbol();
|
8938
|
+
var AFFECTED_PROPERTY = "a";
|
8939
|
+
var IS_TARGET_COPIED_PROPERTY = "f";
|
8940
|
+
var PROXY_PROPERTY = "p";
|
8941
|
+
var PROXY_CACHE_PROPERTY = "c";
|
8942
|
+
var TARGET_CACHE_PROPERTY = "t";
|
8943
|
+
var NEXT_OBJECT_PROPERTY = "n";
|
8944
|
+
var CHANGED_PROPERTY = "g";
|
8945
|
+
var HAS_KEY_PROPERTY = "h";
|
8946
|
+
var ALL_OWN_KEYS_PROPERTY = "w";
|
8947
|
+
var HAS_OWN_KEY_PROPERTY = "o";
|
8948
|
+
var KEYS_PROPERTY = "k";
|
8949
|
+
var newProxy = (target, handler) => new Proxy(target, handler);
|
8950
|
+
var getProto = Object.getPrototypeOf;
|
8951
|
+
var objectsToTrack = /* @__PURE__ */ new WeakMap();
|
8952
|
+
var isObjectToTrack = (obj) => obj && (objectsToTrack.has(obj) ? objectsToTrack.get(obj) : getProto(obj) === Object.prototype || getProto(obj) === Array.prototype);
|
8953
|
+
var isObject = (x) => typeof x === "object" && x !== null;
|
8954
|
+
var needsToCopyTargetObject = (obj) => Object.values(Object.getOwnPropertyDescriptors(obj)).some((descriptor) => !descriptor.configurable && !descriptor.writable);
|
8955
|
+
var copyTargetObject = (obj) => {
|
8956
|
+
if (Array.isArray(obj)) {
|
8957
|
+
return Array.from(obj);
|
8958
|
+
}
|
8959
|
+
const descriptors = Object.getOwnPropertyDescriptors(obj);
|
8960
|
+
Object.values(descriptors).forEach((desc) => {
|
8961
|
+
desc.configurable = true;
|
8962
|
+
});
|
8963
|
+
return Object.create(getProto(obj), descriptors);
|
8964
|
+
};
|
8965
|
+
var createProxyHandler = (origObj, isTargetCopied) => {
|
8966
|
+
const state = {
|
8967
|
+
[IS_TARGET_COPIED_PROPERTY]: isTargetCopied
|
8968
|
+
};
|
8969
|
+
let trackObject = false;
|
8970
|
+
const recordUsage = (type, key) => {
|
8971
|
+
if (!trackObject) {
|
8972
|
+
let used = state[AFFECTED_PROPERTY].get(origObj);
|
8973
|
+
if (!used) {
|
8974
|
+
used = {};
|
8975
|
+
state[AFFECTED_PROPERTY].set(origObj, used);
|
8976
|
+
}
|
8977
|
+
if (type === ALL_OWN_KEYS_PROPERTY) {
|
8978
|
+
used[ALL_OWN_KEYS_PROPERTY] = true;
|
8979
|
+
} else {
|
8980
|
+
let set2 = used[type];
|
8981
|
+
if (!set2) {
|
8982
|
+
set2 = /* @__PURE__ */ new Set();
|
8983
|
+
used[type] = set2;
|
8984
|
+
}
|
8985
|
+
set2.add(key);
|
8986
|
+
}
|
8987
|
+
}
|
8988
|
+
};
|
8989
|
+
const recordObjectAsUsed = () => {
|
8990
|
+
trackObject = true;
|
8991
|
+
state[AFFECTED_PROPERTY].delete(origObj);
|
8992
|
+
};
|
8993
|
+
const handler = {
|
8994
|
+
get(target, key) {
|
8995
|
+
if (key === GET_ORIGINAL_SYMBOL) {
|
8996
|
+
return origObj;
|
8997
|
+
}
|
8998
|
+
recordUsage(KEYS_PROPERTY, key);
|
8999
|
+
return createProxy(Reflect.get(target, key), state[AFFECTED_PROPERTY], state[PROXY_CACHE_PROPERTY], state[TARGET_CACHE_PROPERTY]);
|
9000
|
+
},
|
9001
|
+
has(target, key) {
|
9002
|
+
if (key === TRACK_MEMO_SYMBOL) {
|
9003
|
+
recordObjectAsUsed();
|
9004
|
+
return true;
|
9005
|
+
}
|
9006
|
+
recordUsage(HAS_KEY_PROPERTY, key);
|
9007
|
+
return Reflect.has(target, key);
|
9008
|
+
},
|
9009
|
+
getOwnPropertyDescriptor(target, key) {
|
9010
|
+
recordUsage(HAS_OWN_KEY_PROPERTY, key);
|
9011
|
+
return Reflect.getOwnPropertyDescriptor(target, key);
|
9012
|
+
},
|
9013
|
+
ownKeys(target) {
|
9014
|
+
recordUsage(ALL_OWN_KEYS_PROPERTY);
|
9015
|
+
return Reflect.ownKeys(target);
|
9016
|
+
}
|
9017
|
+
};
|
9018
|
+
if (isTargetCopied) {
|
9019
|
+
handler.set = handler.deleteProperty = () => false;
|
9020
|
+
}
|
9021
|
+
return [handler, state];
|
9022
|
+
};
|
9023
|
+
var getOriginalObject = (obj) => (
|
9024
|
+
// unwrap proxy
|
9025
|
+
obj[GET_ORIGINAL_SYMBOL] || // otherwise
|
9026
|
+
obj
|
9027
|
+
);
|
9028
|
+
var createProxy = (obj, affected, proxyCache, targetCache2) => {
|
9029
|
+
if (!isObjectToTrack(obj))
|
9030
|
+
return obj;
|
9031
|
+
let targetAndCopied = targetCache2 && targetCache2.get(obj);
|
9032
|
+
if (!targetAndCopied) {
|
9033
|
+
const target2 = getOriginalObject(obj);
|
9034
|
+
if (needsToCopyTargetObject(target2)) {
|
9035
|
+
targetAndCopied = [target2, copyTargetObject(target2)];
|
9036
|
+
} else {
|
9037
|
+
targetAndCopied = [target2];
|
9038
|
+
}
|
9039
|
+
targetCache2 === null || targetCache2 === void 0 ? void 0 : targetCache2.set(obj, targetAndCopied);
|
9040
|
+
}
|
9041
|
+
const [target, copiedTarget] = targetAndCopied;
|
9042
|
+
let handlerAndState = proxyCache && proxyCache.get(target);
|
9043
|
+
if (!handlerAndState || handlerAndState[1][IS_TARGET_COPIED_PROPERTY] !== !!copiedTarget) {
|
9044
|
+
handlerAndState = createProxyHandler(target, !!copiedTarget);
|
9045
|
+
handlerAndState[1][PROXY_PROPERTY] = newProxy(copiedTarget || target, handlerAndState[0]);
|
9046
|
+
if (proxyCache) {
|
9047
|
+
proxyCache.set(target, handlerAndState);
|
9048
|
+
}
|
9049
|
+
}
|
9050
|
+
handlerAndState[1][AFFECTED_PROPERTY] = affected;
|
9051
|
+
handlerAndState[1][PROXY_CACHE_PROPERTY] = proxyCache;
|
9052
|
+
handlerAndState[1][TARGET_CACHE_PROPERTY] = targetCache2;
|
9053
|
+
return handlerAndState[1][PROXY_PROPERTY];
|
9054
|
+
};
|
9055
|
+
var isAllOwnKeysChanged = (prevObj, nextObj) => {
|
9056
|
+
const prevKeys = Reflect.ownKeys(prevObj);
|
9057
|
+
const nextKeys = Reflect.ownKeys(nextObj);
|
9058
|
+
return prevKeys.length !== nextKeys.length || prevKeys.some((k, i) => k !== nextKeys[i]);
|
9059
|
+
};
|
9060
|
+
var isChanged = (prevObj, nextObj, affected, cache, isEqual2 = Object.is) => {
|
9061
|
+
if (isEqual2(prevObj, nextObj)) {
|
9062
|
+
return false;
|
9063
|
+
}
|
9064
|
+
if (!isObject(prevObj) || !isObject(nextObj))
|
9065
|
+
return true;
|
9066
|
+
const used = affected.get(getOriginalObject(prevObj));
|
9067
|
+
if (!used)
|
9068
|
+
return true;
|
9069
|
+
if (cache) {
|
9070
|
+
const hit = cache.get(prevObj);
|
9071
|
+
if (hit && hit[NEXT_OBJECT_PROPERTY] === nextObj) {
|
9072
|
+
return hit[CHANGED_PROPERTY];
|
9073
|
+
}
|
9074
|
+
cache.set(prevObj, {
|
9075
|
+
[NEXT_OBJECT_PROPERTY]: nextObj,
|
9076
|
+
[CHANGED_PROPERTY]: false
|
9077
|
+
});
|
9078
|
+
}
|
9079
|
+
let changed = null;
|
9080
|
+
try {
|
9081
|
+
for (const key of used[HAS_KEY_PROPERTY] || []) {
|
9082
|
+
changed = Reflect.has(prevObj, key) !== Reflect.has(nextObj, key);
|
9083
|
+
if (changed)
|
9084
|
+
return changed;
|
9085
|
+
}
|
9086
|
+
if (used[ALL_OWN_KEYS_PROPERTY] === true) {
|
9087
|
+
changed = isAllOwnKeysChanged(prevObj, nextObj);
|
9088
|
+
if (changed)
|
9089
|
+
return changed;
|
9090
|
+
} else {
|
9091
|
+
for (const key of used[HAS_OWN_KEY_PROPERTY] || []) {
|
9092
|
+
const hasPrev = !!Reflect.getOwnPropertyDescriptor(prevObj, key);
|
9093
|
+
const hasNext = !!Reflect.getOwnPropertyDescriptor(nextObj, key);
|
9094
|
+
changed = hasPrev !== hasNext;
|
9095
|
+
if (changed)
|
9096
|
+
return changed;
|
9097
|
+
}
|
9098
|
+
}
|
9099
|
+
for (const key of used[KEYS_PROPERTY] || []) {
|
9100
|
+
changed = isChanged(prevObj[key], nextObj[key], affected, cache, isEqual2);
|
9101
|
+
if (changed)
|
9102
|
+
return changed;
|
9103
|
+
}
|
9104
|
+
if (changed === null)
|
9105
|
+
changed = true;
|
9106
|
+
return changed;
|
9107
|
+
} finally {
|
9108
|
+
if (cache) {
|
9109
|
+
cache.set(prevObj, {
|
9110
|
+
[NEXT_OBJECT_PROPERTY]: nextObj,
|
9111
|
+
[CHANGED_PROPERTY]: changed
|
9112
|
+
});
|
9113
|
+
}
|
9114
|
+
}
|
9115
|
+
};
|
9116
|
+
var getUntracked = (obj) => {
|
9117
|
+
if (isObjectToTrack(obj)) {
|
9118
|
+
return obj[GET_ORIGINAL_SYMBOL] || null;
|
9119
|
+
}
|
9120
|
+
return null;
|
9121
|
+
};
|
9122
|
+
var markToTrack = (obj, mark = true) => {
|
9123
|
+
objectsToTrack.set(obj, mark);
|
9124
|
+
};
|
9125
|
+
|
9126
|
+
// ../../node_modules/@zag-js/store/dist/index.mjs
|
9127
|
+
function getGlobal() {
|
9128
|
+
if (typeof globalThis !== "undefined") return globalThis;
|
9129
|
+
if (typeof self !== "undefined") return self;
|
9130
|
+
if (typeof window !== "undefined") return window;
|
9131
|
+
if (typeof global !== "undefined") return global;
|
9132
|
+
}
|
9133
|
+
function makeGlobal(key, value) {
|
9134
|
+
const g = getGlobal();
|
9135
|
+
if (!g) return value();
|
9136
|
+
g[key] || (g[key] = value());
|
9137
|
+
return g[key];
|
9138
|
+
}
|
9139
|
+
var isDev = () => process.env.NODE_ENV !== "production";
|
9140
|
+
var isObject2 = (x) => typeof x === "object" && x !== null;
|
9141
|
+
var proxyStateMap = makeGlobal("__zag__proxyStateMap", () => /* @__PURE__ */ new WeakMap());
|
9142
|
+
var refSet = makeGlobal("__zag__refSet", () => /* @__PURE__ */ new WeakSet());
|
9143
|
+
var isReactElement = (x) => typeof x === "object" && x !== null && "$$typeof" in x;
|
9144
|
+
var isVueElement = (x) => typeof x === "object" && x !== null && "__v_isVNode" in x;
|
9145
|
+
var isDOMElement = (x) => typeof x === "object" && x !== null && "nodeType" in x && typeof x.nodeName === "string";
|
9146
|
+
var isElement = (x) => isReactElement(x) || isVueElement(x) || isDOMElement(x);
|
9147
|
+
var buildProxyFunction = (objectIs = Object.is, newProxy2 = (target, handler) => new Proxy(target, handler), canProxy = (x) => isObject2(x) && !refSet.has(x) && (Array.isArray(x) || !(Symbol.iterator in x)) && !isElement(x) && !(x instanceof WeakMap) && !(x instanceof WeakSet) && !(x instanceof Error) && !(x instanceof Number) && !(x instanceof Date) && !(x instanceof String) && !(x instanceof RegExp) && !(x instanceof ArrayBuffer), defaultHandlePromise = (promise) => {
|
9148
|
+
switch (promise.status) {
|
9149
|
+
case "fulfilled":
|
9150
|
+
return promise.value;
|
9151
|
+
case "rejected":
|
9152
|
+
throw promise.reason;
|
9153
|
+
default:
|
9154
|
+
throw promise;
|
9155
|
+
}
|
9156
|
+
}, snapCache = /* @__PURE__ */ new WeakMap(), createSnapshot = (target, version, handlePromise = defaultHandlePromise) => {
|
9157
|
+
const cache = snapCache.get(target);
|
9158
|
+
if ((cache == null ? void 0 : cache[0]) === version) {
|
9159
|
+
return cache[1];
|
9160
|
+
}
|
9161
|
+
const snap = Array.isArray(target) ? [] : Object.create(Object.getPrototypeOf(target));
|
9162
|
+
markToTrack(snap, true);
|
9163
|
+
snapCache.set(target, [version, snap]);
|
9164
|
+
Reflect.ownKeys(target).forEach((key) => {
|
9165
|
+
const value = Reflect.get(target, key);
|
9166
|
+
if (refSet.has(value)) {
|
9167
|
+
markToTrack(value, false);
|
9168
|
+
snap[key] = value;
|
9169
|
+
} else if (value instanceof Promise) {
|
9170
|
+
Object.defineProperty(snap, key, {
|
9171
|
+
get() {
|
9172
|
+
return handlePromise(value);
|
9173
|
+
}
|
9174
|
+
});
|
9175
|
+
} else if (proxyStateMap.has(value)) {
|
9176
|
+
snap[key] = snapshot(value, handlePromise);
|
9177
|
+
} else {
|
9178
|
+
snap[key] = value;
|
9179
|
+
}
|
9180
|
+
});
|
9181
|
+
return Object.freeze(snap);
|
9182
|
+
}, proxyCache = /* @__PURE__ */ new WeakMap(), versionHolder = [1, 1], proxyFunction2 = (initialObject) => {
|
9183
|
+
if (!isObject2(initialObject)) {
|
9184
|
+
throw new Error("object required");
|
9185
|
+
}
|
9186
|
+
const found = proxyCache.get(initialObject);
|
9187
|
+
if (found) {
|
9188
|
+
return found;
|
9189
|
+
}
|
9190
|
+
let version = versionHolder[0];
|
9191
|
+
const listeners = /* @__PURE__ */ new Set();
|
9192
|
+
const notifyUpdate = (op, nextVersion = ++versionHolder[0]) => {
|
9193
|
+
if (version !== nextVersion) {
|
9194
|
+
version = nextVersion;
|
9195
|
+
listeners.forEach((listener) => listener(op, nextVersion));
|
9196
|
+
}
|
9197
|
+
};
|
9198
|
+
let checkVersion = versionHolder[1];
|
9199
|
+
const ensureVersion = (nextCheckVersion = ++versionHolder[1]) => {
|
9200
|
+
if (checkVersion !== nextCheckVersion && !listeners.size) {
|
9201
|
+
checkVersion = nextCheckVersion;
|
9202
|
+
propProxyStates.forEach(([propProxyState]) => {
|
9203
|
+
const propVersion = propProxyState[1](nextCheckVersion);
|
9204
|
+
if (propVersion > version) {
|
9205
|
+
version = propVersion;
|
9206
|
+
}
|
9207
|
+
});
|
9208
|
+
}
|
9209
|
+
return version;
|
9210
|
+
};
|
9211
|
+
const createPropListener = (prop) => (op, nextVersion) => {
|
9212
|
+
const newOp = [...op];
|
9213
|
+
newOp[1] = [prop, ...newOp[1]];
|
9214
|
+
notifyUpdate(newOp, nextVersion);
|
9215
|
+
};
|
9216
|
+
const propProxyStates = /* @__PURE__ */ new Map();
|
9217
|
+
const addPropListener = (prop, propProxyState) => {
|
9218
|
+
if (isDev() && propProxyStates.has(prop)) {
|
9219
|
+
throw new Error("prop listener already exists");
|
9220
|
+
}
|
9221
|
+
if (listeners.size) {
|
9222
|
+
const remove = propProxyState[3](createPropListener(prop));
|
9223
|
+
propProxyStates.set(prop, [propProxyState, remove]);
|
9224
|
+
} else {
|
9225
|
+
propProxyStates.set(prop, [propProxyState]);
|
9226
|
+
}
|
9227
|
+
};
|
9228
|
+
const removePropListener = (prop) => {
|
9229
|
+
var _a7;
|
9230
|
+
const entry = propProxyStates.get(prop);
|
9231
|
+
if (entry) {
|
9232
|
+
propProxyStates.delete(prop);
|
9233
|
+
(_a7 = entry[1]) == null ? void 0 : _a7.call(entry);
|
9234
|
+
}
|
9235
|
+
};
|
9236
|
+
const addListener = (listener) => {
|
9237
|
+
listeners.add(listener);
|
9238
|
+
if (listeners.size === 1) {
|
9239
|
+
propProxyStates.forEach(([propProxyState, prevRemove], prop) => {
|
9240
|
+
if (isDev() && prevRemove) {
|
9241
|
+
throw new Error("remove already exists");
|
9242
|
+
}
|
9243
|
+
const remove = propProxyState[3](createPropListener(prop));
|
9244
|
+
propProxyStates.set(prop, [propProxyState, remove]);
|
9245
|
+
});
|
9246
|
+
}
|
9247
|
+
const removeListener = () => {
|
9248
|
+
listeners.delete(listener);
|
9249
|
+
if (listeners.size === 0) {
|
9250
|
+
propProxyStates.forEach(([propProxyState, remove], prop) => {
|
9251
|
+
if (remove) {
|
9252
|
+
remove();
|
9253
|
+
propProxyStates.set(prop, [propProxyState]);
|
9254
|
+
}
|
9255
|
+
});
|
9256
|
+
}
|
9257
|
+
};
|
9258
|
+
return removeListener;
|
9259
|
+
};
|
9260
|
+
const baseObject = Array.isArray(initialObject) ? [] : Object.create(Object.getPrototypeOf(initialObject));
|
9261
|
+
const handler = {
|
9262
|
+
deleteProperty(target, prop) {
|
9263
|
+
const prevValue = Reflect.get(target, prop);
|
9264
|
+
removePropListener(prop);
|
9265
|
+
const deleted = Reflect.deleteProperty(target, prop);
|
9266
|
+
if (deleted) {
|
9267
|
+
notifyUpdate(["delete", [prop], prevValue]);
|
9268
|
+
}
|
9269
|
+
return deleted;
|
9270
|
+
},
|
9271
|
+
set(target, prop, value, receiver) {
|
9272
|
+
var _a7;
|
9273
|
+
const hasPrevValue = Reflect.has(target, prop);
|
9274
|
+
const prevValue = Reflect.get(target, prop, receiver);
|
9275
|
+
if (hasPrevValue && (objectIs(prevValue, value) || proxyCache.has(value) && objectIs(prevValue, proxyCache.get(value)))) {
|
9276
|
+
return true;
|
9277
|
+
}
|
9278
|
+
removePropListener(prop);
|
9279
|
+
if (isObject2(value)) {
|
9280
|
+
value = getUntracked(value) || value;
|
9281
|
+
}
|
9282
|
+
let nextValue = value;
|
9283
|
+
if ((_a7 = Object.getOwnPropertyDescriptor(target, prop)) == null ? void 0 : _a7.set) ;
|
9284
|
+
else if (value instanceof Promise) {
|
9285
|
+
value.then((v) => {
|
9286
|
+
Object.assign(value, { status: "fulfilled", value: v });
|
9287
|
+
notifyUpdate(["resolve", [prop], v]);
|
9288
|
+
}).catch((e) => {
|
9289
|
+
Object.assign(value, { status: "rejected", reason: e });
|
9290
|
+
notifyUpdate(["reject", [prop], e]);
|
9291
|
+
});
|
9292
|
+
} else {
|
9293
|
+
if (!proxyStateMap.has(value) && canProxy(value)) {
|
9294
|
+
nextValue = proxy(value);
|
9295
|
+
}
|
9296
|
+
const childProxyState = !refSet.has(nextValue) && proxyStateMap.get(nextValue);
|
9297
|
+
if (childProxyState) {
|
9298
|
+
addPropListener(prop, childProxyState);
|
9299
|
+
}
|
9300
|
+
}
|
9301
|
+
Reflect.set(target, prop, nextValue, receiver);
|
9302
|
+
notifyUpdate(["set", [prop], value, prevValue]);
|
9303
|
+
return true;
|
9304
|
+
}
|
9305
|
+
};
|
9306
|
+
const proxyObject = newProxy2(baseObject, handler);
|
9307
|
+
proxyCache.set(initialObject, proxyObject);
|
9308
|
+
const proxyState = [baseObject, ensureVersion, createSnapshot, addListener];
|
9309
|
+
proxyStateMap.set(proxyObject, proxyState);
|
9310
|
+
Reflect.ownKeys(initialObject).forEach((key) => {
|
9311
|
+
const desc = Object.getOwnPropertyDescriptor(initialObject, key);
|
9312
|
+
if (desc.get || desc.set) {
|
9313
|
+
Object.defineProperty(baseObject, key, desc);
|
9314
|
+
} else {
|
9315
|
+
proxyObject[key] = initialObject[key];
|
9316
|
+
}
|
9317
|
+
});
|
9318
|
+
return proxyObject;
|
9319
|
+
}) => [
|
9320
|
+
// public functions
|
9321
|
+
proxyFunction2,
|
9322
|
+
// shared state
|
9323
|
+
proxyStateMap,
|
9324
|
+
refSet,
|
9325
|
+
// internal things
|
9326
|
+
objectIs,
|
9327
|
+
newProxy2,
|
9328
|
+
canProxy,
|
9329
|
+
defaultHandlePromise,
|
9330
|
+
snapCache,
|
9331
|
+
createSnapshot,
|
9332
|
+
proxyCache,
|
9333
|
+
versionHolder
|
9334
|
+
];
|
9335
|
+
var [proxyFunction] = buildProxyFunction();
|
9336
|
+
function proxy(initialObject = {}) {
|
9337
|
+
return proxyFunction(initialObject);
|
9338
|
+
}
|
9339
|
+
function subscribe(proxyObject, callback, notifyInSync) {
|
9340
|
+
const proxyState = proxyStateMap.get(proxyObject);
|
9341
|
+
if (isDev() && !proxyState) {
|
9342
|
+
console.warn("Please use proxy object");
|
9343
|
+
}
|
9344
|
+
let promise;
|
9345
|
+
const ops = [];
|
9346
|
+
const addListener = proxyState[3];
|
9347
|
+
let isListenerActive = false;
|
9348
|
+
const listener = (op) => {
|
9349
|
+
ops.push(op);
|
9350
|
+
if (notifyInSync) {
|
9351
|
+
callback(ops.splice(0));
|
9352
|
+
return;
|
9353
|
+
}
|
9354
|
+
if (!promise) {
|
9355
|
+
promise = Promise.resolve().then(() => {
|
9356
|
+
promise = void 0;
|
9357
|
+
if (isListenerActive) {
|
9358
|
+
callback(ops.splice(0));
|
9359
|
+
}
|
9360
|
+
});
|
9361
|
+
}
|
9362
|
+
};
|
9363
|
+
const removeListener = addListener(listener);
|
9364
|
+
isListenerActive = true;
|
9365
|
+
return () => {
|
9366
|
+
isListenerActive = false;
|
9367
|
+
removeListener();
|
9368
|
+
};
|
9369
|
+
}
|
9370
|
+
function snapshot(proxyObject, handlePromise) {
|
9371
|
+
const proxyState = proxyStateMap.get(proxyObject);
|
9372
|
+
if (isDev() && !proxyState) {
|
9373
|
+
console.warn("Please use proxy object");
|
9374
|
+
}
|
9375
|
+
const [target, ensureVersion, createSnapshot] = proxyState;
|
9376
|
+
return createSnapshot(target, ensureVersion(), handlePromise);
|
9377
|
+
}
|
9378
|
+
function ref(obj) {
|
9379
|
+
refSet.add(obj);
|
9380
|
+
return obj;
|
9381
|
+
}
|
9382
|
+
function proxyWithComputed(initialObject, computedFns) {
|
9383
|
+
const keys = Object.keys(computedFns);
|
9384
|
+
keys.forEach((key) => {
|
9385
|
+
if (Object.getOwnPropertyDescriptor(initialObject, key)) {
|
9386
|
+
throw new Error("object property already defined");
|
9387
|
+
}
|
9388
|
+
const computedFn = computedFns[key];
|
9389
|
+
const { get, set: set2 } = typeof computedFn === "function" ? { get: computedFn } : computedFn;
|
9390
|
+
const desc = {};
|
9391
|
+
desc.get = () => get(snapshot(proxyObject));
|
9392
|
+
if (set2) {
|
9393
|
+
desc.set = (newValue) => set2(proxyObject, newValue);
|
9394
|
+
}
|
9395
|
+
Object.defineProperty(initialObject, key, desc);
|
9396
|
+
});
|
9397
|
+
const proxyObject = proxy(initialObject);
|
9398
|
+
return proxyObject;
|
9399
|
+
}
|
9400
|
+
|
9401
|
+
// ../../node_modules/@zag-js/utils/dist/index.mjs
|
9402
|
+
function clear(v) {
|
9403
|
+
while (v.length > 0) v.pop();
|
9404
|
+
return v;
|
9405
|
+
}
|
9406
|
+
var runIfFn = (v, ...a) => {
|
9407
|
+
const res = typeof v === "function" ? v(...a) : v;
|
9408
|
+
return res != null ? res : void 0;
|
9409
|
+
};
|
9410
|
+
var cast = (v) => v;
|
9411
|
+
var noop = () => {
|
9412
|
+
};
|
9413
|
+
var callAll = (...fns) => (...a) => {
|
9414
|
+
fns.forEach(function(fn) {
|
9415
|
+
fn == null ? void 0 : fn(...a);
|
9416
|
+
});
|
9417
|
+
};
|
9418
|
+
var uuid = /* @__PURE__ */ (() => {
|
9419
|
+
let id = 0;
|
9420
|
+
return () => {
|
9421
|
+
id++;
|
9422
|
+
return id.toString(36);
|
9423
|
+
};
|
9424
|
+
})();
|
9425
|
+
var isDev2 = () => process.env.NODE_ENV !== "production";
|
9426
|
+
var isArray = (v) => Array.isArray(v);
|
9427
|
+
var isObjectLike = (v) => v != null && typeof v === "object";
|
9428
|
+
var isObject3 = (v) => isObjectLike(v) && !isArray(v);
|
9429
|
+
var isNumber = (v) => typeof v === "number" && !Number.isNaN(v);
|
9430
|
+
var isString = (v) => typeof v === "string";
|
9431
|
+
var isFunction = (v) => typeof v === "function";
|
9432
|
+
var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
|
9433
|
+
var baseGetTag = (v) => Object.prototype.toString.call(v);
|
9434
|
+
var fnToString = Function.prototype.toString;
|
9435
|
+
var objectCtorString = fnToString.call(Object);
|
9436
|
+
var isPlainObject = (v) => {
|
9437
|
+
if (!isObjectLike(v) || baseGetTag(v) != "[object Object]") return false;
|
9438
|
+
const proto = Object.getPrototypeOf(v);
|
9439
|
+
if (proto === null) return true;
|
9440
|
+
const Ctor = hasProp(proto, "constructor") && proto.constructor;
|
9441
|
+
return typeof Ctor == "function" && Ctor instanceof Ctor && fnToString.call(Ctor) == objectCtorString;
|
9442
|
+
};
|
9443
|
+
function compact(obj) {
|
9444
|
+
if (!isPlainObject2(obj) || obj === void 0) {
|
9445
|
+
return obj;
|
9446
|
+
}
|
9447
|
+
const keys = Reflect.ownKeys(obj).filter((key) => typeof key === "string");
|
9448
|
+
const filtered = {};
|
9449
|
+
for (const key of keys) {
|
9450
|
+
const value = obj[key];
|
9451
|
+
if (value !== void 0) {
|
9452
|
+
filtered[key] = compact(value);
|
9453
|
+
}
|
9454
|
+
}
|
9455
|
+
return filtered;
|
9456
|
+
}
|
9457
|
+
var isPlainObject2 = (value) => {
|
9458
|
+
return value && typeof value === "object" && value.constructor === Object;
|
9459
|
+
};
|
9460
|
+
function warn(...a) {
|
9461
|
+
const m = a.length === 1 ? a[0] : a[1];
|
9462
|
+
const c = a.length === 2 ? a[0] : true;
|
9463
|
+
if (c && process.env.NODE_ENV !== "production") {
|
9464
|
+
console.warn(m);
|
9465
|
+
}
|
9466
|
+
}
|
9467
|
+
function invariant(...a) {
|
9468
|
+
const m = a.length === 1 ? a[0] : a[1];
|
9469
|
+
const c = a.length === 2 ? a[0] : true;
|
9470
|
+
if (c && process.env.NODE_ENV !== "production") {
|
9471
|
+
throw new Error(m);
|
9472
|
+
}
|
9473
|
+
}
|
9474
|
+
|
9475
|
+
// ../../node_modules/klona/full/index.mjs
|
9476
|
+
function set(obj, key, val) {
|
9477
|
+
if (typeof val.value === "object") val.value = klona(val.value);
|
9478
|
+
if (!val.enumerable || val.get || val.set || !val.configurable || !val.writable || key === "__proto__") {
|
9479
|
+
Object.defineProperty(obj, key, val);
|
9480
|
+
} else obj[key] = val.value;
|
9481
|
+
}
|
9482
|
+
function klona(x) {
|
9483
|
+
if (typeof x !== "object") return x;
|
9484
|
+
var i = 0, k, list, tmp, str = Object.prototype.toString.call(x);
|
9485
|
+
if (str === "[object Object]") {
|
9486
|
+
tmp = Object.create(x.__proto__ || null);
|
9487
|
+
} else if (str === "[object Array]") {
|
9488
|
+
tmp = Array(x.length);
|
9489
|
+
} else if (str === "[object Set]") {
|
9490
|
+
tmp = /* @__PURE__ */ new Set();
|
9491
|
+
x.forEach(function(val) {
|
9492
|
+
tmp.add(klona(val));
|
9493
|
+
});
|
9494
|
+
} else if (str === "[object Map]") {
|
9495
|
+
tmp = /* @__PURE__ */ new Map();
|
9496
|
+
x.forEach(function(val, key) {
|
9497
|
+
tmp.set(klona(key), klona(val));
|
9498
|
+
});
|
9499
|
+
} else if (str === "[object Date]") {
|
9500
|
+
tmp = /* @__PURE__ */ new Date(+x);
|
9501
|
+
} else if (str === "[object RegExp]") {
|
9502
|
+
tmp = new RegExp(x.source, x.flags);
|
9503
|
+
} else if (str === "[object DataView]") {
|
9504
|
+
tmp = new x.constructor(klona(x.buffer));
|
9505
|
+
} else if (str === "[object ArrayBuffer]") {
|
9506
|
+
tmp = x.slice(0);
|
9507
|
+
} else if (str.slice(-6) === "Array]") {
|
9508
|
+
tmp = new x.constructor(x);
|
9509
|
+
}
|
9510
|
+
if (tmp) {
|
9511
|
+
for (list = Object.getOwnPropertySymbols(x); i < list.length; i++) {
|
9512
|
+
set(tmp, list[i], Object.getOwnPropertyDescriptor(x, list[i]));
|
9513
|
+
}
|
9514
|
+
for (i = 0, list = Object.getOwnPropertyNames(x); i < list.length; i++) {
|
9515
|
+
if (Object.hasOwnProperty.call(tmp, k = list[i]) && tmp[k] === x[k]) continue;
|
9516
|
+
set(tmp, k, Object.getOwnPropertyDescriptor(x, k));
|
9517
|
+
}
|
9518
|
+
}
|
9519
|
+
return tmp || x;
|
9520
|
+
}
|
9521
|
+
|
9522
|
+
// ../../node_modules/@zag-js/core/dist/index.mjs
|
9523
|
+
var __defProp2 = Object.defineProperty;
|
9524
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
9525
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
9526
|
+
function deepMerge(source, ...objects) {
|
9527
|
+
for (const obj of objects) {
|
9528
|
+
const target = compact(obj);
|
9529
|
+
for (const key in target) {
|
9530
|
+
if (isPlainObject(obj[key])) {
|
9531
|
+
if (!source[key]) {
|
9532
|
+
source[key] = {};
|
9533
|
+
}
|
9534
|
+
deepMerge(source[key], obj[key]);
|
9535
|
+
} else {
|
9536
|
+
source[key] = obj[key];
|
9537
|
+
}
|
9538
|
+
}
|
9539
|
+
}
|
9540
|
+
return source;
|
9541
|
+
}
|
9542
|
+
function structuredClone(v) {
|
9543
|
+
return klona(v);
|
9544
|
+
}
|
9545
|
+
function toEvent(event) {
|
9546
|
+
const obj = isString(event) ? { type: event } : event;
|
9547
|
+
return obj;
|
9548
|
+
}
|
9549
|
+
function toArray(value) {
|
9550
|
+
if (!value) return [];
|
9551
|
+
return isArray(value) ? value.slice() : [value];
|
9552
|
+
}
|
9553
|
+
function isGuardHelper(value) {
|
9554
|
+
return isObject3(value) && value.predicate != null;
|
9555
|
+
}
|
9556
|
+
var Truthy = () => true;
|
9557
|
+
function determineGuardFn(guard, guardMap) {
|
9558
|
+
guard = guard != null ? guard : Truthy;
|
9559
|
+
return (context, event, meta) => {
|
9560
|
+
if (isString(guard)) {
|
9561
|
+
const value = guardMap[guard];
|
9562
|
+
return isFunction(value) ? value(context, event, meta) : value;
|
9563
|
+
}
|
9564
|
+
if (isGuardHelper(guard)) {
|
9565
|
+
return guard.predicate(guardMap)(context, event, meta);
|
9566
|
+
}
|
9567
|
+
return guard == null ? void 0 : guard(context, event, meta);
|
9568
|
+
};
|
9569
|
+
}
|
9570
|
+
function determineActionsFn(values, guardMap) {
|
9571
|
+
return (context, event, meta) => {
|
9572
|
+
if (isGuardHelper(values)) {
|
9573
|
+
return values.predicate(guardMap)(context, event, meta);
|
9574
|
+
}
|
9575
|
+
return values;
|
9576
|
+
};
|
9577
|
+
}
|
9578
|
+
function createProxy2(config) {
|
9579
|
+
var _a7, _b6, _c5, _d5, _e5;
|
9580
|
+
const computedContext = (_a7 = config.computed) != null ? _a7 : cast({});
|
9581
|
+
const initialContext = (_b6 = config.context) != null ? _b6 : cast({});
|
9582
|
+
const initialTags = config.initial ? (_d5 = (_c5 = config.states) == null ? void 0 : _c5[config.initial]) == null ? void 0 : _d5.tags : [];
|
9583
|
+
const state = proxy({
|
9584
|
+
value: (_e5 = config.initial) != null ? _e5 : "",
|
9585
|
+
previousValue: "",
|
9586
|
+
event: cast({}),
|
9587
|
+
previousEvent: cast({}),
|
9588
|
+
context: proxyWithComputed(initialContext, computedContext),
|
9589
|
+
done: false,
|
9590
|
+
tags: initialTags != null ? initialTags : [],
|
9591
|
+
hasTag(tag) {
|
9592
|
+
return this.tags.includes(tag);
|
9593
|
+
},
|
9594
|
+
matches(...value) {
|
9595
|
+
return value.includes(this.value);
|
9596
|
+
},
|
9597
|
+
can(event) {
|
9598
|
+
return cast(this).nextEvents.includes(event);
|
9599
|
+
},
|
9600
|
+
get nextEvents() {
|
9601
|
+
var _a8, _b7, _c6, _d6;
|
9602
|
+
const stateEvents = (_c6 = (_b7 = (_a8 = config.states) == null ? void 0 : _a8[this.value]) == null ? void 0 : _b7["on"]) != null ? _c6 : {};
|
9603
|
+
const globalEvents = (_d6 = config == null ? void 0 : config.on) != null ? _d6 : {};
|
9604
|
+
return Object.keys({ ...stateEvents, ...globalEvents });
|
9605
|
+
},
|
9606
|
+
get changed() {
|
9607
|
+
if (this.event.value === "machine.init" || !this.previousValue) return false;
|
9608
|
+
return this.value !== this.previousValue;
|
9609
|
+
}
|
9610
|
+
});
|
9611
|
+
return cast(state);
|
9612
|
+
}
|
9613
|
+
function determineDelayFn(delay, delaysMap) {
|
9614
|
+
return (context, event) => {
|
9615
|
+
if (isNumber(delay)) return delay;
|
9616
|
+
if (isFunction(delay)) {
|
9617
|
+
return delay(context, event);
|
9618
|
+
}
|
9619
|
+
if (isString(delay)) {
|
9620
|
+
const value = Number.parseFloat(delay);
|
9621
|
+
if (!Number.isNaN(value)) {
|
9622
|
+
return value;
|
9623
|
+
}
|
9624
|
+
if (delaysMap) {
|
9625
|
+
const valueOrFn = delaysMap == null ? void 0 : delaysMap[delay];
|
9626
|
+
invariant(
|
9627
|
+
valueOrFn == null,
|
9628
|
+
`[@zag-js/core > determine-delay] Cannot determine delay for \`${delay}\`. It doesn't exist in \`options.delays\``
|
9629
|
+
);
|
9630
|
+
return isFunction(valueOrFn) ? valueOrFn(context, event) : valueOrFn;
|
9631
|
+
}
|
9632
|
+
}
|
9633
|
+
};
|
9634
|
+
}
|
9635
|
+
function toTarget(target) {
|
9636
|
+
return isString(target) ? { target } : target;
|
9637
|
+
}
|
9638
|
+
function determineTransitionFn(transitions, guardMap) {
|
9639
|
+
return (context, event, meta) => {
|
9640
|
+
return toArray(transitions).map(toTarget).find((transition) => {
|
9641
|
+
var _a7;
|
9642
|
+
const determineGuard = determineGuardFn(transition.guard, guardMap);
|
9643
|
+
const guard = determineGuard(context, event, meta);
|
9644
|
+
return (_a7 = guard != null ? guard : transition.target) != null ? _a7 : transition.actions;
|
9645
|
+
});
|
9646
|
+
};
|
9647
|
+
}
|
9648
|
+
var Machine = class {
|
9649
|
+
// Let's get started!
|
9650
|
+
constructor(config, options) {
|
9651
|
+
var _a7, _b6, _c5, _d5, _e5, _f5, _g5, _h3, _i3, _j3, _k3;
|
9652
|
+
__publicField(
|
9653
|
+
this,
|
9654
|
+
"status",
|
9655
|
+
"Not Started"
|
9656
|
+
/* NotStarted */
|
9657
|
+
);
|
9658
|
+
__publicField(this, "state");
|
9659
|
+
__publicField(this, "initialState");
|
9660
|
+
__publicField(this, "initialContext");
|
9661
|
+
__publicField(this, "id");
|
9662
|
+
__publicField(
|
9663
|
+
this,
|
9664
|
+
"type",
|
9665
|
+
"machine"
|
9666
|
+
/* Machine */
|
9667
|
+
);
|
9668
|
+
__publicField(this, "activityEvents", /* @__PURE__ */ new Map());
|
9669
|
+
__publicField(this, "delayedEvents", /* @__PURE__ */ new Map());
|
9670
|
+
__publicField(this, "stateListeners", /* @__PURE__ */ new Set());
|
9671
|
+
__publicField(this, "doneListeners", /* @__PURE__ */ new Set());
|
9672
|
+
__publicField(this, "contextWatchers", /* @__PURE__ */ new Set());
|
9673
|
+
__publicField(this, "removeStateListener", noop);
|
9674
|
+
__publicField(this, "parent");
|
9675
|
+
__publicField(this, "children", /* @__PURE__ */ new Map());
|
9676
|
+
__publicField(this, "guardMap");
|
9677
|
+
__publicField(this, "actionMap");
|
9678
|
+
__publicField(this, "delayMap");
|
9679
|
+
__publicField(this, "activityMap");
|
9680
|
+
__publicField(this, "sync");
|
9681
|
+
__publicField(this, "options");
|
9682
|
+
__publicField(this, "config");
|
9683
|
+
__publicField(this, "_created", () => {
|
9684
|
+
var _a8;
|
9685
|
+
const event = toEvent(
|
9686
|
+
"machine.created"
|
9687
|
+
/* Created */
|
9688
|
+
);
|
9689
|
+
this.executeActions((_a8 = this.config) == null ? void 0 : _a8.created, event);
|
9690
|
+
});
|
9691
|
+
__publicField(this, "start", (init) => {
|
9692
|
+
this.state.value = "";
|
9693
|
+
this.state.tags = [];
|
9694
|
+
if (this.status === "Running") {
|
9695
|
+
return this;
|
9696
|
+
}
|
9697
|
+
this.status = "Running";
|
9698
|
+
this.removeStateListener = subscribe(
|
9699
|
+
this.state,
|
9700
|
+
() => {
|
9701
|
+
this.stateListeners.forEach((listener) => {
|
9702
|
+
listener(this.stateSnapshot);
|
9703
|
+
});
|
9704
|
+
},
|
9705
|
+
this.sync
|
9706
|
+
);
|
9707
|
+
this.setupContextWatchers();
|
9708
|
+
this.executeActivities(
|
9709
|
+
toEvent(
|
9710
|
+
"machine.start"
|
9711
|
+
/* Start */
|
9712
|
+
),
|
9713
|
+
toArray(this.config.activities),
|
9714
|
+
"machine.start"
|
9715
|
+
/* Start */
|
9716
|
+
);
|
9717
|
+
this.executeActions(this.config.entry, toEvent(
|
9718
|
+
"machine.start"
|
9719
|
+
/* Start */
|
9720
|
+
));
|
9721
|
+
const event = toEvent(
|
9722
|
+
"machine.init"
|
9723
|
+
/* Init */
|
9724
|
+
);
|
9725
|
+
const target = isObject3(init) ? init.value : init;
|
9726
|
+
const context = isObject3(init) ? init.context : void 0;
|
9727
|
+
if (context) {
|
9728
|
+
this.setContext(context);
|
9729
|
+
}
|
9730
|
+
const transition = {
|
9731
|
+
target: target != null ? target : this.config.initial
|
9732
|
+
};
|
9733
|
+
const next = this.getNextStateInfo(transition, event);
|
9734
|
+
this.initialState = next;
|
9735
|
+
this.performStateChangeEffects(this.state.value, next, event);
|
9736
|
+
return this;
|
9737
|
+
});
|
9738
|
+
__publicField(this, "setupContextWatchers", () => {
|
9739
|
+
const { watch } = this.config;
|
9740
|
+
if (!watch) return;
|
9741
|
+
let prev = snapshot(this.state.context);
|
9742
|
+
const cleanup = subscribe(this.state.context, () => {
|
9743
|
+
var _a8, _b7;
|
9744
|
+
const next = snapshot(this.state.context);
|
9745
|
+
for (const [key, fn] of Object.entries(watch)) {
|
9746
|
+
const isEqual2 = (_b7 = (_a8 = this.options.compareFns) == null ? void 0 : _a8[key]) != null ? _b7 : Object.is;
|
9747
|
+
if (isEqual2(prev[key], next[key])) continue;
|
9748
|
+
this.executeActions(fn, this.state.event);
|
9749
|
+
}
|
9750
|
+
prev = next;
|
9751
|
+
});
|
9752
|
+
this.contextWatchers.add(cleanup);
|
9753
|
+
});
|
9754
|
+
__publicField(this, "stop", () => {
|
9755
|
+
if (this.status === "Stopped") return;
|
9756
|
+
this.performExitEffects(this.state.value, toEvent(
|
9757
|
+
"machine.stop"
|
9758
|
+
/* Stop */
|
9759
|
+
));
|
9760
|
+
this.executeActions(this.config.exit, toEvent(
|
9761
|
+
"machine.stop"
|
9762
|
+
/* Stop */
|
9763
|
+
));
|
9764
|
+
this.setState("");
|
9765
|
+
this.setEvent(
|
9766
|
+
"machine.stop"
|
9767
|
+
/* Stop */
|
9768
|
+
);
|
9769
|
+
this.stopStateListeners();
|
9770
|
+
this.stopChildren();
|
9771
|
+
this.stopActivities();
|
9772
|
+
this.stopDelayedEvents();
|
9773
|
+
this.stopContextWatchers();
|
9774
|
+
this.status = "Stopped";
|
9775
|
+
return this;
|
9776
|
+
});
|
9777
|
+
__publicField(this, "stopStateListeners", () => {
|
9778
|
+
this.removeStateListener();
|
9779
|
+
this.stateListeners.clear();
|
9780
|
+
});
|
9781
|
+
__publicField(this, "stopContextWatchers", () => {
|
9782
|
+
this.contextWatchers.forEach((fn) => fn());
|
9783
|
+
this.contextWatchers.clear();
|
9784
|
+
});
|
9785
|
+
__publicField(this, "stopDelayedEvents", () => {
|
9786
|
+
this.delayedEvents.forEach((state) => {
|
9787
|
+
state.forEach((stop) => stop());
|
9788
|
+
});
|
9789
|
+
this.delayedEvents.clear();
|
9790
|
+
});
|
9791
|
+
__publicField(this, "stopActivities", (state) => {
|
9792
|
+
var _a8, _b7;
|
9793
|
+
if (state) {
|
9794
|
+
(_a8 = this.activityEvents.get(state)) == null ? void 0 : _a8.forEach((stop) => stop());
|
9795
|
+
(_b7 = this.activityEvents.get(state)) == null ? void 0 : _b7.clear();
|
9796
|
+
this.activityEvents.delete(state);
|
9797
|
+
} else {
|
9798
|
+
this.activityEvents.forEach((state2) => {
|
9799
|
+
state2.forEach((stop) => stop());
|
9800
|
+
state2.clear();
|
9801
|
+
});
|
9802
|
+
this.activityEvents.clear();
|
9803
|
+
}
|
9804
|
+
});
|
9805
|
+
__publicField(this, "sendChild", (evt, to) => {
|
9806
|
+
const event = toEvent(evt);
|
9807
|
+
const id = runIfFn(to, this.contextSnapshot);
|
9808
|
+
const child = this.children.get(id);
|
9809
|
+
if (!child) {
|
9810
|
+
invariant(`[@zag-js/core] Cannot send '${event.type}' event to unknown child`);
|
9811
|
+
}
|
9812
|
+
child.send(event);
|
9813
|
+
});
|
9814
|
+
__publicField(this, "stopChild", (id) => {
|
9815
|
+
if (!this.children.has(id)) {
|
9816
|
+
invariant(`[@zag-js/core > stop-child] Cannot stop unknown child ${id}`);
|
9817
|
+
}
|
9818
|
+
this.children.get(id).stop();
|
9819
|
+
this.children.delete(id);
|
9820
|
+
});
|
9821
|
+
__publicField(this, "removeChild", (id) => {
|
9822
|
+
this.children.delete(id);
|
9823
|
+
});
|
9824
|
+
__publicField(this, "stopChildren", () => {
|
9825
|
+
this.children.forEach((child) => child.stop());
|
9826
|
+
this.children.clear();
|
9827
|
+
});
|
9828
|
+
__publicField(this, "setParent", (parent) => {
|
9829
|
+
this.parent = parent;
|
9830
|
+
});
|
9831
|
+
__publicField(this, "spawn", (src, id) => {
|
9832
|
+
const actor = runIfFn(src);
|
9833
|
+
if (id) actor.id = id;
|
9834
|
+
actor.type = "machine.actor";
|
9835
|
+
actor.setParent(this);
|
9836
|
+
this.children.set(actor.id, cast(actor));
|
9837
|
+
actor.onDone(() => {
|
9838
|
+
this.removeChild(actor.id);
|
9839
|
+
}).start();
|
9840
|
+
return cast(ref(actor));
|
9841
|
+
});
|
9842
|
+
__publicField(this, "stopActivity", (key) => {
|
9843
|
+
var _a8;
|
9844
|
+
if (!this.state.value) return;
|
9845
|
+
const cleanups = this.activityEvents.get(this.state.value);
|
9846
|
+
(_a8 = cleanups == null ? void 0 : cleanups.get(key)) == null ? void 0 : _a8();
|
9847
|
+
cleanups == null ? void 0 : cleanups.delete(key);
|
9848
|
+
});
|
9849
|
+
__publicField(this, "addActivityCleanup", (state, key, cleanup) => {
|
9850
|
+
var _a8;
|
9851
|
+
if (!state) return;
|
9852
|
+
if (!this.activityEvents.has(state)) {
|
9853
|
+
this.activityEvents.set(state, /* @__PURE__ */ new Map([[key, cleanup]]));
|
9854
|
+
} else {
|
9855
|
+
(_a8 = this.activityEvents.get(state)) == null ? void 0 : _a8.set(key, cleanup);
|
9856
|
+
}
|
9857
|
+
});
|
9858
|
+
__publicField(this, "setState", (target) => {
|
9859
|
+
this.state.previousValue = this.state.value;
|
9860
|
+
this.state.value = target;
|
9861
|
+
const stateNode = this.getStateNode(target);
|
9862
|
+
if (target == null) {
|
9863
|
+
clear(this.state.tags);
|
9864
|
+
} else {
|
9865
|
+
this.state.tags = toArray(stateNode == null ? void 0 : stateNode.tags);
|
9866
|
+
}
|
9867
|
+
});
|
9868
|
+
__publicField(this, "setContext", (context) => {
|
9869
|
+
if (!context) return;
|
9870
|
+
deepMerge(this.state.context, compact(context));
|
9871
|
+
});
|
9872
|
+
__publicField(this, "setOptions", (options2) => {
|
9873
|
+
const opts = compact(options2);
|
9874
|
+
this.actionMap = { ...this.actionMap, ...opts.actions };
|
9875
|
+
this.delayMap = { ...this.delayMap, ...opts.delays };
|
9876
|
+
this.activityMap = { ...this.activityMap, ...opts.activities };
|
9877
|
+
this.guardMap = { ...this.guardMap, ...opts.guards };
|
9878
|
+
});
|
9879
|
+
__publicField(this, "getStateNode", (state) => {
|
9880
|
+
var _a8;
|
9881
|
+
if (!state) return;
|
9882
|
+
return (_a8 = this.config.states) == null ? void 0 : _a8[state];
|
9883
|
+
});
|
9884
|
+
__publicField(this, "getNextStateInfo", (transitions, event) => {
|
9885
|
+
var _a8;
|
9886
|
+
const transition = this.determineTransition(transitions, event);
|
9887
|
+
const isTargetless = !(transition == null ? void 0 : transition.target);
|
9888
|
+
const target = (_a8 = transition == null ? void 0 : transition.target) != null ? _a8 : this.state.value;
|
9889
|
+
const changed = this.state.value !== target;
|
9890
|
+
const stateNode = this.getStateNode(target);
|
9891
|
+
const reenter = !isTargetless && !changed && !(transition == null ? void 0 : transition.internal);
|
9892
|
+
const info = {
|
9893
|
+
reenter,
|
9894
|
+
transition,
|
9895
|
+
stateNode,
|
9896
|
+
target,
|
9897
|
+
changed
|
9898
|
+
};
|
9899
|
+
this.log("NextState:", `[${event.type}]`, this.state.value, "---->", info.target);
|
9900
|
+
return info;
|
9901
|
+
});
|
9902
|
+
__publicField(this, "getAfterActions", (transition, delay) => {
|
9903
|
+
let id;
|
9904
|
+
const current = this.state.value;
|
9905
|
+
return {
|
9906
|
+
entry: () => {
|
9907
|
+
id = globalThis.setTimeout(() => {
|
9908
|
+
const next = this.getNextStateInfo(transition, this.state.event);
|
9909
|
+
this.performStateChangeEffects(current, next, this.state.event);
|
9910
|
+
}, delay);
|
9911
|
+
},
|
9912
|
+
exit: () => {
|
9913
|
+
globalThis.clearTimeout(id);
|
9914
|
+
}
|
9915
|
+
};
|
9916
|
+
});
|
9917
|
+
__publicField(this, "getDelayedEventActions", (state) => {
|
9918
|
+
const stateNode = this.getStateNode(state);
|
9919
|
+
const event = this.state.event;
|
9920
|
+
if (!stateNode || !stateNode.after) return;
|
9921
|
+
const entries = [];
|
9922
|
+
const exits = [];
|
9923
|
+
if (isArray(stateNode.after)) {
|
9924
|
+
const transition = this.determineTransition(stateNode.after, event);
|
9925
|
+
if (!transition) return;
|
9926
|
+
if (!hasProp(transition, "delay")) {
|
9927
|
+
throw new Error(`[@zag-js/core > after] Delay is required for after transition: ${JSON.stringify(transition)}`);
|
9928
|
+
}
|
9929
|
+
const determineDelay = determineDelayFn(transition.delay, this.delayMap);
|
9930
|
+
const __delay = determineDelay(this.contextSnapshot, event);
|
9931
|
+
const actions = this.getAfterActions(transition, __delay);
|
9932
|
+
entries.push(actions.entry);
|
9933
|
+
exits.push(actions.exit);
|
9934
|
+
return { entries, exits };
|
9935
|
+
}
|
9936
|
+
if (isObject3(stateNode.after)) {
|
9937
|
+
for (const delay in stateNode.after) {
|
9938
|
+
const transition = stateNode.after[delay];
|
9939
|
+
const determineDelay = determineDelayFn(delay, this.delayMap);
|
9940
|
+
const __delay = determineDelay(this.contextSnapshot, event);
|
9941
|
+
const actions = this.getAfterActions(transition, __delay);
|
9942
|
+
entries.push(actions.entry);
|
9943
|
+
exits.push(actions.exit);
|
9944
|
+
}
|
9945
|
+
}
|
9946
|
+
return { entries, exits };
|
9947
|
+
});
|
9948
|
+
__publicField(this, "executeActions", (actions, event) => {
|
9949
|
+
var _a8;
|
9950
|
+
const pickedActions = determineActionsFn(actions, this.guardMap)(this.contextSnapshot, event, this.guardMeta);
|
9951
|
+
for (const action of toArray(pickedActions)) {
|
9952
|
+
const fn = isString(action) ? (_a8 = this.actionMap) == null ? void 0 : _a8[action] : action;
|
9953
|
+
warn(
|
9954
|
+
isString(action) && !fn,
|
9955
|
+
`[@zag-js/core > execute-actions] No implementation found for action: \`${action}\``
|
9956
|
+
);
|
9957
|
+
fn == null ? void 0 : fn(this.state.context, event, this.meta);
|
9958
|
+
}
|
9959
|
+
});
|
9960
|
+
__publicField(this, "executeActivities", (event, activities, state) => {
|
9961
|
+
var _a8;
|
9962
|
+
for (const activity of activities) {
|
9963
|
+
const fn = isString(activity) ? (_a8 = this.activityMap) == null ? void 0 : _a8[activity] : activity;
|
9964
|
+
if (!fn) {
|
9965
|
+
warn(`[@zag-js/core > execute-activity] No implementation found for activity: \`${activity}\``);
|
9966
|
+
continue;
|
9967
|
+
}
|
9968
|
+
const cleanup = fn(this.state.context, event, this.meta);
|
9969
|
+
if (cleanup) {
|
9970
|
+
const key = isString(activity) ? activity : activity.name || uuid();
|
9971
|
+
this.addActivityCleanup(state != null ? state : this.state.value, key, cleanup);
|
9972
|
+
}
|
9973
|
+
}
|
9974
|
+
});
|
9975
|
+
__publicField(this, "createEveryActivities", (every, callbackfn) => {
|
9976
|
+
if (!every) return;
|
9977
|
+
if (isArray(every)) {
|
9978
|
+
const picked = toArray(every).find((transition) => {
|
9979
|
+
const delayOrFn = transition.delay;
|
9980
|
+
const determineDelay2 = determineDelayFn(delayOrFn, this.delayMap);
|
9981
|
+
const delay2 = determineDelay2(this.contextSnapshot, this.state.event);
|
9982
|
+
const determineGuard = determineGuardFn(transition.guard, this.guardMap);
|
9983
|
+
const guard = determineGuard(this.contextSnapshot, this.state.event, this.guardMeta);
|
9984
|
+
return guard != null ? guard : delay2 != null;
|
9985
|
+
});
|
9986
|
+
if (!picked) return;
|
9987
|
+
const determineDelay = determineDelayFn(picked.delay, this.delayMap);
|
9988
|
+
const delay = determineDelay(this.contextSnapshot, this.state.event);
|
9989
|
+
const activity = () => {
|
9990
|
+
const id = globalThis.setInterval(() => {
|
9991
|
+
this.executeActions(picked.actions, this.state.event);
|
9992
|
+
}, delay);
|
9993
|
+
return () => {
|
9994
|
+
globalThis.clearInterval(id);
|
9995
|
+
};
|
9996
|
+
};
|
9997
|
+
callbackfn(activity);
|
9998
|
+
} else {
|
9999
|
+
for (const interval in every) {
|
10000
|
+
const actions = every == null ? void 0 : every[interval];
|
10001
|
+
const determineDelay = determineDelayFn(interval, this.delayMap);
|
10002
|
+
const delay = determineDelay(this.contextSnapshot, this.state.event);
|
10003
|
+
const activity = () => {
|
10004
|
+
const id = globalThis.setInterval(() => {
|
10005
|
+
this.executeActions(actions, this.state.event);
|
10006
|
+
}, delay);
|
10007
|
+
return () => {
|
10008
|
+
globalThis.clearInterval(id);
|
10009
|
+
};
|
10010
|
+
};
|
10011
|
+
callbackfn(activity);
|
10012
|
+
}
|
10013
|
+
}
|
10014
|
+
});
|
10015
|
+
__publicField(this, "setEvent", (event) => {
|
10016
|
+
this.state.previousEvent = this.state.event;
|
10017
|
+
this.state.event = ref(toEvent(event));
|
10018
|
+
});
|
10019
|
+
__publicField(this, "performExitEffects", (current, event) => {
|
10020
|
+
const currentState = this.state.value;
|
10021
|
+
if (currentState === "") return;
|
10022
|
+
const stateNode = current ? this.getStateNode(current) : void 0;
|
10023
|
+
this.stopActivities(currentState);
|
10024
|
+
const _exit = determineActionsFn(stateNode == null ? void 0 : stateNode.exit, this.guardMap)(this.contextSnapshot, event, this.guardMeta);
|
10025
|
+
const exitActions = toArray(_exit);
|
10026
|
+
const afterExitActions = this.delayedEvents.get(currentState);
|
10027
|
+
if (afterExitActions) {
|
10028
|
+
exitActions.push(...afterExitActions);
|
10029
|
+
}
|
10030
|
+
this.executeActions(exitActions, event);
|
10031
|
+
this.delayedEvents.delete(currentState);
|
10032
|
+
});
|
10033
|
+
__publicField(this, "performEntryEffects", (next, event) => {
|
10034
|
+
const stateNode = this.getStateNode(next);
|
10035
|
+
const activities = toArray(stateNode == null ? void 0 : stateNode.activities);
|
10036
|
+
this.createEveryActivities(stateNode == null ? void 0 : stateNode.every, (activity) => {
|
10037
|
+
activities.unshift(activity);
|
10038
|
+
});
|
10039
|
+
if (activities.length > 0) {
|
10040
|
+
this.executeActivities(event, activities);
|
10041
|
+
}
|
10042
|
+
const pickedActions = determineActionsFn(stateNode == null ? void 0 : stateNode.entry, this.guardMap)(
|
10043
|
+
this.contextSnapshot,
|
10044
|
+
event,
|
10045
|
+
this.guardMeta
|
10046
|
+
);
|
10047
|
+
const entryActions = toArray(pickedActions);
|
10048
|
+
const afterActions = this.getDelayedEventActions(next);
|
10049
|
+
if ((stateNode == null ? void 0 : stateNode.after) && afterActions) {
|
10050
|
+
this.delayedEvents.set(next, afterActions == null ? void 0 : afterActions.exits);
|
10051
|
+
entryActions.push(...afterActions.entries);
|
10052
|
+
}
|
10053
|
+
this.executeActions(entryActions, event);
|
10054
|
+
if ((stateNode == null ? void 0 : stateNode.type) === "final") {
|
10055
|
+
this.state.done = true;
|
10056
|
+
this.doneListeners.forEach((listener) => {
|
10057
|
+
listener(this.stateSnapshot);
|
10058
|
+
});
|
10059
|
+
this.stop();
|
10060
|
+
}
|
10061
|
+
});
|
10062
|
+
__publicField(this, "performTransitionEffects", (transitions, event) => {
|
10063
|
+
const transition = this.determineTransition(transitions, event);
|
10064
|
+
this.executeActions(transition == null ? void 0 : transition.actions, event);
|
10065
|
+
});
|
10066
|
+
__publicField(this, "performStateChangeEffects", (current, next, event) => {
|
10067
|
+
this.setEvent(event);
|
10068
|
+
const changed = next.changed || next.reenter;
|
10069
|
+
if (changed) {
|
10070
|
+
this.performExitEffects(current, event);
|
10071
|
+
}
|
10072
|
+
this.performTransitionEffects(next.transition, event);
|
10073
|
+
this.setState(next.target);
|
10074
|
+
if (changed) {
|
10075
|
+
this.performEntryEffects(next.target, event);
|
10076
|
+
}
|
10077
|
+
});
|
10078
|
+
__publicField(this, "determineTransition", (transition, event) => {
|
10079
|
+
const fn = determineTransitionFn(transition, this.guardMap);
|
10080
|
+
return fn == null ? void 0 : fn(this.contextSnapshot, event, this.guardMeta);
|
10081
|
+
});
|
10082
|
+
__publicField(this, "sendParent", (evt) => {
|
10083
|
+
var _a8;
|
10084
|
+
if (!this.parent) {
|
10085
|
+
invariant("[@zag-js/core > send-parent] Cannot send event to an unknown parent");
|
10086
|
+
}
|
10087
|
+
const event = toEvent(evt);
|
10088
|
+
(_a8 = this.parent) == null ? void 0 : _a8.send(event);
|
10089
|
+
});
|
10090
|
+
__publicField(this, "log", (...args) => {
|
10091
|
+
if (isDev2() && this.options.debug) {
|
10092
|
+
console.log(...args);
|
10093
|
+
}
|
10094
|
+
});
|
10095
|
+
__publicField(this, "send", (evt) => {
|
10096
|
+
const event = toEvent(evt);
|
10097
|
+
this.transition(this.state.value, event);
|
10098
|
+
});
|
10099
|
+
__publicField(this, "transition", (state, evt) => {
|
10100
|
+
var _a8, _b7, _c6;
|
10101
|
+
const stateNode = isString(state) ? this.getStateNode(state) : state == null ? void 0 : state.stateNode;
|
10102
|
+
const event = toEvent(evt);
|
10103
|
+
if (!stateNode && !this.config.on) {
|
10104
|
+
const msg = this.status === "Stopped" ? "[@zag-js/core > transition] Cannot transition a stopped machine" : `[@zag-js/core > transition] State does not have a definition for \`state\`: ${state}, \`event\`: ${event.type}`;
|
10105
|
+
warn(msg);
|
10106
|
+
return;
|
10107
|
+
}
|
10108
|
+
const transitions = (
|
10109
|
+
// @ts-expect-error - Fix this
|
10110
|
+
(_c6 = (_a8 = stateNode == null ? void 0 : stateNode.on) == null ? void 0 : _a8[event.type]) != null ? _c6 : (_b7 = this.config.on) == null ? void 0 : _b7[event.type]
|
10111
|
+
);
|
10112
|
+
const next = this.getNextStateInfo(transitions, event);
|
10113
|
+
this.performStateChangeEffects(this.state.value, next, event);
|
10114
|
+
return next.stateNode;
|
10115
|
+
});
|
10116
|
+
__publicField(this, "subscribe", (listener) => {
|
10117
|
+
this.stateListeners.add(listener);
|
10118
|
+
if (this.status === "Running") {
|
10119
|
+
listener(this.stateSnapshot);
|
10120
|
+
}
|
10121
|
+
return () => {
|
10122
|
+
this.stateListeners.delete(listener);
|
10123
|
+
};
|
10124
|
+
});
|
10125
|
+
__publicField(this, "onDone", (listener) => {
|
10126
|
+
this.doneListeners.add(listener);
|
10127
|
+
return this;
|
10128
|
+
});
|
10129
|
+
__publicField(this, "onTransition", (listener) => {
|
10130
|
+
this.stateListeners.add(listener);
|
10131
|
+
if (this.status === "Running") {
|
10132
|
+
listener(this.stateSnapshot);
|
10133
|
+
}
|
10134
|
+
return this;
|
10135
|
+
});
|
10136
|
+
this.config = structuredClone(config);
|
10137
|
+
this.options = structuredClone(options != null ? options : {});
|
10138
|
+
this.id = (_a7 = this.config.id) != null ? _a7 : `machine-${uuid()}`;
|
10139
|
+
this.guardMap = (_c5 = (_b6 = this.options) == null ? void 0 : _b6.guards) != null ? _c5 : {};
|
10140
|
+
this.actionMap = (_e5 = (_d5 = this.options) == null ? void 0 : _d5.actions) != null ? _e5 : {};
|
10141
|
+
this.delayMap = (_g5 = (_f5 = this.options) == null ? void 0 : _f5.delays) != null ? _g5 : {};
|
10142
|
+
this.activityMap = (_i3 = (_h3 = this.options) == null ? void 0 : _h3.activities) != null ? _i3 : {};
|
10143
|
+
this.sync = (_k3 = (_j3 = this.options) == null ? void 0 : _j3.sync) != null ? _k3 : false;
|
10144
|
+
this.state = createProxy2(this.config);
|
10145
|
+
this.initialContext = snapshot(this.state.context);
|
10146
|
+
}
|
10147
|
+
// immutable state value
|
10148
|
+
get stateSnapshot() {
|
10149
|
+
return cast(snapshot(this.state));
|
10150
|
+
}
|
10151
|
+
getState() {
|
10152
|
+
return this.stateSnapshot;
|
10153
|
+
}
|
10154
|
+
// immutable context value
|
10155
|
+
get contextSnapshot() {
|
10156
|
+
return this.stateSnapshot.context;
|
10157
|
+
}
|
10158
|
+
/**
|
10159
|
+
* A reference to the instance methods of the machine.
|
10160
|
+
* Useful when spawning child machines and managing the communication between them.
|
10161
|
+
*/
|
10162
|
+
get self() {
|
10163
|
+
const self2 = this;
|
10164
|
+
return {
|
10165
|
+
id: this.id,
|
10166
|
+
send: this.send.bind(this),
|
10167
|
+
sendParent: this.sendParent.bind(this),
|
10168
|
+
sendChild: this.sendChild.bind(this),
|
10169
|
+
stop: this.stop.bind(this),
|
10170
|
+
stopChild: this.stopChild.bind(this),
|
10171
|
+
spawn: this.spawn.bind(this),
|
10172
|
+
stopActivity: this.stopActivity.bind(this),
|
10173
|
+
get state() {
|
10174
|
+
return self2.stateSnapshot;
|
10175
|
+
},
|
10176
|
+
get initialContext() {
|
10177
|
+
return self2.initialContext;
|
10178
|
+
},
|
10179
|
+
get initialState() {
|
10180
|
+
var _a7, _b6;
|
10181
|
+
return (_b6 = (_a7 = self2.initialState) == null ? void 0 : _a7.target) != null ? _b6 : "";
|
10182
|
+
}
|
10183
|
+
};
|
10184
|
+
}
|
10185
|
+
get meta() {
|
10186
|
+
var _a7, _b6;
|
10187
|
+
return {
|
10188
|
+
state: this.stateSnapshot,
|
10189
|
+
guards: this.guardMap,
|
10190
|
+
send: this.send.bind(this),
|
10191
|
+
self: this.self,
|
10192
|
+
initialContext: this.initialContext,
|
10193
|
+
initialState: (_b6 = (_a7 = this.initialState) == null ? void 0 : _a7.target) != null ? _b6 : "",
|
10194
|
+
getState: () => this.stateSnapshot,
|
10195
|
+
getAction: (key) => this.actionMap[key],
|
10196
|
+
getGuard: (key) => this.guardMap[key]
|
10197
|
+
};
|
10198
|
+
}
|
10199
|
+
get guardMeta() {
|
10200
|
+
return {
|
10201
|
+
state: this.stateSnapshot
|
10202
|
+
};
|
10203
|
+
}
|
10204
|
+
get [Symbol.toStringTag]() {
|
10205
|
+
return "Machine";
|
10206
|
+
}
|
10207
|
+
getHydrationState() {
|
10208
|
+
const state = this.getState();
|
10209
|
+
return {
|
10210
|
+
value: state.value,
|
10211
|
+
tags: state.tags
|
10212
|
+
};
|
10213
|
+
}
|
10214
|
+
};
|
10215
|
+
var createMachine = (config, options) => new Machine(config, options);
|
10216
|
+
var clsx = (...args) => args.map((str) => {
|
10217
|
+
var _a7;
|
10218
|
+
return (_a7 = str == null ? void 0 : str.trim) == null ? void 0 : _a7.call(str);
|
10219
|
+
}).filter(Boolean).join(" ");
|
10220
|
+
var CSS_REGEX = /((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;
|
10221
|
+
var serialize = (style) => {
|
10222
|
+
const res = {};
|
10223
|
+
let match;
|
10224
|
+
while (match = CSS_REGEX.exec(style)) {
|
10225
|
+
res[match[1]] = match[2];
|
10226
|
+
}
|
10227
|
+
return res;
|
10228
|
+
};
|
10229
|
+
var css = (a, b) => {
|
10230
|
+
if (isString(a)) {
|
10231
|
+
if (isString(b)) return `${a};${b}`;
|
10232
|
+
a = serialize(a);
|
10233
|
+
} else if (isString(b)) {
|
10234
|
+
b = serialize(b);
|
10235
|
+
}
|
10236
|
+
return Object.assign({}, a != null ? a : {}, b != null ? b : {});
|
10237
|
+
};
|
10238
|
+
function mergeProps(...args) {
|
10239
|
+
let result = {};
|
10240
|
+
for (let props2 of args) {
|
10241
|
+
for (let key in result) {
|
10242
|
+
if (key.startsWith("on") && typeof result[key] === "function" && typeof props2[key] === "function") {
|
10243
|
+
result[key] = callAll(props2[key], result[key]);
|
10244
|
+
continue;
|
10245
|
+
}
|
10246
|
+
if (key === "className" || key === "class") {
|
10247
|
+
result[key] = clsx(result[key], props2[key]);
|
10248
|
+
continue;
|
10249
|
+
}
|
10250
|
+
if (key === "style") {
|
10251
|
+
result[key] = css(result[key], props2[key]);
|
10252
|
+
continue;
|
10253
|
+
}
|
10254
|
+
result[key] = props2[key] !== void 0 ? props2[key] : result[key];
|
10255
|
+
}
|
10256
|
+
for (let key in props2) {
|
10257
|
+
if (result[key] === void 0) {
|
10258
|
+
result[key] = props2[key];
|
10259
|
+
}
|
10260
|
+
}
|
10261
|
+
}
|
10262
|
+
return result;
|
10263
|
+
}
|
10264
|
+
|
10265
|
+
// ../../node_modules/@zag-js/types/dist/index.mjs
|
10266
|
+
function createNormalizer(fn) {
|
10267
|
+
return new Proxy({}, {
|
10268
|
+
get() {
|
10269
|
+
return fn;
|
10270
|
+
}
|
10271
|
+
});
|
10272
|
+
}
|
10273
|
+
var createProps = () => (props2) => Array.from(new Set(props2));
|
10274
|
+
|
10275
|
+
// ../../node_modules/@zag-js/react/dist/index.mjs
|
10276
|
+
var import_react115 = __toESM(require("react"), 1);
|
10277
|
+
var import_react_dom = require("react-dom");
|
10278
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
10279
|
+
var normalizeProps = createNormalizer((v) => v);
|
10280
|
+
var isArrayLike = (value) => (value == null ? void 0 : value.constructor.name) === "Array";
|
10281
|
+
var isArrayEqual = (a, b) => {
|
10282
|
+
if (a.length !== b.length) return false;
|
10283
|
+
for (let i = 0; i < a.length; i++) {
|
10284
|
+
if (!isEqual(a[i], b[i])) return false;
|
10285
|
+
}
|
10286
|
+
return true;
|
10287
|
+
};
|
10288
|
+
var isEqual = (a, b) => {
|
10289
|
+
if (Object.is(a, b)) return true;
|
10290
|
+
if (a == null && b != null || a != null && b == null) return false;
|
10291
|
+
if (typeof (a == null ? void 0 : a.isEqual) === "function" && typeof (b == null ? void 0 : b.isEqual) === "function") {
|
10292
|
+
return a.isEqual(b);
|
10293
|
+
}
|
10294
|
+
if (typeof a === "function" && typeof b === "function") {
|
10295
|
+
return a.toString() === b.toString();
|
10296
|
+
}
|
10297
|
+
if (isArrayLike(a) && isArrayLike(b)) {
|
10298
|
+
return isArrayEqual(Array.from(a), Array.from(b));
|
10299
|
+
}
|
10300
|
+
if (!(typeof a === "object") || !(typeof b === "object")) return false;
|
10301
|
+
const keys = Object.keys(b != null ? b : /* @__PURE__ */ Object.create(null));
|
10302
|
+
const length = keys.length;
|
10303
|
+
for (let i = 0; i < length; i++) {
|
10304
|
+
const hasKey = Reflect.has(a, keys[i]);
|
10305
|
+
if (!hasKey) return false;
|
10306
|
+
}
|
10307
|
+
for (let i = 0; i < length; i++) {
|
10308
|
+
const key = keys[i];
|
10309
|
+
if (!isEqual(a[key], b[key])) return false;
|
10310
|
+
}
|
10311
|
+
return true;
|
10312
|
+
};
|
10313
|
+
var isDev3 = () => process.env.NODE_ENV !== "production";
|
10314
|
+
var fnToString2 = Function.prototype.toString;
|
10315
|
+
fnToString2.call(Object);
|
10316
|
+
function compact2(obj) {
|
10317
|
+
if (!isPlainObject3(obj) || obj === void 0) {
|
10318
|
+
return obj;
|
10319
|
+
}
|
10320
|
+
const keys = Reflect.ownKeys(obj).filter((key) => typeof key === "string");
|
10321
|
+
const filtered = {};
|
10322
|
+
for (const key of keys) {
|
10323
|
+
const value = obj[key];
|
10324
|
+
if (value !== void 0) {
|
10325
|
+
filtered[key] = compact2(value);
|
10326
|
+
}
|
10327
|
+
}
|
10328
|
+
return filtered;
|
10329
|
+
}
|
10330
|
+
var isPlainObject3 = (value) => {
|
10331
|
+
return value && typeof value === "object" && value.constructor === Object;
|
10332
|
+
};
|
10333
|
+
function useUpdateEffect(callback, deps) {
|
10334
|
+
const render = (0, import_react115.useRef)(false);
|
10335
|
+
const effect = (0, import_react115.useRef)(false);
|
10336
|
+
(0, import_react115.useEffect)(() => {
|
10337
|
+
const mounted = render.current;
|
10338
|
+
const run = mounted && effect.current;
|
10339
|
+
if (run) {
|
10340
|
+
return callback();
|
10341
|
+
}
|
10342
|
+
effect.current = true;
|
10343
|
+
}, deps);
|
10344
|
+
(0, import_react115.useEffect)(() => {
|
10345
|
+
render.current = true;
|
10346
|
+
return () => {
|
10347
|
+
render.current = false;
|
10348
|
+
};
|
10349
|
+
}, []);
|
10350
|
+
}
|
10351
|
+
var { use } = import_react115.default;
|
10352
|
+
var targetCache = makeGlobal("__zag__targetCache", () => /* @__PURE__ */ new WeakMap());
|
10353
|
+
function useSnapshot(service, options) {
|
10354
|
+
const { actions, context, sync: notifyInSync } = options != null ? options : {};
|
10355
|
+
const lastSnapshot = (0, import_react115.useRef)();
|
10356
|
+
const lastAffected = (0, import_react115.useRef)();
|
10357
|
+
const currSnapshot = (0, import_react115.useSyncExternalStore)(
|
10358
|
+
(0, import_react115.useCallback)((callback) => subscribe(service.state, callback, notifyInSync), [notifyInSync]),
|
10359
|
+
() => {
|
10360
|
+
const nextSnapshot = snapshot(service.state, use);
|
10361
|
+
try {
|
10362
|
+
if (lastSnapshot.current && lastAffected.current && !isChanged(lastSnapshot.current, nextSnapshot, lastAffected.current, /* @__PURE__ */ new WeakMap())) {
|
10363
|
+
return lastSnapshot.current;
|
10364
|
+
}
|
10365
|
+
} catch {
|
10366
|
+
}
|
10367
|
+
return nextSnapshot;
|
10368
|
+
},
|
10369
|
+
() => snapshot(service.state, use)
|
10370
|
+
);
|
10371
|
+
service.setOptions({ actions });
|
10372
|
+
const ctx = (0, import_react115.useMemo)(() => compact2(context != null ? context : {}), [context]);
|
10373
|
+
useUpdateEffect(() => {
|
10374
|
+
var _a7;
|
10375
|
+
const entries = Object.entries(ctx);
|
10376
|
+
const previousCtx = (_a7 = service.contextSnapshot) != null ? _a7 : {};
|
10377
|
+
const equality = entries.map(([key, value]) => ({
|
10378
|
+
key,
|
10379
|
+
curr: value,
|
10380
|
+
prev: previousCtx[key],
|
10381
|
+
equal: isEqual(previousCtx[key], value)
|
10382
|
+
}));
|
10383
|
+
const allEqual = equality.every(({ equal }) => equal);
|
10384
|
+
if (!allEqual) {
|
10385
|
+
service.setContext(ctx);
|
10386
|
+
}
|
10387
|
+
}, [ctx]);
|
10388
|
+
const currAffected = /* @__PURE__ */ new WeakMap();
|
10389
|
+
(0, import_react115.useEffect)(() => {
|
10390
|
+
lastSnapshot.current = currSnapshot;
|
10391
|
+
lastAffected.current = currAffected;
|
10392
|
+
});
|
10393
|
+
const proxyCache = (0, import_react115.useMemo)(() => /* @__PURE__ */ new WeakMap(), []);
|
10394
|
+
return createProxy(currSnapshot, currAffected, proxyCache, targetCache);
|
10395
|
+
}
|
10396
|
+
function useConstant(fn) {
|
10397
|
+
const ref2 = (0, import_react115.useRef)();
|
10398
|
+
if (!ref2.current) ref2.current = { v: fn() };
|
10399
|
+
return ref2.current.v;
|
10400
|
+
}
|
10401
|
+
var useSafeLayoutEffect = typeof document !== "undefined" ? import_react115.useLayoutEffect : import_react115.useEffect;
|
10402
|
+
function useService(machine2, options) {
|
10403
|
+
const { state: hydratedState, context } = options != null ? options : {};
|
10404
|
+
const service = useConstant(() => {
|
10405
|
+
const instance = typeof machine2 === "function" ? machine2() : machine2;
|
10406
|
+
if (context) instance.setContext(context);
|
10407
|
+
instance._created();
|
10408
|
+
return instance;
|
10409
|
+
});
|
10410
|
+
const snapshotRef = (0, import_react115.useRef)();
|
10411
|
+
useSafeLayoutEffect(() => {
|
10412
|
+
const stateInit = hydratedState != null ? hydratedState : snapshotRef.current;
|
10413
|
+
service.start(stateInit);
|
10414
|
+
return () => {
|
10415
|
+
if (isDev3()) {
|
10416
|
+
snapshotRef.current = service.getHydrationState();
|
10417
|
+
}
|
10418
|
+
service.stop();
|
10419
|
+
};
|
10420
|
+
}, []);
|
10421
|
+
return service;
|
10422
|
+
}
|
10423
|
+
function useMachine(machine2, options) {
|
10424
|
+
const service = useService(machine2, options);
|
10425
|
+
const state = useSnapshot(service, options);
|
10426
|
+
return [state, service.send, service];
|
10427
|
+
}
|
10428
|
+
|
10429
|
+
// ../../node_modules/@ark-ui/react/dist/utils/compose-refs.js
|
10430
|
+
function setRef(ref2, value) {
|
10431
|
+
if (typeof ref2 === "function") {
|
10432
|
+
ref2(value);
|
10433
|
+
} else if (ref2 !== null && ref2 !== void 0) {
|
10434
|
+
ref2.current = value;
|
10435
|
+
}
|
10436
|
+
}
|
10437
|
+
function composeRefs(...refs) {
|
10438
|
+
return (node) => {
|
10439
|
+
for (const ref2 of refs) {
|
10440
|
+
setRef(ref2, node);
|
10441
|
+
}
|
10442
|
+
};
|
10443
|
+
}
|
10444
|
+
|
10445
|
+
// ../../node_modules/@ark-ui/react/dist/utils/create-context.js
|
10446
|
+
var import_react116 = require("react");
|
10447
|
+
function getErrorMessage(hook, provider) {
|
10448
|
+
return `${hook} returned \`undefined\`. Seems you forgot to wrap component within ${provider}`;
|
10449
|
+
}
|
10450
|
+
function createContext2(options = {}) {
|
10451
|
+
const {
|
10452
|
+
name,
|
10453
|
+
strict = true,
|
10454
|
+
hookName = "useContext",
|
10455
|
+
providerName = "Provider",
|
10456
|
+
errorMessage,
|
10457
|
+
defaultValue
|
10458
|
+
} = options;
|
10459
|
+
const Context = (0, import_react116.createContext)(defaultValue);
|
10460
|
+
Context.displayName = name;
|
10461
|
+
function useContext$1() {
|
10462
|
+
var _a7;
|
10463
|
+
const context = (0, import_react116.useContext)(Context);
|
10464
|
+
if (!context && strict) {
|
10465
|
+
const error = new Error(errorMessage != null ? errorMessage : getErrorMessage(hookName, providerName));
|
10466
|
+
error.name = "ContextError";
|
10467
|
+
(_a7 = Error.captureStackTrace) == null ? void 0 : _a7.call(Error, error, useContext$1);
|
10468
|
+
throw error;
|
10469
|
+
}
|
10470
|
+
return context;
|
10471
|
+
}
|
10472
|
+
return [Context.Provider, useContext$1, Context];
|
10473
|
+
}
|
10474
|
+
|
10475
|
+
// ../../node_modules/@ark-ui/react/dist/utils/create-split-props.js
|
10476
|
+
var createSplitProps = () => (props2, keys) => keys.reduce(
|
10477
|
+
(previousValue, currentValue) => {
|
10478
|
+
const [target, source] = previousValue;
|
10479
|
+
const key = currentValue;
|
10480
|
+
if (source[key] !== void 0) {
|
10481
|
+
target[key] = source[key];
|
10482
|
+
}
|
10483
|
+
delete source[key];
|
10484
|
+
return [target, source];
|
10485
|
+
},
|
10486
|
+
[{}, { ...props2 }]
|
10487
|
+
);
|
10488
|
+
|
10489
|
+
// ../../node_modules/@ark-ui/react/dist/components/factory.js
|
10490
|
+
var import_react117 = require("react");
|
10491
|
+
function getRef(element) {
|
10492
|
+
var _a7, _b6;
|
10493
|
+
let getter = (_a7 = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a7.get;
|
10494
|
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
10495
|
+
if (mayWarn) {
|
10496
|
+
return element.ref;
|
10497
|
+
}
|
10498
|
+
getter = (_b6 = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b6.get;
|
10499
|
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
10500
|
+
if (mayWarn) {
|
10501
|
+
return element.props.ref;
|
10502
|
+
}
|
10503
|
+
return element.props.ref || element.ref;
|
10504
|
+
}
|
10505
|
+
var withAsChild = (Component) => {
|
10506
|
+
const Comp = (0, import_react117.memo)(
|
10507
|
+
(0, import_react117.forwardRef)((props2, ref2) => {
|
10508
|
+
const { asChild, children, ...restProps } = props2;
|
10509
|
+
if (!asChild) {
|
10510
|
+
return (0, import_react117.createElement)(Component, { ...restProps, ref: ref2 }, children);
|
10511
|
+
}
|
10512
|
+
const onlyChild = import_react117.Children.only(children);
|
10513
|
+
if (!(0, import_react117.isValidElement)(onlyChild)) {
|
10514
|
+
return null;
|
10515
|
+
}
|
10516
|
+
const childRef = getRef(onlyChild);
|
10517
|
+
return (0, import_react117.cloneElement)(onlyChild, {
|
10518
|
+
...mergeProps(restProps, onlyChild.props),
|
10519
|
+
ref: ref2 ? composeRefs(ref2, childRef) : childRef
|
10520
|
+
});
|
10521
|
+
})
|
10522
|
+
);
|
10523
|
+
Comp.displayName = Component.displayName || Component.name;
|
10524
|
+
return Comp;
|
10525
|
+
};
|
10526
|
+
var jsxFactory = () => {
|
10527
|
+
const cache = /* @__PURE__ */ new Map();
|
10528
|
+
return new Proxy(withAsChild, {
|
10529
|
+
apply(_target, _thisArg, argArray) {
|
10530
|
+
return withAsChild(argArray[0]);
|
10531
|
+
},
|
10532
|
+
get(_, element) {
|
10533
|
+
const asElement = element;
|
10534
|
+
if (!cache.has(asElement)) {
|
10535
|
+
cache.set(asElement, withAsChild(asElement));
|
10536
|
+
}
|
10537
|
+
return cache.get(asElement);
|
10538
|
+
}
|
10539
|
+
});
|
10540
|
+
};
|
10541
|
+
var ark = jsxFactory();
|
10542
|
+
|
10543
|
+
// ../../node_modules/@zag-js/presence/dist/index.mjs
|
10544
|
+
function connect(state, send, _normalize) {
|
10545
|
+
const present = state.matches("mounted", "unmountSuspended");
|
10546
|
+
return {
|
10547
|
+
skip: !state.context.initial && present,
|
10548
|
+
present,
|
10549
|
+
setNode(node) {
|
10550
|
+
if (!node) return;
|
10551
|
+
send({ type: "NODE.SET", node });
|
10552
|
+
},
|
10553
|
+
unmount() {
|
10554
|
+
send({ type: "UNMOUNT" });
|
10555
|
+
}
|
10556
|
+
};
|
10557
|
+
}
|
10558
|
+
function machine(ctx) {
|
10559
|
+
return createMachine(
|
10560
|
+
{
|
10561
|
+
initial: ctx.present ? "mounted" : "unmounted",
|
10562
|
+
context: {
|
10563
|
+
node: null,
|
10564
|
+
styles: null,
|
10565
|
+
unmountAnimationName: null,
|
10566
|
+
prevAnimationName: null,
|
10567
|
+
present: false,
|
10568
|
+
initial: false,
|
10569
|
+
...ctx
|
10570
|
+
},
|
10571
|
+
exit: ["clearInitial"],
|
10572
|
+
watch: {
|
10573
|
+
present: ["setInitial", "syncPresence"]
|
10574
|
+
},
|
10575
|
+
on: {
|
10576
|
+
"NODE.SET": {
|
10577
|
+
actions: ["setNode", "setStyles"]
|
10578
|
+
}
|
10579
|
+
},
|
10580
|
+
states: {
|
10581
|
+
mounted: {
|
10582
|
+
on: {
|
10583
|
+
UNMOUNT: {
|
10584
|
+
target: "unmounted",
|
10585
|
+
actions: ["invokeOnExitComplete"]
|
10586
|
+
},
|
10587
|
+
"UNMOUNT.SUSPEND": "unmountSuspended"
|
10588
|
+
}
|
10589
|
+
},
|
10590
|
+
unmountSuspended: {
|
10591
|
+
activities: ["trackAnimationEvents"],
|
10592
|
+
after: {
|
10593
|
+
// Fallback to timeout to ensure we exit this state even if the `animationend` event
|
10594
|
+
// did not get trigger
|
10595
|
+
ANIMATION_DURATION: {
|
10596
|
+
target: "unmounted",
|
10597
|
+
actions: ["invokeOnExitComplete"]
|
10598
|
+
}
|
10599
|
+
},
|
10600
|
+
on: {
|
10601
|
+
MOUNT: {
|
10602
|
+
target: "mounted",
|
10603
|
+
actions: ["setPrevAnimationName"]
|
10604
|
+
},
|
10605
|
+
UNMOUNT: {
|
10606
|
+
target: "unmounted",
|
10607
|
+
actions: ["invokeOnExitComplete"]
|
10608
|
+
}
|
10609
|
+
}
|
10610
|
+
},
|
10611
|
+
unmounted: {
|
10612
|
+
entry: ["clearPrevAnimationName"],
|
10613
|
+
on: {
|
10614
|
+
MOUNT: {
|
10615
|
+
target: "mounted",
|
10616
|
+
actions: ["setPrevAnimationName"]
|
10617
|
+
}
|
10618
|
+
}
|
10619
|
+
}
|
10620
|
+
}
|
10621
|
+
},
|
10622
|
+
{
|
10623
|
+
delays: {
|
10624
|
+
ANIMATION_DURATION(ctx2) {
|
10625
|
+
var _a7, _b6;
|
10626
|
+
return parseMs((_a7 = ctx2.styles) == null ? void 0 : _a7.animationDuration) + parseMs((_b6 = ctx2.styles) == null ? void 0 : _b6.animationDelay) + ANIMATION_TIMEOUT_MARGIN;
|
10627
|
+
}
|
10628
|
+
},
|
10629
|
+
actions: {
|
10630
|
+
setInitial(ctx2) {
|
10631
|
+
ctx2.initial = true;
|
10632
|
+
},
|
10633
|
+
clearInitial(ctx2) {
|
10634
|
+
ctx2.initial = false;
|
10635
|
+
},
|
10636
|
+
invokeOnExitComplete(ctx2) {
|
10637
|
+
var _a7;
|
10638
|
+
(_a7 = ctx2.onExitComplete) == null ? void 0 : _a7.call(ctx2);
|
10639
|
+
},
|
10640
|
+
setNode(ctx2, evt) {
|
10641
|
+
ctx2.node = ref(evt.node);
|
10642
|
+
},
|
10643
|
+
setStyles(ctx2, evt) {
|
10644
|
+
const win = evt.node.ownerDocument.defaultView || window;
|
10645
|
+
ctx2.styles = ref(win.getComputedStyle(evt.node));
|
10646
|
+
},
|
10647
|
+
syncPresence(ctx2, _evt, { send }) {
|
10648
|
+
var _a7;
|
10649
|
+
if (ctx2.present) {
|
10650
|
+
send({ type: "MOUNT", src: "presence.changed" });
|
10651
|
+
return;
|
10652
|
+
}
|
10653
|
+
if (!ctx2.present && ((_a7 = ctx2.node) == null ? void 0 : _a7.ownerDocument.visibilityState) === "hidden") {
|
10654
|
+
send({ type: "UNMOUNT", src: "visibilitychange" });
|
10655
|
+
return;
|
10656
|
+
}
|
10657
|
+
const animationName = getAnimationName(ctx2.styles);
|
10658
|
+
const exec = ctx2.immediate ? queueMicrotask : requestAnimationFrame;
|
10659
|
+
exec(() => {
|
10660
|
+
var _a8, _b6;
|
10661
|
+
ctx2.unmountAnimationName = animationName;
|
10662
|
+
if (animationName === "none" || animationName === ctx2.prevAnimationName || ((_a8 = ctx2.styles) == null ? void 0 : _a8.display) === "none" || ((_b6 = ctx2.styles) == null ? void 0 : _b6.animationDuration) === "0s") {
|
10663
|
+
send({ type: "UNMOUNT", src: "presence.changed" });
|
10664
|
+
} else {
|
10665
|
+
send({ type: "UNMOUNT.SUSPEND" });
|
10666
|
+
}
|
10667
|
+
});
|
10668
|
+
},
|
10669
|
+
setPrevAnimationName(ctx2) {
|
10670
|
+
const exec = ctx2.immediate ? queueMicrotask : requestAnimationFrame;
|
10671
|
+
exec(() => {
|
10672
|
+
ctx2.prevAnimationName = getAnimationName(ctx2.styles);
|
10673
|
+
});
|
10674
|
+
},
|
10675
|
+
clearPrevAnimationName(ctx2) {
|
10676
|
+
ctx2.prevAnimationName = null;
|
10677
|
+
}
|
10678
|
+
},
|
10679
|
+
activities: {
|
10680
|
+
trackAnimationEvents(ctx2, _evt, { send }) {
|
10681
|
+
const node = ctx2.node;
|
10682
|
+
if (!node) return;
|
10683
|
+
const onStart = (event) => {
|
10684
|
+
var _a7, _b6, _c5;
|
10685
|
+
const target = (_c5 = (_b6 = (_a7 = event.composedPath) == null ? void 0 : _a7.call(event)) == null ? void 0 : _b6[0]) != null ? _c5 : event.target;
|
10686
|
+
if (target === node) {
|
10687
|
+
ctx2.prevAnimationName = getAnimationName(ctx2.styles);
|
10688
|
+
}
|
10689
|
+
};
|
10690
|
+
const onEnd = (event) => {
|
10691
|
+
var _a7, _b6, _c5;
|
10692
|
+
const animationName = getAnimationName(ctx2.styles);
|
10693
|
+
const target = (_c5 = (_b6 = (_a7 = event.composedPath) == null ? void 0 : _a7.call(event)) == null ? void 0 : _b6[0]) != null ? _c5 : event.target;
|
10694
|
+
if (target === node && animationName === ctx2.unmountAnimationName) {
|
10695
|
+
send({ type: "UNMOUNT", src: "animationend" });
|
10696
|
+
}
|
10697
|
+
};
|
10698
|
+
node.addEventListener("animationstart", onStart);
|
10699
|
+
node.addEventListener("animationcancel", onEnd);
|
10700
|
+
node.addEventListener("animationend", onEnd);
|
10701
|
+
return () => {
|
10702
|
+
node.removeEventListener("animationstart", onStart);
|
10703
|
+
node.removeEventListener("animationcancel", onEnd);
|
10704
|
+
node.removeEventListener("animationend", onEnd);
|
10705
|
+
};
|
10706
|
+
}
|
10707
|
+
}
|
10708
|
+
}
|
10709
|
+
);
|
10710
|
+
}
|
10711
|
+
function getAnimationName(styles) {
|
10712
|
+
return (styles == null ? void 0 : styles.animationName) || "none";
|
10713
|
+
}
|
10714
|
+
function parseMs(value) {
|
10715
|
+
return parseFloat(value || "0") * 1e3;
|
10716
|
+
}
|
10717
|
+
var ANIMATION_TIMEOUT_MARGIN = 16.667;
|
10718
|
+
var props = createProps()(["onExitComplete", "present", "immediate"]);
|
10719
|
+
|
10720
|
+
// ../../node_modules/@ark-ui/react/dist/components/presence/use-presence.js
|
10721
|
+
var import_react120 = require("react");
|
10722
|
+
|
10723
|
+
// ../../node_modules/@ark-ui/react/dist/utils/use-event.js
|
10724
|
+
var import_react118 = require("react");
|
10725
|
+
function useEvent(callback, opts = {}) {
|
10726
|
+
const { sync = false } = opts;
|
10727
|
+
const callbackRef = useLatestRef(callback);
|
10728
|
+
return (0, import_react118.useCallback)(
|
10729
|
+
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
10730
|
+
(...args) => {
|
10731
|
+
var _a7;
|
10732
|
+
if (sync) return queueMicrotask(() => {
|
10733
|
+
var _a8;
|
10734
|
+
return (_a8 = callbackRef.current) == null ? void 0 : _a8.call(callbackRef, ...args);
|
10735
|
+
});
|
10736
|
+
return (_a7 = callbackRef.current) == null ? void 0 : _a7.call(callbackRef, ...args);
|
10737
|
+
},
|
10738
|
+
[sync, callbackRef]
|
10739
|
+
);
|
10740
|
+
}
|
10741
|
+
function useLatestRef(value) {
|
10742
|
+
const ref2 = (0, import_react118.useRef)(value);
|
10743
|
+
ref2.current = value;
|
10744
|
+
return ref2;
|
10745
|
+
}
|
10746
|
+
|
10747
|
+
// ../../node_modules/@ark-ui/react/dist/components/presence/use-presence.js
|
10748
|
+
var usePresence = (props2) => {
|
10749
|
+
const { lazyMount, unmountOnExit, ...rest } = props2;
|
10750
|
+
const wasEverPresent = (0, import_react120.useRef)(false);
|
10751
|
+
const context = {
|
10752
|
+
...rest,
|
10753
|
+
onExitComplete: useEvent(props2.onExitComplete)
|
10754
|
+
};
|
10755
|
+
const [state, send] = useMachine(machine(context), { context });
|
10756
|
+
const api = connect(state, send, normalizeProps);
|
10757
|
+
if (api.present) {
|
10758
|
+
wasEverPresent.current = true;
|
10759
|
+
}
|
10760
|
+
const unmounted = !api.present && !wasEverPresent.current && lazyMount || unmountOnExit && !api.present && wasEverPresent.current;
|
10761
|
+
const getPresenceProps = () => ({
|
10762
|
+
"data-state": props2.present ? "open" : "closed",
|
10763
|
+
hidden: !api.present
|
10764
|
+
});
|
10765
|
+
return {
|
10766
|
+
ref: api.setNode,
|
10767
|
+
getPresenceProps,
|
10768
|
+
present: api.present,
|
10769
|
+
unmounted
|
10770
|
+
};
|
10771
|
+
};
|
10772
|
+
|
10773
|
+
// ../../node_modules/@ark-ui/react/dist/components/dialog/use-dialog-context.js
|
10774
|
+
var [DialogProvider, useDialogContext] = createContext2({
|
10775
|
+
name: "DialogContext",
|
10776
|
+
hookName: "useDialogContext",
|
10777
|
+
providerName: "<DialogProvider />"
|
10778
|
+
});
|
10779
|
+
|
10780
|
+
// ../../node_modules/@ark-ui/react/dist/components/dialog/dialog-context.js
|
10781
|
+
var DialogContext = (props2) => props2.children(useDialogContext());
|
10782
|
+
|
10783
|
+
// ../../node_modules/@ark-ui/react/dist/components/presence/split-presence-props.js
|
10784
|
+
var splitPresenceProps = (props2) => createSplitProps()(props2, [
|
10785
|
+
"immediate",
|
10786
|
+
"lazyMount",
|
10787
|
+
"onExitComplete",
|
10788
|
+
"present",
|
10789
|
+
"unmountOnExit"
|
10790
|
+
]);
|
10791
|
+
|
10792
|
+
// src/components/dialog/dialog.tsx
|
10793
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
10794
|
+
var DialogContent = (0, import_react121.forwardRef)(
|
10795
|
+
function DialogContent2(props2, ref2) {
|
10796
|
+
const {
|
10797
|
+
children,
|
10798
|
+
portalled = true,
|
10799
|
+
portalRef,
|
10800
|
+
backdrop = true,
|
10801
|
+
...rest
|
10802
|
+
} = props2;
|
10803
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react122.Portal, { disabled: !portalled, container: portalRef, children: [
|
10804
|
+
backdrop && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react122.Dialog.Backdrop, {}),
|
10805
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react122.Dialog.Positioner, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react122.Dialog.Content, { ref: ref2, ...rest, asChild: false, children }) })
|
10806
|
+
] });
|
10807
|
+
}
|
10808
|
+
);
|
10809
|
+
var DialogCloseTrigger = (0, import_react121.forwardRef)(function DialogCloseTrigger2(props2, ref2) {
|
10810
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
10811
|
+
import_react122.Dialog.CloseTrigger,
|
10812
|
+
{
|
10813
|
+
position: "absolute",
|
10814
|
+
top: "2",
|
10815
|
+
insetEnd: "2",
|
10816
|
+
...props2,
|
10817
|
+
asChild: true,
|
10818
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CloseButton, { size: "sm", ref: ref2, children: props2.children })
|
10819
|
+
}
|
10820
|
+
);
|
10821
|
+
});
|
10822
|
+
var DialogRoot = import_react122.Dialog.Root;
|
10823
|
+
var DialogFooter = import_react122.Dialog.Footer;
|
10824
|
+
var DialogHeader = import_react122.Dialog.Header;
|
10825
|
+
var DialogBody = import_react122.Dialog.Body;
|
10826
|
+
var DialogBackdrop = import_react122.Dialog.Backdrop;
|
10827
|
+
var DialogTitle = import_react122.Dialog.Title;
|
10828
|
+
var DialogDescription = import_react122.Dialog.Description;
|
10829
|
+
var DialogTrigger = import_react122.Dialog.Trigger;
|
10830
|
+
var DialogActionTrigger = import_react122.Dialog.ActionTrigger;
|
10831
|
+
|
10832
|
+
// src/components/drawer/namespace.ts
|
10833
|
+
var namespace_exports3 = {};
|
10834
|
+
__export(namespace_exports3, {
|
10835
|
+
ActionTrigger: () => DrawerActionTrigger,
|
10836
|
+
Backdrop: () => DrawerBackdrop,
|
10837
|
+
Body: () => DrawerBody,
|
10838
|
+
CloseTrigger: () => DrawerCloseTrigger,
|
10839
|
+
Content: () => DrawerContent,
|
10840
|
+
Context: () => DrawerContext,
|
10841
|
+
Description: () => DrawerDescription,
|
10842
|
+
Footer: () => DrawerFooter,
|
10843
|
+
Header: () => DrawerHeader,
|
10844
|
+
Root: () => DrawerRoot,
|
10845
|
+
Title: () => DrawerTitle,
|
10846
|
+
Trigger: () => DrawerTrigger
|
10847
|
+
});
|
10848
|
+
|
10849
|
+
// src/components/drawer/drawer.tsx
|
10850
|
+
var import_react123 = require("react");
|
10851
|
+
var import_react124 = require("@chakra-ui/react");
|
10852
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
10853
|
+
var DrawerContent = (0, import_react123.forwardRef)(
|
10854
|
+
function DrawerContent2(props2, ref2) {
|
10855
|
+
const { children, portalled = true, portalRef, offset, ...rest } = props2;
|
10856
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react124.Portal, { disabled: !portalled, container: portalRef, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react124.Drawer.Positioner, { padding: offset, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react124.Drawer.Content, { ref: ref2, ...rest, asChild: false, children }) }) });
|
10857
|
+
}
|
10858
|
+
);
|
10859
|
+
var DrawerCloseTrigger = (0, import_react123.forwardRef)(function DrawerCloseTrigger2(props2, ref2) {
|
10860
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
10861
|
+
import_react124.Drawer.CloseTrigger,
|
10862
|
+
{
|
10863
|
+
position: "absolute",
|
10864
|
+
top: "2",
|
10865
|
+
insetEnd: "2",
|
10866
|
+
...props2,
|
10867
|
+
asChild: true,
|
10868
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CloseButton, { size: "sm", ref: ref2 })
|
10869
|
+
}
|
10870
|
+
);
|
10871
|
+
});
|
10872
|
+
var DrawerTrigger = import_react124.Drawer.Trigger;
|
10873
|
+
var DrawerRoot = import_react124.Drawer.Root;
|
10874
|
+
var DrawerFooter = import_react124.Drawer.Footer;
|
10875
|
+
var DrawerHeader = import_react124.Drawer.Header;
|
10876
|
+
var DrawerBody = import_react124.Drawer.Body;
|
10877
|
+
var DrawerBackdrop = import_react124.Drawer.Backdrop;
|
10878
|
+
var DrawerDescription = import_react124.Drawer.Description;
|
10879
|
+
var DrawerTitle = import_react124.Drawer.Title;
|
10880
|
+
var DrawerActionTrigger = import_react124.Drawer.ActionTrigger;
|
10881
|
+
var DrawerContext = DialogContext;
|
10882
|
+
|
10883
|
+
// src/components/empty-state/empty-state.tsx
|
10884
|
+
var import_react125 = require("@chakra-ui/react");
|
10885
|
+
var import_react126 = require("react");
|
10886
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
10887
|
+
var EmptyState = (0, import_react126.forwardRef)(
|
10888
|
+
function EmptyState2(props2, ref2) {
|
10889
|
+
const { title, description, icon, children, ...rest } = props2;
|
10890
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react125.EmptyState.Root, { ref: ref2, ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react125.EmptyState.Content, { children: [
|
10891
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react125.EmptyState.Indicator, { children: icon }),
|
10892
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react125.VStack, { textAlign: "center", children: [
|
10893
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react125.EmptyState.Title, { children: title }),
|
10894
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react125.EmptyState.Description, { children: description })
|
10895
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react125.EmptyState.Title, { children: title }),
|
10896
|
+
children
|
10897
|
+
] }) });
|
10898
|
+
}
|
10899
|
+
);
|
10900
|
+
|
10901
|
+
// src/components/grid-list/grid-list.tsx
|
10902
|
+
var grid_list_exports = {};
|
10903
|
+
__export(grid_list_exports, {
|
10904
|
+
Cell: () => GridListCell,
|
10905
|
+
Header: () => GridListHeader,
|
10906
|
+
Item: () => GridListItem,
|
10907
|
+
Root: () => GridListRoot
|
10908
|
+
});
|
10909
|
+
var import_grid_list = require("@saas-ui/core/grid-list");
|
10910
|
+
|
10911
|
+
// src/components/grid-list/grid-list.context.ts
|
10912
|
+
var import_react127 = require("@chakra-ui/react");
|
10913
|
+
var {
|
10914
|
+
withProvider: withProvider2,
|
10915
|
+
withContext: withContext3,
|
10916
|
+
useStyles: useGridListStyles
|
10917
|
+
} = (0, import_react127.createSlotRecipeContext)({
|
10918
|
+
key: "suiGridList"
|
10919
|
+
});
|
10920
|
+
|
10921
|
+
// src/components/grid-list/grid-list.tsx
|
10922
|
+
var GridListRoot = withProvider2(
|
10923
|
+
import_grid_list.GridList.Root,
|
10924
|
+
"root"
|
10925
|
+
);
|
10926
|
+
var GridListItem = withContext3(
|
10927
|
+
import_grid_list.GridList.Item,
|
10928
|
+
"item"
|
10929
|
+
);
|
10930
|
+
var GridListHeader = withContext3(
|
10931
|
+
import_grid_list.GridList.Header,
|
10932
|
+
"header"
|
10933
|
+
);
|
10934
|
+
var GridListCell = withContext3(
|
10935
|
+
import_grid_list.GridList.Cell,
|
10936
|
+
"cell"
|
10937
|
+
);
|
10938
|
+
|
10939
|
+
// src/components/icon-badge/icon-badge.tsx
|
10940
|
+
var React2 = __toESM(require("react"), 1);
|
10941
|
+
var import_react128 = require("react");
|
10942
|
+
var import_react129 = require("@chakra-ui/react");
|
10943
|
+
var import_utils8 = require("@saas-ui/core/utils");
|
10944
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
10945
|
+
var IconBadge = React2.forwardRef(
|
10946
|
+
(props2, ref2) => {
|
10947
|
+
const { icon, children, ...rest } = props2;
|
10948
|
+
const recipe = (0, import_react129.useRecipe)({ key: "suiIconBadge", recipe: props2.recipe });
|
10949
|
+
const [variantProps, localProps] = recipe.splitVariantProps(rest);
|
10950
|
+
const styles = recipe(variantProps);
|
10951
|
+
const element = icon || children;
|
10952
|
+
const _children = (0, import_react128.isValidElement)(element) ? (0, import_react128.cloneElement)(element, {
|
10953
|
+
"aria-hidden": true,
|
10954
|
+
focusable: false
|
10955
|
+
}) : null;
|
10956
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
10957
|
+
import_react129.chakra.div,
|
10958
|
+
{
|
10959
|
+
ref: ref2,
|
10960
|
+
...localProps,
|
10961
|
+
css: [styles, props2.css],
|
10962
|
+
className: (0, import_utils8.cx)(recipe.className, props2.className),
|
10963
|
+
children: _children
|
10964
|
+
}
|
10965
|
+
);
|
10966
|
+
}
|
10967
|
+
);
|
10968
|
+
|
10969
|
+
// src/components/input-group/input-group.tsx
|
10970
|
+
var import_react130 = require("react");
|
10971
|
+
var import_react131 = require("@chakra-ui/react");
|
10972
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
10973
|
+
var InputGroup = (0, import_react130.forwardRef)(
|
10974
|
+
function InputGroup2(props2, ref2) {
|
10975
|
+
const {
|
10976
|
+
startElement,
|
10977
|
+
startElementProps,
|
10978
|
+
endElement,
|
10979
|
+
endElementProps,
|
10980
|
+
children,
|
10981
|
+
...rest
|
10982
|
+
} = props2;
|
10983
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react131.Group, { ref: ref2, display: "flex", ...rest, children: [
|
10984
|
+
startElement && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react131.InputElement, { pointerEvents: "none", ...startElementProps, children: startElement }),
|
10985
|
+
(0, import_react130.isValidElement)(children) && (0, import_react130.cloneElement)(children, {
|
10986
|
+
...startElement && { ps: "calc(var(--input-height) - 6px)" },
|
10987
|
+
...endElement && { pe: "calc(var(--input-height) - 6px)" },
|
10988
|
+
...children.props
|
10989
|
+
}),
|
10990
|
+
endElement && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react131.InputElement, { placement: "end", ...endElementProps, children: endElement })
|
10991
|
+
] });
|
10992
|
+
}
|
10993
|
+
);
|
10994
|
+
|
10995
|
+
// src/components/link/link.tsx
|
10996
|
+
var import_react132 = __toESM(require("react"), 1);
|
10997
|
+
var import_react133 = require("@chakra-ui/react");
|
10998
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
10999
|
+
var Link = import_react132.default.forwardRef(
|
11000
|
+
(props2, ref2) => {
|
11001
|
+
const LinkComponent = useLink();
|
11002
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react133.Link, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(LinkComponent, { ref: ref2, ...props2 }) });
|
11003
|
+
}
|
11004
|
+
);
|
11005
|
+
Link.displayName = "Link";
|
11006
|
+
|
11007
|
+
// src/components/loading-overlay/loading-overlay.tsx
|
11008
|
+
var loading_overlay_exports = {};
|
11009
|
+
__export(loading_overlay_exports, {
|
11010
|
+
Root: () => LoadingOverlayRoot,
|
11011
|
+
Spinner: () => LoadingOverlaySpinner,
|
11012
|
+
Text: () => LoadingOverlayText
|
11013
|
+
});
|
11014
|
+
|
11015
|
+
// ../../node_modules/@ark-ui/react/dist/components/presence/presence.js
|
11016
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
11017
|
+
var import_react134 = require("react");
|
11018
|
+
var Presence = (0, import_react134.forwardRef)((props2, ref2) => {
|
11019
|
+
const [presenceProps, localProps] = splitPresenceProps(props2);
|
11020
|
+
const presence = usePresence(presenceProps);
|
11021
|
+
if (presence.unmounted) {
|
11022
|
+
return null;
|
11023
|
+
}
|
11024
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
11025
|
+
ark.div,
|
11026
|
+
{
|
11027
|
+
...localProps,
|
11028
|
+
...presence.getPresenceProps(),
|
11029
|
+
"data-scope": "presence",
|
11030
|
+
"data-part": "root",
|
11031
|
+
ref: composeRefs(presence.ref, ref2)
|
11032
|
+
}
|
11033
|
+
);
|
11034
|
+
});
|
11035
|
+
Presence.displayName = "Presence";
|
11036
|
+
|
11037
|
+
// src/components/loading-overlay/loading-overlay.tsx
|
11038
|
+
var import_react138 = require("@chakra-ui/react");
|
11039
|
+
|
11040
|
+
// src/components/spinner/spinner.tsx
|
11041
|
+
var import_react135 = require("react");
|
11042
|
+
var import_react136 = require("@chakra-ui/react");
|
11043
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
11044
|
+
var Spinner2 = (0, import_react135.forwardRef)(
|
11045
|
+
function Spinner3(props2, ref2) {
|
11046
|
+
const { loading, children, ...rest } = props2;
|
11047
|
+
if (loading === false) {
|
11048
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_jsx_runtime18.Fragment, { children });
|
11049
|
+
}
|
11050
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react136.Spinner, { ref: ref2, ...rest });
|
11051
|
+
}
|
11052
|
+
);
|
11053
|
+
|
11054
|
+
// src/components/loading-overlay/loading-overlay.context.ts
|
11055
|
+
var import_react137 = require("@chakra-ui/react");
|
11056
|
+
var {
|
11057
|
+
useStyles: useLoadingOverlayStyles,
|
11058
|
+
withContext: withContext4,
|
11059
|
+
withProvider: withProvider3
|
11060
|
+
} = (0, import_react137.createSlotRecipeContext)({
|
11061
|
+
key: "suiLoadingOverlay"
|
11062
|
+
});
|
11063
|
+
|
11064
|
+
// src/components/loading-overlay/loading-overlay.tsx
|
11065
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
11066
|
+
var LoadingOverlay = (props2) => {
|
11067
|
+
const { children, loading = true, ...rest } = props2;
|
11068
|
+
const [presenceProps, rootProps] = splitPresenceProps(rest);
|
11069
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Presence, { present: loading, ...presenceProps, asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react138.chakra.div, { ...rootProps, children }) });
|
11070
|
+
};
|
11071
|
+
var LoadingOverlayRoot = withProvider3(
|
11072
|
+
LoadingOverlay,
|
11073
|
+
"root"
|
11074
|
+
);
|
11075
|
+
LoadingOverlayRoot.displayName = "LoadingOverlay";
|
11076
|
+
var LoadingOverlaySpinner = Spinner2;
|
11077
|
+
var LoadingOverlayText = withContext4(
|
11078
|
+
"p",
|
11079
|
+
"text"
|
11080
|
+
);
|
11081
|
+
|
11082
|
+
// src/components/navbar/navbar.tsx
|
11083
|
+
var navbar_exports = {};
|
11084
|
+
__export(navbar_exports, {
|
11085
|
+
Brand: () => NavbarBrand,
|
11086
|
+
Content: () => NavbarContent,
|
11087
|
+
Item: () => NavbarItem,
|
11088
|
+
Link: () => NavbarLink,
|
11089
|
+
Root: () => NavbarRoot
|
11090
|
+
});
|
11091
|
+
var import_navbar = require("@saas-ui/core/navbar");
|
11092
|
+
|
11093
|
+
// src/components/navbar/navbar.context.ts
|
11094
|
+
var import_react139 = require("@chakra-ui/react");
|
11095
|
+
var {
|
11096
|
+
withProvider: withProvider4,
|
11097
|
+
withContext: withContext5,
|
11098
|
+
useStyles: useNavbarStyles
|
11099
|
+
} = (0, import_react139.createSlotRecipeContext)({
|
11100
|
+
key: "suiNavbar"
|
11101
|
+
});
|
11102
|
+
|
11103
|
+
// src/components/navbar/navbar.tsx
|
11104
|
+
var NavbarRoot = withProvider4(
|
11105
|
+
import_navbar.Navbar.Root,
|
11106
|
+
"root"
|
11107
|
+
);
|
11108
|
+
var NavbarBrand = withContext5(
|
11109
|
+
import_navbar.Navbar.Brand,
|
11110
|
+
"brand"
|
11111
|
+
);
|
11112
|
+
var NavbarContent = withContext5(
|
11113
|
+
import_navbar.Navbar.Content,
|
11114
|
+
"content"
|
11115
|
+
);
|
11116
|
+
var NavbarItem = withContext5(
|
11117
|
+
import_navbar.Navbar.Item,
|
11118
|
+
"item"
|
11119
|
+
);
|
11120
|
+
var NavbarLink = withContext5(
|
11121
|
+
import_navbar.Navbar.Link,
|
11122
|
+
"link"
|
11123
|
+
);
|
11124
|
+
|
11125
|
+
// src/components/number-input/number-input.tsx
|
11126
|
+
var import_react140 = require("react");
|
11127
|
+
var import_react141 = require("@chakra-ui/react");
|
11128
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
11129
|
+
var NumberInput = (0, import_react140.forwardRef)(
|
11130
|
+
function NumberInput2(props2, ref2) {
|
11131
|
+
const {
|
11132
|
+
hideControls,
|
11133
|
+
startElement,
|
11134
|
+
endElement,
|
11135
|
+
inputProps,
|
11136
|
+
rootRef,
|
11137
|
+
...rest
|
11138
|
+
} = props2;
|
11139
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react141.NumberInput.Root, { ref: rootRef, ...rest, children: [
|
11140
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(InputGroup, { startElement, endElement, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react141.NumberInput.Input, { ref: ref2, ...inputProps }) }),
|
11141
|
+
!hideControls && !endElement ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react141.NumberInput.Control, { children: [
|
11142
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react141.NumberInput.IncrementTrigger, {}),
|
11143
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react141.NumberInput.DecrementTrigger, {})
|
11144
|
+
] }) : null
|
11145
|
+
] });
|
11146
|
+
}
|
11147
|
+
);
|
11148
|
+
|
11149
|
+
// src/components/menu/menu.tsx
|
11150
|
+
var menu_exports = {};
|
11151
|
+
__export(menu_exports, {
|
11152
|
+
Arrow: () => MenuArrow,
|
11153
|
+
CheckboxItem: () => MenuCheckboxItem,
|
11154
|
+
Content: () => MenuContent,
|
11155
|
+
ContextTrigger: () => MenuContextTrigger,
|
11156
|
+
Item: () => MenuItem,
|
11157
|
+
ItemCommand: () => MenuItemCommand,
|
11158
|
+
ItemGroup: () => MenuItemGroup,
|
11159
|
+
ItemText: () => MenuItemText,
|
11160
|
+
RadioItem: () => MenuRadioItem,
|
11161
|
+
RadioItemGroup: () => MenuRadioItemGroup,
|
11162
|
+
Root: () => MenuRoot,
|
11163
|
+
Separator: () => MenuSeparator,
|
11164
|
+
Trigger: () => MenuTrigger,
|
11165
|
+
TriggerItem: () => MenuTriggerItem
|
11166
|
+
});
|
11167
|
+
var import_react144 = require("react");
|
11168
|
+
var import_react145 = require("@chakra-ui/react");
|
11169
|
+
|
11170
|
+
// ../../node_modules/react-icons/lib/iconBase.mjs
|
11171
|
+
var import_react143 = __toESM(require("react"), 1);
|
11172
|
+
|
11173
|
+
// ../../node_modules/react-icons/lib/iconContext.mjs
|
11174
|
+
var import_react142 = __toESM(require("react"), 1);
|
11175
|
+
var DefaultContext = {
|
11176
|
+
color: void 0,
|
11177
|
+
size: void 0,
|
11178
|
+
className: void 0,
|
11179
|
+
style: void 0,
|
11180
|
+
attr: void 0
|
11181
|
+
};
|
11182
|
+
var IconContext = import_react142.default.createContext && /* @__PURE__ */ import_react142.default.createContext(DefaultContext);
|
11183
|
+
|
11184
|
+
// ../../node_modules/react-icons/lib/iconBase.mjs
|
11185
|
+
var _excluded = ["attr", "size", "title"];
|
11186
|
+
function _objectWithoutProperties(source, excluded) {
|
11187
|
+
if (source == null) return {};
|
11188
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
11189
|
+
var key, i;
|
11190
|
+
if (Object.getOwnPropertySymbols) {
|
11191
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
11192
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
11193
|
+
key = sourceSymbolKeys[i];
|
11194
|
+
if (excluded.indexOf(key) >= 0) continue;
|
11195
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
11196
|
+
target[key] = source[key];
|
11197
|
+
}
|
11198
|
+
}
|
11199
|
+
return target;
|
11200
|
+
}
|
11201
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
11202
|
+
if (source == null) return {};
|
11203
|
+
var target = {};
|
11204
|
+
for (var key in source) {
|
11205
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
11206
|
+
if (excluded.indexOf(key) >= 0) continue;
|
11207
|
+
target[key] = source[key];
|
11208
|
+
}
|
11209
|
+
}
|
11210
|
+
return target;
|
11211
|
+
}
|
11212
|
+
function _extends() {
|
11213
|
+
_extends = Object.assign ? Object.assign.bind() : function(target) {
|
11214
|
+
for (var i = 1; i < arguments.length; i++) {
|
11215
|
+
var source = arguments[i];
|
11216
|
+
for (var key in source) {
|
11217
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
11218
|
+
target[key] = source[key];
|
11219
|
+
}
|
11220
|
+
}
|
11221
|
+
}
|
11222
|
+
return target;
|
11223
|
+
};
|
11224
|
+
return _extends.apply(this, arguments);
|
11225
|
+
}
|
11226
|
+
function ownKeys(e, r) {
|
11227
|
+
var t = Object.keys(e);
|
11228
|
+
if (Object.getOwnPropertySymbols) {
|
11229
|
+
var o = Object.getOwnPropertySymbols(e);
|
11230
|
+
r && (o = o.filter(function(r2) {
|
11231
|
+
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
11232
|
+
})), t.push.apply(t, o);
|
11233
|
+
}
|
11234
|
+
return t;
|
11235
|
+
}
|
11236
|
+
function _objectSpread(e) {
|
11237
|
+
for (var r = 1; r < arguments.length; r++) {
|
11238
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
11239
|
+
r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
|
11240
|
+
_defineProperty(e, r2, t[r2]);
|
11241
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
|
11242
|
+
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
11243
|
+
});
|
11244
|
+
}
|
11245
|
+
return e;
|
11246
|
+
}
|
11247
|
+
function _defineProperty(obj, key, value) {
|
11248
|
+
key = _toPropertyKey(key);
|
11249
|
+
if (key in obj) {
|
11250
|
+
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
11251
|
+
} else {
|
11252
|
+
obj[key] = value;
|
11253
|
+
}
|
11254
|
+
return obj;
|
11255
|
+
}
|
11256
|
+
function _toPropertyKey(t) {
|
11257
|
+
var i = _toPrimitive(t, "string");
|
11258
|
+
return "symbol" == typeof i ? i : i + "";
|
11259
|
+
}
|
11260
|
+
function _toPrimitive(t, r) {
|
11261
|
+
if ("object" != typeof t || !t) return t;
|
11262
|
+
var e = t[Symbol.toPrimitive];
|
11263
|
+
if (void 0 !== e) {
|
11264
|
+
var i = e.call(t, r || "default");
|
11265
|
+
if ("object" != typeof i) return i;
|
11266
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
11267
|
+
}
|
11268
|
+
return ("string" === r ? String : Number)(t);
|
11269
|
+
}
|
11270
|
+
function Tree2Element(tree) {
|
11271
|
+
return tree && tree.map((node, i) => /* @__PURE__ */ import_react143.default.createElement(node.tag, _objectSpread({
|
11272
|
+
key: i
|
11273
|
+
}, node.attr), Tree2Element(node.child)));
|
11274
|
+
}
|
11275
|
+
function GenIcon(data) {
|
11276
|
+
return (props2) => /* @__PURE__ */ import_react143.default.createElement(IconBase, _extends({
|
11277
|
+
attr: _objectSpread({}, data.attr)
|
11278
|
+
}, props2), Tree2Element(data.child));
|
11279
|
+
}
|
11280
|
+
function IconBase(props2) {
|
11281
|
+
var elem = (conf) => {
|
11282
|
+
var {
|
11283
|
+
attr,
|
11284
|
+
size,
|
11285
|
+
title
|
11286
|
+
} = props2, svgProps = _objectWithoutProperties(props2, _excluded);
|
11287
|
+
var computedSize = size || conf.size || "1em";
|
11288
|
+
var className;
|
11289
|
+
if (conf.className) className = conf.className;
|
11290
|
+
if (props2.className) className = (className ? className + " " : "") + props2.className;
|
11291
|
+
return /* @__PURE__ */ import_react143.default.createElement("svg", _extends({
|
11292
|
+
stroke: "currentColor",
|
11293
|
+
fill: "currentColor",
|
11294
|
+
strokeWidth: "0"
|
11295
|
+
}, conf.attr, attr, svgProps, {
|
11296
|
+
className,
|
11297
|
+
style: _objectSpread(_objectSpread({
|
11298
|
+
color: props2.color || conf.color
|
11299
|
+
}, conf.style), props2.style),
|
11300
|
+
height: computedSize,
|
11301
|
+
width: computedSize,
|
11302
|
+
xmlns: "http://www.w3.org/2000/svg"
|
11303
|
+
}), title && /* @__PURE__ */ import_react143.default.createElement("title", null, title), props2.children);
|
11304
|
+
};
|
11305
|
+
return IconContext !== void 0 ? /* @__PURE__ */ import_react143.default.createElement(IconContext.Consumer, null, (conf) => elem(conf)) : elem(DefaultContext);
|
11306
|
+
}
|
11307
|
+
|
11308
|
+
// ../../node_modules/react-icons/lu/index.mjs
|
11309
|
+
function LuCheck(props2) {
|
11310
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "none", "stroke": "currentColor", "strokeWidth": "2", "strokeLinecap": "round", "strokeLinejoin": "round" }, "child": [{ "tag": "polyline", "attr": { "points": "20 6 9 17 4 12" }, "child": [] }] })(props2);
|
11311
|
+
}
|
11312
|
+
function LuChevronRight(props2) {
|
11313
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "none", "stroke": "currentColor", "strokeWidth": "2", "strokeLinecap": "round", "strokeLinejoin": "round" }, "child": [{ "tag": "path", "attr": { "d": "m9 18 6-6-6-6" }, "child": [] }] })(props2);
|
11314
|
+
}
|
11315
|
+
function LuEyeOff(props2) {
|
11316
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "none", "stroke": "currentColor", "strokeWidth": "2", "strokeLinecap": "round", "strokeLinejoin": "round" }, "child": [{ "tag": "path", "attr": { "d": "M9.88 9.88a3 3 0 1 0 4.24 4.24" }, "child": [] }, { "tag": "path", "attr": { "d": "M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68" }, "child": [] }, { "tag": "path", "attr": { "d": "M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61" }, "child": [] }, { "tag": "line", "attr": { "x1": "2", "x2": "22", "y1": "2", "y2": "22" }, "child": [] }] })(props2);
|
11317
|
+
}
|
11318
|
+
function LuEye(props2) {
|
11319
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "none", "stroke": "currentColor", "strokeWidth": "2", "strokeLinecap": "round", "strokeLinejoin": "round" }, "child": [{ "tag": "path", "attr": { "d": "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z" }, "child": [] }, { "tag": "circle", "attr": { "cx": "12", "cy": "12", "r": "3" }, "child": [] }] })(props2);
|
11320
|
+
}
|
11321
|
+
|
11322
|
+
// src/components/menu/menu.tsx
|
11323
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
11324
|
+
var MenuContent = (0, import_react144.forwardRef)(
|
11325
|
+
function MenuContent2(props2, ref2) {
|
11326
|
+
const { portalled = true, portalRef, ...rest } = props2;
|
11327
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react145.Portal, { disabled: !portalled, container: portalRef, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react145.Menu.Positioner, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react145.Menu.Content, { ref: ref2, ...rest }) }) });
|
11328
|
+
}
|
11329
|
+
);
|
11330
|
+
var MenuArrow = (0, import_react144.forwardRef)(
|
11331
|
+
function MenuArrow2(props2, ref2) {
|
11332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react145.Menu.Arrow, { ref: ref2, ...props2, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react145.Menu.ArrowTip, {}) });
|
11333
|
+
}
|
11334
|
+
);
|
11335
|
+
var MenuCheckboxItem = (0, import_react144.forwardRef)(function MenuCheckboxItem2(props2, ref2) {
|
11336
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react145.Menu.CheckboxItem, { ref: ref2, ...props2, children: [
|
11337
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react145.Menu.ItemIndicator, { hidden: false, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(LuCheck, {}) }),
|
11338
|
+
props2.children
|
11339
|
+
] });
|
11340
|
+
});
|
11341
|
+
var MenuRadioItem = (0, import_react144.forwardRef)(
|
11342
|
+
function MenuRadioItem2(props2, ref2) {
|
11343
|
+
const { children, ...rest } = props2;
|
11344
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react145.Menu.RadioItem, { ps: "8", ref: ref2, ...rest, children: [
|
11345
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react145.AbsoluteCenter, { axis: "horizontal", left: "4", asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react145.Menu.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(LuCheck, {}) }) }),
|
11346
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react145.Menu.ItemText, { children })
|
11347
|
+
] });
|
11348
|
+
}
|
11349
|
+
);
|
11350
|
+
var MenuItemGroup = (0, import_react144.forwardRef)(
|
11351
|
+
function MenuItemGroup2(props2, ref2) {
|
11352
|
+
const { title, children, ...rest } = props2;
|
11353
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react145.Menu.ItemGroup, { ref: ref2, ...rest, children: [
|
11354
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react145.Menu.ItemGroupLabel, { userSelect: "none", children: title }),
|
11355
|
+
children
|
11356
|
+
] });
|
11357
|
+
}
|
11358
|
+
);
|
11359
|
+
var MenuTriggerItem = (0, import_react144.forwardRef)(
|
11360
|
+
function MenuTriggerItem2(props2, ref2) {
|
11361
|
+
const { startIcon, children, ...rest } = props2;
|
11362
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react145.Menu.TriggerItem, { ref: ref2, ...rest, children: [
|
11363
|
+
startIcon,
|
11364
|
+
children,
|
11365
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(LuChevronRight, {})
|
11366
|
+
] });
|
11367
|
+
}
|
11368
|
+
);
|
11369
|
+
var MenuRadioItemGroup = import_react145.Menu.RadioItemGroup;
|
11370
|
+
var MenuContextTrigger = import_react145.Menu.ContextTrigger;
|
11371
|
+
var MenuRoot = import_react145.Menu.Root;
|
11372
|
+
var MenuSeparator = import_react145.Menu.Separator;
|
11373
|
+
var MenuItem = import_react145.Menu.Item;
|
11374
|
+
var MenuItemText = import_react145.Menu.ItemText;
|
11375
|
+
var MenuItemCommand = import_react145.Menu.ItemCommand;
|
11376
|
+
var MenuTrigger = import_react145.Menu.Trigger;
|
11377
|
+
|
11378
|
+
// src/components/password-input/password-input.tsx
|
11379
|
+
var import_react146 = require("react");
|
11380
|
+
var import_react147 = require("@chakra-ui/react");
|
11381
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
11382
|
+
var PasswordInput = (0, import_react146.forwardRef)(
|
11383
|
+
function PasswordInput2(props2, ref2) {
|
11384
|
+
const {
|
11385
|
+
rootProps,
|
11386
|
+
defaultVisible,
|
11387
|
+
visible: visibleProp,
|
11388
|
+
onVisibleChange,
|
11389
|
+
visibilityIcon = { on: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(LuEye, {}), off: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(LuEyeOff, {}) },
|
11390
|
+
...rest
|
11391
|
+
} = props2;
|
11392
|
+
const [visible, setVisible] = (0, import_react147.useControllableState)({
|
11393
|
+
value: visibleProp,
|
11394
|
+
defaultValue: defaultVisible || false,
|
11395
|
+
onChange: onVisibleChange
|
11396
|
+
});
|
11397
|
+
const inputRef = (0, import_react146.useRef)(null);
|
11398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
11399
|
+
InputGroup,
|
11400
|
+
{
|
11401
|
+
width: "full",
|
11402
|
+
endElement: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
11403
|
+
VisibilityTrigger,
|
11404
|
+
{
|
11405
|
+
disabled: rest.disabled,
|
11406
|
+
onPointerDown: (e) => {
|
11407
|
+
if (rest.disabled) return;
|
11408
|
+
if (e.button !== 0) return;
|
11409
|
+
e.preventDefault();
|
11410
|
+
setVisible(!visible);
|
11411
|
+
},
|
11412
|
+
children: visible ? visibilityIcon.off : visibilityIcon.on
|
11413
|
+
}
|
11414
|
+
),
|
11415
|
+
...rootProps,
|
11416
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
11417
|
+
import_react147.Input,
|
11418
|
+
{
|
11419
|
+
...rest,
|
11420
|
+
ref: (0, import_react147.mergeRefs)(ref2, inputRef),
|
11421
|
+
type: visible ? "text" : "password"
|
11422
|
+
}
|
11423
|
+
)
|
11424
|
+
}
|
11425
|
+
);
|
11426
|
+
}
|
11427
|
+
);
|
11428
|
+
var VisibilityTrigger = (0, import_react146.forwardRef)(
|
11429
|
+
function VisibilityTrigger2(props2, ref2) {
|
11430
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
11431
|
+
import_react147.IconButton,
|
11432
|
+
{
|
11433
|
+
tabIndex: -1,
|
11434
|
+
ref: ref2,
|
11435
|
+
me: "-2",
|
11436
|
+
aspectRatio: "square",
|
11437
|
+
size: "sm",
|
11438
|
+
variant: "ghost",
|
11439
|
+
colorPalette: "gray",
|
11440
|
+
height: "calc(100% - {spacing.2})",
|
11441
|
+
"aria-label": "Toggle password visibility",
|
11442
|
+
...props2
|
11443
|
+
}
|
11444
|
+
);
|
11445
|
+
}
|
11446
|
+
);
|
11447
|
+
|
11448
|
+
// src/components/persona/persona.tsx
|
11449
|
+
var React7 = __toESM(require("react"), 1);
|
11450
|
+
|
11451
|
+
// src/components/persona/persona-primitive.tsx
|
11452
|
+
var import_react149 = require("react");
|
11453
|
+
var import_react150 = require("@chakra-ui/react");
|
11454
|
+
var import_utils9 = require("@saas-ui/core/utils");
|
11455
|
+
|
11456
|
+
// src/components/persona/persona.context.ts
|
11457
|
+
var import_react148 = require("@chakra-ui/react");
|
11458
|
+
var {
|
11459
|
+
useStyles: usePersonaStyles,
|
11460
|
+
withProvider: withProvider5,
|
11461
|
+
withContext: withContext6
|
11462
|
+
} = (0, import_react148.createSlotRecipeContext)({
|
11463
|
+
key: "suiPersona"
|
11464
|
+
});
|
11465
|
+
|
11466
|
+
// src/components/persona/persona-primitive.tsx
|
11467
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
11468
|
+
var PersonaRoot = withProvider5(
|
11469
|
+
(0, import_react149.forwardRef)((props2, ref2) => {
|
11470
|
+
const { outOfOffice, presence, ...rest } = props2;
|
11471
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
11472
|
+
import_react150.chakra.div,
|
11473
|
+
{
|
11474
|
+
ref: ref2,
|
11475
|
+
...rest,
|
11476
|
+
"data-out-of-office": (0, import_utils9.dataAttr)(outOfOffice),
|
11477
|
+
"data-presence": presence,
|
11478
|
+
css: [
|
11479
|
+
presence ? {
|
11480
|
+
"--persona-presence": `colors.presence.${presence}`
|
11481
|
+
} : void 0,
|
11482
|
+
rest.css
|
11483
|
+
]
|
11484
|
+
}
|
11485
|
+
);
|
11486
|
+
}),
|
11487
|
+
"root"
|
11488
|
+
);
|
11489
|
+
var PersonaAvatar = (0, import_react149.forwardRef)(
|
11490
|
+
(props2, ref2) => {
|
11491
|
+
const {
|
11492
|
+
name,
|
11493
|
+
getInitials: getInitials2 = (name2) => name2 == null ? void 0 : name2[0],
|
11494
|
+
icon,
|
11495
|
+
loading,
|
11496
|
+
onError,
|
11497
|
+
src,
|
11498
|
+
srcSet,
|
11499
|
+
children,
|
11500
|
+
...rest
|
11501
|
+
} = props2;
|
11502
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react150.Avatar.Root, { ref: ref2, ...rest, children: [
|
11503
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react150.Avatar.Fallback, { children: getInitials2(name) }),
|
11504
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
11505
|
+
import_react150.Avatar.Image,
|
11506
|
+
{
|
11507
|
+
src,
|
11508
|
+
srcSet,
|
11509
|
+
loading,
|
11510
|
+
onError
|
11511
|
+
}
|
11512
|
+
),
|
11513
|
+
children
|
11514
|
+
] });
|
11515
|
+
}
|
11516
|
+
);
|
11517
|
+
var PersonaPresenceBadge = withContext6("span", "presence");
|
11518
|
+
var PersonaDetails = withContext6(
|
11519
|
+
"div",
|
11520
|
+
"details"
|
11521
|
+
);
|
11522
|
+
var PersonaLabel = withContext6(
|
11523
|
+
"span",
|
11524
|
+
"label"
|
11525
|
+
);
|
11526
|
+
PersonaLabel.displayName = "PersonaLabel";
|
11527
|
+
var PersonaSecondaryLabel = withContext6(
|
11528
|
+
"span",
|
11529
|
+
"secondaryLabel"
|
11530
|
+
);
|
11531
|
+
var PersonaTertiaryLabel = withContext6(
|
11532
|
+
"span",
|
11533
|
+
"tertiaryLabel"
|
11534
|
+
);
|
11535
|
+
|
11536
|
+
// src/components/persona/persona.tsx
|
11537
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
11538
|
+
var Persona = React7.forwardRef(
|
11539
|
+
(props2, ref2) => {
|
11540
|
+
const {
|
11541
|
+
name,
|
11542
|
+
presence,
|
11543
|
+
presenceIcon,
|
11544
|
+
isOutOfOffice,
|
11545
|
+
label,
|
11546
|
+
secondaryLabel,
|
11547
|
+
tertiaryLabel,
|
11548
|
+
size,
|
11549
|
+
hideDetails,
|
11550
|
+
children,
|
11551
|
+
/** Avatar props */
|
11552
|
+
getInitials: getInitials2,
|
11553
|
+
icon,
|
11554
|
+
loading,
|
11555
|
+
onError,
|
11556
|
+
src,
|
11557
|
+
srcSet,
|
11558
|
+
...rest
|
11559
|
+
} = props2;
|
11560
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
11561
|
+
PersonaRoot,
|
11562
|
+
{
|
11563
|
+
ref: ref2,
|
11564
|
+
outOfOffice: isOutOfOffice,
|
11565
|
+
presence,
|
11566
|
+
...rest,
|
11567
|
+
children: [
|
11568
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
11569
|
+
PersonaAvatar,
|
11570
|
+
{
|
11571
|
+
name,
|
11572
|
+
size,
|
11573
|
+
getInitials: getInitials2,
|
11574
|
+
icon,
|
11575
|
+
loading,
|
11576
|
+
onError,
|
11577
|
+
src,
|
11578
|
+
srcSet,
|
11579
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(PersonaPresenceBadge, { children: presenceIcon })
|
11580
|
+
}
|
11581
|
+
),
|
11582
|
+
!hideDetails && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(PersonaDetails, { children: [
|
11583
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(PersonaLabel, { children: label || name }),
|
11584
|
+
secondaryLabel && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(PersonaSecondaryLabel, { children: secondaryLabel }),
|
11585
|
+
tertiaryLabel && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(PersonaTertiaryLabel, { children: tertiaryLabel }),
|
11586
|
+
children
|
11587
|
+
] })
|
11588
|
+
]
|
11589
|
+
}
|
11590
|
+
);
|
11591
|
+
}
|
11592
|
+
);
|
11593
|
+
Persona.displayName = "Persona";
|
11594
|
+
var PersonaAvatar2 = React7.forwardRef(function PersonaAvatar3(props2, ref2) {
|
11595
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Persona, { ref: ref2, ...props2, hideDetails: true });
|
11596
|
+
});
|
11597
|
+
|
11598
|
+
// src/components/persona/presence.ts
|
11599
|
+
var defaultPresenceOptions = {
|
11600
|
+
online: {
|
11601
|
+
label: "Online",
|
11602
|
+
color: "presence.online"
|
11603
|
+
},
|
11604
|
+
offline: {
|
11605
|
+
label: "Offline",
|
11606
|
+
color: "presence.offline"
|
11607
|
+
},
|
11608
|
+
busy: {
|
11609
|
+
label: "Busy",
|
11610
|
+
color: "presence.busy"
|
11611
|
+
},
|
11612
|
+
dnd: {
|
11613
|
+
label: "Do-not-disturb",
|
11614
|
+
color: "presence.dnd"
|
11615
|
+
},
|
11616
|
+
away: {
|
11617
|
+
label: "Away",
|
11618
|
+
color: "presence.away"
|
11619
|
+
}
|
11620
|
+
};
|
11621
|
+
|
11622
|
+
// src/components/pin-input/pin-input.tsx
|
11623
|
+
var import_react151 = require("react");
|
11624
|
+
var import_react152 = require("@chakra-ui/react");
|
11625
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
11626
|
+
var PinInput = (0, import_react151.forwardRef)(
|
11627
|
+
function PinInput2(props2, ref2) {
|
11628
|
+
const {
|
11629
|
+
pinLength = 4,
|
11630
|
+
inputProps,
|
11631
|
+
rootRef,
|
11632
|
+
attached,
|
11633
|
+
gap = attached ? 0 : 2,
|
11634
|
+
...rest
|
11635
|
+
} = props2;
|
11636
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_react152.PinInput.Root, { ref: rootRef, ...rest, children: [
|
11637
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react152.PinInput.HiddenInput, { ref: ref2, ...inputProps }),
|
11638
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react152.PinInput.Control, { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react152.Group, { attached, gap, children: Array.from({ length: pinLength }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react152.PinInput.Input, { index }, index)) }) })
|
11639
|
+
] });
|
11640
|
+
}
|
11641
|
+
);
|
11642
|
+
|
11643
|
+
// src/components/radio/radio.tsx
|
11644
|
+
var import_react153 = require("react");
|
11645
|
+
var import_react154 = require("@chakra-ui/react");
|
11646
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
11647
|
+
var Radio = (0, import_react153.forwardRef)(
|
11648
|
+
function Radio2(props2, ref2) {
|
11649
|
+
const { children, inputProps, rootRef, ...rest } = props2;
|
11650
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_react154.RadioGroup.Item, { ref: rootRef, ...rest, children: [
|
11651
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react154.RadioGroup.ItemHiddenInput, { ref: ref2, ...inputProps }),
|
11652
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react154.RadioGroup.ItemIndicator, {}),
|
11653
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react154.RadioGroup.ItemText, { children })
|
11654
|
+
] });
|
11655
|
+
}
|
11656
|
+
);
|
11657
|
+
var RadioGroup = import_react154.RadioGroup.Root;
|
11658
|
+
|
11659
|
+
// src/components/search-input/search-input.tsx
|
11660
|
+
var import_react155 = __toESM(require("react"), 1);
|
11661
|
+
var import_react156 = require("@chakra-ui/react");
|
11662
|
+
var import_utils10 = require("@saas-ui/core/utils");
|
11663
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
11664
|
+
var SearchInput = (0, import_react155.forwardRef)(
|
11665
|
+
(props2, ref2) => {
|
11666
|
+
const {
|
11667
|
+
placeholder = "Search",
|
11668
|
+
value: valueProp,
|
11669
|
+
defaultValue: defaultValueProp,
|
11670
|
+
size,
|
11671
|
+
variant,
|
11672
|
+
width = "full",
|
11673
|
+
icon = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(SearchIcon, {}),
|
11674
|
+
resetIcon,
|
11675
|
+
endElement: endElementProp,
|
11676
|
+
onChange: onChangeProp,
|
11677
|
+
onReset: onResetProp,
|
11678
|
+
onKeyDown: onKeyDownProp,
|
11679
|
+
disabled,
|
11680
|
+
...inputProps
|
11681
|
+
} = props2;
|
11682
|
+
const inputRef = import_react155.default.useRef(null);
|
11683
|
+
const [value, setValue] = (0, import_react156.useControllableState)({
|
11684
|
+
value: valueProp,
|
11685
|
+
defaultValue: defaultValueProp
|
11686
|
+
});
|
11687
|
+
const onChange = import_react155.default.useCallback(
|
11688
|
+
(e) => {
|
11689
|
+
setValue(e.target.value);
|
11690
|
+
},
|
11691
|
+
[setValue]
|
11692
|
+
);
|
11693
|
+
const onKeyDown = import_react155.default.useCallback(
|
11694
|
+
(event) => {
|
11695
|
+
if (event.key === "Escape") {
|
11696
|
+
setValue("");
|
11697
|
+
onReset();
|
11698
|
+
}
|
11699
|
+
},
|
11700
|
+
[onResetProp, setValue]
|
11701
|
+
);
|
11702
|
+
const onReset = () => {
|
11703
|
+
var _a7;
|
11704
|
+
setValue("");
|
11705
|
+
onResetProp == null ? void 0 : onResetProp();
|
11706
|
+
(_a7 = inputRef.current) == null ? void 0 : _a7.focus();
|
11707
|
+
};
|
11708
|
+
const showReset = value && !props2.disabled;
|
11709
|
+
const endElement = showReset ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(SearchInputResetButton, { size, children: resetIcon }) : endElementProp;
|
11710
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_react156.Group, { width, children: [
|
11711
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
11712
|
+
import_react156.InputElement,
|
11713
|
+
{
|
11714
|
+
placement: "start",
|
11715
|
+
px: "0",
|
11716
|
+
aspectRatio: "9/10",
|
11717
|
+
fontSize: size,
|
11718
|
+
children: icon
|
11719
|
+
}
|
11720
|
+
),
|
11721
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
11722
|
+
import_react156.Input,
|
11723
|
+
{
|
11724
|
+
type: "text",
|
11725
|
+
placeholder,
|
11726
|
+
variant,
|
11727
|
+
size,
|
11728
|
+
value,
|
11729
|
+
disabled,
|
11730
|
+
ref: (0, import_react156.mergeRefs)(ref2, inputRef),
|
11731
|
+
onChange: (0, import_utils10.callAll)(onChange, onChangeProp),
|
11732
|
+
onKeyDown: (0, import_utils10.callAll)(onKeyDown, onKeyDownProp),
|
11733
|
+
ps: "calc(var(--input-height) - var(--input-height) / 10)",
|
11734
|
+
pe: "calc(var(--input-height) - var(--input-height) / 10)",
|
11735
|
+
...inputProps
|
11736
|
+
}
|
11737
|
+
),
|
11738
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react156.InputElement, { placement: "end", children: endElement })
|
11739
|
+
] });
|
11740
|
+
}
|
11741
|
+
);
|
11742
|
+
var SearchInputResetButton = (0, import_react155.forwardRef)(
|
11743
|
+
(props2, ref2) => {
|
11744
|
+
const { children = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(CloseIcon, {}), ...rest } = props2;
|
11745
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
11746
|
+
import_react156.IconButton,
|
11747
|
+
{
|
11748
|
+
ref: ref2,
|
11749
|
+
variant: "ghost",
|
11750
|
+
"aria-label": "Reset search",
|
11751
|
+
me: "-2",
|
11752
|
+
aspectRatio: "square",
|
11753
|
+
height: "calc(100% - {spacing.2})",
|
11754
|
+
...rest,
|
11755
|
+
children
|
11756
|
+
}
|
11757
|
+
);
|
11758
|
+
}
|
11759
|
+
);
|
11760
|
+
SearchInput.displayName = "SearchInput";
|
11761
|
+
|
11762
|
+
// src/components/select/namespace.ts
|
11763
|
+
var namespace_exports4 = {};
|
11764
|
+
__export(namespace_exports4, {
|
11765
|
+
Content: () => SelectContent,
|
11766
|
+
Item: () => SelectItem,
|
11767
|
+
ItemGroup: () => SelectItemGroup,
|
11768
|
+
ItemText: () => SelectItemText,
|
11769
|
+
Label: () => SelectLabel,
|
11770
|
+
Root: () => SelectRoot,
|
11771
|
+
Trigger: () => SelectTrigger,
|
11772
|
+
ValueText: () => SelectValueText
|
11773
|
+
});
|
11774
|
+
|
11775
|
+
// src/components/select/select.tsx
|
11776
|
+
var import_react157 = require("react");
|
11777
|
+
var import_react158 = require("@chakra-ui/react");
|
11778
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
11779
|
+
var SelectTrigger = (0, import_react157.forwardRef)(
|
11780
|
+
function SelectTrigger2(props2, ref2) {
|
11781
|
+
const { children, clearable, ...rest } = props2;
|
11782
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_react158.Select.Control, { ...rest, children: [
|
11783
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react158.Select.Trigger, { ref: ref2, children }),
|
11784
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_react158.Select.IndicatorGroup, { children: [
|
11785
|
+
clearable && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SelectClearTrigger, {}),
|
11786
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react158.Select.Indicator, {})
|
11787
|
+
] })
|
11788
|
+
] });
|
11789
|
+
}
|
11790
|
+
);
|
11791
|
+
var SelectClearTrigger = (0, import_react157.forwardRef)(function SelectClearTrigger2(props2, ref2) {
|
11792
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react158.Select.ClearTrigger, { asChild: true, ...props2, ref: ref2, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
11793
|
+
CloseButton,
|
11794
|
+
{
|
11795
|
+
size: "xs",
|
11796
|
+
variant: "plain",
|
11797
|
+
focusVisibleRing: "inside",
|
11798
|
+
focusRingWidth: "2px",
|
11799
|
+
pointerEvents: "auto"
|
11800
|
+
}
|
11801
|
+
) });
|
11802
|
+
});
|
11803
|
+
var SelectContent = (0, import_react157.forwardRef)(
|
11804
|
+
function SelectContent2(props2, ref2) {
|
11805
|
+
const { portalled = true, portalRef, ...rest } = props2;
|
11806
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react158.Portal, { disabled: !portalled, container: portalRef, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react158.Select.Positioner, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react158.Select.Content, { ...rest, ref: ref2 }) }) });
|
11807
|
+
}
|
11808
|
+
);
|
11809
|
+
var SelectItem = (0, import_react157.forwardRef)(
|
11810
|
+
function SelectItem2(props2, ref2) {
|
11811
|
+
const { item, children, ...rest } = props2;
|
11812
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_react158.Select.Item, { item, ...rest, ref: ref2, children: [
|
11813
|
+
children,
|
11814
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react158.Select.ItemIndicator, {})
|
11815
|
+
] }, item.value);
|
11816
|
+
}
|
11817
|
+
);
|
11818
|
+
var SelectValueText = (0, import_react157.forwardRef)(function SelectValueText2(props2, ref2) {
|
11819
|
+
const { children, ...rest } = props2;
|
11820
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react158.Select.ValueText, { ...rest, ref: ref2, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react158.Select.Context, { children: (select) => {
|
11821
|
+
const items = select.selectedItems;
|
11822
|
+
if (items.length === 0) return props2.placeholder;
|
11823
|
+
if (children) return children(items);
|
11824
|
+
if (items.length === 1)
|
11825
|
+
return select.collection.stringifyItem(items[0]);
|
11826
|
+
return `${items.length} selected`;
|
11827
|
+
} }) });
|
11828
|
+
});
|
11829
|
+
var SelectRoot = (0, import_react157.forwardRef)(function SelectRoot2(props2, ref2) {
|
11830
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
11831
|
+
import_react158.Select.Root,
|
11832
|
+
{
|
11833
|
+
...props2,
|
11834
|
+
ref: ref2,
|
11835
|
+
positioning: { sameWidth: true, ...props2.positioning }
|
11836
|
+
}
|
11837
|
+
);
|
11838
|
+
});
|
11839
|
+
var SelectItemGroup = (0, import_react157.forwardRef)(
|
11840
|
+
function SelectItemGroup2(props2, ref2) {
|
11841
|
+
const { children, label, ...rest } = props2;
|
11842
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_react158.Select.ItemGroup, { ...rest, ref: ref2, children: [
|
11843
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react158.Select.ItemGroupLabel, { children: label }),
|
11844
|
+
children
|
11845
|
+
] });
|
11846
|
+
}
|
11847
|
+
);
|
11848
|
+
var SelectLabel = import_react158.Select.Label;
|
11849
|
+
var SelectItemText = import_react158.Select.ItemText;
|
11850
|
+
|
11851
|
+
// src/components/sidebar/sidebar.tsx
|
11852
|
+
var sidebar_exports = {};
|
11853
|
+
__export(sidebar_exports, {
|
11854
|
+
Backdrop: () => SidebarBackdrop,
|
11855
|
+
Body: () => SidebarBody,
|
11856
|
+
FlyoutTrigger: () => SidebarFlyoutTrigger,
|
11857
|
+
Footer: () => SidebarFooter,
|
11858
|
+
Group: () => SidebarGroup,
|
11859
|
+
GroupContent: () => SidebarGroupContent,
|
11860
|
+
GroupEndElement: () => SidebarGroupEndElement,
|
11861
|
+
GroupHeader: () => SidebarGroupHeader,
|
11862
|
+
GroupTitle: () => SidebarGroupTitle,
|
11863
|
+
Header: () => SidebarHeader,
|
11864
|
+
NavButton: () => SidebarNavButton,
|
11865
|
+
NavItem: () => SidebarNavItem,
|
11866
|
+
NavItemEndElement: () => SidebarNavItemEndElement,
|
11867
|
+
Provider: () => SidebarProvider,
|
11868
|
+
Root: () => SidebarRoot,
|
11869
|
+
Track: () => SidebarTrack,
|
11870
|
+
Trigger: () => SidebarTrigger
|
11871
|
+
});
|
11872
|
+
var import_sidebar = require("@saas-ui/core/sidebar");
|
11873
|
+
|
11874
|
+
// src/components/sidebar/sidebar.context.ts
|
11875
|
+
var import_react159 = require("@chakra-ui/react");
|
11876
|
+
var {
|
11877
|
+
withContext: withContext7,
|
11878
|
+
useRecipeResult,
|
11879
|
+
StylesProvider,
|
11880
|
+
ClassNamesProvider,
|
11881
|
+
useStyles: useSidebarStyles
|
11882
|
+
} = (0, import_react159.createSlotRecipeContext)({
|
11883
|
+
key: "suiSidebar"
|
11884
|
+
});
|
11885
|
+
var {
|
11886
|
+
withProvider: withItemProvider,
|
11887
|
+
withContext: withItemContext,
|
11888
|
+
useStyles: useSidebarItemStyles
|
11889
|
+
} = (0, import_react159.createSlotRecipeContext)({
|
11890
|
+
key: "suiSidebarNavItem"
|
11891
|
+
});
|
11892
|
+
|
11893
|
+
// src/components/sidebar/sidebar.tsx
|
11894
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
11895
|
+
var SidebarProvider = function SidebarProvider2(props2) {
|
11896
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_sidebar.Sidebar.Provider, { ...props2, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(RecipeProvider, { ...props2, children: props2.children }) });
|
11897
|
+
};
|
11898
|
+
function RecipeProvider(props2) {
|
11899
|
+
const { mode } = (0, import_sidebar.useSidebar)();
|
11900
|
+
const { styles, classNames } = useRecipeResult({
|
11901
|
+
...props2,
|
11902
|
+
mode
|
11903
|
+
});
|
11904
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(StylesProvider, { value: styles, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ClassNamesProvider, { value: classNames, children: props2.children }) });
|
11905
|
+
}
|
11906
|
+
var SidebarRoot = withContext7(
|
11907
|
+
import_sidebar.Sidebar.Root,
|
11908
|
+
"root"
|
11909
|
+
);
|
11910
|
+
var SidebarTrigger = withContext7(
|
11911
|
+
import_sidebar.Sidebar.Trigger,
|
11912
|
+
"trigger",
|
11913
|
+
{
|
11914
|
+
forwardAsChild: true
|
11915
|
+
}
|
11916
|
+
);
|
11917
|
+
var SidebarFlyoutTrigger = withContext7(import_sidebar.Sidebar.FlyoutTrigger, "flyoutTrigger", {
|
11918
|
+
forwardAsChild: true
|
11919
|
+
});
|
11920
|
+
var SidebarBackdrop = withContext7(
|
11921
|
+
import_sidebar.Sidebar.Backdrop,
|
11922
|
+
"backdrop",
|
11923
|
+
{
|
11924
|
+
forwardAsChild: true
|
11925
|
+
}
|
11926
|
+
);
|
11927
|
+
var SidebarHeader = withContext7(
|
11928
|
+
import_sidebar.Sidebar.Header,
|
11929
|
+
"header"
|
11930
|
+
);
|
11931
|
+
var SidebarBody = withContext7(
|
11932
|
+
import_sidebar.Sidebar.Body,
|
11933
|
+
"body"
|
11934
|
+
);
|
11935
|
+
var SidebarFooter = withContext7(
|
11936
|
+
import_sidebar.Sidebar.Footer,
|
11937
|
+
"footer"
|
11938
|
+
);
|
11939
|
+
var SidebarTrack = withContext7(
|
11940
|
+
import_sidebar.Sidebar.Track,
|
11941
|
+
"track",
|
11942
|
+
{
|
11943
|
+
forwardAsChild: true
|
11944
|
+
}
|
11945
|
+
);
|
11946
|
+
var SidebarGroup = withContext7(
|
11947
|
+
import_sidebar.Sidebar.Group,
|
11948
|
+
"group",
|
11949
|
+
{
|
11950
|
+
defaultProps: {
|
11951
|
+
role: "group"
|
11952
|
+
}
|
11953
|
+
}
|
11954
|
+
);
|
11955
|
+
var SidebarGroupHeader = withContext7(
|
11956
|
+
import_sidebar.Sidebar.GroupHeader,
|
11957
|
+
"groupHeader"
|
11958
|
+
);
|
11959
|
+
var SidebarGroupTitle = withContext7(import_sidebar.Sidebar.GroupTitle, "groupTitle");
|
11960
|
+
var SidebarGroupEndElement = withContext7(import_sidebar.Sidebar.GroupEndElement, "groupEndElement");
|
11961
|
+
var SidebarGroupContent = withContext7(
|
11962
|
+
import_sidebar.Sidebar.GroupContent,
|
11963
|
+
"groupContent"
|
11964
|
+
);
|
11965
|
+
var SidebarNavItem = withItemProvider(
|
11966
|
+
import_sidebar.Sidebar.NavItem,
|
11967
|
+
"item"
|
11968
|
+
);
|
11969
|
+
var SidebarNavButton = withItemContext(import_sidebar.Sidebar.NavButton, "button", {
|
11970
|
+
forwardAsChild: true
|
11971
|
+
});
|
11972
|
+
var SidebarNavItemEndElement = withItemContext(import_sidebar.Sidebar.NavItemEndElement, "endElement");
|
11973
|
+
|
11974
|
+
// src/components/sidebar/index.ts
|
11975
|
+
var import_sidebar2 = require("@saas-ui/core/sidebar");
|
11976
|
+
|
11977
|
+
// src/components/toaster/toaster.tsx
|
11978
|
+
var import_react160 = require("@chakra-ui/react");
|
11979
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
11980
|
+
var toast = (0, import_react160.createToaster)({
|
11981
|
+
placement: "bottom-end",
|
11982
|
+
pauseOnPageIdle: true
|
11983
|
+
});
|
11984
|
+
var Toaster = () => {
|
11985
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react160.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react160.Toaster, { toaster: toast, insetInline: { mdDown: "4" }, children: (toast2) => {
|
11986
|
+
var _a7;
|
11987
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_react160.Toast.Root, { width: { md: "sm" }, children: [
|
11988
|
+
toast2.type === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react160.Spinner, { size: "sm", color: "colorPalette.solid" }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react160.Toast.Indicator, {}),
|
11989
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_react160.Stack, { gap: "1", flex: "1", maxWidth: "100%", children: [
|
11990
|
+
toast2.title && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react160.Toast.Title, { children: toast2.title }),
|
11991
|
+
toast2.description && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react160.Toast.Description, { children: toast2.description })
|
11992
|
+
] }),
|
11993
|
+
toast2.action && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react160.Toast.ActionTrigger, { children: toast2.action.label }),
|
11994
|
+
((_a7 = toast2.meta) == null ? void 0 : _a7.closable) && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react160.Toast.CloseTrigger, {})
|
11995
|
+
] });
|
11996
|
+
} }) });
|
11997
|
+
};
|
11998
|
+
|
11999
|
+
// src/components/steps/steps.tsx
|
12000
|
+
var steps_exports = {};
|
12001
|
+
__export(steps_exports, {
|
12002
|
+
CompletedContent: () => StepsCompletedContent,
|
12003
|
+
Content: () => StepsContent,
|
12004
|
+
Indicator: () => StepsIndicator,
|
12005
|
+
Item: () => StepsItem,
|
12006
|
+
List: () => StepsList,
|
12007
|
+
NextTrigger: () => StepsNextTrigger,
|
12008
|
+
PrevTrigger: () => StepsPrevTrigger,
|
12009
|
+
Root: () => StepsRoot
|
12010
|
+
});
|
12011
|
+
var import_react161 = require("@chakra-ui/react");
|
12012
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
12013
|
+
var StepsItem = (props2) => {
|
12014
|
+
const { title, description, completedIcon, icon, ...rest } = props2;
|
12015
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_react161.Steps.Item, { ...rest, children: [
|
12016
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_react161.Steps.Trigger, { children: [
|
12017
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react161.Steps.Indicator, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
12018
|
+
import_react161.Steps.Status,
|
12019
|
+
{
|
12020
|
+
complete: completedIcon || /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(CheckIcon, {}),
|
12021
|
+
incomplete: icon || /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react161.Steps.Number, {})
|
12022
|
+
}
|
12023
|
+
) }),
|
12024
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(StepInfo, { title, description })
|
12025
|
+
] }),
|
12026
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react161.Steps.Separator, {})
|
12027
|
+
] });
|
12028
|
+
};
|
12029
|
+
var StepInfo = (props2) => {
|
12030
|
+
const { title, description } = props2;
|
12031
|
+
if (title && description) {
|
12032
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_react161.Box, { children: [
|
12033
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react161.Steps.Title, { children: title }),
|
12034
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react161.Steps.Description, { children: description })
|
12035
|
+
] });
|
12036
|
+
}
|
12037
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
12038
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react161.Steps.Title, { children: title }),
|
12039
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react161.Steps.Description, { children: description })
|
12040
|
+
] });
|
12041
|
+
};
|
12042
|
+
var StepsIndicator = (props2) => {
|
12043
|
+
const { icon = /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react161.Steps.Number, {}), completedIcon } = props2;
|
12044
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react161.Steps.Indicator, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react161.Steps.Status, { complete: completedIcon, incomplete: icon }) });
|
12045
|
+
};
|
12046
|
+
var StepsList = import_react161.Steps.List;
|
12047
|
+
var StepsRoot = import_react161.Steps.Root;
|
12048
|
+
var StepsContent = import_react161.Steps.Content;
|
12049
|
+
var StepsCompletedContent = import_react161.Steps.CompletedContent;
|
12050
|
+
var StepsNextTrigger = (props2) => {
|
12051
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react161.Steps.NextTrigger, { ...props2 });
|
12052
|
+
};
|
12053
|
+
var StepsPrevTrigger = (props2) => {
|
12054
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react161.Steps.PrevTrigger, { ...props2 });
|
12055
|
+
};
|
12056
|
+
|
12057
|
+
// src/components/switch/switch.tsx
|
12058
|
+
var import_react162 = require("@chakra-ui/react");
|
12059
|
+
var import_react163 = require("react");
|
12060
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
12061
|
+
var Switch = (0, import_react163.forwardRef)(
|
12062
|
+
function Switch2(props2, ref2) {
|
12063
|
+
const { inputProps, children, rootRef, trackLabel, thumbLabel, ...rest } = props2;
|
12064
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_react162.Switch.Root, { ref: rootRef, ...rest, children: [
|
12065
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react162.Switch.HiddenInput, { ref: ref2, ...inputProps }),
|
12066
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_react162.Switch.Control, { children: [
|
12067
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react162.Switch.Thumb, { children: thumbLabel && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react162.Switch.ThumbIndicator, { fallback: thumbLabel == null ? void 0 : thumbLabel.off, children: thumbLabel == null ? void 0 : thumbLabel.on }) }),
|
12068
|
+
trackLabel && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react162.Switch.Indicator, { fallback: trackLabel.off, children: trackLabel.on })
|
12069
|
+
] }),
|
12070
|
+
children != null && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react162.Switch.Label, { children })
|
12071
|
+
] });
|
12072
|
+
}
|
12073
|
+
);
|
12074
|
+
|
12075
|
+
// src/components/tooltip/tooltip.tsx
|
12076
|
+
var import_react164 = require("react");
|
12077
|
+
var import_react165 = require("@chakra-ui/react");
|
12078
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
12079
|
+
var Tooltip = (0, import_react164.forwardRef)(
|
12080
|
+
function Tooltip2(props2, ref2) {
|
12081
|
+
const {
|
12082
|
+
showArrow,
|
12083
|
+
children,
|
12084
|
+
disabled,
|
12085
|
+
portalled,
|
12086
|
+
content,
|
12087
|
+
contentProps,
|
12088
|
+
portalRef,
|
12089
|
+
...rest
|
12090
|
+
} = props2;
|
12091
|
+
if (disabled) return children;
|
12092
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_react165.Tooltip.Root, { ...rest, children: [
|
12093
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react165.Tooltip.Trigger, { asChild: true, children }),
|
12094
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react165.Portal, { disabled: !portalled, container: portalRef, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react165.Tooltip.Positioner, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_react165.Tooltip.Content, { ref: ref2, ...contentProps, children: [
|
12095
|
+
showArrow && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react165.Tooltip.Arrow, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react165.Tooltip.ArrowTip, {}) }),
|
12096
|
+
content
|
12097
|
+
] }) }) })
|
12098
|
+
] });
|
12099
|
+
}
|
12100
|
+
);
|
8440
12101
|
// Annotate the CommonJS export names for ESM import in node:
|
8441
12102
|
0 && (module.exports = {
|
12103
|
+
AppShell,
|
12104
|
+
Avatar,
|
12105
|
+
AvatarGroup,
|
12106
|
+
Breadcrumb,
|
12107
|
+
Button,
|
12108
|
+
Checkbox,
|
12109
|
+
CloseButton,
|
12110
|
+
Command,
|
12111
|
+
Dialog,
|
12112
|
+
Drawer,
|
12113
|
+
EmptyState,
|
12114
|
+
GridList,
|
12115
|
+
IconBadge,
|
12116
|
+
InputGroup,
|
12117
|
+
Link,
|
12118
|
+
LoadingOverlay,
|
12119
|
+
Menu,
|
12120
|
+
Navbar,
|
12121
|
+
NumberInput,
|
12122
|
+
PasswordInput,
|
12123
|
+
Persona,
|
12124
|
+
PersonaAvatar,
|
12125
|
+
PinInput,
|
12126
|
+
Radio,
|
12127
|
+
RadioGroup,
|
12128
|
+
SearchInput,
|
12129
|
+
Select,
|
12130
|
+
Sidebar,
|
12131
|
+
Spinner,
|
12132
|
+
Steps,
|
8442
12133
|
SuiContext,
|
8443
12134
|
SuiProvider,
|
12135
|
+
Switch,
|
12136
|
+
Toaster,
|
12137
|
+
Tooltip,
|
8444
12138
|
createSystem,
|
8445
12139
|
defaultConfig,
|
12140
|
+
defaultPresenceOptions,
|
8446
12141
|
defaultSystem,
|
12142
|
+
toast,
|
8447
12143
|
useLink,
|
8448
|
-
|
8449
|
-
|
12144
|
+
useLoadingOverlayStyles,
|
12145
|
+
useSidebar,
|
12146
|
+
useSidebarItemStyles,
|
12147
|
+
useSidebarStyles,
|
12148
|
+
useSui
|
8450
12149
|
});
|