@deepnoid/ui 0.1.181 → 0.1.183
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +145 -145
- package/dist/{chunk-GWHUQUKA.mjs → chunk-6WD32ERF.mjs} +93 -79
- package/dist/{chunk-HOQAQVDA.mjs → chunk-VRHMQMRO.mjs} +110 -31
- package/dist/chunk-WKTRWHDA.mjs +264 -0
- package/dist/components/charts/barChart.js +125 -111
- package/dist/components/charts/barChart.mjs +1 -1
- package/dist/components/charts/index.js +218 -190
- package/dist/components/charts/index.mjs +2 -2
- package/dist/components/charts/simpleBarChart.js +93 -79
- package/dist/components/charts/simpleBarChart.mjs +1 -1
- package/dist/components/table/index.js +144 -65
- package/dist/components/table/index.mjs +1 -1
- package/dist/components/table/table-body.js +140 -61
- package/dist/components/table/table-body.mjs +1 -1
- package/dist/components/table/table-head.js +108 -31
- package/dist/components/table/table-head.mjs +1 -1
- package/dist/components/table/table.js +140 -61
- package/dist/components/table/table.mjs +1 -1
- package/dist/components/toast/index.mjs +2 -2
- package/dist/components/toast/use-toast.mjs +2 -2
- package/dist/index.js +540 -433
- package/dist/index.mjs +19 -19
- package/package.json +1 -1
- package/dist/chunk-JOK735WN.mjs +0 -250
- package/dist/{chunk-ROXKJQSJ.mjs → chunk-4SDPS5R2.mjs} +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import "./chunk-MBLZYQCN.mjs";
|
|
3
|
-
import {
|
|
4
|
-
tree_default
|
|
5
|
-
} from "./chunk-MWUA62VL.mjs";
|
|
6
2
|
import "./chunk-HIE2YRGA.mjs";
|
|
7
3
|
import {
|
|
8
4
|
tooltip_default
|
|
9
5
|
} from "./chunk-5KC3IFNR.mjs";
|
|
10
6
|
import "./chunk-ZMOAFSYE.mjs";
|
|
11
7
|
import "./chunk-WSIADHVC.mjs";
|
|
8
|
+
import "./chunk-MBLZYQCN.mjs";
|
|
9
|
+
import {
|
|
10
|
+
tree_default
|
|
11
|
+
} from "./chunk-MWUA62VL.mjs";
|
|
12
12
|
import "./chunk-3MY6LO7N.mjs";
|
|
13
13
|
import {
|
|
14
14
|
tabs_default
|
|
15
15
|
} from "./chunk-DW3BX4M2.mjs";
|
|
16
|
+
import "./chunk-RRAZM5D3.mjs";
|
|
17
|
+
import {
|
|
18
|
+
textarea_default
|
|
19
|
+
} from "./chunk-3CRSSRCH.mjs";
|
|
16
20
|
import "./chunk-LUWGOKLG.mjs";
|
|
17
21
|
import {
|
|
18
22
|
ToastProvider,
|
|
19
23
|
useToast
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-ZOTHPHXA.mjs";
|
|
24
|
+
} from "./chunk-4SDPS5R2.mjs";
|
|
22
25
|
import {
|
|
23
26
|
toast_default
|
|
24
27
|
} from "./chunk-GS5X67UB.mjs";
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import
|
|
27
|
-
textarea_default
|
|
28
|
-
} from "./chunk-3CRSSRCH.mjs";
|
|
29
|
-
import "./chunk-LVFI2NOH.mjs";
|
|
28
|
+
import "./chunk-ZOTHPHXA.mjs";
|
|
29
|
+
import "./chunk-OLQOLLKG.mjs";
|
|
30
30
|
import {
|
|
31
|
-
|
|
32
|
-
} from "./chunk-
|
|
31
|
+
starRating_default
|
|
32
|
+
} from "./chunk-X64VT74O.mjs";
|
|
33
33
|
import "./chunk-DX3KXNP6.mjs";
|
|
34
34
|
import {
|
|
35
35
|
definition_table_default
|
|
36
36
|
} from "./chunk-DS5CGU2X.mjs";
|
|
37
37
|
import {
|
|
38
38
|
table_default
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-VRHMQMRO.mjs";
|
|
40
40
|
import "./chunk-MZ76AA76.mjs";
|
|
41
41
|
import {
|
|
42
42
|
skeleton_default
|
|
43
43
|
} from "./chunk-6PN3DGOE.mjs";
|
|
44
|
-
import "./chunk-
|
|
44
|
+
import "./chunk-LVFI2NOH.mjs";
|
|
45
45
|
import {
|
|
46
|
-
|
|
47
|
-
} from "./chunk-
|
|
46
|
+
switch_default
|
|
47
|
+
} from "./chunk-AGE57VDD.mjs";
|
|
48
48
|
import "./chunk-TPFN22HR.mjs";
|
|
49
49
|
import {
|
|
50
50
|
radio_default
|
|
@@ -112,7 +112,7 @@ import {
|
|
|
112
112
|
import {
|
|
113
113
|
BarChartTooltip,
|
|
114
114
|
barChart_default
|
|
115
|
-
} from "./chunk-
|
|
115
|
+
} from "./chunk-WKTRWHDA.mjs";
|
|
116
116
|
import {
|
|
117
117
|
circularProgress_default
|
|
118
118
|
} from "./chunk-WA7CSZQ3.mjs";
|
|
@@ -121,7 +121,7 @@ import {
|
|
|
121
121
|
} from "./chunk-U7SYKG2C.mjs";
|
|
122
122
|
import {
|
|
123
123
|
simpleBarChart_default
|
|
124
|
-
} from "./chunk-
|
|
124
|
+
} from "./chunk-6WD32ERF.mjs";
|
|
125
125
|
import {
|
|
126
126
|
checkbox_default
|
|
127
127
|
} from "./chunk-OEIEALIP.mjs";
|
package/package.json
CHANGED
package/dist/chunk-JOK735WN.mjs
DELETED
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
mapPropsVariants
|
|
4
|
-
} from "./chunk-E3G5QXSH.mjs";
|
|
5
|
-
import {
|
|
6
|
-
tv
|
|
7
|
-
} from "./chunk-U4DJHAM5.mjs";
|
|
8
|
-
|
|
9
|
-
// src/components/charts/barChart.tsx
|
|
10
|
-
import { forwardRef, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
11
|
-
import { XAxis, YAxis, ResponsiveContainer, CartesianGrid, BarChart, Bar } from "recharts";
|
|
12
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
-
var BarChartComponent = forwardRef((originalProps, ref) => {
|
|
14
|
-
const [props, variantProps] = mapPropsVariants(originalProps, barChartStyle.variantKeys);
|
|
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
|
-
barGap = 20,
|
|
23
|
-
tooltipFormatter
|
|
24
|
-
} = { ...props, ...variantProps };
|
|
25
|
-
const slots = useMemo(() => barChartStyle({ ...variantProps }), [variantProps]);
|
|
26
|
-
const chartRef = useRef(null);
|
|
27
|
-
const tooltipRef = useRef(null);
|
|
28
|
-
const [tooltipLeft, setTooltipLeft] = useState(0);
|
|
29
|
-
const [tickPositions, setTickPositions] = useState([]);
|
|
30
|
-
const tickRef = useRef([]);
|
|
31
|
-
const [tooltipState, setTooltipState] = useState(null);
|
|
32
|
-
const handleMouseEnter = (e, dataKey) => {
|
|
33
|
-
if (!tooltipFormatter || !chartRef.current) return;
|
|
34
|
-
const { payload, x, y } = e;
|
|
35
|
-
if (!payload || !payload[dataKey]) return;
|
|
36
|
-
setTooltipState({
|
|
37
|
-
x,
|
|
38
|
-
y,
|
|
39
|
-
value: payload[dataKey],
|
|
40
|
-
dataKey,
|
|
41
|
-
label: payload.title
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
const handleMouseLeave = () => {
|
|
45
|
-
setTooltipState(null);
|
|
46
|
-
};
|
|
47
|
-
const CustomBarShape = ({ x, y, width, height, fill }) => {
|
|
48
|
-
const radius = 5;
|
|
49
|
-
const extraHeight = 10;
|
|
50
|
-
const adjustedHeight = height + extraHeight;
|
|
51
|
-
const adjustedY = y;
|
|
52
|
-
const bottomY = adjustedY + adjustedHeight;
|
|
53
|
-
return height ? /* @__PURE__ */ jsx(
|
|
54
|
-
"path",
|
|
55
|
-
{
|
|
56
|
-
d: `M${x},${bottomY} L${x},${adjustedY + radius} Q${x},${adjustedY} ${x + radius},${adjustedY} L${x + width - radius},${adjustedY} Q${x + width},${adjustedY} ${x + width},${adjustedY + radius} L${x + width},${bottomY} Z`,
|
|
57
|
-
fill
|
|
58
|
-
}
|
|
59
|
-
) : /* @__PURE__ */ jsx("rect", { x, y, width, height: 0, fill });
|
|
60
|
-
};
|
|
61
|
-
const CustomTick = ({ x, y, payload }) => {
|
|
62
|
-
if (x !== void 0) tickRef.current.push(x);
|
|
63
|
-
return /* @__PURE__ */ jsx(
|
|
64
|
-
"text",
|
|
65
|
-
{
|
|
66
|
-
x,
|
|
67
|
-
y: y + 14,
|
|
68
|
-
textAnchor: "middle",
|
|
69
|
-
fontSize: 12,
|
|
70
|
-
fontWeight: 700,
|
|
71
|
-
fill: "currentColor",
|
|
72
|
-
className: "text-body-foreground",
|
|
73
|
-
children: payload.value
|
|
74
|
-
}
|
|
75
|
-
);
|
|
76
|
-
};
|
|
77
|
-
const CustomYAxisTick = ({ x, y, payload }) => /* @__PURE__ */ jsx(
|
|
78
|
-
"text",
|
|
79
|
-
{
|
|
80
|
-
x: x - 10,
|
|
81
|
-
y,
|
|
82
|
-
textAnchor: "middle",
|
|
83
|
-
fontSize: 12,
|
|
84
|
-
fontWeight: 700,
|
|
85
|
-
fill: "currentColor",
|
|
86
|
-
className: "text-body-foreground",
|
|
87
|
-
dy: 4,
|
|
88
|
-
children: yAxisTickFormatter(payload.value)
|
|
89
|
-
}
|
|
90
|
-
);
|
|
91
|
-
useEffect(() => {
|
|
92
|
-
const raf = requestAnimationFrame(() => {
|
|
93
|
-
const unique = [...new Set(tickRef.current)].sort((a, b) => a - b);
|
|
94
|
-
const mids = [];
|
|
95
|
-
for (let i = 0; i < unique.length - 1; i++) {
|
|
96
|
-
mids.push((unique[i] + unique[i + 1]) / 2);
|
|
97
|
-
}
|
|
98
|
-
setTickPositions(mids);
|
|
99
|
-
tickRef.current = [];
|
|
100
|
-
});
|
|
101
|
-
return () => cancelAnimationFrame(raf);
|
|
102
|
-
}, [data]);
|
|
103
|
-
useLayoutEffect(() => {
|
|
104
|
-
if (!tooltipState || !chartRef.current || !tooltipRef.current) return;
|
|
105
|
-
const chartRect = chartRef.current.getBoundingClientRect();
|
|
106
|
-
const tooltipRect = tooltipRef.current.getBoundingClientRect();
|
|
107
|
-
const chartWidth = chartRect.width;
|
|
108
|
-
const tooltipWidth = tooltipRect.width;
|
|
109
|
-
let left = tooltipState.x - tooltipWidth / 2;
|
|
110
|
-
const padding = 8;
|
|
111
|
-
if (left < padding) {
|
|
112
|
-
left = padding;
|
|
113
|
-
} else if (left + tooltipWidth > chartWidth - padding) {
|
|
114
|
-
left = chartWidth - tooltipWidth - padding;
|
|
115
|
-
}
|
|
116
|
-
setTooltipLeft(left);
|
|
117
|
-
}, [tooltipState]);
|
|
118
|
-
return /* @__PURE__ */ jsxs("div", { ref: chartRef, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), onMouseLeave: handleMouseLeave, children: [
|
|
119
|
-
label && /* @__PURE__ */ jsx("p", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label }),
|
|
120
|
-
/* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs(
|
|
121
|
-
BarChart,
|
|
122
|
-
{
|
|
123
|
-
data,
|
|
124
|
-
margin: { left: -20 },
|
|
125
|
-
barSize: 20,
|
|
126
|
-
barGap,
|
|
127
|
-
className: "[&_.recharts-surface]:outline-none [&_.recharts-surface]:focus:outline-none",
|
|
128
|
-
children: [
|
|
129
|
-
/* @__PURE__ */ jsxs("defs", { children: [
|
|
130
|
-
/* @__PURE__ */ jsxs("linearGradient", { id: "blueGradient", x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
131
|
-
/* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: "#DEC1FA" }),
|
|
132
|
-
/* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: "#3F9CF2" })
|
|
133
|
-
] }),
|
|
134
|
-
/* @__PURE__ */ jsxs("linearGradient", { id: "greenGradient", x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
135
|
-
/* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: "#C2E59C" }),
|
|
136
|
-
/* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: "#64B3F4" })
|
|
137
|
-
] }),
|
|
138
|
-
/* @__PURE__ */ jsxs("linearGradient", { id: "pinkGradient", x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
139
|
-
/* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: "#DDD6F3" }),
|
|
140
|
-
/* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: "#FAACA8" })
|
|
141
|
-
] })
|
|
142
|
-
] }),
|
|
143
|
-
/* @__PURE__ */ jsx(
|
|
144
|
-
CartesianGrid,
|
|
145
|
-
{
|
|
146
|
-
vertical: true,
|
|
147
|
-
horizontal: false,
|
|
148
|
-
strokeDasharray: "4 4",
|
|
149
|
-
className: "stroke-neutral-light",
|
|
150
|
-
verticalPoints: tickPositions
|
|
151
|
-
}
|
|
152
|
-
),
|
|
153
|
-
/* @__PURE__ */ jsx(
|
|
154
|
-
XAxis,
|
|
155
|
-
{
|
|
156
|
-
dataKey: "title",
|
|
157
|
-
axisLine: { stroke: "#DFE2E7", strokeWidth: 1 },
|
|
158
|
-
tickLine: false,
|
|
159
|
-
tick: CustomTick,
|
|
160
|
-
padding: { left: 0, right: 0 }
|
|
161
|
-
}
|
|
162
|
-
),
|
|
163
|
-
/* @__PURE__ */ jsx(
|
|
164
|
-
YAxis,
|
|
165
|
-
{
|
|
166
|
-
axisLine: { stroke: "#DFE2E7", strokeWidth: 1 },
|
|
167
|
-
tickLine: false,
|
|
168
|
-
tick: CustomYAxisTick,
|
|
169
|
-
ticks: yAxisTicks,
|
|
170
|
-
domain: yAxisDomain
|
|
171
|
-
}
|
|
172
|
-
),
|
|
173
|
-
/* @__PURE__ */ jsx(
|
|
174
|
-
Bar,
|
|
175
|
-
{
|
|
176
|
-
dataKey: "blue",
|
|
177
|
-
fill: "url(#blueGradient)",
|
|
178
|
-
shape: CustomBarShape,
|
|
179
|
-
onMouseEnter: (e) => handleMouseEnter(e, "blue"),
|
|
180
|
-
onMouseLeave: handleMouseLeave
|
|
181
|
-
}
|
|
182
|
-
),
|
|
183
|
-
/* @__PURE__ */ jsx(
|
|
184
|
-
Bar,
|
|
185
|
-
{
|
|
186
|
-
dataKey: "green",
|
|
187
|
-
fill: "url(#greenGradient)",
|
|
188
|
-
shape: CustomBarShape,
|
|
189
|
-
onMouseEnter: (e) => handleMouseEnter(e, "green"),
|
|
190
|
-
onMouseLeave: handleMouseLeave
|
|
191
|
-
}
|
|
192
|
-
),
|
|
193
|
-
/* @__PURE__ */ jsx(
|
|
194
|
-
Bar,
|
|
195
|
-
{
|
|
196
|
-
dataKey: "pink",
|
|
197
|
-
fill: "url(#pinkGradient)",
|
|
198
|
-
shape: CustomBarShape,
|
|
199
|
-
onMouseEnter: (e) => handleMouseEnter(e, "pink"),
|
|
200
|
-
onMouseLeave: handleMouseLeave
|
|
201
|
-
}
|
|
202
|
-
)
|
|
203
|
-
]
|
|
204
|
-
}
|
|
205
|
-
) }),
|
|
206
|
-
tooltipFormatter && /* @__PURE__ */ jsx(
|
|
207
|
-
"div",
|
|
208
|
-
{
|
|
209
|
-
ref: tooltipRef,
|
|
210
|
-
style: {
|
|
211
|
-
position: "absolute",
|
|
212
|
-
left: tooltipLeft + 10,
|
|
213
|
-
top: (tooltipState == null ? void 0 : tooltipState.y) ? tooltipState.y - 40 : 0,
|
|
214
|
-
pointerEvents: "none",
|
|
215
|
-
zIndex: 10,
|
|
216
|
-
opacity: tooltipState ? 1 : 0,
|
|
217
|
-
transition: "opacity 0.1s ease-out",
|
|
218
|
-
visibility: tooltipState ? "visible" : "hidden",
|
|
219
|
-
width: "fit-content",
|
|
220
|
-
whiteSpace: "nowrap"
|
|
221
|
-
},
|
|
222
|
-
children: tooltipState && tooltipFormatter(tooltipState)
|
|
223
|
-
}
|
|
224
|
-
)
|
|
225
|
-
] });
|
|
226
|
-
});
|
|
227
|
-
BarChartComponent.displayName = "barChart";
|
|
228
|
-
var barChart_default = BarChartComponent;
|
|
229
|
-
var barChartStyle = tv({
|
|
230
|
-
slots: {
|
|
231
|
-
base: ["flex", "flex-col", "gap-[10px]", "select-none", "relative"],
|
|
232
|
-
label: ["text-md", "font-bold", "text-body-foreground"]
|
|
233
|
-
},
|
|
234
|
-
variants: {},
|
|
235
|
-
defaultVariants: {}
|
|
236
|
-
});
|
|
237
|
-
function BarChartTooltip({ className = "", children }) {
|
|
238
|
-
return /* @__PURE__ */ jsx(
|
|
239
|
-
"div",
|
|
240
|
-
{
|
|
241
|
-
className: `text-md text-common-white bg-common-black flex max-w-[160px] whitespace-nowrap rounded-[5px] px-[10px] py-[6px] text-center font-bold ${className}`,
|
|
242
|
-
children
|
|
243
|
-
}
|
|
244
|
-
);
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
export {
|
|
248
|
-
barChart_default,
|
|
249
|
-
BarChartTooltip
|
|
250
|
-
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
getToastPosition
|
|
4
|
-
} from "./chunk-ZOTHPHXA.mjs";
|
|
5
2
|
import {
|
|
6
3
|
toast_default
|
|
7
4
|
} from "./chunk-GS5X67UB.mjs";
|
|
5
|
+
import {
|
|
6
|
+
getToastPosition
|
|
7
|
+
} from "./chunk-ZOTHPHXA.mjs";
|
|
8
8
|
|
|
9
9
|
// src/components/toast/use-toast.tsx
|
|
10
10
|
import { createContext, useContext, useState, useCallback, useEffect, useRef } from "react";
|