osocna-react-tailwind 0.0.36 → 0.0.40

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,2 +1 @@
1
1
  export * from './opciones-afiliados/monotributo/components/DashboardBarChart';
2
- export * from './opciones-afiliados/monotributo/StatusByPeriodStatsMonotributo';
@@ -1,18 +1,18 @@
1
1
  import { LegendProps } from 'recharts';
2
2
  /**
3
- * Configuración para una barra individual en el gráfico.
3
+ * Configuración para una serie (barra, línea o métrica) en el gráfico.
4
4
  * @template T El tipo de los datos de la fila.
5
5
  */
6
6
  interface BarConfig<T> {
7
- /** Clave de los datos que se mostrará en esta barra. */
7
+ /** Clave de los datos que se mostrará en esta serie. */
8
8
  dataKey: keyof T;
9
- /** Color de relleno de la barra (ej: "#8884d8"). */
9
+ /** Color de relleno/línea de la serie (ej: "#8884d8"). */
10
10
  fill?: string;
11
11
  /** Nombre que aparecerá en la leyenda. */
12
12
  name?: string;
13
13
  /** ID de apilamiento si se desea un gráfico de barras apiladas. */
14
14
  stackId?: string;
15
- /** Ancho de la barra en píxeles. */
15
+ /** Ancho de la barra en píxeles (solo para BarChart). */
16
16
  barSize?: number;
17
17
  /** Duración de la animación en milisegundos. */
18
18
  animationDuration?: number;
@@ -24,10 +24,12 @@ interface BarConfig<T> {
24
24
  interface Props<T extends object> {
25
25
  /** Array de datos a visualizar. */
26
26
  data: T[];
27
- /** Clave del objeto de datos que se usará para el eje X (generalmente el periodo). */
27
+ /** Clave del objeto de datos que se usará para el eje principal (X o de nombres). */
28
28
  xAxisKey: string;
29
- /** Array de configuraciones para las barras que se renderizarán. */
29
+ /** Array de configuraciones para las series que se renderizarán. Mantenemos el nombre de la prop por compatibilidad. */
30
30
  bars: BarConfig<T>[];
31
+ /** Tipo de gráfico a mostrar. Por defecto 'bar'. */
32
+ type?: "bar" | "line" | "pie";
31
33
  /** Ancho del gráfico en píxeles. Por defecto 400. */
32
34
  width?: number;
33
35
  /** Alto del gráfico en píxeles. Por defecto 400. */
@@ -40,22 +42,16 @@ interface Props<T extends object> {
40
42
  tooltipCursor?: boolean | object;
41
43
  /** Propiedades adicionales para la leyenda de Recharts. */
42
44
  legendProps?: Partial<LegendProps>;
45
+ /** Título del gráfico. */
46
+ title?: string;
47
+ /** Colores personalizados para los sectores del gráfico de torta (solo para PieChart). */
48
+ pieColors?: string[];
49
+ /** Define si las barras no se apilan (true) o si se apilan (false). */
50
+ showStackedToggle?: boolean;
43
51
  }
44
52
  /**
45
- * Componente DashboardBarChart (BarChart)
46
- *
47
- * Un componente genérico para renderizar gráficos de barras utilizando Recharts.
48
- * Permite múltiples barras, apilamiento opcional y personalización de ejes y tooltips.
49
- *
50
- * @example
51
- * <DashboardBarChart
52
- * data={[{periodo: '2023-01', altas: 10, bajas: 5}]}
53
- * xAxisKey="periodo"
54
- * bars={[
55
- * { dataKey: 'altas', fill: '#82ca9d', name: 'Altas' },
56
- * { dataKey: 'bajas', fill: '#8884d8', name: 'Bajas' }
57
- * ]}
58
- * />
53
+ * Componente genérico para renderizar distintos tipos de gráficos utilizando Recharts.
54
+ * Aunque se llama DashboardBarChart por compatibilidad, ahora soporta BarChart, LineChart y PieChart.
59
55
  */
60
- export declare const DashboardBarChart: <T extends object>({ data, xAxisKey, bars, width, height, yAxisWidth, tooltipStyle, tooltipCursor, legendProps, }: Props<T>) => import("react/jsx-runtime").JSX.Element;
56
+ export declare const DashboardBarChart: <T extends object>({ data, xAxisKey, bars, type, width, height, yAxisWidth, tooltipStyle, tooltipCursor, legendProps, title, pieColors, showStackedToggle }: Props<T>) => import("react/jsx-runtime").JSX.Element;
61
57
  export {};
@@ -1,2 +1 @@
1
1
  export * from './DashboardBarChart';
2
- export * from './StatusByPeriodStatsMonotributoForm';
@@ -1,8 +1,10 @@
1
1
  import { ReactNode } from 'react';
2
+ import { AppLinks } from 'osocna-shared/OsocnaContext';
2
3
  interface OsocnaAppProviderProps {
3
4
  appTitle: string;
5
+ appLinks?: Array<AppLinks>;
4
6
  children: ReactNode;
5
7
  oidcConfig: any;
6
8
  }
7
- export declare const OsocnaAppProvider: ({ appTitle, children, oidcConfig, }: OsocnaAppProviderProps) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const OsocnaAppProvider: ({ appTitle, appLinks, children, oidcConfig, }: OsocnaAppProviderProps) => import("react/jsx-runtime").JSX.Element;
8
10
  export {};