@kapiuara/ui 0.15.2 → 0.16.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 +338 -6
- package/dist/components/data/KapiDataTable.d.ts +1 -1
- package/dist/components/data/KapiDataTable.js +22 -22
- 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/KapiTable.d.ts +2 -2
- package/dist/components/data/KapiTable.js +347 -329
- 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 +5 -4
- package/dist/components/data/tableCells.js +48 -43
- 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 +66 -1
- package/dist/components/data/useTableSelection.d.ts +4 -2
- package/dist/components/data/useTableSelection.js +27 -23
- package/dist/components/display/KapiAnchor.d.ts +36 -0
- package/dist/components/display/KapiAnchor.js +36 -0
- package/dist/components/display/KapiBadge.d.ts +6 -5
- package/dist/components/display/KapiBadge.js +25 -19
- package/dist/components/display/KapiText.d.ts +43 -0
- package/dist/components/display/KapiText.js +33 -0
- package/dist/components/display/KapiTitle.d.ts +33 -0
- package/dist/components/display/KapiTitle.js +29 -0
- package/dist/components/display/index.d.ts +7 -0
- package/dist/components/display/textLogic.d.ts +32 -0
- package/dist/components/display/textLogic.js +19 -0
- package/dist/components/feedback/KapiAlert.d.ts +8 -4
- package/dist/components/feedback/KapiAlert.js +39 -34
- package/dist/components/inputs/KapiButton.d.ts +7 -4
- package/dist/components/inputs/KapiButton.js +47 -42
- package/dist/components/inputs/KapiSelect.d.ts +12 -0
- package/dist/components/inputs/KapiSelect.js +215 -212
- package/dist/components/inputs/KapiSelectMenu.d.ts +4 -2
- package/dist/components/inputs/KapiSelectMenu.js +131 -133
- package/dist/components/inputs/fieldLogic.d.ts +2 -2
- package/dist/components/inputs/index.d.ts +1 -1
- package/dist/components/inputs/selectSlots.d.ts +24 -0
- package/dist/components/inputs/selectSlots.js +27 -0
- 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/KapiGrid.d.ts +29 -3
- package/dist/components/layout/KapiGrid.js +39 -17
- package/dist/components/layout/KapiPageHeader.d.ts +10 -1
- package/dist/components/layout/KapiPageHeader.js +82 -80
- 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 +123 -120
- package/dist/components/layout/KapiRoot.d.ts +35 -5
- package/dist/components/layout/KapiRoot.js +54 -39
- package/dist/components/layout/KapiShell.d.ts +36 -3
- package/dist/components/layout/KapiShell.js +53 -50
- 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 +11 -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/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 +151 -135
- 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/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/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/overlays/KapiContextMenu.d.ts +8 -0
- package/dist/components/overlays/KapiModal.d.ts +9 -0
- package/dist/components/overlays/KapiModal.js +77 -75
- package/dist/components/overlays/index.d.ts +1 -1
- package/dist/components/overlays/menuList.js +123 -113
- package/dist/components/overlays/modalSlots.d.ts +11 -0
- package/dist/components/overlays/modalSlots.js +14 -0
- package/dist/components/slotCatalog.d.ts +90 -0
- package/dist/components/slotCatalog.js +19 -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/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/layout/KapiBox.css +1 -0
- package/dist/css/components/layout/KapiRail.css +1 -1
- package/dist/css/components/layout/gridSpan.css +1 -0
- package/dist/css/components/navigation/navigation.css +1 -1
- package/dist/hooks/densityLogic.d.ts +15 -0
- package/dist/hooks/densityLogic.js +4 -0
- package/dist/hooks/index.d.ts +4 -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 +122 -0
- package/dist/hooks/toneFamilyLogic.js +151 -0
- package/dist/hooks/useKapiTheme.d.ts +8 -2
- package/dist/hooks/useKapiTheme.js +116 -103
- package/dist/hooks/useToneFamilies.d.ts +30 -0
- package/dist/hooks/useToneFamilies.js +46 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +213 -204
- package/dist/kapi.css +1 -1
- package/dist/kapi.layered.css +1 -1
- package/dist/styles/rawHeights.d.ts +8 -0
- package/package.json +4 -4
|
@@ -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;
|
|
@@ -1,58 +1,63 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "#kapi-css/components/inputs/KapiButton.css";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { useToneLook as e } from "../../hooks/useToneFamilies.js";
|
|
4
|
+
import { renderSlot as t } from "../renderSlot.js";
|
|
5
|
+
import { buttonLookModifier as n, isFamilyTone as r, resolveButtonLook as i } from "../tone.js";
|
|
5
6
|
/* empty css */
|
|
6
|
-
import { Fragment as
|
|
7
|
+
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
8
|
//#region src/components/inputs/KapiButton.tsx
|
|
8
|
-
var
|
|
9
|
-
let
|
|
9
|
+
var c = ({ tone: e, variant: t, size: a = "md", iconOnly: o = !1, bordered: s = !1, loading: c = !1, className: l = "" } = {}) => {
|
|
10
|
+
let u = r(e) ? `family-${i(void 0, t).appearance}` : n(i(e, t));
|
|
10
11
|
return [
|
|
11
12
|
"kapi-btn",
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
u !== null && `kapi-btn--${u}`,
|
|
14
|
+
a !== "md" && `kapi-btn--${a}`,
|
|
15
|
+
o && "kapi-btn--iconbtn",
|
|
16
|
+
s && "kapi-btn--bordered",
|
|
17
|
+
c && "is-loading",
|
|
18
|
+
l
|
|
18
19
|
].filter(Boolean).join(" ");
|
|
19
|
-
},
|
|
20
|
-
let
|
|
20
|
+
}, l = ({ tone: n, variant: r, size: i = "md", iconOnly: l = !1, bordered: u = !1, icon: d, loading: f = !1, disabled: p, className: m, style: h, type: g = "button", children: _, ref: v, render: y, ...b }) => {
|
|
21
|
+
let x = e("KapiButton", n), S = f || p, C = f ? /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o("span", {
|
|
21
22
|
className: "kapi-spinner kapi-btn__spinner",
|
|
22
23
|
"aria-hidden": "true"
|
|
23
|
-
}), /* @__PURE__ */
|
|
24
|
+
}), /* @__PURE__ */ s("span", {
|
|
24
25
|
className: "kapi-btn__content",
|
|
25
|
-
children: [
|
|
26
|
-
})] }) : /* @__PURE__ */ a
|
|
27
|
-
className:
|
|
28
|
-
tone:
|
|
29
|
-
variant:
|
|
30
|
-
size:
|
|
31
|
-
iconOnly:
|
|
32
|
-
bordered:
|
|
33
|
-
loading:
|
|
34
|
-
className:
|
|
26
|
+
children: [d, _]
|
|
27
|
+
})] }) : /* @__PURE__ */ s(a, { children: [d, _] }), w = {
|
|
28
|
+
className: c({
|
|
29
|
+
tone: x.tone,
|
|
30
|
+
variant: r,
|
|
31
|
+
size: i,
|
|
32
|
+
iconOnly: l,
|
|
33
|
+
bordered: u,
|
|
34
|
+
loading: f,
|
|
35
|
+
className: m
|
|
35
36
|
}),
|
|
36
|
-
...
|
|
37
|
+
...x.style || h ? { style: {
|
|
38
|
+
...x.style,
|
|
39
|
+
...h
|
|
40
|
+
} } : {},
|
|
41
|
+
...b
|
|
37
42
|
};
|
|
38
|
-
return
|
|
39
|
-
ref:
|
|
40
|
-
type:
|
|
41
|
-
...
|
|
42
|
-
disabled:
|
|
43
|
-
...
|
|
44
|
-
children:
|
|
45
|
-
}) :
|
|
46
|
-
"aria-disabled":
|
|
47
|
-
"aria-busy":
|
|
48
|
-
onClick:
|
|
49
|
-
ref:
|
|
50
|
-
children:
|
|
51
|
-
}, (e) => /* @__PURE__ */
|
|
43
|
+
return y === void 0 ? /* @__PURE__ */ o("button", {
|
|
44
|
+
ref: v,
|
|
45
|
+
type: g,
|
|
46
|
+
...w,
|
|
47
|
+
disabled: S,
|
|
48
|
+
...f ? { "aria-busy": !0 } : {},
|
|
49
|
+
children: C
|
|
50
|
+
}) : t(y, w, {
|
|
51
|
+
"aria-disabled": S || void 0,
|
|
52
|
+
"aria-busy": f || void 0,
|
|
53
|
+
onClick: S ? (e) => e.preventDefault() : void 0,
|
|
54
|
+
ref: v,
|
|
55
|
+
children: C
|
|
56
|
+
}, (e) => /* @__PURE__ */ o("button", {
|
|
52
57
|
...e,
|
|
53
|
-
type:
|
|
54
|
-
children:
|
|
58
|
+
type: g,
|
|
59
|
+
children: C
|
|
55
60
|
}));
|
|
56
61
|
};
|
|
57
62
|
//#endregion
|
|
58
|
-
export {
|
|
63
|
+
export { l as KapiButton, c as buttonClasses };
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { type CSSProperties, type FocusEvent, type ReactNode, type Ref } from "react";
|
|
2
2
|
import { type KapiSelectEntry, type KapiSelectGroup, type KapiSelectOption } from "./selectLogic.js";
|
|
3
3
|
import type { KapiLabelsOverride } from "../labelsLogic.js";
|
|
4
|
+
import type { KapiClassNames } from "../slotCatalog.js";
|
|
4
5
|
export type { KapiSelectEntry, KapiSelectGroup, KapiSelectOption };
|
|
5
6
|
export type KapiSelectSize = "sm" | "md" | "lg";
|
|
7
|
+
/** Partes de `KapiSelect` que acepta `classNames` (el disparador y el menú). */
|
|
8
|
+
export type KapiSelectClassNames = KapiClassNames<"select">;
|
|
6
9
|
/** Cara del disparador: `field` (campo de formulario) o `chip` (chip compacto de una fila de filtros). */
|
|
7
10
|
export type KapiSelectVariant = "field" | "chip";
|
|
8
11
|
/** Modo simple (default): el valor es un `string` o `null` (vacío). */
|
|
@@ -139,6 +142,15 @@ export interface KapiSelectBaseProps<T = unknown> {
|
|
|
139
142
|
id?: string | undefined;
|
|
140
143
|
/** Clase del envoltorio. */
|
|
141
144
|
className?: string | undefined;
|
|
145
|
+
/**
|
|
146
|
+
* Clases por parte: `classNames={{ tag: "mi-tag", menu: "mi-menu", option: "mi-opcion" }}`. Se suman
|
|
147
|
+
* a las propias, sin reemplazarlas. Cubre el disparador (`root`, `icon`, `label`, `values`, `single`,
|
|
148
|
+
* `placeholder`, `tag`, `tagLabel`, `tagRemove`, `input`, `combo`, `spinner`, `clear`, `caret`) y el
|
|
149
|
+
* menú portaleado (`menu`, `list`, `group`, `groupLabel`, `option`, `check`, `status`). Cada parte
|
|
150
|
+
* además lleva `data-slot="select-<parte>"`; el estado de una opción se alcanza con
|
|
151
|
+
* `[data-slot="select-option"][aria-selected="true"]`.
|
|
152
|
+
*/
|
|
153
|
+
classNames?: KapiSelectClassNames | undefined;
|
|
142
154
|
/** Estilos en línea del envoltorio. */
|
|
143
155
|
style?: CSSProperties | undefined;
|
|
144
156
|
/** Nombre accesible cuando no hay `<label>` asociado (o `KapiField`). */
|