@rafal.lemieszewski/tide-ui 0.83.0 → 0.84.2
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/README.md +20 -8
- package/dist/cjs/components/fundamental/accordion.cjs +1 -0
- package/dist/cjs/components/fundamental/alert-dialog.cjs +1 -0
- package/dist/cjs/components/fundamental/alert.cjs +1 -0
- package/dist/cjs/components/fundamental/autocomplete-search.cjs +1 -0
- package/dist/cjs/components/fundamental/avatar-group.cjs +1 -0
- package/dist/cjs/components/fundamental/avatar.cjs +1 -0
- package/dist/cjs/components/fundamental/badge.cjs +1 -0
- package/dist/cjs/components/fundamental/breadcrumb.cjs +1 -0
- package/dist/cjs/components/fundamental/button-group.cjs +1 -0
- package/dist/cjs/components/fundamental/button.cjs +1 -0
- package/dist/cjs/components/fundamental/calendar.cjs +1 -0
- package/dist/cjs/components/fundamental/card.cjs +1 -0
- package/dist/cjs/components/fundamental/chart.cjs +1 -0
- package/dist/cjs/components/fundamental/checkbox.cjs +1 -0
- package/dist/cjs/components/fundamental/collapsible.cjs +1 -0
- package/dist/cjs/components/fundamental/combobox.cjs +1 -0
- package/dist/cjs/components/fundamental/command.cjs +1 -0
- package/dist/cjs/components/fundamental/country-dropdown.cjs +1 -0
- package/dist/cjs/components/fundamental/custom-icons.cjs +1 -0
- package/dist/cjs/components/fundamental/date-picker.cjs +1 -0
- package/dist/cjs/components/fundamental/dialog.cjs +1 -0
- package/dist/cjs/components/fundamental/drawer.cjs +1 -0
- package/dist/cjs/components/fundamental/dropdown-menu.cjs +1 -0
- package/dist/cjs/components/fundamental/editable.cjs +1 -0
- package/dist/cjs/components/fundamental/empty.cjs +1 -0
- package/dist/cjs/components/fundamental/file-upload.cjs +1 -0
- package/dist/cjs/components/fundamental/flag.cjs +1 -0
- package/dist/cjs/components/fundamental/form-field.cjs +1 -0
- package/dist/cjs/components/fundamental/hover-card.cjs +1 -0
- package/dist/cjs/components/fundamental/icon.cjs +1 -0
- package/dist/cjs/components/fundamental/input-group.cjs +1 -0
- package/dist/cjs/components/fundamental/input.cjs +1 -0
- package/dist/cjs/components/fundamental/kbd.cjs +1 -0
- package/dist/cjs/components/fundamental/label.cjs +1 -0
- package/dist/cjs/components/fundamental/month-picker.cjs +1 -0
- package/dist/cjs/components/fundamental/pagination.cjs +1 -0
- package/dist/cjs/components/fundamental/popover.cjs +1 -0
- package/dist/cjs/components/fundamental/progress.cjs +1 -0
- package/dist/cjs/components/fundamental/radio-group.cjs +1 -0
- package/dist/cjs/components/fundamental/resizable.cjs +1 -0
- package/dist/cjs/components/fundamental/scroll-area.cjs +1 -0
- package/dist/cjs/components/fundamental/select.cjs +1 -0
- package/dist/cjs/components/fundamental/separator.cjs +1 -0
- package/dist/cjs/components/fundamental/sheet.cjs +1 -0
- package/dist/cjs/components/fundamental/sidebar.cjs +1 -0
- package/dist/cjs/components/fundamental/skeleton.cjs +1 -0
- package/dist/cjs/components/fundamental/slider.cjs +1 -0
- package/dist/cjs/components/fundamental/spinner.cjs +1 -0
- package/dist/cjs/components/fundamental/switch.cjs +1 -0
- package/dist/cjs/components/fundamental/table.cjs +1 -0
- package/dist/cjs/components/fundamental/tabs.cjs +1 -0
- package/dist/cjs/components/fundamental/tag.cjs +27 -0
- package/dist/cjs/components/fundamental/text-link.cjs +1 -0
- package/dist/cjs/components/fundamental/textarea.cjs +1 -0
- package/dist/cjs/components/fundamental/toast.cjs +1 -0
- package/dist/cjs/components/fundamental/toggle-group.cjs +1 -0
- package/dist/cjs/components/fundamental/toggle.cjs +1 -0
- package/dist/cjs/components/fundamental/tooltip.cjs +1 -0
- package/dist/cjs/components/fundamental/tree.cjs +1 -0
- package/dist/cjs/components/index.cjs +1 -0
- package/dist/cjs/components/product/activity-log.cjs +1 -0
- package/dist/cjs/components/product/app-frame.cjs +1 -0
- package/dist/cjs/components/product/attributes-list.cjs +1 -0
- package/dist/cjs/components/product/bookmarks.cjs +1 -0
- package/dist/cjs/components/product/data-table-settings-menu.cjs +1 -0
- package/dist/cjs/components/product/data-table.cjs +1 -0
- package/dist/cjs/components/product/filters.cjs +1 -0
- package/dist/cjs/components/product/fixture-status.cjs +1 -0
- package/dist/cjs/components/product/linked-chart.cjs +1 -0
- package/dist/cjs/components/product/view-mode-menu.cjs +1 -0
- package/dist/cjs/lib/date-utils.cjs +1 -0
- package/dist/cjs/lib/hooks.cjs +1 -0
- package/dist/cjs/lib/index.cjs +1 -0
- package/dist/cjs/lib/utils.cjs +1 -0
- package/dist/es/components/fundamental/accordion.js +60 -0
- package/dist/es/components/fundamental/alert-dialog.js +116 -0
- package/dist/es/components/fundamental/alert.js +65 -0
- package/dist/es/components/fundamental/autocomplete-search.js +139 -0
- package/dist/es/components/fundamental/avatar-group.js +51 -0
- package/dist/es/components/fundamental/avatar.js +165 -0
- package/dist/es/components/fundamental/badge.js +157 -0
- package/dist/es/components/fundamental/breadcrumb.js +142 -0
- package/dist/es/components/fundamental/button-group.js +86 -0
- package/dist/es/components/fundamental/button.js +186 -0
- package/dist/es/components/fundamental/calendar.js +130 -0
- package/dist/es/components/fundamental/card.js +68 -0
- package/dist/es/components/fundamental/chart.js +1006 -0
- package/dist/es/components/fundamental/checkbox.js +51 -0
- package/dist/es/components/fundamental/collapsible.js +55 -0
- package/dist/es/components/fundamental/combobox.js +229 -0
- package/dist/es/components/fundamental/command.js +155 -0
- package/dist/es/components/fundamental/country-dropdown.js +215 -0
- package/dist/es/components/fundamental/custom-icons.js +876 -0
- package/dist/es/components/fundamental/date-picker.js +119 -0
- package/dist/es/components/fundamental/dialog.js +106 -0
- package/dist/es/components/fundamental/drawer.js +93 -0
- package/dist/es/components/fundamental/dropdown-menu.js +600 -0
- package/dist/es/components/fundamental/editable.js +123 -0
- package/dist/es/components/fundamental/empty.js +152 -0
- package/dist/es/components/fundamental/file-upload.js +289 -0
- package/dist/es/components/fundamental/flag.js +60 -0
- package/dist/es/components/fundamental/form-field.js +352 -0
- package/dist/es/components/fundamental/hover-card.js +23 -0
- package/dist/es/components/fundamental/icon.js +205 -0
- package/dist/es/components/fundamental/input-group.js +135 -0
- package/dist/es/components/fundamental/input.js +78 -0
- package/dist/es/components/fundamental/kbd.js +57 -0
- package/dist/es/components/fundamental/label.js +54 -0
- package/dist/es/components/fundamental/month-picker.js +161 -0
- package/dist/es/components/fundamental/pagination.js +109 -0
- package/dist/es/components/fundamental/popover.js +24 -0
- package/dist/es/components/fundamental/progress.js +66 -0
- package/dist/es/components/fundamental/radio-group.js +64 -0
- package/dist/es/components/fundamental/resizable.js +43 -0
- package/dist/es/components/fundamental/scroll-area.js +38 -0
- package/dist/es/components/fundamental/select.js +136 -0
- package/dist/es/components/fundamental/separator.js +47 -0
- package/dist/es/components/fundamental/sheet.js +134 -0
- package/dist/es/components/fundamental/sidebar.js +709 -0
- package/dist/es/components/fundamental/skeleton.js +158 -0
- package/dist/es/components/fundamental/slider.js +35 -0
- package/dist/es/components/fundamental/spinner.js +225 -0
- package/dist/es/components/fundamental/switch.js +27 -0
- package/dist/es/components/fundamental/table.js +263 -0
- package/dist/es/components/fundamental/tabs.js +170 -0
- package/dist/es/components/fundamental/tag.js +295 -0
- package/dist/es/components/fundamental/text-link.js +105 -0
- package/dist/es/components/fundamental/textarea.js +47 -0
- package/dist/es/components/fundamental/toast.js +108 -0
- package/dist/es/components/fundamental/toggle-group.js +37 -0
- package/dist/es/components/fundamental/toggle.js +51 -0
- package/dist/es/components/fundamental/tooltip.js +26 -0
- package/dist/es/components/fundamental/tree.js +161 -0
- package/dist/es/components/index.js +37 -0
- package/dist/es/components/product/activity-log.js +231 -0
- package/dist/es/components/product/app-frame.js +985 -0
- package/dist/es/components/product/attributes-list.js +351 -0
- package/dist/es/components/product/bookmarks.js +833 -0
- package/dist/es/components/product/data-table-settings-menu.js +169 -0
- package/dist/es/components/product/data-table.js +2459 -0
- package/dist/es/components/product/filters.js +1041 -0
- package/dist/es/components/product/fixture-status.js +178 -0
- package/dist/es/components/product/linked-chart.js +179 -0
- package/dist/es/components/product/view-mode-menu.js +353 -0
- package/dist/es/lib/date-utils.js +151 -0
- package/dist/es/lib/hooks.js +29 -0
- package/dist/es/lib/index.js +388 -0
- package/dist/es/lib/utils.js +8 -0
- package/dist/es/style.css +1 -0
- package/dist/{components → types/components}/fundamental/button-group.d.ts +1 -1
- package/dist/{components → types/components}/fundamental/button.d.ts +1 -1
- package/dist/{components → types/components}/fundamental/command.d.ts +1 -1
- package/dist/{components → types/components}/fundamental/file-upload.d.ts +1 -1
- package/dist/{components → types/components}/fundamental/form-field.d.ts +1 -1
- package/dist/{components → types/components}/fundamental/form.d.ts +2 -2
- package/dist/{components → types/components}/fundamental/icon.d.ts +1 -1
- package/dist/{components → types/components}/fundamental/input-group.d.ts +1 -1
- package/dist/{components → types/components}/fundamental/sidebar.d.ts +3 -3
- package/dist/{components → types/components}/fundamental/text-link.d.ts +1 -1
- package/dist/{components → types/components}/index.d.ts +118 -118
- package/dist/{components → types/components}/product/activity-log.d.ts +1 -1
- package/dist/{components → types/components}/product/attributes-list.d.ts +1 -1
- package/dist/{components → types/components}/product/bookmarks.d.ts +1 -1
- package/dist/{components → types/components}/product/fixture-status.d.ts +1 -1
- package/dist/{components → types/components}/product/linked-chart.d.ts +1 -1
- package/dist/types/lib/index.d.cts +3 -0
- package/dist/types/lib/index.d.ts +3 -0
- package/package.json +111 -33
- package/dist/index.cjs.js +0 -144
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.es.js +0 -87768
- package/dist/index.es.js.map +0 -1
- package/dist/lib/index.d.ts +0 -3
- package/dist/style.css +0 -1
- /package/dist/{components → types/components}/fundamental/accordion.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/alert-dialog.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/alert.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/autocomplete-search.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/avatar-group.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/avatar.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/badge.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/breadcrumb.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/button.test.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/calendar.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/card.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/chart.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/checkbox.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/collapsible.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/combobox.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/country-dropdown.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/custom-icons.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/date-picker.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/dialog.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/drawer.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/dropdown-menu.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/editable.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/empty.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/flag.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/hover-card.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/input.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/kbd.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/label.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/month-picker.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/pagination.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/popover.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/progress.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/radio-group.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/resizable.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/scroll-area.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/select.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/separator.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/sheet.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/skeleton.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/slider.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/spinner.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/switch.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/table.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/tabs.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/tag.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/textarea.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/toast.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/toggle-group.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/toggle.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/tooltip.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/tree.d.ts +0 -0
- /package/dist/{components → types/components}/product/app-frame.d.ts +0 -0
- /package/dist/{components → types/components}/product/data-table-settings-menu.d.ts +0 -0
- /package/dist/{components → types/components}/product/data-table.d.ts +0 -0
- /package/dist/{components → types/components}/product/filters.d.ts +0 -0
- /package/dist/{components → types/components}/product/view-mode-menu.d.ts +0 -0
- /package/dist/{lib → types/lib}/date-utils.d.ts +0 -0
- /package/dist/{lib → types/lib}/hooks.d.ts +0 -0
- /package/dist/{lib → types/lib}/utils.d.ts +0 -0
|
@@ -0,0 +1,1006 @@
|
|
|
1
|
+
import { jsxs as m, jsx as e, Fragment as Er } from "react/jsx-runtime";
|
|
2
|
+
import lr, { useState as Pr, useMemo as z, useCallback as mr } from "react";
|
|
3
|
+
import { ResponsiveContainer as Tr, ComposedChart as Br, CartesianGrid as U, XAxis as X, YAxis as $, Tooltip as J, Legend as Q, Bar as pr, Area as gr, Line as wr, ScatterChart as Or, Scatter as Rr, LineChart as Vr, ReferenceLine as qr, ReferenceDot as _r, BarChart as Nr } from "recharts";
|
|
4
|
+
import { cn as jr } from "../../lib/utils.js";
|
|
5
|
+
const G = (s, c = 0) => {
|
|
6
|
+
const i = s.toFixed(c).split("."), d = i[0].replace(/\B(?=(\d{3})+(?!\d))/g, " ");
|
|
7
|
+
return c > 0 && i[1] ? `${d}.${i[1]}` : d;
|
|
8
|
+
}, Sr = (s, c, t, i = 20) => {
|
|
9
|
+
if (!s.length) return i;
|
|
10
|
+
let d = 0;
|
|
11
|
+
s.forEach((C) => {
|
|
12
|
+
c.forEach((o) => {
|
|
13
|
+
const v = C[o];
|
|
14
|
+
typeof v == "number" ? d = Math.max(d, Math.abs(v)) : Array.isArray(v) && v.forEach((n) => {
|
|
15
|
+
typeof n == "number" && (d = Math.max(d, Math.abs(n)));
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
const y = (t ? t(d, 0) : d.toString()).length;
|
|
20
|
+
return Math.max(i, y * 6 + 12);
|
|
21
|
+
}, A = {
|
|
22
|
+
bar: [
|
|
23
|
+
"var(--color-chart-bar-1)",
|
|
24
|
+
// #487D9A - Deep blue-teal
|
|
25
|
+
"var(--color-chart-bar-2)",
|
|
26
|
+
// #86C8CF - Light teal
|
|
27
|
+
"var(--color-chart-bar-3)",
|
|
28
|
+
// #D27369 - Coral red
|
|
29
|
+
"var(--color-chart-bar-4)",
|
|
30
|
+
// #CFDEE6 - Light blue-gray
|
|
31
|
+
"var(--color-chart-bar-5)",
|
|
32
|
+
// #DCB891 - Warm beige
|
|
33
|
+
"var(--color-chart-bar-6)"
|
|
34
|
+
// #56959D - Medium teal
|
|
35
|
+
],
|
|
36
|
+
line: [
|
|
37
|
+
"var(--color-chart-line-1)",
|
|
38
|
+
// #487D9A - Deep blue-teal
|
|
39
|
+
"var(--color-chart-line-2)",
|
|
40
|
+
// #86C8CF - Light teal
|
|
41
|
+
"var(--color-chart-line-3)",
|
|
42
|
+
// #DCB891 - Warm beige
|
|
43
|
+
"var(--color-chart-line-4)",
|
|
44
|
+
// #D27369 - Coral red
|
|
45
|
+
"var(--color-chart-line-5)"
|
|
46
|
+
// #6B9691 - Sage green-teal
|
|
47
|
+
],
|
|
48
|
+
scatter: [
|
|
49
|
+
"var(--color-chart-scatter-1)",
|
|
50
|
+
// #66B1BA - Bright teal
|
|
51
|
+
"var(--color-chart-scatter-2)",
|
|
52
|
+
// #A14238 - Deep red-brown
|
|
53
|
+
"var(--color-chart-scatter-3)",
|
|
54
|
+
// #DCB891 - Warm beige
|
|
55
|
+
"var(--color-chart-scatter-4)",
|
|
56
|
+
// #3B5D73 - Dark blue-gray
|
|
57
|
+
"var(--color-chart-scatter-5)",
|
|
58
|
+
// #56959D - Medium teal
|
|
59
|
+
"var(--color-chart-scatter-6)"
|
|
60
|
+
// #D27369 - Coral red
|
|
61
|
+
],
|
|
62
|
+
// Area chart colors optimized for filled regions with transparency
|
|
63
|
+
area: [
|
|
64
|
+
"var(--color-chart-area-1)",
|
|
65
|
+
// #487D9A - Deep blue-teal
|
|
66
|
+
"var(--color-chart-area-2)",
|
|
67
|
+
// #86C8CF - Light teal
|
|
68
|
+
"var(--color-chart-area-3)",
|
|
69
|
+
// #DCB891 - Warm beige
|
|
70
|
+
"var(--color-chart-area-4)",
|
|
71
|
+
// #699792 - Medium sage
|
|
72
|
+
"var(--color-chart-area-5)",
|
|
73
|
+
// #A1C8C4 - Soft teal
|
|
74
|
+
"var(--color-chart-area-6)"
|
|
75
|
+
// #3B5D73 - Dark blue-gray
|
|
76
|
+
],
|
|
77
|
+
// New accessibility-focused scheme
|
|
78
|
+
accessible: [
|
|
79
|
+
"#0066CC",
|
|
80
|
+
// High contrast blue
|
|
81
|
+
"#CC6600",
|
|
82
|
+
// High contrast orange
|
|
83
|
+
"#009966",
|
|
84
|
+
// High contrast green
|
|
85
|
+
"#CC0066",
|
|
86
|
+
// High contrast magenta
|
|
87
|
+
"#6600CC",
|
|
88
|
+
// High contrast purple
|
|
89
|
+
"#CC9900",
|
|
90
|
+
// High contrast gold
|
|
91
|
+
"#006666",
|
|
92
|
+
// High contrast teal
|
|
93
|
+
"#CC0000"
|
|
94
|
+
// High contrast red
|
|
95
|
+
]
|
|
96
|
+
}, L = (s) => {
|
|
97
|
+
switch (s) {
|
|
98
|
+
case "dashed":
|
|
99
|
+
return "5 5";
|
|
100
|
+
// 5px line, 5px gap
|
|
101
|
+
case "dotted":
|
|
102
|
+
return "2 2";
|
|
103
|
+
// 2px dot, 2px gap
|
|
104
|
+
case "solid":
|
|
105
|
+
default:
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
}, Fr = (s = "circle") => (c) => {
|
|
109
|
+
const { cx: t, cy: i, r: d, fill: b, stroke: y, strokeWidth: C } = c, o = d || 4;
|
|
110
|
+
switch (s) {
|
|
111
|
+
case "triangle":
|
|
112
|
+
const v = o * 1.5, n = o * 1.3, f = `M ${t},${i - v} L ${t + n},${i + v / 2} L ${t - n},${i + v / 2} Z`;
|
|
113
|
+
return /* @__PURE__ */ e(
|
|
114
|
+
"path",
|
|
115
|
+
{
|
|
116
|
+
d: f,
|
|
117
|
+
fill: b,
|
|
118
|
+
stroke: y,
|
|
119
|
+
strokeWidth: C || 0
|
|
120
|
+
}
|
|
121
|
+
);
|
|
122
|
+
case "square":
|
|
123
|
+
const k = o * 1.4;
|
|
124
|
+
return /* @__PURE__ */ e(
|
|
125
|
+
"rect",
|
|
126
|
+
{
|
|
127
|
+
x: t - k,
|
|
128
|
+
y: i - k,
|
|
129
|
+
width: k * 2,
|
|
130
|
+
height: k * 2,
|
|
131
|
+
fill: b,
|
|
132
|
+
stroke: y,
|
|
133
|
+
strokeWidth: C || 0
|
|
134
|
+
}
|
|
135
|
+
);
|
|
136
|
+
case "circle":
|
|
137
|
+
default:
|
|
138
|
+
return /* @__PURE__ */ e(
|
|
139
|
+
"circle",
|
|
140
|
+
{
|
|
141
|
+
cx: t,
|
|
142
|
+
cy: i,
|
|
143
|
+
r: o,
|
|
144
|
+
fill: b,
|
|
145
|
+
stroke: y,
|
|
146
|
+
strokeWidth: C || 0
|
|
147
|
+
}
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
}, Ir = (s) => ({ verticalAlign: "bottom", align: "center" }), H = ({ active: s, payload: c, label: t, config: i, tooltipMaxWidth: d = "max-w-xs", chartType: b, referenceMarkers: y }) => {
|
|
151
|
+
if (!s || !c || !c.length)
|
|
152
|
+
return null;
|
|
153
|
+
const C = y?.filter((o) => o.xValue === t) || [];
|
|
154
|
+
return /* @__PURE__ */ m(
|
|
155
|
+
"div",
|
|
156
|
+
{
|
|
157
|
+
className: `rounded-s border border-[var(--color-border-primary-medium)] bg-[var(--color-surface-primary)] p-[var(--space-m)] shadow-md min-w-[120px] ${d} z-[9999]`,
|
|
158
|
+
role: "tooltip",
|
|
159
|
+
"aria-label": "Chart data tooltip",
|
|
160
|
+
children: [
|
|
161
|
+
/* @__PURE__ */ e("p", { className: "text-label-sm mb-[var(--space-xs)] text-[var(--color-text-primary)]", children: t }),
|
|
162
|
+
c.map((o, v) => {
|
|
163
|
+
const n = i[o.dataKey];
|
|
164
|
+
let f;
|
|
165
|
+
if (n?.type === "range-area" && o.payload) {
|
|
166
|
+
const g = o.payload[o.dataKey];
|
|
167
|
+
Array.isArray(g) && g.length === 2 ? f = `${G(g[0])} – ${G(g[1])}` : f = typeof o.value == "number" ? G(o.value) : o.value;
|
|
168
|
+
} else
|
|
169
|
+
f = typeof o.value == "number" ? G(o.value) : o.value;
|
|
170
|
+
return /* @__PURE__ */ m("div", { className: "flex items-center gap-[var(--space-xs)]", children: [
|
|
171
|
+
(() => {
|
|
172
|
+
switch (b) {
|
|
173
|
+
case "line":
|
|
174
|
+
const g = i[o.dataKey]?.strokeStyle, K = L(g);
|
|
175
|
+
return /* @__PURE__ */ e(
|
|
176
|
+
"div",
|
|
177
|
+
{
|
|
178
|
+
className: "w-3 h-0.5 flex-shrink-0 relative",
|
|
179
|
+
"aria-hidden": "true",
|
|
180
|
+
children: /* @__PURE__ */ e(
|
|
181
|
+
"div",
|
|
182
|
+
{
|
|
183
|
+
className: "w-full h-full",
|
|
184
|
+
style: {
|
|
185
|
+
background: K ? `linear-gradient(to right, ${o.color} 50%, transparent 50%)` : o.color,
|
|
186
|
+
backgroundSize: K === "5 5" ? "6px 100%" : K === "2 2" ? "2px 100%" : "100% 100%"
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
)
|
|
190
|
+
}
|
|
191
|
+
);
|
|
192
|
+
case "scatter":
|
|
193
|
+
return /* @__PURE__ */ e(
|
|
194
|
+
"div",
|
|
195
|
+
{
|
|
196
|
+
className: "w-2 h-2 rounded-full flex-shrink-0",
|
|
197
|
+
style: { backgroundColor: o.color },
|
|
198
|
+
"aria-hidden": "true"
|
|
199
|
+
}
|
|
200
|
+
);
|
|
201
|
+
case "composed":
|
|
202
|
+
switch (i[o.dataKey]?.type) {
|
|
203
|
+
case "line":
|
|
204
|
+
const N = i[o.dataKey]?.strokeStyle, w = L(N);
|
|
205
|
+
return /* @__PURE__ */ e(
|
|
206
|
+
"div",
|
|
207
|
+
{
|
|
208
|
+
className: "w-3 h-0.5 flex-shrink-0 relative",
|
|
209
|
+
"aria-hidden": "true",
|
|
210
|
+
children: /* @__PURE__ */ e(
|
|
211
|
+
"div",
|
|
212
|
+
{
|
|
213
|
+
className: "w-full h-full",
|
|
214
|
+
style: {
|
|
215
|
+
background: w ? `linear-gradient(to right, ${o.color} 50%, transparent 50%)` : o.color,
|
|
216
|
+
backgroundSize: w === "5 5" ? "6px 100%" : w === "2 2" ? "2px 100%" : "100% 100%"
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
)
|
|
220
|
+
}
|
|
221
|
+
);
|
|
222
|
+
case "area":
|
|
223
|
+
case "range-area":
|
|
224
|
+
return /* @__PURE__ */ e(
|
|
225
|
+
"div",
|
|
226
|
+
{
|
|
227
|
+
className: "w-2.5 h-2.5 flex-shrink-0",
|
|
228
|
+
style: { backgroundColor: o.color },
|
|
229
|
+
"aria-hidden": "true"
|
|
230
|
+
}
|
|
231
|
+
);
|
|
232
|
+
case "bar":
|
|
233
|
+
default:
|
|
234
|
+
return /* @__PURE__ */ e(
|
|
235
|
+
"div",
|
|
236
|
+
{
|
|
237
|
+
className: "w-2 h-2 flex-shrink-0",
|
|
238
|
+
style: { backgroundColor: o.color },
|
|
239
|
+
"aria-hidden": "true"
|
|
240
|
+
}
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
case "bar":
|
|
244
|
+
case "horizontal-bar":
|
|
245
|
+
case "area":
|
|
246
|
+
default:
|
|
247
|
+
return /* @__PURE__ */ e(
|
|
248
|
+
"div",
|
|
249
|
+
{
|
|
250
|
+
className: "w-2 h-2 flex-shrink-0",
|
|
251
|
+
style: { backgroundColor: o.color },
|
|
252
|
+
"aria-hidden": "true"
|
|
253
|
+
}
|
|
254
|
+
);
|
|
255
|
+
}
|
|
256
|
+
})(),
|
|
257
|
+
/* @__PURE__ */ m("span", { className: "text-body-sm text-[var(--color-text-primary)] min-w-0 break-words", children: [
|
|
258
|
+
n?.label || o.dataKey,
|
|
259
|
+
":"
|
|
260
|
+
] }),
|
|
261
|
+
/* @__PURE__ */ e("span", { className: "text-body-medium-sm text-[var(--color-text-primary)] ml-auto pl-[16px]", children: f })
|
|
262
|
+
] }, v);
|
|
263
|
+
}),
|
|
264
|
+
C.length > 0 && /* @__PURE__ */ m(Er, { children: [
|
|
265
|
+
/* @__PURE__ */ e("div", { className: "my-[var(--space-m)]" }),
|
|
266
|
+
C.map((o, v) => /* @__PURE__ */ m(lr.Fragment, { children: [
|
|
267
|
+
o.tooltipLabel && /* @__PURE__ */ e("p", { className: "text-label-sm mb-[var(--space-xs)] text-[var(--color-text-primary)]", children: o.tooltipLabel }),
|
|
268
|
+
!o.tooltipLabel && v === 0 && /* @__PURE__ */ e("p", { className: "text-label-sm mb-[var(--space-xs)] text-[var(--color-text-primary)]", children: "Reference Markers:" }),
|
|
269
|
+
o.dataPoints.map((n, f) => /* @__PURE__ */ m("div", { className: "flex items-center gap-[var(--space-xs)]", children: [
|
|
270
|
+
(() => {
|
|
271
|
+
switch (n.shape || "circle") {
|
|
272
|
+
case "triangle":
|
|
273
|
+
return /* @__PURE__ */ e("svg", { width: 8, height: 8, className: "flex-shrink-0", viewBox: "0 0 10 10", children: /* @__PURE__ */ e(
|
|
274
|
+
"path",
|
|
275
|
+
{
|
|
276
|
+
d: "M 5,2 L 8,8 L 2,8 Z",
|
|
277
|
+
fill: n.fill || "var(--color-chart-line-1)",
|
|
278
|
+
stroke: n.stroke || "transparent",
|
|
279
|
+
strokeWidth: n.strokeWidth || 0
|
|
280
|
+
}
|
|
281
|
+
) });
|
|
282
|
+
case "square":
|
|
283
|
+
return /* @__PURE__ */ e("svg", { width: 8, height: 8, className: "flex-shrink-0", viewBox: "0 0 10 10", children: /* @__PURE__ */ e(
|
|
284
|
+
"rect",
|
|
285
|
+
{
|
|
286
|
+
x: "2",
|
|
287
|
+
y: "2",
|
|
288
|
+
width: "6",
|
|
289
|
+
height: "6",
|
|
290
|
+
fill: n.fill || "var(--color-chart-line-1)",
|
|
291
|
+
stroke: n.stroke || "transparent",
|
|
292
|
+
strokeWidth: n.strokeWidth || 0
|
|
293
|
+
}
|
|
294
|
+
) });
|
|
295
|
+
case "circle":
|
|
296
|
+
default:
|
|
297
|
+
return /* @__PURE__ */ e(
|
|
298
|
+
"div",
|
|
299
|
+
{
|
|
300
|
+
className: "w-2 h-2 rounded-full flex-shrink-0",
|
|
301
|
+
style: {
|
|
302
|
+
backgroundColor: n.fill || "var(--color-chart-line-1)",
|
|
303
|
+
border: n.stroke ? `${n.strokeWidth || 1}px solid ${n.stroke}` : "none"
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
);
|
|
307
|
+
}
|
|
308
|
+
})(),
|
|
309
|
+
/* @__PURE__ */ m("span", { className: "text-body-sm text-[var(--color-text-primary)] min-w-0 break-words", children: [
|
|
310
|
+
n.label || `Marker ${f + 1}`,
|
|
311
|
+
":"
|
|
312
|
+
] }),
|
|
313
|
+
/* @__PURE__ */ e("span", { className: "text-body-medium-sm text-[var(--color-text-primary)] ml-auto pl-[16px]", children: G(n.yValue) })
|
|
314
|
+
] }, `marker-${v}-point-${f}`))
|
|
315
|
+
] }, `marker-section-${v}`))
|
|
316
|
+
] })
|
|
317
|
+
]
|
|
318
|
+
}
|
|
319
|
+
);
|
|
320
|
+
};
|
|
321
|
+
function Hr({
|
|
322
|
+
type: s,
|
|
323
|
+
data: c,
|
|
324
|
+
config: t,
|
|
325
|
+
className: i,
|
|
326
|
+
height: d = 300,
|
|
327
|
+
width: b,
|
|
328
|
+
minWidth: y = 300,
|
|
329
|
+
onDataPointClick: C,
|
|
330
|
+
onDataPointHover: o,
|
|
331
|
+
highlightedIndex: v,
|
|
332
|
+
showGrid: n = !0,
|
|
333
|
+
showLegend: f = !0,
|
|
334
|
+
showTooltip: k = !0,
|
|
335
|
+
colorScheme: g,
|
|
336
|
+
responsive: K = !0,
|
|
337
|
+
maintainAspectRatio: $r = !1,
|
|
338
|
+
legendHeight: N,
|
|
339
|
+
margin: w,
|
|
340
|
+
yAxisWidth: sr,
|
|
341
|
+
yAxisTickCount: vr,
|
|
342
|
+
xAxisTickFormatter: Ar,
|
|
343
|
+
yAxisTickFormatter: W,
|
|
344
|
+
showRightYAxis: Y = !1,
|
|
345
|
+
rightYAxisWidth: nr,
|
|
346
|
+
rightYAxisTickCount: rr,
|
|
347
|
+
rightYAxisDomain: er,
|
|
348
|
+
rightYAxisTickFormatter: tr,
|
|
349
|
+
title: S,
|
|
350
|
+
description: ar,
|
|
351
|
+
showDataTable: Mr = !1,
|
|
352
|
+
tooltipMaxWidth: D = "max-w-xs",
|
|
353
|
+
tooltipAllowEscapeViewBox: E,
|
|
354
|
+
legendOrder: cr,
|
|
355
|
+
legendPosition: Zr = "bottom",
|
|
356
|
+
referenceMarkers: ir,
|
|
357
|
+
yAxisDomain: fr,
|
|
358
|
+
...zr
|
|
359
|
+
}) {
|
|
360
|
+
const [xr, Lr] = Pr(0), x = z(() => {
|
|
361
|
+
if (g)
|
|
362
|
+
return A[g];
|
|
363
|
+
switch (s) {
|
|
364
|
+
case "bar":
|
|
365
|
+
case "horizontal-bar":
|
|
366
|
+
return A.bar;
|
|
367
|
+
case "line":
|
|
368
|
+
return A.line;
|
|
369
|
+
case "scatter":
|
|
370
|
+
return A.scatter;
|
|
371
|
+
case "composed":
|
|
372
|
+
return A.bar;
|
|
373
|
+
// Use bar colors for composed charts
|
|
374
|
+
default:
|
|
375
|
+
return A.bar;
|
|
376
|
+
}
|
|
377
|
+
}, [s, g]), u = Object.keys(t).filter((r) => r !== "name"), I = z(() => c.map((r) => {
|
|
378
|
+
const a = { ...r };
|
|
379
|
+
return u.forEach((l) => {
|
|
380
|
+
if (t[l].type === "range-area") {
|
|
381
|
+
const h = r[l];
|
|
382
|
+
Array.isArray(h) && h.length === 2 && (a[l] = h, a[`${l}_min`] = h[0], a[`${l}_max`] = h[1]);
|
|
383
|
+
}
|
|
384
|
+
}), a;
|
|
385
|
+
}), [c, t, u]), P = mr((r) => {
|
|
386
|
+
const a = r?.activeTooltipIndex ?? 0;
|
|
387
|
+
Lr(a), o?.(r?.activePayload?.[0]?.payload, a);
|
|
388
|
+
}, [o]), T = mr(() => {
|
|
389
|
+
o?.(null);
|
|
390
|
+
}, [o]), B = mr((r) => {
|
|
391
|
+
const a = r?.activeTooltipIndex ?? 0;
|
|
392
|
+
C?.(r?.activePayload?.[0]?.payload, a);
|
|
393
|
+
}, [C]), O = z(() => xr >= Math.floor(I.length / 2), [xr, I.length]), br = () => {
|
|
394
|
+
const r = { top: 0, right: 0, left: 0, bottom: 0 };
|
|
395
|
+
return {
|
|
396
|
+
top: w?.top ?? r.top,
|
|
397
|
+
right: w?.right ?? r.right,
|
|
398
|
+
// Don't add rightYAxisWidth - Recharts handles it via YAxis width prop
|
|
399
|
+
left: w?.left ?? r.left,
|
|
400
|
+
bottom: w?.bottom ?? r.bottom
|
|
401
|
+
};
|
|
402
|
+
}, Kr = z(() => sr || Sr(I, u, W, 20), [sr, I, u, W]), yr = z(() => {
|
|
403
|
+
if (!Y) return 0;
|
|
404
|
+
if (nr) return nr;
|
|
405
|
+
const r = u.filter((a) => t[a].yAxisId === "right");
|
|
406
|
+
return r.length === 0 ? 0 : Sr(I, r, tr, 20);
|
|
407
|
+
}, [Y, nr, I, u, t, tr]), kr = z(() => u.some((a) => (t[a].yAxisId || "left") === "left") ? "left" : "right", [u, t]), R = N ? {
|
|
408
|
+
...Ir(),
|
|
409
|
+
wrapperStyle: {
|
|
410
|
+
position: "absolute",
|
|
411
|
+
bottom: 0,
|
|
412
|
+
left: 0,
|
|
413
|
+
right: 0,
|
|
414
|
+
height: N,
|
|
415
|
+
paddingTop: 8,
|
|
416
|
+
zIndex: 1
|
|
417
|
+
}
|
|
418
|
+
} : Ir(), V = {
|
|
419
|
+
data: I,
|
|
420
|
+
margin: br()
|
|
421
|
+
}, q = {
|
|
422
|
+
axisLine: { stroke: "var(--color-border-primary-subtle)", strokeWidth: 2 },
|
|
423
|
+
tickLine: !1,
|
|
424
|
+
tick: {
|
|
425
|
+
fontSize: 10,
|
|
426
|
+
fill: "var(--color-text-tertiary)",
|
|
427
|
+
fontFamily: "Inter, sans-serif"
|
|
428
|
+
},
|
|
429
|
+
tickFormatter: Ar
|
|
430
|
+
}, _ = {
|
|
431
|
+
axisLine: { stroke: "var(--color-border-primary-subtle)", strokeWidth: 2 },
|
|
432
|
+
tickLine: { stroke: "var(--color-border-primary-subtle)", strokeWidth: 1 },
|
|
433
|
+
tick: {
|
|
434
|
+
fontSize: 10,
|
|
435
|
+
fill: "var(--color-text-tertiary)",
|
|
436
|
+
fontFamily: "Inter, sans-serif"
|
|
437
|
+
},
|
|
438
|
+
width: Kr,
|
|
439
|
+
// Auto-calculated based on tick formatter, default 20px
|
|
440
|
+
tickFormatter: W,
|
|
441
|
+
...vr && { tickCount: vr },
|
|
442
|
+
// Force specific number of ticks when provided
|
|
443
|
+
...fr && { domain: fr }
|
|
444
|
+
// Custom Y-axis domain when provided
|
|
445
|
+
}, j = {
|
|
446
|
+
stroke: "var(--color-border-primary-subtle)",
|
|
447
|
+
horizontal: !0,
|
|
448
|
+
vertical: !1
|
|
449
|
+
}, F = ({ payload: r }) => {
|
|
450
|
+
if (!r || !r.length) return null;
|
|
451
|
+
const a = cr ? [...r].sort((p, M) => {
|
|
452
|
+
const dr = cr.indexOf(p.dataKey), or = cr.indexOf(M.dataKey);
|
|
453
|
+
return dr === -1 ? 1 : or === -1 ? -1 : dr - or;
|
|
454
|
+
}) : r, h = br().left + 5;
|
|
455
|
+
return /* @__PURE__ */ e(
|
|
456
|
+
"div",
|
|
457
|
+
{
|
|
458
|
+
style: {
|
|
459
|
+
paddingLeft: `${h}px`,
|
|
460
|
+
paddingRight: "16px"
|
|
461
|
+
},
|
|
462
|
+
children: /* @__PURE__ */ e("div", { className: "flex flex-wrap justify-start items-start gap-x-[var(--space-m)] gap-y-[var(--space-s)]", children: a.map((p, M) => /* @__PURE__ */ m("div", { className: "flex items-center justify-center gap-[var(--space-xs)]", children: [
|
|
463
|
+
(() => {
|
|
464
|
+
switch (s) {
|
|
465
|
+
case "line":
|
|
466
|
+
const or = t[p.dataKey]?.strokeStyle, hr = L(or);
|
|
467
|
+
return /* @__PURE__ */ e(
|
|
468
|
+
"div",
|
|
469
|
+
{
|
|
470
|
+
className: "w-[12px] h-[2px] flex-shrink-0 relative",
|
|
471
|
+
"aria-hidden": "true",
|
|
472
|
+
children: /* @__PURE__ */ e(
|
|
473
|
+
"div",
|
|
474
|
+
{
|
|
475
|
+
className: "w-full h-full",
|
|
476
|
+
style: {
|
|
477
|
+
background: hr ? `linear-gradient(to right, ${p.color} 50%, transparent 50%)` : p.color,
|
|
478
|
+
backgroundSize: hr === "5 5" ? "8px 100%" : hr === "2 2" ? "3px 100%" : "100% 100%"
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
)
|
|
482
|
+
}
|
|
483
|
+
);
|
|
484
|
+
case "scatter":
|
|
485
|
+
return /* @__PURE__ */ e(
|
|
486
|
+
"div",
|
|
487
|
+
{
|
|
488
|
+
className: "w-[6px] h-[6px] rounded-full flex-shrink-0",
|
|
489
|
+
style: { backgroundColor: p.color },
|
|
490
|
+
"aria-hidden": "true"
|
|
491
|
+
}
|
|
492
|
+
);
|
|
493
|
+
case "composed":
|
|
494
|
+
switch (t[p.dataKey]?.type) {
|
|
495
|
+
case "line":
|
|
496
|
+
const Dr = t[p.dataKey]?.strokeStyle, ur = L(Dr);
|
|
497
|
+
return /* @__PURE__ */ e(
|
|
498
|
+
"div",
|
|
499
|
+
{
|
|
500
|
+
className: "w-[12px] h-[2px] flex-shrink-0 relative",
|
|
501
|
+
"aria-hidden": "true",
|
|
502
|
+
children: /* @__PURE__ */ e(
|
|
503
|
+
"div",
|
|
504
|
+
{
|
|
505
|
+
className: "w-full h-full",
|
|
506
|
+
style: {
|
|
507
|
+
background: ur ? `linear-gradient(to right, ${p.color} 50%, transparent 50%)` : p.color,
|
|
508
|
+
backgroundSize: ur === "5 5" ? "8px 100%" : ur === "2 2" ? "3px 100%" : "100% 100%"
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
)
|
|
512
|
+
}
|
|
513
|
+
);
|
|
514
|
+
case "area":
|
|
515
|
+
case "range-area":
|
|
516
|
+
return /* @__PURE__ */ e(
|
|
517
|
+
"div",
|
|
518
|
+
{
|
|
519
|
+
className: "w-[8px] h-[8px] flex-shrink-0",
|
|
520
|
+
style: { backgroundColor: p.color },
|
|
521
|
+
"aria-hidden": "true"
|
|
522
|
+
}
|
|
523
|
+
);
|
|
524
|
+
case "bar":
|
|
525
|
+
default:
|
|
526
|
+
return /* @__PURE__ */ e(
|
|
527
|
+
"div",
|
|
528
|
+
{
|
|
529
|
+
className: "w-[6px] h-[6px] flex-shrink-0",
|
|
530
|
+
style: { backgroundColor: p.color },
|
|
531
|
+
"aria-hidden": "true"
|
|
532
|
+
}
|
|
533
|
+
);
|
|
534
|
+
}
|
|
535
|
+
case "bar":
|
|
536
|
+
case "horizontal-bar":
|
|
537
|
+
default:
|
|
538
|
+
return /* @__PURE__ */ e(
|
|
539
|
+
"div",
|
|
540
|
+
{
|
|
541
|
+
className: "w-[6px] h-[6px] flex-shrink-0",
|
|
542
|
+
style: { backgroundColor: p.color },
|
|
543
|
+
"aria-hidden": "true"
|
|
544
|
+
}
|
|
545
|
+
);
|
|
546
|
+
}
|
|
547
|
+
})(),
|
|
548
|
+
/* @__PURE__ */ e("span", { className: "[&]:text-body-medium-xsm [&]:text-[var(--color-text-secondary)] leading-none whitespace-nowrap", children: p.value })
|
|
549
|
+
] }, M)) })
|
|
550
|
+
}
|
|
551
|
+
);
|
|
552
|
+
}, Cr = () => {
|
|
553
|
+
switch (s) {
|
|
554
|
+
case "bar":
|
|
555
|
+
return /* @__PURE__ */ m(
|
|
556
|
+
Nr,
|
|
557
|
+
{
|
|
558
|
+
...V,
|
|
559
|
+
onMouseMove: P,
|
|
560
|
+
onMouseLeave: T,
|
|
561
|
+
onClick: B,
|
|
562
|
+
children: [
|
|
563
|
+
n && /* @__PURE__ */ e(U, { ...j }),
|
|
564
|
+
/* @__PURE__ */ e(X, { dataKey: "name", ...q }),
|
|
565
|
+
/* @__PURE__ */ e($, { ..._ }),
|
|
566
|
+
k && /* @__PURE__ */ e(
|
|
567
|
+
J,
|
|
568
|
+
{
|
|
569
|
+
content: (r) => /* @__PURE__ */ e(H, { ...r, config: t, tooltipMaxWidth: D, chartType: s }),
|
|
570
|
+
cursor: {
|
|
571
|
+
stroke: "var(--color-border-primary)",
|
|
572
|
+
strokeWidth: 1,
|
|
573
|
+
fill: "var(--color-background-neutral-default)",
|
|
574
|
+
fillOpacity: 1
|
|
575
|
+
},
|
|
576
|
+
position: { x: void 0, y: void 0 },
|
|
577
|
+
offset: 10,
|
|
578
|
+
animationDuration: 0,
|
|
579
|
+
allowEscapeViewBox: E,
|
|
580
|
+
reverseDirection: { x: O },
|
|
581
|
+
wrapperStyle: { zIndex: 100 }
|
|
582
|
+
}
|
|
583
|
+
),
|
|
584
|
+
f && /* @__PURE__ */ e(Q, { content: /* @__PURE__ */ e(F, {}), ...R }),
|
|
585
|
+
u.map((r, a) => {
|
|
586
|
+
const l = t[r].color || x[a % x.length];
|
|
587
|
+
return /* @__PURE__ */ e(
|
|
588
|
+
pr,
|
|
589
|
+
{
|
|
590
|
+
dataKey: r,
|
|
591
|
+
name: t[r].label,
|
|
592
|
+
fill: l,
|
|
593
|
+
radius: [0, 0, 0, 0],
|
|
594
|
+
className: "cursor-pointer transition-colors",
|
|
595
|
+
isAnimationActive: !1,
|
|
596
|
+
maxBarSize: 60
|
|
597
|
+
},
|
|
598
|
+
r
|
|
599
|
+
);
|
|
600
|
+
})
|
|
601
|
+
]
|
|
602
|
+
}
|
|
603
|
+
);
|
|
604
|
+
case "horizontal-bar":
|
|
605
|
+
return /* @__PURE__ */ m(
|
|
606
|
+
Nr,
|
|
607
|
+
{
|
|
608
|
+
...V,
|
|
609
|
+
layout: "vertical",
|
|
610
|
+
onMouseMove: P,
|
|
611
|
+
onMouseLeave: T,
|
|
612
|
+
onClick: B,
|
|
613
|
+
children: [
|
|
614
|
+
n && /* @__PURE__ */ e(U, { ...j, horizontal: !1, vertical: !0 }),
|
|
615
|
+
/* @__PURE__ */ e(X, { type: "number", ...q }),
|
|
616
|
+
/* @__PURE__ */ e($, { type: "category", dataKey: "name", ..._ }),
|
|
617
|
+
k && /* @__PURE__ */ e(
|
|
618
|
+
J,
|
|
619
|
+
{
|
|
620
|
+
content: (r) => /* @__PURE__ */ e(H, { ...r, config: t, tooltipMaxWidth: D, chartType: s }),
|
|
621
|
+
cursor: {
|
|
622
|
+
stroke: "var(--color-border-primary)",
|
|
623
|
+
strokeWidth: 1,
|
|
624
|
+
fill: "var(--color-background-neutral-default)",
|
|
625
|
+
fillOpacity: 1
|
|
626
|
+
},
|
|
627
|
+
position: { x: void 0, y: void 0 },
|
|
628
|
+
offset: 10,
|
|
629
|
+
animationDuration: 0,
|
|
630
|
+
allowEscapeViewBox: E,
|
|
631
|
+
reverseDirection: { x: O },
|
|
632
|
+
wrapperStyle: { zIndex: 100 }
|
|
633
|
+
}
|
|
634
|
+
),
|
|
635
|
+
f && /* @__PURE__ */ e(Q, { content: /* @__PURE__ */ e(F, {}), ...R }),
|
|
636
|
+
u.map((r, a) => {
|
|
637
|
+
const l = t[r].color || x[a % x.length];
|
|
638
|
+
return /* @__PURE__ */ e(
|
|
639
|
+
pr,
|
|
640
|
+
{
|
|
641
|
+
dataKey: r,
|
|
642
|
+
name: t[r].label,
|
|
643
|
+
fill: l,
|
|
644
|
+
radius: [0, 0, 0, 0],
|
|
645
|
+
className: "cursor-pointer transition-colors",
|
|
646
|
+
isAnimationActive: !1,
|
|
647
|
+
maxBarSize: 40
|
|
648
|
+
},
|
|
649
|
+
r
|
|
650
|
+
);
|
|
651
|
+
})
|
|
652
|
+
]
|
|
653
|
+
}
|
|
654
|
+
);
|
|
655
|
+
case "line":
|
|
656
|
+
return /* @__PURE__ */ m(
|
|
657
|
+
Vr,
|
|
658
|
+
{
|
|
659
|
+
...V,
|
|
660
|
+
onMouseMove: P,
|
|
661
|
+
onMouseLeave: T,
|
|
662
|
+
onClick: B,
|
|
663
|
+
children: [
|
|
664
|
+
n && /* @__PURE__ */ e(U, { ...j, yAxisId: kr }),
|
|
665
|
+
/* @__PURE__ */ e(X, { dataKey: "name", ...q }),
|
|
666
|
+
/* @__PURE__ */ e($, { yAxisId: "left", ..._ }),
|
|
667
|
+
Y && /* @__PURE__ */ e(
|
|
668
|
+
$,
|
|
669
|
+
{
|
|
670
|
+
yAxisId: "right",
|
|
671
|
+
orientation: "right",
|
|
672
|
+
axisLine: { stroke: "var(--color-border-primary-subtle)", strokeWidth: 2 },
|
|
673
|
+
tickLine: { stroke: "var(--color-border-primary-subtle)", strokeWidth: 1 },
|
|
674
|
+
tick: {
|
|
675
|
+
fontSize: 10,
|
|
676
|
+
fill: "var(--color-text-tertiary)",
|
|
677
|
+
fontFamily: "Inter, sans-serif"
|
|
678
|
+
},
|
|
679
|
+
width: yr,
|
|
680
|
+
tickFormatter: tr,
|
|
681
|
+
...rr && { tickCount: rr },
|
|
682
|
+
...er && { domain: er }
|
|
683
|
+
}
|
|
684
|
+
),
|
|
685
|
+
ir?.map(
|
|
686
|
+
(r, a) => r.showLine !== !1 ? /* @__PURE__ */ e(
|
|
687
|
+
qr,
|
|
688
|
+
{
|
|
689
|
+
x: r.xValue,
|
|
690
|
+
yAxisId: "left",
|
|
691
|
+
stroke: r.lineStyle?.stroke || "#000000",
|
|
692
|
+
strokeWidth: r.lineStyle?.strokeWidth || 2,
|
|
693
|
+
strokeDasharray: r.lineStyle?.strokeDasharray
|
|
694
|
+
},
|
|
695
|
+
`marker-line-${a}`
|
|
696
|
+
) : null
|
|
697
|
+
),
|
|
698
|
+
k && /* @__PURE__ */ e(
|
|
699
|
+
J,
|
|
700
|
+
{
|
|
701
|
+
content: (r) => /* @__PURE__ */ e(H, { ...r, config: t, tooltipMaxWidth: D, chartType: s, referenceMarkers: ir }),
|
|
702
|
+
cursor: {
|
|
703
|
+
stroke: "var(--color-border-primary)",
|
|
704
|
+
strokeWidth: 1,
|
|
705
|
+
fill: "var(--color-background-neutral-default)",
|
|
706
|
+
fillOpacity: 1
|
|
707
|
+
},
|
|
708
|
+
position: { x: void 0, y: void 0 },
|
|
709
|
+
offset: 10,
|
|
710
|
+
animationDuration: 0,
|
|
711
|
+
allowEscapeViewBox: E,
|
|
712
|
+
reverseDirection: { x: O },
|
|
713
|
+
wrapperStyle: { zIndex: 100 }
|
|
714
|
+
}
|
|
715
|
+
),
|
|
716
|
+
f && /* @__PURE__ */ e(Q, { content: /* @__PURE__ */ e(F, {}), ...R }),
|
|
717
|
+
u.map((r, a) => {
|
|
718
|
+
const l = t[r].color || x[a % x.length];
|
|
719
|
+
return /* @__PURE__ */ e(
|
|
720
|
+
wr,
|
|
721
|
+
{
|
|
722
|
+
type: "linear",
|
|
723
|
+
dataKey: r,
|
|
724
|
+
name: t[r].label,
|
|
725
|
+
yAxisId: t[r].yAxisId || "left",
|
|
726
|
+
stroke: l,
|
|
727
|
+
strokeWidth: 2,
|
|
728
|
+
strokeDasharray: L(t[r].strokeStyle),
|
|
729
|
+
dot: t[r].showDots === !0 ? {
|
|
730
|
+
fill: l,
|
|
731
|
+
strokeWidth: 0,
|
|
732
|
+
r: 3
|
|
733
|
+
} : !1,
|
|
734
|
+
activeDot: {
|
|
735
|
+
r: 5,
|
|
736
|
+
fill: l
|
|
737
|
+
},
|
|
738
|
+
className: "cursor-pointer transition-colors",
|
|
739
|
+
isAnimationActive: !1
|
|
740
|
+
},
|
|
741
|
+
r
|
|
742
|
+
);
|
|
743
|
+
}),
|
|
744
|
+
ir?.map((r, a) => /* @__PURE__ */ e(lr.Fragment, { children: r.dataPoints.map((l, h) => /* @__PURE__ */ e(
|
|
745
|
+
_r,
|
|
746
|
+
{
|
|
747
|
+
x: r.xValue,
|
|
748
|
+
y: l.yValue,
|
|
749
|
+
yAxisId: "left",
|
|
750
|
+
r: l.size || 4,
|
|
751
|
+
fill: l.fill || "var(--color-chart-line-1)",
|
|
752
|
+
stroke: l.stroke || "transparent",
|
|
753
|
+
strokeWidth: l.strokeWidth || 0,
|
|
754
|
+
shape: Fr(l.shape || "circle")
|
|
755
|
+
},
|
|
756
|
+
`marker-${a}-point-${h}`
|
|
757
|
+
)) }, `marker-dots-${a}`))
|
|
758
|
+
]
|
|
759
|
+
}
|
|
760
|
+
);
|
|
761
|
+
case "scatter":
|
|
762
|
+
return /* @__PURE__ */ m(
|
|
763
|
+
Or,
|
|
764
|
+
{
|
|
765
|
+
...V,
|
|
766
|
+
onMouseMove: P,
|
|
767
|
+
onMouseLeave: T,
|
|
768
|
+
onClick: B,
|
|
769
|
+
children: [
|
|
770
|
+
n && /* @__PURE__ */ e(U, { ...j }),
|
|
771
|
+
/* @__PURE__ */ e(X, { dataKey: "x", type: "number", ...q }),
|
|
772
|
+
/* @__PURE__ */ e($, { dataKey: "y", type: "number", ..._ }),
|
|
773
|
+
k && /* @__PURE__ */ e(
|
|
774
|
+
J,
|
|
775
|
+
{
|
|
776
|
+
content: (r) => /* @__PURE__ */ e(H, { ...r, config: t, tooltipMaxWidth: D, chartType: s }),
|
|
777
|
+
cursor: {
|
|
778
|
+
stroke: "var(--color-border-primary)",
|
|
779
|
+
strokeWidth: 1,
|
|
780
|
+
fill: "var(--color-background-neutral-default)",
|
|
781
|
+
fillOpacity: 1
|
|
782
|
+
},
|
|
783
|
+
position: { x: void 0, y: void 0 },
|
|
784
|
+
offset: 10,
|
|
785
|
+
animationDuration: 0,
|
|
786
|
+
allowEscapeViewBox: E,
|
|
787
|
+
reverseDirection: { x: O },
|
|
788
|
+
wrapperStyle: { zIndex: 100 }
|
|
789
|
+
}
|
|
790
|
+
),
|
|
791
|
+
f && /* @__PURE__ */ e(Q, { content: /* @__PURE__ */ e(F, {}), ...R }),
|
|
792
|
+
u.filter((r) => r !== "x" && r !== "y" && r !== "name").map((r, a) => {
|
|
793
|
+
const l = t[r]?.color || x[a % x.length];
|
|
794
|
+
return /* @__PURE__ */ e(
|
|
795
|
+
Rr,
|
|
796
|
+
{
|
|
797
|
+
name: t[r]?.label || r,
|
|
798
|
+
data: c.map((h) => ({ x: h.x, y: h.y, [r]: h[r] })),
|
|
799
|
+
fill: l,
|
|
800
|
+
className: "cursor-pointer transition-colors",
|
|
801
|
+
isAnimationActive: !1
|
|
802
|
+
},
|
|
803
|
+
r
|
|
804
|
+
);
|
|
805
|
+
})
|
|
806
|
+
]
|
|
807
|
+
}
|
|
808
|
+
);
|
|
809
|
+
case "composed":
|
|
810
|
+
return /* @__PURE__ */ m(
|
|
811
|
+
Br,
|
|
812
|
+
{
|
|
813
|
+
...V,
|
|
814
|
+
onMouseMove: P,
|
|
815
|
+
onMouseLeave: T,
|
|
816
|
+
onClick: B,
|
|
817
|
+
children: [
|
|
818
|
+
n && /* @__PURE__ */ e(U, { ...j, yAxisId: kr }),
|
|
819
|
+
/* @__PURE__ */ e(X, { dataKey: "name", ...q }),
|
|
820
|
+
/* @__PURE__ */ e($, { yAxisId: "left", ..._ }),
|
|
821
|
+
Y && /* @__PURE__ */ e(
|
|
822
|
+
$,
|
|
823
|
+
{
|
|
824
|
+
yAxisId: "right",
|
|
825
|
+
orientation: "right",
|
|
826
|
+
axisLine: { stroke: "var(--color-border-primary-subtle)", strokeWidth: 2 },
|
|
827
|
+
tickLine: { stroke: "var(--color-border-primary-subtle)", strokeWidth: 1 },
|
|
828
|
+
tick: {
|
|
829
|
+
fontSize: 10,
|
|
830
|
+
fill: "var(--color-text-tertiary)",
|
|
831
|
+
fontFamily: "Inter, sans-serif"
|
|
832
|
+
},
|
|
833
|
+
width: yr,
|
|
834
|
+
tickFormatter: tr,
|
|
835
|
+
...rr && { tickCount: rr },
|
|
836
|
+
...er && { domain: er }
|
|
837
|
+
}
|
|
838
|
+
),
|
|
839
|
+
k && /* @__PURE__ */ e(
|
|
840
|
+
J,
|
|
841
|
+
{
|
|
842
|
+
content: (r) => /* @__PURE__ */ e(H, { ...r, config: t, tooltipMaxWidth: D, chartType: s }),
|
|
843
|
+
cursor: {
|
|
844
|
+
stroke: "var(--color-border-primary)",
|
|
845
|
+
strokeWidth: 1,
|
|
846
|
+
fill: "var(--color-background-neutral-default)",
|
|
847
|
+
fillOpacity: 1
|
|
848
|
+
},
|
|
849
|
+
position: { x: void 0, y: void 0 },
|
|
850
|
+
offset: 10,
|
|
851
|
+
animationDuration: 0,
|
|
852
|
+
allowEscapeViewBox: E,
|
|
853
|
+
reverseDirection: { x: O },
|
|
854
|
+
wrapperStyle: { zIndex: 100 }
|
|
855
|
+
}
|
|
856
|
+
),
|
|
857
|
+
f && /* @__PURE__ */ e(Q, { content: /* @__PURE__ */ e(F, {}), ...R }),
|
|
858
|
+
u.map((r, a) => {
|
|
859
|
+
const l = t[r].color || x[a % x.length];
|
|
860
|
+
return (t[r].type || "bar") === "bar" ? /* @__PURE__ */ e(
|
|
861
|
+
pr,
|
|
862
|
+
{
|
|
863
|
+
dataKey: r,
|
|
864
|
+
name: t[r].label,
|
|
865
|
+
yAxisId: t[r].yAxisId || "left",
|
|
866
|
+
fill: l,
|
|
867
|
+
radius: [0, 0, 0, 0],
|
|
868
|
+
className: "cursor-pointer transition-colors",
|
|
869
|
+
isAnimationActive: !1,
|
|
870
|
+
maxBarSize: 60
|
|
871
|
+
},
|
|
872
|
+
r
|
|
873
|
+
) : null;
|
|
874
|
+
}),
|
|
875
|
+
u.map((r, a) => {
|
|
876
|
+
const l = t[r].color || x[a % x.length], h = t[r].type || "bar";
|
|
877
|
+
return h === "area" ? /* @__PURE__ */ e(
|
|
878
|
+
gr,
|
|
879
|
+
{
|
|
880
|
+
type: "linear",
|
|
881
|
+
dataKey: r,
|
|
882
|
+
name: t[r].label,
|
|
883
|
+
yAxisId: t[r].yAxisId || "left",
|
|
884
|
+
stroke: t[r].stroke ?? l,
|
|
885
|
+
fill: t[r].fill ?? l,
|
|
886
|
+
fillOpacity: 0.3,
|
|
887
|
+
className: "cursor-pointer transition-colors",
|
|
888
|
+
isAnimationActive: !1
|
|
889
|
+
},
|
|
890
|
+
r
|
|
891
|
+
) : h === "range-area" ? /* @__PURE__ */ e(
|
|
892
|
+
gr,
|
|
893
|
+
{
|
|
894
|
+
type: "linear",
|
|
895
|
+
dataKey: r,
|
|
896
|
+
name: t[r].label,
|
|
897
|
+
yAxisId: t[r].yAxisId || "left",
|
|
898
|
+
stroke: t[r].stroke ?? "none",
|
|
899
|
+
fill: t[r].fill ?? l,
|
|
900
|
+
fillOpacity: 0.3,
|
|
901
|
+
className: "cursor-pointer transition-colors",
|
|
902
|
+
isAnimationActive: !1
|
|
903
|
+
},
|
|
904
|
+
r
|
|
905
|
+
) : null;
|
|
906
|
+
}),
|
|
907
|
+
u.map((r, a) => {
|
|
908
|
+
const l = t[r].color || x[a % x.length];
|
|
909
|
+
return (t[r].type || "bar") === "line" ? /* @__PURE__ */ e(
|
|
910
|
+
wr,
|
|
911
|
+
{
|
|
912
|
+
type: "linear",
|
|
913
|
+
dataKey: r,
|
|
914
|
+
name: t[r].label,
|
|
915
|
+
yAxisId: t[r].yAxisId || "left",
|
|
916
|
+
stroke: l,
|
|
917
|
+
strokeWidth: 2,
|
|
918
|
+
strokeDasharray: L(t[r].strokeStyle),
|
|
919
|
+
dot: t[r].showDots === !0 ? {
|
|
920
|
+
fill: l,
|
|
921
|
+
strokeWidth: 0,
|
|
922
|
+
r: 3
|
|
923
|
+
} : !1,
|
|
924
|
+
activeDot: {
|
|
925
|
+
r: 5,
|
|
926
|
+
fill: l
|
|
927
|
+
},
|
|
928
|
+
className: "cursor-pointer transition-colors",
|
|
929
|
+
isAnimationActive: !1
|
|
930
|
+
},
|
|
931
|
+
r
|
|
932
|
+
) : null;
|
|
933
|
+
})
|
|
934
|
+
]
|
|
935
|
+
}
|
|
936
|
+
);
|
|
937
|
+
default:
|
|
938
|
+
return /* @__PURE__ */ e("div", { children: "Unsupported chart type" });
|
|
939
|
+
}
|
|
940
|
+
}, Wr = () => Mr ? /* @__PURE__ */ e("div", { className: "sr-only", children: /* @__PURE__ */ m("table", { role: "table", "aria-label": S ? `Data for ${S}` : "Chart data", children: [
|
|
941
|
+
/* @__PURE__ */ m("caption", { className: "sr-only", children: [
|
|
942
|
+
S && `${S}. `,
|
|
943
|
+
ar || `${s} chart showing ${u.length} data series across ${c.length} categories.`
|
|
944
|
+
] }),
|
|
945
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ m("tr", { children: [
|
|
946
|
+
/* @__PURE__ */ e("th", { scope: "col", children: "Category" }),
|
|
947
|
+
u.map((r) => /* @__PURE__ */ e("th", { scope: "col", children: t[r]?.label || r }, r))
|
|
948
|
+
] }) }),
|
|
949
|
+
/* @__PURE__ */ e("tbody", { children: c.map((r, a) => /* @__PURE__ */ m("tr", { children: [
|
|
950
|
+
/* @__PURE__ */ e("th", { scope: "row", children: r.name || `Item ${a + 1}` }),
|
|
951
|
+
u.map((l) => /* @__PURE__ */ e("td", { children: W ? W(r[l], a) : r[l] }, l))
|
|
952
|
+
] }, a)) })
|
|
953
|
+
] }) }) : null, Z = lr.useRef(null);
|
|
954
|
+
return lr.useEffect(() => {
|
|
955
|
+
const r = Z.current;
|
|
956
|
+
if (!r) return;
|
|
957
|
+
const a = setTimeout(() => {
|
|
958
|
+
r.querySelectorAll(".recharts-cartesian-axis-tick").forEach((h) => {
|
|
959
|
+
const p = h.querySelector("text"), M = h.querySelector(".recharts-cartesian-axis-tick-line");
|
|
960
|
+
p?.textContent?.trim() === "0" && M && M.setAttribute("stroke-width", "2");
|
|
961
|
+
});
|
|
962
|
+
}, 100);
|
|
963
|
+
return () => clearTimeout(a);
|
|
964
|
+
}, [c, s]), /* @__PURE__ */ m(
|
|
965
|
+
"div",
|
|
966
|
+
{
|
|
967
|
+
ref: Z,
|
|
968
|
+
className: jr("w-full", i),
|
|
969
|
+
style: { minWidth: y },
|
|
970
|
+
role: "img",
|
|
971
|
+
"aria-label": S || `${s} chart`,
|
|
972
|
+
"aria-describedby": ar ? `${Z.current?.id || "chart"}-desc` : void 0,
|
|
973
|
+
...zr,
|
|
974
|
+
children: [
|
|
975
|
+
S && /* @__PURE__ */ e("h3", { className: "sr-only", id: `${Z.current?.id || "chart"}-title`, children: S }),
|
|
976
|
+
ar && /* @__PURE__ */ e("p", { className: "sr-only", id: `${Z.current?.id || "chart"}-desc`, children: ar }),
|
|
977
|
+
(() => {
|
|
978
|
+
const r = N ? d - N : d, a = K ? /* @__PURE__ */ e(
|
|
979
|
+
Tr,
|
|
980
|
+
{
|
|
981
|
+
width: b || "100%",
|
|
982
|
+
height: r,
|
|
983
|
+
children: Cr() || /* @__PURE__ */ e("div", { children: "Chart error" })
|
|
984
|
+
}
|
|
985
|
+
) : /* @__PURE__ */ e("div", { style: { width: b || "100%", height: r, minWidth: y }, children: Cr() || /* @__PURE__ */ e("div", { children: "Chart error" }) });
|
|
986
|
+
return N ? /* @__PURE__ */ e("div", { style: { width: b || "100%" }, children: a }) : a;
|
|
987
|
+
})(),
|
|
988
|
+
/* @__PURE__ */ e(Wr, {})
|
|
989
|
+
]
|
|
990
|
+
}
|
|
991
|
+
);
|
|
992
|
+
}
|
|
993
|
+
const Yr = (s, c = "bar") => {
|
|
994
|
+
const t = A[c];
|
|
995
|
+
return Array.from({ length: s }, (i, d) => t[d % t.length]);
|
|
996
|
+
}, re = (s, c, t) => Array.isArray(s) ? s.reduce((d, b, y) => (d[b] = {
|
|
997
|
+
label: c?.[y] || b,
|
|
998
|
+
color: t?.[y]
|
|
999
|
+
}, d), {}) : s;
|
|
1000
|
+
export {
|
|
1001
|
+
Hr as Chart,
|
|
1002
|
+
A as chartColorSchemes,
|
|
1003
|
+
re as createChartConfig,
|
|
1004
|
+
G as formatNumber,
|
|
1005
|
+
Yr as generateChartColors
|
|
1006
|
+
};
|