@datacrest/dcuikit 1.0.26 → 1.0.27

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
1
  import React from 'react';
2
2
  import { ChartProps } from './types';
3
- declare const Chart: ({ data, title, description, showDetail, chartType, height, yAxisWidth, colors, colorPreset, }: ChartProps) => React.JSX.Element;
3
+ declare const Chart: ({ data, title, description, showDetail, chartType, height, yAxisWidth, colors, colorPreset, xAxisKey, dataKeys, dataKeyLabels, }: ChartProps) => React.JSX.Element;
4
4
  export default Chart;
@@ -1,5 +1,8 @@
1
1
  import { ChartColors, ChartData } from './types';
2
2
  export declare const CHART_COLOR_PRESETS: Record<string, ChartColors>;
3
3
  export declare const CHART_DATA: ChartData[];
4
+ export declare const SALES_DATA: ChartData[];
4
5
  export declare const DEFAULT_CHART_TYPE = "bar";
5
6
  export declare const CHART_TYPES: readonly ["bar", "line"];
7
+ export declare const DEFAULT_DATA_KEYS: string[];
8
+ export declare const DEFAULT_X_AXIS_KEY = "date";
@@ -1,2 +1,3 @@
1
1
  export { default as Chart } from './Chart';
2
2
  export * from './types';
3
+ export * from './const';
@@ -1,14 +1,5 @@
1
- export type ChartData = {
2
- date: string;
3
- revenue: number;
4
- expenses?: number;
5
- profit?: number;
6
- };
7
- export type ChartColors = {
8
- revenue: string;
9
- expenses?: string;
10
- profit?: string;
11
- };
1
+ export type ChartData = Record<string, string | number>;
2
+ export type ChartColors = Record<string, string>;
12
3
  export type ChartType = 'bar' | 'line';
13
4
  export interface ChartProps {
14
5
  data: ChartData[];
@@ -20,5 +11,8 @@ export interface ChartProps {
20
11
  yAxisWidth?: number;
21
12
  colors?: ChartColors;
22
13
  colorPreset?: ColorPreset;
14
+ xAxisKey?: string;
15
+ dataKeys?: string[];
16
+ dataKeyLabels?: Record<string, string>;
23
17
  }
24
18
  export type ColorPreset = 'default' | 'blue' | 'green' | 'warm';