@chotot/clad-ui 3.0.0-next.4 → 3.0.0-next.5

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.
Files changed (36) hide show
  1. package/dist/clad-ui.cjs +2 -2
  2. package/dist/clad-ui.es.js +1105 -1032
  3. package/dist/components/Badge/types.d.ts +1 -1
  4. package/dist/components/Box/types.d.ts +1 -1
  5. package/dist/components/CurrencyInput/types.d.ts +1 -1
  6. package/dist/components/DatePicker/types.d.ts +10 -2
  7. package/dist/components/Drawer/types.d.ts +11 -6
  8. package/dist/components/Dropdown/types.d.ts +1 -1
  9. package/dist/components/Grid/types.d.ts +2 -2
  10. package/dist/components/InputGroup/types.d.ts +1 -1
  11. package/dist/components/LegacyDialog/types.d.ts +1 -1
  12. package/dist/components/LegacyPopup/types.d.ts +1 -1
  13. package/dist/components/Pagination/types.d.ts +1 -1
  14. package/dist/components/Popup/types.d.ts +5 -5
  15. package/dist/components/RangeInput/types.d.ts +1 -1
  16. package/dist/components/RowItem/RowItem.d.ts +1 -1
  17. package/dist/components/RowItem/types.d.ts +2 -2
  18. package/dist/components/Slider/types.d.ts +1 -1
  19. package/dist/components/Snack/types.d.ts +2 -2
  20. package/dist/components/Tabs/Tabs.d.ts +2 -11
  21. package/dist/components/Tabs/types.d.ts +2 -2
  22. package/dist/components/TagCloud/TagCloud.d.ts +265 -1
  23. package/dist/components/TagCloud/types.d.ts +1 -1
  24. package/dist/components/TextArea/types.d.ts +1 -1
  25. package/dist/components/ToggleSwitch/types.d.ts +1 -1
  26. package/dist/components/Tooltip/types.d.ts +1 -1
  27. package/dist/styles.css +1 -1
  28. package/package.json +1 -1
  29. package/skills/clad-ui/SKILL.md +1 -1
  30. package/skills/clad-ui/references/components-display-layout.md +3 -1
  31. package/skills/clad-ui/references/components-inputs.md +3 -1
  32. package/skills/clad-ui/references/components-overlays-nav.md +6 -6
  33. package/skills/clad-ui-feedback/SKILL.md +1 -1
  34. package/skills/migrate-clad-ui-v3/SKILL.md +3 -2
  35. package/skills/migrate-clad-ui-v3/references/component-api-changes.md +7 -1
  36. package/skills/migrate-clad-ui-v3/references/token-and-linaria-mapping.md +8 -0
@@ -5,7 +5,7 @@ import { Fragment as N, jsx as P, jsxs as F } from "react/jsx-runtime";
5
5
  import * as I from "react-dom";
6
6
  import { createPortal as L } from "react-dom";
7
7
  //#region ../../node_modules/.pnpm/cn@0.5.0/node_modules/cn/dist/compiler2.js
