@fluityy/designsystem 0.2.10 → 0.2.12

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,26 @@
1
+ export type SparklineVariant = "area" | "line" | "bar";
2
+ export interface SparklineProps {
3
+ /** Pontos do sparkline. Aceita array de numeros ou objetos `{value}`. */
4
+ data: ReadonlyArray<number> | ReadonlyArray<{
5
+ value: number;
6
+ }>;
7
+ variant?: SparklineVariant;
8
+ /** Cor base — aceita CSS var ou cor literal. Default: chart-1. */
9
+ color?: string;
10
+ /** Altura em pixels. Default: 40. */
11
+ height?: number;
12
+ /** Suaviza a curva (monotone). Default: true. */
13
+ smooth?: boolean;
14
+ /** Espessura do traço. Default: 1.75. */
15
+ strokeWidth?: number;
16
+ /** Preenche a area sob a curva. Default: true. So aplica em `area`. */
17
+ filled?: boolean;
18
+ /** Habilita tooltip em hover. Default: true. */
19
+ interactive?: boolean;
20
+ /** Formata o valor exibido no tooltip. */
21
+ formatValue?: (value: number) => string;
22
+ /** Rotulo exibido antes do valor no tooltip. */
23
+ tooltipLabel?: string;
24
+ className?: string;
25
+ }
26
+ export declare function Sparkline({ data, variant, color, height, smooth, strokeWidth, filled, interactive, formatValue, tooltipLabel, className, }: SparklineProps): 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,8 @@
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 { Sparkline, type SparklineProps, type SparklineVariant } from './Sparkline';
6
+ export { ChartTooltip, type ChartTooltipProps } from './ChartTooltip';
7
+ export { ChartLegend, type ChartLegendProps, type ChartLegendItem } from './ChartLegend';
8
+ export { CHART_PALETTE, CHART_GRID, CHART_AXIS, paletteColor, type ChartSeries, } from './chartTheme';
@@ -0,0 +1,30 @@
1
+ import { SparklineVariant } from '../Chart/Sparkline';
2
+ export type MetricTone = "primary" | "accent" | "success" | "warning" | "danger" | "neutral";
3
+ export type MetricCardSize = "sm" | "md" | "lg";
4
+ export interface MetricCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
5
+ /** Rotulo da metrica (ex: "CPU Time"). */
6
+ label: React.ReactNode;
7
+ /** Valor principal exibido em destaque. */
8
+ value: React.ReactNode;
9
+ /** Unidade opcional ao lado do valor (ex: "ms", "%"). */
10
+ unit?: React.ReactNode;
11
+ /** Variacao % vs periodo anterior. */
12
+ delta?: number;
13
+ /** Formata o numero do delta. Default: `↗ N.NN%`. */
14
+ formatDelta?: (n: number) => string;
15
+ /** Forca o tom do delta. `"auto"` usa sinal (+ primary / − neutral). */
16
+ deltaTone?: "auto" | MetricTone;
17
+ /** Pontos do sparkline. Se vazio/ausente, sparkline e omitido. */
18
+ data?: ReadonlyArray<number> | ReadonlyArray<{
19
+ value: number;
20
+ }>;
21
+ /** Tipo do sparkline. Default: "area". */
22
+ sparklineVariant?: SparklineVariant;
23
+ /** Tom geral (sparkline e indicador). Default: "primary". */
24
+ tone?: MetricTone;
25
+ /** Barra inferior colorida. Aceita boolean (usa `tone`) ou um tom especifico. */
26
+ indicator?: boolean | MetricTone;
27
+ /** Tamanho do card. Default: "md". */
28
+ size?: MetricCardSize;
29
+ }
30
+ export declare const MetricCard: import('react').ForwardRefExoticComponent<MetricCardProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,13 @@
1
+ export interface SegmentedControlProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> {
2
+ value?: string;
3
+ defaultValue?: string;
4
+ onValueChange?: (value: string) => void;
5
+ size?: "sm" | "md";
6
+ /** Distribui os segmentos com largura igual. */
7
+ fullWidth?: boolean;
8
+ }
9
+ export declare function SegmentedControl({ value, defaultValue, onValueChange, size, fullWidth, className, children, ...props }: SegmentedControlProps): import("react").JSX.Element;
10
+ export interface SegmentedControlItemProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "value"> {
11
+ value: string;
12
+ }
13
+ export declare function SegmentedControlItem({ value, className, children, disabled, ...props }: SegmentedControlItemProps): import("react").JSX.Element;
@@ -13,8 +13,10 @@ export * from './Progress/Progress';
13
13
  export * from './Divider/Divider';
14
14
  export * from './Breadcrumb/Breadcrumb';
15
15
  export * from './StatCard/StatCard';
16
+ export * from './MetricCard/MetricCard';
16
17
  export * from './Alert/Alert';
17
18
  export * from './Tabs/Tabs';
19
+ export * from './SegmentedControl/SegmentedControl';
18
20
  export * from './Accordion/Accordion';
19
21
  export * from './Tooltip/Tooltip';
20
22
  export * from './Popover/Popover';
@@ -23,5 +25,6 @@ export * from './Drawer/Drawer';
23
25
  export * from './Toast/Toast';
24
26
  export * from './Textarea/Textarea';
25
27
  export * from './CodeBlock/CodeBlock';
28
+ export * from './Chart';
26
29
  export * from './ProfileSettingsModal/ProfileSettingsModal';
27
30
  export * from '../theme/ThemeProvider';