@fluityy/designsystem 0.2.10 → 0.2.11

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.
@@ -0,0 +1,17 @@
1
+ import { ChartSeries } from './chartTheme';
2
+ export interface AreaChartProps {
3
+ data: Array<Record<string, string | number>>;
4
+ series: ChartSeries[];
5
+ xKey: string;
6
+ height?: number;
7
+ showGrid?: boolean;
8
+ showLegend?: boolean;
9
+ showBrush?: boolean;
10
+ smooth?: boolean;
11
+ /** Empilha as series (stacked area). */
12
+ stacked?: boolean;
13
+ formatValue?: (value: number) => string;
14
+ formatLabel?: (label: string | number) => string;
15
+ className?: string;
16
+ }
17
+ export declare function AreaChart({ data, series, xKey, height, showGrid, showLegend, showBrush, smooth, stacked, formatValue, formatLabel, className, }: AreaChartProps): import("react").JSX.Element;
@@ -0,0 +1,21 @@
1
+ import { ChartSeries } from './chartTheme';
2
+ export interface BarChartProps {
3
+ data: Array<Record<string, string | number>>;
4
+ series: ChartSeries[];
5
+ xKey: string;
6
+ height?: number;
7
+ showGrid?: boolean;
8
+ showLegend?: boolean;
9
+ /** "vertical" = barras em pe (default). "horizontal" = barras deitadas. */
10
+ orientation?: "vertical" | "horizontal";
11
+ /** Empilha as series (stacked bars). */
12
+ stacked?: boolean;
13
+ /** Raio das pontas das barras. */
14
+ radius?: number;
15
+ /** Largura maxima de cada barra em px. Default: 24. */
16
+ maxBarSize?: number;
17
+ formatValue?: (value: number) => string;
18
+ formatLabel?: (label: string | number) => string;
19
+ className?: string;
20
+ }
21
+ export declare function BarChart({ data, series, xKey, height, showGrid, showLegend, orientation, stacked, radius, maxBarSize, formatValue, formatLabel, className, }: BarChartProps): import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ export interface ChartLegendItem {
2
+ dataKey: string;
3
+ name: string;
4
+ color: string;
5
+ }
6
+ export interface ChartLegendProps {
7
+ items: ChartLegendItem[];
8
+ hidden: Set<string>;
9
+ onToggle: (dataKey: string) => void;
10
+ className?: string;
11
+ }
12
+ export declare function ChartLegend({ items, hidden, onToggle, className }: ChartLegendProps): import("react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { TooltipContentProps } from 'recharts';
2
+ export interface ChartTooltipProps extends Partial<TooltipContentProps<number, string>> {
3
+ /** Formata o valor numerico exibido. */
4
+ formatValue?: (value: number) => string;
5
+ /** Formata o titulo (label do eixo X). */
6
+ formatLabel?: (label: string | number) => string;
7
+ }
8
+ export declare function ChartTooltip({ active, payload, label, formatValue, formatLabel, }: ChartTooltipProps): import("react").JSX.Element | null;
@@ -0,0 +1,24 @@
1
+ export interface DonutDatum {
2
+ /** Rotulo da fatia. */
3
+ name: string;
4
+ /** Valor numerico. */
5
+ value: number;
6
+ /** Cor da fatia. Default: cor da paleta pelo indice. */
7
+ color?: string;
8
+ }
9
+ export interface DonutChartProps {
10
+ data: DonutDatum[];
11
+ height?: number;
12
+ /** Raio interno (0 = pie/pizza, >0 = donut/rosca). Default: 60. */
13
+ innerRadius?: number;
14
+ /** Raio externo. Default: 90. */
15
+ outerRadius?: number;
16
+ showLegend?: boolean;
17
+ /** Texto exibido no centro (apenas donut). */
18
+ centerLabel?: React.ReactNode;
19
+ /** Sublabel abaixo do centerLabel. */
20
+ centerSublabel?: React.ReactNode;
21
+ formatValue?: (value: number) => string;
22
+ className?: string;
23
+ }
24
+ export declare function DonutChart({ data, height, innerRadius, outerRadius, showLegend, centerLabel, centerSublabel, formatValue, className, }: DonutChartProps): import("react").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { ChartSeries } from './chartTheme';
2
+ export interface LineChartProps {
3
+ data: Array<Record<string, string | number>>;
4
+ series: ChartSeries[];
5
+ /** Chave do eixo X (categoria/tempo). */
6
+ xKey: string;
7
+ height?: number;
8
+ showGrid?: boolean;
9
+ showLegend?: boolean;
10
+ showBrush?: boolean;
11
+ /** Linhas suavizadas (curva) ao inves de retas. */
12
+ smooth?: boolean;
13
+ formatValue?: (value: number) => string;
14
+ formatLabel?: (label: string | number) => string;
15
+ className?: string;
16
+ }
17
+ export declare function LineChart({ data, series, xKey, height, showGrid, showLegend, showBrush, smooth, formatValue, formatLabel, className, }: LineChartProps): import("react").JSX.Element;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Paleta categorica para charts. Os valores sao CSS vars geradas pelos tokens
3
+ * do DS (semantic.chart.*) — trocar tema/marca/modo cascateia automaticamente.
4
+ */
5
+ export declare const CHART_PALETTE: readonly ["var(--flui-semantic-chart-1)", "var(--flui-semantic-chart-2)", "var(--flui-semantic-chart-3)", "var(--flui-semantic-chart-4)", "var(--flui-semantic-chart-5)", "var(--flui-semantic-chart-6)"];
6
+ export declare const CHART_GRID = "var(--flui-semantic-chart-grid)";
7
+ export declare const CHART_AXIS = "var(--flui-semantic-chart-axis)";
8
+ export declare function paletteColor(index: number): string;
9
+ export interface ChartSeries {
10
+ /** Chave do objeto `data` que contem o valor desta serie. */
11
+ dataKey: string;
12
+ /** Rotulo exibido em tooltip/legenda. Default: dataKey. */
13
+ name?: string;
14
+ /** Cor da serie. Default: cor da paleta pelo indice. */
15
+ color?: string;
16
+ }
@@ -0,0 +1,7 @@
1
+ export { LineChart, type LineChartProps } from './LineChart';
2
+ export { AreaChart, type AreaChartProps } from './AreaChart';
3
+ export { BarChart, type BarChartProps } from './BarChart';
4
+ export { DonutChart, type DonutChartProps, type DonutDatum } from './DonutChart';
5
+ export { ChartTooltip, type ChartTooltipProps } from './ChartTooltip';
6
+ export { ChartLegend, type ChartLegendProps, type ChartLegendItem } from './ChartLegend';
7
+ export { CHART_PALETTE, CHART_GRID, CHART_AXIS, paletteColor, type ChartSeries, } from './chartTheme';
@@ -23,5 +23,6 @@ export * from './Drawer/Drawer';
23
23
  export * from './Toast/Toast';
24
24
  export * from './Textarea/Textarea';
25
25
  export * from './CodeBlock/CodeBlock';
26
+ export * from './Chart';
26
27
  export * from './ProfileSettingsModal/ProfileSettingsModal';
27
28
  export * from '../theme/ThemeProvider';