@kapiuara/ui 0.15.2 → 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.
- package/LICENSE +19 -15
- package/README.md +338 -6
- package/dist/components/data/KapiDataTable.d.ts +1 -1
- package/dist/components/data/KapiDataTable.js +22 -22
- package/dist/components/data/KapiPaginationFooter.js +1 -1
- package/dist/components/data/KapiSheet.d.ts +105 -0
- package/dist/components/data/KapiSheet.js +75 -0
- package/dist/components/data/KapiTable.d.ts +2 -2
- package/dist/components/data/KapiTable.js +347 -329
- package/dist/components/data/KapiTableFooter.d.ts +22 -0
- package/dist/components/data/KapiTableFooter.js +55 -0
- package/dist/components/data/KapiTableRow.js +53 -52
- package/dist/components/data/KapiTableToolbar.d.ts +4 -2
- package/dist/components/data/KapiTableToolbar.js +71 -69
- package/dist/components/data/index.d.ts +3 -1
- package/dist/components/data/tableCells.d.ts +5 -4
- package/dist/components/data/tableCells.js +48 -43
- package/dist/components/data/tableLogic.d.ts +2 -0
- package/dist/components/data/tableLogic.js +66 -66
- package/dist/components/data/tableSlots.d.ts +9 -0
- package/dist/components/data/tableSlots.js +12 -0
- package/dist/components/data/tableSpanLogic.d.ts +35 -0
- package/dist/components/data/tableSpanLogic.js +47 -0
- package/dist/components/data/tableTypes.d.ts +66 -1
- package/dist/components/data/useTableSelection.d.ts +4 -2
- package/dist/components/data/useTableSelection.js +27 -23
- package/dist/components/display/KapiAnchor.d.ts +36 -0
- package/dist/components/display/KapiAnchor.js +36 -0
- package/dist/components/display/KapiBadge.d.ts +6 -5
- package/dist/components/display/KapiBadge.js +25 -19
- package/dist/components/display/KapiText.d.ts +43 -0
- package/dist/components/display/KapiText.js +33 -0
- package/dist/components/display/KapiTitle.d.ts +33 -0
- package/dist/components/display/KapiTitle.js +29 -0
- package/dist/components/display/index.d.ts +7 -0
- package/dist/components/display/textLogic.d.ts +32 -0
- package/dist/components/display/textLogic.js +19 -0
- package/dist/components/feedback/KapiAlert.d.ts +8 -4
- package/dist/components/feedback/KapiAlert.js +39 -34
- package/dist/components/inputs/KapiButton.d.ts +7 -4
- package/dist/components/inputs/KapiButton.js +47 -42
- package/dist/components/inputs/KapiSelect.d.ts +12 -0
- package/dist/components/inputs/KapiSelect.js +215 -212
- package/dist/components/inputs/KapiSelectMenu.d.ts +4 -2
- package/dist/components/inputs/KapiSelectMenu.js +131 -133
- package/dist/components/inputs/fieldLogic.d.ts +2 -2
- package/dist/components/inputs/index.d.ts +1 -1
- package/dist/components/inputs/selectSlots.d.ts +24 -0
- package/dist/components/inputs/selectSlots.js +27 -0
- package/dist/components/layout/KapiBox.d.ts +31 -0
- package/dist/components/layout/KapiBox.js +26 -0
- package/dist/components/layout/KapiCard.d.ts +16 -4
- package/dist/components/layout/KapiCard.js +46 -34
- package/dist/components/layout/KapiCenter.d.ts +13 -0
- package/dist/components/layout/KapiCenter.js +23 -0
- package/dist/components/layout/KapiCol.d.ts +22 -0
- package/dist/components/layout/KapiCol.js +23 -0
- package/dist/components/layout/KapiGrid.d.ts +29 -3
- package/dist/components/layout/KapiGrid.js +39 -17
- package/dist/components/layout/KapiPageHeader.d.ts +10 -1
- package/dist/components/layout/KapiPageHeader.js +82 -80
- package/dist/components/layout/KapiPanelParts.d.ts +11 -2
- package/dist/components/layout/KapiPanelParts.js +73 -56
- package/dist/components/layout/KapiRail.d.ts +10 -1
- package/dist/components/layout/KapiRail.js +123 -120
- package/dist/components/layout/KapiRoot.d.ts +35 -5
- package/dist/components/layout/KapiRoot.js +54 -39
- package/dist/components/layout/KapiShell.d.ts +36 -3
- package/dist/components/layout/KapiShell.js +53 -50
- package/dist/components/layout/cardSlots.d.ts +9 -0
- package/dist/components/layout/cardSlots.js +12 -0
- package/dist/components/layout/gridSpanLogic.d.ts +46 -0
- package/dist/components/layout/gridSpanLogic.js +39 -0
- package/dist/components/layout/index.d.ts +11 -4
- package/dist/components/layout/layoutPrimitives.d.ts +11 -0
- package/dist/components/layout/layoutPrimitives.js +12 -1
- package/dist/components/layout/pageHeaderSlots.d.ts +12 -0
- package/dist/components/layout/pageHeaderSlots.js +15 -0
- package/dist/components/layout/railLogic.d.ts +16 -3
- package/dist/components/layout/railSlots.d.ts +12 -0
- package/dist/components/layout/railSlots.js +15 -0
- package/dist/components/layout/shellSlots.d.ts +6 -0
- package/dist/components/layout/shellSlots.js +9 -0
- package/dist/components/layout/useGridBreakpoint.d.ts +12 -0
- package/dist/components/layout/useGridBreakpoint.js +35 -0
- package/dist/components/navigation/KapiBreadcrumb.d.ts +18 -2
- package/dist/components/navigation/KapiBreadcrumb.js +23 -16
- package/dist/components/navigation/KapiContextPanel.d.ts +17 -4
- package/dist/components/navigation/KapiContextPanel.js +151 -135
- package/dist/components/navigation/KapiPanelGroup.d.ts +16 -4
- package/dist/components/navigation/KapiPanelGroup.js +66 -65
- package/dist/components/navigation/KapiTabs.d.ts +12 -0
- package/dist/components/navigation/KapiTabs.js +87 -71
- package/dist/components/navigation/MiniNavItem.d.ts +7 -2
- package/dist/components/navigation/MiniNavItem.js +41 -36
- package/dist/components/navigation/breadcrumbLogic.d.ts +4 -2
- package/dist/components/navigation/breadcrumbLogic.js +1 -1
- package/dist/components/navigation/navLink.d.ts +21 -0
- package/dist/components/navigation/navLink.js +26 -0
- package/dist/components/navigation/navLinkLogic.d.ts +18 -0
- package/dist/components/navigation/navLinkLogic.js +22 -0
- package/dist/components/overlays/KapiContextMenu.d.ts +8 -0
- package/dist/components/overlays/KapiModal.d.ts +9 -0
- package/dist/components/overlays/KapiModal.js +77 -75
- package/dist/components/overlays/index.d.ts +1 -1
- package/dist/components/overlays/menuList.js +123 -113
- package/dist/components/overlays/modalSlots.d.ts +11 -0
- package/dist/components/overlays/modalSlots.js +14 -0
- package/dist/components/slotCatalog.d.ts +90 -0
- package/dist/components/slotCatalog.js +19 -0
- package/dist/components/slotsLogic.d.ts +34 -0
- package/dist/components/slotsLogic.js +18 -0
- package/dist/components/tone.d.ts +26 -0
- package/dist/components/tone.js +15 -14
- package/dist/css/base.css +1 -1
- package/dist/css/components/data/KapiEventCalendar.css +1 -1
- package/dist/css/components/data/KapiTable.css +1 -1
- package/dist/css/components/display/display.css +1 -1
- package/dist/css/components/display/typography.css +1 -0
- package/dist/css/components/feedback/feedback.css +1 -1
- package/dist/css/components/inputs/KapiButton.css +1 -1
- package/dist/css/components/inputs/KapiDatePicker.css +1 -1
- package/dist/css/components/layout/KapiBox.css +1 -0
- package/dist/css/components/layout/KapiRail.css +1 -1
- package/dist/css/components/layout/gridSpan.css +1 -0
- package/dist/css/components/navigation/navigation.css +1 -1
- package/dist/hooks/densityLogic.d.ts +15 -0
- package/dist/hooks/densityLogic.js +4 -0
- package/dist/hooks/index.d.ts +4 -0
- package/dist/hooks/themeColorsLogic.d.ts +19 -0
- package/dist/hooks/themeColorsLogic.js +4 -2
- package/dist/hooks/themeDeriveLogic.d.ts +16 -0
- package/dist/hooks/themeDeriveLogic.js +27 -17
- package/dist/hooks/toneFamilyLogic.d.ts +122 -0
- package/dist/hooks/toneFamilyLogic.js +151 -0
- package/dist/hooks/useKapiTheme.d.ts +8 -2
- package/dist/hooks/useKapiTheme.js +116 -103
- package/dist/hooks/useToneFamilies.d.ts +30 -0
- package/dist/hooks/useToneFamilies.js +46 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +213 -204
- package/dist/kapi.css +1 -1
- package/dist/kapi.layered.css +1 -1
- package/dist/styles/rawHeights.d.ts +8 -0
- package/package.json +4 -4
|
@@ -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 {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
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
|
|
10
|
-
id:
|
|
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":
|
|
13
|
-
"aria-disabled":
|
|
14
|
-
"data-kapisel-index":
|
|
15
|
-
"data-vindex":
|
|
16
|
-
"aria-setsize":
|
|
17
|
-
"aria-posinset":
|
|
18
|
-
|
|
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
|
-
!
|
|
22
|
+
!i.disabled && !c && _(a);
|
|
27
23
|
},
|
|
28
|
-
onClick: (
|
|
29
|
-
children: [/* @__PURE__ */
|
|
24
|
+
onClick: (e) => v(i, e.shiftKey),
|
|
25
|
+
children: [/* @__PURE__ */ l("span", {
|
|
30
26
|
className: "kapisel__opt-body",
|
|
31
|
-
children:
|
|
32
|
-
selected:
|
|
33
|
-
active:
|
|
34
|
-
disabled:
|
|
35
|
-
query:
|
|
36
|
-
}) :
|
|
37
|
-
}),
|
|
38
|
-
|
|
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
|
-
})),
|
|
44
|
-
let
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
]),
|
|
50
|
-
enabled:
|
|
51
|
-
count:
|
|
52
|
-
scrollRef:
|
|
53
|
-
estimate:
|
|
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:
|
|
56
|
-
overscan:
|
|
57
|
-
fallbackViewHeight:
|
|
58
|
-
}), { scrollToIndex:
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}, [
|
|
62
|
-
let
|
|
63
|
-
onHover:
|
|
64
|
-
onChoose:
|
|
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
|
-
|
|
67
|
-
|
|
68
|
-
onHover:
|
|
69
|
-
onChoose:
|
|
62
|
+
o(() => {
|
|
63
|
+
G.current = {
|
|
64
|
+
onHover: I,
|
|
65
|
+
onChoose: L
|
|
70
66
|
};
|
|
71
67
|
});
|
|
72
|
-
let
|
|
73
|
-
let r = e ===
|
|
74
|
-
return /* @__PURE__ */
|
|
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:
|
|
78
|
-
selected:
|
|
79
|
-
active: t ===
|
|
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 :
|
|
83
|
-
renderOption:
|
|
84
|
-
query:
|
|
85
|
-
onHover:
|
|
86
|
-
onChoose:
|
|
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
|
|
90
|
-
ref:
|
|
91
|
-
|
|
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__ */
|
|
95
|
-
id:
|
|
132
|
+
children: [/* @__PURE__ */ u("ul", {
|
|
133
|
+
id: x,
|
|
96
134
|
role: "listbox",
|
|
97
|
-
"aria-multiselectable":
|
|
98
|
-
"aria-label":
|
|
99
|
-
|
|
100
|
-
hidden:
|
|
101
|
-
ref:
|
|
102
|
-
onScroll:
|
|
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
|
-
!
|
|
105
|
-
|
|
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
|
-
|
|
148
|
-
children: [/* @__PURE__ */
|
|
149
|
-
|
|
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__ */
|
|
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) =>
|
|
154
|
+
children: e.items.map((e) => Y(e))
|
|
157
155
|
})]
|
|
158
156
|
}, e.key)),
|
|
159
|
-
!
|
|
160
|
-
option:
|
|
161
|
-
index:
|
|
157
|
+
!z && E && Y({
|
|
158
|
+
option: E,
|
|
159
|
+
index: D
|
|
162
160
|
})
|
|
163
161
|
]
|
|
164
|
-
}),
|
|
165
|
-
|
|
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:
|
|
166
|
+
children: A
|
|
169
167
|
})]
|
|
170
|
-
}),
|
|
168
|
+
}), d);
|
|
171
169
|
};
|
|
172
170
|
//#endregion
|
|
173
|
-
export {
|
|
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 | "
|
|
88
|
-
"aria-required": (boolean | "
|
|
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 {
|
|
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
|
|
7
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
8
|
//#region src/components/layout/KapiCard.tsx
|
|
7
|
-
function
|
|
8
|
-
return /* @__PURE__ */
|
|
9
|
-
|
|
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
|
-
|
|
13
|
-
|
|
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
|
|
22
|
-
return /* @__PURE__ */
|
|
23
|
-
|
|
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
|
|
28
|
-
return /* @__PURE__ */
|
|
29
|
-
|
|
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
|
|
34
|
-
let
|
|
35
|
-
return /* @__PURE__ */
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
|
|
45
|
-
title:
|
|
46
|
-
actions:
|
|
49
|
+
n(l, u) && /* @__PURE__ */ i(o, {
|
|
50
|
+
title: l,
|
|
51
|
+
actions: u,
|
|
52
|
+
classNames: g
|
|
47
53
|
}),
|
|
48
|
-
|
|
49
|
-
|
|
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 {
|
|
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 };
|