@kapiuara/ui 0.14.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/README.md +234 -1
  2. package/dist/components/chat/KapiChatList.js +19 -19
  3. package/dist/components/chat/KapiChatThread.js +23 -23
  4. package/dist/components/chat/KapiComposer.js +19 -19
  5. package/dist/components/chat/KapiMessageBubble.js +4 -4
  6. package/dist/components/chat/KapiTypingIndicator.js +4 -4
  7. package/dist/components/closeReason.d.ts +34 -0
  8. package/dist/components/data/KapiBarChart.js +1 -1
  9. package/dist/components/data/KapiDataTable.js +31 -31
  10. package/dist/components/data/KapiEventCalendar.js +78 -78
  11. package/dist/components/data/KapiHeatmap.js +23 -23
  12. package/dist/components/data/KapiLineChart.js +1 -1
  13. package/dist/components/data/KapiPagination.js +4 -4
  14. package/dist/components/data/KapiSparkline.js +1 -1
  15. package/dist/components/data/KapiTable.js +122 -122
  16. package/dist/components/data/KapiTableFilter.js +18 -18
  17. package/dist/components/data/KapiTableRow.js +24 -24
  18. package/dist/components/data/KapiTableToolbar.js +49 -49
  19. package/dist/components/data/chartFrame.js +21 -21
  20. package/dist/components/data/useColumnResize.js +8 -8
  21. package/dist/components/data/useTableSelection.js +8 -8
  22. package/dist/components/display/KapiAnnotation.js +53 -53
  23. package/dist/components/display/KapiComment.js +4 -4
  24. package/dist/components/display/KapiCommentComposer.js +16 -16
  25. package/dist/components/display/KapiFileItem.js +6 -6
  26. package/dist/components/display/KapiFileViewer.js +9 -9
  27. package/dist/components/display/KapiTruncate.js +7 -7
  28. package/dist/components/feedback/KapiAlert.d.ts +2 -1
  29. package/dist/components/feedback/KapiAlert.js +8 -8
  30. package/dist/components/feedback/KapiCountdown.js +8 -8
  31. package/dist/components/feedback/KapiFab.js +31 -31
  32. package/dist/components/feedback/KapiOfflineBanner.js +8 -8
  33. package/dist/components/feedback/KapiToastContainer.js +21 -21
  34. package/dist/components/feedback/KapiTour.d.ts +2 -1
  35. package/dist/components/feedback/KapiTour.js +32 -32
  36. package/dist/components/inputs/KapiAutocomplete.js +14 -14
  37. package/dist/components/inputs/KapiButton.d.ts +17 -1
  38. package/dist/components/inputs/KapiButton.js +41 -25
  39. package/dist/components/inputs/KapiCalendar.js +5 -5
  40. package/dist/components/inputs/KapiCalendarGrid.js +10 -10
  41. package/dist/components/inputs/KapiChecklist.js +71 -71
  42. package/dist/components/inputs/KapiDatePicker.js +28 -28
  43. package/dist/components/inputs/KapiDateRangePicker.js +27 -27
  44. package/dist/components/inputs/KapiFacetedSearch.js +24 -24
  45. package/dist/components/inputs/KapiField.js +14 -14
  46. package/dist/components/inputs/KapiFileUpload.js +27 -27
  47. package/dist/components/inputs/KapiIconButton.d.ts +9 -1
  48. package/dist/components/inputs/KapiIconButton.js +27 -10
  49. package/dist/components/inputs/KapiInput.js +21 -21
  50. package/dist/components/inputs/KapiInputGroup.js +8 -8
  51. package/dist/components/inputs/KapiMaskedInput.js +22 -22
  52. package/dist/components/inputs/KapiNumberStepper.js +12 -12
  53. package/dist/components/inputs/KapiRating.js +1 -1
  54. package/dist/components/inputs/KapiSearchChip.js +8 -8
  55. package/dist/components/inputs/KapiSegmented.js +27 -27
  56. package/dist/components/inputs/KapiSelect.js +166 -166
  57. package/dist/components/inputs/KapiSelectMenu.js +60 -60
  58. package/dist/components/inputs/KapiSlider.js +1 -1
  59. package/dist/components/inputs/KapiSwitch.js +6 -6
  60. package/dist/components/inputs/KapiTagInput.js +22 -22
  61. package/dist/components/inputs/KapiTextarea.js +8 -8
  62. package/dist/components/inputs/ownField.js +4 -4
  63. package/dist/components/layout/KapiAccountMenu.d.ts +2 -1
  64. package/dist/components/layout/KapiAccountMenu.js +51 -51
  65. package/dist/components/layout/KapiContextSlot.js +35 -35
  66. package/dist/components/layout/KapiMasonry.js +6 -6
  67. package/dist/components/layout/KapiNotificationBell.js +60 -60
  68. package/dist/components/layout/KapiPageHeader.js +19 -19
  69. package/dist/components/layout/KapiRail.js +60 -60
  70. package/dist/components/layout/KapiRailAccount.js +9 -9
  71. package/dist/components/layout/KapiRoot.js +21 -21
  72. package/dist/components/layout/KapiScrollArea.js +11 -11
  73. package/dist/components/layout/KapiShell.js +12 -12
  74. package/dist/components/locale/KapiLocaleProvider.js +13 -13
  75. package/dist/components/navigation/KapiAccordion.js +12 -12
  76. package/dist/components/navigation/KapiBreadcrumb.js +11 -11
  77. package/dist/components/navigation/KapiCollapsiblePanel.js +23 -23
  78. package/dist/components/navigation/KapiContextPanel.js +76 -76
  79. package/dist/components/navigation/KapiFilterChips.js +9 -9
  80. package/dist/components/navigation/KapiNavBadge.d.ts +4 -2
  81. package/dist/components/navigation/KapiNavBadge.js +11 -10
  82. package/dist/components/navigation/KapiPanelGroup.js +25 -25
  83. package/dist/components/navigation/KapiSteps.js +4 -4
  84. package/dist/components/navigation/KapiTabs.d.ts +4 -1
  85. package/dist/components/navigation/KapiTabs.js +18 -17
  86. package/dist/components/navigation/KapiTree.js +72 -72
  87. package/dist/components/navigation/KapiWizard.d.ts +2 -1
  88. package/dist/components/navigation/KapiWizard.js +30 -30
  89. package/dist/components/overlays/KapiCanvasForm.d.ts +6 -2
  90. package/dist/components/overlays/KapiCanvasForm.js +12 -12
  91. package/dist/components/overlays/KapiCommandPalette.d.ts +2 -1
  92. package/dist/components/overlays/KapiCommandPalette.js +23 -23
  93. package/dist/components/overlays/KapiConfirm.d.ts +2 -1
  94. package/dist/components/overlays/KapiConfirm.js +12 -12
  95. package/dist/components/overlays/KapiContextMenu.d.ts +2 -1
  96. package/dist/components/overlays/KapiContextMenu.js +15 -15
  97. package/dist/components/overlays/KapiDialogHost.js +22 -22
  98. package/dist/components/overlays/KapiLoading.js +16 -16
  99. package/dist/components/overlays/KapiMenuButton.js +12 -12
  100. package/dist/components/overlays/KapiModal.d.ts +2 -1
  101. package/dist/components/overlays/KapiModal.js +28 -28
  102. package/dist/components/overlays/KapiOffcanvas.d.ts +3 -2
  103. package/dist/components/overlays/KapiOffcanvas.js +63 -63
  104. package/dist/components/overlays/KapiOffcanvasStack.js +38 -38
  105. package/dist/components/overlays/KapiPhotoView.js +14 -14
  106. package/dist/components/overlays/KapiPopover.d.ts +2 -1
  107. package/dist/components/overlays/KapiPopover.js +7 -7
  108. package/dist/components/overlays/KapiShapeSheet.js +17 -17
  109. package/dist/components/overlays/KapiSplitModal.js +29 -29
  110. package/dist/components/overlays/KapiTooltip.js +20 -20
  111. package/dist/components/overlays/menuList.js +60 -60
  112. package/dist/components/renderSlot.d.ts +27 -0
  113. package/dist/components/renderSlot.js +23 -0
  114. package/dist/hooks/portalRoot.js +6 -6
  115. package/dist/index.d.ts +2 -0
  116. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import "#kapi-css/components/data/KapiTable.css";
