@zeo-app/design-system 0.2.0 → 0.3.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.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  import { jsxs as l, jsx as n } from "react/jsx-runtime";
2
- import { forwardRef as b, useState as k, useRef as A, useEffect as _, createContext as D, useContext as R, useId as Y, useCallback as j } from "react";
3
- const Z = {
2
+ import { forwardRef as N, useState as z, useRef as O, useCallback as L, useLayoutEffect as ae, useEffect as T, useId as oe, createContext as Q, useContext as V } from "react";
3
+ import { createPortal as se } from "react-dom";
4
+ const le = {
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 Le({
26
+ function Ge({
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
- ...i
33
+ ...d
33
34
  }) {
34
- const d = Z[e], c = o ?? d.defaultIcon;
35
+ const c = le[e], x = o ?? c.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
- d.container,
42
+ c.container,
42
43
  s
43
44
  ].filter(Boolean).join(" "),
44
- ...i,
45
+ ...d,
45
46
  children: [
46
- /* @__PURE__ */ n("span", { className: `material-symbols-outlined text-[20px] shrink-0 mt-0.5 ${d.icon}`, children: c }),
47
+ /* @__PURE__ */ n("span", { className: `material-symbols-outlined text-[20px] shrink-0 mt-0.5 ${c.icon}`, children: x }),
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 P = {
65
+ const ie = {
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
- }, ee = {
71
+ }, ce = {
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
- }, te = {
77
+ }, de = {
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 re(e) {
83
+ function ue(e) {
83
84
  return e.split(" ").slice(0, 2).map((t) => t[0]).join("").toUpperCase();
84
85
  }
85
- function ne(e) {
86
+ function fe(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 Se({
97
+ function Ue({
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
- ...i
104
+ ...d
104
105
  }) {
105
- return /* @__PURE__ */ l("div", { className: ["relative inline-flex shrink-0", s].filter(Boolean).join(" "), ...i, children: [
106
+ return /* @__PURE__ */ l("div", { className: ["relative inline-flex shrink-0", s].filter(Boolean).join(" "), ...d, 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
- P[a],
112
- !e && r ? ne(r) : "bg-surface-container"
112
+ ie[a],
113
+ !e && r ? fe(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 ? re(r) : /* @__PURE__ */ n("span", { className: "material-symbols-outlined text-on-surface-variant", style: { fontSize: "60%" }, children: "person" })
122
+ ) : r ? ue(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
- ee[a],
130
- te[o]
130
+ ce[a],
131
+ de[o]
131
132
  ].filter(Boolean).join(" ")
132
133
  }
133
134
  )
134
135
  ] });
135
136
  }
136
- const ae = {
137
+ const me = {
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
- }, oe = {
144
+ }, pe = {
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
- }, se = {
151
+ }, xe = {
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 Me({
155
+ function We({
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
- ...i
162
+ ...d
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
- ae[e],
169
- se[t],
169
+ me[e],
170
+ xe[t],
170
171
  s
171
172
  ].filter(Boolean).join(" "),
172
- ...i,
173
+ ...d,
173
174
  children: [
174
- r && /* @__PURE__ */ n("span", { className: `w-1.5 h-1.5 rounded-full shrink-0 ${oe[e]}` }),
175
+ r && /* @__PURE__ */ n("span", { className: `w-1.5 h-1.5 rounded-full shrink-0 ${pe[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 Ee({ items: e, className: t = "", ...r }) {
182
+ function qe({ 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 le = {
211
+ const he = {
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
- }, ie = {
217
+ }, be = {
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
+ }, R = {
221
222
  sm: "text-[16px]",
222
223
  md: "text-[18px]",
223
224
  lg: "text-[20px]"
224
- }, ce = b(
225
+ }, ge = 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: i,
233
- children: d,
234
- className: c = "",
233
+ disabled: d,
234
+ children: c,
235
+ className: x = "",
235
236
  ...u
236
237
  }, f) => /* @__PURE__ */ l(
237
238
  "button",
238
239
  {
239
240
  ref: f,
240
- disabled: i || r,
241
+ disabled: d || 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
- le[e],
246
- ie[t],
246
+ he[e],
247
+ be[t],
247
248
  s ? "w-full" : "",
248
- c
249
+ x
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 ${$[t]}`,
256
+ className: `material-symbols-outlined animate-spin ${R[t]}`,
256
257
  children: "progress_activity"
257
258
  }
258
- ) : a && /* @__PURE__ */ n("span", { className: `material-symbols-outlined ${$[t]}`, children: a }),
259
- d,
260
- !r && o && /* @__PURE__ */ n("span", { className: `material-symbols-outlined ${$[t]}`, children: o })
259
+ ) : a && /* @__PURE__ */ n("span", { className: `material-symbols-outlined ${R[t]}`, children: a }),
260
+ c,
261
+ !r && o && /* @__PURE__ */ n("span", { className: `material-symbols-outlined ${R[t]}`, children: o })
261
262
  ]
262
263
  }
263
264
  )
264
265
  );
265
- ce.displayName = "Button";
266
- function Ae({ children: e, attached: t = !1, className: r = "", ...a }) {
266
+ ge.displayName = "Button";
267
+ function Oe({ 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 de = {
282
+ const we = {
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
- }, ue = {
286
+ }, ve = {
286
287
  none: "",
287
288
  sm: "p-4",
288
289
  md: "p-5",
289
290
  lg: "p-6"
290
291
  };
291
- function De({
292
+ function Ke({
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
- de[e],
304
+ we[e],
304
305
  a
305
306
  ].filter(Boolean).join(" "),
306
307
  ...o,
307
- children: /* @__PURE__ */ n("div", { className: ue[t], children: r })
308
+ children: /* @__PURE__ */ n("div", { className: ve[t], children: r })
308
309
  }
309
310
  );
310
311
  }
311
- function Re({
312
+ function Je({
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 He({ children: e, className: t = "", ...r }) {
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
  }
348
+ const _ = 8, K = 4;
347
349
  function Ve({ trigger: e, items: t, align: r = "right", className: a = "", ...o }) {
348
- const [s, i] = k(!1), d = A(null);
349
- return _(() => {
350
- const c = (u) => {
351
- d.current && !d.current.contains(u.target) && i(!1);
350
+ const [s, d] = z(!1), [c, x] = z(null), u = O(null), f = O(null), h = L(() => {
351
+ var C;
352
+ const i = u.current;
353
+ if (!i) return;
354
+ const m = i.getBoundingClientRect(), p = (C = f.current) == null ? void 0 : C.getBoundingClientRect(), w = (p == null ? void 0 : p.width) ?? 180, b = (p == null ? void 0 : p.height) ?? 0, v = window.innerHeight - m.bottom, y = m.top, j = v < b + _ && y > v ? m.top - b - K : m.bottom + K, I = r === "right" ? m.right - w : m.left, E = window.innerWidth - w - _, M = Math.min(Math.max(I, _), Math.max(E, _));
355
+ x({ top: j, left: M });
356
+ }, [r]);
357
+ return ae(() => {
358
+ s && h();
359
+ }, [s, h]), T(() => {
360
+ if (!s) return;
361
+ const i = () => h();
362
+ return window.addEventListener("scroll", i, !0), window.addEventListener("resize", i), () => {
363
+ window.removeEventListener("scroll", i, !0), window.removeEventListener("resize", i);
352
364
  };
353
- return document.addEventListener("mousedown", c), () => document.removeEventListener("mousedown", c);
354
- }, []), _(() => {
355
- const c = (u) => {
356
- u.key === "Escape" && i(!1);
365
+ }, [s, h]), T(() => {
366
+ const i = (m) => {
367
+ var v, y;
368
+ const p = m.target, w = (v = u.current) == null ? void 0 : v.contains(p), b = (y = f.current) == null ? void 0 : y.contains(p);
369
+ !w && !b && d(!1);
357
370
  };
358
- return document.addEventListener("keydown", c), () => document.removeEventListener("keydown", c);
359
- }, []), /* @__PURE__ */ l("div", { ref: d, className: ["relative inline-block", a].filter(Boolean).join(" "), ...o, children: [
360
- /* @__PURE__ */ n("div", { onClick: () => i((c) => !c), children: e }),
361
- s && /* @__PURE__ */ n(
362
- "div",
363
- {
364
- className: [
365
- "absolute z-40 mt-2 min-w-[180px] bg-white border border-surface-container-high rounded-xl shadow-theme-lg py-1",
366
- r === "right" ? "right-0" : "left-0"
367
- ].join(" "),
368
- role: "menu",
369
- children: t.map((c, u) => /* @__PURE__ */ l("div", { children: [
370
- /* @__PURE__ */ l(
371
- "button",
372
- {
373
- role: "menuitem",
374
- disabled: c.disabled,
375
- onClick: () => {
376
- var f;
377
- c.disabled || ((f = c.onClick) == null || f.call(c), i(!1));
378
- },
379
- className: [
380
- "w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-colors text-left",
381
- c.danger ? "text-error hover:bg-red-50" : "text-on-surface hover:bg-surface-container-low",
382
- c.disabled ? "opacity-40 cursor-not-allowed" : "cursor-pointer"
383
- ].filter(Boolean).join(" "),
384
- children: [
385
- c.icon && /* @__PURE__ */ n("span", { className: "material-symbols-outlined text-[18px] opacity-70", children: c.icon }),
386
- c.label
387
- ]
388
- }
389
- ),
390
- c.dividerAfter && /* @__PURE__ */ n("div", { className: "my-1 border-t border-surface-container-high" })
391
- ] }, u))
392
- }
371
+ return document.addEventListener("mousedown", i), () => document.removeEventListener("mousedown", i);
372
+ }, []), T(() => {
373
+ const i = (m) => {
374
+ m.key === "Escape" && d(!1);
375
+ };
376
+ return document.addEventListener("keydown", i), () => document.removeEventListener("keydown", i);
377
+ }, []), /* @__PURE__ */ l("div", { ref: u, className: ["relative inline-block", a].filter(Boolean).join(" "), ...o, children: [
378
+ /* @__PURE__ */ n("div", { onClick: () => d((i) => !i), children: e }),
379
+ s && se(
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: (c == null ? void 0 : c.top) ?? 0,
387
+ left: (c == null ? void 0 : c.left) ?? 0,
388
+ visibility: c ? "visible" : "hidden"
389
+ },
390
+ role: "menu",
391
+ children: t.map((i, m) => /* @__PURE__ */ l("div", { children: [
392
+ /* @__PURE__ */ l(
393
+ "button",
394
+ {
395
+ role: "menuitem",
396
+ disabled: i.disabled,
397
+ onClick: () => {
398
+ var p;
399
+ i.disabled || ((p = i.onClick) == null || p.call(i), d(!1));
400
+ },
401
+ className: [
402
+ "w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-colors text-left",
403
+ i.danger ? "text-error hover:bg-red-50" : "text-on-surface hover:bg-surface-container-low",
404
+ i.disabled ? "opacity-40 cursor-not-allowed" : "cursor-pointer"
405
+ ].filter(Boolean).join(" "),
406
+ children: [
407
+ i.icon && /* @__PURE__ */ n("span", { className: "material-symbols-outlined text-[18px] opacity-70", children: i.icon }),
408
+ i.label
409
+ ]
410
+ }
411
+ ),
412
+ i.dividerAfter && /* @__PURE__ */ n("div", { className: "my-1 border-t border-surface-container-high" })
413
+ ] }, m))
414
+ }
415
+ ),
416
+ document.body
393
417
  )
394
418
  ] });
395
419
  }
396
- const fe = b(
397
- ({ label: e, hint: t, error: r, options: a, placeholder: o, disabled: s, className: i = "", id: d, ...c }, u) => {
398
- const f = d ?? (e == null ? void 0 : e.toLowerCase().replace(/\s+/g, "-"));
420
+ const ye = N(
421
+ ({ label: e, hint: t, error: r, options: a, placeholder: o, disabled: s, className: d = "", id: c, ...x }, u) => {
422
+ const f = c ?? (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
- i
437
+ d
414
438
  ].filter(Boolean).join(" "),
415
- ...c,
439
+ ...x,
416
440
  children: [
417
441
  o && /* @__PURE__ */ n("option", { value: "", disabled: !0, children: o }),
418
- a.map((m) => /* @__PURE__ */ n("option", { value: m.value, disabled: m.disabled, children: m.label }, m.value))
442
+ a.map((h) => /* @__PURE__ */ n("option", { value: h.value, disabled: h.disabled, children: h.label }, h.value))
419
443
  ]
420
444
  }
421
445
  ),
@@ -429,18 +453,18 @@ const fe = b(
429
453
  ] });
430
454
  }
431
455
  );
432
- fe.displayName = "Select";
433
- const me = b(
434
- ({ label: e, hint: t, error: r, disabled: a, className: o = "", id: s, rows: i = 4, ...d }, c) => {
456
+ ye.displayName = "Select";
457
+ const Ne = N(
458
+ ({ label: e, hint: t, error: r, disabled: a, className: o = "", id: s, rows: d = 4, ...c }, x) => {
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: c,
465
+ ref: x,
442
466
  id: u,
443
- rows: i,
467
+ rows: d,
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
- ...d
477
+ ...c
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
- me.displayName = "Textarea";
465
- const pe = {
488
+ Ne.displayName = "Textarea";
489
+ const je = {
466
490
  square: "rounded-[2px]",
467
491
  rounded: "rounded-[4px]",
468
492
  circle: "rounded-full"
469
- }, xe = b(
470
- ({ label: e, description: t, error: r, disabled: a, className: o = "", id: s, shape: i = "square", color: d = "#FF6B00", ...c }, u) => {
493
+ }, ke = N(
494
+ ({ label: e, description: t, error: r, disabled: a, className: o = "", id: s, shape: d = "square", color: c = "#FF6B00", ...x }, 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
- ...c
518
+ ...x
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
- pe[i]
528
+ je[d]
505
529
  ].filter(Boolean).join(" "),
506
- style: { "--cb-color": d }
530
+ style: { "--cb-color": c }
507
531
  }
508
532
  ),
509
533
  /* @__PURE__ */ n(
@@ -542,14 +566,14 @@ const pe = {
542
566
  ] });
543
567
  }
544
568
  );
545
- xe.displayName = "Checkbox";
546
- const he = b(
547
- ({ label: e, description: t, disabled: r, className: a = "", id: o, ...s }, i) => {
548
- const d = o ?? `radio-${e == null ? void 0 : e.toLowerCase().replace(/\s+/g, "-")}`;
569
+ ke.displayName = "Checkbox";
570
+ const Be = N(
571
+ ({ label: e, description: t, disabled: r, className: a = "", id: o, ...s }, d) => {
572
+ const c = o ?? `radio-${e == null ? void 0 : e.toLowerCase().replace(/\s+/g, "-")}`;
549
573
  return /* @__PURE__ */ l(
550
574
  "label",
551
575
  {
552
- htmlFor: d,
576
+ htmlFor: c,
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: i,
585
+ ref: d,
562
586
  type: "radio",
563
- id: d,
587
+ id: c,
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
- he.displayName = "Radio";
584
- const be = b(
585
- ({ label: e, description: t, disabled: r, className: a = "", id: o, ...s }, i) => {
586
- const d = o ?? `switch-${e == null ? void 0 : e.toLowerCase().replace(/\s+/g, "-")}`;
607
+ Be.displayName = "Radio";
608
+ const Ce = N(
609
+ ({ label: e, description: t, disabled: r, className: a = "", id: o, ...s }, d) => {
610
+ const c = o ?? `switch-${e == null ? void 0 : e.toLowerCase().replace(/\s+/g, "-")}`;
587
611
  return /* @__PURE__ */ l(
588
612
  "label",
589
613
  {
590
- htmlFor: d,
614
+ htmlFor: c,
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: i,
624
+ ref: d,
601
625
  type: "checkbox",
602
- id: d,
626
+ id: c,
603
627
  disabled: r,
604
628
  className: "sr-only peer",
605
629
  ...s
@@ -617,16 +641,22 @@ const be = b(
617
641
  );
618
642
  }
619
643
  );
620
- be.displayName = "Switch";
621
- const ge = {
644
+ Ce.displayName = "Switch";
645
+ const ze = {
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
- }, E = {
649
+ }, J = {
626
650
  sm: "text-[16px]",
627
651
  md: "text-[18px]",
628
652
  lg: "text-[20px]"
629
- }, we = b(
653
+ };
654
+ function $e(e, t, r) {
655
+ if (e === "" || e === void 0 || e === null) return "";
656
+ const a = Number(e).toFixed(t);
657
+ return r ? `${a} ${r}` : a;
658
+ }
659
+ const _e = N(
630
660
  ({
631
661
  label: e,
632
662
  hint: t,
@@ -634,18 +664,51 @@ const ge = {
634
664
  inputSize: a = "md",
635
665
  iconLeft: o,
636
666
  iconRight: s,
637
- onIconRightClick: i,
638
- disabled: d,
639
- className: c = "",
667
+ onIconRightClick: d,
668
+ disabled: c,
669
+ className: x = "",
640
670
  id: u,
641
- ...f
642
- }, m) => {
643
- const p = u ?? (e == null ? void 0 : e.toLowerCase().replace(/\s+/g, "-"));
671
+ unit: f,
672
+ decimals: h,
673
+ onValueChange: i,
674
+ value: m,
675
+ defaultValue: p,
676
+ type: w,
677
+ step: b,
678
+ inputMode: v,
679
+ onChange: y,
680
+ onFocus: B,
681
+ onBlur: j,
682
+ ...I
683
+ }, E) => {
684
+ const M = oe(), C = u ?? (e ? e.toLowerCase().replace(/\s+/g, "-") : M), g = f !== void 0, F = h ?? 0, S = g && m !== void 0, [Z, P] = z(
685
+ typeof p == "number" ? p : ""
686
+ ), [H, G] = z(!1), [A, U] = z(""), $ = S ? m : Z, ee = g ? H ? A : $e($, F, f ?? "") : m, te = L(
687
+ (k) => {
688
+ g && (G(!0), U($ === "" ? "" : String($))), B == null || B(k);
689
+ },
690
+ [g, $, B]
691
+ ), re = L(
692
+ (k) => {
693
+ if (g) {
694
+ G(!1);
695
+ const W = parseFloat(A.replace(",", ".")), q = isNaN(W) ? "" : W;
696
+ S || P(q), i == null || i(q);
697
+ }
698
+ j == null || j(k);
699
+ },
700
+ [g, A, S, i, j]
701
+ ), ne = L(
702
+ (k) => {
703
+ g && U(k.target.value), y == null || y(k);
704
+ },
705
+ [g, y]
706
+ );
644
707
  return /* @__PURE__ */ l("div", { className: "flex flex-col gap-1.5", children: [
645
708
  e && /* @__PURE__ */ n(
646
709
  "label",
647
710
  {
648
- htmlFor: p,
711
+ htmlFor: C,
649
712
  className: "text-sm font-medium text-on-surface",
650
713
  children: e
651
714
  }
@@ -654,28 +717,37 @@ const ge = {
654
717
  o && /* @__PURE__ */ n(
655
718
  "span",
656
719
  {
657
- className: `material-symbols-outlined absolute left-3 text-on-surface-variant pointer-events-none ${E[a]}`,
720
+ className: `material-symbols-outlined absolute left-3 text-on-surface-variant pointer-events-none ${J[a]}`,
658
721
  children: o
659
722
  }
660
723
  ),
661
724
  /* @__PURE__ */ n(
662
725
  "input",
663
726
  {
664
- ref: m,
665
- id: p,
666
- disabled: d,
727
+ ref: E,
728
+ id: C,
729
+ disabled: c,
730
+ type: g ? H ? "number" : "text" : w,
731
+ inputMode: g ? "decimal" : v,
732
+ value: g ? ee : m,
733
+ defaultValue: g ? void 0 : p,
734
+ step: g ? b ?? (F > 0 ? Math.pow(10, -F) : 1) : b,
735
+ onFocus: te,
736
+ onBlur: re,
737
+ onChange: ne,
667
738
  className: [
668
739
  "w-full bg-white border rounded transition-all duration-200",
669
740
  "text-on-surface placeholder:text-on-surface-variant",
670
741
  "focus:outline-none focus:border-zeo-orange focus:shadow-zeo-focus",
671
742
  r ? "border-error focus:border-error focus:shadow-[0_0_0_4px_rgba(186,26,26,0.15)]" : "border-outline-variant",
672
743
  "disabled:bg-surface-container-low disabled:cursor-not-allowed disabled:opacity-60",
673
- ge[a],
744
+ g ? "[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none" : "",
745
+ ze[a],
674
746
  o ? "pl-9" : "",
675
747
  s ? "pr-9" : "",
676
- c
748
+ x
677
749
  ].filter(Boolean).join(" "),
678
- ...f
750
+ ...I
679
751
  }
680
752
  ),
681
753
  s && /* @__PURE__ */ n(
@@ -683,10 +755,10 @@ const ge = {
683
755
  {
684
756
  className: [
685
757
  "material-symbols-outlined absolute right-3 text-on-surface-variant",
686
- E[a],
687
- i ? "cursor-pointer hover:text-on-surface" : "pointer-events-none"
758
+ J[a],
759
+ d ? "cursor-pointer hover:text-on-surface" : "pointer-events-none"
688
760
  ].filter(Boolean).join(" "),
689
- onClick: i,
761
+ onClick: d,
690
762
  children: s
691
763
  }
692
764
  )
@@ -699,16 +771,16 @@ const ge = {
699
771
  ] });
700
772
  }
701
773
  );
702
- we.displayName = "Input";
703
- const ve = {
774
+ _e.displayName = "Input";
775
+ const Le = {
704
776
  sm: "max-w-sm",
705
777
  md: "max-w-md",
706
778
  lg: "max-w-lg",
707
779
  xl: "max-w-2xl",
708
780
  full: "max-w-[calc(100vw-2rem)]"
709
781
  };
710
- function qe({ open: e, onClose: t, size: r = "md", children: a }) {
711
- return _(() => {
782
+ function Xe({ open: e, onClose: t, size: r = "md", children: a }) {
783
+ return T(() => {
712
784
  if (!e) return;
713
785
  const o = (s) => {
714
786
  s.key === "Escape" && t();
@@ -734,7 +806,7 @@ function qe({ open: e, onClose: t, size: r = "md", children: a }) {
734
806
  {
735
807
  className: [
736
808
  "relative w-full bg-white rounded-2xl shadow-theme-lg z-10 flex flex-col max-h-[90vh]",
737
- ve[r]
809
+ Le[r]
738
810
  ].filter(Boolean).join(" "),
739
811
  children: a
740
812
  }
@@ -743,7 +815,7 @@ function qe({ open: e, onClose: t, size: r = "md", children: a }) {
743
815
  }
744
816
  ) : null;
745
817
  }
746
- function Ue({ title: e, subtitle: t, onClose: r, className: a = "", ...o }) {
818
+ function Ye({ title: e, subtitle: t, onClose: r, className: a = "", ...o }) {
747
819
  return /* @__PURE__ */ l(
748
820
  "div",
749
821
  {
@@ -767,7 +839,7 @@ function Ue({ title: e, subtitle: t, onClose: r, className: a = "", ...o }) {
767
839
  }
768
840
  );
769
841
  }
770
- function Ge({ children: e, className: t = "", ...r }) {
842
+ function Ze({ children: e, className: t = "", ...r }) {
771
843
  return /* @__PURE__ */ n(
772
844
  "div",
773
845
  {
@@ -777,7 +849,7 @@ function Ge({ children: e, className: t = "", ...r }) {
777
849
  }
778
850
  );
779
851
  }
780
- function Ke({ children: e, className: t = "", ...r }) {
852
+ function Pe({ children: e, className: t = "", ...r }) {
781
853
  return /* @__PURE__ */ n(
782
854
  "div",
783
855
  {
@@ -790,25 +862,25 @@ function Ke({ children: e, className: t = "", ...r }) {
790
862
  }
791
863
  );
792
864
  }
793
- function Ne(e, t) {
865
+ function Te(e, t) {
794
866
  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
867
  }
796
- function Oe({
868
+ function et({
797
869
  currentPage: e,
798
870
  totalPages: t,
799
871
  totalItems: r,
800
872
  itemsPerPage: a = 10,
801
873
  onPageChange: o,
802
874
  variant: s = "full",
803
- className: i = "",
804
- ...d
875
+ className: d = "",
876
+ ...c
805
877
  }) {
806
- const c = Ne(e, t), u = (e - 1) * a + 1, f = Math.min(e * a, r ?? e * a), m = "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", p = `${m} w-9 h-9`, g = "bg-zeo-orange text-white", w = "text-on-surface-variant hover:bg-surface-container-low hover:text-on-surface", N = `${m} 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`;
878
+ const x = Te(e, t), u = (e - 1) * a + 1, f = Math.min(e * a, r ?? e * a), h = "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", i = `${h} w-9 h-9`, m = "bg-zeo-orange text-white", p = "text-on-surface-variant hover:bg-surface-container-low hover:text-on-surface", w = `${h} 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
879
  return /* @__PURE__ */ l(
808
880
  "div",
809
881
  {
810
- className: ["flex items-center justify-between gap-4 flex-wrap", i].filter(Boolean).join(" "),
811
- ...d,
882
+ className: ["flex items-center justify-between gap-4 flex-wrap", d].filter(Boolean).join(" "),
883
+ ...c,
812
884
  children: [
813
885
  s === "full" && r !== void 0 && /* @__PURE__ */ l("p", { className: "text-sm text-on-surface-variant", children: [
814
886
  "Mostrando ",
@@ -828,23 +900,23 @@ function Oe({
828
900
  onClick: () => o(e - 1),
829
901
  disabled: e === 1,
830
902
  "aria-label": "Página anterior",
831
- className: s === "icon" ? p + " " + w : N,
903
+ className: s === "icon" ? i + " " + p : w,
832
904
  children: [
833
905
  /* @__PURE__ */ n("span", { className: "material-symbols-outlined text-[18px]", children: "arrow_back" }),
834
906
  s === "text" && "Anterior"
835
907
  ]
836
908
  }
837
909
  ),
838
- c.map(
839
- (x, B) => x === "..." ? /* @__PURE__ */ n("span", { className: "w-9 text-center text-sm text-on-surface-variant select-none", children: "…" }, `ellipsis-${B}`) : /* @__PURE__ */ n(
910
+ x.map(
911
+ (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
912
  "button",
841
913
  {
842
- onClick: () => o(x),
843
- "aria-current": e === x ? "page" : void 0,
844
- className: [p, e === x ? g : w].join(" "),
845
- children: x
914
+ onClick: () => o(b),
915
+ "aria-current": e === b ? "page" : void 0,
916
+ className: [i, e === b ? m : p].join(" "),
917
+ children: b
846
918
  },
847
- x
919
+ b
848
920
  )
849
921
  ),
850
922
  /* @__PURE__ */ l(
@@ -853,7 +925,7 @@ function Oe({
853
925
  onClick: () => o(e + 1),
854
926
  disabled: e === t,
855
927
  "aria-label": "Próxima página",
856
- className: s === "icon" ? p + " " + w : N,
928
+ className: s === "icon" ? i + " " + p : w,
857
929
  children: [
858
930
  s === "text" && "Próxima",
859
931
  /* @__PURE__ */ n("span", { className: "material-symbols-outlined text-[18px]", children: "arrow_forward" })
@@ -865,32 +937,32 @@ function Oe({
865
937
  }
866
938
  );
867
939
  }
868
- const ye = {
940
+ const Ie = {
869
941
  xs: "h-1",
870
942
  sm: "h-1.5",
871
943
  md: "h-2",
872
944
  lg: "h-3"
873
- }, je = {
945
+ }, Ee = {
874
946
  primary: "bg-zeo-orange",
875
947
  success: "bg-green-500",
876
948
  warning: "bg-amber-400",
877
949
  danger: "bg-red-500"
878
950
  };
879
- function We({
951
+ function tt({
880
952
  value: e,
881
953
  max: t = 100,
882
954
  size: r = "md",
883
955
  variant: a = "primary",
884
956
  label: o = "none",
885
957
  showPercent: s = !0,
886
- title: i,
887
- className: d = "",
888
- ...c
958
+ title: d,
959
+ className: c = "",
960
+ ...x
889
961
  }) {
890
962
  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", d].filter(Boolean).join(" "), ...c, children: [
892
- (i || o === "outside" && s) && /* @__PURE__ */ l("div", { className: "flex items-center justify-between gap-2", children: [
893
- i && /* @__PURE__ */ n("span", { className: "text-sm font-medium text-on-surface", children: i }),
963
+ return /* @__PURE__ */ l("div", { className: ["flex flex-col gap-1.5", c].filter(Boolean).join(" "), ...x, children: [
964
+ (d || o === "outside" && s) && /* @__PURE__ */ l("div", { className: "flex items-center justify-between gap-2", children: [
965
+ d && /* @__PURE__ */ n("span", { className: "text-sm font-medium text-on-surface", children: d }),
894
966
  o === "outside" && s && /* @__PURE__ */ n("span", { className: "text-sm font-semibold text-on-surface", children: f })
895
967
  ] }),
896
968
  /* @__PURE__ */ n(
@@ -900,13 +972,13 @@ function We({
900
972
  "aria-valuenow": e,
901
973
  "aria-valuemin": 0,
902
974
  "aria-valuemax": t,
903
- className: ["relative w-full bg-surface-container-high rounded-full overflow-hidden", ye[r]].join(" "),
975
+ className: ["relative w-full bg-surface-container-high rounded-full overflow-hidden", Ie[r]].join(" "),
904
976
  children: /* @__PURE__ */ n(
905
977
  "div",
906
978
  {
907
979
  className: [
908
980
  "h-full rounded-full transition-all duration-500 flex items-center justify-end pr-1",
909
- je[a]
981
+ Ee[a]
910
982
  ].join(" "),
911
983
  style: { width: `${u}%` },
912
984
  children: o === "inside" && s && u >= 20 && /* @__PURE__ */ n("span", { className: "text-[10px] font-bold text-white leading-none", children: f })
@@ -916,18 +988,18 @@ function We({
916
988
  )
917
989
  ] });
918
990
  }
919
- const ke = {
991
+ const Me = {
920
992
  xs: "w-3 h-3 border",
921
993
  sm: "w-4 h-4 border-2",
922
994
  md: "w-6 h-6 border-2",
923
995
  lg: "w-8 h-8 border-[3px]",
924
996
  xl: "w-12 h-12 border-4"
925
- }, Be = {
997
+ }, Fe = {
926
998
  primary: "border-orange-200 border-t-zeo-orange",
927
999
  secondary: "border-surface-container-high border-t-on-surface-variant",
928
1000
  white: "border-white/30 border-t-white"
929
1001
  };
930
- function Je({
1002
+ function rt({
931
1003
  size: e = "md",
932
1004
  variant: t = "primary",
933
1005
  label: r = "Carregando...",
@@ -941,15 +1013,15 @@ function Je({
941
1013
  "aria-label": r,
942
1014
  className: [
943
1015
  "inline-block rounded-full animate-spin",
944
- ke[e],
945
- Be[t],
1016
+ Me[e],
1017
+ Fe[t],
946
1018
  a
947
1019
  ].filter(Boolean).join(" "),
948
1020
  ...o
949
1021
  }
950
1022
  );
951
1023
  }
952
- function Qe({ children: e, className: t = "", ...r }) {
1024
+ function nt({ children: e, className: t = "", ...r }) {
953
1025
  return /* @__PURE__ */ n(
954
1026
  "div",
955
1027
  {
@@ -959,7 +1031,7 @@ function Qe({ children: e, className: t = "", ...r }) {
959
1031
  }
960
1032
  );
961
1033
  }
962
- function Xe({ children: e, className: t = "", ...r }) {
1034
+ function at({ children: e, className: t = "", ...r }) {
963
1035
  return /* @__PURE__ */ n(
964
1036
  "thead",
965
1037
  {
@@ -969,7 +1041,7 @@ function Xe({ children: e, className: t = "", ...r }) {
969
1041
  }
970
1042
  );
971
1043
  }
972
- function Ye({ children: e, className: t = "", ...r }) {
1044
+ function ot({ children: e, className: t = "", ...r }) {
973
1045
  return /* @__PURE__ */ n(
974
1046
  "tbody",
975
1047
  {
@@ -979,7 +1051,7 @@ function Ye({ children: e, className: t = "", ...r }) {
979
1051
  }
980
1052
  );
981
1053
  }
982
- function Ze({ selected: e = !1, children: t, className: r = "", ...a }) {
1054
+ function st({ selected: e = !1, children: t, className: r = "", ...a }) {
983
1055
  return /* @__PURE__ */ n(
984
1056
  "tr",
985
1057
  {
@@ -993,7 +1065,7 @@ function Ze({ selected: e = !1, children: t, className: r = "", ...a }) {
993
1065
  }
994
1066
  );
995
1067
  }
996
- function Pe({
1068
+ function lt({
997
1069
  sortable: e = !1,
998
1070
  sorted: t = !1,
999
1071
  onSort: r,
@@ -1024,7 +1096,7 @@ function Pe({
1024
1096
  }
1025
1097
  );
1026
1098
  }
1027
- function et({ muted: e = !1, mono: t = !1, children: r, className: a = "", ...o }) {
1099
+ function it({ muted: e = !1, mono: t = !1, children: r, className: a = "", ...o }) {
1028
1100
  return /* @__PURE__ */ n(
1029
1101
  "td",
1030
1102
  {
@@ -1039,23 +1111,23 @@ function et({ muted: e = !1, mono: t = !1, children: r, className: a = "", ...o
1039
1111
  }
1040
1112
  );
1041
1113
  }
1042
- const H = D(null);
1043
- function F() {
1044
- const e = R(H);
1114
+ const X = Q(null);
1115
+ function D() {
1116
+ const e = V(X);
1045
1117
  if (!e) throw new Error("Tab must be used inside Tabs");
1046
1118
  return e;
1047
1119
  }
1048
- const V = D({ stretch: !1 });
1049
- function tt({ value: e, onChange: t, variant: r = "default", children: a }) {
1050
- return /* @__PURE__ */ n(H.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 }) });
1120
+ const Y = Q({ stretch: !1 });
1121
+ function ct({ value: e, onChange: t, variant: r = "default", children: a }) {
1122
+ return /* @__PURE__ */ n(X.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
1123
  }
1052
- function rt({ children: e, className: t = "", stretch: r = !1, ...a }) {
1053
- const { variant: o } = F(), s = {
1124
+ function dt({ children: e, className: t = "", stretch: r = !1, ...a }) {
1125
+ const { variant: o } = D(), s = {
1054
1126
  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
1127
  underline: "flex gap-0 border-b border-surface-container-high w-full",
1056
1128
  vertical: "flex flex-col gap-1 bg-surface-container-low rounded-lg p-1 w-48 shrink-0 h-fit"
1057
1129
  }[o];
1058
- return /* @__PURE__ */ n(V.Provider, { value: { stretch: r }, children: /* @__PURE__ */ n(
1130
+ return /* @__PURE__ */ n(Y.Provider, { value: { stretch: r }, children: /* @__PURE__ */ n(
1059
1131
  "div",
1060
1132
  {
1061
1133
  role: "tablist",
@@ -1065,12 +1137,12 @@ function rt({ children: e, className: t = "", stretch: r = !1, ...a }) {
1065
1137
  }
1066
1138
  ) });
1067
1139
  }
1068
- function nt({ value: e, label: t, icon: r, badge: a, disabled: o = !1 }) {
1069
- const { active: s, onChange: i, variant: d } = F(), { stretch: c } = R(V), u = s === e, f = "inline-flex items-center gap-2 font-medium text-sm transition-all duration-200 select-none focus:outline-none", m = "opacity-40 cursor-not-allowed pointer-events-none", p = c && d !== "vertical" ? "flex-1 justify-center" : "", g = {
1140
+ function ut({ value: e, label: t, icon: r, badge: a, disabled: o = !1 }) {
1141
+ const { active: s, onChange: d, variant: c } = D(), { stretch: x } = V(Y), u = s === e, f = "inline-flex items-center gap-2 font-medium text-sm transition-all duration-200 select-none focus:outline-none", h = "opacity-40 cursor-not-allowed pointer-events-none", i = x && c !== "vertical" ? "flex-1 justify-center" : "", m = {
1070
1142
  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
1143
  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
1144
  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
- }[d];
1145
+ }[c];
1074
1146
  return /* @__PURE__ */ l(
1075
1147
  "button",
1076
1148
  {
@@ -1078,8 +1150,8 @@ function nt({ value: e, label: t, icon: r, badge: a, disabled: o = !1 }) {
1078
1150
  "aria-selected": u,
1079
1151
  "aria-disabled": o,
1080
1152
  disabled: o,
1081
- onClick: () => !o && i(e),
1082
- className: [f, g, p, o ? m : ""].filter(Boolean).join(" "),
1153
+ onClick: () => !o && d(e),
1154
+ className: [f, m, i, o ? h : ""].filter(Boolean).join(" "),
1083
1155
  children: [
1084
1156
  r && /* @__PURE__ */ n(
1085
1157
  "span",
@@ -1101,8 +1173,8 @@ function nt({ value: e, label: t, icon: r, badge: a, disabled: o = !1 }) {
1101
1173
  }
1102
1174
  );
1103
1175
  }
1104
- function at({ value: e, children: t, className: r = "", stretch: a = !1 }) {
1105
- const { active: o } = F();
1176
+ function ft({ value: e, children: t, className: r = "", stretch: a = !1 }) {
1177
+ const { active: o } = D();
1106
1178
  return o !== e ? null : /* @__PURE__ */ n(
1107
1179
  "div",
1108
1180
  {
@@ -1112,7 +1184,7 @@ function at({ value: e, children: t, className: r = "", stretch: a = !1 }) {
1112
1184
  }
1113
1185
  );
1114
1186
  }
1115
- const Ce = {
1187
+ const Se = {
1116
1188
  top: {
1117
1189
  wrapper: "bottom-full left-1/2 -translate-x-1/2 mb-2",
1118
1190
  arrow: "top-full left-1/2 -translate-x-1/2 border-t-4 border-x-4 border-x-transparent border-b-0"
@@ -1129,11 +1201,11 @@ const Ce = {
1129
1201
  wrapper: "left-full top-1/2 -translate-y-1/2 ml-2",
1130
1202
  arrow: "right-full top-1/2 -translate-y-1/2 border-r-4 border-y-4 border-y-transparent border-l-0"
1131
1203
  }
1132
- }, ze = {
1204
+ }, Ae = {
1133
1205
  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
1206
  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
1207
  };
1136
- function ot({
1208
+ function mt({
1137
1209
  content: e,
1138
1210
  position: t = "top",
1139
1211
  variant: r = "dark",
@@ -1141,7 +1213,7 @@ function ot({
1141
1213
  className: o = "",
1142
1214
  ...s
1143
1215
  }) {
1144
- const i = Ce[t], d = ze[r];
1216
+ const d = Se[t], c = Ae[r];
1145
1217
  return /* @__PURE__ */ l("div", { className: ["relative inline-flex group", o].filter(Boolean).join(" "), ...s, children: [
1146
1218
  a,
1147
1219
  /* @__PURE__ */ l(
@@ -1152,139 +1224,50 @@ function ot({
1152
1224
  "absolute z-50 pointer-events-none",
1153
1225
  "opacity-0 group-hover:opacity-100 transition-opacity duration-150",
1154
1226
  "whitespace-nowrap text-xs font-medium px-2.5 py-1.5 rounded-lg",
1155
- i.wrapper,
1156
- d.tooltip
1227
+ d.wrapper,
1228
+ c.tooltip
1157
1229
  ].join(" "),
1158
1230
  children: [
1159
1231
  e,
1160
- /* @__PURE__ */ n("span", { className: ["absolute w-0 h-0", i.arrow, d.arrow].join(" ") })
1232
+ /* @__PURE__ */ n("span", { className: ["absolute w-0 h-0", d.arrow, c.arrow].join(" ") })
1161
1233
  ]
1162
1234
  }
1163
1235
  )
1164
1236
  ] });
1165
1237
  }
1166
- const $e = {
1167
- sm: "px-3 py-1.5 text-sm h-8",
1168
- md: "px-3 py-2 text-sm h-10",
1169
- lg: "px-4 py-2.5 text-base h-11"
1170
- };
1171
- function _e(e, t, r) {
1172
- if (e === "" || e === void 0 || e === null) return "";
1173
- const a = Number(e).toFixed(t);
1174
- return r ? `${a} ${r}` : a;
1175
- }
1176
- const Fe = b(
1177
- ({
1178
- label: e,
1179
- hint: t,
1180
- error: r,
1181
- unit: a = "",
1182
- decimals: o = 0,
1183
- value: s,
1184
- defaultValue: i,
1185
- onChange: d,
1186
- disabled: c,
1187
- placeholder: u,
1188
- inputSize: f = "md",
1189
- id: m,
1190
- name: p,
1191
- min: g,
1192
- max: w,
1193
- step: N,
1194
- required: x,
1195
- className: B = ""
1196
- }, v) => {
1197
- const q = Y(), I = m ?? q, C = s !== void 0, [U, G] = k(
1198
- i !== void 0 ? i : ""
1199
- ), [T, L] = k(!1), [z, S] = k(""), K = A(null), y = C ? s : U, O = T ? z : _e(y, o, a), W = j(() => {
1200
- L(!0), S(y === "" ? "" : String(y));
1201
- }, [y]), J = j(() => {
1202
- L(!1);
1203
- const h = parseFloat(z.replace(",", ".")), M = isNaN(h) ? "" : h;
1204
- C || G(M), d == null || d(M);
1205
- }, [z, C, d]), Q = j((h) => {
1206
- S(h.target.value);
1207
- }, []), X = j(
1208
- (h) => {
1209
- K.current = h, typeof v == "function" ? v(h) : v && (v.current = h);
1210
- },
1211
- [v]
1212
- );
1213
- return /* @__PURE__ */ l("div", { className: "flex flex-col gap-1.5", children: [
1214
- e && /* @__PURE__ */ n("label", { htmlFor: I, className: "text-sm font-medium text-on-surface", children: e }),
1215
- /* @__PURE__ */ n(
1216
- "input",
1217
- {
1218
- ref: X,
1219
- id: I,
1220
- name: p,
1221
- type: T ? "number" : "text",
1222
- inputMode: "decimal",
1223
- value: O,
1224
- placeholder: u,
1225
- disabled: c,
1226
- required: x,
1227
- min: g,
1228
- max: w,
1229
- step: N ?? (o > 0 ? Math.pow(10, -o) : 1),
1230
- onFocus: W,
1231
- onBlur: J,
1232
- onChange: Q,
1233
- className: [
1234
- "w-full bg-white border rounded transition-all duration-200",
1235
- "text-on-surface placeholder:text-on-surface-variant",
1236
- "focus:outline-none focus:border-zeo-orange focus:shadow-zeo-focus",
1237
- r ? "border-error focus:border-error focus:shadow-[0_0_0_4px_rgba(186,26,26,0.15)]" : "border-outline-variant",
1238
- "disabled:bg-surface-container-low disabled:cursor-not-allowed disabled:opacity-60",
1239
- "[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",
1240
- $e[f],
1241
- B
1242
- ].filter(Boolean).join(" ")
1243
- }
1244
- ),
1245
- r && /* @__PURE__ */ l("p", { className: "text-xs text-error flex items-center gap-1", children: [
1246
- /* @__PURE__ */ n("span", { className: "material-symbols-outlined text-[14px]", children: "error" }),
1247
- r
1248
- ] }),
1249
- !r && t && /* @__PURE__ */ n("p", { className: "text-xs text-on-surface-variant", children: t })
1250
- ] });
1251
- }
1252
- );
1253
- Fe.displayName = "UnitInput";
1254
1238
  export {
1255
- Le as Alert,
1256
- Se as Avatar,
1257
- Me as Badge,
1258
- Ee as Breadcrumb,
1259
- ce as Button,
1260
- Ae as ButtonGroup,
1261
- De as Card,
1262
- He as CardFooter,
1263
- Re as CardHeader,
1264
- xe as Checkbox,
1239
+ Ge as Alert,
1240
+ Ue as Avatar,
1241
+ We as Badge,
1242
+ qe as Breadcrumb,
1243
+ ge as Button,
1244
+ Oe as ButtonGroup,
1245
+ Ke as Card,
1246
+ Qe as CardFooter,
1247
+ Je as CardHeader,
1248
+ ke as Checkbox,
1265
1249
  Ve as Dropdown,
1266
- we as Input,
1267
- qe as Modal,
1268
- Ge as ModalBody,
1269
- Ke as ModalFooter,
1270
- Ue as ModalHeader,
1271
- Oe as Pagination,
1272
- We as ProgressBar,
1273
- he as Radio,
1274
- fe as Select,
1275
- Je as Spinner,
1276
- be as Switch,
1277
- nt as Tab,
1278
- rt as TabList,
1279
- at as TabPanel,
1280
- Qe as Table,
1281
- Ye as TableBody,
1282
- et as TableCell,
1283
- Xe as TableHead,
1284
- Pe as TableHeaderCell,
1285
- Ze as TableRow,
1286
- tt as Tabs,
1287
- me as Textarea,
1288
- ot as Tooltip,
1289
- Fe as UnitInput
1250
+ _e as Input,
1251
+ Xe as Modal,
1252
+ Ze as ModalBody,
1253
+ Pe as ModalFooter,
1254
+ Ye as ModalHeader,
1255
+ et as Pagination,
1256
+ tt as ProgressBar,
1257
+ Be as Radio,
1258
+ ye as Select,
1259
+ rt as Spinner,
1260
+ Ce as Switch,
1261
+ ut as Tab,
1262
+ dt as TabList,
1263
+ ft as TabPanel,
1264
+ nt as Table,
1265
+ ot as TableBody,
1266
+ it as TableCell,
1267
+ at as TableHead,
1268
+ lt as TableHeaderCell,
1269
+ st as TableRow,
1270
+ ct as Tabs,
1271
+ Ne as Textarea,
1272
+ mt as Tooltip
1290
1273
  };