@foi/design-system 0.0.14 → 0.0.16

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 (45) hide show
  1. package/README.md +117 -18
  2. package/dist/{RadioGroup-DCJBoZc-.js → RadioGroup-BdWsLUz-.js} +4 -4
  3. package/dist/{RadioGroup-DCJBoZc-.js.map → RadioGroup-BdWsLUz-.js.map} +1 -1
  4. package/dist/{RadioGroup.context-QNk2hW_4.js → RadioGroup.context-BBa8PDLt.js} +4 -4
  5. package/dist/RadioGroup.context-BBa8PDLt.js.map +1 -0
  6. package/dist/{Switch-JF9P9VJf.js → Switch-BNFdKefE.js} +1394 -886
  7. package/dist/Switch-BNFdKefE.js.map +1 -0
  8. package/dist/{ThemeProvider-Q2Hjezbt.js → ThemeProvider-C47pyWG6.js} +2 -2
  9. package/dist/{ThemeProvider-Q2Hjezbt.js.map → ThemeProvider-C47pyWG6.js.map} +1 -1
  10. package/dist/atoms.d.ts +4 -2
  11. package/dist/atoms.mjs +3 -3
  12. package/dist/components/atoms/NumberField/NumberField.d.ts +5 -0
  13. package/dist/components/atoms/NumberField/NumberField.interface.d.ts +57 -0
  14. package/dist/components/atoms/NumberField/index.d.ts +4 -0
  15. package/dist/components/atoms/TextField/TextField.d.ts +5 -0
  16. package/dist/components/atoms/TextField/TextField.emotion.d.ts +2 -0
  17. package/dist/components/atoms/TextField/TextField.interface.d.ts +51 -0
  18. package/dist/components/atoms/TextField/index.d.ts +4 -0
  19. package/dist/{emotion-react-jsx-runtime.browser.esm-C4rLUMui.js → emotion-react-jsx-runtime.browser.esm-Ch-DwUYg.js} +2 -2
  20. package/dist/{emotion-react-jsx-runtime.browser.esm-C4rLUMui.js.map → emotion-react-jsx-runtime.browser.esm-Ch-DwUYg.js.map} +1 -1
  21. package/dist/hocs/ThemeProvider/components/NumberField.d.ts +38 -0
  22. package/dist/hocs/ThemeProvider/components/{Input.d.ts → TextField.d.ts} +1 -1
  23. package/dist/hocs/ThemeProvider/components/index.d.ts +3 -2
  24. package/dist/hocs/ThemeProvider/interfaces/Components.interface.d.ts +2 -1
  25. package/dist/hocs.mjs +1 -1
  26. package/dist/index.d.ts +4 -2
  27. package/dist/index.mjs +187 -187
  28. package/dist/index.mjs.map +1 -1
  29. package/dist/molecules.mjs +1 -1
  30. package/dist/theme/dark/components/NumberField.d.ts +60 -0
  31. package/dist/theme/dark/components/{Input.d.ts → TextField.d.ts} +1 -1
  32. package/dist/theme/dark/components/index.d.ts +58 -1
  33. package/dist/theme/dark/index.d.ts +58 -1
  34. package/dist/theme/index.d.ts +58 -1
  35. package/dist/{theme-Cxg9jdmX.js → theme-D01EcUA9.js} +81 -44
  36. package/dist/theme-D01EcUA9.js.map +1 -0
  37. package/dist/theme.mjs +1 -1
  38. package/package.json +1 -1
  39. package/dist/RadioGroup.context-QNk2hW_4.js.map +0 -1
  40. package/dist/Switch-JF9P9VJf.js.map +0 -1
  41. package/dist/components/atoms/Input/Input.d.ts +0 -10
  42. package/dist/components/atoms/Input/Input.interface.d.ts +0 -108
  43. package/dist/components/atoms/Input/index.d.ts +0 -4
  44. package/dist/theme-Cxg9jdmX.js.map +0 -1
  45. /package/dist/components/atoms/{Input/Input.emotion.d.ts → NumberField/NumberField.emotion.d.ts} +0 -0
package/dist/index.mjs CHANGED
@@ -1,14 +1,14 @@
1
- import { i as e, n as t, r as n, t as r } from "./emotion-react-jsx-runtime.browser.esm-C4rLUMui.js";
2
- import { n as i, r as a } from "./theme-Cxg9jdmX.js";
3
- import { a as o, n as s, o as c } from "./RadioGroup.context-QNk2hW_4.js";
4
- import { a as l, c as u, i as d, n as f, o as p, r as m, s as h, t as g } from "./Switch-JF9P9VJf.js";
5
- import { n as _, r as v, t as y } from "./RadioGroup-DCJBoZc-.js";
6
- import { t as b } from "./ThemeProvider-Q2Hjezbt.js";
7
- import { useCallback as x, useEffect as S, useLayoutEffect as C, useMemo as w, useRef as T, useState as E } from "react";
1
+ import { i as e, n as t, r as n, t as r } from "./emotion-react-jsx-runtime.browser.esm-Ch-DwUYg.js";
2
+ import { n as i, r as a } from "./theme-D01EcUA9.js";
3
+ import { a as o, n as s, o as c } from "./RadioGroup.context-BBa8PDLt.js";
4
+ import { a as l, c as u, i as d, l as f, n as p, o as m, r as h, s as g, t as _ } from "./Switch-BNFdKefE.js";
5
+ import { n as v, r as y, t as b } from "./RadioGroup-BdWsLUz-.js";
6
+ import { t as x } from "./ThemeProvider-C47pyWG6.js";
7
+ import { useCallback as S, useEffect as C, useLayoutEffect as ee, useMemo as w, useRef as T, useState as E } from "react";
8
8
  import { css as D, keyframes as O } from "@emotion/react";
9
9
  import k from "react-dom";
10
10
  //#region src/components/atoms/Skeleton/Skeleton.emotion.ts
