@aivenio/aquarium 2.3.2 → 2.5.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 (52) hide show
  1. package/dist/_variables.scss +49 -0
  2. package/dist/atoms.cjs +55 -0
  3. package/dist/atoms.mjs +55 -0
  4. package/dist/charts.cjs +1166 -325
  5. package/dist/charts.mjs +1167 -328
  6. package/dist/src/charts/AreaChart/AreaChart.d.ts +2 -1
  7. package/dist/src/charts/AreaChart/AreaChart.js +14 -30
  8. package/dist/src/charts/BarChart/BarChart.d.ts +2 -1
  9. package/dist/src/charts/BarChart/BarChart.js +17 -21
  10. package/dist/src/charts/DefaultPalette/DefaultPalette.d.ts +15 -0
  11. package/dist/src/charts/DefaultPalette/DefaultPalette.js +23 -0
  12. package/dist/src/charts/Legend/Legend.d.ts +4 -1
  13. package/dist/src/charts/Legend/Legend.js +25 -3
  14. package/dist/src/charts/LineChart/LineChart.d.ts +2 -1
  15. package/dist/src/charts/LineChart/LineChart.js +17 -32
  16. package/dist/src/charts/PieChart/DoughnutChart.d.ts +2 -1
  17. package/dist/src/charts/PieChart/DoughnutChart.js +16 -4
  18. package/dist/src/charts/PieChart/PieChart.d.ts +3 -2
  19. package/dist/src/charts/PieChart/PieChart.js +17 -2
  20. package/dist/src/charts/PieChart/renderPieChildren.d.ts +5 -1
  21. package/dist/src/charts/PieChart/renderPieChildren.js +7 -4
  22. package/dist/src/charts/Tooltip/Tooltip.js +2 -2
  23. package/dist/src/charts/{PieChart → Tooltip}/TooltipContentWrapper.d.ts +2 -1
  24. package/dist/src/charts/Tooltip/TooltipContentWrapper.js +37 -0
  25. package/dist/src/charts/hooks/index.d.ts +1 -0
  26. package/dist/src/charts/hooks/index.js +2 -0
  27. package/dist/src/charts/hooks/useDefaultColor.d.ts +1 -0
  28. package/dist/src/charts/hooks/useDefaultColor.js +7 -0
  29. package/dist/src/charts/hooks/useDefaultColor.spec.d.ts +1 -0
  30. package/dist/src/charts/hooks/useDefaultColor.spec.js +28 -0
  31. package/dist/src/charts/index.d.ts +2 -0
  32. package/dist/src/charts/index.js +3 -1
  33. package/dist/src/charts/lib/utils.d.ts +5 -1
  34. package/dist/src/charts/lib/utils.js +27 -1
  35. package/dist/src/molecules/Combobox/Combobox.d.ts +6 -5
  36. package/dist/src/molecules/Combobox/Combobox.js +21 -12
  37. package/dist/src/molecules/DatePicker/Calendar.js +2 -2
  38. package/dist/src/molecules/DatePicker/RangeCalendar.js +3 -3
  39. package/dist/src/molecules/MultiSelect/MultiSelect.d.ts +5 -11
  40. package/dist/src/molecules/MultiSelect/MultiSelect.js +2 -9
  41. package/dist/src/molecules/Section/Section.js +7 -2
  42. package/dist/src/molecules/Select/utils.d.ts +3 -0
  43. package/dist/src/molecules/Select/utils.js +7 -0
  44. package/dist/src/tokens/tokens.json +55 -0
  45. package/dist/styles.css +75 -20
  46. package/dist/system.cjs +143 -78
  47. package/dist/system.mjs +101 -36
  48. package/dist/tokens.json +55 -0
  49. package/dist/tsconfig.module.tsbuildinfo +1 -1
  50. package/dist/types/tailwindGenerated.d.ts +1 -1
  51. package/package.json +1 -1
  52. package/dist/src/charts/PieChart/TooltipContentWrapper.js +0 -31
package/dist/charts.mjs CHANGED
@@ -31,12 +31,879 @@ var __objRest = (source, exclude) => {
31
31
  };
32
32
 
33
33
  // src/charts/AreaChart/AreaChart.tsx
34
- import React4 from "react";
34
+ import React8 from "react";
35
35
  import { Area as _Area, AreaChart as _AreaChart } from "recharts";
36
36
 
37
- // src/charts/Axis/Axis.tsx
37
+ // src/charts/Container/Container.tsx
38
38
  import React from "react";
