@sfperusacdev/sf-ui 0.1.35 → 0.1.36

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,4 +1,4 @@
1
- import { MetricBarItem } from './types';
1
+ import { MetricBarFootnote, MetricBarItem } from './types';
2
2
  type MetricBarRowProps = {
3
3
  item: MetricBarItem;
4
4
  small?: boolean;
@@ -8,6 +8,10 @@ type MetricBarListProps = {
8
8
  metrics: MetricBarItem[];
9
9
  small?: boolean;
10
10
  className?: string;
11
+ /** Nota destacada debajo de las barras (ej. "56% con menos de 3 meses"), en una caja tintada.
12
+ * Por defecto no se muestra nada (acabado actual). No es una conclusión calculada — el texto es
13
+ * responsabilidad de quien arma los datos. */
14
+ footnote?: MetricBarFootnote;
11
15
  };
12
- export declare const MetricBarList: ({ metrics, small, className }: MetricBarListProps) => import("react").JSX.Element;
16
+ export declare const MetricBarList: ({ metrics, small, className, footnote }: MetricBarListProps) => import("react").JSX.Element;
13
17
  export {};
@@ -14,4 +14,4 @@ export { RecommendationCard } from './RecommendationCard';
14
14
  export type { RecommendationCardProps } from './RecommendationCard';
15
15
  export { ModuleCard, ModuleCardGrid } from './ModuleCard';
16
16
  export type { ModuleCardProps } from './ModuleCard';
17
- export type { BadgeVariant, BadgeSize, BadgeShape, MetricBarTone, MetricBarThresholds, MetricBarItem, SplitBarTone, SplitBarSegment, EntityCardStatus, EntityCardVariant, RecommendationPriority, RecommendationImpact, ModuleCardVariant, ModuleCardDensity, } from './types';
17
+ export type { BadgeVariant, BadgeSize, BadgeShape, MetricBarTone, MetricBarThresholds, MetricBarItem, MetricBarFootnote, SplitBarTone, SplitBarSegment, EntityCardStatus, EntityCardVariant, RecommendationPriority, RecommendationImpact, ModuleCardVariant, ModuleCardDensity, } from './types';
@@ -38,6 +38,10 @@ export type MetricBarItem = {
38
38
  * dimensiona la barra — eso siempre es `value` (crudo si hay `max`, 0-100 si no lo hay). */
39
39
  valueLabel?: string;
40
40
  };
41
+ export type MetricBarFootnote = {
42
+ text: string;
43
+ tone?: MetricBarTone;
44
+ };
41
45
  export type SplitBarTone = MetricBarTone;
42
46
  export type SplitBarSegment = {
43
47
  label: string;
@@ -12,6 +12,9 @@ export type AlertSummaryRowItem = {
12
12
  /** Acciones explícitas de la fila (ej. "Ver lista", "Descartar"), renderizadas como botones propios.
13
13
  * Cuando vienen, la fila entera deja de ser `role="button"` (evita botón-dentro-de-botón). */
14
14
  actions?: AlertActionItem[];
15
+ /** Icono propio para esta fila (sustituye al glifo automático por `tone`). Solo se renderiza si
16
+ * `showIcon` está activo en la lista. */
17
+ icon?: ReactNode;
15
18
  };
16
19
  type AlertSummaryListProps = {
17
20
  items: AlertSummaryRowItem[];
@@ -20,6 +23,10 @@ type AlertSummaryListProps = {
20
23
  density?: AlertDensity;
21
24
  /** Contenido cuando `items` está vacío. Por defecto "Sin alertas". */
22
25
  emptyMessage?: ReactNode;
26
+ /** Muestra un glifo de severidad a la izquierda de cada fila (círculo con "i"/"!", coloreado por
27
+ * `tone`). Por defecto `false` — preserva el acabado actual sin icono. Cada fila puede pasar su
28
+ * propio `icon` para sustituir el automático. */
29
+ showIcon?: boolean;
23
30
  };
24
31
  /**
25
32
  * Lista de filas de ancho completo con fondo tintado por severidad y un valor grande
@@ -27,5 +34,5 @@ type AlertSummaryListProps = {
27
34
  * Distinto de `AlertRowList`: esa es una bitácora de eventos (icono + hora + meta);
28
35
  * esta es un resumen de conteos/alertas con el número como protagonista.
29
36
  */
30
- export declare const AlertSummaryList: ({ items, className, density, emptyMessage }: AlertSummaryListProps) => import("react").JSX.Element;
37
+ export declare const AlertSummaryList: ({ items, className, density, emptyMessage, showIcon, }: AlertSummaryListProps) => import("react").JSX.Element;
31
38
  export {};
@@ -0,0 +1,25 @@
1
+ import { DonutGaugeSize } from './types';
2
+ export type DonutBreakdownSegment = {
3
+ label: string;
4
+ value: number;
5
+ /** Color CSS (token o hex). Si se omite, se usa la paleta por defecto según el índice del segmento. */
6
+ color?: string;
7
+ };
8
+ export type DonutBreakdownProps = {
9
+ segments: DonutBreakdownSegment[];
10
+ /** Contenido central grande (ej. el total). Si se omite, se autocalcula como la suma de `segments`. */
11
+ centerValue?: string | number;
12
+ centerLabel?: string;
13
+ size?: DonutGaugeSize;
14
+ strokeWidth?: number;
15
+ /** Leyenda con nombre, cantidad y porcentaje debajo del donut. Por defecto `true`. */
16
+ showLegend?: boolean;
17
+ className?: string;
18
+ };
19
+ /**
20
+ * Donut de distribución (2+ segmentos, ej. Sexo M/F), con valor central y leyenda.
21
+ * Distinto de `DonutGauge`: ese representa UN indicador 0-100 (progreso/salud); este representa
22
+ * cómo se reparte un total entre categorías. SVG puro, mismo patrón de arcos que `DonutGauge`,
23
+ * sin dependencia nueva.
24
+ */
25
+ export declare const DonutBreakdown: ({ segments, centerValue, centerLabel, size, strokeWidth, showLegend, className, }: DonutBreakdownProps) => import("react").JSX.Element;
@@ -8,6 +8,8 @@ export { Calendar } from './Calendar';
8
8
  export { MONTH_NAMES, WEEKDAY_LABELS, toLocalYMD, parseYMD, buildMonthGrid } from './calendarUtils';
9
9
  export { DonutGauge, DonutGaugeRow } from './DonutGauge';
10
10
  export type { DonutGaugeProps, DonutGaugeRowItem } from './DonutGauge';
11
+ export { DonutBreakdown } from './DonutBreakdown';
12
+ export type { DonutBreakdownProps, DonutBreakdownSegment } from './DonutBreakdown';
11
13
  export { EventLog, AlertRowList, AlertLane } from './EventLog';
12
14
  export type { AlertLaneItem } from './EventLog';
13
15
  export { AlertSummaryList } from './AlertSummaryList';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sfperusacdev/sf-ui",
3
- "version": "0.1.35",
3
+ "version": "0.1.36",
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",