@deepnoid/ui 0.1.118 → 0.1.120

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.
@@ -8,17 +8,20 @@ import {
8
8
 
9
9
  // src/components/charts/barChart.tsx
10
10
  import { forwardRef, useEffect, useMemo, useRef, useState } from "react";
11
- import { XAxis, YAxis, ResponsiveContainer, CartesianGrid, BarChart, Bar } from "recharts";
11
+ import { XAxis, YAxis, ResponsiveContainer, CartesianGrid, BarChart, Bar, Tooltip } from "recharts";
12
12
  import { jsx, jsxs } from "react/jsx-runtime";
13
13
  var BarChartComponent = forwardRef((originalProps, ref) => {
14
14
  const [props, variantProps] = mapPropsVariants(originalProps, barChartStyle.variantKeys);
15
- const { data, label, classNames } = { ...props, ...variantProps };
15
+ const {
16
+ data,
17
+ label,
18
+ classNames,
19
+ yAxisTicks = [0, 20, 40, 60, 80, 100],
20
+ yAxisTickFormatter = (value) => `${value}`,
21
+ yAxisDomain = [-6, 110],
22
+ customTooltip
23
+ } = { ...props, ...variantProps };
16
24
  const slots = useMemo(() => barChartStyle({ ...variantProps }), [variantProps]);
17
- const COLOR_MAP = {
18
- primary: "#C7E5FA",
19
- secondary: "#92DCB2",
20
- warning: "#DEC1FA"
21
- };
22
25
  const [tickPositions, setTickPositions] = useState([]);
23
26
  const tickRef = useRef([]);
24
27
  const CustomBarShape = (barProps) => {
@@ -54,6 +57,28 @@ var BarChartComponent = forwardRef((originalProps, ref) => {
54
57
  }
55
58
  );
56
59
  };
60
+ const CustomYAxisTick = ({ x, y, payload }) => {
61
+ return /* @__PURE__ */ jsx(
62
+ "text",
63
+ {
64
+ x: x - 10,
65
+ y,
66
+ textAnchor: "middle",
67
+ fontSize: 12,
68
+ fontWeight: 700,
69
+ fill: "currentColor",
70
+ className: "text-body-foreground",
71
+ dy: 4,
72
+ children: yAxisTickFormatter(payload.value)
73
+ }
74
+ );
75
+ };
76
+ const CustomTooltip = ({ active, payload, label: label2 }) => {
77
+ if (customTooltip && active && payload && payload.length) {
78
+ return customTooltip({ active, payload, label: label2 });
79
+ }
80
+ return null;
81
+ };
57
82
  useEffect(() => {
58
83
  const raf = requestAnimationFrame(() => {
59
84
  const unique = [...new Set(tickRef.current)].sort((a, b) => a - b);
@@ -72,11 +97,25 @@ var BarChartComponent = forwardRef((originalProps, ref) => {
72
97
  BarChart,
73
98
  {
74
99
  data,
75
- margin: { left: -30 },
100
+ margin: { left: -20 },
76
101
  barSize: 20,
77
- barGap: 10,
102
+ barGap: 20,
78
103
  className: "[&_.recharts-surface]:outline-none [&_.recharts-surface]:focus:outline-none",
79
104
  children: [
105
+ /* @__PURE__ */ jsxs("defs", { children: [
106
+ /* @__PURE__ */ jsxs("linearGradient", { id: "blueGradient", x1: "0", y1: "0", x2: "0", y2: "1", children: [
107
+ /* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: "#DEC1FA" }),
108
+ /* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: "#3F9CF2" })
109
+ ] }),
110
+ /* @__PURE__ */ jsxs("linearGradient", { id: "greenGradient", x1: "0", y1: "0", x2: "0", y2: "1", children: [
111
+ /* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: "#C2E59C" }),
112
+ /* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: "#64B3F4" })
113
+ ] }),
114
+ /* @__PURE__ */ jsxs("linearGradient", { id: "pinkGradient", x1: "0", y1: "0", x2: "0", y2: "1", children: [
115
+ /* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: "#DDD6F3" }),
116
+ /* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: "#FAACA8" })
117
+ ] })
118
+ ] }),
80
119
  /* @__PURE__ */ jsx(
81
120
  CartesianGrid,
82
121
  {
@@ -90,11 +129,11 @@ var BarChartComponent = forwardRef((originalProps, ref) => {
90
129
  /* @__PURE__ */ jsx(
91
130
  XAxis,
92
131
  {
93
- dataKey: "name",
132
+ dataKey: "title",
94
133
  axisLine: { stroke: "#DFE2E7", strokeWidth: 1 },
95
134
  tickLine: false,
96
135
  tick: CustomTick,
97
- padding: { left: 32, right: 32 }
136
+ padding: { left: 0, right: 0 }
98
137
  }
99
138
  ),
100
139
  /* @__PURE__ */ jsx(
@@ -102,20 +141,15 @@ var BarChartComponent = forwardRef((originalProps, ref) => {
102
141
  {
103
142
  axisLine: { stroke: "#DFE2E7", strokeWidth: 1 },
104
143
  tickLine: false,
105
- tick: {
106
- fontSize: 12,
107
- fontWeight: 700,
108
- fill: "text-body-foreground",
109
- textAnchor: "middle",
110
- dx: -10
111
- },
112
- ticks: [0, 20, 40, 60, 80, 100],
113
- domain: [-6, 110]
144
+ tick: CustomYAxisTick,
145
+ ticks: yAxisTicks,
146
+ domain: yAxisDomain
114
147
  }
115
148
  ),
116
- /* @__PURE__ */ jsx(Bar, { dataKey: "avg", fill: COLOR_MAP.primary, width: 20, shape: CustomBarShape }),
117
- /* @__PURE__ */ jsx(Bar, { dataKey: "high", fill: COLOR_MAP.secondary, width: 20, shape: CustomBarShape }),
118
- /* @__PURE__ */ jsx(Bar, { dataKey: "low", fill: COLOR_MAP.warning, width: 20, shape: CustomBarShape })
149
+ customTooltip && /* @__PURE__ */ jsx(Tooltip, { content: /* @__PURE__ */ jsx(CustomTooltip, {}), cursor: { fill: "transparent" } }),
150
+ /* @__PURE__ */ jsx(Bar, { dataKey: "blue", fill: "url(#blueGradient)", width: 20, shape: CustomBarShape }),
151
+ /* @__PURE__ */ jsx(Bar, { dataKey: "green", fill: "url(#greenGradient)", width: 20, shape: CustomBarShape }),
152
+ /* @__PURE__ */ jsx(Bar, { dataKey: "pink", fill: "url(#pinkGradient)", width: 20, shape: CustomBarShape })
119
153
  ]
120
154
  }
121
155
  ) })
@@ -62,67 +62,75 @@ var AreaChartComponent = forwardRef((originalProps, ref) => {
62
62
  };
63
63
  return /* @__PURE__ */ jsxs("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
64
64
  label && /* @__PURE__ */ jsx("p", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label }),
65
- /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs(AreaChart, { data, margin: { left: -30 }, children: [
66
- /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", { id: `colorGradient-${uniqueId}`, x1: "0", y1: "0", x2: "0", y2: "1", children: [
67
- /* @__PURE__ */ jsx("stop", { offset: "5%", stopColor: colorHex, stopOpacity: 0.3 }),
68
- /* @__PURE__ */ jsx("stop", { offset: "95%", stopColor: colorHex, stopOpacity: 0 })
69
- ] }) }),
70
- /* @__PURE__ */ jsx(
71
- CartesianGrid,
72
- {
73
- vertical: true,
74
- horizontal: false,
75
- strokeDasharray: "3 3",
76
- className: "stroke-neutral-light",
77
- verticalPoints: tickPositions
78
- }
79
- ),
80
- /* @__PURE__ */ jsx(
81
- XAxis,
82
- {
83
- dataKey: "name",
84
- axisLine: { stroke: "#DFE2E7", strokeWidth: 1 },
85
- tickLine: false,
86
- tick: CustomTick,
87
- padding: { left: 35.5, right: 35.5 }
88
- }
89
- ),
90
- /* @__PURE__ */ jsx(
91
- YAxis,
92
- {
93
- axisLine: { stroke: "#DFE2E7", strokeWidth: 1 },
94
- tickLine: false,
95
- tick: {
96
- fontSize: 12,
97
- fontWeight: 700,
98
- fill: "text-body-foreground",
99
- textAnchor: "middle",
100
- dx: -10
101
- },
102
- ticks: [0, 20, 40, 60, 80, 100],
103
- domain: [-6, 110]
104
- }
105
- ),
106
- /* @__PURE__ */ jsx(
107
- Area,
108
- {
109
- type: "monotone",
110
- dataKey: "value",
111
- stroke: colorHex,
112
- strokeWidth: 2,
113
- fill: `url(#colorGradient-${uniqueId})`,
114
- dot: /* @__PURE__ */ jsx(CustomDotWithShadow, { stroke: colorHex, fill: colorHex }),
115
- activeDot: { r: 7, fill: colorHex }
116
- }
117
- )
118
- ] }) })
65
+ /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs(
66
+ AreaChart,
67
+ {
68
+ data,
69
+ margin: { left: -30 },
70
+ className: "[&_.recharts-surface]:outline-none [&_.recharts-surface]:focus:outline-none",
71
+ children: [
72
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", { id: `colorGradient-${uniqueId}`, x1: "0", y1: "0", x2: "0", y2: "1", children: [
73
+ /* @__PURE__ */ jsx("stop", { offset: "5%", stopColor: colorHex, stopOpacity: 0.3 }),
74
+ /* @__PURE__ */ jsx("stop", { offset: "95%", stopColor: colorHex, stopOpacity: 0 })
75
+ ] }) }),
76
+ /* @__PURE__ */ jsx(
77
+ CartesianGrid,
78
+ {
79
+ vertical: true,
80
+ horizontal: false,
81
+ strokeDasharray: "3 3",
82
+ className: "stroke-neutral-light",
83
+ verticalPoints: tickPositions
84
+ }
85
+ ),
86
+ /* @__PURE__ */ jsx(
87
+ XAxis,
88
+ {
89
+ dataKey: "name",
90
+ axisLine: { stroke: "#DFE2E7", strokeWidth: 1 },
91
+ tickLine: false,
92
+ tick: CustomTick,
93
+ padding: { left: 35.5, right: 35.5 }
94
+ }
95
+ ),
96
+ /* @__PURE__ */ jsx(
97
+ YAxis,
98
+ {
99
+ axisLine: { stroke: "#DFE2E7", strokeWidth: 1 },
100
+ tickLine: false,
101
+ tick: {
102
+ fontSize: 12,
103
+ fontWeight: 700,
104
+ fill: "text-body-foreground",
105
+ textAnchor: "middle",
106
+ dx: -10
107
+ },
108
+ ticks: [0, 20, 40, 60, 80, 100],
109
+ domain: [-6, 110]
110
+ }
111
+ ),
112
+ /* @__PURE__ */ jsx(
113
+ Area,
114
+ {
115
+ type: "monotone",
116
+ dataKey: "value",
117
+ stroke: colorHex,
118
+ strokeWidth: 2,
119
+ fill: `url(#colorGradient-${uniqueId})`,
120
+ dot: /* @__PURE__ */ jsx(CustomDotWithShadow, { stroke: colorHex, fill: colorHex }),
121
+ activeDot: { r: 7, fill: colorHex }
122
+ }
123
+ )
124
+ ]
125
+ }
126
+ ) })
119
127
  ] });
120
128
  });
121
129
  AreaChartComponent.displayName = "AreaChart";
122
130
  var areaChart_default = AreaChartComponent;
123
131
  var areaChartStyle = tv({
124
132
  slots: {
125
- base: ["flex", "flex-col", "gap-[10px]"],
133
+ base: ["flex", "flex-col", "gap-[10px]", "select-none"],
126
134
  color: [],
127
135
  axis: ["text-sm", "font-bold", "text-center", "text-body-foreground"],
128
136
  label: ["text-md", "font-bold", "text-body-foreground"]
@@ -26,31 +26,39 @@ var RadarChart = forwardRef((originalProps, ref) => {
26
26
  return Math.max(...data.map((item) => item.fullMark || 100));
27
27
  }, [data]);
28
28
  return /* @__PURE__ */ jsxs("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
29
- /* @__PURE__ */ jsx(ResponsiveContainer, { width: 580, height: 330, children: /* @__PURE__ */ jsxs(RechartsRadarChart, { data, outerRadius: "80%", children: [
30
- /* @__PURE__ */ jsx(PolarGrid, { stroke: "#DFE2E7", strokeWidth: 1.75 }),
31
- /* @__PURE__ */ jsx(
32
- PolarAngleAxis,
33
- {
34
- dataKey: "name",
35
- tick: { fill: "#333", fontSize: 12, fontWeight: "bold" },
36
- tickFormatter: (value) => value,
37
- tickSize: 15
38
- }
39
- ),
40
- /* @__PURE__ */ jsx(PolarRadiusAxis, { domain: [0, maxFullMark], tick: false, tickCount: 6, axisLine: false }),
41
- /* @__PURE__ */ jsx(
42
- Radar,
43
- {
44
- name: label,
45
- dataKey: "value",
46
- stroke: "#3F9CF2",
47
- fill: "#C7E5FA",
48
- strokeWidth: 1.75,
49
- dot: false,
50
- activeDot: false
51
- }
52
- )
53
- ] }) }),
29
+ /* @__PURE__ */ jsx(ResponsiveContainer, { width: 580, height: 330, children: /* @__PURE__ */ jsxs(
30
+ RechartsRadarChart,
31
+ {
32
+ data,
33
+ outerRadius: "80%",
34
+ className: "[&_.recharts-surface]:outline-none [&_.recharts-surface]:focus:outline-none",
35
+ children: [
36
+ /* @__PURE__ */ jsx(PolarGrid, { stroke: "#DFE2E7", strokeWidth: 1.75 }),
37
+ /* @__PURE__ */ jsx(
38
+ PolarAngleAxis,
39
+ {
40
+ dataKey: "name",
41
+ tick: { fill: "#333", fontSize: 12, fontWeight: "bold" },
42
+ tickFormatter: (value) => value,
43
+ tickSize: 15
44
+ }
45
+ ),
46
+ /* @__PURE__ */ jsx(PolarRadiusAxis, { domain: [0, maxFullMark], tick: false, tickCount: 6, axisLine: false }),
47
+ /* @__PURE__ */ jsx(
48
+ Radar,
49
+ {
50
+ name: label,
51
+ dataKey: "value",
52
+ stroke: "#3F9CF2",
53
+ fill: "#EFF8FF",
54
+ strokeWidth: 1.75,
55
+ dot: false,
56
+ activeDot: false
57
+ }
58
+ )
59
+ ]
60
+ }
61
+ ) }),
54
62
  label && /* @__PURE__ */ jsx("p", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label })
55
63
  ] });
56
64
  });
@@ -58,7 +66,7 @@ RadarChart.displayName = "RadarChart";
58
66
  var radarChart_default = RadarChart;
59
67
  var radarChartStyle = tv({
60
68
  slots: {
61
- base: ["flex", "flex-col", "items-center", "gap-[10px]"],
69
+ base: ["flex", "flex-col", "items-center", "gap-[10px]", "select-none"],
62
70
  label: ["text-sm", "font-bold", "text-left", "text-body-foreground"]
63
71
  },
64
72
  variants: {},
@@ -102,7 +102,7 @@ CircularProgress.displayName = "CircularProgress";
102
102
  var circularProgress_default = CircularProgress;
103
103
  var circularProgressStyle = tv({
104
104
  slots: {
105
- base: ["flex", "flex-col", "items-center", "gap-[20px]"],
105
+ base: ["flex", "flex-col", "items-center", "gap-[20px]", "select-none"],
106
106
  background: ["fill-body-background", "border-neutral-light"],
107
107
  progress: ["transition-all", "duration-1000 ease-out"],
108
108
  percentage: ["text-xl", "font-bold", "text-body-foreground"],
@@ -424,67 +424,75 @@ var AreaChartComponent = (0, import_react.forwardRef)((originalProps, ref) => {
424
424
  };
425
425
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
426
426
  label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label }),
427
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_recharts.ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_recharts.AreaChart, { data, margin: { left: -30 }, children: [
428
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("linearGradient", { id: `colorGradient-${uniqueId}`, x1: "0", y1: "0", x2: "0", y2: "1", children: [
429
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("stop", { offset: "5%", stopColor: colorHex, stopOpacity: 0.3 }),
430
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("stop", { offset: "95%", stopColor: colorHex, stopOpacity: 0 })
431
- ] }) }),
432
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
433
- import_recharts.CartesianGrid,
434
- {
435
- vertical: true,
436
- horizontal: false,
437
- strokeDasharray: "3 3",
438
- className: "stroke-neutral-light",
439
- verticalPoints: tickPositions
440
- }
441
- ),
442
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
443
- import_recharts.XAxis,
444
- {
445
- dataKey: "name",
446
- axisLine: { stroke: "#DFE2E7", strokeWidth: 1 },
447
- tickLine: false,
448
- tick: CustomTick,
449
- padding: { left: 35.5, right: 35.5 }
450
- }
451
- ),
452
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
453
- import_recharts.YAxis,
454
- {
455
- axisLine: { stroke: "#DFE2E7", strokeWidth: 1 },
456
- tickLine: false,
457
- tick: {
458
- fontSize: 12,
459
- fontWeight: 700,
460
- fill: "text-body-foreground",
461
- textAnchor: "middle",
462
- dx: -10
463
- },
464
- ticks: [0, 20, 40, 60, 80, 100],
465
- domain: [-6, 110]
466
- }
467
- ),
468
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
469
- import_recharts.Area,
470
- {
471
- type: "monotone",
472
- dataKey: "value",
473
- stroke: colorHex,
474
- strokeWidth: 2,
475
- fill: `url(#colorGradient-${uniqueId})`,
476
- dot: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CustomDotWithShadow, { stroke: colorHex, fill: colorHex }),
477
- activeDot: { r: 7, fill: colorHex }
478
- }
479
- )
480
- ] }) })
427
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_recharts.ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
428
+ import_recharts.AreaChart,
429
+ {
430
+ data,
431
+ margin: { left: -30 },
432
+ className: "[&_.recharts-surface]:outline-none [&_.recharts-surface]:focus:outline-none",
433
+ children: [
434
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("linearGradient", { id: `colorGradient-${uniqueId}`, x1: "0", y1: "0", x2: "0", y2: "1", children: [
435
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("stop", { offset: "5%", stopColor: colorHex, stopOpacity: 0.3 }),
436
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("stop", { offset: "95%", stopColor: colorHex, stopOpacity: 0 })
437
+ ] }) }),
438
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
439
+ import_recharts.CartesianGrid,
440
+ {
441
+ vertical: true,
442
+ horizontal: false,
443
+ strokeDasharray: "3 3",
444
+ className: "stroke-neutral-light",
445
+ verticalPoints: tickPositions
446
+ }
447
+ ),
448
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
449
+ import_recharts.XAxis,
450
+ {
451
+ dataKey: "name",
452
+ axisLine: { stroke: "#DFE2E7", strokeWidth: 1 },
453
+ tickLine: false,
454
+ tick: CustomTick,
455
+ padding: { left: 35.5, right: 35.5 }
456
+ }
457
+ ),
458
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
459
+ import_recharts.YAxis,
460
+ {
461
+ axisLine: { stroke: "#DFE2E7", strokeWidth: 1 },
462
+ tickLine: false,
463
+ tick: {
464
+ fontSize: 12,
465
+ fontWeight: 700,
466
+ fill: "text-body-foreground",
467
+ textAnchor: "middle",
468
+ dx: -10
469
+ },
470
+ ticks: [0, 20, 40, 60, 80, 100],
471
+ domain: [-6, 110]
472
+ }
473
+ ),
474
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
475
+ import_recharts.Area,
476
+ {
477
+ type: "monotone",
478
+ dataKey: "value",
479
+ stroke: colorHex,
480
+ strokeWidth: 2,
481
+ fill: `url(#colorGradient-${uniqueId})`,
482
+ dot: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CustomDotWithShadow, { stroke: colorHex, fill: colorHex }),
483
+ activeDot: { r: 7, fill: colorHex }
484
+ }
485
+ )
486
+ ]
487
+ }
488
+ ) })
481
489
  ] });