39
- import { XAxis as _XAxis, YAxis as _YAxis } from "recharts";
39
+ import { ResponsiveContainer as _ResponsiveContainer } from "recharts";
40
+
41
+ // src/utils/tailwind.ts
42
+ import originalClassNames from "classnames";
43
+ function cleanClassNames(classNames2) {
44
+ const tokens = classNames2.split(/\s+/);
45
+ return tokens.filter((item) => item).join(" ");
46
+ }
47
+ function tw(classesOrModifiers1, classesOrModifiers2, classesOrModifiers3, classesOrModifiers4, classesOrModifiers5, classesOrModifiers6, classesOrModifiers7, classesOrModifiers8, classesOrModifiers9, classesOrModifiers10) {
48
+ const result = originalClassNames(
49
+ classesOrModifiers1,
50
+ classesOrModifiers2,
51
+ classesOrModifiers3,
52
+ classesOrModifiers4,
53
+ classesOrModifiers5,
54
+ classesOrModifiers6,
55
+ classesOrModifiers7,
56
+ classesOrModifiers8,
57
+ classesOrModifiers9,
58
+ classesOrModifiers10
59
+ );
60
+ return cleanClassNames(result);
61
+ }
62
+ var classNames = (...args) => {
63
+ const result = originalClassNames(...args);
64
+ return cleanClassNames(result);
65
+ };
66
+
67
+ // src/charts/Container/Container.tsx
68
+ var ResponsiveContainer = (_a) => {
69
+ var _b = _a, {
70
+ isBusy = false,
71
+ busyLabel = "Loading...",
72
+ className,
73
+ style,
74
+ width = "100%",
75
+ height = "100%",
76
+ minWidth,
77
+ minHeight,
78
+ maxHeight
79
+ } = _b, props = __objRest(_b, [
80
+ "isBusy",
81
+ "busyLabel",
82
+ "className",
83
+ "style",
84
+ "width",
85
+ "height",
86
+ "minWidth",
87
+ "minHeight",
88
+ "maxHeight"
89
+ ]);
90
+ return /* @__PURE__ */ React.createElement("div", {
91
+ "aria-busy": isBusy,
92
+ className: classNames(className, tw("relative")),
93
+ style: __spreadProps(__spreadValues({}, style), { width, height, minWidth, minHeight, maxHeight })
94
+ }, /* @__PURE__ */ React.createElement("div", {
95
+ className: classNames(
96
+ tw("absolute inset-0 transition-colors flex items-center justify-center", {
97
+ "delay-300 z-40": isBusy
98
+ })
99
+ ),
100
+ style: isBusy ? { backgroundColor: "rgba(255, 255, 255, 0.5)" } : {}
101
+ }, /* @__PURE__ */ React.createElement("span", {
102
+ "aria-hidden": !isBusy,
103
+ className: tw("rounded-full text-white bg-black typography-caption py-2 px-4 transition-all", {
104
+ "opacity-100 delay-300": isBusy,
105
+ "mb-[-20px] opacity-0": !isBusy
106
+ })
107
+ }, isBusy && busyLabel)), /* @__PURE__ */ React.createElement(_ResponsiveContainer, __spreadValues({}, props)));
108
+ };
109
+
110
+ // src/charts/DefaultPalette/DefaultPalette.tsx
111
+ import React2 from "react";
112
+
113
+ // src/tokens/tokens.json
114
+ var tokens_default = {
115
+ borderRadius: {
116
+ default: "4px",
117
+ full: "9999px",
118
+ "3xl": "1.5rem",
119
+ "2xl": "1rem",
120
+ xl: "0.75rem",
121
+ lg: "0.5rem",
122
+ md: "0.375rem",
123
+ sm: "0.125rem",
124
+ none: "0px"
125
+ },
126
+ borderWidth: {
127
+ "0": "0px",
128
+ "1": "1px",
129
+ "2": "2px",
130
+ "4": "4px",
131
+ "8": "8px",
132
+ default: "1px"
133
+ },
134
+ backgroundColor: {
135
+ body: "white",
136
+ "body-intense": "rgba(58,58,68,1)",
137
+ "popover-content": "white",
138
+ muted: "rgba(247,247,250,1)",
139
+ default: "rgba(237,237,240,1)",
140
+ intense: "rgba(210,210,214,1)",
141
+ primary: {
142
+ muted: "rgba(185,197,239,1)",
143
+ default: "rgba(53,69,190,1)",
144
+ intense: "rgba(34,47,149,1)",
145
+ active: "rgba(243,246,255,1)",
146
+ hover: "rgba(243,246,255,1)"
147
+ },
148
+ info: {
149
+ muted: "rgba(224,245,254,1)",
150
+ default: "rgba(3,153,227,1)",
151
+ intense: "rgba(1,116,186,1)"
152
+ },
153
+ success: {
154
+ muted: "rgba(236,247,237,1)",
155
+ default: "rgba(0,179,0,1)",
156
+ intense: "rgba(0,142,0,1)"
157
+ },
158
+ warning: {
159
+ muted: "rgba(255,248,234,1)",
160
+ default: "rgba(255,179,0,1)",
161
+ intense: "rgba(255,144,3,1)"
162
+ },
163
+ danger: {
164
+ muted: "rgba(255,203,210,1)",
165
+ default: "rgba(255,173,179,1)",
166
+ intense: "rgba(230,39,40,1)"
167
+ },
168
+ status: {
169
+ announcement: "rgba(243,246,255,1)",
170
+ info: "rgba(224,245,254,1)",
171
+ warning: "rgba(255,248,234,1)",
172
+ danger: "rgba(254,232,231,1)",
173
+ success: "rgba(236,247,237,1)"
174
+ },
175
+ "icon-button": {
176
+ hover: "rgba(25,25,29,.05)"
177
+ }
178
+ },
179
+ borderColor: {
180
+ muted: "rgba(237,237,240,1)",
181
+ default: "rgba(210,210,214,1)",
182
+ intense: "rgba(120,120,133,1)",
183
+ primary: {
184
+ muted: "rgba(129,142,236,1)",
185
+ default: "rgba(53,69,190,1)",
186
+ intense: "rgba(14,22,82,1)"
187
+ },
188
+ info: {
189
+ muted: "rgba(40,180,244,1)",
190
+ default: "rgba(3,153,227,1)",
191
+ intense: "rgba(1,116,186,1)"
192
+ },
193
+ success: {
194
+ muted: "rgba(203,255,201,1)",
195
+ default: "rgba(96,219,87,1)",
196
+ intense: "rgba(0,179,0,1)"
197
+ },
198
+ warning: {
199
+ muted: "rgba(254,235,178,1)",
200
+ default: "rgba(255,179,0,1)",
201
+ intense: "rgba(255,144,3,1)"
202
+ },
203
+ danger: {
204
+ muted: "rgba(255,203,210,1)",
205
+ default: "rgba(230,39,40,1)",
206
+ intense: "rgba(197,0,1,1)"
207
+ }
208
+ },
209
+ chartColors: {
210
+ default: "rgba(180, 180, 187, 1)",
211
+ primaryCategorical: {
212
+ "0": "rgba(88, 101, 205, 1)",
213
+ "1": "rgba(255, 53, 84, 1)",
214
+ "2": "rgba(40, 180, 244, 1)",
215
+ "3": "rgba(249, 106, 2, 1)",
216
+ "4": "rgba(0, 179, 0, 1)",
217
+ "5": "rgba(255, 193, 7, 1)"
218
+ },
219
+ secondaryCategorical: {
220
+ "0": "rgba(53, 69, 190, 1)",
221
+ "1": "rgba(253, 159, 0, 1)",
222
+ "2": "rgba(255, 53, 84, 1)",
223
+ "3": "rgba(0, 179, 0, 1)",
224
+ "4": "rgba(243, 88, 13, 1)",
225
+ "5": "rgba(3, 153, 227, 1)",
226
+ "6": "rgba(231, 0, 0, 1)",
227
+ "7": "rgba(34, 47, 149, 1)",
228
+ "8": "rgba(255, 144, 3, 1)",
229
+ "9": "rgba(228, 26, 74, 1)",
230
+ "10": "rgba(0, 159, 0, 1)",
231
+ "11": "rgba(235, 70, 16, 1)",
232
+ "12": "rgba(1, 116, 186, 1)",
233
+ "13": "rgba(197, 0, 1, 1)",
234
+ "14": "rgba(225, 29, 22, 1)",
235
+ "15": "rgba(170, 0, 0, 1)",
236
+ "16": "rgba(2, 86, 154, 1)",
237
+ "17": "rgba(167, 0, 69, 1)",
238
+ "18": "rgba(0, 111, 0, 1)",
239
+ "19": "rgba(254, 109, 0, 1)",
240
+ "20": "rgba(14, 22, 82, 1)",
241
+ "21": "rgba(88, 101, 205, 1)",
242
+ "22": "rgba(255, 179, 0, 1)",
243
+ "23": "rgba(255, 82, 117, 1)",
244
+ "24": "rgba(0, 195, 0, 1)",
245
+ "25": "rgba(249, 106, 2, 1)",
246
+ "26": "rgba(40, 180, 244, 1)",
247
+ "27": "rgba(230, 39, 40, 1)",
248
+ "28": "rgba(129, 142, 236, 1)",
249
+ "29": "rgba(255, 193, 7, 1)",
250
+ "30": "rgba(255, 111, 148, 1)",
251
+ "31": "rgba(96, 219, 87, 1)",
252
+ "32": "rgba(252, 135, 26, 1)",
253
+ "33": "rgba(127, 209, 247, 1)",
254
+ "34": "rgba(224, 80, 79, 1)",
255
+ "35": "rgba(185, 197, 239, 1)",
256
+ "36": "rgba(253, 212, 77, 1)",
257
+ "37": "rgba(255, 169, 201, 1)",
258
+ "38": "rgba(137, 235, 128, 1)",
259
+ "39": "rgba(250, 178, 110, 1)",
260
+ "40": "rgba(180, 229, 251, 1)",
261
+ "41": "rgba(255, 173, 179, 1)"
262
+ }
263
+ },
264
+ colors: {
265
+ white: "white",
266
+ black: "black",
267
+ transparent: "transparent",
268
+ current: "currentColor",
269
+ error: {
270
+ "0": "rgba(254,242,241,1)",
271
+ "5": "rgba(254,232,231,1)",
272
+ "10": "rgba(255,203,210,1)",
273
+ "20": "rgba(255,173,179,1)",
274
+ "30": "rgba(237,121,117,1)",
275
+ "40": "rgba(224,80,79,1)",
276
+ "50": "rgba(230,39,40,1)",
277
+ "60": "rgba(231,0,0,1)",
278
+ "70": "rgba(216,0,5,1)",
279
+ "80": "rgba(197,0,1,1)",
280
+ "90": "rgba(185,0,0,1)",
281
+ "100": "rgba(170,0,0,1)"
282
+ },
283
+ warning: {
284
+ "0": "rgba(255,253,249,1)",
285
+ "5": "rgba(255,248,234,1)",
286
+ "10": "rgba(255,242,205,1)",
287
+ "20": "rgba(254,235,178,1)",
288
+ "30": "rgba(253,223,129,1)",
289
+ "40": "rgba(253,212,77,1)",
290
+ "50": "rgba(253,201,38,1)",
291
+ "60": "rgba(255,193,7,1)",
292
+ "70": "rgba(255,179,0,1)",
293
+ "80": "rgba(253,159,0,1)",
294
+ "90": "rgba(255,144,3,1)",
295
+ "100": "rgba(254,109,0,1)"
296
+ },
297
+ success: {
298
+ "0": "rgba(245,250,245,1)",
299
+ "5": "rgba(236,247,237,1)",
300
+ "10": "rgba(203,255,201,1)",
301
+ "20": "rgba(175,255,167,1)",
302
+ "30": "rgba(137,235,128,1)",
303
+ "40": "rgba(96,219,87,1)",
304
+ "50": "rgba(64,206,55,1)",
305
+ "60": "rgba(0,195,0,1)",
306
+ "70": "rgba(0,179,0,1)",
307
+ "80": "rgba(0,159,0,1)",
308
+ "90": "rgba(0,142,0,1)",
309
+ "100": "rgba(0,111,0,1)"
310
+ },
311
+ info: {
312
+ "0": "rgba(249,253,255,1)",
313
+ "5": "rgba(239,250,255,1)",
314
+ "10": "rgba(224,245,254,1)",
315
+ "20": "rgba(180,229,251,1)",
316
+ "30": "rgba(127,209,247,1)",
317
+ "40": "rgba(76,194,247,1)",
318
+ "50": "rgba(40,180,244,1)",
319
+ "60": "rgba(2,168,243,1)",
320
+ "70": "rgba(3,153,227,1)",
321
+ "80": "rgba(7,136,209,1)",
322
+ "90": "rgba(1,116,186,1)",
323
+ "100": "rgba(2,86,154,1)"
324
+ },
325
+ grey: {
326
+ "0": "rgba(247,247,250,1)",
327
+ "5": "rgba(237,237,240,1)",
328
+ "10": "rgba(225,225,227,1)",
329
+ "20": "rgba(210,210,214,1)",
330
+ "30": "rgba(180,180,187,1)",
331
+ "40": "rgba(150,150,160,1)",
332
+ "50": "rgba(120,120,133,1)",
333
+ "60": "rgba(90,91,106,1)",
334
+ "70": "rgba(74,75,87,1)",
335
+ "80": "rgba(58,58,68,1)",
336
+ "90": "rgba(41,42,49,1)",
337
+ "100": "rgba(25,25,29,1)"
338
+ },
339
+ secondary: {
340
+ "0": "rgba(255,251,248,1)",
341
+ "5": "rgba(255,243,232,1)",
342
+ "10": "rgba(254,232,208,1)",
343
+ "20": "rgba(248,201,156,1)",
344
+ "30": "rgba(250,178,110,1)",
345
+ "40": "rgba(251,154,62,1)",
346
+ "50": "rgba(252,135,26,1)",
347
+ "60": "rgba(255,119,0,1)",
348
+ "70": "rgba(249,106,2,1)",
349
+ "80": "rgba(243,88,13,1)",
350
+ "90": "rgba(235,70,16,1)",
351
+ "100": "rgba(225,29,22,1)"
352
+ },
353
+ primary: {
354
+ "0": "rgba(255,255,255,1)",
355
+ "5": "rgba(243,246,255,1)",
356
+ "10": "rgba(227,233,255,1)",
357
+ "20": "rgba(213,221,250,1)",
358
+ "30": "rgba(199,209,244,1)",
359
+ "40": "rgba(185,197,239,1)",
360
+ "50": "rgba(157,170,238,1)",
361
+ "60": "rgba(129,142,236,1)",
362
+ "70": "rgba(88,101,205,1)",
363
+ "80": "rgba(53,69,190,1)",
364
+ "90": "rgba(34,47,149,1)",
365
+ "100": "rgba(14,22,82,1)"
366
+ }
367
+ },
368
+ textColor: {
369
+ inactive: "rgba(150,150,160,1)",
370
+ muted: "rgba(120,120,133,1)",
371
+ default: "rgba(74,75,87,1)",
372
+ intense: "rgba(41,42,49,1)",
373
+ opposite: {
374
+ default: "white"
375
+ },
376
+ primary: {
377
+ inactive: "rgba(185,197,239,1)",
378
+ active: "rgba(34,47,149,1)",
379
+ muted: "rgba(129,142,236,1)",
380
+ default: "rgba(88,101,205,1)",
381
+ intense: "rgba(53,69,190,1)"
382
+ },
383
+ info: {
384
+ inactive: "rgba(180,229,251,1)",
385
+ muted: "rgba(76,194,247,1)",
386
+ default: "rgba(3,153,227,1)",
387
+ intense: "rgba(1,116,186,1)"
388
+ },
389
+ success: {
390
+ inactive: "rgba(203,255,201,1)",
391
+ muted: "rgba(137,235,128,1)",
392
+ default: "rgba(0,179,0,1)",
393
+ intense: "rgba(0,142,0,1)"
394
+ },
395
+ warning: {
396
+ inactive: "rgba(254,235,178,1)",
397
+ muted: "rgba(253,212,77,1)",
398
+ default: "rgba(253,159,0,1)",
399
+ intense: "rgba(254,109,0,1)"
400
+ },
401
+ danger: {
402
+ inactive: "rgba(255,203,210,1)",
403
+ muted: "rgba(255,173,179,1)",
404
+ default: "rgba(230,39,40,1)",
405
+ intense: "rgba(197,0,1,1)"
406
+ }
407
+ },
408
+ boxShadow: {
409
+ "24dp": "0px 24px 48px rgba(90, 91, 106, 0.08), 0px 12px 24px rgba(58, 58, 68, 0.08)",
410
+ "16dp": "0px 16px 32px rgba(90, 91, 106, 0.12), 0px 8px 16px rgba(58, 58, 68, 0.12)",
411
+ "8dp": "0px 8px 16px rgba(90, 91, 106, 0.16), 0px 4px 8px rgba(58, 58, 68, 0.16)",
412
+ "4dp": "0px 4px 8px rgba(90, 91, 106, 0.20), 0px 2px 4px rgba(58, 58, 68, 0.20)",
413
+ "2dp": "0px 2px 4px rgba(90, 91, 106, 0.24), 0px 1px 2px rgba(58, 58, 68, 0.24)",
414
+ bodyInset: "inset 0 0 0 3px var(--aquarium-background-color-body)"
415
+ },
416
+ elevations: {
417
+ "24dp": "0px 24px 48px rgba(90, 91, 106, 0.08), 0px 12px 24px rgba(58, 58, 68, 0.08)",
418
+ "16dp": "0px 16px 32px rgba(90, 91, 106, 0.12), 0px 8px 16px rgba(58, 58, 68, 0.12)",
419
+ "8dp": "0px 8px 16px rgba(90, 91, 106, 0.16), 0px 4px 8px rgba(58, 58, 68, 0.16)",
420
+ "4dp": "0px 4px 8px rgba(90, 91, 106, 0.20), 0px 2px 4px rgba(58, 58, 68, 0.20)",
421
+ "2dp": "0px 2px 4px rgba(90, 91, 106, 0.24), 0px 1px 2px rgba(58, 58, 68, 0.24)"
422
+ },
423
+ screens: {
424
+ default: "0px",
425
+ xs: "320px",
426
+ sm: "672px",
427
+ md: "1056px",
428
+ lg: "1312px",
429
+ xl: "1536px"
430
+ },
431
+ margin: {
432
+ "0": "0px",
433
+ "1": "2px",
434
+ "2": "4px",
435
+ "3": "8px",
436
+ "4": "12px",
437
+ "5": "16px",
438
+ "6": "24px",
439
+ "7": "32px",
440
+ "8": "40px",
441
+ "9": "48px",
442
+ "1px": "1px",
443
+ l1: "16px",
444
+ l2: "24px",
445
+ l3: "32px",
446
+ l4: "48px",
447
+ l5: "64px",
448
+ l6: "96px",
449
+ l7: "160px"
450
+ },
451
+ spacing: {
452
+ "0": "0px",
453
+ "1": "2px",
454
+ "2": "4px",
455
+ "3": "8px",
456
+ "4": "12px",
457
+ "5": "16px",
458
+ "6": "24px",
459
+ "7": "32px",
460
+ "8": "40px",
461
+ "9": "48px",
462
+ "1px": "1px",
463
+ l1: "16px",
464
+ l2: "24px",
465
+ l3: "32px",
466
+ l4: "48px",
467
+ l5: "64px",
468
+ l6: "96px",
469
+ l7: "160px"
470
+ },
471
+ fontSize: {
472
+ base: "1rem",
473
+ "base-line-height": "1.5rem",
474
+ xs: "0.75rem",
475
+ "xs-line-height": "1rem",
476
+ sm: "0.875rem",
477
+ "sm-line-height": "1.25rem",
478
+ "lg-line-height": "1.75rem",
479
+ lg: "1.125rem",
480
+ "xl-line-height": "1.75rem",
481
+ xl: "1.25rem",
482
+ "2xl-line-height": "2rem",
483
+ "2xl": "1.5rem",
484
+ "3xl-line-height": "2.25rem",
485
+ "3xl": "1.875rem",
486
+ "4xl-line-height": "2.5rem",
487
+ "4xl": "2.25rem",
488
+ "5xl-line-height": "1",
489
+ "5xl": "3rem",
490
+ "6xl-line-height": "1",
491
+ "6xl": "3.75rem",
492
+ "7xl-line-height": "1",
493
+ "7xl": "4.5rem",
494
+ "8xl-line-height": "1",
495
+ "8xl": "6rem",
496
+ "9xl-line-height": "1",
497
+ "9xl": "8rem"
498
+ },
499
+ fontFamily: {
500
+ heading: [
501
+ "Poppins"
502
+ ],
503
+ body: [
504
+ "Inter"
505
+ ],
506
+ monospace: [
507
+ "Source Code Pro"
508
+ ]
509
+ },
510
+ typography: {
511
+ "large-heading": {
512
+ fontFamily: [
513
+ "Poppins"
514
+ ],
515
+ fontSize: "32px",
516
+ fontWeight: 700,
517
+ fontStyle: "normal",
518
+ lineHeight: 1.375,
519
+ textTransform: "none"
520
+ },
521
+ heading: {
522
+ fontFamily: [
523
+ "Poppins"
524
+ ],
525
+ fontSize: "24px",
526
+ fontWeight: 700,
527
+ fontStyle: "normal",
528
+ lineHeight: 1.375,
529
+ textTransform: "none"
530
+ },
531
+ subheading: {
532
+ fontFamily: [
533
+ "Poppins"
534
+ ],
535
+ fontSize: "20px",
536
+ fontWeight: 600,
537
+ fontStyle: "normal",
538
+ lineHeight: 1.375,
539
+ textTransform: "none"
540
+ },
541
+ "large-strong": {
542
+ fontFamily: [
543
+ "Inter"
544
+ ],
545
+ fontSize: "20px",
546
+ fontWeight: 600,
547
+ fontStyle: "normal",
548
+ lineHeight: 1.58,
549
+ textTransform: "none"
550
+ },
551
+ large: {
552
+ fontFamily: [
553
+ "Inter"
554
+ ],
555
+ fontSize: "20px",
556
+ fontWeight: 500,
557
+ fontStyle: "normal",
558
+ lineHeight: 1.58,
559
+ textTransform: "none"
560
+ },
561
+ "default-strong": {
562
+ fontFamily: [
563
+ "Inter"
564
+ ],
565
+ fontSize: "16px",
566
+ fontWeight: 500,
567
+ fontStyle: "normal",
568
+ lineHeight: 1.5,
569
+ textTransform: "none"
570
+ },
571
+ default: {
572
+ fontFamily: [
573
+ "Inter"
574
+ ],
575
+ fontSize: "16px",
576
+ fontWeight: 400,
577
+ fontStyle: "normal",
578
+ lineHeight: 1.5,
579
+ textTransform: "none"
580
+ },
581
+ "small-strong": {
582
+ fontFamily: [
583
+ "Inter"
584
+ ],
585
+ fontSize: "14px",
586
+ fontWeight: 500,
587
+ fontStyle: "normal",
588
+ lineHeight: 1.42,
589
+ textTransform: "none"
590
+ },
591
+ small: {
592
+ fontFamily: [
593
+ "Inter"
594
+ ],
595
+ fontSize: "14px",
596
+ fontWeight: 400,
597
+ fontStyle: "normal",
598
+ lineHeight: 1.42,
599
+ textTransform: "none"
600
+ },
601
+ caption: {
602
+ fontFamily: [
603
+ "Inter"
604
+ ],
605
+ fontSize: "12px",
606
+ fontWeight: 400,
607
+ fontStyle: "normal",
608
+ lineHeight: 1.26,
609
+ textTransform: "none"
610
+ },
611
+ code: {
612
+ fontFamily: [
613
+ "Source Code Pro"
614
+ ],
615
+ fontSize: "16px",
616
+ fontWeight: 400,
617
+ fontStyle: "normal",
618
+ lineHeight: 1.5,
619
+ textTransform: "none"
620
+ },
621
+ "code-strong": {
622
+ fontFamily: [
623
+ "Source Code Pro"
624
+ ],
625
+ fontSize: "16px",
626
+ fontWeight: 600,
627
+ fontStyle: "normal",
628
+ lineHeight: 1.5,
629
+ textTransform: "none"
630
+ },
631
+ "code-small": {
632
+ fontFamily: [
633
+ "Source Code Pro"
634
+ ],
635
+ fontSize: "14px",
636
+ fontWeight: 400,
637
+ fontStyle: "normal",
638
+ lineHeight: 1.42,
639
+ textTransform: "none"
640
+ },
641
+ "code-small-strong": {
642
+ fontFamily: [
643
+ "Source Code Pro"
644
+ ],
645
+ fontSize: "14px",
646
+ fontWeight: 600,
647
+ fontStyle: "normal",
648
+ lineHeight: 1.42,
649
+ textTransform: "none"
650
+ },
651
+ "caption-small": {
652
+ fontFamily: [
653
+ "Inter"
654
+ ],
655
+ fontSize: "10px",
656
+ fontWeight: 400,
657
+ fontStyle: "normal",
658
+ lineHeight: 1.2,
659
+ letterSpacing: 0,
660
+ textTransform: "none"
661
+ },
662
+ "caption-default": {
663
+ fontFamily: [
664
+ "Inter"
665
+ ],
666
+ fontSize: "12px",
667
+ fontWeight: 400,
668
+ fontStyle: "normal",
669
+ lineHeight: 1.26,
670
+ letterSpacing: 0,
671
+ textTransform: "none"
672
+ },
673
+ "overline-small": {
674
+ fontFamily: [
675
+ "Inter"
676
+ ],
677
+ fontSize: "10px",
678
+ fontWeight: 400,
679
+ fontStyle: "normal",
680
+ lineHeight: 1,
681
+ letterSpacing: 0,
682
+ textTransform: "uppercase"
683
+ },
684
+ "overline-default": {
685
+ fontFamily: [
686
+ "Inter"
687
+ ],
688
+ fontSize: "12px",
689
+ fontWeight: 400,
690
+ fontStyle: "normal",
691
+ lineHeight: 1,
692
+ letterSpacing: 0,
693
+ textTransform: "uppercase"
694
+ },
695
+ "button-small": {
696
+ fontFamily: [
697
+ "Inter"
698
+ ],
699
+ fontSize: "12px",
700
+ fontWeight: 500,
701
+ fontStyle: "normal",
702
+ lineHeight: 1,
703
+ letterSpacing: 0,
704
+ textTransform: "none"
705
+ },
706
+ "button-medium": {
707
+ fontFamily: [
708
+ "Inter"
709
+ ],
710
+ fontSize: "14px",
711
+ fontWeight: 400,
712
+ fontStyle: "normal",
713
+ lineHeight: 1,
714
+ letterSpacing: 0,
715
+ textTransform: "none"
716
+ },
717
+ "button-large": {
718
+ fontFamily: [
719
+ "Inter"
720
+ ],
721
+ fontSize: "16px",
722
+ fontWeight: 500,
723
+ fontStyle: "normal",
724
+ lineHeight: 1.5,
725
+ letterSpacing: 0,
726
+ textTransform: "none"
727
+ },
728
+ "body-small": {
729
+ fontFamily: [
730
+ "Inter"
731
+ ],
732
+ fontSize: "14px",
733
+ fontWeight: 400,
734
+ fontStyle: "normal",
735
+ lineHeight: 1.43,
736
+ letterSpacing: 0,
737
+ textTransform: "none"
738
+ },
739
+ "body-small-medium": {
740
+ fontFamily: [
741
+ "Inter"
742
+ ],
743
+ fontSize: "14px",
744
+ fontWeight: 500,
745
+ fontStyle: "normal",
746
+ lineHeight: 1.43,
747
+ letterSpacing: 0,
748
+ textTransform: "none"
749
+ },
750
+ "body-default": {
751
+ fontFamily: [
752
+ "Inter"
753
+ ],
754
+ fontSize: "16px",
755
+ fontWeight: 400,
756
+ fontStyle: "normal",
757
+ lineHeight: 1.5,
758
+ letterSpacing: 0,
759
+ textTransform: "none"
760
+ },
761
+ "body-default-medium": {
762
+ fontFamily: [
763
+ "Inter"
764
+ ],
765
+ fontSize: "16px",
766
+ fontWeight: 500,
767
+ fontStyle: "normal",
768
+ lineHeight: 1.5,
769
+ letterSpacing: 0,
770
+ textTransform: "none"
771
+ },
772
+ "body-large": {
773
+ fontFamily: [
774
+ "Inter"
775
+ ],
776
+ fontSize: "20px",
777
+ fontWeight: 400,
778
+ fontStyle: "normal",
779
+ lineHeight: 1.58,
780
+ letterSpacing: 0,
781
+ textTransform: "none"
782
+ },
783
+ "body-large-medium": {
784
+ fontFamily: [
785
+ "Inter"
786
+ ],
787
+ fontSize: "20px",
788
+ fontWeight: 400,
789
+ fontStyle: "normal",
790
+ lineHeight: 1.2,
791
+ letterSpacing: 0,
792
+ textTransform: "none"
793
+ },
794
+ "heading-large": {
795
+ fontFamily: [
796
+ "Inter"
797
+ ],
798
+ fontSize: "20px",
799
+ fontWeight: 700,
800
+ fontStyle: "normal",
801
+ lineHeight: 1.5,
802
+ letterSpacing: 0.15,
803
+ textTransform: "none"
804
+ },
805
+ "heading-xl": {
806
+ fontFamily: [
807
+ "Inter"
808
+ ],
809
+ fontSize: "24px",
810
+ fontWeight: 700,
811
+ fontStyle: "normal",
812
+ lineHeight: 1.5,
813
+ letterSpacing: 0,
814
+ textTransform: "none"
815
+ },
816
+ "heading-2xl": {
817
+ fontFamily: [
818
+ "Inter"
819
+ ],
820
+ fontSize: "34px",
821
+ fontWeight: 700,
822
+ fontStyle: "normal",
823
+ lineHeight: 1.28,
824
+ letterSpacing: 0,
825
+ textTransform: "none"
826
+ },
827
+ "heading-3xl": {
828
+ fontFamily: [
829
+ "Inter"
830
+ ],
831
+ fontSize: "48px",
832
+ fontWeight: 700,
833
+ fontStyle: "normal",
834
+ lineHeight: 1.24,
835
+ letterSpacing: -0.48,
836
+ textTransform: "none"
837
+ },
838
+ "heading-4xl": {
839
+ fontFamily: [
840
+ "Inter"
841
+ ],
842
+ fontSize: "60px",
843
+ fontWeight: 700,
844
+ fontStyle: "normal",
845
+ lineHeight: 1.2,
846
+ letterSpacing: -1.5,
847
+ textTransform: "none"
848
+ },
849
+ "heading-5xl": {
850
+ fontFamily: [
851
+ "Inter"
852
+ ],
853
+ fontSize: "76px",
854
+ fontWeight: 700,
855
+ fontStyle: "normal",
856
+ lineHeight: 1.2,
857
+ letterSpacing: -1.98,
858
+ textTransform: "none"
859
+ }
860
+ }
861
+ };
862
+
863
+ // src/charts/DefaultPalette/DefaultPalette.tsx
864
+ var DefaultPaletteContext = React2.createContext({ getDefaultColor: () => void 0 });
865
+ var PRIMARY_CATEGORIAL = Object.values(tokens_default.chartColors.primaryCategorical);
866
+ var SECONDARY_CATEGORIAL = Object.values(tokens_default.chartColors.secondaryCategorical);
867
+ var DefaultPalette = ({ palette = "primary", children }) => {
868
+ const registeredKeys = React2.useRef([]);
869
+ const colors = palette === "primary" ? PRIMARY_CATEGORIAL : SECONDARY_CATEGORIAL;
870
+ const getDefaultColor = React2.useCallback(
871
+ (key) => {
872
+ const keys = registeredKeys.current;
873
+ let index = keys.indexOf(key);
874
+ if (index === -1) {
875
+ index = registeredKeys.current.push(key) - 1;
876
+ }
877
+ return colors[index % colors.length];
878
+ },
879
+ [colors]
880
+ );
881
+ return /* @__PURE__ */ React2.createElement(DefaultPaletteContext.Provider, {
882
+ value: { getDefaultColor }
883
+ }, children);
884
+ };
885
+
886
+ // src/charts/Grid/Grid.tsx
887
+ import React3 from "react";
888
+ import { CartesianGrid as _CartesianGrid } from "recharts";
889
+ var CartesianGrid = Object.assign(
890
+ (props) => /* @__PURE__ */ React3.createElement(_CartesianGrid, __spreadProps(__spreadValues({
891
+ strokeDasharray: "3 3"
892
+ }, props), {
893
+ vertical: false
894
+ })),
895
+ _CartesianGrid
896
+ );
897
+
898
+ // src/charts/hooks/useDefaultColor.tsx
899
+ import React4 from "react";
900
+ var useDefaultColor = (key, color2) => {
901
+ const ctx = React4.useContext(DefaultPaletteContext);
902
+ return color2 != null ? color2 : ctx.getDefaultColor(key);
903
+ };
904
+
905
+ // src/charts/lib/utils.tsx
906
+ import React7 from "react";
40
907
 
