anicca-ui 1.0.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/LICENSE +21 -0
- package/README.md +371 -0
- package/dist/anicca-ui.css +1 -0
- package/dist/anicca-ui.es.js +927 -0
- package/dist/anicca-ui.umd.js +1 -0
- package/dist/dashboard/components/ActivityFeed/ActivityFeed.d.ts +27 -0
- package/dist/dashboard/components/ActivityFeed/index.d.ts +2 -0
- package/dist/dashboard/components/Breadcrumb/Breadcrumb.d.ts +25 -0
- package/dist/dashboard/components/Breadcrumb/index.d.ts +2 -0
- package/dist/dashboard/components/ChartWrapper/ChartWrapper.d.ts +34 -0
- package/dist/dashboard/components/ChartWrapper/index.d.ts +2 -0
- package/dist/dashboard/components/DataTable/DataTable.d.ts +38 -0
- package/dist/dashboard/components/DataTable/index.d.ts +2 -0
- package/dist/dashboard/components/Modal/Modal.d.ts +28 -0
- package/dist/dashboard/components/Modal/index.d.ts +2 -0
- package/dist/dashboard/components/Navbar/Navbar.d.ts +31 -0
- package/dist/dashboard/components/Navbar/index.d.ts +2 -0
- package/dist/dashboard/components/ProgressCard/ProgressCard.d.ts +39 -0
- package/dist/dashboard/components/ProgressCard/index.d.ts +2 -0
- package/dist/dashboard/components/Sidebar/Sidebar.d.ts +36 -0
- package/dist/dashboard/components/Sidebar/index.d.ts +2 -0
- package/dist/dashboard/components/StatCard/StatCard.d.ts +26 -0
- package/dist/dashboard/components/StatCard/index.d.ts +2 -0
- package/dist/dashboard/components/Tabs/Tabs.d.ts +28 -0
- package/dist/dashboard/components/Tabs/index.d.ts +2 -0
- package/dist/dashboard/index.d.ts +11 -0
- package/dist/date/hooks/useAniccaDate/index.d.ts +2 -0
- package/dist/date/hooks/useAniccaDate/useAniccaDate.d.ts +42 -0
- package/dist/date/index.d.ts +2 -0
- package/dist/date/utils/index.d.ts +82 -0
- package/dist/index.d.ts +6 -0
- package/dist/theme/AniccaThemeProvider.d.ts +27 -0
- package/dist/theme/index.d.ts +5 -0
- package/dist/theme/types.d.ts +39 -0
- package/dist/utils/functions/index.d.ts +109 -0
- package/dist/utils/hooks/useAniccaUtils/index.d.ts +2 -0
- package/dist/utils/hooks/useAniccaUtils/useAniccaUtils.d.ts +40 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/validation/hooks/useAniccaForm/index.d.ts +2 -0
- package/dist/validation/hooks/useAniccaForm/useAniccaForm.d.ts +60 -0
- package/dist/validation/index.d.ts +2 -0
- package/dist/validation/rules/index.d.ts +73 -0
- package/package.json +65 -0
|
@@ -0,0 +1,927 @@
|
|
|
1
|
+
import { jsx as n, jsxs as c, Fragment as O } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as F, useState as S, useEffect as E, useCallback as k } from "react";
|
|
3
|
+
const _ = {
|
|
4
|
+
primary: "--anicca-primary",
|
|
5
|
+
primaryFg: "--anicca-primary-fg",
|
|
6
|
+
primarySoft: "--anicca-primary-soft",
|
|
7
|
+
success: "--anicca-success",
|
|
8
|
+
successBg: "--anicca-success-bg",
|
|
9
|
+
danger: "--anicca-danger",
|
|
10
|
+
dangerBg: "--anicca-danger-bg",
|
|
11
|
+
warning: "--anicca-warning",
|
|
12
|
+
warningBg: "--anicca-warning-bg",
|
|
13
|
+
info: "--anicca-info",
|
|
14
|
+
infoBg: "--anicca-info-bg",
|
|
15
|
+
surface: "--anicca-surface",
|
|
16
|
+
surfaceMuted: "--anicca-surface-muted",
|
|
17
|
+
surfaceOverlay: "--anicca-surface-overlay",
|
|
18
|
+
surfaceDark: "--anicca-surface-dark",
|
|
19
|
+
surfaceDark2: "--anicca-surface-dark-2",
|
|
20
|
+
surfaceDarkFg: "--anicca-surface-dark-fg",
|
|
21
|
+
surfaceDarkFgMuted: "--anicca-surface-dark-fg-muted",
|
|
22
|
+
border: "--anicca-border",
|
|
23
|
+
borderStrong: "--anicca-border-strong",
|
|
24
|
+
borderDark: "--anicca-border-dark",
|
|
25
|
+
text: "--anicca-text",
|
|
26
|
+
textMuted: "--anicca-text-muted",
|
|
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"
|
|
34
|
+
};
|
|
35
|
+
function H(t) {
|
|
36
|
+
if (!t) return {};
|
|
37
|
+
const e = {};
|
|
38
|
+
for (const r of Object.keys(t)) {
|
|
39
|
+
const a = t[r];
|
|
40
|
+
a !== void 0 && (e[_[r]] = a);
|
|
41
|
+
}
|
|
42
|
+
return e;
|
|
43
|
+
}
|
|
44
|
+
function pe({
|
|
45
|
+
theme: t,
|
|
46
|
+
as: e = "div",
|
|
47
|
+
className: r,
|
|
48
|
+
children: a
|
|
49
|
+
}) {
|
|
50
|
+
const s = F(() => H(t), [t]);
|
|
51
|
+
return /* @__PURE__ */ n(e, { style: s, className: r, "data-anicca-theme": "", children: a });
|
|
52
|
+
}
|
|
53
|
+
function be({
|
|
54
|
+
title: t,
|
|
55
|
+
value: e,
|
|
56
|
+
icon: r,
|
|
57
|
+
trend: a,
|
|
58
|
+
trendLabel: s,
|
|
59
|
+
color: o,
|
|
60
|
+
className: i = ""
|
|
61
|
+
}) {
|
|
62
|
+
const p = a !== void 0 ? a > 0 ? "up" : a < 0 ? "down" : "neutral" : null, l = {
|
|
63
|
+
up: "text-a-success bg-a-success-bg",
|
|
64
|
+
down: "text-a-danger bg-a-danger-bg",
|
|
65
|
+
neutral: "text-a-text-muted bg-a-surface-muted"
|
|
66
|
+
};
|
|
67
|
+
return /* @__PURE__ */ c(
|
|
68
|
+
"div",
|
|
69
|
+
{
|
|
70
|
+
className: `relative bg-gradient-to-br from-a-surface to-a-surface-muted rounded-a p-6 border-l-4 shadow-a-sm transition-all duration-300 ease-[cubic-bezier(0.4,0,0.2,1)] overflow-hidden hover:shadow-a-md hover:-translate-y-1 group ${i}`,
|
|
71
|
+
style: { borderLeftColor: o ?? "var(--anicca-primary)" },
|
|
72
|
+
role: "group",
|
|
73
|
+
"aria-label": `${t}: ${e}`,
|
|
74
|
+
children: [
|
|
75
|
+
/* @__PURE__ */ c("div", { className: "flex justify-between items-start mb-3", children: [
|
|
76
|
+
/* @__PURE__ */ n("span", { className: "text-xs text-a-text-muted font-semibold uppercase tracking-[0.06em]", children: t }),
|
|
77
|
+
r && /* @__PURE__ */ n("span", { className: "text-2xl text-a-text-subtle opacity-80 transition-transform duration-300 ease-in-out group-hover:scale-110", children: r })
|
|
78
|
+
] }),
|
|
79
|
+
/* @__PURE__ */ n("div", { className: "text-[2rem] font-extrabold text-a-text mb-3 tracking-tight leading-[1.1]", children: e }),
|
|
80
|
+
a !== void 0 && /* @__PURE__ */ c("div", { className: `inline-flex items-center gap-[0.35rem] text-[0.8rem] font-semibold py-1 px-[0.6rem] rounded-[20px] ${l[p || "neutral"]}`, children: [
|
|
81
|
+
/* @__PURE__ */ n("span", { className: "text-[0.7rem]", children: p === "up" ? "↑" : p === "down" ? "↓" : "→" }),
|
|
82
|
+
/* @__PURE__ */ c("span", { className: "font-bold", children: [
|
|
83
|
+
Math.abs(a),
|
|
84
|
+
"%"
|
|
85
|
+
] }),
|
|
86
|
+
s && /* @__PURE__ */ n("span", { className: "text-a-text-subtle font-normal ml-2 text-xs", children: s })
|
|
87
|
+
] })
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
const Y = {
|
|
93
|
+
loading: "Loading chart"
|
|
94
|
+
};
|
|
95
|
+
function xe({
|
|
96
|
+
title: t,
|
|
97
|
+
subtitle: e,
|
|
98
|
+
children: r,
|
|
99
|
+
loading: a = !1,
|
|
100
|
+
empty: s = !1,
|
|
101
|
+
emptyMessage: o = "No data available",
|
|
102
|
+
height: i = 300,
|
|
103
|
+
labels: p,
|
|
104
|
+
className: l = ""
|
|
105
|
+
}) {
|
|
106
|
+
const h = typeof i == "number" ? `${i}px` : i, d = { ...Y, ...p };
|
|
107
|
+
return /* @__PURE__ */ c("div", { className: `bg-gradient-to-br from-a-surface to-a-surface-muted rounded-a p-7 shadow-a-sm border border-a-border ${l}`, children: [
|
|
108
|
+
/* @__PURE__ */ c("div", { className: "mb-5", children: [
|
|
109
|
+
/* @__PURE__ */ n("div", { className: "text-[1.05rem] font-bold text-a-text tracking-[-0.01em]", children: t }),
|
|
110
|
+
e && /* @__PURE__ */ n("div", { className: "text-[0.8rem] text-a-text-muted mt-[0.3rem] font-normal", children: e })
|
|
111
|
+
] }),
|
|
112
|
+
/* @__PURE__ */ n("div", { className: "relative w-full rounded-xl overflow-hidden", style: { height: h }, children: a ? /* @__PURE__ */ n("div", { className: "w-full rounded-xl anicca-shimmer", style: { height: h }, "aria-label": d.loading }) : s ? /* @__PURE__ */ c("div", { className: "flex flex-col items-center justify-center text-a-text-subtle gap-4 anicca-empty-bg rounded-xl border-2 border-dashed border-a-border", style: { height: h }, children: [
|
|
113
|
+
/* @__PURE__ */ c(
|
|
114
|
+
"svg",
|
|
115
|
+
{
|
|
116
|
+
className: "w-14 h-14 opacity-40 stroke-[1.2]",
|
|
117
|
+
viewBox: "0 0 24 24",
|
|
118
|
+
fill: "none",
|
|
119
|
+
stroke: "currentColor",
|
|
120
|
+
strokeWidth: "1.5",
|
|
121
|
+
"aria-hidden": "true",
|
|
122
|
+
children: [
|
|
123
|
+
/* @__PURE__ */ n("path", { d: "M3 3v18h18", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
124
|
+
/* @__PURE__ */ n("path", { d: "M7 16l4-4 4 4 5-5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
),
|
|
128
|
+
/* @__PURE__ */ n("span", { className: "text-[0.9rem] text-a-text-muted font-medium", children: o })
|
|
129
|
+
] }) : r })
|
|
130
|
+
] });
|
|
131
|
+
}
|
|
132
|
+
const I = {
|
|
133
|
+
expand: "Expand sidebar",
|
|
134
|
+
collapse: "Collapse sidebar",
|
|
135
|
+
navigation: "Sidebar navigation"
|
|
136
|
+
};
|
|
137
|
+
function ge({
|
|
138
|
+
items: t,
|
|
139
|
+
collapsed: e = !1,
|
|
140
|
+
onCollapse: r,
|
|
141
|
+
logo: a,
|
|
142
|
+
footer: s,
|
|
143
|
+
activePath: o = "",
|
|
144
|
+
labels: i,
|
|
145
|
+
className: p = ""
|
|
146
|
+
}) {
|
|
147
|
+
const [l, h] = S({}), d = { ...I, ...i }, m = (v) => {
|
|
148
|
+
h((M) => ({ ...M, [v]: !M[v] }));
|
|
149
|
+
}, x = () => {
|
|
150
|
+
r == null || r(!e);
|
|
151
|
+
}, u = "flex items-center gap-3 py-[0.65rem] px-4 text-a-surface-dark-fg-muted no-underline text-sm font-medium cursor-pointer transition-all duration-200 ease-in-out border-none bg-transparent w-full text-left rounded-[10px] mb-[2px] hover:bg-a-surface-dark-2/60 hover:text-a-surface-dark-fg group/item", g = "bg-a-primary-soft text-a-primary hover:bg-a-primary-soft hover:text-a-primary", D = (v) => {
|
|
152
|
+
const M = o === v.href, T = v.children && v.children.length > 0, b = l[v.href];
|
|
153
|
+
return /* @__PURE__ */ c("div", { children: [
|
|
154
|
+
T ? /* @__PURE__ */ c(
|
|
155
|
+
"button",
|
|
156
|
+
{
|
|
157
|
+
className: `${u} ${M ? g : ""}`,
|
|
158
|
+
onClick: () => m(v.href),
|
|
159
|
+
"aria-expanded": b,
|
|
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
|
+
]
|
|
165
|
+
}
|
|
166
|
+
) : /* @__PURE__ */ c(
|
|
167
|
+
"a",
|
|
168
|
+
{
|
|
169
|
+
href: v.href,
|
|
170
|
+
className: `${u} ${M ? g : ""}`,
|
|
171
|
+
"aria-current": M ? "page" : void 0,
|
|
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
|
+
]
|
|
176
|
+
}
|
|
177
|
+
),
|
|
178
|
+
T && !e && /* @__PURE__ */ n("div", { className: `pl-2 overflow-hidden transition-[max-height] duration-[350ms] ease-[cubic-bezier(0.4,0,0.2,1)] ${b ? "max-h-[500px]" : "max-h-0"}`, children: v.children.map(($) => /* @__PURE__ */ c(
|
|
179
|
+
"a",
|
|
180
|
+
{
|
|
181
|
+
href: $.href,
|
|
182
|
+
className: `${u} pl-11 text-[0.82rem] ${o === $.href ? g : ""}`,
|
|
183
|
+
"aria-current": o === $.href ? "page" : void 0,
|
|
184
|
+
children: [
|
|
185
|
+
$.icon && /* @__PURE__ */ n("span", { className: "shrink-0 w-5 flex items-center justify-center text-[1.1rem]", children: $.icon }),
|
|
186
|
+
/* @__PURE__ */ n("span", { className: "whitespace-nowrap overflow-hidden text-ellipsis", children: $.label })
|
|
187
|
+
]
|
|
188
|
+
},
|
|
189
|
+
$.href
|
|
190
|
+
)) })
|
|
191
|
+
] }, v.href);
|
|
192
|
+
};
|
|
193
|
+
return /* @__PURE__ */ c(
|
|
194
|
+
"aside",
|
|
195
|
+
{
|
|
196
|
+
className: `flex flex-col h-screen sticky top-0 bg-gradient-to-b from-a-surface-dark to-a-surface-dark-2 text-a-surface-dark-fg transition-[width] duration-300 ease-[cubic-bezier(0.4,0,0.2,1)] overflow-hidden border-r border-a-border-dark shrink-0 ${e ? "w-[72px]" : "w-[260px]"} ${p}`,
|
|
197
|
+
role: "navigation",
|
|
198
|
+
"aria-label": d.navigation,
|
|
199
|
+
children: [
|
|
200
|
+
a && /* @__PURE__ */ n("div", { className: "flex items-center justify-center py-6 px-5 border-b border-a-border-dark min-h-[72px]", children: a }),
|
|
201
|
+
/* @__PURE__ */ n("nav", { className: "flex-1 overflow-y-auto py-3 px-2 min-h-0", children: t.map(D) }),
|
|
202
|
+
/* @__PURE__ */ c("div", { className: "p-4 border-t border-a-border-dark", children: [
|
|
203
|
+
s && !e && s,
|
|
204
|
+
/* @__PURE__ */ n(
|
|
205
|
+
"button",
|
|
206
|
+
{
|
|
207
|
+
className: "flex items-center justify-center w-full py-[0.6rem] bg-a-surface-dark-2/60 border border-a-border-dark rounded-lg text-a-surface-dark-fg-muted cursor-pointer text-[0.9rem] transition-all duration-200 ease-in-out hover:bg-a-surface-dark-2 hover:text-a-surface-dark-fg",
|
|
208
|
+
onClick: x,
|
|
209
|
+
"aria-label": e ? d.expand : d.collapse,
|
|
210
|
+
children: e ? "→" : "←"
|
|
211
|
+
}
|
|
212
|
+
)
|
|
213
|
+
] })
|
|
214
|
+
]
|
|
215
|
+
}
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
const U = {
|
|
219
|
+
toggleMenu: "Toggle menu"
|
|
220
|
+
};
|
|
221
|
+
function ye({
|
|
222
|
+
title: t,
|
|
223
|
+
logo: e,
|
|
224
|
+
actions: r,
|
|
225
|
+
user: a,
|
|
226
|
+
onMenuToggle: s,
|
|
227
|
+
labels: o,
|
|
228
|
+
className: i = ""
|
|
229
|
+
}) {
|
|
230
|
+
const p = { ...U, ...o }, l = (h) => h.split(" ").map((d) => d[0]).join("").toUpperCase().slice(0, 2);
|
|
231
|
+
return /* @__PURE__ */ c("header", { className: `flex items-center justify-between px-7 h-[68px] bg-a-surface/90 backdrop-blur-[12px] border-b border-a-border shadow-a-sm sticky top-0 z-[100] ${i}`, role: "banner", children: [
|
|
232
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-[0.85rem]", children: [
|
|
233
|
+
s && /* @__PURE__ */ n(
|
|
234
|
+
"button",
|
|
235
|
+
{
|
|
236
|
+
className: "flex items-center justify-center w-[38px] h-[38px] border border-a-border bg-a-surface-muted rounded-[10px] cursor-pointer text-a-text-muted text-[1.2rem] transition-all duration-200 ease-in-out hover:bg-a-border hover:text-a-text",
|
|
237
|
+
onClick: s,
|
|
238
|
+
"aria-label": p.toggleMenu,
|
|
239
|
+
children: "☰"
|
|
240
|
+
}
|
|
241
|
+
),
|
|
242
|
+
e && /* @__PURE__ */ n("div", { className: "flex items-center", children: e }),
|
|
243
|
+
t && /* @__PURE__ */ n("span", { className: "text-[1.1rem] font-bold text-a-text tracking-[-0.01em]", children: t })
|
|
244
|
+
] }),
|
|
245
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-5", children: [
|
|
246
|
+
r && /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: r }),
|
|
247
|
+
a && /* @__PURE__ */ c("div", { className: "flex items-center gap-3 py-[0.4rem] pr-[0.6rem] pl-[0.4rem] rounded-xl transition-colors duration-200 ease-in-out hover:bg-a-surface-muted", children: [
|
|
248
|
+
/* @__PURE__ */ n(
|
|
249
|
+
"div",
|
|
250
|
+
{
|
|
251
|
+
className: "w-[38px] h-[38px] rounded-[10px] text-a-primary-fg flex items-center justify-center text-[0.8rem] font-bold overflow-hidden",
|
|
252
|
+
style: { background: "var(--anicca-primary)" },
|
|
253
|
+
children: a.avatar ? /* @__PURE__ */ n("img", { src: a.avatar, alt: a.name, className: "w-full h-full object-cover" }) : l(a.name)
|
|
254
|
+
}
|
|
255
|
+
),
|
|
256
|
+
/* @__PURE__ */ c("div", { className: "flex flex-col", children: [
|
|
257
|
+
/* @__PURE__ */ n("span", { className: "text-[0.85rem] font-semibold text-a-text", children: a.name }),
|
|
258
|
+
a.role && /* @__PURE__ */ n("span", { className: "text-[0.7rem] text-a-text-muted font-normal", children: a.role })
|
|
259
|
+
] })
|
|
260
|
+
] })
|
|
261
|
+
] })
|
|
262
|
+
] });
|
|
263
|
+
}
|
|
264
|
+
function ve({
|
|
265
|
+
items: t,
|
|
266
|
+
separator: e = "/",
|
|
267
|
+
ariaLabel: r = "Breadcrumb",
|
|
268
|
+
className: a = ""
|
|
269
|
+
}) {
|
|
270
|
+
return /* @__PURE__ */ n("nav", { className: `py-[0.6rem] ${a}`, "aria-label": r, children: /* @__PURE__ */ n("ol", { className: "flex items-center list-none m-0 p-0 flex-wrap", children: t.map((s, o) => {
|
|
271
|
+
const i = o === t.length - 1;
|
|
272
|
+
return /* @__PURE__ */ n("li", { className: "flex items-center", children: i ? /* @__PURE__ */ c("span", { className: "inline-flex items-center gap-[0.35rem] text-a-text text-[0.82rem] font-bold py-[0.3rem] px-[0.7rem] bg-a-surface-muted rounded-md", children: [
|
|
273
|
+
s.icon && /* @__PURE__ */ n("span", { className: "flex items-center text-[0.85rem]", children: s.icon }),
|
|
274
|
+
s.label
|
|
275
|
+
] }) : /* @__PURE__ */ c(O, { children: [
|
|
276
|
+
/* @__PURE__ */ c("a", { href: s.href || "#", className: "inline-flex items-center gap-[0.35rem] text-a-text-muted no-underline text-[0.82rem] font-medium py-[0.3rem] px-[0.6rem] rounded-md transition-all duration-200 ease-in-out hover:text-a-primary hover:bg-a-primary-soft", children: [
|
|
277
|
+
s.icon && /* @__PURE__ */ n("span", { className: "flex items-center text-[0.85rem]", children: s.icon }),
|
|
278
|
+
s.label
|
|
279
|
+
] }),
|
|
280
|
+
/* @__PURE__ */ n("span", { className: "mx-1 text-a-text-subtle text-xs select-none", "aria-hidden": "true", children: e })
|
|
281
|
+
] }) }, `${s.label}-${o}`);
|
|
282
|
+
}) }) });
|
|
283
|
+
}
|
|
284
|
+
const J = {
|
|
285
|
+
searchPlaceholder: "Search...",
|
|
286
|
+
results: "results",
|
|
287
|
+
emptyMessage: "No data found",
|
|
288
|
+
page: "Page",
|
|
289
|
+
of: "of",
|
|
290
|
+
previous: "← Prev",
|
|
291
|
+
next: "Next →"
|
|
292
|
+
};
|
|
293
|
+
function Ne({
|
|
294
|
+
data: t,
|
|
295
|
+
columns: e,
|
|
296
|
+
searchable: r = !0,
|
|
297
|
+
pageSize: a = 5,
|
|
298
|
+
className: s = "",
|
|
299
|
+
labels: o
|
|
300
|
+
}) {
|
|
301
|
+
const [i, p] = S(""), [l, h] = S(null), [d, m] = S(!0), [x, u] = S(0), g = { ...J, ...o }, D = F(() => {
|
|
302
|
+
let b = t;
|
|
303
|
+
if (i) {
|
|
304
|
+
const $ = i.toLowerCase();
|
|
305
|
+
b = b.filter(
|
|
306
|
+
(f) => e.some((N) => String(f[N.key] ?? "").toLowerCase().includes($))
|
|
307
|
+
);
|
|
308
|
+
}
|
|
309
|
+
return l && (b = [...b].sort(($, f) => {
|
|
310
|
+
const N = String($[l] ?? ""), y = String(f[l] ?? ""), w = N.localeCompare(y, void 0, { numeric: !0 });
|
|
311
|
+
return d ? w : -w;
|
|
312
|
+
})), b;
|
|
313
|
+
}, [t, i, l, d, e]), v = a > 0 ? Math.ceil(D.length / a) : 1, M = a > 0 ? D.slice(x * a, (x + 1) * a) : D, T = (b) => {
|
|
314
|
+
l === b ? m(!d) : (h(b), m(!0));
|
|
315
|
+
};
|
|
316
|
+
return /* @__PURE__ */ c("div", { className: `bg-a-surface rounded-a shadow-a-sm border border-a-border overflow-hidden ${s}`, children: [
|
|
317
|
+
r && /* @__PURE__ */ c("div", { className: "flex items-center justify-between py-5 px-6 border-b border-a-border", children: [
|
|
318
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-2 bg-a-surface-muted border-[1.5px] border-a-border rounded-[10px] py-2 px-[0.85rem] transition-colors focus-within:border-a-primary focus-within:shadow-[0_0_0_3px_var(--anicca-primary-soft)]", children: [
|
|
319
|
+
/* @__PURE__ */ n("span", { className: "text-[0.85rem] opacity-50", children: "🔍" }),
|
|
320
|
+
/* @__PURE__ */ n(
|
|
321
|
+
"input",
|
|
322
|
+
{
|
|
323
|
+
className: "border-none bg-transparent outline-none text-[0.85rem] font-[inherit] text-a-text w-[200px] placeholder:text-a-text-subtle",
|
|
324
|
+
value: i,
|
|
325
|
+
onChange: (b) => {
|
|
326
|
+
p(b.target.value), u(0);
|
|
327
|
+
},
|
|
328
|
+
placeholder: g.searchPlaceholder
|
|
329
|
+
}
|
|
330
|
+
)
|
|
331
|
+
] }),
|
|
332
|
+
/* @__PURE__ */ c("span", { className: "text-xs text-a-text-subtle font-medium", children: [
|
|
333
|
+
D.length,
|
|
334
|
+
" ",
|
|
335
|
+
g.results
|
|
336
|
+
] })
|
|
337
|
+
] }),
|
|
338
|
+
/* @__PURE__ */ n("div", { className: "overflow-x-auto", children: /* @__PURE__ */ c("table", { className: "w-full border-collapse border-spacing-0", children: [
|
|
339
|
+
/* @__PURE__ */ n("thead", { children: /* @__PURE__ */ n("tr", { children: e.map((b) => /* @__PURE__ */ c(
|
|
340
|
+
"th",
|
|
341
|
+
{
|
|
342
|
+
className: `text-left py-3 px-5 text-[0.7rem] font-semibold text-a-text-muted uppercase tracking-[0.05em] bg-a-surface-muted whitespace-nowrap ${b.sortable ? "cursor-pointer select-none transition-colors duration-150 hover:text-a-text" : ""}`,
|
|
343
|
+
style: b.width ? { width: b.width } : void 0,
|
|
344
|
+
onClick: b.sortable ? () => T(b.key) : void 0,
|
|
345
|
+
children: [
|
|
346
|
+
b.label,
|
|
347
|
+
b.sortable && l === b.key && /* @__PURE__ */ n("span", { className: "text-[0.7rem]", children: d ? " ↑" : " ↓" })
|
|
348
|
+
]
|
|
349
|
+
},
|
|
350
|
+
b.key
|
|
351
|
+
)) }) }),
|
|
352
|
+
/* @__PURE__ */ n("tbody", { children: M.length === 0 ? /* @__PURE__ */ n("tr", { children: /* @__PURE__ */ n("td", { colSpan: e.length, className: "py-12 px-6 text-center text-a-text-subtle text-[0.9rem]", children: g.emptyMessage }) }) : M.map((b, $) => /* @__PURE__ */ n("tr", { className: "transition-colors duration-150 hover:[&>td]:bg-a-surface-muted", children: e.map((f) => /* @__PURE__ */ n("td", { className: "py-[0.85rem] px-5 text-[0.85rem] border-b border-a-border align-middle last:border-b-0 text-a-text", children: f.render ? f.render(b[f.key], b) : String(b[f.key] ?? "") }, f.key)) }, $)) })
|
|
353
|
+
] }) }),
|
|
354
|
+
a > 0 && v > 1 && /* @__PURE__ */ c("div", { className: "flex items-center justify-center gap-4 py-4 px-6 border-t border-a-border", children: [
|
|
355
|
+
/* @__PURE__ */ n(
|
|
356
|
+
"button",
|
|
357
|
+
{
|
|
358
|
+
className: "py-[0.4rem] px-[0.85rem] border-[1.5px] border-a-border rounded-lg bg-a-surface text-[0.78rem] font-medium text-a-text-muted cursor-pointer transition-all duration-150 font-[inherit] hover:enabled:border-a-primary hover:enabled:text-a-primary disabled:opacity-40 disabled:cursor-not-allowed",
|
|
359
|
+
disabled: x === 0,
|
|
360
|
+
onClick: () => u(x - 1),
|
|
361
|
+
children: g.previous
|
|
362
|
+
}
|
|
363
|
+
),
|
|
364
|
+
/* @__PURE__ */ c("span", { className: "text-[0.78rem] text-a-text-muted font-medium", children: [
|
|
365
|
+
g.page,
|
|
366
|
+
" ",
|
|
367
|
+
x + 1,
|
|
368
|
+
" ",
|
|
369
|
+
g.of,
|
|
370
|
+
" ",
|
|
371
|
+
v
|
|
372
|
+
] }),
|
|
373
|
+
/* @__PURE__ */ n(
|
|
374
|
+
"button",
|
|
375
|
+
{
|
|
376
|
+
className: "py-[0.4rem] px-[0.85rem] border-[1.5px] border-a-border rounded-lg bg-a-surface text-[0.78rem] font-medium text-a-text-muted cursor-pointer transition-all duration-150 font-[inherit] hover:enabled:border-a-primary hover:enabled:text-a-primary disabled:opacity-40 disabled:cursor-not-allowed",
|
|
377
|
+
disabled: x >= v - 1,
|
|
378
|
+
onClick: () => u(x + 1),
|
|
379
|
+
children: g.next
|
|
380
|
+
}
|
|
381
|
+
)
|
|
382
|
+
] })
|
|
383
|
+
] });
|
|
384
|
+
}
|
|
385
|
+
function we({
|
|
386
|
+
items: t,
|
|
387
|
+
title: e,
|
|
388
|
+
badge: r,
|
|
389
|
+
className: a = ""
|
|
390
|
+
}) {
|
|
391
|
+
const s = e && e.length > 0 || r;
|
|
392
|
+
return /* @__PURE__ */ c("div", { className: `bg-a-surface rounded-a p-6 shadow-a-sm border border-a-border ${a}`, children: [
|
|
393
|
+
s && /* @__PURE__ */ c("div", { className: "flex justify-between items-center mb-5", children: [
|
|
394
|
+
e ? /* @__PURE__ */ n("span", { className: "text-[0.95rem] font-bold text-a-text", children: e }) : /* @__PURE__ */ n("span", {}),
|
|
395
|
+
r && /* @__PURE__ */ n("span", { children: r })
|
|
396
|
+
] }),
|
|
397
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col", children: t.map((o, i) => /* @__PURE__ */ c("div", { className: "flex gap-[0.85rem] py-[0.85rem] relative", children: [
|
|
398
|
+
i < t.length - 1 && /* @__PURE__ */ n("div", { className: "absolute left-[18px] top-[48px] bottom-0 w-[1.5px] bg-gradient-to-b from-a-border to-transparent" }),
|
|
399
|
+
/* @__PURE__ */ n(
|
|
400
|
+
"div",
|
|
401
|
+
{
|
|
402
|
+
className: "w-9 h-9 rounded-[10px] flex items-center justify-center text-[0.95rem] shrink-0 relative z-[1]",
|
|
403
|
+
style: { background: o.iconBg || "var(--anicca-surface-muted)" },
|
|
404
|
+
children: o.icon
|
|
405
|
+
}
|
|
406
|
+
),
|
|
407
|
+
/* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children: [
|
|
408
|
+
/* @__PURE__ */ n("div", { className: "text-[0.82rem] text-a-text leading-relaxed", children: o.message }),
|
|
409
|
+
/* @__PURE__ */ n("div", { className: "text-[0.7rem] text-a-text-subtle mt-[0.2rem]", children: o.time })
|
|
410
|
+
] })
|
|
411
|
+
] }, i)) })
|
|
412
|
+
] });
|
|
413
|
+
}
|
|
414
|
+
const V = {
|
|
415
|
+
unit: "projects"
|
|
416
|
+
};
|
|
417
|
+
function ke({
|
|
418
|
+
items: t,
|
|
419
|
+
title: e,
|
|
420
|
+
showCount: r = !0,
|
|
421
|
+
labels: a,
|
|
422
|
+
className: s = ""
|
|
423
|
+
}) {
|
|
424
|
+
const o = { ...V, ...a };
|
|
425
|
+
return /* @__PURE__ */ c("div", { className: `bg-a-surface rounded-a p-6 shadow-a-sm border border-a-border ${s}`, children: [
|
|
426
|
+
e && /* @__PURE__ */ c("div", { className: "flex justify-between items-center mb-5", children: [
|
|
427
|
+
/* @__PURE__ */ n("span", { className: "text-[0.95rem] font-bold text-a-text", children: e }),
|
|
428
|
+
r && /* @__PURE__ */ c("span", { className: "text-[0.68rem] py-[0.2rem] px-[0.55rem] rounded-[20px] font-semibold bg-a-info-bg text-a-info", children: [
|
|
429
|
+
t.length,
|
|
430
|
+
" ",
|
|
431
|
+
o.unit
|
|
432
|
+
] })
|
|
433
|
+
] }),
|
|
434
|
+
t.map((i, p) => {
|
|
435
|
+
const l = i.color || "var(--anicca-primary)";
|
|
436
|
+
return /* @__PURE__ */ c("div", { className: `py-[0.85rem] border-b border-a-border last:border-b-0 last:pb-0 ${p === 0 && !e ? "pt-0" : ""}`, children: [
|
|
437
|
+
/* @__PURE__ */ c("div", { className: "flex justify-between items-center mb-2", children: [
|
|
438
|
+
/* @__PURE__ */ n("span", { className: "text-[0.85rem] font-semibold text-a-text", children: i.name }),
|
|
439
|
+
/* @__PURE__ */ c("span", { className: "text-xs font-bold", style: { color: l }, children: [
|
|
440
|
+
i.progress,
|
|
441
|
+
"%"
|
|
442
|
+
] })
|
|
443
|
+
] }),
|
|
444
|
+
/* @__PURE__ */ n("div", { className: "h-[7px] bg-a-surface-muted rounded overflow-hidden", children: /* @__PURE__ */ n("div", { className: "h-full rounded transition-[width] duration-500 ease-in-out", style: { width: `${i.progress}%`, background: l } }) }),
|
|
445
|
+
(i.status || i.team) && /* @__PURE__ */ c("div", { className: "flex justify-between items-center mt-[0.4rem]", children: [
|
|
446
|
+
i.status && /* @__PURE__ */ n("span", { className: "text-[0.7rem] text-a-text-subtle", children: i.status }),
|
|
447
|
+
i.team && /* @__PURE__ */ n("div", { className: "flex", children: i.team.map((h, d) => {
|
|
448
|
+
const m = typeof h == "string" ? h : h.color, x = typeof h == "string" ? String.fromCharCode(65 + d) : h.label ?? String.fromCharCode(65 + d);
|
|
449
|
+
return /* @__PURE__ */ n("div", { className: "w-[22px] h-[22px] rounded-full border-2 border-a-surface -ml-[6px] first:ml-0 flex items-center justify-center text-[0.55rem] font-bold text-a-primary-fg", style: { background: m }, children: x }, d);
|
|
450
|
+
}) })
|
|
451
|
+
] })
|
|
452
|
+
] }, i.name);
|
|
453
|
+
})
|
|
454
|
+
] });
|
|
455
|
+
}
|
|
456
|
+
const P = {
|
|
457
|
+
close: "Close"
|
|
458
|
+
};
|
|
459
|
+
function $e({
|
|
460
|
+
open: t,
|
|
461
|
+
onClose: e,
|
|
462
|
+
title: r,
|
|
463
|
+
children: a,
|
|
464
|
+
footer: s,
|
|
465
|
+
disableEscapeKey: o = !1,
|
|
466
|
+
disableBackdropClick: i = !1,
|
|
467
|
+
labels: p,
|
|
468
|
+
className: l = ""
|
|
469
|
+
}) {
|
|
470
|
+
const h = { ...P, ...p };
|
|
471
|
+
return E(() => {
|
|
472
|
+
if (!t || o) return;
|
|
473
|
+
const d = (m) => {
|
|
474
|
+
m.key === "Escape" && e();
|
|
475
|
+
};
|
|
476
|
+
return document.addEventListener("keydown", d), () => document.removeEventListener("keydown", d);
|
|
477
|
+
}, [t, e, o]), E(() => {
|
|
478
|
+
if (t)
|
|
479
|
+
return document.body.style.overflow = "hidden", () => {
|
|
480
|
+
document.body.style.overflow = "";
|
|
481
|
+
};
|
|
482
|
+
}, [t]), t ? /* @__PURE__ */ n(
|
|
483
|
+
"div",
|
|
484
|
+
{
|
|
485
|
+
className: "fixed inset-0 backdrop-blur-[4px] flex items-center justify-center z-[1000] anicca-fade-in p-4",
|
|
486
|
+
style: { background: "var(--anicca-surface-overlay)" },
|
|
487
|
+
onClick: i ? void 0 : e,
|
|
488
|
+
role: "dialog",
|
|
489
|
+
"aria-modal": "true",
|
|
490
|
+
"aria-label": r,
|
|
491
|
+
children: /* @__PURE__ */ c("div", { className: `bg-a-surface rounded-a shadow-a-lg w-full max-w-[480px] max-h-[90vh] overflow-y-auto anicca-slide-up ${l}`, onClick: (d) => d.stopPropagation(), children: [
|
|
492
|
+
r && /* @__PURE__ */ c("div", { className: "flex items-center justify-between py-5 px-6 border-b border-a-border", children: [
|
|
493
|
+
/* @__PURE__ */ n("span", { className: "text-base font-bold text-a-text", children: r }),
|
|
494
|
+
/* @__PURE__ */ n("button", { className: "w-8 h-8 rounded-lg border-none bg-a-surface-muted text-a-text-muted text-[1.1rem] cursor-pointer flex items-center justify-center transition-all duration-150 hover:bg-a-border hover:text-a-text", onClick: e, "aria-label": h.close, children: "×" })
|
|
495
|
+
] }),
|
|
496
|
+
/* @__PURE__ */ n("div", { className: "p-6 text-a-text", children: a }),
|
|
497
|
+
s && /* @__PURE__ */ n("div", { className: "flex justify-end gap-3 py-4 px-6 border-t border-a-border", children: s })
|
|
498
|
+
] })
|
|
499
|
+
}
|
|
500
|
+
) : null;
|
|
501
|
+
}
|
|
502
|
+
function Me({
|
|
503
|
+
tabs: t,
|
|
504
|
+
defaultTab: e,
|
|
505
|
+
activeKey: r,
|
|
506
|
+
onChange: a,
|
|
507
|
+
className: s = ""
|
|
508
|
+
}) {
|
|
509
|
+
var d;
|
|
510
|
+
const [o, i] = S(e || ((d = t[0]) == null ? void 0 : d.key) || ""), p = r ?? o, l = t.find((m) => m.key === p), h = (m) => {
|
|
511
|
+
r === void 0 && i(m), a == null || a(m);
|
|
512
|
+
};
|
|
513
|
+
return /* @__PURE__ */ c("div", { className: `bg-a-surface rounded-a shadow-a-sm border border-a-border overflow-hidden ${s}`, children: [
|
|
514
|
+
/* @__PURE__ */ n("div", { className: "flex pt-2 px-6 border-b border-a-border", role: "tablist", children: t.map((m) => /* @__PURE__ */ c(
|
|
515
|
+
"button",
|
|
516
|
+
{
|
|
517
|
+
className: `py-[0.7rem] px-[1.1rem] text-[0.82rem] font-medium cursor-pointer border-none bg-transparent border-b-2 transition-all duration-200 flex items-center gap-[0.4rem] font-[inherit] -mb-px ${p === m.key ? "text-a-primary border-b-a-primary font-semibold" : "text-a-text-muted border-b-transparent hover:text-a-text"}`,
|
|
518
|
+
onClick: () => h(m.key),
|
|
519
|
+
role: "tab",
|
|
520
|
+
"aria-selected": p === m.key,
|
|
521
|
+
children: [
|
|
522
|
+
m.icon && /* @__PURE__ */ n("span", { className: "text-[0.9rem]", children: m.icon }),
|
|
523
|
+
m.label
|
|
524
|
+
]
|
|
525
|
+
},
|
|
526
|
+
m.key
|
|
527
|
+
)) }),
|
|
528
|
+
/* @__PURE__ */ n("div", { className: "p-6 text-a-text", role: "tabpanel", children: l == null ? void 0 : l.content })
|
|
529
|
+
] });
|
|
530
|
+
}
|
|
531
|
+
function Se(t = "This field is required") {
|
|
532
|
+
return {
|
|
533
|
+
validate: (e) => e == null ? !1 : typeof e == "string" ? e.trim().length > 0 : Array.isArray(e) ? e.length > 0 : !0,
|
|
534
|
+
message: t
|
|
535
|
+
};
|
|
536
|
+
}
|
|
537
|
+
function Ae(t = "Invalid email address") {
|
|
538
|
+
return {
|
|
539
|
+
validate: (e) => typeof e != "string" ? !1 : /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),
|
|
540
|
+
message: t
|
|
541
|
+
};
|
|
542
|
+
}
|
|
543
|
+
function De(t, e) {
|
|
544
|
+
return {
|
|
545
|
+
validate: (r) => typeof r != "string" ? !1 : r.length >= t,
|
|
546
|
+
message: e || `Must be at least ${t} characters`
|
|
547
|
+
};
|
|
548
|
+
}
|
|
549
|
+
function Te(t, e) {
|
|
550
|
+
return {
|
|
551
|
+
validate: (r) => typeof r != "string" ? !1 : r.length <= t,
|
|
552
|
+
message: e || `Must be at most ${t} characters`
|
|
553
|
+
};
|
|
554
|
+
}
|
|
555
|
+
function Ce(t, e = "Invalid format") {
|
|
556
|
+
return {
|
|
557
|
+
validate: (r) => typeof r != "string" ? !1 : t.test(r),
|
|
558
|
+
message: e
|
|
559
|
+
};
|
|
560
|
+
}
|
|
561
|
+
function je(t, e) {
|
|
562
|
+
return {
|
|
563
|
+
validate: (r) => typeof r != "number" ? !1 : r >= t,
|
|
564
|
+
message: e || `Must be at least ${t}`
|
|
565
|
+
};
|
|
566
|
+
}
|
|
567
|
+
function Le(t, e) {
|
|
568
|
+
return {
|
|
569
|
+
validate: (r) => typeof r != "number" ? !1 : r <= t,
|
|
570
|
+
message: e || `Must be at most ${t}`
|
|
571
|
+
};
|
|
572
|
+
}
|
|
573
|
+
function Fe(t, e) {
|
|
574
|
+
return {
|
|
575
|
+
validate: t,
|
|
576
|
+
message: e
|
|
577
|
+
};
|
|
578
|
+
}
|
|
579
|
+
function Ee(t) {
|
|
580
|
+
const { initialValues: e, validationSchema: r, onSubmit: a } = t, [s, o] = S(e), [i, p] = S({}), [l, h] = S({}), [d, m] = S(!1), x = k(
|
|
581
|
+
(f, N) => {
|
|
582
|
+
const y = r == null ? void 0 : r[f];
|
|
583
|
+
if (y) {
|
|
584
|
+
for (const w of y)
|
|
585
|
+
if (!w.validate(N))
|
|
586
|
+
return w.message;
|
|
587
|
+
}
|
|
588
|
+
},
|
|
589
|
+
[r]
|
|
590
|
+
), u = k(() => {
|
|
591
|
+
const f = {};
|
|
592
|
+
for (const N of Object.keys(e)) {
|
|
593
|
+
const y = x(N, s[N]);
|
|
594
|
+
y && (f[N] = y);
|
|
595
|
+
}
|
|
596
|
+
return f;
|
|
597
|
+
}, [e, x, s]), g = Object.keys(i).length === 0, D = k(
|
|
598
|
+
(f) => (N) => {
|
|
599
|
+
const y = N.target.value;
|
|
600
|
+
if (o((w) => ({ ...w, [f]: y })), l[f]) {
|
|
601
|
+
const w = x(f, y);
|
|
602
|
+
p((C) => {
|
|
603
|
+
const L = { ...C };
|
|
604
|
+
return w ? L[f] = w : delete L[f], L;
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
},
|
|
608
|
+
[l, x]
|
|
609
|
+
), v = k(
|
|
610
|
+
(f) => () => {
|
|
611
|
+
h((y) => ({ ...y, [f]: !0 }));
|
|
612
|
+
const N = x(f, s[f]);
|
|
613
|
+
p((y) => {
|
|
614
|
+
const w = { ...y };
|
|
615
|
+
return N ? w[f] = N : delete w[f], w;
|
|
616
|
+
});
|
|
617
|
+
},
|
|
618
|
+
[x, s]
|
|
619
|
+
), M = k(
|
|
620
|
+
async (f) => {
|
|
621
|
+
f && f.preventDefault();
|
|
622
|
+
const N = {};
|
|
623
|
+
for (const w of Object.keys(e))
|
|
624
|
+
N[w] = !0;
|
|
625
|
+
h(N);
|
|
626
|
+
const y = u();
|
|
627
|
+
if (p(y), Object.keys(y).length === 0 && a) {
|
|
628
|
+
m(!0);
|
|
629
|
+
try {
|
|
630
|
+
await a(s);
|
|
631
|
+
} finally {
|
|
632
|
+
m(!1);
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
},
|
|
636
|
+
[e, a, u, s]
|
|
637
|
+
), T = k(() => {
|
|
638
|
+
o(e), p({}), h({}), m(!1);
|
|
639
|
+
}, [e]), b = k(
|
|
640
|
+
(f, N) => {
|
|
641
|
+
if (o((y) => ({ ...y, [f]: N })), l[f]) {
|
|
642
|
+
const y = x(f, N);
|
|
643
|
+
p((w) => {
|
|
644
|
+
const C = { ...w };
|
|
645
|
+
return y ? C[f] = y : delete C[f], C;
|
|
646
|
+
});
|
|
647
|
+
}
|
|
648
|
+
},
|
|
649
|
+
[l, x]
|
|
650
|
+
), $ = k((f, N) => {
|
|
651
|
+
p((y) => ({ ...y, [f]: N }));
|
|
652
|
+
}, []);
|
|
653
|
+
return {
|
|
654
|
+
values: s,
|
|
655
|
+
errors: i,
|
|
656
|
+
touched: l,
|
|
657
|
+
isValid: g,
|
|
658
|
+
isSubmitting: d,
|
|
659
|
+
handleChange: D,
|
|
660
|
+
handleBlur: v,
|
|
661
|
+
handleSubmit: M,
|
|
662
|
+
reset: T,
|
|
663
|
+
setFieldValue: b,
|
|
664
|
+
setFieldError: $
|
|
665
|
+
};
|
|
666
|
+
}
|
|
667
|
+
const q = ["Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"], z = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], K = ["Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember"], R = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
|
668
|
+
function A(t) {
|
|
669
|
+
return typeof t == "string" ? new Date(t) : new Date(t.getTime());
|
|
670
|
+
}
|
|
671
|
+
function j(t) {
|
|
672
|
+
return t.toString().padStart(2, "0");
|
|
673
|
+
}
|
|
674
|
+
function W(t, e, r = "en") {
|
|
675
|
+
const a = A(t), s = r === "id" ? q : z, o = r === "id" ? K : R;
|
|
676
|
+
return e.replace("YYYY", a.getFullYear().toString()).replace("MM", j(a.getMonth() + 1)).replace("DD", j(a.getDate())).replace("HH", j(a.getHours())).replace("mm", j(a.getMinutes())).replace("ss", j(a.getSeconds())).replace("dddd", s[a.getDay()]).replace("MMMM", o[a.getMonth()]);
|
|
677
|
+
}
|
|
678
|
+
function G(t, e, r) {
|
|
679
|
+
const a = A(t), s = A(e);
|
|
680
|
+
if (r === "years")
|
|
681
|
+
return Math.abs(a.getFullYear() - s.getFullYear());
|
|
682
|
+
if (r === "months")
|
|
683
|
+
return Math.abs(
|
|
684
|
+
(a.getFullYear() - s.getFullYear()) * 12 + (a.getMonth() - s.getMonth())
|
|
685
|
+
);
|
|
686
|
+
const o = Math.abs(a.getTime() - s.getTime());
|
|
687
|
+
return Math.floor(o / {
|
|
688
|
+
seconds: 1e3,
|
|
689
|
+
minutes: 6e4,
|
|
690
|
+
hours: 36e5,
|
|
691
|
+
days: 864e5
|
|
692
|
+
}[r]);
|
|
693
|
+
}
|
|
694
|
+
function Q(t, e = "en") {
|
|
695
|
+
const r = A(t), s = (/* @__PURE__ */ new Date()).getTime() - r.getTime(), o = s < 0, i = Math.abs(s), p = Math.floor(i / 1e3), l = Math.floor(i / 6e4), h = Math.floor(i / 36e5), d = Math.floor(i / 864e5), m = Math.floor(d / 7), x = Math.floor(d / 30), u = Math.floor(d / 365);
|
|
696
|
+
if (e === "id") {
|
|
697
|
+
const g = o ? "lagi" : "lalu";
|
|
698
|
+
return p < 60 ? "baru saja" : l < 60 ? `${l} menit ${g}` : h < 24 ? `${h} jam ${g}` : d < 7 ? `${d} hari ${g}` : m < 4 ? `${m} minggu ${g}` : x < 12 ? `${x} bulan ${g}` : `${u} tahun ${g}`;
|
|
699
|
+
}
|
|
700
|
+
return p < 60 ? "just now" : o ? l < 60 ? `in ${l} minutes` : h < 24 ? `in ${h} hours` : d < 7 ? `in ${d} days` : m < 4 ? `in ${m} weeks` : x < 12 ? `in ${x} months` : `in ${u} years` : l < 60 ? `${l} minutes ago` : h < 24 ? `${h} hours ago` : d < 7 ? `${d} days ago` : m < 4 ? `${m} weeks ago` : x < 12 ? `${x} months ago` : `${u} years ago`;
|
|
701
|
+
}
|
|
702
|
+
function X(t, e) {
|
|
703
|
+
const r = A(t);
|
|
704
|
+
switch (e) {
|
|
705
|
+
case "day":
|
|
706
|
+
return r.setHours(0, 0, 0, 0), r;
|
|
707
|
+
case "week": {
|
|
708
|
+
const a = r.getDay();
|
|
709
|
+
return r.setDate(r.getDate() - a), r.setHours(0, 0, 0, 0), r;
|
|
710
|
+
}
|
|
711
|
+
case "month":
|
|
712
|
+
return r.setDate(1), r.setHours(0, 0, 0, 0), r;
|
|
713
|
+
case "year":
|
|
714
|
+
return r.setMonth(0, 1), r.setHours(0, 0, 0, 0), r;
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
function Z(t, e) {
|
|
718
|
+
const r = A(t);
|
|
719
|
+
switch (e) {
|
|
720
|
+
case "day":
|
|
721
|
+
return r.setHours(23, 59, 59, 999), r;
|
|
722
|
+
case "week": {
|
|
723
|
+
const a = r.getDay();
|
|
724
|
+
return r.setDate(r.getDate() + (6 - a)), r.setHours(23, 59, 59, 999), r;
|
|
725
|
+
}
|
|
726
|
+
case "month":
|
|
727
|
+
return r.setMonth(r.getMonth() + 1, 0), r.setHours(23, 59, 59, 999), r;
|
|
728
|
+
case "year":
|
|
729
|
+
return r.setMonth(11, 31), r.setHours(23, 59, 59, 999), r;
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
function ee(t, e, r) {
|
|
733
|
+
const a = A(t);
|
|
734
|
+
switch (r) {
|
|
735
|
+
case "minutes":
|
|
736
|
+
return a.setMinutes(a.getMinutes() + e), a;
|
|
737
|
+
case "hours":
|
|
738
|
+
return a.setHours(a.getHours() + e), a;
|
|
739
|
+
case "days":
|
|
740
|
+
return a.setDate(a.getDate() + e), a;
|
|
741
|
+
case "months":
|
|
742
|
+
return a.setMonth(a.getMonth() + e), a;
|
|
743
|
+
case "years":
|
|
744
|
+
return a.setFullYear(a.getFullYear() + e), a;
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
function te(t) {
|
|
748
|
+
return t instanceof Date ? !isNaN(t.getTime()) : typeof t == "string" ? !isNaN(new Date(t).getTime()) : !1;
|
|
749
|
+
}
|
|
750
|
+
function re(t, e) {
|
|
751
|
+
return A(t).getTime() < A(e).getTime();
|
|
752
|
+
}
|
|
753
|
+
function ae(t, e) {
|
|
754
|
+
return A(t).getTime() > A(e).getTime();
|
|
755
|
+
}
|
|
756
|
+
function Be(t) {
|
|
757
|
+
const [e, r] = S(() => {
|
|
758
|
+
if (t == null) return null;
|
|
759
|
+
const u = typeof t == "string" ? new Date(t) : t;
|
|
760
|
+
return isNaN(u.getTime()) ? null : u;
|
|
761
|
+
}), a = k((u) => {
|
|
762
|
+
if (u === null) {
|
|
763
|
+
r(null);
|
|
764
|
+
return;
|
|
765
|
+
}
|
|
766
|
+
const g = typeof u == "string" ? new Date(u) : u;
|
|
767
|
+
r(isNaN(g.getTime()) ? null : g);
|
|
768
|
+
}, []), s = k(
|
|
769
|
+
(u, g = "en") => e ? W(e, u, g) : "",
|
|
770
|
+
[e]
|
|
771
|
+
), o = k(
|
|
772
|
+
(u, g) => e ? G(e, u, g) : 0,
|
|
773
|
+
[e]
|
|
774
|
+
), i = k(
|
|
775
|
+
(u = "en") => e ? Q(e, u) : "",
|
|
776
|
+
[e]
|
|
777
|
+
), p = k(
|
|
778
|
+
(u, g) => e ? ee(e, u, g) : /* @__PURE__ */ new Date(),
|
|
779
|
+
[e]
|
|
780
|
+
), l = k(
|
|
781
|
+
(u) => e ? X(e, u) : /* @__PURE__ */ new Date(),
|
|
782
|
+
[e]
|
|
783
|
+
), h = k(
|
|
784
|
+
(u) => e ? Z(e, u) : /* @__PURE__ */ new Date(),
|
|
785
|
+
[e]
|
|
786
|
+
), d = k(() => te(e), [e]), m = k(
|
|
787
|
+
(u) => e ? re(e, u) : !1,
|
|
788
|
+
[e]
|
|
789
|
+
), x = k(
|
|
790
|
+
(u) => e ? ae(e, u) : !1,
|
|
791
|
+
[e]
|
|
792
|
+
);
|
|
793
|
+
return {
|
|
794
|
+
date: e,
|
|
795
|
+
setDate: a,
|
|
796
|
+
format: s,
|
|
797
|
+
diff: o,
|
|
798
|
+
relative: i,
|
|
799
|
+
add: p,
|
|
800
|
+
startOf: l,
|
|
801
|
+
endOf: h,
|
|
802
|
+
isValid: d,
|
|
803
|
+
isBefore: m,
|
|
804
|
+
isAfter: x
|
|
805
|
+
};
|
|
806
|
+
}
|
|
807
|
+
function ne(t, e) {
|
|
808
|
+
let r = null;
|
|
809
|
+
return (...a) => {
|
|
810
|
+
r && clearTimeout(r), r = setTimeout(() => t(...a), e);
|
|
811
|
+
};
|
|
812
|
+
}
|
|
813
|
+
function se(t, e) {
|
|
814
|
+
let r = 0;
|
|
815
|
+
return (...a) => {
|
|
816
|
+
const s = Date.now();
|
|
817
|
+
s - r >= e && (r = s, t(...a));
|
|
818
|
+
};
|
|
819
|
+
}
|
|
820
|
+
function oe(t, e, r = "...") {
|
|
821
|
+
return t.length <= e ? t : t.slice(0, e) + r;
|
|
822
|
+
}
|
|
823
|
+
async function ie(t) {
|
|
824
|
+
try {
|
|
825
|
+
if (navigator.clipboard && navigator.clipboard.writeText)
|
|
826
|
+
return await navigator.clipboard.writeText(t), !0;
|
|
827
|
+
const e = document.createElement("textarea");
|
|
828
|
+
e.value = t, e.style.position = "fixed", e.style.opacity = "0", document.body.appendChild(e), e.select();
|
|
829
|
+
const r = document.execCommand("copy");
|
|
830
|
+
return document.body.removeChild(e), r;
|
|
831
|
+
} catch {
|
|
832
|
+
return !1;
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
function ce(t) {
|
|
836
|
+
return t.toLowerCase().replace(/[^\w\s-]/g, "").replace(/[\s_]+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
837
|
+
}
|
|
838
|
+
function le(t) {
|
|
839
|
+
return t && t.charAt(0).toUpperCase() + t.slice(1).toLowerCase();
|
|
840
|
+
}
|
|
841
|
+
function de(t) {
|
|
842
|
+
return typeof structuredClone == "function" ? structuredClone(t) : JSON.parse(JSON.stringify(t));
|
|
843
|
+
}
|
|
844
|
+
function B(t, e = "") {
|
|
845
|
+
const r = {};
|
|
846
|
+
for (const a of Object.keys(t)) {
|
|
847
|
+
const s = e ? `${e}.${a}` : a, o = t[a];
|
|
848
|
+
o !== null && typeof o == "object" && !Array.isArray(o) ? Object.assign(r, B(o, s)) : r[s] = o;
|
|
849
|
+
}
|
|
850
|
+
return r;
|
|
851
|
+
}
|
|
852
|
+
function ue(t, e) {
|
|
853
|
+
const r = {};
|
|
854
|
+
for (const a of t) {
|
|
855
|
+
const s = String(a[e]);
|
|
856
|
+
r[s] || (r[s] = []), r[s].push(a);
|
|
857
|
+
}
|
|
858
|
+
return r;
|
|
859
|
+
}
|
|
860
|
+
function fe(t, e) {
|
|
861
|
+
const r = /* @__PURE__ */ new Set();
|
|
862
|
+
return t.filter((a) => {
|
|
863
|
+
const s = a[e];
|
|
864
|
+
return r.has(s) ? !1 : (r.add(s), !0);
|
|
865
|
+
});
|
|
866
|
+
}
|
|
867
|
+
function Oe() {
|
|
868
|
+
return F(
|
|
869
|
+
() => ({
|
|
870
|
+
debounce: ne,
|
|
871
|
+
throttle: se,
|
|
872
|
+
truncate: oe,
|
|
873
|
+
copyToClipboard: ie,
|
|
874
|
+
slugify: ce,
|
|
875
|
+
capitalize: le,
|
|
876
|
+
deepClone: de,
|
|
877
|
+
flattenObject: B,
|
|
878
|
+
groupBy: ue,
|
|
879
|
+
uniqueBy: fe
|
|
880
|
+
}),
|
|
881
|
+
[]
|
|
882
|
+
);
|
|
883
|
+
}
|
|
884
|
+
export {
|
|
885
|
+
_ as ANICCA_THEME_CSS_VAR_MAP,
|
|
886
|
+
we as AniccaActivityFeed,
|
|
887
|
+
ve as AniccaBreadcrumb,
|
|
888
|
+
xe as AniccaChartWrapper,
|
|
889
|
+
Ne as AniccaDataTable,
|
|
890
|
+
$e as AniccaModal,
|
|
891
|
+
ye as AniccaNavbar,
|
|
892
|
+
ke as AniccaProgressCard,
|
|
893
|
+
ge as AniccaSidebar,
|
|
894
|
+
be as AniccaStatCard,
|
|
895
|
+
Me as AniccaTabs,
|
|
896
|
+
pe as AniccaThemeProvider,
|
|
897
|
+
ee as aniccaAdd,
|
|
898
|
+
le as aniccaCapitalize,
|
|
899
|
+
ie as aniccaCopyToClipboard,
|
|
900
|
+
ne as aniccaDebounce,
|
|
901
|
+
de as aniccaDeepClone,
|
|
902
|
+
G as aniccaDiff,
|
|
903
|
+
Z as aniccaEndOf,
|
|
904
|
+
B as aniccaFlattenObject,
|
|
905
|
+
W as aniccaFormat,
|
|
906
|
+
ue as aniccaGroupBy,
|
|
907
|
+
ae as aniccaIsAfter,
|
|
908
|
+
re as aniccaIsBefore,
|
|
909
|
+
te as aniccaIsValid,
|
|
910
|
+
Q as aniccaRelative,
|
|
911
|
+
ce as aniccaSlugify,
|
|
912
|
+
X as aniccaStartOf,
|
|
913
|
+
se as aniccaThrottle,
|
|
914
|
+
oe as aniccaTruncate,
|
|
915
|
+
fe as aniccaUniqueBy,
|
|
916
|
+
Fe as custom,
|
|
917
|
+
Ae as email,
|
|
918
|
+
Le as max,
|
|
919
|
+
Te as maxLength,
|
|
920
|
+
je as min,
|
|
921
|
+
De as minLength,
|
|
922
|
+
Ce as pattern,
|
|
923
|
+
Se as required,
|
|
924
|
+
Be as useAniccaDate,
|
|
925
|
+
Ee as useAniccaForm,
|
|
926
|
+
Oe as useAniccaUtils
|
|
927
|
+
};
|