@validationcloud/fractal-ui 1.49.0 → 1.51.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.
Files changed (96) hide show
  1. package/dist/components/echarts-renderer/echarts-chart-option.d.ts +11 -0
  2. package/dist/components/echarts-renderer/echarts-chart-option.js +9 -0
  3. package/dist/components/echarts-renderer/echarts-renderer.d.ts +22 -0
  4. package/dist/components/echarts-renderer/echarts-renderer.js +21 -0
  5. package/dist/components/echarts-renderer/echarts-theme-option.d.ts +4 -0
  6. package/dist/components/echarts-renderer/echarts-theme-option.js +9 -0
  7. package/dist/components/echarts-renderer/mavrik-theme.d.ts +227 -0
  8. package/dist/components/echarts-renderer/mavrik-theme.js +11 -0
  9. package/dist/components/echarts-renderer/mavrik-theme.json.d.ts +269 -0
  10. package/dist/components/echarts-renderer/mavrik-theme.json.js +33 -0
  11. package/dist/components/echarts-renderer/use-chart-instance.d.ts +19 -0
  12. package/dist/components/echarts-renderer/use-chart-instance.js +46 -0
  13. package/dist/components/mount-svg-sprite/mount-svg-sprite.js +18 -0
  14. package/dist/{src/components → components}/protocol-logo/protocol-logo-ids.d.ts +1 -1
  15. package/dist/{src/components → components}/scroll-area/scroll-area-viewport.js +1 -1
  16. package/dist/index.d.ts +32 -2
  17. package/dist/index.js +63 -51
  18. package/dist/lib/render-chart-to-image.d.ts +28 -0
  19. package/dist/lib/render-chart-to-image.js +34 -0
  20. package/dist/lib/render-chart-to-image.test.d.ts +1 -0
  21. package/dist/server.d.ts +1 -0
  22. package/dist/server.js +4 -0
  23. package/package.json +25 -13
  24. package/dist/node_modules/.pnpm/@radix-ui_react-compose-refs@1.1.2_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-compose-refs/dist/index.js +0 -25
  25. package/dist/src/components/mount-svg-sprite/mount-svg-sprite.js +0 -18
  26. package/dist/src/index.d.ts +0 -27
  27. /package/dist/{src/assets → assets}/animated-loader.svg.js +0 -0
  28. /package/dist/{src/assets → assets}/default-avatar.svg.js +0 -0
  29. /package/dist/{src/assets → assets}/not-found.svg.js +0 -0
  30. /package/dist/{src/components → components}/animated-loader/animated-loader.d.ts +0 -0
  31. /package/dist/{src/components → components}/animated-loader/animated-loader.js +0 -0
  32. /package/dist/{src/components → components}/badge/badge.d.ts +0 -0
  33. /package/dist/{src/components → components}/badge/badge.js +0 -0
  34. /package/dist/{src/components → components}/box/box.d.ts +0 -0
  35. /package/dist/{src/components → components}/box/box.js +0 -0
  36. /package/dist/{src/components → components}/button/button.d.ts +0 -0
  37. /package/dist/{src/components → components}/button/button.js +0 -0
  38. /package/dist/{src/components → components}/client-modal/client-modal.d.ts +0 -0
  39. /package/dist/{src/components → components}/client-modal/client-modal.js +0 -0
  40. /package/dist/{src/components → components}/copy-button/copy-button.d.ts +0 -0
  41. /package/dist/{src/components → components}/copy-button/copy-button.js +0 -0
  42. /package/dist/{src/components → components}/decorated-icon/decorated-icon.d.ts +0 -0
  43. /package/dist/{src/components → components}/decorated-icon/decorated-icon.js +0 -0
  44. /package/dist/{src/components → components}/dropdown-menu/dropdown-menu.d.ts +0 -0
  45. /package/dist/{src/components → components}/dropdown-menu/dropdown-menu.js +0 -0
  46. /package/dist/{src/components → components}/error-boundary/error-boundary.d.ts +0 -0
  47. /package/dist/{src/components → components}/error-boundary/error-boundary.js +0 -0
  48. /package/dist/{src/components → components}/icon/icon-ids.d.ts +0 -0
  49. /package/dist/{src/components → components}/icon/icon.d.ts +0 -0
  50. /package/dist/{src/components → components}/icon/icon.js +0 -0
  51. /package/dist/{src/components → components}/icon-button/icon-button.d.ts +0 -0
  52. /package/dist/{src/components → components}/icon-button/icon-button.js +0 -0
  53. /package/dist/{src/components → components}/input-button/input-button.d.ts +0 -0
  54. /package/dist/{src/components → components}/input-button/input-button.js +0 -0
  55. /package/dist/{src/components → components}/mount-svg-sprite/mount-svg-sprite.d.ts +0 -0
  56. /package/dist/{src/components → components}/not-found-component/not-found-component.d.ts +0 -0
  57. /package/dist/{src/components → components}/not-found-component/not-found-component.js +0 -0
  58. /package/dist/{src/components → components}/page-padding/page-padding.d.ts +0 -0
  59. /package/dist/{src/components → components}/page-padding/page-padding.js +0 -0
  60. /package/dist/{src/components → components}/protocol-logo/protocol-logo.d.ts +0 -0
  61. /package/dist/{src/components → components}/protocol-logo/protocol-logo.js +0 -0
  62. /package/dist/{src/components → components}/scroll-area/index.d.ts +0 -0
  63. /package/dist/{src/components → components}/scroll-area/index.js +0 -0
  64. /package/dist/{src/components → components}/scroll-area/scroll-area-viewport.d.ts +0 -0
  65. /package/dist/{src/components → components}/scroll-area/scroll-area.d.ts +0 -0
  66. /package/dist/{src/components → components}/scroll-area/scroll-area.js +0 -0
  67. /package/dist/{src/components → components}/skeleton/skeleton.d.ts +0 -0
  68. /package/dist/{src/components → components}/skeleton/skeleton.js +0 -0
  69. /package/dist/{src/components → components}/switch/switch.d.ts +0 -0
  70. /package/dist/{src/components → components}/switch/switch.js +0 -0
  71. /package/dist/{src/components → components}/text-input/text-input.d.ts +0 -0
  72. /package/dist/{src/components → components}/text-input/text-input.js +0 -0
  73. /package/dist/{src/components → components}/tooltip/tooltip.d.ts +0 -0
  74. /package/dist/{src/components → components}/tooltip/tooltip.js +0 -0
  75. /package/dist/{src/components → components}/tooltip-provider/tooltip-provider.d.ts +0 -0
  76. /package/dist/{src/components → components}/tooltip-provider/tooltip-provider.js +0 -0
  77. /package/dist/{src/components → components}/touch-target/touch-target.d.ts +0 -0
  78. /package/dist/{src/components → components}/touch-target/touch-target.js +0 -0
  79. /package/dist/{src/components → components}/user-dropdown/user-dropdown.d.ts +0 -0
  80. /package/dist/{src/components → components}/user-dropdown/user-dropdown.js +0 -0
  81. /package/dist/{src/components → components}/user-dropdown-mobile/user-dropdown-mobile.d.ts +0 -0
  82. /package/dist/{src/components → components}/user-dropdown-mobile/user-dropdown-mobile.js +0 -0
  83. /package/dist/{src/hooks → hooks}/use-scroll-to-bottom.d.ts +0 -0
  84. /package/dist/{src/hooks → hooks}/use-scroll-to-bottom.js +0 -0
  85. /package/dist/{src/internal → internal}/modal-header.d.ts +0 -0
  86. /package/dist/{src/internal → internal}/modal-header.js +0 -0
  87. /package/dist/{src/internal → internal}/modal.d.ts +0 -0
  88. /package/dist/{src/internal → internal}/modal.js +0 -0
  89. /package/dist/{src/internal → internal}/react-portal.d.ts +0 -0
  90. /package/dist/{src/internal → internal}/react-portal.js +0 -0
  91. /package/dist/{src/internal → internal}/round-button.d.ts +0 -0
  92. /package/dist/{src/internal → internal}/round-button.js +0 -0
  93. /package/dist/{src/lib → lib}/tailwind-merge.d.ts +0 -0
  94. /package/dist/{src/lib → lib}/tailwind-merge.js +0 -0
  95. /package/dist/{src/utils → utils}/disable-password-managers.d.ts +0 -0
  96. /package/dist/{src/utils → utils}/disable-password-managers.js +0 -0
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * A loose Zod schema for validating ECharts chart options.
4
+ *
5
+ * This schema validates the basic structure without enforcing
6
+ * strict ECharts types, which allows JSON imports to pass validation
7
+ * while still providing runtime type checking.
8
+ */
9
+ export declare const EChartsChartOption: z.ZodObject<{}, z.core.$catchall<z.ZodUnknown>>;
10
+ export type EChartsChartOption = z.infer<typeof EChartsChartOption>;
11
+ export declare function isEChartsChartOption(value: unknown): value is EChartsChartOption;
@@ -0,0 +1,9 @@
1
+ import { z as t } from "zod";
2
+ const n = t.object({}).catchall(t.unknown());
3
+ function s(r) {
4
+ return n.safeParse(r).success;
5
+ }
6
+ export {
7
+ n as EChartsChartOption,
8
+ s as isEChartsChartOption
9
+ };
@@ -0,0 +1,22 @@
1
+ import { EChartsOption } from 'echarts';
2
+ import { EChartsThemeOption } from './echarts-theme-option';
3
+ export type { EChartsOption, EChartsThemeOption };
4
+ export type EChartsRendererRef = {
5
+ download: () => Promise<void>;
6
+ };
7
+ export type EChartsRendererProps = {
8
+ readonly option: EChartsOption;
9
+ readonly theme?: {
10
+ name: string;
11
+ config: EChartsThemeOption;
12
+ };
13
+ readonly className?: string;
14
+ } & Omit<React.ComponentPropsWithoutRef<'div'>, 'children'>;
15
+ export declare const EChartsRenderer: import('react').ForwardRefExoticComponent<{
16
+ readonly option: EChartsOption;
17
+ readonly theme?: {
18
+ name: string;
19
+ config: EChartsThemeOption;
20
+ };
21
+ readonly className?: string;
22
+ } & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "children"> & import('react').RefAttributes<EChartsRendererRef>>;
@@ -0,0 +1,21 @@
1
+ "use client";
2
+ import { jsx as r } from "react/jsx-runtime";
3
+ import { forwardRef as f, useImperativeHandle as i } from "react";
4
+ import { twMerge as d } from "../../lib/tailwind-merge.js";
5
+ import { useChartInstance as m } from "./use-chart-instance.js";
6
+ const v = f(function({ className: o, option: t, theme: n, ...a }, l) {
7
+ const { containerRef: s, downloadChart: e } = m({
8
+ options: t,
9
+ theme: n
10
+ });
11
+ return i(
12
+ l,
13
+ () => ({
14
+ download: e
15
+ }),
16
+ [e]
17
+ ), /* @__PURE__ */ r("div", { className: d("relative h-full w-full", o), ...a, children: /* @__PURE__ */ r("div", { className: "h-full w-full", ref: s }) });
18
+ });
19
+ export {
20
+ v as EChartsRenderer
21
+ };
@@ -0,0 +1,4 @@
1
+ import { z } from 'zod';
2
+ export declare const EChartsThemeOption: z.ZodObject<{}, z.core.$catchall<z.ZodUnknown>>;
3
+ export type EChartsThemeOption = z.infer<typeof EChartsThemeOption>;
4
+ export declare function isEChartsThemeOption(value: unknown): value is EChartsThemeOption;
@@ -0,0 +1,9 @@
1
+ import { z as t } from "zod";
2
+ const n = t.object({}).catchall(t.unknown());
3
+ function s(e) {
4
+ return n.safeParse(e).success;
5
+ }
6
+ export {
7
+ n as EChartsThemeOption,
8
+ s as isEChartsThemeOption
9
+ };
@@ -0,0 +1,227 @@
1
+ export declare const MAVRIK_THEME: {
2
+ readonly name: "mavrik";
3
+ readonly config: {
4
+ color: {
5
+ type: string;
6
+ x: number;
7
+ y: number;
8
+ x2: number;
9
+ y2: number;
10
+ colorStops: {
11
+ offset: number;
12
+ color: string;
13
+ }[];
14
+ }[];
15
+ backgroundColor: string;
16
+ textStyle: {
17
+ fontFamily: string;
18
+ fontWeight: number;
19
+ };
20
+ title: {
21
+ top: number;
22
+ left: number;
23
+ textStyle: {
24
+ color: string;
25
+ fontSize: number;
26
+ fontWeight: number;
27
+ };
28
+ subtextStyle: {
29
+ color: string;
30
+ };
31
+ };
32
+ line: {
33
+ itemStyle: {
34
+ borderWidth: number;
35
+ };
36
+ lineStyle: {
37
+ width: number;
38
+ };
39
+ areaStyle: {
40
+ opacity: number;
41
+ };
42
+ showSymbol: boolean;
43
+ symbolSize: number;
44
+ symbol: string;
45
+ smooth: boolean;
46
+ sampling: string;
47
+ };
48
+ bar: {
49
+ barGap: string;
50
+ barCategoryGap: string;
51
+ };
52
+ categoryAxis: {
53
+ axisLine: {
54
+ show: boolean;
55
+ lineStyle: {
56
+ color: string;
57
+ type: string;
58
+ };
59
+ };
60
+ axisTick: {
61
+ show: boolean;
62
+ };
63
+ axisLabel: {
64
+ show: boolean;
65
+ color: string;
66
+ };
67
+ nameLocation: string;
68
+ nameTextStyle: {
69
+ color: string;
70
+ fontSize: number;
71
+ fontWeight: number;
72
+ };
73
+ splitLine: {
74
+ show: boolean;
75
+ };
76
+ };
77
+ valueAxis: {
78
+ axisLine: {
79
+ show: boolean;
80
+ };
81
+ axisTick: {
82
+ show: boolean;
83
+ };
84
+ axisLabel: {
85
+ show: boolean;
86
+ color: string;
87
+ };
88
+ nameLocation: string;
89
+ nameTextStyle: {
90
+ color: string;
91
+ fontSize: number;
92
+ fontWeight: number;
93
+ };
94
+ splitLine: {
95
+ show: boolean;
96
+ lineStyle: {
97
+ color: string[];
98
+ type: string;
99
+ };
100
+ };
101
+ };
102
+ logAxis: {
103
+ axisLine: {
104
+ show: boolean;
105
+ };
106
+ axisTick: {
107
+ show: boolean;
108
+ };
109
+ axisLabel: {
110
+ show: boolean;
111
+ color: string;
112
+ };
113
+ nameLocation: string;
114
+ nameTextStyle: {
115
+ color: string;
116
+ fontSize: number;
117
+ fontWeight: number;
118
+ };
119
+ splitLine: {
120
+ show: boolean;
121
+ lineStyle: {
122
+ color: string[];
123
+ type: string;
124
+ };
125
+ };
126
+ };
127
+ timeAxis: {
128
+ axisLine: {
129
+ show: boolean;
130
+ lineStyle: {
131
+ color: string;
132
+ };
133
+ };
134
+ axisTick: {
135
+ show: boolean;
136
+ };
137
+ axisLabel: {
138
+ show: boolean;
139
+ color: string;
140
+ };
141
+ nameLocation: string;
142
+ nameTextStyle: {
143
+ color: string;
144
+ fontSize: number;
145
+ fontWeight: number;
146
+ };
147
+ splitLine: {
148
+ show: boolean;
149
+ };
150
+ };
151
+ legend: {
152
+ top: number;
153
+ left: string;
154
+ right: number;
155
+ icon: string;
156
+ itemGap: number;
157
+ itemWidth: number;
158
+ itemHeight: number;
159
+ textStyle: {
160
+ color: string;
161
+ fontSize: number;
162
+ };
163
+ };
164
+ grid: {
165
+ top: number;
166
+ left: number;
167
+ right: number;
168
+ bottom: number;
169
+ outerBoundsMode: string;
170
+ outerBoundsContain: string;
171
+ };
172
+ dataZoom: {
173
+ backgroundColor: string;
174
+ borderColor: string;
175
+ borderRadius: number;
176
+ dataBackground: {
177
+ lineStyle: {
178
+ color: string;
179
+ width: number;
180
+ };
181
+ areaStyle: {
182
+ color: string;
183
+ };
184
+ };
185
+ selectedDataBackground: {
186
+ lineStyle: {
187
+ color: string;
188
+ width: number;
189
+ };
190
+ areaStyle: {
191
+ color: string;
192
+ };
193
+ };
194
+ fillerColor: string;
195
+ handleStyle: {
196
+ color: string;
197
+ borderColor: string;
198
+ };
199
+ moveHandleStyle: {
200
+ color: string;
201
+ };
202
+ brushStyle: {
203
+ color: string;
204
+ };
205
+ emphasis: {
206
+ handleStyle: {
207
+ color: string;
208
+ borderColor: string;
209
+ };
210
+ };
211
+ handleSize: string;
212
+ textStyle: {
213
+ color: string;
214
+ };
215
+ };
216
+ markPoint: {
217
+ label: {
218
+ color: string;
219
+ };
220
+ emphasis: {
221
+ label: {
222
+ color: string;
223
+ };
224
+ };
225
+ };
226
+ };
227
+ };
@@ -0,0 +1,11 @@
1
+ import { isEChartsThemeOption as r } from "./echarts-theme-option.js";
2
+ import o from "./mavrik-theme.json.js";
3
+ if (!r(o))
4
+ throw new Error("Invalid mavrik theme configuration");
5
+ const t = {
6
+ name: "mavrik",
7
+ config: o
8
+ };
9
+ export {
10
+ t as MAVRIK_THEME
11
+ };
@@ -0,0 +1,269 @@
1
+ declare const _default: {
2
+ "color": [
3
+ {
4
+ "type": "linear",
5
+ "x": 0,
6
+ "y": 0,
7
+ "x2": 0,
8
+ "y2": 1,
9
+ "colorStops": [
10
+ {
11
+ "offset": 0,
12
+ "color": "#C14E64"
13
+ },
14
+ {
15
+ "offset": 1,
16
+ "color": "#DF687D"
17
+ }
18
+ ]
19
+ },
20
+ {
21
+ "type": "linear",
22
+ "x": 0,
23
+ "y": 0,
24
+ "x2": 0,
25
+ "y2": 1,
26
+ "colorStops": [
27
+ {
28
+ "offset": 0,
29
+ "color": "#FFFFFF"
30
+ },
31
+ {
32
+ "offset": 1,
33
+ "color": "#FFFFFF"
34
+ }
35
+ ]
36
+ },
37
+ {
38
+ "type": "linear",
39
+ "x": 0,
40
+ "y": 0,
41
+ "x2": 0,
42
+ "y2": 1,
43
+ "colorStops": [
44
+ {
45
+ "offset": 0,
46
+ "color": "#1E6FDA"
47
+ },
48
+ {
49
+ "offset": 1,
50
+ "color": "#3F8CFF"
51
+ }
52
+ ]
53
+ }
54
+ ],
55
+ "backgroundColor": "#242731",
56
+ "textStyle": {
57
+ "fontFamily": "Poppins, sans-serif",
58
+ "fontWeight": 500
59
+ },
60
+ "title": {
61
+ "top": 32,
62
+ "left": 32,
63
+ "textStyle": {
64
+ "color": "#FFFFFF",
65
+ "fontSize": 16,
66
+ "fontWeight": 600
67
+ },
68
+ "subtextStyle": {
69
+ "color": "#A7A9AD"
70
+ }
71
+ },
72
+ "line": {
73
+ "itemStyle": {
74
+ "borderWidth": 1
75
+ },
76
+ "lineStyle": {
77
+ "width": 2
78
+ },
79
+ "areaStyle": {
80
+ "opacity": 0.15
81
+ },
82
+ "showSymbol": false,
83
+ "symbolSize": 5,
84
+ "symbol": "circle",
85
+ "smooth": false,
86
+ "sampling": "lttb"
87
+ },
88
+ "bar": {
89
+ "barGap": "25%",
90
+ "barCategoryGap": "25%"
91
+ },
92
+ "categoryAxis": {
93
+ "axisLine": {
94
+ "show": true,
95
+ "lineStyle": {
96
+ "color": "#3A3D46",
97
+ "type": "dashed"
98
+ }
99
+ },
100
+ "axisTick": {
101
+ "show": false
102
+ },
103
+ "axisLabel": {
104
+ "show": true,
105
+ "color": "#A7A9AD"
106
+ },
107
+ "nameLocation": "middle",
108
+ "nameTextStyle": {
109
+ "color": "#A7A9AD",
110
+ "fontSize": 11,
111
+ "fontWeight": 400
112
+ },
113
+ "splitLine": {
114
+ "show": false
115
+ }
116
+ },
117
+ "valueAxis": {
118
+ "axisLine": {
119
+ "show": false
120
+ },
121
+ "axisTick": {
122
+ "show": false
123
+ },
124
+ "axisLabel": {
125
+ "show": true,
126
+ "color": "#A7A9AD"
127
+ },
128
+ "nameLocation": "middle",
129
+ "nameTextStyle": {
130
+ "color": "#A7A9AD",
131
+ "fontSize": 11,
132
+ "fontWeight": 400
133
+ },
134
+ "splitLine": {
135
+ "show": true,
136
+ "lineStyle": {
137
+ "color": ["#3A3D46"],
138
+ "type": "dashed"
139
+ }
140
+ }
141
+ },
142
+ "logAxis": {
143
+ "axisLine": {
144
+ "show": false
145
+ },
146
+ "axisTick": {
147
+ "show": false
148
+ },
149
+ "axisLabel": {
150
+ "show": true,
151
+ "color": "#A7A9AD"
152
+ },
153
+ "nameLocation": "middle",
154
+ "nameTextStyle": {
155
+ "color": "#A7A9AD",
156
+ "fontSize": 11,
157
+ "fontWeight": 400
158
+ },
159
+ "splitLine": {
160
+ "show": true,
161
+ "lineStyle": {
162
+ "color": ["#3A3D46"],
163
+ "type": "dashed"
164
+ }
165
+ }
166
+ },
167
+ "timeAxis": {
168
+ "axisLine": {
169
+ "show": true,
170
+ "lineStyle": {
171
+ "color": "#3A3D46"
172
+ }
173
+ },
174
+ "axisTick": {
175
+ "show": false
176
+ },
177
+ "axisLabel": {
178
+ "show": true,
179
+ "color": "#A7A9AD"
180
+ },
181
+ "nameLocation": "middle",
182
+ "nameTextStyle": {
183
+ "color": "#A7A9AD",
184
+ "fontSize": 11,
185
+ "fontWeight": 400
186
+ },
187
+ "splitLine": {
188
+ "show": false
189
+ }
190
+ },
191
+ "legend": {
192
+ "top": 82,
193
+ "left": "auto",
194
+ "right": 32,
195
+ "icon": "circle",
196
+ "itemGap": 22,
197
+ "itemWidth": 12,
198
+ "itemHeight": 12,
199
+ "textStyle": {
200
+ "color": "#A7A9AD",
201
+ "fontSize": 11
202
+ }
203
+ },
204
+ "grid": {
205
+ "top": 132,
206
+ "left": 32,
207
+ "right": 32,
208
+ "bottom": 70,
209
+ "outerBoundsMode": "same",
210
+ "outerBoundsContain": "axisLabel"
211
+ },
212
+ "dataZoom": {
213
+ "backgroundColor": "rgba(36, 39, 49, 0)",
214
+ "borderColor": "#3A3D46",
215
+ "borderRadius": 4,
216
+ "dataBackground": {
217
+ "lineStyle": {
218
+ "color": "#606060",
219
+ "width": 1
220
+ },
221
+ "areaStyle": {
222
+ "color": "rgba(96, 96, 96, 0.3)"
223
+ }
224
+ },
225
+ "selectedDataBackground": {
226
+ "lineStyle": {
227
+ "color": "#b36674",
228
+ "width": 1
229
+ },
230
+ "areaStyle": {
231
+ "color": "rgba(164, 91, 105, 0.5)"
232
+ }
233
+ },
234
+ "fillerColor": "rgba(82, 45, 52, 0.35)",
235
+ "handleStyle": {
236
+ "color": "#C14E64",
237
+ "borderColor": "#C14E64"
238
+ },
239
+ "moveHandleStyle": {
240
+ "color": "#b36674"
241
+ },
242
+ "brushStyle": {
243
+ "color": "rgba(95, 58, 65, 0.2)"
244
+ },
245
+ "emphasis": {
246
+ "handleStyle": {
247
+ "color": "rgb(209, 123, 140)",
248
+ "borderColor": "rgb(209, 123, 140)"
249
+ }
250
+ },
251
+ "handleSize": "100%",
252
+ "textStyle": {
253
+ "color": "#A7A9AD"
254
+ }
255
+ },
256
+ "markPoint": {
257
+ "label": {
258
+ "color": "#A7A9AD"
259
+ },
260
+ "emphasis": {
261
+ "label": {
262
+ "color": "#FFFFFF"
263
+ }
264
+ }
265
+ }
266
+ }
267
+ ;
268
+
269
+ export default _default;
@@ -0,0 +1,33 @@
1
+ const o = [{ type: "linear", x: 0, y: 0, x2: 0, y2: 1, colorStops: [{ offset: 0, color: "#C14E64" }, { offset: 1, color: "#DF687D" }] }, { type: "linear", x: 0, y: 0, x2: 0, y2: 1, colorStops: [{ offset: 0, color: "#FFFFFF" }, { offset: 1, color: "#FFFFFF" }] }, { type: "linear", x: 0, y: 0, x2: 0, y2: 1, colorStops: [{ offset: 0, color: "#1E6FDA" }, { offset: 1, color: "#3F8CFF" }] }], e = "#242731", t = { fontFamily: "Poppins, sans-serif", fontWeight: 500 }, l = { top: 32, left: 32, textStyle: { color: "#FFFFFF", fontSize: 16, fontWeight: 600 }, subtextStyle: { color: "#A7A9AD" } }, i = { itemStyle: { borderWidth: 1 }, lineStyle: { width: 2 }, areaStyle: { opacity: 0.15 }, showSymbol: !1, symbolSize: 5, symbol: "circle", smooth: !1, sampling: "lttb" }, a = { barGap: "25%", barCategoryGap: "25%" }, s = { axisLine: { show: !0, lineStyle: { color: "#3A3D46", type: "dashed" } }, axisTick: { show: !1 }, axisLabel: { show: !0, color: "#A7A9AD" }, nameLocation: "middle", nameTextStyle: { color: "#A7A9AD", fontSize: 11, fontWeight: 400 }, splitLine: { show: !1 } }, r = { axisLine: { show: !1 }, axisTick: { show: !1 }, axisLabel: { show: !0, color: "#A7A9AD" }, nameLocation: "middle", nameTextStyle: { color: "#A7A9AD", fontSize: 11, fontWeight: 400 }, splitLine: { show: !0, lineStyle: { color: ["#3A3D46"], type: "dashed" } } }, n = { axisLine: { show: !1 }, axisTick: { show: !1 }, axisLabel: { show: !0, color: "#A7A9AD" }, nameLocation: "middle", nameTextStyle: { color: "#A7A9AD", fontSize: 11, fontWeight: 400 }, splitLine: { show: !0, lineStyle: { color: ["#3A3D46"], type: "dashed" } } }, c = { axisLine: { show: !0, lineStyle: { color: "#3A3D46" } }, axisTick: { show: !1 }, axisLabel: { show: !0, color: "#A7A9AD" }, nameLocation: "middle", nameTextStyle: { color: "#A7A9AD", fontSize: 11, fontWeight: 400 }, splitLine: { show: !1 } }, A = { top: 82, left: "auto", right: 32, icon: "circle", itemGap: 22, itemWidth: 12, itemHeight: 12, textStyle: { color: "#A7A9AD", fontSize: 11 } }, y = { top: 132, left: 32, right: 32, bottom: 70, outerBoundsMode: "same", outerBoundsContain: "axisLabel" }, d = { backgroundColor: "rgba(36, 39, 49, 0)", borderColor: "#3A3D46", borderRadius: 4, dataBackground: { lineStyle: { color: "#606060", width: 1 }, areaStyle: { color: "rgba(96, 96, 96, 0.3)" } }, selectedDataBackground: { lineStyle: { color: "#b36674", width: 1 }, areaStyle: { color: "rgba(164, 91, 105, 0.5)" } }, fillerColor: "rgba(82, 45, 52, 0.35)", handleStyle: { color: "#C14E64", borderColor: "#C14E64" }, moveHandleStyle: { color: "#b36674" }, brushStyle: { color: "rgba(95, 58, 65, 0.2)" }, emphasis: { handleStyle: { color: "rgb(209, 123, 140)", borderColor: "rgb(209, 123, 140)" } }, handleSize: "100%", textStyle: { color: "#A7A9AD" } }, f = { label: { color: "#A7A9AD" }, emphasis: { label: { color: "#FFFFFF" } } }, h = {
2
+ color: o,
3
+ backgroundColor: e,
4
+ textStyle: t,
5
+ title: l,
6
+ line: i,
7
+ bar: a,
8
+ categoryAxis: s,
9
+ valueAxis: r,
10
+ logAxis: n,
11
+ timeAxis: c,
12
+ legend: A,
13
+ grid: y,
14
+ dataZoom: d,
15
+ markPoint: f
16
+ };
17
+ export {
18
+ e as backgroundColor,
19
+ a as bar,
20
+ s as categoryAxis,
21
+ o as color,
22
+ d as dataZoom,
23
+ h as default,
24
+ y as grid,
25
+ A as legend,
26
+ i as line,
27
+ n as logAxis,
28
+ f as markPoint,
29
+ t as textStyle,
30
+ c as timeAxis,
31
+ l as title,
32
+ r as valueAxis
33
+ };
@@ -0,0 +1,19 @@
1
+ import { EChartsOption } from 'echarts';
2
+ import { EChartsThemeOption } from './echarts-theme-option';
3
+ export type UseChartInstanceProps = {
4
+ options: EChartsOption;
5
+ theme?: {
6
+ name: string;
7
+ config: EChartsThemeOption;
8
+ };
9
+ };
10
+ export type UseChartInstanceReturn = {
11
+ containerRef: React.RefObject<HTMLDivElement | null>;
12
+ isReady: boolean;
13
+ downloadChart: () => Promise<void>;
14
+ };
15
+ /**
16
+ * React hook for managing ECharts instance lifecycle and download functionality.
17
+ * Handles initialization, updates, cleanup, and resize.
18
+ */
19
+ export declare function useChartInstance({ options, theme }: UseChartInstanceProps): UseChartInstanceReturn;
@@ -0,0 +1,46 @@
1
+ "use client";
2
+ import { init as f, registerTheme as h } from "echarts";
3
+ import { useRef as i, useState as w, useEffect as d, useCallback as g } from "react";
4
+ const u = /* @__PURE__ */ new Set();
5
+ function R(e, n) {
6
+ u.has(e) || (h(e, n), u.add(e));
7
+ }
8
+ function b({ options: e, theme: n }) {
9
+ const o = i(null), c = i(null), [s, a] = w(!1);
10
+ d(() => {
11
+ if (!o.current) return;
12
+ n && R(n.name, n.config);
13
+ const r = f(o.current, n?.name, {
14
+ renderer: "svg"
15
+ });
16
+ c.current = r, r.setOption(e), a(!0);
17
+ const t = new ResizeObserver(() => {
18
+ r.resize();
19
+ });
20
+ return t.observe(o.current), () => {
21
+ t.disconnect(), r.dispose(), c.current = null, a(!1);
22
+ };
23
+ }, [e, n]), d(() => {
24
+ !c.current || !s || c.current.setOption(e);
25
+ }, [e, s]);
26
+ const l = g(async () => {
27
+ if (!c.current)
28
+ throw new Error("Chart is not initialized");
29
+ try {
30
+ const r = c.current.getDataURL({
31
+ type: "svg"
32
+ }), t = document.createElement("a");
33
+ t.download = `chart-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.svg`, t.href = r, document.body.appendChild(t), t.click(), document.body.removeChild(t);
34
+ } catch (r) {
35
+ throw console.error("Failed to download chart:", r), new Error("Failed to download chart");
36
+ }
37
+ }, []);
38
+ return {
39
+ containerRef: o,
40
+ isReady: s,
41
+ downloadChart: l
42
+ };
43
+ }
44
+ export {
45
+ b as useChartInstance
46
+ };