@kapiuara/ui 0.15.3 → 0.17.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 +505 -13
- package/dist/components/chat/KapiChatThread.js +4 -4
- package/dist/components/chat/KapiComposer.js +8 -8
- package/dist/components/data/KapiDataTable.d.ts +1 -1
- package/dist/components/data/KapiDataTable.js +25 -25
- 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/KapiSparkline.d.ts +2 -1
- package/dist/components/data/KapiSparkline.js +29 -26
- package/dist/components/data/KapiTable.d.ts +2 -2
- package/dist/components/data/KapiTable.js +347 -329
- package/dist/components/data/KapiTableFilter.js +6 -6
- 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 +17 -5
- package/dist/components/data/tableCells.js +52 -53
- 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 +54 -1
- package/dist/components/data/useTableSelection.d.ts +4 -2
- package/dist/components/data/useTableSelection.js +29 -25
- package/dist/components/display/KapiAnchor.d.ts +36 -0
- package/dist/components/display/KapiAnchor.js +36 -0
- package/dist/components/display/KapiAnnotation.js +68 -63
- package/dist/components/display/KapiAvatar.d.ts +6 -4
- package/dist/components/display/KapiAvatar.js +33 -28
- package/dist/components/display/KapiBadge.d.ts +6 -5
- package/dist/components/display/KapiBadge.js +25 -19
- package/dist/components/display/KapiCodeBlock.d.ts +48 -0
- package/dist/components/display/KapiCodeBlock.js +44 -0
- package/dist/components/display/KapiCommentComposer.js +6 -6
- package/dist/components/display/KapiDiff.d.ts +62 -0
- package/dist/components/display/KapiDiff.js +118 -0
- package/dist/components/display/KapiHighlight.d.ts +27 -0
- package/dist/components/display/KapiHighlight.js +21 -0
- package/dist/components/display/KapiIconTile.d.ts +2 -1
- package/dist/components/display/KapiIconTile.js +23 -21
- package/dist/components/display/KapiStat.d.ts +3 -2
- package/dist/components/display/KapiStat.js +32 -26
- package/dist/components/display/KapiTag.d.ts +4 -3
- package/dist/components/display/KapiTag.js +29 -24
- package/dist/components/display/KapiText.d.ts +43 -0
- package/dist/components/display/KapiText.js +33 -0
- package/dist/components/display/KapiTimeline.d.ts +5 -2
- package/dist/components/display/KapiTimeline.js +31 -23
- package/dist/components/display/KapiTitle.d.ts +33 -0
- package/dist/components/display/KapiTitle.js +29 -0
- package/dist/components/display/annotationLogic.d.ts +2 -1
- package/dist/components/display/annotationLogic.js +7 -6
- package/dist/components/display/codeBlockSlots.d.ts +10 -0
- package/dist/components/display/codeBlockSlots.js +13 -0
- package/dist/components/display/diffLogic.d.ts +58 -0
- package/dist/components/display/diffLogic.js +96 -0
- package/dist/components/display/diffSlots.d.ts +14 -0
- package/dist/components/display/diffSlots.js +17 -0
- package/dist/components/display/highlightLogic.d.ts +18 -0
- package/dist/components/display/highlightLogic.js +26 -0
- package/dist/components/display/highlightSlots.d.ts +5 -0
- package/dist/components/display/highlightSlots.js +8 -0
- package/dist/components/display/iconTileLogic.d.ts +2 -2
- package/dist/components/display/iconTileLogic.js +7 -6
- package/dist/components/display/index.d.ts +15 -0
- package/dist/components/display/statLogic.d.ts +2 -1
- package/dist/components/display/statLogic.js +7 -6
- package/dist/components/display/tagLogic.d.ts +2 -1
- package/dist/components/display/tagLogic.js +7 -6
- package/dist/components/display/textLogic.d.ts +32 -0
- package/dist/components/display/textLogic.js +19 -0
- package/dist/components/display/timelineLogic.d.ts +20 -2
- package/dist/components/display/timelineLogic.js +10 -2
- package/dist/components/feedback/KapiAlert.d.ts +8 -4
- package/dist/components/feedback/KapiAlert.js +39 -34
- package/dist/components/feedback/KapiFab.js +108 -108
- package/dist/components/feedback/KapiProgress.js +63 -54
- package/dist/components/feedback/KapiToastContainer.js +9 -9
- package/dist/components/feedback/KapiTour.js +12 -12
- package/dist/components/feedback/progressLogic.d.ts +2 -1
- package/dist/components/feedback/progressLogic.js +9 -8
- package/dist/components/inputs/KapiAutocomplete.d.ts +6 -0
- package/dist/components/inputs/KapiAutocomplete.js +86 -85
- package/dist/components/inputs/KapiButton.d.ts +7 -4
- package/dist/components/inputs/KapiButton.js +47 -42
- package/dist/components/inputs/KapiChecklist.d.ts +7 -1
- package/dist/components/inputs/KapiChecklist.js +53 -52
- package/dist/components/inputs/KapiCopyButton.d.ts +40 -0
- package/dist/components/inputs/KapiCopyButton.js +35 -0
- package/dist/components/inputs/KapiDatePicker.d.ts +7 -1
- package/dist/components/inputs/KapiDatePicker.js +118 -116
- package/dist/components/inputs/KapiDateRangePicker.d.ts +7 -1
- package/dist/components/inputs/KapiDateRangePicker.js +136 -135
- package/dist/components/inputs/KapiFacetedSearch.js +5 -5
- package/dist/components/inputs/KapiField.d.ts +9 -1
- package/dist/components/inputs/KapiField.js +43 -42
- package/dist/components/inputs/KapiFileUpload.js +6 -6
- package/dist/components/inputs/KapiInput.d.ts +29 -1
- package/dist/components/inputs/KapiInput.js +74 -51
- package/dist/components/inputs/KapiMaskedInput.js +26 -26
- package/dist/components/inputs/KapiNumberStepper.d.ts +7 -1
- package/dist/components/inputs/KapiNumberStepper.js +24 -23
- package/dist/components/inputs/KapiPinInput.d.ts +72 -0
- package/dist/components/inputs/KapiPinInput.js +75 -0
- package/dist/components/inputs/KapiPropsForm.d.ts +34 -0
- package/dist/components/inputs/KapiPropsForm.js +78 -0
- package/dist/components/inputs/KapiRating.d.ts +7 -1
- package/dist/components/inputs/KapiRating.js +39 -38
- package/dist/components/inputs/KapiSearchChip.js +5 -5
- package/dist/components/inputs/KapiSegmented.d.ts +13 -5
- package/dist/components/inputs/KapiSegmented.js +81 -77
- package/dist/components/inputs/KapiSelect.d.ts +21 -1
- package/dist/components/inputs/KapiSelect.js +251 -245
- package/dist/components/inputs/KapiSelectMenu.d.ts +4 -2
- package/dist/components/inputs/KapiSelectMenu.js +131 -133
- package/dist/components/inputs/KapiSlider.d.ts +10 -3
- package/dist/components/inputs/KapiSlider.js +67 -63
- package/dist/components/inputs/KapiTagInput.d.ts +7 -1
- package/dist/components/inputs/KapiTagInput.js +70 -69
- package/dist/components/inputs/KapiTextarea.d.ts +7 -1
- package/dist/components/inputs/KapiTextarea.js +51 -50
- package/dist/components/inputs/copyLogic.d.ts +1 -0
- package/dist/components/inputs/copyLogic.js +12 -0
- package/dist/components/inputs/fieldLogic.d.ts +21 -1
- package/dist/components/inputs/fieldLogic.js +18 -11
- package/dist/components/inputs/index.d.ts +9 -1
- package/dist/components/inputs/inputLogic.d.ts +16 -1
- package/dist/components/inputs/inputLogic.js +3 -3
- package/dist/components/inputs/ownField.d.ts +3 -1
- package/dist/components/inputs/ownField.js +28 -27
- package/dist/components/inputs/pinInputLogic.d.ts +34 -0
- package/dist/components/inputs/pinInputLogic.js +37 -0
- package/dist/components/inputs/propsFormLogic.d.ts +53 -0
- package/dist/components/inputs/propsFormLogic.js +11 -0
- package/dist/components/inputs/segmentedLogic.d.ts +7 -0
- package/dist/components/inputs/segmentedLogic.js +2 -2
- package/dist/components/inputs/selectSlots.d.ts +24 -0
- package/dist/components/inputs/selectSlots.js +27 -0
- package/dist/components/layout/KapiAccessCard.d.ts +5 -1
- package/dist/components/layout/KapiAccessCard.js +43 -39
- package/dist/components/layout/KapiAccountMenu.js +7 -7
- 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/KapiCollapse.d.ts +39 -0
- package/dist/components/layout/KapiCollapse.js +20 -0
- package/dist/components/layout/KapiContextSlot.js +4 -4
- package/dist/components/layout/KapiDivider.d.ts +11 -2
- package/dist/components/layout/KapiDivider.js +30 -24
- package/dist/components/layout/KapiGrid.d.ts +29 -3
- package/dist/components/layout/KapiGrid.js +39 -17
- package/dist/components/layout/KapiNotificationBell.js +10 -10
- package/dist/components/layout/KapiPageHeader.d.ts +10 -1
- package/dist/components/layout/KapiPageHeader.js +94 -92
- 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 +125 -122
- package/dist/components/layout/KapiRoot.d.ts +55 -5
- package/dist/components/layout/KapiRoot.js +57 -38
- package/dist/components/layout/KapiShell.d.ts +44 -3
- package/dist/components/layout/KapiShell.js +54 -50
- package/dist/components/layout/accessCardLogic.d.ts +8 -1
- package/dist/components/layout/accessCardLogic.js +11 -7
- 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 +13 -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/locale/labelRegistry.d.ts +10 -0
- package/dist/components/navigation/KapiAccordion.js +9 -9
- 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 +152 -136
- package/dist/components/navigation/KapiNavBadge.d.ts +6 -3
- package/dist/components/navigation/KapiNavBadge.js +26 -22
- 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/KapiToc.d.ts +48 -0
- package/dist/components/navigation/KapiToc.js +66 -0
- package/dist/components/navigation/KapiTree.js +10 -10
- 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/index.d.ts +3 -0
- 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/navigation/tocLogic.d.ts +35 -0
- package/dist/components/navigation/tocLogic.js +11 -0
- package/dist/components/navigation/tocSlots.d.ts +8 -0
- package/dist/components/navigation/tocSlots.js +11 -0
- package/dist/components/overlays/KapiCommandPalette.js +6 -6
- package/dist/components/overlays/KapiContextMenu.d.ts +8 -0
- package/dist/components/overlays/KapiContextMenu.js +5 -5
- package/dist/components/overlays/KapiMenuButton.js +7 -7
- package/dist/components/overlays/KapiModal.d.ts +9 -0
- package/dist/components/overlays/KapiModal.js +79 -77
- package/dist/components/overlays/KapiOffcanvas.js +24 -24
- package/dist/components/overlays/KapiPhotoView.js +10 -10
- package/dist/components/overlays/KapiPopover.js +6 -6
- package/dist/components/overlays/KapiShapeSheet.js +4 -4
- package/dist/components/overlays/KapiTooltip.js +18 -18
- package/dist/components/overlays/index.d.ts +1 -1
- package/dist/components/overlays/menuList.js +127 -117
- package/dist/components/overlays/modalSlots.d.ts +11 -0
- package/dist/components/overlays/modalSlots.js +14 -0
- package/dist/components/slotCatalog.d.ts +123 -0
- package/dist/components/slotCatalog.js +27 -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/KapiAnnotation.css +1 -1
- package/dist/css/components/display/KapiCodeBlock.css +1 -0
- package/dist/css/components/display/KapiDiff.css +1 -0
- 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/inputs/KapiPinInput.css +1 -0
- package/dist/css/components/inputs/KapiSelect.css +1 -1
- package/dist/css/components/inputs/inputsExtra.css +1 -1
- package/dist/css/components/layout/KapiAccessCard.css +1 -1
- package/dist/css/components/layout/KapiBox.css +1 -0
- package/dist/css/components/layout/KapiCollapse.css +1 -0
- package/dist/css/components/layout/KapiDivider.css +1 -1
- package/dist/css/components/layout/KapiRail.css +1 -1
- package/dist/css/components/layout/gridSpan.css +1 -0
- package/dist/css/components/navigation/KapiToc.css +1 -0
- package/dist/css/components/navigation/navigation.css +1 -1
- package/dist/hooks/asyncResourceLogic.d.ts +11 -0
- package/dist/hooks/asyncResourceLogic.js +4 -0
- package/dist/hooks/densityLogic.d.ts +15 -0
- package/dist/hooks/densityLogic.js +4 -0
- package/dist/hooks/index.d.ts +7 -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 +146 -0
- package/dist/hooks/toneFamilyLogic.js +164 -0
- package/dist/hooks/useAsyncResource.d.ts +45 -0
- package/dist/hooks/useAsyncResource.js +24 -0
- package/dist/hooks/useKapiTheme.d.ts +16 -3
- package/dist/hooks/useKapiTheme.js +130 -117
- package/dist/hooks/useToneFamilies.d.ts +40 -0
- package/dist/hooks/useToneFamilies.js +50 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +227 -204
- package/dist/kapi.css +1 -1
- package/dist/kapi.layered.css +1 -1
- package/dist/logic.d.ts +41 -0
- package/dist/logic.js +42 -0
- package/dist/styles/rawHeights.d.ts +8 -0
- package/package.json +14 -3
|
@@ -1,162 +1,164 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "#kapi-css/components/layout/KapiPageHeader.css";
|
|
3
3
|
import "#kapi-css/components/navigation/navigation.css";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { useMergedRefs as e } from "../../hooks/mergeRefs.js";
|
|
5
|
+
import { computedStyleOf as t, docOf as n } from "../../hooks/ownerDocument.js";
|
|
6
|
+
import { slot as r } from "../slotsLogic.js";
|
|
7
|
+
import { prefersReducedMotion as i } from "../../hooks/reducedMotion.js";
|
|
8
|
+
import { maxTransitionMs as a } from "../overlays/dialogUtils.js";
|
|
8
9
|
/* empty css */
|
|
9
|
-
import { KapiBreadcrumb as
|
|
10
|
-
import { useReopenBus as
|
|
11
|
-
import { useScrollCollapse as
|
|
12
|
-
import { pageHeaderBox as
|
|
10
|
+
import { KapiBreadcrumb as o } from "../navigation/KapiBreadcrumb.js";
|
|
11
|
+
import { useReopenBus as s } from "./reopenBus.js";
|
|
12
|
+
import { useScrollCollapse as c } from "../../hooks/useScrollCollapse.js";
|
|
13
|
+
import { pageHeaderBox as l } from "./pageHeaderLogic.js";
|
|
13
14
|
/* empty css */
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
15
|
+
import { PAGEHEADER_SLOTS as u } from "./pageHeaderSlots.js";
|
|
16
|
+
import { useEffect as d, useLayoutEffect as f, useRef as p } from "react";
|
|
17
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
18
|
+
import { ChevronsLeft as _, ChevronsRight as v } from "lucide-react";
|
|
17
19
|
//#region src/components/layout/KapiPageHeader.tsx
|
|
18
|
-
var
|
|
20
|
+
var y = "kapi-pageheader--collapsed", b = "kapi-pageheader--animating", x = "kapi-pageheader--measuring", S = 80, C = (e, t) => {
|
|
19
21
|
let n = e.style.height;
|
|
20
|
-
e.classList.add(
|
|
22
|
+
e.classList.add(x), e.style.height = "", e.classList.toggle(y, !1);
|
|
21
23
|
let r = e.getBoundingClientRect().height;
|
|
22
|
-
e.classList.toggle(
|
|
24
|
+
e.classList.toggle(y, !0);
|
|
23
25
|
let i = e.getBoundingClientRect().height;
|
|
24
|
-
return e.classList.toggle(
|
|
26
|
+
return e.classList.toggle(y, t), e.style.height = n, e.getBoundingClientRect(), e.classList.remove(x), {
|
|
25
27
|
expanded: r,
|
|
26
28
|
collapsed: i
|
|
27
29
|
};
|
|
28
|
-
},
|
|
29
|
-
let n =
|
|
30
|
+
}, w = (e, t) => {
|
|
31
|
+
let n = l(e, t);
|
|
30
32
|
return t ? n : {
|
|
31
33
|
height: null,
|
|
32
34
|
reserve: n.reserve
|
|
33
35
|
};
|
|
34
|
-
},
|
|
36
|
+
}, T = (e, t, n) => {
|
|
35
37
|
let r = () => {
|
|
36
38
|
t.height === null ? e.style.removeProperty("height") : e.style.height = `${t.height}px`, e.style.setProperty("--kapi-pageheader-reserve", `${t.reserve}px`);
|
|
37
39
|
};
|
|
38
40
|
n ? r() : (e.style.transition = "none", r(), e.getBoundingClientRect(), e.style.transition = "");
|
|
39
41
|
};
|
|
40
|
-
function
|
|
41
|
-
let { collapsed:
|
|
42
|
+
function E({ title: y, subtitle: x, meta: E, actions: D, chip: O, breadcrumbs: k, collapseOnScroll: A = !0, sticky: j = !0, scrollRoot: M = null, responsive: N = !0, className: P, classNames: F, ref: I, ...L }) {
|
|
43
|
+
let { collapsed: R, sentinelRef: z } = c({ root: M }), B = A && R, V = p(null), H = e(V, I), U = p({
|
|
42
44
|
expanded: 0,
|
|
43
45
|
collapsed: 0
|
|
44
|
-
}),
|
|
45
|
-
|
|
46
|
-
let
|
|
47
|
-
|
|
48
|
-
let e =
|
|
46
|
+
}), W = p(B);
|
|
47
|
+
W.current = B;
|
|
48
|
+
let G = p(!1), K = p(!1);
|
|
49
|
+
f(() => {
|
|
50
|
+
let e = V.current;
|
|
49
51
|
if (!e) return;
|
|
50
|
-
let
|
|
51
|
-
|
|
52
|
+
let t = () => {
|
|
53
|
+
K.current || (U.current = C(e, W.current), T(e, w(U.current, W.current), !1));
|
|
52
54
|
};
|
|
53
|
-
|
|
55
|
+
t();
|
|
54
56
|
let r = !0;
|
|
55
|
-
if (
|
|
56
|
-
r &&
|
|
57
|
+
if (n(e)?.fonts?.ready.then(() => {
|
|
58
|
+
r && t();
|
|
57
59
|
}), typeof ResizeObserver > "u") return () => {
|
|
58
60
|
r = !1;
|
|
59
61
|
};
|
|
60
62
|
let i = e.getBoundingClientRect().width, a = new ResizeObserver((e) => {
|
|
61
|
-
let
|
|
62
|
-
if (!
|
|
63
|
-
let r =
|
|
64
|
-
r !== i && (i = r,
|
|
63
|
+
let n = e[e.length - 1];
|
|
64
|
+
if (!n) return;
|
|
65
|
+
let r = n.borderBoxSize?.[0]?.inlineSize ?? n.contentRect.width;
|
|
66
|
+
r !== i && (i = r, t());
|
|
65
67
|
});
|
|
66
68
|
return a.observe(e), () => {
|
|
67
69
|
r = !1, a.disconnect();
|
|
68
70
|
};
|
|
69
71
|
}, [
|
|
70
|
-
_,
|
|
71
72
|
y,
|
|
72
|
-
|
|
73
|
-
T,
|
|
73
|
+
x,
|
|
74
74
|
E,
|
|
75
75
|
D,
|
|
76
76
|
O,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
let
|
|
82
|
-
|
|
77
|
+
k,
|
|
78
|
+
A,
|
|
79
|
+
N
|
|
80
|
+
]), f(() => {
|
|
81
|
+
let e = V.current;
|
|
82
|
+
if (!e) return;
|
|
83
|
+
let { expanded: n } = U.current, r = l(U.current, B), o = G.current && !i(e);
|
|
84
|
+
G.current = !0;
|
|
83
85
|
let s = () => {
|
|
84
|
-
|
|
86
|
+
K.current = !1, e.classList.remove(b), B || e.style.removeProperty("height");
|
|
85
87
|
};
|
|
86
88
|
if (!o) {
|
|
87
|
-
|
|
89
|
+
T(e, w(U.current, B), !1);
|
|
88
90
|
return;
|
|
89
91
|
}
|
|
90
|
-
|
|
91
|
-
let
|
|
92
|
-
|
|
92
|
+
e.style.height === "" && n > 0 && (e.style.height = `${n}px`, e.getBoundingClientRect()), K.current = !0, e.classList.add(b), T(e, r, !0);
|
|
93
|
+
let c = (t) => {
|
|
94
|
+
t.target === e && t.propertyName === "height" && s();
|
|
93
95
|
};
|
|
94
|
-
|
|
95
|
-
let u = e
|
|
96
|
+
e.addEventListener("transitionend", c);
|
|
97
|
+
let u = t(e), d = window.setTimeout(s, a(u.transitionDuration, u.transitionDelay) + S);
|
|
96
98
|
return () => {
|
|
97
|
-
|
|
99
|
+
e.removeEventListener("transitionend", c), window.clearTimeout(d);
|
|
98
100
|
};
|
|
99
|
-
}, [
|
|
100
|
-
let
|
|
101
|
+
}, [B]);
|
|
102
|
+
let q = [
|
|
101
103
|
"kapi-pageheader",
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
].filter(Boolean).join(" "),
|
|
107
|
-
|
|
108
|
-
let
|
|
109
|
-
return /* @__PURE__ */ m
|
|
110
|
-
ref:
|
|
104
|
+
j && "kapi-pageheader--sticky",
|
|
105
|
+
N && "kapi-pageheader--cq",
|
|
106
|
+
B && "kapi-pageheader--collapsed",
|
|
107
|
+
P
|
|
108
|
+
].filter(Boolean).join(" "), J = s(), Y = J?.addHost;
|
|
109
|
+
d(() => Y?.(), [Y]);
|
|
110
|
+
let X = J?.info ?? null, Z = X?.side === "right" ? _ : v;
|
|
111
|
+
return /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("div", {
|
|
112
|
+
ref: z,
|
|
111
113
|
className: "kapi-pageheader__sentinel",
|
|
112
114
|
"aria-hidden": !0
|
|
113
|
-
}), /* @__PURE__ */
|
|
114
|
-
...
|
|
115
|
-
ref:
|
|
116
|
-
|
|
115
|
+
}), /* @__PURE__ */ g("header", {
|
|
116
|
+
...L,
|
|
117
|
+
ref: H,
|
|
118
|
+
...r(u, "root", F, q),
|
|
117
119
|
children: [
|
|
118
|
-
|
|
120
|
+
X && /* @__PURE__ */ h("button", {
|
|
119
121
|
type: "button",
|
|
120
|
-
|
|
121
|
-
onClick:
|
|
122
|
-
"aria-label":
|
|
123
|
-
children: /* @__PURE__ */
|
|
122
|
+
...r(u, "reopen", F, "kapi-paneltoggle"),
|
|
123
|
+
onClick: X.expand,
|
|
124
|
+
"aria-label": X.label,
|
|
125
|
+
children: /* @__PURE__ */ h(Z, {
|
|
124
126
|
className: "kapi-flip-rtl",
|
|
125
127
|
size: 16,
|
|
126
128
|
strokeWidth: 2,
|
|
127
129
|
"aria-hidden": "true"
|
|
128
130
|
})
|
|
129
131
|
}),
|
|
130
|
-
/* @__PURE__ */
|
|
131
|
-
|
|
132
|
+
/* @__PURE__ */ g("div", {
|
|
133
|
+
...r(u, "main", F),
|
|
132
134
|
children: [
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
items:
|
|
135
|
+
k && k.length > 0 && /* @__PURE__ */ h(o, {
|
|
136
|
+
...r(u, "breadcrumb", F),
|
|
137
|
+
items: k
|
|
136
138
|
}),
|
|
137
|
-
/* @__PURE__ */
|
|
138
|
-
|
|
139
|
-
children: [/* @__PURE__ */
|
|
140
|
-
|
|
141
|
-
children:
|
|
142
|
-
}),
|
|
139
|
+
/* @__PURE__ */ g("div", {
|
|
140
|
+
...r(u, "titleRow", F),
|
|
141
|
+
children: [/* @__PURE__ */ h("h1", {
|
|
142
|
+
...r(u, "title", F),
|
|
143
|
+
children: y
|
|
144
|
+
}), O]
|
|
143
145
|
}),
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
children:
|
|
146
|
+
x && /* @__PURE__ */ h("div", {
|
|
147
|
+
...r(u, "subtitle", F),
|
|
148
|
+
children: x
|
|
147
149
|
}),
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
children:
|
|
150
|
+
E && /* @__PURE__ */ h("div", {
|
|
151
|
+
...r(u, "meta", F),
|
|
152
|
+
children: E
|
|
151
153
|
})
|
|
152
154
|
]
|
|
153
155
|
}),
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
children:
|
|
156
|
+
D && /* @__PURE__ */ h("div", {
|
|
157
|
+
...r(u, "actions", F),
|
|
158
|
+
children: D
|
|
157
159
|
})
|
|
158
160
|
]
|
|
159
161
|
})] });
|
|
160
162
|
}
|
|
161
163
|
//#endregion
|
|
162
|
-
export {
|
|
164
|
+
export { E as KapiPageHeader };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type KapiNavBadgeValue } from "../navigation/navBadgeLogic.js";
|
|
2
2
|
import type { KapiTone } from "../tone.js";
|
|
3
3
|
import type { ButtonHTMLAttributes, HTMLAttributes, InputHTMLAttributes, ReactNode, Ref } from "react";
|
|
4
|
+
import { type KapiRender } from "../renderSlot.js";
|
|
4
5
|
type DivProps = HTMLAttributes<HTMLDivElement> & {
|
|
5
6
|
/** Ref al `<div>` raíz. */
|
|
6
7
|
ref?: Ref<HTMLDivElement> | undefined;
|
|
@@ -41,8 +42,16 @@ export declare const KapiPanelList: ({ children, ...rest }: Omit<DivProps, "chil
|
|
|
41
42
|
children: ReactNode;
|
|
42
43
|
}) => import("react").JSX.Element;
|
|
43
44
|
export type KapiPanelItemProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"> & {
|
|
44
|
-
/** Ref al `<button>` del ítem. */
|
|
45
|
+
/** Ref al `<button>` del ítem (o al elemento de `render`). */
|
|
45
46
|
ref?: Ref<HTMLButtonElement> | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Dibuja OTRO elemento con el aspecto del ítem: el `<Link>` de tu router, para navegar sin recargar la
|
|
49
|
+
* página. Las clases se unen, los estilos se funden y los handlers corren los dos (primero el tuyo).
|
|
50
|
+
* `aria-current` sale de `active`; `disabled` pasa a `aria-disabled` y frena el clic.
|
|
51
|
+
*
|
|
52
|
+
* <KapiPanelItem render={<Link to="/listado" />}>Listado</KapiPanelItem>
|
|
53
|
+
*/
|
|
54
|
+
render?: KapiRender | undefined;
|
|
46
55
|
/** Marca el ítem actual (resaltado y `aria-current="page"`). */
|
|
47
56
|
active?: boolean | undefined;
|
|
48
57
|
/** Contenido a la derecha (badge, contador…). */
|
|
@@ -59,5 +68,5 @@ export type KapiPanelItemProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "
|
|
|
59
68
|
children: ReactNode;
|
|
60
69
|
};
|
|
61
70
|
/** Ítem de navegación del panel contextual. `aria-current` sale de `active`; `icon` va antes del texto. */
|
|
62
|
-
export declare const KapiPanelItem: ({ active, trailing, badge, badgeTone, badgeLabel, icon, className, type, children, ...rest }: KapiPanelItemProps) => import("react").JSX.Element;
|
|
71
|
+
export declare const KapiPanelItem: ({ active, trailing, badge, badgeTone, badgeLabel, icon, className, type, children, render, disabled, ref, ...rest }: KapiPanelItemProps) => import("react").JSX.Element;
|
|
63
72
|
export {};
|
|
@@ -2,81 +2,98 @@
|
|
|
2
2
|
import "#kapi-css/components/layout/KapiPanelParts.css";
|
|
3
3
|
import "#kapi-css/components/navigation/navigation.css";
|
|
4
4
|
import { joinClasses as e } from "../rootProps.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { renderSlot as t } from "../renderSlot.js";
|
|
6
|
+
import { useLabels as n } from "../locale/KapiLocaleProvider.js";
|
|
7
|
+
import { searchChipName as r } from "../inputs/searchChipLogic.js";
|
|
8
|
+
import { DEFAULT_SEARCH_CHIP_LABELS as i } from "../inputs/KapiSearchChip.js";
|
|
8
9
|
import "../navigation/navBadgeLogic.js";
|
|
9
|
-
import { KapiNavBadge as
|
|
10
|
-
import { CtxSlidingList as
|
|
10
|
+
import { KapiNavBadge as a } from "../navigation/KapiNavBadge.js";
|
|
11
|
+
import { CtxSlidingList as o } from "../navigation/CtxSlidingList.js";
|
|
11
12
|
/* empty css */
|
|
12
|
-
import { useKapiPanelMini as
|
|
13
|
-
import { MiniNavItem as
|
|
13
|
+
import { useKapiPanelMini as s } from "../navigation/panelMini.js";
|
|
14
|
+
import { MiniNavItem as c } from "../navigation/MiniNavItem.js";
|
|
14
15
|
/* empty css */
|
|
15
|
-
import { jsx as
|
|
16
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
16
17
|
//#region src/components/layout/KapiPanelParts.tsx
|
|
17
|
-
var
|
|
18
|
+
var f = ({ className: t, ...n }) => /* @__PURE__ */ u("div", {
|
|
18
19
|
...n,
|
|
19
20
|
className: e("kapi-ct", t)
|
|
20
|
-
}),
|
|
21
|
+
}), p = ({ className: t, ...n }) => /* @__PURE__ */ u("div", {
|
|
21
22
|
...n,
|
|
22
23
|
className: e("kapi-ctxdivider", t)
|
|
23
|
-
}),
|
|
24
|
+
}), m = ({ className: t, ...n }) => /* @__PURE__ */ u("div", {
|
|
24
25
|
...n,
|
|
25
26
|
className: e("kapi-hint", t)
|
|
26
|
-
}),
|
|
27
|
-
let
|
|
28
|
-
return /* @__PURE__ */
|
|
27
|
+
}), h = ({ className: t, placeholder: a, "aria-label": o, ...s }) => {
|
|
28
|
+
let c = n("searchChip", i, void 0);
|
|
29
|
+
return /* @__PURE__ */ u("input", {
|
|
29
30
|
...s,
|
|
30
31
|
type: "search",
|
|
31
|
-
className: e("kapi-ctxsearch kapi-ctxsearch--input",
|
|
32
|
+
className: e("kapi-ctxsearch kapi-ctxsearch--input", t),
|
|
32
33
|
placeholder: a,
|
|
33
|
-
"aria-label":
|
|
34
|
+
"aria-label": r({
|
|
34
35
|
ariaLabel: o,
|
|
35
36
|
placeholder: a,
|
|
36
|
-
fallback:
|
|
37
|
+
fallback: c.search
|
|
37
38
|
})
|
|
38
39
|
});
|
|
39
|
-
},
|
|
40
|
+
}, g = ({ children: e, ...t }) => /* @__PURE__ */ u(o, {
|
|
40
41
|
...t,
|
|
41
42
|
children: e
|
|
42
|
-
}),
|
|
43
|
-
let { mini:
|
|
44
|
-
|
|
45
|
-
...
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
className: e("kapi-ctxitem", t && "kapi-ctxitem--on", f),
|
|
58
|
-
"aria-current": t ? "page" : void 0,
|
|
59
|
-
children: [
|
|
60
|
-
d == null || d === !1 ? m : /* @__PURE__ */ l("span", {
|
|
61
|
-
className: "kapi-ctxitem__lead",
|
|
62
|
-
children: [/* @__PURE__ */ c("span", {
|
|
63
|
-
className: "kapi-ctxitem__icon",
|
|
64
|
-
"aria-hidden": "true",
|
|
65
|
-
children: d
|
|
66
|
-
}), /* @__PURE__ */ c("span", {
|
|
67
|
-
className: "kapi-ctxitem__label",
|
|
68
|
-
children: m
|
|
69
|
-
})]
|
|
70
|
-
}),
|
|
71
|
-
/* @__PURE__ */ c(i, {
|
|
72
|
-
value: r,
|
|
73
|
-
tone: a,
|
|
74
|
-
label: u,
|
|
75
|
-
max: 999
|
|
76
|
-
}),
|
|
77
|
-
n
|
|
78
|
-
]
|
|
43
|
+
}), _ = ({ active: n = !1, trailing: r, badge: i, badgeTone: o, badgeLabel: f, icon: p, className: m, type: h = "button", children: g, render: _, disabled: v, ref: y, ...b }) => {
|
|
44
|
+
let { mini: x } = s();
|
|
45
|
+
if (x) return /* @__PURE__ */ u(c, {
|
|
46
|
+
...b,
|
|
47
|
+
ref: y,
|
|
48
|
+
type: h,
|
|
49
|
+
className: m,
|
|
50
|
+
disabled: v,
|
|
51
|
+
render: _,
|
|
52
|
+
label: g,
|
|
53
|
+
icon: p,
|
|
54
|
+
active: n,
|
|
55
|
+
badge: i,
|
|
56
|
+
badgeTone: o,
|
|
57
|
+
badgeLabel: f
|
|
79
58
|
});
|
|
59
|
+
let S = e("kapi-ctxitem", n && "kapi-ctxitem--on", m), C = /* @__PURE__ */ d(l, { children: [
|
|
60
|
+
p == null || p === !1 ? g : /* @__PURE__ */ d("span", {
|
|
61
|
+
className: "kapi-ctxitem__lead",
|
|
62
|
+
children: [/* @__PURE__ */ u("span", {
|
|
63
|
+
className: "kapi-ctxitem__icon",
|
|
64
|
+
"aria-hidden": "true",
|
|
65
|
+
children: p
|
|
66
|
+
}), /* @__PURE__ */ u("span", {
|
|
67
|
+
className: "kapi-ctxitem__label",
|
|
68
|
+
children: g
|
|
69
|
+
})]
|
|
70
|
+
}),
|
|
71
|
+
/* @__PURE__ */ u(a, {
|
|
72
|
+
value: i,
|
|
73
|
+
tone: o,
|
|
74
|
+
label: f,
|
|
75
|
+
max: 999
|
|
76
|
+
}),
|
|
77
|
+
r
|
|
78
|
+
] });
|
|
79
|
+
return _ === void 0 ? /* @__PURE__ */ u("button", {
|
|
80
|
+
...b,
|
|
81
|
+
ref: y,
|
|
82
|
+
type: h,
|
|
83
|
+
disabled: v,
|
|
84
|
+
className: S,
|
|
85
|
+
"aria-current": n ? "page" : void 0,
|
|
86
|
+
children: C
|
|
87
|
+
}) : t(_, {
|
|
88
|
+
...b,
|
|
89
|
+
className: S
|
|
90
|
+
}, {
|
|
91
|
+
"aria-current": n ? "page" : void 0,
|
|
92
|
+
"aria-disabled": v || void 0,
|
|
93
|
+
...v ? { onClick: (e) => e.preventDefault() } : {},
|
|
94
|
+
ref: y,
|
|
95
|
+
children: C
|
|
96
|
+
}, (e) => /* @__PURE__ */ u("a", { ...e }));
|
|
80
97
|
};
|
|
81
98
|
//#endregion
|
|
82
|
-
export {
|
|
99
|
+
export { p as KapiPanelDivider, m as KapiPanelHint, _ as KapiPanelItem, f as KapiPanelLabel, g as KapiPanelList, h as KapiPanelSearch };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type HTMLAttributes, type ReactNode, type Ref } from "react";
|
|
2
2
|
import { type KapiRailEntry, type KapiRailItem, type KapiRailPinned, type KapiRailSeparator, type KapiRailZone, type KapiRailVariant } from "./railLogic.js";
|
|
3
|
+
import type { KapiClassNames } from "../slotCatalog.js";
|
|
3
4
|
import { type KapiLinkLabels } from "../locale/linkLabels.js";
|
|
4
5
|
import type { KapiLabelsOverride } from "../labelsLogic.js";
|
|
5
6
|
export type { KapiRailEntry, KapiRailItem, KapiRailPinned, KapiRailSeparator, KapiRailVariant, KapiRailZone };
|
|
@@ -15,6 +16,8 @@ export type KapiRailLabels = {
|
|
|
15
16
|
};
|
|
16
17
|
export declare const DEFAULT_RAIL_LABELS: KapiRailLabels;
|
|
17
18
|
/** Atributos nativos (`id`, `style`, `data-*`…) van al `<nav>`. `Id` se infiere de `items`. */
|
|
19
|
+
/** Partes de `KapiRail` que acepta `classNames`: `root`, `brand`, `start`, `scroll`, `indicator`, `item`, `label`, `separator` y `end`. */
|
|
20
|
+
export type KapiRailClassNames = KapiClassNames<"rail">;
|
|
18
21
|
export type KapiRailProps<Id extends string = string> = Omit<HTMLAttributes<HTMLElement>, "children" | "onSelect"> & {
|
|
19
22
|
/**
|
|
20
23
|
* Ítems del rail. Intercala `{ separator: true }` para dibujar un divisor entre grupos. Con `pinned: "start"`
|
|
@@ -22,6 +25,12 @@ export type KapiRailProps<Id extends string = string> = Omit<HTMLAttributes<HTML
|
|
|
22
25
|
* (en vertical) y la única que, en la barra inferior del celular, esconde en «Más» lo que no entra.
|
|
23
26
|
*/
|
|
24
27
|
items: readonly KapiRailEntry<Id>[];
|
|
28
|
+
/**
|
|
29
|
+
* Clases por parte: `classNames={{ item: "mi-item", indicator: "mi-pildora" }}`. Se suman a las propias.
|
|
30
|
+
* `root` es el `<nav>` (lo mismo que `className`). Cada parte además lleva `data-slot="rail-<parte>"`;
|
|
31
|
+
* el ítem activo se alcanza con `[data-slot="rail-item"][aria-current="page"]`.
|
|
32
|
+
*/
|
|
33
|
+
classNames?: KapiRailClassNames | undefined;
|
|
25
34
|
/** id del ítem activo (controlado por la app: derívalo de tu router). */
|
|
26
35
|
activeId?: Id | undefined;
|
|
27
36
|
/** Se llama con el `id` del ítem clickeado (la app navega y actualiza `activeId`). */
|
|
@@ -49,4 +58,4 @@ export type KapiRailProps<Id extends string = string> = Omit<HTMLAttributes<HTML
|
|
|
49
58
|
* En móvil se convierte en barra inferior (shell.css): muestra los ítems del medio que entran y manda el
|
|
50
59
|
* resto a un ítem «Más» que abre un menú hacia arriba. Los ítems fijos y el footer no se tocan.
|
|
51
60
|
*/
|
|
52
|
-
export declare const KapiRail: <Id extends string = string>({ items, activeId, onSelect, brand, footer, variant, "aria-label": ariaLabel, labels, className, ref, ...rest }: KapiRailProps<Id>) => import("react").JSX.Element;
|
|
61
|
+
export declare const KapiRail: <Id extends string = string>({ items, activeId, onSelect, brand, footer, variant, "aria-label": ariaLabel, labels, className, classNames, ref, ...rest }: KapiRailProps<Id>) => import("react").JSX.Element;
|