@kapiuara/ui 0.15.3 → 0.16.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 (145) hide show
  1. package/LICENSE +19 -15
  2. package/README.md +338 -6
  3. package/dist/components/data/KapiDataTable.d.ts +1 -1
  4. package/dist/components/data/KapiDataTable.js +22 -22
  5. package/dist/components/data/KapiPaginationFooter.js +1 -1
  6. package/dist/components/data/KapiSheet.d.ts +105 -0
  7. package/dist/components/data/KapiSheet.js +75 -0
  8. package/dist/components/data/KapiTable.d.ts +2 -2
  9. package/dist/components/data/KapiTable.js +347 -329
  10. package/dist/components/data/KapiTableFooter.d.ts +22 -0
  11. package/dist/components/data/KapiTableFooter.js +55 -0
  12. package/dist/components/data/KapiTableRow.js +53 -52
  13. package/dist/components/data/KapiTableToolbar.d.ts +4 -2
  14. package/dist/components/data/KapiTableToolbar.js +71 -69
  15. package/dist/components/data/index.d.ts +3 -1
  16. package/dist/components/data/tableCells.d.ts +5 -4
  17. package/dist/components/data/tableCells.js +42 -41
  18. package/dist/components/data/tableLogic.d.ts +2 -0
  19. package/dist/components/data/tableLogic.js +66 -66
  20. package/dist/components/data/tableSlots.d.ts +9 -0
  21. package/dist/components/data/tableSlots.js +12 -0
  22. package/dist/components/data/tableSpanLogic.d.ts +35 -0
  23. package/dist/components/data/tableSpanLogic.js +47 -0
  24. package/dist/components/data/tableTypes.d.ts +54 -1
  25. package/dist/components/data/useTableSelection.d.ts +4 -2
  26. package/dist/components/data/useTableSelection.js +27 -23
  27. package/dist/components/display/KapiAnchor.d.ts +36 -0
  28. package/dist/components/display/KapiAnchor.js +36 -0
  29. package/dist/components/display/KapiBadge.d.ts +6 -5
  30. package/dist/components/display/KapiBadge.js +25 -19
  31. package/dist/components/display/KapiText.d.ts +43 -0
  32. package/dist/components/display/KapiText.js +33 -0
  33. package/dist/components/display/KapiTitle.d.ts +33 -0
  34. package/dist/components/display/KapiTitle.js +29 -0
  35. package/dist/components/display/index.d.ts +7 -0
  36. package/dist/components/display/textLogic.d.ts +32 -0
  37. package/dist/components/display/textLogic.js +19 -0
  38. package/dist/components/feedback/KapiAlert.d.ts +8 -4
  39. package/dist/components/feedback/KapiAlert.js +39 -34
  40. package/dist/components/inputs/KapiButton.d.ts +7 -4
  41. package/dist/components/inputs/KapiButton.js +47 -42
  42. package/dist/components/inputs/KapiSelect.d.ts +12 -0
  43. package/dist/components/inputs/KapiSelect.js +215 -212
  44. package/dist/components/inputs/KapiSelectMenu.d.ts +4 -2
  45. package/dist/components/inputs/KapiSelectMenu.js +131 -133
  46. package/dist/components/inputs/fieldLogic.d.ts +2 -2
  47. package/dist/components/inputs/index.d.ts +1 -1
  48. package/dist/components/inputs/selectSlots.d.ts +24 -0
  49. package/dist/components/inputs/selectSlots.js +27 -0
  50. package/dist/components/layout/KapiBox.d.ts +31 -0
  51. package/dist/components/layout/KapiBox.js +26 -0
  52. package/dist/components/layout/KapiCard.d.ts +16 -4
  53. package/dist/components/layout/KapiCard.js +46 -34
  54. package/dist/components/layout/KapiCenter.d.ts +13 -0
  55. package/dist/components/layout/KapiCenter.js +23 -0
  56. package/dist/components/layout/KapiCol.d.ts +22 -0
  57. package/dist/components/layout/KapiCol.js +23 -0
  58. package/dist/components/layout/KapiGrid.d.ts +29 -3
  59. package/dist/components/layout/KapiGrid.js +39 -17
  60. package/dist/components/layout/KapiPageHeader.d.ts +10 -1
  61. package/dist/components/layout/KapiPageHeader.js +82 -80
  62. package/dist/components/layout/KapiPanelParts.d.ts +11 -2
  63. package/dist/components/layout/KapiPanelParts.js +73 -56
  64. package/dist/components/layout/KapiRail.d.ts +10 -1
  65. package/dist/components/layout/KapiRail.js +123 -120
  66. package/dist/components/layout/KapiRoot.d.ts +35 -5
  67. package/dist/components/layout/KapiRoot.js +54 -39
  68. package/dist/components/layout/KapiShell.d.ts +36 -3
  69. package/dist/components/layout/KapiShell.js +53 -50
  70. package/dist/components/layout/cardSlots.d.ts +9 -0
  71. package/dist/components/layout/cardSlots.js +12 -0
  72. package/dist/components/layout/gridSpanLogic.d.ts +46 -0
  73. package/dist/components/layout/gridSpanLogic.js +39 -0
  74. package/dist/components/layout/index.d.ts +11 -4
  75. package/dist/components/layout/layoutPrimitives.d.ts +11 -0
  76. package/dist/components/layout/layoutPrimitives.js +12 -1
  77. package/dist/components/layout/pageHeaderSlots.d.ts +12 -0
  78. package/dist/components/layout/pageHeaderSlots.js +15 -0
  79. package/dist/components/layout/railLogic.d.ts +16 -3
  80. package/dist/components/layout/railSlots.d.ts +12 -0
  81. package/dist/components/layout/railSlots.js +15 -0
  82. package/dist/components/layout/shellSlots.d.ts +6 -0
  83. package/dist/components/layout/shellSlots.js +9 -0
  84. package/dist/components/layout/useGridBreakpoint.d.ts +12 -0
  85. package/dist/components/layout/useGridBreakpoint.js +35 -0
  86. package/dist/components/navigation/KapiBreadcrumb.d.ts +18 -2
  87. package/dist/components/navigation/KapiBreadcrumb.js +23 -16
  88. package/dist/components/navigation/KapiContextPanel.d.ts +17 -4
  89. package/dist/components/navigation/KapiContextPanel.js +151 -135
  90. package/dist/components/navigation/KapiPanelGroup.d.ts +16 -4
  91. package/dist/components/navigation/KapiPanelGroup.js +66 -65
  92. package/dist/components/navigation/KapiTabs.d.ts +12 -0
  93. package/dist/components/navigation/KapiTabs.js +87 -71
  94. package/dist/components/navigation/MiniNavItem.d.ts +7 -2
  95. package/dist/components/navigation/MiniNavItem.js +41 -36
  96. package/dist/components/navigation/breadcrumbLogic.d.ts +4 -2
  97. package/dist/components/navigation/breadcrumbLogic.js +1 -1
  98. package/dist/components/navigation/navLink.d.ts +21 -0
  99. package/dist/components/navigation/navLink.js +26 -0
  100. package/dist/components/navigation/navLinkLogic.d.ts +18 -0
  101. package/dist/components/navigation/navLinkLogic.js +22 -0
  102. package/dist/components/overlays/KapiContextMenu.d.ts +8 -0
  103. package/dist/components/overlays/KapiModal.d.ts +9 -0
  104. package/dist/components/overlays/KapiModal.js +77 -75
  105. package/dist/components/overlays/index.d.ts +1 -1
  106. package/dist/components/overlays/menuList.js +123 -113
  107. package/dist/components/overlays/modalSlots.d.ts +11 -0
  108. package/dist/components/overlays/modalSlots.js +14 -0
  109. package/dist/components/slotCatalog.d.ts +90 -0
  110. package/dist/components/slotCatalog.js +19 -0
  111. package/dist/components/slotsLogic.d.ts +34 -0
  112. package/dist/components/slotsLogic.js +18 -0
  113. package/dist/components/tone.d.ts +26 -0
  114. package/dist/components/tone.js +15 -14
  115. package/dist/css/base.css +1 -1
  116. package/dist/css/components/data/KapiEventCalendar.css +1 -1
  117. package/dist/css/components/data/KapiTable.css +1 -1
  118. package/dist/css/components/display/display.css +1 -1
  119. package/dist/css/components/display/typography.css +1 -0
  120. package/dist/css/components/feedback/feedback.css +1 -1
  121. package/dist/css/components/inputs/KapiButton.css +1 -1
  122. package/dist/css/components/inputs/KapiDatePicker.css +1 -1
  123. package/dist/css/components/layout/KapiBox.css +1 -0
  124. package/dist/css/components/layout/KapiRail.css +1 -1
  125. package/dist/css/components/layout/gridSpan.css +1 -0
  126. package/dist/css/components/navigation/navigation.css +1 -1
  127. package/dist/hooks/densityLogic.d.ts +15 -0
  128. package/dist/hooks/densityLogic.js +4 -0
  129. package/dist/hooks/index.d.ts +4 -0
  130. package/dist/hooks/themeColorsLogic.d.ts +19 -0
  131. package/dist/hooks/themeColorsLogic.js +4 -2
  132. package/dist/hooks/themeDeriveLogic.d.ts +16 -0
  133. package/dist/hooks/themeDeriveLogic.js +27 -17
  134. package/dist/hooks/toneFamilyLogic.d.ts +122 -0
  135. package/dist/hooks/toneFamilyLogic.js +151 -0
  136. package/dist/hooks/useKapiTheme.d.ts +8 -2
  137. package/dist/hooks/useKapiTheme.js +116 -103
  138. package/dist/hooks/useToneFamilies.d.ts +30 -0
  139. package/dist/hooks/useToneFamilies.js +46 -0
  140. package/dist/index.d.ts +3 -1
  141. package/dist/index.js +213 -204
  142. package/dist/kapi.css +1 -1
  143. package/dist/kapi.layered.css +1 -1
  144. package/dist/styles/rawHeights.d.ts +8 -0
  145. package/package.json +2 -2
