@sfperusacdev/sf-ui 0.1.33 → 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 +1379 -1310
- 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/dashboard/DetailSection.d.ts +26 -0
- package/dist/types/src/components/dashboard/DetailSection.test.d.ts +1 -0
- 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
|
@@ -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 {};
|
|
@@ -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