@kapiuara/ui 0.14.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +234 -1
- 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/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 +53 -53
- 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 +31 -31
- package/dist/components/feedback/KapiOfflineBanner.js +8 -8
- package/dist/components/feedback/KapiToastContainer.js +21 -21
- package/dist/components/feedback/KapiTour.d.ts +2 -1
- package/dist/components/feedback/KapiTour.js +32 -32
- 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 +28 -28
- package/dist/components/inputs/KapiDateRangePicker.js +27 -27
- package/dist/components/inputs/KapiFacetedSearch.js +24 -24
- 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.js +22 -22
- package/dist/components/inputs/KapiNumberStepper.js +12 -12
- package/dist/components/inputs/KapiRating.js +1 -1
- package/dist/components/inputs/KapiSearchChip.js +8 -8
- package/dist/components/inputs/KapiSegmented.js +27 -27
- package/dist/components/inputs/KapiSelect.js +166 -166
- 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 +22 -22
- package/dist/components/inputs/KapiTextarea.js +8 -8
- package/dist/components/inputs/ownField.js +4 -4
- package/dist/components/layout/KapiAccountMenu.d.ts +2 -1
- package/dist/components/layout/KapiAccountMenu.js +51 -51
- 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/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 +18 -17
- package/dist/components/navigation/KapiTree.js +72 -72
- 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 +15 -15
- package/dist/components/overlays/KapiDialogHost.js +22 -22
- package/dist/components/overlays/KapiLoading.js +16 -16
- package/dist/components/overlays/KapiMenuButton.js +12 -12
- 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 +14 -14
- package/dist/components/overlays/KapiPopover.d.ts +2 -1
- package/dist/components/overlays/KapiPopover.js +7 -7
- package/dist/components/overlays/KapiShapeSheet.js +17 -17
- package/dist/components/overlays/KapiSplitModal.js +29 -29
- package/dist/components/overlays/KapiTooltip.js +20 -20
- 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/hooks/portalRoot.js +6 -6
- package/dist/index.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "#kapi-css/components/layout/KapiRoot.css";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { joinClasses as e } from "../rootProps.js";
|
|
4
|
+
import { useKapiDir as t } from "../locale/KapiLocaleProvider.js";
|
|
5
5
|
import { KapiPortalRootProvider as n, usePortalRootOverride as r } from "../../hooks/portalRoot.js";
|
|
6
6
|
import { useMergedRefs as i } from "../../hooks/mergeRefs.js";
|
|
7
7
|
import { KapiThemeContext as a, themeRootStyle as o, useKapiThemeState as s } from "../../hooks/useKapiTheme.js";
|
|
8
8
|
/* empty css */
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { createContext as c, useContext as l, useMemo as u, useState as d } from "react";
|
|
10
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
11
11
|
//#region src/components/layout/KapiRoot.tsx
|
|
12
|
-
var p =
|
|
13
|
-
let
|
|
12
|
+
var p = c(null), m = ({ storageNamespace: e, brandTheme: n, style: a, ref: c }) => {
|
|
13
|
+
let f = s({ namespace: e }), m = t(), h = u(() => o(f, n), [f, n]), [g, _] = d(null), v = i(_, c), y = r(), b = l(p), x = y && y !== b ? y : g;
|
|
14
14
|
return {
|
|
15
|
-
themeState:
|
|
15
|
+
themeState: f,
|
|
16
16
|
dir: m,
|
|
17
17
|
attrs: {
|
|
18
18
|
ref: v,
|
|
19
|
-
"data-theme":
|
|
20
|
-
"data-motion":
|
|
19
|
+
"data-theme": f.theme,
|
|
20
|
+
"data-motion": f.motion === "reduced" ? "reduced" : void 0,
|
|
21
21
|
style: {
|
|
22
22
|
...a,
|
|
23
23
|
...h
|
|
@@ -27,30 +27,30 @@ var p = l(null), m = ({ storageNamespace: t, brandTheme: n, style: a, ref: c })
|
|
|
27
27
|
element: g,
|
|
28
28
|
portalRoot: x
|
|
29
29
|
};
|
|
30
|
-
}, h = ({ wiring: e, children: t }) => /* @__PURE__ */
|
|
30
|
+
}, h = ({ wiring: e, children: t }) => /* @__PURE__ */ f(a.Provider, {
|
|
31
31
|
value: e.themeState,
|
|
32
|
-
children: /* @__PURE__ */
|
|
32
|
+
children: /* @__PURE__ */ f(p.Provider, {
|
|
33
33
|
value: e.element,
|
|
34
|
-
children: /* @__PURE__ */
|
|
34
|
+
children: /* @__PURE__ */ f(n, {
|
|
35
35
|
root: e.portalRoot,
|
|
36
36
|
children: t
|
|
37
37
|
})
|
|
38
38
|
})
|
|
39
|
-
}), g = ({ children:
|
|
40
|
-
let
|
|
39
|
+
}), g = ({ children: t, className: n, storageNamespace: r, brandTheme: i, style: a, ref: o, ...s }) => {
|
|
40
|
+
let c = m({
|
|
41
41
|
storageNamespace: r,
|
|
42
42
|
brandTheme: i,
|
|
43
43
|
style: a,
|
|
44
44
|
ref: o
|
|
45
45
|
});
|
|
46
|
-
return /* @__PURE__ */
|
|
47
|
-
wiring:
|
|
48
|
-
children: /* @__PURE__ */
|
|
49
|
-
...
|
|
46
|
+
return /* @__PURE__ */ f(h, {
|
|
47
|
+
wiring: c,
|
|
48
|
+
children: /* @__PURE__ */ f("div", {
|
|
49
|
+
...c.dir ? { dir: c.dir } : {},
|
|
50
50
|
...s,
|
|
51
|
-
className:
|
|
52
|
-
...
|
|
53
|
-
children:
|
|
51
|
+
className: e("kapi", "kapi--embed", n),
|
|
52
|
+
...c.attrs,
|
|
53
|
+
children: t
|
|
54
54
|
})
|
|
55
55
|
});
|
|
56
56
|
};
|
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "#kapi-css/components/layout/KapiScrollArea.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 { useScrollEdges as n } from "../../hooks/useScrollEdges.js";
|
|
6
6
|
/* empty css */
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { useCallback as r } from "react";
|
|
8
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
9
9
|
//#region src/components/layout/KapiScrollArea.tsx
|
|
10
10
|
var o = {
|
|
11
11
|
previous: "Ver contenido anterior",
|
|
12
12
|
next: "Ver contenido siguiente"
|
|
13
13
|
};
|
|
14
14
|
function s({ children: s, axis: c = "x", fade: l = !0, paging: u = !0, className: d, viewportRef: f, ref: p, labels: m, ...h }) {
|
|
15
|
-
let g =
|
|
15
|
+
let g = t("scrollArea", o, m), { ref: _, edges: v, scrollByPage: y } = n({ axis: c }), b = r((e) => {
|
|
16
16
|
_.current = e, typeof f == "function" ? f(e) : f && (f.current = e);
|
|
17
17
|
}, [_, f]);
|
|
18
|
-
return /* @__PURE__ */
|
|
18
|
+
return /* @__PURE__ */ a("div", {
|
|
19
19
|
...h,
|
|
20
20
|
ref: p,
|
|
21
|
-
className:
|
|
21
|
+
className: e("kapi-scroll-area", d),
|
|
22
22
|
"data-axis": c,
|
|
23
23
|
children: [
|
|
24
|
-
/* @__PURE__ */
|
|
24
|
+
/* @__PURE__ */ i("div", {
|
|
25
25
|
ref: b,
|
|
26
|
-
className:
|
|
26
|
+
className: e("kapi-scroll-area__viewport", l && `kapi-fade-${c}`),
|
|
27
27
|
"data-edge-start": v.start ? "" : void 0,
|
|
28
28
|
"data-edge-end": v.end ? "" : void 0,
|
|
29
29
|
tabIndex: 0,
|
|
30
30
|
children: s
|
|
31
31
|
}),
|
|
32
|
-
u && v.start && /* @__PURE__ */
|
|
32
|
+
u && v.start && /* @__PURE__ */ i("button", {
|
|
33
33
|
type: "button",
|
|
34
34
|
tabIndex: -1,
|
|
35
35
|
"aria-label": g.previous,
|
|
36
36
|
className: "kapi-scroll-area__edge kapi-scroll-area__edge--start",
|
|
37
37
|
onClick: () => y(-1)
|
|
38
38
|
}),
|
|
39
|
-
u && v.end && /* @__PURE__ */
|
|
39
|
+
u && v.end && /* @__PURE__ */ i("button", {
|
|
40
40
|
type: "button",
|
|
41
41
|
tabIndex: -1,
|
|
42
42
|
"aria-label": g.next,
|
|
@@ -6,8 +6,8 @@ import { KapiContextMenu as t } from "../overlays/KapiContextMenu.js";
|
|
|
6
6
|
import { useGlobalRightClick as n } from "../../hooks/useGlobalRightClick.js";
|
|
7
7
|
import { KapiRootScope as r, useKapiRootWiring as i } from "./KapiRoot.js";
|
|
8
8
|
import { KapiReopenContext as a } from "./reopenBus.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { useCallback as o, useMemo as s, useState as c } from "react";
|
|
10
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
11
11
|
import { ChevronsLeft as d, ChevronsRight as f } from "lucide-react";
|
|
12
12
|
//#region src/components/layout/KapiShell.tsx
|
|
13
13
|
var p = ({ rail: p, panel: m, panelRight: h, children: g, contextMenuItems: _, rightClick: v = !0, overlays: y, className: b, contentClassName: x = "", storageNamespace: S, brandTheme: C, style: w, ref: T, ...E }) => {
|
|
@@ -16,7 +16,7 @@ var p = ({ rail: p, panel: m, panelRight: h, children: g, contextMenuItems: _, r
|
|
|
16
16
|
brandTheme: C,
|
|
17
17
|
style: w,
|
|
18
18
|
ref: T
|
|
19
|
-
}), [O, k] =
|
|
19
|
+
}), [O, k] = c(null);
|
|
20
20
|
n({
|
|
21
21
|
enabled: v,
|
|
22
22
|
onMenu: _?.length ? (e, t) => k({
|
|
@@ -24,7 +24,7 @@ var p = ({ rail: p, panel: m, panelRight: h, children: g, contextMenuItems: _, r
|
|
|
24
24
|
y: t
|
|
25
25
|
}) : void 0
|
|
26
26
|
});
|
|
27
|
-
let [A, j] =
|
|
27
|
+
let [A, j] = c(null), [M, N] = c(0), P = o(() => (N((e) => e + 1), () => N((e) => e - 1)), []), F = s(() => ({
|
|
28
28
|
info: A,
|
|
29
29
|
publish: j,
|
|
30
30
|
hosts: M,
|
|
@@ -34,11 +34,11 @@ var p = ({ rail: p, panel: m, panelRight: h, children: g, contextMenuItems: _, r
|
|
|
34
34
|
M,
|
|
35
35
|
P
|
|
36
36
|
]);
|
|
37
|
-
return /* @__PURE__ */
|
|
37
|
+
return /* @__PURE__ */ l(r, {
|
|
38
38
|
wiring: D,
|
|
39
|
-
children: /* @__PURE__ */
|
|
39
|
+
children: /* @__PURE__ */ l(a.Provider, {
|
|
40
40
|
value: F,
|
|
41
|
-
children: /* @__PURE__ */
|
|
41
|
+
children: /* @__PURE__ */ u("div", {
|
|
42
42
|
...D.dir ? { dir: D.dir } : {},
|
|
43
43
|
...E,
|
|
44
44
|
className: e("kapi", b),
|
|
@@ -46,20 +46,20 @@ var p = ({ rail: p, panel: m, panelRight: h, children: g, contextMenuItems: _, r
|
|
|
46
46
|
children: [
|
|
47
47
|
p,
|
|
48
48
|
m,
|
|
49
|
-
/* @__PURE__ */
|
|
49
|
+
/* @__PURE__ */ u("main", {
|
|
50
50
|
className: `kapi-content${x ? ` ${x}` : ""}`,
|
|
51
51
|
tabIndex: 0,
|
|
52
|
-
children: [A && M === 0 && /* @__PURE__ */
|
|
52
|
+
children: [A && M === 0 && /* @__PURE__ */ l("button", {
|
|
53
53
|
type: "button",
|
|
54
54
|
className: "kapi-paneltoggle kapi-content__reopen",
|
|
55
55
|
onClick: A.expand,
|
|
56
56
|
"aria-label": A.label,
|
|
57
|
-
children: A.side === "right" ? /* @__PURE__ */
|
|
57
|
+
children: A.side === "right" ? /* @__PURE__ */ l(d, {
|
|
58
58
|
className: "kapi-flip-rtl",
|
|
59
59
|
size: 16,
|
|
60
60
|
strokeWidth: 2,
|
|
61
61
|
"aria-hidden": "true"
|
|
62
|
-
}) : /* @__PURE__ */
|
|
62
|
+
}) : /* @__PURE__ */ l(f, {
|
|
63
63
|
className: "kapi-flip-rtl",
|
|
64
64
|
size: 16,
|
|
65
65
|
strokeWidth: 2,
|
|
@@ -69,7 +69,7 @@ var p = ({ rail: p, panel: m, panelRight: h, children: g, contextMenuItems: _, r
|
|
|
69
69
|
}),
|
|
70
70
|
h,
|
|
71
71
|
y,
|
|
72
|
-
O && _ && /* @__PURE__ */
|
|
72
|
+
O && _ && /* @__PURE__ */ l(t, {
|
|
73
73
|
open: !0,
|
|
74
74
|
x: O.x,
|
|
75
75
|
y: O.y,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { withLabels as e } from "../labelsLogic.js";
|
|
3
3
|
import { isWeekday as t, resolveFormatLocale as n, weekStartForLocale as r } from "./localeLogic.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { createContext as i, useContext as a, useMemo as o } from "react";
|
|
5
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/locale/KapiLocaleProvider.tsx
|
|
7
|
-
var c =
|
|
8
|
-
function u({ locale: e, labels: t = l, weekStartsOn: n, dir: r, children:
|
|
9
|
-
let
|
|
7
|
+
var c = i(null), l = {};
|
|
8
|
+
function u({ locale: e, labels: t = l, weekStartsOn: n, dir: r, children: i }) {
|
|
9
|
+
let a = o(() => ({
|
|
10
10
|
locale: e,
|
|
11
11
|
labels: t,
|
|
12
12
|
weekStartsOn: n,
|
|
@@ -17,18 +17,18 @@ function u({ locale: e, labels: t = l, weekStartsOn: n, dir: r, children: a }) {
|
|
|
17
17
|
n,
|
|
18
18
|
r
|
|
19
19
|
]);
|
|
20
|
-
return /* @__PURE__ */
|
|
21
|
-
value:
|
|
22
|
-
children:
|
|
20
|
+
return /* @__PURE__ */ s(c.Provider, {
|
|
21
|
+
value: a,
|
|
22
|
+
children: i
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
var d = () =>
|
|
26
|
-
let n =
|
|
25
|
+
var d = () => a(c)?.locale, f = () => n(d()), p = (e) => {
|
|
26
|
+
let n = a(c);
|
|
27
27
|
return t(e) ? e : t(n?.weekStartsOn) ? n.weekStartsOn : r(n?.locale);
|
|
28
|
-
}, m = () =>
|
|
28
|
+
}, m = () => a(c)?.dir;
|
|
29
29
|
function h(t, n, r) {
|
|
30
|
-
let i =
|
|
31
|
-
return
|
|
30
|
+
let i = a(c)?.labels[t];
|
|
31
|
+
return o(() => e(i ? e(n, i) : n, r), [
|
|
32
32
|
n,
|
|
33
33
|
i,
|
|
34
34
|
r
|
|
@@ -5,8 +5,8 @@ import { enabledIndexes as t, navKeyOf as n, nextEnabledIndex as r } from "../ov
|
|
|
5
5
|
import { useControllableState as i } from "../../hooks/useControllableState.js";
|
|
6
6
|
/* empty css */
|
|
7
7
|
import { normalizeOpenIds as a, toggleOpenId as o } from "./accordionLogic.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { useId as s } from "react";
|
|
9
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
10
10
|
import { ChevronDown as u } from "lucide-react";
|
|
11
11
|
//#region src/components/navigation/KapiAccordion.tsx
|
|
12
12
|
var d = ":scope > .kapi-accordion__item > .kapi-accordion__heading > .kapi-accordion__trigger:not(:disabled)", f = (e) => {
|
|
@@ -17,17 +17,17 @@ var d = ":scope > .kapi-accordion__item > .kapi-accordion__heading > .kapi-accor
|
|
|
17
17
|
!s || o < 0 || (e.preventDefault(), a[r(o, s, t(a.length))]?.focus());
|
|
18
18
|
};
|
|
19
19
|
function p({ items: t, single: n = !0, openIds: r, defaultOpenIds: d = [], onOpenIdsChange: p, className: m, ...h }) {
|
|
20
|
-
let g =
|
|
21
|
-
return /* @__PURE__ */
|
|
20
|
+
let g = s(), [_, v] = i(r, () => a(d, n), p), y = a(_, n), b = (e) => v(o(y, e, n));
|
|
21
|
+
return /* @__PURE__ */ c("div", {
|
|
22
22
|
...h,
|
|
23
23
|
className: e("kapi-accordion", m),
|
|
24
24
|
children: t.map((e) => {
|
|
25
25
|
let t = y.includes(e.id), n = `${g}-b-${e.id}`, r = `${g}-p-${e.id}`;
|
|
26
|
-
return /* @__PURE__ */
|
|
26
|
+
return /* @__PURE__ */ l("div", {
|
|
27
27
|
className: t ? "kapi-accordion__item kapi-accordion__item--open" : "kapi-accordion__item",
|
|
28
|
-
children: [/* @__PURE__ */
|
|
28
|
+
children: [/* @__PURE__ */ c("h3", {
|
|
29
29
|
className: "kapi-accordion__heading",
|
|
30
|
-
children: /* @__PURE__ */
|
|
30
|
+
children: /* @__PURE__ */ l("button", {
|
|
31
31
|
type: "button",
|
|
32
32
|
id: n,
|
|
33
33
|
className: "kapi-accordion__trigger",
|
|
@@ -36,25 +36,25 @@ function p({ items: t, single: n = !0, openIds: r, defaultOpenIds: d = [], onOpe
|
|
|
36
36
|
disabled: e.disabled,
|
|
37
37
|
onClick: () => b(e.id),
|
|
38
38
|
onKeyDown: f,
|
|
39
|
-
children: [/* @__PURE__ */
|
|
39
|
+
children: [/* @__PURE__ */ c("span", {
|
|
40
40
|
className: "kapi-accordion__title",
|
|
41
41
|
children: e.title
|
|
42
|
-
}), /* @__PURE__ */
|
|
42
|
+
}), /* @__PURE__ */ c(u, {
|
|
43
43
|
className: "kapi-accordion__chevron",
|
|
44
44
|
size: 18,
|
|
45
45
|
strokeWidth: 2,
|
|
46
46
|
"aria-hidden": !0
|
|
47
47
|
})]
|
|
48
48
|
})
|
|
49
|
-
}), /* @__PURE__ */
|
|
49
|
+
}), /* @__PURE__ */ c("div", {
|
|
50
50
|
id: r,
|
|
51
51
|
role: "region",
|
|
52
52
|
"aria-labelledby": n,
|
|
53
53
|
className: "kapi-accordion__region",
|
|
54
54
|
inert: !t,
|
|
55
|
-
children: /* @__PURE__ */
|
|
55
|
+
children: /* @__PURE__ */ c("div", {
|
|
56
56
|
className: "kapi-accordion__clip",
|
|
57
|
-
children: /* @__PURE__ */
|
|
57
|
+
children: /* @__PURE__ */ c("div", {
|
|
58
58
|
className: "kapi-accordion__content",
|
|
59
59
|
children: e.content
|
|
60
60
|
})
|
|
@@ -1,32 +1,32 @@
|
|
|
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
|
/* empty css */
|
|
6
6
|
import { breadcrumbKinds as n } from "./breadcrumbLogic.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { Fragment as r } from "react";
|
|
8
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
9
9
|
//#region src/components/navigation/KapiBreadcrumb.tsx
|
|
10
10
|
var o = { navigation: "Ubicación" };
|
|
11
11
|
function s({ items: s, "aria-label": c, labels: l, className: u, ref: d, ...f }) {
|
|
12
|
-
let p =
|
|
13
|
-
return /* @__PURE__ */
|
|
12
|
+
let p = t("breadcrumb", o, l), m = n(s);
|
|
13
|
+
return /* @__PURE__ */ i("nav", {
|
|
14
14
|
...f,
|
|
15
15
|
ref: d,
|
|
16
|
-
className:
|
|
16
|
+
className: e("kapi-breadcrumb", u),
|
|
17
17
|
"aria-label": c ?? p.navigation,
|
|
18
|
-
children: s.map((e, t) => /* @__PURE__ */
|
|
18
|
+
children: s.map((e, t) => /* @__PURE__ */ a(r, { children: [t > 0 && /* @__PURE__ */ i("span", {
|
|
19
19
|
"aria-hidden": !0,
|
|
20
20
|
children: " · "
|
|
21
|
-
}), m[t] === "link" ? /* @__PURE__ */
|
|
21
|
+
}), m[t] === "link" ? /* @__PURE__ */ i("button", {
|
|
22
22
|
type: "button",
|
|
23
23
|
className: "kapi-link",
|
|
24
24
|
onClick: e.onClick,
|
|
25
25
|
children: e.label
|
|
26
|
-
}) : m[t] === "current" ? /* @__PURE__ */
|
|
26
|
+
}) : m[t] === "current" ? /* @__PURE__ */ i("b", {
|
|
27
27
|
"aria-current": "page",
|
|
28
28
|
children: e.label
|
|
29
|
-
}) : /* @__PURE__ */
|
|
29
|
+
}) : /* @__PURE__ */ i("span", { children: e.label })] }, t))
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
32
|
//#endregion
|
|
@@ -1,12 +1,12 @@
|
|
|
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 { KapiTooltip as r } from "../overlays/KapiTooltip.js";
|
|
7
7
|
/* empty css */
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { useLayoutEffect as i, useRef as a, useState as o } from "react";
|
|
9
|
+
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
10
10
|
import { ChevronsLeft as u, ChevronsRight as d } from "lucide-react";
|
|
11
11
|
//#region src/components/navigation/KapiCollapsiblePanel.tsx
|
|
12
12
|
var f = {
|
|
@@ -14,8 +14,8 @@ var f = {
|
|
|
14
14
|
expand: "Desplegar panel",
|
|
15
15
|
region: "Panel lateral"
|
|
16
16
|
}, p = (e) => typeof e == "number" ? `${e}px` : e, m = (e) => e === "right" ? "start" : "end", h = ({ children: h, strip: g, header: _, collapsed: v, defaultCollapsed: y = !1, onCollapsedChange: b, side: x = "right", expandedWidth: S = 320, collapsedWidth: C = 58, collapseLabel: w, expandLabel: T, "aria-label": E, labels: D, className: O, style: k, ...A }) => {
|
|
17
|
-
let j =
|
|
18
|
-
|
|
17
|
+
let j = t("collapsiblePanel", f, D), M = w ?? j.collapse, N = T ?? j.expand, P = E ?? j.region, [F, I] = n(v, y, b), L = a(null), [R, z] = o(null);
|
|
18
|
+
i(() => {
|
|
19
19
|
R && (F === R.next && L.current?.focus(), z(null));
|
|
20
20
|
}, [R, F]);
|
|
21
21
|
let B = () => {
|
|
@@ -25,61 +25,61 @@ var f = {
|
|
|
25
25
|
...k,
|
|
26
26
|
"--cpanel-w": p(F ? C : S)
|
|
27
27
|
};
|
|
28
|
-
return /* @__PURE__ */
|
|
28
|
+
return /* @__PURE__ */ c("aside", {
|
|
29
29
|
...A,
|
|
30
|
-
className:
|
|
30
|
+
className: e(`kapi-cpanel kapi-cpanel--${x}`, F && "is-collapsed", O),
|
|
31
31
|
style: U,
|
|
32
32
|
"aria-label": P,
|
|
33
|
-
children: F ? /* @__PURE__ */
|
|
33
|
+
children: F ? /* @__PURE__ */ l("div", {
|
|
34
34
|
className: "kapi-cpanel__strip",
|
|
35
|
-
children: [/* @__PURE__ */
|
|
35
|
+
children: [/* @__PURE__ */ c(r, {
|
|
36
36
|
label: N,
|
|
37
37
|
prefer: m(x),
|
|
38
|
-
children: /* @__PURE__ */
|
|
38
|
+
children: /* @__PURE__ */ c("button", {
|
|
39
39
|
ref: L,
|
|
40
40
|
type: "button",
|
|
41
41
|
className: "kapi-cpanel__fold",
|
|
42
42
|
onClick: B,
|
|
43
43
|
"aria-label": N,
|
|
44
|
-
children: /* @__PURE__ */
|
|
44
|
+
children: /* @__PURE__ */ c(H, {
|
|
45
45
|
size: 15,
|
|
46
46
|
strokeWidth: 2
|
|
47
47
|
})
|
|
48
48
|
})
|
|
49
49
|
}), g]
|
|
50
|
-
}) : /* @__PURE__ */
|
|
50
|
+
}) : /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ l("div", {
|
|
51
51
|
className: "kapi-cpanel__head",
|
|
52
|
-
children: [/* @__PURE__ */
|
|
52
|
+
children: [/* @__PURE__ */ c("div", {
|
|
53
53
|
className: "kapi-cpanel__header",
|
|
54
54
|
children: _
|
|
55
|
-
}), /* @__PURE__ */
|
|
55
|
+
}), /* @__PURE__ */ c("button", {
|
|
56
56
|
ref: L,
|
|
57
57
|
type: "button",
|
|
58
58
|
className: "kapi-cpanel__fold",
|
|
59
59
|
onClick: B,
|
|
60
60
|
"aria-label": M,
|
|
61
|
-
children: /* @__PURE__ */
|
|
61
|
+
children: /* @__PURE__ */ c(V, {
|
|
62
62
|
className: "kapi-flip-rtl",
|
|
63
63
|
size: 15,
|
|
64
64
|
strokeWidth: 2
|
|
65
65
|
})
|
|
66
66
|
})]
|
|
67
|
-
}), /* @__PURE__ */
|
|
67
|
+
}), /* @__PURE__ */ c("div", {
|
|
68
68
|
className: "kapi-cpanel__body",
|
|
69
69
|
children: h
|
|
70
70
|
})] })
|
|
71
71
|
});
|
|
72
|
-
}, g = ({ icon:
|
|
72
|
+
}, g = ({ icon: t, label: n, active: i = !1, onClick: a, side: o = "right", className: s, ...l }) => /* @__PURE__ */ c(r, {
|
|
73
73
|
label: n,
|
|
74
|
-
prefer: m(
|
|
75
|
-
children: /* @__PURE__ */
|
|
74
|
+
prefer: m(o),
|
|
75
|
+
children: /* @__PURE__ */ c("button", {
|
|
76
76
|
...l,
|
|
77
77
|
type: "button",
|
|
78
|
-
className:
|
|
78
|
+
className: e("kapi-cpanel__stripbtn", i && "is-on", s),
|
|
79
79
|
"aria-label": n,
|
|
80
80
|
"aria-pressed": i,
|
|
81
|
-
onClick:
|
|
82
|
-
children:
|
|
81
|
+
onClick: a,
|
|
82
|
+
children: t
|
|
83
83
|
})
|
|
84
84
|
});
|
|
85
85
|
//#endregion
|