@appcorp/shadcn 1.1.9 → 1.1.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.
|
@@ -12,7 +12,8 @@ export interface AreaChartV1Props {
|
|
|
12
12
|
label: string;
|
|
13
13
|
value: string;
|
|
14
14
|
}[];
|
|
15
|
+
locale?: string;
|
|
15
16
|
onSelectorChange: (value: string) => void;
|
|
16
17
|
}
|
|
17
|
-
export declare const AreaChartV1: ({ dates, description, legends, title, selectors, onSelectorChange, }: AreaChartV1Props) => React.JSX.Element;
|
|
18
|
+
export declare const AreaChartV1: ({ dates, description, legends, title, selectors, locale, onSelectorChange, }: AreaChartV1Props) => React.JSX.Element;
|
|
18
19
|
export {};
|
|
@@ -51,8 +51,8 @@ var createChartConfig = function (legends) {
|
|
|
51
51
|
}, {});
|
|
52
52
|
};
|
|
53
53
|
var AreaChartV1 = function (_a) {
|
|
54
|
-
var dates = _a.dates, description = _a.description, legends = _a.legends, title = _a.title, selectors = _a.selectors, onSelectorChange = _a.onSelectorChange;
|
|
55
|
-
var
|
|
54
|
+
var dates = _a.dates, description = _a.description, legends = _a.legends, title = _a.title, selectors = _a.selectors, _b = _a.locale, locale = _b === void 0 ? "en-US" : _b, onSelectorChange = _a.onSelectorChange;
|
|
55
|
+
var _c = React.useState("30d"), timeRange = _c[0], setTimeRange = _c[1];
|
|
56
56
|
var dynamicChartConfig = createChartConfig(legends);
|
|
57
57
|
var handleValueChange = function (value) {
|
|
58
58
|
setTimeRange(value);
|
|
@@ -93,13 +93,13 @@ var AreaChartV1 = function (_a) {
|
|
|
93
93
|
React.createElement(recharts_1.CartesianGrid, { vertical: false }),
|
|
94
94
|
React.createElement(recharts_1.XAxis, { dataKey: "date", tickLine: false, axisLine: false, tickMargin: 8, minTickGap: 32, tickFormatter: function (value) {
|
|
95
95
|
var date = new Date(value);
|
|
96
|
-
return date.toLocaleDateString(
|
|
96
|
+
return date.toLocaleDateString(locale, {
|
|
97
97
|
month: "short",
|
|
98
98
|
day: "numeric",
|
|
99
99
|
});
|
|
100
100
|
} }),
|
|
101
101
|
React.createElement(chart_1.ChartTooltip, { cursor: false, content: React.createElement(chart_1.ChartTooltipContent, { labelFormatter: function (value) {
|
|
102
|
-
return new Date(value).toLocaleDateString(
|
|
102
|
+
return new Date(value).toLocaleDateString(locale, {
|
|
103
103
|
month: "short",
|
|
104
104
|
day: "numeric",
|
|
105
105
|
});
|