41
908
  // node_modules/d3-array/src/ascending.js
42
909
  function ascending(a, b) {
@@ -1856,70 +2723,13 @@ function utcTime() {
1856
2723
  return initRange.apply(calendar(utcTicks, utcTickInterval, utcYear, utcMonth, utcSunday, utcDay, utcHour, utcMinute, second, utcFormat).domain([Date.UTC(2e3, 0, 1), Date.UTC(2e3, 0, 2)]), arguments);
1857
2724
  }
1858
2725
 
1859
- // src/charts/lib/utils.ts
2726
+ // src/charts/lib/utils.tsx
1860
2727
  import castArray from "lodash/castArray";
1861
2728
  import isDate from "lodash/isDate";
1862
- var CHART_MARGIN_BOTTOM = 15;
1863
- var CHART_YLABEL_DEFAULT_OFFSET = 10;
1864
- var CHART_XLABEL_DEFAULT_OFFSET = CHART_YLABEL_DEFAULT_OFFSET * -1;
1865
- var DEFAULT_MARGINS = {
1866
- top: 20,
1867
- right: 30,
1868
- left: 20,
1869
- bottom: CHART_MARGIN_BOTTOM
1870
- };
1871
- var getDisplayName = (Comp) => {
1872
- if (typeof Comp === "string") {
1873
- return Comp;
1874
- }
1875
- if (!Comp) {
1876
- return "";
1877
- }
1878
- return Comp.displayName || Comp.name || "Component";
1879
- };
1880
- var isDateArray = (arr) => Array.isArray(arr) && arr.every(isDate);
1881
- var isNumberOrDate = (value) => Number.isFinite(value) || isDate(value);
1882
- var getXAxisTicks = ({ dataKey, ticks: ticks2, domain }, chartProps) => {
1883
- var _a;
1884
- if (!ticks2 || Array.isArray(ticks2)) {
1885
- return ticks2 != null ? ticks2 : void 0;
1886
- }
1887
- const normalizedDomain = normalizeAxisDomain(domain);
1888
- const [domainMin, domainMax] = (_a = domainExtent(normalizedDomain)) != null ? _a : [];
1889
- const [dataMin, dataMax] = getXAxisExtent(chartProps.data, dataKey);
1890
- const min = isNumberOrDate(domainMin) ? Number(domainMin) : dataMin;
1891
- const max = isNumberOrDate(domainMax) ? Number(domainMax) : dataMax;
1892
- if (min === void 0 || max === void 0) {
1893
- return void 0;
1894
- }
1895
- return utcTime().domain([min, max]).ticks(ticks2).map((v) => v.valueOf());
1896
- };
1897
- var extractChildByDisplayName = (_children, name) => {
1898
- const children = castArray(_children);
1899
- const childIndex = children.findIndex((child) => getDisplayName(child.type) === name);
1900
- if (childIndex === -1) {
1901
- return [void 0, children];
1902
- }
1903
- const foundChild = children.at(childIndex);
1904
- const remainingChildren = children.slice(0, childIndex).concat(children.slice(childIndex + 1));
1905
- return [foundChild, remainingChildren];
1906
- };
1907
- var normalizeAxisDomain = (domain) => {
1908
- return isDateArray(domain) ? domain.map((d) => d.valueOf()) : domain;
1909
- };
1910
- var getXAxisValues = (data = [], dataKey) => {
1911
- return data.map((datum) => typeof dataKey === "function" ? dataKey(datum) : dataKey ? datum[dataKey] : void 0);
1912
- };
1913
- var getXAxisExtent = (data = [], dataKey) => extent(getXAxisValues(data, dataKey));
1914
- var domainExtent = (domain) => {
1915
- if (!Array.isArray(domain)) {
1916
- return void 0;
1917
- }
1918
- const [min, max] = domain;
1919
- return Number.isFinite(min) && Number.isFinite(max) ? [min, max] : void 0;
1920
- };
1921
2729
 
1922
2730
  // src/charts/Axis/Axis.tsx
2731
+ import React5 from "react";
2732
+ import { XAxis as _XAxis, YAxis as _YAxis } from "recharts";
1923
2733
  var XTimeAxis = () => null;
1924
2734
  XTimeAxis.displayName = "Axis.XAxis.Time";
1925
2735
  var XAxis = () => null;
@@ -1930,7 +2740,7 @@ YAxis.displayName = "Axis.YAxis";
1930
2740
  var renderXAxis = (child, chartProps) => {
1931
2741
  const _a = child.props, { tickLine = false, ticks: ticks2, domain } = _a, props = __objRest(_a, ["tickLine", "ticks", "domain"]);
1932
2742
  const xticks = getXAxisTicks(__spreadValues({ domain }, child.props), chartProps);
1933
- return /* @__PURE__ */ React.createElement(_XAxis, __spreadValues({
2743
+ return /* @__PURE__ */ React5.createElement(_XAxis, __spreadValues({
1934
2744
  tickLine,
1935
2745
  ticks: xticks,
1936
2746
  domain
@@ -1942,7 +2752,7 @@ var renderXTimeAxis = (child, chartProps) => {
1942
2752
  const normalizedDomain = normalizeAxisDomain(domain);
1943
2753
  const [min, max] = getXAxisExtent(chartProps.data, child.props.dataKey);
1944
2754
  const effectiveDomain = normalizedDomain != null ? normalizedDomain : min !== void 0 && max !== void 0 ? [Number(min), Number(max)] : ["auto", "auto"];
1945
- return /* @__PURE__ */ React.createElement(_XAxis, __spreadValues({
2755
+ return /* @__PURE__ */ React5.createElement(_XAxis, __spreadValues({
1946
2756
  scale: utc ? "utc" : "time",
1947
2757
  type: "number",
1948
2758
  allowDataOverflow: true,
@@ -1953,7 +2763,7 @@ var renderXTimeAxis = (child, chartProps) => {
1953
2763
  };
1954
2764
  var renderYAxis = (child, _props) => {
1955
2765
  const _a = child.props, { axisLine = false, tickLine = false } = _a, props = __objRest(_a, ["axisLine", "tickLine"]);
1956
- return /* @__PURE__ */ React.createElement(_YAxis, __spreadValues({
2766
+ return /* @__PURE__ */ React5.createElement(_YAxis, __spreadValues({
1957
2767
  axisLine,
1958
2768
  tickLine
1959
2769
  }, props));
@@ -1963,96 +2773,11 @@ var Axis = {
1963
2773
  YAxis
1964
2774
  };
1965
2775
 
1966
- // src/charts/Container/Container.tsx
1967
- import React2 from "react";
1968
- import { ResponsiveContainer as _ResponsiveContainer } from "recharts";
1969
-
1970
- // src/utils/tailwind.ts
1971
- import originalClassNames from "classnames";
1972
- function cleanClassNames(classNames2) {
1973
- const tokens = classNames2.split(/\s+/);
1974
- return tokens.filter((item) => item).join(" ");
1975
- }
1976
- function tw(classesOrModifiers1, classesOrModifiers2, classesOrModifiers3, classesOrModifiers4, classesOrModifiers5, classesOrModifiers6, classesOrModifiers7, classesOrModifiers8, classesOrModifiers9, classesOrModifiers10) {
1977
- const result = originalClassNames(
1978
- classesOrModifiers1,
1979
- classesOrModifiers2,
1980
- classesOrModifiers3,
1981
- classesOrModifiers4,
1982
- classesOrModifiers5,
1983
- classesOrModifiers6,
1984
- classesOrModifiers7,
1985
- classesOrModifiers8,
1986
- classesOrModifiers9,
1987
- classesOrModifiers10
1988
- );
1989
- return cleanClassNames(result);
1990
- }
1991
- var classNames = (...args) => {
1992
- const result = originalClassNames(...args);
1993
- return cleanClassNames(result);
1994
- };
1995
-
1996
- // src/charts/Container/Container.tsx
1997
- var ResponsiveContainer = (_a) => {
1998
- var _b = _a, {
1999
- isBusy = false,
2000
- busyLabel = "Loading...",
2001
- className,
2002
- style,
2003
- width = "100%",
2004
- height = "100%",
2005
- minWidth,
2006
- minHeight,
2007
- maxHeight
2008
- } = _b, props = __objRest(_b, [
2009
- "isBusy",
2010
- "busyLabel",
2011
- "className",
2012
- "style",
2013
- "width",
2014
- "height",
2015
- "minWidth",
2016
- "minHeight",
2017
- "maxHeight"
2018
- ]);
2019
- return /* @__PURE__ */ React2.createElement("div", {
2020
- "aria-busy": isBusy,
2021
- className: classNames(className, tw("relative")),
2022
- style: __spreadProps(__spreadValues({}, style), { width, height, minWidth, minHeight, maxHeight })
2023
- }, /* @__PURE__ */ React2.createElement("div", {
2024
- className: classNames(
2025
- tw("absolute inset-0 transition-colors flex items-center justify-center", {
2026
- "delay-300 z-40": isBusy
2027
- })
2028
- ),
2029
- style: isBusy ? { backgroundColor: "rgba(255, 255, 255, 0.5)" } : {}
2030
- }, /* @__PURE__ */ React2.createElement("span", {
2031
- "aria-hidden": !isBusy,
2032
- className: tw("rounded-full text-white bg-black typography-caption py-2 px-4 transition-all", {
2033
- "opacity-100 delay-300": isBusy,
2034
- "mb-[-20px] opacity-0": !isBusy
2035
- })
2036
- }, isBusy && busyLabel)), /* @__PURE__ */ React2.createElement(_ResponsiveContainer, __spreadValues({}, props)));
2037
- };
2038
-
2039
- // src/charts/Grid/Grid.tsx
2040
- import React3 from "react";
2041
- import { CartesianGrid as _CartesianGrid } from "recharts";
2042
- var CartesianGrid = Object.assign(
2043
- (props) => /* @__PURE__ */ React3.createElement(_CartesianGrid, __spreadProps(__spreadValues({
2044
- strokeDasharray: "3 3"
2045
- }, props), {
2046
- vertical: false
2047
- })),
2048
- _CartesianGrid
2049
- );
2050
-
2051
2776
  // src/charts/Tooltip/Tooltip.tsx
2052
2777
  import { DefaultTooltipContent, Tooltip as _Tooltip } from "recharts";
2053
2778
  var contentStyle = {
2054
2779
  boxShadow: "var(--aquarium-box-shadow-8dp)",
2055
- background: "#fff"
2780
+ background: "var(--aquarium-background-color-body)"
2056
2781
  };
2057
2782
  var itemStyle = {
2058
2783
  display: "flex",
@@ -2070,137 +2795,243 @@ Tooltip.defaultProps = Object.assign({}, _Tooltip.defaultProps, {
2070
2795
  cursor: { stroke: "var(--aquarium-border-color-intense)", strokeDasharray: "5" }
2071
2796
  });
2072
2797
 
2073
- // src/charts/AreaChart/AreaChart.tsx
2074
- var renderChildren = (props) => {
2075
- return React4.Children.map(props.children, (child) => {
2076
- if (!child) {
2077
- return child;
2798
+ // src/charts/Tooltip/TooltipContentWrapper.tsx
2799
+ import React6 from "react";
2800
+ import isFunction from "lodash/isFunction";
2801
+ var TooltipContentWrapper = (_a) => {
2802
+ var _b = _a, {
2803
+ content,
2804
+ tooltipColor = "stroke"
2805
+ } = _b, props = __objRest(_b, [
2806
+ "content",
2807
+ "tooltipColor"
2808
+ ]);
2809
+ var _a2;
2810
+ const { getDefaultColor } = React6.useContext(DefaultPaletteContext);
2811
+ const payload = (_a2 = props.payload) == null ? void 0 : _a2.map((entry) => {
2812
+ var _a3, _b2, _c, _d, _e, _f;
2813
+ const stroke = (_b2 = (_a3 = entry.payload) == null ? void 0 : _a3.stroke) != null ? _b2 : entry.stroke;
2814
+ const fill = (_d = (_c = entry.payload) == null ? void 0 : _c.fill) != null ? _d : entry.fill;
2815
+ const color2 = tooltipColor === "stroke" ? stroke : fill;
2816
+ return __spreadProps(__spreadValues({}, entry), {
2817
+ color: color2 != null ? color2 : getDefaultColor((_f = (_e = entry.dataKey) == null ? void 0 : _e.toString()) != null ? _f : "unknown")
2818
+ });
2819
+ });
2820
+ const propsWithPayload = __spreadProps(__spreadValues({}, props), { payload });
2821
+ if (React6.isValidElement(content)) {
2822
+ return React6.cloneElement(content, propsWithPayload);
2823
+ }
2824
+ if (isFunction(content)) {
2825
+ return React6.createElement(content, propsWithPayload);
2826
+ }
2827
+ return /* @__PURE__ */ React6.createElement(Tooltip.DefaultContent, __spreadProps(__spreadValues({}, props), {
2828
+ payload
2829
+ }));
2830
+ };
2831
+
2832
+ // src/charts/lib/utils.tsx
2833
+ var CHART_MARGIN_BOTTOM = 15;
2834
+ var CHART_YLABEL_DEFAULT_OFFSET = 10;
2835
+ var CHART_XLABEL_DEFAULT_OFFSET = CHART_YLABEL_DEFAULT_OFFSET * -1;
2836
+ var DEFAULT_MARGINS = {
2837
+ top: 20,
2838
+ right: 30,
2839
+ left: 20,
2840
+ bottom: CHART_MARGIN_BOTTOM
2841
+ };
2842
+ var getDisplayName = (Comp) => {
2843
+ if (typeof Comp === "string") {
2844
+ return Comp;
2845
+ }
2846
+ if (!Comp) {
2847
+ return "";
2848
+ }
2849
+ return Comp.displayName || Comp.name || "Component";
2850
+ };
2851
+ var isDateArray = (arr) => Array.isArray(arr) && arr.every(isDate);
2852
+ var isNumberOrDate = (value) => Number.isFinite(value) || isDate(value);
2853
+ var renderChartChildren = (child, chartProps) => {
2854
+ if (!child) {
2855
+ return child;
2856
+ }
2857
+ switch (getDisplayName(child.type)) {
2858
+ case Axis.XAxis.displayName: {
2859
+ return renderXAxis(child, chartProps);
2078
2860
  }
2079
- switch (getDisplayName(child.type)) {
2080
- case Axis.XAxis.displayName: {
2081
- return renderXAxis(child, props);
2082
- }
2083
- case Axis.XAxis.Time.displayName: {
2084
- return renderXTimeAxis(child, props);
2085
- }
2086
- case Axis.YAxis.displayName: {
2087
- return renderYAxis(child, props);
2088
- }
2089
- default: {
2090
- return child;
2091
- }
2861
+ case Axis.XAxis.Time.displayName: {
2862
+ return renderXTimeAxis(child, chartProps);
2092
2863
  }
2093
- });
2864
+ case Axis.YAxis.displayName: {
2865
+ return renderYAxis(child, chartProps);
2866
+ }
2867
+ case Tooltip.displayName: {
2868
+ return React7.cloneElement(child, { content: /* @__PURE__ */ React7.createElement(TooltipContentWrapper, {
2869
+ content: child.props.content
2870
+ }) });
2871
+ }
2872
+ default: {
2873
+ return child;
2874
+ }
2875
+ }
2094
2876
  };
2877
+ var getXAxisTicks = ({ dataKey, ticks: ticks2, domain }, chartProps) => {
2878
+ var _a;
2879
+ if (!ticks2 || Array.isArray(ticks2)) {
2880
+ return ticks2 != null ? ticks2 : void 0;
2881
+ }
2882
+ const normalizedDomain = normalizeAxisDomain(domain);
2883
+ const [domainMin, domainMax] = (_a = domainExtent(normalizedDomain)) != null ? _a : [];
2884
+ const [dataMin, dataMax] = getXAxisExtent(chartProps.data, dataKey);
2885
+ const min = isNumberOrDate(domainMin) ? Number(domainMin) : dataMin;
2886
+ const max = isNumberOrDate(domainMax) ? Number(domainMax) : dataMax;
2887
+ if (min === void 0 || max === void 0) {
2888
+ return void 0;
2889
+ }
2890
+ return utcTime().domain([min, max]).ticks(ticks2).map((v) => v.valueOf());
2891
+ };
2892
+ var extractChildByDisplayName = (_children, name) => {
2893
+ const children = castArray(_children);
2894
+ const childIndex = children.findIndex((child) => getDisplayName(child.type) === name);
2895
+ if (childIndex === -1) {
2896
+ return [void 0, children];
2897
+ }
2898
+ const foundChild = children.at(childIndex);
2899
+ const remainingChildren = children.slice(0, childIndex).concat(children.slice(childIndex + 1));
2900
+ return [foundChild, remainingChildren];
2901
+ };
2902
+ var normalizeAxisDomain = (domain) => {
2903
+ return isDateArray(domain) ? domain.map((d) => d.valueOf()) : domain;
2904
+ };
2905
+ var getXAxisValues = (data = [], dataKey) => {
2906
+ return data.map((datum) => typeof dataKey === "function" ? dataKey(datum) : dataKey ? datum[dataKey] : void 0);
2907
+ };
2908
+ var getXAxisExtent = (data = [], dataKey) => extent(getXAxisValues(data, dataKey));
2909
+ var domainExtent = (domain) => {
2910
+ if (!Array.isArray(domain)) {
2911
+ return void 0;
2912
+ }
2913
+ const [min, max] = domain;
2914
+ return Number.isFinite(min) && Number.isFinite(max) ? [min, max] : void 0;
2915
+ };
2916
+
2917
+ // src/charts/AreaChart/AreaChart.tsx
2095
2918
  var AreaChart = (_a) => {
2096
2919
  var _b = _a, {
2097
2920
  isBusy,
2098
2921
  busyLabel,
2099
- margin = DEFAULT_MARGINS
2922
+ margin = DEFAULT_MARGINS,
2923
+ palette
2100
2924
  } = _b, props = __objRest(_b, [
2101
2925
  "isBusy",
2102
2926
  "busyLabel",
2103
- "margin"
2927
+ "margin",
2928
+ "palette"
2104
2929
  ]);
2105
2930
  const [tooltip] = extractChildByDisplayName(props.children, Tooltip.displayName);
2106
- return /* @__PURE__ */ React4.createElement(ResponsiveContainer, {
2931
+ return /* @__PURE__ */ React8.createElement(DefaultPalette, {
2932
+ palette
2933
+ }, /* @__PURE__ */ React8.createElement(ResponsiveContainer, {
2107
2934
  width: props.width,
2108
2935
  height: props.height,
2109
2936
  isBusy,
2110
2937
  busyLabel
2111
- }, /* @__PURE__ */ React4.createElement(_AreaChart, {
2938
+ }, /* @__PURE__ */ React8.createElement(_AreaChart, {
2112
2939
  accessibilityLayer: tooltip !== void 0,
2113
2940
  data: props.data,
2114
2941
  style: { stroke: "#fff", strokeWidth: 1 },
2115
2942
  margin
2116
- }, /* @__PURE__ */ React4.createElement(CartesianGrid, null), renderChildren(props)));
2943
+ }, /* @__PURE__ */ React8.createElement(CartesianGrid, null), React8.Children.map(props.children, (child) => renderChartChildren(child, props)))));
2117
2944
  };
2118
- var Area = Object.assign(
2119
- (props) => {
2120
- var _a;
2121
- return /* @__PURE__ */ React4.createElement(_Area, __spreadProps(__spreadValues({
2122
- type: "linear",
2123
- strokeWidth: 2,
2124
- dot: false
2125
- }, props), {
2126
- fill: (_a = props.fill) != null ? _a : props.stroke,
2127
- fillOpacity: 0.1,
2128
- isAnimationActive: false
2129
- }));
2130
- },
2131
- _Area
2132
- );
2945
+ var Area = Object.assign((props) => {
2946
+ var _a;
2947
+ const stroke = useDefaultColor(props.dataKey.toString(), props.stroke);
2948
+ const fill = useDefaultColor(props.dataKey.toString(), (_a = props.fill) != null ? _a : stroke);
2949
+ return /* @__PURE__ */ React8.createElement(_Area, __spreadProps(__spreadValues({
2950
+ type: "linear",
2951
+ strokeWidth: 2,
2952
+ dot: false
2953
+ }, props), {
2954
+ stroke,
2955
+ fill,
2956
+ fillOpacity: 0.1,
2957
+ isAnimationActive: false
2958
+ }));
2959
+ }, _Area);
2133
2960
  Area.defaultProps = Object.assign({}, _Area.defaultProps, {
2134
2961
  fillOpacity: 0.1,
2135
- fill: void 0
2962
+ fill: void 0,
2963
+ stroke: void 0
2136
2964
  });
2137
2965
  AreaChart.Area = Area;
2138
2966
 
2139
2967
  // src/charts/BarChart/BarChart.tsx
2140
- import React5 from "react";
2968
+ import React9 from "react";
2141
2969
  import { Bar as _Bar, BarChart as _BarChart, Rectangle } from "recharts";
2142
2970
  var BarChart = (_a) => {
2143
2971
  var _b = _a, {
2144
2972
  isBusy,
2145
2973
  busyLabel,
2146
- margin = DEFAULT_MARGINS
2974
+ margin = DEFAULT_MARGINS,
2975
+ palette
2147
2976
  } = _b, props = __objRest(_b, [
2148
2977
  "isBusy",
2149
2978
  "busyLabel",
2150
- "margin"
2979
+ "margin",
2980
+ "palette"
2151
2981
  ]);
2152
- const [activeIndex, setActiveIndex] = React5.useState(void 0);
2982
+ const [activeIndex, setActiveIndex] = React9.useState(void 0);
2153
2983
  const [tooltip] = extractChildByDisplayName(props.children, Tooltip.displayName);
2154
- const renderChildren3 = (props2) => {
2155
- return React5.Children.map(props2.children, (child) => {
2984
+ const renderChildren = (props2) => {
2985
+ return React9.Children.map(props2.children, (child) => {
2156
2986
  if (!child) {
2157
2987
  return child;
2158
2988
  }
2159
2989
  switch (getDisplayName(child.type)) {
2160
- case Axis.XAxis.displayName: {
2161
- return renderXAxis(child, props2);
2162
- }
2163
- case Axis.XAxis.Time.displayName: {
2164
- return renderXTimeAxis(child, props2);
2165
- }
2166
- case Axis.YAxis.displayName: {
2167
- return renderYAxis(child, props2);
2168
- }
2169
2990
  case _Bar.displayName: {
2170
- return React5.cloneElement(child, {
2171
- shape: (props3) => /* @__PURE__ */ React5.createElement(Rectangle, __spreadProps(__spreadValues({}, props3), {
2991
+ return React9.cloneElement(child, {
2992
+ shape: (props3) => /* @__PURE__ */ React9.createElement(Rectangle, __spreadProps(__spreadValues({}, props3), {
2172
2993
  className: activeIndex !== void 0 ? "inactive" : void 0
2173
2994
  }))
2174
2995
  });
2175
2996
  }
2176
2997
  case Tooltip.displayName: {
2177
- return /* @__PURE__ */ React5.createElement(Tooltip, __spreadProps(__spreadValues({}, child.props), {
2998
+ return /* @__PURE__ */ React9.createElement(Tooltip, __spreadProps(__spreadValues({}, child.props), {
2999
+ content: /* @__PURE__ */ React9.createElement(TooltipContentWrapper, {
3000
+ content: child.props.content,
3001
+ tooltipColor: "fill"
3002
+ }),
2178
3003
  cursor: false
2179
3004
  }));
2180
3005
  }
2181
3006
  default: {
2182
- return child;
3007
+ return renderChartChildren(child, props2);
2183
3008
  }
2184
3009
  }
2185
3010
  });
2186
3011
  };
2187
- return /* @__PURE__ */ React5.createElement(ResponsiveContainer, {
3012
+ return /* @__PURE__ */ React9.createElement(DefaultPalette, {
3013
+ palette
3014
+ }, /* @__PURE__ */ React9.createElement(ResponsiveContainer, {
2188
3015
  width: props.width,
2189
3016
  height: props.height,
2190
3017
  isBusy,
2191
3018
  busyLabel
2192
- }, /* @__PURE__ */ React5.createElement(_BarChart, __spreadProps(__spreadValues({}, props), {
3019
+ }, /* @__PURE__ */ React9.createElement(_BarChart, __spreadProps(__spreadValues({}, props), {
2193
3020
  accessibilityLayer: tooltip !== void 0,
2194
3021
  barCategoryGap: "5%",
2195
3022
  style: { stroke: "#fff", strokeWidth: 1 },
2196
3023
  onMouseMove: (state) => setActiveIndex(state.isTooltipActive ? state.activeTooltipIndex : void 0),
2197
3024
  onMouseLeave: () => setActiveIndex(void 0),
2198
3025
  margin
2199
- }), /* @__PURE__ */ React5.createElement(CartesianGrid, null), renderChildren3(props)));
3026
+ }), /* @__PURE__ */ React9.createElement(CartesianGrid, null), renderChildren(props))));
2200
3027
  };
2201
- var Bar = Object.assign((props) => /* @__PURE__ */ React5.createElement(_Bar, __spreadProps(__spreadValues({}, props), {
2202
- isAnimationActive: false
2203
- })), _Bar);
3028
+ var Bar = Object.assign((props) => {
3029
+ const fill = useDefaultColor(props.dataKey.toString(), props.fill);
3030
+ return /* @__PURE__ */ React9.createElement(_Bar, __spreadProps(__spreadValues({}, props), {
3031
+ fill,
3032
+ isAnimationActive: false
3033
+ }));
3034
+ }, _Bar);
2204
3035
  BarChart.Bar = Bar;
2205
3036
  BarChart.Tooltip = Tooltip;
2206
3037
 
@@ -2209,17 +3040,17 @@ import { Cell } from "recharts";
2209
3040
  import {} from "recharts";
2210
3041
 
2211
3042
  // src/charts/Label/Label.tsx
2212
- import React6 from "react";
3043
+ import React10 from "react";
2213
3044
  import { Label as _Label, LabelList as _LabelList } from "recharts";
2214
3045
  var XLabel = Object.assign(
2215
- (props) => /* @__PURE__ */ React6.createElement(_Label, __spreadValues({
3046
+ (props) => /* @__PURE__ */ React10.createElement(_Label, __spreadValues({
2216
3047
  position: "insideBottom",
2217
3048
  offset: CHART_XLABEL_DEFAULT_OFFSET
2218
3049
  }, props)),
2219
3050
  _Label
2220
3051
  );
2221
3052
  var YLabel = Object.assign(
2222
- (props) => /* @__PURE__ */ React6.createElement(_Label, __spreadValues({
3053
+ (props) => /* @__PURE__ */ React10.createElement(_Label, __spreadValues({
2223
3054
  position: "insideLeft",
2224
3055
  angle: -90,
2225
3056
  offset: CHART_YLABEL_DEFAULT_OFFSET
@@ -2233,11 +3064,17 @@ var Label = {
2233
3064
  var LabelList = _LabelList;
2234
3065
 
2235
3066
  // src/charts/Legend/Legend.tsx
2236
- import React7 from "react";
2237
- import { Legend as _Legend } from "recharts";
2238
- var Legend = React7.forwardRef((props, _ref) => {
2239
- return /* @__PURE__ */ React7.createElement(_Legend, __spreadProps(__spreadValues({}, props), {
2240
- margin: __spreadProps(__spreadValues({}, props.margin), { top: 0 })
3067
+ import React11 from "react";
3068
+ import {
3069
+ DefaultLegendContent,
3070
+ Legend as _Legend
3071
+ } from "recharts";
3072
+ var Legend = React11.forwardRef((props, _ref) => {
3073
+ return /* @__PURE__ */ React11.createElement(_Legend, __spreadProps(__spreadValues({}, props), {
3074
+ margin: __spreadProps(__spreadValues({}, props.margin), { top: 0 }),
3075
+ content: /* @__PURE__ */ React11.createElement(LegendContentWrapper, {
3076
+ content: props.content
3077
+ })
2241
3078
  }));
2242
3079
  });
2243
3080
  Legend.displayName = "Legend";
@@ -2249,130 +3086,110 @@ Legend.defaultProps = {
2249
3086
  verticalAlign: "top",
2250
3087
  margin: { top: 0 }
2251
3088
  };
2252
-
2253
- // src/charts/LineChart/LineChart.tsx
2254
- import React8 from "react";
2255
- import { Line as _Line, LineChart as _LineChart } from "recharts";
2256
- var renderChildren2 = (props) => {
2257
- return React8.Children.map(props.children, (child) => {
2258
- if (!child) {
2259
- return child;
2260
- }
2261
- switch (getDisplayName(child.type)) {
2262
- case Axis.XAxis.displayName: {
2263
- return renderXAxis(child, props);
2264
- }
2265
- case Axis.XAxis.Time.displayName: {
2266
- return renderXTimeAxis(child, props);
2267
- }
2268
- case Axis.YAxis.displayName: {
2269
- return renderYAxis(child, props);
2270
- }
2271
- default: {
2272
- return child;
2273
- }
2274
- }
3089
+ var LegendContentWrapper = (_a) => {
3090
+ var _b = _a, {
3091
+ ref,
3092
+ content
3093
+ } = _b, props = __objRest(_b, [
3094
+ "ref",
3095
+ "content"
3096
+ ]);
3097
+ var _a2;
3098
+ const { getDefaultColor } = React11.useContext(DefaultPaletteContext);
3099
+ const payload = (_a2 = props.payload) == null ? void 0 : _a2.map((entry) => {
3100
+ var _a3;
3101
+ return __spreadProps(__spreadValues({}, entry), {
3102
+ color: (_a3 = entry.color) != null ? _a3 : getDefaultColor("dataKey" in entry && typeof entry.dataKey === "string" ? entry.dataKey : "unknown")
3103
+ });
2275
3104
  });
3105
+ return /* @__PURE__ */ React11.createElement(DefaultLegendContent, __spreadProps(__spreadValues({}, props), {
3106
+ payload
3107
+ }));
2276
3108
  };
3109
+
3110
+ // src/charts/LineChart/LineChart.tsx
3111
+ import React12 from "react";
3112
+ import { Line as _Line, LineChart as _LineChart, Tooltip as Tooltip2 } from "recharts";
2277
3113
  var LineChart = (_a) => {
2278
3114
  var _b = _a, {
2279
3115
  isBusy,
2280
3116
  busyLabel,
2281
- margin = DEFAULT_MARGINS
3117
+ margin = DEFAULT_MARGINS,
3118
+ palette
2282
3119
  } = _b, props = __objRest(_b, [
2283
3120
  "isBusy",
2284
3121
  "busyLabel",
2285
- "margin"
3122
+ "margin",
3123
+ "palette"
2286
3124
  ]);
2287
- const [tooltip] = extractChildByDisplayName(props.children, Tooltip.displayName);
2288
- return /* @__PURE__ */ React8.createElement(ResponsiveContainer, {
3125
+ const [tooltip] = extractChildByDisplayName(props.children, Tooltip2.displayName);
3126
+ return /* @__PURE__ */ React12.createElement(DefaultPalette, {
3127
+ palette
3128
+ }, /* @__PURE__ */ React12.createElement(ResponsiveContainer, {
2289
3129
  width: props.width,
2290
3130
  height: props.height,
2291
3131
  isBusy,
2292
3132
  busyLabel
2293
- }, /* @__PURE__ */ React8.createElement(_LineChart, {
3133
+ }, /* @__PURE__ */ React12.createElement(_LineChart, {
2294
3134
  data: props.data,
2295
3135
  style: { stroke: "#fff", strokeWidth: 1 },
2296
3136
  margin,
2297
3137
  accessibilityLayer: tooltip !== void 0
2298
- }, /* @__PURE__ */ React8.createElement(CartesianGrid, null), renderChildren2(props)));
3138
+ }, /* @__PURE__ */ React12.createElement(CartesianGrid, null), React12.Children.map(props.children, (child) => renderChartChildren(child, props)))));
2299
3139
  };
2300
- var Line = Object.assign(
2301
- (props) => /* @__PURE__ */ React8.createElement(_Line, __spreadProps(__spreadValues({
3140
+ var Line = Object.assign((props) => {
3141
+ var _a, _b;
3142
+ const stroke = useDefaultColor((_b = (_a = props.dataKey) == null ? void 0 : _a.toString()) != null ? _b : "unknown", props.stroke);
3143
+ return /* @__PURE__ */ React12.createElement(_Line, __spreadProps(__spreadValues({
2302
3144
  type: "linear"
2303
3145
  }, props), {
3146
+ stroke,
2304
3147
  strokeWidth: 2,
2305
3148
  isAnimationActive: false,
2306
3149
  dot: false
2307
- })),
2308
- _Line
2309
- );
3150
+ }));
3151
+ }, _Line);
3152
+ Line.defaultProps = Object.assign({}, _Line.defaultProps, { stroke: void 0, fill: void 0 });
2310
3153
  LineChart.Line = Line;
2311
3154
 
2312
3155
  // src/charts/PieChart/DoughnutChart.tsx
2313
- import React12 from "react";
3156
+ import React15 from "react";
2314
3157
  import isNil from "lodash/isNil";
2315
3158
  import { Cell as Cell2, Customized, Pie as _Pie, PieChart as _PieChart } from "recharts";
2316
3159
 
2317
3160
  // src/charts/PieChart/ChartValue.tsx
2318
- import React9 from "react";
3161
+ import React13 from "react";
2319
3162
  var ChartValue = (props) => {
2320
3163
  const { value, unit: unit2, caption } = props;
2321
- return /* @__PURE__ */ React9.createElement("p", {
3164
+ return /* @__PURE__ */ React13.createElement("p", {
2322
3165
  className: tw(
2323
3166
  "typography-large-heading text-intense text-center leading-tight absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2"
2324
3167
  )
2325
- }, value, unit2, caption && /* @__PURE__ */ React9.createElement("span", {
3168
+ }, value, unit2, caption && /* @__PURE__ */ React13.createElement("span", {
2326
3169
  className: tw("block", "typography-small text-default")
2327
3170
  }, caption));
2328
3171
  };
2329
3172
 
2330
3173
  // src/charts/PieChart/renderPieChildren.tsx
2331
- import React11 from "react";
3174
+ import React14 from "react";
2332
3175
  import { Legend as Legend2 } from "recharts";
2333
-
2334
- // src/charts/PieChart/TooltipContentWrapper.tsx
2335
- import React10 from "react";
2336
- import isFunction from "lodash/isFunction";
2337
- var TooltipContentWrapper = (_a) => {
2338
- var _b = _a, {
2339
- content
2340
- } = _b, props = __objRest(_b, [
2341
- "content"
2342
- ]);
2343
- var _a2;
2344
- const payload = (_a2 = props.payload) == null ? void 0 : _a2.map((entry) => {
2345
- var _a3;
2346
- return __spreadProps(__spreadValues({}, entry), {
2347
- color: (_a3 = entry.payload) == null ? void 0 : _a3.fill
2348
- });
2349
- });
2350
- const propsWithPayload = __spreadProps(__spreadValues({}, props), { payload });
2351
- if (React10.isValidElement(content)) {
2352
- return React10.cloneElement(content, propsWithPayload);
2353
- }
2354
- if (isFunction(content)) {
2355
- return React10.createElement(content, propsWithPayload);
2356
- }
2357
- return /* @__PURE__ */ React10.createElement(Tooltip.DefaultContent, __spreadProps(__spreadValues({}, props), {
2358
- payload
2359
- }));
2360
- };
2361
-
2362
- // src/charts/PieChart/renderPieChildren.tsx
2363
- var renderPieChildren = (children) => {
2364
- return React11.Children.map(children, (child) => {
3176
+ var renderPieChildren = (children, opts = {}) => {
3177
+ return React14.Children.map(children, (child) => {
2365
3178
  if (!child) {
2366
3179
  return child;
2367
3180
  }
2368
3181
  switch (getDisplayName(child.type)) {
2369
3182
  case Tooltip.displayName: {
2370
- return React11.cloneElement(child, { content: /* @__PURE__ */ React11.createElement(TooltipContentWrapper, {
2371
- content: child.props.content
2372
- }) });
3183
+ return React14.cloneElement(child, {
3184
+ content: /* @__PURE__ */ React14.createElement(TooltipContentWrapper, {
3185
+ content: child.props.content,
3186
+ tooltipColor: opts.tooltipColor
3187
+ }),
3188
+ labelStyle: { paddingBottom: 0 }
3189
+ });
2373
3190
  }
2374
3191
  case Legend2.displayName: {
2375
- return React11.cloneElement(child, { verticalAlign: "top", align: "center" });
3192
+ return React14.cloneElement(child, { verticalAlign: "top", align: "center" });
2376
3193
  }
2377
3194
  default: {
2378
3195
  return child;
@@ -2384,27 +3201,29 @@ var renderPieChildren = (children) => {
2384
3201
  // src/charts/PieChart/DoughnutChart.tsx
2385
3202
  var refSize = 300;
2386
3203
  var DoughnutChart = (_a) => {
2387
- var _b = _a, {
2388
- isBusy,
2389
- busyLabel
2390
- } = _b, props = __objRest(_b, [
2391
- "isBusy",
2392
- "busyLabel"
2393
- ]);
2394
- const [containerWidth, setContainerWidth] = React12.useState(0);
2395
- const [containerHeight, setContainerHeight] = React12.useState(0);
2396
- const [activeIndex, setActiveIndex] = React12.useState(null);
3204
+ var _b = _a, { palette } = _b, props = __objRest(_b, ["palette"]);
3205
+ return /* @__PURE__ */ React15.createElement(DefaultPalette, {
3206
+ palette
3207
+ }, /* @__PURE__ */ React15.createElement(DoughnutChartWrapper, __spreadValues({}, props)));
3208
+ };
3209
+ var DoughnutChartWrapper = (_a) => {
3210
+ var _b = _a, { isBusy, busyLabel } = _b, props = __objRest(_b, ["isBusy", "busyLabel"]);
3211
+ var _a2;
3212
+ const [containerWidth, setContainerWidth] = React15.useState(0);
3213
+ const [containerHeight, setContainerHeight] = React15.useState(0);
3214
+ const [activeIndex, setActiveIndex] = React15.useState(null);
3215
+ const { getDefaultColor } = React15.useContext(DefaultPaletteContext);
2397
3216
  const [chartValue, _children] = extractChildByDisplayName(props.children, ChartValue.displayName);
2398
- const [pie, children] = extractChildByDisplayName(_children, DoughnutChart.Doughnut.displayName);
3217
+ const [doughnut, children] = extractChildByDisplayName(_children, DoughnutChart.Doughnut.displayName);
2399
3218
  const [tooltip] = extractChildByDisplayName(props.children, Tooltip.displayName);
2400
3219
  const onResize = (w, h) => {
2401
3220
  setContainerWidth(w);
2402
3221
  setContainerHeight(h);
2403
3222
  };
2404
3223
  const renderChartValue = ({ formattedGraphicalItems }) => {
2405
- var _a2, _b2, _c;
2406
- const pie2 = formattedGraphicalItems == null ? void 0 : formattedGraphicalItems[0];
2407
- const props2 = (_a2 = pie2 == null ? void 0 : pie2.props) != null ? _a2 : {};
3224
+ var _a3, _b2, _c;
3225
+ const pie = formattedGraphicalItems == null ? void 0 : formattedGraphicalItems[0];
3226
+ const props2 = (_a3 = pie == null ? void 0 : pie.props) != null ? _a3 : {};
2408
3227
  const cx = (_b2 = props2.cx) != null ? _b2 : containerWidth / 2;
2409
3228
  const cy = (_c = props2.cy) != null ? _c : containerHeight / 2;
2410
3229
  if (!containerWidth || !containerHeight || isNil(chartValue)) {
@@ -2416,7 +3235,7 @@ var DoughnutChart = (_a) => {
2416
3235
  const yMargin = (containerHeight - refSize * scale) / 2;
2417
3236
  const x = cx - refSize / 2 * scale;
2418
3237
  const y = (yOffset + yMargin) / scale;
2419
- return /* @__PURE__ */ React12.createElement("foreignObject", {
3238
+ return /* @__PURE__ */ React15.createElement("foreignObject", {
2420
3239
  width: refSize,
2421
3240
  height: refSize,
2422
3241
  x,
@@ -2425,24 +3244,27 @@ var DoughnutChart = (_a) => {
2425
3244
  }, chartValue);
2426
3245
  };
2427
3246
  const highlightActive = activeIndex !== null && tooltip;
2428
- return /* @__PURE__ */ React12.createElement(ResponsiveContainer, {
3247
+ return /* @__PURE__ */ React15.createElement(ResponsiveContainer, {
2429
3248
  width: props.width,
2430
3249
  height: props.height,
2431
3250
  isBusy,
2432
3251
  busyLabel,
2433
3252
  onResize
2434
- }, /* @__PURE__ */ React12.createElement(_PieChart, null, chartValue && /* @__PURE__ */ React12.createElement(Customized, {
3253
+ }, /* @__PURE__ */ React15.createElement(_PieChart, null, chartValue && /* @__PURE__ */ React15.createElement(Customized, {
2435
3254
  component: renderChartValue
2436
- }), pie && /* @__PURE__ */ React12.createElement(_Pie, __spreadProps(__spreadValues({}, pie.props), {
3255
+ }), doughnut && /* @__PURE__ */ React15.createElement(_Pie, __spreadProps(__spreadValues({}, doughnut.props), {
3256
+ fill: (_a2 = doughnut.props.fill) != null ? _a2 : getDefaultColor(doughnut.props.dataKey),
2437
3257
  onMouseEnter: (_, index) => setActiveIndex(index),
2438
3258
  onMouseLeave: () => setActiveIndex(null),
2439
3259
  activeIndex,
2440
3260
  inactiveShape: { className: highlightActive ? "inactive" : void 0 },
2441
3261
  activeShape: { className: highlightActive ? "active" : void 0 }
2442
- })), renderPieChildren(children)));
3262
+ })), renderPieChildren(children, { tooltipColor: "fill" })));
2443
3263
  };
2444
- var Doughnut = Object.assign((props) => /* @__PURE__ */ React12.createElement(_Pie, __spreadValues({}, props)), _Pie);
3264
+ var Doughnut = Object.assign((props) => /* @__PURE__ */ React15.createElement(_Pie, __spreadValues({}, props)), _Pie);
2445
3265
  Doughnut.defaultProps = Object.assign({}, _Pie.defaultProps, {
3266
+ fill: void 0,
3267
+ stroke: void 0,
2446
3268
  isAnimationActive: false,
2447
3269
  innerRadius: "60%",
2448
3270
  outerRadius: "80%"
@@ -2452,22 +3274,34 @@ DoughnutChart.ChartValue = ChartValue;
2452
3274
  DoughnutChart.Cell = Cell2;
2453
3275
 
2454
3276
  // src/charts/PieChart/PieChart.tsx
2455
- import React13 from "react";
3277
+ import React16 from "react";
2456
3278
  import { Cell as Cell3, Pie as _Pie2, PieChart as _PieChart2 } from "recharts";
2457
3279
  var PieChart = (_a) => {
3280
+ var _b = _a, { palette } = _b, props = __objRest(_b, ["palette"]);
3281
+ return /* @__PURE__ */ React16.createElement(DefaultPalette, {
3282
+ palette
3283
+ }, /* @__PURE__ */ React16.createElement(PieChartWrapper, __spreadValues({}, props)));
3284
+ };
3285
+ var PieChartWrapper = (_a) => {
2458
3286
  var _b = _a, { isBusy, busyLabel } = _b, props = __objRest(_b, ["isBusy", "busyLabel"]);
2459
- return /* @__PURE__ */ React13.createElement(ResponsiveContainer, {
3287
+ var _a2;
3288
+ const [pie, children] = extractChildByDisplayName(props.children, PieChart.Pie.displayName);
3289
+ const { getDefaultColor } = React16.useContext(DefaultPaletteContext);
3290
+ return /* @__PURE__ */ React16.createElement(ResponsiveContainer, {
2460
3291
  width: props.width,
2461
3292
  height: props.height,
2462
3293
  isBusy,
2463
3294
  busyLabel
2464
- }, /* @__PURE__ */ React13.createElement(_PieChart2, {
3295
+ }, /* @__PURE__ */ React16.createElement(_PieChart2, {
2465
3296
  width: 500,
2466
3297
  height: 500
2467
- }, renderPieChildren(props.children)));
3298
+ }, renderPieChildren(children, { tooltipColor: "fill" }), pie && /* @__PURE__ */ React16.createElement(_Pie2, __spreadProps(__spreadValues({}, pie.props), {
3299
+ fill: (_a2 = pie.props.fill) != null ? _a2 : getDefaultColor(pie.props.dataKey)
3300
+ }))));
2468
3301
  };
2469
- var Pie = Object.assign((props) => /* @__PURE__ */ React13.createElement(_Pie2, __spreadValues({}, props)), _Pie2);
3302
+ var Pie = Object.assign((props) => /* @__PURE__ */ React16.createElement(_Pie2, __spreadValues({}, props)), _Pie2);
2470
3303
  Pie.defaultProps = Object.assign({}, _Pie2.defaultProps, {
3304
+ fill: void 0,
2471
3305
  isAnimationActive: false,
2472
3306
  innerRadius: 0,
2473
3307
  outerRadius: "80%"
@@ -2476,20 +3310,20 @@ PieChart.Pie = Pie;
2476
3310
  PieChart.Cell = Cell3;
2477
3311
 
2478
3312
  // src/charts/Reference/Reference.tsx
2479
- import React14 from "react";
3313
+ import React17 from "react";
2480
3314
  import {
2481
3315
  ReferenceArea as _ReferenceArea,
2482
3316
  ReferenceLine as _ReferenceLine
2483
3317
  } from "recharts";
2484
3318
  var ReferenceLine = Object.assign(
2485
- (props) => /* @__PURE__ */ React14.createElement(_ReferenceLine, __spreadProps(__spreadValues({}, props), {
3319
+ (props) => /* @__PURE__ */ React17.createElement(_ReferenceLine, __spreadProps(__spreadValues({}, props), {
2486
3320
  strokeDasharray: "9 3",
2487
3321
  strokeWidth: 2
2488
3322
  })),
2489
3323
  _ReferenceLine
2490
3324
  );
2491
3325
  var ReferenceArea = Object.assign(
2492
- (props) => /* @__PURE__ */ React14.createElement(_ReferenceArea, __spreadProps(__spreadValues({}, props), {
3326
+ (props) => /* @__PURE__ */ React17.createElement(_ReferenceArea, __spreadProps(__spreadValues({}, props), {
2493
3327
  strokeWidth: 0,
2494
3328
  fillOpacity: 0.1
2495
3329
  })),
@@ -2511,11 +3345,14 @@ export {
2511
3345
  CartesianGrid,
2512
3346
  Cell,
2513
3347
  DEFAULT_MARGINS,
3348
+ DefaultPalette,
3349
+ DefaultPaletteContext,
2514
3350
  Doughnut,
2515
3351
  DoughnutChart,
2516
3352
  Label,
2517
3353
  LabelList,
2518
3354
  Legend,
3355
+ LegendContentWrapper,
2519
3356
  Line,
2520
3357
  LineChart,
2521
3358
  Pie,
@@ -2529,6 +3366,7 @@ export {
2529
3366
  getXAxisTicks,
2530
3367
  getXAxisValues,
2531
3368
  normalizeAxisDomain,
3369
+ renderChartChildren,
2532
3370
  renderXAxis,
2533
3371
  renderXTimeAxis,
2534
3372
  renderYAxis,
@@ -2567,6 +3405,7 @@ export {
2567
3405
  timeYears,
2568
3406
  unixDay,
2569
3407
  unixDays,
3408
+ useDefaultColor,
2570
3409
  utcDay,
2571
3410
  utcDays,
2572
3411
  utcFriday,