3
- import { useKapiLocale as e, useLabels as t } from "../locale/KapiLocaleProvider.js";
4
- import { joinClasses as n } from "../rootProps.js";
3
+ import { joinClasses as e } from "../rootProps.js";
4
+ import { useKapiLocale as t, useLabels as n } from "../locale/KapiLocaleProvider.js";
5
5
  import { useControllableState as r } from "../../hooks/useControllableState.js";
6
6
  import { winOf as i } from "../../hooks/ownerDocument.js";
7
7
  import { computeStickyOffsets as ee, computeStickyRightOffsets as te, effectiveColumnWidth as ne, firstRightStickyIndex as re, lastStickyIndex as ie, nextSortState as ae, sortRowsByColumn as oe, stickySideOf as a, tableWrapClass as o } from "./tableLogic.js";
@@ -12,20 +12,20 @@ import { actColClass as l, ariaSortOf as u, bodyCell as d, cellClass as f, colum
12
12
  import { useRowKeyWarning as le } from "./useRowKeyWarning.js";
13
13
  import { useTableEdges as ue } from "./useTableEdges.js";
14
14
  import { isRowActivationKey as de, mergeRowProps as fe, shouldFireRowClick as pe } from "./rowClickLogic.js";
15
- import { jsx as _, jsxs as v } from "react/jsx-runtime";
16
- import { useLayoutEffect as me, useMemo as y, useRef as b, useState as he } from "react";
15
+ import { useLayoutEffect as me, useMemo as _, useRef as v, useState as he } from "react";
16
+ import { jsx as y, jsxs as b } from "react/jsx-runtime";
17
17
  //#region src/components/data/KapiDataTable.tsx
18
18
  var x = {};
19
19
  function S({ columns: S, rows: C, keyField: w = "id", ref: T, maxHeight: E = "58vh", fill: D = !1, card: O = !1, density: k = "default", rowHover: A = !1, mobileCards: j = !1, labels: M, sort: N, defaultSort: P = null, onSortChange: F, manualSort: I = !1, loading: L = !1, loadingRows: R = 5, loadingMessage: z, emptyMessage: B, onCopy: ge, actions: V, onRowClick: H, getRowProps: _e, className: ve, style: ye, id: be }) {
20
- let U = t("table", c, M);
20
+ let U = n("table", c, M);
21
21
  le("KapiDataTable", C, w);
22
- let W = e(), [G, xe] = r(N, P, F), Se = (e) => xe(ae(G, e)), K = y(() => I ? C : oe(C, S, G, W), [
22
+ let W = t(), [G, xe] = r(N, P, F), Se = (e) => xe(ae(G, e)), K = _(() => I ? C : oe(C, S, G, W), [
23
23
  I,
24
24
  C,
25
25
  S,
26
26
  G,
27
27
  W
28
- ]), q = !!V, J = S.some((e) => a(e.sticky) === "right"), Y = b(null), [X, Ce] = he(0);
28
+ ]), q = !!V, J = S.some((e) => a(e.sticky) === "right"), Y = v(null), [X, Ce] = he(0);
29
29
  me(() => {
30
30
  let e = Y.current;
31
31
  if (!e || !J) return;
@@ -37,7 +37,7 @@ function S({ columns: S, rows: C, keyField: w = "id", ref: T, maxHeight: E = "58
37
37
  let n = new ResizeObserver(t);
38
38
  return n.observe(e), () => n.disconnect();
39
39
  }, [J, q]);
40
- let Z = y(() => {
40
+ let Z = _(() => {
41
41
  let e = S.map((e) => ({
42
42
  sticky: e.sticky,
43
43
  width: ne(e, x)
@@ -52,7 +52,7 @@ function S({ columns: S, rows: C, keyField: w = "id", ref: T, maxHeight: E = "58
52
52
  S,
53
53
  q,
54
54
  X
55
- ]), Q = b(null), { cortaDerecha: we, cortaIzquierda: Te, medirBordes: Ee } = ue(Q, S), $ = S.length + +!!q, De = B === void 0 ? U.empty : B, Oe = z === void 0 ? U.loading : z, ke = (e) => H ? {
55
+ ]), Q = v(null), { cortaDerecha: we, cortaIzquierda: Te, medirBordes: Ee } = ue(Q, S), $ = S.length + +!!q, De = B === void 0 ? U.empty : B, Oe = z === void 0 ? U.loading : z, ke = (e) => H ? {
56
56
  className: "is-clickable",
57
57
  tabIndex: 0,
58
58
  onClick: (t) => {
@@ -69,10 +69,10 @@ function S({ columns: S, rows: C, keyField: w = "id", ref: T, maxHeight: E = "58
69
69
  isComposing: t.nativeEvent.isComposing
70
70
  }) && (t.preventDefault(), H(e, t));
71
71
  }
72
- } : {}, Ae = Array.from({ length: R }, (e, t) => /* @__PURE__ */ v("tr", {
72
+ } : {}, Ae = Array.from({ length: R }, (e, t) => /* @__PURE__ */ b("tr", {
73
73
  className: "kapi-table-skrow",
74
74
  "aria-hidden": !0,
75
- children: [S.map((e, n) => /* @__PURE__ */ _("td", {
75
+ children: [S.map((e, n) => /* @__PURE__ */ y("td", {
76
76
  "data-col": e.key,
77
77
  className: f(e, n, Z),
78
78
  style: {
@@ -80,9 +80,9 @@ function S({ columns: S, rows: C, keyField: w = "id", ref: T, maxHeight: E = "58
80
80
  ...m(e, "td", x)
81
81
  },
82
82
  children: ce(e, n, t)
83
- }, e.key)), q && /* @__PURE__ */ _("td", {
83
+ }, e.key)), q && /* @__PURE__ */ y("td", {
84
84
  className: l(Z),
85
- children: /* @__PURE__ */ _(s, {
85
+ children: /* @__PURE__ */ y(s, {
86
86
  width: 28,
87
87
  height: 14,
88
88
  radius: 6,
@@ -90,12 +90,12 @@ function S({ columns: S, rows: C, keyField: w = "id", ref: T, maxHeight: E = "58
90
90
  })
91
91
  })]
92
92
  }, `sk-${t}`));
93
- return /* @__PURE__ */ _("div", {
93
+ return /* @__PURE__ */ y("div", {
94
94
  ref: T,
95
95
  id: be,
96
96
  style: ye,
97
- className: n("kapi-table-shell", O && "kapi-table-shell--card", D && "kapi-table-shell--fill", j && "kapi-table-shell--cards", ve),
98
- children: /* @__PURE__ */ _("div", {
97
+ className: e("kapi-table-shell", O && "kapi-table-shell--card", D && "kapi-table-shell--fill", j && "kapi-table-shell--cards", ve),
98
+ children: /* @__PURE__ */ y("div", {
99
99
  ref: Q,
100
100
  className: o({
101
101
  cortaDerecha: we,
@@ -105,30 +105,30 @@ function S({ columns: S, rows: C, keyField: w = "id", ref: T, maxHeight: E = "58
105
105
  tabIndex: 0,
106
106
  style: D ? void 0 : { maxHeight: E },
107
107
  onScroll: (e) => Ee(e.currentTarget),
108
- children: /* @__PURE__ */ v("table", {
109
- className: n("kapi-table2", k === "card" && "kapi-table2--card", A && "kapi-table2--hover"),
110
- children: [/* @__PURE__ */ _("thead", { children: /* @__PURE__ */ v("tr", { children: [S.map((e, t) => /* @__PURE__ */ _("th", {
111
- "data-col": e.key,
112
- className: n(f(e, t, Z), e.sortable && "is-sortable"),
113
- "aria-sort": u(e, G),
108
+ children: /* @__PURE__ */ b("table", {
109
+ className: e("kapi-table2", k === "card" && "kapi-table2--card", A && "kapi-table2--hover"),
110
+ children: [/* @__PURE__ */ y("thead", { children: /* @__PURE__ */ b("tr", { children: [S.map((t, n) => /* @__PURE__ */ y("th", {
111
+ "data-col": t.key,
112
+ className: e(f(t, n, Z), t.sortable && "is-sortable"),
113
+ "aria-sort": u(t, G),
114
114
  style: {
115
- ...g(t, Z),
116
- ...m(e, "th", x),
117
- textAlign: p(e.align)
115
+ ...g(n, Z),
116
+ ...m(t, "th", x),
117
+ textAlign: p(t.align)
118
118
  },
119
- children: se(e, G, Se, U)
120
- }, e.key)), q && /* @__PURE__ */ _("th", {
119
+ children: se(t, G, Se, U)
120
+ }, t.key)), q && /* @__PURE__ */ y("th", {
121
121
  ref: Y,
122
122
  className: l(Z),
123
123
  children: U.actions
124
- })] }) }), /* @__PURE__ */ v("tbody", { children: [
124
+ })] }) }), /* @__PURE__ */ b("tbody", { children: [
125
125
  L && (R > 0 ? Ae : h($, Oe, !0)),
126
126
  !L && K.length === 0 && h($, De),
127
- !L && K.map((e, t) => /* @__PURE__ */ v("tr", {
127
+ !L && K.map((e, t) => /* @__PURE__ */ b("tr", {
128
128
  ...fe(_e?.(e, t), ke(e)),
129
- children: [S.map((t, n) => d(t, n, e, Z, x, U, ge)), q && /* @__PURE__ */ _("td", {
129
+ children: [S.map((t, n) => d(t, n, e, Z, x, U, ge)), q && /* @__PURE__ */ y("td", {
130
130
  className: l(Z),
131
- children: /* @__PURE__ */ _("div", {
131
+ children: /* @__PURE__ */ y("div", {
132
132
  className: "kapi-actcol__in",
133
133
  children: V?.(e)
134
134
  })
@@ -1,14 +1,14 @@
1
1
  "use client";
2
2
  import "#kapi-css/components/data/KapiEventCalendar.css";
3
- import { useKapiLocale as e, useKapiWeekStart as t, useLabels as n } from "../locale/KapiLocaleProvider.js";
4
- import { joinClasses as r } from "../rootProps.js";
3
+ import { joinClasses as e } from "../rootProps.js";
4
+ import { useKapiLocale as t, useKapiWeekStart as n, useLabels as r } from "../locale/KapiLocaleProvider.js";
5
5
  import { calendarNames as i, monthTitle as a, sameDay as o, weekdayOrder as s } from "../inputs/datePickerLogic.js";
6
6
  import { KapiSegmented as c } from "../inputs/KapiSegmented.js";
7
7
  import { KapiPopover as l } from "../overlays/KapiPopover.js";
8
8
  import { aDia as u, correrMes as d, diasConEventos as f, duracionEnDias as p, eventosDelDia as m, eventosDelMes as h, semanasDelMes as g, visiblesYResto as _ } from "./eventCalendarLogic.js";
9
9
  /* empty css */
10
- import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
11
- import { useRef as x, useState as S } from "react";
10
+ import { useRef as v, useState as y } from "react";
11
+ import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
12
12
  import { ChevronLeft as ee, ChevronRight as te } from "lucide-react";
13
13
  //#region src/components/data/KapiEventCalendar.tsx
14
14
  var C = {
@@ -24,11 +24,11 @@ var C = {
24
24
  moreTitle: "Eventos del {date}",
25
25
  range: "del {from} al {to}"
26
26
  }, w = (e) => `${e.getDate()}/${e.getMonth() + 1}`, T = ({ events: T, month: E, onMonthChange: D, view: O, defaultView: ne = "month", onViewChange: re, maxPerDay: ie = 2, onEventClick: k, labels: A, weekStartsOn: j, className: M, ref: N, ...P }) => {
27
- let F = n("eventCalendar", C, A), I = i(e()), L = t(j), R = s(I.weekdays, L), z = s(I.weekdayNames, L), [B, V] = S(() => E ?? /* @__PURE__ */ new Date()), H = E ?? B, U = (e) => {
27
+ let F = r("eventCalendar", C, A), I = i(t()), L = n(j), R = s(I.weekdays, L), z = s(I.weekdayNames, L), [B, V] = y(() => E ?? /* @__PURE__ */ new Date()), H = E ?? B, U = (e) => {
28
28
  E === void 0 && V(e), D?.(e);
29
- }, [W, G] = S(ne), K = O ?? W, q = (e) => {
29
+ }, [W, G] = y(ne), K = O ?? W, q = (e) => {
30
30
  O === void 0 && G(e), re?.(e);
31
- }, [J, Y] = S(null), X = x(null), ae = /* @__PURE__ */ new Date(), oe = [
31
+ }, [J, Y] = y(null), X = v(null), ae = /* @__PURE__ */ new Date(), oe = [
32
32
  {
33
33
  id: "month",
34
34
  label: F.monthView
@@ -41,182 +41,182 @@ var C = {
41
41
  id: "year",
42
42
  label: F.yearView
43
43
  }
44
- ], Z = (e) => ({ "--kapi-evcal-color": `var(--kapi-series-${e.slot ?? 1})` }), Q = ({ e, lista: t, sigue: n }) => {
45
- let i = p(e), a = /* @__PURE__ */ b(v, { children: [
46
- /* @__PURE__ */ y("span", {
44
+ ], Z = (e) => ({ "--kapi-evcal-color": `var(--kapi-series-${e.slot ?? 1})` }), Q = ({ e: t, lista: n, sigue: r }) => {
45
+ let i = p(t), a = /* @__PURE__ */ S(b, { children: [
46
+ /* @__PURE__ */ x("span", {
47
47
  className: "kapi-evcal__dot",
48
48
  "aria-hidden": "true"
49
49
  }),
50
- /* @__PURE__ */ y("span", {
50
+ /* @__PURE__ */ x("span", {
51
51
  className: "kapi-evcal__ev-title",
52
- children: e.title
52
+ children: t.title
53
53
  }),
54
- t && i > 1 && /* @__PURE__ */ y("span", {
54
+ n && i > 1 && /* @__PURE__ */ x("span", {
55
55
  className: "kapi-evcal__ev-range",
56
- children: F.range.replace("{from}", w(e.start)).replace("{to}", w(e.end ?? e.start))
56
+ children: F.range.replace("{from}", w(t.start)).replace("{to}", w(t.end ?? t.start))
57
57
  }),
58
- t && e.detail && /* @__PURE__ */ y("span", {
58
+ n && t.detail && /* @__PURE__ */ x("span", {
59
59
  className: "kapi-evcal__ev-detail",
60
- children: e.detail
60
+ children: t.detail
61
61
  })
62
62
  ] });
63
- return k ? /* @__PURE__ */ y("button", {
63
+ return k ? /* @__PURE__ */ x("button", {
64
64
  type: "button",
65
- className: r("kapi-evcal__ev", t && "kapi-evcal__ev--list", n && "kapi-evcal__ev--sigue"),
66
- style: Z(e),
67
- onClick: () => k(e),
68
- "aria-label": n ? e.title : void 0,
65
+ className: e("kapi-evcal__ev", n && "kapi-evcal__ev--list", r && "kapi-evcal__ev--sigue"),
66
+ style: Z(t),
67
+ onClick: () => k(t),
68
+ "aria-label": r ? t.title : void 0,
69
69
  children: a
70
- }) : /* @__PURE__ */ y("span", {
71
- className: r("kapi-evcal__ev", t && "kapi-evcal__ev--list"),
72
- style: Z(e),
70
+ }) : /* @__PURE__ */ x("span", {
71
+ className: e("kapi-evcal__ev", n && "kapi-evcal__ev--list"),
72
+ style: Z(t),
73
73
  children: a
74
74
  });
75
75
  }, $ = h(T, H), se = f(T, H.getFullYear());
76
- return /* @__PURE__ */ b("div", {
76
+ return /* @__PURE__ */ S("div", {
77
77
  ...P,
78
78
  ref: N,
79
- className: r("kapi-evcal", M),
79
+ className: e("kapi-evcal", M),
80
80
  children: [
81
- /* @__PURE__ */ b("div", {
81
+ /* @__PURE__ */ S("div", {
82
82
  className: "kapi-evcal__head",
83
- children: [/* @__PURE__ */ b("div", {
83
+ children: [/* @__PURE__ */ S("div", {
84
84
  className: "kapi-evcal__nav",
85
85
  children: [
86
- /* @__PURE__ */ y("button", {
86
+ /* @__PURE__ */ x("button", {
87
87
  type: "button",
88
88
  className: "kapi-btn kapi-btn--icon",
89
89
  onClick: () => U(d(H, K === "year" ? -12 : -1)),
90
90
  "aria-label": F.prev,
91
- children: /* @__PURE__ */ y(ee, {
91
+ children: /* @__PURE__ */ x(ee, {
92
92
  className: "kapi-flip-rtl",
93
93
  size: 16,
94
94
  strokeWidth: 2,
95
95
  "aria-hidden": "true"
96
96
  })
97
97
  }),
98
- /* @__PURE__ */ y("button", {
98
+ /* @__PURE__ */ x("button", {
99
99
  type: "button",
100
100
  className: "kapi-btn kapi-btn--icon",
101
101
  onClick: () => U(d(H, K === "year" ? 12 : 1)),
102
102
  "aria-label": F.next,
103
- children: /* @__PURE__ */ y(te, {
103
+ children: /* @__PURE__ */ x(te, {
104
104
  className: "kapi-flip-rtl",
105
105
  size: 16,
106
106
  strokeWidth: 2,
107
107
  "aria-hidden": "true"
108
108
  })
109
109
  }),
110
- /* @__PURE__ */ y("h3", {
110
+ /* @__PURE__ */ x("h3", {
111
111
  className: "kapi-evcal__title",
112
112
  "aria-live": "polite",
113
113
  children: K === "year" ? String(H.getFullYear()) : a(H, I.months)
114
114
  })
115
115
  ]
116
- }), /* @__PURE__ */ y(c, {
116
+ }), /* @__PURE__ */ x(c, {
117
117
  items: oe,
118
118
  value: K,
119
119
  onChange: q,
120
120
  "aria-label": F.view
121
121
  })]
122
122
  }),
123
- K === "month" ? /* @__PURE__ */ b("div", {
123
+ K === "month" ? /* @__PURE__ */ S("div", {
124
124
  className: "kapi-evcal__grid",
125
125
  role: "table",
126
126
  "aria-label": a(H, I.months),
127
- children: [/* @__PURE__ */ y("div", {
127
+ children: [/* @__PURE__ */ x("div", {
128
128
  className: "kapi-evcal__row kapi-evcal__row--head",
129
129
  role: "row",
130
- children: R.map((e, t) => /* @__PURE__ */ y("div", {
130
+ children: R.map((e, t) => /* @__PURE__ */ x("div", {
131
131
  className: "kapi-evcal__wd",
132
132
  role: "columnheader",
133
- children: /* @__PURE__ */ y("abbr", {
133
+ children: /* @__PURE__ */ x("abbr", {
134
134
  title: z[t],
135
135
  children: e
136
136
  })
137
137
  }, t))
138
- }), g(H, L).map((e) => /* @__PURE__ */ y("div", {
138
+ }), g(H, L).map((t) => /* @__PURE__ */ x("div", {
139
139
  className: "kapi-evcal__row",
140
140
  role: "row",
141
- children: e.map((e) => {
142
- let t = m(T, e.date), { visibles: n, resto: i } = _(t, ie), a = e.date.toISOString();
143
- return /* @__PURE__ */ b("div", {
141
+ children: t.map((t) => {
142
+ let n = m(T, t.date), { visibles: r, resto: i } = _(n, ie), a = t.date.toISOString();
143
+ return /* @__PURE__ */ S("div", {
144
144
  role: "cell",
145
- className: r("kapi-evcal__day", e.out && "is-out", o(e.date, ae) && "is-today"),
145
+ className: e("kapi-evcal__day", t.out && "is-out", o(t.date, ae) && "is-today"),
146
146
  children: [
147
- /* @__PURE__ */ y("span", {
147
+ /* @__PURE__ */ x("span", {
148
148
  className: "kapi-evcal__daynum",
149
- children: e.day
149
+ children: t.day
150
150
  }),
151
- n.map((t) => /* @__PURE__ */ y(Q, {
152
- e: t,
153
- sigue: u(t.start) < u(e.date) && e.date.getDay() !== L
154
- }, t.id)),
155
- i > 0 && /* @__PURE__ */ y("button", {
151
+ r.map((e) => /* @__PURE__ */ x(Q, {
152
+ e,
153
+ sigue: u(e.start) < u(t.date) && t.date.getDay() !== L
154
+ }, e.id)),
155
+ i > 0 && /* @__PURE__ */ x("button", {
156
156
  type: "button",
157
157
  className: "kapi-evcal__more",
158
- onClick: (t) => {
159
- X.current = t.currentTarget, Y(e.date);
158
+ onClick: (e) => {
159
+ X.current = e.currentTarget, Y(t.date);
160
160
  },
161
161
  children: F.more.replace("{n}", String(i))
162
162
  })
163
163
  ]
164
164
  }, a);
165
165
  })
166
- }, e[0].date.toISOString()))]
167
- }) : K === "year" ? /* @__PURE__ */ y("div", {
166
+ }, t[0].date.toISOString()))]
167
+ }) : K === "year" ? /* @__PURE__ */ x("div", {
168
168
  className: "kapi-evcal__year",
169
- children: Array.from({ length: 12 }, (e, t) => {
170
- let n = new Date(H.getFullYear(), t, 1);
171
- return /* @__PURE__ */ b("div", {
169
+ children: Array.from({ length: 12 }, (t, n) => {
170
+ let r = new Date(H.getFullYear(), n, 1);
171
+ return /* @__PURE__ */ S("div", {
172
172
  className: "kapi-evcal__mini",
173
- children: [/* @__PURE__ */ y("button", {
173
+ children: [/* @__PURE__ */ x("button", {
174
174
  type: "button",
175
175
  className: "kapi-evcal__mini-title",
176
176
  onClick: () => {
177
- U(n), q("month");
177
+ U(r), q("month");
178
178
  },
179
- children: I.months[t]
180
- }), /* @__PURE__ */ y("div", {
179
+ children: I.months[n]
180
+ }), /* @__PURE__ */ x("div", {
181
181
  className: "kapi-evcal__mini-grid",
182
- children: g(n, L).flat().map((e) => {
183
- let t = e.out ? void 0 : se.get(u(e.date));
184
- return /* @__PURE__ */ y("span", {
185
- className: r("kapi-evcal__mini-day", e.out && "is-out", t && "has-events"),
186
- style: t ? { "--kapi-evcal-color": `var(--kapi-series-${t.slot})` } : void 0,
187
- children: e.out ? "" : e.day
188
- }, e.date.toISOString());
182
+ children: g(r, L).flat().map((t) => {
183
+ let n = t.out ? void 0 : se.get(u(t.date));
184
+ return /* @__PURE__ */ x("span", {
185
+ className: e("kapi-evcal__mini-day", t.out && "is-out", n && "has-events"),
186
+ style: n ? { "--kapi-evcal-color": `var(--kapi-series-${n.slot})` } : void 0,
187
+ children: t.out ? "" : t.day
188
+ }, t.date.toISOString());
189
189
  })
190
190
  })]
191
- }, t);
191
+ }, n);
192
192
  })
193
- }) : $.length === 0 ? /* @__PURE__ */ y("p", {
193
+ }) : $.length === 0 ? /* @__PURE__ */ x("p", {
194
194
  className: "kapi-evcal__empty kapi-muted",
195
195
  children: F.empty
196
- }) : /* @__PURE__ */ y("ul", {
196
+ }) : /* @__PURE__ */ x("ul", {
197
197
  className: "kapi-evcal__list",
198
- children: $.map((e) => /* @__PURE__ */ b("li", {
198
+ children: $.map((e) => /* @__PURE__ */ S("li", {
199
199
  className: "kapi-evcal__li",
200
- children: [/* @__PURE__ */ y("span", {
200
+ children: [/* @__PURE__ */ x("span", {
201
201
  className: "kapi-evcal__li-date",
202
202
  children: w(e.start)
203
- }), /* @__PURE__ */ y(Q, {
203
+ }), /* @__PURE__ */ x(Q, {
204
204
  e,
205
205
  lista: !0
206
206
  })]
207
207
  }, e.id))
208
208
  }),
209
- J && /* @__PURE__ */ y(l, {
209
+ J && /* @__PURE__ */ x(l, {
210
210
  open: !0,
211
211
  anchorRef: X,
212
212
  onClose: () => Y(null),
213
213
  "aria-label": F.moreTitle.replace("{date}", w(J)),
214
- children: /* @__PURE__ */ b("div", {
214
+ children: /* @__PURE__ */ S("div", {
215
215
  className: "kapi-evcal__pop",
216
- children: [/* @__PURE__ */ y("p", {
216
+ children: [/* @__PURE__ */ x("p", {
217
217
  className: "kapi-evcal__pop-title",
218
218
  children: F.moreTitle.replace("{date}", w(J))
219
- }), m(T, J).map((e) => /* @__PURE__ */ y(Q, {
219
+ }), m(T, J).map((e) => /* @__PURE__ */ x(Q, {
220
220
  e,
221
221
  lista: !0
222
222
  }, e.id))]
@@ -7,8 +7,8 @@ import { KapiSegmented as i } from "../inputs/KapiSegmented.js";
7
7
  import { useChartTitleId as a, useChartView as o } from "./chartFrame.js";
8
8
  import { heatLegendRanges as s, heatMax as c, heatStep as l } from "./heatmapLogic.js";
9
9
  /* empty css */
10
- import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
11
- import { Fragment as p } from "react";
10
+ import { Fragment as u } from "react";
11
+ import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
12
12
  //#region src/components/data/KapiHeatmap.tsx
13
13
  var m = {
14
14
  chartView: "Mapa",
@@ -22,19 +22,19 @@ var m = {
22
22
  }, h = (e) => ({ "--kapi-chart-slot": e > 0 ? `var(--kapi-seq-${e})` : "transparent" });
23
23
  function g({ rows: g, columns: _, values: v, title: y, max: b, view: x, defaultView: S = "chart", onViewChange: C, labels: w, className: T, ref: E, ...D }) {
24
24
  let O = e(), k = t("heatmap", m, w), A = a(), { current: j, setView: M } = o(x, S, C), N = b !== void 0 && b > 0 ? b : c(v), P = g.length === 0 || _.length === 0, F = (e, t) => v[e]?.[t], I = k.summary.replace("{rows}", String(g.length)).replace("{columns}", String(_.length));
25
- return /* @__PURE__ */ f("div", {
25
+ return /* @__PURE__ */ p("div", {
26
26
  ...D,
27
27
  ref: E,
28
28
  className: ["kapi-heatmap", T].filter(Boolean).join(" "),
29
29
  role: "group",
30
30
  ...y ? { "aria-labelledby": A } : {},
31
- children: [/* @__PURE__ */ f("div", {
31
+ children: [/* @__PURE__ */ p("div", {
32
32
  className: "kapi-heatmap__head",
33
- children: [y ? /* @__PURE__ */ d("div", {
33
+ children: [y ? /* @__PURE__ */ f("div", {
34
34
  className: "kapi-heatmap__title",
35
35
  id: A,
36
36
  children: y
37
- }) : null, /* @__PURE__ */ d(i, {
37
+ }) : null, /* @__PURE__ */ f(i, {
38
38
  "aria-label": k.view,
39
39
  items: [{
40
40
  id: "chart",
@@ -46,52 +46,52 @@ function g({ rows: g, columns: _, values: v, title: y, max: b, view: x, defaultV
46
46
  value: j,
47
47
  onChange: M
48
48
  })]
49
- }), P ? /* @__PURE__ */ d("p", {
49
+ }), P ? /* @__PURE__ */ f("p", {
50
50
  className: "kapi-heatmap__empty kapi-muted",
51
51
  children: k.empty
52
- }) : j === "table" ? /* @__PURE__ */ d("div", {
52
+ }) : j === "table" ? /* @__PURE__ */ f("div", {
53
53
  className: "kapi-heatmap__tablewrap",
54
- children: /* @__PURE__ */ f("table", {
54
+ children: /* @__PURE__ */ p("table", {
55
55
  className: "kapi-heatmap__table",
56
- children: [/* @__PURE__ */ d("thead", { children: /* @__PURE__ */ f("tr", { children: [/* @__PURE__ */ d("th", {
56
+ children: [/* @__PURE__ */ f("thead", { children: /* @__PURE__ */ p("tr", { children: [/* @__PURE__ */ f("th", {
57
57
  scope: "col",
58
58
  children: k.rowHeader
59
- }), _.map((e, t) => /* @__PURE__ */ d("th", {
59
+ }), _.map((e, t) => /* @__PURE__ */ f("th", {
60
60
  scope: "col",
61
61
  children: e
62
- }, `${e}-${t}`))] }) }), /* @__PURE__ */ d("tbody", { children: g.map((e, t) => /* @__PURE__ */ f("tr", { children: [/* @__PURE__ */ d("th", {
62
+ }, `${e}-${t}`))] }) }), /* @__PURE__ */ f("tbody", { children: g.map((e, t) => /* @__PURE__ */ p("tr", { children: [/* @__PURE__ */ f("th", {
63
63
  scope: "row",
64
64
  children: e
65
65
  }), _.map((e, r) => {
66
66
  let i = F(t, r);
67
- return /* @__PURE__ */ d("td", { children: i === void 0 || !Number.isFinite(i) ? /* @__PURE__ */ d("span", {
67
+ return /* @__PURE__ */ f("td", { children: i === void 0 || !Number.isFinite(i) ? /* @__PURE__ */ f("span", {
68
68
  className: "kapi-muted",
69
69
  children: k.noData
70
70
  }) : n(i, O) }, `${e}-${r}`);
71
71
  })] }, `${e}-${t}`)) })]
72
72
  })
73
- }) : /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", {
73
+ }) : /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("div", {
74
74
  className: "kapi-heatmap__plot",
75
75
  role: "img",
76
76
  "aria-label": I,
77
- children: /* @__PURE__ */ f("div", {
77
+ children: /* @__PURE__ */ p("div", {
78
78
  className: "kapi-heatmap__grid",
79
79
  style: { "--kapi-heatmap-cols": _.length },
80
80
  children: [
81
- /* @__PURE__ */ d("span", { className: "kapi-heatmap__corner" }),
82
- _.map((e, t) => /* @__PURE__ */ d("span", {
81
+ /* @__PURE__ */ f("span", { className: "kapi-heatmap__corner" }),
82
+ _.map((e, t) => /* @__PURE__ */ f("span", {
83
83
  className: "kapi-heatmap__colhead",
84
84
  children: e
85
85
  }, `col-${e}-${t}`)),
86
- g.map((e, t) => /* @__PURE__ */ f(p, { children: [/* @__PURE__ */ d("span", {
86
+ g.map((e, t) => /* @__PURE__ */ p(u, { children: [/* @__PURE__ */ f("span", {
87
87
  className: "kapi-heatmap__rowhead",
88
88
  children: e
89
89
  }), _.map((i, a) => {
90
90
  let o = F(t, a), s = o === void 0 ? 0 : l(o, N), c = o === void 0 || !Number.isFinite(o) ? k.noData : n(o, O);
91
- return /* @__PURE__ */ d(r, {
91
+ return /* @__PURE__ */ f(r, {
92
92
  label: `${e} · ${i}: ${c}`,
93
93
  className: "kapi-heatmap__cellwrap",
94
- children: /* @__PURE__ */ d("span", {
94
+ children: /* @__PURE__ */ f("span", {
95
95
  className: `kapi-heatmap__cell${s === 0 ? " kapi-heatmap__cell--empty" : ""}`,
96
96
  style: h(s)
97
97
  })
@@ -99,13 +99,13 @@ function g({ rows: g, columns: _, values: v, title: y, max: b, view: x, defaultV
99
99
  })] }, `row-${e}-${t}`))
100
100
  ]
101
101
  })
102
- }), /* @__PURE__ */ d("ul", {
102
+ }), /* @__PURE__ */ f("ul", {
103
103
  className: "kapi-heatmap__legend",
104
104
  "aria-label": k.legend,
105
- children: s(N).map(([e, t], r) => /* @__PURE__ */ f("li", {
105
+ children: s(N).map(([e, t], r) => /* @__PURE__ */ p("li", {
106
106
  className: "kapi-heatmap__legenditem",
107
107
  children: [
108
- /* @__PURE__ */ d("span", {
108
+ /* @__PURE__ */ f("span", {
109
109
  className: "kapi-heatmap__swatch",
110
110
  style: h(r + 1)
111
111
  }),
@@ -7,8 +7,8 @@ import { KapiChartFrame as r, chartSummary as i, chartVars as a, useChartLabels
7
7
  import { barHeight as u, barScale as d, barTickLabel as f } from "./barChartLogic.js";
8
8
  import { areaPath as p, lineEndpoint as m, linePath as h, linePoints as g } from "./lineChartLogic.js";
9
9
  /* empty css */
10
- import { jsx as _, jsxs as v } from "react/jsx-runtime";
11
10
  import "react";
11
+ import { jsx as _, jsxs as v } from "react/jsx-runtime";
12
12
  //#region src/components/data/KapiLineChart.tsx
13
13
  var y = 4;
14
14
  function b({ categories: b, series: x, title: S, tickCount: C = 4, area: w = !1, unit: T, view: E, defaultView: D = "chart", onViewChange: O, labels: k, className: A, ref: j, ...M }) {
@@ -2,8 +2,8 @@
2
2
  import { useLabels as e } from "../locale/KapiLocaleProvider.js";
3
3
  import { computePagination as t } from "./tableLogic.js";
4
4
  import { KapiPaginationFooter as n } from "./KapiPaginationFooter.js";
5
- import { jsx as r } from "react/jsx-runtime";
6
- import { useEffect as i } from "react";
5
+ import { useEffect as r } from "react";
6
+ import { jsx as i } from "react/jsx-runtime";
7
7
  //#region src/components/data/KapiPagination.tsx
8
8
  var a = {
9
9
  rowsPerPage: "Filas por página",
@@ -20,14 +20,14 @@ function o({ page: o, pageSize: s, total: c, onPageChange: l, pageSizeOptions: u
20
20
  pageSize: s,
21
21
  total: c
22
22
  });
23
- return i(() => {
23
+ return r(() => {
24
24
  c > 0 && v.page !== o && l(v.page);
25
25
  }, [
26
26
  c,
27
27
  v.page,
28
28
  o,
29
29
  l
30
- ]), /* @__PURE__ */ r(n, {
30
+ ]), /* @__PURE__ */ i(n, {
31
31
  ...g,
32
32
  as: "nav",
33
33
  className: m,
@@ -6,8 +6,8 @@ import { chartVars as n } from "./chartFrame.js";
6
6
  import { areaPath as r, linePath as i, linePoints as a } from "./lineChartLogic.js";
7
7
  import { sparklineLabel as o, sparklineMax as s } from "./sparklineLogic.js";
8
8
  /* empty css */
9
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
10
9
  import "react";
10
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
11
11
  //#region src/components/data/KapiSparkline.tsx
12
12
  var u = {
13
13
  trend: "Tendencia",