@monolith-forensics/monolith-ui 1.8.0 → 1.8.1-dev.0
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.
- package/dist/BarChart/BarChart.d.ts +3 -0
- package/dist/BarChart/BarChart.js +511 -0
- package/dist/BarChart/BarChart.lib.d.ts +31 -0
- package/dist/BarChart/BarChart.lib.js +136 -0
- package/dist/BarChart/BarChart.styled.d.ts +49 -0
- package/dist/BarChart/BarChart.styled.js +111 -0
- package/dist/BarChart/BarChart.types.d.ts +170 -0
- package/dist/BarChart/BarChart.types.js +1 -0
- package/dist/BarChart/index.d.ts +3 -0
- package/dist/BarChart/index.js +2 -0
- package/dist/Button/Button.js +9 -58
- package/dist/Calendar/Calendar.d.ts +3 -1
- package/dist/Calendar/Calendar.js +134 -33
- package/dist/Calendar/CalendarStyles.d.ts +3 -0
- package/dist/Calendar/CalendarStyles.js +92 -14
- package/dist/Calendar/calendarHelpers.d.ts +5 -1
- package/dist/Calendar/calendarHelpers.js +13 -5
- package/dist/ChartPrimitives/chartLegend.styled.d.ts +12 -0
- package/dist/ChartPrimitives/chartLegend.styled.js +52 -0
- package/dist/ChartPrimitives/chartTooltip.styled.d.ts +19 -0
- package/dist/ChartPrimitives/chartTooltip.styled.js +61 -0
- package/dist/ChartPrimitives/index.d.ts +2 -0
- package/dist/ChartPrimitives/index.js +2 -0
- package/dist/ChartUtils/chartColors.d.ts +8 -0
- package/dist/ChartUtils/chartColors.js +65 -0
- package/dist/ChartUtils/chartMath.d.ts +3 -0
- package/dist/ChartUtils/chartMath.js +3 -0
- package/dist/ChartUtils/index.d.ts +2 -0
- package/dist/ChartUtils/index.js +2 -0
- package/dist/Charts/BarChart/BarChart.d.ts +5 -0
- package/dist/Charts/BarChart/BarChart.js +549 -0
- package/dist/Charts/BarChart/BarChart.lib.d.ts +31 -0
- package/dist/Charts/BarChart/BarChart.lib.js +136 -0
- package/dist/Charts/BarChart/BarChart.styled.d.ts +51 -0
- package/dist/Charts/BarChart/BarChart.styled.js +115 -0
- package/dist/Charts/BarChart/BarChart.types.d.ts +171 -0
- package/dist/Charts/BarChart/BarChart.types.js +1 -0
- package/dist/Charts/BarChart/index.d.ts +3 -0
- package/dist/Charts/BarChart/index.js +2 -0
- package/dist/Charts/ChartPrimitives/ChartExportControl.d.ts +11 -0
- package/dist/Charts/ChartPrimitives/ChartExportControl.js +29 -0
- package/dist/Charts/ChartPrimitives/chartActions.styled.d.ts +1 -0
- package/dist/Charts/ChartPrimitives/chartActions.styled.js +8 -0
- package/dist/Charts/ChartPrimitives/chartLegend.styled.d.ts +12 -0
- package/dist/Charts/ChartPrimitives/chartLegend.styled.js +52 -0
- package/dist/Charts/ChartPrimitives/chartTooltip.styled.d.ts +19 -0
- package/dist/Charts/ChartPrimitives/chartTooltip.styled.js +61 -0
- package/dist/Charts/ChartPrimitives/index.d.ts +4 -0
- package/dist/Charts/ChartPrimitives/index.js +4 -0
- package/dist/Charts/ChartUtils/chartColors.d.ts +8 -0
- package/dist/Charts/ChartUtils/chartColors.js +65 -0
- package/dist/Charts/ChartUtils/chartExport.d.ts +47 -0
- package/dist/Charts/ChartUtils/chartExport.js +311 -0
- package/dist/Charts/ChartUtils/chartMath.d.ts +3 -0
- package/dist/Charts/ChartUtils/chartMath.js +3 -0
- package/dist/Charts/ChartUtils/index.d.ts +3 -0
- package/dist/Charts/ChartUtils/index.js +3 -0
- package/dist/Charts/HeatMap/HeatMap.d.ts +5 -0
- package/dist/Charts/HeatMap/HeatMap.js +212 -0
- package/dist/Charts/HeatMap/HeatMap.lib.d.ts +30 -0
- package/dist/Charts/HeatMap/HeatMap.lib.js +115 -0
- package/dist/Charts/HeatMap/HeatMap.styled.d.ts +37 -0
- package/dist/Charts/HeatMap/HeatMap.styled.js +91 -0
- package/dist/Charts/HeatMap/HeatMap.types.d.ts +80 -0
- package/dist/Charts/HeatMap/HeatMap.types.js +1 -0
- package/dist/Charts/HeatMap/index.d.ts +3 -0
- package/dist/Charts/HeatMap/index.js +2 -0
- package/dist/Charts/LineChart/LineChart.d.ts +5 -0
- package/dist/Charts/LineChart/LineChart.js +529 -0
- package/dist/Charts/LineChart/LineChart.lib.d.ts +24 -0
- package/dist/Charts/LineChart/LineChart.lib.js +132 -0
- package/dist/Charts/LineChart/LineChart.styled.d.ts +59 -0
- package/dist/Charts/LineChart/LineChart.styled.js +147 -0
- package/dist/Charts/LineChart/LineChart.types.d.ts +193 -0
- package/dist/Charts/LineChart/LineChart.types.js +1 -0
- package/dist/Charts/LineChart/index.d.ts +3 -0
- package/dist/Charts/LineChart/index.js +2 -0
- package/dist/Charts/PieChart/PieChart.d.ts +4 -0
- package/dist/Charts/PieChart/PieChart.js +199 -0
- package/dist/Charts/PieChart/PieChart.lib.d.ts +5 -0
- package/dist/Charts/PieChart/PieChart.lib.js +19 -0
- package/dist/Charts/PieChart/PieChart.styled.d.ts +51 -0
- package/dist/Charts/PieChart/PieChart.styled.js +163 -0
- package/dist/Charts/PieChart/PieChart.types.d.ts +100 -0
- package/dist/Charts/PieChart/PieChart.types.js +1 -0
- package/dist/Charts/PieChart/index.d.ts +2 -0
- package/dist/Charts/PieChart/index.js +1 -0
- package/dist/Charts/index.d.ts +5 -0
- package/dist/Charts/index.js +4 -0
- package/dist/CheckBox/CheckBox.js +2 -16
- package/dist/DateInput/DateInput.js +198 -143
- package/dist/DropDownMenu/components/MenuComponent.js +2 -1
- package/dist/DropDownMenu/components/MenuItem.js +5 -14
- package/dist/DropDownMenu/components/MenuItemList.js +7 -24
- package/dist/DropDownMenu/components/StyledFloatContainer.js +1 -1
- package/dist/FieldLabel/FieldLabel.js +4 -12
- package/dist/FileInputField/FileInputField.js +4 -23
- package/dist/FormSection/FormSection.js +5 -25
- package/dist/HeatMap/HeatMap.d.ts +3 -0
- package/dist/HeatMap/HeatMap.js +174 -0
- package/dist/HeatMap/HeatMap.lib.d.ts +30 -0
- package/dist/HeatMap/HeatMap.lib.js +115 -0
- package/dist/HeatMap/HeatMap.styled.d.ts +34 -0
- package/dist/HeatMap/HeatMap.styled.js +83 -0
- package/dist/HeatMap/HeatMap.types.d.ts +79 -0
- package/dist/HeatMap/HeatMap.types.js +1 -0
- package/dist/HeatMap/index.d.ts +3 -0
- package/dist/HeatMap/index.js +2 -0
- package/dist/IconButton/IconButton.js +2 -16
- package/dist/Input/Input.js +7 -56
- package/dist/LineChart/LineChart.d.ts +3 -0
- package/dist/LineChart/LineChart.js +491 -0
- package/dist/LineChart/LineChart.lib.d.ts +24 -0
- package/dist/LineChart/LineChart.lib.js +132 -0
- package/dist/LineChart/LineChart.styled.d.ts +57 -0
- package/dist/LineChart/LineChart.styled.js +150 -0
- package/dist/LineChart/LineChart.types.d.ts +192 -0
- package/dist/LineChart/LineChart.types.js +1 -0
- package/dist/LineChart/index.d.ts +3 -0
- package/dist/LineChart/index.js +2 -0
- package/dist/PieChart/PieChart.d.ts +2 -0
- package/dist/PieChart/PieChart.js +161 -0
- package/dist/PieChart/PieChart.lib.d.ts +5 -0
- package/dist/PieChart/PieChart.lib.js +19 -0
- package/dist/PieChart/PieChart.styled.d.ts +49 -0
- package/dist/PieChart/PieChart.styled.js +161 -0
- package/dist/PieChart/PieChart.types.d.ts +99 -0
- package/dist/PieChart/PieChart.types.js +1 -0
- package/dist/PieChart/index.d.ts +2 -0
- package/dist/PieChart/index.js +1 -0
- package/dist/Pill/Pill.js +8 -79
- package/dist/Popover/Popover.context.d.ts +2 -1
- package/dist/Popover/Popover.js +5 -2
- package/dist/Popover/Popover.styles.d.ts +1 -6
- package/dist/Popover/Popover.styles.js +11 -28
- package/dist/Popover/Popover.transitions.d.ts +4 -2
- package/dist/Popover/Popover.transitions.js +23 -49
- package/dist/Popover/PopoverDropdown.js +6 -8
- package/dist/Popover/PopoverTarget.js +6 -3
- package/dist/SegmentedControl/SegmentedControl.utils.d.ts +2 -2
- package/dist/SegmentedControl/SegmentedControl.utils.js +3 -30
- package/dist/SelectBox/SelectBox.js +3 -3
- package/dist/SelectBox/select-box.styled-components.d.ts +3 -1
- package/dist/SelectBox/select-box.styled-components.js +10 -48
- package/dist/SuperDatePicker/SuperDatePicker.d.ts +74 -0
- package/dist/SuperDatePicker/SuperDatePicker.js +557 -0
- package/dist/SuperDatePicker/index.d.ts +2 -0
- package/dist/SuperDatePicker/index.js +2 -0
- package/dist/Switch/Switch.d.ts +2 -2
- package/dist/Switch/Switch.js +18 -83
- package/dist/Table/StateStorage.d.ts +4 -0
- package/dist/Table/StateStorage.js +13 -0
- package/dist/Table/Table.js +160 -12
- package/dist/Table/TableComponents.d.ts +10 -0
- package/dist/Table/TableComponents.js +57 -0
- package/dist/Table/TableDefaults.d.ts +7 -0
- package/dist/Table/TableDefaults.js +7 -0
- package/dist/Table/TableProvider.js +263 -71
- package/dist/Table/TableRow.js +15 -10
- package/dist/Table/types.d.ts +64 -0
- package/dist/TagBox/TagBox.js +18 -76
- package/dist/TextArea/TextArea.js +4 -23
- package/dist/TextInput/TextInput.js +12 -6
- package/dist/Utilities/parseTimestamp.js +11 -6
- package/dist/core/ArrowButton.d.ts +2 -0
- package/dist/core/ArrowButton.js +7 -3
- package/dist/core/ClearButton.d.ts +2 -0
- package/dist/core/ClearButton.js +7 -3
- package/dist/core/controlSizes.d.ts +34 -0
- package/dist/core/controlSizes.js +190 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +5 -1
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
import { useTheme } from "styled-components";
|
|
3
|
+
import { clamp, easeOutCubic, formatDefaultValue, getGradientColor, getGradientColorFromStops, getGradientStops, mixColors, } from "../ChartUtils";
|
|
4
|
+
export { clamp, easeOutCubic, formatDefaultValue, getGradientColor, getGradientColorFromStops, getGradientStops, mixColors, };
|
|
5
|
+
export const getBarKey = (datum, index) => { var _a; return (_a = datum.id) !== null && _a !== void 0 ? _a : `${datum.label}-${index}`; };
|
|
6
|
+
export const getSeriesKey = (series, index) => {
|
|
7
|
+
if (series.id != null)
|
|
8
|
+
return series.id;
|
|
9
|
+
if (typeof series.label === "string" || typeof series.label === "number") {
|
|
10
|
+
return String(series.label);
|
|
11
|
+
}
|
|
12
|
+
return `series-${index}`;
|
|
13
|
+
};
|
|
14
|
+
export const getSeriesLabelText = (label, fallbackLabel) => {
|
|
15
|
+
if (typeof label === "string" || typeof label === "number") {
|
|
16
|
+
return String(label);
|
|
17
|
+
}
|
|
18
|
+
return fallbackLabel;
|
|
19
|
+
};
|
|
20
|
+
export const getCategoryKey = (datum) => datum.label;
|
|
21
|
+
export const useThemeColors = (colors) => {
|
|
22
|
+
const theme = useTheme();
|
|
23
|
+
return useMemo(() => (colors === null || colors === void 0 ? void 0 : colors.length)
|
|
24
|
+
? colors
|
|
25
|
+
: [
|
|
26
|
+
theme.palette.primary.main,
|
|
27
|
+
theme.alert.info.color,
|
|
28
|
+
theme.alert.success.color,
|
|
29
|
+
theme.alert.warning.color,
|
|
30
|
+
theme.alert.error.color,
|
|
31
|
+
theme.palette.fourth.main,
|
|
32
|
+
theme.button.text.secondary,
|
|
33
|
+
], [colors, theme]);
|
|
34
|
+
};
|
|
35
|
+
export const getBandPadding = (barGap, span, count) => {
|
|
36
|
+
if (count <= 1 || barGap <= 0 || span <= 0) {
|
|
37
|
+
return { inner: 0.08, outer: 0.04 };
|
|
38
|
+
}
|
|
39
|
+
const approximateStep = span / count;
|
|
40
|
+
const inner = clamp(barGap / Math.max(approximateStep, 1), 0, 0.72);
|
|
41
|
+
return {
|
|
42
|
+
inner,
|
|
43
|
+
outer: clamp(inner / 2, 0.04, 0.3),
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export const getValueDomain = (values, minValue, maxValue) => {
|
|
47
|
+
const actualMin = values.length ? Math.min(...values) : 0;
|
|
48
|
+
const actualMax = values.length ? Math.max(...values) : 0;
|
|
49
|
+
const resolvedMin = minValue != null ? Math.min(minValue, 0) : Math.min(actualMin, 0);
|
|
50
|
+
const resolvedMax = maxValue != null ? Math.max(maxValue, 0) : Math.max(actualMax, 0);
|
|
51
|
+
if (resolvedMin === resolvedMax) {
|
|
52
|
+
if (resolvedMin === 0)
|
|
53
|
+
return [0, 1];
|
|
54
|
+
return [Math.min(resolvedMin, 0), Math.max(resolvedMax, 0) + 1];
|
|
55
|
+
}
|
|
56
|
+
return [resolvedMin, resolvedMax];
|
|
57
|
+
};
|
|
58
|
+
export const getDefaultMargin = (orientation, showCategoryAxisLabels, showValueAxisLabels, showLabels) => {
|
|
59
|
+
if (orientation === "horizontal") {
|
|
60
|
+
return {
|
|
61
|
+
top: showLabels ? 22 : 16,
|
|
62
|
+
right: showLabels ? 42 : 24,
|
|
63
|
+
bottom: showValueAxisLabels ? 34 : 18,
|
|
64
|
+
left: showCategoryAxisLabels ? 108 : 18,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
top: showLabels ? 28 : 16,
|
|
69
|
+
right: 18,
|
|
70
|
+
bottom: showCategoryAxisLabels ? 52 : 18,
|
|
71
|
+
left: showValueAxisLabels ? 52 : 18,
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
export const mergeChartMargin = (orientation, margin, showCategoryAxisLabels, showValueAxisLabels, showLabels) => {
|
|
75
|
+
var _a, _b, _c, _d;
|
|
76
|
+
const defaults = getDefaultMargin(orientation, showCategoryAxisLabels, showValueAxisLabels, showLabels);
|
|
77
|
+
return {
|
|
78
|
+
top: (_a = margin === null || margin === void 0 ? void 0 : margin.top) !== null && _a !== void 0 ? _a : defaults.top,
|
|
79
|
+
right: (_b = margin === null || margin === void 0 ? void 0 : margin.right) !== null && _b !== void 0 ? _b : defaults.right,
|
|
80
|
+
bottom: (_c = margin === null || margin === void 0 ? void 0 : margin.bottom) !== null && _c !== void 0 ? _c : defaults.bottom,
|
|
81
|
+
left: (_d = margin === null || margin === void 0 ? void 0 : margin.left) !== null && _d !== void 0 ? _d : defaults.left,
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
export const normalizeTickValue = (value) => Math.abs(value) < 1e-9 ? 0 : value;
|
|
85
|
+
export const getRoundedBarPath = ({ x, y, width, height, radius, orientation, value, }) => {
|
|
86
|
+
if (width <= 0 || height <= 0)
|
|
87
|
+
return "";
|
|
88
|
+
const safeRadius = clamp(radius, 0, Math.min(width, height) / 2);
|
|
89
|
+
const right = x + width;
|
|
90
|
+
const bottom = y + height;
|
|
91
|
+
if (safeRadius === 0) {
|
|
92
|
+
return `M ${x} ${y} H ${right} V ${bottom} H ${x} Z`;
|
|
93
|
+
}
|
|
94
|
+
if (orientation === "vertical") {
|
|
95
|
+
if (value >= 0) {
|
|
96
|
+
return [
|
|
97
|
+
`M ${x} ${bottom}`,
|
|
98
|
+
`L ${x} ${y + safeRadius}`,
|
|
99
|
+
`Q ${x} ${y} ${x + safeRadius} ${y}`,
|
|
100
|
+
`L ${right - safeRadius} ${y}`,
|
|
101
|
+
`Q ${right} ${y} ${right} ${y + safeRadius}`,
|
|
102
|
+
`L ${right} ${bottom}`,
|
|
103
|
+
"Z",
|
|
104
|
+
].join(" ");
|
|
105
|
+
}
|
|
106
|
+
return [
|
|
107
|
+
`M ${x} ${y}`,
|
|
108
|
+
`L ${x} ${bottom - safeRadius}`,
|
|
109
|
+
`Q ${x} ${bottom} ${x + safeRadius} ${bottom}`,
|
|
110
|
+
`L ${right - safeRadius} ${bottom}`,
|
|
111
|
+
`Q ${right} ${bottom} ${right} ${bottom - safeRadius}`,
|
|
112
|
+
`L ${right} ${y}`,
|
|
113
|
+
"Z",
|
|
114
|
+
].join(" ");
|
|
115
|
+
}
|
|
116
|
+
if (value >= 0) {
|
|
117
|
+
return [
|
|
118
|
+
`M ${x} ${y}`,
|
|
119
|
+
`L ${right - safeRadius} ${y}`,
|
|
120
|
+
`Q ${right} ${y} ${right} ${y + safeRadius}`,
|
|
121
|
+
`L ${right} ${bottom - safeRadius}`,
|
|
122
|
+
`Q ${right} ${bottom} ${right - safeRadius} ${bottom}`,
|
|
123
|
+
`L ${x} ${bottom}`,
|
|
124
|
+
"Z",
|
|
125
|
+
].join(" ");
|
|
126
|
+
}
|
|
127
|
+
return [
|
|
128
|
+
`M ${right} ${y}`,
|
|
129
|
+
`L ${x + safeRadius} ${y}`,
|
|
130
|
+
`Q ${x} ${y} ${x} ${y + safeRadius}`,
|
|
131
|
+
`L ${x} ${bottom - safeRadius}`,
|
|
132
|
+
`Q ${x} ${bottom} ${x + safeRadius} ${bottom}`,
|
|
133
|
+
`L ${right} ${bottom}`,
|
|
134
|
+
"Z",
|
|
135
|
+
].join(" ");
|
|
136
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { StyledChartActions } from "../ChartPrimitives";
|
|
2
|
+
export declare const StyledContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
3
|
+
export declare const StyledChartScroller: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
4
|
+
export declare const StyledChartFrame: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
5
|
+
export { StyledChartActions };
|
|
6
|
+
export declare const StyledSvg: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").SVGProps<SVGSVGElement>, never>> & string;
|
|
7
|
+
export declare const StyledBar: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").SVGProps<SVGPathElement>, {
|
|
8
|
+
$active: boolean;
|
|
9
|
+
}>> & string;
|
|
10
|
+
export declare const StyledGridLine: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").SVGLineElementAttributes<SVGLineElement>, never>> & string;
|
|
11
|
+
export declare const StyledAxisLine: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").SVGLineElementAttributes<SVGLineElement>, never>> & string;
|
|
12
|
+
export declare const StyledAxisText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").SVGTextElementAttributes<SVGTextElement>, never>> & string;
|
|
13
|
+
export declare const StyledValueLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").SVGTextElementAttributes<SVGTextElement>, never>> & string;
|
|
14
|
+
export declare const StyledLegend: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
15
|
+
export declare const StyledLegendItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
16
|
+
$active: boolean;
|
|
17
|
+
$showSwatch: boolean;
|
|
18
|
+
$showLabel: boolean;
|
|
19
|
+
$showValue: boolean;
|
|
20
|
+
}>> & string;
|
|
21
|
+
export declare const StyledSwatch: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
|
|
22
|
+
$color: string;
|
|
23
|
+
$width?: number;
|
|
24
|
+
$height?: number;
|
|
25
|
+
$radius?: number;
|
|
26
|
+
}>> & string;
|
|
27
|
+
export declare const StyledLegendLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
28
|
+
export declare const StyledLegendValue: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
29
|
+
export declare const StyledEmptyState: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
30
|
+
$width: number;
|
|
31
|
+
$height: number;
|
|
32
|
+
}>> & string;
|
|
33
|
+
export declare const StyledTooltip: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
34
|
+
$minWidth?: number;
|
|
35
|
+
$maxWidth?: number;
|
|
36
|
+
$transform?: string;
|
|
37
|
+
}>> & string;
|
|
38
|
+
export declare const StyledTooltipHeader: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
39
|
+
export declare const StyledTooltipSwatch: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
|
|
40
|
+
$color: string;
|
|
41
|
+
$radius?: string;
|
|
42
|
+
}>> & string;
|
|
43
|
+
export declare const StyledTooltipLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
44
|
+
export declare const StyledTooltipMeta: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$marginTop" | "$direction" | "$gap"> & {
|
|
45
|
+
$marginTop?: number;
|
|
46
|
+
$direction?: "row" | "column";
|
|
47
|
+
$gap?: number;
|
|
48
|
+
}, never>> & string;
|
|
49
|
+
export declare const StyledTooltipList: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
50
|
+
export declare const StyledTooltipRow: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
51
|
+
export declare const StyledTooltipValue: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { StyledChartActions, StyledChartLegend, StyledChartLegendLabel, StyledChartLegendSwatch, StyledChartLegendValue, StyledChartTooltip, StyledChartTooltipHeader, StyledChartTooltipLabel, StyledChartTooltipList, StyledChartTooltipMeta, StyledChartTooltipRow, StyledChartTooltipSwatch, StyledChartTooltipValue, sharedLegendItemStyles, } from "../ChartPrimitives";
|
|
3
|
+
const activeBarStyles = `
|
|
4
|
+
opacity: 0.98;
|
|
5
|
+
filter: brightness(1.1) saturate(1.08);
|
|
6
|
+
transform: scale(1.01);
|
|
7
|
+
`;
|
|
8
|
+
export const StyledContainer = styled.div `
|
|
9
|
+
position: relative;
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: flex-start;
|
|
12
|
+
flex-wrap: wrap;
|
|
13
|
+
gap: 20px;
|
|
14
|
+
width: fit-content;
|
|
15
|
+
max-width: 100%;
|
|
16
|
+
color: ${({ theme }) => theme.palette.text.primary};
|
|
17
|
+
box-sizing: border-box;
|
|
18
|
+
overflow: visible;
|
|
19
|
+
`;
|
|
20
|
+
export const StyledChartScroller = styled.div `
|
|
21
|
+
display: flex;
|
|
22
|
+
max-width: 100%;
|
|
23
|
+
overflow-x: auto;
|
|
24
|
+
overflow-y: visible;
|
|
25
|
+
padding-bottom: 2px;
|
|
26
|
+
`;
|
|
27
|
+
export const StyledChartFrame = styled.div `
|
|
28
|
+
position: relative;
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
gap: 0px;
|
|
32
|
+
flex: 0 0 auto;
|
|
33
|
+
`;
|
|
34
|
+
export { StyledChartActions };
|
|
35
|
+
export const StyledSvg = styled.svg `
|
|
36
|
+
display: block;
|
|
37
|
+
overflow: visible;
|
|
38
|
+
`;
|
|
39
|
+
export const StyledBar = styled.path `
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
outline: none;
|
|
42
|
+
transform-box: fill-box;
|
|
43
|
+
transform-origin: center;
|
|
44
|
+
transition:
|
|
45
|
+
opacity 0.18s ease,
|
|
46
|
+
filter 0.18s ease,
|
|
47
|
+
transform 0.18s ease;
|
|
48
|
+
|
|
49
|
+
&:hover,
|
|
50
|
+
&:focus-visible {
|
|
51
|
+
${activeBarStyles}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
${({ $active }) => $active && activeBarStyles}
|
|
55
|
+
`;
|
|
56
|
+
export const StyledGridLine = styled.line `
|
|
57
|
+
stroke: ${({ theme }) => theme.palette.divider};
|
|
58
|
+
stroke-opacity: 0.65;
|
|
59
|
+
stroke-dasharray: 3 4;
|
|
60
|
+
`;
|
|
61
|
+
export const StyledAxisLine = styled.line `
|
|
62
|
+
stroke: ${({ theme }) => theme.palette.divider};
|
|
63
|
+
stroke-width: 1;
|
|
64
|
+
`;
|
|
65
|
+
export const StyledAxisText = styled.text `
|
|
66
|
+
fill: ${({ theme }) => theme.palette.text.secondary};
|
|
67
|
+
font-size: 11px;
|
|
68
|
+
`;
|
|
69
|
+
export const StyledValueLabel = styled.text `
|
|
70
|
+
fill: ${({ theme }) => theme.palette.text.primary};
|
|
71
|
+
font-size: 11px;
|
|
72
|
+
font-weight: 600;
|
|
73
|
+
pointer-events: none;
|
|
74
|
+
`;
|
|
75
|
+
export const StyledLegend = StyledChartLegend;
|
|
76
|
+
export const StyledLegendItem = styled.div `
|
|
77
|
+
display: grid;
|
|
78
|
+
grid-template-columns: ${({ $showSwatch, $showLabel, $showValue }) => [
|
|
79
|
+
$showSwatch ? "4px" : null,
|
|
80
|
+
$showLabel ? "minmax(0, 1fr)" : null,
|
|
81
|
+
$showValue ? "auto" : null,
|
|
82
|
+
]
|
|
83
|
+
.filter(Boolean)
|
|
84
|
+
.join(" ")};
|
|
85
|
+
${sharedLegendItemStyles}
|
|
86
|
+
`;
|
|
87
|
+
export const StyledSwatch = StyledChartLegendSwatch;
|
|
88
|
+
export const StyledLegendLabel = StyledChartLegendLabel;
|
|
89
|
+
export const StyledLegendValue = StyledChartLegendValue;
|
|
90
|
+
export const StyledEmptyState = styled.div `
|
|
91
|
+
display: flex;
|
|
92
|
+
align-items: center;
|
|
93
|
+
justify-content: center;
|
|
94
|
+
width: ${({ $width }) => $width}px;
|
|
95
|
+
height: ${({ $height }) => $height}px;
|
|
96
|
+
border: 1px dashed ${({ theme }) => theme.palette.divider};
|
|
97
|
+
border-radius: 8px;
|
|
98
|
+
background: linear-gradient(
|
|
99
|
+
180deg,
|
|
100
|
+
${({ theme }) => theme.palette.background.paper} 0%,
|
|
101
|
+
${({ theme }) => theme.palette.background.secondary} 100%
|
|
102
|
+
);
|
|
103
|
+
font-size: 12px;
|
|
104
|
+
color: ${({ theme }) => theme.palette.text.secondary};
|
|
105
|
+
`;
|
|
106
|
+
export const StyledTooltip = StyledChartTooltip;
|
|
107
|
+
export const StyledTooltipHeader = StyledChartTooltipHeader;
|
|
108
|
+
export const StyledTooltipSwatch = StyledChartTooltipSwatch;
|
|
109
|
+
export const StyledTooltipLabel = StyledChartTooltipLabel;
|
|
110
|
+
export const StyledTooltipMeta = styled(StyledChartTooltipMeta) `
|
|
111
|
+
display: block;
|
|
112
|
+
`;
|
|
113
|
+
export const StyledTooltipList = StyledChartTooltipList;
|
|
114
|
+
export const StyledTooltipRow = StyledChartTooltipRow;
|
|
115
|
+
export const StyledTooltipValue = StyledChartTooltipValue;
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import React, { HTMLAttributes } from "react";
|
|
2
|
+
import type { ChartExportOptions } from "../ChartUtils";
|
|
3
|
+
export type BarChartDatum<TData = unknown> = {
|
|
4
|
+
/** Stable identifier for the bar. Falls back to label and index when omitted. */
|
|
5
|
+
id?: string | number;
|
|
6
|
+
/** Display label used for axes, labels, legends, tooltips, and accessibility text. */
|
|
7
|
+
label: string;
|
|
8
|
+
/** Numeric value rendered by the bar. Zero and negative values are supported. */
|
|
9
|
+
value: number;
|
|
10
|
+
/** Optional per-bar color. Takes precedence over colorGradient, colors, and theme colors. */
|
|
11
|
+
color?: string;
|
|
12
|
+
/** Optional contextual payload returned in click callbacks and formatter functions. */
|
|
13
|
+
data?: TData;
|
|
14
|
+
};
|
|
15
|
+
export type BarChartSeries<TData = unknown> = {
|
|
16
|
+
/** Stable identifier for the series. Falls back to its label and index when omitted. */
|
|
17
|
+
id?: string | number;
|
|
18
|
+
/** Display label used in legends, tooltips, and accessibility text. */
|
|
19
|
+
label: React.ReactNode;
|
|
20
|
+
/** Optional per-series color. Takes precedence over colors, colorGradient, and theme colors. */
|
|
21
|
+
color?: string;
|
|
22
|
+
/** Optional gradient used to resolve this series color when no per-datum color is provided. */
|
|
23
|
+
colorGradient?: BarChartColorGradient;
|
|
24
|
+
/** Values rendered for this series. Categories are matched by datum label. */
|
|
25
|
+
data: BarChartDatum<TData>[];
|
|
26
|
+
};
|
|
27
|
+
export type BarChartColorGradient =
|
|
28
|
+
/** Ordered color stops used to generate bar colors across a gradient scale. */
|
|
29
|
+
string[]
|
|
30
|
+
/** Two-color gradient range used to generate bar colors from start to end. */
|
|
31
|
+
| {
|
|
32
|
+
/** Starting color for generated bar colors. */
|
|
33
|
+
from: string;
|
|
34
|
+
/** Ending color for generated bar colors. */
|
|
35
|
+
to: string;
|
|
36
|
+
};
|
|
37
|
+
export type BarChartOrientation = "vertical" | "horizontal";
|
|
38
|
+
export type BarChartSeriesLayout = "grouped" | "stacked";
|
|
39
|
+
export type BarChartMargin = {
|
|
40
|
+
top: number;
|
|
41
|
+
right: number;
|
|
42
|
+
bottom: number;
|
|
43
|
+
left: number;
|
|
44
|
+
};
|
|
45
|
+
export type ResolvedBar<TData = unknown> = BarChartDatum<TData> & {
|
|
46
|
+
key: string | number;
|
|
47
|
+
keyString: string;
|
|
48
|
+
color: string;
|
|
49
|
+
index: number;
|
|
50
|
+
renderIndex: number;
|
|
51
|
+
seriesKey: string | number;
|
|
52
|
+
seriesIndex: number;
|
|
53
|
+
seriesLabel: React.ReactNode;
|
|
54
|
+
seriesLabelText: string;
|
|
55
|
+
categoryKey: string;
|
|
56
|
+
categoryLabel: string;
|
|
57
|
+
valueStart: number;
|
|
58
|
+
valueEnd: number;
|
|
59
|
+
sourceSeries?: BarChartSeries<TData>;
|
|
60
|
+
};
|
|
61
|
+
export type ResolvedBarSeries<TData = unknown> = {
|
|
62
|
+
key: string | number;
|
|
63
|
+
label: React.ReactNode;
|
|
64
|
+
labelText: string;
|
|
65
|
+
color: string;
|
|
66
|
+
index: number;
|
|
67
|
+
totalValue: number;
|
|
68
|
+
sourceSeries?: BarChartSeries<TData>;
|
|
69
|
+
};
|
|
70
|
+
export type ResolvedBarCategory<TData = unknown> = {
|
|
71
|
+
key: string;
|
|
72
|
+
label: string;
|
|
73
|
+
index: number;
|
|
74
|
+
representativeDatum: BarChartDatum<TData>;
|
|
75
|
+
bars: ResolvedBar<TData>[];
|
|
76
|
+
positiveTotal: number;
|
|
77
|
+
negativeTotal: number;
|
|
78
|
+
};
|
|
79
|
+
export type ActiveTooltip = {
|
|
80
|
+
barKey: string | number;
|
|
81
|
+
x: number;
|
|
82
|
+
y: number;
|
|
83
|
+
};
|
|
84
|
+
export type BarChartProps<TData = unknown> = HTMLAttributes<HTMLDivElement> & ChartExportOptions & {
|
|
85
|
+
/** Single-series bar data. Ignored when series is provided. */
|
|
86
|
+
data?: BarChartDatum<TData>[];
|
|
87
|
+
/** Multi-series bar data. Takes precedence over data when provided. */
|
|
88
|
+
series?: BarChartSeries<TData>[];
|
|
89
|
+
/** SVG width in pixels. Defaults to 640. */
|
|
90
|
+
width?: number;
|
|
91
|
+
/** SVG height in pixels. Defaults to 320. */
|
|
92
|
+
height?: number;
|
|
93
|
+
/** Bar layout direction. Defaults to "vertical". */
|
|
94
|
+
orientation?: BarChartOrientation;
|
|
95
|
+
/** Multi-series layout mode. Defaults to "grouped". */
|
|
96
|
+
seriesLayout?: BarChartSeriesLayout;
|
|
97
|
+
/** Partial chart margin overrides. Defaults are based on orientation and visible labels. */
|
|
98
|
+
margin?: Partial<BarChartMargin>;
|
|
99
|
+
/** Gap between bars in pixels. Defaults to 10. */
|
|
100
|
+
barGap?: number;
|
|
101
|
+
/** Gap between bars within each grouped category. Defaults to barGap. */
|
|
102
|
+
groupBarGap?: number;
|
|
103
|
+
/** Maximum bar thickness in pixels before bars are centered within their band. */
|
|
104
|
+
maxBarThickness?: number;
|
|
105
|
+
/** Bar corner radius in pixels. Defaults to 3. */
|
|
106
|
+
barRadius?: number;
|
|
107
|
+
/** Categorical color palette for bars. Used after per-bar colors and colorGradient. */
|
|
108
|
+
colors?: string[];
|
|
109
|
+
/** Generates bar colors along a gradient scale. Per-bar color values still take precedence. */
|
|
110
|
+
colorGradient?: BarChartColorGradient;
|
|
111
|
+
/** Opacity applied to bar fills. Clamped between 0 and 1. Defaults to 1. */
|
|
112
|
+
barOpacity?: number;
|
|
113
|
+
/** Stroke color around each bar. Defaults to the theme divider color. */
|
|
114
|
+
barBorderColor?: string;
|
|
115
|
+
/** Stroke width around each bar in pixels. Defaults to 1. */
|
|
116
|
+
barBorderWidth?: number;
|
|
117
|
+
/** Stroke opacity around each bar. Clamped between 0 and 1. Defaults to 1. */
|
|
118
|
+
barBorderOpacity?: number;
|
|
119
|
+
/** Minimum domain value used for the value axis. Zero is always included. */
|
|
120
|
+
minValue?: number;
|
|
121
|
+
/** Maximum domain value used for the value axis. Zero is always included. */
|
|
122
|
+
maxValue?: number;
|
|
123
|
+
/** Approximate number of value-axis ticks. Defaults to 5. */
|
|
124
|
+
valueTickCount?: number;
|
|
125
|
+
/** Shows or hides value-axis grid lines. Defaults to true. */
|
|
126
|
+
showGridLines?: boolean;
|
|
127
|
+
/** Shows or hides axis lines. Defaults to true. */
|
|
128
|
+
showAxisLines?: boolean;
|
|
129
|
+
/** Shows or hides category-axis labels. Defaults to true. */
|
|
130
|
+
showCategoryAxisLabels?: boolean;
|
|
131
|
+
/** Shows or hides value-axis labels. Defaults to true. */
|
|
132
|
+
showValueAxisLabels?: boolean;
|
|
133
|
+
/** Shows or hides legend items. Defaults to false. */
|
|
134
|
+
showLegend?: boolean;
|
|
135
|
+
/** Shows or hides legend color swatches. Defaults to true. */
|
|
136
|
+
showLegendSwatches?: boolean;
|
|
137
|
+
/** Shows or hides legend labels. Defaults to true. */
|
|
138
|
+
showLegendLabels?: boolean;
|
|
139
|
+
/** Shows or hides legend formatted values. Defaults to true. */
|
|
140
|
+
showLegendValues?: boolean;
|
|
141
|
+
/** Shows or hides formatted value labels near bars. Defaults to false. */
|
|
142
|
+
showLabels?: boolean;
|
|
143
|
+
/** Content shown when no valid numeric data values are available. Defaults to "No data". */
|
|
144
|
+
emptyLabel?: React.ReactNode;
|
|
145
|
+
/** Accessible label for the SVG chart image. Defaults to "Bar chart". */
|
|
146
|
+
ariaLabel?: string;
|
|
147
|
+
/** Animates bars on initial render from the zero baseline. Defaults to false. */
|
|
148
|
+
animateOnRender?: boolean;
|
|
149
|
+
/** Duration in milliseconds for each bar animation. Defaults to 520. */
|
|
150
|
+
animationDuration?: number;
|
|
151
|
+
/** Delay in milliseconds between each bar animation. Defaults to 35. */
|
|
152
|
+
animationStagger?: number;
|
|
153
|
+
/** Shows a custom themed tooltip when hovering over bars. Defaults to false. */
|
|
154
|
+
showTooltips?: boolean;
|
|
155
|
+
/** Formats values shown in labels, legends, tooltips, and accessibility text. */
|
|
156
|
+
valueFormatter?: (value: number, datum: BarChartDatum<TData>, series?: BarChartSeries<TData>) => React.ReactNode;
|
|
157
|
+
/** Formats category labels shown on the category axis. */
|
|
158
|
+
categoryLabelFormatter?: (datum: BarChartDatum<TData>, index: number, series?: BarChartSeries<TData>) => React.ReactNode;
|
|
159
|
+
/** Formats value-axis tick labels. */
|
|
160
|
+
tickFormatter?: (value: number) => React.ReactNode;
|
|
161
|
+
/** Formats labels rendered near bars. */
|
|
162
|
+
labelFormatter?: (datum: BarChartDatum<TData>, index: number, series?: BarChartSeries<TData>) => React.ReactNode;
|
|
163
|
+
/** Custom tooltip renderer. Receives the original datum and its index. */
|
|
164
|
+
tooltipFormatter?: (datum: BarChartDatum<TData>, index: number, series?: BarChartSeries<TData>) => React.ReactNode;
|
|
165
|
+
/** Called when a bar is clicked or activated with Enter/Space. */
|
|
166
|
+
onBarClick?: (event: React.MouseEvent<SVGPathElement> | React.KeyboardEvent<SVGPathElement>, datum: BarChartDatum<TData>, series?: BarChartSeries<TData>) => void;
|
|
167
|
+
/** Called when a single-series legend item is clicked or activated with Enter/Space. */
|
|
168
|
+
onLegendItemClick?: (event: React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement>, datum: BarChartDatum<TData>) => void;
|
|
169
|
+
/** Called when a multi-series legend item is clicked or activated with Enter/Space. */
|
|
170
|
+
onSeriesLegendItemClick?: (event: React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement>, series: BarChartSeries<TData>) => void;
|
|
171
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React, { RefObject } from "react";
|
|
2
|
+
import { ChartExportFormat } from "../ChartUtils";
|
|
3
|
+
export type ChartExportControlProps = {
|
|
4
|
+
rootRef?: RefObject<HTMLElement | null>;
|
|
5
|
+
svgRef: RefObject<SVGSVGElement | null>;
|
|
6
|
+
fileName: string;
|
|
7
|
+
formats: ChartExportFormat[];
|
|
8
|
+
scale?: number;
|
|
9
|
+
backgroundColor?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const ChartExportControl: React.FC<ChartExportControlProps>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { DownloadIcon } from "lucide-react";
|
|
3
|
+
import { DropDownMenu } from "../../DropDownMenu";
|
|
4
|
+
import { downloadChartImage } from "../ChartUtils";
|
|
5
|
+
const EXPORT_LABELS = {
|
|
6
|
+
svg: "Download SVG",
|
|
7
|
+
png: "Download PNG",
|
|
8
|
+
jpg: "Download JPG",
|
|
9
|
+
};
|
|
10
|
+
export const ChartExportControl = ({ rootRef, svgRef, fileName, formats, scale, backgroundColor, }) => {
|
|
11
|
+
const exportItems = formats.map((format) => ({
|
|
12
|
+
label: EXPORT_LABELS[format],
|
|
13
|
+
value: format,
|
|
14
|
+
}));
|
|
15
|
+
return (_jsx(DropDownMenu, { data: exportItems, variant: "outlined", size: "xs", arrow: true, buttonProps: {
|
|
16
|
+
title: "Download chart image",
|
|
17
|
+
size: "xxs",
|
|
18
|
+
style: { padding: "0px 4px" },
|
|
19
|
+
}, dropDownProps: {
|
|
20
|
+
style: { width: 168, maxWidth: 220 },
|
|
21
|
+
}, onItemSelect: (item) => void downloadChartImage({
|
|
22
|
+
rootElement: rootRef === null || rootRef === void 0 ? void 0 : rootRef.current,
|
|
23
|
+
svg: svgRef.current,
|
|
24
|
+
format: item.value,
|
|
25
|
+
fileName,
|
|
26
|
+
scale,
|
|
27
|
+
backgroundColor,
|
|
28
|
+
}), children: _jsx(DownloadIcon, { size: 14 }) }));
|
|
29
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const StyledChartActions: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const StyledChartLegend: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
2
|
+
export declare const sharedLegendItemStyles: import("styled-components").RuleSet<{
|
|
3
|
+
$active: boolean;
|
|
4
|
+
}>;
|
|
5
|
+
export declare const StyledChartLegendLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
6
|
+
export declare const StyledChartLegendValue: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
7
|
+
export declare const StyledChartLegendSwatch: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
|
|
8
|
+
$color: string;
|
|
9
|
+
$width?: number;
|
|
10
|
+
$height?: number;
|
|
11
|
+
$radius?: number;
|
|
12
|
+
}>> & string;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import styled, { css } from "styled-components";
|
|
2
|
+
export const StyledChartLegend = styled.div `
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
min-width: 168px;
|
|
6
|
+
max-width: 280px;
|
|
7
|
+
gap: 6px;
|
|
8
|
+
`;
|
|
9
|
+
export const sharedLegendItemStyles = css `
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
user-select: none;
|
|
12
|
+
align-items: center;
|
|
13
|
+
gap: 10px;
|
|
14
|
+
min-height: 30px;
|
|
15
|
+
padding: 5px 7px;
|
|
16
|
+
border: 1px solid transparent;
|
|
17
|
+
border-radius: 4px;
|
|
18
|
+
font-size: 12px;
|
|
19
|
+
transition:
|
|
20
|
+
background-color 0.16s ease,
|
|
21
|
+
border-color 0.16s ease;
|
|
22
|
+
|
|
23
|
+
&:hover,
|
|
24
|
+
&:focus-visible {
|
|
25
|
+
border-color: ${({ theme }) => theme.palette.divider};
|
|
26
|
+
background-color: ${({ theme }) => theme.palette.action.hover};
|
|
27
|
+
outline: none;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
${({ $active, theme }) => $active &&
|
|
31
|
+
`
|
|
32
|
+
border-color: ${theme.palette.divider};
|
|
33
|
+
background-color: ${theme.palette.action.hover};
|
|
34
|
+
`}
|
|
35
|
+
`;
|
|
36
|
+
export const StyledChartLegendLabel = styled.span `
|
|
37
|
+
overflow: hidden;
|
|
38
|
+
text-overflow: ellipsis;
|
|
39
|
+
white-space: nowrap;
|
|
40
|
+
color: ${({ theme }) => theme.palette.text.primary};
|
|
41
|
+
`;
|
|
42
|
+
export const StyledChartLegendValue = styled.span `
|
|
43
|
+
font-variant-numeric: tabular-nums;
|
|
44
|
+
color: ${({ theme }) => theme.palette.text.secondary};
|
|
45
|
+
white-space: nowrap;
|
|
46
|
+
`;
|
|
47
|
+
export const StyledChartLegendSwatch = styled.span `
|
|
48
|
+
width: ${({ $width = 4 }) => $width}px;
|
|
49
|
+
height: ${({ $height = 22 }) => $height}px;
|
|
50
|
+
border-radius: ${({ $radius = 2 }) => $radius}px;
|
|
51
|
+
background: ${({ $color }) => $color};
|
|
52
|
+
`;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const StyledChartTooltip: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
2
|
+
$minWidth?: number;
|
|
3
|
+
$maxWidth?: number;
|
|
4
|
+
$transform?: string;
|
|
5
|
+
}>> & string;
|
|
6
|
+
export declare const StyledChartTooltipHeader: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
7
|
+
export declare const StyledChartTooltipSwatch: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
|
|
8
|
+
$color: string;
|
|
9
|
+
$radius?: string;
|
|
10
|
+
}>> & string;
|
|
11
|
+
export declare const StyledChartTooltipLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
12
|
+
export declare const StyledChartTooltipMeta: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
13
|
+
$marginTop?: number;
|
|
14
|
+
$direction?: "row" | "column";
|
|
15
|
+
$gap?: number;
|
|
16
|
+
}>> & string;
|
|
17
|
+
export declare const StyledChartTooltipList: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
18
|
+
export declare const StyledChartTooltipRow: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
19
|
+
export declare const StyledChartTooltipValue: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|