@sfperusacdev/sf-ui 0.1.32 → 0.1.34
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/dist/sf-ui.css +1 -1
- package/dist/sf-ui.js +1416 -1347
- package/dist/sf-ui.js.map +1 -1
- package/dist/sf-ui.umd.cjs +7 -7
- package/dist/sf-ui.umd.cjs.map +1 -1
- package/dist/types/src/components/cards/KPICard.d.ts +4 -1
- package/dist/types/src/components/dashboard/DetailSection.d.ts +26 -0
- package/dist/types/src/components/dashboard/DetailSection.test.d.ts +1 -0
- package/dist/types/src/components/dashboard/DetailSidePanel.d.ts +4 -1
- package/dist/types/src/components/dashboard/index.d.ts +2 -0
- package/dist/types/src/components/inputs/AsyncSearchTableSelect.d.ts +8 -1
- package/dist/types/src/components/inputs/SearchTableSelect.d.ts +16 -1
- package/dist/types/src/components/inputs/SearchTableSelect.test.d.ts +1 -0
- package/package.json +1 -1
|
@@ -25,13 +25,16 @@ export type KPICardProps = {
|
|
|
25
25
|
/** Controla el borde superior de 3px (.sf-kpi-card). Por defecto true en "stacked" (como hoy) y false en
|
|
26
26
|
* "leading-icon" (el mockup no lo tiene). */
|
|
27
27
|
accentBar?: boolean;
|
|
28
|
+
/** Por defecto (false) el label se trunca en una línea (acabado actual). Con true se permite el salto de línea:
|
|
29
|
+
* para tarjetas angostas (5 KPI en la columna izquierda con la ficha abierta, mockup 031). */
|
|
30
|
+
labelWrap?: boolean;
|
|
28
31
|
/** Solo aplica a `layout="leading-icon"` (el tile `.sf-kpi-tile`). En "stacked" el icono va en
|
|
29
32
|
* `.sf-card-icon`, que no depende del tono, y esta prop se ignora. Por defecto "solid" = aspecto actual. */
|
|
30
33
|
iconStyle?: KPICardIconStyle;
|
|
31
34
|
className?: string;
|
|
32
35
|
onClick?: () => void;
|
|
33
36
|
};
|
|
34
|
-
export declare const KPICard: ({ label, value, sublabel, icon, iconClassName, trend, trendLabel, accentTone, progress, layout, accentBar, iconStyle, className, onClick, }: KPICardProps) => import("react").JSX.Element;
|
|
37
|
+
export declare const KPICard: ({ label, value, sublabel, icon, iconClassName, trend, trendLabel, accentTone, progress, layout, accentBar, iconStyle, labelWrap, className, onClick, }: KPICardProps) => import("react").JSX.Element;
|
|
35
38
|
type KPIGridProps = {
|
|
36
39
|
children: ReactNode;
|
|
37
40
|
cols?: 2 | 3 | 4 | 5;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type DetailSectionTone = "default" | "info" | "danger" | "warning" | "success";
|
|
3
|
+
export type DetailSectionDensity = "sm" | "md";
|
|
4
|
+
export type DetailSectionRow = {
|
|
5
|
+
label: string;
|
|
6
|
+
value: ReactNode;
|
|
7
|
+
/** Línea de 12px bajo el valor — p.ej. "Vencido hace 72 días". El color lo decide el consumidor en el nodo. */
|
|
8
|
+
hint?: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
export type DetailSectionProps = {
|
|
11
|
+
/** Título de la cabecera, 14px/600 — p.ej. "Carnet del conductor". */
|
|
12
|
+
title: string;
|
|
13
|
+
/** Icono a la izquierda del título (inline-flex). */
|
|
14
|
+
icon?: ReactNode;
|
|
15
|
+
/** "default": cabecera `--sf-surface-alt`. Los demás: fondo tenue del tono e icono/título en su color
|
|
16
|
+
* (mockup 0402 Conductores: "Carnet del conductor" en `danger` cuando está vencido). */
|
|
17
|
+
tone?: DetailSectionTone;
|
|
18
|
+
/** Filas label/valor separadas por línea `--sf-border`; el valor va alineado a la izquierda de su columna. */
|
|
19
|
+
rows?: DetailSectionRow[];
|
|
20
|
+
/** Contenido libre bajo las filas. */
|
|
21
|
+
children?: ReactNode;
|
|
22
|
+
className?: string;
|
|
23
|
+
/** "md" (por defecto) o "sm" = padding y fuente menores para paneles laterales de 380px. */
|
|
24
|
+
density?: DetailSectionDensity;
|
|
25
|
+
};
|
|
26
|
+
export declare const DetailSection: ({ title, icon, tone, rows, children, className, density }: DetailSectionProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -18,6 +18,9 @@ export type DetailSidePanelProps = {
|
|
|
18
18
|
headerAction?: ReactNode;
|
|
19
19
|
/** Icono del bloque de identidad (tile 44px). */
|
|
20
20
|
icon?: ReactNode;
|
|
21
|
+
/** Tamaño del tile de identidad. "sm" (por defecto) = 44px, el acabado actual. "lg" = 112×84px, para una foto
|
|
22
|
+
* de la entidad (mockup 031 Vehículos). No cambia nada más del bloque. */
|
|
23
|
+
iconSize?: "sm" | "lg";
|
|
21
24
|
/** Encabezado del bloque de identidad, 18px bold — p.ej. la placa. */
|
|
22
25
|
heading: string;
|
|
23
26
|
/** Badge del bloque de identidad — p.ej. el estado operativo. */
|
|
@@ -32,4 +35,4 @@ export type DetailSidePanelProps = {
|
|
|
32
35
|
width?: number | string;
|
|
33
36
|
className?: string;
|
|
34
37
|
};
|
|
35
|
-
export declare const DetailSidePanel: ({ title, onClose, headerAction, icon, heading, badge, rows, align, actions, sectionTitle, items, width, className, }: DetailSidePanelProps) => import("react").JSX.Element;
|
|
38
|
+
export declare const DetailSidePanel: ({ title, onClose, headerAction, icon, iconSize, heading, badge, rows, align, actions, sectionTitle, items, width, className, }: DetailSidePanelProps) => import("react").JSX.Element;
|
|
@@ -13,4 +13,6 @@ export { DashboardCard, DashboardGrid, DashboardSection, DashboardStatBar, Dashb
|
|
|
13
13
|
export type { DashboardCardProps } from './DashboardCard';
|
|
14
14
|
export { DetailSidePanel } from './DetailSidePanel';
|
|
15
15
|
export type { DetailSidePanelProps, DetailSidePanelRow, DetailSidePanelSecondaryItem } from './DetailSidePanel';
|
|
16
|
+
export { DetailSection } from './DetailSection';
|
|
17
|
+
export type { DetailSectionProps, DetailSectionRow, DetailSectionTone, DetailSectionDensity } from './DetailSection';
|
|
16
18
|
export type { StepStatus, StepItem, CalendarBadgeVariant, CalendarDayBadge, DonutGaugeSize, DashboardCardVariant, EventStatus, EventItem, AlertRowItem, AlertRowSeverity, AlertRowListHeaderLabels, StatBarItem, } from './types';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
import { FieldValues, Path, UseFormReturn } from 'react-hook-form';
|
|
2
3
|
import { ColumnDef } from '@tanstack/react-table';
|
|
3
4
|
import { SelectOption } from './SelectOption';
|
|
@@ -16,6 +17,12 @@ type AsyncSearchTableSelectProps<TFormValues extends FieldValues, TOption extend
|
|
|
16
17
|
pageSize?: number;
|
|
17
18
|
onChange?: (value: string | string[]) => void;
|
|
18
19
|
loadOnMount?: boolean;
|
|
20
|
+
searchPlaceholder?: string;
|
|
21
|
+
helperText?: ReactNode;
|
|
22
|
+
minSearchLength?: number;
|
|
23
|
+
promptIcon?: ReactNode;
|
|
24
|
+
promptTitle?: string;
|
|
25
|
+
promptMessage?: ReactNode;
|
|
19
26
|
};
|
|
20
|
-
export declare const AsyncSearchTableSelect: <TFormValues extends FieldValues, TOption extends SelectOption = SelectOption>({ form, name, loadOptions, columns, searchKeys, label, info, required, multiple, emptyMessage, readOnly, pageSize, onChange, loadOnMount, }: AsyncSearchTableSelectProps<TFormValues, TOption>) => import("react").JSX.Element;
|
|
27
|
+
export declare const AsyncSearchTableSelect: <TFormValues extends FieldValues, TOption extends SelectOption = SelectOption>({ form, name, loadOptions, columns, searchKeys, label, info, required, multiple, emptyMessage, readOnly, pageSize, onChange, loadOnMount, searchPlaceholder, helperText, minSearchLength, promptIcon, promptTitle, promptMessage, }: AsyncSearchTableSelectProps<TFormValues, TOption>) => import("react").JSX.Element;
|
|
21
28
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
import { FieldValues, Path, UseFormReturn } from 'react-hook-form';
|
|
2
3
|
import { ColumnDef } from '@tanstack/react-table';
|
|
3
4
|
import { SelectOption } from './SelectOption';
|
|
@@ -17,6 +18,20 @@ type SearchTableSelectProps<TFormValues extends FieldValues, TOption extends Sel
|
|
|
17
18
|
pageSize?: number;
|
|
18
19
|
onChange?: (value: string | string[]) => void;
|
|
19
20
|
onRefresh?: () => Promise<void> | void;
|
|
21
|
+
/** Placeholder de la caja de búsqueda. Default: "Buscar..." ("Cargando..." mientras `loading`). */
|
|
22
|
+
searchPlaceholder?: string;
|
|
23
|
+
/** Texto de ayuda bajo la caja de búsqueda. Sin la prop no se renderiza nada. */
|
|
24
|
+
helperText?: ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* Cantidad mínima de caracteres (del texto ya recortado con `trim`) para listar filas.
|
|
27
|
+
* Default `0` = comportamiento histórico: la lista se muestra siempre.
|
|
28
|
+
* Con un valor > 0, mientras la búsqueda no alcance el mínimo se pinta el
|
|
29
|
+
* estado inicial (`promptIcon` / `promptTitle` / `promptMessage`) en lugar de la tabla.
|
|
30
|
+
*/
|
|
31
|
+
minSearchLength?: number;
|
|
32
|
+
promptIcon?: ReactNode;
|
|
33
|
+
promptTitle?: string;
|
|
34
|
+
promptMessage?: ReactNode;
|
|
20
35
|
};
|
|
21
|
-
export declare const SearchTableSelect: <TFormValues extends FieldValues, TOption extends SelectOption = SelectOption>({ form, name, options, columns: extraColumns, searchKeys, label, info, required, multiple, emptyMessage, readOnly, loading, pageSize, onChange, onRefresh, }: SearchTableSelectProps<TFormValues, TOption>) => import("react").JSX.Element;
|
|
36
|
+
export declare const SearchTableSelect: <TFormValues extends FieldValues, TOption extends SelectOption = SelectOption>({ form, name, options, columns: extraColumns, searchKeys, label, info, required, multiple, emptyMessage, readOnly, loading, pageSize, onChange, onRefresh, searchPlaceholder, helperText, minSearchLength, promptIcon, promptTitle, promptMessage, }: SearchTableSelectProps<TFormValues, TOption>) => import("react").JSX.Element;
|
|
22
37
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED