@sfperusacdev/sf-ui 0.1.28 → 0.1.29

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.
@@ -1,5 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  export type KPICardAccentTone = "emerald" | "blue" | "amber" | "red" | "teal" | "slate";
3
+ export type KPICardLayout = "stacked" | "leading-icon";
3
4
  export type KPICardProgress = {
4
5
  value: number;
5
6
  max: number;
@@ -15,10 +16,16 @@ type KPICardProps = {
15
16
  trendLabel?: string;
16
17
  accentTone?: KPICardAccentTone;
17
18
  progress?: KPICardProgress;
19
+ /** Disposición visual. "stacked" (por defecto) reproduce el acabado actual; "leading-icon" pone el icono a la
20
+ * izquierda en un tile de color sólido con label/valor en columna, como en el mockup de Torre de control. */
21
+ layout?: KPICardLayout;
22
+ /** Controla el borde superior de 3px (.sf-kpi-card). Por defecto true en "stacked" (como hoy) y false en
23
+ * "leading-icon" (el mockup no lo tiene). */
24
+ accentBar?: boolean;
18
25
  className?: string;
19
26
  onClick?: () => void;
20
27
  };
21
- export declare const KPICard: ({ label, value, sublabel, icon, iconClassName, trend, trendLabel, accentTone, progress, className, onClick, }: KPICardProps) => import("react").JSX.Element;
28
+ export declare const KPICard: ({ label, value, sublabel, icon, iconClassName, trend, trendLabel, accentTone, progress, layout, accentBar, className, onClick, }: KPICardProps) => import("react").JSX.Element;
22
29
  type KPIGridProps = {
23
30
  children: ReactNode;
24
31
  cols?: 2 | 3 | 4 | 5;
@@ -0,0 +1,15 @@
1
+ import { ReactNode } from 'react';
2
+ export type QuickActionTileProps = {
3
+ label: string;
4
+ icon: ReactNode;
5
+ onClick: () => void;
6
+ disabled?: boolean;
7
+ className?: string;
8
+ };
9
+ export declare const QuickActionTile: ({ label, icon, onClick, disabled, className }: QuickActionTileProps) => import("react").JSX.Element;
10
+ export type QuickActionGridProps = {
11
+ children: ReactNode;
12
+ cols?: 2 | 3 | 4;
13
+ className?: string;
14
+ };
15
+ export declare const QuickActionGrid: ({ children, cols, className }: QuickActionGridProps) => import("react").JSX.Element;
@@ -1,7 +1,9 @@
1
1
  export { Badge } from './Badge';
2
2
  export { badgeClassName, badgeDotClassName } from './badgeClassName';
3
3
  export { KPICard, KPIGrid } from './KPICard';
4
- export type { KPICardAccentTone, KPICardProgress } from './KPICard';
4
+ export type { KPICardAccentTone, KPICardProgress, KPICardLayout } from './KPICard';
5
+ export { QuickActionTile, QuickActionGrid } from './QuickActionTile';
6
+ export type { QuickActionTileProps, QuickActionGridProps } from './QuickActionTile';
5
7
  export { MetricBarRow, MetricBarList } from './MetricBar';
6
8
  export { EntityCard, EntityCardGrid } from './EntityCard';
7
9
  export type { EntityCardProps } from './EntityCard';
@@ -8,10 +8,13 @@ export type DashboardCardProps = {
8
8
  variant?: DashboardCardVariant;
9
9
  span?: 1 | 2 | 3 | 4;
10
10
  padding?: "sm" | "md" | "lg" | "none";
11
+ /** Tamaño de la cabecera. "sm" (por defecto) reproduce el acabado actual; "md" usa el título 15px, icono en
12
+ * círculo de 28px y padding más generoso del mockup de Torre de control. */
13
+ headerSize?: "sm" | "md";
11
14
  className?: string;
12
15
  children?: ReactNode;
13
16
  };
14
- export declare const DashboardCard: ({ title, subtitle, icon, headerAction, variant, span, padding, className, children, }: DashboardCardProps) => import("react").JSX.Element;
17
+ export declare const DashboardCard: ({ title, subtitle, icon, headerAction, variant, span, padding, headerSize, className, children, }: DashboardCardProps) => import("react").JSX.Element;
15
18
  type DashboardGridProps = {
16
19
  cols?: 2 | 3 | 4 | 5 | 6;
17
20
  gap?: "sm" | "md" | "lg";
@@ -0,0 +1,35 @@
1
+ import { ReactNode } from 'react';
2
+ export type DetailSidePanelRow = {
3
+ icon?: ReactNode;
4
+ label: string;
5
+ value: ReactNode;
6
+ hint?: string;
7
+ };
8
+ export type DetailSidePanelSecondaryItem = {
9
+ icon?: ReactNode;
10
+ label: string;
11
+ value: ReactNode;
12
+ };
13
+ export type DetailSidePanelProps = {
14
+ /** Título del panel (cabecera), 16px bold — p.ej. "Detalle del vehículo". */
15
+ title?: string;
16
+ onClose: () => void;
17
+ /** Slot a la izquierda de la cabecera — p.ej. el botón "Actualizar". */
18
+ headerAction?: ReactNode;
19
+ /** Icono del bloque de identidad (tile 44px). */
20
+ icon?: ReactNode;
21
+ /** Encabezado del bloque de identidad, 18px bold — p.ej. la placa. */
22
+ heading: string;
23
+ /** Badge del bloque de identidad — p.ej. el estado operativo. */
24
+ badge?: ReactNode;
25
+ rows?: DetailSidePanelRow[];
26
+ /** "stack" (por defecto): label arriba, valor debajo. "inline": label a la izquierda, valor a la derecha. */
27
+ align?: "stack" | "inline";
28
+ /** Slot de acciones — p.ej. "Centrar en mapa". */
29
+ actions?: ReactNode;
30
+ sectionTitle?: string;
31
+ items?: DetailSidePanelSecondaryItem[];
32
+ width?: number | string;
33
+ className?: string;
34
+ };
35
+ export declare const DetailSidePanel: ({ title, onClose, headerAction, icon, heading, badge, rows, align, actions, sectionTitle, items, width, className, }: DetailSidePanelProps) => import("react").JSX.Element;
@@ -11,4 +11,6 @@ export { EventLog, AlertRowList, AlertLane } from './EventLog';
11
11
  export type { AlertLaneItem } from './EventLog';
12
12
  export { DashboardCard, DashboardGrid, DashboardSection, DashboardStatBar, DashboardLayout, } from './DashboardCard';
13
13
  export type { DashboardCardProps } from './DashboardCard';
14
+ export { DetailSidePanel } from './DetailSidePanel';
15
+ export type { DetailSidePanelProps, DetailSidePanelRow, DetailSidePanelSecondaryItem } from './DetailSidePanel';
14
16
  export type { StepStatus, StepItem, CalendarBadgeVariant, CalendarDayBadge, DonutGaugeSize, DashboardCardVariant, EventStatus, EventItem, AlertRowItem, StatBarItem, } from './types';
@@ -0,0 +1,10 @@
1
+ export type MapLegendItem = {
2
+ label: string;
3
+ color: string;
4
+ count?: number;
5
+ };
6
+ export type MapLegendProps = {
7
+ items: MapLegendItem[];
8
+ className?: string;
9
+ };
10
+ export declare const MapLegend: ({ items, className }: MapLegendProps) => import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ export type MapToolbarMapType = "roadmap" | "satellite";
2
+ export type MapToolbarProps = {
3
+ mapType: MapToolbarMapType;
4
+ onMapTypeChange: (mapType: MapToolbarMapType) => void;
5
+ onFullscreen: () => void;
6
+ /** Botón de capas — solo se muestra si viene el callback. */
7
+ onLayers?: () => void;
8
+ className?: string;
9
+ };
10
+ export declare const MapToolbar: ({ mapType, onMapTypeChange, onFullscreen, onLayers, className }: MapToolbarProps) => import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ export type MapVehiclePopupProps = {
2
+ title: string;
3
+ subtitle?: string;
4
+ statusLabel: string;
5
+ statusColor: string;
6
+ speedKmh?: number;
7
+ onClick?: () => void;
8
+ className?: string;
9
+ };
10
+ export declare const MapVehiclePopup: ({ title, subtitle, statusLabel, statusColor, speedKmh, onClick, className, }: MapVehiclePopupProps) => import("react").JSX.Element;
@@ -2,3 +2,9 @@ export { MapFrame } from './MapFrame';
2
2
  export type { MapFrameProps } from './MapFrame';
3
3
  export { MapStatus } from './MapStatus';
4
4
  export type { MapStatusProps } from './MapStatus';
5
+ export { MapLegend } from './MapLegend';
6
+ export type { MapLegendItem, MapLegendProps } from './MapLegend';
7
+ export { MapToolbar } from './MapToolbar';
8
+ export type { MapToolbarMapType, MapToolbarProps } from './MapToolbar';
9
+ export { MapVehiclePopup } from './MapVehiclePopup';
10
+ export type { MapVehiclePopupProps } from './MapVehiclePopup';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sfperusacdev/sf-ui",
3
- "version": "0.1.28",
3
+ "version": "0.1.29",
4
4
  "description": "SF UI — librería de componentes React (inputs, tablas, hooks) para aplicaciones SF Perú.",
5
5
  "type": "module",
6
6
  "main": "./dist/sf-ui.umd.cjs",