@engrate/components 0.1.3 → 0.1.5

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,65 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ import * as React from 'react';
3
+ declare const barChartVariants: (props?: ({
4
+ size?: "sm" | "default" | "lg" | null | undefined;
5
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
6
+ /** A single data point for the bar chart */
7
+ interface BarChartDataPoint {
8
+ /** Label for the x-axis (e.g., date, category) */
9
+ label: string;
10
+ /** Numeric values for each series */
11
+ [key: string]: string | number;
12
+ }
13
+ /** Configuration for a bar chart data series */
14
+ interface BarChartSeriesConfig {
15
+ /** Key in the data object for this series */
16
+ key: string;
17
+ /** Display name for the legend */
18
+ name: string;
19
+ /** Bar color (defaults to sunflower for first series) */
20
+ color?: string;
21
+ }
22
+ interface BarChartProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof barChartVariants> {
23
+ /** Data points to render */
24
+ data: BarChartDataPoint[];
25
+ /** Configuration for data series. If not provided, all numeric keys except 'label' will be rendered */
26
+ series?: BarChartSeriesConfig[];
27
+ /** Show grid lines */
28
+ showGrid?: boolean;
29
+ /** Show legend */
30
+ showLegend?: boolean;
31
+ /** Show tooltips on hover */
32
+ showTooltip?: boolean;
33
+ /** X-axis label */
34
+ xAxisLabel?: string;
35
+ /** Y-axis label */
36
+ yAxisLabel?: string;
37
+ /** Bar corner radius */
38
+ radius?: number;
39
+ /** Stack bars on top of each other */
40
+ stacked?: boolean;
41
+ /** Layout orientation */
42
+ layout?: 'horizontal' | 'vertical';
43
+ }
44
+ /**
45
+ * BarChart component for displaying categorical data comparisons.
46
+ * Built with Recharts and styled according to Engrate design system.
47
+ *
48
+ * @example
49
+ * ```tsx
50
+ * <BarChart
51
+ * data={[
52
+ * { label: 'Jan', revenue: 4000, expenses: 2400 },
53
+ * { label: 'Feb', revenue: 3000, expenses: 1398 },
54
+ * { label: 'Mar', revenue: 2000, expenses: 9800 },
55
+ * ]}
56
+ * series={[
57
+ * { key: 'revenue', name: 'Revenue' },
58
+ * { key: 'expenses', name: 'Expenses', color: '#0080FF' },
59
+ * ]}
60
+ * aria-label="Revenue vs expenses comparison"
61
+ * />
62
+ * ```
63
+ */
64
+ declare const BarChart: React.ForwardRefExoticComponent<BarChartProps & React.RefAttributes<HTMLDivElement>>;
65
+ export { BarChart, barChartVariants, type BarChartProps, type BarChartDataPoint, type BarChartSeriesConfig, };
@@ -0,0 +1 @@
1
+ export { BarChart, barChartVariants, type BarChartProps, type BarChartDataPoint, type BarChartSeriesConfig, } from './BarChart';
@@ -3,7 +3,7 @@ import * as React from 'react';
3
3
  declare const cardVariants: (props?: ({
4
4
  variant?: "ghost" | "default" | "elevated" | null | undefined;
5
5
  padding?: "sm" | "default" | "lg" | "none" | null | undefined;
6
- bg?: "contrast" | "main" | "sunflower" | "lemon-meringue" | "vanilla" | "eggshell" | "warm-purple" | "cool-purple" | "electric-blue" | "deep-blue" | "error" | "card" | "alt" | "transparent" | "sunflower-hover" | null | undefined;
6
+ bg?: "contrast" | "main" | "sunflower" | "lemon-meringue" | "vanilla" | "eggshell" | "warm-purple" | "cool-purple" | "electric-blue" | "deep-blue" | "error" | "transparent" | "card" | "alt" | "sunflower-hover" | null | undefined;
7
7
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
8
8
  interface CardProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof cardVariants> {
9
9
  /** Render as a child component */
@@ -4,7 +4,7 @@ declare const datePickerTriggerVariants: (props?: ({
4
4
  variant?: "default" | "error" | null | undefined;
5
5
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
6
6
  declare const calendarDayVariants: (props?: ({
7
- state?: "default" | "disabled" | "selected" | "today" | "outside" | null | undefined;
7
+ state?: "default" | "disabled" | "outside" | "selected" | "today" | null | undefined;
8
8
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
9
9
  interface DatePickerProps extends VariantProps<typeof datePickerTriggerVariants> {
10
10
  /** The currently selected date */
@@ -4,7 +4,7 @@ declare const dateTimePickerTriggerVariants: (props?: ({
4
4
  variant?: "default" | "error" | null | undefined;
5
5
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
6
6
  declare const calendarDayVariants: (props?: ({
7
- state?: "default" | "disabled" | "selected" | "today" | "outside" | null | undefined;
7
+ state?: "default" | "disabled" | "outside" | "selected" | "today" | null | undefined;
8
8
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
9
9
  interface DateTimePickerProps extends VariantProps<typeof dateTimePickerTriggerVariants> {
10
10
  /** The currently selected date and time */
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  declare const gridVariants: (props?: ({
3
- cols?: 1 | 2 | 3 | 4 | 5 | 6 | 12 | null | undefined;
3
+ cols?: 1 | 2 | 3 | 4 | 5 | 12 | 6 | null | undefined;
4
4
  gap?: "sm" | "lg" | "none" | "md" | "xl" | "xs" | "2xl" | null | undefined;
5
5
  align?: "end" | "start" | "center" | "stretch" | "baseline" | null | undefined;
6
6
  justify?: "end" | "start" | "center" | "stretch" | null | undefined;
@@ -53,9 +53,9 @@ interface GridProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'cols'> {
53
53
  */
54
54
  declare const Grid: React.ForwardRefExoticComponent<GridProps & React.RefAttributes<HTMLDivElement>>;
55
55
  declare const gridItemVariants: (props?: ({
56
- colSpan?: 1 | 2 | 3 | 4 | 5 | 6 | 11 | 12 | 10 | "full" | 7 | 8 | 9 | null | undefined;
56
+ colSpan?: 1 | 2 | 3 | 4 | 5 | 12 | 10 | 6 | 11 | "full" | 7 | 8 | 9 | null | undefined;
57
57
  rowSpan?: 1 | 2 | 3 | 4 | 5 | 6 | "full" | null | undefined;
58
- colStart?: 1 | "auto" | 2 | 3 | 4 | 5 | 6 | 11 | 12 | 10 | 7 | 8 | 9 | null | undefined;
58
+ colStart?: 1 | "auto" | 2 | 3 | 4 | 5 | 12 | 10 | 6 | 11 | 7 | 8 | 9 | null | undefined;
59
59
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
60
60
  type ColSpanValue = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 'full';
61
61
  type RowSpanValue = 1 | 2 | 3 | 4 | 5 | 6 | 'full';
@@ -0,0 +1,65 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ import * as React from 'react';
3
+ declare const lineChartVariants: (props?: ({
4
+ size?: "sm" | "default" | "lg" | null | undefined;
5
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
6
+ /** A single data point for the chart */
7
+ interface DataPoint {
8
+ /** Label for the x-axis (e.g., date, category) */
9
+ label: string;
10
+ /** Numeric values for each series */
11
+ [key: string]: string | number;
12
+ }
13
+ /** Configuration for a data series */
14
+ interface SeriesConfig {
15
+ /** Key in the data object for this series */
16
+ key: string;
17
+ /** Display name for the legend */
18
+ name: string;
19
+ /** Line color (defaults to sunflower for first series) */
20
+ color?: string;
21
+ }
22
+ interface LineChartProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof lineChartVariants> {
23
+ /** Data points to render */
24
+ data: DataPoint[];
25
+ /** Configuration for data series. If not provided, all numeric keys except 'label' will be rendered */
26
+ series?: SeriesConfig[];
27
+ /** Show grid lines */
28
+ showGrid?: boolean;
29
+ /** Show legend */
30
+ showLegend?: boolean;
31
+ /** Show tooltips on hover */
32
+ showTooltip?: boolean;
33
+ /** X-axis label */
34
+ xAxisLabel?: string;
35
+ /** Y-axis label */
36
+ yAxisLabel?: string;
37
+ /** Custom stroke width for lines */
38
+ strokeWidth?: number;
39
+ /** Enable curve interpolation */
40
+ curved?: boolean;
41
+ /** Show dots on data points */
42
+ showDots?: boolean;
43
+ }
44
+ /**
45
+ * LineChart component for displaying data trends over time.
46
+ * Built with Recharts and styled according to Engrate design system.
47
+ *
48
+ * @example
49
+ * ```tsx
50
+ * <LineChart
51
+ * data={[
52
+ * { label: 'Jan', revenue: 4000, expenses: 2400 },
53
+ * { label: 'Feb', revenue: 3000, expenses: 1398 },
54
+ * { label: 'Mar', revenue: 2000, expenses: 9800 },
55
+ * ]}
56
+ * series={[
57
+ * { key: 'revenue', name: 'Revenue' },
58
+ * { key: 'expenses', name: 'Expenses', color: '#0080FF' },
59
+ * ]}
60
+ * aria-label="Revenue vs expenses over time"
61
+ * />
62
+ * ```
63
+ */
64
+ declare const LineChart: React.ForwardRefExoticComponent<LineChartProps & React.RefAttributes<HTMLDivElement>>;
65
+ export { LineChart, lineChartVariants, type LineChartProps, type DataPoint, type SeriesConfig, };
@@ -0,0 +1 @@
1
+ export { LineChart, lineChartVariants, type LineChartProps, type DataPoint, type SeriesConfig, } from './LineChart';
@@ -0,0 +1,61 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ import * as React from 'react';
3
+ declare const pieChartVariants: (props?: ({
4
+ size?: "sm" | "default" | "lg" | null | undefined;
5
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
6
+ /** A single data point for the pie chart */
7
+ interface PieChartDataPoint {
8
+ /** Label for the segment */
9
+ name: string;
10
+ /** Numeric value for the segment */
11
+ value: number;
12
+ /** Optional color for the segment */
13
+ color?: string;
14
+ }
15
+ interface PieChartProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof pieChartVariants> {
16
+ /** Data points to render */
17
+ data: PieChartDataPoint[];
18
+ /** Show legend */
19
+ showLegend?: boolean;
20
+ /** Show tooltips on hover */
21
+ showTooltip?: boolean;
22
+ /** Inner radius for donut chart (0 = pie, > 0 = donut) */
23
+ innerRadius?: number;
24
+ /** Outer radius as percentage of container */
25
+ outerRadius?: number | string;
26
+ /** Padding angle between segments */
27
+ paddingAngle?: number;
28
+ /** Show percentage labels on segments */
29
+ showLabels?: boolean;
30
+ /** Start angle in degrees (0 = 3 o'clock, 90 = 12 o'clock) */
31
+ startAngle?: number;
32
+ /** End angle in degrees */
33
+ endAngle?: number;
34
+ }
35
+ /**
36
+ * PieChart component for displaying proportional data.
37
+ * Built with Recharts and styled according to Engrate design system.
38
+ *
39
+ * @example
40
+ * ```tsx
41
+ * <PieChart
42
+ * data={[
43
+ * { name: 'Desktop', value: 400 },
44
+ * { name: 'Mobile', value: 300 },
45
+ * { name: 'Tablet', value: 200 },
46
+ * ]}
47
+ * aria-label="Traffic by device type"
48
+ * />
49
+ * ```
50
+ *
51
+ * @example Donut chart
52
+ * ```tsx
53
+ * <PieChart
54
+ * data={data}
55
+ * innerRadius={60}
56
+ * aria-label="Revenue distribution"
57
+ * />
58
+ * ```
59
+ */
60
+ declare const PieChart: React.ForwardRefExoticComponent<PieChartProps & React.RefAttributes<HTMLDivElement>>;
61
+ export { PieChart, pieChartVariants, type PieChartProps, type PieChartDataPoint, };
@@ -0,0 +1 @@
1
+ export { PieChart, pieChartVariants, type PieChartProps, type PieChartDataPoint, } from './PieChart';
@@ -1,5 +1,6 @@
1
1
  export * from './AlertDialog';
2
2
  export * from './Badge';
3
+ export * from './BarChart';
3
4
  export * from './Breadcrumbs';
4
5
  export * from './Button';
5
6
  export * from './Card';
@@ -16,8 +17,10 @@ export * from './Grid';
16
17
  export * from './Heading';
17
18
  export * from './Input';
18
19
  export * from './Label';
20
+ export * from './LineChart';
19
21
  export * from './Link';
20
22
  export * from './Modal';
23
+ export * from './PieChart';
21
24
  export * from './ProgressIndicator';
22
25
  export * from './Radio';
23
26
  export * from './Select';