@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
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "#kapi-css/components/display/typography.css";
|
|
3
|
+
import { useToneLook as e } from "../../hooks/useToneFamilies.js";
|
|
4
|
+
import { joinClasses as t } from "../rootProps.js";
|
|
5
|
+
import { renderSlot as n } from "../renderSlot.js";
|
|
6
|
+
import { textClasses as r, truncateLines as i } from "./textLogic.js";
|
|
7
|
+
/* empty css */
|
|
8
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
9
|
+
//#region src/components/display/KapiText.tsx
|
|
10
|
+
var o = ({ size: o, tone: s, muted: c, weight: l, align: u, truncate: d, as: f = "p", render: p, className: m, style: h, ref: g, children: _, ...v }) => {
|
|
11
|
+
let y = i(d), b = e("KapiText", s), x = {
|
|
12
|
+
className: t(...r({
|
|
13
|
+
size: o,
|
|
14
|
+
tone: b.tone,
|
|
15
|
+
muted: c,
|
|
16
|
+
weight: l,
|
|
17
|
+
align: u,
|
|
18
|
+
truncate: d
|
|
19
|
+
}), f === "code" && "kapi-code", f === "kbd" && "kapi-kbd", m),
|
|
20
|
+
style: y === void 0 && !b.style ? h : {
|
|
21
|
+
...y === void 0 ? {} : { "--kapi-text-lines": y },
|
|
22
|
+
...b.style,
|
|
23
|
+
...h
|
|
24
|
+
},
|
|
25
|
+
...v
|
|
26
|
+
}, S = f;
|
|
27
|
+
return n(p, x, {
|
|
28
|
+
ref: g,
|
|
29
|
+
children: _
|
|
30
|
+
}, (e) => /* @__PURE__ */ a(S, { ...e }));
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
33
|
+
export { o as KapiText };
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { HTMLAttributes, ReactNode, Ref } from "react";
|
|
2
|
-
import { type
|
|
2
|
+
import { type KapiTimelineToneName } from "./timelineLogic.js";
|
|
3
3
|
export type KapiTimelineItem = {
|
|
4
|
+
/** Qué pasó. */
|
|
4
5
|
text: ReactNode;
|
|
6
|
+
/** Cuándo pasó; se dibuja apagado debajo del texto. */
|
|
5
7
|
date?: ReactNode;
|
|
6
|
-
|
|
8
|
+
/** Color del punto: un tono de la línea de tiempo o una familia propia de la app. @default "primary" */
|
|
9
|
+
tone?: KapiTimelineToneName | undefined;
|
|
7
10
|
};
|
|
8
11
|
/** Atributos nativos (`id`, `style`, `data-*`, `aria-*`…) van al `<ol>`. */
|
|
9
12
|
export type KapiTimelineProps = Omit<HTMLAttributes<HTMLOListElement>, "children"> & {
|
|
@@ -1,31 +1,39 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "#kapi-css/components/display/display.css";
|
|
3
|
+
import { useToneLookResolver as e } from "../../hooks/useToneFamilies.js";
|
|
3
4
|
/* empty css */
|
|
4
|
-
import { showConnector as
|
|
5
|
-
import { jsx as
|
|
5
|
+
import { isTimelineTone as t, needsToneResolver as n, showConnector as r, timelineDotClass as i } from "./timelineLogic.js";
|
|
6
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
7
|
//#region src/components/display/KapiTimeline.tsx
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
children: [/* @__PURE__ */
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
8
|
+
function s({ items: s, className: c, ...l }) {
|
|
9
|
+
let u = e("KapiTimeline");
|
|
10
|
+
return /* @__PURE__ */ a("ol", {
|
|
11
|
+
...l,
|
|
12
|
+
className: ["kapi-timeline", c].filter(Boolean).join(" "),
|
|
13
|
+
children: s.map((e, c) => {
|
|
14
|
+
let l = n(e.tone) ? u(e.tone) : void 0;
|
|
15
|
+
return /* @__PURE__ */ o("li", {
|
|
16
|
+
className: "kapi-timeline__item",
|
|
17
|
+
children: [/* @__PURE__ */ o("div", {
|
|
18
|
+
className: "kapi-timeline__rail",
|
|
19
|
+
"aria-hidden": !0,
|
|
20
|
+
children: [/* @__PURE__ */ a("span", {
|
|
21
|
+
className: i(t(e.tone) ? e.tone : void 0, l?.style !== void 0),
|
|
22
|
+
style: l?.style
|
|
23
|
+
}), r(c, s.length) && /* @__PURE__ */ a("span", { className: "kapi-tl-line" })]
|
|
24
|
+
}), /* @__PURE__ */ o("div", {
|
|
25
|
+
className: "kapi-timeline__body",
|
|
26
|
+
children: [/* @__PURE__ */ a("div", {
|
|
27
|
+
className: "kapi-strong",
|
|
28
|
+
children: e.text
|
|
29
|
+
}), e.date != null && /* @__PURE__ */ a("div", {
|
|
30
|
+
className: "kapi-muted",
|
|
31
|
+
children: e.date
|
|
32
|
+
})]
|
|
25
33
|
})]
|
|
26
|
-
})
|
|
27
|
-
}
|
|
34
|
+
}, c);
|
|
35
|
+
})
|
|
28
36
|
});
|
|
29
37
|
}
|
|
30
38
|
//#endregion
|
|
31
|
-
export {
|
|
39
|
+
export { s as KapiTimeline };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { HTMLAttributes, Ref } from "react";
|
|
2
|
+
import { type KapiTextAlign, type KapiTextSize, type KapiTextTone, type KapiTextWeight, type KapiTitleLevel } from "./textLogic.js";
|
|
3
|
+
export type KapiTitleProps = HTMLAttributes<HTMLHeadingElement> & {
|
|
4
|
+
/** Ref al `<h1>`–`<h6>`. */
|
|
5
|
+
ref?: Ref<HTMLHeadingElement> | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* Nivel del encabezado (`h1` a `h6`): es la estructura del documento, lo que leen los lectores de
|
|
8
|
+
* pantalla. NO decide el tamaño; para eso está `size`.
|
|
9
|
+
* @default 2
|
|
10
|
+
*/
|
|
11
|
+
level?: KapiTitleLevel | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Tamaño visual, de la escala `--kapi-fs-*`, independiente del nivel: un `h2` puede verse chico sin
|
|
14
|
+
* romper la jerarquía. Sin `size`, cada nivel trae el suyo.
|
|
15
|
+
*/
|
|
16
|
+
size?: KapiTextSize | undefined;
|
|
17
|
+
/** Color semántico (`KapiTone`). Sin `tone` el título usa la tinta del sistema. */
|
|
18
|
+
tone?: KapiTextTone | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Peso de la letra.
|
|
21
|
+
* @default "bold"
|
|
22
|
+
*/
|
|
23
|
+
weight?: KapiTextWeight | undefined;
|
|
24
|
+
/** Alineación del texto dentro de su caja. */
|
|
25
|
+
align?: KapiTextAlign | undefined;
|
|
26
|
+
/** Corta con elipsis: `true` o `1` en una línea, un número mayor en esa cantidad de líneas. */
|
|
27
|
+
truncate?: boolean | number | undefined;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Encabezado. El nivel (`level`) y el tamaño visual (`size`) son props separadas a propósito: elegir
|
|
31
|
+
* `h4` para que se vea chico rompe la estructura que usan los lectores de pantalla.
|
|
32
|
+
*/
|
|
33
|
+
export declare const KapiTitle: ({ level, size, tone, weight, align, truncate, className, style, ref, ...rest }: KapiTitleProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "#kapi-css/components/display/typography.css";
|
|
3
|
+
import { useToneLook as e } from "../../hooks/useToneFamilies.js";
|
|
4
|
+
import { joinClasses as t } from "../rootProps.js";
|
|
5
|
+
import { TITLE_DEFAULT_SIZE as n, textClasses as r, truncateLines as i } from "./textLogic.js";
|
|
6
|
+
/* empty css */
|
|
7
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
8
|
+
//#region src/components/display/KapiTitle.tsx
|
|
9
|
+
var o = ({ level: o = 2, size: s, tone: c, weight: l, align: u, truncate: d, className: f, style: p, ref: m, ...h }) => {
|
|
10
|
+
let g = `h${o}`, _ = i(d), v = e("KapiTitle", c);
|
|
11
|
+
return /* @__PURE__ */ a(g, {
|
|
12
|
+
...h,
|
|
13
|
+
ref: m,
|
|
14
|
+
className: t(...r({
|
|
15
|
+
size: s ?? n[o],
|
|
16
|
+
tone: v.tone,
|
|
17
|
+
weight: l,
|
|
18
|
+
align: u,
|
|
19
|
+
truncate: d
|
|
20
|
+
}), "kapi-heading", f),
|
|
21
|
+
style: _ === void 0 && !v.style ? p : {
|
|
22
|
+
..._ === void 0 ? {} : { "--kapi-text-lines": _ },
|
|
23
|
+
...v.style,
|
|
24
|
+
...p
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { o as KapiTitle };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
+
import { type KapiFamilyTone } from "../tone.js";
|
|
2
3
|
export type KapiAnnotationUnderline = "dotted" | "solid" | "none";
|
|
3
4
|
export type KapiAnnotationTone = "primary" | "info" | "warning" | "neutral";
|
|
4
5
|
/** Clases del término anotado. Pura: es lo que se testea (no el markup). */
|
|
5
6
|
export declare const annotationClasses: ({ underline, tone, clickable, className }?: {
|
|
6
7
|
underline?: KapiAnnotationUnderline | undefined;
|
|
7
|
-
tone?: KapiAnnotationTone | undefined;
|
|
8
|
+
tone?: KapiAnnotationTone | KapiFamilyTone | undefined;
|
|
8
9
|
clickable?: boolean | undefined;
|
|
9
10
|
className?: string | undefined;
|
|
10
11
|
}) => string;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import { isFamilyTone as e } from "../tone.js";
|
|
1
2
|
//#region src/components/display/annotationLogic.ts
|
|
2
|
-
var
|
|
3
|
+
var t = ({ underline: t = "dotted", tone: n = "primary", clickable: r = !1, className: i = "" } = {}) => [
|
|
3
4
|
"kapi-annotation",
|
|
5
|
+
e(n) ? "kapi-annotation--family" : `kapi-annotation--${n}`,
|
|
4
6
|
`kapi-annotation--${t}`,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
].filter(Boolean).join(" "), t = (e, t, n) => {
|
|
7
|
+
r && "kapi-annotation--clickable",
|
|
8
|
+
i
|
|
9
|
+
].filter(Boolean).join(" "), n = (e, t, n) => {
|
|
9
10
|
let r = typeof e == "function";
|
|
10
11
|
return {
|
|
11
12
|
element: r ? "button" : "span",
|
|
@@ -14,4 +15,4 @@ var e = ({ underline: e = "dotted", tone: t = "primary", clickable: n = !1, clas
|
|
|
14
15
|
};
|
|
15
16
|
};
|
|
16
17
|
//#endregion
|
|
17
|
-
export {
|
|
18
|
+
export { t as annotationClasses, n as annotationRole };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Partes de `codeBlock` (ver `slotCatalog.ts` para el contrato). Vive junto al componente. */
|
|
2
|
+
export declare const CODE_BLOCK_SLOTS: import("../slotsLogic.js").SlotTable<"codeBlock", {
|
|
3
|
+
readonly root: "kapi-codeblock";
|
|
4
|
+
readonly bar: "kapi-codeblock__bar";
|
|
5
|
+
readonly title: "kapi-codeblock__title";
|
|
6
|
+
readonly copy: null;
|
|
7
|
+
readonly pre: "kapi-codeblock__pre";
|
|
8
|
+
readonly numbers: "kapi-codeblock__nums";
|
|
9
|
+
readonly code: "kapi-codeblock__code";
|
|
10
|
+
}>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defineSlots as e } from "../slotsLogic.js";
|
|
2
|
+
//#region src/components/display/codeBlockSlots.ts
|
|
3
|
+
var t = e("codeBlock", {
|
|
4
|
+
root: "kapi-codeblock",
|
|
5
|
+
bar: "kapi-codeblock__bar",
|
|
6
|
+
title: "kapi-codeblock__title",
|
|
7
|
+
copy: null,
|
|
8
|
+
pre: "kapi-codeblock__pre",
|
|
9
|
+
numbers: "kapi-codeblock__nums",
|
|
10
|
+
code: "kapi-codeblock__code"
|
|
11
|
+
});
|
|
12
|
+
//#endregion
|
|
13
|
+
export { t as CODE_BLOCK_SLOTS };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/** Qué le pasó a una línea entre `before` y `after`. */
|
|
2
|
+
export type KapiDiffKind = "equal" | "add" | "remove";
|
|
3
|
+
/** Una línea del resultado, con su número en cada lado (`null` si no existe de ese lado). */
|
|
4
|
+
export type KapiDiffLine = {
|
|
5
|
+
/** Si la línea se mantiene, se agrega o se quita. */
|
|
6
|
+
kind: KapiDiffKind;
|
|
7
|
+
/** Número de línea en `before`, desde 1. `null` en una línea agregada. */
|
|
8
|
+
before: number | null;
|
|
9
|
+
/** Número de línea en `after`, desde 1. `null` en una línea quitada. */
|
|
10
|
+
after: number | null;
|
|
11
|
+
/** El texto de la línea, sin el salto. */
|
|
12
|
+
text: string;
|
|
13
|
+
};
|
|
14
|
+
/** Un tramo del resultado: líneas seguidas, con el aviso de cuántas se saltearon antes. */
|
|
15
|
+
export type KapiDiffHunk = {
|
|
16
|
+
/** Las líneas del tramo, en orden. */
|
|
17
|
+
lines: KapiDiffLine[];
|
|
18
|
+
/** Cuántas líneas iguales quedaron ocultas ANTES de este tramo. 0 en el primero si no se cortó. */
|
|
19
|
+
skipped: number;
|
|
20
|
+
/**
|
|
21
|
+
* Cuántas líneas iguales quedaron ocultas DESPUÉS de este tramo. Sólo el último puede traerlo
|
|
22
|
+
* distinto de 0: sin esto, las ocultas del final se contaban y se tiraban, y la vista parecía
|
|
23
|
+
* terminar en el último cambio.
|
|
24
|
+
*/
|
|
25
|
+
skippedAfter: number;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* La diferencia línea por línea entre dos textos.
|
|
29
|
+
*
|
|
30
|
+
* El orden dentro de un bloque cambiado es **primero lo que se quita y después lo que se agrega**,
|
|
31
|
+
* que es como se lee un diff en todos lados. Myers emite las operaciones mezcladas según por dónde
|
|
32
|
+
* pasó el camino, así que cada bloque se reordena al armarlo.
|
|
33
|
+
*/
|
|
34
|
+
export declare const diffLines: (before: string, after: string) => KapiDiffLine[];
|
|
35
|
+
/**
|
|
36
|
+
* Corta el resultado en tramos, dejando `context` líneas iguales alrededor de cada cambio.
|
|
37
|
+
*
|
|
38
|
+
* Sin esto, comparar dos versiones de un documento largo muestra el documento entero con tres
|
|
39
|
+
* líneas en rojo en el medio. `skipped` dice cuántas se ocultaron antes de cada tramo, para poder
|
|
40
|
+
* dibujar el "… 42 líneas sin cambios".
|
|
41
|
+
*
|
|
42
|
+
* Con `context: Infinity` devuelve un solo tramo con todo, que es lo que quiere una vista completa.
|
|
43
|
+
*/
|
|
44
|
+
export declare const diffHunks: (lines: readonly KapiDiffLine[], context?: number) => KapiDiffHunk[];
|
|
45
|
+
/** Una fila de la vista lado a lado: puede faltar de un lado. */
|
|
46
|
+
export type KapiDiffRow = {
|
|
47
|
+
/** La línea de la izquierda (`before`), o `null` si de ese lado no hay. */
|
|
48
|
+
left: KapiDiffLine | null;
|
|
49
|
+
/** La línea de la derecha (`after`), o `null` si de ese lado no hay. */
|
|
50
|
+
right: KapiDiffLine | null;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Pasa un tramo a filas de dos columnas, emparejando lo quitado con lo agregado.
|
|
54
|
+
*
|
|
55
|
+
* Emparejar importa: con tres líneas quitadas y tres agregadas se quiere verlas enfrentadas, no
|
|
56
|
+
* seis filas con huecos. Cuando los conteos no coinciden, el lado corto queda en `null`.
|
|
57
|
+
*/
|
|
58
|
+
export declare const diffRows: (lines: readonly KapiDiffLine[]) => KapiDiffRow[];
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
//#region src/components/display/diffLogic.ts
|
|
2
|
+
var e = (e) => e === "" ? [] : e.split(/\r?\n/), t = (e, t, n) => t === -n || t !== n && (e.get(t - 1) ?? 0) < (e.get(t + 1) ?? 0), n = (e, n) => {
|
|
3
|
+
let i = e.length, a = n.length, o = i + a, s = /* @__PURE__ */ new Map([[1, 0]]), c = [], l = Math.min(o, 1e3);
|
|
4
|
+
for (let o = 0; o <= l; o++) {
|
|
5
|
+
c.push(new Map(s));
|
|
6
|
+
for (let l = -o; l <= o; l += 2) {
|
|
7
|
+
let u = t(s, l, o) ? s.get(l + 1) ?? 0 : (s.get(l - 1) ?? 0) + 1, d = u - l;
|
|
8
|
+
for (; u < i && d < a && e[u] === n[d];) u++, d++;
|
|
9
|
+
if (s.set(l, u), u >= i && d >= a) return r(c, i, a, o);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
return [...Array.from({ length: i }, () => "remove"), ...Array.from({ length: a }, () => "add")];
|
|
13
|
+
}, r = (e, n, r, i) => {
|
|
14
|
+
let a = [], o = n, s = r;
|
|
15
|
+
for (let n = i; n > 0; n--) {
|
|
16
|
+
let r = e[n], i = o - s, c = t(r, i, n), l = c ? i + 1 : i - 1, u = r.get(l) ?? 0, d = u - l;
|
|
17
|
+
for (; o > u && s > d;) a.push("equal"), o--, s--;
|
|
18
|
+
a.push(c ? "add" : "remove"), o = u, s = d;
|
|
19
|
+
}
|
|
20
|
+
for (; o > 0 && s > 0;) a.push("equal"), o--, s--;
|
|
21
|
+
return a.reverse();
|
|
22
|
+
}, i = (t, r) => {
|
|
23
|
+
let i = e(t), a = e(r), o = n(i, a), s = [], c = 0, l = 0, u = 0;
|
|
24
|
+
for (; u < o.length;) {
|
|
25
|
+
if (o[u] === "equal") {
|
|
26
|
+
s.push({
|
|
27
|
+
kind: "equal",
|
|
28
|
+
before: c + 1,
|
|
29
|
+
after: l + 1,
|
|
30
|
+
text: i[c]
|
|
31
|
+
}), c++, l++, u++;
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
let e = [], t = [];
|
|
35
|
+
for (; u < o.length && o[u] !== "equal";) o[u] === "remove" ? (e.push({
|
|
36
|
+
kind: "remove",
|
|
37
|
+
before: c + 1,
|
|
38
|
+
after: null,
|
|
39
|
+
text: i[c]
|
|
40
|
+
}), c++) : (t.push({
|
|
41
|
+
kind: "add",
|
|
42
|
+
before: null,
|
|
43
|
+
after: l + 1,
|
|
44
|
+
text: a[l]
|
|
45
|
+
}), l++), u++;
|
|
46
|
+
s.push(...e, ...t);
|
|
47
|
+
}
|
|
48
|
+
return s;
|
|
49
|
+
}, a = (e) => e === Infinity ? Infinity : Number.isFinite(e) ? Math.max(0, Math.trunc(e)) : 0, o = (e, t = 3) => {
|
|
50
|
+
if (e.length === 0) return [];
|
|
51
|
+
let n = a(t), r = /* @__PURE__ */ new Set(), i = 0;
|
|
52
|
+
for (let t = 0; t < e.length; t++) {
|
|
53
|
+
if (e[t]?.kind === "equal") continue;
|
|
54
|
+
let a = Math.max(i, t - n), o = Math.min(e.length - 1, t + n);
|
|
55
|
+
for (let e = a; e <= o; e++) r.add(e);
|
|
56
|
+
i = Math.max(i, o + 1);
|
|
57
|
+
}
|
|
58
|
+
if (r.size === 0) return [];
|
|
59
|
+
let o = [], s = [], c = 0, l = 0;
|
|
60
|
+
for (let t = 0; t < e.length; t++) r.has(t) ? (s.length === 0 && (c = l), l = 0, s.push(e[t])) : (s.length > 0 && (o.push({
|
|
61
|
+
lines: s,
|
|
62
|
+
skipped: c,
|
|
63
|
+
skippedAfter: 0
|
|
64
|
+
}), s = []), l++);
|
|
65
|
+
s.length > 0 && o.push({
|
|
66
|
+
lines: s,
|
|
67
|
+
skipped: c,
|
|
68
|
+
skippedAfter: 0
|
|
69
|
+
});
|
|
70
|
+
let u = o[o.length - 1];
|
|
71
|
+
return u !== void 0 && (u.skippedAfter = l), o;
|
|
72
|
+
}, s = (e) => {
|
|
73
|
+
let t = [], n = 0;
|
|
74
|
+
for (; n < e.length;) {
|
|
75
|
+
let r = e[n];
|
|
76
|
+
if (r.kind === "equal") {
|
|
77
|
+
t.push({
|
|
78
|
+
left: r,
|
|
79
|
+
right: r
|
|
80
|
+
}), n++;
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
let i = [], a = [];
|
|
84
|
+
for (; n < e.length && e[n]?.kind !== "equal";) {
|
|
85
|
+
let t = e[n];
|
|
86
|
+
(t.kind === "remove" ? i : a).push(t), n++;
|
|
87
|
+
}
|
|
88
|
+
for (let e = 0; e < Math.max(i.length, a.length); e++) t.push({
|
|
89
|
+
left: i[e] ?? null,
|
|
90
|
+
right: a[e] ?? null
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
return t;
|
|
94
|
+
};
|
|
95
|
+
//#endregion
|
|
96
|
+
export { o as diffHunks, i as diffLines, s as diffRows };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Partes de `diff` (ver `slotCatalog.ts` para el contrato). Vive junto al componente. */
|
|
2
|
+
export declare const DIFF_SLOTS: import("../slotsLogic.js").SlotTable<"diff", {
|
|
3
|
+
readonly root: "kapi-diff";
|
|
4
|
+
readonly bar: "kapi-diff__bar";
|
|
5
|
+
readonly empty: "kapi-diff__empty";
|
|
6
|
+
readonly body: "kapi-diff__body";
|
|
7
|
+
readonly hunk: null;
|
|
8
|
+
readonly skip: "kapi-diff__skip";
|
|
9
|
+
readonly row: "kapi-diff__row";
|
|
10
|
+
readonly cell: "kapi-diff__cell";
|
|
11
|
+
readonly number: "kapi-diff__num";
|
|
12
|
+
readonly sign: "kapi-diff__sign";
|
|
13
|
+
readonly text: "kapi-diff__text";
|
|
14
|
+
}>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineSlots as e } from "../slotsLogic.js";
|
|
2
|
+
//#region src/components/display/diffSlots.ts
|
|
3
|
+
var t = e("diff", {
|
|
4
|
+
root: "kapi-diff",
|
|
5
|
+
bar: "kapi-diff__bar",
|
|
6
|
+
empty: "kapi-diff__empty",
|
|
7
|
+
body: "kapi-diff__body",
|
|
8
|
+
hunk: null,
|
|
9
|
+
skip: "kapi-diff__skip",
|
|
10
|
+
row: "kapi-diff__row",
|
|
11
|
+
cell: "kapi-diff__cell",
|
|
12
|
+
number: "kapi-diff__num",
|
|
13
|
+
sign: "kapi-diff__sign",
|
|
14
|
+
text: "kapi-diff__text"
|
|
15
|
+
});
|
|
16
|
+
//#endregion
|
|
17
|
+
export { t as DIFF_SLOTS };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** A piece of the text: either part of a match or the text between matches. */
|
|
2
|
+
export type KapiHighlightSegment = {
|
|
3
|
+
/** The piece of text. Never empty. */
|
|
4
|
+
text: string;
|
|
5
|
+
/** `true` when this piece is one of the occurrences of the query. */
|
|
6
|
+
match: boolean;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Splits `text` into the pieces that match `query` and the ones that do not, left to right.
|
|
10
|
+
*
|
|
11
|
+
* The query is matched LITERALLY, never as a regular expression. That is the whole reason this is
|
|
12
|
+
* a function and not an inline `split`: search boxes get `(`, `*` and `?` typed into them all the
|
|
13
|
+
* time, and building a `RegExp` from user input either throws or silently matches something else.
|
|
14
|
+
*
|
|
15
|
+
* Returns one non-matching segment for the whole text when the query is empty, and an empty list
|
|
16
|
+
* for an empty text, so the caller never has to special-case either.
|
|
17
|
+
*/
|
|
18
|
+
export declare const splitByQuery: (text: string, query: string, caseSensitive?: boolean) => KapiHighlightSegment[];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//#region src/components/display/highlightLogic.ts
|
|
2
|
+
var e = (e, t, n = !1) => {
|
|
3
|
+
if (e === "") return [];
|
|
4
|
+
if (t === "") return [{
|
|
5
|
+
text: e,
|
|
6
|
+
match: !1
|
|
7
|
+
}];
|
|
8
|
+
let r = n ? t : t.toLowerCase(), i = n ? e : e.toLowerCase(), a = [], o = 0;
|
|
9
|
+
for (;;) {
|
|
10
|
+
let n = i.indexOf(r, o);
|
|
11
|
+
if (n === -1) break;
|
|
12
|
+
n > o && a.push({
|
|
13
|
+
text: e.slice(o, n),
|
|
14
|
+
match: !1
|
|
15
|
+
}), a.push({
|
|
16
|
+
text: e.slice(n, n + t.length),
|
|
17
|
+
match: !0
|
|
18
|
+
}), o = n + t.length;
|
|
19
|
+
}
|
|
20
|
+
return o < e.length && a.push({
|
|
21
|
+
text: e.slice(o),
|
|
22
|
+
match: !1
|
|
23
|
+
}), a;
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { e as splitByQuery };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type KapiFamilyTone, type KapiTone } from "../tone.js";
|
|
2
2
|
export type KapiIconTileTone = KapiTone;
|
|
3
3
|
export type KapiIconTileSize = "sm" | "md" | "lg" | number;
|
|
4
4
|
/** Tile edge in px; named sizes map to a fixed scale, numbers are clamped to >= 16. */
|
|
@@ -7,7 +7,7 @@ export declare const iconTileSizePx: (size?: KapiIconTileSize) => number;
|
|
|
7
7
|
export declare const iconTileRadiusPx: (px: number) => number;
|
|
8
8
|
/** Classes of an icon tile. Pure and exported. */
|
|
9
9
|
export declare const iconTileClasses: ({ tone, soft, className }?: {
|
|
10
|
-
tone?: KapiIconTileTone | undefined;
|
|
10
|
+
tone?: KapiIconTileTone | KapiFamilyTone | undefined;
|
|
11
11
|
soft?: boolean | undefined;
|
|
12
12
|
className?: string | undefined;
|
|
13
13
|
}) => string;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import { isFamilyTone as e } from "../tone.js";
|
|
1
2
|
//#region src/components/display/iconTileLogic.ts
|
|
2
|
-
var
|
|
3
|
+
var t = {
|
|
3
4
|
sm: 36,
|
|
4
5
|
md: 48,
|
|
5
6
|
lg: 56
|
|
6
|
-
},
|
|
7
|
+
}, n = (e = "md") => typeof e == "number" ? Math.max(16, Math.round(e)) : t[e], r = (e) => Math.max(8, Math.round(e * .27)), i = ({ tone: t = "primary", soft: n = !1, className: r = "" } = {}) => [
|
|
7
8
|
"kapi-icontile",
|
|
8
|
-
`kapi-icontile--${
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
e(t) ? "kapi-icontile--family" : `kapi-icontile--${t}`,
|
|
10
|
+
n && "kapi-icontile--soft",
|
|
11
|
+
r
|
|
11
12
|
].filter(Boolean).join(" ");
|
|
12
13
|
//#endregion
|
|
13
|
-
export {
|
|
14
|
+
export { i as iconTileClasses, r as iconTileRadiusPx, n as iconTileSizePx };
|
|
@@ -84,3 +84,18 @@ export type { KapiTruncateProps } from "./KapiTruncate.js";
|
|
|
84
84
|
export {
|
|
85
85
|
/** @deprecated Interno; usa `KapiTruncate` en su lugar. Se quita en 1.0. */
|
|
86
86
|
isTruncated } from "./truncateLogic.js";
|
|
87
|
+
export { KapiText } from "./KapiText.js";
|
|
88
|
+
export type { KapiTextElement, KapiTextProps } from "./KapiText.js";
|
|
89
|
+
export { KapiTitle } from "./KapiTitle.js";
|
|
90
|
+
export type { KapiTitleProps } from "./KapiTitle.js";
|
|
91
|
+
export { KapiAnchor } from "./KapiAnchor.js";
|
|
92
|
+
export type { KapiAnchorProps, KapiAnchorUnderline } from "./KapiAnchor.js";
|
|
93
|
+
export type { KapiTextAlign, KapiTextSize, KapiTextTone, KapiTextWeight, KapiTitleLevel } from "./textLogic.js";
|
|
94
|
+
export { KapiHighlight } from "./KapiHighlight.js";
|
|
95
|
+
export type { KapiHighlightProps, KapiHighlightSegment } from "./KapiHighlight.js";
|
|
96
|
+
export { splitByQuery } from "./highlightLogic.js";
|
|
97
|
+
export { KapiCodeBlock, DEFAULT_CODE_BLOCK_LABELS } from "./KapiCodeBlock.js";
|
|
98
|
+
export type { KapiCodeBlockLabels, KapiCodeBlockProps } from "./KapiCodeBlock.js";
|
|
99
|
+
export { KapiDiff, DEFAULT_DIFF_LABELS } from "./KapiDiff.js";
|
|
100
|
+
export type { KapiDiffHunk, KapiDiffKind, KapiDiffLabels, KapiDiffLine, KapiDiffProps, KapiDiffRow, KapiDiffView } from "./KapiDiff.js";
|
|
101
|
+
export { diffHunks, diffLines, diffRows } from "./diffLogic.js";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { KapiIconTileTone } from "./iconTileLogic.js";
|
|
2
|
+
import { type KapiFamilyTone } from "../tone.js";
|
|
2
3
|
export type KapiStatTone = "neutral" | "primary" | "success" | "info" | "warning" | "danger";
|
|
3
4
|
/** Clases de una tarjeta KPI: reutiliza `.kapi-card .kapi-statcard`; el tono sólo tiñe el valor/nota. */
|
|
4
5
|
export declare const statClasses: ({ tone, hasIcon, className }?: {
|
|
5
|
-
tone?: KapiStatTone | undefined;
|
|
6
|
+
tone?: KapiStatTone | KapiFamilyTone | undefined;
|
|
6
7
|
hasIcon?: boolean | undefined;
|
|
7
8
|
className?: string | undefined;
|
|
8
9
|
}) => string;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { isFamilyTone as e } from "../tone.js";
|
|
1
2
|
//#region src/components/display/statLogic.ts
|
|
2
|
-
var
|
|
3
|
+
var t = ({ tone: t = "neutral", hasIcon: n = !1, className: r = "" } = {}) => [
|
|
3
4
|
"kapi-card",
|
|
4
5
|
"kapi-statcard",
|
|
5
|
-
e !== "neutral" && `kapi-statcard--${
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
].filter(Boolean).join(" "),
|
|
6
|
+
e(t) ? "kapi-statcard--family" : t !== "neutral" && `kapi-statcard--${t}`,
|
|
7
|
+
n && "kapi-statcard--icon",
|
|
8
|
+
r
|
|
9
|
+
].filter(Boolean).join(" "), n = (e = "neutral", t) => t ?? (e === "neutral" ? "primary" : e);
|
|
9
10
|
//#endregion
|
|
10
|
-
export {
|
|
11
|
+
export { t as statClasses, n as statIconTone };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { type KapiFamilyTone } from "../tone.js";
|
|
1
2
|
export type KapiTagTone = "neutral" | "primary" | "success" | "info" | "warning" | "danger";
|
|
2
3
|
export type KapiTagSize = "sm" | "md";
|
|
3
4
|
export type KapiTagClassesInput = {
|
|
4
|
-
tone?: KapiTagTone | undefined;
|
|
5
|
+
tone?: KapiTagTone | KapiFamilyTone | undefined;
|
|
5
6
|
size?: KapiTagSize | undefined;
|
|
6
7
|
/** Tiene botón de quitar: reserva el espacio del borde derecho. */
|
|
7
8
|
removable?: boolean | undefined;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { isFamilyTone as e } from "../tone.js";
|
|
1
2
|
//#region src/components/display/tagLogic.ts
|
|
2
|
-
var
|
|
3
|
+
var t = ({ tone: t = "neutral", size: n = "md", removable: r = !1, className: i = "" } = {}) => [
|
|
3
4
|
"kapi-tag",
|
|
4
|
-
`kapi-tag--${
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
e(t) ? "kapi-tag--family" : `kapi-tag--${t}`,
|
|
6
|
+
n !== "md" && `kapi-tag--${n}`,
|
|
7
|
+
r && "kapi-tag--removable",
|
|
8
|
+
i
|
|
8
9
|
].filter(Boolean).join(" ");
|
|
9
10
|
//#endregion
|
|
10
|
-
export {
|
|
11
|
+
export { t as tagClasses };
|