@zeo-app/design-system 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +324 -300
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsxs as l, jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
|
|
2
|
+
import { forwardRef as N, useState as C, useRef as M, useCallback as B, useLayoutEffect as P, useEffect as I, createContext as V, useContext as W, useId as ee } from "react";
|
|
3
|
+
import { createPortal as te } from "react-dom";
|
|
4
|
+
const re = {
|
|
4
5
|
info: {
|
|
5
6
|
container: "bg-blue-50 border-blue-200 text-blue-800",
|
|
6
7
|
icon: "text-blue-500",
|
|
@@ -22,28 +23,28 @@ const Z = {
|
|
|
22
23
|
defaultIcon: "error"
|
|
23
24
|
}
|
|
24
25
|
};
|
|
25
|
-
function
|
|
26
|
+
function Ae({
|
|
26
27
|
variant: e = "info",
|
|
27
28
|
title: t,
|
|
28
29
|
children: r,
|
|
29
30
|
onClose: a,
|
|
30
31
|
icon: o,
|
|
31
32
|
className: s = "",
|
|
32
|
-
...
|
|
33
|
+
...c
|
|
33
34
|
}) {
|
|
34
|
-
const
|
|
35
|
+
const i = re[e], m = o ?? i.defaultIcon;
|
|
35
36
|
return /* @__PURE__ */ l(
|
|
36
37
|
"div",
|
|
37
38
|
{
|
|
38
39
|
role: "alert",
|
|
39
40
|
className: [
|
|
40
41
|
"flex gap-3 p-4 rounded-lg border",
|
|
41
|
-
|
|
42
|
+
i.container,
|
|
42
43
|
s
|
|
43
44
|
].filter(Boolean).join(" "),
|
|
44
|
-
...
|
|
45
|
+
...c,
|
|
45
46
|
children: [
|
|
46
|
-
/* @__PURE__ */ n("span", { className: `material-symbols-outlined text-[20px] shrink-0 mt-0.5 ${
|
|
47
|
+
/* @__PURE__ */ n("span", { className: `material-symbols-outlined text-[20px] shrink-0 mt-0.5 ${i.icon}`, children: m }),
|
|
47
48
|
/* @__PURE__ */ l("div", { className: "flex-1 min-w-0", children: [
|
|
48
49
|
t && /* @__PURE__ */ n("p", { className: "font-semibold text-sm mb-0.5", children: t }),
|
|
49
50
|
/* @__PURE__ */ n("div", { className: "text-sm leading-relaxed", children: r })
|
|
@@ -61,28 +62,28 @@ function Le({
|
|
|
61
62
|
}
|
|
62
63
|
);
|
|
63
64
|
}
|
|
64
|
-
const
|
|
65
|
+
const ne = {
|
|
65
66
|
xs: "w-6 h-6 text-[10px]",
|
|
66
67
|
sm: "w-8 h-8 text-xs",
|
|
67
68
|
md: "w-10 h-10 text-sm",
|
|
68
69
|
lg: "w-12 h-12 text-base",
|
|
69
70
|
xl: "w-16 h-16 text-lg"
|
|
70
|
-
},
|
|
71
|
+
}, ae = {
|
|
71
72
|
xs: "w-1.5 h-1.5",
|
|
72
73
|
sm: "w-2 h-2",
|
|
73
74
|
md: "w-2.5 h-2.5",
|
|
74
75
|
lg: "w-3 h-3",
|
|
75
76
|
xl: "w-3.5 h-3.5"
|
|
76
|
-
},
|
|
77
|
+
}, oe = {
|
|
77
78
|
online: "bg-green-500",
|
|
78
79
|
offline: "bg-gray-400",
|
|
79
80
|
busy: "bg-red-500",
|
|
80
81
|
away: "bg-yellow-400"
|
|
81
82
|
};
|
|
82
|
-
function
|
|
83
|
+
function se(e) {
|
|
83
84
|
return e.split(" ").slice(0, 2).map((t) => t[0]).join("").toUpperCase();
|
|
84
85
|
}
|
|
85
|
-
function
|
|
86
|
+
function le(e) {
|
|
86
87
|
const t = [
|
|
87
88
|
"bg-orange-100 text-orange-700",
|
|
88
89
|
"bg-blue-100 text-blue-700",
|
|
@@ -93,23 +94,23 @@ function ne(e) {
|
|
|
93
94
|
], r = e.charCodeAt(0) % t.length;
|
|
94
95
|
return t[r];
|
|
95
96
|
}
|
|
96
|
-
function
|
|
97
|
+
function He({
|
|
97
98
|
src: e,
|
|
98
99
|
alt: t = "",
|
|
99
100
|
name: r,
|
|
100
101
|
size: a = "md",
|
|
101
102
|
status: o,
|
|
102
103
|
className: s = "",
|
|
103
|
-
...
|
|
104
|
+
...c
|
|
104
105
|
}) {
|
|
105
|
-
return /* @__PURE__ */ l("div", { className: ["relative inline-flex shrink-0", s].filter(Boolean).join(" "), ...
|
|
106
|
+
return /* @__PURE__ */ l("div", { className: ["relative inline-flex shrink-0", s].filter(Boolean).join(" "), ...c, children: [
|
|
106
107
|
/* @__PURE__ */ n(
|
|
107
108
|
"div",
|
|
108
109
|
{
|
|
109
110
|
className: [
|
|
110
111
|
"rounded-full overflow-hidden flex items-center justify-center font-semibold",
|
|
111
|
-
|
|
112
|
-
!e && r ?
|
|
112
|
+
ne[a],
|
|
113
|
+
!e && r ? le(r) : "bg-surface-container"
|
|
113
114
|
].filter(Boolean).join(" "),
|
|
114
115
|
children: e ? /* @__PURE__ */ n(
|
|
115
116
|
"img",
|
|
@@ -118,7 +119,7 @@ function Se({
|
|
|
118
119
|
alt: t || r,
|
|
119
120
|
className: "w-full h-full object-cover"
|
|
120
121
|
}
|
|
121
|
-
) : r ?
|
|
122
|
+
) : r ? se(r) : /* @__PURE__ */ n("span", { className: "material-symbols-outlined text-on-surface-variant", style: { fontSize: "60%" }, children: "person" })
|
|
122
123
|
}
|
|
123
124
|
),
|
|
124
125
|
o && /* @__PURE__ */ n(
|
|
@@ -126,59 +127,59 @@ function Se({
|
|
|
126
127
|
{
|
|
127
128
|
className: [
|
|
128
129
|
"absolute bottom-0 right-0 rounded-full border-2 border-white",
|
|
129
|
-
|
|
130
|
-
|
|
130
|
+
ae[a],
|
|
131
|
+
oe[o]
|
|
131
132
|
].filter(Boolean).join(" ")
|
|
132
133
|
}
|
|
133
134
|
)
|
|
134
135
|
] });
|
|
135
136
|
}
|
|
136
|
-
const
|
|
137
|
+
const ie = {
|
|
137
138
|
default: "bg-surface-container text-on-surface-variant",
|
|
138
139
|
primary: "bg-orange-100 text-orange-700",
|
|
139
140
|
success: "bg-green-100 text-green-700",
|
|
140
141
|
warning: "bg-yellow-100 text-yellow-700",
|
|
141
142
|
danger: "bg-red-100 text-red-700",
|
|
142
143
|
info: "bg-blue-100 text-blue-700"
|
|
143
|
-
},
|
|
144
|
+
}, ce = {
|
|
144
145
|
default: "bg-on-surface-variant",
|
|
145
146
|
primary: "bg-orange-500",
|
|
146
147
|
success: "bg-green-500",
|
|
147
148
|
warning: "bg-yellow-500",
|
|
148
149
|
danger: "bg-red-500",
|
|
149
150
|
info: "bg-blue-500"
|
|
150
|
-
},
|
|
151
|
+
}, de = {
|
|
151
152
|
sm: "px-2 py-0.5 text-xs gap-1",
|
|
152
153
|
md: "px-2.5 py-1 text-xs gap-1.5"
|
|
153
154
|
};
|
|
154
|
-
function
|
|
155
|
+
function De({
|
|
155
156
|
variant: e = "default",
|
|
156
157
|
size: t = "md",
|
|
157
158
|
dot: r = !1,
|
|
158
159
|
icon: a,
|
|
159
160
|
children: o,
|
|
160
161
|
className: s = "",
|
|
161
|
-
...
|
|
162
|
+
...c
|
|
162
163
|
}) {
|
|
163
164
|
return /* @__PURE__ */ l(
|
|
164
165
|
"span",
|
|
165
166
|
{
|
|
166
167
|
className: [
|
|
167
168
|
"inline-flex items-center font-medium rounded-full",
|
|
168
|
-
|
|
169
|
-
|
|
169
|
+
ie[e],
|
|
170
|
+
de[t],
|
|
170
171
|
s
|
|
171
172
|
].filter(Boolean).join(" "),
|
|
172
|
-
...
|
|
173
|
+
...c,
|
|
173
174
|
children: [
|
|
174
|
-
r && /* @__PURE__ */ n("span", { className: `w-1.5 h-1.5 rounded-full shrink-0 ${
|
|
175
|
+
r && /* @__PURE__ */ n("span", { className: `w-1.5 h-1.5 rounded-full shrink-0 ${ce[e]}` }),
|
|
175
176
|
a && !r && /* @__PURE__ */ n("span", { className: "material-symbols-outlined text-[12px]", children: a }),
|
|
176
177
|
o
|
|
177
178
|
]
|
|
178
179
|
}
|
|
179
180
|
);
|
|
180
181
|
}
|
|
181
|
-
function
|
|
182
|
+
function Ge({ items: e, className: t = "", ...r }) {
|
|
182
183
|
return /* @__PURE__ */ n("nav", { "aria-label": "Breadcrumb", className: t, ...r, children: /* @__PURE__ */ n("ol", { className: "inline-flex items-center gap-1.5 text-sm flex-wrap", children: e.map((a, o) => {
|
|
183
184
|
const s = o === e.length - 1;
|
|
184
185
|
return /* @__PURE__ */ l("li", { className: "flex items-center gap-1.5", children: [
|
|
@@ -207,21 +208,21 @@ function Ee({ items: e, className: t = "", ...r }) {
|
|
|
207
208
|
] }, o);
|
|
208
209
|
}) }) });
|
|
209
210
|
}
|
|
210
|
-
const
|
|
211
|
+
const ue = {
|
|
211
212
|
primary: "bg-zeo-orange text-white hover:bg-orange-700 active:bg-orange-800 focus:shadow-zeo-focus border-transparent",
|
|
212
213
|
secondary: "bg-white text-on-surface border-outline-variant hover:bg-surface-container-low active:bg-surface-container focus:shadow-zeo-focus",
|
|
213
214
|
ghost: "bg-transparent text-on-surface-variant border-transparent hover:bg-surface-container-low active:bg-surface-container focus:shadow-zeo-focus",
|
|
214
215
|
danger: "bg-error text-on-error border-transparent hover:bg-red-700 active:bg-red-800 focus:shadow-[0_0_0_4px_rgba(186,26,26,0.15)]",
|
|
215
216
|
success: "bg-tertiary text-on-tertiary border-transparent hover:bg-green-800 active:bg-green-900 focus:shadow-[0_0_0_4px_rgba(0,108,73,0.15)]"
|
|
216
|
-
},
|
|
217
|
+
}, fe = {
|
|
217
218
|
sm: "px-3 py-1.5 text-sm gap-1.5 h-8",
|
|
218
219
|
md: "px-4 py-2 text-sm gap-2 h-10",
|
|
219
220
|
lg: "px-5 py-2.5 text-base gap-2 h-11"
|
|
220
|
-
},
|
|
221
|
+
}, E = {
|
|
221
222
|
sm: "text-[16px]",
|
|
222
223
|
md: "text-[18px]",
|
|
223
224
|
lg: "text-[20px]"
|
|
224
|
-
},
|
|
225
|
+
}, me = N(
|
|
225
226
|
({
|
|
226
227
|
variant: e = "primary",
|
|
227
228
|
size: t = "md",
|
|
@@ -229,41 +230,41 @@ const le = {
|
|
|
229
230
|
iconLeft: a,
|
|
230
231
|
iconRight: o,
|
|
231
232
|
fullWidth: s = !1,
|
|
232
|
-
disabled:
|
|
233
|
-
children:
|
|
234
|
-
className:
|
|
233
|
+
disabled: c,
|
|
234
|
+
children: i,
|
|
235
|
+
className: m = "",
|
|
235
236
|
...u
|
|
236
237
|
}, f) => /* @__PURE__ */ l(
|
|
237
238
|
"button",
|
|
238
239
|
{
|
|
239
240
|
ref: f,
|
|
240
|
-
disabled:
|
|
241
|
+
disabled: c || r,
|
|
241
242
|
className: [
|
|
242
243
|
"inline-flex items-center justify-center font-medium rounded border transition-all duration-200 select-none",
|
|
243
244
|
"focus:outline-none",
|
|
244
245
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
245
|
-
|
|
246
|
-
|
|
246
|
+
ue[e],
|
|
247
|
+
fe[t],
|
|
247
248
|
s ? "w-full" : "",
|
|
248
|
-
|
|
249
|
+
m
|
|
249
250
|
].filter(Boolean).join(" "),
|
|
250
251
|
...u,
|
|
251
252
|
children: [
|
|
252
253
|
r ? /* @__PURE__ */ n(
|
|
253
254
|
"span",
|
|
254
255
|
{
|
|
255
|
-
className: `material-symbols-outlined animate-spin ${
|
|
256
|
+
className: `material-symbols-outlined animate-spin ${E[t]}`,
|
|
256
257
|
children: "progress_activity"
|
|
257
258
|
}
|
|
258
|
-
) : a && /* @__PURE__ */ n("span", { className: `material-symbols-outlined ${
|
|
259
|
-
|
|
260
|
-
!r && o && /* @__PURE__ */ n("span", { className: `material-symbols-outlined ${
|
|
259
|
+
) : a && /* @__PURE__ */ n("span", { className: `material-symbols-outlined ${E[t]}`, children: a }),
|
|
260
|
+
i,
|
|
261
|
+
!r && o && /* @__PURE__ */ n("span", { className: `material-symbols-outlined ${E[t]}`, children: o })
|
|
261
262
|
]
|
|
262
263
|
}
|
|
263
264
|
)
|
|
264
265
|
);
|
|
265
|
-
|
|
266
|
-
function
|
|
266
|
+
me.displayName = "Button";
|
|
267
|
+
function Ue({ children: e, attached: t = !1, className: r = "", ...a }) {
|
|
267
268
|
return /* @__PURE__ */ n(
|
|
268
269
|
"div",
|
|
269
270
|
{
|
|
@@ -278,17 +279,17 @@ function Ae({ children: e, attached: t = !1, className: r = "", ...a }) {
|
|
|
278
279
|
}
|
|
279
280
|
);
|
|
280
281
|
}
|
|
281
|
-
const
|
|
282
|
+
const pe = {
|
|
282
283
|
elevated: "bg-white shadow-theme-lg border border-surface-container-high",
|
|
283
284
|
outlined: "bg-white border border-outline-variant",
|
|
284
285
|
filled: "bg-surface-container-low border border-transparent"
|
|
285
|
-
},
|
|
286
|
+
}, xe = {
|
|
286
287
|
none: "",
|
|
287
288
|
sm: "p-4",
|
|
288
289
|
md: "p-5",
|
|
289
290
|
lg: "p-6"
|
|
290
291
|
};
|
|
291
|
-
function
|
|
292
|
+
function Ve({
|
|
292
293
|
variant: e = "elevated",
|
|
293
294
|
padding: t = "md",
|
|
294
295
|
children: r,
|
|
@@ -300,15 +301,15 @@ function De({
|
|
|
300
301
|
{
|
|
301
302
|
className: [
|
|
302
303
|
"rounded-xl overflow-hidden",
|
|
303
|
-
|
|
304
|
+
pe[e],
|
|
304
305
|
a
|
|
305
306
|
].filter(Boolean).join(" "),
|
|
306
307
|
...o,
|
|
307
|
-
children: /* @__PURE__ */ n("div", { className:
|
|
308
|
+
children: /* @__PURE__ */ n("div", { className: xe[t], children: r })
|
|
308
309
|
}
|
|
309
310
|
);
|
|
310
311
|
}
|
|
311
|
-
function
|
|
312
|
+
function We({
|
|
312
313
|
title: e,
|
|
313
314
|
subtitle: t,
|
|
314
315
|
action: r,
|
|
@@ -334,7 +335,7 @@ function Re({
|
|
|
334
335
|
}
|
|
335
336
|
);
|
|
336
337
|
}
|
|
337
|
-
function
|
|
338
|
+
function qe({ children: e, className: t = "", ...r }) {
|
|
338
339
|
return /* @__PURE__ */ n(
|
|
339
340
|
"div",
|
|
340
341
|
{
|
|
@@ -344,58 +345,81 @@ function He({ children: e, className: t = "", ...r }) {
|
|
|
344
345
|
}
|
|
345
346
|
);
|
|
346
347
|
}
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
348
|
+
const _ = 8, G = 4;
|
|
349
|
+
function Oe({ trigger: e, items: t, align: r = "right", className: a = "", ...o }) {
|
|
350
|
+
const [s, c] = C(!1), [i, m] = C(null), u = M(null), f = M(null), p = B(() => {
|
|
351
|
+
var k;
|
|
352
|
+
const d = u.current;
|
|
353
|
+
if (!d) return;
|
|
354
|
+
const x = d.getBoundingClientRect(), h = (k = f.current) == null ? void 0 : k.getBoundingClientRect(), w = (h == null ? void 0 : h.width) ?? 180, b = (h == null ? void 0 : h.height) ?? 0, v = window.innerHeight - x.bottom, g = x.top, z = v < b + _ && g > v ? x.top - b - G : x.bottom + G, j = r === "right" ? x.right - w : x.left, L = window.innerWidth - w - _, T = Math.min(Math.max(j, _), Math.max(L, _));
|
|
355
|
+
m({ top: z, left: T });
|
|
356
|
+
}, [r]);
|
|
357
|
+
return P(() => {
|
|
358
|
+
s && p();
|
|
359
|
+
}, [s, p]), I(() => {
|
|
360
|
+
if (!s) return;
|
|
361
|
+
const d = () => p();
|
|
362
|
+
return window.addEventListener("scroll", d, !0), window.addEventListener("resize", d), () => {
|
|
363
|
+
window.removeEventListener("scroll", d, !0), window.removeEventListener("resize", d);
|
|
352
364
|
};
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
u.
|
|
365
|
+
}, [s, p]), I(() => {
|
|
366
|
+
const d = (x) => {
|
|
367
|
+
var v, g;
|
|
368
|
+
const h = x.target, w = (v = u.current) == null ? void 0 : v.contains(h), b = (g = f.current) == null ? void 0 : g.contains(h);
|
|
369
|
+
!w && !b && c(!1);
|
|
357
370
|
};
|
|
358
|
-
return document.addEventListener("
|
|
359
|
-
}, []),
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
371
|
+
return document.addEventListener("mousedown", d), () => document.removeEventListener("mousedown", d);
|
|
372
|
+
}, []), I(() => {
|
|
373
|
+
const d = (x) => {
|
|
374
|
+
x.key === "Escape" && c(!1);
|
|
375
|
+
};
|
|
376
|
+
return document.addEventListener("keydown", d), () => document.removeEventListener("keydown", d);
|
|
377
|
+
}, []), /* @__PURE__ */ l("div", { ref: u, className: ["relative inline-block", a].filter(Boolean).join(" "), ...o, children: [
|
|
378
|
+
/* @__PURE__ */ n("div", { onClick: () => c((d) => !d), children: e }),
|
|
379
|
+
s && te(
|
|
380
|
+
/* @__PURE__ */ n(
|
|
381
|
+
"div",
|
|
382
|
+
{
|
|
383
|
+
ref: f,
|
|
384
|
+
className: "fixed z-[100] min-w-[180px] bg-white border border-surface-container-high rounded-xl shadow-theme-lg py-1",
|
|
385
|
+
style: {
|
|
386
|
+
top: (i == null ? void 0 : i.top) ?? 0,
|
|
387
|
+
left: (i == null ? void 0 : i.left) ?? 0,
|
|
388
|
+
visibility: i ? "visible" : "hidden"
|
|
389
|
+
},
|
|
390
|
+
role: "menu",
|
|
391
|
+
children: t.map((d, x) => /* @__PURE__ */ l("div", { children: [
|
|
392
|
+
/* @__PURE__ */ l(
|
|
393
|
+
"button",
|
|
394
|
+
{
|
|
395
|
+
role: "menuitem",
|
|
396
|
+
disabled: d.disabled,
|
|
397
|
+
onClick: () => {
|
|
398
|
+
var h;
|
|
399
|
+
d.disabled || ((h = d.onClick) == null || h.call(d), c(!1));
|
|
400
|
+
},
|
|
401
|
+
className: [
|
|
402
|
+
"w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-colors text-left",
|
|
403
|
+
d.danger ? "text-error hover:bg-red-50" : "text-on-surface hover:bg-surface-container-low",
|
|
404
|
+
d.disabled ? "opacity-40 cursor-not-allowed" : "cursor-pointer"
|
|
405
|
+
].filter(Boolean).join(" "),
|
|
406
|
+
children: [
|
|
407
|
+
d.icon && /* @__PURE__ */ n("span", { className: "material-symbols-outlined text-[18px] opacity-70", children: d.icon }),
|
|
408
|
+
d.label
|
|
409
|
+
]
|
|
410
|
+
}
|
|
411
|
+
),
|
|
412
|
+
d.dividerAfter && /* @__PURE__ */ n("div", { className: "my-1 border-t border-surface-container-high" })
|
|
413
|
+
] }, x))
|
|
414
|
+
}
|
|
415
|
+
),
|
|
416
|
+
document.body
|
|
393
417
|
)
|
|
394
418
|
] });
|
|
395
419
|
}
|
|
396
|
-
const
|
|
397
|
-
({ label: e, hint: t, error: r, options: a, placeholder: o, disabled: s, className:
|
|
398
|
-
const f =
|
|
420
|
+
const he = N(
|
|
421
|
+
({ label: e, hint: t, error: r, options: a, placeholder: o, disabled: s, className: c = "", id: i, ...m }, u) => {
|
|
422
|
+
const f = i ?? (e == null ? void 0 : e.toLowerCase().replace(/\s+/g, "-"));
|
|
399
423
|
return /* @__PURE__ */ l("div", { className: "flex flex-col gap-1.5", children: [
|
|
400
424
|
e && /* @__PURE__ */ n("label", { htmlFor: f, className: "text-sm font-medium text-on-surface", children: e }),
|
|
401
425
|
/* @__PURE__ */ l("div", { className: "relative", children: [
|
|
@@ -410,12 +434,12 @@ const fe = b(
|
|
|
410
434
|
"text-on-surface focus:outline-none focus:border-zeo-orange focus:shadow-zeo-focus",
|
|
411
435
|
r ? "border-error" : "border-outline-variant",
|
|
412
436
|
"disabled:bg-surface-container-low disabled:cursor-not-allowed disabled:opacity-60",
|
|
413
|
-
|
|
437
|
+
c
|
|
414
438
|
].filter(Boolean).join(" "),
|
|
415
|
-
...
|
|
439
|
+
...m,
|
|
416
440
|
children: [
|
|
417
441
|
o && /* @__PURE__ */ n("option", { value: "", disabled: !0, children: o }),
|
|
418
|
-
a.map((
|
|
442
|
+
a.map((p) => /* @__PURE__ */ n("option", { value: p.value, disabled: p.disabled, children: p.label }, p.value))
|
|
419
443
|
]
|
|
420
444
|
}
|
|
421
445
|
),
|
|
@@ -429,18 +453,18 @@ const fe = b(
|
|
|
429
453
|
] });
|
|
430
454
|
}
|
|
431
455
|
);
|
|
432
|
-
|
|
433
|
-
const
|
|
434
|
-
({ label: e, hint: t, error: r, disabled: a, className: o = "", id: s, rows:
|
|
456
|
+
he.displayName = "Select";
|
|
457
|
+
const be = N(
|
|
458
|
+
({ label: e, hint: t, error: r, disabled: a, className: o = "", id: s, rows: c = 4, ...i }, m) => {
|
|
435
459
|
const u = s ?? (e == null ? void 0 : e.toLowerCase().replace(/\s+/g, "-"));
|
|
436
460
|
return /* @__PURE__ */ l("div", { className: "flex flex-col gap-1.5", children: [
|
|
437
461
|
e && /* @__PURE__ */ n("label", { htmlFor: u, className: "text-sm font-medium text-on-surface", children: e }),
|
|
438
462
|
/* @__PURE__ */ n(
|
|
439
463
|
"textarea",
|
|
440
464
|
{
|
|
441
|
-
ref:
|
|
465
|
+
ref: m,
|
|
442
466
|
id: u,
|
|
443
|
-
rows:
|
|
467
|
+
rows: c,
|
|
444
468
|
disabled: a,
|
|
445
469
|
className: [
|
|
446
470
|
"w-full bg-white border rounded px-3 py-2 text-sm resize-y transition-all duration-200",
|
|
@@ -450,7 +474,7 @@ const me = b(
|
|
|
450
474
|
"disabled:bg-surface-container-low disabled:cursor-not-allowed disabled:opacity-60",
|
|
451
475
|
o
|
|
452
476
|
].filter(Boolean).join(" "),
|
|
453
|
-
...
|
|
477
|
+
...i
|
|
454
478
|
}
|
|
455
479
|
),
|
|
456
480
|
r && /* @__PURE__ */ l("p", { className: "text-xs text-error flex items-center gap-1", children: [
|
|
@@ -461,13 +485,13 @@ const me = b(
|
|
|
461
485
|
] });
|
|
462
486
|
}
|
|
463
487
|
);
|
|
464
|
-
|
|
465
|
-
const
|
|
488
|
+
be.displayName = "Textarea";
|
|
489
|
+
const ge = {
|
|
466
490
|
square: "rounded-[2px]",
|
|
467
491
|
rounded: "rounded-[4px]",
|
|
468
492
|
circle: "rounded-full"
|
|
469
|
-
},
|
|
470
|
-
({ label: e, description: t, error: r, disabled: a, className: o = "", id: s, shape:
|
|
493
|
+
}, we = N(
|
|
494
|
+
({ label: e, description: t, error: r, disabled: a, className: o = "", id: s, shape: c = "square", color: i = "#FF6B00", ...m }, u) => {
|
|
471
495
|
const f = s ?? `checkbox-${e == null ? void 0 : e.toLowerCase().replace(/\s+/g, "-")}`;
|
|
472
496
|
return /* @__PURE__ */ l("div", { className: "flex flex-col gap-1", children: [
|
|
473
497
|
/* @__PURE__ */ l(
|
|
@@ -491,7 +515,7 @@ const pe = {
|
|
|
491
515
|
"absolute inset-0 w-full h-full opacity-0 cursor-pointer peer disabled:cursor-not-allowed",
|
|
492
516
|
o
|
|
493
517
|
].filter(Boolean).join(" "),
|
|
494
|
-
...
|
|
518
|
+
...m
|
|
495
519
|
}
|
|
496
520
|
),
|
|
497
521
|
/* @__PURE__ */ n(
|
|
@@ -501,9 +525,9 @@ const pe = {
|
|
|
501
525
|
"w-4 h-4 border-2 border-outline-variant transition-colors pointer-events-none",
|
|
502
526
|
"bg-white peer-checked:bg-[var(--cb-color)] peer-checked:border-[var(--cb-color)]",
|
|
503
527
|
"peer-focus-visible:ring-2 peer-focus-visible:ring-[var(--cb-color)]/30 peer-focus-visible:ring-offset-0",
|
|
504
|
-
|
|
528
|
+
ge[c]
|
|
505
529
|
].filter(Boolean).join(" "),
|
|
506
|
-
style: { "--cb-color":
|
|
530
|
+
style: { "--cb-color": i }
|
|
507
531
|
}
|
|
508
532
|
),
|
|
509
533
|
/* @__PURE__ */ n(
|
|
@@ -542,14 +566,14 @@ const pe = {
|
|
|
542
566
|
] });
|
|
543
567
|
}
|
|
544
568
|
);
|
|
545
|
-
|
|
546
|
-
const
|
|
547
|
-
({ label: e, description: t, disabled: r, className: a = "", id: o, ...s },
|
|
548
|
-
const
|
|
569
|
+
we.displayName = "Checkbox";
|
|
570
|
+
const ve = N(
|
|
571
|
+
({ label: e, description: t, disabled: r, className: a = "", id: o, ...s }, c) => {
|
|
572
|
+
const i = o ?? `radio-${e == null ? void 0 : e.toLowerCase().replace(/\s+/g, "-")}`;
|
|
549
573
|
return /* @__PURE__ */ l(
|
|
550
574
|
"label",
|
|
551
575
|
{
|
|
552
|
-
htmlFor:
|
|
576
|
+
htmlFor: i,
|
|
553
577
|
className: [
|
|
554
578
|
"flex items-start gap-3 cursor-pointer",
|
|
555
579
|
r ? "opacity-50 cursor-not-allowed" : ""
|
|
@@ -558,9 +582,9 @@ const he = b(
|
|
|
558
582
|
/* @__PURE__ */ n(
|
|
559
583
|
"input",
|
|
560
584
|
{
|
|
561
|
-
ref:
|
|
585
|
+
ref: c,
|
|
562
586
|
type: "radio",
|
|
563
|
-
id:
|
|
587
|
+
id: i,
|
|
564
588
|
disabled: r,
|
|
565
589
|
className: [
|
|
566
590
|
"mt-0.5 w-4 h-4 border-outline-variant text-zeo-orange shrink-0",
|
|
@@ -580,14 +604,14 @@ const he = b(
|
|
|
580
604
|
);
|
|
581
605
|
}
|
|
582
606
|
);
|
|
583
|
-
|
|
584
|
-
const
|
|
585
|
-
({ label: e, description: t, disabled: r, className: a = "", id: o, ...s },
|
|
586
|
-
const
|
|
607
|
+
ve.displayName = "Radio";
|
|
608
|
+
const ye = N(
|
|
609
|
+
({ label: e, description: t, disabled: r, className: a = "", id: o, ...s }, c) => {
|
|
610
|
+
const i = o ?? `switch-${e == null ? void 0 : e.toLowerCase().replace(/\s+/g, "-")}`;
|
|
587
611
|
return /* @__PURE__ */ l(
|
|
588
612
|
"label",
|
|
589
613
|
{
|
|
590
|
-
htmlFor:
|
|
614
|
+
htmlFor: i,
|
|
591
615
|
className: [
|
|
592
616
|
"flex items-start gap-3 cursor-pointer select-none",
|
|
593
617
|
r ? "opacity-50 cursor-not-allowed" : ""
|
|
@@ -597,9 +621,9 @@ const be = b(
|
|
|
597
621
|
/* @__PURE__ */ n(
|
|
598
622
|
"input",
|
|
599
623
|
{
|
|
600
|
-
ref:
|
|
624
|
+
ref: c,
|
|
601
625
|
type: "checkbox",
|
|
602
|
-
id:
|
|
626
|
+
id: i,
|
|
603
627
|
disabled: r,
|
|
604
628
|
className: "sr-only peer",
|
|
605
629
|
...s
|
|
@@ -617,16 +641,16 @@ const be = b(
|
|
|
617
641
|
);
|
|
618
642
|
}
|
|
619
643
|
);
|
|
620
|
-
|
|
621
|
-
const
|
|
644
|
+
ye.displayName = "Switch";
|
|
645
|
+
const Ne = {
|
|
622
646
|
sm: "px-3 py-1.5 text-sm h-8",
|
|
623
647
|
md: "px-3 py-2 text-sm h-10",
|
|
624
648
|
lg: "px-4 py-2.5 text-base h-11"
|
|
625
|
-
},
|
|
649
|
+
}, U = {
|
|
626
650
|
sm: "text-[16px]",
|
|
627
651
|
md: "text-[18px]",
|
|
628
652
|
lg: "text-[20px]"
|
|
629
|
-
},
|
|
653
|
+
}, je = N(
|
|
630
654
|
({
|
|
631
655
|
label: e,
|
|
632
656
|
hint: t,
|
|
@@ -634,18 +658,18 @@ const ge = {
|
|
|
634
658
|
inputSize: a = "md",
|
|
635
659
|
iconLeft: o,
|
|
636
660
|
iconRight: s,
|
|
637
|
-
onIconRightClick:
|
|
638
|
-
disabled:
|
|
639
|
-
className:
|
|
661
|
+
onIconRightClick: c,
|
|
662
|
+
disabled: i,
|
|
663
|
+
className: m = "",
|
|
640
664
|
id: u,
|
|
641
665
|
...f
|
|
642
|
-
},
|
|
643
|
-
const
|
|
666
|
+
}, p) => {
|
|
667
|
+
const d = u ?? (e == null ? void 0 : e.toLowerCase().replace(/\s+/g, "-"));
|
|
644
668
|
return /* @__PURE__ */ l("div", { className: "flex flex-col gap-1.5", children: [
|
|
645
669
|
e && /* @__PURE__ */ n(
|
|
646
670
|
"label",
|
|
647
671
|
{
|
|
648
|
-
htmlFor:
|
|
672
|
+
htmlFor: d,
|
|
649
673
|
className: "text-sm font-medium text-on-surface",
|
|
650
674
|
children: e
|
|
651
675
|
}
|
|
@@ -654,26 +678,26 @@ const ge = {
|
|
|
654
678
|
o && /* @__PURE__ */ n(
|
|
655
679
|
"span",
|
|
656
680
|
{
|
|
657
|
-
className: `material-symbols-outlined absolute left-3 text-on-surface-variant pointer-events-none ${
|
|
681
|
+
className: `material-symbols-outlined absolute left-3 text-on-surface-variant pointer-events-none ${U[a]}`,
|
|
658
682
|
children: o
|
|
659
683
|
}
|
|
660
684
|
),
|
|
661
685
|
/* @__PURE__ */ n(
|
|
662
686
|
"input",
|
|
663
687
|
{
|
|
664
|
-
ref:
|
|
665
|
-
id:
|
|
666
|
-
disabled:
|
|
688
|
+
ref: p,
|
|
689
|
+
id: d,
|
|
690
|
+
disabled: i,
|
|
667
691
|
className: [
|
|
668
692
|
"w-full bg-white border rounded transition-all duration-200",
|
|
669
693
|
"text-on-surface placeholder:text-on-surface-variant",
|
|
670
694
|
"focus:outline-none focus:border-zeo-orange focus:shadow-zeo-focus",
|
|
671
695
|
r ? "border-error focus:border-error focus:shadow-[0_0_0_4px_rgba(186,26,26,0.15)]" : "border-outline-variant",
|
|
672
696
|
"disabled:bg-surface-container-low disabled:cursor-not-allowed disabled:opacity-60",
|
|
673
|
-
|
|
697
|
+
Ne[a],
|
|
674
698
|
o ? "pl-9" : "",
|
|
675
699
|
s ? "pr-9" : "",
|
|
676
|
-
|
|
700
|
+
m
|
|
677
701
|
].filter(Boolean).join(" "),
|
|
678
702
|
...f
|
|
679
703
|
}
|
|
@@ -683,10 +707,10 @@ const ge = {
|
|
|
683
707
|
{
|
|
684
708
|
className: [
|
|
685
709
|
"material-symbols-outlined absolute right-3 text-on-surface-variant",
|
|
686
|
-
|
|
687
|
-
|
|
710
|
+
U[a],
|
|
711
|
+
c ? "cursor-pointer hover:text-on-surface" : "pointer-events-none"
|
|
688
712
|
].filter(Boolean).join(" "),
|
|
689
|
-
onClick:
|
|
713
|
+
onClick: c,
|
|
690
714
|
children: s
|
|
691
715
|
}
|
|
692
716
|
)
|
|
@@ -699,16 +723,16 @@ const ge = {
|
|
|
699
723
|
] });
|
|
700
724
|
}
|
|
701
725
|
);
|
|
702
|
-
|
|
703
|
-
const
|
|
726
|
+
je.displayName = "Input";
|
|
727
|
+
const ke = {
|
|
704
728
|
sm: "max-w-sm",
|
|
705
729
|
md: "max-w-md",
|
|
706
730
|
lg: "max-w-lg",
|
|
707
731
|
xl: "max-w-2xl",
|
|
708
732
|
full: "max-w-[calc(100vw-2rem)]"
|
|
709
733
|
};
|
|
710
|
-
function
|
|
711
|
-
return
|
|
734
|
+
function Ke({ open: e, onClose: t, size: r = "md", children: a }) {
|
|
735
|
+
return I(() => {
|
|
712
736
|
if (!e) return;
|
|
713
737
|
const o = (s) => {
|
|
714
738
|
s.key === "Escape" && t();
|
|
@@ -734,7 +758,7 @@ function qe({ open: e, onClose: t, size: r = "md", children: a }) {
|
|
|
734
758
|
{
|
|
735
759
|
className: [
|
|
736
760
|
"relative w-full bg-white rounded-2xl shadow-theme-lg z-10 flex flex-col max-h-[90vh]",
|
|
737
|
-
|
|
761
|
+
ke[r]
|
|
738
762
|
].filter(Boolean).join(" "),
|
|
739
763
|
children: a
|
|
740
764
|
}
|
|
@@ -743,7 +767,7 @@ function qe({ open: e, onClose: t, size: r = "md", children: a }) {
|
|
|
743
767
|
}
|
|
744
768
|
) : null;
|
|
745
769
|
}
|
|
746
|
-
function
|
|
770
|
+
function Je({ title: e, subtitle: t, onClose: r, className: a = "", ...o }) {
|
|
747
771
|
return /* @__PURE__ */ l(
|
|
748
772
|
"div",
|
|
749
773
|
{
|
|
@@ -767,7 +791,7 @@ function Ue({ title: e, subtitle: t, onClose: r, className: a = "", ...o }) {
|
|
|
767
791
|
}
|
|
768
792
|
);
|
|
769
793
|
}
|
|
770
|
-
function
|
|
794
|
+
function Qe({ children: e, className: t = "", ...r }) {
|
|
771
795
|
return /* @__PURE__ */ n(
|
|
772
796
|
"div",
|
|
773
797
|
{
|
|
@@ -777,7 +801,7 @@ function Ge({ children: e, className: t = "", ...r }) {
|
|
|
777
801
|
}
|
|
778
802
|
);
|
|
779
803
|
}
|
|
780
|
-
function
|
|
804
|
+
function Xe({ children: e, className: t = "", ...r }) {
|
|
781
805
|
return /* @__PURE__ */ n(
|
|
782
806
|
"div",
|
|
783
807
|
{
|
|
@@ -790,25 +814,25 @@ function Ke({ children: e, className: t = "", ...r }) {
|
|
|
790
814
|
}
|
|
791
815
|
);
|
|
792
816
|
}
|
|
793
|
-
function
|
|
817
|
+
function Be(e, t) {
|
|
794
818
|
return t <= 7 ? Array.from({ length: t }, (r, a) => a + 1) : e <= 4 ? [1, 2, 3, 4, 5, "...", t] : e >= t - 3 ? [1, "...", t - 4, t - 3, t - 2, t - 1, t] : [1, "...", e - 1, e, e + 1, "...", t];
|
|
795
819
|
}
|
|
796
|
-
function
|
|
820
|
+
function Ye({
|
|
797
821
|
currentPage: e,
|
|
798
822
|
totalPages: t,
|
|
799
823
|
totalItems: r,
|
|
800
824
|
itemsPerPage: a = 10,
|
|
801
825
|
onPageChange: o,
|
|
802
826
|
variant: s = "full",
|
|
803
|
-
className:
|
|
804
|
-
...
|
|
827
|
+
className: c = "",
|
|
828
|
+
...i
|
|
805
829
|
}) {
|
|
806
|
-
const
|
|
830
|
+
const m = Be(e, t), u = (e - 1) * a + 1, f = Math.min(e * a, r ?? e * a), p = "inline-flex items-center justify-center text-sm font-medium rounded transition-all duration-150 focus:outline-none focus:ring-2 focus:ring-zeo-orange/30 disabled:opacity-40 disabled:cursor-not-allowed select-none", d = `${p} w-9 h-9`, x = "bg-zeo-orange text-white", h = "text-on-surface-variant hover:bg-surface-container-low hover:text-on-surface", w = `${p} px-3 h-9 gap-1.5 border border-surface-container-high text-on-surface-variant hover:bg-surface-container-low hover:text-on-surface`;
|
|
807
831
|
return /* @__PURE__ */ l(
|
|
808
832
|
"div",
|
|
809
833
|
{
|
|
810
|
-
className: ["flex items-center justify-between gap-4 flex-wrap",
|
|
811
|
-
...
|
|
834
|
+
className: ["flex items-center justify-between gap-4 flex-wrap", c].filter(Boolean).join(" "),
|
|
835
|
+
...i,
|
|
812
836
|
children: [
|
|
813
837
|
s === "full" && r !== void 0 && /* @__PURE__ */ l("p", { className: "text-sm text-on-surface-variant", children: [
|
|
814
838
|
"Mostrando ",
|
|
@@ -828,23 +852,23 @@ function Oe({
|
|
|
828
852
|
onClick: () => o(e - 1),
|
|
829
853
|
disabled: e === 1,
|
|
830
854
|
"aria-label": "Página anterior",
|
|
831
|
-
className: s === "icon" ?
|
|
855
|
+
className: s === "icon" ? d + " " + h : w,
|
|
832
856
|
children: [
|
|
833
857
|
/* @__PURE__ */ n("span", { className: "material-symbols-outlined text-[18px]", children: "arrow_back" }),
|
|
834
858
|
s === "text" && "Anterior"
|
|
835
859
|
]
|
|
836
860
|
}
|
|
837
861
|
),
|
|
838
|
-
|
|
839
|
-
(
|
|
862
|
+
m.map(
|
|
863
|
+
(b, v) => b === "..." ? /* @__PURE__ */ n("span", { className: "w-9 text-center text-sm text-on-surface-variant select-none", children: "…" }, `ellipsis-${v}`) : /* @__PURE__ */ n(
|
|
840
864
|
"button",
|
|
841
865
|
{
|
|
842
|
-
onClick: () => o(
|
|
843
|
-
"aria-current": e ===
|
|
844
|
-
className: [
|
|
845
|
-
children:
|
|
866
|
+
onClick: () => o(b),
|
|
867
|
+
"aria-current": e === b ? "page" : void 0,
|
|
868
|
+
className: [d, e === b ? x : h].join(" "),
|
|
869
|
+
children: b
|
|
846
870
|
},
|
|
847
|
-
|
|
871
|
+
b
|
|
848
872
|
)
|
|
849
873
|
),
|
|
850
874
|
/* @__PURE__ */ l(
|
|
@@ -853,7 +877,7 @@ function Oe({
|
|
|
853
877
|
onClick: () => o(e + 1),
|
|
854
878
|
disabled: e === t,
|
|
855
879
|
"aria-label": "Próxima página",
|
|
856
|
-
className: s === "icon" ?
|
|
880
|
+
className: s === "icon" ? d + " " + h : w,
|
|
857
881
|
children: [
|
|
858
882
|
s === "text" && "Próxima",
|
|
859
883
|
/* @__PURE__ */ n("span", { className: "material-symbols-outlined text-[18px]", children: "arrow_forward" })
|
|
@@ -865,32 +889,32 @@ function Oe({
|
|
|
865
889
|
}
|
|
866
890
|
);
|
|
867
891
|
}
|
|
868
|
-
const
|
|
892
|
+
const Ce = {
|
|
869
893
|
xs: "h-1",
|
|
870
894
|
sm: "h-1.5",
|
|
871
895
|
md: "h-2",
|
|
872
896
|
lg: "h-3"
|
|
873
|
-
},
|
|
897
|
+
}, ze = {
|
|
874
898
|
primary: "bg-zeo-orange",
|
|
875
899
|
success: "bg-green-500",
|
|
876
900
|
warning: "bg-amber-400",
|
|
877
901
|
danger: "bg-red-500"
|
|
878
902
|
};
|
|
879
|
-
function
|
|
903
|
+
function Ze({
|
|
880
904
|
value: e,
|
|
881
905
|
max: t = 100,
|
|
882
906
|
size: r = "md",
|
|
883
907
|
variant: a = "primary",
|
|
884
908
|
label: o = "none",
|
|
885
909
|
showPercent: s = !0,
|
|
886
|
-
title:
|
|
887
|
-
className:
|
|
888
|
-
...
|
|
910
|
+
title: c,
|
|
911
|
+
className: i = "",
|
|
912
|
+
...m
|
|
889
913
|
}) {
|
|
890
914
|
const u = Math.min(100, Math.max(0, e / t * 100)), f = `${Math.round(u)}%`;
|
|
891
|
-
return /* @__PURE__ */ l("div", { className: ["flex flex-col gap-1.5",
|
|
892
|
-
(
|
|
893
|
-
|
|
915
|
+
return /* @__PURE__ */ l("div", { className: ["flex flex-col gap-1.5", i].filter(Boolean).join(" "), ...m, children: [
|
|
916
|
+
(c || o === "outside" && s) && /* @__PURE__ */ l("div", { className: "flex items-center justify-between gap-2", children: [
|
|
917
|
+
c && /* @__PURE__ */ n("span", { className: "text-sm font-medium text-on-surface", children: c }),
|
|
894
918
|
o === "outside" && s && /* @__PURE__ */ n("span", { className: "text-sm font-semibold text-on-surface", children: f })
|
|
895
919
|
] }),
|
|
896
920
|
/* @__PURE__ */ n(
|
|
@@ -900,13 +924,13 @@ function We({
|
|
|
900
924
|
"aria-valuenow": e,
|
|
901
925
|
"aria-valuemin": 0,
|
|
902
926
|
"aria-valuemax": t,
|
|
903
|
-
className: ["relative w-full bg-surface-container-high rounded-full overflow-hidden",
|
|
927
|
+
className: ["relative w-full bg-surface-container-high rounded-full overflow-hidden", Ce[r]].join(" "),
|
|
904
928
|
children: /* @__PURE__ */ n(
|
|
905
929
|
"div",
|
|
906
930
|
{
|
|
907
931
|
className: [
|
|
908
932
|
"h-full rounded-full transition-all duration-500 flex items-center justify-end pr-1",
|
|
909
|
-
|
|
933
|
+
ze[a]
|
|
910
934
|
].join(" "),
|
|
911
935
|
style: { width: `${u}%` },
|
|
912
936
|
children: o === "inside" && s && u >= 20 && /* @__PURE__ */ n("span", { className: "text-[10px] font-bold text-white leading-none", children: f })
|
|
@@ -916,18 +940,18 @@ function We({
|
|
|
916
940
|
)
|
|
917
941
|
] });
|
|
918
942
|
}
|
|
919
|
-
const
|
|
943
|
+
const $e = {
|
|
920
944
|
xs: "w-3 h-3 border",
|
|
921
945
|
sm: "w-4 h-4 border-2",
|
|
922
946
|
md: "w-6 h-6 border-2",
|
|
923
947
|
lg: "w-8 h-8 border-[3px]",
|
|
924
948
|
xl: "w-12 h-12 border-4"
|
|
925
|
-
},
|
|
949
|
+
}, _e = {
|
|
926
950
|
primary: "border-orange-200 border-t-zeo-orange",
|
|
927
951
|
secondary: "border-surface-container-high border-t-on-surface-variant",
|
|
928
952
|
white: "border-white/30 border-t-white"
|
|
929
953
|
};
|
|
930
|
-
function
|
|
954
|
+
function Pe({
|
|
931
955
|
size: e = "md",
|
|
932
956
|
variant: t = "primary",
|
|
933
957
|
label: r = "Carregando...",
|
|
@@ -941,15 +965,15 @@ function Je({
|
|
|
941
965
|
"aria-label": r,
|
|
942
966
|
className: [
|
|
943
967
|
"inline-block rounded-full animate-spin",
|
|
944
|
-
|
|
945
|
-
|
|
968
|
+
$e[e],
|
|
969
|
+
_e[t],
|
|
946
970
|
a
|
|
947
971
|
].filter(Boolean).join(" "),
|
|
948
972
|
...o
|
|
949
973
|
}
|
|
950
974
|
);
|
|
951
975
|
}
|
|
952
|
-
function
|
|
976
|
+
function et({ children: e, className: t = "", ...r }) {
|
|
953
977
|
return /* @__PURE__ */ n(
|
|
954
978
|
"div",
|
|
955
979
|
{
|
|
@@ -959,7 +983,7 @@ function Qe({ children: e, className: t = "", ...r }) {
|
|
|
959
983
|
}
|
|
960
984
|
);
|
|
961
985
|
}
|
|
962
|
-
function
|
|
986
|
+
function tt({ children: e, className: t = "", ...r }) {
|
|
963
987
|
return /* @__PURE__ */ n(
|
|
964
988
|
"thead",
|
|
965
989
|
{
|
|
@@ -969,7 +993,7 @@ function Xe({ children: e, className: t = "", ...r }) {
|
|
|
969
993
|
}
|
|
970
994
|
);
|
|
971
995
|
}
|
|
972
|
-
function
|
|
996
|
+
function rt({ children: e, className: t = "", ...r }) {
|
|
973
997
|
return /* @__PURE__ */ n(
|
|
974
998
|
"tbody",
|
|
975
999
|
{
|
|
@@ -979,7 +1003,7 @@ function Ye({ children: e, className: t = "", ...r }) {
|
|
|
979
1003
|
}
|
|
980
1004
|
);
|
|
981
1005
|
}
|
|
982
|
-
function
|
|
1006
|
+
function nt({ selected: e = !1, children: t, className: r = "", ...a }) {
|
|
983
1007
|
return /* @__PURE__ */ n(
|
|
984
1008
|
"tr",
|
|
985
1009
|
{
|
|
@@ -993,7 +1017,7 @@ function Ze({ selected: e = !1, children: t, className: r = "", ...a }) {
|
|
|
993
1017
|
}
|
|
994
1018
|
);
|
|
995
1019
|
}
|
|
996
|
-
function
|
|
1020
|
+
function at({
|
|
997
1021
|
sortable: e = !1,
|
|
998
1022
|
sorted: t = !1,
|
|
999
1023
|
onSort: r,
|
|
@@ -1024,7 +1048,7 @@ function Pe({
|
|
|
1024
1048
|
}
|
|
1025
1049
|
);
|
|
1026
1050
|
}
|
|
1027
|
-
function
|
|
1051
|
+
function ot({ muted: e = !1, mono: t = !1, children: r, className: a = "", ...o }) {
|
|
1028
1052
|
return /* @__PURE__ */ n(
|
|
1029
1053
|
"td",
|
|
1030
1054
|
{
|
|
@@ -1039,23 +1063,23 @@ function et({ muted: e = !1, mono: t = !1, children: r, className: a = "", ...o
|
|
|
1039
1063
|
}
|
|
1040
1064
|
);
|
|
1041
1065
|
}
|
|
1042
|
-
const
|
|
1043
|
-
function
|
|
1044
|
-
const e =
|
|
1066
|
+
const q = V(null);
|
|
1067
|
+
function R() {
|
|
1068
|
+
const e = W(q);
|
|
1045
1069
|
if (!e) throw new Error("Tab must be used inside Tabs");
|
|
1046
1070
|
return e;
|
|
1047
1071
|
}
|
|
1048
|
-
const
|
|
1049
|
-
function
|
|
1050
|
-
return /* @__PURE__ */ n(
|
|
1072
|
+
const O = V({ stretch: !1 });
|
|
1073
|
+
function st({ value: e, onChange: t, variant: r = "default", children: a }) {
|
|
1074
|
+
return /* @__PURE__ */ n(q.Provider, { value: { active: e, onChange: t, variant: r }, children: /* @__PURE__ */ n("div", { className: r === "vertical" ? "flex gap-6" : "flex flex-col gap-4", children: a }) });
|
|
1051
1075
|
}
|
|
1052
|
-
function
|
|
1053
|
-
const { variant: o } =
|
|
1076
|
+
function lt({ children: e, className: t = "", stretch: r = !1, ...a }) {
|
|
1077
|
+
const { variant: o } = R(), s = {
|
|
1054
1078
|
default: r ? "flex gap-1 bg-surface-container-low rounded-lg p-1 w-full" : "flex gap-1 bg-surface-container-low rounded-lg p-1 w-fit",
|
|
1055
1079
|
underline: "flex gap-0 border-b border-surface-container-high w-full",
|
|
1056
1080
|
vertical: "flex flex-col gap-1 bg-surface-container-low rounded-lg p-1 w-48 shrink-0 h-fit"
|
|
1057
1081
|
}[o];
|
|
1058
|
-
return /* @__PURE__ */ n(
|
|
1082
|
+
return /* @__PURE__ */ n(O.Provider, { value: { stretch: r }, children: /* @__PURE__ */ n(
|
|
1059
1083
|
"div",
|
|
1060
1084
|
{
|
|
1061
1085
|
role: "tablist",
|
|
@@ -1065,12 +1089,12 @@ function rt({ children: e, className: t = "", stretch: r = !1, ...a }) {
|
|
|
1065
1089
|
}
|
|
1066
1090
|
) });
|
|
1067
1091
|
}
|
|
1068
|
-
function
|
|
1069
|
-
const { active: s, onChange:
|
|
1092
|
+
function it({ value: e, label: t, icon: r, badge: a, disabled: o = !1 }) {
|
|
1093
|
+
const { active: s, onChange: c, variant: i } = R(), { stretch: m } = W(O), u = s === e, f = "inline-flex items-center gap-2 font-medium text-sm transition-all duration-200 select-none focus:outline-none", p = "opacity-40 cursor-not-allowed pointer-events-none", d = m && i !== "vertical" ? "flex-1 justify-center" : "", x = {
|
|
1070
1094
|
default: u ? "bg-white text-on-surface shadow-sm rounded-md px-4 py-2" : "text-on-surface-variant hover:text-on-surface rounded-md px-4 py-2",
|
|
1071
1095
|
underline: u ? "text-zeo-orange border-b-2 border-zeo-orange px-4 py-2.5 -mb-px" : "text-on-surface-variant hover:text-on-surface border-b-2 border-transparent px-4 py-2.5 -mb-px",
|
|
1072
1096
|
vertical: u ? "bg-white text-on-surface shadow-sm rounded-md px-4 py-2 w-full" : "text-on-surface-variant hover:text-on-surface rounded-md px-4 py-2 w-full"
|
|
1073
|
-
}[
|
|
1097
|
+
}[i];
|
|
1074
1098
|
return /* @__PURE__ */ l(
|
|
1075
1099
|
"button",
|
|
1076
1100
|
{
|
|
@@ -1078,8 +1102,8 @@ function nt({ value: e, label: t, icon: r, badge: a, disabled: o = !1 }) {
|
|
|
1078
1102
|
"aria-selected": u,
|
|
1079
1103
|
"aria-disabled": o,
|
|
1080
1104
|
disabled: o,
|
|
1081
|
-
onClick: () => !o &&
|
|
1082
|
-
className: [f,
|
|
1105
|
+
onClick: () => !o && c(e),
|
|
1106
|
+
className: [f, x, d, o ? p : ""].filter(Boolean).join(" "),
|
|
1083
1107
|
children: [
|
|
1084
1108
|
r && /* @__PURE__ */ n(
|
|
1085
1109
|
"span",
|
|
@@ -1101,8 +1125,8 @@ function nt({ value: e, label: t, icon: r, badge: a, disabled: o = !1 }) {
|
|
|
1101
1125
|
}
|
|
1102
1126
|
);
|
|
1103
1127
|
}
|
|
1104
|
-
function
|
|
1105
|
-
const { active: o } =
|
|
1128
|
+
function ct({ value: e, children: t, className: r = "", stretch: a = !1 }) {
|
|
1129
|
+
const { active: o } = R();
|
|
1106
1130
|
return o !== e ? null : /* @__PURE__ */ n(
|
|
1107
1131
|
"div",
|
|
1108
1132
|
{
|
|
@@ -1112,7 +1136,7 @@ function at({ value: e, children: t, className: r = "", stretch: a = !1 }) {
|
|
|
1112
1136
|
}
|
|
1113
1137
|
);
|
|
1114
1138
|
}
|
|
1115
|
-
const
|
|
1139
|
+
const Ie = {
|
|
1116
1140
|
top: {
|
|
1117
1141
|
wrapper: "bottom-full left-1/2 -translate-x-1/2 mb-2",
|
|
1118
1142
|
arrow: "top-full left-1/2 -translate-x-1/2 border-t-4 border-x-4 border-x-transparent border-b-0"
|
|
@@ -1129,11 +1153,11 @@ const Ce = {
|
|
|
1129
1153
|
wrapper: "left-full top-1/2 -translate-y-1/2 ml-2",
|
|
1130
1154
|
arrow: "right-full top-1/2 -translate-y-1/2 border-r-4 border-y-4 border-y-transparent border-l-0"
|
|
1131
1155
|
}
|
|
1132
|
-
},
|
|
1156
|
+
}, Le = {
|
|
1133
1157
|
dark: { tooltip: "bg-slate-800 text-white", arrow: "border-t-slate-800 border-r-slate-800 border-b-slate-800 border-l-slate-800" },
|
|
1134
1158
|
light: { tooltip: "bg-white text-on-surface border border-surface-container-high shadow-theme-lg", arrow: "border-t-white border-r-white border-b-white border-l-white" }
|
|
1135
1159
|
};
|
|
1136
|
-
function
|
|
1160
|
+
function dt({
|
|
1137
1161
|
content: e,
|
|
1138
1162
|
position: t = "top",
|
|
1139
1163
|
variant: r = "dark",
|
|
@@ -1141,7 +1165,7 @@ function ot({
|
|
|
1141
1165
|
className: o = "",
|
|
1142
1166
|
...s
|
|
1143
1167
|
}) {
|
|
1144
|
-
const
|
|
1168
|
+
const c = Ie[t], i = Le[r];
|
|
1145
1169
|
return /* @__PURE__ */ l("div", { className: ["relative inline-flex group", o].filter(Boolean).join(" "), ...s, children: [
|
|
1146
1170
|
a,
|
|
1147
1171
|
/* @__PURE__ */ l(
|
|
@@ -1152,28 +1176,28 @@ function ot({
|
|
|
1152
1176
|
"absolute z-50 pointer-events-none",
|
|
1153
1177
|
"opacity-0 group-hover:opacity-100 transition-opacity duration-150",
|
|
1154
1178
|
"whitespace-nowrap text-xs font-medium px-2.5 py-1.5 rounded-lg",
|
|
1155
|
-
|
|
1156
|
-
|
|
1179
|
+
c.wrapper,
|
|
1180
|
+
i.tooltip
|
|
1157
1181
|
].join(" "),
|
|
1158
1182
|
children: [
|
|
1159
1183
|
e,
|
|
1160
|
-
/* @__PURE__ */ n("span", { className: ["absolute w-0 h-0",
|
|
1184
|
+
/* @__PURE__ */ n("span", { className: ["absolute w-0 h-0", c.arrow, i.arrow].join(" ") })
|
|
1161
1185
|
]
|
|
1162
1186
|
}
|
|
1163
1187
|
)
|
|
1164
1188
|
] });
|
|
1165
1189
|
}
|
|
1166
|
-
const
|
|
1190
|
+
const Te = {
|
|
1167
1191
|
sm: "px-3 py-1.5 text-sm h-8",
|
|
1168
1192
|
md: "px-3 py-2 text-sm h-10",
|
|
1169
1193
|
lg: "px-4 py-2.5 text-base h-11"
|
|
1170
1194
|
};
|
|
1171
|
-
function
|
|
1195
|
+
function Fe(e, t, r) {
|
|
1172
1196
|
if (e === "" || e === void 0 || e === null) return "";
|
|
1173
1197
|
const a = Number(e).toFixed(t);
|
|
1174
1198
|
return r ? `${a} ${r}` : a;
|
|
1175
1199
|
}
|
|
1176
|
-
const
|
|
1200
|
+
const Ee = N(
|
|
1177
1201
|
({
|
|
1178
1202
|
label: e,
|
|
1179
1203
|
hint: t,
|
|
@@ -1181,55 +1205,55 @@ const Fe = b(
|
|
|
1181
1205
|
unit: a = "",
|
|
1182
1206
|
decimals: o = 0,
|
|
1183
1207
|
value: s,
|
|
1184
|
-
defaultValue:
|
|
1185
|
-
onChange:
|
|
1186
|
-
disabled:
|
|
1208
|
+
defaultValue: c,
|
|
1209
|
+
onChange: i,
|
|
1210
|
+
disabled: m,
|
|
1187
1211
|
placeholder: u,
|
|
1188
1212
|
inputSize: f = "md",
|
|
1189
|
-
id:
|
|
1190
|
-
name:
|
|
1191
|
-
min:
|
|
1192
|
-
max:
|
|
1193
|
-
step:
|
|
1194
|
-
required:
|
|
1195
|
-
className:
|
|
1196
|
-
},
|
|
1197
|
-
const
|
|
1198
|
-
|
|
1199
|
-
), [
|
|
1200
|
-
|
|
1201
|
-
}, [
|
|
1202
|
-
|
|
1203
|
-
const
|
|
1204
|
-
|
|
1205
|
-
}, [
|
|
1206
|
-
|
|
1207
|
-
}, []),
|
|
1208
|
-
(
|
|
1209
|
-
K.current =
|
|
1213
|
+
id: p,
|
|
1214
|
+
name: d,
|
|
1215
|
+
min: x,
|
|
1216
|
+
max: h,
|
|
1217
|
+
step: w,
|
|
1218
|
+
required: b,
|
|
1219
|
+
className: v = ""
|
|
1220
|
+
}, g) => {
|
|
1221
|
+
const S = ee(), z = p ?? S, j = s !== void 0, [L, T] = C(
|
|
1222
|
+
c !== void 0 ? c : ""
|
|
1223
|
+
), [k, A] = C(!1), [F, H] = C(""), K = M(null), $ = j ? s : L, J = k ? F : Fe($, o, a), Q = B(() => {
|
|
1224
|
+
A(!0), H($ === "" ? "" : String($));
|
|
1225
|
+
}, [$]), X = B(() => {
|
|
1226
|
+
A(!1);
|
|
1227
|
+
const y = parseFloat(F.replace(",", ".")), D = isNaN(y) ? "" : y;
|
|
1228
|
+
j || T(D), i == null || i(D);
|
|
1229
|
+
}, [F, j, i]), Y = B((y) => {
|
|
1230
|
+
H(y.target.value);
|
|
1231
|
+
}, []), Z = B(
|
|
1232
|
+
(y) => {
|
|
1233
|
+
K.current = y, typeof g == "function" ? g(y) : g && (g.current = y);
|
|
1210
1234
|
},
|
|
1211
|
-
[
|
|
1235
|
+
[g]
|
|
1212
1236
|
);
|
|
1213
1237
|
return /* @__PURE__ */ l("div", { className: "flex flex-col gap-1.5", children: [
|
|
1214
|
-
e && /* @__PURE__ */ n("label", { htmlFor:
|
|
1238
|
+
e && /* @__PURE__ */ n("label", { htmlFor: z, className: "text-sm font-medium text-on-surface", children: e }),
|
|
1215
1239
|
/* @__PURE__ */ n(
|
|
1216
1240
|
"input",
|
|
1217
1241
|
{
|
|
1218
|
-
ref:
|
|
1219
|
-
id:
|
|
1220
|
-
name:
|
|
1221
|
-
type:
|
|
1242
|
+
ref: Z,
|
|
1243
|
+
id: z,
|
|
1244
|
+
name: d,
|
|
1245
|
+
type: k ? "number" : "text",
|
|
1222
1246
|
inputMode: "decimal",
|
|
1223
|
-
value:
|
|
1247
|
+
value: J,
|
|
1224
1248
|
placeholder: u,
|
|
1225
|
-
disabled:
|
|
1226
|
-
required:
|
|
1227
|
-
min:
|
|
1228
|
-
max:
|
|
1229
|
-
step:
|
|
1230
|
-
onFocus:
|
|
1231
|
-
onBlur:
|
|
1232
|
-
onChange:
|
|
1249
|
+
disabled: m,
|
|
1250
|
+
required: b,
|
|
1251
|
+
min: x,
|
|
1252
|
+
max: h,
|
|
1253
|
+
step: w ?? (o > 0 ? Math.pow(10, -o) : 1),
|
|
1254
|
+
onFocus: Q,
|
|
1255
|
+
onBlur: X,
|
|
1256
|
+
onChange: Y,
|
|
1233
1257
|
className: [
|
|
1234
1258
|
"w-full bg-white border rounded transition-all duration-200",
|
|
1235
1259
|
"text-on-surface placeholder:text-on-surface-variant",
|
|
@@ -1237,8 +1261,8 @@ const Fe = b(
|
|
|
1237
1261
|
r ? "border-error focus:border-error focus:shadow-[0_0_0_4px_rgba(186,26,26,0.15)]" : "border-outline-variant",
|
|
1238
1262
|
"disabled:bg-surface-container-low disabled:cursor-not-allowed disabled:opacity-60",
|
|
1239
1263
|
"[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",
|
|
1240
|
-
|
|
1241
|
-
|
|
1264
|
+
Te[f],
|
|
1265
|
+
v
|
|
1242
1266
|
].filter(Boolean).join(" ")
|
|
1243
1267
|
}
|
|
1244
1268
|
),
|
|
@@ -1250,41 +1274,41 @@ const Fe = b(
|
|
|
1250
1274
|
] });
|
|
1251
1275
|
}
|
|
1252
1276
|
);
|
|
1253
|
-
|
|
1277
|
+
Ee.displayName = "UnitInput";
|
|
1254
1278
|
export {
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1279
|
+
Ae as Alert,
|
|
1280
|
+
He as Avatar,
|
|
1281
|
+
De as Badge,
|
|
1282
|
+
Ge as Breadcrumb,
|
|
1283
|
+
me as Button,
|
|
1284
|
+
Ue as ButtonGroup,
|
|
1285
|
+
Ve as Card,
|
|
1286
|
+
qe as CardFooter,
|
|
1287
|
+
We as CardHeader,
|
|
1288
|
+
we as Checkbox,
|
|
1289
|
+
Oe as Dropdown,
|
|
1290
|
+
je as Input,
|
|
1291
|
+
Ke as Modal,
|
|
1292
|
+
Qe as ModalBody,
|
|
1293
|
+
Xe as ModalFooter,
|
|
1294
|
+
Je as ModalHeader,
|
|
1295
|
+
Ye as Pagination,
|
|
1296
|
+
Ze as ProgressBar,
|
|
1297
|
+
ve as Radio,
|
|
1298
|
+
he as Select,
|
|
1299
|
+
Pe as Spinner,
|
|
1300
|
+
ye as Switch,
|
|
1301
|
+
it as Tab,
|
|
1302
|
+
lt as TabList,
|
|
1303
|
+
ct as TabPanel,
|
|
1304
|
+
et as Table,
|
|
1305
|
+
rt as TableBody,
|
|
1306
|
+
ot as TableCell,
|
|
1307
|
+
tt as TableHead,
|
|
1308
|
+
at as TableHeaderCell,
|
|
1309
|
+
nt as TableRow,
|
|
1310
|
+
st as Tabs,
|
|
1311
|
+
be as Textarea,
|
|
1312
|
+
dt as Tooltip,
|
|
1313
|
+
Ee as UnitInput
|
|
1290
1314
|
};
|