@commerce7/admin-ui 2.0.56 → 2.0.58

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,87 @@
1
+ import { FC, ReactElement } from 'react';
2
+ export interface BarChartSeries {
3
+ /** The data key in each data object for this bar */
4
+ key: string;
5
+ /** Display label for the bar (used in tooltip/legend) */
6
+ label: string;
7
+ /** Fill color for the bar */
8
+ color: string;
9
+ }
10
+ export interface BarChartProps {
11
+ /**
12
+ * The source data array to render the bar chart.
13
+ * Each object should have a category key (see xAxisDataKey) and numeric keys matching each series key.
14
+ */
15
+ data: Record<string, any>[];
16
+ /**
17
+ * The series definitions that describe each bar to render.
18
+ */
19
+ series: BarChartSeries[];
20
+ /**
21
+ * The data key used for the category axis. Defaults to 'period'.
22
+ */
23
+ xAxisDataKey?: string;
24
+ /**
25
+ * The layout of the bar chart.
26
+ */
27
+ layout?: 'horizontal' | 'vertical';
28
+ /**
29
+ * The percentage value of the chart's width or a fixed width.
30
+ */
31
+ width?: string | number;
32
+ /**
33
+ * The percentage value of the chart's height or a fixed height.
34
+ */
35
+ height?: string | number;
36
+ /**
37
+ * The prop to add positioning to BarChart. Refer: https://recharts.org/en-US/api/BarChart#margin
38
+ */
39
+ margin?: {
40
+ top?: number;
41
+ right?: number;
42
+ bottom?: number;
43
+ left?: number;
44
+ };
45
+ /**
46
+ * The gap between bar categories as a percentage or fixed value.
47
+ */
48
+ barCategoryGap?: string | number;
49
+ /**
50
+ * The gap between bars within the same category.
51
+ */
52
+ barGap?: number;
53
+ /**
54
+ * The fixed width/height of each bar.
55
+ */
56
+ barSize?: number;
57
+ /**
58
+ * The border radius for each bar. Defaults to [3, 3, 0, 0] for horizontal, [0, 3, 3, 0] for vertical.
59
+ */
60
+ barRadius?: [number, number, number, number];
61
+ /**
62
+ * A component to render custom tooltip. Refer: https://recharts.org/en-US/api/Tooltip#content
63
+ */
64
+ tooltip?: ReactElement;
65
+ /**
66
+ * Indicates whether the tooltip is hidden.
67
+ */
68
+ hideTooltip?: boolean;
69
+ /**
70
+ * Indicates whether the X axis is hidden.
71
+ */
72
+ hideXAxis?: boolean;
73
+ /**
74
+ * Indicates whether the Y axis is hidden (only applies to vertical layout).
75
+ */
76
+ hideYAxis?: boolean;
77
+ /**
78
+ * The stroke color for axis tick labels.
79
+ */
80
+ axisColor?: string;
81
+ /**
82
+ * The minimum point size for bars to ensure visibility of zero or near-zero values.
83
+ */
84
+ minPointSize?: number;
85
+ }
86
+ declare const BarChart: FC<BarChartProps>;
87
+ export default BarChart;
@@ -0,0 +1,26 @@
1
+ import { FC } from 'react';
2
+ interface PayloadItem {
3
+ name: string;
4
+ value: string | number;
5
+ payload?: Record<string, any>;
6
+ dataKey?: string;
7
+ fill?: string;
8
+ [key: string]: any;
9
+ }
10
+ interface ToolTipProps {
11
+ /**
12
+ * Whether the tooltip is currently active (visible)
13
+ */
14
+ active?: boolean;
15
+ /**
16
+ * The data payload of the tooltip
17
+ */
18
+ payload?: PayloadItem[];
19
+ }
20
+ /**
21
+ * Custom tooltip component for bar charts
22
+ * Displays the series name and value of the hovered bar
23
+ */
24
+ declare const ToolTip: FC<ToolTipProps>;
25
+ export type { ToolTipProps, PayloadItem };
26
+ export default ToolTip;
@@ -0,0 +1,3 @@
1
+ import BarChart, { BarChartProps, BarChartSeries } from './BarChart';
2
+ export type { BarChartProps, BarChartSeries };
3
+ export default BarChart;
@@ -1,5 +1,6 @@
1
1
  import Alert from './alert';
2
2
  import Avatar from './avatar';
3
+ import BarChart from './barChart';
3
4
  import Breadcrumbs from './breadcrumbs';
4
5
  import Button from './button';
5
6
  import ButtonMenu from './buttonMenu';
@@ -42,9 +43,10 @@ import Textarea from './textarea';
42
43
  import Commerce7AdminUI from './ui';
43
44
  import { c7Colors } from './ui/theme';
44
45
  import VividIcon from './vividIcon';
45
- export { Avatar, Alert, Breadcrumbs, Button, ButtonMenu, c7Colors, Commerce7AdminUI, Checkbox, CheckboxGroup, Columns, ContextMenu, DataDisplay, DatePicker, Heading, Icon, InfoCard, DisplayIcon, VividIcon, Input, LineBreak, Nav, NoRecords, ProgressBar, Picture, PieChart, Legend, LinkButton, Modal, Radio, RadioGroup, Region, Select, SelectButton, Spinner, Stepper, SubMenu, Switch, Table, Tag, Textarea, Card, CardLink, Text, Tabs };
46
+ export { Avatar, Alert, BarChart, Breadcrumbs, Button, ButtonMenu, c7Colors, Commerce7AdminUI, Checkbox, CheckboxGroup, Columns, ContextMenu, DataDisplay, DatePicker, Heading, Icon, InfoCard, DisplayIcon, VividIcon, Input, LineBreak, Nav, NoRecords, ProgressBar, Picture, PieChart, Legend, LinkButton, Modal, Radio, RadioGroup, Region, Select, SelectButton, Spinner, Stepper, SubMenu, Switch, Table, Tag, Textarea, Card, CardLink, Text, Tabs };
46
47
  export type { AlertProps, AlertVariant } from './alert';
47
48
  export type { AvatarProps } from './avatar';
49
+ export type { BarChartProps, BarChartSeries } from './barChart';
48
50
  export type { BreadcrumbProps, BreadcrumbsProps } from './breadcrumbs';
49
51
  export type { ButtonProps, ButtonSize, ButtonVariant } from './button';
50
52
  export type { ButtonMenuProps, ButtonMenuItemProps, ButtonSize as ButtonMenuSize, ButtonVariant as ButtonMenuVariant } from './buttonMenu';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commerce7/admin-ui",
3
- "version": "2.0.56",
3
+ "version": "2.0.58",
4
4
  "description": "Commerce7 Admin UI Component Library",
5
5
  "keywords": [
6
6
  "Commerce7"