@kapiuara/ui 0.13.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +239 -1
- package/dist/components/chat/KapiChatDivider.d.ts +7 -3
- package/dist/components/chat/KapiChatDivider.js +6 -6
- package/dist/components/chat/KapiChatList.js +19 -19
- package/dist/components/chat/KapiChatThread.js +23 -23
- package/dist/components/chat/KapiComposer.js +19 -19
- package/dist/components/chat/KapiMessageBubble.js +4 -4
- package/dist/components/chat/KapiTypingIndicator.js +4 -4
- package/dist/components/chat/index.d.ts +1 -1
- package/dist/components/closeReason.d.ts +34 -0
- package/dist/components/data/KapiBarChart.js +1 -1
- package/dist/components/data/KapiDataTable.js +31 -31
- package/dist/components/data/KapiEventCalendar.js +78 -78
- package/dist/components/data/KapiHeatmap.js +23 -23
- package/dist/components/data/KapiLineChart.js +1 -1
- package/dist/components/data/KapiPagination.js +4 -4
- package/dist/components/data/KapiSparkline.js +1 -1
- package/dist/components/data/KapiTable.js +122 -122
- package/dist/components/data/KapiTableFilter.js +18 -18
- package/dist/components/data/KapiTableRow.js +24 -24
- package/dist/components/data/KapiTableToolbar.js +49 -49
- package/dist/components/data/chartFrame.js +21 -21
- package/dist/components/data/useColumnResize.js +8 -8
- package/dist/components/data/useTableSelection.js +8 -8
- package/dist/components/display/KapiAnnotation.js +55 -55
- package/dist/components/display/KapiComment.js +4 -4
- package/dist/components/display/KapiCommentComposer.js +16 -16
- package/dist/components/display/KapiFileItem.js +6 -6
- package/dist/components/display/KapiFileViewer.js +9 -9
- package/dist/components/display/KapiTruncate.js +7 -7
- package/dist/components/feedback/KapiAlert.d.ts +2 -1
- package/dist/components/feedback/KapiAlert.js +8 -8
- package/dist/components/feedback/KapiCountdown.js +8 -8
- package/dist/components/feedback/KapiFab.js +30 -30
- package/dist/components/feedback/KapiOfflineBanner.js +8 -8
- package/dist/components/feedback/KapiToastContainer.js +25 -25
- package/dist/components/feedback/KapiTour.d.ts +2 -1
- package/dist/components/feedback/KapiTour.js +35 -35
- package/dist/components/inputs/KapiAutocomplete.js +14 -14
- package/dist/components/inputs/KapiButton.d.ts +17 -1
- package/dist/components/inputs/KapiButton.js +41 -25
- package/dist/components/inputs/KapiCalendar.js +5 -5
- package/dist/components/inputs/KapiCalendarGrid.js +10 -10
- package/dist/components/inputs/KapiChecklist.js +71 -71
- package/dist/components/inputs/KapiDatePicker.js +124 -122
- package/dist/components/inputs/KapiDateRangePicker.js +138 -136
- package/dist/components/inputs/KapiFacetedSearch.js +29 -29
- package/dist/components/inputs/KapiField.js +14 -14
- package/dist/components/inputs/KapiFileUpload.js +27 -27
- package/dist/components/inputs/KapiIconButton.d.ts +9 -1
- package/dist/components/inputs/KapiIconButton.js +27 -10
- package/dist/components/inputs/KapiInput.js +21 -21
- package/dist/components/inputs/KapiInputGroup.js +8 -8
- package/dist/components/inputs/KapiMaskedInput.d.ts +8 -3
- package/dist/components/inputs/KapiMaskedInput.js +64 -51
- package/dist/components/inputs/KapiNumberStepper.js +29 -29
- package/dist/components/inputs/KapiRating.js +61 -59
- package/dist/components/inputs/KapiSearchChip.js +8 -8
- package/dist/components/inputs/KapiSegmented.js +74 -64
- package/dist/components/inputs/KapiSelect.js +232 -222
- package/dist/components/inputs/KapiSelectMenu.js +60 -60
- package/dist/components/inputs/KapiSlider.js +1 -1
- package/dist/components/inputs/KapiSwitch.js +6 -6
- package/dist/components/inputs/KapiTagInput.js +83 -81
- package/dist/components/inputs/KapiTextarea.js +8 -8
- package/dist/components/inputs/misuseWarnings.d.ts +37 -0
- package/dist/components/inputs/misuseWarnings.js +36 -0
- package/dist/components/inputs/numberStepLogic.d.ts +10 -0
- package/dist/components/inputs/numberStepLogic.js +16 -7
- package/dist/components/inputs/ownField.js +4 -4
- package/dist/components/layout/KapiAccountMenu.d.ts +2 -1
- package/dist/components/layout/KapiAccountMenu.js +53 -53
- package/dist/components/layout/KapiContextSlot.js +35 -35
- package/dist/components/layout/KapiMasonry.js +6 -6
- package/dist/components/layout/KapiNotificationBell.js +60 -60
- package/dist/components/layout/KapiPageHeader.js +19 -19
- package/dist/components/layout/KapiRail.js +60 -60
- package/dist/components/layout/KapiRailAccount.js +9 -9
- package/dist/components/layout/KapiRoot.js +21 -21
- package/dist/components/layout/KapiScrollArea.js +11 -11
- package/dist/components/layout/KapiShell.js +12 -12
- package/dist/components/locale/KapiLocaleProvider.js +13 -13
- package/dist/components/navigation/CtxSlidingList.js +4 -4
- package/dist/components/navigation/KapiAccordion.js +12 -12
- package/dist/components/navigation/KapiBreadcrumb.js +11 -11
- package/dist/components/navigation/KapiCollapsiblePanel.js +23 -23
- package/dist/components/navigation/KapiContextPanel.js +76 -76
- package/dist/components/navigation/KapiFilterChips.js +9 -9
- package/dist/components/navigation/KapiNavBadge.d.ts +4 -2
- package/dist/components/navigation/KapiNavBadge.js +11 -10
- package/dist/components/navigation/KapiPanelGroup.js +25 -25
- package/dist/components/navigation/KapiSteps.js +4 -4
- package/dist/components/navigation/KapiTabs.d.ts +4 -1
- package/dist/components/navigation/KapiTabs.js +63 -55
- package/dist/components/navigation/KapiTree.js +75 -75
- package/dist/components/navigation/KapiWizard.d.ts +2 -1
- package/dist/components/navigation/KapiWizard.js +30 -30
- package/dist/components/overlays/KapiCanvasForm.d.ts +6 -2
- package/dist/components/overlays/KapiCanvasForm.js +12 -12
- package/dist/components/overlays/KapiCommandPalette.d.ts +2 -1
- package/dist/components/overlays/KapiCommandPalette.js +23 -23
- package/dist/components/overlays/KapiConfirm.d.ts +2 -1
- package/dist/components/overlays/KapiConfirm.js +12 -12
- package/dist/components/overlays/KapiContextMenu.d.ts +2 -1
- package/dist/components/overlays/KapiContextMenu.js +18 -18
- package/dist/components/overlays/KapiDialogHost.js +22 -22
- package/dist/components/overlays/KapiLoading.js +16 -16
- package/dist/components/overlays/KapiMenuButton.js +15 -15
- package/dist/components/overlays/KapiModal.d.ts +2 -1
- package/dist/components/overlays/KapiModal.js +28 -28
- package/dist/components/overlays/KapiOffcanvas.d.ts +3 -2
- package/dist/components/overlays/KapiOffcanvas.js +63 -63
- package/dist/components/overlays/KapiOffcanvasStack.js +38 -38
- package/dist/components/overlays/KapiPhotoView.js +15 -15
- package/dist/components/overlays/KapiPopover.d.ts +2 -1
- package/dist/components/overlays/KapiPopover.js +10 -10
- package/dist/components/overlays/KapiShapeSheet.js +20 -20
- package/dist/components/overlays/KapiSplitModal.js +29 -29
- package/dist/components/overlays/KapiTooltip.js +21 -21
- package/dist/components/overlays/menuList.js +60 -60
- package/dist/components/renderSlot.d.ts +27 -0
- package/dist/components/renderSlot.js +23 -0
- package/dist/css/components/chat/chat.css +1 -1
- package/dist/hooks/portalRoot.js +6 -6
- package/dist/hooks/useControllableState.d.ts +6 -2
- package/dist/hooks/useControllableState.js +14 -11
- package/dist/hooks/useFormReset.d.ts +22 -0
- package/dist/hooks/useFormReset.js +17 -0
- package/dist/index.d.ts +2 -0
- package/dist/kapi.css +1 -1
- package/dist/kapi.layered.css +1 -1
- package/package.json +5 -2
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "#kapi-css/components/navigation/navigation.css";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { joinClasses as e } from "../rootProps.js";
|
|
4
|
+
import { useLabels as t } from "../locale/KapiLocaleProvider.js";
|
|
5
5
|
import { useControllableState as n } from "../../hooks/useControllableState.js";
|
|
6
6
|
import { directionOf as r, physicalSide as i } from "../../hooks/directionLogic.js";
|
|
7
7
|
import { useMergedRefs as a } from "../../hooks/mergeRefs.js";
|
|
8
8
|
import { DEFAULT_LINK_LABELS as o } from "../locale/linkLabels.js";
|
|
9
9
|
import "./navBadgeLogic.js";
|
|
10
10
|
import { KapiNavBadge as s } from "./KapiNavBadge.js";
|
|
11
|
-
import { canCollapse as c, clampCtxPanelWidth as ee, ctxPanelClasses as l, ctxPanelWidthFromDrag as te, stepCtxPanelWidth as
|
|
12
|
-
import { activeIdIn as
|
|
13
|
-
import { CtxSlidingList as
|
|
11
|
+
import { canCollapse as c, clampCtxPanelWidth as ee, ctxPanelClasses as l, ctxPanelWidthFromDrag as te, stepCtxPanelWidth as u } from "./contextPanelLogic.js";
|
|
12
|
+
import { activeIdIn as d } from "./activeItemLogic.js";
|
|
13
|
+
import { CtxSlidingList as f } from "./CtxSlidingList.js";
|
|
14
14
|
/* empty css */
|
|
15
|
-
import { KapiPanelMiniContext as
|
|
16
|
-
import { MiniNavItem as
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { ChevronsLeft as
|
|
15
|
+
import { KapiPanelMiniContext as ne, useKapiPanelMini as p } from "./panelMini.js";
|
|
16
|
+
import { MiniNavItem as m } from "./MiniNavItem.js";
|
|
17
|
+
import { useLayoutEffect as h, useMemo as re, useRef as g, useState as _ } from "react";
|
|
18
|
+
import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
19
|
+
import { ChevronsLeft as x, ChevronsRight as S, ExternalLink as C } from "lucide-react";
|
|
20
20
|
//#region src/components/navigation/KapiContextPanel.tsx
|
|
21
|
-
var
|
|
22
|
-
let { mini: i } =
|
|
23
|
-
return i ? /* @__PURE__ */
|
|
21
|
+
var w = ({ item: e, active: t, onSelect: n, newTabLabel: r }) => {
|
|
22
|
+
let { mini: i } = p(), a = e.detail !== void 0 || e.initials !== void 0, o = () => n?.(e.id);
|
|
23
|
+
return i ? /* @__PURE__ */ y(m, {
|
|
24
24
|
label: e.label,
|
|
25
25
|
icon: e.icon,
|
|
26
26
|
initials: e.initials,
|
|
@@ -34,28 +34,28 @@ var C = ({ item: e, active: t, onSelect: n, newTabLabel: r }) => {
|
|
|
34
34
|
newTab: e.newTab,
|
|
35
35
|
newTabLabel: r
|
|
36
36
|
} : { onClick: o }
|
|
37
|
-
}) : a ? /* @__PURE__ */
|
|
37
|
+
}) : a ? /* @__PURE__ */ b("button", {
|
|
38
38
|
type: "button",
|
|
39
39
|
className: `kapi-ctxrec${t ? " kapi-ctxrec--on" : ""}`,
|
|
40
40
|
"aria-current": t ? "page" : void 0,
|
|
41
41
|
disabled: e.disabled,
|
|
42
42
|
onClick: o,
|
|
43
43
|
children: [
|
|
44
|
-
e.initials !== void 0 && /* @__PURE__ */
|
|
44
|
+
e.initials !== void 0 && /* @__PURE__ */ y("span", {
|
|
45
45
|
className: "kapi-ctxrec__av kapi-ctxrec__av--tone",
|
|
46
46
|
children: e.initials
|
|
47
47
|
}),
|
|
48
|
-
/* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ b("span", {
|
|
49
49
|
className: "kapi-ctxrec__txt",
|
|
50
|
-
children: [/* @__PURE__ */
|
|
50
|
+
children: [/* @__PURE__ */ y("span", {
|
|
51
51
|
className: "kapi-ctxrec__name",
|
|
52
52
|
children: e.label
|
|
53
|
-
}), e.detail !== void 0 && /* @__PURE__ */
|
|
53
|
+
}), e.detail !== void 0 && /* @__PURE__ */ y("span", {
|
|
54
54
|
className: "kapi-ctxrec__sub",
|
|
55
55
|
children: e.detail
|
|
56
56
|
})]
|
|
57
57
|
}),
|
|
58
|
-
/* @__PURE__ */
|
|
58
|
+
/* @__PURE__ */ y(s, {
|
|
59
59
|
value: e.badge,
|
|
60
60
|
tone: e.badgeTone,
|
|
61
61
|
label: e.badgeLabel,
|
|
@@ -63,18 +63,18 @@ var C = ({ item: e, active: t, onSelect: n, newTabLabel: r }) => {
|
|
|
63
63
|
}),
|
|
64
64
|
e.trailing
|
|
65
65
|
]
|
|
66
|
-
}) : e.href === void 0 ? /* @__PURE__ */
|
|
66
|
+
}) : e.href === void 0 ? /* @__PURE__ */ b("button", {
|
|
67
67
|
type: "button",
|
|
68
68
|
className: `kapi-ctxitem${t ? " kapi-ctxitem--on" : ""}`,
|
|
69
69
|
"aria-current": t ? "page" : void 0,
|
|
70
70
|
disabled: e.disabled,
|
|
71
71
|
onClick: o,
|
|
72
72
|
children: [
|
|
73
|
-
/* @__PURE__ */
|
|
73
|
+
/* @__PURE__ */ b("span", {
|
|
74
74
|
className: "kapi-ctxitem__main",
|
|
75
75
|
children: [e.icon, e.label]
|
|
76
76
|
}),
|
|
77
|
-
/* @__PURE__ */
|
|
77
|
+
/* @__PURE__ */ y(s, {
|
|
78
78
|
value: e.badge,
|
|
79
79
|
tone: e.badgeTone,
|
|
80
80
|
label: e.badgeLabel,
|
|
@@ -82,7 +82,7 @@ var C = ({ item: e, active: t, onSelect: n, newTabLabel: r }) => {
|
|
|
82
82
|
}),
|
|
83
83
|
e.trailing
|
|
84
84
|
]
|
|
85
|
-
}) : /* @__PURE__ */
|
|
85
|
+
}) : /* @__PURE__ */ b("a", {
|
|
86
86
|
className: `kapi-ctxitem kapi-ctxitem--link${t ? " kapi-ctxitem--on" : ""}`,
|
|
87
87
|
href: e.disabled ? void 0 : e.href,
|
|
88
88
|
rel: "noopener noreferrer",
|
|
@@ -90,32 +90,32 @@ var C = ({ item: e, active: t, onSelect: n, newTabLabel: r }) => {
|
|
|
90
90
|
"aria-current": t ? "page" : void 0,
|
|
91
91
|
"aria-disabled": e.disabled || void 0,
|
|
92
92
|
children: [
|
|
93
|
-
/* @__PURE__ */
|
|
93
|
+
/* @__PURE__ */ b("span", {
|
|
94
94
|
className: "kapi-ctxitem__main",
|
|
95
95
|
children: [e.icon, e.label]
|
|
96
96
|
}),
|
|
97
|
-
/* @__PURE__ */
|
|
97
|
+
/* @__PURE__ */ y(s, {
|
|
98
98
|
value: e.badge,
|
|
99
99
|
tone: e.badgeTone,
|
|
100
100
|
label: e.badgeLabel,
|
|
101
101
|
max: 999
|
|
102
102
|
}),
|
|
103
103
|
e.trailing,
|
|
104
|
-
e.external && /* @__PURE__ */
|
|
104
|
+
e.external && /* @__PURE__ */ y(C, {
|
|
105
105
|
className: "kapi-ctxitem__ext",
|
|
106
106
|
size: 14,
|
|
107
107
|
"aria-hidden": "true"
|
|
108
108
|
}),
|
|
109
|
-
e.newTab && /* @__PURE__ */
|
|
109
|
+
e.newTab && /* @__PURE__ */ y("span", {
|
|
110
110
|
className: "kapi-ctxitem__sr",
|
|
111
111
|
children: r
|
|
112
112
|
})
|
|
113
113
|
]
|
|
114
114
|
});
|
|
115
|
-
},
|
|
116
|
-
let c =
|
|
117
|
-
return /* @__PURE__ */
|
|
118
|
-
i && /* @__PURE__ */
|
|
115
|
+
}, T = ({ sections: e, activeId: n, onSelect: r, search: i, hint: a, labels: s }) => {
|
|
116
|
+
let c = t("link", o, s);
|
|
117
|
+
return /* @__PURE__ */ b(v, { children: [
|
|
118
|
+
i && /* @__PURE__ */ y("input", {
|
|
119
119
|
type: "search",
|
|
120
120
|
className: "kapi-ctxsearch kapi-ctxsearch--input",
|
|
121
121
|
placeholder: i.placeholder,
|
|
@@ -123,17 +123,17 @@ var C = ({ item: e, active: t, onSelect: n, newTabLabel: r }) => {
|
|
|
123
123
|
"aria-label": i["aria-label"] ?? i.placeholder,
|
|
124
124
|
onChange: (e) => i.onChange?.(e.target.value)
|
|
125
125
|
}),
|
|
126
|
-
|
|
126
|
+
e.map((e, t) => /* @__PURE__ */ b("div", {
|
|
127
127
|
className: "kapi-ctxsection",
|
|
128
128
|
children: [
|
|
129
|
-
t > 0 && /* @__PURE__ */
|
|
130
|
-
e.label && /* @__PURE__ */
|
|
129
|
+
t > 0 && /* @__PURE__ */ y("div", { className: "kapi-ctxdivider" }),
|
|
130
|
+
e.label && /* @__PURE__ */ y("div", {
|
|
131
131
|
className: "kapi-ct",
|
|
132
132
|
children: e.label
|
|
133
133
|
}),
|
|
134
|
-
/* @__PURE__ */
|
|
135
|
-
active:
|
|
136
|
-
children: e.items.map((e) => /* @__PURE__ */
|
|
134
|
+
/* @__PURE__ */ y(f, {
|
|
135
|
+
active: d(e.items, n),
|
|
136
|
+
children: e.items.map((e) => /* @__PURE__ */ y(w, {
|
|
137
137
|
item: e,
|
|
138
138
|
active: e.id === n,
|
|
139
139
|
onSelect: r,
|
|
@@ -142,99 +142,99 @@ var C = ({ item: e, active: t, onSelect: n, newTabLabel: r }) => {
|
|
|
142
142
|
})
|
|
143
143
|
]
|
|
144
144
|
}, e.id)),
|
|
145
|
-
a && /* @__PURE__ */
|
|
145
|
+
a && /* @__PURE__ */ y("div", {
|
|
146
146
|
className: "kapi-hint",
|
|
147
147
|
children: a
|
|
148
148
|
})
|
|
149
149
|
] });
|
|
150
|
-
},
|
|
150
|
+
}, E = {
|
|
151
151
|
resize: "Redimensionar panel",
|
|
152
152
|
collapse: "Plegar panel",
|
|
153
153
|
expand: "Desplegar panel",
|
|
154
154
|
region: "Panel contextual"
|
|
155
|
-
},
|
|
156
|
-
let I =
|
|
157
|
-
|
|
155
|
+
}, D = ({ title: o, actions: s, collapsed: d, defaultCollapsed: f, onCollapsedChange: p, collapseLabel: m, expandLabel: v, side: C = "left", collapsedMode: w = "hidden", resizable: D = !1, minWidth: O = 200, maxWidth: k = 420, "aria-label": ie, labels: A, className: j, style: M, id: N, ref: P, ...F }) => {
|
|
156
|
+
let I = t("contextPanel", E, A), L = m ?? I.collapse, R = v ?? I.expand, z = ie ?? I.region, [B, ae] = n(d, f ?? !1, p), [V, H] = _(null), [oe, U] = _(!1), W = g(null), G = g(null), K = a(G, P), q = g(null), [J, Y] = _(null);
|
|
157
|
+
h(() => {
|
|
158
158
|
J && (B === J.next && q.current?.focus(), Y(null));
|
|
159
159
|
}, [J, B]);
|
|
160
160
|
let X = (e) => {
|
|
161
161
|
Y({ next: e }), ae(e);
|
|
162
|
-
}, Z =
|
|
163
|
-
|
|
162
|
+
}, Z = g(X);
|
|
163
|
+
h(() => {
|
|
164
164
|
Z.current = X;
|
|
165
165
|
});
|
|
166
|
-
let se =
|
|
166
|
+
let se = re(() => ({
|
|
167
167
|
mini: !0,
|
|
168
168
|
expand: () => Z.current(!1),
|
|
169
|
-
tooltipSide:
|
|
170
|
-
}), [
|
|
169
|
+
tooltipSide: C === "right" ? "start" : "end"
|
|
170
|
+
}), [C]), ce = C === "right" ? S : x, le = C === "right" ? x : S, Q = () => V ?? G.current?.offsetWidth ?? 258, ue = (e) => {
|
|
171
171
|
e.button === 0 && (W.current = {
|
|
172
172
|
startX: e.clientX,
|
|
173
173
|
startWidth: Q()
|
|
174
174
|
}, e.currentTarget.setPointerCapture(e.pointerId), U(!0), e.preventDefault());
|
|
175
175
|
}, de = (e) => {
|
|
176
176
|
let t = W.current;
|
|
177
|
-
t && H(te(i(
|
|
177
|
+
t && H(te(i(C, r(e.currentTarget)), t.startWidth, t.startX, e.clientX, O, k));
|
|
178
178
|
}, $ = (e) => {
|
|
179
179
|
W.current = null, e.currentTarget.hasPointerCapture(e.pointerId) && e.currentTarget.releasePointerCapture(e.pointerId), U(!1);
|
|
180
180
|
}, fe = (e) => {
|
|
181
|
-
let t =
|
|
181
|
+
let t = u(i(C, r(e.currentTarget)), Q(), e.key, O, k);
|
|
182
182
|
t !== null && (e.preventDefault(), H(t));
|
|
183
183
|
};
|
|
184
184
|
if (B) {
|
|
185
|
-
let
|
|
186
|
-
return /* @__PURE__ */
|
|
185
|
+
let t = w === "mini";
|
|
186
|
+
return /* @__PURE__ */ b("aside", {
|
|
187
187
|
ref: P,
|
|
188
188
|
id: N,
|
|
189
|
-
className:
|
|
190
|
-
side:
|
|
189
|
+
className: e(l({
|
|
190
|
+
side: C,
|
|
191
191
|
collapsed: !0
|
|
192
|
-
}),
|
|
192
|
+
}), t && "is-mini kapi-navmini", j),
|
|
193
193
|
style: M,
|
|
194
194
|
"aria-label": z,
|
|
195
|
-
children: [/* @__PURE__ */
|
|
195
|
+
children: [/* @__PURE__ */ y("button", {
|
|
196
196
|
ref: q,
|
|
197
197
|
type: "button",
|
|
198
198
|
className: "kapi-paneltoggle",
|
|
199
199
|
onClick: () => X(!1),
|
|
200
200
|
"aria-label": R,
|
|
201
|
-
children: /* @__PURE__ */
|
|
201
|
+
children: /* @__PURE__ */ y(le, {
|
|
202
202
|
className: "kapi-flip-rtl",
|
|
203
203
|
size: 16,
|
|
204
204
|
strokeWidth: 2,
|
|
205
205
|
"aria-hidden": "true"
|
|
206
206
|
})
|
|
207
|
-
}),
|
|
207
|
+
}), t && /* @__PURE__ */ y(ne.Provider, {
|
|
208
208
|
value: se,
|
|
209
|
-
children: /* @__PURE__ */
|
|
209
|
+
children: /* @__PURE__ */ y(T, {
|
|
210
210
|
...F,
|
|
211
211
|
labels: A
|
|
212
212
|
})
|
|
213
213
|
})]
|
|
214
214
|
});
|
|
215
215
|
}
|
|
216
|
-
return /* @__PURE__ */
|
|
216
|
+
return /* @__PURE__ */ b("aside", {
|
|
217
217
|
ref: K,
|
|
218
218
|
id: N,
|
|
219
|
-
className:
|
|
220
|
-
side:
|
|
219
|
+
className: e(l({
|
|
220
|
+
side: C,
|
|
221
221
|
resizing: oe
|
|
222
222
|
}), j),
|
|
223
223
|
"aria-label": z,
|
|
224
|
-
"data-resizable":
|
|
225
|
-
style:
|
|
224
|
+
"data-resizable": D || void 0,
|
|
225
|
+
style: D && V !== null ? {
|
|
226
226
|
...M,
|
|
227
227
|
width: V
|
|
228
228
|
} : M,
|
|
229
229
|
children: [
|
|
230
|
-
|
|
230
|
+
D && /* @__PURE__ */ y("div", {
|
|
231
231
|
className: "kapi-ctxpanel__resize",
|
|
232
232
|
role: "separator",
|
|
233
233
|
"aria-orientation": "vertical",
|
|
234
234
|
"aria-label": I.resize,
|
|
235
|
-
"aria-valuemin":
|
|
236
|
-
"aria-valuemax":
|
|
237
|
-
"aria-valuenow": ee(V ?? 258,
|
|
235
|
+
"aria-valuemin": O,
|
|
236
|
+
"aria-valuemax": k,
|
|
237
|
+
"aria-valuenow": ee(V ?? 258, O, k),
|
|
238
238
|
tabIndex: 0,
|
|
239
239
|
onPointerDown: ue,
|
|
240
240
|
onPointerMove: de,
|
|
@@ -242,21 +242,21 @@ var C = ({ item: e, active: t, onSelect: n, newTabLabel: r }) => {
|
|
|
242
242
|
onPointerCancel: $,
|
|
243
243
|
onKeyDown: fe
|
|
244
244
|
}),
|
|
245
|
-
/* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ b("div", {
|
|
246
246
|
className: "kapi-ctxpanel__head",
|
|
247
|
-
children: [/* @__PURE__ */
|
|
247
|
+
children: [/* @__PURE__ */ y("span", { children: o }), /* @__PURE__ */ b("div", {
|
|
248
248
|
className: "kapi-ctxpanel__actions",
|
|
249
249
|
children: [s, c({
|
|
250
|
-
collapsed:
|
|
251
|
-
defaultCollapsed:
|
|
252
|
-
onCollapsedChange:
|
|
253
|
-
}) && /* @__PURE__ */
|
|
250
|
+
collapsed: d,
|
|
251
|
+
defaultCollapsed: f,
|
|
252
|
+
onCollapsedChange: p
|
|
253
|
+
}) && /* @__PURE__ */ y("button", {
|
|
254
254
|
ref: q,
|
|
255
255
|
type: "button",
|
|
256
256
|
className: "kapi-paneltoggle",
|
|
257
257
|
onClick: () => X(!0),
|
|
258
258
|
"aria-label": L,
|
|
259
|
-
children: /* @__PURE__ */
|
|
259
|
+
children: /* @__PURE__ */ y(ce, {
|
|
260
260
|
className: "kapi-flip-rtl",
|
|
261
261
|
size: 16,
|
|
262
262
|
strokeWidth: 2,
|
|
@@ -265,7 +265,7 @@ var C = ({ item: e, active: t, onSelect: n, newTabLabel: r }) => {
|
|
|
265
265
|
})]
|
|
266
266
|
})]
|
|
267
267
|
}),
|
|
268
|
-
/* @__PURE__ */
|
|
268
|
+
/* @__PURE__ */ y(T, {
|
|
269
269
|
...F,
|
|
270
270
|
labels: A
|
|
271
271
|
})
|
|
@@ -273,4 +273,4 @@ var C = ({ item: e, active: t, onSelect: n, newTabLabel: r }) => {
|
|
|
273
273
|
});
|
|
274
274
|
};
|
|
275
275
|
//#endregion
|
|
276
|
-
export {
|
|
276
|
+
export { E as DEFAULT_CONTEXT_PANEL_LABELS, D as KapiContextPanel, T as KapiContextSections };
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "#kapi-css/components/navigation/KapiFilterChips.css";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { joinClasses as e } from "../rootProps.js";
|
|
4
|
+
import { useLabels as t } from "../locale/KapiLocaleProvider.js";
|
|
5
5
|
import { useControllableState as n } from "../../hooks/useControllableState.js";
|
|
6
6
|
import { logicalKeyOf as r } from "../../hooks/directionLogic.js";
|
|
7
7
|
import { activeChipIndex as i, chipAriaLabel as a, filterChipClasses as o, nextChipIndex as s } from "./filterChipsLogic.js";
|
|
8
8
|
/* empty css */
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { useRef as c } from "react";
|
|
10
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
11
11
|
//#region src/components/navigation/KapiFilterChips.tsx
|
|
12
12
|
var d = { group: "Filtros" };
|
|
13
13
|
function f({ items: f, value: p, defaultValue: m, onChange: h, size: g = "md", disabled: _ = !1, labels: v, className: y, "aria-label": b, ...x }) {
|
|
14
|
-
let S =
|
|
14
|
+
let S = t("filterChips", d, v), C = c([]), [w, T] = n(p, () => m ?? f[0]?.id, h), E = (e) => _ || f[e]?.disabled === !0, D = i(f, w ?? "", E), O = (e, t) => {
|
|
15
15
|
let n = s(t, f.length, r(e), E);
|
|
16
16
|
n != null && (e.preventDefault(), C.current[n]?.focus());
|
|
17
17
|
};
|
|
18
|
-
return /* @__PURE__ */
|
|
18
|
+
return /* @__PURE__ */ l("div", {
|
|
19
19
|
...x,
|
|
20
20
|
role: "group",
|
|
21
21
|
"aria-label": b ?? S.group,
|
|
22
22
|
"aria-disabled": _ || void 0,
|
|
23
|
-
className:
|
|
24
|
-
children: f.map((e, t) => /* @__PURE__ */
|
|
23
|
+
className: e("kapi-filterchips", y),
|
|
24
|
+
children: f.map((e, t) => /* @__PURE__ */ u("button", {
|
|
25
25
|
ref: (e) => {
|
|
26
26
|
C.current[t] = e;
|
|
27
27
|
},
|
|
@@ -33,7 +33,7 @@ function f({ items: f, value: p, defaultValue: m, onChange: h, size: g = "md", d
|
|
|
33
33
|
disabled: E(t) || void 0,
|
|
34
34
|
onClick: () => T(e.id),
|
|
35
35
|
onKeyDown: (e) => O(e, t),
|
|
36
|
-
children: [/* @__PURE__ */
|
|
36
|
+
children: [/* @__PURE__ */ l("span", { children: e.label }), e.count != null && /* @__PURE__ */ l("span", {
|
|
37
37
|
className: "kapi-filterpill__count",
|
|
38
38
|
"aria-hidden": !0,
|
|
39
39
|
children: e.count
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Ref } from "react";
|
|
1
|
+
import type { CSSProperties, Ref } from "react";
|
|
2
2
|
import type { KapiTone } from "../tone.js";
|
|
3
3
|
import { type KapiNavBadgeValue } from "./navBadgeLogic.js";
|
|
4
4
|
export type KapiNavBadgeProps = {
|
|
@@ -18,6 +18,8 @@ export type KapiNavBadgeProps = {
|
|
|
18
18
|
announce?: boolean | undefined;
|
|
19
19
|
/** Clase extra. */
|
|
20
20
|
className?: string | undefined;
|
|
21
|
+
/** Estilo del `<span>` visible, al lado de `className`. */
|
|
22
|
+
style?: CSSProperties | undefined;
|
|
21
23
|
/** Ref al `<span>` visible del badge (el que lleva `className`). */
|
|
22
24
|
ref?: Ref<HTMLSpanElement> | undefined;
|
|
23
25
|
};
|
|
@@ -25,4 +27,4 @@ export type KapiNavBadgeProps = {
|
|
|
25
27
|
* Badge de atención para navegación (rail, ítems de panel, grupos). Lo visible es `aria-hidden` y el texto
|
|
26
28
|
* accesible va aparte, así el nombre del ítem que lo contiene queda "Trámites 3 trámites vencidos".
|
|
27
29
|
*/
|
|
28
|
-
export declare const KapiNavBadge: ({ value, tone, label, placement, max, showZero, announce, className, ref }: KapiNavBadgeProps) => import("react").JSX.Element | null;
|
|
30
|
+
export declare const KapiNavBadge: ({ value, tone, label, placement, max, showZero, announce, className, style, ref }: KapiNavBadgeProps) => import("react").JSX.Element | null;
|
|
@@ -6,27 +6,28 @@ import { navBadgeA11yText as n, navBadgeView as r } from "./navBadgeLogic.js";
|
|
|
6
6
|
/* empty css */
|
|
7
7
|
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
8
8
|
//#region src/components/navigation/KapiNavBadge.tsx
|
|
9
|
-
var s = ({ value: s, tone: c = "primary", label: l, placement: u = "inline", max: d, showZero: f, announce: p = !0, className: m,
|
|
10
|
-
let
|
|
9
|
+
var s = ({ value: s, tone: c = "primary", label: l, placement: u = "inline", max: d, showZero: f, announce: p = !0, className: m, style: h, ref: g }) => {
|
|
10
|
+
let _ = r(s, {
|
|
11
11
|
max: d,
|
|
12
12
|
showZero: f
|
|
13
13
|
});
|
|
14
|
-
if (
|
|
15
|
-
let
|
|
14
|
+
if (_ === null) return null;
|
|
15
|
+
let v = p ? n(s, l, { showZero: f }) : null, y = _.kind === "dot";
|
|
16
16
|
return /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a("span", {
|
|
17
|
-
ref:
|
|
17
|
+
ref: g,
|
|
18
|
+
style: h,
|
|
18
19
|
className: e(t({
|
|
19
20
|
tone: c,
|
|
20
|
-
variant: u === "corner" ||
|
|
21
|
+
variant: u === "corner" || y ? "solid" : "subtle",
|
|
21
22
|
size: "sm"
|
|
22
|
-
}), "kapi-navbadge", `kapi-navbadge--${u}`,
|
|
23
|
+
}), "kapi-navbadge", `kapi-navbadge--${u}`, y && "kapi-navbadge--dot", m),
|
|
23
24
|
"aria-hidden": "true",
|
|
24
|
-
children:
|
|
25
|
-
}),
|
|
25
|
+
children: y ? null : _.text
|
|
26
|
+
}), v !== null && /* @__PURE__ */ o(i, { children: [
|
|
26
27
|
" ",
|
|
27
28
|
/* @__PURE__ */ a("span", {
|
|
28
29
|
className: "kapi-navbadge__sr",
|
|
29
|
-
children:
|
|
30
|
+
children: v
|
|
30
31
|
}),
|
|
31
32
|
" "
|
|
32
33
|
] })] });
|
|
@@ -11,22 +11,22 @@ import { CtxSlidingList as a } from "./CtxSlidingList.js";
|
|
|
11
11
|
import { useKapiPanelMini as o } from "./panelMini.js";
|
|
12
12
|
import { MiniNavItem as s } from "./MiniNavItem.js";
|
|
13
13
|
import { formatCount as c, panelGroupClasses as l } from "./panelGroupLogic.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
14
|
+
import { useId as u } from "react";
|
|
15
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
16
16
|
import { ChevronRight as p, ExternalLink as m } from "lucide-react";
|
|
17
17
|
//#region src/components/navigation/KapiPanelGroup.tsx
|
|
18
18
|
var h = ({ value: e }) => {
|
|
19
19
|
let t = c(e);
|
|
20
|
-
return t === null ? null : /* @__PURE__ */
|
|
20
|
+
return t === null ? null : /* @__PURE__ */ d("span", {
|
|
21
21
|
className: "kapi-panelgroup__count",
|
|
22
22
|
children: t
|
|
23
23
|
});
|
|
24
24
|
}, g = ({ item: e, active: t, onSelect: n, newTabLabel: i }) => {
|
|
25
|
-
let a = `kapi-ctxitem${t ? " kapi-ctxitem--on" : ""}`, o = /* @__PURE__ */
|
|
25
|
+
let a = `kapi-ctxitem${t ? " kapi-ctxitem--on" : ""}`, o = /* @__PURE__ */ f("span", {
|
|
26
26
|
className: "kapi-ctxitem__main",
|
|
27
27
|
children: [e.icon, e.label]
|
|
28
28
|
});
|
|
29
|
-
return e.href === void 0 ? /* @__PURE__ */
|
|
29
|
+
return e.href === void 0 ? /* @__PURE__ */ f("button", {
|
|
30
30
|
type: "button",
|
|
31
31
|
className: a,
|
|
32
32
|
"aria-current": t ? "page" : void 0,
|
|
@@ -34,15 +34,15 @@ var h = ({ value: e }) => {
|
|
|
34
34
|
onClick: () => n?.(e.id),
|
|
35
35
|
children: [
|
|
36
36
|
o,
|
|
37
|
-
/* @__PURE__ */
|
|
37
|
+
/* @__PURE__ */ d(r, {
|
|
38
38
|
value: e.badge,
|
|
39
39
|
tone: e.badgeTone,
|
|
40
40
|
label: e.badgeLabel,
|
|
41
41
|
max: 999
|
|
42
42
|
}),
|
|
43
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ d(h, { value: e.count })
|
|
44
44
|
]
|
|
45
|
-
}) : /* @__PURE__ */
|
|
45
|
+
}) : /* @__PURE__ */ f("a", {
|
|
46
46
|
className: `${a} kapi-ctxitem--link`,
|
|
47
47
|
href: e.disabled ? void 0 : e.href,
|
|
48
48
|
rel: "noopener noreferrer",
|
|
@@ -51,19 +51,19 @@ var h = ({ value: e }) => {
|
|
|
51
51
|
"aria-disabled": e.disabled || void 0,
|
|
52
52
|
children: [
|
|
53
53
|
o,
|
|
54
|
-
/* @__PURE__ */
|
|
54
|
+
/* @__PURE__ */ d(r, {
|
|
55
55
|
value: e.badge,
|
|
56
56
|
tone: e.badgeTone,
|
|
57
57
|
label: e.badgeLabel,
|
|
58
58
|
max: 999
|
|
59
59
|
}),
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
e.external && /* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ d(h, { value: e.count }),
|
|
61
|
+
e.external && /* @__PURE__ */ d(m, {
|
|
62
62
|
className: "kapi-ctxitem__ext",
|
|
63
63
|
size: 14,
|
|
64
64
|
"aria-hidden": "true"
|
|
65
65
|
}),
|
|
66
|
-
e.newTab && /* @__PURE__ */
|
|
66
|
+
e.newTab && /* @__PURE__ */ d("span", {
|
|
67
67
|
className: "kapi-ctxitem__sr",
|
|
68
68
|
children: i
|
|
69
69
|
})
|
|
@@ -71,8 +71,8 @@ var h = ({ value: e }) => {
|
|
|
71
71
|
});
|
|
72
72
|
};
|
|
73
73
|
function _({ label: c, count: m, badge: _, badgeTone: v, badgeLabel: y, icon: b, items: x, activeId: S, onSelect: C, open: w, defaultOpen: T = !1, onOpenChange: E, className: D, style: O, id: k, ref: A, "aria-label": j, labels: M }) {
|
|
74
|
-
let N = e("link", n, M), P =
|
|
75
|
-
return B ? /* @__PURE__ */
|
|
74
|
+
let N = e("link", n, M), P = u(), F = `${P}-body`, I = `${P}-head`, [L, R] = t(w, T, E), z = () => R(!L), { mini: B, expand: V } = o();
|
|
75
|
+
return B ? /* @__PURE__ */ d("div", {
|
|
76
76
|
ref: A,
|
|
77
77
|
className: l({
|
|
78
78
|
open: !1,
|
|
@@ -80,7 +80,7 @@ function _({ label: c, count: m, badge: _, badgeTone: v, badgeLabel: y, icon: b,
|
|
|
80
80
|
}),
|
|
81
81
|
style: O,
|
|
82
82
|
id: k,
|
|
83
|
-
children: /* @__PURE__ */
|
|
83
|
+
children: /* @__PURE__ */ d(s, {
|
|
84
84
|
label: c,
|
|
85
85
|
icon: b,
|
|
86
86
|
active: i(x, S) !== null,
|
|
@@ -91,7 +91,7 @@ function _({ label: c, count: m, badge: _, badgeTone: v, badgeLabel: y, icon: b,
|
|
|
91
91
|
V(), L || R(!0);
|
|
92
92
|
}
|
|
93
93
|
})
|
|
94
|
-
}) : /* @__PURE__ */
|
|
94
|
+
}) : /* @__PURE__ */ f("div", {
|
|
95
95
|
ref: A,
|
|
96
96
|
className: l({
|
|
97
97
|
open: L,
|
|
@@ -99,7 +99,7 @@ function _({ label: c, count: m, badge: _, badgeTone: v, badgeLabel: y, icon: b,
|
|
|
99
99
|
}),
|
|
100
100
|
style: O,
|
|
101
101
|
id: k,
|
|
102
|
-
children: [/* @__PURE__ */
|
|
102
|
+
children: [/* @__PURE__ */ f("button", {
|
|
103
103
|
type: "button",
|
|
104
104
|
id: I,
|
|
105
105
|
className: "kapi-panelgroup__head",
|
|
@@ -107,36 +107,36 @@ function _({ label: c, count: m, badge: _, badgeTone: v, badgeLabel: y, icon: b,
|
|
|
107
107
|
"aria-controls": F,
|
|
108
108
|
onClick: z,
|
|
109
109
|
children: [
|
|
110
|
-
/* @__PURE__ */
|
|
110
|
+
/* @__PURE__ */ f("span", {
|
|
111
111
|
className: "kapi-panelgroup__label",
|
|
112
112
|
children: [b, c]
|
|
113
113
|
}),
|
|
114
|
-
/* @__PURE__ */
|
|
114
|
+
/* @__PURE__ */ d(r, {
|
|
115
115
|
value: _,
|
|
116
116
|
tone: v,
|
|
117
117
|
label: y,
|
|
118
118
|
max: 999
|
|
119
119
|
}),
|
|
120
|
-
/* @__PURE__ */
|
|
121
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ d(h, { value: m }),
|
|
121
|
+
/* @__PURE__ */ d(p, {
|
|
122
122
|
className: "kapi-panelgroup__chevron kapi-flip-rtl",
|
|
123
123
|
size: 16,
|
|
124
124
|
strokeWidth: 2,
|
|
125
125
|
"aria-hidden": "true"
|
|
126
126
|
})
|
|
127
127
|
]
|
|
128
|
-
}), /* @__PURE__ */
|
|
128
|
+
}), /* @__PURE__ */ d("div", {
|
|
129
129
|
id: F,
|
|
130
130
|
role: "region",
|
|
131
131
|
"aria-label": j,
|
|
132
132
|
"aria-labelledby": j ? void 0 : I,
|
|
133
133
|
className: "kapi-panelgroup__body",
|
|
134
134
|
inert: !L,
|
|
135
|
-
children: /* @__PURE__ */
|
|
135
|
+
children: /* @__PURE__ */ d("div", {
|
|
136
136
|
className: "kapi-panelgroup__clip",
|
|
137
|
-
children: /* @__PURE__ */
|
|
137
|
+
children: /* @__PURE__ */ d(a, {
|
|
138
138
|
active: i(x, S),
|
|
139
|
-
children: x.map((e) => /* @__PURE__ */
|
|
139
|
+
children: x.map((e) => /* @__PURE__ */ d(g, {
|
|
140
140
|
item: e,
|
|
141
141
|
active: e.id === S,
|
|
142
142
|
onSelect: C,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "#kapi-css/components/navigation/KapiSteps.css";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { joinClasses as e } from "../rootProps.js";
|
|
4
|
+
import { useLabels as t } from "../locale/KapiLocaleProvider.js";
|
|
5
5
|
/* empty css */
|
|
6
6
|
import { resolveSteps as n, stepsClasses as r } from "./stepsLogic.js";
|
|
7
7
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
@@ -18,11 +18,11 @@ var c = {
|
|
|
18
18
|
"aria-hidden": !0
|
|
19
19
|
};
|
|
20
20
|
function u({ steps: u, current: d, orientation: f = "vertical", size: p = "md", labels: m, className: h, ref: g, ..._ }) {
|
|
21
|
-
let v =
|
|
21
|
+
let v = t("steps", c, m), { statuses: y, currentIndex: b } = n(u, d);
|
|
22
22
|
return /* @__PURE__ */ i("ol", {
|
|
23
23
|
..._,
|
|
24
24
|
ref: g,
|
|
25
|
-
className:
|
|
25
|
+
className: e(r(f, p), h),
|
|
26
26
|
children: u.map((e, t) => {
|
|
27
27
|
let n = y[t] ?? "upcoming";
|
|
28
28
|
return /* @__PURE__ */ a("li", {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CSSProperties } from "react";
|
|
1
2
|
import { type HTMLAttributes, type ReactNode, type Ref } from "react";
|
|
2
3
|
/** Pestaña de `KapiTabs`. `Id` acota los ids (p. ej. una unión de literales). */
|
|
3
4
|
export type KapiTabItem<Id extends string = string> = {
|
|
@@ -63,6 +64,8 @@ export type KapiTabPanelProps = {
|
|
|
63
64
|
keepMounted?: boolean | undefined;
|
|
64
65
|
/** Clase del panel (`role="tabpanel"`). */
|
|
65
66
|
className?: string | undefined;
|
|
67
|
+
/** Estilo del panel, al lado de `className`. */
|
|
68
|
+
style?: CSSProperties | undefined;
|
|
66
69
|
/** Contenido del panel. */
|
|
67
70
|
children?: ReactNode;
|
|
68
71
|
/** Ref al `<div role="tabpanel">`. */
|
|
@@ -73,4 +76,4 @@ export type KapiTabPanelProps = {
|
|
|
73
76
|
* (`tabIndex=0`) para llegar al contenido con Tab. Los inactivos se renderizan `hidden` para que las
|
|
74
77
|
* referencias `aria-controls` sigan siendo válidas.
|
|
75
78
|
*/
|
|
76
|
-
export declare function KapiTabPanel({ idBase, tabId: owner, active, keepMounted, className, children, ref }: KapiTabPanelProps): import("react").JSX.Element;
|
|
79
|
+
export declare function KapiTabPanel({ idBase, tabId: owner, active, keepMounted, className, style, children, ref }: KapiTabPanelProps): import("react").JSX.Element;
|