@deepnoid/ui 0.1.167 → 0.1.169
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 +165 -160
- package/dist/chunk-B4UNRT7U.mjs +192 -0
- package/dist/{chunk-BRVQTI2T.mjs → chunk-JOK735WN.mjs} +9 -3
- package/dist/{chunk-ARNMOGRH.mjs → chunk-LH6Z7SDZ.mjs} +1 -1
- package/dist/components/charts/areaChart.js +1 -1
- package/dist/components/charts/areaChart.mjs +1 -1
- package/dist/components/charts/barChart.d.mts +4 -2
- package/dist/components/charts/barChart.d.ts +4 -2
- package/dist/components/charts/barChart.js +9 -3
- package/dist/components/charts/barChart.mjs +1 -1
- package/dist/components/charts/index.d.mts +1 -0
- package/dist/components/charts/index.d.ts +1 -0
- package/dist/components/charts/index.js +195 -6
- package/dist/components/charts/index.mjs +8 -4
- package/dist/components/charts/simpleBarChart.d.mts +40 -0
- package/dist/components/charts/simpleBarChart.d.ts +40 -0
- package/dist/components/charts/simpleBarChart.js +555 -0
- package/dist/components/charts/simpleBarChart.mjs +10 -0
- package/dist/components/picker/datePicker.mjs +2 -2
- package/dist/components/picker/index.mjs +2 -2
- package/dist/components/table/index.mjs +1 -1
- package/dist/components/table/table-body.mjs +1 -1
- package/dist/components/table/table-head.mjs +1 -1
- 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.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +208 -19
- package/dist/index.mjs +26 -22
- package/package.json +1 -1
- package/dist/{chunk-VYNBJBXD.mjs → chunk-3OCNT22V.mjs} +0 -0
- package/dist/{chunk-EQLBG32V.mjs → chunk-4OOHXMJH.mjs} +3 -3
- package/dist/{chunk-NJFJJIWK.mjs → chunk-W66K4FK5.mjs} +3 -3
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as tailwind_variants from 'tailwind-variants';
|
|
2
|
+
import { VariantProps } from 'tailwind-variants';
|
|
3
|
+
import * as react from 'react';
|
|
4
|
+
import { ReactNode } from 'react';
|
|
5
|
+
import { SlotsToClasses } from '../../utils/types.js';
|
|
6
|
+
|
|
7
|
+
type SimpleBarData = {
|
|
8
|
+
title: string;
|
|
9
|
+
value: number;
|
|
10
|
+
};
|
|
11
|
+
type TooltipFormatterParams = {
|
|
12
|
+
value: number;
|
|
13
|
+
label: string;
|
|
14
|
+
};
|
|
15
|
+
type Props = {
|
|
16
|
+
data?: SimpleBarData[];
|
|
17
|
+
label?: string;
|
|
18
|
+
classNames?: SlotsToClasses<simpleBarChartSlots>;
|
|
19
|
+
yAxisTicks?: number[];
|
|
20
|
+
yAxisDomain?: [number, number];
|
|
21
|
+
barGap?: number;
|
|
22
|
+
tooltipFormatter?: (params: TooltipFormatterParams) => ReactNode;
|
|
23
|
+
};
|
|
24
|
+
type simpleBarChartProps = Props & simpleBarChartVariantProps;
|
|
25
|
+
declare const SimpleBarChartComponent: react.ForwardRefExoticComponent<Props & simpleBarChartVariantProps & react.RefAttributes<HTMLDivElement>>;
|
|
26
|
+
|
|
27
|
+
declare const simpleBarChartStyle: tailwind_variants.TVReturnType<{}, {
|
|
28
|
+
base: string[];
|
|
29
|
+
label: string[];
|
|
30
|
+
}, undefined, {}, {
|
|
31
|
+
base: string[];
|
|
32
|
+
label: string[];
|
|
33
|
+
}, tailwind_variants.TVReturnType<{}, {
|
|
34
|
+
base: string[];
|
|
35
|
+
label: string[];
|
|
36
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
37
|
+
type simpleBarChartVariantProps = VariantProps<typeof simpleBarChartStyle>;
|
|
38
|
+
type simpleBarChartSlots = keyof ReturnType<typeof simpleBarChartStyle>;
|
|
39
|
+
|
|
40
|
+
export { SimpleBarChartComponent as default, type simpleBarChartProps };
|
|
@@ -0,0 +1,555 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
10
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
11
|
+
};
|
|
12
|
+
var __export = (target, all) => {
|
|
13
|
+
for (var name in all)
|
|
14
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
15
|
+
};
|
|
16
|
+
var __copyProps = (to, from, except, desc) => {
|
|
17
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
|
+
for (let key of __getOwnPropNames(from))
|
|
19
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
20
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
};
|
|
24
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
25
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
26
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
27
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
30
|
+
mod
|
|
31
|
+
));
|
|
32
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
33
|
+
|
|
34
|
+
// ../../node_modules/tailwindcss/lib/util/createPlugin.js
|
|
35
|
+
var require_createPlugin = __commonJS({
|
|
36
|
+
"../../node_modules/tailwindcss/lib/util/createPlugin.js"(exports2) {
|
|
37
|
+
"use strict";
|
|
38
|
+
Object.defineProperty(exports2, "__esModule", {
|
|
39
|
+
value: true
|
|
40
|
+
});
|
|
41
|
+
Object.defineProperty(exports2, "default", {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
get: function() {
|
|
44
|
+
return _default;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
function createPlugin(plugin2, config) {
|
|
48
|
+
return {
|
|
49
|
+
handler: plugin2,
|
|
50
|
+
config
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
createPlugin.withOptions = function(pluginFunction, configFunction = () => ({})) {
|
|
54
|
+
const optionsFunction = function(options) {
|
|
55
|
+
return {
|
|
56
|
+
__options: options,
|
|
57
|
+
handler: pluginFunction(options),
|
|
58
|
+
config: configFunction(options)
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
optionsFunction.__isOptionsFunction = true;
|
|
62
|
+
optionsFunction.__pluginFunction = pluginFunction;
|
|
63
|
+
optionsFunction.__configFunction = configFunction;
|
|
64
|
+
return optionsFunction;
|
|
65
|
+
};
|
|
66
|
+
var _default = createPlugin;
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
// ../../node_modules/tailwindcss/lib/public/create-plugin.js
|
|
71
|
+
var require_create_plugin = __commonJS({
|
|
72
|
+
"../../node_modules/tailwindcss/lib/public/create-plugin.js"(exports2) {
|
|
73
|
+
"use strict";
|
|
74
|
+
Object.defineProperty(exports2, "__esModule", {
|
|
75
|
+
value: true
|
|
76
|
+
});
|
|
77
|
+
Object.defineProperty(exports2, "default", {
|
|
78
|
+
enumerable: true,
|
|
79
|
+
get: function() {
|
|
80
|
+
return _default;
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
var _createPlugin = /* @__PURE__ */ _interop_require_default(require_createPlugin());
|
|
84
|
+
function _interop_require_default(obj) {
|
|
85
|
+
return obj && obj.__esModule ? obj : {
|
|
86
|
+
default: obj
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
var _default = _createPlugin.default;
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
// ../../node_modules/tailwindcss/plugin.js
|
|
94
|
+
var require_plugin = __commonJS({
|
|
95
|
+
"../../node_modules/tailwindcss/plugin.js"(exports2, module2) {
|
|
96
|
+
"use strict";
|
|
97
|
+
var createPlugin = require_create_plugin();
|
|
98
|
+
module2.exports = (createPlugin.__esModule ? createPlugin : { default: createPlugin }).default;
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
// src/components/charts/simpleBarChart.tsx
|
|
103
|
+
var simpleBarChart_exports = {};
|
|
104
|
+
__export(simpleBarChart_exports, {
|
|
105
|
+
default: () => simpleBarChart_default
|
|
106
|
+
});
|
|
107
|
+
module.exports = __toCommonJS(simpleBarChart_exports);
|
|
108
|
+
var import_react = require("react");
|
|
109
|
+
var import_recharts = require("recharts");
|
|
110
|
+
|
|
111
|
+
// src/utils/tailwind-variants.ts
|
|
112
|
+
var import_tailwind_variants = require("tailwind-variants");
|
|
113
|
+
|
|
114
|
+
// ../tailwind-config/src/plugin.ts
|
|
115
|
+
var import_plugin = __toESM(require_plugin());
|
|
116
|
+
|
|
117
|
+
// ../tailwind-config/src/typography/font.ts
|
|
118
|
+
var fontSize = {
|
|
119
|
+
h1: [
|
|
120
|
+
"40px",
|
|
121
|
+
{
|
|
122
|
+
fontWeight: "700"
|
|
123
|
+
}
|
|
124
|
+
],
|
|
125
|
+
h2: [
|
|
126
|
+
"34px",
|
|
127
|
+
{
|
|
128
|
+
fontWeight: "700"
|
|
129
|
+
}
|
|
130
|
+
],
|
|
131
|
+
h3: [
|
|
132
|
+
"28px",
|
|
133
|
+
{
|
|
134
|
+
fontWeight: "700"
|
|
135
|
+
}
|
|
136
|
+
],
|
|
137
|
+
h4: [
|
|
138
|
+
"24px",
|
|
139
|
+
{
|
|
140
|
+
fontWeight: "700"
|
|
141
|
+
}
|
|
142
|
+
],
|
|
143
|
+
h5: [
|
|
144
|
+
"20px",
|
|
145
|
+
{
|
|
146
|
+
fontWeight: "600"
|
|
147
|
+
}
|
|
148
|
+
],
|
|
149
|
+
sm: [
|
|
150
|
+
"12px",
|
|
151
|
+
{
|
|
152
|
+
lineHeight: "18px",
|
|
153
|
+
fontWeight: "400"
|
|
154
|
+
}
|
|
155
|
+
],
|
|
156
|
+
md: [
|
|
157
|
+
"14px",
|
|
158
|
+
{
|
|
159
|
+
lineHeight: "21px",
|
|
160
|
+
fontWeight: "400"
|
|
161
|
+
}
|
|
162
|
+
],
|
|
163
|
+
lg: [
|
|
164
|
+
"16px",
|
|
165
|
+
{
|
|
166
|
+
lineHeight: "24px",
|
|
167
|
+
fontWeight: "400"
|
|
168
|
+
}
|
|
169
|
+
],
|
|
170
|
+
xl: [
|
|
171
|
+
"18px",
|
|
172
|
+
{
|
|
173
|
+
lineHeight: "27px",
|
|
174
|
+
fontWeight: "400"
|
|
175
|
+
}
|
|
176
|
+
],
|
|
177
|
+
"2xl": [
|
|
178
|
+
"24px",
|
|
179
|
+
{
|
|
180
|
+
lineHeight: "36px",
|
|
181
|
+
fontWeight: "400"
|
|
182
|
+
}
|
|
183
|
+
]
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
// ../tailwind-config/src/animation/bar.ts
|
|
187
|
+
var barAnimation = {
|
|
188
|
+
"indeterminate-bar": "indeterminate-bar 1.5s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite normal none running"
|
|
189
|
+
};
|
|
190
|
+
var barKeyframe = {
|
|
191
|
+
"indeterminate-bar": {
|
|
192
|
+
"0%": {
|
|
193
|
+
transform: "translateX(-50%) scaleX(0.2)"
|
|
194
|
+
},
|
|
195
|
+
"100%": {
|
|
196
|
+
transform: "translateX(100%) scaleX(1)"
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
// ../tailwind-config/src/animation/slide.ts
|
|
202
|
+
var sliceAnimation = {
|
|
203
|
+
slideInFromTop: "slideInFromTop 0.5s ease-out",
|
|
204
|
+
slideInFromBottom: "slideInFromBottom 0.5s ease-out",
|
|
205
|
+
slideInFromLeft: "slideInFromLeft 0.5s ease-out",
|
|
206
|
+
slideInFromRight: "slideInFromRight 0.5s ease-out",
|
|
207
|
+
slideOutToTop: "slideOutToTop 0.5s ease-in",
|
|
208
|
+
slideOutToBottom: "slideOutToBottom 0.5s ease-in",
|
|
209
|
+
slideOutToLeft: "slideOutToLeft 0.5s ease-in",
|
|
210
|
+
slideOutToRight: "slideOutToRight 0.5s ease-in"
|
|
211
|
+
};
|
|
212
|
+
var sliceKeyframe = {
|
|
213
|
+
slideInFromTop: {
|
|
214
|
+
"0%": {
|
|
215
|
+
transform: "translateY(-10px)",
|
|
216
|
+
opacity: "0"
|
|
217
|
+
},
|
|
218
|
+
"100%": {
|
|
219
|
+
transform: "translateY(0)",
|
|
220
|
+
opacity: "1"
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
slideInFromBottom: {
|
|
224
|
+
"0%": {
|
|
225
|
+
transform: "translateY(10px)",
|
|
226
|
+
opacity: "0"
|
|
227
|
+
},
|
|
228
|
+
"100%": {
|
|
229
|
+
transform: "translateY(0)",
|
|
230
|
+
opacity: "1"
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
slideInFromLeft: {
|
|
234
|
+
"0%": {
|
|
235
|
+
transform: "translateX(-10px)",
|
|
236
|
+
opacity: "0"
|
|
237
|
+
},
|
|
238
|
+
"100%": {
|
|
239
|
+
transform: "translateX(0)",
|
|
240
|
+
opacity: "1"
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
slideInFromRight: {
|
|
244
|
+
"0%": {
|
|
245
|
+
transform: "translateX(10px)",
|
|
246
|
+
opacity: "0"
|
|
247
|
+
},
|
|
248
|
+
"100%": {
|
|
249
|
+
transform: "translateX(0)",
|
|
250
|
+
opacity: "1"
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
slideOutToTop: {
|
|
254
|
+
"0%": {
|
|
255
|
+
transform: "translateY(0)",
|
|
256
|
+
opacity: "1"
|
|
257
|
+
},
|
|
258
|
+
"100%": {
|
|
259
|
+
transform: "translateY(-10px)",
|
|
260
|
+
opacity: "0"
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
slideOutToBottom: {
|
|
264
|
+
"0%": {
|
|
265
|
+
transform: "translateY(0)",
|
|
266
|
+
opacity: "1"
|
|
267
|
+
},
|
|
268
|
+
"100%": {
|
|
269
|
+
transform: "translateY(10px)",
|
|
270
|
+
opacity: "0"
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
slideOutToLeft: {
|
|
274
|
+
"0%": {
|
|
275
|
+
transform: "translateX(0)",
|
|
276
|
+
opacity: "1"
|
|
277
|
+
},
|
|
278
|
+
"100%": {
|
|
279
|
+
transform: "translateX(-10px)",
|
|
280
|
+
opacity: "0"
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
slideOutToRight: {
|
|
284
|
+
"0%": {
|
|
285
|
+
transform: "translateX(0)",
|
|
286
|
+
opacity: "1"
|
|
287
|
+
},
|
|
288
|
+
"100%": {
|
|
289
|
+
transform: "translateX(10px)",
|
|
290
|
+
opacity: "0"
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
// ../tailwind-config/src/animation/index.ts
|
|
296
|
+
var animation = { ...sliceAnimation, ...barAnimation };
|
|
297
|
+
var keyframes = { ...sliceKeyframe, ...barKeyframe };
|
|
298
|
+
|
|
299
|
+
// ../tailwind-config/src/shadow/index.ts
|
|
300
|
+
var boxShadow = {
|
|
301
|
+
"border-1": "inner 0 0 0 1px inset",
|
|
302
|
+
"border-2": "inner 0 0 0 2px inset",
|
|
303
|
+
"border-3": "inner 0 0 0 3px inset",
|
|
304
|
+
"border-4": "inner 0 0 0 4px inset",
|
|
305
|
+
"border-5": "inner 0 0 0 5px inset",
|
|
306
|
+
"border-6": "inner 0 0 0 6px inset",
|
|
307
|
+
"border-7": "inner 0 0 0 7px inset",
|
|
308
|
+
"border-8": "inner 0 0 0 8px inset",
|
|
309
|
+
"border-9": "inner 0 0 0 9px inset",
|
|
310
|
+
"border-10": "inner 0 0 0 10px inset",
|
|
311
|
+
inner: "inset 0 4px 8px 0 rgba(36, 39, 44, 0.2)",
|
|
312
|
+
"inner-sm": "inset 0 4px 8px 0 rgba(0, 0, 0, 0.2)",
|
|
313
|
+
"inner-md": "inset 0 6px 12px 0 rgba(0, 0, 0, 0.2)",
|
|
314
|
+
"inner-lg": "inset 0 8px 16px 0 rgba(0, 0, 0, 0.2)",
|
|
315
|
+
"inner-xl": "inset 0 10px 20px 0 rgba(0, 0, 0, 0.2)",
|
|
316
|
+
drop: "0 20px 40px 0 rgba(36, 39, 44, 0.2)",
|
|
317
|
+
"drop-sm": "0 4px 12px 0 rgba(0, 0, 0, 0.1)",
|
|
318
|
+
"drop-md": "0 6px 18px 0 rgba(0, 0, 0, 0.1)",
|
|
319
|
+
"drop-lg": "0 8px 24px 0 rgba(0, 0, 0, 0.1)",
|
|
320
|
+
"drop-xl": "0 10px 30px 0 rgba(0, 0, 0, 0.1)"
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
// ../tailwind-config/src/border/radius.ts
|
|
324
|
+
var borderRadius = {
|
|
325
|
+
sm: "4px",
|
|
326
|
+
md: "6px",
|
|
327
|
+
lg: "8px",
|
|
328
|
+
xl: "10px",
|
|
329
|
+
none: "0",
|
|
330
|
+
full: "9999px"
|
|
331
|
+
};
|
|
332
|
+
|
|
333
|
+
// ../tailwind-config/src/space/gap.ts
|
|
334
|
+
var gap = {
|
|
335
|
+
sm: "4px",
|
|
336
|
+
md: "6px",
|
|
337
|
+
lg: "8px",
|
|
338
|
+
xl: "10px"
|
|
339
|
+
};
|
|
340
|
+
|
|
341
|
+
// src/utils/tailwind-variants.ts
|
|
342
|
+
function typedKeys(obj) {
|
|
343
|
+
return Object.keys(obj);
|
|
344
|
+
}
|
|
345
|
+
var COMMON_SIZE = ["sm", "md", "lg", "xl"];
|
|
346
|
+
var tv = (0, import_tailwind_variants.createTV)({
|
|
347
|
+
twMergeConfig: {
|
|
348
|
+
classGroups: {
|
|
349
|
+
fontSize: [{ text: [...typedKeys(fontSize)] }],
|
|
350
|
+
borderRadius: [{ rounded: [...typedKeys(borderRadius)] }],
|
|
351
|
+
boxShadow: [{ shadow: [...typedKeys(boxShadow)] }],
|
|
352
|
+
padding: [{ p: [...COMMON_SIZE] }],
|
|
353
|
+
gap: [{ gap: [...typedKeys(gap)] }]
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
});
|
|
357
|
+
|
|
358
|
+
// src/utils/props.ts
|
|
359
|
+
var mapPropsVariants = (props, variantKeys, removeVariantProps = true) => {
|
|
360
|
+
if (!variantKeys) {
|
|
361
|
+
return [props, {}];
|
|
362
|
+
}
|
|
363
|
+
const picked = variantKeys.reduce((acc, key) => {
|
|
364
|
+
if (key in props) {
|
|
365
|
+
return { ...acc, [key]: props[key] };
|
|
366
|
+
} else {
|
|
367
|
+
return acc;
|
|
368
|
+
}
|
|
369
|
+
}, {});
|
|
370
|
+
if (removeVariantProps) {
|
|
371
|
+
const omitted = Object.keys(props).filter((key) => !variantKeys.includes(key)).reduce((acc, key) => ({ ...acc, [key]: props[key] }), {});
|
|
372
|
+
return [omitted, picked];
|
|
373
|
+
} else {
|
|
374
|
+
return [props, picked];
|
|
375
|
+
}
|
|
376
|
+
};
|
|
377
|
+
|
|
378
|
+
// src/components/charts/simpleBarChart.tsx
|
|
379
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
380
|
+
var SimpleBarChartComponent = (0, import_react.forwardRef)((originalProps, ref) => {
|
|
381
|
+
const [props, variantProps] = mapPropsVariants(originalProps, simpleBarChartStyle.variantKeys);
|
|
382
|
+
const {
|
|
383
|
+
data = [],
|
|
384
|
+
label,
|
|
385
|
+
classNames,
|
|
386
|
+
yAxisTicks = [0, 20, 40, 60, 80, 100],
|
|
387
|
+
yAxisDomain = [0, 100],
|
|
388
|
+
barGap = 20,
|
|
389
|
+
tooltipFormatter
|
|
390
|
+
} = { ...props, ...variantProps };
|
|
391
|
+
const slots = (0, import_react.useMemo)(() => simpleBarChartStyle({ ...variantProps }), [variantProps]);
|
|
392
|
+
const chartRef = (0, import_react.useRef)(null);
|
|
393
|
+
const tooltipRef = (0, import_react.useRef)(null);
|
|
394
|
+
const [tooltipLeft, setTooltipLeft] = (0, import_react.useState)(0);
|
|
395
|
+
const [tickPositions, setTickPositions] = (0, import_react.useState)([]);
|
|
396
|
+
const tickRef = (0, import_react.useRef)([]);
|
|
397
|
+
const [tooltipState, setTooltipState] = (0, import_react.useState)(null);
|
|
398
|
+
const handleMouseEnter = (e) => {
|
|
399
|
+
if (!tooltipFormatter || !chartRef.current) return;
|
|
400
|
+
const { payload, x, y } = e;
|
|
401
|
+
if (!payload) return;
|
|
402
|
+
setTooltipState({
|
|
403
|
+
x,
|
|
404
|
+
y,
|
|
405
|
+
value: payload.value,
|
|
406
|
+
label: payload.title
|
|
407
|
+
});
|
|
408
|
+
};
|
|
409
|
+
const handleMouseLeave = () => {
|
|
410
|
+
setTooltipState(null);
|
|
411
|
+
};
|
|
412
|
+
const CustomBarShape = ({ x, y, width, height, fill }) => {
|
|
413
|
+
const radius = 4;
|
|
414
|
+
const extraHeight = 10;
|
|
415
|
+
const adjustedHeight = height + extraHeight;
|
|
416
|
+
const adjustedY = y - extraHeight;
|
|
417
|
+
const bottomY = adjustedY + adjustedHeight;
|
|
418
|
+
return height > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
419
|
+
"path",
|
|
420
|
+
{
|
|
421
|
+
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`,
|
|
422
|
+
fill
|
|
423
|
+
}
|
|
424
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x, y, width, height: 0, fill });
|
|
425
|
+
};
|
|
426
|
+
const CustomTick = ({ x, y, payload }) => {
|
|
427
|
+
if (x !== void 0) tickRef.current.push(x);
|
|
428
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
429
|
+
"text",
|
|
430
|
+
{
|
|
431
|
+
x,
|
|
432
|
+
y: y + 14,
|
|
433
|
+
textAnchor: "middle",
|
|
434
|
+
fontSize: 12,
|
|
435
|
+
fontWeight: 700,
|
|
436
|
+
fill: "currentColor",
|
|
437
|
+
className: "text-body-foreground",
|
|
438
|
+
children: payload.value
|
|
439
|
+
}
|
|
440
|
+
);
|
|
441
|
+
};
|
|
442
|
+
(0, import_react.useEffect)(() => {
|
|
443
|
+
const raf = requestAnimationFrame(() => {
|
|
444
|
+
const unique = [...new Set(tickRef.current)].sort((a, b) => a - b);
|
|
445
|
+
const mids = [];
|
|
446
|
+
for (let i = 0; i < unique.length - 1; i++) {
|
|
447
|
+
mids.push((unique[i] + unique[i + 1]) / 2);
|
|
448
|
+
}
|
|
449
|
+
setTickPositions(mids);
|
|
450
|
+
tickRef.current = [];
|
|
451
|
+
});
|
|
452
|
+
return () => cancelAnimationFrame(raf);
|
|
453
|
+
}, [data]);
|
|
454
|
+
(0, import_react.useLayoutEffect)(() => {
|
|
455
|
+
if (!tooltipState || !chartRef.current || !tooltipRef.current) return;
|
|
456
|
+
const chartRect = chartRef.current.getBoundingClientRect();
|
|
457
|
+
const tooltipRect = tooltipRef.current.getBoundingClientRect();
|
|
458
|
+
const chartWidth = chartRect.width;
|
|
459
|
+
const tooltipWidth = tooltipRect.width;
|
|
460
|
+
let left = tooltipState.x - tooltipWidth / 2;
|
|
461
|
+
const padding2 = 8;
|
|
462
|
+
if (left < padding2) {
|
|
463
|
+
left = padding2;
|
|
464
|
+
} else if (left + tooltipWidth > chartWidth - padding2) {
|
|
465
|
+
left = chartWidth - tooltipWidth - padding2;
|
|
466
|
+
}
|
|
467
|
+
setTooltipLeft(left);
|
|
468
|
+
}, [tooltipState]);
|
|
469
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { ref: chartRef, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), onMouseLeave: handleMouseLeave, children: [
|
|
470
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label }),
|
|
471
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_recharts.ResponsiveContainer, { width: "100%", height: 140, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
472
|
+
import_recharts.BarChart,
|
|
473
|
+
{
|
|
474
|
+
data,
|
|
475
|
+
margin: { left: 0, right: 0, top: 0, bottom: 0 },
|
|
476
|
+
barSize: 10,
|
|
477
|
+
barGap,
|
|
478
|
+
className: "[&_.recharts-surface]:outline-none [&_.recharts-surface]:focus:outline-none",
|
|
479
|
+
children: [
|
|
480
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
481
|
+
import_recharts.CartesianGrid,
|
|
482
|
+
{
|
|
483
|
+
vertical: true,
|
|
484
|
+
horizontal: false,
|
|
485
|
+
strokeDasharray: "4 4",
|
|
486
|
+
className: "stroke-neutral-light",
|
|
487
|
+
verticalPoints: tickPositions
|
|
488
|
+
}
|
|
489
|
+
),
|
|
490
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
491
|
+
import_recharts.CartesianGrid,
|
|
492
|
+
{
|
|
493
|
+
vertical: true,
|
|
494
|
+
horizontal: false,
|
|
495
|
+
strokeDasharray: "0",
|
|
496
|
+
strokeWidth: 2,
|
|
497
|
+
className: "stroke-neutral-light",
|
|
498
|
+
verticalPoints: [0]
|
|
499
|
+
}
|
|
500
|
+
),
|
|
501
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
502
|
+
import_recharts.XAxis,
|
|
503
|
+
{
|
|
504
|
+
dataKey: "title",
|
|
505
|
+
axisLine: { stroke: "#DFE2E7", strokeWidth: 1 },
|
|
506
|
+
tickLine: false,
|
|
507
|
+
tick: CustomTick,
|
|
508
|
+
padding: { left: 0, right: 0 }
|
|
509
|
+
}
|
|
510
|
+
),
|
|
511
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_recharts.YAxis, { hide: true, ticks: yAxisTicks, domain: yAxisDomain }),
|
|
512
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
513
|
+
import_recharts.Bar,
|
|
514
|
+
{
|
|
515
|
+
dataKey: "value",
|
|
516
|
+
fill: "#C7E5FA",
|
|
517
|
+
shape: CustomBarShape,
|
|
518
|
+
onMouseEnter: handleMouseEnter,
|
|
519
|
+
onMouseLeave: handleMouseLeave
|
|
520
|
+
}
|
|
521
|
+
)
|
|
522
|
+
]
|
|
523
|
+
}
|
|
524
|
+
) }),
|
|
525
|
+
tooltipFormatter && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
526
|
+
"div",
|
|
527
|
+
{
|
|
528
|
+
ref: tooltipRef,
|
|
529
|
+
style: {
|
|
530
|
+
position: "absolute",
|
|
531
|
+
left: tooltipLeft + 5,
|
|
532
|
+
top: (tooltipState == null ? void 0 : tooltipState.y) ? tooltipState.y - 20 : 0,
|
|
533
|
+
pointerEvents: "none",
|
|
534
|
+
zIndex: 10,
|
|
535
|
+
opacity: tooltipState ? 1 : 0,
|
|
536
|
+
transition: "opacity 0.1s ease-out",
|
|
537
|
+
visibility: tooltipState ? "visible" : "hidden",
|
|
538
|
+
width: "fit-content",
|
|
539
|
+
whiteSpace: "nowrap"
|
|
540
|
+
},
|
|
541
|
+
children: tooltipState && tooltipFormatter(tooltipState)
|
|
542
|
+
}
|
|
543
|
+
)
|
|
544
|
+
] });
|
|
545
|
+
});
|
|
546
|
+
SimpleBarChartComponent.displayName = "simpleBarChart";
|
|
547
|
+
var simpleBarChart_default = SimpleBarChartComponent;
|
|
548
|
+
var simpleBarChartStyle = tv({
|
|
549
|
+
slots: {
|
|
550
|
+
base: ["flex", "flex-col", "gap-[10px]", "select-none", "relative", "w-full"],
|
|
551
|
+
label: ["text-md", "font-bold", "text-common-black"]
|
|
552
|
+
},
|
|
553
|
+
variants: {},
|
|
554
|
+
defaultVariants: {}
|
|
555
|
+
});
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import {
|
|
3
3
|
datePickerStyle,
|
|
4
4
|
datePicker_default
|
|
5
|
-
} from "../../chunk-
|
|
6
|
-
import "../../chunk-XZYQFBCT.mjs";
|
|
5
|
+
} from "../../chunk-W66K4FK5.mjs";
|
|
7
6
|
import "../../chunk-FWFEKWWD.mjs";
|
|
7
|
+
import "../../chunk-XZYQFBCT.mjs";
|
|
8
8
|
import "../../chunk-2GCSFWHD.mjs";
|
|
9
9
|
import "../../chunk-VNRGOOSY.mjs";
|
|
10
10
|
import "../../chunk-MY5U63QO.mjs";
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import "../../chunk-4VWG4726.mjs";
|
|
3
3
|
import {
|
|
4
4
|
datePicker_default
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-W66K4FK5.mjs";
|
|
6
|
+
import "../../chunk-FWFEKWWD.mjs";
|
|
6
7
|
import {
|
|
7
8
|
day_default
|
|
8
9
|
} from "../../chunk-XZYQFBCT.mjs";
|
|
@@ -11,7 +12,6 @@ import {
|
|
|
11
12
|
} from "../../chunk-BM3MR3JR.mjs";
|
|
12
13
|
import "../../chunk-QCEKPS7U.mjs";
|
|
13
14
|
import "../../chunk-5G6CCE55.mjs";
|
|
14
|
-
import "../../chunk-FWFEKWWD.mjs";
|
|
15
15
|
import "../../chunk-2GCSFWHD.mjs";
|
|
16
16
|
import "../../chunk-VNRGOOSY.mjs";
|
|
17
17
|
import "../../chunk-MY5U63QO.mjs";
|
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
import "../../chunk-7B7LRG5J.mjs";
|
|
10
10
|
import "../../chunk-WLTBJF4I.mjs";
|
|
11
11
|
import "../../chunk-F3HENRVM.mjs";
|
|
12
|
+
import "../../chunk-QZ3LVYJW.mjs";
|
|
12
13
|
import "../../chunk-2GCSFWHD.mjs";
|
|
13
14
|
import "../../chunk-VNRGOOSY.mjs";
|
|
14
15
|
import "../../chunk-DQRAFUDA.mjs";
|
|
15
16
|
import "../../chunk-EWS3FESG.mjs";
|
|
16
|
-
import "../../chunk-QZ3LVYJW.mjs";
|
|
17
17
|
import "../../chunk-OEIEALIP.mjs";
|
|
18
18
|
import "../../chunk-ZYIIXWVY.mjs";
|
|
19
19
|
import "../../chunk-R7KUEH3N.mjs";
|
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
import "../../chunk-7B7LRG5J.mjs";
|
|
6
6
|
import "../../chunk-WLTBJF4I.mjs";
|
|
7
7
|
import "../../chunk-F3HENRVM.mjs";
|
|
8
|
+
import "../../chunk-QZ3LVYJW.mjs";
|
|
8
9
|
import "../../chunk-2GCSFWHD.mjs";
|
|
9
10
|
import "../../chunk-VNRGOOSY.mjs";
|
|
10
11
|
import "../../chunk-DQRAFUDA.mjs";
|
|
11
12
|
import "../../chunk-EWS3FESG.mjs";
|
|
12
|
-
import "../../chunk-QZ3LVYJW.mjs";
|
|
13
13
|
import "../../chunk-OEIEALIP.mjs";
|
|
14
14
|
import "../../chunk-ZYIIXWVY.mjs";
|
|
15
15
|
import "../../chunk-R7KUEH3N.mjs";
|
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
import "../../chunk-7B7LRG5J.mjs";
|
|
6
6
|
import "../../chunk-WLTBJF4I.mjs";
|
|
7
7
|
import "../../chunk-F3HENRVM.mjs";
|
|
8
|
+
import "../../chunk-QZ3LVYJW.mjs";
|
|
8
9
|
import "../../chunk-2GCSFWHD.mjs";
|
|
9
10
|
import "../../chunk-VNRGOOSY.mjs";
|
|
10
11
|
import "../../chunk-DQRAFUDA.mjs";
|
|
11
12
|
import "../../chunk-EWS3FESG.mjs";
|
|
12
|
-
import "../../chunk-QZ3LVYJW.mjs";
|
|
13
13
|
import "../../chunk-OEIEALIP.mjs";
|
|
14
14
|
import "../../chunk-ZYIIXWVY.mjs";
|
|
15
15
|
import "../../chunk-R7KUEH3N.mjs";
|
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
import "../../chunk-7B7LRG5J.mjs";
|
|
7
7
|
import "../../chunk-WLTBJF4I.mjs";
|
|
8
8
|
import "../../chunk-F3HENRVM.mjs";
|
|
9
|
+
import "../../chunk-QZ3LVYJW.mjs";
|
|
9
10
|
import "../../chunk-2GCSFWHD.mjs";
|
|
10
11
|
import "../../chunk-VNRGOOSY.mjs";
|
|
11
12
|
import "../../chunk-DQRAFUDA.mjs";
|
|
12
13
|
import "../../chunk-EWS3FESG.mjs";
|
|
13
|
-
import "../../chunk-QZ3LVYJW.mjs";
|
|
14
14
|
import "../../chunk-OEIEALIP.mjs";
|
|
15
15
|
import "../../chunk-ZYIIXWVY.mjs";
|
|
16
16
|
import "../../chunk-R7KUEH3N.mjs";
|