@@ -1,173 +1,171 @@
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 { 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
- import { Check as l } from "lucide-react";
7
- import { createPortal as u } from "react-dom";
4
+ import { slot as n } from "../slotsLogic.js";
5
+ import { SELECT_SLOTS as r } from "./selectSlots.js";
6
+ import { memo as i, useCallback as a, useLayoutEffect as o, useMemo as s, useRef as c } from "react";
7
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
8
+ import { Check as d } from "lucide-react";
9
+ import { createPortal as f } from "react-dom";
8
10
  //#region src/components/inputs/KapiSelectMenu.tsx
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
+ var p = 38, m = 264, h = 4, g = i(({ optionClass: e, checkClass: t, option: i, index: a, id: o, selected: s, active: c, create: f, vindex: p, setSize: m, renderOption: h, query: g, onHover: _, onChoose: v }) => /* @__PURE__ */ u("li", {
12
+ id: o,
11
13
  role: "option",
12
- "aria-selected": r,
13
- "aria-disabled": e.disabled || void 0,
14
- "data-kapisel-index": t,
15
- "data-vindex": o,
16
- "aria-setsize": o === void 0 ? void 0 : u,
17
- "aria-posinset": o === void 0 ? void 0 : t + 1,
18
- className: [
19
- "kapisel__opt",
20
- i && "kapisel__opt--active",
21
- r && "kapisel__opt--selected",
22
- a && "kapisel__opt--create",
23
- e.disabled && "kapisel__opt--disabled"
24
- ].filter(Boolean).join(" "),
14
+ "aria-selected": s,
15
+ "aria-disabled": i.disabled || void 0,
16
+ "data-kapisel-index": a,
17
+ "data-vindex": p,
18
+ "aria-setsize": p === void 0 ? void 0 : m,
19
+ "aria-posinset": p === void 0 ? void 0 : a + 1,
20
+ ...n(r, "option", { option: e }, c && "kapisel__opt--active", s && "kapisel__opt--selected", f && "kapisel__opt--create", i.disabled && "kapisel__opt--disabled"),
25
21
  onMouseMove: () => {
26
- !e.disabled && !i && p(t);
22
+ !i.disabled && !c && _(a);
27
23
  },
28
- onClick: (t) => m(e, t.shiftKey),
29
- children: [/* @__PURE__ */ s("span", {
24
+ onClick: (e) => v(i, e.shiftKey),
25
+ children: [/* @__PURE__ */ l("span", {
30
26
  className: "kapisel__opt-body",
31
- children: d && !a ? d(e, {
32
- selected: r,
33
- active: i,
34
- disabled: e.disabled === !0,
35
- query: f
36
- }) : e.label
37
- }), r && /* @__PURE__ */ s(l, {
38
- className: "kapisel__check",
27
+ children: h && !f ? h(i, {
28
+ selected: s,
29
+ active: c,
30
+ disabled: i.disabled === !0,
31
+ query: g
32
+ }) : i.label
33
+ }), s && /* @__PURE__ */ l(d, {
34
+ ...n(r, "check", { check: t }),
39
35
  size: 15,
40
36
  strokeWidth: 2.4,
41
37
  "aria-hidden": "true"
42
38
  })]
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
- M,
46
- S,
47
- C,
48
- w
49
- ]), L = a(() => I?.rows.map((e) => e.key), [I]), R = t({
50
- enabled: M && !T,
51
- count: I?.rows.length ?? 0,
52
- scrollRef: F,
53
- estimate: d,
39
+ })), _ = ({ classNames: i, root: d, ref: _, side: v, hug: y, style: b, listboxId: x, optionId: S, multiple: C, "aria-label": w, rows: T, createRow: E, createIndex: D, loading: O, empty: k, message: A, active: j, values: M, renderOption: N, query: P, virtual: F, onHover: I, onChoose: L }) => {
40
+ let R = c(null), z = s(() => F ? e(T, E, D) : null, [
41
+ F,
42
+ T,
43
+ E,
44
+ D
45
+ ]), B = s(() => z?.rows.map((e) => e.key), [z]), V = t({
46
+ enabled: F && !O,
47
+ count: z?.rows.length ?? 0,
48
+ scrollRef: R,
49
+ estimate: p,
54
50
  measure: !0,
55
- keys: L,
56
- overscan: p,
57
- fallbackViewHeight: f
58
- }), { scrollToIndex: z } = R, B = O >= 0 ? I?.rowOf[O] : void 0;
59
- i(() => {
60
- B !== void 0 && z(B);
61
- }, [B, z]);
62
- let V = a(() => new Set(k), [k]), H = o({
63
- onHover: N,
64
- onChoose: P
51
+ keys: B,
52
+ overscan: h,
53
+ fallbackViewHeight: m
54
+ }), { scrollToIndex: H } = V, U = j >= 0 ? z?.rowOf[j] : void 0;
55
+ o(() => {
56
+ U !== void 0 && H(U);
57
+ }, [U, H]);
58
+ let W = s(() => new Set(M), [M]), G = c({
59
+ onHover: I,
60
+ onChoose: L
65
61
  });
66
- i(() => {
67
- H.current = {
68
- onHover: N,
69
- onChoose: P
62
+ o(() => {
63
+ G.current = {
64
+ onHover: I,
65
+ onChoose: L
70
66
  };
71
67
  });
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, {
68
+ let K = a((e) => G.current.onHover(e), []), q = a((e, t) => G.current.onChoose(e, t), []), J = D + 1, Y = ({ option: e, index: t }, n) => {
69
+ let r = e === E, a = N && !r ? N : void 0;
70
+ return /* @__PURE__ */ l(g, {
71
+ optionClass: i?.option,
72
+ checkClass: i?.check,
75
73
  option: e,
76
74
  index: t,
77
- id: y(t),
78
- selected: V.has(e.value),
79
- active: t === O,
75
+ id: S(t),
76
+ selected: W.has(e.value),
77
+ active: t === j,
80
78
  create: r,
81
79
  vindex: n,
82
- setSize: n === void 0 ? void 0 : G,
83
- renderOption: i,
84
- query: i ? j : "",
85
- onHover: U,
86
- onChoose: W
80
+ setSize: n === void 0 ? void 0 : J,
81
+ renderOption: a,
82
+ query: a ? P : "",
83
+ onHover: K,
84
+ onChoose: q
87
85
  }, `${e.value}-${t}`);
86
+ }, X = (e, t, a, o, s) => {
87
+ let c = [];
88
+ o > 0 && c.push(/* @__PURE__ */ l("li", {
89
+ role: "presentation",
90
+ "aria-hidden": !0,
91
+ style: { height: o }
92
+ }, "pad-top"));
93
+ let d = t;
94
+ for (; d < a;) {
95
+ let t = e[d];
96
+ if (t.group === null) {
97
+ t.kind === "option" && c.push(Y(t.item, d)), d += 1;
98
+ continue;
99
+ }
100
+ let o = t.group, s = null, f = [];
101
+ for (; d < a && e[d].group?.key === o.key;) {
102
+ let t = e[d];
103
+ t.kind === "header" ? s = /* @__PURE__ */ l("div", {
104
+ ...n(r, "groupLabel", i),
105
+ "aria-hidden": "true",
106
+ "data-vindex": d,
107
+ children: o.label
108
+ }, "h") : f.push(Y(t.item, d)), d += 1;
109
+ }
110
+ c.push(/* @__PURE__ */ u("li", {
111
+ role: "presentation",
112
+ ...n(r, "group", i),
113
+ children: [s, f.length > 0 && /* @__PURE__ */ l("ul", {
114
+ role: "group",
115
+ "aria-label": o.label,
116
+ className: "kapisel__group-list",
117
+ children: f
118
+ })]
119
+ }, o.key));
120
+ }
121
+ return s > 0 && c.push(/* @__PURE__ */ l("li", {
122
+ role: "presentation",
123
+ "aria-hidden": !0,
124
+ style: { height: s }
125
+ }, "pad-bottom")), c;
88
126
  };
89
- return u(/* @__PURE__ */ c("div", {
90
- ref: l,
91
- className: `kapisel__menu kapisel__menu--${h}${g ? " kapisel__menu--hug" : ""}`,
92
- style: _,
127
+ return f(/* @__PURE__ */ u("div", {
128
+ ref: _,
129
+ ...n(r, "menu", i, `kapisel__menu--${v}`, y && "kapisel__menu--hug"),
130
+ style: b,
93
131
  onMouseDown: (e) => e.preventDefault(),
94
- children: [/* @__PURE__ */ c("ul", {
95
- id: v,
132
+ children: [/* @__PURE__ */ u("ul", {
133
+ id: x,
96
134
  role: "listbox",
97
- "aria-multiselectable": b || void 0,
98
- "aria-label": x,
99
- className: M ? "kapisel__list kapisel__list--virtual" : "kapisel__list",
100
- hidden: E || T,
101
- ref: F,
102
- onScroll: M ? R.onScroll : void 0,
135
+ "aria-multiselectable": C || void 0,
136
+ "aria-label": w,
137
+ ...n(r, "list", i, F && "kapisel__list--virtual"),
138
+ hidden: k || O,
139
+ ref: R,
140
+ onScroll: F ? V.onScroll : void 0,
103
141
  children: [
104
- !T && I && ((e, t, n, r, i) => {
105
- let a = [];
106
- r > 0 && a.push(/* @__PURE__ */ s("li", {
107
- role: "presentation",
108
- "aria-hidden": !0,
109
- style: { height: r }
110
- }, "pad-top"));
111
- let o = t;
112
- for (; o < n;) {
113
- let t = e[o];
114
- if (t.group === null) {
115
- t.kind === "option" && a.push(K(t.item, o)), o += 1;
116
- continue;
117
- }
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
- className: "kapisel__group-label",
123
- "aria-hidden": "true",
124
- "data-vindex": o,
125
- children: r.label
126
- }, "h") : l.push(K(t.item, o)), o += 1;
127
- }
128
- a.push(/* @__PURE__ */ c("li", {
129
- role: "presentation",
130
- className: "kapisel__group",
131
- children: [i, l.length > 0 && /* @__PURE__ */ s("ul", {
132
- role: "group",
133
- "aria-label": r.label,
134
- className: "kapisel__group-list",
135
- children: l
136
- })]
137
- }, r.key));
138
- }
139
- return i > 0 && a.push(/* @__PURE__ */ s("li", {
140
- role: "presentation",
141
- "aria-hidden": !0,
142
- style: { height: i }
143
- }, "pad-bottom")), a;
144
- })(I.rows, R.start, R.end, R.padTop, R.padBottom),
145
- !T && !I && S.map((e) => e.kind === "option" ? K(e.item) : /* @__PURE__ */ c("li", {
142
+ !O && z && X(z.rows, V.start, V.end, V.padTop, V.padBottom),
143
+ !O && !z && T.map((e) => e.kind === "option" ? Y(e.item) : /* @__PURE__ */ u("li", {
146
144
  role: "presentation",
147
- className: "kapisel__group",
148
- children: [/* @__PURE__ */ s("div", {
149
- className: "kapisel__group-label",
145
+ ...n(r, "group", i),
146
+ children: [/* @__PURE__ */ l("div", {
147
+ ...n(r, "groupLabel", i),
150
148
  "aria-hidden": "true",
151
149
  children: e.label
152
- }), /* @__PURE__ */ s("ul", {
150
+ }), /* @__PURE__ */ l("ul", {
153
151
  role: "group",
154
152
  "aria-label": e.label,
155
153
  className: "kapisel__group-list",
156
- children: e.items.map((e) => K(e))
154
+ children: e.items.map((e) => Y(e))
157
155
  })]
158
156
  }, e.key)),
159
- !I && C && K({
160
- option: C,
161
- index: w
157
+ !z && E && Y({
158
+ option: E,
159
+ index: D
162
160
  })
163
161
  ]
164
- }), D != null && D !== !1 && D !== "" && /* @__PURE__ */ s("div", {
165
- className: "kapisel__status",
162
+ }), A != null && A !== !1 && A !== "" && /* @__PURE__ */ l("div", {
163
+ ...n(r, "status", i),
166
164
  role: "status",
167
165
  "aria-live": "polite",
168
- children: D
166
+ children: A
169
167
  })]
170
- }), n);
168
+ }), d);
171
169
  };
172
170
  //#endregion
173
- export { h as KapiSelectMenu };
171
+ export { _ as KapiSelectMenu };
@@ -84,8 +84,8 @@ export declare const nativeFieldProps: (ctx: KapiFieldContextValue | null, own:
84
84
  }) => {
85
85
  id: string | undefined;
86
86
  "aria-describedby": string | undefined;
87
- "aria-invalid": boolean | "true" | "false" | "grammar" | "spelling" | undefined;
88
- "aria-required": (boolean | "true" | "false") | undefined;
87
+ "aria-invalid": boolean | "false" | "true" | "grammar" | "spelling" | undefined;
88
+ "aria-required": (boolean | "false" | "true") | undefined;
89
89
  "aria-busy": true | undefined;
90
90
  };
91
91
  /**
@@ -54,7 +54,7 @@ export { KapiSelect,
54
54
  /** @deprecated Interno, se quita en 1.0. */
55
55
  selectClasses, DEFAULT_SELECT_LABELS } from "./KapiSelect.js";
56
56
  export type { KapiSelectLabels, KapiSelectRenderContext } from "./KapiSelect.js";
57
- export type { KapiSelectProps, KapiSelectBaseProps, KapiSelectSingleProps, KapiSelectMultiProps, KapiSelectSize, KapiSelectVariant, KapiSelectOption, KapiSelectGroup, KapiSelectEntry } from "./KapiSelect.js";
57
+ export type { KapiSelectClassNames, KapiSelectProps, KapiSelectBaseProps, KapiSelectSingleProps, KapiSelectMultiProps, KapiSelectSize, KapiSelectVariant, KapiSelectOption, KapiSelectGroup, KapiSelectEntry } from "./KapiSelect.js";
58
58
  export { KapiCalendar } from "./KapiCalendar.js";
59
59
  export { KapiDatePicker } from "./KapiDatePicker.js";
60
60
  export { DEFAULT_CALENDAR_LABELS, DEFAULT_DATE_PATTERN,
@@ -0,0 +1,24 @@
1
+ /** Partes de `select` (ver `slotCatalog.ts` para el contrato). Vive junto al componente para que su CSS lo siga. */
2
+ export declare const SELECT_SLOTS: import("../slotsLogic.js").SlotTable<"select", {
3
+ readonly root: null;
4
+ readonly icon: "kapisel__icon";
5
+ readonly label: "kapisel__chiplabel";
6
+ readonly values: "kapisel__values";
7
+ readonly single: "kapisel__single";
8
+ readonly placeholder: "kapisel__placeholder";
9
+ readonly tag: "kapisel__chip";
10
+ readonly tagLabel: "kapisel__chip-label";
11
+ readonly tagRemove: "kapisel__chip-x";
12
+ readonly input: "kapisel__input";
13
+ readonly combo: "kapisel__combo";
14
+ readonly spinner: "kapisel__spinner";
15
+ readonly clear: "kapisel__clear";
16
+ readonly caret: "kapisel__caret";
17
+ readonly menu: "kapisel__menu";
18
+ readonly list: "kapisel__list";
19
+ readonly group: "kapisel__group";
20
+ readonly groupLabel: "kapisel__group-label";
21
+ readonly option: "kapisel__opt";
22
+ readonly check: "kapisel__check";
23
+ readonly status: "kapisel__status";
24
+ }>;
@@ -0,0 +1,27 @@
1
+ import { defineSlots as e } from "../slotsLogic.js";
2
+ //#region src/components/inputs/selectSlots.ts
3
+ var t = e("select", {
4
+ root: null,
5
+ icon: "kapisel__icon",
6
+ label: "kapisel__chiplabel",
7
+ values: "kapisel__values",
8
+ single: "kapisel__single",
9
+ placeholder: "kapisel__placeholder",
10
+ tag: "kapisel__chip",
11
+ tagLabel: "kapisel__chip-label",
12
+ tagRemove: "kapisel__chip-x",
13
+ input: "kapisel__input",
14
+ combo: "kapisel__combo",
15
+ spinner: "kapisel__spinner",
16
+ clear: "kapisel__clear",
17
+ caret: "kapisel__caret",
18
+ menu: "kapisel__menu",
19
+ list: "kapisel__list",
20
+ group: "kapisel__group",
21
+ groupLabel: "kapisel__group-label",
22
+ option: "kapisel__opt",
23
+ check: "kapisel__check",
24
+ status: "kapisel__status"
25
+ });
26
+ //#endregion
27
+ export { t as SELECT_SLOTS };
@@ -0,0 +1,31 @@
1
+ import type { HTMLAttributes, Ref } from "react";
2
+ import { type KapiRender } from "../renderSlot.js";
3
+ import { type KapiGap } from "./layoutPrimitives.js";
4
+ /** Elementos que puede dibujar `KapiBox`: contenedores y secciones, no texto ni tablas. */
5
+ export type KapiBoxElement = "div" | "section" | "article" | "aside" | "header" | "footer" | "main" | "nav" | "span";
6
+ export type KapiBoxProps = HTMLAttributes<HTMLElement> & {
7
+ /** Ref al elemento raíz. */
8
+ ref?: Ref<HTMLElement> | undefined;
9
+ /**
10
+ * Elemento que se dibuja.
11
+ * @default "div"
12
+ */
13
+ as?: KapiBoxElement | undefined;
14
+ /**
15
+ * Relleno interno en los cuatro lados: número = px, string = largo CSS CON unidad
16
+ * (`"1rem"`, `"var(--kapi-space-8)"`). Un string sin unidad (`"16"`) lo descarta el navegador en
17
+ * silencio; lo caza `gapSource.test.ts`. Sin `pad` no hay relleno.
18
+ */
19
+ pad?: KapiGap | undefined;
20
+ /** Relleno a izquierda y derecha; pisa a `pad` en ese eje. */
21
+ padX?: KapiGap | undefined;
22
+ /** Relleno arriba y abajo; pisa a `pad` en ese eje. */
23
+ padY?: KapiGap | undefined;
24
+ /** Dibuja OTRO elemento con las clases de la caja, como en `KapiButton`. Gana sobre `as`. */
25
+ render?: KapiRender | undefined;
26
+ };
27
+ /**
28
+ * Caja neutra: un elemento con `ref`, passthrough nativo, `as` y `render`. No es un contenedor de
29
+ * layout —para apilar o alinear hijos están `KapiStack`, `KapiCluster`, `KapiGrid` y `KapiCenter`—.
30
+ */
31
+ export declare const KapiBox: ({ as, pad, padX, padY, render, className, style, ref, children, ...rest }: KapiBoxProps) => import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
@@ -0,0 +1,26 @@
1
+ "use client";
2
+ import "#kapi-css/components/layout/KapiBox.css";
3
+ import { joinClasses as e } from "../rootProps.js";
4
+ import { renderSlot as t } from "../renderSlot.js";
5
+ import { boxStyle as n } from "./layoutPrimitives.js";
6
+ /* empty css */
7
+ import { jsx as r } from "react/jsx-runtime";
8
+ //#region src/components/layout/KapiBox.tsx
9
+ var i = ({ as: i = "div", pad: a, padX: o, padY: s, render: c, className: l, style: u, ref: d, children: f, ...p }) => {
10
+ let m = {
11
+ className: e("kapi-box", l),
12
+ style: n({
13
+ pad: a,
14
+ padX: o,
15
+ padY: s,
16
+ style: u
17
+ }),
18
+ ...p
19
+ }, h = i;
20
+ return t(c, m, {
21
+ ref: d,
22
+ children: f
23
+ }, (e) => /* @__PURE__ */ r(h, { ...e }));
24
+ };
25
+ //#endregion
26
+ export { i as KapiBox };
@@ -1,8 +1,13 @@
1
1
  import type { HTMLAttributes, ReactNode, Ref } from "react";
2
+ import type { KapiClassNames } from "../slotCatalog.js";
3
+ /** Partes de `KapiCard` que acepta `classNames` (`root`, `header`, `title`, `actions`, `body`, `footer`). */
4
+ export type KapiCardClassNames = KapiClassNames<"card">;
2
5
  type DivProps = Omit<HTMLAttributes<HTMLDivElement>, "title">;
3
6
  type KapiCardSectionProps = DivProps & {
4
7
  /** Ref al `<div>` de la sección. */
5
8
  ref?: Ref<HTMLDivElement> | undefined;
9
+ /** Clases por parte (acá cuenta `body` o `footer`, según la sección). Se suman a las propias. */
10
+ classNames?: KapiCardClassNames | undefined;
6
11
  };
7
12
  export type KapiCardHeaderProps = DivProps & {
8
13
  /** Ref al `<div>` de la cabecera. */
@@ -11,13 +16,15 @@ export type KapiCardHeaderProps = DivProps & {
11
16
  title?: ReactNode;
12
17
  /** Acciones a la derecha (botones, badge, link…). */
13
18
  actions?: ReactNode;
19
+ /** Clases por parte (acá cuentan `header`, `title` y `actions`). Se suman a las propias. */
20
+ classNames?: KapiCardClassNames | undefined;
14
21
  };
15
22
  /** Cabecera de card: título a la izquierda, acciones a la derecha. */
16
- export declare function KapiCardHeader({ title, actions, className, children, ...rest }: KapiCardHeaderProps): import("react").JSX.Element;
23
+ export declare function KapiCardHeader({ title, actions, className, classNames, children, ...rest }: KapiCardHeaderProps): import("react").JSX.Element;
17
24
  /** Cuerpo de card (ocupa el alto restante). */
18
- export declare function KapiCardBody({ className, ...rest }: KapiCardSectionProps): import("react").JSX.Element;
25
+ export declare function KapiCardBody({ className, classNames, ...rest }: KapiCardSectionProps): import("react").JSX.Element;
19
26
  /** Pie de card, con separador superior y acciones alineadas a la derecha. */
20
- export declare function KapiCardFooter({ className, ...rest }: KapiCardSectionProps): import("react").JSX.Element;
27
+ export declare function KapiCardFooter({ className, classNames, ...rest }: KapiCardSectionProps): import("react").JSX.Element;
21
28
  export type KapiCardProps = DivProps & {
22
29
  /** Ref al `<div>` raíz de la tarjeta. */
23
30
  ref?: Ref<HTMLDivElement> | undefined;
@@ -41,10 +48,15 @@ export type KapiCardProps = DivProps & {
41
48
  * Default `false`: una card de panel estática no se mueve. Sin movimiento, el lift se apaga.
42
49
  */
43
50
  interactive?: boolean | undefined;
51
+ /**
52
+ * Clases por parte (`root`, `header`, `title`, `actions`, `body`, `footer`): `classNames={{ header: "mi-header" }}`.
53
+ * Se suman a las propias, sin reemplazarlas. Cada parte además lleva `data-slot="card-<parte>"`.
54
+ */
55
+ classNames?: KapiCardClassNames | undefined;
44
56
  };
45
57
  /**
46
58
  * Card. Dos formas de uso: props (`title`/`actions`/`footer` + children)
47
59
  * o composición con `KapiCardHeader`, `KapiCardBody` y `KapiCardFooter`.
48
60
  */
49
- export declare function KapiCard({ title, actions, footer, flush, responsive, interactive, className, children, ...rest }: KapiCardProps): import("react").JSX.Element;
61
+ export declare function KapiCard({ title, actions, footer, flush, responsive, interactive, className, classNames, children, ...rest }: KapiCardProps): import("react").JSX.Element;
50
62
  export {};
@@ -1,54 +1,66 @@
1
1
  "use client";
2
2
  import "#kapi-css/components/layout/KapiCard.css";
3
- import { cardClasses as e, hasCardHeader as t } from "./cardLogic.js";
3
+ import { slot as e } from "../slotsLogic.js";
4
+ import { cardClasses as t, hasCardHeader as n } from "./cardLogic.js";
5
+ import { CARD_SLOTS as r } from "./cardSlots.js";
4
6
  /* empty css */
5
- import { jsx as n, jsxs as r } from "react/jsx-runtime";
7
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
8
  //#region src/components/layout/KapiCard.tsx
7
- function i({ title: e, actions: t, className: i, children: a, ...o }) {
8
- return /* @__PURE__ */ r("div", {
9
- className: ["kapi-panelcard__head", i].filter(Boolean).join(" "),
10
- ...o,
9
+ function o({ title: t, actions: n, className: o, classNames: s, children: c, ...l }) {
10
+ return /* @__PURE__ */ a("div", {
11
+ ...l,
12
+ ...e(r, "header", s, o),
11
13
  children: [
12
- e != null && /* @__PURE__ */ n("span", { children: e }),
13
- a,
14
- t != null && /* @__PURE__ */ n("span", {
15
- className: "kapi-panelcard__actions",
14
+ t != null && /* @__PURE__ */ i("span", {
15
+ ...e(r, "title", s),
16
16
  children: t
17
+ }),
18
+ c,
19
+ n != null && /* @__PURE__ */ i("span", {
20
+ ...e(r, "actions", s),
21
+ children: n
17
22
  })
18
23
  ]
19
24
  });
20
25
  }
21
- function a({ className: e, ...t }) {
22
- return /* @__PURE__ */ n("div", {
23
- className: ["kapi-card__body", e].filter(Boolean).join(" "),
24
- ...t
26
+ function s({ className: t, classNames: n, ...a }) {
27
+ return /* @__PURE__ */ i("div", {
28
+ ...a,
29
+ ...e(r, "body", n, t)
25
30
  });
26
31
  }
27
- function o({ className: e, ...t }) {
28
- return /* @__PURE__ */ n("div", {
29
- className: ["kapi-card__foot", e].filter(Boolean).join(" "),
30
- ...t
32
+ function c({ className: t, classNames: n, ...a }) {
33
+ return /* @__PURE__ */ i("div", {
34
+ ...a,
35
+ ...e(r, "footer", n, t)
31
36
  });
32
37
  }
33
- function s({ title: s, actions: c, footer: l, flush: u = !1, responsive: d = !1, interactive: f = !1, className: p, children: m, ...h }) {
34
- let g = t(s, c) || l != null;
35
- return /* @__PURE__ */ r("div", {
36
- className: e({
37
- flush: u,
38
- responsive: d,
39
- interactive: f,
40
- className: p
41
- }),
42
- ...h,
38
+ function l({ title: l, actions: u, footer: d, flush: f = !1, responsive: p = !1, interactive: m = !1, className: h, classNames: g, children: _, ...v }) {
39
+ let y = n(l, u) || d != null;
40
+ return /* @__PURE__ */ a("div", {
41
+ ...v,
42
+ ...e(r, "root", g, t({
43
+ flush: f,
44
+ responsive: p,
45
+ interactive: m,
46
+ className: h
47
+ })),
43
48
  children: [
44
- t(s, c) && /* @__PURE__ */ n(i, {
45
- title: s,
46
- actions: c
49
+ n(l, u) && /* @__PURE__ */ i(o, {
50
+ title: l,
51
+ actions: u,
52
+ classNames: g
47
53
  }),
48
- g ? /* @__PURE__ */ n(a, { children: m }) : m,
49
- l != null && /* @__PURE__ */ n(o, { children: l })
54
+ y ? /* @__PURE__ */ i(s, {
55
+ classNames: g,
56
+ children: _
57
+ }) : _,
58
+ d != null && /* @__PURE__ */ i(c, {
59
+ classNames: g,
60
+ children: d
61
+ })
50
62
  ]
51
63
  });
52
64
  }
53
65
  //#endregion
54
- export { s as KapiCard, a as KapiCardBody, o as KapiCardFooter, i as KapiCardHeader };
66
+ export { l as KapiCard, s as KapiCardBody, c as KapiCardFooter, o as KapiCardHeader };
@@ -0,0 +1,13 @@
1
+ import type { HTMLAttributes, Ref } from "react";
2
+ import { type KapiGap } from "./layoutPrimitives.js";
3
+ export type KapiCenterProps = HTMLAttributes<HTMLDivElement> & {
4
+ /** Ref al `<div>` raíz. */
5
+ ref?: Ref<HTMLDivElement> | undefined;
6
+ /** Espacio entre hijos: número = px, string = largo CSS. Default 12px. */
7
+ gap?: KapiGap | undefined;
8
+ };
9
+ /**
10
+ * Centra su contenido en los dos ejes. Es `KapiCluster` con `justify="center"`, `align="center"` y sin
11
+ * salto de línea, fijado: no hay un motor de layout nuevo, sólo el nombre de un caso que se pide mucho.
12
+ */
13
+ export declare function KapiCenter({ gap, className, style, children, ...rest }: KapiCenterProps): import("react").JSX.Element;
@@ -0,0 +1,23 @@
1
+ "use client";
2
+ import "#kapi-css/components/layout/layout-primitives.css";
3
+ import { clusterProps as e } from "./layoutPrimitives.js";
4
+ /* empty css */
5
+ import { jsx as t } from "react/jsx-runtime";
6
+ //#region src/components/layout/KapiCenter.tsx
7
+ function n({ gap: n, className: r, style: i, children: a, ...o }) {
8
+ let s = e({
9
+ gap: n,
10
+ justify: "center",
11
+ align: "center",
12
+ wrap: !1,
13
+ className: r === void 0 ? "kapi-center" : `kapi-center ${r}`,
14
+ style: i
15
+ });
16
+ return /* @__PURE__ */ t("div", {
17
+ ...o,
18
+ ...s,
19
+ children: a
20
+ });
21
+ }
22
+ //#endregion
23
+ export { n as KapiCenter };