@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,95 +1,104 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "#kapi-css/components/feedback/feedback.css";
|
|
3
|
+
import { useToneLook as e } from "../../hooks/useToneFamilies.js";
|
|
3
4
|
/* empty css */
|
|
4
|
-
import { circleDash as
|
|
5
|
-
import { jsx as
|
|
5
|
+
import { circleDash as t, clampPercent as n, formatPercent as r, progressClasses as i } from "./progressLogic.js";
|
|
6
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
7
|
//#region src/components/feedback/KapiProgress.tsx
|
|
7
|
-
var
|
|
8
|
+
var s = {
|
|
8
9
|
sm: 36,
|
|
9
10
|
md: 56,
|
|
10
11
|
lg: 84
|
|
11
|
-
},
|
|
12
|
+
}, c = {
|
|
12
13
|
sm: 4,
|
|
13
14
|
md: 6,
|
|
14
15
|
lg: 8
|
|
15
16
|
};
|
|
16
|
-
function
|
|
17
|
-
let
|
|
18
|
-
tone:
|
|
19
|
-
size:
|
|
20
|
-
variant:
|
|
21
|
-
className:
|
|
22
|
-
}),
|
|
17
|
+
function l({ value: l, variant: u = "bar", tone: d = "primary", size: f = "md", label: p, showValue: m = !1, "aria-label": h, className: g, ..._ }) {
|
|
18
|
+
let v = e("KapiProgress", d), y = n(l), b = i({
|
|
19
|
+
tone: v.tone,
|
|
20
|
+
size: f,
|
|
21
|
+
variant: u,
|
|
22
|
+
className: g
|
|
23
|
+
}), x = {
|
|
23
24
|
role: "progressbar",
|
|
24
25
|
"aria-valuemin": 0,
|
|
25
26
|
"aria-valuemax": 100,
|
|
26
|
-
"aria-valuenow": Math.round(
|
|
27
|
-
"aria-label": typeof
|
|
27
|
+
"aria-valuenow": Math.round(y),
|
|
28
|
+
"aria-label": typeof p == "string" ? p : h
|
|
28
29
|
};
|
|
29
|
-
if (
|
|
30
|
-
let
|
|
31
|
-
return /* @__PURE__ */
|
|
32
|
-
...
|
|
33
|
-
className:
|
|
34
|
-
|
|
30
|
+
if (u === "circle") {
|
|
31
|
+
let e = s[f], n = c[f], i = (e - n) / 2, { circumference: l, offset: u } = t(y, i);
|
|
32
|
+
return /* @__PURE__ */ o("div", {
|
|
33
|
+
..._,
|
|
34
|
+
className: b,
|
|
35
|
+
style: {
|
|
36
|
+
...v.style,
|
|
37
|
+
..._.style
|
|
38
|
+
},
|
|
39
|
+
children: [/* @__PURE__ */ o("div", {
|
|
35
40
|
className: "kapi-progress__ring",
|
|
36
41
|
style: {
|
|
37
|
-
width:
|
|
38
|
-
height:
|
|
42
|
+
width: e,
|
|
43
|
+
height: e
|
|
39
44
|
},
|
|
40
|
-
...
|
|
41
|
-
children: [/* @__PURE__ */
|
|
42
|
-
width:
|
|
43
|
-
height:
|
|
44
|
-
viewBox: `0 0 ${
|
|
45
|
+
...x,
|
|
46
|
+
children: [/* @__PURE__ */ o("svg", {
|
|
47
|
+
width: e,
|
|
48
|
+
height: e,
|
|
49
|
+
viewBox: `0 0 ${e} ${e}`,
|
|
45
50
|
"aria-hidden": !0,
|
|
46
|
-
children: [/* @__PURE__ */
|
|
51
|
+
children: [/* @__PURE__ */ a("circle", {
|
|
47
52
|
className: "kapi-progress__track",
|
|
48
|
-
cx:
|
|
49
|
-
cy:
|
|
50
|
-
r:
|
|
51
|
-
strokeWidth:
|
|
52
|
-
}), /* @__PURE__ */
|
|
53
|
+
cx: e / 2,
|
|
54
|
+
cy: e / 2,
|
|
55
|
+
r: i,
|
|
56
|
+
strokeWidth: n
|
|
57
|
+
}), /* @__PURE__ */ a("circle", {
|
|
53
58
|
className: "kapi-progress__arc",
|
|
54
|
-
cx:
|
|
55
|
-
cy:
|
|
56
|
-
r:
|
|
57
|
-
strokeWidth:
|
|
59
|
+
cx: e / 2,
|
|
60
|
+
cy: e / 2,
|
|
61
|
+
r: i,
|
|
62
|
+
strokeWidth: n,
|
|
58
63
|
strokeDasharray: l,
|
|
59
64
|
strokeDashoffset: u,
|
|
60
|
-
transform: `rotate(-90 ${
|
|
65
|
+
transform: `rotate(-90 ${e / 2} ${e / 2})`
|
|
61
66
|
})]
|
|
62
|
-
}),
|
|
67
|
+
}), m && /* @__PURE__ */ a("span", {
|
|
63
68
|
className: "kapi-progress__center",
|
|
64
|
-
children:
|
|
69
|
+
children: r(y)
|
|
65
70
|
})]
|
|
66
|
-
}),
|
|
71
|
+
}), p && /* @__PURE__ */ a("span", {
|
|
67
72
|
className: "kapi-progress__label",
|
|
68
|
-
children:
|
|
73
|
+
children: p
|
|
69
74
|
})]
|
|
70
75
|
});
|
|
71
76
|
}
|
|
72
|
-
return /* @__PURE__ */
|
|
73
|
-
...
|
|
74
|
-
className:
|
|
75
|
-
|
|
77
|
+
return /* @__PURE__ */ o("div", {
|
|
78
|
+
..._,
|
|
79
|
+
className: b,
|
|
80
|
+
style: {
|
|
81
|
+
...v.style,
|
|
82
|
+
..._.style
|
|
83
|
+
},
|
|
84
|
+
children: [(p || m) && /* @__PURE__ */ o("div", {
|
|
76
85
|
className: "kapi-progress__head",
|
|
77
|
-
children: [
|
|
86
|
+
children: [p && /* @__PURE__ */ a("span", {
|
|
78
87
|
className: "kapi-progress__label",
|
|
79
|
-
children:
|
|
80
|
-
}),
|
|
88
|
+
children: p
|
|
89
|
+
}), m && /* @__PURE__ */ a("span", {
|
|
81
90
|
className: "kapi-progress__value",
|
|
82
|
-
children:
|
|
91
|
+
children: r(y)
|
|
83
92
|
})]
|
|
84
|
-
}), /* @__PURE__ */
|
|
93
|
+
}), /* @__PURE__ */ a("div", {
|
|
85
94
|
className: "kapi-progress__bar",
|
|
86
|
-
...
|
|
87
|
-
children: /* @__PURE__ */
|
|
95
|
+
...x,
|
|
96
|
+
children: /* @__PURE__ */ a("div", {
|
|
88
97
|
className: "kapi-progress__fill",
|
|
89
|
-
style: { width: `${
|
|
98
|
+
style: { width: `${y}%` }
|
|
90
99
|
})
|
|
91
100
|
})]
|
|
92
101
|
});
|
|
93
102
|
}
|
|
94
103
|
//#endregion
|
|
95
|
-
export {
|
|
104
|
+
export { l as KapiProgress };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "#kapi-css/components/feedback/feedback.css";
|
|
3
3
|
import { joinClasses as e } from "../rootProps.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { useMergedRefs as t } from "../../hooks/mergeRefs.js";
|
|
5
|
+
import { useLabels as n } from "../locale/KapiLocaleProvider.js";
|
|
6
|
+
import { activeElementOf as r, docOf as i } from "../../hooks/ownerDocument.js";
|
|
7
|
+
import { usePortalRootOverride as a } from "../../hooks/portalRoot.js";
|
|
8
8
|
import { modalStack as o } from "../overlays/modalStack.js";
|
|
9
9
|
import { getPortalRoot as s } from "../overlays/useNativeDialog.js";
|
|
10
10
|
/* empty css */
|
|
@@ -33,9 +33,9 @@ var w = { close: "Cerrar" }, T = {
|
|
|
33
33
|
color: "var(--kapi-warning)"
|
|
34
34
|
}
|
|
35
35
|
}, E = (e) => e ? u.pause() : u.resume(), D = () => typeof HTMLElement < "u" && typeof HTMLElement.prototype.showPopover == "function", O = ({ closeLabel: y, labels: b, className: x, style: S, id: O, ref: k }) => {
|
|
36
|
-
let A =
|
|
36
|
+
let A = n("toast", w, b), j = y ?? A.close, M = h(u.subscribe, u.getSnapshot, u.getSnapshot), N = p(null), P = t(N, k), F = a(), [I, L] = m(null);
|
|
37
37
|
d(() => {
|
|
38
|
-
let e =
|
|
38
|
+
let e = i(F);
|
|
39
39
|
if (!e) return;
|
|
40
40
|
let t = e.createElement("div");
|
|
41
41
|
t.className = "kapi-toasts-host", t.style.display = "contents";
|
|
@@ -44,9 +44,9 @@ var w = { close: "Cerrar" }, T = {
|
|
|
44
44
|
n && (c(t, n), N.current && l(N.current));
|
|
45
45
|
};
|
|
46
46
|
n(), L(t);
|
|
47
|
-
let
|
|
47
|
+
let r = o.subscribe(n);
|
|
48
48
|
return () => {
|
|
49
|
-
|
|
49
|
+
r(), t.remove();
|
|
50
50
|
};
|
|
51
51
|
}, [F]);
|
|
52
52
|
let R = M.length ? Math.max(...M.map((e) => e.id)) : 0;
|
|
@@ -56,7 +56,7 @@ var w = { close: "Cerrar" }, T = {
|
|
|
56
56
|
let z = p(!1), B = p(!1), V = () => E(z.current || B.current);
|
|
57
57
|
if (d(() => {
|
|
58
58
|
let e = N.current;
|
|
59
|
-
B.current && !(e && e.contains(
|
|
59
|
+
B.current && !(e && e.contains(r(e))) && (B.current = !1), M.length || (z.current = !1), E(z.current || B.current);
|
|
60
60
|
}, [M]), d(() => () => u.resume(), []), !I) return null;
|
|
61
61
|
let H = (e) => {
|
|
62
62
|
let { Icon: t, color: n } = T[e.tone];
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "#kapi-css/components/feedback/feedback.css";
|
|
3
3
|
import { joinClasses as e } from "../rootProps.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
4
|
+
import { useMergedRefs as t } from "../../hooks/mergeRefs.js";
|
|
5
|
+
import { useLabels as n } from "../locale/KapiLocaleProvider.js";
|
|
6
|
+
import { activeHTMLElementOf as r, rootNodeOf as i, winOf as a } from "../../hooks/ownerDocument.js";
|
|
7
|
+
import { usePortalRootOverride as o } from "../../hooks/portalRoot.js";
|
|
8
|
+
import { useKapiRoot as s } from "../../hooks/kapiRoot.js";
|
|
9
|
+
import { onViewportChange as c } from "../../hooks/rafThrottle.js";
|
|
10
|
+
import { usePlacement as l } from "../../hooks/usePlacement.js";
|
|
11
11
|
import { useDismiss as u } from "../../hooks/useDismiss.js";
|
|
12
12
|
import { trapTabKey as d } from "../../hooks/focusLogic.js";
|
|
13
13
|
/* empty css */
|
|
@@ -23,7 +23,7 @@ var T = {
|
|
|
23
23
|
close: "Cerrar",
|
|
24
24
|
of: "de"
|
|
25
25
|
}, E = ({ steps: E, open: D, onClose: O, markSeen: k, labels: A, className: ee, style: te, id: j, ref: M }) => {
|
|
26
|
-
let N =
|
|
26
|
+
let N = n("tour", T, A), P = o(), F = s(), I = P ?? F, L = (e) => (i(I) ?? document).querySelector(e), [R, z] = x([]), [B, V] = x(0), [H, U] = x(null), W = b(null), G = t(W, M), K = v(), q = g((e) => {
|
|
27
27
|
k && h(typeof k == "string" ? k : void 0), O(e);
|
|
28
28
|
}, [k, O]), J = E.map((e) => e.element).join("|"), Y = b(E);
|
|
29
29
|
Y.current = E, _(() => {
|
|
@@ -37,7 +37,7 @@ var T = {
|
|
|
37
37
|
let X = D ? R[B] : void 0;
|
|
38
38
|
y(() => {
|
|
39
39
|
if (!D) return;
|
|
40
|
-
let e =
|
|
40
|
+
let e = r(P);
|
|
41
41
|
return () => {
|
|
42
42
|
e?.isConnected && e.focus();
|
|
43
43
|
};
|
|
@@ -56,10 +56,10 @@ var T = {
|
|
|
56
56
|
});
|
|
57
57
|
let t = () => U(m(e.getBoundingClientRect()));
|
|
58
58
|
t();
|
|
59
|
-
let n =
|
|
60
|
-
return
|
|
59
|
+
let n = a(e);
|
|
60
|
+
return c(t, n ? { target: n } : {});
|
|
61
61
|
}, [X]);
|
|
62
|
-
let { style: Z, update: Q } =
|
|
62
|
+
let { style: Z, update: Q } = l({
|
|
63
63
|
open: !!X && !!I,
|
|
64
64
|
anchor: () => {
|
|
65
65
|
let e = X ? L(X.element) : null;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type KapiFamilyTone } from "../tone.js";
|
|
1
2
|
export type KapiProgressTone = "primary" | "success" | "warning" | "danger";
|
|
2
3
|
/** Lleva `value` al rango 0–100. NaN/undefined/Infinity-negativo -> 0; +Infinity -> 100. */
|
|
3
4
|
export declare const clampPercent: (value: number) => number;
|
|
@@ -10,7 +11,7 @@ export declare const circleDash: (value: number, radius: number) => {
|
|
|
10
11
|
};
|
|
11
12
|
/** Clases del contenedor de progreso. */
|
|
12
13
|
export declare const progressClasses: ({ tone, size, variant, className }?: {
|
|
13
|
-
tone?: KapiProgressTone | undefined;
|
|
14
|
+
tone?: KapiProgressTone | KapiFamilyTone | undefined;
|
|
14
15
|
size?: "sm" | "md" | "lg" | undefined;
|
|
15
16
|
variant?: "bar" | "circle" | undefined;
|
|
16
17
|
className?: string | undefined;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
+
import { isFamilyTone as e } from "../tone.js";
|
|
1
2
|
//#region src/components/feedback/progressLogic.ts
|
|
2
|
-
var
|
|
3
|
+
var t = (e) => Number.isNaN(e) ? 0 : Math.min(100, Math.max(0, e)), n = (e) => `${Math.round(t(e))}%`, r = (e, n) => {
|
|
3
4
|
let r = 2 * Math.PI * n;
|
|
4
5
|
return {
|
|
5
6
|
circumference: r,
|
|
6
|
-
offset: r * (1 - e
|
|
7
|
+
offset: r * (1 - t(e) / 100)
|
|
7
8
|
};
|
|
8
|
-
},
|
|
9
|
+
}, i = ({ tone: t = "primary", size: n = "md", variant: r = "bar", className: i = "" } = {}) => [
|
|
9
10
|
"kapi-progress",
|
|
10
|
-
|
|
11
|
-
`kapi-progress--${
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
r === "circle" && "kapi-progress--circle",
|
|
12
|
+
e(t) ? "kapi-progress--family" : `kapi-progress--${t}`,
|
|
13
|
+
n !== "md" && `kapi-progress--${n}`,
|
|
14
|
+
i
|
|
14
15
|
].filter(Boolean).join(" ");
|
|
15
16
|
//#endregion
|
|
16
|
-
export {
|
|
17
|
+
export { r as circleDash, t as clampPercent, n as formatPercent, i as progressClasses };
|
|
@@ -64,6 +64,12 @@ type KapiAutocompleteBaseProps<T> = {
|
|
|
64
64
|
required?: boolean | undefined;
|
|
65
65
|
/** Texto de ayuda o error bajo el campo. */
|
|
66
66
|
help?: ReactNode;
|
|
67
|
+
/**
|
|
68
|
+
* El motivo por el que el campo está mal. Reemplaza a `help` y lo marca inválido (rojo, ícono y
|
|
69
|
+
* `role="alert"`). Es lo que entregan las librerías de formularios: un mensaje, no un booleano.
|
|
70
|
+
* Un error que React no pinta (`true`, `""`, `null`) no marca nada. Gana sobre `invalid` y `status`.
|
|
71
|
+
*/
|
|
72
|
+
error?: ReactNode | undefined;
|
|
67
73
|
/** Clase del `KapiField` propio (con `label` o `help`). `className` va al input. */
|
|
68
74
|
fieldClassName?: string | undefined;
|
|
69
75
|
/** Clase del `<input>` (la del envoltorio va en `fieldClassName`). */
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "#kapi-css/components/inputs/KapiAutocomplete.css";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { useLabels as e } from "../locale/KapiLocaleProvider.js";
|
|
4
|
+
import { assignRef as t, fieldControlProps as n, joinIds as r, resolveFieldMessage as ee, resolveReadOnly as te } from "./fieldLogic.js";
|
|
5
|
+
import { useOwnField as ne } from "./ownField.js";
|
|
6
6
|
import { inputClasses as re } from "./KapiInput.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { useControllableState as ie } from "../../hooks/useControllableState.js";
|
|
8
|
+
import { enabledIndexes as ae, nextEnabledIndex as oe } from "../overlays/menuKeyboardLogic.js";
|
|
9
9
|
import { resolveKapiRoot as se } from "../../hooks/kapiRoot.js";
|
|
10
10
|
import { AUTOCOMPLETE_MENU_PLACEMENT as ce, clampActiveIndex as le, defaultGetLabel as ue, filterOptions as de, highlightParts as fe, shouldOpen as pe } from "./autocompleteLogic.js";
|
|
11
11
|
import { usePlacement as me } from "../../hooks/usePlacement.js";
|
|
@@ -23,165 +23,166 @@ var l = {
|
|
|
23
23
|
data: [],
|
|
24
24
|
error: !1
|
|
25
25
|
}, d = (d) => {
|
|
26
|
-
let { value: xe, defaultValue: Se, onChange: Ce, onSelect: f, getLabel: p, getKey: m, renderOption: h, fillOnSelect: g = !0, minChars: we = 0, maxResults: _ = 8, loadDelay: Te, debounceMs: Ee, emptyMessage: De, loadingMessage: Oe, noResultsText: ke, loadingText: Ae, labels: je, size: Me, invalid: v, status: y, label: Ne, required: b, help:
|
|
27
|
-
id:
|
|
26
|
+
let { value: xe, defaultValue: Se, onChange: Ce, onSelect: f, getLabel: p, getKey: m, renderOption: h, fillOnSelect: g = !0, minChars: we = 0, maxResults: _ = 8, loadDelay: Te, debounceMs: Ee, emptyMessage: De, loadingMessage: Oe, noResultsText: ke, loadingText: Ae, labels: je, size: Me, invalid: v, status: y, label: Ne, required: b, help: x, error: S, fieldClassName: Pe, className: Fe, readOnly: C, ref: w, options: T, loadOptions: E, id: Ie, onFocus: Le, onBlur: Re, onKeyDown: ze, ...D } = d, O = e("autocomplete", l, je), Be = De ?? ke ?? O.noResults, Ve = Oe ?? Ae ?? O.loading, He = Te ?? Ee ?? 250, [k, A] = ie(xe, Se ?? "", Ce), { invalid: Ue, status: We } = ee(S, x, v, y), j = ne({
|
|
27
|
+
id: Ie,
|
|
28
28
|
label: Ne,
|
|
29
|
-
help:
|
|
29
|
+
help: x,
|
|
30
|
+
error: S,
|
|
30
31
|
required: b,
|
|
31
32
|
invalid: v,
|
|
32
33
|
status: y,
|
|
33
|
-
readOnly:
|
|
34
|
-
fieldClassName:
|
|
35
|
-
}),
|
|
36
|
-
|
|
37
|
-
}, [
|
|
34
|
+
readOnly: C,
|
|
35
|
+
fieldClassName: Pe
|
|
36
|
+
}), M = te(C, j.field), N = j.controlId ?? j.autoId, P = `${N}-listbox`, { helpId: Ge } = j, F = (e) => `${N}-opt-${e}`, I = p ?? ue, Ke = i((e) => {
|
|
37
|
+
t(w, e);
|
|
38
|
+
}, [w]), [qe, L] = o(!1), [Je, R] = o(!1), [Ye, z] = o(-1), B = a(null), V = a(null), H = a(null), U = E !== void 0, W = !M && pe({
|
|
38
39
|
focused: qe,
|
|
39
40
|
dismissed: Je,
|
|
40
|
-
query:
|
|
41
|
+
query: k,
|
|
41
42
|
minChars: we
|
|
42
|
-
}),
|
|
43
|
-
query:
|
|
44
|
-
enabled:
|
|
45
|
-
load:
|
|
43
|
+
}), G = k.trim(), K = he({
|
|
44
|
+
query: G,
|
|
45
|
+
enabled: U && W,
|
|
46
|
+
load: E,
|
|
46
47
|
delay: He,
|
|
47
48
|
revalidate: !0,
|
|
48
49
|
initial: u
|
|
49
|
-
}).last ?? u,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
}).last ?? u, q = U && W && K.key !== G, Xe = ve(() => U ? (K.data ?? []).slice(0, _ > 0 ? _ : void 0) : de(T ?? [], k, I, _), [
|
|
51
|
+
U,
|
|
52
|
+
K.data,
|
|
53
|
+
T,
|
|
54
|
+
k,
|
|
54
55
|
_
|
|
55
|
-
]),
|
|
56
|
+
]), J = q ? [] : Xe, Y = le(Ye, J.length);
|
|
56
57
|
ge(() => {
|
|
57
|
-
if (!
|
|
58
|
-
let e =
|
|
58
|
+
if (!W || Y < 0) return;
|
|
59
|
+
let e = B.current?.children[Y];
|
|
59
60
|
e instanceof HTMLElement && typeof e.scrollIntoView == "function" && e.scrollIntoView({ block: "nearest" });
|
|
60
|
-
}, [
|
|
61
|
-
let
|
|
62
|
-
open:
|
|
63
|
-
anchor:
|
|
64
|
-
floatingRef:
|
|
61
|
+
}, [W, Y]);
|
|
62
|
+
let X = W && !q && J.length === 0, Z = W && (q || J.length > 0 || X), { placement: Ze, style: Qe, update: Q } = me({
|
|
63
|
+
open: Z,
|
|
64
|
+
anchor: V,
|
|
65
|
+
floatingRef: H,
|
|
65
66
|
...ce,
|
|
66
67
|
offset: be
|
|
67
68
|
});
|
|
68
69
|
_e(() => {
|
|
69
|
-
|
|
70
|
+
Z && Q();
|
|
70
71
|
}, [
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
Z,
|
|
73
|
+
J.length,
|
|
74
|
+
q,
|
|
75
|
+
Q
|
|
75
76
|
]);
|
|
76
|
-
let
|
|
77
|
-
g &&
|
|
77
|
+
let $e = i((e) => {
|
|
78
|
+
g && A(I(e)), f?.(e), R(!0), z(-1);
|
|
78
79
|
}, [
|
|
79
80
|
g,
|
|
80
|
-
|
|
81
|
+
A,
|
|
81
82
|
f,
|
|
82
83
|
p
|
|
83
|
-
]),
|
|
84
|
-
|
|
85
|
-
},
|
|
84
|
+
]), et = (e) => {
|
|
85
|
+
A(e.target.value), R(!1), z(-1);
|
|
86
|
+
}, tt = (e) => {
|
|
86
87
|
if (ze?.(e), !e.defaultPrevented) switch (e.key) {
|
|
87
88
|
case "ArrowDown":
|
|
88
89
|
case "ArrowUp":
|
|
89
|
-
if (e.preventDefault(), !
|
|
90
|
-
|
|
90
|
+
if (e.preventDefault(), !W) {
|
|
91
|
+
R(!1);
|
|
91
92
|
return;
|
|
92
93
|
}
|
|
93
|
-
|
|
94
|
+
z(oe(Y, e.key === "ArrowDown" ? "next" : "prev", ae(J.length)));
|
|
94
95
|
break;
|
|
95
96
|
case "Enter":
|
|
96
|
-
if (
|
|
97
|
+
if (W && Y >= 0) {
|
|
97
98
|
e.preventDefault();
|
|
98
|
-
let t =
|
|
99
|
-
t !== void 0 &&
|
|
99
|
+
let t = J[Y];
|
|
100
|
+
t !== void 0 && $e(t);
|
|
100
101
|
}
|
|
101
102
|
break;
|
|
102
|
-
case "Escape":
|
|
103
|
+
case "Escape": W && (e.preventDefault(), e.stopPropagation(), R(!0), z(-1));
|
|
103
104
|
}
|
|
104
|
-
}, tt = (e) => {
|
|
105
|
-
I(!0), L(!1), T?.(e);
|
|
106
105
|
}, nt = (e) => {
|
|
107
|
-
|
|
108
|
-
},
|
|
109
|
-
|
|
110
|
-
|
|
106
|
+
L(!0), R(!1), Le?.(e);
|
|
107
|
+
}, rt = (e) => {
|
|
108
|
+
L(!1), z(-1), Re?.(e);
|
|
109
|
+
}, $ = Z ? se(V.current) : null, it = /* @__PURE__ */ c("div", {
|
|
110
|
+
ref: V,
|
|
111
|
+
className: ["kapi-ac", q && "kapi-ac--loading"].filter(Boolean).join(" "),
|
|
111
112
|
children: [
|
|
112
113
|
/* @__PURE__ */ s("input", {
|
|
113
|
-
...
|
|
114
|
+
...D,
|
|
114
115
|
ref: Ke,
|
|
115
116
|
type: "text",
|
|
116
117
|
role: "combobox",
|
|
117
118
|
autoComplete: "off",
|
|
118
119
|
"aria-autocomplete": "list",
|
|
119
|
-
"aria-expanded":
|
|
120
|
-
"aria-controls":
|
|
121
|
-
"aria-activedescendant":
|
|
122
|
-
...
|
|
123
|
-
id:
|
|
124
|
-
describedBy:
|
|
125
|
-
busy:
|
|
120
|
+
"aria-expanded": Z,
|
|
121
|
+
"aria-controls": P,
|
|
122
|
+
"aria-activedescendant": Z && Y >= 0 ? F(Y) : void 0,
|
|
123
|
+
...n(j.outer, {
|
|
124
|
+
id: N,
|
|
125
|
+
describedBy: r(Ge, D["aria-describedby"]),
|
|
126
|
+
busy: q || void 0,
|
|
126
127
|
invalid: Ue
|
|
127
128
|
}),
|
|
128
129
|
required: b,
|
|
129
|
-
readOnly:
|
|
130
|
+
readOnly: M || void 0,
|
|
130
131
|
className: re({
|
|
131
132
|
size: Me,
|
|
132
133
|
status: We,
|
|
133
|
-
className:
|
|
134
|
+
className: Fe
|
|
134
135
|
}),
|
|
135
|
-
value:
|
|
136
|
-
onChange:
|
|
137
|
-
onKeyDown:
|
|
138
|
-
onFocus:
|
|
139
|
-
onBlur:
|
|
136
|
+
value: k,
|
|
137
|
+
onChange: et,
|
|
138
|
+
onKeyDown: tt,
|
|
139
|
+
onFocus: nt,
|
|
140
|
+
onBlur: rt
|
|
140
141
|
}),
|
|
141
|
-
|
|
142
|
+
q && /* @__PURE__ */ s("span", {
|
|
142
143
|
className: "kapi-ac__spinner kapi-spinner kapi-spinner--sm",
|
|
143
144
|
"aria-hidden": "true"
|
|
144
145
|
}),
|
|
145
146
|
$ && ye(/* @__PURE__ */ c("div", {
|
|
146
|
-
ref:
|
|
147
|
+
ref: H,
|
|
147
148
|
className: "kapi-ac__menu",
|
|
148
149
|
"data-side": Ze?.side ?? "bottom",
|
|
149
150
|
style: Qe,
|
|
150
151
|
onMouseDown: (e) => e.preventDefault(),
|
|
151
152
|
children: [/* @__PURE__ */ s("ul", {
|
|
152
|
-
ref:
|
|
153
|
-
id:
|
|
153
|
+
ref: B,
|
|
154
|
+
id: P,
|
|
154
155
|
role: "listbox",
|
|
155
156
|
className: "kapi-ac__list",
|
|
156
|
-
hidden:
|
|
157
|
-
children:
|
|
158
|
-
let n =
|
|
157
|
+
hidden: J.length === 0,
|
|
158
|
+
children: J.map((e, t) => {
|
|
159
|
+
let n = I(e), r = t === Y;
|
|
159
160
|
return /* @__PURE__ */ s("li", {
|
|
160
|
-
id:
|
|
161
|
+
id: F(t),
|
|
161
162
|
role: "option",
|
|
162
163
|
"aria-selected": r,
|
|
163
164
|
className: ["kapi-ac__opt", r && "kapi-ac__opt--active"].filter(Boolean).join(" "),
|
|
164
|
-
onMouseEnter: () =>
|
|
165
|
-
onClick: () =>
|
|
165
|
+
onMouseEnter: () => z(t),
|
|
166
|
+
onClick: () => $e(e),
|
|
166
167
|
children: h ? h(e, {
|
|
167
|
-
query:
|
|
168
|
+
query: k,
|
|
168
169
|
active: r
|
|
169
|
-
}) : fe(n,
|
|
170
|
+
}) : fe(n, k).map((e, t) => e.match ? /* @__PURE__ */ s("mark", {
|
|
170
171
|
className: "kapi-ac__mark",
|
|
171
172
|
children: e.text
|
|
172
173
|
}, t) : /* @__PURE__ */ s("span", { children: e.text }, t))
|
|
173
174
|
}, m ? m(e) : `${n}-${t}`);
|
|
174
175
|
})
|
|
175
|
-
}), (
|
|
176
|
+
}), (q || X) && /* @__PURE__ */ s("div", {
|
|
176
177
|
className: "kapi-ac__status",
|
|
177
178
|
role: "status",
|
|
178
179
|
"aria-live": "polite",
|
|
179
|
-
children:
|
|
180
|
+
children: q ? Ve : Be
|
|
180
181
|
})]
|
|
181
182
|
}), $)
|
|
182
183
|
]
|
|
183
184
|
});
|
|
184
|
-
return
|
|
185
|
+
return j.wrap(it);
|
|
185
186
|
};
|
|
186
187
|
//#endregion
|
|
187
188
|
export { l as DEFAULT_AUTOCOMPLETE_LABELS, d as KapiAutocomplete };
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { ButtonHTMLAttributes, ReactNode, Ref } from "react";
|
|
2
2
|
import { type KapiRender } from "../renderSlot.js";
|
|
3
|
-
import { type KapiButtonAppearance, type KapiLegacyButtonVariant, type
|
|
3
|
+
import { type KapiButtonAppearance, type KapiLegacyButtonVariant, type KapiToneName } from "../tone.js";
|
|
4
4
|
export type { KapiButtonAppearance } from "../tone.js";
|
|
5
|
-
/**
|
|
6
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Color de un botón: cualquier `KapiTone` o una familia propia de la app (`neutral` es el botón por
|
|
7
|
+
* defecto, borde + card).
|
|
8
|
+
*/
|
|
9
|
+
export type KapiButtonTone = KapiToneName;
|
|
7
10
|
/**
|
|
8
11
|
* @deprecated Valores combinados de color y forma (`primary`, `outline-danger`, `tonal-success`…):
|
|
9
12
|
* usar `tone` (`KapiButtonTone`) + `variant` (`KapiButtonAppearance`). Siguen andando hasta 1.0.
|
|
@@ -62,4 +65,4 @@ export type KapiButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "chi
|
|
|
62
65
|
/** Clases de un botón. Pura y exportada: es lo que se testea (no el markup). */
|
|
63
66
|
export declare const buttonClasses: ({ tone, variant, size, iconOnly, bordered, loading, className }?: Pick<KapiButtonProps, "tone" | "variant" | "size" | "iconOnly" | "bordered" | "loading" | "className">) => string;
|
|
64
67
|
/** Botón base: color (`tone`), forma (`variant`), tamaños, sólo ícono y borde. Acepta los atributos nativos de `<button>`. */
|
|
65
|
-
export declare const KapiButton: ({ tone, variant, size, iconOnly, bordered, icon, loading, disabled, className, type, children, ref, render, ...rest }: KapiButtonProps) => import("react").JSX.Element;
|
|
68
|
+
export declare const KapiButton: ({ tone, variant, size, iconOnly, bordered, icon, loading, disabled, className, style, type, children, ref, render, ...rest }: KapiButtonProps) => import("react").JSX.Element;
|