anicca-ui 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/anicca-ui.css +1 -1
- package/dist/anicca-ui.es.js +2637 -603
- package/dist/anicca-ui.umd.js +30 -1
- package/dist/auth/AuthModal/AuthModal.d.ts +92 -0
- package/dist/auth/AuthModal/index.d.ts +1 -0
- package/dist/auth/index.d.ts +1 -0
- package/dist/dashboard/components/ActivityFeed/ActivityFeed.d.ts +1 -10
- package/dist/dashboard/components/Breadcrumb/Breadcrumb.d.ts +1 -9
- package/dist/dashboard/components/ChartWrapper/ChartWrapper.d.ts +1 -15
- package/dist/dashboard/components/DataTable/DataTable.d.ts +3 -10
- package/dist/dashboard/components/Modal/Modal.d.ts +1 -9
- package/dist/dashboard/components/Navbar/Navbar.d.ts +1 -9
- package/dist/dashboard/components/ProgressCard/ProgressCard.d.ts +1 -14
- package/dist/dashboard/components/Sidebar/Sidebar.d.ts +2 -11
- package/dist/dashboard/components/StatCard/StatCard.d.ts +2 -12
- package/dist/dashboard/components/Tabs/Tabs.d.ts +1 -2
- package/dist/data/Avatar/Avatar.d.ts +31 -0
- package/dist/data/Avatar/index.d.ts +1 -0
- package/dist/data/Badge/Badge.d.ts +16 -0
- package/dist/data/Badge/index.d.ts +1 -0
- package/dist/data/Pagination/Pagination.d.ts +27 -0
- package/dist/data/Pagination/index.d.ts +1 -0
- package/dist/data/Skeleton/Skeleton.d.ts +18 -0
- package/dist/data/Skeleton/index.d.ts +1 -0
- package/dist/data/Spinner/Spinner.d.ts +16 -0
- package/dist/data/Spinner/index.d.ts +1 -0
- package/dist/data/index.d.ts +5 -0
- package/dist/demo/App.d.ts +1 -0
- package/dist/demo/data.d.ts +153 -0
- package/dist/demo/nav.d.ts +5 -0
- package/dist/demo/pages/AdminPage.d.ts +1 -0
- package/dist/demo/pages/DashboardPage.d.ts +1 -0
- package/dist/demo/pages/FormElementPage.d.ts +1 -0
- package/dist/demo/pages/FormValidationPage.d.ts +1 -0
- package/dist/demo/pages/FormWizardPage.d.ts +1 -0
- package/dist/demo/pages/Placeholder.d.ts +4 -0
- package/dist/demo/pages/ProfilePage.d.ts +1 -0
- package/dist/demo/pages/RtlPage.d.ts +1 -0
- package/dist/demo/pages/Settings2Page.d.ts +1 -0
- package/dist/demo/pages/SettingsPage.d.ts +1 -0
- package/dist/demo/pages/TableBasicPage.d.ts +1 -0
- package/dist/demo/pages/TableDataPage.d.ts +1 -0
- package/dist/demo/pages/auth.d.ts +5 -0
- package/dist/demo/pages/dashLayouts.d.ts +10 -0
- package/dist/demo/pages/errors.d.ts +3 -0
- package/dist/demo/pages/extra.d.ts +2 -0
- package/dist/demo/pages/icons.d.ts +3 -0
- package/dist/demo/pages/landing.d.ts +9 -0
- package/dist/demo/pages/maps.d.ts +3 -0
- package/dist/demo/pages/parts.d.ts +45 -0
- package/dist/demo/pages/plugins.d.ts +6 -0
- package/dist/demo/pages/special.d.ts +5 -0
- package/dist/demo/pages/users.d.ts +5 -0
- package/dist/demo/pages/widgets.d.ts +3 -0
- package/dist/demo/theme-init.d.ts +0 -0
- package/dist/demo/theme.d.ts +33 -0
- package/dist/demo/ui/AuthLayout.d.ts +9 -0
- package/dist/demo/ui/HeaderMenus.d.ts +2 -0
- package/dist/demo/ui/LandingLayout.d.ts +7 -0
- package/dist/demo/ui/Modal.d.ts +20 -0
- package/dist/demo/ui/Toast.d.ts +8 -0
- package/dist/demo/ui/UserMenu.d.ts +9 -0
- package/dist/demo/ui/charts.d.ts +29 -0
- package/dist/demo/ui/form.d.ts +54 -0
- package/dist/demo/ui/primitives.d.ts +32 -0
- package/dist/demo.d.ts +1 -0
- package/dist/feedback/Alert/Alert.d.ts +21 -0
- package/dist/feedback/Alert/index.d.ts +1 -0
- package/dist/feedback/Popover/Popover.d.ts +22 -0
- package/dist/feedback/Popover/index.d.ts +1 -0
- package/dist/feedback/Popup/Popup.d.ts +40 -0
- package/dist/feedback/Popup/index.d.ts +1 -0
- package/dist/feedback/Toast/Toast.d.ts +46 -0
- package/dist/feedback/Toast/index.d.ts +1 -0
- package/dist/feedback/Tooltip/Tooltip.d.ts +20 -0
- package/dist/feedback/Tooltip/index.d.ts +1 -0
- package/dist/feedback/index.d.ts +5 -0
- package/dist/index.d.ts +6 -0
- package/dist/layout/Card/Card.d.ts +21 -0
- package/dist/layout/Card/index.d.ts +1 -0
- package/dist/layout/Divider/Divider.d.ts +15 -0
- package/dist/layout/Divider/index.d.ts +1 -0
- package/dist/layout/Grid/Grid.d.ts +23 -0
- package/dist/layout/Grid/index.d.ts +1 -0
- package/dist/layout/Stack/Stack.d.ts +22 -0
- package/dist/layout/Stack/index.d.ts +1 -0
- package/dist/layout/index.d.ts +4 -0
- package/dist/overlay/Combobox/Combobox.d.ts +39 -0
- package/dist/overlay/Combobox/index.d.ts +1 -0
- package/dist/overlay/Drawer/Drawer.d.ts +26 -0
- package/dist/overlay/Drawer/index.d.ts +1 -0
- package/dist/overlay/Dropdown/Dropdown.d.ts +20 -0
- package/dist/overlay/Dropdown/index.d.ts +1 -0
- package/dist/overlay/Menu/Menu.d.ts +22 -0
- package/dist/overlay/Menu/index.d.ts +1 -0
- package/dist/overlay/index.d.ts +4 -0
- package/dist/primitives/Button/Button.d.ts +20 -0
- package/dist/primitives/Button/index.d.ts +1 -0
- package/dist/primitives/Checkbox/Checkbox.d.ts +14 -0
- package/dist/primitives/Checkbox/index.d.ts +1 -0
- package/dist/primitives/Input/Input.d.ts +24 -0
- package/dist/primitives/Input/index.d.ts +1 -0
- package/dist/primitives/Radio/Radio.d.ts +29 -0
- package/dist/primitives/Radio/index.d.ts +1 -0
- package/dist/primitives/Select/Select.d.ts +23 -0
- package/dist/primitives/Select/index.d.ts +1 -0
- package/dist/primitives/Switch/Switch.d.ts +15 -0
- package/dist/primitives/Switch/index.d.ts +1 -0
- package/dist/primitives/Textarea/Textarea.d.ts +18 -0
- package/dist/primitives/Textarea/index.d.ts +1 -0
- package/dist/primitives/index.d.ts +7 -0
- package/dist/theme/AniccaThemeProvider.d.ts +2 -1
- package/dist/theme/types.d.ts +29 -30
- package/package.json +3 -6
package/dist/anicca-ui.es.js
CHANGED
|
@@ -1,287 +1,1900 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
surface: "--
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
textSubtle: "--anicca-text-subtle",
|
|
28
|
-
radius: "--anicca-radius",
|
|
29
|
-
radiusSm: "--anicca-radius-sm",
|
|
30
|
-
radiusLg: "--anicca-radius-lg",
|
|
31
|
-
shadowSm: "--anicca-shadow-sm",
|
|
32
|
-
shadowMd: "--anicca-shadow-md",
|
|
33
|
-
shadowLg: "--anicca-shadow-lg"
|
|
1
|
+
import { jsx as r, jsxs as u, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
+
import U, { useMemo as Q, forwardRef as W, useId as O, useRef as D, useEffect as M, useContext as ne, createContext as ae, useState as S, useCallback as C, isValidElement as oe, cloneElement as ie } from "react";
|
|
3
|
+
import { createPortal as z } from "react-dom";
|
|
4
|
+
const ge = {
|
|
5
|
+
primary: "--primary",
|
|
6
|
+
"on-primary": "--on-primary",
|
|
7
|
+
"primary-container": "--primary-container",
|
|
8
|
+
secondary: "--secondary",
|
|
9
|
+
"secondary-container": "--secondary-container",
|
|
10
|
+
"on-secondary-container": "--on-secondary-container",
|
|
11
|
+
tertiary: "--tertiary",
|
|
12
|
+
error: "--error",
|
|
13
|
+
surface: "--surface",
|
|
14
|
+
"surface-container-lowest": "--surface-container-lowest",
|
|
15
|
+
"surface-container-low": "--surface-container-low",
|
|
16
|
+
"surface-container": "--surface-container",
|
|
17
|
+
"surface-container-high": "--surface-container-high",
|
|
18
|
+
"surface-container-highest": "--surface-container-highest",
|
|
19
|
+
"on-surface": "--on-surface",
|
|
20
|
+
"on-surface-variant": "--on-surface-variant",
|
|
21
|
+
outline: "--outline",
|
|
22
|
+
"outline-variant": "--outline-variant",
|
|
23
|
+
background: "--background",
|
|
24
|
+
"sidebar-bg": "--sidebar-bg",
|
|
25
|
+
violet: "--violet",
|
|
26
|
+
amber: "--amber"
|
|
34
27
|
};
|
|
35
|
-
function
|
|
28
|
+
function ve(t) {
|
|
36
29
|
if (!t) return {};
|
|
37
30
|
const e = {};
|
|
38
|
-
for (const
|
|
39
|
-
const a = t[
|
|
40
|
-
a !== void 0 && (e[
|
|
31
|
+
for (const n of Object.keys(t)) {
|
|
32
|
+
const a = t[n];
|
|
33
|
+
a !== void 0 && (e[ge[n]] = a);
|
|
41
34
|
}
|
|
42
35
|
return e;
|
|
43
36
|
}
|
|
44
|
-
function
|
|
37
|
+
function Or({
|
|
45
38
|
theme: t,
|
|
46
39
|
as: e = "div",
|
|
47
|
-
className:
|
|
40
|
+
className: n,
|
|
48
41
|
children: a
|
|
49
42
|
}) {
|
|
50
|
-
const
|
|
51
|
-
return /* @__PURE__ */
|
|
43
|
+
const o = Q(() => ve(t), [t]);
|
|
44
|
+
return /* @__PURE__ */ r(e, { style: o, className: n, "data-anicca-theme": "", children: a });
|
|
52
45
|
}
|
|
53
|
-
|
|
46
|
+
const ye = {
|
|
47
|
+
primary: "bg-primary text-primary-fg border border-primary hover:opacity-90 active:opacity-100 dark:bg-primary dark:text-primary-fg dark:border-primary",
|
|
48
|
+
secondary: "bg-surface-muted text-text border border-border hover:bg-surface-low dark:bg-surface-container dark:text-text dark:border-border dark:hover:bg-surface-container",
|
|
49
|
+
outline: "bg-transparent text-text border border-border hover:bg-surface-muted dark:text-text dark:border-border dark:hover:bg-surface-container",
|
|
50
|
+
ghost: "bg-transparent text-text border border-transparent hover:bg-surface-muted dark:text-text dark:hover:bg-surface-container",
|
|
51
|
+
danger: "bg-danger text-white border border-danger hover:opacity-90 dark:bg-danger dark:text-white dark:border-danger",
|
|
52
|
+
link: "bg-transparent text-primary border border-transparent underline-offset-4 hover:underline px-0 dark:text-primary"
|
|
53
|
+
}, we = {
|
|
54
|
+
sm: "h-8 px-3 text-[0.78rem] gap-1.5 rounded-lg",
|
|
55
|
+
md: "h-10 px-4 text-[0.875rem] gap-2 rounded-lg",
|
|
56
|
+
lg: "h-12 px-6 text-[0.95rem] gap-2 rounded-a",
|
|
57
|
+
icon: "h-10 w-10 p-0 rounded-lg"
|
|
58
|
+
}, zr = W(function({
|
|
59
|
+
variant: e = "primary",
|
|
60
|
+
size: n = "md",
|
|
61
|
+
loading: a = !1,
|
|
62
|
+
leftIcon: o,
|
|
63
|
+
rightIcon: i,
|
|
64
|
+
fullWidth: l,
|
|
65
|
+
className: m = "",
|
|
66
|
+
disabled: d,
|
|
67
|
+
children: b,
|
|
68
|
+
type: h = "button",
|
|
69
|
+
...c
|
|
70
|
+
}, s) {
|
|
71
|
+
return /* @__PURE__ */ u(
|
|
72
|
+
"button",
|
|
73
|
+
{
|
|
74
|
+
ref: s,
|
|
75
|
+
type: h,
|
|
76
|
+
disabled: d || a,
|
|
77
|
+
"data-loading": a || void 0,
|
|
78
|
+
className: `relative inline-flex items-center justify-center font-semibold tracking-tight transition-[background,color,opacity,border-color] duration-200 ease-out focus-visible:outline-none focus-visible:ring-[var(--anicca-ring-width)] focus-visible:ring-primary/20 disabled:opacity-50 disabled:cursor-not-allowed font-[inherit] ${ye[e]} ${we[n]} ${l ? "w-full" : ""} ${m}`,
|
|
79
|
+
...c,
|
|
80
|
+
children: [
|
|
81
|
+
a && /* @__PURE__ */ r("span", { className: "absolute inset-0 flex items-center justify-center", "aria-hidden": "true", children: /* @__PURE__ */ u("svg", { className: "h-4 w-4 animate-spin", viewBox: "0 0 24 24", fill: "none", children: [
|
|
82
|
+
/* @__PURE__ */ r("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "3", opacity: "0.25" }),
|
|
83
|
+
/* @__PURE__ */ r("path", { d: "M22 12a10 10 0 0 1-10 10", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round" })
|
|
84
|
+
] }) }),
|
|
85
|
+
/* @__PURE__ */ u("span", { className: `inline-flex items-center gap-[inherit] ${a ? "opacity-0" : ""}`, children: [
|
|
86
|
+
o && /* @__PURE__ */ r("span", { className: "inline-flex shrink-0", children: o }),
|
|
87
|
+
b,
|
|
88
|
+
i && /* @__PURE__ */ r("span", { className: "inline-flex shrink-0", children: i })
|
|
89
|
+
] })
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
}), ke = {
|
|
94
|
+
sm: "h-8 text-[0.8rem] rounded-lg",
|
|
95
|
+
md: "h-10 text-[0.875rem] rounded-lg",
|
|
96
|
+
lg: "h-12 text-[0.95rem] rounded-a"
|
|
97
|
+
}, Hr = W(function({
|
|
98
|
+
label: e,
|
|
99
|
+
helper: n,
|
|
100
|
+
error: a,
|
|
101
|
+
required: o,
|
|
102
|
+
leftAddon: i,
|
|
103
|
+
rightAddon: l,
|
|
104
|
+
inputSize: m = "md",
|
|
105
|
+
id: d,
|
|
106
|
+
className: b = "",
|
|
107
|
+
wrapperClassName: h = "",
|
|
108
|
+
disabled: c,
|
|
109
|
+
...s
|
|
110
|
+
}, f) {
|
|
111
|
+
const p = O(), g = d ?? p, N = `${g}-helper`, $ = `${g}-error`, _ = a ? $ : n ? N : void 0;
|
|
112
|
+
return /* @__PURE__ */ u("div", { className: `flex flex-col gap-1.5 ${h}`, children: [
|
|
113
|
+
e && /* @__PURE__ */ u("label", { htmlFor: g, className: "text-[0.78rem] font-semibold text-text", children: [
|
|
114
|
+
e,
|
|
115
|
+
o && /* @__PURE__ */ r("span", { className: "text-danger ml-0.5", children: "*" })
|
|
116
|
+
] }),
|
|
117
|
+
/* @__PURE__ */ u(
|
|
118
|
+
"div",
|
|
119
|
+
{
|
|
120
|
+
className: `group flex items-center gap-2 bg-surface border border-border px-3 transition-[border-color,box-shadow] duration-200 ease-out focus-within:border-primary focus-within:ring-[var(--anicca-ring-width)] focus-within:ring-primary/20 dark:bg-surface dark:border-border dark:focus-within:border-primary ${ke[m]} ${a ? "border-danger focus-within:border-danger focus-within:ring-danger/20" : ""} ${c ? "opacity-50 cursor-not-allowed bg-surface-muted dark:bg-surface-container" : ""}`,
|
|
121
|
+
children: [
|
|
122
|
+
i && /* @__PURE__ */ r("span", { className: "text-text-muted shrink-0 inline-flex items-center", children: i }),
|
|
123
|
+
/* @__PURE__ */ r(
|
|
124
|
+
"input",
|
|
125
|
+
{
|
|
126
|
+
ref: f,
|
|
127
|
+
id: g,
|
|
128
|
+
disabled: c,
|
|
129
|
+
"aria-invalid": a ? !0 : void 0,
|
|
130
|
+
"aria-describedby": _,
|
|
131
|
+
required: o,
|
|
132
|
+
className: `flex-1 min-w-0 bg-transparent outline-none border-none text-text placeholder:text-text-subtle font-[inherit] dark:text-text dark:placeholder:text-text-subtle ${b}`,
|
|
133
|
+
...s
|
|
134
|
+
}
|
|
135
|
+
),
|
|
136
|
+
l && /* @__PURE__ */ r("span", { className: "text-text-muted shrink-0 inline-flex items-center", children: l })
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
),
|
|
140
|
+
a ? /* @__PURE__ */ r("span", { id: $, className: "text-[0.72rem] text-danger font-medium", children: a }) : n ? /* @__PURE__ */ r("span", { id: N, className: "text-[0.72rem] text-text-muted", children: n }) : null
|
|
141
|
+
] });
|
|
142
|
+
}), Vr = W(function({
|
|
143
|
+
label: e,
|
|
144
|
+
helper: n,
|
|
145
|
+
error: a,
|
|
146
|
+
required: o,
|
|
147
|
+
autoResize: i = !1,
|
|
148
|
+
maxHeight: l,
|
|
149
|
+
showCount: m = !1,
|
|
150
|
+
maxLength: d,
|
|
151
|
+
id: b,
|
|
152
|
+
className: h = "",
|
|
153
|
+
wrapperClassName: c = "",
|
|
154
|
+
disabled: s,
|
|
155
|
+
onInput: f,
|
|
156
|
+
value: p,
|
|
157
|
+
defaultValue: g,
|
|
158
|
+
...N
|
|
159
|
+
}, $) {
|
|
160
|
+
const _ = O(), E = b ?? _, k = D(null), x = (y) => {
|
|
161
|
+
k.current = y, typeof $ == "function" ? $(y) : $ && ($.current = y);
|
|
162
|
+
}, w = () => {
|
|
163
|
+
const y = k.current;
|
|
164
|
+
if (!y || !i) return;
|
|
165
|
+
y.style.height = "auto";
|
|
166
|
+
const A = l ? Math.min(y.scrollHeight, l) : y.scrollHeight;
|
|
167
|
+
y.style.height = `${A}px`;
|
|
168
|
+
};
|
|
169
|
+
M(() => {
|
|
170
|
+
w();
|
|
171
|
+
}, [p, g, i, l]);
|
|
172
|
+
const v = typeof p == "string" ? p.length : 0;
|
|
173
|
+
return /* @__PURE__ */ u("div", { className: `flex flex-col gap-1.5 ${c}`, children: [
|
|
174
|
+
e && /* @__PURE__ */ u("label", { htmlFor: E, className: "text-[0.78rem] font-semibold text-text", children: [
|
|
175
|
+
e,
|
|
176
|
+
o && /* @__PURE__ */ r("span", { className: "text-danger ml-0.5", children: "*" })
|
|
177
|
+
] }),
|
|
178
|
+
/* @__PURE__ */ r(
|
|
179
|
+
"textarea",
|
|
180
|
+
{
|
|
181
|
+
ref: x,
|
|
182
|
+
id: E,
|
|
183
|
+
disabled: s,
|
|
184
|
+
required: o,
|
|
185
|
+
maxLength: d,
|
|
186
|
+
value: p,
|
|
187
|
+
defaultValue: g,
|
|
188
|
+
"aria-invalid": a ? !0 : void 0,
|
|
189
|
+
onInput: (y) => {
|
|
190
|
+
w(), f == null || f(y);
|
|
191
|
+
},
|
|
192
|
+
className: `bg-surface border border-border rounded-lg px-3 py-2 text-[0.875rem] text-text placeholder:text-text-subtle outline-none resize-y transition-[border-color,box-shadow] duration-200 ease-out focus:border-primary focus:ring-[var(--anicca-ring-width)] focus:ring-primary/20 font-[inherit] dark:bg-surface dark:border-border dark:text-text dark:placeholder:text-text-subtle dark:focus:border-primary ${a ? "border-danger focus:border-danger focus:ring-danger/20" : ""} ${s ? "opacity-50 cursor-not-allowed bg-surface-muted dark:bg-surface-container" : ""} ${i ? "resize-none overflow-hidden" : ""} ${h}`,
|
|
193
|
+
...N
|
|
194
|
+
}
|
|
195
|
+
),
|
|
196
|
+
/* @__PURE__ */ u("div", { className: "flex justify-between gap-3", children: [
|
|
197
|
+
/* @__PURE__ */ r("span", { className: "text-[0.72rem] flex-1 min-w-0", children: a ? /* @__PURE__ */ r("span", { className: "text-danger font-medium", children: a }) : n ? /* @__PURE__ */ r("span", { className: "text-text-muted", children: n }) : null }),
|
|
198
|
+
m && /* @__PURE__ */ u("span", { className: "text-[0.72rem] text-text-subtle tabular-nums", children: [
|
|
199
|
+
v,
|
|
200
|
+
d ? `/${d}` : ""
|
|
201
|
+
] })
|
|
202
|
+
] })
|
|
203
|
+
] });
|
|
204
|
+
}), Ne = {
|
|
205
|
+
sm: "h-8 text-[0.8rem] rounded-lg pl-3 pr-8",
|
|
206
|
+
md: "h-10 text-[0.875rem] rounded-lg pl-3 pr-9",
|
|
207
|
+
lg: "h-12 text-[0.95rem] rounded-a pl-4 pr-10"
|
|
208
|
+
}, Ur = W(function({
|
|
209
|
+
label: e,
|
|
210
|
+
helper: n,
|
|
211
|
+
error: a,
|
|
212
|
+
required: o,
|
|
213
|
+
options: i,
|
|
214
|
+
placeholder: l,
|
|
215
|
+
selectSize: m = "md",
|
|
216
|
+
id: d,
|
|
217
|
+
className: b = "",
|
|
218
|
+
wrapperClassName: h = "",
|
|
219
|
+
disabled: c,
|
|
220
|
+
children: s,
|
|
221
|
+
value: f,
|
|
222
|
+
defaultValue: p,
|
|
223
|
+
...g
|
|
224
|
+
}, N) {
|
|
225
|
+
const $ = O(), _ = d ?? $;
|
|
226
|
+
return /* @__PURE__ */ u("div", { className: `flex flex-col gap-1.5 ${h}`, children: [
|
|
227
|
+
e && /* @__PURE__ */ u("label", { htmlFor: _, className: "text-[0.78rem] font-semibold text-text", children: [
|
|
228
|
+
e,
|
|
229
|
+
o && /* @__PURE__ */ r("span", { className: "text-danger ml-0.5", children: "*" })
|
|
230
|
+
] }),
|
|
231
|
+
/* @__PURE__ */ u("div", { className: "relative", children: [
|
|
232
|
+
/* @__PURE__ */ u(
|
|
233
|
+
"select",
|
|
234
|
+
{
|
|
235
|
+
ref: N,
|
|
236
|
+
id: _,
|
|
237
|
+
disabled: c,
|
|
238
|
+
required: o,
|
|
239
|
+
"aria-invalid": a ? !0 : void 0,
|
|
240
|
+
value: f,
|
|
241
|
+
defaultValue: p ?? (l && f === void 0 ? "" : void 0),
|
|
242
|
+
className: `appearance-none w-full bg-surface border border-border text-text outline-none cursor-pointer transition-[border-color,box-shadow] duration-200 ease-out focus:border-primary focus:ring-[var(--anicca-ring-width)] focus:ring-primary/20 font-[inherit] dark:bg-surface dark:border-border dark:text-text dark:focus:border-primary ${Ne[m]} ${a ? "border-danger focus:border-danger focus:ring-danger/20" : ""} ${c ? "opacity-50 cursor-not-allowed bg-surface-muted dark:bg-surface-container" : ""} ${b}`,
|
|
243
|
+
...g,
|
|
244
|
+
children: [
|
|
245
|
+
l && /* @__PURE__ */ r("option", { value: "", disabled: !0, hidden: !0, children: l }),
|
|
246
|
+
s ?? (i == null ? void 0 : i.map((E) => /* @__PURE__ */ r("option", { value: E.value, disabled: E.disabled, children: E.label }, E.value)))
|
|
247
|
+
]
|
|
248
|
+
}
|
|
249
|
+
),
|
|
250
|
+
/* @__PURE__ */ r(
|
|
251
|
+
"svg",
|
|
252
|
+
{
|
|
253
|
+
className: "absolute right-3 top-1/2 -translate-y-1/2 w-4 h-4 text-text-muted pointer-events-none",
|
|
254
|
+
viewBox: "0 0 24 24",
|
|
255
|
+
fill: "none",
|
|
256
|
+
stroke: "currentColor",
|
|
257
|
+
strokeWidth: "2",
|
|
258
|
+
"aria-hidden": "true",
|
|
259
|
+
children: /* @__PURE__ */ r("polyline", { points: "6 9 12 15 18 9", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
260
|
+
}
|
|
261
|
+
)
|
|
262
|
+
] }),
|
|
263
|
+
a ? /* @__PURE__ */ r("span", { className: "text-[0.72rem] text-danger font-medium", children: a }) : n ? /* @__PURE__ */ r("span", { className: "text-[0.72rem] text-text-muted", children: n }) : null
|
|
264
|
+
] });
|
|
265
|
+
}), Yr = W(function({
|
|
266
|
+
label: e,
|
|
267
|
+
description: n,
|
|
268
|
+
error: a,
|
|
269
|
+
indeterminate: o = !1,
|
|
270
|
+
id: i,
|
|
271
|
+
className: l = "",
|
|
272
|
+
wrapperClassName: m = "",
|
|
273
|
+
disabled: d,
|
|
274
|
+
checked: b,
|
|
275
|
+
defaultChecked: h,
|
|
276
|
+
...c
|
|
277
|
+
}, s) {
|
|
278
|
+
const f = O(), p = i ?? f, g = D(null), N = ($) => {
|
|
279
|
+
g.current = $, typeof s == "function" ? s($) : s && (s.current = $);
|
|
280
|
+
};
|
|
281
|
+
return M(() => {
|
|
282
|
+
g.current && (g.current.indeterminate = o);
|
|
283
|
+
}, [o]), /* @__PURE__ */ u("label", { htmlFor: p, className: `inline-flex items-start gap-2.5 cursor-pointer ${d ? "opacity-50 cursor-not-allowed" : ""} ${m}`, children: [
|
|
284
|
+
/* @__PURE__ */ u("span", { className: "relative inline-flex items-center justify-center shrink-0 mt-[0.15rem]", children: [
|
|
285
|
+
/* @__PURE__ */ r(
|
|
286
|
+
"input",
|
|
287
|
+
{
|
|
288
|
+
ref: N,
|
|
289
|
+
id: p,
|
|
290
|
+
type: "checkbox",
|
|
291
|
+
disabled: d,
|
|
292
|
+
checked: b,
|
|
293
|
+
defaultChecked: h,
|
|
294
|
+
"aria-invalid": a ? !0 : void 0,
|
|
295
|
+
className: `peer appearance-none w-[18px] h-[18px] border-[1.5px] border-border-strong rounded-xs bg-surface cursor-[inherit] transition-[background-color,border-color,box-shadow] duration-150 checked:bg-primary checked:border-primary indeterminate:bg-primary indeterminate:border-primary focus-visible:outline-none focus-visible:ring-[var(--anicca-ring-width)] focus-visible:ring-primary/20 dark:bg-surface dark:border-border-strong dark:checked:bg-primary dark:checked:border-primary ${a ? "border-danger" : ""} ${l}`,
|
|
296
|
+
...c
|
|
297
|
+
}
|
|
298
|
+
),
|
|
299
|
+
/* @__PURE__ */ r(
|
|
300
|
+
"svg",
|
|
301
|
+
{
|
|
302
|
+
className: "absolute w-3 h-3 text-primary-fg pointer-events-none opacity-0 peer-checked:opacity-100 peer-indeterminate:opacity-0 transition-opacity duration-150",
|
|
303
|
+
viewBox: "0 0 24 24",
|
|
304
|
+
fill: "none",
|
|
305
|
+
stroke: "currentColor",
|
|
306
|
+
strokeWidth: "3",
|
|
307
|
+
"aria-hidden": "true",
|
|
308
|
+
children: /* @__PURE__ */ r("polyline", { points: "20 6 9 17 4 12", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
309
|
+
}
|
|
310
|
+
),
|
|
311
|
+
/* @__PURE__ */ r("span", { className: "absolute w-2.5 h-[2px] bg-primary-fg pointer-events-none opacity-0 peer-indeterminate:opacity-100", "aria-hidden": "true" })
|
|
312
|
+
] }),
|
|
313
|
+
(e || n || a) && /* @__PURE__ */ u("span", { className: "flex flex-col gap-0.5 min-w-0", children: [
|
|
314
|
+
e && /* @__PURE__ */ r("span", { className: "text-[0.85rem] text-text font-medium leading-tight", children: e }),
|
|
315
|
+
n && !a && /* @__PURE__ */ r("span", { className: "text-[0.75rem] text-text-muted leading-snug", children: n }),
|
|
316
|
+
a && /* @__PURE__ */ r("span", { className: "text-[0.72rem] text-danger font-medium leading-snug", children: a })
|
|
317
|
+
] })
|
|
318
|
+
] });
|
|
319
|
+
}), ue = ae(null);
|
|
320
|
+
function Jr({
|
|
321
|
+
name: t,
|
|
322
|
+
value: e,
|
|
323
|
+
defaultValue: n,
|
|
324
|
+
onChange: a,
|
|
325
|
+
orientation: o = "vertical",
|
|
326
|
+
disabled: i,
|
|
327
|
+
label: l,
|
|
328
|
+
error: m,
|
|
329
|
+
className: d = "",
|
|
330
|
+
children: b
|
|
331
|
+
}) {
|
|
332
|
+
const [h, c] = U.useState(n ?? ""), s = e !== void 0, f = s ? e : h, p = (g) => {
|
|
333
|
+
s || c(g), a == null || a(g);
|
|
334
|
+
};
|
|
335
|
+
return /* @__PURE__ */ u("div", { className: `flex flex-col gap-2 ${d}`, role: "radiogroup", "aria-label": l, children: [
|
|
336
|
+
l && /* @__PURE__ */ r("span", { className: "text-[0.78rem] font-semibold text-text", children: l }),
|
|
337
|
+
/* @__PURE__ */ r("div", { className: `flex ${o === "horizontal" ? "flex-row gap-4 flex-wrap" : "flex-col gap-2"}`, children: /* @__PURE__ */ r(ue.Provider, { value: { name: t, value: f, onChange: p, disabled: i }, children: b }) }),
|
|
338
|
+
m && /* @__PURE__ */ r("span", { className: "text-[0.72rem] text-danger font-medium", children: m })
|
|
339
|
+
] });
|
|
340
|
+
}
|
|
341
|
+
const Gr = W(function({ value: e, label: n, description: a, id: o, className: i = "", wrapperClassName: l = "", disabled: m, ...d }, b) {
|
|
342
|
+
const h = O(), c = o ?? h, s = ne(ue), f = m || (s == null ? void 0 : s.disabled), p = s ? s.value === e : d.checked;
|
|
343
|
+
return /* @__PURE__ */ u("label", { htmlFor: c, className: `inline-flex items-start gap-2.5 cursor-pointer ${f ? "opacity-50 cursor-not-allowed" : ""} ${l}`, children: [
|
|
344
|
+
/* @__PURE__ */ u("span", { className: "relative inline-flex items-center justify-center shrink-0 mt-[0.15rem]", children: [
|
|
345
|
+
/* @__PURE__ */ r(
|
|
346
|
+
"input",
|
|
347
|
+
{
|
|
348
|
+
ref: b,
|
|
349
|
+
id: c,
|
|
350
|
+
type: "radio",
|
|
351
|
+
name: (s == null ? void 0 : s.name) ?? d.name,
|
|
352
|
+
value: e,
|
|
353
|
+
checked: p,
|
|
354
|
+
disabled: f,
|
|
355
|
+
onChange: (g) => {
|
|
356
|
+
var N, $;
|
|
357
|
+
(N = s == null ? void 0 : s.onChange) == null || N.call(s, e), ($ = d.onChange) == null || $.call(d, g);
|
|
358
|
+
},
|
|
359
|
+
className: `peer appearance-none w-[18px] h-[18px] border-[1.5px] border-border-strong rounded-full bg-surface cursor-[inherit] transition-[border-color,box-shadow] duration-150 checked:border-primary focus-visible:outline-none focus-visible:ring-[var(--anicca-ring-width)] focus-visible:ring-primary/20 dark:bg-surface dark:border-border-strong dark:checked:border-primary ${i}`,
|
|
360
|
+
...d
|
|
361
|
+
}
|
|
362
|
+
),
|
|
363
|
+
/* @__PURE__ */ r("span", { className: "absolute w-[8px] h-[8px] rounded-full bg-primary pointer-events-none opacity-0 peer-checked:opacity-100 transition-opacity duration-150", "aria-hidden": "true" })
|
|
364
|
+
] }),
|
|
365
|
+
(n || a) && /* @__PURE__ */ u("span", { className: "flex flex-col gap-0.5 min-w-0", children: [
|
|
366
|
+
n && /* @__PURE__ */ r("span", { className: "text-[0.85rem] text-text font-medium leading-tight", children: n }),
|
|
367
|
+
a && /* @__PURE__ */ r("span", { className: "text-[0.75rem] text-text-muted leading-snug", children: a })
|
|
368
|
+
] })
|
|
369
|
+
] });
|
|
370
|
+
}), $e = {
|
|
371
|
+
sm: { track: "w-8 h-[18px]", thumb: "w-3.5 h-3.5", translate: "peer-checked:translate-x-[14px]" },
|
|
372
|
+
md: { track: "w-10 h-[22px]", thumb: "w-[18px] h-[18px]", translate: "peer-checked:translate-x-[18px]" },
|
|
373
|
+
lg: { track: "w-12 h-7", thumb: "w-6 h-6", translate: "peer-checked:translate-x-5" }
|
|
374
|
+
}, Zr = W(function({
|
|
375
|
+
label: e,
|
|
376
|
+
description: n,
|
|
377
|
+
switchSize: a = "md",
|
|
378
|
+
labelPosition: o = "right",
|
|
379
|
+
id: i,
|
|
380
|
+
className: l = "",
|
|
381
|
+
wrapperClassName: m = "",
|
|
382
|
+
disabled: d,
|
|
383
|
+
...b
|
|
384
|
+
}, h) {
|
|
385
|
+
const c = O(), s = i ?? c, { track: f, thumb: p, translate: g } = $e[a], N = /* @__PURE__ */ u("span", { className: `relative inline-flex items-center shrink-0 ${f}`, children: [
|
|
386
|
+
/* @__PURE__ */ r(
|
|
387
|
+
"input",
|
|
388
|
+
{
|
|
389
|
+
ref: h,
|
|
390
|
+
id: s,
|
|
391
|
+
type: "checkbox",
|
|
392
|
+
role: "switch",
|
|
393
|
+
disabled: d,
|
|
394
|
+
className: `peer appearance-none w-full h-full bg-border-strong rounded-full cursor-[inherit] transition-colors duration-200 ease-out checked:bg-primary focus-visible:outline-none focus-visible:ring-[var(--anicca-ring-width)] focus-visible:ring-primary/20 dark:bg-border dark:checked:bg-primary ${l}`,
|
|
395
|
+
...b
|
|
396
|
+
}
|
|
397
|
+
),
|
|
398
|
+
/* @__PURE__ */ r(
|
|
399
|
+
"span",
|
|
400
|
+
{
|
|
401
|
+
className: `absolute left-0.5 ${p} bg-surface rounded-full transition-transform duration-200 ease-out pointer-events-none ${g}`,
|
|
402
|
+
"aria-hidden": "true",
|
|
403
|
+
style: { boxShadow: "0 2px 4px rgba(0,0,0,0.15)" }
|
|
404
|
+
}
|
|
405
|
+
)
|
|
406
|
+
] }), $ = (e || n) && /* @__PURE__ */ u("span", { className: "flex flex-col gap-0.5 min-w-0", children: [
|
|
407
|
+
e && /* @__PURE__ */ r("span", { className: "text-[0.85rem] text-text font-medium leading-tight", children: e }),
|
|
408
|
+
n && /* @__PURE__ */ r("span", { className: "text-[0.75rem] text-text-muted leading-snug", children: n })
|
|
409
|
+
] });
|
|
410
|
+
return /* @__PURE__ */ u("label", { htmlFor: s, className: `inline-flex items-center gap-3 cursor-pointer ${d ? "opacity-50 cursor-not-allowed" : ""} ${m}`, children: [
|
|
411
|
+
o === "left" && $,
|
|
412
|
+
N,
|
|
413
|
+
o === "right" && $
|
|
414
|
+
] });
|
|
415
|
+
}), _e = {
|
|
416
|
+
elevated: "bg-surface border border-text/[0.06] shadow-md dark:bg-surface dark:border-border/50 dark:shadow-md",
|
|
417
|
+
outlined: "bg-surface border border-border dark:bg-surface dark:border-border",
|
|
418
|
+
flat: "bg-surface-muted border border-transparent dark:bg-surface-container"
|
|
419
|
+
};
|
|
420
|
+
function qr({
|
|
421
|
+
variant: t = "elevated",
|
|
422
|
+
accent: e,
|
|
423
|
+
unpadded: n,
|
|
424
|
+
className: a = "",
|
|
425
|
+
style: o,
|
|
426
|
+
children: i,
|
|
427
|
+
...l
|
|
428
|
+
}) {
|
|
429
|
+
return /* @__PURE__ */ r(
|
|
430
|
+
"div",
|
|
431
|
+
{
|
|
432
|
+
className: `rounded-a ${n ? "" : "p-6"} ${_e[t]} ${e ? "border-l-4" : ""} ${a}`,
|
|
433
|
+
style: { ...e ? { borderLeftColor: e } : {}, ...o },
|
|
434
|
+
...l,
|
|
435
|
+
children: i
|
|
436
|
+
}
|
|
437
|
+
);
|
|
438
|
+
}
|
|
439
|
+
function Kr({ className: t = "", children: e, ...n }) {
|
|
440
|
+
return /* @__PURE__ */ r("div", { className: `px-6 py-5 border-b border-border flex items-center justify-between gap-3 ${t}`, ...n, children: e });
|
|
441
|
+
}
|
|
442
|
+
function Xr({ className: t = "", children: e, ...n }) {
|
|
443
|
+
return /* @__PURE__ */ r("h3", { className: `text-[1rem] font-bold text-text tracking-tight m-0 ${t}`, ...n, children: e });
|
|
444
|
+
}
|
|
445
|
+
function Qr({ className: t = "", children: e, ...n }) {
|
|
446
|
+
return /* @__PURE__ */ r("p", { className: `text-[0.82rem] text-text-muted m-0 ${t}`, ...n, children: e });
|
|
447
|
+
}
|
|
448
|
+
function et({ className: t = "", children: e, ...n }) {
|
|
449
|
+
return /* @__PURE__ */ r("div", { className: `px-6 py-5 text-text ${t}`, ...n, children: e });
|
|
450
|
+
}
|
|
451
|
+
function rt({ className: t = "", children: e, ...n }) {
|
|
452
|
+
return /* @__PURE__ */ r("div", { className: `px-6 py-4 border-t border-border flex items-center justify-end gap-2 ${t}`, ...n, children: e });
|
|
453
|
+
}
|
|
454
|
+
const Ae = {
|
|
455
|
+
start: "items-start",
|
|
456
|
+
center: "items-center",
|
|
457
|
+
end: "items-end",
|
|
458
|
+
stretch: "items-stretch",
|
|
459
|
+
baseline: "items-baseline"
|
|
460
|
+
}, Le = {
|
|
461
|
+
start: "justify-start",
|
|
462
|
+
center: "justify-center",
|
|
463
|
+
end: "justify-end",
|
|
464
|
+
between: "justify-between",
|
|
465
|
+
around: "justify-around",
|
|
466
|
+
evenly: "justify-evenly"
|
|
467
|
+
};
|
|
468
|
+
function tt({
|
|
469
|
+
direction: t = "vertical",
|
|
470
|
+
gap: e = 1,
|
|
471
|
+
align: n,
|
|
472
|
+
justify: a,
|
|
473
|
+
wrap: o,
|
|
474
|
+
divider: i,
|
|
475
|
+
as: l = "div",
|
|
476
|
+
className: m = "",
|
|
477
|
+
style: d,
|
|
478
|
+
children: b,
|
|
479
|
+
...h
|
|
480
|
+
}) {
|
|
481
|
+
const c = l, s = typeof e == "number" ? `${e}rem` : e;
|
|
482
|
+
if (i !== void 0) {
|
|
483
|
+
const f = U.Children.toArray(b).filter(Boolean), p = [];
|
|
484
|
+
f.forEach((g, N) => {
|
|
485
|
+
p.push(g), N < f.length - 1 && p.push(/* @__PURE__ */ r(U.Fragment, { children: i }, `anicca-stack-divider-${N}`));
|
|
486
|
+
}), b = p;
|
|
487
|
+
}
|
|
488
|
+
return /* @__PURE__ */ r(
|
|
489
|
+
c,
|
|
490
|
+
{
|
|
491
|
+
className: `flex ${t === "vertical" ? "flex-col" : "flex-row"} ${o && t === "horizontal" ? "flex-wrap" : ""} ${n ? Ae[n] : ""} ${a ? Le[a] : ""} ${m}`,
|
|
492
|
+
style: { gap: s, ...d },
|
|
493
|
+
...h,
|
|
494
|
+
children: b
|
|
495
|
+
}
|
|
496
|
+
);
|
|
497
|
+
}
|
|
498
|
+
function Se(t) {
|
|
499
|
+
if (t !== void 0)
|
|
500
|
+
return typeof t == "number" ? `repeat(${t}, minmax(0, 1fr))` : t;
|
|
501
|
+
}
|
|
502
|
+
function nt({
|
|
503
|
+
columns: t = 1,
|
|
504
|
+
responsive: e,
|
|
505
|
+
gap: n = 1,
|
|
506
|
+
minChildWidth: a,
|
|
507
|
+
as: o = "div",
|
|
508
|
+
className: i = "",
|
|
509
|
+
style: l,
|
|
510
|
+
children: m,
|
|
511
|
+
...d
|
|
512
|
+
}) {
|
|
513
|
+
const b = o, h = typeof n == "number" ? `${n}rem` : n, c = a ? `repeat(auto-fit, minmax(${a}, 1fr))` : Se((e == null ? void 0 : e.base) ?? t), s = { display: "grid", gap: h, gridTemplateColumns: c, ...l };
|
|
514
|
+
return /* @__PURE__ */ r(
|
|
515
|
+
b,
|
|
516
|
+
{
|
|
517
|
+
"data-anicca-grid": "",
|
|
518
|
+
"data-responsive": e ? JSON.stringify(e) : void 0,
|
|
519
|
+
className: i,
|
|
520
|
+
style: s,
|
|
521
|
+
...d,
|
|
522
|
+
children: m
|
|
523
|
+
}
|
|
524
|
+
);
|
|
525
|
+
}
|
|
526
|
+
function at({
|
|
527
|
+
orientation: t = "horizontal",
|
|
528
|
+
label: e,
|
|
529
|
+
variant: n = "solid",
|
|
530
|
+
thickness: a = 1,
|
|
531
|
+
className: o = "",
|
|
532
|
+
style: i,
|
|
533
|
+
...l
|
|
534
|
+
}) {
|
|
535
|
+
return t === "vertical" ? /* @__PURE__ */ r(
|
|
536
|
+
"div",
|
|
537
|
+
{
|
|
538
|
+
role: "separator",
|
|
539
|
+
"aria-orientation": "vertical",
|
|
540
|
+
className: `self-stretch ${o}`,
|
|
541
|
+
style: {
|
|
542
|
+
borderLeftWidth: a,
|
|
543
|
+
borderLeftStyle: n,
|
|
544
|
+
borderColor: "rgb(var(--anicca-border))",
|
|
545
|
+
...i
|
|
546
|
+
},
|
|
547
|
+
...l
|
|
548
|
+
}
|
|
549
|
+
) : e ? /* @__PURE__ */ u("div", { role: "separator", "aria-orientation": "horizontal", className: `flex items-center gap-3 ${o}`, ...l, children: [
|
|
550
|
+
/* @__PURE__ */ r("span", { className: "flex-1", style: { borderTopWidth: a, borderTopStyle: n, borderColor: "rgb(var(--anicca-border))" } }),
|
|
551
|
+
/* @__PURE__ */ r("span", { className: "text-[0.72rem] uppercase tracking-[0.08em] text-text-muted font-semibold dark:text-text-subtle", children: e }),
|
|
552
|
+
/* @__PURE__ */ r("span", { className: "flex-1", style: { borderTopWidth: a, borderTopStyle: n, borderColor: "rgb(var(--anicca-border))" } })
|
|
553
|
+
] }) : /* @__PURE__ */ r(
|
|
554
|
+
"div",
|
|
555
|
+
{
|
|
556
|
+
role: "separator",
|
|
557
|
+
"aria-orientation": "horizontal",
|
|
558
|
+
className: o,
|
|
559
|
+
style: {
|
|
560
|
+
borderTopWidth: a,
|
|
561
|
+
borderTopStyle: n,
|
|
562
|
+
borderColor: "rgb(var(--anicca-border))",
|
|
563
|
+
...i
|
|
564
|
+
},
|
|
565
|
+
...l
|
|
566
|
+
}
|
|
567
|
+
);
|
|
568
|
+
}
|
|
569
|
+
const Te = {
|
|
570
|
+
neutral: "bg-surface-muted text-text-muted",
|
|
571
|
+
primary: "bg-primary-soft text-primary",
|
|
572
|
+
success: "bg-success-bg text-success",
|
|
573
|
+
warning: "bg-warning-bg text-warning",
|
|
574
|
+
danger: "bg-danger-bg text-danger",
|
|
575
|
+
info: "bg-info-bg text-info"
|
|
576
|
+
}, Ce = {
|
|
577
|
+
neutral: "bg-text text-surface",
|
|
578
|
+
primary: "bg-primary text-primary-fg",
|
|
579
|
+
success: "bg-success text-primary-fg",
|
|
580
|
+
warning: "bg-warning text-primary-fg",
|
|
581
|
+
danger: "bg-danger text-primary-fg",
|
|
582
|
+
info: "bg-info text-primary-fg"
|
|
583
|
+
}, Ee = {
|
|
584
|
+
neutral: "border border-border text-text-muted",
|
|
585
|
+
primary: "border border-primary text-primary",
|
|
586
|
+
success: "border border-success text-success",
|
|
587
|
+
warning: "border border-warning text-warning",
|
|
588
|
+
danger: "border border-danger text-danger",
|
|
589
|
+
info: "border border-info text-info"
|
|
590
|
+
}, Me = {
|
|
591
|
+
neutral: "bg-text-muted",
|
|
592
|
+
primary: "bg-primary",
|
|
593
|
+
success: "bg-success",
|
|
594
|
+
warning: "bg-warning",
|
|
595
|
+
danger: "bg-danger",
|
|
596
|
+
info: "bg-info"
|
|
597
|
+
}, je = {
|
|
598
|
+
sm: "h-5 px-2 text-[0.65rem]",
|
|
599
|
+
md: "h-6 px-2.5 text-[0.72rem]"
|
|
600
|
+
};
|
|
601
|
+
function ot({
|
|
602
|
+
variant: t = "neutral",
|
|
603
|
+
size: e = "md",
|
|
604
|
+
appearance: n = "soft",
|
|
605
|
+
dot: a,
|
|
606
|
+
className: o = "",
|
|
607
|
+
children: i,
|
|
608
|
+
...l
|
|
609
|
+
}) {
|
|
610
|
+
const m = n === "solid" ? Ce[t] : n === "outlined" ? Ee[t] : Te[t];
|
|
611
|
+
return /* @__PURE__ */ u(
|
|
612
|
+
"span",
|
|
613
|
+
{
|
|
614
|
+
className: `inline-flex items-center gap-1.5 rounded-full font-semibold whitespace-nowrap leading-none tracking-tight ${je[e]} ${m} ${o}`,
|
|
615
|
+
...l,
|
|
616
|
+
children: [
|
|
617
|
+
a && /* @__PURE__ */ r("span", { className: `inline-block w-1.5 h-1.5 rounded-full ${Me[t]}`, "aria-hidden": "true" }),
|
|
618
|
+
i
|
|
619
|
+
]
|
|
620
|
+
}
|
|
621
|
+
);
|
|
622
|
+
}
|
|
623
|
+
const fe = {
|
|
624
|
+
xs: 24,
|
|
625
|
+
sm: 32,
|
|
626
|
+
md: 40,
|
|
627
|
+
lg: 56,
|
|
628
|
+
xl: 72
|
|
629
|
+
}, Ie = {
|
|
630
|
+
online: "var(--anicca-success)",
|
|
631
|
+
offline: "var(--anicca-text-subtle)",
|
|
632
|
+
busy: "var(--anicca-danger)",
|
|
633
|
+
away: "var(--anicca-warning)"
|
|
634
|
+
}, De = {
|
|
635
|
+
circle: "rounded-full",
|
|
636
|
+
rounded: "rounded-lg",
|
|
637
|
+
square: "rounded-none"
|
|
638
|
+
};
|
|
639
|
+
function Be(t) {
|
|
640
|
+
return t ? t.split(/\s+/).filter(Boolean).slice(0, 2).map((e) => e[0].toUpperCase()).join("") : "?";
|
|
641
|
+
}
|
|
642
|
+
function Fe({
|
|
643
|
+
src: t,
|
|
644
|
+
alt: e,
|
|
645
|
+
name: n,
|
|
646
|
+
fallback: a,
|
|
647
|
+
size: o = "md",
|
|
648
|
+
shape: i = "circle",
|
|
649
|
+
status: l,
|
|
650
|
+
className: m = "",
|
|
651
|
+
style: d,
|
|
652
|
+
...b
|
|
653
|
+
}) {
|
|
654
|
+
const [h, c] = S(!1), s = typeof o == "number" ? o : fe[o], f = s * 0.4, p = t && !h;
|
|
655
|
+
return /* @__PURE__ */ u(
|
|
656
|
+
"span",
|
|
657
|
+
{
|
|
658
|
+
className: `relative inline-flex items-center justify-center bg-surface-muted text-text-muted overflow-hidden border border-border dark:bg-surface-container dark:text-text-muted dark:border-border ${De[i]} ${m}`,
|
|
659
|
+
style: { width: s, height: s, fontSize: f, ...d },
|
|
660
|
+
role: "img",
|
|
661
|
+
"aria-label": e ?? n ?? "avatar",
|
|
662
|
+
...b,
|
|
663
|
+
children: [
|
|
664
|
+
p ? /* @__PURE__ */ r("img", { src: t, alt: e ?? n ?? "", onError: () => c(!0), className: "w-full h-full object-cover" }) : /* @__PURE__ */ r("span", { className: "font-bold tracking-tight", children: a ?? Be(n) }),
|
|
665
|
+
l && /* @__PURE__ */ r(
|
|
666
|
+
"span",
|
|
667
|
+
{
|
|
668
|
+
className: "absolute bottom-0 right-0 rounded-full border-2 border-surface",
|
|
669
|
+
style: { width: s * 0.28, height: s * 0.28, background: Ie[l] },
|
|
670
|
+
"aria-label": l
|
|
671
|
+
}
|
|
672
|
+
)
|
|
673
|
+
]
|
|
674
|
+
}
|
|
675
|
+
);
|
|
676
|
+
}
|
|
677
|
+
function it({
|
|
678
|
+
max: t = 4,
|
|
679
|
+
spacing: e = 8,
|
|
680
|
+
size: n = "md",
|
|
681
|
+
className: a = "",
|
|
682
|
+
style: o,
|
|
683
|
+
children: i,
|
|
684
|
+
...l
|
|
685
|
+
}) {
|
|
686
|
+
const m = U.Children.toArray(i).filter(Boolean), d = m.slice(0, t), b = m.length - d.length, h = typeof n == "number" ? n : fe[n];
|
|
687
|
+
return /* @__PURE__ */ u("div", { className: `flex ${a}`, style: o, ...l, children: [
|
|
688
|
+
d.map((c, s) => /* @__PURE__ */ r("span", { style: { marginLeft: s === 0 ? 0 : -e }, className: "ring-2 ring-surface rounded-full", children: U.isValidElement(c) && c.type === Fe ? U.cloneElement(c, { size: n }) : c }, s)),
|
|
689
|
+
b > 0 && /* @__PURE__ */ u(
|
|
690
|
+
"span",
|
|
691
|
+
{
|
|
692
|
+
className: "inline-flex items-center justify-center bg-surface-muted text-text-muted rounded-full border-2 border-surface font-semibold",
|
|
693
|
+
style: { width: h, height: h, fontSize: h * 0.36, marginLeft: -e },
|
|
694
|
+
children: [
|
|
695
|
+
"+",
|
|
696
|
+
b
|
|
697
|
+
]
|
|
698
|
+
}
|
|
699
|
+
)
|
|
700
|
+
] });
|
|
701
|
+
}
|
|
702
|
+
function st({
|
|
703
|
+
variant: t = "rect",
|
|
704
|
+
width: e,
|
|
705
|
+
height: n,
|
|
706
|
+
lines: a = 1,
|
|
707
|
+
static: o,
|
|
708
|
+
className: i = "",
|
|
709
|
+
style: l,
|
|
710
|
+
...m
|
|
711
|
+
}) {
|
|
712
|
+
const d = `${o ? "" : "anicca-shimmer"} block bg-surface-muted dark:bg-surface-container`, b = typeof e == "number" ? `${e}px` : e, h = typeof n == "number" ? `${n}px` : n;
|
|
713
|
+
if (t === "circle") {
|
|
714
|
+
const c = b ?? h ?? "2.5rem";
|
|
715
|
+
return /* @__PURE__ */ r(
|
|
716
|
+
"span",
|
|
717
|
+
{
|
|
718
|
+
className: `${d} rounded-full ${i}`,
|
|
719
|
+
style: { width: c, height: c, ...l },
|
|
720
|
+
"aria-hidden": "true",
|
|
721
|
+
...m
|
|
722
|
+
}
|
|
723
|
+
);
|
|
724
|
+
}
|
|
725
|
+
return t === "text" ? /* @__PURE__ */ r("span", { className: `flex flex-col gap-1.5 ${i}`, "aria-hidden": "true", ...m, children: Array.from({ length: a }).map((c, s) => /* @__PURE__ */ r(
|
|
726
|
+
"span",
|
|
727
|
+
{
|
|
728
|
+
className: `${d} rounded-xs`,
|
|
729
|
+
style: {
|
|
730
|
+
width: s === a - 1 && a > 1 ? "70%" : b ?? "100%",
|
|
731
|
+
height: h ?? "0.875rem"
|
|
732
|
+
}
|
|
733
|
+
},
|
|
734
|
+
s
|
|
735
|
+
)) }) : /* @__PURE__ */ r(
|
|
736
|
+
"span",
|
|
737
|
+
{
|
|
738
|
+
className: `${d} rounded-lg ${i}`,
|
|
739
|
+
style: { width: b ?? "100%", height: h ?? "1rem", ...l },
|
|
740
|
+
"aria-hidden": "true",
|
|
741
|
+
...m
|
|
742
|
+
}
|
|
743
|
+
);
|
|
744
|
+
}
|
|
745
|
+
const Re = {
|
|
746
|
+
xs: 12,
|
|
747
|
+
sm: 16,
|
|
748
|
+
md: 24,
|
|
749
|
+
lg: 32,
|
|
750
|
+
xl: 48
|
|
751
|
+
};
|
|
752
|
+
function ct({
|
|
753
|
+
size: t = "md",
|
|
754
|
+
thickness: e = 2.5,
|
|
755
|
+
color: n,
|
|
756
|
+
label: a = "Loading",
|
|
757
|
+
className: o = "",
|
|
758
|
+
style: i,
|
|
759
|
+
...l
|
|
760
|
+
}) {
|
|
761
|
+
const m = typeof t == "number" ? t : Re[t];
|
|
762
|
+
return /* @__PURE__ */ u(
|
|
763
|
+
"span",
|
|
764
|
+
{
|
|
765
|
+
role: "status",
|
|
766
|
+
"aria-label": a,
|
|
767
|
+
className: `inline-flex items-center justify-center text-primary ${o}`,
|
|
768
|
+
style: { color: n, ...i },
|
|
769
|
+
...l,
|
|
770
|
+
children: [
|
|
771
|
+
/* @__PURE__ */ u("svg", { className: "animate-spin", width: m, height: m, viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
|
|
772
|
+
/* @__PURE__ */ r("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: e, opacity: "0.2" }),
|
|
773
|
+
/* @__PURE__ */ r("path", { d: "M22 12a10 10 0 0 1-10 10", stroke: "currentColor", strokeWidth: e, strokeLinecap: "round" })
|
|
774
|
+
] }),
|
|
775
|
+
/* @__PURE__ */ r("span", { className: "sr-only", children: a })
|
|
776
|
+
]
|
|
777
|
+
}
|
|
778
|
+
);
|
|
779
|
+
}
|
|
780
|
+
const Pe = {
|
|
781
|
+
previous: "← Prev",
|
|
782
|
+
next: "Next →",
|
|
783
|
+
page: "Page",
|
|
784
|
+
goToPage: (t) => `Go to page ${t}`
|
|
785
|
+
};
|
|
786
|
+
function V(t, e) {
|
|
787
|
+
return Array.from({ length: e - t + 1 }, (n, a) => t + a);
|
|
788
|
+
}
|
|
789
|
+
function We(t, e, n, a) {
|
|
790
|
+
const o = a * 2 + n * 2 + 3;
|
|
791
|
+
if (e <= o) return V(1, e);
|
|
792
|
+
const i = Math.max(t - n, a + 2), l = Math.min(t + n, e - a - 1), m = i > a + 2, d = l < e - a - 1, b = V(1, a), h = V(e - a + 1, e), c = [...b];
|
|
793
|
+
return m ? c.push("ellipsis") : c.push(...V(a + 1, i - 1)), c.push(...V(i, l)), d ? c.push("ellipsis") : c.push(...V(l + 1, e - a)), c.push(...h), c;
|
|
794
|
+
}
|
|
795
|
+
function dt({
|
|
796
|
+
page: t,
|
|
797
|
+
pageCount: e,
|
|
798
|
+
onPageChange: n,
|
|
799
|
+
siblingCount: a = 1,
|
|
800
|
+
boundaryCount: o = 1,
|
|
801
|
+
hideControls: i = !1,
|
|
802
|
+
labels: l,
|
|
803
|
+
className: m = "",
|
|
804
|
+
...d
|
|
805
|
+
}) {
|
|
806
|
+
const b = { ...Pe, ...l }, h = We(t, e, a, o), c = "min-w-[34px] h-[34px] px-2 inline-flex items-center justify-center text-[0.82rem] font-semibold rounded-lg border transition-[background-color,border-color,color] duration-150 focus-visible:outline-none focus-visible:ring-[var(--anicca-ring-width)] focus-visible:ring-primary-soft disabled:opacity-40 disabled:cursor-not-allowed";
|
|
807
|
+
return /* @__PURE__ */ u("nav", { className: `flex items-center gap-1.5 ${m}`, "aria-label": "Pagination", ...d, children: [
|
|
808
|
+
!i && /* @__PURE__ */ r(
|
|
809
|
+
"button",
|
|
810
|
+
{
|
|
811
|
+
type: "button",
|
|
812
|
+
className: `${c} bg-surface text-text-muted border-border hover:enabled:border-primary hover:enabled:text-primary`,
|
|
813
|
+
disabled: t <= 1,
|
|
814
|
+
onClick: () => n(t - 1),
|
|
815
|
+
children: b.previous
|
|
816
|
+
}
|
|
817
|
+
),
|
|
818
|
+
h.map(
|
|
819
|
+
(s, f) => {
|
|
820
|
+
var p;
|
|
821
|
+
return s === "ellipsis" ? /* @__PURE__ */ r("span", { className: "px-1 text-text-subtle select-none", children: "…" }, `e${f}`) : /* @__PURE__ */ r(
|
|
822
|
+
"button",
|
|
823
|
+
{
|
|
824
|
+
type: "button",
|
|
825
|
+
"aria-current": s === t ? "page" : void 0,
|
|
826
|
+
"aria-label": (p = b.goToPage) == null ? void 0 : p.call(b, s),
|
|
827
|
+
onClick: () => n(s),
|
|
828
|
+
className: `${c} ${s === t ? "bg-primary text-primary-fg border-primary" : "bg-surface text-text-muted border-border hover:enabled:border-primary hover:enabled:text-primary"}`,
|
|
829
|
+
children: s
|
|
830
|
+
},
|
|
831
|
+
s
|
|
832
|
+
);
|
|
833
|
+
}
|
|
834
|
+
),
|
|
835
|
+
!i && /* @__PURE__ */ r(
|
|
836
|
+
"button",
|
|
837
|
+
{
|
|
838
|
+
type: "button",
|
|
839
|
+
className: `${c} bg-surface text-text-muted border-border hover:enabled:border-primary hover:enabled:text-primary`,
|
|
840
|
+
disabled: t >= e,
|
|
841
|
+
onClick: () => n(t + 1),
|
|
842
|
+
children: b.next
|
|
843
|
+
}
|
|
844
|
+
)
|
|
845
|
+
] });
|
|
846
|
+
}
|
|
847
|
+
const Oe = {
|
|
848
|
+
info: "bg-info-bg border-info/40 text-info dark:bg-info/20 dark:border-info/30 dark:text-info",
|
|
849
|
+
success: "bg-success-bg border-success/40 text-success dark:bg-success/20 dark:border-success/30 dark:text-success",
|
|
850
|
+
warning: "bg-warning-bg border-warning/40 text-warning dark:bg-warning/20 dark:border-warning/30 dark:text-warning",
|
|
851
|
+
danger: "bg-danger-bg border-danger/40 text-danger dark:bg-danger/20 dark:border-danger/30 dark:text-danger",
|
|
852
|
+
neutral: "bg-surface-muted border-border text-text dark:bg-surface-container dark:border-border dark:text-text"
|
|
853
|
+
}, ze = {
|
|
854
|
+
info: "bg-surface border-info text-info dark:bg-surface dark:border-info dark:text-info",
|
|
855
|
+
success: "bg-surface border-success text-success dark:bg-surface dark:border-success dark:text-success",
|
|
856
|
+
warning: "bg-surface border-warning text-warning dark:bg-surface dark:border-warning dark:text-warning",
|
|
857
|
+
danger: "bg-surface border-danger text-danger dark:bg-surface dark:border-danger dark:text-danger",
|
|
858
|
+
neutral: "bg-surface border-border text-text dark:bg-surface dark:border-border dark:text-text"
|
|
859
|
+
}, He = {
|
|
860
|
+
info: /* @__PURE__ */ r(G, { d: "M12 8h.01M11 12h1v4h1" }),
|
|
861
|
+
success: /* @__PURE__ */ r(G, { d: "M20 6L9 17l-5-5" }),
|
|
862
|
+
warning: /* @__PURE__ */ r(G, { d: "M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }),
|
|
863
|
+
danger: /* @__PURE__ */ r(G, { d: "M10 14l4-4m0 4l-4-4M12 22a10 10 0 110-20 10 10 0 010 20z" }),
|
|
864
|
+
neutral: /* @__PURE__ */ r(G, { d: "M12 8h.01M11 12h1v4h1" })
|
|
865
|
+
};
|
|
866
|
+
function G({ d: t }) {
|
|
867
|
+
return /* @__PURE__ */ r("svg", { className: "w-5 h-5 shrink-0", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": "true", children: /* @__PURE__ */ r("path", { d: t, strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
868
|
+
}
|
|
869
|
+
function lt({
|
|
870
|
+
variant: t = "info",
|
|
871
|
+
title: e,
|
|
872
|
+
icon: n,
|
|
873
|
+
onDismiss: a,
|
|
874
|
+
labels: o,
|
|
875
|
+
appearance: i = "soft",
|
|
876
|
+
className: l = "",
|
|
877
|
+
children: m,
|
|
878
|
+
...d
|
|
879
|
+
}) {
|
|
880
|
+
const b = (o == null ? void 0 : o.dismiss) ?? "Dismiss", h = i === "outlined" ? ze[t] : Oe[t], c = n === null ? null : n ?? He[t];
|
|
881
|
+
return /* @__PURE__ */ u(
|
|
882
|
+
"div",
|
|
883
|
+
{
|
|
884
|
+
role: "alert",
|
|
885
|
+
className: `flex items-start gap-3 p-4 rounded-lg border ${h} ${l}`,
|
|
886
|
+
...d,
|
|
887
|
+
children: [
|
|
888
|
+
c,
|
|
889
|
+
/* @__PURE__ */ u("div", { className: "flex-1 min-w-0", children: [
|
|
890
|
+
e && /* @__PURE__ */ r("div", { className: "font-semibold text-[0.9rem] mb-0.5 text-text", children: e }),
|
|
891
|
+
/* @__PURE__ */ r("div", { className: "text-[0.82rem] text-text leading-relaxed", children: m })
|
|
892
|
+
] }),
|
|
893
|
+
a && /* @__PURE__ */ r(
|
|
894
|
+
"button",
|
|
895
|
+
{
|
|
896
|
+
type: "button",
|
|
897
|
+
onClick: a,
|
|
898
|
+
"aria-label": b,
|
|
899
|
+
className: "shrink-0 w-6 h-6 inline-flex items-center justify-center rounded-xs text-text-muted hover:text-text hover:bg-surface-muted transition-colors",
|
|
900
|
+
children: "×"
|
|
901
|
+
}
|
|
902
|
+
)
|
|
903
|
+
]
|
|
904
|
+
}
|
|
905
|
+
);
|
|
906
|
+
}
|
|
907
|
+
const me = ae(null), Ve = {
|
|
908
|
+
"top-right": "top-4 right-4 items-end",
|
|
909
|
+
"top-left": "top-4 left-4 items-start",
|
|
910
|
+
"top-center": "top-4 left-1/2 -translate-x-1/2 items-center",
|
|
911
|
+
"bottom-right": "bottom-4 right-4 items-end",
|
|
912
|
+
"bottom-left": "bottom-4 left-4 items-start",
|
|
913
|
+
"bottom-center": "bottom-4 left-1/2 -translate-x-1/2 items-center"
|
|
914
|
+
}, Ue = {
|
|
915
|
+
info: "border-info",
|
|
916
|
+
success: "border-success",
|
|
917
|
+
warning: "border-warning",
|
|
918
|
+
danger: "border-danger",
|
|
919
|
+
neutral: "border-border"
|
|
920
|
+
};
|
|
921
|
+
let Ye = 0;
|
|
922
|
+
function ut({
|
|
923
|
+
position: t = "top-right",
|
|
924
|
+
defaultDuration: e = 4e3,
|
|
925
|
+
max: n = 5,
|
|
926
|
+
children: a
|
|
927
|
+
}) {
|
|
928
|
+
const [o, i] = S([]), l = D(/* @__PURE__ */ new Map()), m = C((c) => {
|
|
929
|
+
i((f) => f.filter((p) => p.id !== c));
|
|
930
|
+
const s = l.current.get(c);
|
|
931
|
+
s && (window.clearTimeout(s), l.current.delete(c));
|
|
932
|
+
}, []), d = C((c) => {
|
|
933
|
+
const s = c.id ?? `t-${++Ye}`, f = c.duration ?? e;
|
|
934
|
+
if (i((p) => {
|
|
935
|
+
const g = [...p, { ...c, id: s, duration: f }];
|
|
936
|
+
return g.length > n ? g.slice(g.length - n) : g;
|
|
937
|
+
}), f > 0) {
|
|
938
|
+
const p = window.setTimeout(() => m(s), f);
|
|
939
|
+
l.current.set(s, p);
|
|
940
|
+
}
|
|
941
|
+
return s;
|
|
942
|
+
}, [e, m, n]), b = C(() => {
|
|
943
|
+
l.current.forEach((c) => window.clearTimeout(c)), l.current.clear(), i([]);
|
|
944
|
+
}, []);
|
|
945
|
+
M(() => () => {
|
|
946
|
+
l.current.forEach((c) => window.clearTimeout(c));
|
|
947
|
+
}, []);
|
|
948
|
+
const h = typeof document < "u" ? z(
|
|
949
|
+
/* @__PURE__ */ r(
|
|
950
|
+
"div",
|
|
951
|
+
{
|
|
952
|
+
"aria-live": "polite",
|
|
953
|
+
"aria-atomic": "true",
|
|
954
|
+
className: `fixed z-[2000] flex flex-col gap-2 pointer-events-none ${Ve[t]}`,
|
|
955
|
+
children: o.map((c) => /* @__PURE__ */ u(
|
|
956
|
+
"div",
|
|
957
|
+
{
|
|
958
|
+
role: "status",
|
|
959
|
+
className: `pointer-events-auto anicca-slide-up bg-surface border-l-4 ${Ue[c.variant ?? "neutral"]} border border-border rounded-lg shadow-md min-w-[280px] max-w-[420px] p-4 flex items-start gap-3`,
|
|
960
|
+
children: [
|
|
961
|
+
/* @__PURE__ */ u("div", { className: "flex-1 min-w-0", children: [
|
|
962
|
+
c.title && /* @__PURE__ */ r("div", { className: "font-semibold text-[0.88rem] text-text", children: c.title }),
|
|
963
|
+
c.description && /* @__PURE__ */ r("div", { className: "text-[0.8rem] text-text-muted mt-0.5 leading-snug", children: c.description })
|
|
964
|
+
] }),
|
|
965
|
+
c.action && /* @__PURE__ */ r(
|
|
966
|
+
"button",
|
|
967
|
+
{
|
|
968
|
+
type: "button",
|
|
969
|
+
onClick: () => {
|
|
970
|
+
c.action.onClick(), m(c.id);
|
|
971
|
+
},
|
|
972
|
+
className: "text-[0.78rem] font-semibold text-primary hover:underline shrink-0",
|
|
973
|
+
children: c.action.label
|
|
974
|
+
}
|
|
975
|
+
),
|
|
976
|
+
/* @__PURE__ */ r(
|
|
977
|
+
"button",
|
|
978
|
+
{
|
|
979
|
+
type: "button",
|
|
980
|
+
onClick: () => m(c.id),
|
|
981
|
+
"aria-label": "Dismiss",
|
|
982
|
+
className: "shrink-0 w-5 h-5 inline-flex items-center justify-center text-text-subtle hover:text-text transition-colors",
|
|
983
|
+
children: "×"
|
|
984
|
+
}
|
|
985
|
+
)
|
|
986
|
+
]
|
|
987
|
+
},
|
|
988
|
+
c.id
|
|
989
|
+
))
|
|
990
|
+
}
|
|
991
|
+
),
|
|
992
|
+
document.body
|
|
993
|
+
) : null;
|
|
994
|
+
return /* @__PURE__ */ u(me.Provider, { value: { toasts: o, push: d, dismiss: m, clear: b }, children: [
|
|
995
|
+
a,
|
|
996
|
+
h
|
|
997
|
+
] });
|
|
998
|
+
}
|
|
999
|
+
function ft() {
|
|
1000
|
+
const t = ne(me);
|
|
1001
|
+
if (!t) throw new Error("useAniccaToast must be used inside <AniccaToastProvider>");
|
|
1002
|
+
return t;
|
|
1003
|
+
}
|
|
1004
|
+
const be = ae(null), Je = {
|
|
1005
|
+
info: "border-primary",
|
|
1006
|
+
success: "border-tertiary",
|
|
1007
|
+
warning: "border-amber",
|
|
1008
|
+
danger: "border-error",
|
|
1009
|
+
neutral: "border-outline-variant"
|
|
1010
|
+
}, Ge = {
|
|
1011
|
+
info: "text-primary",
|
|
1012
|
+
success: "text-tertiary",
|
|
1013
|
+
warning: "text-amber",
|
|
1014
|
+
danger: "text-error",
|
|
1015
|
+
neutral: "text-outline"
|
|
1016
|
+
}, Ze = {
|
|
1017
|
+
info: /* @__PURE__ */ u("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
1018
|
+
/* @__PURE__ */ r("circle", { cx: "10", cy: "10", r: "9", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
1019
|
+
/* @__PURE__ */ r("path", { d: "M10 9v5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }),
|
|
1020
|
+
/* @__PURE__ */ r("circle", { cx: "10", cy: "6.5", r: "0.75", fill: "currentColor" })
|
|
1021
|
+
] }),
|
|
1022
|
+
success: /* @__PURE__ */ u("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
1023
|
+
/* @__PURE__ */ r("circle", { cx: "10", cy: "10", r: "9", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
1024
|
+
/* @__PURE__ */ r("path", { d: "M6.5 10.5l2.5 2.5 4.5-5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
1025
|
+
] }),
|
|
1026
|
+
warning: /* @__PURE__ */ u("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
1027
|
+
/* @__PURE__ */ r("path", { d: "M10 2.5L18 17H2L10 2.5z", stroke: "currentColor", strokeWidth: "1.5", strokeLinejoin: "round" }),
|
|
1028
|
+
/* @__PURE__ */ r("path", { d: "M10 8v4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }),
|
|
1029
|
+
/* @__PURE__ */ r("circle", { cx: "10", cy: "13.5", r: "0.75", fill: "currentColor" })
|
|
1030
|
+
] }),
|
|
1031
|
+
danger: /* @__PURE__ */ u("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
1032
|
+
/* @__PURE__ */ r("circle", { cx: "10", cy: "10", r: "9", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
1033
|
+
/* @__PURE__ */ r("path", { d: "M7 7l6 6M13 7l-6 6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
|
|
1034
|
+
] }),
|
|
1035
|
+
neutral: /* @__PURE__ */ u("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
1036
|
+
/* @__PURE__ */ r("circle", { cx: "10", cy: "10", r: "9", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
1037
|
+
/* @__PURE__ */ r("path", { d: "M6.5 10h7", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
|
|
1038
|
+
] })
|
|
1039
|
+
}, qe = {
|
|
1040
|
+
primary: "bg-primary text-on-primary hover:opacity-90",
|
|
1041
|
+
secondary: "bg-surface-container text-on-surface border border-outline-variant/20 hover:bg-surface-container-high",
|
|
1042
|
+
danger: "bg-error text-on-error hover:opacity-90"
|
|
1043
|
+
};
|
|
1044
|
+
let Ke = 0;
|
|
1045
|
+
function mt({ children: t }) {
|
|
1046
|
+
var c, s;
|
|
1047
|
+
const [e, n] = S([]), a = D(null), o = () => {
|
|
1048
|
+
a.current !== null && (window.clearTimeout(a.current), a.current = null);
|
|
1049
|
+
}, i = C((f) => {
|
|
1050
|
+
o(), n((p) => p.filter((g) => g.id !== f));
|
|
1051
|
+
}, []), l = C(() => {
|
|
1052
|
+
o(), n([]);
|
|
1053
|
+
}, []), m = C((f) => {
|
|
1054
|
+
var N;
|
|
1055
|
+
const p = f.id ?? `p-${++Ke}`, g = f.duration ?? ((N = f.actions) != null && N.length ? 0 : 4e3);
|
|
1056
|
+
return n(($) => [...$, { ...f, id: p, duration: g }]), p;
|
|
1057
|
+
}, []), d = e[0];
|
|
1058
|
+
M(() => (o(), d && (d.duration ?? 0) > 0 && (a.current = window.setTimeout(() => i(d.id), d.duration)), o), [d == null ? void 0 : d.id, d == null ? void 0 : d.duration, i]), M(() => () => o(), []);
|
|
1059
|
+
const b = (d == null ? void 0 : d.variant) ?? "neutral", h = typeof document < "u" && d ? z(
|
|
1060
|
+
/* @__PURE__ */ u(
|
|
1061
|
+
"div",
|
|
1062
|
+
{
|
|
1063
|
+
className: "fixed inset-0 z-[2100] flex items-center justify-center anicca-fade-in",
|
|
1064
|
+
"aria-modal": "true",
|
|
1065
|
+
role: "dialog",
|
|
1066
|
+
"aria-labelledby": `popup-title-${d.id}`,
|
|
1067
|
+
children: [
|
|
1068
|
+
/* @__PURE__ */ r(
|
|
1069
|
+
"div",
|
|
1070
|
+
{
|
|
1071
|
+
className: "absolute inset-0 bg-black/50",
|
|
1072
|
+
onClick: () => {
|
|
1073
|
+
var f;
|
|
1074
|
+
return !((f = d.actions) != null && f.length) && i(d.id);
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
),
|
|
1078
|
+
/* @__PURE__ */ u(
|
|
1079
|
+
"div",
|
|
1080
|
+
{
|
|
1081
|
+
className: `relative anicca-slide-up bg-surface-container-lowest rounded-[22px] border-t-4 ${Je[b]} border border-on-surface/[0.06] dark:border-[rgba(51,65,85,0.5)] w-full max-w-sm mx-4 shadow-[0_24px_70px_-20px_rgba(11,28,48,0.35),0_8px_24px_-12px_rgb(var(--primary)/0.12)] dark:shadow-[0_20px_60px_rgba(0,0,0,0.55)]`,
|
|
1082
|
+
children: [
|
|
1083
|
+
/* @__PURE__ */ r("div", { className: "p-5", children: /* @__PURE__ */ u("div", { className: "flex items-start gap-3", children: [
|
|
1084
|
+
/* @__PURE__ */ r("span", { className: `mt-0.5 shrink-0 ${Ge[b]}`, children: Ze[b] }),
|
|
1085
|
+
/* @__PURE__ */ u("div", { className: "flex-1 min-w-0", children: [
|
|
1086
|
+
d.title && /* @__PURE__ */ r(
|
|
1087
|
+
"div",
|
|
1088
|
+
{
|
|
1089
|
+
id: `popup-title-${d.id}`,
|
|
1090
|
+
className: "font-semibold text-body-base text-on-surface",
|
|
1091
|
+
children: d.title
|
|
1092
|
+
}
|
|
1093
|
+
),
|
|
1094
|
+
d.description && /* @__PURE__ */ r("div", { className: "text-body-sm text-on-surface-variant mt-1 leading-relaxed", children: d.description })
|
|
1095
|
+
] }),
|
|
1096
|
+
!((c = d.actions) != null && c.length) && /* @__PURE__ */ r(
|
|
1097
|
+
"button",
|
|
1098
|
+
{
|
|
1099
|
+
type: "button",
|
|
1100
|
+
onClick: () => i(d.id),
|
|
1101
|
+
"aria-label": "Dismiss",
|
|
1102
|
+
className: "shrink-0 w-7 h-7 rounded-[8px] bg-on-surface/[0.05] text-outline text-[1rem] flex items-center justify-center hover:bg-surface-container-high hover:text-on-surface transition-all",
|
|
1103
|
+
children: "×"
|
|
1104
|
+
}
|
|
1105
|
+
)
|
|
1106
|
+
] }) }),
|
|
1107
|
+
(s = d.actions) != null && s.length ? /* @__PURE__ */ r("div", { className: "px-5 pb-5 flex justify-end gap-2 border-t border-on-surface/[0.06] dark:border-[rgba(51,65,85,0.5)] pt-4", children: d.actions.map((f, p) => /* @__PURE__ */ r(
|
|
1108
|
+
"button",
|
|
1109
|
+
{
|
|
1110
|
+
type: "button",
|
|
1111
|
+
onClick: () => {
|
|
1112
|
+
f.onClick(), i(d.id);
|
|
1113
|
+
},
|
|
1114
|
+
className: `px-4 py-2 text-label-sm font-semibold rounded-[10px] transition-opacity ${qe[f.variant ?? "secondary"]}`,
|
|
1115
|
+
children: f.label
|
|
1116
|
+
},
|
|
1117
|
+
p
|
|
1118
|
+
)) }) : null
|
|
1119
|
+
]
|
|
1120
|
+
}
|
|
1121
|
+
)
|
|
1122
|
+
]
|
|
1123
|
+
}
|
|
1124
|
+
),
|
|
1125
|
+
document.body
|
|
1126
|
+
) : null;
|
|
1127
|
+
return /* @__PURE__ */ u(be.Provider, { value: { push: m, dismiss: i, clear: l }, children: [
|
|
1128
|
+
t,
|
|
1129
|
+
h
|
|
1130
|
+
] });
|
|
1131
|
+
}
|
|
1132
|
+
function bt() {
|
|
1133
|
+
const t = ne(be);
|
|
1134
|
+
if (!t) throw new Error("useAniccaPopup must be used inside <AniccaPopupProvider>");
|
|
1135
|
+
return t;
|
|
1136
|
+
}
|
|
1137
|
+
const K = 8;
|
|
1138
|
+
function pt({
|
|
1139
|
+
content: t,
|
|
1140
|
+
placement: e = "top",
|
|
1141
|
+
delay: n = 200,
|
|
1142
|
+
disabled: a,
|
|
1143
|
+
open: o,
|
|
1144
|
+
children: i,
|
|
1145
|
+
className: l = ""
|
|
1146
|
+
}) {
|
|
1147
|
+
const [m, d] = S(!1), b = o ?? m, h = D(null), c = D(), [s, f] = S(null), p = () => {
|
|
1148
|
+
a || (window.clearTimeout(c.current), c.current = window.setTimeout(() => d(!0), n));
|
|
1149
|
+
}, g = () => {
|
|
1150
|
+
window.clearTimeout(c.current), d(!1);
|
|
1151
|
+
};
|
|
1152
|
+
if (M(() => {
|
|
1153
|
+
if (!b || !h.current) return;
|
|
1154
|
+
h.current.getBoundingClientRect();
|
|
1155
|
+
const k = () => {
|
|
1156
|
+
const x = h.current.getBoundingClientRect();
|
|
1157
|
+
let w = 0, v = 0;
|
|
1158
|
+
e === "top" ? (w = x.top - K, v = x.left + x.width / 2) : e === "bottom" ? (w = x.bottom + K, v = x.left + x.width / 2) : e === "left" ? (w = x.top + x.height / 2, v = x.left - K) : (w = x.top + x.height / 2, v = x.right + K), f({ top: w + window.scrollY, left: v + window.scrollX });
|
|
1159
|
+
};
|
|
1160
|
+
return k(), window.addEventListener("scroll", k, !0), window.addEventListener("resize", k), () => {
|
|
1161
|
+
window.removeEventListener("scroll", k, !0), window.removeEventListener("resize", k);
|
|
1162
|
+
};
|
|
1163
|
+
}, [b, e]), M(() => () => window.clearTimeout(c.current), []), !oe(i)) return i;
|
|
1164
|
+
const N = i.props, $ = ie(i, {
|
|
1165
|
+
ref: (k) => {
|
|
1166
|
+
h.current = k;
|
|
1167
|
+
const x = i.ref;
|
|
1168
|
+
typeof x == "function" ? x(k) : x && "current" in x && (x.current = k);
|
|
1169
|
+
},
|
|
1170
|
+
onMouseEnter: (k) => {
|
|
1171
|
+
var x;
|
|
1172
|
+
p(), (x = N.onMouseEnter) == null || x.call(N, k);
|
|
1173
|
+
},
|
|
1174
|
+
onMouseLeave: (k) => {
|
|
1175
|
+
var x;
|
|
1176
|
+
g(), (x = N.onMouseLeave) == null || x.call(N, k);
|
|
1177
|
+
},
|
|
1178
|
+
onFocus: (k) => {
|
|
1179
|
+
var x;
|
|
1180
|
+
p(), (x = N.onFocus) == null || x.call(N, k);
|
|
1181
|
+
},
|
|
1182
|
+
onBlur: (k) => {
|
|
1183
|
+
var x;
|
|
1184
|
+
g(), (x = N.onBlur) == null || x.call(N, k);
|
|
1185
|
+
}
|
|
1186
|
+
}), _ = {
|
|
1187
|
+
top: "translate(-50%, -100%)",
|
|
1188
|
+
bottom: "translate(-50%, 0)",
|
|
1189
|
+
left: "translate(-100%, -50%)",
|
|
1190
|
+
right: "translate(0, -50%)"
|
|
1191
|
+
}, E = b && s && typeof document < "u" ? z(
|
|
1192
|
+
/* @__PURE__ */ r(
|
|
1193
|
+
"div",
|
|
1194
|
+
{
|
|
1195
|
+
role: "tooltip",
|
|
1196
|
+
className: `fixed z-[2100] pointer-events-none anicca-fade-in ${l}`,
|
|
1197
|
+
style: { top: s.top, left: s.left, transform: _[e] },
|
|
1198
|
+
children: /* @__PURE__ */ r("div", { className: "bg-text text-surface text-[0.75rem] font-medium px-2.5 py-1.5 rounded-xs shadow-md leading-tight max-w-[240px] dark:bg-surface-container dark:text-text", children: t })
|
|
1199
|
+
}
|
|
1200
|
+
),
|
|
1201
|
+
document.body
|
|
1202
|
+
) : null;
|
|
1203
|
+
return /* @__PURE__ */ u(Y, { children: [
|
|
1204
|
+
$,
|
|
1205
|
+
E
|
|
1206
|
+
] });
|
|
1207
|
+
}
|
|
1208
|
+
const X = 10;
|
|
1209
|
+
function ht({
|
|
1210
|
+
content: t,
|
|
1211
|
+
placement: e = "bottom",
|
|
1212
|
+
open: n,
|
|
1213
|
+
onOpenChange: a,
|
|
1214
|
+
disableOutsideClick: o,
|
|
1215
|
+
disableEscapeKey: i,
|
|
1216
|
+
trigger: l = "click",
|
|
1217
|
+
children: m,
|
|
1218
|
+
className: d = ""
|
|
1219
|
+
}) {
|
|
1220
|
+
const b = n !== void 0, [h, c] = S(!1), s = b ? n : h, f = D(null), p = D(null), [g, N] = S(null), $ = C((v) => {
|
|
1221
|
+
b || c(v), a == null || a(v);
|
|
1222
|
+
}, [b, a]);
|
|
1223
|
+
if (M(() => {
|
|
1224
|
+
if (!s || !f.current) return;
|
|
1225
|
+
const v = () => {
|
|
1226
|
+
const y = f.current.getBoundingClientRect();
|
|
1227
|
+
let A = 0, T = 0;
|
|
1228
|
+
e === "top" ? (A = y.top - X, T = y.left + y.width / 2) : e === "bottom" ? (A = y.bottom + X, T = y.left + y.width / 2) : e === "left" ? (A = y.top + y.height / 2, T = y.left - X) : (A = y.top + y.height / 2, T = y.right + X), N({ top: A + window.scrollY, left: T + window.scrollX });
|
|
1229
|
+
};
|
|
1230
|
+
return v(), window.addEventListener("scroll", v, !0), window.addEventListener("resize", v), () => {
|
|
1231
|
+
window.removeEventListener("scroll", v, !0), window.removeEventListener("resize", v);
|
|
1232
|
+
};
|
|
1233
|
+
}, [s, e]), M(() => {
|
|
1234
|
+
if (!s) return;
|
|
1235
|
+
const v = (A) => {
|
|
1236
|
+
var j, P;
|
|
1237
|
+
if (o) return;
|
|
1238
|
+
const T = A.target;
|
|
1239
|
+
(j = p.current) != null && j.contains(T) || (P = f.current) != null && P.contains(T) || $(!1);
|
|
1240
|
+
}, y = (A) => {
|
|
1241
|
+
!i && A.key === "Escape" && $(!1);
|
|
1242
|
+
};
|
|
1243
|
+
return document.addEventListener("mousedown", v), document.addEventListener("keydown", y), () => {
|
|
1244
|
+
document.removeEventListener("mousedown", v), document.removeEventListener("keydown", y);
|
|
1245
|
+
};
|
|
1246
|
+
}, [s, o, i, $]), !oe(m)) return m;
|
|
1247
|
+
const _ = m.props, k = ie(m, {
|
|
1248
|
+
ref: (v) => {
|
|
1249
|
+
f.current = v;
|
|
1250
|
+
const y = m.ref;
|
|
1251
|
+
typeof y == "function" ? y(v) : y && "current" in y && (y.current = v);
|
|
1252
|
+
},
|
|
1253
|
+
"aria-expanded": s,
|
|
1254
|
+
...l === "click" ? {
|
|
1255
|
+
onClick: (v) => {
|
|
1256
|
+
var y;
|
|
1257
|
+
$(!s), (y = _.onClick) == null || y.call(_, v);
|
|
1258
|
+
}
|
|
1259
|
+
} : {
|
|
1260
|
+
onMouseEnter: (v) => {
|
|
1261
|
+
var y;
|
|
1262
|
+
$(!0), (y = _.onMouseEnter) == null || y.call(_, v);
|
|
1263
|
+
},
|
|
1264
|
+
onMouseLeave: (v) => {
|
|
1265
|
+
var y;
|
|
1266
|
+
$(!1), (y = _.onMouseLeave) == null || y.call(_, v);
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
1269
|
+
}), x = {
|
|
1270
|
+
top: "translate(-50%, -100%)",
|
|
1271
|
+
bottom: "translate(-50%, 0)",
|
|
1272
|
+
left: "translate(-100%, -50%)",
|
|
1273
|
+
right: "translate(0, -50%)"
|
|
1274
|
+
}, w = s && g && typeof document < "u" ? z(
|
|
1275
|
+
/* @__PURE__ */ r(
|
|
1276
|
+
"div",
|
|
1277
|
+
{
|
|
1278
|
+
ref: p,
|
|
1279
|
+
role: "dialog",
|
|
1280
|
+
className: `fixed z-[2050] anicca-fade-in ${d}`,
|
|
1281
|
+
style: { top: g.top, left: g.left, transform: x[e] },
|
|
1282
|
+
children: /* @__PURE__ */ r("div", { className: "bg-surface border border-border rounded-lg shadow-md p-3 min-w-[180px] text-[0.85rem] text-text dark:bg-surface dark:border-border dark:text-text", children: t })
|
|
1283
|
+
}
|
|
1284
|
+
),
|
|
1285
|
+
document.body
|
|
1286
|
+
) : null;
|
|
1287
|
+
return /* @__PURE__ */ u(Y, { children: [
|
|
1288
|
+
k,
|
|
1289
|
+
w
|
|
1290
|
+
] });
|
|
1291
|
+
}
|
|
1292
|
+
const ce = {
|
|
1293
|
+
sm: "320px",
|
|
1294
|
+
md: "400px",
|
|
1295
|
+
lg: "520px",
|
|
1296
|
+
xl: "720px",
|
|
1297
|
+
full: "100%"
|
|
1298
|
+
};
|
|
1299
|
+
function xt({
|
|
1300
|
+
open: t,
|
|
1301
|
+
onClose: e,
|
|
1302
|
+
side: n = "right",
|
|
1303
|
+
size: a = "md",
|
|
1304
|
+
title: o,
|
|
1305
|
+
footer: i,
|
|
1306
|
+
disableEscapeKey: l,
|
|
1307
|
+
disableBackdropClick: m,
|
|
1308
|
+
labels: d,
|
|
1309
|
+
className: b = "",
|
|
1310
|
+
children: h
|
|
1311
|
+
}) {
|
|
1312
|
+
const c = (d == null ? void 0 : d.close) ?? "Close";
|
|
1313
|
+
if (M(() => {
|
|
1314
|
+
if (!t || l) return;
|
|
1315
|
+
const $ = (_) => {
|
|
1316
|
+
_.key === "Escape" && e();
|
|
1317
|
+
};
|
|
1318
|
+
return document.addEventListener("keydown", $), () => document.removeEventListener("keydown", $);
|
|
1319
|
+
}, [t, e, l]), M(() => {
|
|
1320
|
+
if (t)
|
|
1321
|
+
return document.body.style.overflow = "hidden", () => {
|
|
1322
|
+
document.body.style.overflow = "";
|
|
1323
|
+
};
|
|
1324
|
+
}, [t]), !t || typeof document > "u") return null;
|
|
1325
|
+
const s = n === "left" || n === "right", f = a in ce ? ce[a] : a, p = {
|
|
1326
|
+
[s ? "width" : "height"]: f,
|
|
1327
|
+
[s ? "height" : "width"]: "100%"
|
|
1328
|
+
}, g = {
|
|
1329
|
+
left: "top-0 left-0 h-full",
|
|
1330
|
+
right: "top-0 right-0 h-full",
|
|
1331
|
+
top: "top-0 left-0 w-full",
|
|
1332
|
+
bottom: "bottom-0 left-0 w-full"
|
|
1333
|
+
}[n], N = {
|
|
1334
|
+
left: "animate-[anicca-slide-from-left_0.25s_ease-out]",
|
|
1335
|
+
right: "animate-[anicca-slide-from-right_0.25s_ease-out]",
|
|
1336
|
+
top: "animate-[anicca-slide-from-top_0.25s_ease-out]",
|
|
1337
|
+
bottom: "animate-[anicca-slide-from-bottom_0.25s_ease-out]"
|
|
1338
|
+
}[n];
|
|
1339
|
+
return z(
|
|
1340
|
+
/* @__PURE__ */ r(
|
|
1341
|
+
"div",
|
|
1342
|
+
{
|
|
1343
|
+
className: "fixed inset-0 z-[1500] anicca-fade-in bg-surface-overlay/60",
|
|
1344
|
+
onClick: m ? void 0 : e,
|
|
1345
|
+
role: "dialog",
|
|
1346
|
+
"aria-modal": "true",
|
|
1347
|
+
children: /* @__PURE__ */ u(
|
|
1348
|
+
"div",
|
|
1349
|
+
{
|
|
1350
|
+
className: `absolute bg-surface shadow-lg flex flex-col dark:bg-surface ${g} ${N} ${b}`,
|
|
1351
|
+
style: p,
|
|
1352
|
+
onClick: ($) => $.stopPropagation(),
|
|
1353
|
+
children: [
|
|
1354
|
+
o && /* @__PURE__ */ u("div", { className: "flex items-center justify-between px-6 py-4 border-b border-border shrink-0", children: [
|
|
1355
|
+
/* @__PURE__ */ r("h2", { className: "text-[1rem] font-bold text-text m-0", children: o }),
|
|
1356
|
+
/* @__PURE__ */ r(
|
|
1357
|
+
"button",
|
|
1358
|
+
{
|
|
1359
|
+
type: "button",
|
|
1360
|
+
onClick: e,
|
|
1361
|
+
"aria-label": c,
|
|
1362
|
+
className: "w-8 h-8 rounded-lg bg-surface-muted text-text-muted hover:bg-border hover:text-text inline-flex items-center justify-center text-[1.1rem] transition-colors",
|
|
1363
|
+
children: "×"
|
|
1364
|
+
}
|
|
1365
|
+
)
|
|
1366
|
+
] }),
|
|
1367
|
+
/* @__PURE__ */ r("div", { className: "flex-1 overflow-y-auto px-6 py-5 text-text", children: h }),
|
|
1368
|
+
i && /* @__PURE__ */ r("div", { className: "px-6 py-4 border-t border-border flex justify-end gap-2 shrink-0", children: i })
|
|
1369
|
+
]
|
|
1370
|
+
}
|
|
1371
|
+
)
|
|
1372
|
+
}
|
|
1373
|
+
),
|
|
1374
|
+
document.body
|
|
1375
|
+
);
|
|
1376
|
+
}
|
|
1377
|
+
const de = 6;
|
|
1378
|
+
function gt({
|
|
1379
|
+
content: t,
|
|
1380
|
+
placement: e = "bottom-start",
|
|
1381
|
+
open: n,
|
|
1382
|
+
onOpenChange: a,
|
|
1383
|
+
matchTriggerWidth: o,
|
|
1384
|
+
children: i,
|
|
1385
|
+
className: l = ""
|
|
1386
|
+
}) {
|
|
1387
|
+
const m = n !== void 0, [d, b] = S(!1), h = m ? n : d, c = D(null), s = D(null), [f, p] = S(null), g = C((x) => {
|
|
1388
|
+
m || b(x), a == null || a(x);
|
|
1389
|
+
}, [m, a]);
|
|
1390
|
+
if (M(() => {
|
|
1391
|
+
if (!h || !c.current) return;
|
|
1392
|
+
const x = () => {
|
|
1393
|
+
const w = c.current.getBoundingClientRect(), v = e.startsWith("bottom"), y = e.endsWith("end"), A = (v ? w.bottom + de : w.top - de) + window.scrollY, T = (y ? w.right : w.left) + window.scrollX;
|
|
1394
|
+
p({ top: A, left: T, width: w.width });
|
|
1395
|
+
};
|
|
1396
|
+
return x(), window.addEventListener("scroll", x, !0), window.addEventListener("resize", x), () => {
|
|
1397
|
+
window.removeEventListener("scroll", x, !0), window.removeEventListener("resize", x);
|
|
1398
|
+
};
|
|
1399
|
+
}, [h, e]), M(() => {
|
|
1400
|
+
if (!h) return;
|
|
1401
|
+
const x = (v) => {
|
|
1402
|
+
var A, T;
|
|
1403
|
+
const y = v.target;
|
|
1404
|
+
(A = s.current) != null && A.contains(y) || (T = c.current) != null && T.contains(y) || g(!1);
|
|
1405
|
+
}, w = (v) => {
|
|
1406
|
+
v.key === "Escape" && g(!1);
|
|
1407
|
+
};
|
|
1408
|
+
return document.addEventListener("mousedown", x), document.addEventListener("keydown", w), () => {
|
|
1409
|
+
document.removeEventListener("mousedown", x), document.removeEventListener("keydown", w);
|
|
1410
|
+
};
|
|
1411
|
+
}, [h, g]), !oe(i)) return i;
|
|
1412
|
+
const N = i.props, $ = ie(i, {
|
|
1413
|
+
ref: (x) => {
|
|
1414
|
+
c.current = x;
|
|
1415
|
+
const w = i.ref;
|
|
1416
|
+
typeof w == "function" ? w(x) : w && "current" in w && (w.current = x);
|
|
1417
|
+
},
|
|
1418
|
+
"aria-expanded": h,
|
|
1419
|
+
"aria-haspopup": "menu",
|
|
1420
|
+
onClick: (x) => {
|
|
1421
|
+
var w;
|
|
1422
|
+
g(!h), (w = N.onClick) == null || w.call(N, x);
|
|
1423
|
+
}
|
|
1424
|
+
}), _ = e.endsWith("end"), E = e.startsWith("top"), k = h && f && typeof document < "u" ? z(
|
|
1425
|
+
/* @__PURE__ */ r(
|
|
1426
|
+
"div",
|
|
1427
|
+
{
|
|
1428
|
+
ref: s,
|
|
1429
|
+
role: "menu",
|
|
1430
|
+
className: `fixed z-[2050] anicca-fade-in ${l}`,
|
|
1431
|
+
style: {
|
|
1432
|
+
top: f.top,
|
|
1433
|
+
left: f.left,
|
|
1434
|
+
transform: `translate(${_ ? "-100%" : "0"}, ${E ? "-100%" : "0"})`,
|
|
1435
|
+
minWidth: o ? f.width : 180
|
|
1436
|
+
},
|
|
1437
|
+
children: /* @__PURE__ */ r("div", { className: "bg-surface border border-border rounded-lg shadow-md py-1.5 max-h-[60vh] overflow-y-auto dark:bg-surface dark:border-border", children: t })
|
|
1438
|
+
}
|
|
1439
|
+
),
|
|
1440
|
+
document.body
|
|
1441
|
+
) : null;
|
|
1442
|
+
return /* @__PURE__ */ u(Y, { children: [
|
|
1443
|
+
$,
|
|
1444
|
+
k
|
|
1445
|
+
] });
|
|
1446
|
+
}
|
|
1447
|
+
function vt({ className: t = "", children: e, ...n }) {
|
|
1448
|
+
return /* @__PURE__ */ r("div", { role: "menu", className: `flex flex-col ${t}`, ...n, children: e });
|
|
1449
|
+
}
|
|
1450
|
+
function yt({
|
|
1451
|
+
leftIcon: t,
|
|
1452
|
+
rightIcon: e,
|
|
1453
|
+
destructive: n,
|
|
1454
|
+
shortcut: a,
|
|
1455
|
+
className: o = "",
|
|
1456
|
+
children: i,
|
|
1457
|
+
...l
|
|
1458
|
+
}) {
|
|
1459
|
+
return /* @__PURE__ */ u(
|
|
1460
|
+
"button",
|
|
1461
|
+
{
|
|
1462
|
+
type: "button",
|
|
1463
|
+
role: "menuitem",
|
|
1464
|
+
className: `flex items-center gap-2.5 px-3 py-2 text-left text-[0.85rem] cursor-pointer border-none bg-transparent transition-colors duration-150 hover:bg-surface-muted focus-visible:outline-none focus-visible:bg-surface-muted disabled:opacity-50 disabled:cursor-not-allowed dark:hover:bg-surface-container dark:focus-visible:bg-surface-container ${n ? "text-danger hover:bg-danger/10 dark:hover:bg-danger/20" : "text-text dark:text-text"} ${o}`,
|
|
1465
|
+
...l,
|
|
1466
|
+
children: [
|
|
1467
|
+
t && /* @__PURE__ */ r("span", { className: "shrink-0 inline-flex items-center w-4 h-4", children: t }),
|
|
1468
|
+
/* @__PURE__ */ r("span", { className: "flex-1 truncate", children: i }),
|
|
1469
|
+
a && /* @__PURE__ */ r("span", { className: "text-[0.72rem] text-text-subtle font-mono ml-2", children: a }),
|
|
1470
|
+
e && /* @__PURE__ */ r("span", { className: "shrink-0 inline-flex items-center w-4 h-4", children: e })
|
|
1471
|
+
]
|
|
1472
|
+
}
|
|
1473
|
+
);
|
|
1474
|
+
}
|
|
1475
|
+
function wt({ className: t = "" }) {
|
|
1476
|
+
return /* @__PURE__ */ r("div", { role: "separator", className: `my-1 h-px bg-border ${t}` });
|
|
1477
|
+
}
|
|
1478
|
+
function kt({
|
|
1479
|
+
className: t = "",
|
|
1480
|
+
children: e,
|
|
1481
|
+
...n
|
|
1482
|
+
}) {
|
|
1483
|
+
return /* @__PURE__ */ r("div", { className: `px-3 py-1.5 text-[0.68rem] uppercase tracking-[0.06em] font-semibold text-text-subtle ${t}`, ...n, children: e });
|
|
1484
|
+
}
|
|
1485
|
+
const Xe = {
|
|
1486
|
+
noResults: "No results",
|
|
1487
|
+
searchPlaceholder: "Type to search..."
|
|
1488
|
+
}, Qe = (t, e) => e.label.toLowerCase().includes(t.toLowerCase());
|
|
1489
|
+
function Nt({
|
|
1490
|
+
options: t,
|
|
1491
|
+
value: e,
|
|
1492
|
+
defaultValue: n,
|
|
1493
|
+
onChange: a,
|
|
1494
|
+
filter: o = Qe,
|
|
1495
|
+
renderOption: i,
|
|
1496
|
+
label: l,
|
|
1497
|
+
helper: m,
|
|
1498
|
+
error: d,
|
|
1499
|
+
placeholder: b,
|
|
1500
|
+
required: h,
|
|
1501
|
+
disabled: c,
|
|
1502
|
+
allowCustomValue: s,
|
|
1503
|
+
labels: f,
|
|
1504
|
+
wrapperClassName: p = "",
|
|
1505
|
+
className: g = ""
|
|
1506
|
+
}) {
|
|
1507
|
+
const N = { ...Xe, ...f }, $ = O(), _ = e !== void 0, [E, k] = S(n ?? ""), x = _ ? e : E, w = t.find((L) => L.value === x), [v, y] = S((w == null ? void 0 : w.label) ?? ""), [A, T] = S(!1), [j, P] = S(0), ee = D(null), J = D(null), q = D(null);
|
|
1508
|
+
M(() => {
|
|
1509
|
+
w ? y(w.label) : s || y("");
|
|
1510
|
+
}, [w, s]);
|
|
1511
|
+
const I = Q(
|
|
1512
|
+
() => t.filter((L) => o(v, L)),
|
|
1513
|
+
[t, v, o]
|
|
1514
|
+
);
|
|
1515
|
+
M(() => {
|
|
1516
|
+
P(0);
|
|
1517
|
+
}, [v, A]), M(() => {
|
|
1518
|
+
const L = (F) => {
|
|
1519
|
+
var B;
|
|
1520
|
+
(B = q.current) != null && B.contains(F.target) || T(!1);
|
|
1521
|
+
};
|
|
1522
|
+
return document.addEventListener("mousedown", L), () => document.removeEventListener("mousedown", L);
|
|
1523
|
+
}, []);
|
|
1524
|
+
const H = (L) => {
|
|
1525
|
+
var F;
|
|
1526
|
+
L.disabled || (_ || k(L.value), a == null || a(L.value), y(L.label), T(!1), (F = J.current) == null || F.blur());
|
|
1527
|
+
}, he = (L) => {
|
|
1528
|
+
var F;
|
|
1529
|
+
if (L.key === "ArrowDown")
|
|
1530
|
+
L.preventDefault(), T(!0), P((B) => Math.min(B + 1, I.length - 1));
|
|
1531
|
+
else if (L.key === "ArrowUp")
|
|
1532
|
+
L.preventDefault(), P((B) => Math.max(B - 1, 0));
|
|
1533
|
+
else if (L.key === "Enter") {
|
|
1534
|
+
L.preventDefault();
|
|
1535
|
+
const B = I[j];
|
|
1536
|
+
B ? H(B) : s && (_ || k(v), a == null || a(v), T(!1));
|
|
1537
|
+
} else L.key === "Escape" && (T(!1), (F = J.current) == null || F.blur());
|
|
1538
|
+
};
|
|
1539
|
+
return /* @__PURE__ */ u("div", { ref: q, className: `flex flex-col gap-1.5 ${p}`, children: [
|
|
1540
|
+
l && /* @__PURE__ */ u("label", { htmlFor: $, className: "text-[0.78rem] font-semibold text-text", children: [
|
|
1541
|
+
l,
|
|
1542
|
+
h && /* @__PURE__ */ r("span", { className: "text-danger ml-0.5", children: "*" })
|
|
1543
|
+
] }),
|
|
1544
|
+
/* @__PURE__ */ u("div", { className: "relative", children: [
|
|
1545
|
+
/* @__PURE__ */ r(
|
|
1546
|
+
"input",
|
|
1547
|
+
{
|
|
1548
|
+
ref: J,
|
|
1549
|
+
id: $,
|
|
1550
|
+
type: "text",
|
|
1551
|
+
role: "combobox",
|
|
1552
|
+
"aria-expanded": A,
|
|
1553
|
+
"aria-controls": `${$}-listbox`,
|
|
1554
|
+
"aria-activedescendant": A ? `${$}-opt-${j}` : void 0,
|
|
1555
|
+
autoComplete: "off",
|
|
1556
|
+
disabled: c,
|
|
1557
|
+
required: h,
|
|
1558
|
+
value: v,
|
|
1559
|
+
placeholder: b ?? N.searchPlaceholder,
|
|
1560
|
+
onChange: (L) => {
|
|
1561
|
+
y(L.target.value), T(!0);
|
|
1562
|
+
},
|
|
1563
|
+
onFocus: () => T(!0),
|
|
1564
|
+
onKeyDown: he,
|
|
1565
|
+
"aria-invalid": d ? !0 : void 0,
|
|
1566
|
+
className: `w-full h-10 px-3 pr-9 text-[0.875rem] bg-surface border border-border rounded-lg text-text placeholder:text-text-subtle outline-none transition-[border-color,box-shadow] duration-200 focus:border-primary focus:ring-[var(--anicca-ring-width)] focus:ring-primary/20 dark:bg-surface dark:border-border dark:text-text dark:placeholder:text-text-subtle dark:focus:border-primary ${d ? "border-danger focus:border-danger focus:ring-danger/20" : ""} ${c ? "opacity-50 cursor-not-allowed bg-surface-muted dark:bg-surface-container" : ""} ${g}`
|
|
1567
|
+
}
|
|
1568
|
+
),
|
|
1569
|
+
/* @__PURE__ */ r(
|
|
1570
|
+
"svg",
|
|
1571
|
+
{
|
|
1572
|
+
className: `absolute right-3 top-1/2 -translate-y-1/2 w-4 h-4 text-text-muted pointer-events-none transition-transform ${A ? "rotate-180" : ""}`,
|
|
1573
|
+
viewBox: "0 0 24 24",
|
|
1574
|
+
fill: "none",
|
|
1575
|
+
stroke: "currentColor",
|
|
1576
|
+
strokeWidth: "2",
|
|
1577
|
+
"aria-hidden": "true",
|
|
1578
|
+
children: /* @__PURE__ */ r("polyline", { points: "6 9 12 15 18 9", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
1579
|
+
}
|
|
1580
|
+
),
|
|
1581
|
+
A && /* @__PURE__ */ r(
|
|
1582
|
+
"ul",
|
|
1583
|
+
{
|
|
1584
|
+
ref: ee,
|
|
1585
|
+
id: `${$}-listbox`,
|
|
1586
|
+
role: "listbox",
|
|
1587
|
+
className: "absolute z-[2000] top-full left-0 right-0 mt-1 bg-surface border border-border rounded-lg shadow-md max-h-[260px] overflow-y-auto py-1.5 dark:bg-surface dark:border-border",
|
|
1588
|
+
children: I.length === 0 ? /* @__PURE__ */ r("li", { className: "px-3 py-2 text-[0.82rem] text-text-subtle", children: N.noResults }) : I.map((L, F) => {
|
|
1589
|
+
const B = F === j, se = L.value === x;
|
|
1590
|
+
return /* @__PURE__ */ r(
|
|
1591
|
+
"li",
|
|
1592
|
+
{
|
|
1593
|
+
id: `${$}-opt-${F}`,
|
|
1594
|
+
role: "option",
|
|
1595
|
+
"aria-selected": se,
|
|
1596
|
+
onMouseEnter: () => P(F),
|
|
1597
|
+
onMouseDown: (xe) => {
|
|
1598
|
+
xe.preventDefault(), H(L);
|
|
1599
|
+
},
|
|
1600
|
+
className: `px-3 py-2 cursor-pointer text-[0.85rem] flex flex-col gap-0.5 ${B ? "bg-surface-muted" : ""} ${se ? "text-primary font-semibold" : "text-text"} ${L.disabled ? "opacity-50 cursor-not-allowed" : ""}`,
|
|
1601
|
+
children: i ? i(L, B) : /* @__PURE__ */ u(Y, { children: [
|
|
1602
|
+
/* @__PURE__ */ r("span", { children: L.label }),
|
|
1603
|
+
L.description && /* @__PURE__ */ r("span", { className: "text-[0.72rem] text-text-muted", children: L.description })
|
|
1604
|
+
] })
|
|
1605
|
+
},
|
|
1606
|
+
L.value
|
|
1607
|
+
);
|
|
1608
|
+
})
|
|
1609
|
+
}
|
|
1610
|
+
)
|
|
1611
|
+
] }),
|
|
1612
|
+
d ? /* @__PURE__ */ r("span", { className: "text-[0.72rem] text-danger font-medium", children: d }) : m ? /* @__PURE__ */ r("span", { className: "text-[0.72rem] text-text-muted", children: m }) : null
|
|
1613
|
+
] });
|
|
1614
|
+
}
|
|
1615
|
+
function $t({
|
|
54
1616
|
title: t,
|
|
55
1617
|
value: e,
|
|
56
|
-
icon:
|
|
1618
|
+
icon: n,
|
|
57
1619
|
trend: a,
|
|
58
|
-
trendLabel:
|
|
59
|
-
color:
|
|
60
|
-
className:
|
|
61
|
-
}) {
|
|
62
|
-
const
|
|
63
|
-
up: "text-
|
|
64
|
-
down: "text-
|
|
65
|
-
neutral: "text-
|
|
1620
|
+
trendLabel: o,
|
|
1621
|
+
color: i,
|
|
1622
|
+
className: l = ""
|
|
1623
|
+
}) {
|
|
1624
|
+
const m = a !== void 0 ? a > 0 ? "up" : a < 0 ? "down" : "neutral" : null, d = {
|
|
1625
|
+
up: "text-[#15803d] bg-[rgba(22,163,74,0.1)] dark:text-[#10b981] dark:bg-[rgba(16,185,129,0.18)]",
|
|
1626
|
+
down: "text-[#dc2626] bg-[rgba(220,38,38,0.1)] dark:text-[#ef4444] dark:bg-[rgba(239,68,68,0.18)]",
|
|
1627
|
+
neutral: "text-[#64748b] bg-[rgba(100,116,139,0.1)] dark:text-[#94a3b8] dark:bg-[rgba(100,116,139,0.18)]"
|
|
66
1628
|
};
|
|
67
|
-
return /* @__PURE__ */
|
|
1629
|
+
return /* @__PURE__ */ u(
|
|
68
1630
|
"div",
|
|
69
1631
|
{
|
|
70
|
-
className: `
|
|
71
|
-
|
|
1632
|
+
className: `
|
|
1633
|
+
relative overflow-hidden group
|
|
1634
|
+
bg-surface-container-lowest rounded-[20px]
|
|
1635
|
+
border border-on-surface/[0.06]
|
|
1636
|
+
shadow-[0_1px_2px_rgba(11,28,48,0.04),0_12px_32px_-14px_rgba(11,28,48,0.14)]
|
|
1637
|
+
dark:shadow-[0_1px_2px_rgba(0,0,0,0.3),0_12px_32px_-14px_rgba(0,0,0,0.5)]
|
|
1638
|
+
transition-[transform,box-shadow] duration-[250ms] ease-[cubic-bezier(0.4,0,0.2,1)]
|
|
1639
|
+
hover:-translate-y-[3px]
|
|
1640
|
+
hover:shadow-[0_1px_2px_rgba(11,28,48,0.05),0_18px_44px_-16px_rgba(11,28,48,0.22)]
|
|
1641
|
+
${l}
|
|
1642
|
+
`,
|
|
1643
|
+
style: {
|
|
1644
|
+
padding: "1.5rem 1.5rem 1.5rem 1.625rem",
|
|
1645
|
+
borderLeft: `3px solid ${i ?? "rgb(var(--primary))"}`
|
|
1646
|
+
},
|
|
72
1647
|
role: "group",
|
|
73
1648
|
"aria-label": `${t}: ${e}`,
|
|
74
1649
|
children: [
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
|
|
77
|
-
|
|
1650
|
+
/* @__PURE__ */ r(
|
|
1651
|
+
"div",
|
|
1652
|
+
{
|
|
1653
|
+
"aria-hidden": "true",
|
|
1654
|
+
className: "absolute top-0 right-0 w-[100px] h-[100px] rounded-full pointer-events-none",
|
|
1655
|
+
style: { background: "radial-gradient(circle, rgb(var(--primary) / 0.05) 0%, transparent 70%)", transform: "translate(30%, -30%)" }
|
|
1656
|
+
}
|
|
1657
|
+
),
|
|
1658
|
+
/* @__PURE__ */ u("div", { className: "flex justify-between items-start mb-3", children: [
|
|
1659
|
+
/* @__PURE__ */ r("span", { className: "text-[0.7rem] font-semibold text-outline uppercase tracking-[0.08em]", children: t }),
|
|
1660
|
+
n && /* @__PURE__ */ r("span", { className: "text-2xl text-[#94a3b8] opacity-80 transition-transform duration-300 ease-in-out group-hover:scale-110", children: n })
|
|
78
1661
|
] }),
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
a !== void 0 && /* @__PURE__ */
|
|
81
|
-
/* @__PURE__ */
|
|
82
|
-
/* @__PURE__ */
|
|
1662
|
+
/* @__PURE__ */ r("div", { className: "text-[1.875rem] font-bold font-display text-on-surface mb-3 tracking-[-0.03em] leading-[1.1] [font-variant-numeric:tabular-nums]", children: e }),
|
|
1663
|
+
a !== void 0 && m && /* @__PURE__ */ u("div", { className: `inline-flex items-center gap-[0.35rem] text-[0.8rem] font-semibold rounded-[20px] py-1 px-[0.6rem] ${d[m]}`, children: [
|
|
1664
|
+
/* @__PURE__ */ r("span", { className: "text-[0.7rem]", children: m === "up" ? "↑" : m === "down" ? "↓" : "→" }),
|
|
1665
|
+
/* @__PURE__ */ u("span", { className: "font-bold", children: [
|
|
83
1666
|
Math.abs(a),
|
|
84
1667
|
"%"
|
|
85
1668
|
] }),
|
|
86
|
-
|
|
1669
|
+
o && /* @__PURE__ */ r("span", { className: "text-[#94a3b8] font-normal ml-2 text-[0.75rem]", children: o })
|
|
87
1670
|
] })
|
|
88
1671
|
]
|
|
89
1672
|
}
|
|
90
1673
|
);
|
|
91
1674
|
}
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
};
|
|
95
|
-
function xe({
|
|
1675
|
+
const er = { loading: "Loading chart" };
|
|
1676
|
+
function _t({
|
|
96
1677
|
title: t,
|
|
97
1678
|
subtitle: e,
|
|
98
|
-
children:
|
|
1679
|
+
children: n,
|
|
99
1680
|
loading: a = !1,
|
|
100
|
-
empty:
|
|
101
|
-
emptyMessage:
|
|
102
|
-
height:
|
|
103
|
-
labels:
|
|
104
|
-
className:
|
|
1681
|
+
empty: o = !1,
|
|
1682
|
+
emptyMessage: i = "No data available",
|
|
1683
|
+
height: l = 300,
|
|
1684
|
+
labels: m,
|
|
1685
|
+
className: d = ""
|
|
105
1686
|
}) {
|
|
106
|
-
const
|
|
107
|
-
return /* @__PURE__ */
|
|
108
|
-
/* @__PURE__ */
|
|
109
|
-
/* @__PURE__ */
|
|
110
|
-
e && /* @__PURE__ */
|
|
1687
|
+
const b = typeof l == "number" ? `${l}px` : l, h = { ...er, ...m };
|
|
1688
|
+
return /* @__PURE__ */ u("div", { className: `bg-surface-container-lowest rounded-[20px] p-[1.75rem] shadow-[0_1px_2px_rgba(11,28,48,0.04),0_12px_32px_-14px_rgba(11,28,48,0.14)] dark:shadow-[0_1px_2px_rgba(0,0,0,0.3),0_4px_12px_rgba(0,0,0,0.35)] border border-on-surface/[0.06] dark:border-[rgba(51,65,85,0.5)] ${d}`, children: [
|
|
1689
|
+
/* @__PURE__ */ u("div", { className: "mb-5", children: [
|
|
1690
|
+
/* @__PURE__ */ r("div", { className: "text-[1.05rem] font-semibold text-on-surface tracking-[-0.02em]", children: t }),
|
|
1691
|
+
e && /* @__PURE__ */ r("div", { className: "text-[0.8rem] text-outline dark:text-[#94a3b8] mt-[0.3rem] font-normal", children: e })
|
|
111
1692
|
] }),
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
fill: "none",
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
children:
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
),
|
|
128
|
-
/* @__PURE__ */ n("span", { className: "text-[0.9rem] text-a-text-muted font-medium", children: o })
|
|
129
|
-
] }) : r })
|
|
1693
|
+
/* @__PURE__ */ r("div", { className: "relative w-full rounded-xl overflow-hidden", style: { height: b }, children: a ? /* @__PURE__ */ r("div", { className: "w-full rounded-xl anicca-shimmer", style: { height: b }, "aria-label": h.loading }) : o ? /* @__PURE__ */ u(
|
|
1694
|
+
"div",
|
|
1695
|
+
{
|
|
1696
|
+
className: "anicca-empty-bg flex flex-col items-center justify-center gap-4 rounded-xl border-2 border-dashed border-[#e2e8f0] dark:border-[rgba(71,85,105,0.5)]",
|
|
1697
|
+
style: { height: b },
|
|
1698
|
+
children: [
|
|
1699
|
+
/* @__PURE__ */ u("svg", { className: "w-14 h-14 opacity-40", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", "aria-hidden": "true", children: [
|
|
1700
|
+
/* @__PURE__ */ r("path", { d: "M3 3v18h18", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
1701
|
+
/* @__PURE__ */ r("path", { d: "M7 16l4-4 4 4 5-5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
1702
|
+
] }),
|
|
1703
|
+
/* @__PURE__ */ r("span", { className: "text-[0.9rem] text-[#64748b] dark:text-[#94a3b8] font-medium", children: i })
|
|
1704
|
+
]
|
|
1705
|
+
}
|
|
1706
|
+
) : n })
|
|
130
1707
|
] });
|
|
131
1708
|
}
|
|
132
|
-
const
|
|
1709
|
+
const rr = {
|
|
133
1710
|
expand: "Expand sidebar",
|
|
134
1711
|
collapse: "Collapse sidebar",
|
|
135
1712
|
navigation: "Sidebar navigation"
|
|
136
1713
|
};
|
|
137
|
-
function
|
|
1714
|
+
function At({
|
|
138
1715
|
items: t,
|
|
139
1716
|
collapsed: e = !1,
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
footer: s,
|
|
1717
|
+
logo: n,
|
|
1718
|
+
footer: a,
|
|
143
1719
|
activePath: o = "",
|
|
144
1720
|
labels: i,
|
|
145
|
-
className:
|
|
146
|
-
}) {
|
|
147
|
-
const [
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
1721
|
+
className: l = ""
|
|
1722
|
+
}) {
|
|
1723
|
+
const [m, d] = S({}), b = { ...rr, ...i }, h = (s) => d((f) => ({ ...f, [s]: !f[s] })), c = (s, f = !1) => {
|
|
1724
|
+
var x;
|
|
1725
|
+
const p = o === s.href, g = (((x = s.children) == null ? void 0 : x.length) ?? 0) > 0, N = m[s.href], $ = f ? "text-primary font-semibold dark:text-white dark:font-semibold" : [
|
|
1726
|
+
"bg-primary-container/10 text-primary font-bold translate-x-1 rounded-lg",
|
|
1727
|
+
"dark:bg-primary dark:text-white dark:shadow-lg dark:shadow-primary/20"
|
|
1728
|
+
].join(" "), _ = f ? "text-[#767586] hover:text-on-surface dark:text-[#64748b] dark:hover:text-[#e2e8f0]" : [
|
|
1729
|
+
"text-on-surface-variant hover:bg-secondary-container/30 hover:text-on-surface",
|
|
1730
|
+
"dark:text-secondary dark:hover:text-white dark:hover:bg-surface-container-highest/50"
|
|
1731
|
+
].join(" "), E = [
|
|
1732
|
+
"flex items-center gap-3 px-4 py-3 text-[0.875rem] font-medium",
|
|
1733
|
+
"cursor-pointer transition-all duration-200 border-none bg-transparent text-left no-underline",
|
|
1734
|
+
f ? "pl-[2.75rem] text-[0.82rem]" : ""
|
|
1735
|
+
].join(" "), k = /* @__PURE__ */ u(Y, { children: [
|
|
1736
|
+
s.icon && /* @__PURE__ */ r("span", { className: "shrink-0 w-5 flex items-center justify-center text-[1.1rem] transition-transform duration-200 ease-in-out group-hover/item:scale-110", children: s.icon }),
|
|
1737
|
+
!e && /* @__PURE__ */ r("span", { className: "whitespace-nowrap overflow-hidden text-ellipsis flex-1", children: s.label }),
|
|
1738
|
+
g && !e && /* @__PURE__ */ r(
|
|
1739
|
+
"span",
|
|
1740
|
+
{
|
|
1741
|
+
className: "ml-auto text-[0.65rem] transition-transform duration-[250ms] ease-[cubic-bezier(0.4,0,0.2,1)]",
|
|
1742
|
+
style: { opacity: N ? 1 : 0.6, transform: N ? "rotate(90deg)" : "none" },
|
|
1743
|
+
children: "▶"
|
|
1744
|
+
}
|
|
1745
|
+
)
|
|
1746
|
+
] });
|
|
1747
|
+
return /* @__PURE__ */ u("div", { className: "group/item", children: [
|
|
1748
|
+
g ? /* @__PURE__ */ r(
|
|
155
1749
|
"button",
|
|
156
1750
|
{
|
|
157
|
-
className: `${
|
|
158
|
-
onClick: () =>
|
|
159
|
-
"aria-expanded":
|
|
160
|
-
children:
|
|
161
|
-
v.icon && /* @__PURE__ */ n("span", { className: "shrink-0 w-5 flex items-center justify-center text-[1.1rem] transition-transform duration-200 ease-in-out group-hover/item:scale-110", children: v.icon }),
|
|
162
|
-
/* @__PURE__ */ n("span", { className: `whitespace-nowrap overflow-hidden text-ellipsis transition-opacity duration-200 ease-in-out ${e ? "hidden" : ""}`, children: v.label }),
|
|
163
|
-
!e && /* @__PURE__ */ n("span", { className: `ml-auto transition-transform duration-[250ms] ease-[cubic-bezier(0.4,0,0.2,1)] text-[0.65rem] opacity-60 ${b ? "rotate-90 opacity-100" : ""}`, children: "▶" })
|
|
164
|
-
]
|
|
1751
|
+
className: `${E} ${p ? $ : _}`,
|
|
1752
|
+
onClick: () => h(s.href),
|
|
1753
|
+
"aria-expanded": N,
|
|
1754
|
+
children: k
|
|
165
1755
|
}
|
|
166
|
-
) : /* @__PURE__ */
|
|
1756
|
+
) : /* @__PURE__ */ r(
|
|
167
1757
|
"a",
|
|
168
1758
|
{
|
|
169
|
-
href:
|
|
170
|
-
className: `${
|
|
171
|
-
"aria-current":
|
|
172
|
-
children:
|
|
173
|
-
v.icon && /* @__PURE__ */ n("span", { className: "shrink-0 w-5 flex items-center justify-center text-[1.1rem] transition-transform duration-200 ease-in-out group-hover/item:scale-110", children: v.icon }),
|
|
174
|
-
/* @__PURE__ */ n("span", { className: `whitespace-nowrap overflow-hidden text-ellipsis transition-opacity duration-200 ease-in-out ${e ? "hidden" : ""}`, children: v.label })
|
|
175
|
-
]
|
|
1759
|
+
href: s.href,
|
|
1760
|
+
className: `${E} ${p ? $ : _}`,
|
|
1761
|
+
"aria-current": p ? "page" : void 0,
|
|
1762
|
+
children: k
|
|
176
1763
|
}
|
|
177
1764
|
),
|
|
178
|
-
|
|
179
|
-
"
|
|
1765
|
+
g && !e && /* @__PURE__ */ r(
|
|
1766
|
+
"div",
|
|
180
1767
|
{
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
]
|
|
188
|
-
},
|
|
189
|
-
$.href
|
|
190
|
-
)) })
|
|
191
|
-
] }, v.href);
|
|
1768
|
+
className: "overflow-hidden transition-[max-height] duration-[350ms] ease-[cubic-bezier(0.4,0,0.2,1)]",
|
|
1769
|
+
style: { maxHeight: N ? "500px" : "0" },
|
|
1770
|
+
children: s.children.map((w) => c(w, !0))
|
|
1771
|
+
}
|
|
1772
|
+
)
|
|
1773
|
+
] }, s.href);
|
|
192
1774
|
};
|
|
193
|
-
return /* @__PURE__ */
|
|
1775
|
+
return /* @__PURE__ */ u(
|
|
194
1776
|
"aside",
|
|
195
1777
|
{
|
|
196
|
-
className: `
|
|
1778
|
+
className: `
|
|
1779
|
+
flex flex-col h-screen sticky top-0 overflow-hidden shrink-0
|
|
1780
|
+
bg-surface dark:bg-sidebar-bg
|
|
1781
|
+
border-r border-on-surface/[0.08] dark:border-outline-variant/30
|
|
1782
|
+
dark:shadow-2xl
|
|
1783
|
+
transition-[width] duration-300 ease-[cubic-bezier(0.4,0,0.2,1)]
|
|
1784
|
+
${e ? "w-[72px]" : "w-[260px]"}
|
|
1785
|
+
${l}
|
|
1786
|
+
`,
|
|
197
1787
|
role: "navigation",
|
|
198
|
-
"aria-label":
|
|
1788
|
+
"aria-label": b.navigation,
|
|
199
1789
|
children: [
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
1790
|
+
n && /* @__PURE__ */ r("div", { className: `
|
|
1791
|
+
flex items-center px-5 shrink-0
|
|
1792
|
+
h-[68px] border-b border-on-surface/[0.08] dark:border-outline-variant/30
|
|
1793
|
+
${e ? "justify-center" : ""}
|
|
1794
|
+
`, children: n }),
|
|
1795
|
+
/* @__PURE__ */ r(
|
|
1796
|
+
"nav",
|
|
1797
|
+
{
|
|
1798
|
+
className: "flex-1 flex flex-col gap-1 overflow-y-auto py-3 min-h-0 [scrollbar-width:thin] [scrollbar-color:rgb(var(--outline-variant))_transparent] dark:[scrollbar-color:#334155_transparent]",
|
|
1799
|
+
children: t.map((s) => c(s))
|
|
1800
|
+
}
|
|
1801
|
+
),
|
|
1802
|
+
/* @__PURE__ */ r("div", { className: `
|
|
1803
|
+
pt-4 pb-4 border-t border-outline-variant/10 shrink-0
|
|
1804
|
+
`, children: a && !e && /* @__PURE__ */ r("div", { className: "px-4 dark:px-0 mb-2", children: a }) })
|
|
214
1805
|
]
|
|
215
1806
|
}
|
|
216
1807
|
);
|
|
217
1808
|
}
|
|
218
|
-
const
|
|
219
|
-
|
|
220
|
-
};
|
|
221
|
-
function ye({
|
|
1809
|
+
const tr = { toggleMenu: "Toggle menu" };
|
|
1810
|
+
function Lt({
|
|
222
1811
|
title: t,
|
|
223
1812
|
logo: e,
|
|
224
|
-
actions:
|
|
1813
|
+
actions: n,
|
|
225
1814
|
user: a,
|
|
226
|
-
onMenuToggle:
|
|
227
|
-
labels:
|
|
228
|
-
className:
|
|
1815
|
+
onMenuToggle: o,
|
|
1816
|
+
labels: i,
|
|
1817
|
+
className: l = ""
|
|
229
1818
|
}) {
|
|
230
|
-
const
|
|
231
|
-
return /* @__PURE__ */
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
1819
|
+
const m = { ...tr, ...i }, d = (b) => b.split(" ").map((h) => h[0]).join("").toUpperCase().slice(0, 2);
|
|
1820
|
+
return /* @__PURE__ */ u(
|
|
1821
|
+
"header",
|
|
1822
|
+
{
|
|
1823
|
+
className: `glass flex items-center justify-between px-7 h-[68px] sticky top-0 z-[100] border-b border-on-surface/[0.06] shadow-[0_1px_2px_rgba(11,28,48,0.03)] dark:border-outline-variant/50 dark:shadow-[0_1px_3px_rgba(0,0,0,0.3)] ${l}`,
|
|
1824
|
+
role: "banner",
|
|
1825
|
+
children: [
|
|
1826
|
+
/* @__PURE__ */ u("div", { className: "flex items-center gap-[0.85rem]", children: [
|
|
1827
|
+
o && /* @__PURE__ */ r(
|
|
1828
|
+
"button",
|
|
1829
|
+
{
|
|
1830
|
+
className: "flex items-center justify-center w-[38px] h-[38px] rounded-[10px] cursor-pointer text-[1.2rem] transition-all duration-200 ease-in-out text-[#475569] border border-[rgba(226,232,240,0.8)] bg-[rgba(248,250,252,0.8)] hover:bg-[#f1f5f9] hover:border-[#cbd5e1] hover:text-[#1e293b] dark:bg-[rgba(30,41,59,0.7)] dark:border-[rgba(71,85,105,0.5)] dark:text-[#94a3b8] dark:hover:bg-[rgba(71,85,105,0.4)] dark:hover:border-[rgba(100,116,139,0.5)] dark:hover:text-on-surface",
|
|
1831
|
+
onClick: o,
|
|
1832
|
+
"aria-label": m.toggleMenu,
|
|
1833
|
+
children: "☰"
|
|
1834
|
+
}
|
|
1835
|
+
),
|
|
1836
|
+
e && /* @__PURE__ */ r("div", { className: "flex items-center", children: e }),
|
|
1837
|
+
t && /* @__PURE__ */ r("span", { className: "text-[1.1rem] font-semibold text-on-surface tracking-[-0.02em]", children: t })
|
|
1838
|
+
] }),
|
|
1839
|
+
/* @__PURE__ */ u("div", { className: "flex items-center gap-5", children: [
|
|
1840
|
+
n && /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: n }),
|
|
1841
|
+
a && /* @__PURE__ */ u(
|
|
1842
|
+
"div",
|
|
1843
|
+
{
|
|
1844
|
+
className: "flex items-center gap-3 rounded-xl transition-colors duration-200 ease-in-out hover:bg-[rgba(241,245,249,0.8)] dark:hover:bg-[rgba(71,85,105,0.3)] cursor-default",
|
|
1845
|
+
style: { padding: "0.4rem 0.6rem 0.4rem 0.4rem" },
|
|
1846
|
+
children: [
|
|
1847
|
+
/* @__PURE__ */ r(
|
|
1848
|
+
"div",
|
|
1849
|
+
{
|
|
1850
|
+
className: "w-[38px] h-[38px] rounded-[10px] flex items-center justify-center text-[0.8rem] font-bold text-white overflow-hidden shrink-0",
|
|
1851
|
+
style: {
|
|
1852
|
+
background: "linear-gradient(135deg, #3b82f6 0%, #6366f1 100%)",
|
|
1853
|
+
boxShadow: "0 2px 8px rgba(59,130,246,0.25)"
|
|
1854
|
+
},
|
|
1855
|
+
children: a.avatar ? /* @__PURE__ */ r("img", { src: a.avatar, alt: a.name, className: "w-full h-full object-cover" }) : d(a.name)
|
|
1856
|
+
}
|
|
1857
|
+
),
|
|
1858
|
+
/* @__PURE__ */ u("div", { className: "flex flex-col", children: [
|
|
1859
|
+
/* @__PURE__ */ r("span", { className: "text-[0.85rem] font-semibold text-[#0f172a] dark:text-on-surface", children: a.name }),
|
|
1860
|
+
a.role && /* @__PURE__ */ r("span", { className: "text-[0.7rem] text-[#64748b] dark:text-[#94a3b8] font-normal", children: a.role })
|
|
1861
|
+
] })
|
|
1862
|
+
]
|
|
1863
|
+
}
|
|
1864
|
+
)
|
|
259
1865
|
] })
|
|
260
|
-
]
|
|
261
|
-
|
|
262
|
-
|
|
1866
|
+
]
|
|
1867
|
+
}
|
|
1868
|
+
);
|
|
263
1869
|
}
|
|
264
|
-
function
|
|
1870
|
+
function St({
|
|
265
1871
|
items: t,
|
|
266
1872
|
separator: e = "/",
|
|
267
|
-
ariaLabel:
|
|
1873
|
+
ariaLabel: n = "Breadcrumb",
|
|
268
1874
|
className: a = ""
|
|
269
1875
|
}) {
|
|
270
|
-
return /* @__PURE__ */
|
|
271
|
-
const
|
|
272
|
-
return /* @__PURE__ */
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
] }) : /* @__PURE__ */
|
|
276
|
-
/* @__PURE__ */
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
1876
|
+
return /* @__PURE__ */ r("nav", { className: `py-[0.6rem] ${a}`, "aria-label": n, children: /* @__PURE__ */ r("ol", { className: "flex items-center list-none m-0 p-0 flex-wrap", children: t.map((o, i) => {
|
|
1877
|
+
const l = i === t.length - 1;
|
|
1878
|
+
return /* @__PURE__ */ r("li", { className: "flex items-center", children: l ? /* @__PURE__ */ u("span", { className: "inline-flex items-center gap-[0.35rem] text-[#0f172a] dark:text-on-surface text-[0.82rem] font-bold py-[0.3rem] px-[0.7rem] bg-[rgba(15,23,42,0.05)] dark:bg-[rgba(71,85,105,0.4)] rounded-[6px]", children: [
|
|
1879
|
+
o.icon && /* @__PURE__ */ r("span", { className: "flex items-center text-[0.85rem]", children: o.icon }),
|
|
1880
|
+
o.label
|
|
1881
|
+
] }) : /* @__PURE__ */ u(Y, { children: [
|
|
1882
|
+
/* @__PURE__ */ u(
|
|
1883
|
+
"a",
|
|
1884
|
+
{
|
|
1885
|
+
href: o.href || "#",
|
|
1886
|
+
className: "inline-flex items-center gap-[0.35rem] text-[#64748b] dark:text-[#94a3b8] no-underline text-[0.82rem] font-medium py-[0.3rem] px-[0.6rem] rounded-[6px] transition-all duration-200 ease-in-out hover:text-[#3b82f6] hover:bg-[rgba(59,130,246,0.08)] dark:hover:bg-[rgba(59,130,246,0.12)]",
|
|
1887
|
+
children: [
|
|
1888
|
+
o.icon && /* @__PURE__ */ r("span", { className: "flex items-center text-[0.85rem]", children: o.icon }),
|
|
1889
|
+
o.label
|
|
1890
|
+
]
|
|
1891
|
+
}
|
|
1892
|
+
),
|
|
1893
|
+
/* @__PURE__ */ r("span", { "aria-hidden": "true", className: "mx-1 text-[#cbd5e1] dark:text-[#475569] text-[0.75rem] select-none", children: e })
|
|
1894
|
+
] }) }, `${o.label}-${i}`);
|
|
282
1895
|
}) }) });
|
|
283
1896
|
}
|
|
284
|
-
const
|
|
1897
|
+
const nr = {
|
|
285
1898
|
searchPlaceholder: "Search...",
|
|
286
1899
|
results: "results",
|
|
287
1900
|
emptyMessage: "No data found",
|
|
@@ -290,448 +1903,517 @@ const J = {
|
|
|
290
1903
|
previous: "← Prev",
|
|
291
1904
|
next: "Next →"
|
|
292
1905
|
};
|
|
293
|
-
function
|
|
1906
|
+
function Tt({
|
|
294
1907
|
data: t,
|
|
295
1908
|
columns: e,
|
|
296
|
-
searchable:
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
);
|
|
1909
|
+
searchable: n = !0,
|
|
1910
|
+
searchPlaceholder: a,
|
|
1911
|
+
pageSize: o = 5,
|
|
1912
|
+
className: i = "",
|
|
1913
|
+
labels: l
|
|
1914
|
+
}) {
|
|
1915
|
+
const [m, d] = S(""), [b, h] = S(null), [c, s] = S(!0), [f, p] = S(0), g = { ...nr, ...l }, N = Q(() => {
|
|
1916
|
+
let k = t;
|
|
1917
|
+
if (m) {
|
|
1918
|
+
const x = m.toLowerCase();
|
|
1919
|
+
k = k.filter((w) => e.some((v) => String(w[v.key] ?? "").toLowerCase().includes(x)));
|
|
308
1920
|
}
|
|
309
|
-
return
|
|
310
|
-
const
|
|
311
|
-
return
|
|
312
|
-
})),
|
|
313
|
-
}, [t,
|
|
314
|
-
|
|
1921
|
+
return b && (k = [...k].sort((x, w) => {
|
|
1922
|
+
const v = String(x[b] ?? ""), y = String(w[b] ?? "");
|
|
1923
|
+
return c ? v.localeCompare(y, void 0, { numeric: !0 }) : y.localeCompare(v, void 0, { numeric: !0 });
|
|
1924
|
+
})), k;
|
|
1925
|
+
}, [t, m, b, c, e]), $ = o > 0 ? Math.ceil(N.length / o) : 1, _ = o > 0 ? N.slice(f * o, (f + 1) * o) : N, E = (k) => {
|
|
1926
|
+
b === k ? s(!c) : (h(k), s(!0));
|
|
315
1927
|
};
|
|
316
|
-
return /* @__PURE__ */
|
|
317
|
-
|
|
318
|
-
/* @__PURE__ */
|
|
319
|
-
/* @__PURE__ */
|
|
320
|
-
|
|
1928
|
+
return /* @__PURE__ */ u("div", { className: `bg-surface-container-lowest rounded-[20px] shadow-[0_1px_2px_rgba(11,28,48,0.04),0_12px_32px_-14px_rgba(11,28,48,0.14)] dark:shadow-[0_1px_3px_rgba(0,0,0,0.3),0_2px_8px_rgba(0,0,0,0.3)] border border-on-surface/[0.06] dark:border-[rgba(51,65,85,0.5)] overflow-hidden ${i}`, children: [
|
|
1929
|
+
n && /* @__PURE__ */ u("div", { className: "flex items-center justify-between py-5 px-6 border-b border-on-surface/[0.06] dark:border-[rgba(51,65,85,0.5)]", children: [
|
|
1930
|
+
/* @__PURE__ */ u("div", { className: "flex items-center gap-2 bg-[#f8fafc] dark:bg-background border border-on-surface/[0.08] dark:border-[rgba(71,85,105,0.5)] rounded-[10px] py-2 px-[0.85rem] transition-[border-color,box-shadow] duration-200 focus-within:border-primary focus-within:shadow-[0_0_0_3px_rgb(var(--primary)/0.12)] dark:focus-within:border-primary dark:focus-within:shadow-[0_0_0_3px_rgba(59,130,246,0.15)]", children: [
|
|
1931
|
+
/* @__PURE__ */ u("svg", { width: "15", height: "15", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", className: "shrink-0 text-outline", "aria-hidden": "true", children: [
|
|
1932
|
+
/* @__PURE__ */ r("circle", { cx: "11", cy: "11", r: "8" }),
|
|
1933
|
+
/* @__PURE__ */ r("path", { d: "m21 21-4.35-4.35", strokeLinecap: "round" })
|
|
1934
|
+
] }),
|
|
1935
|
+
/* @__PURE__ */ r(
|
|
321
1936
|
"input",
|
|
322
1937
|
{
|
|
323
|
-
className: "border-none bg-transparent outline-none text-[0.85rem] font-[inherit] text-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
1938
|
+
className: "border-none bg-transparent outline-none text-[0.85rem] font-[inherit] text-on-surface dark:text-on-surface w-[200px] placeholder:text-[#94a3b8] dark:placeholder:text-[#64748b]",
|
|
1939
|
+
placeholder: a ?? g.searchPlaceholder,
|
|
1940
|
+
value: m,
|
|
1941
|
+
onChange: (k) => {
|
|
1942
|
+
d(k.target.value), p(0);
|
|
1943
|
+
}
|
|
329
1944
|
}
|
|
330
1945
|
)
|
|
331
1946
|
] }),
|
|
332
|
-
/* @__PURE__ */
|
|
333
|
-
|
|
1947
|
+
/* @__PURE__ */ u("span", { className: "text-[0.75rem] font-medium text-[#94a3b8]", children: [
|
|
1948
|
+
N.length,
|
|
334
1949
|
" ",
|
|
335
1950
|
g.results
|
|
336
1951
|
] })
|
|
337
1952
|
] }),
|
|
338
|
-
/* @__PURE__ */
|
|
339
|
-
/* @__PURE__ */
|
|
1953
|
+
/* @__PURE__ */ r("div", { className: "overflow-x-auto", children: /* @__PURE__ */ u("table", { className: "w-full border-separate border-spacing-0", children: [
|
|
1954
|
+
/* @__PURE__ */ r("thead", { children: /* @__PURE__ */ r("tr", { children: e.map((k) => /* @__PURE__ */ u(
|
|
340
1955
|
"th",
|
|
341
1956
|
{
|
|
342
|
-
className: `text-left py-
|
|
343
|
-
style:
|
|
344
|
-
onClick:
|
|
1957
|
+
className: `text-left py-[0.9rem] px-5 text-[0.68rem] font-semibold text-[#767586] dark:text-[#94a3b8] uppercase tracking-[0.08em] bg-transparent dark:bg-background border-b border-on-surface/[0.06] dark:border-[rgba(51,65,85,0.5)] whitespace-nowrap ${k.sortable ? "cursor-pointer select-none transition-colors duration-150 hover:text-on-surface dark:hover:text-on-surface" : ""}`,
|
|
1958
|
+
style: k.width ? { width: k.width } : void 0,
|
|
1959
|
+
onClick: k.sortable ? () => E(k.key) : void 0,
|
|
345
1960
|
children: [
|
|
346
|
-
|
|
347
|
-
|
|
1961
|
+
k.label,
|
|
1962
|
+
k.sortable && b === k.key && /* @__PURE__ */ r("span", { className: "text-[0.7rem] ml-1", children: c ? "↑" : "↓" })
|
|
348
1963
|
]
|
|
349
1964
|
},
|
|
350
|
-
|
|
1965
|
+
k.key
|
|
351
1966
|
)) }) }),
|
|
352
|
-
/* @__PURE__ */
|
|
1967
|
+
/* @__PURE__ */ r("tbody", { children: _.length === 0 ? /* @__PURE__ */ r("tr", { children: /* @__PURE__ */ r("td", { colSpan: e.length, className: "py-12 px-6 text-center text-[#94a3b8] text-[0.85rem]", children: g.emptyMessage }) }) : _.map((k, x) => /* @__PURE__ */ r("tr", { className: "group", children: e.map((w) => /* @__PURE__ */ r(
|
|
1968
|
+
"td",
|
|
1969
|
+
{
|
|
1970
|
+
className: `py-4 px-5 text-[0.85rem] text-on-surface dark:text-[#cbd5e1] align-middle border-b border-on-surface/[0.05] dark:border-[rgba(51,65,85,0.4)] last:border-b-0 transition-colors duration-150 group-hover:bg-primary/[0.07] dark:group-hover:bg-[rgba(71,85,105,0.35)] ${x % 2 !== 0 ? "bg-surface-container-low/40 dark:bg-[rgba(51,65,85,0.25)]" : ""}`,
|
|
1971
|
+
children: w.render ? w.render(k[w.key], k) : String(k[w.key] ?? "")
|
|
1972
|
+
},
|
|
1973
|
+
w.key
|
|
1974
|
+
)) }, x)) })
|
|
353
1975
|
] }) }),
|
|
354
|
-
|
|
355
|
-
/* @__PURE__ */
|
|
1976
|
+
o > 0 && $ > 1 && /* @__PURE__ */ u("div", { className: "flex items-center justify-center gap-4 py-4 px-6 border-t border-on-surface/[0.06] dark:border-[rgba(51,65,85,0.5)]", children: [
|
|
1977
|
+
/* @__PURE__ */ r(
|
|
356
1978
|
"button",
|
|
357
1979
|
{
|
|
358
|
-
className: "py-[0.
|
|
359
|
-
disabled:
|
|
360
|
-
onClick: () =>
|
|
1980
|
+
className: "py-[0.45rem] px-[0.9rem] border border-on-surface/10 dark:border-[rgba(71,85,105,0.5)] rounded-[10px] bg-surface-container-lowest dark:bg-[#1e293b] text-[0.78rem] font-semibold text-[#565e74] dark:text-[#cbd5e1] cursor-pointer font-[inherit] transition-all duration-150 disabled:opacity-40 disabled:cursor-not-allowed hover:enabled:border-primary hover:enabled:text-primary hover:enabled:bg-primary/[0.04] dark:hover:enabled:border-[#3b82f6] dark:hover:enabled:text-[#3b82f6]",
|
|
1981
|
+
disabled: f === 0,
|
|
1982
|
+
onClick: () => p(f - 1),
|
|
361
1983
|
children: g.previous
|
|
362
1984
|
}
|
|
363
1985
|
),
|
|
364
|
-
/* @__PURE__ */
|
|
1986
|
+
/* @__PURE__ */ u("span", { className: "text-[0.78rem] text-[#64748b] dark:text-[#94a3b8] font-medium", children: [
|
|
365
1987
|
g.page,
|
|
366
1988
|
" ",
|
|
367
|
-
|
|
1989
|
+
f + 1,
|
|
368
1990
|
" ",
|
|
369
1991
|
g.of,
|
|
370
1992
|
" ",
|
|
371
|
-
|
|
1993
|
+
$
|
|
372
1994
|
] }),
|
|
373
|
-
/* @__PURE__ */
|
|
1995
|
+
/* @__PURE__ */ r(
|
|
374
1996
|
"button",
|
|
375
1997
|
{
|
|
376
|
-
className: "py-[0.
|
|
377
|
-
disabled:
|
|
378
|
-
onClick: () =>
|
|
1998
|
+
className: "py-[0.45rem] px-[0.9rem] border border-on-surface/10 dark:border-[rgba(71,85,105,0.5)] rounded-[10px] bg-surface-container-lowest dark:bg-[#1e293b] text-[0.78rem] font-semibold text-[#565e74] dark:text-[#cbd5e1] cursor-pointer font-[inherit] transition-all duration-150 disabled:opacity-40 disabled:cursor-not-allowed hover:enabled:border-primary hover:enabled:text-primary hover:enabled:bg-primary/[0.04] dark:hover:enabled:border-[#3b82f6] dark:hover:enabled:text-[#3b82f6]",
|
|
1999
|
+
disabled: f >= $ - 1,
|
|
2000
|
+
onClick: () => p(f + 1),
|
|
379
2001
|
children: g.next
|
|
380
2002
|
}
|
|
381
2003
|
)
|
|
382
2004
|
] })
|
|
383
2005
|
] });
|
|
384
2006
|
}
|
|
385
|
-
function
|
|
2007
|
+
function Ct({
|
|
386
2008
|
items: t,
|
|
387
2009
|
title: e,
|
|
388
|
-
badge:
|
|
2010
|
+
badge: n,
|
|
389
2011
|
className: a = ""
|
|
390
2012
|
}) {
|
|
391
|
-
const
|
|
392
|
-
return /* @__PURE__ */
|
|
393
|
-
|
|
394
|
-
e ? /* @__PURE__ */
|
|
395
|
-
|
|
2013
|
+
const o = e && e.length > 0 || n;
|
|
2014
|
+
return /* @__PURE__ */ u("div", { className: `bg-surface-container-lowest rounded-[20px] p-6 shadow-[0_1px_2px_rgba(11,28,48,0.04),0_12px_32px_-14px_rgba(11,28,48,0.14)] dark:shadow-[0_1px_3px_rgba(0,0,0,0.3),0_2px_8px_rgba(0,0,0,0.3)] border border-on-surface/[0.06] dark:border-[rgba(51,65,85,0.5)] ${a}`, children: [
|
|
2015
|
+
o && /* @__PURE__ */ u("div", { className: "flex justify-between items-center mb-5", children: [
|
|
2016
|
+
e ? /* @__PURE__ */ r("span", { className: "text-[0.95rem] font-bold text-[#0f172a] dark:text-on-surface", children: e }) : /* @__PURE__ */ r("span", {}),
|
|
2017
|
+
n && /* @__PURE__ */ r("span", { children: n })
|
|
396
2018
|
] }),
|
|
397
|
-
/* @__PURE__ */
|
|
398
|
-
|
|
399
|
-
|
|
2019
|
+
/* @__PURE__ */ r("div", { className: "flex flex-col", children: t.map((i, l) => /* @__PURE__ */ u("div", { className: "flex gap-[0.85rem] py-[0.85rem] relative", children: [
|
|
2020
|
+
l < t.length - 1 && /* @__PURE__ */ r(
|
|
2021
|
+
"div",
|
|
2022
|
+
{
|
|
2023
|
+
"aria-hidden": "true",
|
|
2024
|
+
className: "absolute left-[18px] top-[48px] bottom-0 w-[1.5px]",
|
|
2025
|
+
style: { background: "linear-gradient(180deg, rgb(var(--outline-variant)), transparent)" }
|
|
2026
|
+
}
|
|
2027
|
+
),
|
|
2028
|
+
/* @__PURE__ */ r(
|
|
400
2029
|
"div",
|
|
401
2030
|
{
|
|
402
2031
|
className: "w-9 h-9 rounded-[10px] flex items-center justify-center text-[0.95rem] shrink-0 relative z-[1]",
|
|
403
|
-
style: { background:
|
|
404
|
-
children:
|
|
2032
|
+
style: { background: i.iconBg || "rgb(var(--surface-container-low))" },
|
|
2033
|
+
children: i.icon
|
|
405
2034
|
}
|
|
406
2035
|
),
|
|
407
|
-
/* @__PURE__ */
|
|
408
|
-
/* @__PURE__ */
|
|
409
|
-
/* @__PURE__ */
|
|
2036
|
+
/* @__PURE__ */ u("div", { className: "flex-1 min-w-0", children: [
|
|
2037
|
+
/* @__PURE__ */ r("div", { className: "text-[0.82rem] text-[#334155] dark:text-[#cbd5e1] leading-[1.5]", children: i.message }),
|
|
2038
|
+
/* @__PURE__ */ r("div", { className: "text-[0.7rem] text-[#94a3b8] mt-[0.2rem]", children: i.time })
|
|
410
2039
|
] })
|
|
411
|
-
] },
|
|
2040
|
+
] }, l)) })
|
|
412
2041
|
] });
|
|
413
2042
|
}
|
|
414
|
-
const
|
|
415
|
-
|
|
416
|
-
};
|
|
417
|
-
function ke({
|
|
2043
|
+
const ar = { unit: "projects" };
|
|
2044
|
+
function Et({
|
|
418
2045
|
items: t,
|
|
419
2046
|
title: e,
|
|
420
|
-
showCount:
|
|
2047
|
+
showCount: n = !0,
|
|
421
2048
|
labels: a,
|
|
422
|
-
className:
|
|
2049
|
+
className: o = ""
|
|
423
2050
|
}) {
|
|
424
|
-
const
|
|
425
|
-
return /* @__PURE__ */
|
|
426
|
-
e && /* @__PURE__ */
|
|
427
|
-
/* @__PURE__ */
|
|
428
|
-
|
|
2051
|
+
const i = { ...ar, ...a };
|
|
2052
|
+
return /* @__PURE__ */ u("div", { className: `bg-surface-container-lowest rounded-[20px] p-6 shadow-[0_1px_2px_rgba(11,28,48,0.04),0_12px_32px_-14px_rgba(11,28,48,0.14)] dark:shadow-[0_1px_3px_rgba(0,0,0,0.3),0_2px_8px_rgba(0,0,0,0.3)] border border-on-surface/[0.06] dark:border-[rgba(51,65,85,0.5)] ${o}`, children: [
|
|
2053
|
+
e && /* @__PURE__ */ u("div", { className: "flex justify-between items-center mb-5", children: [
|
|
2054
|
+
/* @__PURE__ */ r("span", { className: "text-[0.95rem] font-bold text-[#0f172a] dark:text-on-surface", children: e }),
|
|
2055
|
+
n && /* @__PURE__ */ u("span", { className: "text-[0.68rem] font-semibold py-[0.2rem] px-[0.55rem] rounded-[20px] bg-[#f5f3ff] text-violet dark:bg-[rgba(59,130,246,0.18)] dark:text-[#3b82f6]", children: [
|
|
429
2056
|
t.length,
|
|
430
2057
|
" ",
|
|
431
|
-
|
|
2058
|
+
i.unit
|
|
432
2059
|
] })
|
|
433
2060
|
] }),
|
|
434
|
-
t.map((
|
|
435
|
-
const
|
|
436
|
-
return /* @__PURE__ */
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
"
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
2061
|
+
t.map((l, m) => {
|
|
2062
|
+
const d = l.color || "rgb(var(--primary))";
|
|
2063
|
+
return /* @__PURE__ */ u(
|
|
2064
|
+
"div",
|
|
2065
|
+
{
|
|
2066
|
+
className: `py-[0.85rem] ${m < t.length - 1 ? "border-b border-[#f8fafc] dark:border-[rgba(51,65,85,0.4)]" : "border-b-0 pb-0"} ${m === 0 && !e ? "pt-0" : ""}`,
|
|
2067
|
+
children: [
|
|
2068
|
+
/* @__PURE__ */ u("div", { className: "flex justify-between items-center mb-2", children: [
|
|
2069
|
+
/* @__PURE__ */ r("span", { className: "text-[0.85rem] font-semibold text-[#0f172a] dark:text-on-surface", children: l.name }),
|
|
2070
|
+
/* @__PURE__ */ u("span", { className: "text-[0.75rem] font-bold", style: { color: d }, children: [
|
|
2071
|
+
l.progress,
|
|
2072
|
+
"%"
|
|
2073
|
+
] })
|
|
2074
|
+
] }),
|
|
2075
|
+
/* @__PURE__ */ r("div", { className: "h-[7px] bg-[#f1f5f9] dark:bg-[rgba(71,85,105,0.4)] rounded overflow-hidden", children: /* @__PURE__ */ r(
|
|
2076
|
+
"div",
|
|
2077
|
+
{
|
|
2078
|
+
className: "h-full rounded transition-[width] duration-500 ease-in-out",
|
|
2079
|
+
style: { width: `${l.progress}%`, background: d }
|
|
2080
|
+
}
|
|
2081
|
+
) }),
|
|
2082
|
+
(l.status || l.team) && /* @__PURE__ */ u("div", { className: "flex justify-between items-center mt-[0.4rem]", children: [
|
|
2083
|
+
l.status && /* @__PURE__ */ r("span", { className: "text-[0.7rem] text-[#94a3b8]", children: l.status }),
|
|
2084
|
+
l.team && /* @__PURE__ */ r("div", { className: "flex", children: l.team.map((b, h) => {
|
|
2085
|
+
const c = typeof b == "string" ? b : b.color, s = typeof b == "string" ? String.fromCharCode(65 + h) : b.label ?? String.fromCharCode(65 + h);
|
|
2086
|
+
return /* @__PURE__ */ r(
|
|
2087
|
+
"div",
|
|
2088
|
+
{
|
|
2089
|
+
className: "w-[22px] h-[22px] rounded-full border-2 border-surface-container-lowest dark:border-[#1e293b] flex items-center justify-center text-[0.55rem] font-bold text-white",
|
|
2090
|
+
style: { background: c, marginLeft: h === 0 ? 0 : "-6px" },
|
|
2091
|
+
children: s
|
|
2092
|
+
},
|
|
2093
|
+
h
|
|
2094
|
+
);
|
|
2095
|
+
}) })
|
|
2096
|
+
] })
|
|
2097
|
+
]
|
|
2098
|
+
},
|
|
2099
|
+
l.name
|
|
2100
|
+
);
|
|
453
2101
|
})
|
|
454
2102
|
] });
|
|
455
2103
|
}
|
|
456
|
-
const
|
|
457
|
-
|
|
458
|
-
};
|
|
459
|
-
function $e({
|
|
2104
|
+
const or = { close: "Close" };
|
|
2105
|
+
function Mt({
|
|
460
2106
|
open: t,
|
|
461
2107
|
onClose: e,
|
|
462
|
-
title:
|
|
2108
|
+
title: n,
|
|
463
2109
|
children: a,
|
|
464
|
-
footer:
|
|
465
|
-
disableEscapeKey:
|
|
466
|
-
disableBackdropClick:
|
|
467
|
-
labels:
|
|
468
|
-
className:
|
|
2110
|
+
footer: o,
|
|
2111
|
+
disableEscapeKey: i = !1,
|
|
2112
|
+
disableBackdropClick: l = !1,
|
|
2113
|
+
labels: m,
|
|
2114
|
+
className: d = ""
|
|
469
2115
|
}) {
|
|
470
|
-
const
|
|
471
|
-
return
|
|
472
|
-
if (!t ||
|
|
473
|
-
const
|
|
474
|
-
|
|
2116
|
+
const b = { ...or, ...m };
|
|
2117
|
+
return M(() => {
|
|
2118
|
+
if (!t || i) return;
|
|
2119
|
+
const h = (c) => {
|
|
2120
|
+
c.key === "Escape" && e();
|
|
475
2121
|
};
|
|
476
|
-
return document.addEventListener("keydown",
|
|
477
|
-
}, [t, e,
|
|
2122
|
+
return document.addEventListener("keydown", h), () => document.removeEventListener("keydown", h);
|
|
2123
|
+
}, [t, e, i]), M(() => {
|
|
478
2124
|
if (t)
|
|
479
2125
|
return document.body.style.overflow = "hidden", () => {
|
|
480
2126
|
document.body.style.overflow = "";
|
|
481
2127
|
};
|
|
482
|
-
}, [t]), t ? /* @__PURE__ */
|
|
2128
|
+
}, [t]), t ? /* @__PURE__ */ r(
|
|
483
2129
|
"div",
|
|
484
2130
|
{
|
|
485
2131
|
className: "fixed inset-0 backdrop-blur-[4px] flex items-center justify-center z-[1000] anicca-fade-in p-4",
|
|
486
|
-
style: { background: "
|
|
487
|
-
onClick:
|
|
2132
|
+
style: { background: "rgba(15,23,42,0.6)" },
|
|
2133
|
+
onClick: l ? void 0 : e,
|
|
488
2134
|
role: "dialog",
|
|
489
2135
|
"aria-modal": "true",
|
|
490
|
-
"aria-label":
|
|
491
|
-
children: /* @__PURE__ */
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
2136
|
+
"aria-label": n,
|
|
2137
|
+
children: /* @__PURE__ */ u(
|
|
2138
|
+
"div",
|
|
2139
|
+
{
|
|
2140
|
+
className: `bg-surface-container-lowest rounded-[22px] border border-on-surface/[0.06] dark:border-[rgba(51,65,85,0.5)] w-full max-w-[480px] max-h-[90vh] overflow-y-auto anicca-slide-up shadow-[0_24px_70px_-20px_rgba(11,28,48,0.35),0_8px_24px_-12px_rgb(var(--primary)/0.12)] dark:shadow-[0_20px_60px_rgba(0,0,0,0.55)] ${d}`,
|
|
2141
|
+
onClick: (h) => h.stopPropagation(),
|
|
2142
|
+
children: [
|
|
2143
|
+
n && /* @__PURE__ */ u("div", { className: "flex items-center justify-between py-5 px-6 border-b border-on-surface/[0.06] dark:border-[rgba(51,65,85,0.5)]", children: [
|
|
2144
|
+
/* @__PURE__ */ r("span", { className: "text-body-base font-semibold tracking-[-0.01em] text-on-surface", children: n }),
|
|
2145
|
+
/* @__PURE__ */ r(
|
|
2146
|
+
"button",
|
|
2147
|
+
{
|
|
2148
|
+
className: "w-8 h-8 rounded-[10px] border-none bg-on-surface/[0.05] text-secondary text-[1.1rem] cursor-pointer flex items-center justify-center transition-all duration-150 font-[inherit] hover:bg-[#e2e8f0] hover:text-[#1e293b] dark:bg-[#334155] dark:text-[#94a3b8] dark:hover:bg-[#475569] dark:hover:text-on-surface",
|
|
2149
|
+
onClick: e,
|
|
2150
|
+
"aria-label": b.close,
|
|
2151
|
+
children: "×"
|
|
2152
|
+
}
|
|
2153
|
+
)
|
|
2154
|
+
] }),
|
|
2155
|
+
/* @__PURE__ */ r("div", { className: "p-6 text-on-surface", children: a }),
|
|
2156
|
+
o && /* @__PURE__ */ r("div", { className: "flex justify-end gap-3 py-4 px-6 border-t border-on-surface/[0.06] dark:border-[rgba(51,65,85,0.5)]", children: o })
|
|
2157
|
+
]
|
|
2158
|
+
}
|
|
2159
|
+
)
|
|
499
2160
|
}
|
|
500
2161
|
) : null;
|
|
501
2162
|
}
|
|
502
|
-
function
|
|
2163
|
+
function jt({
|
|
503
2164
|
tabs: t,
|
|
504
2165
|
defaultTab: e,
|
|
505
|
-
activeKey:
|
|
2166
|
+
activeKey: n,
|
|
506
2167
|
onChange: a,
|
|
507
|
-
className:
|
|
2168
|
+
className: o = ""
|
|
508
2169
|
}) {
|
|
509
|
-
var
|
|
510
|
-
const [
|
|
511
|
-
|
|
2170
|
+
var h;
|
|
2171
|
+
const [i, l] = S(e || ((h = t[0]) == null ? void 0 : h.key) || ""), m = n ?? i, d = t.find((c) => c.key === m), b = (c) => {
|
|
2172
|
+
n === void 0 && l(c), a == null || a(c);
|
|
512
2173
|
};
|
|
513
|
-
return /* @__PURE__ */
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
{
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
2174
|
+
return /* @__PURE__ */ u(
|
|
2175
|
+
"div",
|
|
2176
|
+
{
|
|
2177
|
+
className: `bg-surface-container-lowest rounded-[20px] shadow-[0_1px_2px_rgba(11,28,48,0.04),0_12px_32px_-14px_rgba(11,28,48,0.14)] dark:shadow-[0_1px_3px_rgba(0,0,0,0.3),0_2px_8px_rgba(0,0,0,0.3)] border border-on-surface/[0.06] overflow-hidden ${o}`,
|
|
2178
|
+
children: [
|
|
2179
|
+
/* @__PURE__ */ r(
|
|
2180
|
+
"div",
|
|
2181
|
+
{
|
|
2182
|
+
className: "flex pt-2 px-6 border-b border-[#f1f5f9] dark:border-outline-variant/50",
|
|
2183
|
+
role: "tablist",
|
|
2184
|
+
children: t.map((c) => {
|
|
2185
|
+
const s = m === c.key;
|
|
2186
|
+
return /* @__PURE__ */ u(
|
|
2187
|
+
"button",
|
|
2188
|
+
{
|
|
2189
|
+
className: `
|
|
2190
|
+
py-[0.7rem] px-[1.1rem] text-[0.82rem] font-medium cursor-pointer
|
|
2191
|
+
border-none bg-transparent border-b-2 transition-all duration-200
|
|
2192
|
+
flex items-center gap-[0.4rem] font-[inherit] -mb-px
|
|
2193
|
+
${s ? "text-primary border-b-primary font-semibold" : "text-secondary border-b-transparent hover:text-on-surface dark:text-[#94a3b8] dark:hover:text-on-surface"}
|
|
2194
|
+
`,
|
|
2195
|
+
onClick: () => b(c.key),
|
|
2196
|
+
role: "tab",
|
|
2197
|
+
"aria-selected": s,
|
|
2198
|
+
children: [
|
|
2199
|
+
c.icon && /* @__PURE__ */ r("span", { className: "text-[0.9rem]", children: c.icon }),
|
|
2200
|
+
c.label
|
|
2201
|
+
]
|
|
2202
|
+
},
|
|
2203
|
+
c.key
|
|
2204
|
+
);
|
|
2205
|
+
})
|
|
2206
|
+
}
|
|
2207
|
+
),
|
|
2208
|
+
/* @__PURE__ */ r("div", { className: "p-6 text-on-surface", role: "tabpanel", children: d == null ? void 0 : d.content })
|
|
2209
|
+
]
|
|
2210
|
+
}
|
|
2211
|
+
);
|
|
530
2212
|
}
|
|
531
|
-
function
|
|
2213
|
+
function It(t = "This field is required") {
|
|
532
2214
|
return {
|
|
533
2215
|
validate: (e) => e == null ? !1 : typeof e == "string" ? e.trim().length > 0 : Array.isArray(e) ? e.length > 0 : !0,
|
|
534
2216
|
message: t
|
|
535
2217
|
};
|
|
536
2218
|
}
|
|
537
|
-
function
|
|
2219
|
+
function Dt(t = "Invalid email address") {
|
|
538
2220
|
return {
|
|
539
2221
|
validate: (e) => typeof e != "string" ? !1 : /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),
|
|
540
2222
|
message: t
|
|
541
2223
|
};
|
|
542
2224
|
}
|
|
543
|
-
function
|
|
2225
|
+
function Bt(t, e) {
|
|
544
2226
|
return {
|
|
545
|
-
validate: (
|
|
2227
|
+
validate: (n) => typeof n != "string" ? !1 : n.length >= t,
|
|
546
2228
|
message: e || `Must be at least ${t} characters`
|
|
547
2229
|
};
|
|
548
2230
|
}
|
|
549
|
-
function
|
|
2231
|
+
function Ft(t, e) {
|
|
550
2232
|
return {
|
|
551
|
-
validate: (
|
|
2233
|
+
validate: (n) => typeof n != "string" ? !1 : n.length <= t,
|
|
552
2234
|
message: e || `Must be at most ${t} characters`
|
|
553
2235
|
};
|
|
554
2236
|
}
|
|
555
|
-
function
|
|
2237
|
+
function Rt(t, e = "Invalid format") {
|
|
556
2238
|
return {
|
|
557
|
-
validate: (
|
|
2239
|
+
validate: (n) => typeof n != "string" ? !1 : t.test(n),
|
|
558
2240
|
message: e
|
|
559
2241
|
};
|
|
560
2242
|
}
|
|
561
|
-
function
|
|
2243
|
+
function Pt(t, e) {
|
|
562
2244
|
return {
|
|
563
|
-
validate: (
|
|
2245
|
+
validate: (n) => typeof n != "number" ? !1 : n >= t,
|
|
564
2246
|
message: e || `Must be at least ${t}`
|
|
565
2247
|
};
|
|
566
2248
|
}
|
|
567
|
-
function
|
|
2249
|
+
function Wt(t, e) {
|
|
568
2250
|
return {
|
|
569
|
-
validate: (
|
|
2251
|
+
validate: (n) => typeof n != "number" ? !1 : n <= t,
|
|
570
2252
|
message: e || `Must be at most ${t}`
|
|
571
2253
|
};
|
|
572
2254
|
}
|
|
573
|
-
function
|
|
2255
|
+
function Ot(t, e) {
|
|
574
2256
|
return {
|
|
575
2257
|
validate: t,
|
|
576
2258
|
message: e
|
|
577
2259
|
};
|
|
578
2260
|
}
|
|
579
|
-
function
|
|
580
|
-
const { initialValues: e, validationSchema:
|
|
581
|
-
(
|
|
582
|
-
const
|
|
583
|
-
if (
|
|
584
|
-
for (const
|
|
585
|
-
if (!
|
|
586
|
-
return
|
|
2261
|
+
function zt(t) {
|
|
2262
|
+
const { initialValues: e, validationSchema: n, onSubmit: a } = t, [o, i] = S(e), [l, m] = S({}), [d, b] = S({}), [h, c] = S(!1), s = C(
|
|
2263
|
+
(x, w) => {
|
|
2264
|
+
const v = n == null ? void 0 : n[x];
|
|
2265
|
+
if (v) {
|
|
2266
|
+
for (const y of v)
|
|
2267
|
+
if (!y.validate(w))
|
|
2268
|
+
return y.message;
|
|
587
2269
|
}
|
|
588
2270
|
},
|
|
589
|
-
[
|
|
590
|
-
),
|
|
591
|
-
const
|
|
592
|
-
for (const
|
|
593
|
-
const
|
|
594
|
-
|
|
2271
|
+
[n]
|
|
2272
|
+
), f = C(() => {
|
|
2273
|
+
const x = {};
|
|
2274
|
+
for (const w of Object.keys(e)) {
|
|
2275
|
+
const v = s(w, o[w]);
|
|
2276
|
+
v && (x[w] = v);
|
|
595
2277
|
}
|
|
596
|
-
return
|
|
597
|
-
}, [e,
|
|
598
|
-
(
|
|
599
|
-
const
|
|
600
|
-
if (
|
|
601
|
-
const
|
|
602
|
-
|
|
603
|
-
const
|
|
604
|
-
return
|
|
2278
|
+
return x;
|
|
2279
|
+
}, [e, s, o]), p = Object.keys(l).length === 0, g = C(
|
|
2280
|
+
(x) => (w) => {
|
|
2281
|
+
const v = w.target.value;
|
|
2282
|
+
if (i((y) => ({ ...y, [x]: v })), d[x]) {
|
|
2283
|
+
const y = s(x, v);
|
|
2284
|
+
m((A) => {
|
|
2285
|
+
const T = { ...A };
|
|
2286
|
+
return y ? T[x] = y : delete T[x], T;
|
|
605
2287
|
});
|
|
606
2288
|
}
|
|
607
2289
|
},
|
|
608
|
-
[
|
|
609
|
-
),
|
|
610
|
-
(
|
|
611
|
-
|
|
612
|
-
const
|
|
613
|
-
|
|
614
|
-
const
|
|
615
|
-
return
|
|
2290
|
+
[d, s]
|
|
2291
|
+
), N = C(
|
|
2292
|
+
(x) => () => {
|
|
2293
|
+
b((v) => ({ ...v, [x]: !0 }));
|
|
2294
|
+
const w = s(x, o[x]);
|
|
2295
|
+
m((v) => {
|
|
2296
|
+
const y = { ...v };
|
|
2297
|
+
return w ? y[x] = w : delete y[x], y;
|
|
616
2298
|
});
|
|
617
2299
|
},
|
|
618
|
-
[
|
|
619
|
-
),
|
|
620
|
-
async (
|
|
621
|
-
|
|
622
|
-
const
|
|
623
|
-
for (const
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
const
|
|
627
|
-
if (
|
|
628
|
-
|
|
2300
|
+
[s, o]
|
|
2301
|
+
), $ = C(
|
|
2302
|
+
async (x) => {
|
|
2303
|
+
x && x.preventDefault();
|
|
2304
|
+
const w = {};
|
|
2305
|
+
for (const y of Object.keys(e))
|
|
2306
|
+
w[y] = !0;
|
|
2307
|
+
b(w);
|
|
2308
|
+
const v = f();
|
|
2309
|
+
if (m(v), Object.keys(v).length === 0 && a) {
|
|
2310
|
+
c(!0);
|
|
629
2311
|
try {
|
|
630
|
-
await a(
|
|
2312
|
+
await a(o);
|
|
631
2313
|
} finally {
|
|
632
|
-
|
|
2314
|
+
c(!1);
|
|
633
2315
|
}
|
|
634
2316
|
}
|
|
635
2317
|
},
|
|
636
|
-
[e, a,
|
|
637
|
-
),
|
|
638
|
-
|
|
639
|
-
}, [e]),
|
|
640
|
-
(
|
|
641
|
-
if (
|
|
642
|
-
const
|
|
643
|
-
|
|
644
|
-
const
|
|
645
|
-
return
|
|
2318
|
+
[e, a, f, o]
|
|
2319
|
+
), _ = C(() => {
|
|
2320
|
+
i(e), m({}), b({}), c(!1);
|
|
2321
|
+
}, [e]), E = C(
|
|
2322
|
+
(x, w) => {
|
|
2323
|
+
if (i((v) => ({ ...v, [x]: w })), d[x]) {
|
|
2324
|
+
const v = s(x, w);
|
|
2325
|
+
m((y) => {
|
|
2326
|
+
const A = { ...y };
|
|
2327
|
+
return v ? A[x] = v : delete A[x], A;
|
|
646
2328
|
});
|
|
647
2329
|
}
|
|
648
2330
|
},
|
|
649
|
-
[
|
|
650
|
-
),
|
|
651
|
-
|
|
2331
|
+
[d, s]
|
|
2332
|
+
), k = C((x, w) => {
|
|
2333
|
+
m((v) => ({ ...v, [x]: w }));
|
|
652
2334
|
}, []);
|
|
653
2335
|
return {
|
|
654
|
-
values:
|
|
655
|
-
errors:
|
|
656
|
-
touched:
|
|
657
|
-
isValid:
|
|
658
|
-
isSubmitting:
|
|
659
|
-
handleChange:
|
|
660
|
-
handleBlur:
|
|
661
|
-
handleSubmit:
|
|
662
|
-
reset:
|
|
663
|
-
setFieldValue:
|
|
664
|
-
setFieldError:
|
|
2336
|
+
values: o,
|
|
2337
|
+
errors: l,
|
|
2338
|
+
touched: d,
|
|
2339
|
+
isValid: p,
|
|
2340
|
+
isSubmitting: h,
|
|
2341
|
+
handleChange: g,
|
|
2342
|
+
handleBlur: N,
|
|
2343
|
+
handleSubmit: $,
|
|
2344
|
+
reset: _,
|
|
2345
|
+
setFieldValue: E,
|
|
2346
|
+
setFieldError: k
|
|
665
2347
|
};
|
|
666
2348
|
}
|
|
667
|
-
const
|
|
668
|
-
function
|
|
2349
|
+
const ir = ["Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"], sr = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], cr = ["Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember"], dr = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
|
2350
|
+
function R(t) {
|
|
669
2351
|
return typeof t == "string" ? new Date(t) : new Date(t.getTime());
|
|
670
2352
|
}
|
|
671
|
-
function
|
|
2353
|
+
function Z(t) {
|
|
672
2354
|
return t.toString().padStart(2, "0");
|
|
673
2355
|
}
|
|
674
|
-
function
|
|
675
|
-
const a =
|
|
676
|
-
return e.replace("YYYY", a.getFullYear().toString()).replace("MM",
|
|
2356
|
+
function lr(t, e, n = "en") {
|
|
2357
|
+
const a = R(t), o = n === "id" ? ir : sr, i = n === "id" ? cr : dr;
|
|
2358
|
+
return e.replace("YYYY", a.getFullYear().toString()).replace("MM", Z(a.getMonth() + 1)).replace("DD", Z(a.getDate())).replace("HH", Z(a.getHours())).replace("mm", Z(a.getMinutes())).replace("ss", Z(a.getSeconds())).replace("dddd", o[a.getDay()]).replace("MMMM", i[a.getMonth()]);
|
|
677
2359
|
}
|
|
678
|
-
function
|
|
679
|
-
const a =
|
|
680
|
-
if (
|
|
681
|
-
return Math.abs(a.getFullYear() -
|
|
682
|
-
if (
|
|
2360
|
+
function ur(t, e, n) {
|
|
2361
|
+
const a = R(t), o = R(e);
|
|
2362
|
+
if (n === "years")
|
|
2363
|
+
return Math.abs(a.getFullYear() - o.getFullYear());
|
|
2364
|
+
if (n === "months")
|
|
683
2365
|
return Math.abs(
|
|
684
|
-
(a.getFullYear() -
|
|
2366
|
+
(a.getFullYear() - o.getFullYear()) * 12 + (a.getMonth() - o.getMonth())
|
|
685
2367
|
);
|
|
686
|
-
const
|
|
687
|
-
return Math.floor(
|
|
2368
|
+
const i = Math.abs(a.getTime() - o.getTime());
|
|
2369
|
+
return Math.floor(i / {
|
|
688
2370
|
seconds: 1e3,
|
|
689
2371
|
minutes: 6e4,
|
|
690
2372
|
hours: 36e5,
|
|
691
2373
|
days: 864e5
|
|
692
|
-
}[
|
|
2374
|
+
}[n]);
|
|
693
2375
|
}
|
|
694
|
-
function
|
|
695
|
-
const
|
|
2376
|
+
function fr(t, e = "en") {
|
|
2377
|
+
const n = R(t), o = (/* @__PURE__ */ new Date()).getTime() - n.getTime(), i = o < 0, l = Math.abs(o), m = Math.floor(l / 1e3), d = Math.floor(l / 6e4), b = Math.floor(l / 36e5), h = Math.floor(l / 864e5), c = Math.floor(h / 7), s = Math.floor(h / 30), f = Math.floor(h / 365);
|
|
696
2378
|
if (e === "id") {
|
|
697
|
-
const
|
|
698
|
-
return
|
|
2379
|
+
const p = i ? "lagi" : "lalu";
|
|
2380
|
+
return m < 60 ? "baru saja" : d < 60 ? `${d} menit ${p}` : b < 24 ? `${b} jam ${p}` : h < 7 ? `${h} hari ${p}` : c < 4 ? `${c} minggu ${p}` : s < 12 ? `${s} bulan ${p}` : `${f} tahun ${p}`;
|
|
699
2381
|
}
|
|
700
|
-
return
|
|
2382
|
+
return m < 60 ? "just now" : i ? d < 60 ? `in ${d} minutes` : b < 24 ? `in ${b} hours` : h < 7 ? `in ${h} days` : c < 4 ? `in ${c} weeks` : s < 12 ? `in ${s} months` : `in ${f} years` : d < 60 ? `${d} minutes ago` : b < 24 ? `${b} hours ago` : h < 7 ? `${h} days ago` : c < 4 ? `${c} weeks ago` : s < 12 ? `${s} months ago` : `${f} years ago`;
|
|
701
2383
|
}
|
|
702
|
-
function
|
|
703
|
-
const
|
|
2384
|
+
function mr(t, e) {
|
|
2385
|
+
const n = R(t);
|
|
704
2386
|
switch (e) {
|
|
705
2387
|
case "day":
|
|
706
|
-
return
|
|
2388
|
+
return n.setHours(0, 0, 0, 0), n;
|
|
707
2389
|
case "week": {
|
|
708
|
-
const a =
|
|
709
|
-
return
|
|
2390
|
+
const a = n.getDay();
|
|
2391
|
+
return n.setDate(n.getDate() - a), n.setHours(0, 0, 0, 0), n;
|
|
710
2392
|
}
|
|
711
2393
|
case "month":
|
|
712
|
-
return
|
|
2394
|
+
return n.setDate(1), n.setHours(0, 0, 0, 0), n;
|
|
713
2395
|
case "year":
|
|
714
|
-
return
|
|
2396
|
+
return n.setMonth(0, 1), n.setHours(0, 0, 0, 0), n;
|
|
715
2397
|
}
|
|
716
2398
|
}
|
|
717
|
-
function
|
|
718
|
-
const
|
|
2399
|
+
function br(t, e) {
|
|
2400
|
+
const n = R(t);
|
|
719
2401
|
switch (e) {
|
|
720
2402
|
case "day":
|
|
721
|
-
return
|
|
2403
|
+
return n.setHours(23, 59, 59, 999), n;
|
|
722
2404
|
case "week": {
|
|
723
|
-
const a =
|
|
724
|
-
return
|
|
2405
|
+
const a = n.getDay();
|
|
2406
|
+
return n.setDate(n.getDate() + (6 - a)), n.setHours(23, 59, 59, 999), n;
|
|
725
2407
|
}
|
|
726
2408
|
case "month":
|
|
727
|
-
return
|
|
2409
|
+
return n.setMonth(n.getMonth() + 1, 0), n.setHours(23, 59, 59, 999), n;
|
|
728
2410
|
case "year":
|
|
729
|
-
return
|
|
2411
|
+
return n.setMonth(11, 31), n.setHours(23, 59, 59, 999), n;
|
|
730
2412
|
}
|
|
731
2413
|
}
|
|
732
|
-
function
|
|
733
|
-
const a =
|
|
734
|
-
switch (
|
|
2414
|
+
function pr(t, e, n) {
|
|
2415
|
+
const a = R(t);
|
|
2416
|
+
switch (n) {
|
|
735
2417
|
case "minutes":
|
|
736
2418
|
return a.setMinutes(a.getMinutes() + e), a;
|
|
737
2419
|
case "hours":
|
|
@@ -744,184 +2426,536 @@ function ee(t, e, r) {
|
|
|
744
2426
|
return a.setFullYear(a.getFullYear() + e), a;
|
|
745
2427
|
}
|
|
746
2428
|
}
|
|
747
|
-
function
|
|
2429
|
+
function hr(t) {
|
|
748
2430
|
return t instanceof Date ? !isNaN(t.getTime()) : typeof t == "string" ? !isNaN(new Date(t).getTime()) : !1;
|
|
749
2431
|
}
|
|
750
|
-
function
|
|
751
|
-
return
|
|
2432
|
+
function xr(t, e) {
|
|
2433
|
+
return R(t).getTime() < R(e).getTime();
|
|
752
2434
|
}
|
|
753
|
-
function
|
|
754
|
-
return
|
|
2435
|
+
function gr(t, e) {
|
|
2436
|
+
return R(t).getTime() > R(e).getTime();
|
|
755
2437
|
}
|
|
756
|
-
function
|
|
757
|
-
const [e,
|
|
2438
|
+
function Ht(t) {
|
|
2439
|
+
const [e, n] = S(() => {
|
|
758
2440
|
if (t == null) return null;
|
|
759
|
-
const
|
|
760
|
-
return isNaN(
|
|
761
|
-
}), a =
|
|
762
|
-
if (
|
|
763
|
-
|
|
2441
|
+
const f = typeof t == "string" ? new Date(t) : t;
|
|
2442
|
+
return isNaN(f.getTime()) ? null : f;
|
|
2443
|
+
}), a = C((f) => {
|
|
2444
|
+
if (f === null) {
|
|
2445
|
+
n(null);
|
|
764
2446
|
return;
|
|
765
2447
|
}
|
|
766
|
-
const
|
|
767
|
-
|
|
768
|
-
}, []),
|
|
769
|
-
(
|
|
2448
|
+
const p = typeof f == "string" ? new Date(f) : f;
|
|
2449
|
+
n(isNaN(p.getTime()) ? null : p);
|
|
2450
|
+
}, []), o = C(
|
|
2451
|
+
(f, p = "en") => e ? lr(e, f, p) : "",
|
|
770
2452
|
[e]
|
|
771
|
-
),
|
|
772
|
-
(
|
|
2453
|
+
), i = C(
|
|
2454
|
+
(f, p) => e ? ur(e, f, p) : 0,
|
|
773
2455
|
[e]
|
|
774
|
-
),
|
|
775
|
-
(
|
|
2456
|
+
), l = C(
|
|
2457
|
+
(f = "en") => e ? fr(e, f) : "",
|
|
776
2458
|
[e]
|
|
777
|
-
),
|
|
778
|
-
(
|
|
2459
|
+
), m = C(
|
|
2460
|
+
(f, p) => e ? pr(e, f, p) : /* @__PURE__ */ new Date(),
|
|
779
2461
|
[e]
|
|
780
|
-
),
|
|
781
|
-
(
|
|
2462
|
+
), d = C(
|
|
2463
|
+
(f) => e ? mr(e, f) : /* @__PURE__ */ new Date(),
|
|
782
2464
|
[e]
|
|
783
|
-
),
|
|
784
|
-
(
|
|
2465
|
+
), b = C(
|
|
2466
|
+
(f) => e ? br(e, f) : /* @__PURE__ */ new Date(),
|
|
785
2467
|
[e]
|
|
786
|
-
),
|
|
787
|
-
(
|
|
2468
|
+
), h = C(() => hr(e), [e]), c = C(
|
|
2469
|
+
(f) => e ? xr(e, f) : !1,
|
|
788
2470
|
[e]
|
|
789
|
-
),
|
|
790
|
-
(
|
|
2471
|
+
), s = C(
|
|
2472
|
+
(f) => e ? gr(e, f) : !1,
|
|
791
2473
|
[e]
|
|
792
2474
|
);
|
|
793
2475
|
return {
|
|
794
2476
|
date: e,
|
|
795
2477
|
setDate: a,
|
|
796
|
-
format:
|
|
797
|
-
diff:
|
|
798
|
-
relative:
|
|
799
|
-
add:
|
|
800
|
-
startOf:
|
|
801
|
-
endOf:
|
|
802
|
-
isValid:
|
|
803
|
-
isBefore:
|
|
804
|
-
isAfter:
|
|
2478
|
+
format: o,
|
|
2479
|
+
diff: i,
|
|
2480
|
+
relative: l,
|
|
2481
|
+
add: m,
|
|
2482
|
+
startOf: d,
|
|
2483
|
+
endOf: b,
|
|
2484
|
+
isValid: h,
|
|
2485
|
+
isBefore: c,
|
|
2486
|
+
isAfter: s
|
|
805
2487
|
};
|
|
806
2488
|
}
|
|
807
|
-
function
|
|
808
|
-
let
|
|
2489
|
+
function vr(t, e) {
|
|
2490
|
+
let n = null;
|
|
809
2491
|
return (...a) => {
|
|
810
|
-
|
|
2492
|
+
n && clearTimeout(n), n = setTimeout(() => t(...a), e);
|
|
811
2493
|
};
|
|
812
2494
|
}
|
|
813
|
-
function
|
|
814
|
-
let
|
|
2495
|
+
function yr(t, e) {
|
|
2496
|
+
let n = 0;
|
|
815
2497
|
return (...a) => {
|
|
816
|
-
const
|
|
817
|
-
|
|
2498
|
+
const o = Date.now();
|
|
2499
|
+
o - n >= e && (n = o, t(...a));
|
|
818
2500
|
};
|
|
819
2501
|
}
|
|
820
|
-
function
|
|
821
|
-
return t.length <= e ? t : t.slice(0, e) +
|
|
2502
|
+
function wr(t, e, n = "...") {
|
|
2503
|
+
return t.length <= e ? t : t.slice(0, e) + n;
|
|
822
2504
|
}
|
|
823
|
-
async function
|
|
2505
|
+
async function kr(t) {
|
|
824
2506
|
try {
|
|
825
2507
|
if (navigator.clipboard && navigator.clipboard.writeText)
|
|
826
2508
|
return await navigator.clipboard.writeText(t), !0;
|
|
827
2509
|
const e = document.createElement("textarea");
|
|
828
2510
|
e.value = t, e.style.position = "fixed", e.style.opacity = "0", document.body.appendChild(e), e.select();
|
|
829
|
-
const
|
|
830
|
-
return document.body.removeChild(e),
|
|
2511
|
+
const n = document.execCommand("copy");
|
|
2512
|
+
return document.body.removeChild(e), n;
|
|
831
2513
|
} catch {
|
|
832
2514
|
return !1;
|
|
833
2515
|
}
|
|
834
2516
|
}
|
|
835
|
-
function
|
|
2517
|
+
function Nr(t) {
|
|
836
2518
|
return t.toLowerCase().replace(/[^\w\s-]/g, "").replace(/[\s_]+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
837
2519
|
}
|
|
838
|
-
function
|
|
2520
|
+
function $r(t) {
|
|
839
2521
|
return t && t.charAt(0).toUpperCase() + t.slice(1).toLowerCase();
|
|
840
2522
|
}
|
|
841
|
-
function
|
|
2523
|
+
function _r(t) {
|
|
842
2524
|
return typeof structuredClone == "function" ? structuredClone(t) : JSON.parse(JSON.stringify(t));
|
|
843
2525
|
}
|
|
844
|
-
function
|
|
845
|
-
const
|
|
2526
|
+
function pe(t, e = "") {
|
|
2527
|
+
const n = {};
|
|
846
2528
|
for (const a of Object.keys(t)) {
|
|
847
|
-
const
|
|
848
|
-
|
|
2529
|
+
const o = e ? `${e}.${a}` : a, i = t[a];
|
|
2530
|
+
i !== null && typeof i == "object" && !Array.isArray(i) ? Object.assign(n, pe(i, o)) : n[o] = i;
|
|
849
2531
|
}
|
|
850
|
-
return
|
|
2532
|
+
return n;
|
|
851
2533
|
}
|
|
852
|
-
function
|
|
853
|
-
const
|
|
2534
|
+
function Ar(t, e) {
|
|
2535
|
+
const n = {};
|
|
854
2536
|
for (const a of t) {
|
|
855
|
-
const
|
|
856
|
-
|
|
2537
|
+
const o = String(a[e]);
|
|
2538
|
+
n[o] || (n[o] = []), n[o].push(a);
|
|
857
2539
|
}
|
|
858
|
-
return
|
|
2540
|
+
return n;
|
|
859
2541
|
}
|
|
860
|
-
function
|
|
861
|
-
const
|
|
2542
|
+
function Lr(t, e) {
|
|
2543
|
+
const n = /* @__PURE__ */ new Set();
|
|
862
2544
|
return t.filter((a) => {
|
|
863
|
-
const
|
|
864
|
-
return
|
|
2545
|
+
const o = a[e];
|
|
2546
|
+
return n.has(o) ? !1 : (n.add(o), !0);
|
|
865
2547
|
});
|
|
866
2548
|
}
|
|
867
|
-
function
|
|
868
|
-
return
|
|
2549
|
+
function Vt() {
|
|
2550
|
+
return Q(
|
|
869
2551
|
() => ({
|
|
870
|
-
debounce:
|
|
871
|
-
throttle:
|
|
872
|
-
truncate:
|
|
873
|
-
copyToClipboard:
|
|
874
|
-
slugify:
|
|
875
|
-
capitalize:
|
|
876
|
-
deepClone:
|
|
877
|
-
flattenObject:
|
|
878
|
-
groupBy:
|
|
879
|
-
uniqueBy:
|
|
2552
|
+
debounce: vr,
|
|
2553
|
+
throttle: yr,
|
|
2554
|
+
truncate: wr,
|
|
2555
|
+
copyToClipboard: kr,
|
|
2556
|
+
slugify: Nr,
|
|
2557
|
+
capitalize: $r,
|
|
2558
|
+
deepClone: _r,
|
|
2559
|
+
flattenObject: pe,
|
|
2560
|
+
groupBy: Ar,
|
|
2561
|
+
uniqueBy: Lr
|
|
880
2562
|
}),
|
|
881
2563
|
[]
|
|
882
2564
|
);
|
|
883
2565
|
}
|
|
2566
|
+
const Sr = {
|
|
2567
|
+
signinTitle: "Sign in with email",
|
|
2568
|
+
signupTitle: "Create an account",
|
|
2569
|
+
recoverTitle: "Reset your password",
|
|
2570
|
+
signinSubtitle: "Welcome back! Enter your credentials.",
|
|
2571
|
+
signupSubtitle: "Start your journey today.",
|
|
2572
|
+
recoverSubtitle: "We'll send a reset link to your email.",
|
|
2573
|
+
nameLabel: "Full Name",
|
|
2574
|
+
namePlaceholder: "Jane Smith",
|
|
2575
|
+
emailLabel: "Email address",
|
|
2576
|
+
emailPlaceholder: "you@example.com",
|
|
2577
|
+
passwordLabel: "Password",
|
|
2578
|
+
passwordPlaceholder: "••••••••",
|
|
2579
|
+
showPassword: "Show password",
|
|
2580
|
+
hidePassword: "Hide password",
|
|
2581
|
+
forgotPassword: "Forgot password?",
|
|
2582
|
+
signinCta: "Get Started",
|
|
2583
|
+
signupCta: "Create Account",
|
|
2584
|
+
recoverCta: "Send Reset Link",
|
|
2585
|
+
divider: "Or sign in with",
|
|
2586
|
+
toSignup: "Don't have an account? Sign up",
|
|
2587
|
+
toSignin: "Already have an account? Sign in",
|
|
2588
|
+
toRecover: "← Return to sign in"
|
|
2589
|
+
};
|
|
2590
|
+
function le({ size: t = 22 }) {
|
|
2591
|
+
return /* @__PURE__ */ u("svg", { "aria-hidden": "true", width: t, height: t, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2592
|
+
/* @__PURE__ */ r("rect", { x: "3", y: "11", width: "18", height: "11", rx: "2", ry: "2" }),
|
|
2593
|
+
/* @__PURE__ */ r("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })
|
|
2594
|
+
] });
|
|
2595
|
+
}
|
|
2596
|
+
function Tr() {
|
|
2597
|
+
return /* @__PURE__ */ u("svg", { "aria-hidden": "true", width: 16, height: 16, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2598
|
+
/* @__PURE__ */ r("rect", { x: "2", y: "4", width: "20", height: "16", rx: "2" }),
|
|
2599
|
+
/* @__PURE__ */ r("path", { d: "m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7" })
|
|
2600
|
+
] });
|
|
2601
|
+
}
|
|
2602
|
+
function Cr() {
|
|
2603
|
+
return /* @__PURE__ */ u("svg", { "aria-hidden": "true", width: 16, height: 16, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2604
|
+
/* @__PURE__ */ r("circle", { cx: "12", cy: "8", r: "4" }),
|
|
2605
|
+
/* @__PURE__ */ r("path", { d: "M4 20c0-4 3.6-7 8-7s8 3 8 7" })
|
|
2606
|
+
] });
|
|
2607
|
+
}
|
|
2608
|
+
function Er() {
|
|
2609
|
+
return /* @__PURE__ */ u("svg", { "aria-hidden": "true", width: 16, height: 16, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2610
|
+
/* @__PURE__ */ r("path", { d: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z" }),
|
|
2611
|
+
/* @__PURE__ */ r("circle", { cx: "12", cy: "12", r: "3" })
|
|
2612
|
+
] });
|
|
2613
|
+
}
|
|
2614
|
+
function Mr() {
|
|
2615
|
+
return /* @__PURE__ */ u("svg", { "aria-hidden": "true", width: 16, height: 16, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2616
|
+
/* @__PURE__ */ r("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.94" }),
|
|
2617
|
+
/* @__PURE__ */ r("path", { d: "M9.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.19" }),
|
|
2618
|
+
/* @__PURE__ */ r("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
|
|
2619
|
+
] });
|
|
2620
|
+
}
|
|
2621
|
+
function jr() {
|
|
2622
|
+
return /* @__PURE__ */ u("svg", { "aria-hidden": "true", width: 15, height: 15, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2623
|
+
/* @__PURE__ */ r("circle", { cx: "12", cy: "12", r: "10" }),
|
|
2624
|
+
/* @__PURE__ */ r("line", { x1: "12", y1: "8", x2: "12", y2: "12" }),
|
|
2625
|
+
/* @__PURE__ */ r("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" })
|
|
2626
|
+
] });
|
|
2627
|
+
}
|
|
2628
|
+
function Ir() {
|
|
2629
|
+
return /* @__PURE__ */ u("svg", { "aria-hidden": "true", className: "h-4 w-4 animate-spin", viewBox: "0 0 24 24", fill: "none", children: [
|
|
2630
|
+
/* @__PURE__ */ r("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "3", opacity: "0.25" }),
|
|
2631
|
+
/* @__PURE__ */ r("path", { d: "M22 12a10 10 0 0 1-10 10", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round" })
|
|
2632
|
+
] });
|
|
2633
|
+
}
|
|
2634
|
+
function Dr() {
|
|
2635
|
+
return /* @__PURE__ */ u("svg", { "aria-hidden": "true", width: 18, height: 18, viewBox: "0 0 24 24", children: [
|
|
2636
|
+
/* @__PURE__ */ r("path", { d: "M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z", fill: "#4285F4" }),
|
|
2637
|
+
/* @__PURE__ */ r("path", { d: "M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z", fill: "#34A853" }),
|
|
2638
|
+
/* @__PURE__ */ r("path", { d: "M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z", fill: "#FBBC05" }),
|
|
2639
|
+
/* @__PURE__ */ r("path", { d: "M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z", fill: "#EA4335" })
|
|
2640
|
+
] });
|
|
2641
|
+
}
|
|
2642
|
+
function Br() {
|
|
2643
|
+
return /* @__PURE__ */ r("svg", { "aria-hidden": "true", width: 18, height: 18, viewBox: "0 0 24 24", fill: "#1877F2", children: /* @__PURE__ */ r("path", { d: "M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z" }) });
|
|
2644
|
+
}
|
|
2645
|
+
function Fr() {
|
|
2646
|
+
return /* @__PURE__ */ r("svg", { "aria-hidden": "true", width: 17, height: 17, viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ r("path", { d: "M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.8-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z" }) });
|
|
2647
|
+
}
|
|
2648
|
+
function re({ label: t, type: e, value: n, onChange: a, placeholder: o, leftAddon: i, rightAddon: l, autoComplete: m, disabled: d }) {
|
|
2649
|
+
return /* @__PURE__ */ u("div", { className: "flex flex-col gap-1.5", children: [
|
|
2650
|
+
/* @__PURE__ */ r("label", { className: "text-label-sm font-semibold text-on-surface", children: t }),
|
|
2651
|
+
/* @__PURE__ */ u("div", { className: `flex items-center gap-2 h-11 px-3.5 rounded-[10px] border border-outline-variant bg-surface-container-low transition-[border-color,box-shadow] duration-200 focus-within:border-primary focus-within:ring-2 focus-within:ring-primary/15 dark:bg-surface-container dark:border-outline-variant dark:focus-within:border-primary ${d ? "opacity-50 cursor-not-allowed" : ""}`, children: [
|
|
2652
|
+
i && /* @__PURE__ */ r("span", { className: "text-on-surface-variant shrink-0 inline-flex items-center", children: i }),
|
|
2653
|
+
/* @__PURE__ */ r(
|
|
2654
|
+
"input",
|
|
2655
|
+
{
|
|
2656
|
+
type: e,
|
|
2657
|
+
value: n,
|
|
2658
|
+
onChange: (b) => a(b.target.value),
|
|
2659
|
+
placeholder: o,
|
|
2660
|
+
autoComplete: m,
|
|
2661
|
+
disabled: d,
|
|
2662
|
+
className: "flex-1 min-w-0 bg-transparent outline-none border-none text-body-sm text-on-surface placeholder:text-on-surface-variant/50 font-[inherit] disabled:cursor-not-allowed"
|
|
2663
|
+
}
|
|
2664
|
+
),
|
|
2665
|
+
l && /* @__PURE__ */ r("span", { className: "text-on-surface-variant shrink-0 inline-flex items-center", children: l })
|
|
2666
|
+
] })
|
|
2667
|
+
] });
|
|
2668
|
+
}
|
|
2669
|
+
function te({ onClick: t, "aria-label": e, children: n }) {
|
|
2670
|
+
return /* @__PURE__ */ r(
|
|
2671
|
+
"button",
|
|
2672
|
+
{
|
|
2673
|
+
type: "button",
|
|
2674
|
+
onClick: t,
|
|
2675
|
+
"aria-label": e,
|
|
2676
|
+
className: "w-11 h-11 rounded-full border border-outline-variant bg-surface-container-lowest flex items-center justify-center hover:bg-surface-container-low hover:border-outline transition-colors dark:bg-surface-container dark:border-outline-variant dark:hover:bg-surface-container-high",
|
|
2677
|
+
children: n
|
|
2678
|
+
}
|
|
2679
|
+
);
|
|
2680
|
+
}
|
|
2681
|
+
function Ut({
|
|
2682
|
+
open: t,
|
|
2683
|
+
onClose: e,
|
|
2684
|
+
mode: n,
|
|
2685
|
+
onModeChange: a,
|
|
2686
|
+
onSubmit: o,
|
|
2687
|
+
onGoogle: i,
|
|
2688
|
+
onFacebook: l,
|
|
2689
|
+
onApple: m,
|
|
2690
|
+
loading: d = !1,
|
|
2691
|
+
error: b,
|
|
2692
|
+
labels: h,
|
|
2693
|
+
disableEscapeKey: c = !1,
|
|
2694
|
+
disableBackdropClick: s = !1,
|
|
2695
|
+
className: f = ""
|
|
2696
|
+
}) {
|
|
2697
|
+
const p = { ...Sr, ...h }, g = n ?? "signin", N = !!(i || l || m), [$, _] = S(""), [E, k] = S(""), [x, w] = S(""), [v, y] = S(!1), [A, T] = S(!1), j = d || A;
|
|
2698
|
+
if (M(() => {
|
|
2699
|
+
if (!t || c) return;
|
|
2700
|
+
const I = (H) => {
|
|
2701
|
+
H.key === "Escape" && e();
|
|
2702
|
+
};
|
|
2703
|
+
return document.addEventListener("keydown", I), () => document.removeEventListener("keydown", I);
|
|
2704
|
+
}, [t, e, c]), M(() => {
|
|
2705
|
+
if (t)
|
|
2706
|
+
return document.body.style.overflow = "hidden", () => {
|
|
2707
|
+
document.body.style.overflow = "";
|
|
2708
|
+
};
|
|
2709
|
+
}, [t]), !t || typeof document > "u") return null;
|
|
2710
|
+
const P = { signin: p.signinTitle, signup: p.signupTitle, recover: p.recoverTitle }[g], ee = { signin: p.signinSubtitle, signup: p.signupSubtitle, recover: p.recoverSubtitle }[g], J = { signin: p.signinCta, signup: p.signupCta, recover: p.recoverCta }[g], q = async (I) => {
|
|
2711
|
+
if (I.preventDefault(), !j) {
|
|
2712
|
+
T(!0);
|
|
2713
|
+
try {
|
|
2714
|
+
const H = {
|
|
2715
|
+
mode: g,
|
|
2716
|
+
email: $,
|
|
2717
|
+
...g !== "recover" && { password: E },
|
|
2718
|
+
...g === "signup" && { name: x }
|
|
2719
|
+
};
|
|
2720
|
+
await o(H);
|
|
2721
|
+
} finally {
|
|
2722
|
+
T(!1);
|
|
2723
|
+
}
|
|
2724
|
+
}
|
|
2725
|
+
};
|
|
2726
|
+
return z(
|
|
2727
|
+
/* @__PURE__ */ r(
|
|
2728
|
+
"div",
|
|
2729
|
+
{
|
|
2730
|
+
className: "fixed inset-0 backdrop-blur-[4px] flex items-center justify-center z-[1200] anicca-fade-in p-4",
|
|
2731
|
+
style: { background: "rgba(15,23,42,0.6)" },
|
|
2732
|
+
onClick: s ? void 0 : e,
|
|
2733
|
+
role: "dialog",
|
|
2734
|
+
"aria-modal": "true",
|
|
2735
|
+
"aria-labelledby": "anicca-auth-modal-title",
|
|
2736
|
+
children: /* @__PURE__ */ u(
|
|
2737
|
+
"div",
|
|
2738
|
+
{
|
|
2739
|
+
className: `bg-surface-container-lowest rounded-[24px] border border-on-surface/[0.06] dark:border-[rgba(51,65,85,0.5)] w-full max-w-[400px] anicca-slide-up shadow-[0_24px_70px_-20px_rgba(11,28,48,0.35),0_8px_24px_-12px_rgb(var(--primary)/0.12)] dark:shadow-[0_20px_60px_rgba(0,0,0,0.55)] ${f}`,
|
|
2740
|
+
onClick: (I) => I.stopPropagation(),
|
|
2741
|
+
children: [
|
|
2742
|
+
/* @__PURE__ */ u("div", { className: "flex flex-col items-center pt-8 pb-2 px-8", children: [
|
|
2743
|
+
/* @__PURE__ */ r("div", { className: "w-12 h-12 rounded-[14px] bg-primary/10 flex items-center justify-center mb-4 text-primary", children: /* @__PURE__ */ r(le, { size: 22 }) }),
|
|
2744
|
+
/* @__PURE__ */ r(
|
|
2745
|
+
"h2",
|
|
2746
|
+
{
|
|
2747
|
+
id: "anicca-auth-modal-title",
|
|
2748
|
+
className: "text-headline-md text-on-surface text-center m-0",
|
|
2749
|
+
children: P
|
|
2750
|
+
}
|
|
2751
|
+
),
|
|
2752
|
+
/* @__PURE__ */ r("p", { className: "text-body-sm text-on-surface-variant text-center mt-1 mb-0", children: ee })
|
|
2753
|
+
] }),
|
|
2754
|
+
b && /* @__PURE__ */ u("div", { className: "mx-8 mt-4 flex items-center gap-2.5 px-4 py-3 rounded-[10px] bg-error/[0.08] border border-error/20 text-error text-body-sm", children: [
|
|
2755
|
+
/* @__PURE__ */ r("span", { className: "shrink-0", children: /* @__PURE__ */ r(jr, {}) }),
|
|
2756
|
+
b
|
|
2757
|
+
] }),
|
|
2758
|
+
/* @__PURE__ */ u("form", { className: "px-8 pt-5 pb-6 flex flex-col gap-4", onSubmit: q, noValidate: !0, children: [
|
|
2759
|
+
g === "signup" && /* @__PURE__ */ r(
|
|
2760
|
+
re,
|
|
2761
|
+
{
|
|
2762
|
+
label: p.nameLabel,
|
|
2763
|
+
type: "text",
|
|
2764
|
+
value: x,
|
|
2765
|
+
onChange: w,
|
|
2766
|
+
placeholder: p.namePlaceholder,
|
|
2767
|
+
leftAddon: /* @__PURE__ */ r(Cr, {}),
|
|
2768
|
+
autoComplete: "name",
|
|
2769
|
+
disabled: j
|
|
2770
|
+
}
|
|
2771
|
+
),
|
|
2772
|
+
/* @__PURE__ */ r(
|
|
2773
|
+
re,
|
|
2774
|
+
{
|
|
2775
|
+
label: p.emailLabel,
|
|
2776
|
+
type: "email",
|
|
2777
|
+
value: $,
|
|
2778
|
+
onChange: _,
|
|
2779
|
+
placeholder: p.emailPlaceholder,
|
|
2780
|
+
leftAddon: /* @__PURE__ */ r(Tr, {}),
|
|
2781
|
+
autoComplete: "email",
|
|
2782
|
+
disabled: j
|
|
2783
|
+
}
|
|
2784
|
+
),
|
|
2785
|
+
g !== "recover" && /* @__PURE__ */ r(
|
|
2786
|
+
re,
|
|
2787
|
+
{
|
|
2788
|
+
label: p.passwordLabel,
|
|
2789
|
+
type: v ? "text" : "password",
|
|
2790
|
+
value: E,
|
|
2791
|
+
onChange: k,
|
|
2792
|
+
placeholder: p.passwordPlaceholder,
|
|
2793
|
+
leftAddon: /* @__PURE__ */ r(le, { size: 16 }),
|
|
2794
|
+
rightAddon: /* @__PURE__ */ r(
|
|
2795
|
+
"button",
|
|
2796
|
+
{
|
|
2797
|
+
type: "button",
|
|
2798
|
+
onClick: () => y((I) => !I),
|
|
2799
|
+
"aria-label": v ? p.hidePassword : p.showPassword,
|
|
2800
|
+
className: "text-on-surface-variant hover:text-on-surface transition-colors cursor-pointer",
|
|
2801
|
+
children: v ? /* @__PURE__ */ r(Mr, {}) : /* @__PURE__ */ r(Er, {})
|
|
2802
|
+
}
|
|
2803
|
+
),
|
|
2804
|
+
autoComplete: g === "signin" ? "current-password" : "new-password",
|
|
2805
|
+
disabled: j
|
|
2806
|
+
}
|
|
2807
|
+
),
|
|
2808
|
+
g === "signin" && /* @__PURE__ */ r("div", { className: "flex justify-end -mt-2", children: /* @__PURE__ */ r(
|
|
2809
|
+
"button",
|
|
2810
|
+
{
|
|
2811
|
+
type: "button",
|
|
2812
|
+
className: "text-label-sm text-primary hover:underline underline-offset-4 transition-colors font-[inherit] cursor-pointer",
|
|
2813
|
+
onClick: () => a == null ? void 0 : a("recover"),
|
|
2814
|
+
children: p.forgotPassword
|
|
2815
|
+
}
|
|
2816
|
+
) }),
|
|
2817
|
+
/* @__PURE__ */ u(
|
|
2818
|
+
"button",
|
|
2819
|
+
{
|
|
2820
|
+
type: "submit",
|
|
2821
|
+
disabled: j,
|
|
2822
|
+
className: "relative w-full h-11 rounded-[12px] font-semibold text-label-md tracking-tight hover:opacity-90 active:opacity-100 transition-opacity disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2 mt-1 font-[inherit] cursor-pointer",
|
|
2823
|
+
style: { background: "rgb(var(--on-surface))", color: "rgb(var(--surface-container-lowest))" },
|
|
2824
|
+
children: [
|
|
2825
|
+
j && /* @__PURE__ */ r("span", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ r(Ir, {}) }),
|
|
2826
|
+
/* @__PURE__ */ r("span", { className: j ? "opacity-0" : "", children: J })
|
|
2827
|
+
]
|
|
2828
|
+
}
|
|
2829
|
+
)
|
|
2830
|
+
] }),
|
|
2831
|
+
g !== "recover" && N && /* @__PURE__ */ u("div", { className: "px-8 pb-7", children: [
|
|
2832
|
+
/* @__PURE__ */ u("div", { className: "flex items-center gap-3 mb-4", children: [
|
|
2833
|
+
/* @__PURE__ */ r("div", { className: "flex-1 h-px bg-outline-variant" }),
|
|
2834
|
+
/* @__PURE__ */ r("span", { className: "text-label-sm text-on-surface-variant whitespace-nowrap", children: p.divider }),
|
|
2835
|
+
/* @__PURE__ */ r("div", { className: "flex-1 h-px bg-outline-variant" })
|
|
2836
|
+
] }),
|
|
2837
|
+
/* @__PURE__ */ u("div", { className: "flex items-center justify-center gap-3", children: [
|
|
2838
|
+
i && /* @__PURE__ */ r(te, { onClick: i, "aria-label": "Sign in with Google", children: /* @__PURE__ */ r(Dr, {}) }),
|
|
2839
|
+
l && /* @__PURE__ */ r(te, { onClick: l, "aria-label": "Sign in with Facebook", children: /* @__PURE__ */ r(Br, {}) }),
|
|
2840
|
+
m && /* @__PURE__ */ r(te, { onClick: m, "aria-label": "Sign in with Apple", children: /* @__PURE__ */ r(Fr, {}) })
|
|
2841
|
+
] })
|
|
2842
|
+
] }),
|
|
2843
|
+
/* @__PURE__ */ u("div", { className: "text-center pb-6 px-8 text-body-sm text-on-surface-variant", children: [
|
|
2844
|
+
g === "signin" && /* @__PURE__ */ r(
|
|
2845
|
+
"button",
|
|
2846
|
+
{
|
|
2847
|
+
type: "button",
|
|
2848
|
+
className: "text-primary hover:underline underline-offset-4 font-[inherit] cursor-pointer",
|
|
2849
|
+
onClick: () => a == null ? void 0 : a("signup"),
|
|
2850
|
+
children: p.toSignup
|
|
2851
|
+
}
|
|
2852
|
+
),
|
|
2853
|
+
g === "signup" && /* @__PURE__ */ r(
|
|
2854
|
+
"button",
|
|
2855
|
+
{
|
|
2856
|
+
type: "button",
|
|
2857
|
+
className: "text-primary hover:underline underline-offset-4 font-[inherit] cursor-pointer",
|
|
2858
|
+
onClick: () => a == null ? void 0 : a("signin"),
|
|
2859
|
+
children: p.toSignin
|
|
2860
|
+
}
|
|
2861
|
+
),
|
|
2862
|
+
g === "recover" && /* @__PURE__ */ r(
|
|
2863
|
+
"button",
|
|
2864
|
+
{
|
|
2865
|
+
type: "button",
|
|
2866
|
+
className: "text-primary hover:underline underline-offset-4 font-[inherit] cursor-pointer",
|
|
2867
|
+
onClick: () => a == null ? void 0 : a("signin"),
|
|
2868
|
+
children: p.toRecover
|
|
2869
|
+
}
|
|
2870
|
+
)
|
|
2871
|
+
] })
|
|
2872
|
+
]
|
|
2873
|
+
}
|
|
2874
|
+
)
|
|
2875
|
+
}
|
|
2876
|
+
),
|
|
2877
|
+
document.body
|
|
2878
|
+
);
|
|
2879
|
+
}
|
|
884
2880
|
export {
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
2881
|
+
ge as ANICCA_THEME_CSS_VAR_MAP,
|
|
2882
|
+
Ct as AniccaActivityFeed,
|
|
2883
|
+
lt as AniccaAlert,
|
|
2884
|
+
Ut as AniccaAuthModal,
|
|
2885
|
+
Fe as AniccaAvatar,
|
|
2886
|
+
it as AniccaAvatarGroup,
|
|
2887
|
+
ot as AniccaBadge,
|
|
2888
|
+
St as AniccaBreadcrumb,
|
|
2889
|
+
zr as AniccaButton,
|
|
2890
|
+
qr as AniccaCard,
|
|
2891
|
+
et as AniccaCardBody,
|
|
2892
|
+
Qr as AniccaCardDescription,
|
|
2893
|
+
rt as AniccaCardFooter,
|
|
2894
|
+
Kr as AniccaCardHeader,
|
|
2895
|
+
Xr as AniccaCardTitle,
|
|
2896
|
+
_t as AniccaChartWrapper,
|
|
2897
|
+
Yr as AniccaCheckbox,
|
|
2898
|
+
Nt as AniccaCombobox,
|
|
2899
|
+
Tt as AniccaDataTable,
|
|
2900
|
+
at as AniccaDivider,
|
|
2901
|
+
xt as AniccaDrawer,
|
|
2902
|
+
gt as AniccaDropdown,
|
|
2903
|
+
nt as AniccaGrid,
|
|
2904
|
+
Hr as AniccaInput,
|
|
2905
|
+
vt as AniccaMenu,
|
|
2906
|
+
wt as AniccaMenuDivider,
|
|
2907
|
+
yt as AniccaMenuItem,
|
|
2908
|
+
kt as AniccaMenuLabel,
|
|
2909
|
+
Mt as AniccaModal,
|
|
2910
|
+
Lt as AniccaNavbar,
|
|
2911
|
+
dt as AniccaPagination,
|
|
2912
|
+
ht as AniccaPopover,
|
|
2913
|
+
mt as AniccaPopupProvider,
|
|
2914
|
+
Et as AniccaProgressCard,
|
|
2915
|
+
Gr as AniccaRadio,
|
|
2916
|
+
Jr as AniccaRadioGroup,
|
|
2917
|
+
Ur as AniccaSelect,
|
|
2918
|
+
At as AniccaSidebar,
|
|
2919
|
+
st as AniccaSkeleton,
|
|
2920
|
+
ct as AniccaSpinner,
|
|
2921
|
+
tt as AniccaStack,
|
|
2922
|
+
$t as AniccaStatCard,
|
|
2923
|
+
Zr as AniccaSwitch,
|
|
2924
|
+
jt as AniccaTabs,
|
|
2925
|
+
Vr as AniccaTextarea,
|
|
2926
|
+
Or as AniccaThemeProvider,
|
|
2927
|
+
ut as AniccaToastProvider,
|
|
2928
|
+
pt as AniccaTooltip,
|
|
2929
|
+
pr as aniccaAdd,
|
|
2930
|
+
$r as aniccaCapitalize,
|
|
2931
|
+
kr as aniccaCopyToClipboard,
|
|
2932
|
+
vr as aniccaDebounce,
|
|
2933
|
+
_r as aniccaDeepClone,
|
|
2934
|
+
ur as aniccaDiff,
|
|
2935
|
+
br as aniccaEndOf,
|
|
2936
|
+
pe as aniccaFlattenObject,
|
|
2937
|
+
lr as aniccaFormat,
|
|
2938
|
+
Ar as aniccaGroupBy,
|
|
2939
|
+
gr as aniccaIsAfter,
|
|
2940
|
+
xr as aniccaIsBefore,
|
|
2941
|
+
hr as aniccaIsValid,
|
|
2942
|
+
fr as aniccaRelative,
|
|
2943
|
+
Nr as aniccaSlugify,
|
|
2944
|
+
mr as aniccaStartOf,
|
|
2945
|
+
yr as aniccaThrottle,
|
|
2946
|
+
wr as aniccaTruncate,
|
|
2947
|
+
Lr as aniccaUniqueBy,
|
|
2948
|
+
Ot as custom,
|
|
2949
|
+
Dt as email,
|
|
2950
|
+
Wt as max,
|
|
2951
|
+
Ft as maxLength,
|
|
2952
|
+
Pt as min,
|
|
2953
|
+
Bt as minLength,
|
|
2954
|
+
Rt as pattern,
|
|
2955
|
+
It as required,
|
|
2956
|
+
Ht as useAniccaDate,
|
|
2957
|
+
zt as useAniccaForm,
|
|
2958
|
+
bt as useAniccaPopup,
|
|
2959
|
+
ft as useAniccaToast,
|
|
2960
|
+
Vt as useAniccaUtils
|
|
927
2961
|
};
|