11
- var ee = D`
11
+ var A = D`
12
12
  &.--SKELETON {
13
13
  display: block;
14
14
  background: linear-gradient(
@@ -31,13 +31,13 @@ var ee = D`
31
31
  border-radius: 4px;
32
32
  }
33
33
  }
34
- `, A = ({ variant: e = "rectangular", width: n, height: r, className: i }) => /* @__PURE__ */ t("span", {
34
+ `, j = ({ variant: e = "rectangular", width: n, height: r, className: i }) => /* @__PURE__ */ t("span", {
35
35
  className: [
36
36
  "--SKELETON",
37
37
  `--SKELETON--${e}`,
38
38
  i || ""
39
39
  ].filter(Boolean).join(" "),
40
- css: ee,
40
+ css: A,
41
41
  style: {
42
42
  width: n,
43
43
  height: r
@@ -213,7 +213,7 @@ var ee = D`
213
213
  padding: 12px 16px !important;
214
214
  }
215
215
  }
216
- `, j = (e, t) => `
216
+ `, M = (e, t) => `
217
217
  // BACKGROUNDS
218
218
  ${a(e, "background-color", `--DATAGRIDMENU-${t}-BACKGROUND-COLOR`)}
219
219
 
@@ -222,7 +222,7 @@ var ee = D`
222
222
  ${a(e, "border-width", `--DATAGRIDMENU-${t}-BORDER-WIDTH`)}
223
223
  ${a(e, "border-style", `--DATAGRIDMENU-${t}-BORDER-STYLE`)}
224
224
  ${a(e, "border-radius", `--DATAGRIDMENU-${t}-BORDER-RADIUS`)}
225
- `, M = (e) => D`
225
+ `, N = (e) => D`
226
226
  &.--DATAGRIDMENU {
227
227
  position: fixed;
228
228
  z-index: 200;
@@ -236,7 +236,7 @@ var ee = D`
236
236
  rgba(0, 0, 0, 0.14) 0px 8px 10px 1px,
237
237
  rgba(0, 0, 0, 0.12) 0px 3px 14px 2px;
238
238
 
239
- ${j(e, "ROOT")}
239
+ ${M(e, "ROOT")}
240
240
 
241
241
  .--DATAGRIDMENU-header {
242
242
  display: flex;
@@ -300,9 +300,9 @@ var ee = D`
300
300
  justify-content: flex-end;
301
301
  }
302
302
  }
303
- `, N = "--DATAGRIDMENU", P = ({ columnKey: e, pendingSearch: n, onSearchChange: r, searchLabel: i = "Search" }) => /* @__PURE__ */ t("div", {
304
- className: `${N}-searchInput`,
305
- children: /* @__PURE__ */ t(l, {
303
+ `, P = "--DATAGRIDMENU", F = ({ columnKey: e, pendingSearch: n, onSearchChange: r, searchLabel: i = "Search" }) => /* @__PURE__ */ t("div", {
304
+ className: `${P}-searchInput`,
305
+ children: /* @__PURE__ */ t(m, {
306
306
  name: `search-${e}`,
307
307
  label: i,
308
308
  value: n,
@@ -310,33 +310,33 @@ var ee = D`
310
310
  showErrorText: !1,
311
311
  width: "full",
312
312
  autoFocus: !0,
313
- "data-testid": `${N}-searchInput-${e}`,
313
+ "data-testid": `${P}-searchInput-${e}`,
314
314
  startAdornment: /* @__PURE__ */ t(o, {
315
315
  name: "search",
316
316
  style: { color: "white" }
317
317
  })
318
318
  })
319
- }), F = "--DATAGRIDMENU", I = ({ filterType: e, columnKey: i, options: a, pendingMulti: o, onMultiChange: c, multiSearch: u, onMultiSearchChange: d }) => {
320
- let f = e === "multiselect-search", p = a.filter((e) => !u || e.label.toLowerCase().includes(u.toLowerCase()));
321
- return /* @__PURE__ */ n(r, { children: [f && /* @__PURE__ */ t("div", {
322
- className: `${F}-searchInput`,
323
- children: /* @__PURE__ */ t(l, {
319
+ }), I = "--DATAGRIDMENU", L = ({ filterType: e, columnKey: i, options: a, pendingMulti: o, onMultiChange: c, multiSearch: l, onMultiSearchChange: u }) => {
320
+ let d = e === "multiselect-search", f = a.filter((e) => !l || e.label.toLowerCase().includes(l.toLowerCase()));
321
+ return /* @__PURE__ */ n(r, { children: [d && /* @__PURE__ */ t("div", {
322
+ className: `${I}-searchInput`,
323
+ children: /* @__PURE__ */ t(m, {
324
324
  name: `multiSearch-${i}`,
325
325
  label: "Search options",
326
- value: u,
327
- onValueChange: d,
326
+ value: l,
327
+ onValueChange: u,
328
328
  showErrorText: !1,
329
329
  width: "full",
330
330
  autoFocus: !0,
331
- "data-testid": `${F}-multiSearch-${i}`
331
+ "data-testid": `${I}-multiSearch-${i}`
332
332
  })
333
333
  }), /* @__PURE__ */ t("div", {
334
- className: `${F}-optionsList`,
335
- "data-testid": `${F}-optionsList-${i}`,
336
- children: p.map((e) => /* @__PURE__ */ n("div", {
337
- className: `${F}-optionRow`,
334
+ className: `${I}-optionsList`,
335
+ "data-testid": `${I}-optionsList-${i}`,
336
+ children: f.map((e) => /* @__PURE__ */ n("div", {
337
+ className: `${I}-optionRow`,
338
338
  children: [e.color && /* @__PURE__ */ t("span", {
339
- className: `${F}-optionDot`,
339
+ className: `${I}-optionDot`,
340
340
  style: { backgroundColor: e.color },
341
341
  "aria-hidden": "true"
342
342
  }), /* @__PURE__ */ t(s, {
@@ -344,71 +344,71 @@ var ee = D`
344
344
  onChecked: (t) => c(t ? [...o, e.value] : o.filter((t) => t !== e.value)),
345
345
  label: e.label,
346
346
  showErrorText: !1,
347
- "data-testid": `${F}-option-${i}-${e.value}`
347
+ "data-testid": `${I}-option-${i}-${e.value}`
348
348
  })]
349
349
  }, e.value))
350
350
  })] });
351
- }, L = "--DATAGRIDMENU", R = ({ filterType: e, options: r, columnKey: i, filterTitle: a, searchLabel: s, cancelLabel: c = "Cancel", applyLabel: l = "Apply", pendingSearch: d, onSearchChange: f, pendingMulti: p, onMultiChange: m, multiSearch: g, onMultiSearchChange: _, onCancel: v, onApply: y, onClear: b, anchorEl: x, style: S }) => {
352
- let w = T(null);
353
- return C(() => {
351
+ }, R = "--DATAGRIDMENU", z = ({ filterType: e, options: r, columnKey: i, filterTitle: a, searchLabel: s, cancelLabel: c = "Cancel", applyLabel: l = "Apply", pendingSearch: d, onSearchChange: p, pendingMulti: m, onMultiChange: h, multiSearch: g, onMultiSearchChange: _, onCancel: v, onApply: y, onClear: b, anchorEl: x, style: S }) => {
352
+ let C = T(null);
353
+ return ee(() => {
354
354
  if (!x) return;
355
355
  let e = () => {
356
- if (!w.current) return;
357
- let e = x.getBoundingClientRect(), t = w.current.offsetWidth, n = e.left + e.width / 2 - t / 2;
358
- w.current.style.top = `${e.bottom + 8}px`, w.current.style.left = `${Math.max(8, Math.min(n, window.innerWidth - t - 8))}px`;
356
+ if (!C.current) return;
357
+ let e = x.getBoundingClientRect(), t = C.current.offsetWidth, n = e.left + e.width / 2 - t / 2;
358
+ C.current.style.top = `${e.bottom + 8}px`, C.current.style.left = `${Math.max(8, Math.min(n, window.innerWidth - t - 8))}px`;
359
359
  };
360
360
  return e(), window.addEventListener("scroll", e, !0), window.addEventListener("resize", e), () => {
361
361
  window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e);
362
362
  };
363
363
  }, [x]), k.createPortal(/* @__PURE__ */ n("div", {
364
- ref: w,
365
- className: L,
366
- css: M(S),
364
+ ref: C,
365
+ className: R,
366
+ css: N(S),
367
367
  "data-popover-key": i,
368
- "data-testid": `${L}-${i}`,
368
+ "data-testid": `${R}-${i}`,
369
369
  children: [
370
370
  /* @__PURE__ */ n("div", {
371
- className: `${L}-header`,
371
+ className: `${R}-header`,
372
372
  children: [/* @__PURE__ */ t("span", {
373
- className: `${L}-headerTitle`,
373
+ className: `${R}-headerTitle`,
374
374
  children: a
375
- }), /* @__PURE__ */ t(h, {
375
+ }), /* @__PURE__ */ t(u, {
376
376
  icon: /* @__PURE__ */ t(o, {
377
377
  name: "delete_outline",
378
378
  size: "sm"
379
379
  }),
380
380
  onClick: b,
381
381
  "aria-label": "Clear filter",
382
- "data-testid": `${L}-clearBtn-${i}`
382
+ "data-testid": `${R}-clearBtn-${i}`
383
383
  })]
384
384
  }),
385
385
  /* @__PURE__ */ n("div", {
386
- className: `${L}-content`,
387
- children: [e === "search" && /* @__PURE__ */ t(P, {
386
+ className: `${R}-content`,
387
+ children: [e === "search" && /* @__PURE__ */ t(F, {
388
388
  columnKey: i,
389
389
  pendingSearch: d,
390
- onSearchChange: f,
390
+ onSearchChange: p,
391
391
  searchLabel: s
392
- }), (e === "multiselect" || e === "multiselect-search") && /* @__PURE__ */ t(I, {
392
+ }), (e === "multiselect" || e === "multiselect-search") && /* @__PURE__ */ t(L, {
393
393
  filterType: e,
394
394
  columnKey: i,
395
395
  options: r ?? [],
396
- pendingMulti: p,
397
- onMultiChange: m,
396
+ pendingMulti: m,
397
+ onMultiChange: h,
398
398
  multiSearch: g,
399
399
  onMultiSearchChange: _
400
400
  })]
401
401
  }),
402
402
  /* @__PURE__ */ n("div", {
403
- className: `${L}-actions`,
404
- children: [/* @__PURE__ */ t(u, {
403
+ className: `${R}-actions`,
404
+ children: [/* @__PURE__ */ t(f, {
405
405
  onClick: v,
406
- "data-testid": `${L}-cancelBtn-${i}`,
406
+ "data-testid": `${R}-cancelBtn-${i}`,
407
407
  variant: "ghost",
408
408
  children: c
409
- }), /* @__PURE__ */ t(u, {
409
+ }), /* @__PURE__ */ t(f, {
410
410
  onClick: y,
411
- "data-testid": `${L}-applyBtn-${i}`,
411
+ "data-testid": `${R}-applyBtn-${i}`,
412
412
  children: l
413
413
  })]
414
414
  })
@@ -416,27 +416,27 @@ var ee = D`
416
416
  }), document.body);
417
417
  }, ne = ({ theme: n, variant: r = "default", ...i }) => {
418
418
  let { componentStyles: a } = e([c.DATAGRIDMENU], n, r.toUpperCase());
419
- return /* @__PURE__ */ t(R, {
419
+ return /* @__PURE__ */ t(z, {
420
420
  ...i,
421
421
  style: a
422
422
  });
423
- }, z = "--DATAGRID", re = ({ columns: e, pageSize: n }) => {
423
+ }, B = "--DATAGRID", re = ({ columns: e, pageSize: n }) => {
424
424
  let i = w(() => Array.from({ length: n }, () => e.map((e) => e.type === "options" ? null : `${Math.floor(Math.random() * 51) + 40}%`)), [n, e.length]);
425
425
  return /* @__PURE__ */ t(r, { children: Array.from({ length: n }).map((n, r) => /* @__PURE__ */ t("tr", {
426
- className: `${z}-row`,
426
+ className: `${B}-row`,
427
427
  children: e.map((e, n) => /* @__PURE__ */ t("td", {
428
- className: [`${z}-td`, e.type === "options" ? `${z}-tdOptions` : ""].filter(Boolean).join(" "),
429
- children: e.type === "options" ? /* @__PURE__ */ t(A, {
428
+ className: [`${B}-td`, e.type === "options" ? `${B}-tdOptions` : ""].filter(Boolean).join(" "),
429
+ children: e.type === "options" ? /* @__PURE__ */ t(j, {
430
430
  variant: "circular",
431
431
  width: 24,
432
432
  height: 24
433
- }) : /* @__PURE__ */ t(A, {
433
+ }) : /* @__PURE__ */ t(j, {
434
434
  height: 16,
435
435
  width: i[r][n] ?? void 0
436
436
  })
437
437
  }, e.key))
438
438
  }, r)) });
439
- }, B = (e) => D`
439
+ }, V = (e) => D`
440
440
  &.--PAGINATION {
441
441
  display: flex;
442
442
  align-items: center;
@@ -473,7 +473,7 @@ var ee = D`
473
473
  }
474
474
  }
475
475
  }
476
- `, V = (e, t) => `
476
+ `, H = (e, t) => `
477
477
  // BACKGROUNDS
478
478
  ${a(e, "background-color", `--PAGINATIONMENU-EVENTS-${t}-BACKGROUND-COLOR`)}
479
479
 
@@ -482,11 +482,11 @@ var ee = D`
482
482
  ${a(e, "border-width", `--PAGINATIONMENU-EVENTS-${t}-BORDER-WIDTH`)}
483
483
  ${a(e, "border-style", `--PAGINATIONMENU-EVENTS-${t}-BORDER-STYLE`)}
484
484
  ${a(e, "border-radius", `--PAGINATIONMENU-EVENTS-${t}-BORDER-RADIUS`)}
485
- `, H = (e, t) => `
485
+ `, U = (e, t) => `
486
486
  // TYPOGRAPHY
487
487
  ${a(e, "color", `--PAGINATIONMENU-EVENTS-${t}-COLOR-PRIMARY`)};
488
488
  ${a(e, "caret-color", `--PAGINATIONMENU-EVENTS-${t}-COLOR-PRIMARY`)};
489
- `, ie = (e, t) => `
489
+ `, W = (e, t) => `
490
490
  // BACKGROUNDS
491
491
  ${a(e, "background-color", `--PAGINATIONMENU-${t}-BACKGROUND-COLOR`)}
492
492
 
@@ -495,7 +495,7 @@ var ee = D`
495
495
  ${a(e, "border-width", `--PAGINATIONMENU-${t}-BORDER-WIDTH`)}
496
496
  ${a(e, "border-style", `--PAGINATIONMENU-${t}-BORDER-STYLE`)}
497
497
  ${a(e, "border-radius", `--PAGINATIONMENU-${t}-BORDER-RADIUS`)}
498
- `, U = (e) => D`
498
+ `, G = (e) => D`
499
499
  &.--PAGINATIONMENU {
500
500
  position: absolute;
501
501
  bottom: calc(100% + ${e["--PAGINATIONMENU-ROOT-BOTTOM"] || ""});
@@ -510,7 +510,7 @@ var ee = D`
510
510
  rgba(0, 0, 0, 0.14) 0px 8px 10px 1px,
511
511
  rgba(0, 0, 0, 0.12) 0px 3px 14px 2px;
512
512
 
513
- ${ie(e, "ROOT")}
513
+ ${W(e, "ROOT")}
514
514
 
515
515
  .--PAGINATIONMENU-option {
516
516
  all: unset;
@@ -523,111 +523,111 @@ var ee = D`
523
523
  font-size: 0.8125rem;
524
524
 
525
525
  // ENABLED
526
- ${V(e, "ENABLED")}
527
526
  ${H(e, "ENABLED")}
527
+ ${U(e, "ENABLED")}
528
528
 
529
529
  // VALUE
530
530
  &.--PAGINATIONMENU-selected {
531
- ${V(e, "VALUE")}
532
531
  ${H(e, "VALUE")}
532
+ ${U(e, "VALUE")}
533
533
  }
534
534
 
535
535
  // HOVER
536
536
  &:hover {
537
- ${V(e, "HOVER")}
538
537
  ${H(e, "HOVER")}
538
+ ${U(e, "HOVER")}
539
539
  }
540
540
 
541
541
  // - ACTIVE
542
542
  &:active,
543
543
  &.--PAGINATIONMENU-active {
544
- ${V(e, "ACTIVE")}
545
544
  ${H(e, "ACTIVE")}
545
+ ${U(e, "ACTIVE")}
546
546
  }
547
547
 
548
548
  // FOCUS
549
549
  &:focus-visible {
550
550
  outline-offset: 0px;
551
551
  outline: 0;
552
- ${V(e, "FOCUS")}
553
552
  ${H(e, "FOCUS")}
553
+ ${U(e, "FOCUS")}
554
554
  }
555
555
  }
556
556
  }
557
- `, W = "--PAGINATIONMENU", G = ({ options: e, activeOption: n, onSelect: r, focusedElement: i = -1, style: a }) => /* @__PURE__ */ t("div", {
558
- className: W,
559
- css: U(a),
557
+ `, K = "--PAGINATIONMENU", q = ({ options: e, activeOption: n, onSelect: r, focusedElement: i = -1, style: a }) => /* @__PURE__ */ t("div", {
558
+ className: K,
559
+ css: G(a),
560
560
  children: e.map((e, a) => {
561
- let o = e === n ? `${W}-selected` : "", s = i === a;
561
+ let o = e === n ? `${K}-selected` : "", s = i === a;
562
562
  return /* @__PURE__ */ t("button", {
563
563
  className: [
564
- `${W}-option`,
564
+ `${K}-option`,
565
565
  o,
566
- s ? `${W}-active` : ""
566
+ s ? `${K}-active` : ""
567
567
  ].filter(Boolean).join(" "),
568
568
  onClick: () => r(e),
569
569
  children: e
570
570
  }, e);
571
571
  })
572
- }), K = ({ theme: n, variant: r = "default", ...i }) => {
572
+ }), J = ({ theme: n, variant: r = "default", ...i }) => {
573
573
  let { componentStyles: a } = e([c.PAGINATIONMENU], n, r.toUpperCase());
574
- return /* @__PURE__ */ t(G, {
574
+ return /* @__PURE__ */ t(q, {
575
575
  ...i,
576
576
  style: a
577
577
  });
578
- }, q = "--PAGINATION", J = ({ page: e, total: r, pageSize: i, onPageChange: a, pageSizeOptions: s, onPageSizeChange: c, loading: l, className: u, style: d }) => {
579
- let [f, p] = E(!1), [m, g] = E(-1), _ = Math.max(1, Math.ceil(r / i)), v = e * i + 1, y = Math.min((e + 1) * i, r), b = e === 0, x = e >= _ - 1, C = () => {
580
- p(!1), g(-1);
578
+ }, Y = "--PAGINATION", X = ({ page: e, total: r, pageSize: i, onPageChange: a, pageSizeOptions: s, onPageSizeChange: c, loading: l, className: d, style: f }) => {
579
+ let [p, m] = E(!1), [h, g] = E(-1), _ = Math.max(1, Math.ceil(r / i)), v = e * i + 1, y = Math.min((e + 1) * i, r), b = e === 0, x = e >= _ - 1, S = () => {
580
+ m(!1), g(-1);
581
581
  };
582
- return S(() => {
583
- if (!f) return;
582
+ return C(() => {
583
+ if (!p) return;
584
584
  let e = (e) => {
585
- e.target.closest(`.${q}-rowsControl`) || (p(!1), g(-1));
585
+ e.target.closest(`.${Y}-rowsControl`) || (m(!1), g(-1));
586
586
  };
587
587
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
588
- }, [f]), /* @__PURE__ */ n("div", {
589
- className: [q, u || ""].filter(Boolean).join(" "),
590
- css: B(d ?? {}),
588
+ }, [p]), /* @__PURE__ */ n("div", {
589
+ className: [Y, d || ""].filter(Boolean).join(" "),
590
+ css: V(f ?? {}),
591
591
  children: [s && s.length > 0 && /* @__PURE__ */ n("div", {
592
- className: `${q}-rowsControl`,
592
+ className: `${Y}-rowsControl`,
593
593
  children: [
594
- f && /* @__PURE__ */ t(K, {
594
+ p && /* @__PURE__ */ t(J, {
595
595
  options: s,
596
596
  activeOption: i,
597
597
  onSelect: (e) => {
598
- c?.(e), C();
598
+ c?.(e), S();
599
599
  },
600
- focusedElement: m
600
+ focusedElement: h
601
601
  }),
602
602
  /* @__PURE__ */ t("span", {
603
- className: `${q}-rowsSize`,
603
+ className: `${Y}-rowsSize`,
604
604
  children: i
605
605
  }),
606
- /* @__PURE__ */ t(h, {
606
+ /* @__PURE__ */ t(u, {
607
607
  icon: /* @__PURE__ */ t(o, {
608
608
  name: "arrow_drop_up",
609
609
  size: "sm"
610
610
  }),
611
- onClick: () => f ? C() : p(!0),
611
+ onClick: () => p ? S() : m(!0),
612
612
  onKeyDown: (e) => {
613
- if (e.key === "Tab" || e.key === "Escape") p(!1), g(-1);
614
- else if (["ArrowDown", "ArrowUp"].includes(e.key) && f) e.preventDefault(), e.key === "ArrowDown" ? g((e) => e + 1 >= (s?.length ?? 0) ? 0 : e + 1) : g((e) => e - 1 < 0 ? (s?.length ?? 1) - 1 : e - 1);
615
- else if (e.key === "Enter" && f && m >= 0 && s) {
613
+ if (e.key === "Tab" || e.key === "Escape") m(!1), g(-1);
614
+ else if (["ArrowDown", "ArrowUp"].includes(e.key) && p) e.preventDefault(), e.key === "ArrowDown" ? g((e) => e + 1 >= (s?.length ?? 0) ? 0 : e + 1) : g((e) => e - 1 < 0 ? (s?.length ?? 1) - 1 : e - 1);
615
+ else if (e.key === "Enter" && p && h >= 0 && s) {
616
616
  e.preventDefault();
617
- let t = s[m];
618
- t !== void 0 && (c?.(t), p(!1), g(-1));
617
+ let t = s[h];
618
+ t !== void 0 && (c?.(t), m(!1), g(-1));
619
619
  }
620
620
  },
621
- isFlipped: f,
621
+ isFlipped: p,
622
622
  "aria-label": "Rows per page",
623
- "data-testid": `${q}-rowsBtn`
623
+ "data-testid": `${Y}-rowsBtn`
624
624
  })
625
625
  ]
626
626
  }), /* @__PURE__ */ n("div", {
627
- className: `${q}-controls`,
627
+ className: `${Y}-controls`,
628
628
  children: [
629
629
  /* @__PURE__ */ n("span", {
630
- className: `${q}-info`,
630
+ className: `${Y}-info`,
631
631
  children: [
632
632
  v,
633
633
  "-",
@@ -636,7 +636,7 @@ var ee = D`
636
636
  r
637
637
  ]
638
638
  }),
639
- /* @__PURE__ */ t(h, {
639
+ /* @__PURE__ */ t(u, {
640
640
  icon: /* @__PURE__ */ t(o, {
641
641
  name: "first_page",
642
642
  size: "sm"
@@ -644,9 +644,9 @@ var ee = D`
644
644
  onClick: () => a(0),
645
645
  disabled: l || b,
646
646
  "aria-label": "First page",
647
- "data-testid": `${q}-first`
647
+ "data-testid": `${Y}-first`
648
648
  }),
649
- /* @__PURE__ */ t(h, {
649
+ /* @__PURE__ */ t(u, {
650
650
  icon: /* @__PURE__ */ t(o, {
651
651
  name: "chevron_left",
652
652
  size: "sm"
@@ -654,9 +654,9 @@ var ee = D`
654
654
  onClick: () => a(e - 1),
655
655
  disabled: l || b,
656
656
  "aria-label": "Previous page",
657
- "data-testid": `${q}-prev`
657
+ "data-testid": `${Y}-prev`
658
658
  }),
659
- /* @__PURE__ */ t(h, {
659
+ /* @__PURE__ */ t(u, {
660
660
  icon: /* @__PURE__ */ t(o, {
661
661
  name: "chevron_right",
662
662
  size: "sm"
@@ -664,9 +664,9 @@ var ee = D`
664
664
  onClick: () => a(e + 1),
665
665
  disabled: l || x,
666
666
  "aria-label": "Next page",
667
- "data-testid": `${q}-next`
667
+ "data-testid": `${Y}-next`
668
668
  }),
669
- /* @__PURE__ */ t(h, {
669
+ /* @__PURE__ */ t(u, {
670
670
  icon: /* @__PURE__ */ t(o, {
671
671
  name: "last_page",
672
672
  size: "sm"
@@ -674,28 +674,28 @@ var ee = D`
674
674
  onClick: () => a(_ - 1),
675
675
  disabled: l || x,
676
676
  "aria-label": "Last page",
677
- "data-testid": `${q}-last`
677
+ "data-testid": `${Y}-last`
678
678
  })
679
679
  ]
680
680
  })]
681
681
  });
682
- }, Y = ({ theme: n, variant: r = "default", ...i }) => {
682
+ }, ie = ({ theme: n, variant: r = "default", ...i }) => {
683
683
  let { componentStyles: a } = e([c.PAGINATION], n, r.toUpperCase());
684
- return /* @__PURE__ */ t(J, {
684
+ return /* @__PURE__ */ t(X, {
685
685
  ...i,
686
686
  style: a
687
687
  });
688
- }, X = "--DATAGRID", ae = 10, Z = ({ columns: e, onFetch: i, paginationType: a = "pagination", pageSize: s = ae, pageSizeOptions: c, emptyContent: l = /* @__PURE__ */ t("span", { children: "No se han encontrado resultados" }), loadingMoreContent: u = /* @__PURE__ */ t("span", { children: "Cargando..." }), className: d, style: f }) => {
689
- let [p, m] = E([]), [g, _] = E(0), [v, y] = E(0), [b, w] = E(s), [D, O] = E(!0), [k, ee] = E(null), [A, j] = E({}), [M, N] = E(null), [P, F] = E(null), [I, L] = E(""), [R, z] = E([]), [B, V] = E(""), [H, ie] = E([]), [U, W] = E(0), G = T({}), K = T(null), q = T(null);
690
- S(() => {
688
+ }, Z = "--DATAGRID", ae = 10, Q = ({ columns: e, onFetch: i, paginationType: a = "pagination", pageSize: s = ae, pageSizeOptions: c, emptyContent: l = /* @__PURE__ */ t("span", { children: "No se han encontrado resultados" }), loadingMoreContent: d = /* @__PURE__ */ t("span", { children: "Cargando..." }), className: f, style: p }) => {
689
+ let [m, h] = E([]), [g, _] = E(0), [v, y] = E(0), [b, x] = E(s), [w, D] = E(!0), [O, k] = E(null), [A, j] = E({}), [M, N] = E(null), [P, F] = E(null), [I, L] = E(""), [R, z] = E([]), [B, V] = E(""), [H, U] = E([]), [W, G] = E(0), K = T({}), q = T(null), J = T(null);
690
+ C(() => {
691
691
  let e = !1;
692
692
  return i({
693
693
  page: v,
694
694
  pageSize: b,
695
695
  filters: A,
696
- sort: k ?? void 0
696
+ sort: O ?? void 0
697
697
  }).then((t) => {
698
- e || (m((e) => a === "scroll" && v > 0 ? [...e, ...t.data] : t.data), _(t.total), O(!1));
698
+ e || (h((e) => a === "scroll" && v > 0 ? [...e, ...t.data] : t.data), _(t.total), D(!1));
699
699
  }), () => {
700
700
  e = !0;
701
701
  };
@@ -703,34 +703,34 @@ var ee = D`
703
703
  v,
704
704
  b,
705
705
  A,
706
- k,
706
+ O,
707
707
  a,
708
708
  i
709
- ]), C(() => {
710
- a !== "scroll" || !K.current || !q.current || (ie(Array.from(K.current.querySelectorAll(`th:not(.${X}-thScrollbarSpacer)`)).map((e) => e.offsetWidth)), W(q.current.offsetWidth - q.current.clientWidth));
709
+ ]), ee(() => {
710
+ a !== "scroll" || !q.current || !J.current || (U(Array.from(q.current.querySelectorAll(`th:not(.${Z}-thScrollbarSpacer)`)).map((e) => e.offsetWidth)), G(J.current.offsetWidth - J.current.clientWidth));
711
711
  }, [
712
712
  a,
713
713
  e.length,
714
- D
715
- ]), S(() => {
714
+ w
715
+ ]), C(() => {
716
716
  if (!M) return;
717
717
  let e = (e) => {
718
718
  e.target.closest(`[data-popover-key="${M}"]`) || N(null);
719
719
  };
720
720
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
721
721
  }, [M]);
722
- let J = (e) => {
722
+ let Y = (e) => {
723
723
  if (!e.filter) return;
724
724
  if (M === e.key) {
725
725
  N(null), F(null);
726
726
  return;
727
727
  }
728
728
  let t = A[e.key];
729
- e.filter.type === "search" ? L(typeof t == "string" ? t : "") : (z(Array.isArray(t) ? t : []), V("")), F(G.current[e.key] ?? null), N(e.key);
730
- }, Z = (e) => {
729
+ e.filter.type === "search" ? L(typeof t == "string" ? t : "") : (z(Array.isArray(t) ? t : []), V("")), F(K.current[e.key] ?? null), N(e.key);
730
+ }, X = (e) => {
731
731
  if (!e.filter) return;
732
732
  let t = e.filter.type === "search" ? I : R;
733
- O(!0), j((n) => ({
733
+ D(!0), j((n) => ({
734
734
  ...n,
735
735
  [e.key]: t
736
736
  })), y(0), N(null);
@@ -738,7 +738,7 @@ var ee = D`
738
738
  let t = A[e];
739
739
  return t == null ? !1 : Array.isArray(t) ? t.length > 0 : t !== "";
740
740
  }, oe = (e) => {
741
- O(!0), ee((t) => t?.key === e ? {
741
+ D(!0), k((t) => t?.key === e ? {
742
742
  key: e,
743
743
  direction: t.direction === "asc" ? "desc" : "asc"
744
744
  } : {
@@ -746,145 +746,145 @@ var ee = D`
746
746
  direction: "asc"
747
747
  }), y(0);
748
748
  }, se = (e) => {
749
- O(!0), y(e);
749
+ D(!0), y(e);
750
750
  }, ce = (e) => {
751
- O(!0), w(e), y(0);
752
- }, le = x((e) => {
753
- if (a !== "scroll" || D || p.length >= g) return;
751
+ D(!0), x(e), y(0);
752
+ }, le = S((e) => {
753
+ if (a !== "scroll" || w || m.length >= g) return;
754
754
  let { scrollTop: t, scrollHeight: n, clientHeight: r } = e.currentTarget;
755
- n - t - r < 48 && (O(!0), y((e) => e + 1));
755
+ n - t - r < 48 && (D(!0), y((e) => e + 1));
756
756
  }, [
757
757
  a,
758
- D,
759
- p.length,
758
+ w,
759
+ m.length,
760
760
  g
761
- ]), ue = e.length, $ = M ? e.find((e) => e.key === M) : void 0, de = b * 48, fe = !D && p.length === 0, pe = e.map((e) => /* @__PURE__ */ t("th", {
762
- className: [`${X}-th`, e.type === "options" ? `${X}-thOptions` : ""].join(" "),
761
+ ]), ue = e.length, $ = M ? e.find((e) => e.key === M) : void 0, de = b * 48, fe = !w && m.length === 0, pe = e.map((e) => /* @__PURE__ */ t("th", {
762
+ className: [`${Z}-th`, e.type === "options" ? `${Z}-thOptions` : ""].join(" "),
763
763
  style: e.width ? { width: e.width } : void 0,
764
764
  children: /* @__PURE__ */ n("div", {
765
- className: `${X}-thInner`,
766
- "data-testid": `${X}-th-${e.key}`,
765
+ className: `${Z}-thInner`,
766
+ "data-testid": `${Z}-th-${e.key}`,
767
767
  children: [/* @__PURE__ */ t("span", {
768
- className: `${X}-thLabel`,
768
+ className: `${Z}-thLabel`,
769
769
  children: e.label
770
770
  }), e.type !== "options" && /* @__PURE__ */ n("div", {
771
- className: `${X}-thActions`,
771
+ className: `${Z}-thActions`,
772
772
  children: [e.filter && /* @__PURE__ */ t("div", {
773
- className: `${X}-filterContainer`,
773
+ className: `${Z}-filterContainer`,
774
774
  "data-popover-key": e.key,
775
775
  children: /* @__PURE__ */ t("span", {
776
776
  ref: (t) => {
777
- G.current[e.key] = t;
777
+ K.current[e.key] = t;
778
778
  },
779
- children: /* @__PURE__ */ t(h, {
779
+ children: /* @__PURE__ */ t(u, {
780
780
  icon: /* @__PURE__ */ t(o, {
781
781
  name: Q(e.key) ? "filter_alt" : "filter_list",
782
782
  size: "sm",
783
783
  style: { color: Q(e.key) ? "white" : "" }
784
784
  }),
785
- onClick: () => J(e),
786
- "data-testid": `${X}-filterBtn-${e.key}`,
785
+ onClick: () => Y(e),
786
+ "data-testid": `${Z}-filterBtn-${e.key}`,
787
787
  "aria-label": `Filter ${e.label}`
788
788
  })
789
789
  })
790
- }), e.sortable !== !1 && /* @__PURE__ */ t(h, {
790
+ }), e.sortable !== !1 && /* @__PURE__ */ t(u, {
791
791
  icon: /* @__PURE__ */ t(o, {
792
- name: k?.key === e.key ? k.direction === "asc" ? "arrow_upward" : "arrow_downward" : "unfold_more",
792
+ name: O?.key === e.key ? O.direction === "asc" ? "arrow_upward" : "arrow_downward" : "unfold_more",
793
793
  size: "sm",
794
- style: { color: k?.key === e.key ? "white" : "" }
794
+ style: { color: O?.key === e.key ? "white" : "" }
795
795
  }),
796
796
  onClick: () => oe(e.key),
797
- "data-testid": `${X}-sortBtn-${e.key}`,
797
+ "data-testid": `${Z}-sortBtn-${e.key}`,
798
798
  "aria-label": `Sort ${e.label}`
799
799
  })]
800
800
  })]
801
801
  })
802
- }, e.key)), me = D && (a !== "scroll" || p.length === 0) ? /* @__PURE__ */ t(re, {
802
+ }, e.key)), me = w && (a !== "scroll" || m.length === 0) ? /* @__PURE__ */ t(re, {
803
803
  columns: e,
804
804
  pageSize: b
805
805
  }) : fe ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
806
806
  colSpan: ue,
807
- className: `${X}-emptyCell`,
807
+ className: `${Z}-emptyCell`,
808
808
  style: { height: `${de}px` },
809
809
  children: l
810
- }) }) : /* @__PURE__ */ n(r, { children: [p.map((n, r) => /* @__PURE__ */ t("tr", {
811
- className: `${X}-row`,
812
- "data-testid": `${X}-row-${r}`,
810
+ }) }) : /* @__PURE__ */ n(r, { children: [m.map((n, r) => /* @__PURE__ */ t("tr", {
811
+ className: `${Z}-row`,
812
+ "data-testid": `${Z}-row-${r}`,
813
813
  children: e.map((e) => {
814
814
  let i = n[e.key];
815
815
  return /* @__PURE__ */ t("td", {
816
- className: [`${X}-td`, e.type === "options" ? `${X}-tdOptions` : ""].filter(Boolean).join(" "),
817
- "data-testid": `${X}-cell-${e.key}-${r}`,
816
+ className: [`${Z}-td`, e.type === "options" ? `${Z}-tdOptions` : ""].filter(Boolean).join(" "),
817
+ "data-testid": `${Z}-cell-${e.key}-${r}`,
818
818
  children: e.render ? e.render(i, n) : String(i ?? "")
819
819
  }, e.key);
820
820
  })
821
- }, r)), a === "scroll" && D && /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
821
+ }, r)), a === "scroll" && w && /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
822
822
  colSpan: ue,
823
- className: `${X}-loadingMore`,
824
- children: u
823
+ className: `${Z}-loadingMore`,
824
+ children: d
825
825
  }) })] });
826
826
  return /* @__PURE__ */ n("div", {
827
- className: [X, d || ""].join(" "),
828
- css: te(f),
829
- "data-testid": X,
827
+ className: [Z, f || ""].join(" "),
828
+ css: te(p),
829
+ "data-testid": Z,
830
830
  children: [
831
831
  /* @__PURE__ */ t("div", {
832
- className: `${X}-tableContainer`,
832
+ className: `${Z}-tableContainer`,
833
833
  children: a === "scroll" ? /* @__PURE__ */ n(r, { children: [/* @__PURE__ */ n("table", {
834
- className: `${X}-table`,
835
- children: [/* @__PURE__ */ n("colgroup", { children: [e.map((e) => /* @__PURE__ */ t("col", { style: e.width ? { width: e.width } : void 0 }, e.key)), /* @__PURE__ */ t("col", { style: { width: U || 0 } })] }), /* @__PURE__ */ t("thead", {
836
- ref: K,
837
- className: `${X}-thead`,
834
+ className: `${Z}-table`,
835
+ children: [/* @__PURE__ */ n("colgroup", { children: [e.map((e) => /* @__PURE__ */ t("col", { style: e.width ? { width: e.width } : void 0 }, e.key)), /* @__PURE__ */ t("col", { style: { width: W || 0 } })] }), /* @__PURE__ */ t("thead", {
836
+ ref: q,
837
+ className: `${Z}-thead`,
838
838
  children: /* @__PURE__ */ n("tr", {
839
- className: `${X}-headerRow`,
839
+ className: `${Z}-headerRow`,
840
840
  children: [pe, /* @__PURE__ */ t("th", {
841
841
  "aria-hidden": "true",
842
- className: `${X}-thScrollbarSpacer`,
842
+ className: `${Z}-thScrollbarSpacer`,
843
843
  style: { padding: 0 }
844
844
  })]
845
845
  })
846
846
  })]
847
847
  }), /* @__PURE__ */ t("div", {
848
- ref: q,
849
- className: `${X}-bodyContainer`,
848
+ ref: J,
849
+ className: `${Z}-bodyContainer`,
850
850
  style: {
851
851
  overflowY: "auto",
852
852
  maxHeight: `${de}px`
853
853
  },
854
854
  onScroll: le,
855
855
  children: /* @__PURE__ */ n("table", {
856
- className: `${X}-table`,
856
+ className: `${Z}-table`,
857
857
  style: {
858
858
  tableLayout: "fixed",
859
859
  width: "100%"
860
860
  },
861
861
  children: [/* @__PURE__ */ t("colgroup", { children: e.map((e, n) => /* @__PURE__ */ t("col", { style: { width: H[n] === void 0 ? e.width ?? "auto" : H[n] } }, e.key)) }), /* @__PURE__ */ t("tbody", {
862
- className: `${X}-tbody`,
862
+ className: `${Z}-tbody`,
863
863
  children: me
864
864
  })]
865
865
  })
866
866
  })] }) : /* @__PURE__ */ n("table", {
867
- className: `${X}-table`,
867
+ className: `${Z}-table`,
868
868
  children: [/* @__PURE__ */ t("thead", {
869
- className: `${X}-thead`,
869
+ className: `${Z}-thead`,
870
870
  children: /* @__PURE__ */ t("tr", {
871
- className: `${X}-headerRow`,
871
+ className: `${Z}-headerRow`,
872
872
  children: pe
873
873
  })
874
874
  }), /* @__PURE__ */ t("tbody", {
875
- className: `${X}-tbody`,
875
+ className: `${Z}-tbody`,
876
876
  children: me
877
877
  })]
878
878
  })
879
879
  }),
880
- a === "pagination" && /* @__PURE__ */ t(Y, {
880
+ a === "pagination" && /* @__PURE__ */ t(ie, {
881
881
  page: v,
882
882
  total: g,
883
883
  pageSize: b,
884
884
  onPageChange: se,
885
885
  pageSizeOptions: c,
886
886
  onPageSizeChange: ce,
887
- loading: D
887
+ loading: w
888
888
  }),
889
889
  $?.filter && /* @__PURE__ */ t(ne, {
890
890
  filterType: $.filter.type,
@@ -901,7 +901,7 @@ var ee = D`
901
901
  multiSearch: B,
902
902
  onMultiSearchChange: V,
903
903
  onCancel: () => N(null),
904
- onApply: () => Z($),
904
+ onApply: () => X($),
905
905
  onClear: () => {
906
906
  $.filter?.type === "search" ? L("") : (z([]), V(""));
907
907
  },
@@ -909,14 +909,14 @@ var ee = D`
909
909
  })
910
910
  ]
911
911
  });
912
- }, Q = ({ theme: n, variant: r = "default", ...i }) => {
912
+ }, oe = ({ theme: n, variant: r = "default", ...i }) => {
913
913
  let { componentStyles: a } = e([c.DATAGRID], n, r.toUpperCase());
914
- return /* @__PURE__ */ t(Z, {
914
+ return /* @__PURE__ */ t(Q, {
915
915
  ...i,
916
916
  style: a
917
917
  });
918
918
  };
919
919
  //#endregion
920
- export { u as Button, s as Checkbox, v as CheckboxGroup, _ as CheckboxTree, Q as DataGrid, p as DatePicker, o as Icon, h as IconButton, l as Input, Y as Pagination, d as Radio, y as RadioGroup, m as Select, A as Skeleton, f as Slider, g as Switch, b as ThemeProvider, i as darkTheme };
920
+ export { f as Button, s as Checkbox, y as CheckboxGroup, v as CheckboxTree, oe as DataGrid, g as DatePicker, o as Icon, u as IconButton, l as NumberField, ie as Pagination, d as Radio, b as RadioGroup, h as Select, j as Skeleton, p as Slider, _ as Switch, m as TextField, x as ThemeProvider, i as darkTheme };
921
921
 
922
922
  //# sourceMappingURL=index.mjs.map