482
490
  });
483
491
  AreaChartComponent.displayName = "AreaChart";
484
492
  var areaChart_default = AreaChartComponent;
485
493
  var areaChartStyle = tv({
486
494
  slots: {
487
- base: ["flex", "flex-col", "gap-[10px]"],
495
+ base: ["flex", "flex-col", "gap-[10px]", "select-none"],
488
496
  color: [],
489
497
  axis: ["text-sm", "font-bold", "text-center", "text-body-foreground"],
490
498
  label: ["text-md", "font-bold", "text-body-foreground"]
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  areaChart_default
4
- } from "../../chunk-WIZDHK4O.mjs";
4
+ } from "../../chunk-QKRCC26D.mjs";
5
5
  import "../../chunk-E3G5QXSH.mjs";
6
6
  import "../../chunk-CDXBML6O.mjs";
7
7
  import "../../chunk-AC6TWLRT.mjs";
@@ -1,18 +1,28 @@
1
1
  import * as tailwind_variants from 'tailwind-variants';
2
2
  import { VariantProps } from 'tailwind-variants';
3
3
  import * as react from 'react';
4
+ import { ReactNode } from 'react';
4
5
  import { SlotsToClasses } from '../../utils/types.mjs';
5
6
 
6
7
  type BarData = {
7
- name: string;
8
- avg: number;
9
- high: number;
10
- low: number;
8
+ title: string;
9
+ blue: number;
10
+ green: number;
11
+ pink: number;
12
+ };
13
+ type TooltipProps = {
14
+ active: boolean;
15
+ payload: any[];
16
+ label: string;
11
17
  };
12
18
  type Props = {
13
19
  data?: BarData[];
14
20
  label?: string;
15
21
  classNames?: SlotsToClasses<barChartSlots>;
22
+ yAxisTicks?: number[];
23
+ yAxisTickFormatter?: (value: number) => string;
24
+ yAxisDomain?: [number, number];
25
+ customTooltip?: (props: TooltipProps) => ReactNode;
16
26
  };
17
27
  type barChartProps = Props & barChartVariantProps;
18
28
  declare const BarChartComponent: react.ForwardRefExoticComponent<Props & barChartVariantProps & react.RefAttributes<HTMLDivElement>>;
@@ -1,18 +1,28 @@
1
1
  import * as tailwind_variants from 'tailwind-variants';
2
2
  import { VariantProps } from 'tailwind-variants';
3
3
  import * as react from 'react';
4
+ import { ReactNode } from 'react';
4
5
  import { SlotsToClasses } from '../../utils/types.js';
5
6
 
6
7
  type BarData = {
7
- name: string;
8
- avg: number;
9
- high: number;
10
- low: number;
8
+ title: string;
9
+ blue: number;
10
+ green: number;
11
+ pink: number;
12
+ };
13
+ type TooltipProps = {
14
+ active: boolean;
15
+ payload: any[];
16
+ label: string;
11
17
  };
12
18
  type Props = {
13
19
  data?: BarData[];
14
20
  label?: string;
15
21
  classNames?: SlotsToClasses<barChartSlots>;
22
+ yAxisTicks?: number[];
23
+ yAxisTickFormatter?: (value: number) => string;
24
+ yAxisDomain?: [number, number];
25
+ customTooltip?: (props: TooltipProps) => ReactNode;
16
26
  };
17
27
  type barChartProps = Props & barChartVariantProps;
18
28
  declare const BarChartComponent: react.ForwardRefExoticComponent<Props & barChartVariantProps & react.RefAttributes<HTMLDivElement>>;