@kapiuara/ui 0.14.0 → 0.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) 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/overlays/useNativeDialog.d.ts +5 -0
  113. package/dist/components/overlays/useNativeDialog.js +2 -2
  114. package/dist/components/renderSlot.d.ts +27 -0
  115. package/dist/components/renderSlot.js +23 -0
  116. package/dist/hooks/portalRoot.js +6 -6
  117. package/dist/index.d.ts +2 -0
  118. package/package.json +1 -1
@@ -1,52 +1,52 @@
1
1
  "use client";
2
2
  import { flattenMenuRows as e } from "./selectLogic.js";
3
3
  import { useVirtualList as t } from "../../hooks/useVirtualList.js";
4
- import { jsx as n, jsxs as r } from "react/jsx-runtime";
5
- import { memo as i, useCallback as a, useLayoutEffect as o, useMemo as s, useRef as c } from "react";
4
+ import { memo as n, useCallback as r, useLayoutEffect as i, useMemo as a, useRef as o } from "react";
5
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
6
6
  import { Check as l } from "lucide-react";
7
7
  import { createPortal as u } from "react-dom";
8
8
  //#region src/components/inputs/KapiSelectMenu.tsx
9
- var d = 38, f = 264, p = 4, m = i(({ option: e, index: t, id: i, selected: a, active: o, create: s, vindex: c, setSize: u, renderOption: d, query: f, onHover: p, onChoose: m }) => /* @__PURE__ */ r("li", {
10
- id: i,
9
+ var d = 38, f = 264, p = 4, m = n(({ option: e, index: t, id: n, selected: r, active: i, create: a, vindex: o, setSize: u, renderOption: d, query: f, onHover: p, onChoose: m }) => /* @__PURE__ */ c("li", {
10
+ id: n,
11
11
  role: "option",
12
- "aria-selected": a,
12
+ "aria-selected": r,
13
13
  "aria-disabled": e.disabled || void 0,
14
14
  "data-kapisel-index": t,
15
- "data-vindex": c,
16
- "aria-setsize": c === void 0 ? void 0 : u,
17
- "aria-posinset": c === void 0 ? void 0 : t + 1,
15
+ "data-vindex": o,
16
+ "aria-setsize": o === void 0 ? void 0 : u,
17
+ "aria-posinset": o === void 0 ? void 0 : t + 1,
18
18
  className: [
19
19
  "kapisel__opt",
20
- o && "kapisel__opt--active",
21
- a && "kapisel__opt--selected",
22
- s && "kapisel__opt--create",
20
+ i && "kapisel__opt--active",
21
+ r && "kapisel__opt--selected",
22
+ a && "kapisel__opt--create",
23
23
  e.disabled && "kapisel__opt--disabled"
24
24
  ].filter(Boolean).join(" "),
25
25
  onMouseMove: () => {
26
- !e.disabled && !o && p(t);
26
+ !e.disabled && !i && p(t);
27
27
  },
28
28
  onClick: (t) => m(e, t.shiftKey),
29
- children: [/* @__PURE__ */ n("span", {
29
+ children: [/* @__PURE__ */ s("span", {
30
30
  className: "kapisel__opt-body",
31
- children: d && !s ? d(e, {
32
- selected: a,
33
- active: o,
31
+ children: d && !a ? d(e, {
32
+ selected: r,
33
+ active: i,
34
34
  disabled: e.disabled === !0,
35
35
  query: f
36
36
  }) : e.label
37
- }), a && /* @__PURE__ */ n(l, {
37
+ }), r && /* @__PURE__ */ s(l, {
38
38
  className: "kapisel__check",
39
39
  size: 15,
40
40
  strokeWidth: 2.4,
41
41
  "aria-hidden": "true"
42
42
  })]
43
- })), h = ({ root: i, ref: l, side: h, hug: g, style: _, listboxId: v, optionId: y, multiple: b, "aria-label": x, rows: S, createRow: C, createIndex: w, loading: T, empty: E, message: D, active: O, values: k, renderOption: A, query: j, virtual: M, onHover: N, onChoose: P }) => {
44
- let F = c(null), I = s(() => M ? e(S, C, w) : null, [
43
+ })), h = ({ root: n, ref: l, side: h, hug: g, style: _, listboxId: v, optionId: y, multiple: b, "aria-label": x, rows: S, createRow: C, createIndex: w, loading: T, empty: E, message: D, active: O, values: k, renderOption: A, query: j, virtual: M, onHover: N, onChoose: P }) => {
44
+ let F = o(null), I = a(() => M ? e(S, C, w) : null, [
45
45
  M,
46
46
  S,
47
47
  C,
48
48
  w
49
- ]), L = s(() => I?.rows.map((e) => e.key), [I]), R = t({
49
+ ]), L = a(() => I?.rows.map((e) => e.key), [I]), R = t({
50
50
  enabled: M && !T,
51
51
  count: I?.rows.length ?? 0,
52
52
  scrollRef: F,
@@ -56,42 +56,42 @@ var d = 38, f = 264, p = 4, m = i(({ option: e, index: t, id: i, selected: a, ac
56
56
  overscan: p,
57
57
  fallbackViewHeight: f
58
58
  }), { scrollToIndex: z } = R, B = O >= 0 ? I?.rowOf[O] : void 0;
59
- o(() => {
59
+ i(() => {
60
60
  B !== void 0 && z(B);
61
61
  }, [B, z]);
62
- let V = s(() => new Set(k), [k]), H = c({
62
+ let V = a(() => new Set(k), [k]), H = o({
63
63
  onHover: N,
64
64
  onChoose: P
65
65
  });
66
- o(() => {
66
+ i(() => {
67
67
  H.current = {
68
68
  onHover: N,
69
69
  onChoose: P
70
70
  };
71
71
  });
72
- let U = a((e) => H.current.onHover(e), []), W = a((e, t) => H.current.onChoose(e, t), []), G = w + 1, K = ({ option: e, index: t }, r) => {
73
- let i = e === C, a = A && !i ? A : void 0;
74
- return /* @__PURE__ */ n(m, {
72
+ let U = r((e) => H.current.onHover(e), []), W = r((e, t) => H.current.onChoose(e, t), []), G = w + 1, K = ({ option: e, index: t }, n) => {
73
+ let r = e === C, i = A && !r ? A : void 0;
74
+ return /* @__PURE__ */ s(m, {
75
75
  option: e,
76
76
  index: t,
77
77
  id: y(t),
78
78
  selected: V.has(e.value),
79
79
  active: t === O,
80
- create: i,
81
- vindex: r,
82
- setSize: r === void 0 ? void 0 : G,
83
- renderOption: a,
84
- query: a ? j : "",
80
+ create: r,
81
+ vindex: n,
82
+ setSize: n === void 0 ? void 0 : G,
83
+ renderOption: i,
84
+ query: i ? j : "",
85
85
  onHover: U,
86
86
  onChoose: W
87
87
  }, `${e.value}-${t}`);
88
88
  };
89
- return u(/* @__PURE__ */ r("div", {
89
+ return u(/* @__PURE__ */ c("div", {
90
90
  ref: l,
91
91
  className: `kapisel__menu kapisel__menu--${h}${g ? " kapisel__menu--hug" : ""}`,
92
92
  style: _,
93
93
  onMouseDown: (e) => e.preventDefault(),
94
- children: [/* @__PURE__ */ r("ul", {
94
+ children: [/* @__PURE__ */ c("ul", {
95
95
  id: v,
96
96
  role: "listbox",
97
97
  "aria-multiselectable": b || void 0,
@@ -101,55 +101,55 @@ var d = 38, f = 264, p = 4, m = i(({ option: e, index: t, id: i, selected: a, ac
101
101
  ref: F,
102
102
  onScroll: M ? R.onScroll : void 0,
103
103
  children: [
104
- !T && I && ((e, t, i, a, o) => {
105
- let s = [];
106
- a > 0 && s.push(/* @__PURE__ */ n("li", {
104
+ !T && I && ((e, t, n, r, i) => {
105
+ let a = [];
106
+ r > 0 && a.push(/* @__PURE__ */ s("li", {
107
107
  role: "presentation",
108
108
  "aria-hidden": !0,
109
- style: { height: a }
109
+ style: { height: r }
110
110
  }, "pad-top"));
111
- let c = t;
112
- for (; c < i;) {
113
- let t = e[c];
111
+ let o = t;
112
+ for (; o < n;) {
113
+ let t = e[o];
114
114
  if (t.group === null) {
115
- t.kind === "option" && s.push(K(t.item, c)), c += 1;
115
+ t.kind === "option" && a.push(K(t.item, o)), o += 1;
116
116
  continue;
117
117
  }
118
- let a = t.group, o = null, l = [];
119
- for (; c < i && e[c].group?.key === a.key;) {
120
- let t = e[c];
121
- t.kind === "header" ? o = /* @__PURE__ */ n("div", {
118
+ let r = t.group, i = null, l = [];
119
+ for (; o < n && e[o].group?.key === r.key;) {
120
+ let t = e[o];
121
+ t.kind === "header" ? i = /* @__PURE__ */ s("div", {
122
122
  className: "kapisel__group-label",
123
123
  "aria-hidden": "true",
124
- "data-vindex": c,
125
- children: a.label
126
- }, "h") : l.push(K(t.item, c)), c += 1;
124
+ "data-vindex": o,
125
+ children: r.label
126
+ }, "h") : l.push(K(t.item, o)), o += 1;
127
127
  }
128
- s.push(/* @__PURE__ */ r("li", {
128
+ a.push(/* @__PURE__ */ c("li", {
129
129
  role: "presentation",
130
130
  className: "kapisel__group",
131
- children: [o, l.length > 0 && /* @__PURE__ */ n("ul", {
131
+ children: [i, l.length > 0 && /* @__PURE__ */ s("ul", {
132
132
  role: "group",
133
- "aria-label": a.label,
133
+ "aria-label": r.label,
134
134
  className: "kapisel__group-list",
135
135
  children: l
136
136
  })]
137
- }, a.key));
137
+ }, r.key));
138
138
  }
139
- return o > 0 && s.push(/* @__PURE__ */ n("li", {
139
+ return i > 0 && a.push(/* @__PURE__ */ s("li", {
140
140
  role: "presentation",
141
141
  "aria-hidden": !0,
142
- style: { height: o }
143
- }, "pad-bottom")), s;
142
+ style: { height: i }
143
+ }, "pad-bottom")), a;
144
144
  })(I.rows, R.start, R.end, R.padTop, R.padBottom),
145
- !T && !I && S.map((e) => e.kind === "option" ? K(e.item) : /* @__PURE__ */ r("li", {
145
+ !T && !I && S.map((e) => e.kind === "option" ? K(e.item) : /* @__PURE__ */ c("li", {
146
146
  role: "presentation",
147
147
  className: "kapisel__group",
148
- children: [/* @__PURE__ */ n("div", {
148
+ children: [/* @__PURE__ */ s("div", {
149
149
  className: "kapisel__group-label",
150
150
  "aria-hidden": "true",
151
151
  children: e.label
152
- }), /* @__PURE__ */ n("ul", {
152
+ }), /* @__PURE__ */ s("ul", {
153
153
  role: "group",
154
154
  "aria-label": e.label,
155
155
  className: "kapisel__group-list",
@@ -161,13 +161,13 @@ var d = 38, f = 264, p = 4, m = i(({ option: e, index: t, id: i, selected: a, ac
161
161
  index: w
162
162
  })
163
163
  ]
164
- }), D != null && D !== !1 && D !== "" && /* @__PURE__ */ n("div", {
164
+ }), D != null && D !== !1 && D !== "" && /* @__PURE__ */ s("div", {
165
165
  className: "kapisel__status",
166
166
  role: "status",
167
167
  "aria-live": "polite",
168
168
  children: D
169
169
  })]
170
- }), i);
170
+ }), n);
171
171
  };
172
172
  //#endregion
173
173
  export { h as KapiSelectMenu };
@@ -5,8 +5,8 @@ import { useOwnField as r } from "./ownField.js";
5
5
  /* empty css */
6
6
  import { useControllableState as i } from "../../hooks/useControllableState.js";
7
7
  import { clampToStep as a, percentOf as o } from "./sliderLogic.js";
8
- import { jsx as s, jsxs as c } from "react/jsx-runtime";
9
8
  import "react";
9
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
10
10
  //#region src/components/inputs/KapiSlider.tsx
11
11
  var l = ({ tone: e = "primary", disabled: t = !1, readOnly: n = !1, className: r = "" } = {}) => [
12
12
  "kapi-slider",
@@ -1,13 +1,13 @@
1
1
  "use client";
2
2
  import "#kapi-css/components/inputs/checkControl.css";
3
- import { nativeFieldProps as e } from "./fieldLogic.js";
4
- import { useKapiField as t } from "./KapiField.js";
3
+ import { joinClasses as e } from "../rootProps.js";
4
+ import { nativeFieldProps as t } from "./fieldLogic.js";
5
+ import { useKapiField as n } from "./KapiField.js";
5
6
  /* empty css */
6
- import { joinClasses as n } from "../rootProps.js";
7
7
  import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
8
8
  //#region src/components/inputs/KapiSwitch.tsx
9
9
  var o = ({ label: o, className: s, ref: c, invalid: l, id: u, required: d, "aria-describedby": f, "aria-invalid": p, "aria-required": m, ...h }) => {
10
- let g = e(t(), {
10
+ let g = t(n(), {
11
11
  id: u,
12
12
  describedBy: f,
13
13
  invalid: l,
@@ -23,10 +23,10 @@ var o = ({ label: o, className: s, ref: c, invalid: l, id: u, required: d, "aria
23
23
  required: d
24
24
  }), /* @__PURE__ */ i("span", { className: "kapi-switch__track" })] });
25
25
  return o == null ? /* @__PURE__ */ i("label", {
26
- className: n("kapi-switch", s),
26
+ className: e("kapi-switch", s),
27
27
  children: _
28
28
  }) : /* @__PURE__ */ a("label", {
29
- className: n("kapi-switchfield", s),
29
+ className: e("kapi-switchfield", s),
30
30
  children: [/* @__PURE__ */ i("span", {
31
31
  className: "kapi-switch",
32
32
  children: _
@@ -1,25 +1,25 @@
1
1
  "use client";
2
2
  import "#kapi-css/components/inputs/KapiTagInput.css";
3
- import { assignRef as e, fieldControlProps as t, focusLeaves as n, joinIds as r, resolveReadOnly as i } from "./fieldLogic.js";
4
- import { useOwnField as a } from "./ownField.js";
5
- import { useLabels as o } from "../locale/KapiLocaleProvider.js";
6
- import { joinClasses as s } from "../rootProps.js";
3
+ import { joinClasses as e } from "../rootProps.js";
4
+ import { assignRef as t, fieldControlProps as n, focusLeaves as r, joinIds as i, resolveReadOnly as a } from "./fieldLogic.js";
5
+ import { useOwnField as o } from "./ownField.js";
6
+ import { useLabels as s } from "../locale/KapiLocaleProvider.js";
7
7
  import { useControllableState as ee } from "../../hooks/useControllableState.js";
8
8
  import { useFormReset as te } from "../../hooks/useFormReset.js";
9
9
  import { useMergedRefs as ne } from "../../hooks/mergeRefs.js";
10
10
  /* empty css */
11
11
  import { addTags as re, hasSeparator as c, removeTagAt as l, spliceText as u, splitDraft as d, splitTags as f } from "./tagInputLogic.js";
12
12
  import { KapiTag as ie } from "../display/KapiTag.js";
13
- import { jsx as p, jsxs as m } from "react/jsx-runtime";
14
- import { useCallback as ae, useId as oe, useRef as h, useState as g } from "react";
13
+ import { useCallback as ae, useId as oe, useRef as p, useState as m } from "react";
14
+ import { jsx as h, jsxs as g } from "react/jsx-runtime";
15
15
  //#region src/components/inputs/KapiTagInput.tsx
16
16
  var _ = {
17
17
  remove: "Quitar",
18
18
  duplicate: "Ya está en la lista:",
19
19
  max: "Llegaste al máximo de"
20
- }, v = ({ size: e = "md", invalid: t, disabled: n, readOnly: r, className: i }) => s("kapi-taginput", e !== "md" && `kapi-taginput--${e}`, t && "kapi-taginput--err", n && "kapi-taginput--disabled", r && "kapi-taginput--readonly", i);
21
- function y({ value: s, defaultValue: y = [], onChange: b, validate: se, maxTags: x, allowDuplicates: ce, caseSensitive: le, placeholder: ue, disabled: S = !1, size: C = "md", name: w, id: T, invalid: E, required: D, label: de, help: fe, fieldClassName: pe, readOnly: O, "aria-label": k, "aria-labelledby": A, "aria-describedby": j, onBlur: M, ref: N, labels: P, className: F, onClick: I, ...L }) {
22
- let R = o("tagInput", _, P), z = a({
20
+ }, v = ({ size: t = "md", invalid: n, disabled: r, readOnly: i, className: a }) => e("kapi-taginput", t !== "md" && `kapi-taginput--${t}`, n && "kapi-taginput--err", r && "kapi-taginput--disabled", i && "kapi-taginput--readonly", a);
21
+ function y({ value: e, defaultValue: y = [], onChange: b, validate: se, maxTags: x, allowDuplicates: ce, caseSensitive: le, placeholder: ue, disabled: S = !1, size: C = "md", name: w, id: T, invalid: E, required: D, label: de, help: fe, fieldClassName: pe, readOnly: O, "aria-label": k, "aria-labelledby": A, "aria-describedby": j, onBlur: M, ref: N, labels: P, className: F, onClick: I, ...L }) {
22
+ let R = s("tagInput", _, P), z = o({
23
23
  id: T,
24
24
  label: de,
25
25
  help: fe,
@@ -27,8 +27,8 @@ function y({ value: s, defaultValue: y = [], onChange: b, validate: se, maxTags:
27
27
  invalid: E,
28
28
  readOnly: O,
29
29
  fieldClassName: pe
30
- }), B = z.field, V = i(O, B), H = oe(), [U, W, , me] = ee(s, y, b), [G, K] = g(""), [q, J] = g(null), Y = h(null), he = ne(Y, te(me)), X = h(null), ge = ae((t) => {
31
- X.current = t, e(N, t);
30
+ }), B = z.field, V = a(O, B), H = oe(), [U, W, , me] = ee(e, y, b), [G, K] = m(""), [q, J] = m(null), Y = p(null), he = ne(Y, te(me)), X = p(null), ge = ae((e) => {
31
+ X.current = e, t(N, e);
32
32
  }, [N]), _e = (e) => e.reason === "invalid" ? e.message : e.reason === "duplicate" ? `${R.duplicate} ${e.tag}` : `${R.max} ${x}`, Z = (e, t = "") => {
33
33
  let { values: n, rejected: r } = re(U, e, {
34
34
  validate: se,
@@ -55,13 +55,13 @@ function y({ value: s, defaultValue: y = [], onChange: b, validate: se, maxTags:
55
55
  let n = e.currentTarget, r = u(G, n.selectionStart ?? G.length, n.selectionEnd ?? G.length, t);
56
56
  Z(f(r));
57
57
  }, be = (e) => {
58
- n(e.relatedTarget, Y.current) && (G.trim() && !V && Z(f(G)), M?.(e));
58
+ r(e.relatedTarget, Y.current) && (G.trim() && !V && Z(f(G)), M?.(e));
59
59
  }, xe = (e) => {
60
60
  I?.(e), !(e.defaultPrevented || S) && (e.target.closest("button, input") || X.current?.focus());
61
61
  }, Se = (e) => {
62
62
  J(null), W(l(U, e)), X.current?.focus();
63
63
  }, $ = q !== null || (E ?? B?.invalid ?? !1);
64
- return z.wrap(/* @__PURE__ */ m("div", {
64
+ return z.wrap(/* @__PURE__ */ g("div", {
65
65
  ...L,
66
66
  ref: he,
67
67
  className: v({
@@ -74,13 +74,13 @@ function y({ value: s, defaultValue: y = [], onChange: b, validate: se, maxTags:
74
74
  onClick: xe,
75
75
  onBlur: be,
76
76
  children: [
77
- /* @__PURE__ */ m("div", {
77
+ /* @__PURE__ */ g("div", {
78
78
  className: "kapi-taginput__box",
79
- children: [U.length > 0 && /* @__PURE__ */ p("ul", {
79
+ children: [U.length > 0 && /* @__PURE__ */ h("ul", {
80
80
  className: "kapi-taginput__tags",
81
- children: U.map((e, t) => /* @__PURE__ */ p("li", {
81
+ children: U.map((e, t) => /* @__PURE__ */ h("li", {
82
82
  className: "kapi-taginput__item",
83
- children: /* @__PURE__ */ p(ie, {
83
+ children: /* @__PURE__ */ h(ie, {
84
84
  tone: "primary",
85
85
  size: C === "sm" ? "sm" : "md",
86
86
  onRemove: S || V ? void 0 : () => Se(t),
@@ -88,13 +88,13 @@ function y({ value: s, defaultValue: y = [], onChange: b, validate: se, maxTags:
88
88
  children: e
89
89
  })
90
90
  }, `${t}-${e}`))
91
- }), /* @__PURE__ */ p("input", {
91
+ }), /* @__PURE__ */ h("input", {
92
92
  ref: ge,
93
93
  type: "text",
94
94
  className: "kapi-taginput__input",
95
- ...t(B, {
95
+ ...n(B, {
96
96
  id: T,
97
- describedBy: r(q !== null && H, j),
97
+ describedBy: i(q !== null && H, j),
98
98
  invalid: $,
99
99
  required: D
100
100
  }),
@@ -110,13 +110,13 @@ function y({ value: s, defaultValue: y = [], onChange: b, validate: se, maxTags:
110
110
  onPaste: ye
111
111
  })]
112
112
  }),
113
- q !== null && /* @__PURE__ */ p("span", {
113
+ q !== null && /* @__PURE__ */ h("span", {
114
114
  id: H,
115
115
  className: "kapi-taginput__error",
116
116
  role: "alert",
117
117
  children: q
118
118
  }),
119
- w && U.map((e, t) => /* @__PURE__ */ p("input", {
119
+ w && U.map((e, t) => /* @__PURE__ */ h("input", {
120
120
  type: "hidden",
121
121
  name: w,
122
122
  value: e
@@ -7,8 +7,8 @@ import { inputClasses as i } from "./KapiInput.js";
7
7
  import { computedStyleOf as a } from "../../hooks/ownerDocument.js";
8
8
  import { rafThrottle as o } from "../../hooks/rafThrottle.js";
9
9
  import { autosizeHeight as s, rowsToHeight as c } from "./textareaLogic.js";
10
- import { jsx as l } from "react/jsx-runtime";
11
- import { useCallback as u, useEffect as d, useLayoutEffect as f, useRef as p } from "react";
10
+ import { useCallback as l, useEffect as u, useLayoutEffect as d, useRef as f } from "react";
11
+ import { jsx as p } from "react/jsx-runtime";
12
12
  //#region src/components/inputs/KapiTextarea.tsx
13
13
  var m = ({ status: e, autosize: t = !1, className: n = "" } = {}) => i({
14
14
  status: e,
@@ -26,9 +26,9 @@ var m = ({ status: e, autosize: t = !1, className: n = "" } = {}) => i({
26
26
  invalid: i,
27
27
  status: h,
28
28
  fieldClassName: y
29
- }), { controlId: j, helpId: M } = A, N = p(null), P = u((e) => {
29
+ }), { controlId: j, helpId: M } = A, N = f(null), P = l((e) => {
30
30
  N.current = e, typeof E == "function" ? E(e) : E && (E.current = e);
31
- }, [E]), F = p(null), I = u(() => {
31
+ }, [E]), F = f(null), I = l(() => {
32
32
  let e = N.current;
33
33
  if (!e || !b) return;
34
34
  let t = a(e), n = (e) => parseFloat(e) || 0;
@@ -45,11 +45,11 @@ var m = ({ status: e, autosize: t = !1, className: n = "" } = {}) => i({
45
45
  x,
46
46
  w
47
47
  ]), L = D.value;
48
- f(() => {
48
+ d(() => {
49
49
  I();
50
50
  }, [I, L]);
51
- let R = p(I);
52
- R.current = I, d(() => {
51
+ let R = f(I);
52
+ R.current = I, u(() => {
53
53
  let e = N.current;
54
54
  if (!e || !b || typeof ResizeObserver > "u") return;
55
55
  let t = null, n = o(() => R.current()), r = new ResizeObserver((e) => {
@@ -66,7 +66,7 @@ var m = ({ status: e, autosize: t = !1, className: n = "" } = {}) => i({
66
66
  }, [b]);
67
67
  let z = (e) => {
68
68
  I(), T?.(e);
69
- }, B = /* @__PURE__ */ l("textarea", {
69
+ }, B = /* @__PURE__ */ p("textarea", {
70
70
  ...D,
71
71
  ref: P,
72
72
  ...e(A.outer, {
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import { fieldContextValue as e, resolveValidation as t } from "./fieldLogic.js";
3
3
  import { KapiField as n, useKapiField as r } from "./KapiField.js";
4
- import { jsx as i } from "react/jsx-runtime";
5
- import { useId as a } from "react";
4
+ import { useId as i } from "react";
5
+ import { jsx as a } from "react/jsx-runtime";
6
6
  //#region src/components/inputs/ownField.tsx
7
7
  var o = ({ id: o, label: s, help: c, required: l, invalid: u, status: d, readOnly: f, fieldClassName: p }) => {
8
- let m = r(), h = a(), g = s != null || !!c, _ = o ?? (g ? h : m?.controlId), v = c ? `${_}-help` : void 0, { status: y } = t(u, d);
8
+ let m = r(), h = i(), g = s != null || !!c, _ = o ?? (g ? h : m?.controlId), v = c ? `${_}-help` : void 0, { status: y } = t(u, d);
9
9
  return {
10
10
  wraps: g,
11
11
  field: g ? e({
@@ -20,7 +20,7 @@ var o = ({ id: o, label: s, help: c, required: l, invalid: u, status: d, readOnl
20
20
  controlId: _,
21
21
  autoId: h,
22
22
  helpId: v,
23
- wrap: (e) => g ? /* @__PURE__ */ i(n, {
23
+ wrap: (e) => g ? /* @__PURE__ */ a(n, {
24
24
  label: s,
25
25
  htmlFor: _,
26
26
  required: l,
@@ -1,4 +1,5 @@
1
1
  import { type RefObject } from "react";
2
+ import type { KapiCloseReason } from "../closeReason.js";
2
3
  import type { KapiMenuItem } from "../overlays/KapiContextMenu.js";
3
4
  import { type KapiRootProps } from "../rootProps.js";
4
5
  import type { KapiLabelsOverride } from "../labelsLogic.js";
@@ -16,7 +17,7 @@ export type KapiAccountMenuProps = KapiRootProps<HTMLDivElement> & {
16
17
  /** Muestra u oculta el menú (controlado). */
17
18
  open: boolean;
18
19
  /** Pide cerrar el menú (Escape, click afuera o tras elegir una acción); el foco vuelve al disparador. */
19
- onClose: () => void;
20
+ onClose: (reason: KapiCloseReason) => void;
20
21
  /** Usuario de la cabecera: nombre, email, rol e iniciales opcionales. */
21
22
  user: KapiAccountMenuUser;
22
23
  /** Cantidad de notificaciones sin leer; con 0 o sin valor no se muestra el badge. */