@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,20 +1,20 @@
1
1
  "use client";
2
2
  import "#kapi-css/components/layout/KapiNotificationBell.css";
3
- import { assignRef as e, focusLeaves as t } from "../inputs/fieldLogic.js";
4
- import { useKapiFormatLocale as n, useLabels as r } from "../locale/KapiLocaleProvider.js";
5
- import { joinClasses as i } from "../rootProps.js";
6
- import { focusedMenuIndex as a, menuKeyIntent as o, nextEnabledIndex as ee } from "../overlays/menuKeyboardLogic.js";
7
- import { useControllableState as s } from "../../hooks/useControllableState.js";
8
- import { activeElementOf as te } from "../../hooks/ownerDocument.js";
9
- import { resolveKapiRoot as c } from "../../hooks/kapiRoot.js";
3
+ import { joinClasses as e } from "../rootProps.js";
4
+ import { assignRef as t, focusLeaves as n } from "../inputs/fieldLogic.js";
5
+ import { useKapiFormatLocale as r, useLabels as i } from "../locale/KapiLocaleProvider.js";
6
+ import { focusedMenuIndex as a, menuKeyIntent as o, nextEnabledIndex as s } from "../overlays/menuKeyboardLogic.js";
7
+ import { useControllableState as ee } from "../../hooks/useControllableState.js";
8
+ import { activeElementOf as c } from "../../hooks/ownerDocument.js";
9
+ import { resolveKapiRoot as te } from "../../hooks/kapiRoot.js";
10
10
  import { usePlacement as l } from "../../hooks/usePlacement.js";
11
11
  import { useDismiss as u } from "../../hooks/useDismiss.js";
12
- import { KapiOverlayPortal as ne } from "../overlays/overlayPortal.js";
13
- import { formatRelativeTime as re } from "../../hooks/dateFormat.js";
14
- import { NOTIFICATION_BELL_PLACEMENT as ie, badgeText as ae, bellTriggerLabel as d, notificationDateTime as f, unreadCount as p } from "./notificationBellLogic.js";
12
+ import { KapiOverlayPortal as d } from "../overlays/overlayPortal.js";
13
+ import { formatRelativeTime as ne } from "../../hooks/dateFormat.js";
14
+ import { NOTIFICATION_BELL_PLACEMENT as re, badgeText as ie, bellTriggerLabel as ae, notificationDateTime as f, unreadCount as p } from "./notificationBellLogic.js";
15
15
  /* empty css */
16
- import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
17
- import { useEffect as oe, useId as _, useLayoutEffect as v, useRef as y, useState as b } from "react";
16
+ import { useEffect as oe, useId as m, useLayoutEffect as h, useRef as g, useState as _ } from "react";
17
+ import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
18
18
  import { Bell as x } from "lucide-react";
19
19
  //#region src/components/layout/KapiNotificationBell.tsx