8
- var R = Object.defineProperty, z = /* @__PURE__ */ ((e, t) => {
8
+ var R = Object.defineProperty, ee = /* @__PURE__ */ ((e, t) => {
9
9
  let n = {};
10
10
  for (var r in e) R(n, r, {
11
11
  get: e[r],
@@ -32,19 +32,19 @@ var R = Object.defineProperty, z = /* @__PURE__ */ ((e, t) => {
32
32
  isArbitraryVariableSize: () => Fe,
33
33
  isArbitraryVariableWeight: () => Re,
34
34
  isArbitraryWeight: () => Ee,
35
- isFraction: () => q,
35
+ isFraction: () => K,
36
36
  isInteger: () => ne,
37
37
  isNamedContainerQuery: () => de,
38
- isNumber: () => te,
38
+ isNumber: () => q,
39
39
  isPercent: () => re,
40
40
  isTshirtSize: () => ie
41
- }), B = /^\[(?:(\w[\w-]*):)?(.+)\]$/i, V = /^\((?:(\w[\w-]*):)?(.+)\)$/i, H = /^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/, U = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/, W = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/, G = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/, ee = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/, K = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/, q = (e) => H.test(e), te = (e) => !!e && !Number.isNaN(Number(e)), ne = (e) => !!e && Number.isInteger(Number(e)), re = (e) => e.endsWith("%") && te(e.slice(0, -1)), ie = (e) => U.test(e), ae = () => !0, oe = (e) => W.test(e) && !G.test(e), se = () => !1, ce = (e) => ee.test(e), le = (e) => K.test(e), ue = (e) => !Ce(e) && !je(e), de = (e) => e.startsWith("@container") && (e[10] === "/" && e[11] !== void 0 || e[11] === "s" && e[16] !== void 0 && e.startsWith("-size/", 10) || e[11] === "n" && e[18] !== void 0 && e.startsWith("-normal/", 10)), fe = (e, t, n) => {
42
- let r = B.exec(e);
41
+ }), z = /^\[(?:(\w[\w-]*):)?(.+)\]$/i, B = /^\((?:(\w[\w-]*):)?(.+)\)$/i, V = /^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/, H = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/, U = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/, W = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/, G = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/, te = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/, K = (e) => V.test(e), q = (e) => !!e && !Number.isNaN(Number(e)), ne = (e) => !!e && Number.isInteger(Number(e)), re = (e) => e.endsWith("%") && q(e.slice(0, -1)), ie = (e) => H.test(e), ae = () => !0, oe = (e) => U.test(e) && !W.test(e), se = () => !1, ce = (e) => G.test(e), le = (e) => te.test(e), ue = (e) => !Ce(e) && !je(e), de = (e) => e.startsWith("@container") && (e[10] === "/" && e[11] !== void 0 || e[11] === "s" && e[16] !== void 0 && e.startsWith("-size/", 10) || e[11] === "n" && e[18] !== void 0 && e.startsWith("-normal/", 10)), fe = (e, t, n) => {
42
+ let r = z.exec(e);
43
43
  return r ? r[1] ? t(r[1]) : n(r[2]) : !1;
44
44
  }, pe = (e, t, n = !1) => {
45
- let r = V.exec(e);
45
+ let r = B.exec(e);
46
46
  return r ? r[1] ? t(r[1]) : n : !1;
47
- }, me = (e) => e === "position" || e === "percentage", he = (e) => e === "image" || e === "url", ge = (e) => e === "length" || e === "size" || e === "bg-size", _e = (e) => e === "length", ve = (e) => e === "number", ye = (e) => e === "family-name", be = (e) => e === "number" || e === "weight", xe = (e) => e === "shadow", Se = (e) => fe(e, ge, se), Ce = (e) => B.test(e), we = (e) => fe(e, _e, oe), Te = (e) => fe(e, ve, te), Ee = (e) => fe(e, be, ae), De = (e) => fe(e, ye, se), Oe = (e) => fe(e, me, se), ke = (e) => fe(e, he, le), Ae = (e) => fe(e, xe, ce), je = (e) => V.test(e), Me = (e) => pe(e, _e), Ne = (e) => pe(e, ye), Pe = (e) => pe(e, me), Fe = (e) => pe(e, ge), Ie = (e) => pe(e, he), Le = (e) => pe(e, xe, !0), Re = (e) => pe(e, be, !0), ze = (e, t) => {
47
+ }, me = (e) => e === "position" || e === "percentage", he = (e) => e === "image" || e === "url", ge = (e) => e === "length" || e === "size" || e === "bg-size", _e = (e) => e === "length", ve = (e) => e === "number", ye = (e) => e === "family-name", be = (e) => e === "number" || e === "weight", xe = (e) => e === "shadow", Se = (e) => fe(e, ge, se), Ce = (e) => z.test(e), we = (e) => fe(e, _e, oe), Te = (e) => fe(e, ve, q), Ee = (e) => fe(e, be, ae), De = (e) => fe(e, ye, se), Oe = (e) => fe(e, me, se), ke = (e) => fe(e, he, le), Ae = (e) => fe(e, xe, ce), je = (e) => B.test(e), Me = (e) => pe(e, _e), Ne = (e) => pe(e, ye), Pe = (e) => pe(e, me), Fe = (e) => pe(e, ge), Ie = (e) => pe(e, he), Le = (e) => pe(e, xe, !0), Re = (e) => pe(e, be, !0), ze = (e, t) => {
48
48
  let n = Object.keys(e);
49
49
  return n.length === 1 && n[0] === t && typeof e[t] == "string";
50
50
  }, Be = (e) => typeof e == "function" && e.isThemeGetter === !0, Ve = (e) => ({
@@ -109,7 +109,7 @@ var R = Object.defineProperty, z = /* @__PURE__ */ ((e, t) => {
109
109
  let n = e.fnName.get(t);
110
110
  return n === void 0 && (n = "$c" + e.fnName.size, e.fnName.set(t, n), e.impls[n] = t), Ke(e, n, t);
111
111
  }
112
- let n = t.$v, r = z[n];
112
+ let n = t.$v, r = ee[n];
113
113
  if (Ue[n] === void 0 || !r) throw Error(`cn: unknown validator "${n}"`);
114
114
  return Ke(e, n, r);
115
115
  }, Je = () => ({
@@ -306,26 +306,26 @@ var R = Object.defineProperty, z = /* @__PURE__ */ ((e, t) => {
306
306
  for (let t of Object.values(e.conflictingClassGroups)) for (let e of t) i(e);
307
307
  for (let t of Object.values(e.conflictingClassGroupModifiers)) for (let e of t) i(e);
308
308
  for (let t of e.postfixLookupClassGroups ?? []) i(t);
309
- let L = n.length, R = new Int32Array(L).fill(-1), z = 0, B = (e) => (R[e] === -1 && (R[e] = z++), R[e]);
310
- for (let e = 0; e < M.length; e++) M[e] = B(M[e]);
311
- for (let e of N) e.gid = B(e.gid);
312
- for (let e = 0; e < D.length; e++) D[e] >= 0 && (D[e] = B(D[e]));
313
- for (let e = 0; e < L; e++) R[e] === -1 && (R[e] = z++);
314
- let V = Array(L);
315
- for (let e = 0; e < L; e++) V[R[e]] = n[e];
316
- let H = [], U = [], W = [], G = [], ee = [];
309
+ let L = n.length, R = new Int32Array(L).fill(-1), ee = 0, z = (e) => (R[e] === -1 && (R[e] = ee++), R[e]);
310
+ for (let e = 0; e < M.length; e++) M[e] = z(M[e]);
311
+ for (let e of N) e.gid = z(e.gid);
312
+ for (let e = 0; e < D.length; e++) D[e] >= 0 && (D[e] = z(D[e]));
313
+ for (let e = 0; e < L; e++) R[e] === -1 && (R[e] = ee++);
314
+ let B = Array(L);
315
+ for (let e = 0; e < L; e++) B[R[e]] = n[e];
316
+ let V = [], H = [], U = [], W = [], G = [];
317
317
  for (let t = 0; t < L; t++) {
318
- let n = V[t], i = (e.conflictingClassGroups[n] ?? []).map((e) => R[r.get(e)]), a = (e.conflictingClassGroupModifiers[n] ?? []).map((e) => R[r.get(e)]);
319
- i.length && (H.push(t), U.push(i.length), W.push(...i));
320
- for (let e of a) G.push(t), ee.push(e);
318
+ let n = B[t], i = (e.conflictingClassGroups[n] ?? []).map((e) => R[r.get(e)]), a = (e.conflictingClassGroupModifiers[n] ?? []).map((e) => R[r.get(e)]);
319
+ i.length && (V.push(t), H.push(i.length), U.push(...i));
320
+ for (let e of a) W.push(t), G.push(e);
321
321
  }
322
- let K = (e.postfixLookupClassGroups ?? []).map((e) => R[r.get(e)]), q = [], te = new Int32Array(j.length);
322
+ let te = (e.postfixLookupClassGroups ?? []).map((e) => R[r.get(e)]), K = [], q = new Int32Array(j.length);
323
323
  for (let e = 0; e < j.length; e++) {
324
324
  let n = t.names[j[e]], r = Ue[n];
325
- if (r !== void 0) te[e] = r;
325
+ if (r !== void 0) q[e] = r;
326
326
  else {
327
- let t = q.indexOf(n);
328
- t === -1 && (t = q.length, q.push(n)), te[e] = We + t;
327
+ let t = K.indexOf(n);
328
+ t === -1 && (t = K.length, K.push(n)), q[e] = We + t;
329
329
  }
330
330
  }
331
331
  let ne = /* @__PURE__ */ new Map(), re = [], ie = [], ae = [];
@@ -333,16 +333,16 @@ var R = Object.defineProperty, z = /* @__PURE__ */ ((e, t) => {
333
333
  let e = 0;
334
334
  for (let t of d) {
335
335
  let n = [];
336
- for (let r = 0; r < t.length; r++) n.push(te[e++]);
336
+ for (let r = 0; r < t.length; r++) n.push(q[e++]);
337
337
  let r = n.join(","), i = ne.get(r);
338
338
  i === void 0 && (i = re.length, ne.set(r, i), re.push(n.length), ie.push(...n)), ae.push(i);
339
339
  }
340
340
  }
341
341
  let oe = {};
342
- for (let e of q) oe[e] = t.classifierFns.get(e);
342
+ for (let e of K) oe[e] = t.classifierFns.get(e);
343
343
  return {
344
344
  G: L,
345
- customNames: q,
345
+ customNames: K,
346
346
  impls: oe,
347
347
  edgeCounts: w,
348
348
  edgeLabelLen: T,
@@ -360,12 +360,12 @@ var R = Object.defineProperty, z = /* @__PURE__ */ ((e, t) => {
360
360
  sets: F,
361
361
  attachments: N,
362
362
  uniqueTailCount: I,
363
- adjGid: H,
364
- adjCnt: U,
365
- adjTgt: W,
366
- patGid: G,
367
- patTgt: ee,
368
- postfixLookup: K,
363
+ adjGid: V,
364
+ adjCnt: H,
365
+ adjTgt: U,
366
+ patGid: W,
367
+ patTgt: G,
368
+ postfixLookup: te,
369
369
  orderSensitiveModifiers: e.orderSensitiveModifiers.join(" "),
370
370
  prefix: e.prefix
371
371
  };
@@ -469,15 +469,15 @@ var R = Object.defineProperty, z = /* @__PURE__ */ ((e, t) => {
469
469
  }
470
470
  i = i + 1 & I - 1;
471
471
  }
472
- }, z = n.cacheSize ?? 8192, B = n.prefix ?? e.prefix ?? "", V = B === "" ? "" : B + ":", H = V.length, U = (T ?? []).map((e) => {
472
+ }, ee = n.cacheSize ?? 8192, z = n.prefix ?? e.prefix ?? "", B = z === "" ? "" : z + ":", V = B.length, H = (T ?? []).map((e) => {
473
473
  let n = t && t[e];
474
474
  if (!n) throw Error("cn: missing validator " + e);
475
475
  return n;
476
- }), W = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/, G = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/, ee = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/, K = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/, q = 0, te = -1, ne = -1, re = -1, ie = -1, ae = (e) => e >= 97 && e <= 122 || e >= 65 && e <= 90 || e >= 48 && e <= 57 || e === 95, oe = (e) => /\s/.test(String.fromCharCode(e)), se = (e, t, n) => {
477
- if (q = 0, te = -1, n - t < 3) return;
476
+ }), U = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/, W = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/, G = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/, te = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/, K = 0, q = -1, ne = -1, re = -1, ie = -1, ae = (e) => e >= 97 && e <= 122 || e >= 65 && e <= 90 || e >= 48 && e <= 57 || e === 95, oe = (e) => /\s/.test(String.fromCharCode(e)), se = (e, t, n) => {
477
+ if (K = 0, q = -1, n - t < 3) return;
478
478
  let r = e.charCodeAt(t), i = e.charCodeAt(n - 1);
479
- if (r === 91 && i === 93) q = 1;
480
- else if (r === 40 && i === 41) q = 2;
479
+ if (r === 91 && i === 93) K = 1;
480
+ else if (r === 40 && i === 41) K = 2;
481
481
  else return;
482
482
  re = t + 1, ie = n - 1;
483
483
  let a = t + 1;
@@ -487,7 +487,7 @@ var R = Object.defineProperty, z = /* @__PURE__ */ ((e, t) => {
487
487
  if (!ae(t) && t !== 45) break;
488
488
  a++;
489
489
  }
490
- a < n - 2 && e.charCodeAt(a) === 58 && (te = t + 1, ne = a, re = a + 1);
490
+ a < n - 2 && e.charCodeAt(a) === 58 && (q = t + 1, ne = a, re = a + 1);
491
491
  }
492
492
  }, ce = (e, t, n, r) => {
493
493
  if (n - t !== r.length) return !1;
@@ -532,11 +532,11 @@ var R = Object.defineProperty, z = /* @__PURE__ */ ((e, t) => {
532
532
  1
533
533
  ], ge = (e, t, n, r) => {
534
534
  if (e >= 10) {
535
- if (e >= 25) return U[e - 25](t.slice(n, r));
535
+ if (e >= 25) return H[e - 25](t.slice(n, r));
536
536
  let i = e - 10;
537
- if (q !== pe[i]) return !1;
538
- if (te >= 0) {
539
- for (let e of me[i]) if (ce(t, te, ne, e)) return !0;
537
+ if (K !== pe[i]) return !1;
538
+ if (q >= 0) {
539
+ for (let e of me[i]) if (ce(t, q, ne, e)) return !0;
540
540
  return !1;
541
541
  }
542
542
  switch (he[i]) {
@@ -544,18 +544,18 @@ var R = Object.defineProperty, z = /* @__PURE__ */ ((e, t) => {
544
544
  case 1: return !0;
545
545
  case 2: {
546
546
  let e = t.slice(re, ie);
547
- return W.test(e) && !G.test(e);
547
+ return U.test(e) && !W.test(e);
548
548
  }
549
549
  case 3: return de(t.slice(re, ie));
550
- case 4: return K.test(t.slice(re, ie));
551
- default: return ee.test(t.slice(re, ie));
550
+ case 4: return te.test(t.slice(re, ie));
551
+ default: return G.test(t.slice(re, ie));
552
552
  }
553
553
  }
554
554
  switch (e) {
555
555
  case 0: return !0;
556
- case 1: return q === 0;
557
- case 2: return q === 1;
558
- case 3: return q === 2;
556
+ case 1: return K === 0;
557
+ case 2: return K === 1;
558
+ case 3: return K === 2;
559
559
  case 4: return le.test(t.slice(n, r));
560
560
  case 5: return de(t.slice(n, r));
561
561
  case 6: {
@@ -697,12 +697,12 @@ var R = Object.defineProperty, z = /* @__PURE__ */ ((e, t) => {
697
697
  }
698
698
  }
699
699
  let b = p;
700
- if (H !== 0) {
701
- if (h - p <= H || !e.startsWith(V, p)) {
700
+ if (V !== 0) {
701
+ if (h - p <= V || !e.startsWith(B, p)) {
702
702
  He[_] = tt, Ie(y, e, p, h, v, tt, 0, 0);
703
703
  continue;
704
704
  }
705
- b = p + H;
705
+ b = p + V;
706
706
  }
707
707
  let x = 0, S = 0, C = -1, w = -1;
708
708
  for (let t = b; t < h; t++) {
@@ -727,8 +727,8 @@ var R = Object.defineProperty, z = /* @__PURE__ */ ((e, t) => {
727
727
  D - E > 1 && e.charCodeAt(E) === 45 && (M = E + 1);
728
728
  let P = 0, F = 0, I = 0, L = -1, R = 0;
729
729
  (l[0] >= 0 || N[0] === 1) && (Je[0] = 0, Ye[0] = M, R = 1);
730
- let z = nt, B = 0;
731
- for (let t = M; t < D; t++) if (t === A && (z = F < I ? nt : P, B = R), P !== nt) {
730
+ let ee = nt, z = 0;
731
+ for (let t = M; t < D; t++) if (t === A && (ee = F < I ? nt : P, z = R), P !== nt) {
732
732
  let n = e.charCodeAt(t), r = -1;
733
733
  if (F < I) o.charCodeAt(F) === n ? (F++, F === I && (r = P = L)) : P = nt;
734
734
  else {
@@ -753,15 +753,15 @@ var R = Object.defineProperty, z = /* @__PURE__ */ ((e, t) => {
753
753
  Je[R] = r, Ye[R] = t + 2, R++;
754
754
  }
755
755
  }
756
- A === D && (z = F < I ? nt : P, B = R);
757
- let U = F < I ? nt : P, W, G = !1;
758
- if (A >= 0) if (G = !0, W = lt(e, E, A, z, B), W !== tt && W < r && j[W]) {
759
- let t = lt(e, E, D, U, R);
760
- t !== tt && t !== W && (W = t, G = !1);
761
- } else W === tt && (W = lt(e, E, D, U, R), G = !1);
762
- else W = lt(e, E, D, U, R);
763
- let ee = 0, K = 0;
764
- W === tt ? He[_] = tt : (K = G ? 1 : 0, ee = b >= C ? O ? 1 : 0 : ve(ye, e, b, C, O ? 1 : 0, (e) => Ce(e, O)), He[_] = W, We[_] = K, Ue[_] = ee), Ie(y, e, p, h, v, W, ee, K);
756
+ A === D && (ee = F < I ? nt : P, z = R);
757
+ let H = F < I ? nt : P, U, W = !1;
758
+ if (A >= 0) if (W = !0, U = lt(e, E, A, ee, z), U !== tt && U < r && j[U]) {
759
+ let t = lt(e, E, D, H, R);
760
+ t !== tt && t !== U && (U = t, W = !1);
761
+ } else U === tt && (U = lt(e, E, D, H, R), W = !1);
762
+ else U = lt(e, E, D, H, R);
763
+ let G = 0, te = 0;
764
+ U === tt ? He[_] = tt : (te = W ? 1 : 0, G = b >= C ? O ? 1 : 0 : ve(ye, e, b, C, O ? 1 : 0, (e) => Ce(e, O)), He[_] = U, We[_] = te, Ue[_] = G), Ie(y, e, p, h, v, U, G, te);
765
765
  }
766
766
  if (n === 0) return "";
767
767
  if (n === 1) return Be[0] === 0 && Ve[0] === t ? e : e.slice(Be[0], Ve[0]);
@@ -807,16 +807,16 @@ var R = Object.defineProperty, z = /* @__PURE__ */ ((e, t) => {
807
807
  let t = ht[e];
808
808
  if (t !== void 0) return t;
809
809
  let n = it(e, 0, e.length), r = (n & 16383) + pt, i = ft[r] === (n ^ mt) || ft[r ^ dt] === (n ^ mt - 1);
810
- return i && (t = gt[e], t !== void 0) ? (ht[e] = t, t) : (t = ut(e), i ? (ht[e] = t, ++J > z && (J = 0, gt = ht, ht = Object.create(null), bt())) : (ft[r] = n ^ mt, ++yt > dt && bt()), t);
810
+ return i && (t = gt[e], t !== void 0) ? (ht[e] = t, t) : (t = ut(e), i ? (ht[e] = t, ++J > ee && (J = 0, gt = ht, ht = Object.create(null), bt())) : (ft[r] = n ^ mt, ++yt > dt && bt()), t);
811
811
  }, St = (e) => {
812
812
  let t = _t.get(e);
813
813
  if (t !== void 0) return t;
814
814
  let n = it(e, 0, e.length), r = (n & 16383) + pt, i = ft[r] === (n ^ mt) || ft[r ^ dt] === (n ^ mt - 1);
815
- return i && (t = vt.get(e), t !== void 0) ? (_t.set(e, t), t) : (t = ut(e), i ? (_t.set(e, t), ++J > z && (J = 0, vt = _t, _t = /* @__PURE__ */ new Map(), bt())) : (ft[r] = n ^ mt, ++yt > dt && bt()), t);
815
+ return i && (t = vt.get(e), t !== void 0) ? (_t.set(e, t), t) : (t = ut(e), i ? (_t.set(e, t), ++J > ee && (J = 0, vt = _t, _t = /* @__PURE__ */ new Map(), bt())) : (ft[r] = n ^ mt, ++yt > dt && bt()), t);
816
816
  }, Ct = (e) => {
817
817
  let t = it(e, 0, e.length), n = (t & 16383) + pt;
818
818
  return ft[n] === (t ^ mt) || ft[n ^ dt] === (t ^ mt - 1) ? !0 : (ft[n] = t ^ mt, ++yt > dt && bt(), !1);
819
- }, wt = z === 0 ? ut : et ? (e) => {
819
+ }, wt = ee === 0 ? ut : et ? (e) => {
820
820
  let t = _t.get(e);
821
821
  return t === void 0 ? St(e) : t;
822
822
  } : xt;
@@ -825,7 +825,7 @@ var R = Object.defineProperty, z = /* @__PURE__ */ ((e, t) => {
825
825
  return arguments.length === 1 && typeof arguments[0] == "string" ? wt(arguments[0]) : wt(ct.apply(null, arguments));
826
826
  },
827
827
  mergeString: wt,
828
- seenBefore: z === 0 ? () => !1 : Ct,
828
+ seenBefore: ee === 0 ? () => !1 : Ct,
829
829
  mergeUncached: ut
830
830
  };
831
831
  }, ot = (e, t) => {
@@ -1774,8 +1774,8 @@ var jn = Y({
1774
1774
  sm: "8px",
1775
1775
  md: "8px",
1776
1776
  lg: "10px"
1777
- }, Pn = ({ size: t = "sm", children: n = "Default Badge Children", label: r = "", backgroundColor: i = "warning", variant: a = "solid", position: o = "topRight", zIndex: s = 1, borderRadius: c = "none", className: l = "" }) => {
1778
- let u = e.useMemo(() => {
1777
+ }, Pn = ({ size: t = "sm", children: n = "Default Badge Children", label: r = "", backgroundColor: i = "warning", variant: a = "solid", position: o = "topRight", zIndex: s = 1, borderRadius: c = "none", className: l = "", style: u, ...d }) => {
1778
+ let f = e.useMemo(() => {
1779
1779
  let e = Nn[t] || "8px", n = t === "dot" ? "100%" : c ? Mn[c] : Mn.pill;
1780
1780
  switch (o) {
1781
1781
  case "right": return {
@@ -1820,13 +1820,17 @@ var jn = Y({
1820
1820
  return /* @__PURE__ */ F("div", {
1821
1821
  className: "badge-wrapper",
1822
1822
  children: [/* @__PURE__ */ P("div", {
1823
+ ...d,
1823
1824
  "data-clad": "Badge",
1824
1825
  className: J(jn({
1825
1826
  size: t,
1826
1827
  backgroundColor: i,
1827
1828
  variant: a
1828
1829
  }), l),
1829
- style: u,
1830
+ style: {
1831
+ ...f,
1832
+ ...u
1833
+ },
1830
1834
  children: t !== "dot" && r
1831
1835
  }), n]
1832
1836
  });
@@ -2180,64 +2184,66 @@ var Ln = {
2180
2184
  interactionWarningPressed: "var(--color-interaction-warning-pressed)",
2181
2185
  interactionWarningLightHover: "var(--color-interaction-warning-light-hover)",
2182
2186
  interactionWarningLightPressed: "var(--color-interaction-warning-light-pressed)"
2183
- }, Un = (e, t) => In(e, t).map((e) => Ln[e] || Ln.none), Wn = (e, t) => In(e, t).map((e) => Rn[e] || "initial"), Gn = (e, t) => In(e, t).map((e) => `${zn[e] || zn.none}`), Kn = (e, t) => In(e, t).map((e) => Bn[e] || Bn.none), qn = (e, t) => In(e, t).map((e) => Vn[e] || Vn.none), Jn = ({ as: e = "div", className: t = "", style: n = void 0, borderColor: r = null, alignItems: i = "initial", justifyContent: a = "initial", textAlign: o = "initial", color: s = null, backgroundColor: c = null, backgroundImage: l = "", padding: u = "none", paddingx: d = null, paddingy: f = null, width: p = "full", maxWidth: m = "full", height: h = "initial", borderWidth: g = "none", borderRadius: _ = "none", boxShadow: v = "none", children: y = null, dangerousHtml: b = "" }) => {
2184
- let x = J("clad-box", (a !== "initial" || i !== "initial") && "flex", t), S;
2185
- typeof b == "string" && b.trim() && (S = { __html: Fn(b) });
2186
- let C = i === "start" && "flex-start" || i === "end" && "flex-end" || i, w = a === "start" && "flex-start" || a === "end" && "flex-end" || a === "between" && "space-between" || a === "around" && "space-around" || a, T = d ?? u, E = f ?? u, D = Un(T, "initial"), O = Un(E, "initial"), k = Wn(p, "initial"), A = Wn(m, "initial"), j = Wn(h, "initial"), M = Gn(g, "initial"), N = Kn(_, "initial"), F = qn(v, "initial");
2187
+ }, Un = (e, t) => In(e, t).map((e) => Ln[e] || Ln.none), Wn = (e, t) => In(e, t).map((e) => Rn[e] || "initial"), Gn = (e, t) => In(e, t).map((e) => `${zn[e] || zn.none}`), Kn = (e, t) => In(e, t).map((e) => Bn[e] || Bn.none), qn = (e, t) => In(e, t).map((e) => Vn[e] || Vn.none), Jn = ({ as: e = "div", className: t = "", style: n = void 0, borderColor: r = null, alignItems: i = "initial", justifyContent: a = "initial", textAlign: o = "initial", color: s = null, backgroundColor: c = null, backgroundImage: l = "", padding: u = "none", paddingx: d = null, paddingy: f = null, width: p = "full", maxWidth: m = "full", height: h = "initial", borderWidth: g = "none", borderRadius: _ = "none", boxShadow: v = "none", children: y = null, dangerousHtml: b = "", ...x }) => {
2188
+ let S = J("clad-box", (a !== "initial" || i !== "initial") && "flex", t), C;
2189
+ typeof b == "string" && b.trim() && (C = { __html: Fn(b) });
2190
+ let w = i === "start" && "flex-start" || i === "end" && "flex-end" || i, T = a === "start" && "flex-start" || a === "end" && "flex-end" || a === "between" && "space-between" || a === "around" && "space-around" || a, E = d ?? u, D = f ?? u, O = Un(E, "initial"), k = Un(D, "initial"), A = Wn(p, "initial"), j = Wn(m, "initial"), M = Wn(h, "initial"), N = Gn(g, "initial"), F = Kn(_, "initial"), I = qn(v, "initial"), L = {
2191
+ "--box-color": s && Hn[s] || "initial",
2192
+ "--box-text-align": o,
2193
+ "--box-bg-color": c && Hn[c] || "transparent",
2194
+ "--box-border-color": r && Hn[r] || "currentColor",
2195
+ "--box-bg-image": l ? `url(${l})` : "none",
2196
+ "--box-justify": T,
2197
+ "--box-align": w,
2198
+ "--box-px-0": O[0],
2199
+ "--box-px-1": O[1],
2200
+ "--box-px-2": O[2],
2201
+ "--box-px-3": O[3],
2202
+ "--box-px-4": O[4],
2203
+ "--box-py-0": k[0],
2204
+ "--box-py-1": k[1],
2205
+ "--box-py-2": k[2],
2206
+ "--box-py-3": k[3],
2207
+ "--box-py-4": k[4],
2208
+ "--box-w-0": A[0],
2209
+ "--box-w-1": A[1],
2210
+ "--box-w-2": A[2],
2211
+ "--box-w-3": A[3],
2212
+ "--box-w-4": A[4],
2213
+ "--box-max-w-0": j[0],
2214
+ "--box-max-w-1": j[1],
2215
+ "--box-max-w-2": j[2],
2216
+ "--box-max-w-3": j[3],
2217
+ "--box-max-w-4": j[4],
2218
+ "--box-h-0": M[0],
2219
+ "--box-h-1": M[1],
2220
+ "--box-h-2": M[2],
2221
+ "--box-h-3": M[3],
2222
+ "--box-h-4": M[4],
2223
+ "--box-bw-0": N[0],
2224
+ "--box-bw-1": N[1],
2225
+ "--box-bw-2": N[2],
2226
+ "--box-bw-3": N[3],
2227
+ "--box-bw-4": N[4],
2228
+ "--box-br-0": F[0],
2229
+ "--box-br-1": F[1],
2230
+ "--box-br-2": F[2],
2231
+ "--box-br-3": F[3],
2232
+ "--box-br-4": F[4],
2233
+ "--box-shadow-0": I[0],
2234
+ "--box-shadow-1": I[1],
2235
+ "--box-shadow-2": I[2],
2236
+ "--box-shadow-3": I[3],
2237
+ "--box-shadow-4": I[4],
2238
+ ...n
2239
+ };
2187
2240
  return /* @__PURE__ */ P(e, {
2188
- className: x,
2189
- style: {
2190
- "--box-color": s && Hn[s] || "initial",
2191
- "--box-text-align": o,
2192
- "--box-bg-color": c && Hn[c] || "transparent",
2193
- "--box-border-color": r && Hn[r] || "currentColor",
2194
- "--box-bg-image": l ? `url(${l})` : "none",
2195
- "--box-justify": w,
2196
- "--box-align": C,
2197
- "--box-px-0": D[0],
2198
- "--box-px-1": D[1],
2199
- "--box-px-2": D[2],
2200
- "--box-px-3": D[3],
2201
- "--box-px-4": D[4],
2202
- "--box-py-0": O[0],
2203
- "--box-py-1": O[1],
2204
- "--box-py-2": O[2],
2205
- "--box-py-3": O[3],
2206
- "--box-py-4": O[4],
2207
- "--box-w-0": k[0],
2208
- "--box-w-1": k[1],
2209
- "--box-w-2": k[2],
2210
- "--box-w-3": k[3],
2211
- "--box-w-4": k[4],
2212
- "--box-max-w-0": A[0],
2213
- "--box-max-w-1": A[1],
2214
- "--box-max-w-2": A[2],
2215
- "--box-max-w-3": A[3],
2216
- "--box-max-w-4": A[4],
2217
- "--box-h-0": j[0],
2218
- "--box-h-1": j[1],
2219
- "--box-h-2": j[2],
2220
- "--box-h-3": j[3],
2221
- "--box-h-4": j[4],
2222
- "--box-bw-0": M[0],
2223
- "--box-bw-1": M[1],
2224
- "--box-bw-2": M[2],
2225
- "--box-bw-3": M[3],
2226
- "--box-bw-4": M[4],
2227
- "--box-br-0": N[0],
2228
- "--box-br-1": N[1],
2229
- "--box-br-2": N[2],
2230
- "--box-br-3": N[3],
2231
- "--box-br-4": N[4],
2232
- "--box-shadow-0": F[0],
2233
- "--box-shadow-1": F[1],
2234
- "--box-shadow-2": F[2],
2235
- "--box-shadow-3": F[3],
2236
- "--box-shadow-4": F[4],
2237
- ...n
2238
- },
2239
- dangerouslySetInnerHTML: S,
2240
- children: S ? null : y
2241
+ ...x,
2242
+ className: S,
2243
+ style: L,
2244
+ dangerouslySetInnerHTML: C,
2245
+ "data-clad": "Box",
2246
+ children: C ? null : y
2241
2247
  });
2242
2248
  };
2243
2249
  Jn.displayName = "Box";
@@ -2282,6 +2288,7 @@ var Yn = Y({
2282
2288
  return i("label", {
2283
2289
  ref: t,
2284
2290
  className: m,
2291
+ "data-clad": "Checkbox",
2285
2292
  ...p
2286
2293
  }, i("input", g), i("span", { "aria-hidden": !0 }, _), c || null);
2287
2294
  });
@@ -2293,6 +2300,7 @@ var Qn = Y({ base: "breadcrumbs" }), $n = Y({ base: "breadcrumb-item" }), er = y
2293
2300
  return i(a, {
2294
2301
  ref: t,
2295
2302
  className: J($n(), n),
2303
+ "data-clad": "BreadcrumbItem",
2296
2304
  ...o
2297
2305
  }, r);
2298
2306
  });
@@ -2308,6 +2316,7 @@ var tr = yt((e, n) => {
2308
2316
  className: J(Qn(), r),
2309
2317
  itemScope: !0,
2310
2318
  itemType: "https://schema.org/BreadcrumbList",
2319
+ "data-clad": "Breadcrumbs",
2311
2320
  ...l
2312
2321
  }, t.map(a, (e, t) => {
2313
2322
  if (!o(e)) return null;
@@ -2568,6 +2577,7 @@ var lr = cr, ur = Y({
2568
2577
  }), f),
2569
2578
  "aria-disabled": o || void 0,
2570
2579
  onClick: o ? void 0 : m,
2580
+ "data-clad": "Chip",
2571
2581
  ...h,
2572
2582
  ...o ? {
2573
2583
  href: void 0,
@@ -2612,27 +2622,27 @@ var fr = Y({
2612
2622
  return `${c}${e}${r === 0 ? "" : `${n}${i}`}`;
2613
2623
  }
2614
2624
  return `${c}${s}`;
2615
- }, br = () => {}, xr = ({ id: e = "", name: t = "", label: n = "", value: r = "", onChange: i = br, onFormatChange: a = br, onBlur: o = br, onFocus: u = br, disabled: d = !1, required: m = !1, status: h = "default", helptext: g = "", inputRef: _, width: v = "full", suffix: y = "đ", allowNegativeValue: b = !1, separator: x = ".", decimalSeparator: S = ",", maxDigits: C = 12, decimalsLimit: w = 0, helptextClassName: T = "", className: E }) => {
2616
- let D = {
2625
+ }, br = () => {}, xr = ({ id: e = "", name: t = "", label: n = "", value: r = "", onChange: i = br, onFormatChange: a = br, onBlur: o = br, onFocus: u = br, disabled: d = !1, required: m = !1, status: h = "default", helptext: g = "", inputRef: _, width: v = "full", suffix: y = "đ", allowNegativeValue: b = !1, separator: x = ".", decimalSeparator: S = ",", maxDigits: C = 12, decimalsLimit: w = 0, helptextClassName: T = "", className: E, ...D }) => {
2626
+ let O = {
2617
2627
  decimalSeparator: S,
2618
2628
  separator: x,
2619
2629
  suffix: y
2620
- }, O = r === void 0 ? "" : gr({
2621
- ...D,
2630
+ }, k = r === void 0 ? "" : gr({
2631
+ ...O,
2622
2632
  value: String(r)
2623
- }), k = {
2633
+ }), A = {
2624
2634
  decimalSeparator: S,
2625
2635
  separator: x,
2626
2636
  decimalsLimit: w,
2627
2637
  allowNegativeValue: b
2628
- }, [A, j] = p(!1), [M, N] = p(O), [I, L] = p(!1), [R, z] = p(0), B = f(null), V = typeof _ == "object" && _ ? _ : B;
2638
+ }, [j, M] = p(!1), [N, I] = p(k), [L, R] = p(!1), [ee, z] = p(0), B = f(null), V = typeof _ == "object" && _ ? _ : B;
2629
2639
  l(_, () => V.current), c(() => {
2630
- I && M !== "-" && V && typeof V == "object" && V.current && V.current.setSelectionRange(R, R);
2640
+ L && N !== "-" && V && typeof V == "object" && V.current && V.current.setSelectionRange(ee, ee);
2631
2641
  }, [
2632
- M,
2633
- R,
2642
+ N,
2643
+ ee,
2634
2644
  V,
2635
- I
2645
+ L
2636
2646
  ]);
2637
2647
  let H = J("currency-input-el", r && "hasValue", !n && "noLabel", m && "required"), U = s((e) => {
2638
2648
  let t = e;
@@ -2643,25 +2653,25 @@ var fr = Y({
2643
2653
  S,
2644
2654
  C
2645
2655
  ]), W = (e, t, n) => {
2646
- L(!0);
2656
+ R(!0);
2647
2657
  let r = yr({
2648
2658
  value: e,
2649
- ...k
2659
+ ...A
2650
2660
  });
2651
2661
  if (r === "") {
2652
- n?.(void 0), N("");
2662
+ n?.(void 0), I("");
2653
2663
  return;
2654
2664
  }
2655
2665
  if (!U(r)) return;
2656
2666
  if (r === "-" || r === S) {
2657
- n?.(void 0), N(e);
2667
+ n?.(void 0), I(e);
2658
2668
  return;
2659
2669
  }
2660
2670
  let i = gr({
2661
2671
  value: r,
2662
- ...D
2672
+ ...O
2663
2673
  });
2664
- if (t != null && z(t + (i.length - e.length) || 1), N(i), n) {
2674
+ if (t != null && z(t + (i.length - e.length) || 1), I(i), n) {
2665
2675
  let e = i;
2666
2676
  +r == 0 && (e = "0"), n(e);
2667
2677
  }
@@ -2670,9 +2680,9 @@ var fr = Y({
2670
2680
  if (W(t, n, a), i) {
2671
2681
  let n = yr({
2672
2682
  value: t,
2673
- ...k
2683
+ ...A
2674
2684
  });
2675
- U(n) && (S && M.includes(S) && (n = n.replace(S, ".")), i({
2685
+ U(n) && (S && N.includes(S) && (n = n.replace(S, ".")), i({
2676
2686
  ...e,
2677
2687
  target: {
2678
2688
  ...e.target,
@@ -2681,39 +2691,40 @@ var fr = Y({
2681
2691
  }));
2682
2692
  }
2683
2693
  }, [
2684
- M,
2694
+ N,
2685
2695
  a,
2686
2696
  i,
2687
2697
  U,
2688
2698
  S
2689
- ]), ee = s((e) => {
2690
- M || j(!1);
2699
+ ]), te = s((e) => {
2700
+ N || M(!1);
2691
2701
  let { target: { value: t } } = e, n = yr({
2692
2702
  value: t,
2693
- ...k
2703
+ ...A
2694
2704
  });
2695
2705
  if (n === "-" || !n) {
2696
- N(""), o(e);
2706
+ I(""), o(e);
2697
2707
  return;
2698
2708
  }
2699
- N(gr({
2700
- ...D,
2709
+ I(gr({
2710
+ ...O,
2701
2711
  value: n
2702
2712
  })), o(e);
2703
- }, [M, o]), K = s((e) => {
2704
- j(!0), u(e);
2713
+ }, [N, o]), K = s((e) => {
2714
+ M(!0), u(e);
2705
2715
  }, [u]), q = r === void 0 ? void 0 : gr({
2706
- ...D,
2716
+ ...O,
2707
2717
  value: String(r)
2708
- }), te = q !== void 0 && M !== "-" && M !== S ? q : M, ne = nr[v] ?? "initial", re = J(fr({ status: h }), d && "disabled"), ie = !!(A || r);
2718
+ }), ne = q !== void 0 && N !== "-" && N !== S ? q : N, re = nr[v] ?? "initial", ie = J(fr({ status: h }), d && "disabled"), ae = !!(j || r);
2709
2719
  return /* @__PURE__ */ F("div", {
2710
2720
  "data-clad": "Input Field - Currency",
2711
2721
  className: J("currency-input-container", E),
2712
- style: { width: ne },
2722
+ style: { width: re },
2713
2723
  children: [/* @__PURE__ */ F("div", {
2714
- className: re,
2724
+ className: ie,
2715
2725
  children: [
2716
2726
  /* @__PURE__ */ P("input", {
2727
+ ...D,
2717
2728
  ref: V,
2718
2729
  type: "text",
2719
2730
  inputMode: "decimal",
@@ -2721,9 +2732,10 @@ var fr = Y({
2721
2732
  id: e || void 0,
2722
2733
  name: t || void 0,
2723
2734
  disabled: d,
2724
- value: te,
2735
+ required: m,
2736
+ value: ne,
2725
2737
  onChange: G,
2726
- onBlur: ee,
2738
+ onBlur: te,
2727
2739
  onFocus: K
2728
2740
  }),
2729
2741
  !!n && /* @__PURE__ */ P("label", {
@@ -2731,7 +2743,7 @@ var fr = Y({
2731
2743
  children: n
2732
2744
  }),
2733
2745
  /* @__PURE__ */ P("div", {
2734
- className: J("currency-input-suffix", ie && "currency-input-suffix--focused"),
2746
+ className: J("currency-input-suffix", ae && "currency-input-suffix--focused"),
2735
2747
  children: /* @__PURE__ */ P("span", { children: y })
2736
2748
  })
2737
2749
  ]
@@ -4123,14 +4135,14 @@ var Oa = Y({
4123
4135
  }, Ma = {
4124
4136
  dark: "var(--color-border-black)",
4125
4137
  light: "var(--color-border-thin)"
4126
- }, Na = (e) => e.replace(/(<(script|object|applet|embed|frameset|iframe|form|textarea|map)(\s+.*?)?>.*?<\/\2>)|(<(script|object|applet|embed|frameset|iframe|form|textarea|input|button|map)(\s+.*?)?\/?>)|(=.*".*javascript:.*?")/g, ""), Pa = ({ children: e = null, text: t = null, dangerousHtml: r = null, placement: a = "bottom-center", manual: o = !1, variant: s = "dark", delayEnter: c = "none", delayLeave: l = "none", arrowOffset: d = "xs", triggerOffset: f = "sm", hoverable: m = !1, zIndex: h = 1900, fadeDuration: g = "xs", title: _ = "", thumbnail: v = "", haveClose: y = !1, maxWidth: b = "280px", action: x = null, onClose: S }) => {
4127
- let [w, T] = p(!0), [E, D] = p(!1), [O, k] = Da({
4138
+ }, Na = (e) => e.replace(/(<(script|object|applet|embed|frameset|iframe|form|textarea|map)(\s+.*?)?>.*?<\/\2>)|(<(script|object|applet|embed|frameset|iframe|form|textarea|input|button|map)(\s+.*?)?\/?>)|(=.*".*javascript:.*?")/g, ""), Pa = ({ children: e = null, text: t = null, dangerousHtml: r = null, placement: a = "bottom-center", manual: o = !1, variant: s = "dark", delayEnter: c = "none", delayLeave: l = "none", arrowOffset: d = "xs", triggerOffset: f = "sm", hoverable: m = !1, zIndex: h = 1900, fadeDuration: g = "xs", title: _ = "", thumbnail: v = "", haveClose: y = !1, maxWidth: b = "280px", action: x = null, onClose: S, className: w, style: T, ...E }) => {
4139
+ let [D, O] = p(!0), [k, A] = p(!1), [j, M] = Da({
4128
4140
  delayEnter: Aa[c],
4129
4141
  delayLeave: Aa[l]
4130
- }), A = !w || m && !O, { triggerProps: j, layerProps: M, arrowProps: N, renderLayer: P } = ba({
4131
- isOpen: E,
4142
+ }), N = !D || m && !j, { triggerProps: P, layerProps: F, arrowProps: I, renderLayer: L } = ba({
4143
+ isOpen: k,
4132
4144
  onOutsideClick: () => {
4133
- w && (T(!1), S?.());
4145
+ D && (O(!1), S?.());
4134
4146
  },
4135
4147
  arrowOffset: ka[d],
4136
4148
  triggerOffset: ka[f],
@@ -4138,27 +4150,29 @@ var Oa = Y({
4138
4150
  placement: a
4139
4151
  });
4140
4152
  u(() => {
4141
- A || D(!0);
4142
- }, [A]);
4143
- let F = null;
4144
- typeof r == "string" && r.trim() && (F = { __html: Na(r) });
4145
- let I = () => {
4146
- A && D(!1);
4147
- }, L = (e) => {
4148
- e.stopPropagation(), T(!1), S?.();
4153
+ N || A(!0);
4154
+ }, [N]);
4155
+ let R = null;
4156
+ typeof r == "string" && r.trim() && (R = { __html: Na(r) });
4157
+ let ee = () => {
4158
+ N && A(!1);
4159
+ }, z = (e) => {
4160
+ e.stopPropagation(), O(!1), S?.();
4149
4161
  };
4150
4162
  return i(n, null, i("span", {
4151
- ...j,
4152
- ...k
4153
- }, e), E && P(i("div", {
4154
- ...M,
4155
- className: J(Oa({ variant: s }), A && "tooltip--exit"),
4156
- onAnimationEnd: I,
4163
+ ...P,
4164
+ ...M
4165
+ }, e), k && L(i("div", {
4166
+ ...E,
4167
+ ...F,
4168
+ className: J(Oa({ variant: s }), N && "tooltip--exit", w),
4169
+ onAnimationEnd: ee,
4157
4170
  style: {
4158
4171
  "--tooltip-max-width": b,
4159
4172
  "--tooltip-z-index": h,
4160
4173
  "--tooltip-fade-duration": `${Aa[g]}ms`,
4161
- ...M.style
4174
+ ...F.style,
4175
+ ...T
4162
4176
  },
4163
4177
  "data-clad": "Tooltip"
4164
4178
  }, i("div", { className: "tooltip-content-wrapper" }, v ? i("img", {
@@ -4168,16 +4182,16 @@ var Oa = Y({
4168
4182
  }) : null, i("div", { className: "tooltip-content" }, _ ? i("span", {
4169
4183
  className: "tooltip-title",
4170
4184
  style: y ? { paddingRight: "18px" } : void 0
4171
- }, _) : null, F ? i("span", {
4185
+ }, _) : null, R ? i("span", {
4172
4186
  className: "tooltip-text",
4173
- dangerouslySetInnerHTML: F
4187
+ dangerouslySetInnerHTML: R
4174
4188
  }) : i("span", { className: "tooltip-text" }, t), x ?? null)), y ? i("button", {
4175
4189
  type: "button",
4176
4190
  className: "tooltip-close",
4177
- onClick: L,
4191
+ onClick: z,
4178
4192
  "aria-label": "Close tooltip"
4179
4193
  }, i(C, { "aria-hidden": !0 })) : null, i(Ta, {
4180
- ...N,
4194
+ ...I,
4181
4195
  backgroundColor: ja[s],
4182
4196
  borderColor: Ma[s]
4183
4197
  }))));
@@ -4195,23 +4209,24 @@ var Fa = Y({
4195
4209
  success: ""
4196
4210
  } }
4197
4211
  }), Ia = yt((e, t) => {
4198
- let { id: n, name: r, type: i = "text", width: a = "full", label: o, value: s = "", onChange: c, onBlur: u, onFocus: d, onKeyDown: m, onKeyUp: h, disabled: g = !1, required: _ = !1, status: v = "default", helptext: y, helptextClassName: b, allowClear: x = !0, showPassword: C = !1, tooltip: D, inputMode: O = "text", characterLimit: k, onClear: A, showValidationIcon: N = !1, icon: I, placeholder: L, className: R, inputRef: z, ...B } = e, V = f(null);
4199
- l(t, () => V.current), l(z, () => V.current);
4200
- let [H, U] = p(!1), W = H ? j : T, G = () => {
4201
- V.current && (V.current.type === "password" ? (V.current.type = "text", U(!0)) : (V.current.type = "password", U(!1)));
4202
- }, ee = (e) => {
4203
- x && V.current && (V.current.value = "", c?.({
4204
- target: V.current,
4205
- currentTarget: V.current
4212
+ let { id: n, name: r, type: i = "text", width: a = "full", label: o, value: s = "", onChange: c, onBlur: u, onFocus: d, onKeyDown: m, onKeyUp: h, disabled: g = !1, required: _ = !1, status: v = "default", helptext: y, helptextClassName: b, allowClear: x = !0, showPassword: C = !1, tooltip: D, inputMode: O = "text", characterLimit: k, onClear: A, showValidationIcon: N = !1, icon: I, placeholder: L, className: R, inputRef: ee, ...z } = e, B = f(null);
4213
+ l(t, () => B.current), l(ee, () => B.current);
4214
+ let [V, H] = p(!1), U = V ? j : T, W = () => {
4215
+ B.current && (B.current.type === "password" ? (B.current.type = "text", H(!0)) : (B.current.type = "password", H(!1)));
4216
+ }, G = (e) => {
4217
+ x && B.current && (B.current.value = "", c?.({
4218
+ target: B.current,
4219
+ currentTarget: B.current
4206
4220
  })), A?.(e);
4207
- }, K = "", q = !1, te = (e) => {
4208
- i === "number" && (K = e.key.toLowerCase(), (e.metaKey || e.ctrlKey) && K === "a" && (q = !0)), m?.(e);
4221
+ }, te = "", K = !1, q = (e) => {
4222
+ i === "number" && (te = e.key.toLowerCase(), (e.metaKey || e.ctrlKey) && te === "a" && (K = !0)), m?.(e);
4209
4223
  }, ne = (e) => {
4210
- (e.target.value !== "" || K === "backspace" || K === "delete" || q && K === "-" || q && K === "+") && (c?.(e), q = !1);
4224
+ (e.target.value !== "" || te === "backspace" || te === "delete" || K && te === "-" || K && te === "+") && (c?.(e), K = !1);
4211
4225
  }, re = (e) => {
4212
- u?.(e), e.target.value === "" && V.current && ((Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set)?.call(V.current, ""), V.current.dispatchEvent(new Event("change", { bubbles: !0 })));
4226
+ u?.(e), e.target.value === "" && B.current && ((Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set)?.call(B.current, ""), B.current.dispatchEvent(new Event("change", { bubbles: !0 })));
4213
4227
  }, ie = !C && x && !!s, ae = i === "password" && C && !!s, oe = !!D && (x ? !s : !0), se = ie || oe || N, ce = J(Fa({ status: v }), g && "input--disabled", !!I && "input--has-left-icon", !o && "input--no-label", se && "input--has-right-icon"), le = J("input-el", !!s && "has-value", !!L && "has-placeholder", _ && "is-required");
4214
4228
  return /* @__PURE__ */ F("div", {
4229
+ "data-clad": "Input",
4215
4230
  className: J("relative w-full", R),
4216
4231
  style: a === "full" ? void 0 : { width: nr[a] || a },
4217
4232
  children: [/* @__PURE__ */ F("div", {
@@ -4223,7 +4238,7 @@ var Fa = Y({
4223
4238
  }) : null,
4224
4239
  /* @__PURE__ */ P("input", {
4225
4240
  ref: (e) => {
4226
- V.current = e;
4241
+ B.current = e;
4227
4242
  },
4228
4243
  className: le,
4229
4244
  type: i,
@@ -4240,9 +4255,9 @@ var Fa = Y({
4240
4255
  onFocus: d,
4241
4256
  onKeyUp: h,
4242
4257
  onChange: i === "number" ? ne : c,
4243
- onKeyDown: te,
4258
+ onKeyDown: q,
4244
4259
  onBlur: i === "number" ? re : u,
4245
- ...B
4260
+ ...z
4246
4261
  }),
4247
4262
  !!o && /* @__PURE__ */ P("label", {
4248
4263
  htmlFor: n,
@@ -4252,7 +4267,7 @@ var Fa = Y({
4252
4267
  tabIndex: -1,
4253
4268
  type: "button",
4254
4269
  className: "input-clear-btn",
4255
- onClick: ee,
4270
+ onClick: G,
4256
4271
  "aria-label": "Clear input",
4257
4272
  children: /* @__PURE__ */ P(w, {
4258
4273
  width: "20px",
@@ -4264,9 +4279,9 @@ var Fa = Y({
4264
4279
  tabIndex: -1,
4265
4280
  type: "button",
4266
4281
  className: "input-password-btn",
4267
- onClick: G,
4268
- "aria-label": H ? "Hide password" : "Show password",
4269
- children: /* @__PURE__ */ P(W, {
4282
+ onClick: W,
4283
+ "aria-label": V ? "Hide password" : "Show password",
4284
+ children: /* @__PURE__ */ P(U, {
4270
4285
  width: "20px",
4271
4286
  height: "20px",
4272
4287
  "aria-hidden": !0
@@ -4329,140 +4344,140 @@ var La = Y({
4329
4344
  year: e?.getFullYear() ?? null,
4330
4345
  month: e?.getMonth() ?? null,
4331
4346
  date: e?.getDate() ?? null
4332
- }), Ha = ({ value: t, defaultValue: n = new Date(2025, 1, 1), label: r, required: i, onChange: a, onBlur: o = Ra, onFocus: s = Ra, onClickOutside: c = Ra, onInputFocus: l = Ra, onYearSelect: u = Ra, onMonthSelect: d = Ra, onNextMonthSelect: f = Ra, onPrevMonthSelect: p = Ra, onCalendarOpen: h = Ra, onCalendarClose: g = Ra, icon: b, disabled: S, disabledDates: C = [], disabledDatesFn: w, defaultOpen: T = !1, minYear: E = 1900, maxYear: D = 2100, minDate: O = null, maxDate: k = null, allowClear: A = !0, allowInput: j = !0, format: M = X.DdMmYyyy, helptext: N = "", hightlightCurrentDate: I = !0, className: L }) => {
4333
- let R = /* @__PURE__ */ new Date(), z = e.useRef(null), [B, V] = e.useState(t?.getMonth() || n.getMonth()), [H, U] = e.useState(t?.getFullYear() || n.getFullYear()), [W, G] = e.useState(!1), [ee, K] = e.useState(M === X.MmYyyy), [q, te] = e.useState(T), [ne, re] = e.useState(t ? Ba(t, M) : ""), { renderLayer: ie, triggerProps: ae, layerProps: oe } = ba({
4347
+ }), Ha = ({ id: t, value: n, defaultValue: r = new Date(2025, 1, 1), label: i, required: a, onChange: o, onBlur: s = Ra, onFocus: c = Ra, onClickOutside: l = Ra, onInputFocus: u = Ra, onYearSelect: d = Ra, onMonthSelect: f = Ra, onNextMonthSelect: p = Ra, onPrevMonthSelect: h = Ra, onCalendarOpen: g = Ra, onCalendarClose: b = Ra, icon: S, disabled: C, disabledDates: w = [], disabledDatesFn: T, defaultOpen: E = !1, minYear: D = 1900, maxYear: O = 2100, minDate: k = null, maxDate: A = null, allowClear: j = !0, allowInput: M = !0, format: N = X.DdMmYyyy, helptext: I = "", hightlightCurrentDate: L = !0, className: R, ...ee }) => {
4348
+ let z = /* @__PURE__ */ new Date(), B = e.useRef(null), [V, H] = e.useState(n?.getMonth() || r.getMonth()), [U, W] = e.useState(n?.getFullYear() || r.getFullYear()), [G, te] = e.useState(!1), [K, q] = e.useState(N === X.MmYyyy), [ne, re] = e.useState(E), [ie, ae] = e.useState(n ? Ba(n, N) : ""), { renderLayer: oe, triggerProps: se, layerProps: ce } = ba({
4334
4349
  auto: !0,
4335
- isOpen: q,
4350
+ isOpen: ne,
4336
4351
  placement: "bottom-start",
4337
4352
  onOutsideClick: () => {
4338
- te(!1), g?.();
4353
+ re(!1), b?.();
4339
4354
  },
4340
4355
  triggerOffset: -12
4341
- }), se = e.useMemo(() => O ? O.getFullYear() : E ?? 1900, [
4342
- E,
4356
+ }), le = e.useMemo(() => k ? k.getFullYear() : D ?? 1900, [
4343
4357
  D,
4344
4358
  O,
4345
- k
4346
- ]), ce = e.useMemo(() => k ? k.getFullYear() : D ?? 2100, [
4347
- E,
4359
+ k,
4360
+ A
4361
+ ]), ue = e.useMemo(() => A ? A.getFullYear() : O ?? 2100, [
4348
4362
  D,
4349
4363
  O,
4350
- k
4351
- ]), le = e.useMemo(() => O ? O.getMonth() : 0, [
4352
- E,
4364
+ k,
4365
+ A
4366
+ ]), de = e.useMemo(() => k ? k.getMonth() : 0, [
4353
4367
  D,
4354
4368
  O,
4355
- k
4356
- ]), ue = e.useMemo(() => k ? k.getMonth() : 11, [
4357
- E,
4369
+ k,
4370
+ A
4371
+ ]), fe = e.useMemo(() => A ? A.getMonth() : 11, [
4358
4372
  D,
4359
4373
  O,
4360
- k
4361
- ]), de = e.useMemo(() => O ? O.getDate() : 1, [
4362
- E,
4374
+ k,
4375
+ A
4376
+ ]), pe = e.useMemo(() => k ? k.getDate() : 1, [
4363
4377
  D,
4364
4378
  O,
4365
- k
4366
- ]), fe = e.useMemo(() => k ? k.getDate() : 31, [
4367
- E,
4379
+ k,
4380
+ A
4381
+ ]), me = e.useMemo(() => A ? A.getDate() : 31, [
4368
4382
  D,
4369
4383
  O,
4370
- k
4371
- ]), pe = e.useMemo(() => t?.getFullYear() || n.getFullYear(), [t]), me = e.useMemo(() => t?.getMonth() || n.getMonth(), [t]), he = e.useMemo(() => t?.getDate() || n.getDate(), [t]);
4384
+ k,
4385
+ A
4386
+ ]), he = e.useMemo(() => n?.getFullYear() || r.getFullYear(), [n]), ge = e.useMemo(() => n?.getMonth() || r.getMonth(), [n]), _e = e.useMemo(() => n?.getDate() || r.getDate(), [n]);
4372
4387
  e.useEffect(() => {
4373
- if (ee && z.current) {
4374
- let e = Math.floor((pe - se) / 4) * 44, t = z.current;
4388
+ if (K && B.current) {
4389
+ let e = Math.floor((he - le) / 4) * 44, t = B.current;
4375
4390
  t.scrollTop += e;
4376
4391
  }
4377
- }, [ee]);
4378
- let ge = (e) => {
4379
- te(!0), h && h(), l && l(e);
4380
- }, _e = (e) => {
4381
- S && (e.stopPropagation(), e.preventDefault());
4382
- }, ve = () => {
4383
- G((e) => !e), K(!1);
4384
- }, ye = () => {
4385
- K((e) => !e), G(!1);
4392
+ }, [K]);
4393
+ let ve = (e) => {
4394
+ re(!0), g && g(), u && u(e);
4395
+ }, ye = (e) => {
4396
+ C && (e.stopPropagation(), e.preventDefault());
4386
4397
  }, be = () => {
4387
- te((e) => !e);
4388
- }, xe = (e) => {
4389
- switch (M) {
4398
+ te((e) => !e), q(!1);
4399
+ }, xe = () => {
4400
+ q((e) => !e), te(!1);
4401
+ }, Se = () => {
4402
+ re((e) => !e);
4403
+ }, Ce = (e) => {
4404
+ switch (N) {
4390
4405
  case X.DdMmYyyy: if (e) {
4391
4406
  let t = e?.getMonth(), n = e?.getFullYear() || 2024;
4392
- H !== n && U(n), B !== +t && V(+t), re(Ba(e, M));
4407
+ U !== n && W(n), V !== +t && H(+t), ae(Ba(e, N));
4393
4408
  break;
4394
4409
  } else {
4395
- re("");
4410
+ ae("");
4396
4411
  break;
4397
4412
  }
4398
4413
  case X.DdMm: if (e) {
4399
4414
  let t = e?.getMonth(), n = e?.getFullYear() || 2024;
4400
- H !== n && U(n), B !== +t && V(+t), re(Ba(e, M));
4415
+ U !== n && W(n), V !== +t && H(+t), ae(Ba(e, N));
4401
4416
  break;
4402
4417
  } else {
4403
- re("");
4418
+ ae("");
4404
4419
  break;
4405
4420
  }
4406
4421
  case X.MmYyyy: if (e) {
4407
- re(Ba(e, M));
4422
+ ae(Ba(e, N));
4408
4423
  break;
4409
4424
  } else {
4410
- re("");
4425
+ ae("");
4411
4426
  break;
4412
4427
  }
4413
4428
  default: break;
4414
4429
  }
4415
- }, Se = (e) => {
4416
- a(Va(null), e), xe(null);
4417
- }, Ce = (e, t) => {
4418
- a(Va(e), t), xe(e), te(!1), g?.();
4419
4430
  }, we = (e) => {
4431
+ o(Va(null), e), Ce(null);
4432
+ }, Te = (e, t) => {
4433
+ o(Va(e), t), Ce(e), re(!1), b?.();
4434
+ }, Ee = (e) => {
4420
4435
  let t = 0;
4421
- B === 0 ? H > se ? (t = 11, U(H - 1)) : U(se) : t = H === se && B <= le ? le : B - 1, V(t), p?.(t, e);
4422
- }, Te = (e) => {
4436
+ V === 0 ? U > le ? (t = 11, W(U - 1)) : W(le) : t = U === le && V <= de ? de : V - 1, H(t), h?.(t, e);
4437
+ }, De = (e) => {
4423
4438
  let t = 0;
4424
- B === 11 ? H < ce ? (t = 0, U(H + 1)) : U(ce) : t = H === ce && B >= ue ? ue : B + 1, V(t), f?.(t, e);
4425
- }, Ee = (e) => {
4439
+ V === 11 ? U < ue ? (t = 0, W(U + 1)) : W(ue) : t = U === ue && V >= fe ? fe : V + 1, H(t), p?.(t, e);
4440
+ }, Oe = (e) => {
4426
4441
  let t = +e.target.dataset.value;
4427
- U(t), K(!1), G(!0);
4428
- let n = new Date(t, me, he);
4429
- a(Va(n), e), xe(n), u?.(t);
4430
- }, De = (e) => {
4442
+ W(t), q(!1), te(!0);
4443
+ let n = new Date(t, ge, _e);
4444
+ o(Va(n), e), Ce(n), d?.(t);
4445
+ }, ke = (e) => {
4431
4446
  let t = +e.target.dataset.value;
4432
- if (V(t), G(!1), M === X.DdMm || M === X.DdMmYyyy) {
4433
- let n = new Date(pe, t, he);
4434
- a(Va(n), e), xe(n), d?.(t);
4435
- } else if (M === X.MmYyyy) {
4436
- let n = new Date(pe, t, 1);
4437
- a(Va(n), e), xe(n), d?.(t), K(!0), te(!1), g?.();
4447
+ if (H(t), te(!1), N === X.DdMm || N === X.DdMmYyyy) {
4448
+ let n = new Date(he, t, _e);
4449
+ o(Va(n), e), Ce(n), f?.(t);
4450
+ } else if (N === X.MmYyyy) {
4451
+ let n = new Date(he, t, 1);
4452
+ o(Va(n), e), Ce(n), f?.(t), q(!0), re(!1), b?.();
4438
4453
  }
4439
- }, Oe = e.useCallback(() => /* @__PURE__ */ P("div", {
4454
+ }, Ae = e.useCallback(() => /* @__PURE__ */ P("div", {
4440
4455
  className: "date-picker-year-panel",
4441
- ref: z,
4442
- children: Array.from({ length: ce + 1 - se }, (e, t) => {
4443
- let n = se + t;
4456
+ ref: B,
4457
+ children: Array.from({ length: ue + 1 - le }, (e, t) => {
4458
+ let n = le + t;
4444
4459
  return /* @__PURE__ */ P("button", {
4445
4460
  type: "button",
4446
4461
  "data-value": n,
4447
- onClick: Ee,
4448
- className: J(pe === n && "selected-year"),
4462
+ onClick: Oe,
4463
+ className: J(he === n && "selected-year"),
4449
4464
  children: n
4450
4465
  }, n);
4451
4466
  })
4452
- }), [t]), ke = e.useCallback(() => {
4453
- let e = H === se ? le : 0, t = H === ce ? ue : 11;
4467
+ }), [n]), je = e.useCallback(() => {
4468
+ let e = U === le ? de : 0, t = U === ue ? fe : 11;
4454
4469
  return /* @__PURE__ */ P("div", {
4455
4470
  className: "date-picker-month-panel",
4456
4471
  children: Array.from({ length: 12 }, (n, r) => /* @__PURE__ */ F("button", {
4457
- onClick: De,
4472
+ onClick: ke,
4458
4473
  type: "button",
4459
4474
  "data-value": r,
4460
- className: J(me === r && "selected-month", (r < e || r > t) && "disabled"),
4475
+ className: J(ge === r && "selected-month", (r < e || r > t) && "disabled"),
4461
4476
  children: ["Tháng ", r + 1]
4462
4477
  }, r))
4463
4478
  });
4464
- }, [t]), Ae = e.useCallback(() => {
4465
- let e = H === ce && B === ue, t = H === se && B === le;
4479
+ }, [n]), Me = e.useCallback(() => {
4480
+ let e = U === ue && V === fe, t = U === le && V === de;
4466
4481
  return /* @__PURE__ */ P("div", {
4467
4482
  className: "date-picker-wrapped-header",
4468
4483
  children: /* @__PURE__ */ F("div", {
@@ -4471,60 +4486,60 @@ var La = Y({
4471
4486
  className: "date-picker-panel-control-wrapper",
4472
4487
  children: [/* @__PURE__ */ F("button", {
4473
4488
  type: "button",
4474
- onClick: ve,
4489
+ onClick: be,
4475
4490
  className: "date-picker-panel-control-button month-select",
4476
4491
  children: [
4477
- /* @__PURE__ */ F("span", { children: ["Tháng ", B + 1] }),
4492
+ /* @__PURE__ */ F("span", { children: ["Tháng ", V + 1] }),
4478
4493
  " ",
4479
- M === X.DdMm && P(W ? x : _, {})
4494
+ N === X.DdMm && P(G ? x : _, {})
4480
4495
  ]
4481
- }), M !== X.DdMm && /* @__PURE__ */ F("button", {
4496
+ }), N !== X.DdMm && /* @__PURE__ */ F("button", {
4482
4497
  type: "button",
4483
- onClick: ye,
4498
+ onClick: xe,
4484
4499
  className: "date-picker-panel-control-button year-select",
4485
4500
  children: [/* @__PURE__ */ F("span", { children: [
4486
4501
  " ",
4487
4502
  "/",
4488
4503
  " ",
4489
- H
4490
- ] }), P(ee ? x : _, {})]
4504
+ U
4505
+ ] }), P(K ? x : _, {})]
4491
4506
  })]
4492
- }), !ee && !W && /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("button", {
4507
+ }), !K && !G && /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("button", {
4493
4508
  className: "date-picker-month-control",
4494
- disabled: S || t,
4495
- onClick: we,
4509
+ disabled: C || t,
4510
+ onClick: Ee,
4496
4511
  type: "button",
4497
4512
  children: /* @__PURE__ */ P(v, {})
4498
4513
  }), /* @__PURE__ */ P("button", {
4499
4514
  className: "date-picker-month-control",
4500
- disabled: S || e,
4501
- onClick: Te,
4515
+ disabled: C || e,
4516
+ onClick: De,
4502
4517
  type: "button",
4503
4518
  children: /* @__PURE__ */ P(y, {})
4504
4519
  })] })]
4505
4520
  })
4506
4521
  });
4507
4522
  }, [
4508
- B,
4509
- H,
4510
- t,
4511
- ee,
4512
- W,
4513
- M
4514
- ]), je = e.useCallback(() => {
4515
- let e = (new Date(H, B, 1).getDay() + 6) % 7, n = new Date(H, B + 1, 0).getDate(), r = [];
4523
+ V,
4524
+ U,
4525
+ n,
4526
+ K,
4527
+ G,
4528
+ N
4529
+ ]), Ne = e.useCallback(() => {
4530
+ let e = (new Date(U, V, 1).getDay() + 6) % 7, t = new Date(U, V + 1, 0).getDate(), r = [];
4516
4531
  for (let t = 0; t < e; t++) r.push(/* @__PURE__ */ P("div", { className: "date-picker-day" }, `empty-${t}`));
4517
- for (let e = 1; e <= n; e++) {
4518
- let n = new Date(H, B, e);
4532
+ for (let e = 1; e <= t; e++) {
4533
+ let t = new Date(U, V, e);
4519
4534
  r.push(/* @__PURE__ */ P("div", {
4520
- className: J("date-picker-day", t?.getDate() === e && t?.getMonth() === B && t?.getFullYear() === H && "selected-date", H === se && B <= le && e < de && "disabled", H === ce && B >= ue && e > fe && "disabled", C.length && C.find((e) => `${Ba(e, X.DdMmYyyy)}` == `${Ba(n, X.DdMmYyyy)}`) && "disabled", w && w(n) && "disabled", "valid-date", I && H === R.getFullYear() && B === R.getMonth() && e === R.getDate() && "today", `${n}`),
4535
+ className: J("date-picker-day", n?.getDate() === e && n?.getMonth() === V && n?.getFullYear() === U && "selected-date", U === le && V <= de && e < pe && "disabled", U === ue && V >= fe && e > me && "disabled", w.length && w.find((e) => `${Ba(e, X.DdMmYyyy)}` == `${Ba(t, X.DdMmYyyy)}`) && "disabled", T && T(t) && "disabled", "valid-date", L && U === z.getFullYear() && V === z.getMonth() && e === z.getDate() && "today", `${t}`),
4521
4536
  role: "button",
4522
4537
  tabIndex: 0,
4523
4538
  onClick: (e) => {
4524
- Ce(n, e);
4539
+ Te(t, e);
4525
4540
  },
4526
4541
  onKeyDown: (e) => {
4527
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), Ce(n, e));
4542
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), Te(t, e));
4528
4543
  },
4529
4544
  children: e
4530
4545
  }, e));
@@ -4551,28 +4566,28 @@ var La = Y({
4551
4566
  })]
4552
4567
  });
4553
4568
  }, [
4554
- t,
4555
- B,
4556
- H,
4557
- I
4558
- ]), Me = (e) => {
4559
- if (!j) return;
4569
+ n,
4570
+ V,
4571
+ U,
4572
+ L
4573
+ ]), Pe = (e) => {
4574
+ if (!M) return;
4560
4575
  let { value: t } = e.target, n = t.replace(/[^0-9/]/g, "");
4561
- te(!1), re(n);
4562
- }, Ne = (e) => {
4563
- switch (M) {
4576
+ re(!1), ae(n);
4577
+ }, Fe = (e) => {
4578
+ switch (N) {
4564
4579
  case X.DdMmYyyy:
4565
- if (e.target.value !== Ba(t, M)) {
4580
+ if (e.target.value !== Ba(n, N)) {
4566
4581
  let t = e?.target?.value?.split("/"), n = +t[0], r = +t[1], i = +t[2];
4567
- if (+r > 12 ? r = 12 : +r < 1 && (r = 1), +i > ce ? i = ce : +i < se && (i = se), !za(i, r, n) && n <= 0) n = 1;
4582
+ if (+r > 12 ? r = 12 : +r < 1 && (r = 1), +i > ue ? i = ue : +i < le && (i = le), !za(i, r, n) && n <= 0) n = 1;
4568
4583
  else {
4569
4584
  let e = new Date(i, r, 0).getDate();
4570
4585
  !za(i, r, n) && +n > e && (n = e);
4571
4586
  }
4572
- let o = r - 1, s = new Date(i, o, +n);
4573
- isNaN(s.getTime()) ? (a(Va(null), e), xe(null)) : (a(Va(s), e), xe(s));
4587
+ let a = r - 1, s = new Date(i, a, +n);
4588
+ isNaN(s.getTime()) ? (o(Va(null), e), Ce(null)) : (o(Va(s), e), Ce(s));
4574
4589
  }
4575
- o?.(e);
4590
+ s?.(e);
4576
4591
  break;
4577
4592
  case X.DdMm: {
4578
4593
  let t = e?.target?.value?.split("/"), n = +t[0], r = +t[1];
@@ -4580,69 +4595,71 @@ var La = Y({
4580
4595
  let i = new Date((/* @__PURE__ */ new Date()).getFullYear(), r, 0).getDate();
4581
4596
  if (n > i && (n = i), n < 1 && (n = 1), za((/* @__PURE__ */ new Date()).getFullYear(), r, n)) {
4582
4597
  let t = new Date((/* @__PURE__ */ new Date()).getFullYear(), r - 1, n);
4583
- isNaN(t.getTime()) ? (a(Va(null), e), xe(null)) : (a(Va(t), e), xe(t));
4598
+ isNaN(t.getTime()) ? (o(Va(null), e), Ce(null)) : (o(Va(t), e), Ce(t));
4584
4599
  }
4585
- o?.(e);
4600
+ s?.(e);
4586
4601
  break;
4587
4602
  }
4588
4603
  case X.MmYyyy: {
4589
4604
  let t = e?.target?.value?.split("/"), n = +t[0], r = +t[1];
4590
- if (n > 12 && (n = 12), n < 1 && (n = 1), r > ce && (r = ce), r < se && (r = se), za(r, n, 1)) {
4605
+ if (n > 12 && (n = 12), n < 1 && (n = 1), r > ue && (r = ue), r < le && (r = le), za(r, n, 1)) {
4591
4606
  let t = new Date(r, n - 1, 1);
4592
- isNaN(t.getTime()) ? (a(Va(null), e), xe(null)) : (a(Va(t), e), xe(t));
4607
+ isNaN(t.getTime()) ? (o(Va(null), e), Ce(null)) : (o(Va(t), e), Ce(t));
4593
4608
  }
4594
- o?.(e);
4609
+ s?.(e);
4595
4610
  break;
4596
4611
  }
4597
4612
  default: break;
4598
4613
  }
4599
4614
  };
4600
4615
  return /* @__PURE__ */ F("div", {
4601
- ref: ae.ref,
4602
- className: J(La(), L),
4616
+ ...ee,
4617
+ ref: se.ref,
4618
+ className: J(La(), R),
4603
4619
  "data-clad": "Date Picker",
4604
4620
  children: [
4605
4621
  /* @__PURE__ */ P(Ia, {
4606
- required: i,
4607
- disabled: S,
4608
- label: r,
4622
+ id: t,
4623
+ required: a,
4624
+ disabled: C,
4625
+ label: i,
4609
4626
  type: "text",
4610
- placeholder: M,
4611
- onClear: Se,
4612
- onChange: Me,
4613
- onBlur: Ne,
4614
- onFocus: ge,
4615
- allowClear: A,
4616
- value: ne,
4617
- helptext: N
4627
+ placeholder: N,
4628
+ onClear: we,
4629
+ onChange: Pe,
4630
+ onBlur: Fe,
4631
+ onFocus: ve,
4632
+ allowClear: j,
4633
+ value: ie,
4634
+ helptext: I
4618
4635
  }),
4619
4636
  /* @__PURE__ */ P("button", {
4620
4637
  type: "button",
4621
4638
  className: "date-picker-icon",
4622
- onClick: be,
4639
+ onClick: Se,
4623
4640
  "aria-label": "Toggle calendar",
4624
- "aria-expanded": q,
4625
- disabled: S,
4626
- children: b || /* @__PURE__ */ P(m, {
4641
+ "aria-expanded": ne,
4642
+ disabled: C,
4643
+ children: S || /* @__PURE__ */ P(m, {
4627
4644
  width: 20,
4628
4645
  height: 20,
4629
4646
  "aria-hidden": !0
4630
4647
  })
4631
4648
  }),
4632
- q ? ie(/* @__PURE__ */ P("div", {
4649
+ ne ? oe(/* @__PURE__ */ P("div", {
4633
4650
  className: "date-picker-layout",
4634
4651
  "data-clad": "Date Picker Calendar",
4635
- ...oe,
4652
+ ...ce,
4636
4653
  children: /* @__PURE__ */ P("div", {
4637
- className: J("date-picker-calendar", S && "disabled"),
4638
- onFocus: s,
4639
- onBlur: c,
4640
- onClick: _e,
4654
+ className: J("date-picker-calendar", C && "disabled"),
4655
+ onFocus: c,
4656
+ onBlur: l,
4657
+ onClick: ye,
4641
4658
  children: /* @__PURE__ */ F("div", { children: [
4642
- Ae(),
4643
- M === X.MmYyyy ? /* @__PURE__ */ P("div", { className: "h-[200px]" }) : je(),
4644
- !!ee && Oe(),
4645
- !!W && ke()
4659
+ Me(),
4660
+ N === X.MmYyyy ? /* @__PURE__ */ P("div", { className: "h-[200px]" }) : Ne(),
4661
+ !!K && Ae(),
4662
+ !!G && je()
4646
4663
  ] })
4647
4664
  })
4648
4665
  })) : null
@@ -4712,137 +4729,137 @@ var Ua = Y({
4712
4729
  }, Xa = (e) => {
4713
4730
  let { hour: t, minute: n } = Ya(e[0]);
4714
4731
  return new Date(2025, 1, 1, t, n);
4715
- }, Za = ({ value: t, timeRange: n = Ga, defaultValue: r = Xa(n), label: i, required: a, onChange: o, onBlur: s = Wa, onFocus: c = Wa, onClickOutside: l = Wa, onInputFocus: u = Wa, onYearSelect: d = Wa, onMonthSelect: f = Wa, onNextMonthSelect: p = Wa, onPrevMonthSelect: h = Wa, onCalendarOpen: g = Wa, onCalendarClose: b = Wa, icon: S, disabled: C, disabledDates: w = [], disabledDatesFn: T, defaultOpen: E = !1, minYear: D = 1900, maxYear: O = 2100, minDate: k = null, maxDate: A = null, allowClear: j = !0, allowInput: M = !0, format: N = X.DdMmYyyy, helptext: I = "", hightlightCurrentDate: L = !0, className: R }) => {
4716
- let z = /* @__PURE__ */ new Date(), B = e.useRef(null), [V, H] = e.useState(t?.getMonth() || r.getMonth()), [U, W] = e.useState(t?.getFullYear() || r.getFullYear()), [G, ee] = e.useState(!1), [K, q] = e.useState(N === X.MmYyyy), [te, ne] = e.useState(E), [re, ie] = e.useState(t ? qa(t, N) : ""), [ae, oe] = e.useState({
4732
+ }, Za = ({ id: t, value: n, timeRange: r = Ga, defaultValue: i = Xa(r), label: a, required: o, onChange: s, onBlur: c = Wa, onFocus: l = Wa, onClickOutside: u = Wa, onInputFocus: d = Wa, onYearSelect: f = Wa, onMonthSelect: p = Wa, onNextMonthSelect: h = Wa, onPrevMonthSelect: g = Wa, onCalendarOpen: b = Wa, onCalendarClose: S = Wa, icon: C, disabled: w, disabledDates: T = [], disabledDatesFn: E, defaultOpen: D = !1, minYear: O = 1900, maxYear: k = 2100, minDate: A = null, maxDate: j = null, allowClear: M = !0, allowInput: N = !0, format: I = X.DdMmYyyy, helptext: L = "", hightlightCurrentDate: R = !0, className: ee, ...z }) => {
4733
+ let B = /* @__PURE__ */ new Date(), V = e.useRef(null), [H, U] = e.useState(n?.getMonth() || i.getMonth()), [W, G] = e.useState(n?.getFullYear() || i.getFullYear()), [te, K] = e.useState(!1), [q, ne] = e.useState(I === X.MmYyyy), [re, ie] = e.useState(D), [ae, oe] = e.useState(n ? qa(n, I) : ""), [se, ce] = e.useState({
4717
4734
  date: !1,
4718
4735
  time: !1
4719
- }), { renderLayer: se, triggerProps: ce, layerProps: le } = ba({
4736
+ }), { renderLayer: le, triggerProps: ue, layerProps: de } = ba({
4720
4737
  auto: !0,
4721
- isOpen: te,
4738
+ isOpen: re,
4722
4739
  placement: "bottom-start",
4723
4740
  onOutsideClick: () => {
4724
- ne(!1), b?.();
4741
+ ie(!1), S?.();
4725
4742
  },
4726
4743
  triggerOffset: -12
4727
- }), ue = e.useMemo(() => k ? k.getFullYear() : D ?? 1900, [
4728
- D,
4744
+ }), fe = e.useMemo(() => A ? A.getFullYear() : O ?? 1900, [
4729
4745
  O,
4730
4746
  k,
4731
- A
4732
- ]), de = e.useMemo(() => A ? A.getFullYear() : O ?? 2100, [
4733
- D,
4747
+ A,
4748
+ j
4749
+ ]), pe = e.useMemo(() => j ? j.getFullYear() : k ?? 2100, [
4734
4750
  O,
4735
4751
  k,
4736
- A
4737
- ]), fe = e.useMemo(() => k ? k.getMonth() : 0, [
4738
- D,
4752
+ A,
4753
+ j
4754
+ ]), me = e.useMemo(() => A ? A.getMonth() : 0, [
4739
4755
  O,
4740
4756
  k,
4741
- A
4742
- ]), pe = e.useMemo(() => A ? A.getMonth() : 11, [
4743
- D,
4757
+ A,
4758
+ j
4759
+ ]), he = e.useMemo(() => j ? j.getMonth() : 11, [
4744
4760
  O,
4745
4761
  k,
4746
- A
4747
- ]), me = e.useMemo(() => k ? k.getDate() : 1, [
4748
- D,
4762
+ A,
4763
+ j
4764
+ ]), ge = e.useMemo(() => A ? A.getDate() : 1, [
4749
4765
  O,
4750
4766
  k,
4751
- A
4752
- ]), he = e.useMemo(() => A ? A.getDate() : 31, [
4753
- D,
4767
+ A,
4768
+ j
4769
+ ]), _e = e.useMemo(() => j ? j.getDate() : 31, [
4754
4770
  O,
4755
4771
  k,
4756
- A
4757
- ]), ge = e.useMemo(() => t?.getFullYear() || r.getFullYear(), [t]), _e = e.useMemo(() => t?.getMonth() || r.getMonth(), [t]), ve = e.useMemo(() => t?.getDate() || r.getDate(), [t]), ye = e.useMemo(() => t?.getHours() || r.getHours(), [t]), be = e.useMemo(() => t?.getMinutes() || r.getMinutes(), [t]);
4772
+ A,
4773
+ j
4774
+ ]), ve = e.useMemo(() => n?.getFullYear() || i.getFullYear(), [n]), ye = e.useMemo(() => n?.getMonth() || i.getMonth(), [n]), be = e.useMemo(() => n?.getDate() || i.getDate(), [n]), xe = e.useMemo(() => n?.getHours() || i.getHours(), [n]), Se = e.useMemo(() => n?.getMinutes() || i.getMinutes(), [n]);
4758
4775
  e.useEffect(() => {
4759
- if (K && B.current) {
4760
- let e = Math.floor((ge - ue) / 4) * 44, t = B.current;
4776
+ if (q && V.current) {
4777
+ let e = Math.floor((ve - fe) / 4) * 44, t = V.current;
4761
4778
  t.scrollTop += e;
4762
4779
  }
4763
- }, [K]);
4764
- let xe = (e) => {
4765
- ne(!0), g && g(), u && u(e);
4766
- }, Se = (e) => {
4767
- C && (e.stopPropagation(), e.preventDefault());
4768
- }, Ce = () => {
4769
- ee((e) => !e), q(!1);
4770
- }, we = () => {
4771
- q((e) => !e), ee(!1);
4780
+ }, [q]);
4781
+ let Ce = (e) => {
4782
+ ie(!0), b && b(), d && d(e);
4783
+ }, we = (e) => {
4784
+ w && (e.stopPropagation(), e.preventDefault());
4772
4785
  }, Te = () => {
4773
- ne((e) => !e);
4774
- }, Ee = (e) => {
4775
- switch (N) {
4786
+ K((e) => !e), ne(!1);
4787
+ }, Ee = () => {
4788
+ ne((e) => !e), K(!1);
4789
+ }, De = () => {
4790
+ ie((e) => !e);
4791
+ }, Oe = (e) => {
4792
+ switch (I) {
4776
4793
  case X.DdMmYyyy:
4777
4794
  case X.DdMm:
4778
4795
  if (e) {
4779
4796
  let t = e.getMonth(), n = e.getFullYear() || 2024;
4780
- U !== n && W(n), V !== +t && H(+t), ie(qa(e, N));
4781
- } else ie("");
4797
+ W !== n && G(n), H !== +t && U(+t), oe(qa(e, I));
4798
+ } else oe("");
4782
4799
  break;
4783
4800
  case X.MmYyyy:
4784
- ie(e ? qa(e, N) : "");
4801
+ oe(e ? qa(e, I) : "");
4785
4802
  break;
4786
4803
  default: break;
4787
4804
  }
4788
- }, De = (e) => {
4789
- o(Ja(null), e), oe({
4805
+ }, ke = (e) => {
4806
+ s(Ja(null), e), ce({
4790
4807
  date: !1,
4791
4808
  time: !1
4792
- }), Ee(null);
4793
- }, Oe = (e, t) => {
4794
- let n = new Date(e.getFullYear(), e.getMonth(), e.getDate(), ye, be);
4795
- oe((e) => ({
4809
+ }), Oe(null);
4810
+ }, Ae = (e, t) => {
4811
+ let n = new Date(e.getFullYear(), e.getMonth(), e.getDate(), xe, Se);
4812
+ ce((e) => ({
4796
4813
  ...e,
4797
4814
  date: !0
4798
- })), o(Ja(n), t), Ee(n), ae.time && (ne(!1), b?.());
4799
- }, ke = (e) => {
4815
+ })), s(Ja(n), t), Oe(n), se.time && (ie(!1), S?.());
4816
+ }, je = (e) => {
4800
4817
  let t = 0;
4801
- V === 0 ? U > ue ? (t = 11, W(U - 1)) : W(ue) : t = U === ue && V <= fe ? fe : V - 1, H(t), h?.(t, e);
4802
- }, Ae = (e) => {
4818
+ H === 0 ? W > fe ? (t = 11, G(W - 1)) : G(fe) : t = W === fe && H <= me ? me : H - 1, U(t), g?.(t, e);
4819
+ }, Me = (e) => {
4803
4820
  let t = 0;
4804
- V === 11 ? U < de ? (t = 0, W(U + 1)) : W(de) : t = U === de && V >= pe ? pe : V + 1, H(t), p?.(t, e);
4805
- }, je = (e) => {
4821
+ H === 11 ? W < pe ? (t = 0, G(W + 1)) : G(pe) : t = W === pe && H >= he ? he : H + 1, U(t), h?.(t, e);
4822
+ }, Ne = (e) => {
4806
4823
  let t = +e.target.dataset.value;
4807
- W(t), q(!1), ee(!0);
4808
- let n = new Date(t, _e, ve, ye, be);
4809
- o(Ja(n), e), Ee(n), d?.(t);
4810
- }, Me = (e) => {
4824
+ G(t), ne(!1), K(!0);
4825
+ let n = new Date(t, ye, be, xe, Se);
4826
+ s(Ja(n), e), Oe(n), f?.(t);
4827
+ }, Pe = (e) => {
4811
4828
  let t = +e.target.dataset.value;
4812
- if (H(t), ee(!1), N === X.DdMm || N === X.DdMmYyyy) {
4813
- let n = new Date(ge, t, ve, ye, be);
4814
- o(Ja(n), e), Ee(n), f?.(t);
4815
- } else if (N === X.MmYyyy) {
4816
- let n = new Date(ge, t, 1, ye, be);
4817
- o(Ja(n), e), Ee(n), f?.(t), q(!0), ne(!1), b?.();
4829
+ if (U(t), K(!1), I === X.DdMm || I === X.DdMmYyyy) {
4830
+ let n = new Date(ve, t, be, xe, Se);
4831
+ s(Ja(n), e), Oe(n), p?.(t);
4832
+ } else if (I === X.MmYyyy) {
4833
+ let n = new Date(ve, t, 1, xe, Se);
4834
+ s(Ja(n), e), Oe(n), p?.(t), ne(!0), ie(!1), S?.();
4818
4835
  }
4819
- }, Ne = e.useCallback(() => /* @__PURE__ */ P("div", {
4836
+ }, Fe = e.useCallback(() => /* @__PURE__ */ P("div", {
4820
4837
  className: "date-picker-year-panel",
4821
- ref: B,
4822
- children: Array.from({ length: de + 1 - ue }, (e, t) => {
4823
- let n = ue + t;
4838
+ ref: V,
4839
+ children: Array.from({ length: pe + 1 - fe }, (e, t) => {
4840
+ let n = fe + t;
4824
4841
  return /* @__PURE__ */ P("button", {
4825
4842
  type: "button",
4826
4843
  "data-value": n,
4827
- onClick: je,
4828
- className: J(ge === n && "selected-year"),
4844
+ onClick: Ne,
4845
+ className: J(ve === n && "selected-year"),
4829
4846
  children: n
4830
4847
  }, n);
4831
4848
  })
4832
- }), [t]), Pe = e.useCallback(() => {
4833
- let e = U === ue ? fe : 0, t = U === de ? pe : 11;
4849
+ }), [n]), Ie = e.useCallback(() => {
4850
+ let e = W === fe ? me : 0, t = W === pe ? he : 11;
4834
4851
  return /* @__PURE__ */ P("div", {
4835
4852
  className: "date-picker-month-panel",
4836
4853
  children: Array.from({ length: 12 }, (n, r) => /* @__PURE__ */ F("button", {
4837
- onClick: Me,
4854
+ onClick: Pe,
4838
4855
  type: "button",
4839
4856
  "data-value": r,
4840
- className: J(_e === r && "selected-month", (r < e || r > t) && "disabled"),
4857
+ className: J(ye === r && "selected-month", (r < e || r > t) && "disabled"),
4841
4858
  children: ["Tháng ", r + 1]
4842
4859
  }, r))
4843
4860
  });
4844
- }, [t]), Fe = e.useCallback(() => {
4845
- let e = U === de && V === pe, t = U === ue && V === fe;
4861
+ }, [n]), Le = e.useCallback(() => {
4862
+ let e = W === pe && H === he, t = W === fe && H === me;
4846
4863
  return /* @__PURE__ */ P("div", {
4847
4864
  className: "date-picker-wrapped-header",
4848
4865
  children: /* @__PURE__ */ F("div", {
@@ -4851,60 +4868,60 @@ var Ua = Y({
4851
4868
  className: "date-picker-panel-control-wrapper",
4852
4869
  children: [/* @__PURE__ */ F("button", {
4853
4870
  type: "button",
4854
- onClick: Ce,
4871
+ onClick: Te,
4855
4872
  className: "date-picker-panel-control-button month-select",
4856
4873
  children: [
4857
- /* @__PURE__ */ F("span", { children: ["Tháng ", V + 1] }),
4874
+ /* @__PURE__ */ F("span", { children: ["Tháng ", H + 1] }),
4858
4875
  " ",
4859
- N === X.DdMm && P(G ? x : _, {})
4876
+ I === X.DdMm && P(te ? x : _, {})
4860
4877
  ]
4861
- }), N !== X.DdMm && /* @__PURE__ */ F("button", {
4878
+ }), I !== X.DdMm && /* @__PURE__ */ F("button", {
4862
4879
  type: "button",
4863
- onClick: we,
4880
+ onClick: Ee,
4864
4881
  className: "date-picker-panel-control-button year-select",
4865
4882
  children: [/* @__PURE__ */ F("span", { children: [
4866
4883
  " ",
4867
4884
  "/",
4868
4885
  " ",
4869
- U
4870
- ] }), P(K ? x : _, {})]
4886
+ W
4887
+ ] }), P(q ? x : _, {})]
4871
4888
  })]
4872
- }), !K && !G && /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("button", {
4889
+ }), !q && !te && /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("button", {
4873
4890
  className: "date-picker-month-control",
4874
- disabled: C || t,
4875
- onClick: ke,
4891
+ disabled: w || t,
4892
+ onClick: je,
4876
4893
  type: "button",
4877
4894
  children: /* @__PURE__ */ P(v, {})
4878
4895
  }), /* @__PURE__ */ P("button", {
4879
4896
  className: "date-picker-month-control",
4880
- disabled: C || e,
4881
- onClick: Ae,
4897
+ disabled: w || e,
4898
+ onClick: Me,
4882
4899
  type: "button",
4883
4900
  children: /* @__PURE__ */ P(y, {})
4884
4901
  })] })]
4885
4902
  })
4886
4903
  });
4887
4904
  }, [
4888
- V,
4889
- U,
4890
- t,
4891
- K,
4892
- G,
4893
- N
4894
- ]), Ie = e.useCallback(() => {
4895
- let e = (new Date(U, V, 1).getDay() + 6) % 7, n = new Date(U, V + 1, 0).getDate(), r = [];
4905
+ H,
4906
+ W,
4907
+ n,
4908
+ q,
4909
+ te,
4910
+ I
4911
+ ]), Re = e.useCallback(() => {
4912
+ let e = (new Date(W, H, 1).getDay() + 6) % 7, t = new Date(W, H + 1, 0).getDate(), r = [];
4896
4913
  for (let t = 0; t < e; t++) r.push(/* @__PURE__ */ P("div", { className: "date-picker-day" }, `empty-${t}`));
4897
- for (let e = 1; e <= n; e++) {
4898
- let n = new Date(U, V, e);
4914
+ for (let e = 1; e <= t; e++) {
4915
+ let t = new Date(W, H, e);
4899
4916
  r.push(/* @__PURE__ */ P("div", {
4900
- className: J("date-picker-day", t?.getDate() === e && t?.getMonth() === V && t?.getFullYear() === U && "selected-date", U === ue && V <= fe && e < me && "disabled", U === de && V >= pe && e > he && "disabled", w.length && w.find((e) => `${qa(e, X.DdMmYyyy)}` == `${qa(n, X.DdMmYyyy)}`) && "disabled", T && T(n) && "disabled", "valid-date", L && U === z.getFullYear() && V === z.getMonth() && e === z.getDate() && "today", `${n}`),
4917
+ className: J("date-picker-day", n?.getDate() === e && n?.getMonth() === H && n?.getFullYear() === W && "selected-date", W === fe && H <= me && e < ge && "disabled", W === pe && H >= he && e > _e && "disabled", T.length && T.find((e) => `${qa(e, X.DdMmYyyy)}` == `${qa(t, X.DdMmYyyy)}`) && "disabled", E && E(t) && "disabled", "valid-date", R && W === B.getFullYear() && H === B.getMonth() && e === B.getDate() && "today", `${t}`),
4901
4918
  role: "button",
4902
4919
  tabIndex: 0,
4903
4920
  onClick: (e) => {
4904
- Oe(n, e);
4921
+ Ae(t, e);
4905
4922
  },
4906
4923
  onKeyDown: (e) => {
4907
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), Oe(n, e));
4924
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), Ae(t, e));
4908
4925
  },
4909
4926
  children: e
4910
4927
  }, e));
@@ -4931,127 +4948,129 @@ var Ua = Y({
4931
4948
  })]
4932
4949
  });
4933
4950
  }, [
4934
- t,
4935
- V,
4936
- U,
4937
- L,
4938
- ae
4939
- ]), Le = (e) => {
4940
- if (!M) return;
4951
+ n,
4952
+ H,
4953
+ W,
4954
+ R,
4955
+ se
4956
+ ]), ze = (e) => {
4957
+ if (!N) return;
4941
4958
  let { value: t } = e.target;
4942
- ie(t.replace(/[^0-9/]/g, ""));
4943
- }, Re = (e) => {
4944
- switch (N) {
4959
+ oe(t.replace(/[^0-9/]/g, ""));
4960
+ }, Be = (e) => {
4961
+ switch (I) {
4945
4962
  case X.DdMmYyyy:
4946
- if (e.target.value !== qa(t, N)) {
4963
+ if (e.target.value !== qa(n, I)) {
4947
4964
  let t = e?.target?.value?.split("/"), n = +t[0], r = +t[1], i = +t[2];
4948
- if (+r > 12 ? r = 12 : +r < 1 && (r = 1), +i > de ? i = de : +i < ue && (i = ue), !Ka(i, r, n) && n <= 0) n = 1;
4965
+ if (+r > 12 ? r = 12 : +r < 1 && (r = 1), +i > pe ? i = pe : +i < fe && (i = fe), !Ka(i, r, n) && n <= 0) n = 1;
4949
4966
  else {
4950
4967
  let e = new Date(i, r, 0).getDate();
4951
4968
  !Ka(i, r, n) && +n > e && (n = e);
4952
4969
  }
4953
- let a = r - 1, s = new Date(i, a, +n, ye, be);
4954
- isNaN(s.getTime()) ? (o(Ja(null), e), Ee(null)) : (o(Ja(s), e), Ee(s));
4970
+ let a = r - 1, o = new Date(i, a, +n, xe, Se);
4971
+ isNaN(o.getTime()) ? (s(Ja(null), e), Oe(null)) : (s(Ja(o), e), Oe(o));
4955
4972
  }
4956
- s?.(e);
4973
+ c?.(e);
4957
4974
  break;
4958
4975
  case X.DdMm: {
4959
4976
  let t = e?.target?.value?.split("/"), n = +t[0], r = +t[1];
4960
4977
  r > 12 && (r = 12), r < 1 && (r = 1);
4961
4978
  let i = new Date((/* @__PURE__ */ new Date()).getFullYear(), r, 0).getDate();
4962
4979
  if (n > i && (n = i), n < 1 && (n = 1), Ka((/* @__PURE__ */ new Date()).getFullYear(), r, n)) {
4963
- let t = new Date((/* @__PURE__ */ new Date()).getFullYear(), r - 1, n, ye, be);
4964
- isNaN(t.getTime()) ? (o(Ja(null), e), Ee(null)) : (o(Ja(t), e), Ee(t));
4980
+ let t = new Date((/* @__PURE__ */ new Date()).getFullYear(), r - 1, n, xe, Se);
4981
+ isNaN(t.getTime()) ? (s(Ja(null), e), Oe(null)) : (s(Ja(t), e), Oe(t));
4965
4982
  }
4966
- s?.(e);
4983
+ c?.(e);
4967
4984
  break;
4968
4985
  }
4969
4986
  case X.MmYyyy: {
4970
4987
  let t = e?.target?.value?.split("/"), n = +t[0], r = +t[1];
4971
- if (n > 12 && (n = 12), n < 1 && (n = 1), r > de && (r = de), r < ue && (r = ue), Ka(r, n, 1)) {
4972
- let t = new Date(r, n - 1, 1, ye, be);
4973
- isNaN(t.getTime()) ? (o(Ja(null), e), Ee(null)) : (o(Ja(t), e), Ee(t));
4988
+ if (n > 12 && (n = 12), n < 1 && (n = 1), r > pe && (r = pe), r < fe && (r = fe), Ka(r, n, 1)) {
4989
+ let t = new Date(r, n - 1, 1, xe, Se);
4990
+ isNaN(t.getTime()) ? (s(Ja(null), e), Oe(null)) : (s(Ja(t), e), Oe(t));
4974
4991
  }
4975
- s?.(e);
4992
+ c?.(e);
4976
4993
  break;
4977
4994
  }
4978
4995
  default: break;
4979
4996
  }
4980
- }, ze = (e) => {
4997
+ }, Ve = (e) => {
4981
4998
  let { hour: t, minute: n } = Ya(+e.target.dataset.value);
4982
- oe((e) => ({
4999
+ ce((e) => ({
4983
5000
  ...e,
4984
5001
  time: !0
4985
5002
  }));
4986
- let r = new Date(ge, _e, ve, t, n);
4987
- o(Ja(r), e), Ee(r), ae.date && (ne(!1), b?.());
4988
- }, Be = e.useCallback(() => /* @__PURE__ */ F("div", {
5003
+ let r = new Date(ve, ye, be, t, n);
5004
+ s(Ja(r), e), Oe(r), se.date && (ie(!1), S?.());
5005
+ }, He = e.useCallback(() => /* @__PURE__ */ F("div", {
4989
5006
  className: "date-time-picker-time-wrapper",
4990
5007
  children: [/* @__PURE__ */ P("div", {
4991
5008
  className: "date-time-picker-time-header",
4992
5009
  children: "Giờ"
4993
5010
  }), /* @__PURE__ */ P("div", {
4994
5011
  className: "date-time-picker-time-body",
4995
- children: n.map((e) => {
4996
- let { hour: n, minute: r } = Ya(e), i = `${n}:${r.toString().padStart(2, "0")}`;
5012
+ children: r.map((e) => {
5013
+ let { hour: t, minute: r } = Ya(e), i = `${t}:${r.toString().padStart(2, "0")}`;
4997
5014
  return /* @__PURE__ */ P("button", {
4998
5015
  "data-value": e,
4999
5016
  type: "button",
5000
- onClick: ze,
5001
- className: J("date-time-picker-time-button", t?.getHours() === n && t?.getMinutes() === r && "selected-time"),
5017
+ onClick: Ve,
5018
+ className: J("date-time-picker-time-button", n?.getHours() === t && n?.getMinutes() === r && "selected-time"),
5002
5019
  children: i
5003
5020
  }, i);
5004
5021
  })
5005
5022
  })]
5006
- }), [t, n]);
5023
+ }), [n, r]);
5007
5024
  return /* @__PURE__ */ F("div", {
5008
- ref: ce.ref,
5009
- className: J(Ua(), R),
5025
+ ...z,
5026
+ ref: ue.ref,
5027
+ className: J(Ua(), ee),
5010
5028
  "data-clad": "Date Time Picker",
5011
5029
  children: [
5012
5030
  /* @__PURE__ */ P(Ia, {
5013
- required: a,
5014
- disabled: C,
5015
- label: i,
5031
+ id: t,
5032
+ required: o,
5033
+ disabled: w,
5034
+ label: a,
5016
5035
  type: "text",
5017
5036
  placeholder: "dd/mm/yyyy hh:mm",
5018
- onClear: De,
5019
- onChange: Le,
5020
- onBlur: Re,
5021
- onFocus: xe,
5022
- allowClear: j,
5023
- value: re,
5024
- helptext: I
5037
+ onClear: ke,
5038
+ onChange: ze,
5039
+ onBlur: Be,
5040
+ onFocus: Ce,
5041
+ allowClear: M,
5042
+ value: ae,
5043
+ helptext: L
5025
5044
  }),
5026
5045
  /* @__PURE__ */ P("button", {
5027
5046
  type: "button",
5028
5047
  className: "date-picker-icon",
5029
- onClick: Te,
5048
+ onClick: De,
5030
5049
  "aria-label": "Toggle calendar",
5031
- "aria-expanded": te,
5032
- disabled: C,
5033
- children: S || /* @__PURE__ */ P(m, {
5050
+ "aria-expanded": re,
5051
+ disabled: w,
5052
+ children: C || /* @__PURE__ */ P(m, {
5034
5053
  width: 20,
5035
5054
  height: 20,
5036
5055
  "aria-hidden": !0
5037
5056
  })
5038
5057
  }),
5039
- te ? se(/* @__PURE__ */ F("div", {
5058
+ re ? le(/* @__PURE__ */ F("div", {
5040
5059
  className: "date-picker-layout",
5041
5060
  "data-clad": "Date Time Picker Calendar",
5042
- ...le,
5061
+ ...de,
5043
5062
  children: [/* @__PURE__ */ P("div", {
5044
- className: J("date-picker-calendar", C && "disabled"),
5045
- onFocus: c,
5046
- onBlur: l,
5047
- onClick: Se,
5063
+ className: J("date-picker-calendar", w && "disabled"),
5064
+ onFocus: l,
5065
+ onBlur: u,
5066
+ onClick: we,
5048
5067
  children: /* @__PURE__ */ F("div", { children: [
5049
- Fe(),
5050
- N === X.MmYyyy ? /* @__PURE__ */ P("div", { className: "h-[200px]" }) : Ie(),
5051
- !!K && Ne(),
5052
- !!G && Pe()
5068
+ Le(),
5069
+ I === X.MmYyyy ? /* @__PURE__ */ P("div", { className: "h-[200px]" }) : Re(),
5070
+ !!q && Fe(),
5071
+ !!te && Ie()
5053
5072
  ] })
5054
- }), Be()]
5073
+ }), He()]
5055
5074
  })) : null
5056
5075
  ]
5057
5076
  });
@@ -5108,111 +5127,116 @@ var ro = () => {}, io = {
5108
5127
  S: "size-s",
5109
5128
  M: "size-m",
5110
5129
  L: "size-l"
5111
- }, oo = e.createContext({}), so = ({ onClick: t, className: n = "" }) => {
5112
- let { onClose: r, isExpanded: i, setIsExpanded: a, halfHeight: o, setIsDragging: s, setDragTranslateY: c, canExpand: l } = e.useContext(oo), u = e.useRef(0), d = e.useRef(0), f = e.useRef(!1), p = (e) => {
5130
+ }, oo = e.createContext({}), so = ({ onClick: t, className: n = "", ...r }) => {
5131
+ let { onClose: i, isExpanded: a, setIsExpanded: o, halfHeight: s, setIsDragging: c, setDragTranslateY: l, canExpand: u } = e.useContext(oo), d = e.useRef(0), f = e.useRef(0), p = e.useRef(!1), m = (e) => {
5113
5132
  if (e.button === 0 && !(typeof window < "u" && window.innerWidth >= 768)) {
5114
- u.current = e.clientY, d.current = 0, f.current = !0, s?.(!0);
5133
+ d.current = e.clientY, f.current = 0, p.current = !0, c?.(!0);
5115
5134
  try {
5116
5135
  e.currentTarget.setPointerCapture(e.pointerId);
5117
5136
  } catch {}
5118
5137
  }
5119
- }, m = (e) => {
5120
- if (!f.current) return;
5121
- let t = e.clientY - u.current, n = t;
5122
- (i || l === !1) && t < 0 && (n = t * .2), d.current = n, c?.(n);
5123
5138
  }, h = (e) => {
5124
- if (!f.current) return;
5125
- f.current = !1, s?.(!1), c?.(0);
5139
+ if (!p.current) return;
5140
+ let t = e.clientY - d.current, n = t;
5141
+ (a || u === !1) && t < 0 && (n = t * .2), f.current = n, l?.(n);
5142
+ }, g = (e) => {
5143
+ if (!p.current) return;
5144
+ p.current = !1, c?.(!1), l?.(0);
5126
5145
  try {
5127
5146
  e.currentTarget.hasPointerCapture(e.pointerId) && e.currentTarget.releasePointerCapture(e.pointerId);
5128
5147
  } catch {}
5129
- let t = d.current;
5130
- t > 50 ? o && i && a ? a(!1) : r && r(e) : t < -50 && o && !i && l !== !1 && a && a(!0);
5131
- };
5132
- return o && !l ? null : /* @__PURE__ */ P("div", {
5133
- onPointerDown: p,
5134
- onPointerMove: m,
5135
- onPointerUp: h,
5136
- onPointerCancel: h,
5137
- onClick: (e) => {
5138
- if (!(Math.abs(d.current) >= 5)) {
5139
- if (t) {
5140
- t(e);
5148
+ let t = f.current;
5149
+ t > 50 ? s && a && o ? o(!1) : i && i(e) : t < -50 && s && !a && u !== !1 && o && o(!0);
5150
+ }, _ = (e) => {
5151
+ if (!(Math.abs(f.current) >= 5)) {
5152
+ if (t) {
5153
+ t(e);
5154
+ return;
5155
+ }
5156
+ if (s) {
5157
+ if (!a && u !== !1 && o) {
5158
+ o(!0);
5141
5159
  return;
5142
5160
  }
5143
- if (o) {
5144
- if (!i && l !== !1 && a) {
5145
- a(!0);
5146
- return;
5147
- }
5148
- if (i && a) {
5149
- a(!1);
5150
- return;
5151
- }
5161
+ if (a && o) {
5162
+ o(!1);
5163
+ return;
5152
5164
  }
5153
- r && r(e);
5154
5165
  }
5155
- },
5166
+ i && i(e);
5167
+ }
5168
+ };
5169
+ return s && !u ? null : /* @__PURE__ */ P("div", {
5170
+ ...r,
5171
+ onPointerDown: m,
5172
+ onPointerMove: h,
5173
+ onPointerUp: g,
5174
+ onPointerCancel: g,
5175
+ onClick: _,
5156
5176
  className: J("drawer-drag-handle-slot", n),
5157
5177
  "data-clad": "Drawer.DragHandle",
5158
5178
  children: /* @__PURE__ */ P("div", { className: "drawer-drag-handle-pill" })
5159
5179
  });
5160
- }, co = ({ children: t, open: n = !1, onClose: r = ro, size: i = "S", halfHeight: a = !1, dragHandle: o = !1, className: s = "", needBypassScrollLock: c = !1 }) => {
5161
- let [l, u] = e.useState(!1), [d, f] = e.useState(!1), [p, m] = e.useState(0), [h, g] = e.useState(!a), _ = e.useRef(null);
5180
+ }, co = ({ children: t, open: n = !1, onClose: r = ro, size: i = "S", halfHeight: a = !1, dragHandle: o = !1, className: s = "", needBypassScrollLock: c = !1, style: l, ...u }) => {
5181
+ let [d, f] = e.useState(!1), [p, m] = e.useState(!1), [h, g] = e.useState(0), [_, v] = e.useState(!a), y = e.useRef(null);
5162
5182
  to(n && !c), e.useEffect(() => {
5163
- n || (u(!1), f(!1), m(0), g(!a));
5183
+ n || (f(!1), m(!1), g(0), v(!a));
5164
5184
  }, [n, a]);
5165
- let v = e.useMemo(() => ({
5185
+ let b = e.useMemo(() => ({
5166
5186
  onClose: r,
5167
- isExpanded: l,
5168
- setIsExpanded: u,
5187
+ isExpanded: d,
5188
+ setIsExpanded: f,
5169
5189
  halfHeight: a,
5170
- isDragging: d,
5171
- setIsDragging: f,
5172
- dragTranslateY: p,
5173
- setDragTranslateY: m,
5174
- canExpand: h,
5175
- setCanExpand: g
5190
+ isDragging: p,
5191
+ setIsDragging: m,
5192
+ dragTranslateY: h,
5193
+ setDragTranslateY: g,
5194
+ canExpand: _,
5195
+ setCanExpand: v
5176
5196
  }), [
5177
5197
  r,
5178
- l,
5179
- a,
5180
5198
  d,
5199
+ a,
5181
5200
  p,
5182
- h
5201
+ h,
5202
+ _
5183
5203
  ]);
5184
5204
  if (!n) return null;
5185
- let y = J("drawer", s, ao[i] || ao.S, a && "half-height", a && l && "is-expanded");
5205
+ let x = J("drawer", s, ao[i] || ao.S, a && "half-height", a && d && "is-expanded");
5186
5206
  return Qa(/* @__PURE__ */ P(oo.Provider, {
5187
- value: v,
5207
+ value: b,
5188
5208
  children: /* @__PURE__ */ F("div", {
5189
- ref: _,
5209
+ ref: y,
5190
5210
  className: "drawer-modal",
5191
5211
  "data-clad": "Drawer.Modal",
5192
5212
  children: [/* @__PURE__ */ P("div", {
5193
5213
  className: "drawer-backdrop",
5194
5214
  onClick: r
5195
5215
  }), /* @__PURE__ */ F("div", {
5196
- className: y,
5197
- style: d ? {
5198
- transform: `translate3d(0, ${p}px, 0)`,
5216
+ ...u,
5217
+ className: x,
5218
+ style: p ? {
5219
+ ...l,
5220
+ transform: `translate3d(0, ${h}px, 0)`,
5199
5221
  transition: "none"
5200
- } : void 0,
5222
+ } : l,
5201
5223
  "data-clad": "Drawer.Container",
5202
5224
  children: [!!o && /* @__PURE__ */ P(so, {}), t]
5203
5225
  })]
5204
5226
  })
5205
5227
  }));
5206
- }, lo = ({ type: t = "icon", icon: n, text: r, onClick: i, className: a = "" }) => {
5207
- let { onClose: o } = e.useContext(oo);
5228
+ }, lo = ({ type: t = "icon", icon: n, text: r, onClick: i, className: a = "", ...o }) => {
5229
+ let { onClose: s } = e.useContext(oo), c = i || s;
5208
5230
  return /* @__PURE__ */ P("button", {
5231
+ ...o,
5209
5232
  type: "button",
5210
- onClick: i || o,
5233
+ onClick: c,
5211
5234
  className: J("drawer-header-item-btn", t === "textLink" && "is-text-link", a),
5212
5235
  "data-clad": "Drawer.HeaderItem",
5213
5236
  children: t === "textLink" ? r : n
5214
5237
  });
5215
- }, uo = ({ title: e, leading: t, trailing: n, className: r = "" }) => /* @__PURE__ */ F("div", {
5238
+ }, uo = ({ title: e, leading: t, trailing: n, className: r = "", ...i }) => /* @__PURE__ */ F("div", {
5239
+ ...i,
5216
5240
  className: J("drawer-slot-header", r),
5217
5241
  "data-clad": "Drawer.Header",
5218
5242
  children: [
@@ -5229,249 +5253,255 @@ var ro = () => {}, io = {
5229
5253
  children: n
5230
5254
  })
5231
5255
  ]
5232
- }), fo = ({ children: t, className: n = "", hideScrollbar: r = !1, childrenOverflowVisible: i = !1 }) => {
5233
- let { halfHeight: a, isExpanded: o, setIsExpanded: s, canExpand: c, setCanExpand: l } = e.useContext(oo), [u, d] = no(), [f, p] = e.useState(!1), m = e.useRef(null), h = e.useRef(null);
5256
+ }), fo = ({ children: t, className: n = "", hideScrollbar: r = !1, childrenOverflowVisible: i = !1, ...a }) => {
5257
+ let { halfHeight: o, isExpanded: s, setIsExpanded: c, canExpand: l, setCanExpand: u } = e.useContext(oo), [d, f] = no(), [p, m] = e.useState(!1), h = e.useRef(null), g = e.useRef(null);
5234
5258
  e.useEffect(() => {
5235
- a && !o && c !== !1 && +u > 0 && s && s(!0);
5259
+ o && !s && l !== !1 && +d > 0 && c && c(!0);
5236
5260
  }, [
5237
- u,
5238
- a,
5261
+ d,
5239
5262
  o,
5240
- c,
5241
- s
5263
+ s,
5264
+ l,
5265
+ c
5242
5266
  ]);
5243
- let g = () => {
5244
- let e = m.current;
5267
+ let _ = () => {
5268
+ let e = h.current;
5245
5269
  return e ? e.scrollHeight - e.scrollTop > e.clientHeight + 1 : !1;
5246
5270
  };
5247
5271
  e.useEffect(() => {
5248
- p(g());
5249
- }, [u, t]), e.useEffect(() => {
5250
- if (a && !o && m.current && l) {
5272
+ m(_());
5273
+ }, [d, t]), e.useEffect(() => {
5274
+ if (o && !s && h.current && u) {
5251
5275
  let e = () => {
5252
- let e = m.current;
5253
- e && l(e.scrollHeight > e.clientHeight + 1);
5276
+ let e = h.current;
5277
+ e && u(e.scrollHeight > e.clientHeight + 1);
5254
5278
  };
5255
5279
  e();
5256
5280
  let t = typeof requestAnimationFrame < "u" ? requestAnimationFrame(e) : void 0, n;
5257
- return typeof ResizeObserver < "u" && m.current && (n = new ResizeObserver(e), n.observe(m.current)), () => {
5281
+ return typeof ResizeObserver < "u" && h.current && (n = new ResizeObserver(e), n.observe(h.current)), () => {
5258
5282
  t && cancelAnimationFrame(t), n?.disconnect();
5259
5283
  };
5260
5284
  }
5261
5285
  }, [
5262
- a,
5263
5286
  o,
5287
+ s,
5264
5288
  t,
5265
- l
5289
+ u
5266
5290
  ]);
5267
- let _ = J((typeof t == "string" || typeof t == "number") && "is-single-string", i && "children-overflow-visible", r && "hide-scrollbar", n);
5291
+ let v = J((typeof t == "string" || typeof t == "number") && "is-single-string", i && "children-overflow-visible", r && "hide-scrollbar"), y = J(v, n);
5268
5292
  return /* @__PURE__ */ F("div", {
5269
- className: J("drawer-children-wrapper", _),
5270
- ref: h,
5293
+ ...a,
5294
+ className: J("drawer-children-wrapper", v),
5295
+ ref: g,
5271
5296
  "data-clad": "Drawer.Body",
5272
5297
  children: [
5273
5298
  /* @__PURE__ */ P("div", {
5274
5299
  className: "shadow-top shadow",
5275
5300
  style: {
5276
- opacity: +u > 0 ? "1" : "0",
5301
+ opacity: +d > 0 ? "1" : "0",
5277
5302
  transition: "opacity 0.3s"
5278
5303
  }
5279
5304
  }),
5280
5305
  /* @__PURE__ */ P("div", {
5281
5306
  className: "shadow-bottom shadow",
5282
5307
  style: {
5283
- opacity: f ? "1" : "0",
5308
+ opacity: p ? "1" : "0",
5284
5309
  transition: "opacity 0.3s"
5285
5310
  }
5286
5311
  }),
5287
5312
  /* @__PURE__ */ P("div", {
5288
- className: J("drawer-children-content", _),
5289
- ref: m,
5290
- ...d,
5313
+ className: J("drawer-children-content", y),
5314
+ ref: h,
5315
+ ...f,
5291
5316
  children: t
5292
5317
  })
5293
5318
  ]
5294
5319
  });
5295
- }, po = ({ children: e, direction: t = "horizontal", className: n = "" }) => /* @__PURE__ */ P("div", {
5320
+ }, po = ({ children: e, direction: t = "horizontal", className: n = "", ...r }) => /* @__PURE__ */ P("div", {
5321
+ ...r,
5296
5322
  className: J("drawer-slot-button-group", t === "vertical" && "is-vertical", n),
5297
5323
  "data-clad": "Drawer.Button",
5298
5324
  children: e
5299
- }), mo = Object.assign(({ className: t = "", title: n = "", children: r, primaryBtnLabel: i, secondaryBtnLabel: a, primaryColor: o = "primary", optionalBtnLabel: s, onOptionalBtnClick: c, btnRowPosition: l = "justify", open: u = !1, onClose: d = ro, onPrimaryButtonClick: f = ro, onSecondaryButtonClick: p = null, childrenOverflowVisible: m = !1, isEmptyDrawer: h = !1, haveClose: g = !0, closeIcon: _ = /* @__PURE__ */ P(C, {}), contentClassName: v = "", needBypassScrollLock: y = !1, actions: b, hideScrollbar: x = !1, size: S = "S", halfHeight: w = !1, dragHandle: T = !1 }) => {
5300
- let { useEffect: E, useRef: D, useState: O } = e, k = !!b || !!i, A = J((typeof r == "string" || typeof r == "number") && "is-single-string", !k && "no-button", m && "children-overflow-visible", x && "hide-scrollbar", v), [j, M] = no(), I = { ...M };
5301
- to(u && !y);
5302
- let [L, R] = O(!1), [z, B] = O(!1), [V, H] = O(!1), [U, W] = O(0), [G, ee] = O(!w), K = D(null), q = D(null), te = D(null);
5303
- E(() => {
5304
- u || (B(!1), H(!1), W(0), ee(!w));
5305
- }, [u, w]), E(() => {
5306
- w && !z && G && +j > 0 && B(!0);
5325
+ }), mo = Object.assign(({ className: t = "", title: n = "", children: r, primaryBtnLabel: i, secondaryBtnLabel: a, primaryColor: o = "primary", disablePrimaryButton: s = !1, optionalBtnLabel: c, onOptionalBtnClick: l, btnRowPosition: u = "justify", open: d = !1, onClose: f = ro, onPrimaryButtonClick: p = ro, onSecondaryButtonClick: m = null, childrenOverflowVisible: h = !1, isEmptyDrawer: g = !1, haveClose: _ = !0, closeIcon: v = /* @__PURE__ */ P(C, {}), contentClassName: y = "", needBypassScrollLock: b = !1, actions: x, hideScrollbar: S = !1, size: w = "S", halfHeight: T = !1, dragHandle: E = !1, style: D, ...O }) => {
5326
+ let { useEffect: k, useRef: A, useState: j } = e, M = J((typeof r == "string" || typeof r == "number") && "is-single-string", !(x || i) && "no-button", h && "children-overflow-visible", S && "hide-scrollbar"), I = J(M, y), [L, R] = no(), ee = { ...R };
5327
+ to(d && !b);
5328
+ let [z, B] = j(!1), [V, H] = j(!1), [U, W] = j(!1), [G, te] = j(0), [K, q] = j(!T), ne = A(null), re = A(null), ie = A(null);
5329
+ k(() => {
5330
+ d || (H(!1), W(!1), te(0), q(!T));
5331
+ }, [d, T]), k(() => {
5332
+ T && !V && K && +L > 0 && H(!0);
5307
5333
  }, [
5308
- j,
5309
- w,
5310
- z,
5311
- G
5312
- ]), E(() => {
5313
- if (w && !z && K.current) {
5334
+ L,
5335
+ T,
5336
+ V,
5337
+ K
5338
+ ]), k(() => {
5339
+ if (T && !V && ne.current) {
5314
5340
  let e = () => {
5315
- let e = K.current;
5316
- e && ee(e.scrollHeight > e.clientHeight + 1);
5341
+ let e = ne.current;
5342
+ e && q(e.scrollHeight > e.clientHeight + 1);
5317
5343
  };
5318
5344
  e();
5319
5345
  let t = typeof requestAnimationFrame < "u" ? requestAnimationFrame(e) : void 0, n;
5320
- return typeof ResizeObserver < "u" && K.current && (n = new ResizeObserver(e), n.observe(K.current)), () => {
5346
+ return typeof ResizeObserver < "u" && ne.current && (n = new ResizeObserver(e), n.observe(ne.current)), () => {
5321
5347
  t && cancelAnimationFrame(t), n?.disconnect();
5322
5348
  };
5323
5349
  }
5324
5350
  }, [
5325
- w,
5326
- z,
5351
+ T,
5352
+ V,
5327
5353
  r
5328
5354
  ]);
5329
- let ne = J("drawer-option-btn", (typeof s == "string" || typeof s == "number") && "is-text"), re = { justifyContent: io[l] || "flex-end" }, ie = () => {
5330
- let e = K.current;
5355
+ let ae = J("drawer-option-btn", (typeof c == "string" || typeof c == "number") && "is-text"), oe = { justifyContent: io[u] || "flex-end" }, se = () => {
5356
+ let e = ne.current;
5331
5357
  return e ? e.scrollHeight - e.scrollTop > e.clientHeight + 1 : !1;
5332
5358
  };
5333
- E(() => {
5334
- R(ie());
5359
+ k(() => {
5360
+ B(se());
5335
5361
  }, [
5336
- u,
5337
- j,
5362
+ d,
5363
+ L,
5338
5364
  r
5339
5365
  ]);
5340
- let ae = J("drawer-close-btn", (typeof _ == "string" || typeof _ == "number") && "is-text"), oe = () => b ? /* @__PURE__ */ P("div", {
5366
+ let ce = J("drawer-close-btn", (typeof v == "string" || typeof v == "number") && "is-text"), le = () => x ? /* @__PURE__ */ P("div", {
5341
5367
  className: "drawer-button-group",
5342
- "data-clad": "Drawer",
5343
- children: b
5368
+ "data-clad": "Drawer.Button",
5369
+ children: x
5344
5370
  }) : i ? /* @__PURE__ */ F("div", {
5345
5371
  className: "drawer-button-group",
5346
- style: re,
5347
- "data-clad": "Drawer",
5372
+ style: oe,
5373
+ "data-clad": "Drawer.Button",
5348
5374
  children: [!!a && /* @__PURE__ */ P(or, {
5349
5375
  variant: "outline",
5350
5376
  color: "tertiary",
5351
5377
  size: "large",
5352
- className: J(l === "justify" && "drawer-btn-full"),
5353
- onClick: p || d,
5378
+ className: J(u === "justify" && "drawer-btn-full"),
5379
+ onClick: m || f,
5354
5380
  children: a
5355
5381
  }), /* @__PURE__ */ P(or, {
5356
5382
  color: o,
5357
5383
  size: "large",
5358
- className: J(l === "justify" && "drawer-btn-full"),
5359
- onClick: f,
5384
+ disabled: s,
5385
+ className: J(u === "justify" && "drawer-btn-full"),
5386
+ onClick: p,
5360
5387
  children: i
5361
5388
  })]
5362
- }) : null, se = e.useMemo(() => ({
5363
- onClose: d,
5364
- isExpanded: z,
5365
- setIsExpanded: B,
5366
- halfHeight: w,
5367
- isDragging: V,
5368
- setIsDragging: H,
5369
- dragTranslateY: U,
5370
- setDragTranslateY: W,
5371
- canExpand: G,
5372
- setCanExpand: ee
5389
+ }) : null, ue = e.useMemo(() => ({
5390
+ onClose: f,
5391
+ isExpanded: V,
5392
+ setIsExpanded: H,
5393
+ halfHeight: T,
5394
+ isDragging: U,
5395
+ setIsDragging: W,
5396
+ dragTranslateY: G,
5397
+ setDragTranslateY: te,
5398
+ canExpand: K,
5399
+ setCanExpand: q
5373
5400
  }), [
5374
- d,
5375
- z,
5376
- w,
5401
+ f,
5377
5402
  V,
5403
+ T,
5378
5404
  U,
5379
- G
5405
+ G,
5406
+ K
5380
5407
  ]);
5381
- if (!u) return null;
5382
- let ce = J("drawer", t, h && "no-spacing", ao[S] || ao.S, w && "half-height", w && z && "is-expanded");
5408
+ if (!d) return null;
5409
+ let de = J("drawer", t, g && "no-spacing", ao[w] || ao.S, T && "half-height", T && V && "is-expanded");
5383
5410
  return Qa(/* @__PURE__ */ P(oo.Provider, {
5384
- value: se,
5411
+ value: ue,
5385
5412
  children: /* @__PURE__ */ F("div", {
5386
- ref: te,
5413
+ ref: ie,
5387
5414
  className: "drawer-modal",
5388
5415
  "data-clad": "Drawer.Modal",
5389
5416
  children: [/* @__PURE__ */ P("div", {
5390
5417
  className: "drawer-backdrop",
5391
- onClick: d
5418
+ onClick: f
5392
5419
  }), /* @__PURE__ */ F("div", {
5393
- className: ce,
5394
- style: V ? {
5395
- transform: `translate3d(0, ${U}px, 0)`,
5420
+ ...O,
5421
+ className: de,
5422
+ style: U ? {
5423
+ ...D,
5424
+ transform: `translate3d(0, ${G}px, 0)`,
5396
5425
  transition: "none"
5397
- } : void 0,
5426
+ } : D,
5398
5427
  "data-clad": "Drawer",
5399
- children: [!!T && /* @__PURE__ */ P(so, {}), h ? /* @__PURE__ */ F("div", {
5400
- className: J("drawer-children-wrapper", A),
5401
- ref: q,
5402
- "data-clad": "Drawer",
5428
+ children: [!!E && /* @__PURE__ */ P(so, {}), g ? /* @__PURE__ */ F("div", {
5429
+ className: J("drawer-children-wrapper", M),
5430
+ ref: re,
5431
+ "data-clad": "Drawer.Body",
5403
5432
  children: [
5404
5433
  /* @__PURE__ */ P("div", {
5405
5434
  className: "shadow-top shadow",
5406
5435
  style: {
5407
- opacity: +j > 0 ? "1" : "0",
5436
+ opacity: +L > 0 ? "1" : "0",
5408
5437
  transition: "opacity 0.3s"
5409
5438
  }
5410
5439
  }),
5411
5440
  /* @__PURE__ */ P("div", {
5412
5441
  className: "shadow-bottom shadow",
5413
5442
  style: {
5414
- opacity: L ? "1" : "0",
5443
+ opacity: z ? "1" : "0",
5415
5444
  transition: "opacity 0.3s"
5416
5445
  }
5417
5446
  }),
5418
5447
  /* @__PURE__ */ P("div", {
5419
- className: J("drawer-children-content", A),
5420
- ref: K,
5421
- ...I,
5448
+ className: J("drawer-children-content", I),
5449
+ ref: ne,
5450
+ ...ee,
5422
5451
  children: r
5423
5452
  })
5424
5453
  ]
5425
5454
  }) : /* @__PURE__ */ F(N, { children: [
5426
5455
  /* @__PURE__ */ P("div", {
5427
5456
  className: "drawer-header",
5428
- "data-clad": k ? void 0 : "Drawer",
5457
+ "data-clad": "Drawer.Header",
5429
5458
  children: /* @__PURE__ */ F("div", {
5430
5459
  className: "drawer-header-top-bar",
5431
5460
  children: [
5432
- !!g && /* @__PURE__ */ P("button", {
5461
+ !!_ && /* @__PURE__ */ P("button", {
5433
5462
  type: "button",
5434
- onClick: d,
5435
- className: ae,
5436
- children: _
5463
+ onClick: f,
5464
+ className: ce,
5465
+ children: v
5437
5466
  }),
5438
5467
  /* @__PURE__ */ P("div", { children: !!n && /* @__PURE__ */ P("h5", { children: n }) }),
5439
- !!s && /* @__PURE__ */ P("button", {
5468
+ !!c && /* @__PURE__ */ P("button", {
5440
5469
  type: "button",
5441
- onClick: c,
5442
- className: ne,
5443
- children: s
5470
+ onClick: l,
5471
+ className: ae,
5472
+ children: c
5444
5473
  })
5445
5474
  ]
5446
5475
  })
5447
5476
  }),
5448
5477
  /* @__PURE__ */ F("div", {
5449
- className: J("drawer-children-wrapper", A),
5450
- ref: q,
5478
+ className: J("drawer-children-wrapper", M),
5479
+ ref: re,
5480
+ "data-clad": "Drawer.Body",
5451
5481
  children: [
5452
5482
  /* @__PURE__ */ P("div", {
5453
5483
  className: "shadow-top shadow",
5454
5484
  style: {
5455
- opacity: +j > 0 ? "1" : "0",
5485
+ opacity: +L > 0 ? "1" : "0",
5456
5486
  transition: "opacity 0.3s"
5457
5487
  }
5458
5488
  }),
5459
5489
  /* @__PURE__ */ P("div", {
5460
5490
  className: "shadow-bottom shadow",
5461
5491
  style: {
5462
- opacity: L ? "1" : "0",
5492
+ opacity: z ? "1" : "0",
5463
5493
  transition: "opacity 0.3s"
5464
5494
  }
5465
5495
  }),
5466
5496
  /* @__PURE__ */ P("div", {
5467
- className: J("drawer-children-content", A),
5468
- ref: K,
5469
- ...I,
5497
+ className: J("drawer-children-content", I),
5498
+ ref: ne,
5499
+ ...ee,
5470
5500
  children: r
5471
5501
  })
5472
5502
  ]
5473
5503
  }),
5474
- oe()
5504
+ le()
5475
5505
  ] })]
5476
5506
  })]
5477
5507
  })
@@ -5490,31 +5520,31 @@ var ro = () => {}, io = {
5490
5520
  default: "",
5491
5521
  error: "error"
5492
5522
  } }
5493
- }), go = () => {}, _o = ({ className: e = "", id: t = "", name: n = "", label: r = "", value: i = "", onClick: a = go, onChange: o = go, onBlur: s = go, onFocus: u = go, disabled: d = !1, required: m = !1, status: g = "default", helptext: v = "", helptextClassName: y = "", inputRef: b, options: x = [], width: S = "full", menuMaxHeight: C = "$sm", icon: w, paddingForIcon: T = 28 }) => {
5494
- let E = f(null), D = f(null), O = f(null), k = typeof b == "object" && b ? b : E;
5495
- l(b, () => k.current);
5496
- let [A, j] = p(!1), M = w ? T : 0, [N, I] = p(!1), { renderLayer: L, triggerProps: { ref: R }, layerProps: z, triggerBounds: B } = ba({
5497
- isOpen: A,
5523
+ }), go = () => {}, _o = ({ className: e = "", id: t = "", name: n = "", label: r = "", value: i = "", onClick: a = go, onChange: o = go, onBlur: s = go, onFocus: u = go, disabled: d = !1, required: m = !1, status: g = "default", helptext: v = "", helptextClassName: y = "", inputRef: b, options: x = [], width: S = "full", menuMaxHeight: C = "$sm", icon: w, paddingForIcon: T = 28, ...E }) => {
5524
+ let D = f(null), O = f(null), k = f(null), A = typeof b == "object" && b ? b : D;
5525
+ l(b, () => A.current);
5526
+ let [j, M] = p(!1), N = w ? T : 0, [I, L] = p(!1), { renderLayer: R, triggerProps: { ref: ee }, layerProps: z, triggerBounds: B } = ba({
5527
+ isOpen: j,
5498
5528
  auto: !0,
5499
5529
  snap: !0,
5500
5530
  placement: "bottom-start",
5501
5531
  possiblePlacements: ["top-start", "bottom-start"],
5502
5532
  triggerOffset: 2,
5503
5533
  onOutsideClick: () => {
5504
- j(!1);
5534
+ M(!1);
5505
5535
  }
5506
5536
  });
5507
- R(D.current), c(() => {
5537
+ ee(O.current), c(() => {
5508
5538
  let e = (e) => {
5509
- if (k.current && !k.current.contains(e.target)) {
5510
- if (O.current?.contains(e.target)) return;
5511
- I(!1);
5539
+ if (A.current && !A.current.contains(e.target)) {
5540
+ if (k.current?.contains(e.target)) return;
5541
+ L(!1);
5512
5542
  }
5513
5543
  };
5514
5544
  return document.addEventListener("mousedown", e), () => {
5515
5545
  document.removeEventListener("mousedown", e);
5516
5546
  };
5517
- }, [k]);
5547
+ }, [A]);
5518
5548
  let V = J("select", "dropdown-select", "isDropdown", i && "hasValue", !r && "noLabel", m && "required"), H = nr[S] ?? "initial", U = x.map((e) => /* @__PURE__ */ P("option", {
5519
5549
  value: e.value,
5520
5550
  children: e.label
@@ -5528,14 +5558,14 @@ var ro = () => {}, io = {
5528
5558
  value: ""
5529
5559
  }, "_initial-value"));
5530
5560
  let W = (e) => {
5531
- a(e), !e.isDefaultPrevented() && (N || u(), I(!0), e.preventDefault(), x.length && j(!A));
5561
+ a(e), !e.isDefaultPrevented() && (I || u(), L(!0), e.preventDefault(), x.length && M(!j));
5532
5562
  }, G = (e) => {
5533
- if (k.current) {
5534
- k.current.value = e.currentTarget.getAttribute("value") || "";
5563
+ if (A.current) {
5564
+ A.current.value = e.currentTarget.getAttribute("value") || "";
5535
5565
  let t = new Event("change", { bubbles: !0 });
5536
- k.current.dispatchEvent(t);
5566
+ A.current.dispatchEvent(t);
5537
5567
  }
5538
- j(!1);
5568
+ M(!1);
5539
5569
  };
5540
5570
  return /* @__PURE__ */ F("div", {
5541
5571
  "data-clad": "Input Field - Dropdown",
@@ -5543,9 +5573,9 @@ var ro = () => {}, io = {
5543
5573
  style: { width: H },
5544
5574
  children: [
5545
5575
  /* @__PURE__ */ F("div", {
5546
- style: { paddingLeft: M },
5547
- className: J("wrapper", ho({ status: g }), d && "disabled", N && "focus"),
5548
- ref: D,
5576
+ style: { paddingLeft: N },
5577
+ className: J("wrapper", ho({ status: g }), d && "disabled", I && "focus"),
5578
+ ref: O,
5549
5579
  onMouseDown: W,
5550
5580
  children: [
5551
5581
  w ? /* @__PURE__ */ P("div", {
@@ -5553,11 +5583,13 @@ var ro = () => {}, io = {
5553
5583
  children: w
5554
5584
  }) : null,
5555
5585
  /* @__PURE__ */ P("select", {
5586
+ ...E,
5556
5587
  className: V,
5557
- ref: k,
5588
+ ref: A,
5558
5589
  id: t || void 0,
5559
5590
  name: n || void 0,
5560
5591
  disabled: d,
5592
+ required: m,
5561
5593
  value: i,
5562
5594
  onChange: o,
5563
5595
  onBlur: s,
@@ -5565,7 +5597,7 @@ var ro = () => {}, io = {
5565
5597
  children: U
5566
5598
  }),
5567
5599
  !!r && /* @__PURE__ */ P("label", {
5568
- style: { marginLeft: M },
5600
+ style: { marginLeft: N },
5569
5601
  className: "label",
5570
5602
  htmlFor: t,
5571
5603
  children: r
@@ -5592,11 +5624,11 @@ var ro = () => {}, io = {
5592
5624
  className: J("helptext", "dropdown-helptext", y),
5593
5625
  children: v
5594
5626
  }) : null,
5595
- A ? L(/* @__PURE__ */ P("ul", {
5627
+ j ? R(/* @__PURE__ */ P("ul", {
5596
5628
  role: "listbox",
5597
5629
  ...z,
5598
5630
  className: "dropdown-menu",
5599
- ref: ma(z.ref, O),
5631
+ ref: ma(z.ref, k),
5600
5632
  style: {
5601
5633
  ...z.style,
5602
5634
  width: (B?.width || 0) + 2,
@@ -5737,49 +5769,54 @@ var So = (e) => {
5737
5769
  }, Co = (e, t) => In(e, t).map((e) => So(e)), wo = (e) => {
5738
5770
  let t = Ln[e];
5739
5771
  return t ? +t.slice(0, t.length - 2) : 0;
5740
- }, To = (e, t) => In(e, t).map((e) => wo(e)), Eo = (e) => Rn[e] ?? "initial", Do = (e, t) => In(e, t).map((e) => Eo(e)), Oo = ({ width: e = null, align: t = "initial", justify: n = "initial", rowCols: r = null, gutter: i = null, gutterx: a = null, guttery: o = null, className: s = "", children: c }) => {
5741
- let l = J("clad-grid", s, !!r && "withRowCols"), u = t === "start" && "flex-start" || t === "end" && "flex-end" || t, d = n === "start" && "flex-start" || n === "end" && "flex-end" || n === "between" && "space-between" || n === "around" && "space-around" || n, f = Co(r, "initial"), p = {
5742
- "--grid-align": u,
5743
- "--grid-justify": d,
5744
- "--grid-col-w-0": f[0],
5745
- "--grid-col-w-1": f[1],
5746
- "--grid-col-w-2": f[2],
5747
- "--grid-col-w-3": f[3],
5748
- "--grid-col-w-4": f[4]
5749
- }, m = J("clad-grid-container", s, !!e && "withWidth", !!(i || a || o) && "withGutter"), h = Do(e, "initial"), g = a ?? i ?? "none", _ = o ?? i ?? "none", v = To(g, 0), y = To(_, 0);
5772
+ }, To = (e, t) => In(e, t).map((e) => wo(e)), Eo = (e) => Rn[e] ?? "initial", Do = (e, t) => In(e, t).map((e) => Eo(e)), Oo = ({ width: e = null, align: t = "initial", justify: n = "initial", rowCols: r = null, gutter: i = null, gutterx: a = null, guttery: o = null, className: s = "", style: c, children: l, ...u }) => {
5773
+ let d = J("clad-grid", s, !!r && "withRowCols"), f = t === "start" && "flex-start" || t === "end" && "flex-end" || t, p = n === "start" && "flex-start" || n === "end" && "flex-end" || n === "between" && "space-between" || n === "around" && "space-around" || n, m = Co(r, "initial"), h = {
5774
+ "--grid-align": f,
5775
+ "--grid-justify": p,
5776
+ "--grid-col-w-0": m[0],
5777
+ "--grid-col-w-1": m[1],
5778
+ "--grid-col-w-2": m[2],
5779
+ "--grid-col-w-3": m[3],
5780
+ "--grid-col-w-4": m[4]
5781
+ }, g = J("clad-grid-container", s, !!e && "withWidth", !!(i || a || o) && "withGutter"), _ = Do(e, "initial"), v = a ?? i ?? "none", y = o ?? i ?? "none", b = To(v, 0), x = To(y, 0), S = {
5782
+ "--grid-w-0": _[0],
5783
+ "--grid-w-1": _[1],
5784
+ "--grid-w-2": _[2],
5785
+ "--grid-w-3": _[3],
5786
+ "--grid-w-4": _[4],
5787
+ "--grid-gx-half-0": `${b[0] / 2}px`,
5788
+ "--grid-gx-half-1": `${b[1] / 2}px`,
5789
+ "--grid-gx-half-2": `${b[2] / 2}px`,
5790
+ "--grid-gx-half-3": `${b[3] / 2}px`,
5791
+ "--grid-gx-half-4": `${b[4] / 2}px`,
5792
+ "--grid-gx-neg-0": `${b[0] * -1}px`,
5793
+ "--grid-gx-neg-1": `${b[1] * -1}px`,
5794
+ "--grid-gx-neg-2": `${b[2] * -1}px`,
5795
+ "--grid-gx-neg-3": `${b[3] * -1}px`,
5796
+ "--grid-gx-neg-4": `${b[4] * -1}px`,
5797
+ "--grid-gy-0": `${x[0]}px`,
5798
+ "--grid-gy-1": `${x[1]}px`,
5799
+ "--grid-gy-2": `${x[2]}px`,
5800
+ "--grid-gy-3": `${x[3]}px`,
5801
+ "--grid-gy-4": `${x[4]}px`,
5802
+ "--grid-gy-neg-0": `${x[0] * -1}px`,
5803
+ "--grid-gy-neg-1": `${x[1] * -1}px`,
5804
+ "--grid-gy-neg-2": `${x[2] * -1}px`,
5805
+ "--grid-gy-neg-3": `${x[3] * -1}px`,
5806
+ "--grid-gy-neg-4": `${x[4] * -1}px`
5807
+ };
5750
5808
  return /* @__PURE__ */ P("div", {
5751
- className: m,
5809
+ ...u,
5810
+ className: g,
5752
5811
  style: {
5753
- "--grid-w-0": h[0],
5754
- "--grid-w-1": h[1],
5755
- "--grid-w-2": h[2],
5756
- "--grid-w-3": h[3],
5757
- "--grid-w-4": h[4],
5758
- "--grid-gx-half-0": `${v[0] / 2}px`,
5759
- "--grid-gx-half-1": `${v[1] / 2}px`,
5760
- "--grid-gx-half-2": `${v[2] / 2}px`,
5761
- "--grid-gx-half-3": `${v[3] / 2}px`,
5762
- "--grid-gx-half-4": `${v[4] / 2}px`,
5763
- "--grid-gx-neg-0": `${v[0] * -1}px`,
5764
- "--grid-gx-neg-1": `${v[1] * -1}px`,
5765
- "--grid-gx-neg-2": `${v[2] * -1}px`,
5766
- "--grid-gx-neg-3": `${v[3] * -1}px`,
5767
- "--grid-gx-neg-4": `${v[4] * -1}px`,
5768
- "--grid-gy-0": `${y[0]}px`,
5769
- "--grid-gy-1": `${y[1]}px`,
5770
- "--grid-gy-2": `${y[2]}px`,
5771
- "--grid-gy-3": `${y[3]}px`,
5772
- "--grid-gy-4": `${y[4]}px`,
5773
- "--grid-gy-neg-0": `${y[0] * -1}px`,
5774
- "--grid-gy-neg-1": `${y[1] * -1}px`,
5775
- "--grid-gy-neg-2": `${y[2] * -1}px`,
5776
- "--grid-gy-neg-3": `${y[3] * -1}px`,
5777
- "--grid-gy-neg-4": `${y[4] * -1}px`
5812
+ ...S,
5813
+ ...c
5778
5814
  },
5815
+ "data-clad": "Grid",
5779
5816
  children: /* @__PURE__ */ P("div", {
5780
- className: l,
5781
- style: p,
5782
- children: c
5817
+ className: d,
5818
+ style: h,
5819
+ children: l
5783
5820
  })
5784
5821
  });
5785
5822
  };
@@ -5789,25 +5826,30 @@ Oo.displayName = "Grid";
5789
5826
  var ko = (e) => {
5790
5827
  let t = parseInt(e, 10);
5791
5828
  return isNaN(t) ? "initial" : (t < 0 && (t = 0), t > 12 && (t = 12), t === 0 ? "0%" : 1 / (12 / t) * 100 + "%");
5792
- }, Ao = (e, t) => In(e, t).map((e) => ko(e)), jo = ({ span: e = null, offset: t = null, align: n = "initial", order: r = "initial", className: i = "", children: a }) => {
5793
- let o = J("clad-col", i, !!e && "withSpan", !!t && "withOffset"), s = n === "start" && "flex-start" || n === "end" && "flex-end" || n, c = r === "first" && -1 || r === "last" && 13 || (typeof r == "number" ? r : 0), l = Ao(e, "initial"), u = Ao(t, "initial");
5829
+ }, Ao = (e, t) => In(e, t).map((e) => ko(e)), jo = ({ span: e = null, offset: t = null, align: n = "initial", order: r = "initial", className: i = "", style: a, children: o, ...s }) => {
5830
+ let c = J("clad-col", i, !!e && "withSpan", !!t && "withOffset"), l = n === "start" && "flex-start" || n === "end" && "flex-end" || n, u = r === "first" && -1 || r === "last" && 13 || (typeof r == "number" ? r : 0), d = Ao(e, "initial"), f = Ao(t, "initial"), p = {
5831
+ "--col-align": l,
5832
+ "--col-order": u,
5833
+ "--col-span-0": d[0],
5834
+ "--col-span-1": d[1],
5835
+ "--col-span-2": d[2],
5836
+ "--col-span-3": d[3],
5837
+ "--col-span-4": d[4],
5838
+ "--col-offset-0": f[0],
5839
+ "--col-offset-1": f[1],
5840
+ "--col-offset-2": f[2],
5841
+ "--col-offset-3": f[3],
5842
+ "--col-offset-4": f[4]
5843
+ };
5794
5844
  return /* @__PURE__ */ P("div", {
5795
- className: o,
5845
+ ...s,
5846
+ className: c,
5796
5847
  style: {
5797
- "--col-align": s,
5798
- "--col-order": c,
5799
- "--col-span-0": l[0],
5800
- "--col-span-1": l[1],
5801
- "--col-span-2": l[2],
5802
- "--col-span-3": l[3],
5803
- "--col-span-4": l[4],
5804
- "--col-offset-0": u[0],
5805
- "--col-offset-1": u[1],
5806
- "--col-offset-2": u[2],
5807
- "--col-offset-3": u[3],
5808
- "--col-offset-4": u[4]
5848
+ ...p,
5849
+ ...a
5809
5850
  },
5810
- children: a
5851
+ "data-clad": "Col",
5852
+ children: o
5811
5853
  });
5812
5854
  };
5813
5855
  jo.displayName = "Col";
@@ -5820,7 +5862,8 @@ var Mo = Y({
5820
5862
  error: "error"
5821
5863
  } },
5822
5864
  defaultVariants: { status: "default" }
5823
- }), No = ({ children: e, status: t = "default", helptext: n = "", helptextClassName: r = "", className: i = "" }) => /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P("div", {
5865
+ }), No = ({ children: e, status: t = "default", helptext: n = "", helptextClassName: r = "", className: i = "", ...a }) => /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P("div", {
5866
+ ...a,
5824
5867
  className: J(Mo({ status: t }), i),
5825
5868
  "data-clad": "Input Field - Input Group",
5826
5869
  children: e
@@ -5877,19 +5920,20 @@ var Po = () => /* @__PURE__ */ F("svg", {
5877
5920
  })
5878
5921
  ]
5879
5922
  })]
5880
- }), Fo = () => {}, Io = ({ className: t = "", title: n = "", children: r, btnLabel: i = "", mainIcon: a = /* @__PURE__ */ P(Po, {}), desktopSize: o = "lg", open: s = !1, onClose: c = Fo, closeIcon: l = /* @__PURE__ */ P(C, {}), onButtonClick: u = Fo }) => {
5881
- let d = e.useRef(null);
5923
+ }), Fo = () => {}, Io = ({ className: t = "", title: n = "", children: r, btnLabel: i = "", mainIcon: a = /* @__PURE__ */ P(Po, {}), desktopSize: o = "lg", open: s = !1, onClose: c = Fo, closeIcon: l = /* @__PURE__ */ P(C, {}), onButtonClick: u = Fo, ...d }) => {
5924
+ let f = e.useRef(null);
5882
5925
  e.useEffect(() => {
5883
5926
  s ? document.body.style.overflow = "hidden" : document.body.style.overflow = "unset";
5884
5927
  }, [s]);
5885
- let f = J("legacy-dialog-close", (typeof l == "string" || typeof l == "number") && "is-text"), p = J("legacy-dialog-children", (typeof r == "string" || typeof r == "number") && "is-single-string", typeof i == "string" && !i.trim() && "no-button");
5928
+ let p = J("legacy-dialog-close", (typeof l == "string" || typeof l == "number") && "is-text"), m = J("legacy-dialog-children", (typeof r == "string" || typeof r == "number") && "is-single-string", typeof i == "string" && !i.trim() && "no-button");
5886
5929
  return /* @__PURE__ */ P(N, { children: !!s && Qa(/* @__PURE__ */ F("div", {
5887
- ref: d,
5930
+ ref: f,
5888
5931
  className: "legacy-dialog-modal",
5889
5932
  children: [/* @__PURE__ */ P("div", {
5890
5933
  className: "legacy-popup-backdrop",
5891
5934
  onClick: c
5892
5935
  }), /* @__PURE__ */ F("div", {
5936
+ ...d,
5893
5937
  className: J("legacy-dialog", t, o),
5894
5938
  "data-clad": "Legacy Dialog",
5895
5939
  children: [
@@ -5899,13 +5943,13 @@ var Po = () => /* @__PURE__ */ F("svg", {
5899
5943
  }),
5900
5944
  /* @__PURE__ */ P("button", {
5901
5945
  type: "button",
5902
- className: f,
5946
+ className: p,
5903
5947
  onClick: c,
5904
5948
  children: l
5905
5949
  }),
5906
5950
  /* @__PURE__ */ P("h5", { children: n }),
5907
5951
  /* @__PURE__ */ P("div", {
5908
- className: p,
5952
+ className: m,
5909
5953
  children: r
5910
5954
  }),
5911
5955
  /* @__PURE__ */ P(or, {
@@ -5921,59 +5965,60 @@ var Po = () => /* @__PURE__ */ F("svg", {
5921
5965
  Io.displayName = "LegacyDialog";
5922
5966
  //#endregion
5923
5967
  //#region src/components/LegacyPopup/LegacyPopup.tsx
5924
- var Lo = () => {}, Ro = (e, t) => In(e, t).map((e) => Ln[e] || Ln.none), zo = ({ title: t = "", children: n, btnLabel: r = "", desktopSize: i = "lg", mobileSize: a = "half", open: o = !1, onClose: s = Lo, closeIcon: c = /* @__PURE__ */ P(C, {}), rightIcon: l = null, onRightIconClick: u = Lo, onButtonClick: d = Lo, padding: f = [
5968
+ var Lo = () => {}, Ro = (e, t) => In(e, t).map((e) => Ln[e] || Ln.none), zo = ({ className: t = "", title: n = "", children: r, btnLabel: i = "", desktopSize: a = "lg", mobileSize: o = "half", open: s = !1, onClose: c = Lo, closeIcon: l = /* @__PURE__ */ P(C, {}), rightIcon: u = null, onRightIconClick: d = Lo, onButtonClick: f = Lo, padding: p = [
5925
5969
  "sm",
5926
5970
  "sm",
5927
5971
  "lg"
5928
- ], childrenOverflowVisible: p = !1 }) => {
5929
- let m = e.useRef(null);
5972
+ ], childrenOverflowVisible: m = !1, ...h }) => {
5973
+ let g = e.useRef(null);
5930
5974
  e.useEffect(() => {
5931
- o ? document.body.style.overflow = "hidden" : document.body.style.overflow = "unset";
5932
- }, [o]);
5933
- let h = J((typeof c == "string" || typeof c == "number") && "is-text"), g = J(l == null && "hidden", (typeof l == "string" || typeof l == "number") && "is-text"), _ = J("legacy-popup-children", a, (typeof n == "string" || typeof n == "number") && "is-single-string", typeof r == "string" && !r.trim() && "no-button", p && "children-overflow-visible"), v = Ro(f, "none"), y = {
5934
- "--legacy-popup-p-0": v[0],
5935
- "--legacy-popup-p-1": v[1],
5936
- "--legacy-popup-p-2": v[2],
5937
- "--legacy-popup-p-3": v[3],
5938
- "--legacy-popup-p-4": v[4]
5975
+ s ? document.body.style.overflow = "hidden" : document.body.style.overflow = "unset";
5976
+ }, [s]);
5977
+ let _ = J((typeof l == "string" || typeof l == "number") && "is-text"), v = J(u == null && "hidden", (typeof u == "string" || typeof u == "number") && "is-text"), y = J("legacy-popup-children", o, (typeof r == "string" || typeof r == "number") && "is-single-string", typeof i == "string" && !i.trim() && "no-button", m && "children-overflow-visible"), b = Ro(p, "none"), x = {
5978
+ "--legacy-popup-p-0": b[0],
5979
+ "--legacy-popup-p-1": b[1],
5980
+ "--legacy-popup-p-2": b[2],
5981
+ "--legacy-popup-p-3": b[3],
5982
+ "--legacy-popup-p-4": b[4]
5939
5983
  };
5940
- return /* @__PURE__ */ P(N, { children: !!o && Qa(/* @__PURE__ */ F("div", {
5941
- ref: m,
5984
+ return /* @__PURE__ */ P(N, { children: !!s && Qa(/* @__PURE__ */ F("div", {
5985
+ ref: g,
5942
5986
  className: "legacy-popup-modal",
5943
5987
  children: [/* @__PURE__ */ P("div", {
5944
5988
  className: "legacy-popup-backdrop",
5945
- onClick: s
5989
+ onClick: c
5946
5990
  }), /* @__PURE__ */ F("div", {
5947
- className: J("legacy-popup", i),
5991
+ ...h,
5992
+ className: J("legacy-popup", a, t),
5948
5993
  children: [/* @__PURE__ */ F("div", {
5949
5994
  className: "legacy-popup-header",
5950
5995
  "data-clad": "LegacyPopup",
5951
5996
  children: [
5952
5997
  /* @__PURE__ */ P("button", {
5953
5998
  type: "button",
5954
- className: h,
5955
- onClick: s,
5956
- children: c
5999
+ className: _,
6000
+ onClick: c,
6001
+ children: l
5957
6002
  }),
5958
- /* @__PURE__ */ P("h5", { children: t }),
6003
+ /* @__PURE__ */ P("h5", { children: n }),
5959
6004
  /* @__PURE__ */ P("button", {
5960
6005
  type: "button",
5961
- className: g,
5962
- onClick: u,
5963
- children: l
6006
+ className: v,
6007
+ onClick: d,
6008
+ children: u
5964
6009
  })
5965
6010
  ]
5966
6011
  }), /* @__PURE__ */ F("div", {
5967
6012
  className: "legacy-popup-content",
5968
- style: y,
6013
+ style: x,
5969
6014
  children: [/* @__PURE__ */ P("div", {
5970
- className: _,
5971
- children: n
6015
+ className: y,
6016
+ children: r
5972
6017
  }), /* @__PURE__ */ P(or, {
5973
6018
  color: "primary",
5974
6019
  className: "legacy-popup-btn",
5975
- onClick: d,
5976
- children: r
6020
+ onClick: f,
6021
+ children: i
5977
6022
  })]
5978
6023
  })]
5979
6024
  })]
@@ -6052,6 +6097,7 @@ var Bo = Y({
6052
6097
  bg: a,
6053
6098
  color: o
6054
6099
  }), s),
6100
+ "data-clad": "ShapeIcon",
6055
6101
  ...u
6056
6102
  }, c);
6057
6103
  });
@@ -6071,8 +6117,8 @@ function qo(e) {
6071
6117
  return n >= 37 && n <= 40 && t.indexOf("Arrow") !== 0 ? `Arrow${t}` : t;
6072
6118
  }
6073
6119
  var Jo = ({ id: t, label: n = "", value: r = [], options: i = [], onInput: a = Ko, onChange: o = Ko, onSelect: s = Ko, onBlur: c = Ko, onRemoveOption: l = Ko, inputRef: u, onClearData: d = Ko, menuMaxHeight: f = "$sm", emptyString: p = "Không có lựa chọn khả dụng", width: m = "full", disabled: h = !1, required: g = !1, helptext: v = "", helptextClassName: y = "", status: b = "default", className: x = "", ...S }) => {
6074
- let w = Wo(null), [T, E] = Uo(!1), [D, O] = Uo(r), [k, A] = Uo(!1), [j, M] = Uo(-1), [N, I] = Uo(i), [L, R] = Uo(i), [z, B] = Uo(""), V = T, H = Wo(null), U = typeof u == "object" && u ? u : H;
6075
- e.useImperativeHandle(u, () => U?.current), Go(() => {
6120
+ let w = Wo(null), [T, E] = Uo(!1), [D, O] = Uo(r), [k, A] = Uo(!1), [j, M] = Uo(-1), [N, I] = Uo(i), [L, R] = Uo(i), [ee, z] = Uo(""), B = T, V = Wo(null), H = typeof u == "object" && u ? u : V;
6121
+ e.useImperativeHandle(u, () => H?.current), Go(() => {
6076
6122
  if (Array.isArray(N)) {
6077
6123
  let e = [...N];
6078
6124
  r.length > 0 && r.forEach((t) => {
@@ -6082,35 +6128,35 @@ var Jo = ({ id: t, label: n = "", value: r = [], options: i = [], onInput: a = K
6082
6128
  }, [r.length]), Go(() => {
6083
6129
  I(i), R(i);
6084
6130
  }, [i]);
6085
- let { renderLayer: W, triggerProps: { ref: G }, layerProps: ee, triggerBounds: K } = ba({
6086
- isOpen: V,
6131
+ let { renderLayer: U, triggerProps: { ref: W }, layerProps: G, triggerBounds: te } = ba({
6132
+ isOpen: B,
6087
6133
  auto: !0,
6088
6134
  snap: !0,
6089
6135
  placement: "bottom-start",
6090
6136
  possiblePlacements: ["top-start", "bottom-start"],
6091
6137
  triggerOffset: 1,
6092
6138
  onOutsideClick: () => {
6093
- E(!1), B(""), A(!1), R(N);
6139
+ E(!1), z(""), A(!1), R(N);
6094
6140
  }
6095
6141
  });
6096
- G(w.current);
6097
- let q = (e) => (T || (E(!0), A(!0), M(-1), U?.current?.focus()), e), te = (e) => (B(""), A(!1), R(N), e.stopPropagation(), c(e)), ne = (e, t) => {
6142
+ W(w.current);
6143
+ let K = (e) => (T || (E(!0), A(!0), M(-1), H?.current?.focus()), e), q = (e) => (z(""), A(!1), R(N), e.stopPropagation(), c(e)), ne = (e, t) => {
6098
6144
  let n = L[e];
6099
- return M(-1), n ? (B(""), s?.(n, t), U?.current?.focus(), o?.(n, t)) : t;
6145
+ return M(-1), n ? (z(""), s?.(n, t), H?.current?.focus(), o?.(n, t)) : t;
6100
6146
  }, re = (e) => {
6101
6147
  e.preventDefault();
6102
6148
  }, ie = (e, t) => {
6103
6149
  if (e) {
6104
6150
  t.stopPropagation();
6105
6151
  let n = [...N], r = i.filter((t) => t?.text === e?.text);
6106
- return n.push(r[0]), R(n), I(n), l(e, t), U?.current?.focus(), o?.(e, t);
6152
+ return n.push(r[0]), R(n), I(n), l(e, t), H?.current?.focus(), o?.(e, t);
6107
6153
  }
6108
6154
  return t;
6109
6155
  }, ae = (e) => {
6110
6156
  let t = qo(e), n = j;
6111
6157
  switch (t) {
6112
6158
  case "Enter": return j > -1 ? ne(j, e) : e;
6113
- case "Backspace": return z.length <= 0 ? ie(D[D.length - 1], e) : e;
6159
+ case "Backspace": return ee.length <= 0 ? ie(D[D.length - 1], e) : e;
6114
6160
  case "ArrowUp":
6115
6161
  --n, n < 0 && (n = N.length - 1), e.preventDefault();
6116
6162
  break;
@@ -6120,10 +6166,10 @@ var Jo = ({ id: t, label: n = "", value: r = [], options: i = [], onInput: a = K
6120
6166
  default:
6121
6167
  if (/^[a-z0-9]$/i.test(e.key)) {
6122
6168
  let t = e.key, n = setTimeout(() => {
6123
- B("");
6169
+ z("");
6124
6170
  }, 1e3);
6125
6171
  clearTimeout(n);
6126
- let r = z + t, a = RegExp(`^${r}`, "i"), o = i.findIndex((e) => a.test(e?.text));
6172
+ let r = ee + t, a = RegExp(`^${r}`, "i"), o = i.findIndex((e) => a.test(e?.text));
6127
6173
  return o === -1 ? { typed: r } : {
6128
6174
  tempFocusedValue: o,
6129
6175
  typed: r
@@ -6136,7 +6182,7 @@ var Jo = ({ id: t, label: n = "", value: r = [], options: i = [], onInput: a = K
6136
6182
  let t = e.currentTarget;
6137
6183
  return ne(Number(t.getAttribute("data-index")), e);
6138
6184
  }, se = (e) => {
6139
- B(e.target.value), a?.(e);
6185
+ z(e.target.value), a?.(e);
6140
6186
  let t = e.target.value, n = (e) => e.normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/đ/g, "d").replace(/Đ/g, "D");
6141
6187
  R(t ? N.filter((e) => {
6142
6188
  if (e?.text) {
@@ -6146,7 +6192,7 @@ var Jo = ({ id: t, label: n = "", value: r = [], options: i = [], onInput: a = K
6146
6192
  return !1;
6147
6193
  }) : N);
6148
6194
  }, ce = (e) => {
6149
- B(""), M(-1), I(i), R(i), d(e), e.stopPropagation();
6195
+ z(""), M(-1), I(i), R(i), d(e), e.stopPropagation();
6150
6196
  }, le = (e) => {
6151
6197
  e.preventDefault();
6152
6198
  let t = e.target.closest("[data-index]")?.getAttribute("data-index");
@@ -6167,9 +6213,9 @@ var Jo = ({ id: t, label: n = "", value: r = [], options: i = [], onInput: a = K
6167
6213
  children: [D.length > 0 && e, /* @__PURE__ */ P("input", {
6168
6214
  className: "msd-search-input",
6169
6215
  autoComplete: "off",
6170
- value: z,
6216
+ value: ee,
6171
6217
  onChange: se,
6172
- ref: U
6218
+ ref: H
6173
6219
  })]
6174
6220
  });
6175
6221
  }, de = () => {
@@ -6184,7 +6230,7 @@ var Jo = ({ id: t, label: n = "", value: r = [], options: i = [], onInput: a = K
6184
6230
  className: J(Ho({ status: b }), k ? "focus" : "", h && "disabled", g && "required"),
6185
6231
  role: "tab",
6186
6232
  tabIndex: 0,
6187
- onClick: h ? void 0 : q,
6233
+ onClick: h ? void 0 : K,
6188
6234
  onKeyUp: h ? void 0 : re,
6189
6235
  onKeyDown: h ? void 0 : ae,
6190
6236
  ref: w,
@@ -6195,14 +6241,14 @@ var Jo = ({ id: t, label: n = "", value: r = [], options: i = [], onInput: a = K
6195
6241
  children: n
6196
6242
  }),
6197
6243
  ue(),
6198
- !!V && W(/* @__PURE__ */ P("ul", {
6244
+ !!B && U(/* @__PURE__ */ P("ul", {
6199
6245
  role: "listbox",
6200
6246
  className: "msd-menu",
6201
- ...ee,
6247
+ ...G,
6202
6248
  style: {
6203
- width: K?.width,
6249
+ width: te?.width,
6204
6250
  maxHeight: nr[f] || f,
6205
- ...ee.style
6251
+ ...G.style
6206
6252
  },
6207
6253
  children: L.length > 0 ? L.map((e, t) => /* @__PURE__ */ P("li", {
6208
6254
  role: "menuitem",
@@ -6230,7 +6276,7 @@ var Jo = ({ id: t, label: n = "", value: r = [], options: i = [], onInput: a = K
6230
6276
  tabIndex: 0,
6231
6277
  children: /* @__PURE__ */ P(C, {})
6232
6278
  }), /* @__PURE__ */ P("span", {
6233
- className: J(V ? "inverted" : "", "msd-dropdown-icon"),
6279
+ className: J(B ? "inverted" : "", "msd-dropdown-icon"),
6234
6280
  onClick: de,
6235
6281
  role: "tab",
6236
6282
  tabIndex: 0,
@@ -6246,7 +6292,7 @@ var Jo = ({ id: t, label: n = "", value: r = [], options: i = [], onInput: a = K
6246
6292
  /* @__PURE__ */ P("input", {
6247
6293
  value: r.length ? r.length : "",
6248
6294
  required: g,
6249
- onBlur: te,
6295
+ onBlur: q,
6250
6296
  readOnly: !0,
6251
6297
  hidden: !0
6252
6298
  })
@@ -6288,8 +6334,8 @@ Zo.displayName = "PageItem";
6288
6334
  var Qo = (e, t) => {
6289
6335
  let n = t - e + 1;
6290
6336
  return Array.from({ length: n }, (t, n) => n + e);
6291
- }, $o = "DOT_LEFT", es = "DOT_RIGHT", ts = ({ currentPage: t = 1, totalPages: n, siblingCount: r = 1, onChange: i, className: a, renderPageItem: o, onNextPage: s, onPreviousPage: c, showActionButtons: l = !0 }) => {
6292
- let u = e.useMemo(() => {
6337
+ }, $o = "DOT_LEFT", es = "DOT_RIGHT", ts = ({ currentPage: t = 1, totalPages: n, siblingCount: r = 1, onChange: i, className: a, renderPageItem: o, onNextPage: s, onPreviousPage: c, showActionButtons: l = !0, ...u }) => {
6338
+ let d = e.useMemo(() => {
6293
6339
  if (n <= r * 2 + 3 + 2) return Qo(1, n);
6294
6340
  let e = Math.max(t - r, 1), i = Math.min(t + r, n), a = e > 2, o = i < n - 2;
6295
6341
  return !a && o ? [
@@ -6311,31 +6357,33 @@ var Qo = (e, t) => {
6311
6357
  n,
6312
6358
  t,
6313
6359
  r
6314
- ]), d = (e) => {
6360
+ ]), f = (e) => {
6315
6361
  e !== t && i?.(e);
6316
6362
  };
6317
6363
  return /* @__PURE__ */ F("div", {
6364
+ ...u,
6318
6365
  className: J(Yo(), a),
6366
+ "data-clad": "Pagination",
6319
6367
  children: [
6320
6368
  !!l && /* @__PURE__ */ P(Zo, {
6321
6369
  className: "page-item--action",
6322
6370
  disabled: t === 1,
6323
6371
  onClick: () => {
6324
- d(t - 1), c?.();
6372
+ f(t - 1), c?.();
6325
6373
  },
6326
6374
  children: /* @__PURE__ */ P(v, {
6327
6375
  width: 20,
6328
6376
  height: 20
6329
6377
  })
6330
6378
  }),
6331
- u.map((e) => {
6379
+ d.map((e) => {
6332
6380
  if (e === $o || e === es) return /* @__PURE__ */ P(Zo, {
6333
6381
  as: "span",
6334
6382
  className: "page-item--ellipsis",
6335
6383
  children: /* @__PURE__ */ P(k, {})
6336
6384
  }, e);
6337
6385
  let n = {
6338
- onClick: () => d(Number(e)),
6386
+ onClick: () => f(Number(e)),
6339
6387
  key: e,
6340
6388
  page: Number(e),
6341
6389
  isActive: e === t,
@@ -6347,7 +6395,7 @@ var Qo = (e, t) => {
6347
6395
  className: "page-item--action",
6348
6396
  disabled: t === n,
6349
6397
  onClick: () => {
6350
- d(t + 1), s?.();
6398
+ f(t + 1), s?.();
6351
6399
  },
6352
6400
  children: /* @__PURE__ */ P(y, {
6353
6401
  width: 20,
@@ -6414,36 +6462,39 @@ var os = () => {}, ss = {
6414
6462
  }, cs = {
6415
6463
  row: "row-reverse",
6416
6464
  column: "column"
6417
- }, ls = e.createContext({}), us = ({ children: t, open: n = !1, onClose: r = os, className: i = "", needBypassScrollLock: a = !1 }) => {
6418
- let o = e.useRef(null);
6465
+ }, ls = e.createContext({}), us = ({ children: t, open: n = !1, onClose: r = os, className: i = "", needBypassScrollLock: a = !1, ...o }) => {
6466
+ let s = e.useRef(null);
6419
6467
  to(n && !a);
6420
- let s = e.useMemo(() => ({ onClose: r }), [r]);
6468
+ let c = e.useMemo(() => ({ onClose: r }), [r]);
6421
6469
  return n ? Qa(/* @__PURE__ */ P(ls.Provider, {
6422
- value: s,
6470
+ value: c,
6423
6471
  children: /* @__PURE__ */ F("div", {
6424
- ref: o,
6472
+ ref: s,
6425
6473
  className: "popup-modal",
6426
6474
  "data-clad": "Popup.Modal",
6427
6475
  children: [/* @__PURE__ */ P("div", {
6428
6476
  className: "popup-backdrop",
6429
6477
  onClick: r
6430
6478
  }), /* @__PURE__ */ P("div", {
6479
+ ...o,
6431
6480
  className: J("popup", i),
6432
6481
  "data-clad": "Popup.Container",
6433
6482
  children: t
6434
6483
  })]
6435
6484
  })
6436
6485
  })) : null;
6437
- }, ds = ({ type: t = "icon", icon: n, text: r, onClick: i, className: a = "" }) => {
6438
- let { onClose: o } = e.useContext(ls);
6486
+ }, ds = ({ type: t = "icon", icon: n, text: r, onClick: i, className: a = "", ...o }) => {
6487
+ let { onClose: s } = e.useContext(ls), c = i || s;
6439
6488
  return /* @__PURE__ */ P("button", {
6489
+ ...o,
6440
6490
  type: "button",
6441
- onClick: i || o,
6491
+ onClick: c,
6442
6492
  className: J("popup-header-item-btn", t === "textLink" && "is-text-link", a),
6443
6493
  "data-clad": "Popup.HeaderItem",
6444
6494
  children: t === "textLink" ? r : n
6445
6495
  });
6446
- }, fs = ({ title: e, leading: t, trailing: n, className: r = "" }) => /* @__PURE__ */ F("div", {
6496
+ }, fs = ({ title: e, leading: t, trailing: n, className: r = "", ...i }) => /* @__PURE__ */ F("div", {
6497
+ ...i,
6447
6498
  className: J("popup-slot-header", r),
6448
6499
  "data-clad": "Popup.Header",
6449
6500
  children: [
@@ -6460,29 +6511,32 @@ var os = () => {}, ss = {
6460
6511
  children: n
6461
6512
  })
6462
6513
  ]
6463
- }), ps = ({ children: e, className: t = "", childrenOverflowVisible: n = !1 }) => /* @__PURE__ */ P("div", {
6514
+ }), ps = ({ children: e, className: t = "", childrenOverflowVisible: n = !1, ...r }) => /* @__PURE__ */ P("div", {
6515
+ ...r,
6464
6516
  className: J("popup-slot-body", n && "children-overflow-visible", t),
6465
6517
  "data-clad": "Popup.Body",
6466
6518
  children: e
6467
- }), ms = ({ children: e, direction: t = "horizontal", className: n = "" }) => /* @__PURE__ */ P("div", {
6519
+ }), ms = ({ children: e, direction: t = "horizontal", className: n = "", ...r }) => /* @__PURE__ */ P("div", {
6520
+ ...r,
6468
6521
  className: J("popup-slot-button-group", t === "vertical" && "is-vertical", n),
6469
6522
  "data-clad": "Popup.Button",
6470
6523
  children: e
6471
- }), hs = Object.assign(({ className: t = "", title: n = "", img: r, imgSize: i = "lg", children: a, primaryBtnLabel: o = "Xác nhận", secondaryBtnLabel: s, primaryColor: c = "primary", secondaryColor: l = "tertiary", haveClose: u = !0, btnGroupDirection: d = "row", btnRowPosition: f = "justify", open: p = !1, onClose: m, onPrimaryButtonClick: h = os, onSecondaryButtonClick: g = null, childrenOverflowVisible: _ = !1, needBypassScrollLock: v = !1 }) => {
6472
- let y = e.useRef(null);
6524
+ }), hs = Object.assign(({ className: t = "", title: n = "", img: r, imgSize: i = "lg", children: a, primaryBtnLabel: o = "Xác nhận", secondaryBtnLabel: s, primaryColor: c = "primary", secondaryColor: l = "tertiary", haveClose: u = !0, btnGroupDirection: d = "row", btnRowPosition: f = "justify", open: p = !1, onClose: m, onPrimaryButtonClick: h = os, onSecondaryButtonClick: g = null, childrenOverflowVisible: _ = !1, needBypassScrollLock: v = !1, ...y }) => {
6525
+ let b = e.useRef(null);
6473
6526
  if (to(p && !v), !p) return null;
6474
- let b = J("popup-children-wrapper", (typeof a == "string" || typeof a == "number") && "is-single-string", typeof o == "string" && !o.trim() && "no-button", _ && "children-overflow-visible"), x = {
6527
+ let x = J("popup-children-wrapper", (typeof a == "string" || typeof a == "number") && "is-single-string", typeof o == "string" && !o.trim() && "no-button", _ && "children-overflow-visible"), S = {
6475
6528
  justifyContent: ss[f] || ss.justify,
6476
6529
  flexDirection: cs[d] || cs.row
6477
6530
  };
6478
6531
  return Qa(/* @__PURE__ */ F("div", {
6479
- ref: y,
6532
+ ref: b,
6480
6533
  className: "popup-modal",
6481
6534
  "data-clad": "Popup.Modal",
6482
6535
  children: [/* @__PURE__ */ P("div", {
6483
6536
  className: "popup-backdrop",
6484
6537
  onClick: m
6485
6538
  }), /* @__PURE__ */ F("div", {
6539
+ ...y,
6486
6540
  className: J("popup", t),
6487
6541
  "data-clad": "Popup",
6488
6542
  children: [/* @__PURE__ */ P("div", {
@@ -6506,12 +6560,12 @@ var os = () => {}, ss = {
6506
6560
  children: n
6507
6561
  }),
6508
6562
  /* @__PURE__ */ P("div", {
6509
- className: b,
6563
+ className: x,
6510
6564
  children: a
6511
6565
  }),
6512
6566
  !!o && /* @__PURE__ */ F("div", {
6513
6567
  className: "popup-button-group",
6514
- style: x,
6568
+ style: S,
6515
6569
  children: [/* @__PURE__ */ P(or, {
6516
6570
  color: c,
6517
6571
  size: "large",
@@ -6600,9 +6654,10 @@ var os = () => {}, ss = {
6600
6654
  ys.displayName = "RadioButton";
6601
6655
  //#endregion
6602
6656
  //#region src/components/RangeInput/range-input.styles.ts
6603
- var bs = Y({ base: "range-input-container" }), xs = ({ children: t, helptext: n = "", helptextClassName: r = "", className: i = "", status: a = "default", separatorComponent: o }) => {
6604
- let s = a === "error";
6657
+ var bs = Y({ base: "range-input-container" }), xs = ({ children: t, helptext: n = "", helptextClassName: r = "", className: i = "", status: a = "default", separatorComponent: o, ...s }) => {
6658
+ let c = a === "error";
6605
6659
  return /* @__PURE__ */ F("div", {
6660
+ ...s,
6606
6661
  className: J(bs(), i),
6607
6662
  "data-clad": "Range Input",
6608
6663
  children: [/* @__PURE__ */ P("div", {
@@ -6618,7 +6673,7 @@ var bs = Y({ base: "range-input-container" }), xs = ({ children: t, helptext: n
6618
6673
  }, n);
6619
6674
  })
6620
6675
  }), n ? /* @__PURE__ */ P("p", {
6621
- className: J("range-input-helptext", r, s && "error"),
6676
+ className: J("range-input-helptext", r, c && "error"),
6622
6677
  children: n
6623
6678
  }) : null]
6624
6679
  });
@@ -6767,6 +6822,7 @@ var Ts = Y({ base: "searchbar-container" }), Es = yt((e, t) => {
6767
6822
  }), h?.current?.focus();
6768
6823
  };
6769
6824
  return /* @__PURE__ */ F("div", {
6825
+ "data-clad": "Searchbar",
6770
6826
  className: J(Ts(), i?.container),
6771
6827
  children: [
6772
6828
  /* @__PURE__ */ P(A, {
@@ -7190,35 +7246,35 @@ var Ds = (e, t) => {
7190
7246
  "y",
7191
7247
  "space",
7192
7248
  "round"
7193
- ] }], z = () => [
7249
+ ] }], ee = () => [
7194
7250
  "auto",
7195
7251
  "cover",
7196
7252
  "contain",
7197
7253
  Wc,
7198
7254
  Nc,
7199
7255
  { size: [$, Q] }
7200
- ], B = () => [
7256
+ ], z = () => [
7201
7257
  wc,
7202
7258
  Vc,
7203
7259
  Pc
7204
- ], V = () => [
7260
+ ], B = () => [
7205
7261
  "",
7206
7262
  "none",
7207
7263
  "full",
7208
7264
  l,
7209
7265
  $,
7210
7266
  Q
7211
- ], H = () => [
7267
+ ], V = () => [
7212
7268
  "",
7213
7269
  Z,
7214
7270
  Vc,
7215
7271
  Pc
7216
- ], U = () => [
7272
+ ], H = () => [
7217
7273
  "solid",
7218
7274
  "dashed",
7219
7275
  "dotted",
7220
7276
  "double"
7221
- ], W = () => [
7277
+ ], U = () => [
7222
7278
  "normal",
7223
7279
  "multiply",
7224
7280
  "screen",
@@ -7235,28 +7291,28 @@ var Ds = (e, t) => {
7235
7291
  "saturation",
7236
7292
  "color",
7237
7293
  "luminosity"
7238
- ], G = () => [
7294
+ ], W = () => [
7239
7295
  Z,
7240
7296
  wc,
7241
7297
  Uc,
7242
7298
  Rc
7243
- ], ee = () => [
7299
+ ], G = () => [
7244
7300
  "",
7245
7301
  "none",
7246
7302
  m,
7247
7303
  $,
7248
7304
  Q
7249
- ], K = () => [
7305
+ ], te = () => [
7250
7306
  "none",
7251
7307
  Z,
7252
7308
  $,
7253
7309
  Q
7254
- ], q = () => [
7310
+ ], K = () => [
7255
7311
  "none",
7256
7312
  Z,
7257
7313
  $,
7258
7314
  Q
7259
- ], te = () => [
7315
+ ], q = () => [
7260
7316
  Z,
7261
7317
  $,
7262
7318
  Q
@@ -7676,7 +7732,7 @@ var Ds = (e, t) => {
7676
7732
  "line-through",
7677
7733
  "no-underline"
7678
7734
  ],
7679
- "text-decoration-style": [{ decoration: [...U(), "wavy"] }],
7735
+ "text-decoration-style": [{ decoration: [...H(), "wavy"] }],
7680
7736
  "text-decoration-thickness": [{ decoration: [
7681
7737
  Z,
7682
7738
  "from-font",
@@ -7773,7 +7829,7 @@ var Ds = (e, t) => {
7773
7829
  ] }],
7774
7830
  "bg-position": [{ bg: L() }],
7775
7831
  "bg-repeat": [{ bg: R() }],
7776
- "bg-size": [{ bg: z() }],
7832
+ "bg-size": [{ bg: ee() }],
7777
7833
  "bg-image": [{ bg: [
7778
7834
  "none",
7779
7835
  {
@@ -7807,49 +7863,49 @@ var Ds = (e, t) => {
7807
7863
  zc
7808
7864
  ] }],
7809
7865
  "bg-color": [{ bg: I() }],
7810
- "gradient-from-pos": [{ from: B() }],
7811
- "gradient-via-pos": [{ via: B() }],
7812
- "gradient-to-pos": [{ to: B() }],
7866
+ "gradient-from-pos": [{ from: z() }],
7867
+ "gradient-via-pos": [{ via: z() }],
7868
+ "gradient-to-pos": [{ to: z() }],
7813
7869
  "gradient-from": [{ from: I() }],
7814
7870
  "gradient-via": [{ via: I() }],
7815
7871
  "gradient-to": [{ to: I() }],
7816
- rounded: [{ rounded: V() }],
7817
- "rounded-s": [{ "rounded-s": V() }],
7818
- "rounded-e": [{ "rounded-e": V() }],
7819
- "rounded-t": [{ "rounded-t": V() }],
7820
- "rounded-r": [{ "rounded-r": V() }],
7821
- "rounded-b": [{ "rounded-b": V() }],
7822
- "rounded-l": [{ "rounded-l": V() }],
7823
- "rounded-ss": [{ "rounded-ss": V() }],
7824
- "rounded-se": [{ "rounded-se": V() }],
7825
- "rounded-ee": [{ "rounded-ee": V() }],
7826
- "rounded-es": [{ "rounded-es": V() }],
7827
- "rounded-tl": [{ "rounded-tl": V() }],
7828
- "rounded-tr": [{ "rounded-tr": V() }],
7829
- "rounded-br": [{ "rounded-br": V() }],
7830
- "rounded-bl": [{ "rounded-bl": V() }],
7831
- "border-w": [{ border: H() }],
7832
- "border-w-x": [{ "border-x": H() }],
7833
- "border-w-y": [{ "border-y": H() }],
7834
- "border-w-s": [{ "border-s": H() }],
7835
- "border-w-e": [{ "border-e": H() }],
7836
- "border-w-bs": [{ "border-bs": H() }],
7837
- "border-w-be": [{ "border-be": H() }],
7838
- "border-w-t": [{ "border-t": H() }],
7839
- "border-w-r": [{ "border-r": H() }],
7840
- "border-w-b": [{ "border-b": H() }],
7841
- "border-w-l": [{ "border-l": H() }],
7842
- "divide-x": [{ "divide-x": H() }],
7872
+ rounded: [{ rounded: B() }],
7873
+ "rounded-s": [{ "rounded-s": B() }],
7874
+ "rounded-e": [{ "rounded-e": B() }],
7875
+ "rounded-t": [{ "rounded-t": B() }],
7876
+ "rounded-r": [{ "rounded-r": B() }],
7877
+ "rounded-b": [{ "rounded-b": B() }],
7878
+ "rounded-l": [{ "rounded-l": B() }],
7879
+ "rounded-ss": [{ "rounded-ss": B() }],
7880
+ "rounded-se": [{ "rounded-se": B() }],
7881
+ "rounded-ee": [{ "rounded-ee": B() }],
7882
+ "rounded-es": [{ "rounded-es": B() }],
7883
+ "rounded-tl": [{ "rounded-tl": B() }],
7884
+ "rounded-tr": [{ "rounded-tr": B() }],
7885
+ "rounded-br": [{ "rounded-br": B() }],
7886
+ "rounded-bl": [{ "rounded-bl": B() }],
7887
+ "border-w": [{ border: V() }],
7888
+ "border-w-x": [{ "border-x": V() }],
7889
+ "border-w-y": [{ "border-y": V() }],
7890
+ "border-w-s": [{ "border-s": V() }],
7891
+ "border-w-e": [{ "border-e": V() }],
7892
+ "border-w-bs": [{ "border-bs": V() }],
7893
+ "border-w-be": [{ "border-be": V() }],
7894
+ "border-w-t": [{ "border-t": V() }],
7895
+ "border-w-r": [{ "border-r": V() }],
7896
+ "border-w-b": [{ "border-b": V() }],
7897
+ "border-w-l": [{ "border-l": V() }],
7898
+ "divide-x": [{ "divide-x": V() }],
7843
7899
  "divide-x-reverse": ["divide-x-reverse"],
7844
- "divide-y": [{ "divide-y": H() }],
7900
+ "divide-y": [{ "divide-y": V() }],
7845
7901
  "divide-y-reverse": ["divide-y-reverse"],
7846
7902
  "border-style": [{ border: [
7847
- ...U(),
7903
+ ...H(),
7848
7904
  "hidden",
7849
7905
  "none"
7850
7906
  ] }],
7851
7907
  "divide-style": [{ divide: [
7852
- ...U(),
7908
+ ...H(),
7853
7909
  "hidden",
7854
7910
  "none"
7855
7911
  ] }],
@@ -7866,7 +7922,7 @@ var Ds = (e, t) => {
7866
7922
  "border-color-l": [{ "border-l": I() }],
7867
7923
  "divide-color": [{ divide: I() }],
7868
7924
  "outline-style": [{ outline: [
7869
- ...U(),
7925
+ ...H(),
7870
7926
  "none",
7871
7927
  "hidden"
7872
7928
  ] }],
@@ -7897,12 +7953,12 @@ var Ds = (e, t) => {
7897
7953
  Bc
7898
7954
  ] }],
7899
7955
  "inset-shadow-color": [{ "inset-shadow": I() }],
7900
- "ring-w": [{ ring: H() }],
7956
+ "ring-w": [{ ring: V() }],
7901
7957
  "ring-w-inset": ["ring-inset"],
7902
7958
  "ring-color": [{ ring: I() }],
7903
7959
  "ring-offset-w": [{ "ring-offset": [Z, Pc] }],
7904
7960
  "ring-offset-color": [{ "ring-offset": I() }],
7905
- "inset-ring-w": [{ "inset-ring": H() }],
7961
+ "inset-ring-w": [{ "inset-ring": V() }],
7906
7962
  "inset-ring-color": [{ "inset-ring": I() }],
7907
7963
  "text-shadow": [{ "text-shadow": [
7908
7964
  "none",
@@ -7917,11 +7973,11 @@ var Ds = (e, t) => {
7917
7973
  Q
7918
7974
  ] }],
7919
7975
  "mix-blend": [{ "mix-blend": [
7920
- ...W(),
7976
+ ...U(),
7921
7977
  "plus-darker",
7922
7978
  "plus-lighter"
7923
7979
  ] }],
7924
- "bg-blend": [{ "bg-blend": W() }],
7980
+ "bg-blend": [{ "bg-blend": U() }],
7925
7981
  "mask-clip": [{ "mask-clip": [
7926
7982
  "border",
7927
7983
  "padding",
@@ -7937,37 +7993,37 @@ var Ds = (e, t) => {
7937
7993
  "exclude"
7938
7994
  ] }],
7939
7995
  "mask-image-linear-pos": [{ "mask-linear": [Z] }],
7940
- "mask-image-linear-from-pos": [{ "mask-linear-from": G() }],
7941
- "mask-image-linear-to-pos": [{ "mask-linear-to": G() }],
7996
+ "mask-image-linear-from-pos": [{ "mask-linear-from": W() }],
7997
+ "mask-image-linear-to-pos": [{ "mask-linear-to": W() }],
7942
7998
  "mask-image-linear-from-color": [{ "mask-linear-from": I() }],
7943
7999
  "mask-image-linear-to-color": [{ "mask-linear-to": I() }],
7944
- "mask-image-t-from-pos": [{ "mask-t-from": G() }],
7945
- "mask-image-t-to-pos": [{ "mask-t-to": G() }],
8000
+ "mask-image-t-from-pos": [{ "mask-t-from": W() }],
8001
+ "mask-image-t-to-pos": [{ "mask-t-to": W() }],
7946
8002
  "mask-image-t-from-color": [{ "mask-t-from": I() }],
7947
8003
  "mask-image-t-to-color": [{ "mask-t-to": I() }],
7948
- "mask-image-r-from-pos": [{ "mask-r-from": G() }],
7949
- "mask-image-r-to-pos": [{ "mask-r-to": G() }],
8004
+ "mask-image-r-from-pos": [{ "mask-r-from": W() }],
8005
+ "mask-image-r-to-pos": [{ "mask-r-to": W() }],
7950
8006
  "mask-image-r-from-color": [{ "mask-r-from": I() }],
7951
8007
  "mask-image-r-to-color": [{ "mask-r-to": I() }],
7952
- "mask-image-b-from-pos": [{ "mask-b-from": G() }],
7953
- "mask-image-b-to-pos": [{ "mask-b-to": G() }],
8008
+ "mask-image-b-from-pos": [{ "mask-b-from": W() }],
8009
+ "mask-image-b-to-pos": [{ "mask-b-to": W() }],
7954
8010
  "mask-image-b-from-color": [{ "mask-b-from": I() }],
7955
8011
  "mask-image-b-to-color": [{ "mask-b-to": I() }],
7956
- "mask-image-l-from-pos": [{ "mask-l-from": G() }],
7957
- "mask-image-l-to-pos": [{ "mask-l-to": G() }],
8012
+ "mask-image-l-from-pos": [{ "mask-l-from": W() }],
8013
+ "mask-image-l-to-pos": [{ "mask-l-to": W() }],
7958
8014
  "mask-image-l-from-color": [{ "mask-l-from": I() }],
7959
8015
  "mask-image-l-to-color": [{ "mask-l-to": I() }],
7960
- "mask-image-x-from-pos": [{ "mask-x-from": G() }],
7961
- "mask-image-x-to-pos": [{ "mask-x-to": G() }],
8016
+ "mask-image-x-from-pos": [{ "mask-x-from": W() }],
8017
+ "mask-image-x-to-pos": [{ "mask-x-to": W() }],
7962
8018
  "mask-image-x-from-color": [{ "mask-x-from": I() }],
7963
8019
  "mask-image-x-to-color": [{ "mask-x-to": I() }],
7964
- "mask-image-y-from-pos": [{ "mask-y-from": G() }],
7965
- "mask-image-y-to-pos": [{ "mask-y-to": G() }],
8020
+ "mask-image-y-from-pos": [{ "mask-y-from": W() }],
8021
+ "mask-image-y-to-pos": [{ "mask-y-to": W() }],
7966
8022
  "mask-image-y-from-color": [{ "mask-y-from": I() }],
7967
8023
  "mask-image-y-to-color": [{ "mask-y-to": I() }],
7968
8024
  "mask-image-radial": [{ "mask-radial": [$, Q] }],
7969
- "mask-image-radial-from-pos": [{ "mask-radial-from": G() }],
7970
- "mask-image-radial-to-pos": [{ "mask-radial-to": G() }],
8025
+ "mask-image-radial-from-pos": [{ "mask-radial-from": W() }],
8026
+ "mask-image-radial-to-pos": [{ "mask-radial-to": W() }],
7971
8027
  "mask-image-radial-from-color": [{ "mask-radial-from": I() }],
7972
8028
  "mask-image-radial-to-color": [{ "mask-radial-to": I() }],
7973
8029
  "mask-image-radial-shape": [{ "mask-radial": ["circle", "ellipse"] }],
@@ -7977,8 +8033,8 @@ var Ds = (e, t) => {
7977
8033
  }] }],
7978
8034
  "mask-image-radial-pos": [{ "mask-radial-at": b() }],
7979
8035
  "mask-image-conic-pos": [{ "mask-conic": [Z] }],
7980
- "mask-image-conic-from-pos": [{ "mask-conic-from": G() }],
7981
- "mask-image-conic-to-pos": [{ "mask-conic-to": G() }],
8036
+ "mask-image-conic-from-pos": [{ "mask-conic-from": W() }],
8037
+ "mask-image-conic-to-pos": [{ "mask-conic-to": W() }],
7982
8038
  "mask-image-conic-from-color": [{ "mask-conic-from": I() }],
7983
8039
  "mask-image-conic-to-color": [{ "mask-conic-to": I() }],
7984
8040
  "mask-mode": [{ mask: [
@@ -7996,7 +8052,7 @@ var Ds = (e, t) => {
7996
8052
  ] }],
7997
8053
  "mask-position": [{ mask: L() }],
7998
8054
  "mask-repeat": [{ mask: R() }],
7999
- "mask-size": [{ mask: z() }],
8055
+ "mask-size": [{ mask: ee() }],
8000
8056
  "mask-type": [{ "mask-type": ["alpha", "luminance"] }],
8001
8057
  "mask-image": [{ mask: [
8002
8058
  "none",
@@ -8009,7 +8065,7 @@ var Ds = (e, t) => {
8009
8065
  $,
8010
8066
  Q
8011
8067
  ] }],
8012
- blur: [{ blur: ee() }],
8068
+ blur: [{ blur: G() }],
8013
8069
  brightness: [{ brightness: [
8014
8070
  Z,
8015
8071
  $,
@@ -8062,7 +8118,7 @@ var Ds = (e, t) => {
8062
8118
  $,
8063
8119
  Q
8064
8120
  ] }],
8065
- "backdrop-blur": [{ "backdrop-blur": ee() }],
8121
+ "backdrop-blur": [{ "backdrop-blur": G() }],
8066
8122
  "backdrop-brightness": [{ "backdrop-brightness": [
8067
8123
  Z,
8068
8124
  $,
@@ -8155,18 +8211,18 @@ var Ds = (e, t) => {
8155
8211
  Q
8156
8212
  ] }],
8157
8213
  "perspective-origin": [{ "perspective-origin": x() }],
8158
- rotate: [{ rotate: K() }],
8159
- "rotate-x": [{ "rotate-x": K() }],
8160
- "rotate-y": [{ "rotate-y": K() }],
8161
- "rotate-z": [{ "rotate-z": K() }],
8162
- scale: [{ scale: q() }],
8163
- "scale-x": [{ "scale-x": q() }],
8164
- "scale-y": [{ "scale-y": q() }],
8165
- "scale-z": [{ "scale-z": q() }],
8214
+ rotate: [{ rotate: te() }],
8215
+ "rotate-x": [{ "rotate-x": te() }],
8216
+ "rotate-y": [{ "rotate-y": te() }],
8217
+ "rotate-z": [{ "rotate-z": te() }],
8218
+ scale: [{ scale: K() }],
8219
+ "scale-x": [{ "scale-x": K() }],
8220
+ "scale-y": [{ "scale-y": K() }],
8221
+ "scale-z": [{ "scale-z": K() }],
8166
8222
  "scale-3d": ["scale-3d"],
8167
- skew: [{ skew: te() }],
8168
- "skew-x": [{ "skew-x": te() }],
8169
- "skew-y": [{ "skew-y": te() }],
8223
+ skew: [{ skew: q() }],
8224
+ "skew-x": [{ "skew-x": q() }],
8225
+ "skew-y": [{ "skew-y": q() }],
8170
8226
  transform: [{ transform: [
8171
8227
  $,
8172
8228
  Q,
@@ -8566,17 +8622,21 @@ var yl = (e, t) => {
8566
8622
  bl.createTV;
8567
8623
  //#endregion
8568
8624
  //#region src/components/Slider/slider.styles.ts
8569
- var Sl = xl({ base: "slider-wrapper" }), Cl = ({ id: t, value: n = 0, min: r = 0, max: i = 100, disabled: a = !1, step: o = 1, unit: s = "", width: c = "buttonMaxWidth", type: l = "single", inputField: u = !1, inputWidth: d = "xxxl", onChange: f, className: p }) => {
8570
- let [m, h] = e.useState(!1), [g, _] = e.useState(!1), v = Array.isArray(n) ? n[0] ?? r : r, y = typeof n == "number" && l === "single" ? n : Array.isArray(n) ? n[1] ?? i : i, [b, x] = e.useState(`${v} ${s}`), [S, C] = e.useState(`${y} ${s}`), w = (e) => {
8571
- e.persist?.(), e.preventDefault?.(), l === "single" ? e.target.id === "single-input" && /^\d*$/.test(e.target.value) && (e.target.value === "" ? (y = r, C("")) : (y = +e.target.value > i ? i : +e.target.value < r ? r : +e.target.value, C(`${y}`))) : l === "range" && (e.target.id === "range-input-max" && /^\d*$/.test(e.target.value) ? e.target.value === "" ? (y = i, C("")) : +e.target.value > i ? (y = i, C(`${y}`)) : +e.target.value < v + o ? (y = v + o, C(`${y}`)) : (y = +e.target.value, C(`${y}`)) : e.target.id === "range-input-min" && /^\d*$/.test(e.target.value) && (e.target.value === "" ? (v = r, x("")) : +e.target.value < r ? (v = r, x(`${v}`)) : +e.target.value > y - o ? (v = y - o, x(`${v}`)) : (v = +e.target.value, x(`${v}`))));
8625
+ var Sl = xl({ base: "slider-wrapper" }), Cl = ({ id: t, value: n = 0, min: r = 0, max: i = 100, disabled: a = !1, step: o = 1, unit: s = "", width: c = "buttonMaxWidth", type: l = "single", inputField: u = !1, inputWidth: d = "xxxl", onChange: f, className: p, style: m, ...h }) => {
8626
+ let [g, _] = e.useState(!1), [v, y] = e.useState(!1), b = Array.isArray(n) ? n[0] ?? r : r, x = typeof n == "number" && l === "single" ? n : Array.isArray(n) ? n[1] ?? i : i, [S, C] = e.useState(`${b} ${s}`), [w, T] = e.useState(`${x} ${s}`), E = (e) => {
8627
+ e.persist?.(), e.preventDefault?.(), l === "single" ? e.target.id === "single-input" && /^\d*$/.test(e.target.value) && (e.target.value === "" ? (x = r, T("")) : (x = +e.target.value > i ? i : +e.target.value < r ? r : +e.target.value, T(`${x}`))) : l === "range" && (e.target.id === "range-input-max" && /^\d*$/.test(e.target.value) ? e.target.value === "" ? (x = i, T("")) : +e.target.value > i ? (x = i, T(`${x}`)) : +e.target.value < b + o ? (x = b + o, T(`${x}`)) : (x = +e.target.value, T(`${x}`)) : e.target.id === "range-input-min" && /^\d*$/.test(e.target.value) && (e.target.value === "" ? (b = r, C("")) : +e.target.value < r ? (b = r, C(`${b}`)) : +e.target.value > x - o ? (b = x - o, C(`${b}`)) : (b = +e.target.value, C(`${b}`))));
8572
8628
  let t = e.shiftKey ? 10 : 1;
8573
- return e.key === "ArrowDown" || e.key === "ArrowLeft" ? g ? (y - t * o < v + o ? (y = v + o, l === "single" && (y = r)) : y -= t * o, C(`${y} ${s}`)) : m && (v - t * o < r ? v = r : v -= t * o, x(`${v} ${s}`)) : e.key === "ArrowUp" || e.key === "ArrowRight" ? g ? (y + t * o <= i ? y += t * o : y = i, C(`${y} ${s}`)) : m && (v + t * o < y ? v += t * o : v = +y - o, x(`${v} ${s}`)) : e.target.className === "range-min" ? y - +e.target.value < o ? v = y - o : (v = +e.target.value, x(`${v} ${s}`)) : e.target.className === "range-max" && (+e.target.value - v < o ? l === "single" ? y = v : l === "range" && (y = v + o) : y = +e.target.value, C(`${y} ${s}`)), e.value = l === "single" ? y : [v, y], f?.(e);
8574
- }, T = nr[c] || c;
8629
+ return e.key === "ArrowDown" || e.key === "ArrowLeft" ? v ? (x - t * o < b + o ? (x = b + o, l === "single" && (x = r)) : x -= t * o, T(`${x} ${s}`)) : g && (b - t * o < r ? b = r : b -= t * o, C(`${b} ${s}`)) : e.key === "ArrowUp" || e.key === "ArrowRight" ? v ? (x + t * o <= i ? x += t * o : x = i, T(`${x} ${s}`)) : g && (b + t * o < x ? b += t * o : b = +x - o, C(`${b} ${s}`)) : e.target.className === "range-min" ? x - +e.target.value < o ? b = x - o : (b = +e.target.value, C(`${b} ${s}`)) : e.target.className === "range-max" && (+e.target.value - b < o ? l === "single" ? x = b : l === "range" && (x = b + o) : x = +e.target.value, T(`${x} ${s}`)), e.value = l === "single" ? x : [b, x], f?.(e);
8630
+ }, D = nr[c] || c;
8575
8631
  return /* @__PURE__ */ F("div", {
8632
+ ...h,
8576
8633
  id: t,
8577
8634
  "data-clad": "Slider",
8578
8635
  className: J(Sl(), p),
8579
- style: { width: T },
8636
+ style: {
8637
+ width: D,
8638
+ ...m
8639
+ },
8580
8640
  children: [
8581
8641
  /* @__PURE__ */ P("div", {
8582
8642
  className: J(u && l === "single" ? "input-field" : "hidden"),
@@ -8585,13 +8645,13 @@ var Sl = xl({ base: "slider-wrapper" }), Cl = ({ id: t, value: n = 0, min: r = 0
8585
8645
  width: d,
8586
8646
  type: "text",
8587
8647
  id: "single-input",
8588
- value: S,
8589
- onChange: w,
8648
+ value: w,
8649
+ onChange: E,
8590
8650
  onFocus: () => {
8591
- C(S.slice(0, S.length - s.length - 1));
8651
+ T(w.slice(0, w.length - s.length - 1));
8592
8652
  },
8593
8653
  onBlur: () => {
8594
- C(S === "" ? `${r} ${s}` : `${S} ${s}`);
8654
+ T(w === "" ? `${r} ${s}` : `${w} ${s}`);
8595
8655
  }
8596
8656
  })
8597
8657
  }),
@@ -8602,13 +8662,13 @@ var Sl = xl({ base: "slider-wrapper" }), Cl = ({ id: t, value: n = 0, min: r = 0
8602
8662
  width: d,
8603
8663
  type: "text",
8604
8664
  id: "range-input-min",
8605
- value: b,
8606
- onChange: w,
8665
+ value: S,
8666
+ onChange: E,
8607
8667
  onFocus: () => {
8608
- x(b.slice(0, b.length - s.length - 1));
8668
+ C(S.slice(0, S.length - s.length - 1));
8609
8669
  },
8610
8670
  onBlur: () => {
8611
- x(b === "" ? `${r} ${s}` : `${b} ${s}`);
8671
+ C(S === "" ? `${r} ${s}` : `${S} ${s}`);
8612
8672
  }
8613
8673
  })
8614
8674
  }),
@@ -8616,7 +8676,7 @@ var Sl = xl({ base: "slider-wrapper" }), Cl = ({ id: t, value: n = 0, min: r = 0
8616
8676
  className: "wapper",
8617
8677
  role: "tab",
8618
8678
  tabIndex: -1,
8619
- onKeyDown: w,
8679
+ onKeyDown: E,
8620
8680
  children: /* @__PURE__ */ F("div", {
8621
8681
  className: "slider-inner",
8622
8682
  children: [
@@ -8629,15 +8689,15 @@ var Sl = xl({ base: "slider-wrapper" }), Cl = ({ id: t, value: n = 0, min: r = 0
8629
8689
  children: [
8630
8690
  /* @__PURE__ */ F("div", {
8631
8691
  className: "slider-current-value",
8632
- children: [!!m && /* @__PURE__ */ P("span", {
8633
- style: { left: `${Math.round((v - r) * 100 / (i - r))}%` },
8692
+ children: [!!g && /* @__PURE__ */ P("span", {
8693
+ style: { left: `${Math.round((b - r) * 100 / (i - r))}%` },
8634
8694
  hidden: l === "single",
8635
8695
  className: "min-value",
8636
- children: `${v} ${s}`
8637
- }), !!g && /* @__PURE__ */ P("span", {
8638
- style: { right: `${Math.round((i - y) * 100 / (i - r))}%` },
8696
+ children: `${b} ${s}`
8697
+ }), !!v && /* @__PURE__ */ P("span", {
8698
+ style: { right: `${Math.round((i - x) * 100 / (i - r))}%` },
8639
8699
  className: "max-value",
8640
- children: `${y} ${s}`
8700
+ children: `${x} ${s}`
8641
8701
  })]
8642
8702
  }),
8643
8703
  /* @__PURE__ */ P("div", {
@@ -8645,8 +8705,8 @@ var Sl = xl({ base: "slider-wrapper" }), Cl = ({ id: t, value: n = 0, min: r = 0
8645
8705
  children: /* @__PURE__ */ P("div", {
8646
8706
  className: "progress",
8647
8707
  style: {
8648
- left: `${Math.round((v - r) * 100 / (i - r))}%`,
8649
- right: `${100 - Math.round((y - r) * 100 / (i - r))}%`
8708
+ left: `${Math.round((b - r) * 100 / (i - r))}%`,
8709
+ right: `${100 - Math.round((x - r) * 100 / (i - r))}%`
8650
8710
  }
8651
8711
  })
8652
8712
  }),
@@ -8658,15 +8718,15 @@ var Sl = xl({ base: "slider-wrapper" }), Cl = ({ id: t, value: n = 0, min: r = 0
8658
8718
  min: r,
8659
8719
  max: i,
8660
8720
  step: o,
8661
- onChange: w,
8662
- value: v,
8721
+ onChange: E,
8722
+ value: b,
8663
8723
  disabled: a,
8664
8724
  hidden: l === "single",
8665
8725
  onFocus: () => {
8666
- h(!0);
8726
+ _(!0);
8667
8727
  },
8668
8728
  onBlur: () => {
8669
- h(!1);
8729
+ _(!1);
8670
8730
  },
8671
8731
  onClick: (e) => {
8672
8732
  e.currentTarget.focus();
@@ -8677,14 +8737,14 @@ var Sl = xl({ base: "slider-wrapper" }), Cl = ({ id: t, value: n = 0, min: r = 0
8677
8737
  min: r,
8678
8738
  max: i,
8679
8739
  step: o,
8680
- value: y,
8681
- onChange: w,
8740
+ value: x,
8741
+ onChange: E,
8682
8742
  disabled: a,
8683
8743
  onFocus: () => {
8684
- _(!0);
8744
+ y(!0);
8685
8745
  },
8686
8746
  onBlur: () => {
8687
- _(!1);
8747
+ y(!1);
8688
8748
  },
8689
8749
  onClick: (e) => {
8690
8750
  e.currentTarget.focus();
@@ -8707,13 +8767,13 @@ var Sl = xl({ base: "slider-wrapper" }), Cl = ({ id: t, value: n = 0, min: r = 0
8707
8767
  width: d,
8708
8768
  type: "text",
8709
8769
  id: "range-input-max",
8710
- value: S,
8711
- onChange: w,
8770
+ value: w,
8771
+ onChange: E,
8712
8772
  onFocus: () => {
8713
- C(S.slice(0, S.length - s.length - 1));
8773
+ T(w.slice(0, w.length - s.length - 1));
8714
8774
  },
8715
8775
  onBlur: () => {
8716
- C(S === "" ? `${i} ${s}` : `${S} ${s}`);
8776
+ T(w === "" ? `${i} ${s}` : `${w} ${s}`);
8717
8777
  }
8718
8778
  })
8719
8779
  })
@@ -8743,22 +8803,25 @@ var wl = Y({
8743
8803
  xxl: 6e3,
8744
8804
  xxxl: 8e3,
8745
8805
  xxxxl: 1e4
8746
- }, El = () => {}, Dl = ({ children: e, onClose: t = El, desktopSize: n = "lg", autoHideDuration: r = "xl", haveClose: i = !1, onActionClick: a = El, actionLabel: o = "", icon: s, layout: l = "horizontal", className: u }) => {
8747
- let [d, f] = p(!1);
8748
- return c(() => {
8806
+ }, El = () => {}, Dl = ({ children: e, onClose: t = El, desktopSize: n = "lg", autoHideDuration: r = "xl", haveClose: i = !1, onActionClick: a = El, actionLabel: o = "", icon: s, layout: l = "horizontal", className: u, ...d }) => {
8807
+ let [f, m] = p(!1);
8808
+ c(() => {
8749
8809
  let e = setTimeout(() => {
8750
- f(!0), t();
8810
+ m(!0), t();
8751
8811
  }, Tl[r]);
8752
8812
  return () => {
8753
8813
  clearTimeout(e);
8754
8814
  };
8755
- }), /* @__PURE__ */ P(N, { children: Qa(/* @__PURE__ */ P("div", {
8815
+ });
8816
+ let h = () => {
8817
+ f && t();
8818
+ };
8819
+ return /* @__PURE__ */ P(N, { children: Qa(/* @__PURE__ */ P("div", {
8756
8820
  className: "snack-wrapper",
8757
8821
  children: /* @__PURE__ */ F("div", {
8758
- className: J(wl({ desktopSize: n }), d && "exit", o && "hasAction", l === "vertical" && o && "verticalLayout", !s && !o && !i && "centerText", u),
8759
- onAnimationEnd: () => {
8760
- d && t();
8761
- },
8822
+ ...d,
8823
+ className: J(wl({ desktopSize: n }), f && "exit", o && "hasAction", l === "vertical" && o && "verticalLayout", !s && !o && !i && "centerText", u),
8824
+ onAnimationEnd: h,
8762
8825
  "data-clad": "Snack",
8763
8826
  children: [
8764
8827
  /* @__PURE__ */ F("div", {
@@ -8806,37 +8869,37 @@ function Al(e) {
8806
8869
  let r = new Event("change", { bubbles: !0 });
8807
8870
  r.simulated = !0, t._valueTracker?.setValue?.(n), t.dispatchEvent(r);
8808
8871
  }
8809
- var jl = ({ id: e = "", name: t, label: n = "", value: r = "", onChange: i = kl, onBlur: a = kl, onFocus: o = kl, disabled: u = !1, required: d = !1, status: m = "default", helptext: h = "", helptextClassName: g = "", inputRef: _, resize: v = "none", lines: y = 5, placeholder: b = "", inputMode: x = "text", width: S = "full", characterLimit: C = 0, isResizeableOnFocus: T = !1, allowClear: E = !0, autoSize: D = !1, className: O }) => {
8810
- let k = f(null), A = typeof _ == "object" && _ ? _ : k;
8811
- l(_, () => A.current);
8812
- let j = 16 + (y + 1) * 20, [M, N] = p(j), I = J("text-area-el", r && "hasValue", d && "required"), L = () => {
8813
- A.current && (A.current.style.height = "auto", A.current.style.height = `${A.current.scrollHeight}px`);
8872
+ var jl = ({ id: e = "", name: t, label: n = "", value: r = "", onChange: i = kl, onBlur: a = kl, onFocus: o = kl, disabled: u = !1, required: d = !1, status: m = "default", helptext: h = "", helptextClassName: g = "", inputRef: _, resize: v = "none", lines: y = 5, placeholder: b = "", inputMode: x = "text", width: S = "full", characterLimit: C = 0, isResizeableOnFocus: T = !1, allowClear: E = !0, autoSize: D = !1, className: O, ...k }) => {
8873
+ let A = f(null), j = typeof _ == "object" && _ ? _ : A;
8874
+ l(_, () => j.current);
8875
+ let M = 16 + (y + 1) * 20, [N, I] = p(M), L = J("text-area-el", r && "hasValue", d && "required"), R = () => {
8876
+ j.current && (j.current.style.height = "auto", j.current.style.height = `${j.current.scrollHeight}px`);
8814
8877
  };
8815
8878
  c(() => {
8816
- D && L();
8879
+ D && R();
8817
8880
  }, [r, D]);
8818
- let R = (e) => {
8819
- D && L(), i(e);
8881
+ let ee = (e) => {
8882
+ D && R(), i(e);
8820
8883
  }, z = [
8821
8884
  "both",
8822
8885
  "horizontal",
8823
8886
  "vertical"
8824
8887
  ].includes(v), B = J(Ol({ status: m }), u && "disabled", z && `resize-${v}`, E && "showRightIcon"), V = nr[S] || "initial", H = () => {
8825
- A.current?.focus();
8888
+ j.current?.focus();
8826
8889
  }, U = s((e) => {
8827
- T && N(j * 2), o(e);
8890
+ T && I(M * 2), o(e);
8828
8891
  }, [
8829
8892
  T,
8830
- j,
8893
+ M,
8831
8894
  o
8832
8895
  ]), W = s((e) => {
8833
- T && N(j), a(e);
8896
+ T && I(M), a(e);
8834
8897
  }, [
8835
8898
  T,
8836
- j,
8899
+ M,
8837
8900
  a
8838
8901
  ]), G = () => {
8839
- E && Al(A);
8902
+ E && Al(j);
8840
8903
  };
8841
8904
  return /* @__PURE__ */ F("div", {
8842
8905
  "data-clad": "Input Field - Text Area",
@@ -8845,8 +8908,8 @@ var jl = ({ id: e = "", name: t, label: n = "", value: r = "", onChange: i = kl,
8845
8908
  children: [/* @__PURE__ */ F("div", {
8846
8909
  className: B,
8847
8910
  style: {
8848
- height: D ? void 0 : `${M}px`,
8849
- minHeight: `${M}px`
8911
+ height: D ? void 0 : `${N}px`,
8912
+ minHeight: `${N}px`
8850
8913
  },
8851
8914
  children: [
8852
8915
  /* @__PURE__ */ P("div", {
@@ -8854,16 +8917,18 @@ var jl = ({ id: e = "", name: t, label: n = "", value: r = "", onChange: i = kl,
8854
8917
  onClick: H
8855
8918
  }),
8856
8919
  /* @__PURE__ */ P("textarea", {
8857
- ref: A,
8858
- className: I,
8920
+ ...k,
8921
+ ref: j,
8922
+ className: L,
8859
8923
  id: e || void 0,
8860
8924
  name: t || void 0,
8861
8925
  placeholder: b || void 0,
8862
8926
  maxLength: C || void 0,
8863
8927
  value: r,
8864
8928
  disabled: u,
8929
+ required: d,
8865
8930
  inputMode: x,
8866
- onChange: R,
8931
+ onChange: ee,
8867
8932
  onFocus: U,
8868
8933
  onBlur: W
8869
8934
  }),
@@ -8956,8 +9021,8 @@ var Fl = Y({
8956
9021
  neutral: "toggle-switch--neutral"
8957
9022
  }
8958
9023
  }
8959
- }), Il = () => {}, Ll = ({ id: e, name: t, value: n, checked: r = !1, color: i = "primary", disabled: a = !1, onChange: o = Il, size: s = "md", className: c }) => {
8960
- let l = !!r;
9024
+ }), Il = () => {}, Ll = ({ id: e, name: t, value: n, checked: r = !1, color: i = "primary", disabled: a = !1, onChange: o = Il, size: s = "md", className: c, ...l }) => {
9025
+ let u = !!r;
8961
9026
  return /* @__PURE__ */ P("div", {
8962
9027
  "data-clad": "Toggle",
8963
9028
  className: J(Fl({
@@ -8968,9 +9033,10 @@ var Fl = Y({
8968
9033
  htmlFor: e,
8969
9034
  className: "toggle-switch-label",
8970
9035
  children: [
8971
- /* @__PURE__ */ P("span", { className: J("toggle-switch-inner", l && "toggle-switch-inner--active") }),
8972
- /* @__PURE__ */ P("span", { className: J("toggle-switch-switcher", l && "toggle-switch-switcher--active") }),
9036
+ /* @__PURE__ */ P("span", { className: J("toggle-switch-inner", u && "toggle-switch-inner--active") }),
9037
+ /* @__PURE__ */ P("span", { className: J("toggle-switch-switcher", u && "toggle-switch-switcher--active") }),
8973
9038
  /* @__PURE__ */ P("input", {
9039
+ ...l,
8974
9040
  type: "checkbox",
8975
9041
  className: "toggle-switch-checkbox",
8976
9042
  name: t,
@@ -9015,51 +9081,55 @@ var Rl = Y({
9015
9081
  false: ""
9016
9082
  }
9017
9083
  }
9018
- }), Bl = () => {}, Vl = ({ children: e, onChange: n = Bl, className: r, value: a, variant: s = "standard", showDivider: l = !1, fontWeight: u = "bold", height: d, lineClamp: m = 1, showScrollBtn: h = !1, widthScroll: g }) => {
9019
- let [_, b] = p(!1), [x, S] = p(!1), [C, w] = p(0), T = f(null), E = f(null);
9084
+ }), Bl = () => {}, Vl = ({ children: e, onChange: n = Bl, className: r, value: a, variant: s = "standard", showDivider: l = !1, fontWeight: u = "bold", height: d, lineClamp: m = 1, showScrollBtn: h = !1, widthScroll: g, style: _, ...b }) => {
9085
+ let [x, S] = p(!1), [C, w] = p(!1), [T, E] = p(0), D = f(null), O = f(null);
9020
9086
  c(() => {
9021
- T.current && E.current && E.current.scrollWidth < T.current.scrollWidth && S(!0);
9087
+ D.current && O.current && O.current.scrollWidth < D.current.scrollWidth && w(!0);
9022
9088
  }, []);
9023
- let D = i("span", { className: "tabs__indicator" }), O = t.toArray(e), k = O.length, A = (e) => {
9024
- let t = T.current?.childNodes, r = C;
9089
+ let k = i("span", { className: "tabs__indicator" }), A = t.toArray(e), j = A.length, M = (e) => {
9090
+ let t = D.current?.childNodes, r = T;
9025
9091
  if (e.keyCode === 32) {
9026
- let t = O[r];
9092
+ let t = A[r];
9027
9093
  o(t) && n(e, t.props.value);
9028
9094
  return;
9029
9095
  }
9030
- e.keyCode === 39 && r + 1 < k && (r += 1), e.keyCode === 37 && r - 1 >= 0 && --r, w(r), (t?.[r])?.focus();
9031
- }, j = (e) => {
9096
+ e.keyCode === 39 && r + 1 < j && (r += 1), e.keyCode === 37 && r - 1 >= 0 && --r, E(r), (t?.[r])?.focus();
9097
+ }, N = (e) => {
9032
9098
  let t = e.currentTarget.dataset.value;
9033
- if (T.current) {
9034
- let { childNodes: e } = T.current, n = T.current.scrollWidth ?? 0, r = T.current.offsetWidth ?? 0, i = T.current.scrollLeft ?? 0, a = g ?? Math.round(n / (e?.length ?? 1));
9035
- t === "left" ? i -= a : i += a, T.current.scrollTo({
9099
+ if (D.current) {
9100
+ let { childNodes: e } = D.current, n = D.current.scrollWidth ?? 0, r = D.current.offsetWidth ?? 0, i = D.current.scrollLeft ?? 0, a = g ?? Math.round(n / (e?.length ?? 1));
9101
+ t === "left" ? i -= a : i += a, D.current.scrollTo({
9036
9102
  left: i,
9037
9103
  behavior: "smooth"
9038
- }), i <= 0 ? (b(!1), S(!0)) : i + r >= n ? (b(!0), S(!1)) : (b(!0), S(!0));
9104
+ }), i <= 0 ? (S(!1), w(!0)) : i + r >= n ? (S(!0), w(!1)) : (S(!0), w(!0));
9039
9105
  }
9040
- }, M = J("tabs__scroller", s === "standard" && "tabs__scroller--scrollable"), N = t.map(e, (e, t) => {
9106
+ }, P = J("tabs__scroller", s === "standard" && "tabs__scroller--scrollable"), F = t.map(e, (e, t) => {
9041
9107
  if (!o(e)) return null;
9042
9108
  let r = e.props, c = r.value === a;
9043
9109
  return i(e.type, {
9044
9110
  ...r,
9045
- indicator: c ? D : null,
9111
+ indicator: c ? k : null,
9046
9112
  active: c,
9047
9113
  variant: s,
9048
9114
  onClick: n,
9049
- tabIndex: C === t ? 0 : -1,
9115
+ tabIndex: T === t ? 0 : -1,
9050
9116
  fontWeight: u,
9051
9117
  height: d,
9052
9118
  lineClamp: m
9053
9119
  });
9054
9120
  });
9055
9121
  return i("div", {
9056
- ref: E,
9122
+ ...b,
9123
+ ref: O,
9057
9124
  className: J(Rl({ showDivider: l }), r),
9058
- style: d ? { height: d } : void 0,
9125
+ style: {
9126
+ ...d ? { height: d } : void 0,
9127
+ ..._
9128
+ },
9059
9129
  "data-clad": "Tabs"
9060
9130
  }, h && s === "standard" ? i("button", {
9061
- className: J("tabs__scroll-btn", !_ && "hidden"),
9062
- onClick: j,
9131
+ className: J("tabs__scroll-btn", !x && "hidden"),
9132
+ onClick: N,
9063
9133
  type: "button",
9064
9134
  "data-value": "left"
9065
9135
  }, i(v, {
@@ -9067,13 +9137,13 @@ var Rl = Y({
9067
9137
  height: "24px",
9068
9138
  "aria-hidden": !0
9069
9139
  })) : null, i("div", {
9070
- ref: T,
9140
+ ref: D,
9071
9141
  role: "tablist",
9072
- className: M,
9073
- onKeyDown: A
9074
- }, N), h && s === "standard" ? i("button", {
9075
- className: J("tabs__scroll-btn", !x && "hidden"),
9076
- onClick: j,
9142
+ className: P,
9143
+ onKeyDown: M
9144
+ }, F), h && s === "standard" ? i("button", {
9145
+ className: J("tabs__scroll-btn", !C && "hidden"),
9146
+ onClick: N,
9077
9147
  type: "button",
9078
9148
  "data-value": "right"
9079
9149
  }, i(y, {
@@ -9112,6 +9182,7 @@ var Hl = yt((e, t) => {
9112
9182
  "aria-selected": f === 0,
9113
9183
  "aria-disabled": !!l,
9114
9184
  tabIndex: f,
9185
+ "data-clad": "Tab",
9115
9186
  ...v
9116
9187
  }, o ? i("span", { className: "tab__icon" }, o) : null, r ? i("div", { className: "flex h-full items-center" }, i("span", {
9117
9188
  className: x,
@@ -9145,28 +9216,29 @@ function Kl(e, t, n) {
9145
9216
  }
9146
9217
  return t === e ? [] : [t, e];
9147
9218
  }
9148
- var ql = ({ className: e, options: t = [], label: n = "", value: r = "", onChange: a, required: o = !1, multiple: s = !1, maxSelection: c = 0, tagCloudRef: u, status: d = "default", helptext: p = "", variant: m = "fill", selectedTextStyle: h = "bold" }) => {
9149
- let g = f(null), _ = u && typeof u == "object" ? u : g;
9150
- l(u ?? null, () => _.current);
9151
- let v = t.map((e) => e.value), y = s ? Gl(r, v) : r, b = (e) => {
9152
- a && a(Wl(_, s ? Kl(e, y, c || void 0) : e));
9153
- }, x = t.map((e) => {
9154
- let t = s ? Array.isArray(y) && y.includes(e.value) : y === e.value, n = !s && h === "normal" ? "tag-cloud__chip--normal-selected" : void 0;
9219
+ var ql = ({ className: e, options: t = [], label: n = "", value: r = "", onChange: a, required: o = !1, multiple: s = !1, maxSelection: c = 0, tagCloudRef: u, status: d = "default", helptext: p = "", variant: m = "fill", selectedTextStyle: h = "bold", ...g }) => {
9220
+ let _ = f(null), v = u && typeof u == "object" ? u : _;
9221
+ l(u ?? null, () => v.current);
9222
+ let y = t.map((e) => e.value), b = s ? Gl(r, y) : r, x = (e) => {
9223
+ a && a(Wl(v, s ? Kl(e, b, c || void 0) : e));
9224
+ }, S = t.map((e) => {
9225
+ let t = s ? Array.isArray(b) && b.includes(e.value) : b === e.value, n = !s && h === "normal" ? "tag-cloud__chip--normal-selected" : void 0;
9155
9226
  return i(dr, {
9156
9227
  key: e.value,
9157
9228
  active: t,
9158
9229
  as: "button",
9159
- onClick: () => b(e.value),
9230
+ onClick: () => x(e.value),
9160
9231
  variant: m,
9161
9232
  className: n,
9162
9233
  type: "button"
9163
9234
  }, e.label);
9164
9235
  });
9165
9236
  return i("div", {
9166
- ref: _,
9237
+ ...g,
9238
+ ref: v,
9167
9239
  className: J(Ul({ status: d }), e),
9168
9240
  "data-clad": "Tag Cloud"
9169
- }, n ? i("label", { className: J("tag-cloud__label", o && "required") }, n) : null, i("div", { className: "tag-cloud__chips" }, ...x), p ? i("p", { className: "tag-cloud__helptext" }, p) : null);
9241
+ }, n ? i("label", { className: J("tag-cloud__label", o && "required") }, n) : null, i("div", { className: "tag-cloud__chips" }, ...S), p ? i("p", { className: "tag-cloud__helptext" }, p) : null);
9170
9242
  };
9171
9243
  ql.displayName = "TagCloud";
9172
9244
  //#endregion
@@ -9189,26 +9261,26 @@ var Jl = Y({
9189
9261
  wrap: "row-item--border-wrap"
9190
9262
  }
9191
9263
  }
9192
- }), Yl = ({ name: e, size: t = "md", icon: r, border: a = "none", type: o = "list", inverted: s = !1, onClick: l, onChange: u, value: d, checked: f = !1, children: m = "Default Row", description: h = "", collapsibleContent: _, isCollapsed: v = !1, onCollapseChange: x, className: S }) => {
9193
- let [C, w] = p(f);
9264
+ }), Yl = ({ name: e, size: t = "md", icon: r, border: a = "none", type: o = "list", inverted: s = !1, onClick: l, onChange: u, value: d, checked: f = !1, children: m = "Default Row", description: h = "", collapsibleContent: _, isCollapsed: v = !1, onCollapseChange: x, className: S, ...C }) => {
9265
+ let [w, T] = p(f);
9194
9266
  c(() => {
9195
- w(f);
9267
+ T(f);
9196
9268
  }, [f]);
9197
- let T = (e) => {
9269
+ let E = (e) => {
9198
9270
  o === "list" || o === "chevron" || o === "accordion" ? l?.(e) : e.target.value || u?.({
9199
9271
  value: d,
9200
- checked: !C
9272
+ checked: !w
9201
9273
  }), o === "accordion" && x?.(!v);
9202
- }, E = (() => {
9274
+ }, D = (() => {
9203
9275
  switch (o) {
9204
9276
  case "checkbox": return i(Zn, {
9205
9277
  name: e,
9206
- checked: C,
9278
+ checked: w,
9207
9279
  value: d
9208
9280
  });
9209
9281
  case "radio": return i(ys, {
9210
9282
  name: e,
9211
- checked: C,
9283
+ checked: w,
9212
9284
  value: d
9213
9285
  });
9214
9286
  case "chevron": return i(y, {
@@ -9223,15 +9295,16 @@ var Jl = Y({
9223
9295
  });
9224
9296
  default: return null;
9225
9297
  }
9226
- })(), D = J("row-item__top-row", s && "row-item__top-row--inverted");
9298
+ })(), O = J("row-item__top-row", s && "row-item__top-row--inverted");
9227
9299
  return i(n, null, i("div", {
9300
+ ...C,
9228
9301
  className: J(Jl({
9229
9302
  size: t,
9230
9303
  border: a
9231
9304
  }), S),
9232
- onClick: T,
9305
+ onClick: E,
9233
9306
  "data-clad": "Row Item"
9234
- }, i("div", { className: D }, r ? i("div", { className: "row-item__icon" }, r) : null, i("div", { className: "row-item__text" }, m), i("div", { className: "row-item__icon" }, E)), h ? i("div", { className: "row-item__description" }, h) : null), v && _ ? i("div", { className: "row-item__collapsible" }, _) : null);
9307
+ }, i("div", { className: O }, r ? i("div", { className: "row-item__icon" }, r) : null, i("div", { className: "row-item__text" }, m), i("div", { className: "row-item__icon" }, D)), h ? i("div", { className: "row-item__description" }, h) : null), v && _ ? i("div", { className: "row-item__collapsible" }, _) : null);
9235
9308
  };
9236
9309
  Yl.displayName = "RowItem";
9237
9310
  //#endregion