20
20
  var S = {
@@ -27,9 +27,9 @@ var S = {
27
27
  loading: "Cargando notificaciones…"
28
28
  }, C = "[data-menu-index]", w = (e) => (e?.querySelector(C) ?? e)?.focus();
29
29
  function T({ items: T, onItemSelect: se, onMarkAllRead: E, onViewAll: D, loading: O = !1, emptyMessage: k, max: A = 9, open: j, defaultOpen: M = !1, onOpenChange: N, labels: P, now: F, ref: I, className: L, onClick: R, "aria-label": z, ...B }) {
30
- let V = r("notificationBell", S, P), H = n(), [U, W] = s(j, M, N), G = _(), K = _(), q = y(null), J = y(null), [Y, ce] = b(null);
31
- v(() => {
32
- ce(U ? c(q.current) : null);
30
+ let V = i("notificationBell", S, P), H = r(), [U, W] = ee(j, M, N), G = m(), K = m(), q = g(null), J = g(null), [Y, ce] = _(null);
31
+ h(() => {
32
+ ce(U ? te(q.current) : null);
33
33
  }, [U]);
34
34
  let { style: le } = l({
35
35
  open: U,
@@ -37,7 +37,7 @@ function T({ items: T, onItemSelect: se, onMarkAllRead: E, onViewAll: D, loading
37
37
  anchor: q,
38
38
  floatingRef: J,
39
39
  hideUntilPlaced: !1,
40
- ...ie
40
+ ...re
41
41
  }), ue = () => Array.from(J.current?.querySelectorAll(C) ?? []), de = () => w(J.current);
42
42
  oe(() => {
43
43
  U && Y && w(J.current);
@@ -49,26 +49,26 @@ function T({ items: T, onItemSelect: se, onMarkAllRead: E, onViewAll: D, loading
49
49
  }
50
50
  }), Z = () => {
51
51
  W(!1), q.current?.focus();
52
- }, Q = p(T), $ = ae(Q, A), fe = (e) => {
52
+ }, Q = p(T), $ = ie(Q, A), fe = (e) => {
53
53
  R?.(e), !e.defaultPrevented && W(!U);
54
54
  }, pe = (e) => {
55
55
  let t = o(e.key);
56
56
  if (t.kind !== "move") return X(e);
57
57
  let n = ue();
58
- n.length !== 0 && (e.preventDefault(), n[ee(a(te(e.currentTarget)), t.dir, n.map((e, t) => t))]?.focus());
58
+ n.length !== 0 && (e.preventDefault(), n[s(a(c(e.currentTarget)), t.dir, n.map((e, t) => t))]?.focus());
59
59
  }, me = (e) => {
60
- t(e.relatedTarget, J.current, q.current) && e.relatedTarget && W(!1);
60
+ n(e.relatedTarget, J.current, q.current) && e.relatedTarget && W(!1);
61
61
  }, he = () => {
62
62
  E?.(), de();
63
63
  }, ge = F ?? /* @__PURE__ */ new Date();
64
- return /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ g("button", {
64
+ return /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ b("button", {
65
65
  ...B,
66
- ref: (t) => {
67
- q.current = t, e(I, t);
66
+ ref: (e) => {
67
+ q.current = e, t(I, e);
68
68
  },
69
69
  type: "button",
70
- className: i("kapi-bell", L),
71
- "aria-label": z ?? d(V.title, Q, V.unread),
70
+ className: e("kapi-bell", L),
71
+ "aria-label": z ?? ae(V.title, Q, V.unread),
72
72
  "aria-haspopup": "dialog",
73
73
  "aria-expanded": U,
74
74
  "aria-controls": U ? G : void 0,
@@ -76,18 +76,18 @@ function T({ items: T, onItemSelect: se, onMarkAllRead: E, onViewAll: D, loading
76
76
  onKeyDown: (e) => {
77
77
  B.onKeyDown?.(e), X(e);
78
78
  },
79
- children: [/* @__PURE__ */ h(x, {
79
+ children: [/* @__PURE__ */ y(x, {
80
80
  size: 20,
81
81
  strokeWidth: 1.8,
82
82
  "aria-hidden": "true"
83
- }), $ && /* @__PURE__ */ h("span", {
83
+ }), $ && /* @__PURE__ */ y("span", {
84
84
  className: "kapi-bell__badge",
85
85
  "aria-hidden": "true",
86
86
  children: $
87
87
  })]
88
- }), U && /* @__PURE__ */ h(ne, {
88
+ }), U && /* @__PURE__ */ y(d, {
89
89
  root: Y,
90
- children: /* @__PURE__ */ g("div", {
90
+ children: /* @__PURE__ */ b("div", {
91
91
  ref: J,
92
92
  id: G,
93
93
  role: "dialog",
@@ -98,85 +98,85 @@ function T({ items: T, onItemSelect: se, onMarkAllRead: E, onViewAll: D, loading
98
98
  onKeyDown: pe,
99
99
  onBlur: me,
100
100
  children: [
101
- /* @__PURE__ */ g("div", {
101
+ /* @__PURE__ */ b("div", {
102
102
  className: "kapi-bell__head",
103
- children: [/* @__PURE__ */ h("h2", {
103
+ children: [/* @__PURE__ */ y("h2", {
104
104
  id: K,
105
105
  className: "kapi-bell__title",
106
106
  children: V.title
107
- }), E && Q > 0 && !O && /* @__PURE__ */ h("button", {
107
+ }), E && Q > 0 && !O && /* @__PURE__ */ y("button", {
108
108
  type: "button",
109
109
  className: "kapi-bell__link",
110
110
  onClick: he,
111
111
  children: V.markAllRead
112
112
  })]
113
113
  }),
114
- O ? /* @__PURE__ */ g("div", {
114
+ O ? /* @__PURE__ */ b("div", {
115
115
  className: "kapi-bell__state",
116
116
  role: "status",
117
- children: [/* @__PURE__ */ h("span", {
117
+ children: [/* @__PURE__ */ y("span", {
118
118
  className: "kapi-spinner kapi-spinner--sm",
119
119
  "aria-hidden": "true"
120
120
  }), V.loading]
121
- }) : T.length === 0 ? /* @__PURE__ */ h("div", {
121
+ }) : T.length === 0 ? /* @__PURE__ */ y("div", {
122
122
  className: "kapi-bell__state",
123
123
  children: k ?? V.empty
124
- }) : /* @__PURE__ */ h("ul", {
124
+ }) : /* @__PURE__ */ y("ul", {
125
125
  className: "kapi-bell__list",
126
126
  "aria-labelledby": K,
127
- children: T.map((e, t) => {
128
- let n = e.date === void 0 ? null : f(e.date), r = (t) => {
129
- se?.(e, t), Z();
130
- }, a = /* @__PURE__ */ g(m, { children: [
131
- e.icon && /* @__PURE__ */ h("span", {
127
+ children: T.map((t, n) => {
128
+ let r = t.date === void 0 ? null : f(t.date), i = (e) => {
129
+ se?.(t, e), Z();
130
+ }, a = /* @__PURE__ */ b(v, { children: [
131
+ t.icon && /* @__PURE__ */ y("span", {
132
132
  className: "kapi-bell__icon",
133
133
  "aria-hidden": "true",
134
- children: e.icon
134
+ children: t.icon
135
135
  }),
136
- /* @__PURE__ */ g("span", {
136
+ /* @__PURE__ */ b("span", {
137
137
  className: "kapi-bell__body",
138
138
  children: [
139
- /* @__PURE__ */ h("span", {
139
+ /* @__PURE__ */ y("span", {
140
140
  className: "kapi-bell__itemtitle",
141
- children: e.title
141
+ children: t.title
142
142
  }),
143
- e.description && /* @__PURE__ */ h("span", {
143
+ t.description && /* @__PURE__ */ y("span", {
144
144
  className: "kapi-bell__desc",
145
- children: e.description
145
+ children: t.description
146
146
  }),
147
- n !== null && /* @__PURE__ */ h("time", {
147
+ r !== null && /* @__PURE__ */ y("time", {
148
148
  className: "kapi-bell__date",
149
- dateTime: n,
150
- children: re(e.date, ge, H)
149
+ dateTime: r,
150
+ children: ne(t.date, ge, H)
151
151
  })
152
152
  ]
153
153
  }),
154
- !e.read && /* @__PURE__ */ h("span", {
154
+ !t.read && /* @__PURE__ */ y("span", {
155
155
  className: "kapi-bell__dot",
156
- children: /* @__PURE__ */ h("span", {
156
+ children: /* @__PURE__ */ y("span", {
157
157
  className: "kapi-bell__sr",
158
158
  children: V.unreadItem
159
159
  })
160
160
  })
161
161
  ] }), o = {
162
- className: i("kapi-bell__item", !e.read && "is-unread"),
163
- "data-menu-index": t,
164
- onClick: r
162
+ className: e("kapi-bell__item", !t.read && "is-unread"),
163
+ "data-menu-index": n,
164
+ onClick: i
165
165
  };
166
- return /* @__PURE__ */ h("li", { children: e.href ? /* @__PURE__ */ h("a", {
166
+ return /* @__PURE__ */ y("li", { children: t.href ? /* @__PURE__ */ y("a", {
167
167
  ...o,
168
- href: e.href,
168
+ href: t.href,
169
169
  children: a
170
- }) : /* @__PURE__ */ h("button", {
170
+ }) : /* @__PURE__ */ y("button", {
171
171
  ...o,
172
172
  type: "button",
173
173
  children: a
174
- }) }, e.id);
174
+ }) }, t.id);
175
175
  })
176
176
  }),
177
- D && /* @__PURE__ */ h("div", {
177
+ D && /* @__PURE__ */ y("div", {
178
178
  className: "kapi-bell__foot",
179
- children: /* @__PURE__ */ h("button", {
179
+ children: /* @__PURE__ */ y("button", {
180
180
  type: "button",
181
181
  className: "kapi-bell__link",
182
182
  onClick: () => {
@@ -11,8 +11,8 @@ import { useReopenBus as o } from "./reopenBus.js";
11
11
  import { useScrollCollapse as s } from "../../hooks/useScrollCollapse.js";
12
12
  import { pageHeaderBox as c } from "./pageHeaderLogic.js";
13
13
  /* empty css */
14
- import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
15
- import { useEffect as f, useLayoutEffect as p, useRef as m } from "react";
14
+ import { useEffect as l, useLayoutEffect as u, useRef as d } from "react";
15
+ import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
16
16
  import { ChevronsLeft as h, ChevronsRight as g } from "lucide-react";
17
17
  //#region src/components/layout/KapiPageHeader.tsx
18
18
  var _ = "kapi-pageheader--collapsed", v = "kapi-pageheader--animating", y = "kapi-pageheader--measuring", b = 80, x = (e, t) => {
@@ -38,13 +38,13 @@ var _ = "kapi-pageheader--collapsed", v = "kapi-pageheader--animating", y = "kap
38
38
  n ? r() : (e.style.transition = "none", r(), e.getBoundingClientRect(), e.style.transition = "");
39
39
  };
40
40
  function w({ title: _, subtitle: y, meta: w, actions: T, chip: E, breadcrumbs: D, collapseOnScroll: O = !0, sticky: k = !0, scrollRoot: A = null, responsive: j = !0, className: M, ref: N, ...P }) {
41
- let { collapsed: F, sentinelRef: I } = s({ root: A }), L = O && F, R = m(null), z = n(R, N), B = m({
41
+ let { collapsed: F, sentinelRef: I } = s({ root: A }), L = O && F, R = d(null), z = n(R, N), B = d({
42
42
  expanded: 0,
43
43
  collapsed: 0
44
- }), V = m(L);
44
+ }), V = d(L);
45
45
  V.current = L;
46
- let H = m(!1), U = m(!1);
47
- p(() => {
46
+ let H = d(!1), U = d(!1);
47
+ u(() => {
48
48
  let e = R.current;
49
49
  if (!e) return;
50
50
  let n = () => {
@@ -75,7 +75,7 @@ function w({ title: _, subtitle: y, meta: w, actions: T, chip: E, breadcrumbs: D
75
75
  D,
76
76
  O,
77
77
  j
78
- ]), p(() => {
78
+ ]), u(() => {
79
79
  let t = R.current;
80
80
  if (!t) return;
81
81
  let { expanded: n } = B.current, a = c(B.current, L), o = H.current && !r(t);
@@ -104,54 +104,54 @@ function w({ title: _, subtitle: y, meta: w, actions: T, chip: E, breadcrumbs: D
104
104
  L && "kapi-pageheader--collapsed",
105
105
  M
106
106
  ].filter(Boolean).join(" "), G = o(), K = G?.addHost;
107
- f(() => K?.(), [K]);
107
+ l(() => K?.(), [K]);
108
108
  let q = G?.info ?? null, J = q?.side === "right" ? h : g;
109
- return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", {
109
+ return /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("div", {
110
110
  ref: I,
111
111
  className: "kapi-pageheader__sentinel",
112
112
  "aria-hidden": !0
113
- }), /* @__PURE__ */ d("header", {
113
+ }), /* @__PURE__ */ m("header", {
114
114
  ...P,
115
115
  ref: z,
116
116
  className: W,
117
117
  children: [
118
- q && /* @__PURE__ */ u("button", {
118
+ q && /* @__PURE__ */ p("button", {
119
119
  type: "button",
120
120
  className: "kapi-paneltoggle kapi-pageheader__reopen",
121
121
  onClick: q.expand,
122
122
  "aria-label": q.label,
123
- children: /* @__PURE__ */ u(J, {
123
+ children: /* @__PURE__ */ p(J, {
124
124
  className: "kapi-flip-rtl",
125
125
  size: 16,
126
126
  strokeWidth: 2,
127
127
  "aria-hidden": "true"
128
128
  })
129
129
  }),
130
- /* @__PURE__ */ d("div", {
130
+ /* @__PURE__ */ m("div", {
131
131
  className: "kapi-pageheader__main",
132
132
  children: [
133
- D && D.length > 0 && /* @__PURE__ */ u(a, {
133
+ D && D.length > 0 && /* @__PURE__ */ p(a, {
134
134
  className: "kapi-pageheader__breadcrumb",
135
135
  items: D
136
136
  }),
137
- /* @__PURE__ */ d("div", {
137
+ /* @__PURE__ */ m("div", {
138
138
  className: "kapi-pageheader__titlerow",
139
- children: [/* @__PURE__ */ u("h1", {
139
+ children: [/* @__PURE__ */ p("h1", {
140
140
  className: "kapi-pageheader__title",
141
141
  children: _
142
142
  }), E]
143
143
  }),
144
- y && /* @__PURE__ */ u("div", {
144
+ y && /* @__PURE__ */ p("div", {
145
145
  className: "kapi-pageheader__subtitle",
146
146
  children: y
147
147
  }),
148
- w && /* @__PURE__ */ u("div", {
148
+ w && /* @__PURE__ */ p("div", {
149
149
  className: "kapi-pageheader__meta",
150
150
  children: w
151
151
  })
152
152
  ]
153
153
  }),
154
- T && /* @__PURE__ */ u("div", {
154
+ T && /* @__PURE__ */ p("div", {
155
155
  className: "kapi-pageheader__actions",
156
156
  children: T
157
157
  })
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import "#kapi-css/components/layout/KapiRail.css";
3
- import { assignRef as e } from "../inputs/fieldLogic.js";
4
- import { useLabels as t } from "../locale/KapiLocaleProvider.js";
5
- import { joinClasses as n } from "../rootProps.js";
3
+ import { joinClasses as e } from "../rootProps.js";
4
+ import { assignRef as t } from "../inputs/fieldLogic.js";
5
+ import { useLabels as n } from "../locale/KapiLocaleProvider.js";
6
6
  import { useSlidingIndicator as r } from "../../hooks/useSlidingIndicator.js";
7
7
  import { KapiTooltip as i } from "../overlays/KapiTooltip.js";
8
8
  import { DEFAULT_LINK_LABELS as a } from "../locale/linkLabels.js";
@@ -16,56 +16,56 @@ import { isRailSeparator as p, railClasses as m, railItemClasses as h, railOverf
16
16
  import { useRailOverflow as b } from "./useRailOverflow.js";
17
17
  import { RailVariantContext as x } from "./railContext.js";
18
18
  /* empty css */
19
- import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
20
- import { useCallback as T, useState as ee } from "react";
21
- import { ExternalLink as te, MoreHorizontal as ne } from "lucide-react";
19
+ import { useCallback as S, useState as C } from "react";
20
+ import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
21
+ import { ExternalLink as ee, MoreHorizontal as te } from "lucide-react";
22
22
  //#region src/components/layout/KapiRail.tsx
23
- var E = {
23
+ var D = {
24
24
  navigation: "Navegación principal",
25
25
  more: "Más",
26
26
  moreCurrent: "sección actual",
27
27
  account: "Cuenta"
28
- }, D = ({ items: D, activeId: O, onSelect: k, brand: A, footer: j, variant: M = "labeled", "aria-label": N, labels: P, className: F, ref: I, ...L }) => {
29
- let R = t("rail", E, P), z = t("link", a, P), B = M === "compact", V = _(M), H = v(D), U = d(u), [W, G] = ee(null);
30
- f(W, U);
31
- let re = T((t) => {
32
- G(t), e(I, t);
33
- }, [I]), { ref: K, edges: q } = l({ axis: "y" }), J = H.scroll, Y = J.filter((e) => !p(e)).length, ie = b(K, {
34
- enabled: U,
28
+ }, O = ({ items: O, activeId: k, onSelect: A, brand: j, footer: M, variant: N = "labeled", "aria-label": P, labels: F, className: I, ref: L, ...R }) => {
29
+ let z = n("rail", D, F), B = n("link", a, F), V = N === "compact", H = _(N), U = v(O), W = d(u), [G, ne] = C(null);
30
+ f(G, W);
31
+ let re = S((e) => {
32
+ ne(e), t(L, e);
33
+ }, [L]), { ref: K, edges: q } = l({ axis: "y" }), J = U.scroll, Y = J.filter((e) => !p(e)).length, ie = b(K, {
34
+ enabled: W,
35
35
  count: Y,
36
36
  separators: J.length - Y
37
- }), { shown: ae, hidden: X } = y(J, ie ?? Y), Z = g(X, O), { containerRef: Q, indicatorRef: oe } = r({
38
- active: O ?? null,
37
+ }), { shown: ae, hidden: X } = y(J, ie ?? Y), Z = g(X, k), { containerRef: Q, indicatorRef: oe } = r({
38
+ active: k ?? null,
39
39
  deps: [
40
- D,
41
- M,
40
+ O,
41
+ N,
42
42
  X.length
43
43
  ],
44
44
  findActive: (e) => e.querySelector(".kapi-rail__item[aria-current=\"page\"], .kapi-rail__more--on")
45
- }), se = T((e) => {
45
+ }), se = S((e) => {
46
46
  Q.current = e, K.current = e;
47
47
  }, [Q, K]), ce = ({ id: e, label: t, icon: n, href: r, external: a, newTab: o, badge: l, badgeTone: u, badgeLabel: d }) => {
48
- let f = O === e, p = f ? "page" : void 0, m = s(l, d), g = m === null ? t : `${t} ${m}`, _ = B ? g : void 0, v = /* @__PURE__ */ C(c, {
48
+ let f = k === e, p = f ? "page" : void 0, m = s(l, d), g = m === null ? t : `${t} ${m}`, _ = V ? g : void 0, v = /* @__PURE__ */ T(c, {
49
49
  value: l,
50
50
  tone: u,
51
51
  label: d,
52
52
  placement: "corner",
53
- announce: !B
54
- }), y = r === void 0 ? /* @__PURE__ */ w("button", {
53
+ announce: !V
54
+ }), y = r === void 0 ? /* @__PURE__ */ E("button", {
55
55
  type: "button",
56
56
  className: h({ active: f }),
57
- onClick: () => k?.(e),
57
+ onClick: () => A?.(e),
58
58
  "aria-current": p,
59
59
  "aria-label": _,
60
60
  children: [
61
61
  n,
62
- !B && /* @__PURE__ */ C("span", {
62
+ !V && /* @__PURE__ */ T("span", {
63
63
  className: "kapi-rail__label",
64
64
  children: t
65
65
  }),
66
66
  v
67
67
  ]
68
- }, V ? void 0 : e) : /* @__PURE__ */ w("a", {
68
+ }, H ? void 0 : e) : /* @__PURE__ */ E("a", {
69
69
  className: h({
70
70
  active: f,
71
71
  link: !0
@@ -77,27 +77,27 @@ var E = {
77
77
  "aria-label": _,
78
78
  children: [
79
79
  n,
80
- !B && /* @__PURE__ */ C("span", {
80
+ !V && /* @__PURE__ */ T("span", {
81
81
  className: "kapi-rail__label",
82
82
  children: t
83
83
  }),
84
84
  v,
85
- a && /* @__PURE__ */ C(te, {
85
+ a && /* @__PURE__ */ T(ee, {
86
86
  className: "kapi-rail__ext",
87
87
  size: 12,
88
88
  "aria-hidden": "true"
89
89
  }),
90
- o && /* @__PURE__ */ C("span", {
90
+ o && /* @__PURE__ */ T("span", {
91
91
  className: "kapi-rail__sr",
92
- children: z.newTab
92
+ children: B.newTab
93
93
  })
94
94
  ]
95
- }, V ? void 0 : e);
96
- return V ? /* @__PURE__ */ C(i, {
95
+ }, H ? void 0 : e);
96
+ return H ? /* @__PURE__ */ T(i, {
97
97
  label: g,
98
98
  children: y
99
99
  }, e) : y;
100
- }, $ = (e) => e.map((e, t) => p(e) ? /* @__PURE__ */ C("div", {
100
+ }, $ = (e) => e.map((e, t) => p(e) ? /* @__PURE__ */ T("div", {
101
101
  className: "kapi-rail__sep",
102
102
  role: "separator",
103
103
  "aria-orientation": "horizontal"
@@ -105,51 +105,51 @@ var E = {
105
105
  let o = s(i, a);
106
106
  return {
107
107
  label: o === null ? t : `${t} ${o}`,
108
- current: O === e,
108
+ current: k === e,
109
109
  onClick: () => {
110
- n === void 0 ? k?.(e) : r ? window.open(n, "_blank", "noopener,noreferrer") : window.location.assign(n);
110
+ n === void 0 ? A?.(e) : r ? window.open(n, "_blank", "noopener,noreferrer") : window.location.assign(n);
111
111
  }
112
112
  };
113
113
  });
114
- return /* @__PURE__ */ w("nav", {
115
- ...L,
114
+ return /* @__PURE__ */ E("nav", {
115
+ ...R,
116
116
  ref: re,
117
- className: n(m({ variant: M }), F),
118
- "aria-label": N ?? R.navigation,
117
+ className: e(m({ variant: N }), I),
118
+ "aria-label": P ?? z.navigation,
119
119
  children: [
120
- A !== void 0 && /* @__PURE__ */ C("div", {
120
+ j !== void 0 && /* @__PURE__ */ T("div", {
121
121
  className: "kapi-rail__brand",
122
- children: A
122
+ children: j
123
123
  }),
124
- H.start.length > 0 && /* @__PURE__ */ C("div", {
124
+ U.start.length > 0 && /* @__PURE__ */ T("div", {
125
125
  className: "kapi-rail__start",
126
- children: $(H.start)
126
+ children: $(U.start)
127
127
  }),
128
- /* @__PURE__ */ w("div", {
128
+ /* @__PURE__ */ E("div", {
129
129
  ref: se,
130
- className: n("kapi-rail__scroll", !U && "kapi-fade-y"),
131
- "data-edge-start": !U && q.start ? "" : void 0,
132
- "data-edge-end": !U && q.end ? "" : void 0,
130
+ className: e("kapi-rail__scroll", !W && "kapi-fade-y"),
131
+ "data-edge-start": !W && q.start ? "" : void 0,
132
+ "data-edge-end": !W && q.end ? "" : void 0,
133
133
  children: [
134
- /* @__PURE__ */ C("span", {
134
+ /* @__PURE__ */ T("span", {
135
135
  ref: oe,
136
136
  className: "kapi-rail__indicator",
137
137
  "aria-hidden": "true"
138
138
  }),
139
139
  $(ae),
140
- X.length > 0 && /* @__PURE__ */ C(o, {
141
- className: n("kapi-rail__more", Z.current && "kapi-rail__more--on"),
140
+ X.length > 0 && /* @__PURE__ */ T(o, {
141
+ className: e("kapi-rail__more", Z.current && "kapi-rail__more--on"),
142
142
  variant: "ghost",
143
143
  drop: "up",
144
- icon: /* @__PURE__ */ C(ne, {
144
+ icon: /* @__PURE__ */ T(te, {
145
145
  size: 21,
146
146
  strokeWidth: 1.8
147
147
  }),
148
- ...B || Z.current ? { "aria-label": Z.current ? `${R.more} · ${R.moreCurrent}: ${Z.current.label}` : R.more } : {},
149
- label: /* @__PURE__ */ w(S, { children: [!B && /* @__PURE__ */ C("span", {
148
+ ...V || Z.current ? { "aria-label": Z.current ? `${z.more} · ${z.moreCurrent}: ${Z.current.label}` : z.more } : {},
149
+ label: /* @__PURE__ */ E(w, { children: [!V && /* @__PURE__ */ T("span", {
150
150
  className: "kapi-rail__label",
151
- children: R.more
152
- }), Z.notice && /* @__PURE__ */ C(c, {
151
+ children: z.more
152
+ }), Z.notice && /* @__PURE__ */ T(c, {
153
153
  value: "dot",
154
154
  tone: Z.notice.badgeTone,
155
155
  placement: "corner"
@@ -158,16 +158,16 @@ var E = {
158
158
  })
159
159
  ]
160
160
  }),
161
- H.end.length > 0 && /* @__PURE__ */ C("div", {
161
+ U.end.length > 0 && /* @__PURE__ */ T("div", {
162
162
  className: "kapi-rail__end",
163
- children: $(H.end)
163
+ children: $(U.end)
164
164
  }),
165
- j !== void 0 && /* @__PURE__ */ C(x.Provider, {
166
- value: M,
167
- children: j
165
+ M !== void 0 && /* @__PURE__ */ T(x.Provider, {
166
+ value: N,
167
+ children: M
168
168
  })
169
169
  ]
170
170
  });
171
171
  };
172
172
  //#endregion
173
- export { E as DEFAULT_RAIL_LABELS, D as KapiRail };
173
+ export { D as DEFAULT_RAIL_LABELS, O as KapiRail };
@@ -1,34 +1,34 @@
1
1
  "use client";
2
2
  import "#kapi-css/components/layout/KapiRail.css";
3
- import { useLabels as e } from "../locale/KapiLocaleProvider.js";
4
- import { joinClasses as t } from "../rootProps.js";
3
+ import { joinClasses as e } from "../rootProps.js";
4
+ import { useLabels as t } from "../locale/KapiLocaleProvider.js";
5
5
  import { KapiTooltip as n } from "../overlays/KapiTooltip.js";
6
6
  import { initialsFrom as r } from "../display/avatarLogic.js";
7
7
  import { RailVariantContext as i } from "./railContext.js";
8
8
  /* empty css */
9
9
  import { DEFAULT_RAIL_LABELS as a } from "./KapiRail.js";
10
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
11
- import { useContext as c } from "react";
10
+ import { useContext as o } from "react";
11
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
12
12
  //#region src/components/layout/KapiRailAccount.tsx
13
13
  var l = ({ user: l, label: u, avatar: d, open: f = !1, labels: p, className: m, ref: h, ...g }) => {
14
- let _ = e("rail", a, p), v = c(i) === "compact", y = u ?? _.account, b = /* @__PURE__ */ s("button", {
14
+ let _ = t("rail", a, p), v = o(i) === "compact", y = u ?? _.account, b = /* @__PURE__ */ c("button", {
15
15
  ...g,
16
16
  ref: h,
17
17
  type: "button",
18
- className: t("kapi-rail__item kapi-rail__item--account", m),
18
+ className: e("kapi-rail__item kapi-rail__item--account", m),
19
19
  "aria-haspopup": "menu",
20
20
  "aria-expanded": f,
21
21
  "aria-label": v ? g["aria-label"] ?? y : g["aria-label"],
22
- children: [/* @__PURE__ */ o("span", {
22
+ children: [/* @__PURE__ */ s("span", {
23
23
  className: "kapi-rail__avatar",
24
24
  "aria-hidden": "true",
25
25
  children: d ?? l.initials ?? r(l.name)
26
- }), !v && /* @__PURE__ */ o("span", {
26
+ }), !v && /* @__PURE__ */ s("span", {
27
27
  className: "kapi-rail__label",
28
28
  children: y
29
29
  })]
30
30
  });
31
- return v ? /* @__PURE__ */ o(n, {
31
+ return v ? /* @__PURE__ */ s(n, {
32
32
  label: y,
33
33
  children: b
34
34
  }) : b;