@deepnoid/ui 0.1.161 → 0.1.163
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 +155 -155
- package/dist/{chunk-V25UBATO.mjs → chunk-BRVQTI2T.mjs} +10 -7
- package/dist/{chunk-553TGKS6.mjs → chunk-WA7CSZQ3.mjs} +38 -8
- package/dist/components/charts/barChart.js +10 -7
- package/dist/components/charts/barChart.mjs +1 -1
- package/dist/components/charts/circularProgress.d.mts +6 -8
- package/dist/components/charts/circularProgress.d.ts +6 -8
- package/dist/components/charts/circularProgress.js +37 -7
- package/dist/components/charts/circularProgress.mjs +1 -1
- package/dist/components/charts/index.js +47 -14
- package/dist/components/charts/index.mjs +2 -2
- package/dist/index.js +48 -15
- package/dist/index.mjs +16 -16
- package/package.json +1 -1
|
@@ -106,13 +106,14 @@ var BarChartComponent = forwardRef((originalProps, ref) => {
|
|
|
106
106
|
const tooltipRect = tooltipRef.current.getBoundingClientRect();
|
|
107
107
|
const chartWidth = chartRect.width;
|
|
108
108
|
const tooltipWidth = tooltipRect.width;
|
|
109
|
-
let
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
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;
|
|
114
115
|
}
|
|
115
|
-
setTooltipLeft(
|
|
116
|
+
setTooltipLeft(left);
|
|
116
117
|
}, [tooltipState]);
|
|
117
118
|
return /* @__PURE__ */ jsxs("div", { ref: chartRef, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), onMouseLeave: handleMouseLeave, children: [
|
|
118
119
|
label && /* @__PURE__ */ jsx("p", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label }),
|
|
@@ -214,7 +215,9 @@ var BarChartComponent = forwardRef((originalProps, ref) => {
|
|
|
214
215
|
zIndex: 10,
|
|
215
216
|
opacity: tooltipState ? 1 : 0,
|
|
216
217
|
transition: "opacity 0.1s ease-out",
|
|
217
|
-
visibility: tooltipState ? "visible" : "hidden"
|
|
218
|
+
visibility: tooltipState ? "visible" : "hidden",
|
|
219
|
+
width: "fit-content",
|
|
220
|
+
whiteSpace: "nowrap"
|
|
218
221
|
},
|
|
219
222
|
children: tooltipState && tooltipFormatter(tooltipState)
|
|
220
223
|
}
|
|
@@ -8,11 +8,11 @@ import {
|
|
|
8
8
|
|
|
9
9
|
// src/components/charts/circularProgress.tsx
|
|
10
10
|
import { RadialBarChart, RadialBar, PolarAngleAxis } from "recharts";
|
|
11
|
-
import { forwardRef, useMemo } from "react";
|
|
11
|
+
import { cloneElement, forwardRef, isValidElement, useMemo } from "react";
|
|
12
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
var CircularProgress = forwardRef((originalProps, ref) => {
|
|
14
14
|
const [props, variantProps] = mapPropsVariants(originalProps, circularProgressStyle.variantKeys);
|
|
15
|
-
const { label, size = 150, percentage,
|
|
15
|
+
const { label, size = 150, percentage, innerContent, classNames } = { ...props, ...variantProps };
|
|
16
16
|
const slots = useMemo(() => circularProgressStyle({ ...variantProps }), [variantProps]);
|
|
17
17
|
const data = [
|
|
18
18
|
{
|
|
@@ -45,6 +45,9 @@ var CircularProgress = forwardRef((originalProps, ref) => {
|
|
|
45
45
|
const colorValue = originalProps.color;
|
|
46
46
|
const colorKey = colorValue || "blue";
|
|
47
47
|
const currentGradient = gradientColors[colorKey];
|
|
48
|
+
const wrappedInnerContent = useMemo(() => {
|
|
49
|
+
return wrapSpanWithClass(innerContent);
|
|
50
|
+
}, [innerContent]);
|
|
48
51
|
return /* @__PURE__ */ jsxs("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
49
52
|
/* @__PURE__ */ jsxs("div", { className: "relative", style: { width: size, height: size }, children: [
|
|
50
53
|
/* @__PURE__ */ jsxs(
|
|
@@ -90,10 +93,7 @@ var CircularProgress = forwardRef((originalProps, ref) => {
|
|
|
90
93
|
]
|
|
91
94
|
}
|
|
92
95
|
),
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
/* @__PURE__ */ jsx("span", { className: slots.percentage({ class: classNames == null ? void 0 : classNames.percentage }), children: percentage }),
|
|
95
|
-
/* @__PURE__ */ jsx("span", { className: slots.unit({ class: classNames == null ? void 0 : classNames.unit }), children: unit })
|
|
96
|
-
] })
|
|
96
|
+
innerContent && /* @__PURE__ */ jsx("div", { className: slots.inner({ class: classNames == null ? void 0 : classNames.inner }), children: wrappedInnerContent })
|
|
97
97
|
] }),
|
|
98
98
|
label && /* @__PURE__ */ jsx("p", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label })
|
|
99
99
|
] });
|
|
@@ -105,8 +105,16 @@ var circularProgressStyle = tv({
|
|
|
105
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
|
-
|
|
109
|
-
|
|
108
|
+
inner: [
|
|
109
|
+
"absolute",
|
|
110
|
+
"inset-0",
|
|
111
|
+
"flex",
|
|
112
|
+
"items-center",
|
|
113
|
+
"justify-center",
|
|
114
|
+
"font-bold",
|
|
115
|
+
"text-body-foreground",
|
|
116
|
+
"text-md"
|
|
117
|
+
],
|
|
110
118
|
label: ["text-md", "font-bold", "text-left", "text-body-foreground"]
|
|
111
119
|
},
|
|
112
120
|
variants: {
|
|
@@ -126,6 +134,28 @@ var circularProgressStyle = tv({
|
|
|
126
134
|
color: "blue"
|
|
127
135
|
}
|
|
128
136
|
});
|
|
137
|
+
function wrapSpanWithClass(node) {
|
|
138
|
+
var _a;
|
|
139
|
+
if (Array.isArray(node)) {
|
|
140
|
+
return node.map(wrapSpanWithClass);
|
|
141
|
+
}
|
|
142
|
+
if (isValidElement(node)) {
|
|
143
|
+
const element = node;
|
|
144
|
+
if (element.type === "span") {
|
|
145
|
+
const existing = (_a = element.props.className) != null ? _a : "";
|
|
146
|
+
return cloneElement(element, {
|
|
147
|
+
className: `text-xl font-bold ${existing}`.trim()
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
if (element.props.children) {
|
|
151
|
+
return cloneElement(element, {
|
|
152
|
+
children: wrapSpanWithClass(element.props.children)
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
return element;
|
|
156
|
+
}
|
|
157
|
+
return node;
|
|
158
|
+
}
|
|
129
159
|
|
|
130
160
|
export {
|
|
131
161
|
circularProgress_default
|
|
@@ -474,13 +474,14 @@ var BarChartComponent = (0, import_react.forwardRef)((originalProps, ref) => {
|
|
|
474
474
|
const tooltipRect = tooltipRef.current.getBoundingClientRect();
|
|
475
475
|
const chartWidth = chartRect.width;
|
|
476
476
|
const tooltipWidth = tooltipRect.width;
|
|
477
|
-
let
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
477
|
+
let left = tooltipState.x - tooltipWidth / 2;
|
|
478
|
+
const padding2 = 8;
|
|
479
|
+
if (left < padding2) {
|
|
480
|
+
left = padding2;
|
|
481
|
+
} else if (left + tooltipWidth > chartWidth - padding2) {
|
|
482
|
+
left = chartWidth - tooltipWidth - padding2;
|
|
482
483
|
}
|
|
483
|
-
setTooltipLeft(
|
|
484
|
+
setTooltipLeft(left);
|
|
484
485
|
}, [tooltipState]);
|
|
485
486
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { ref: chartRef, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), onMouseLeave: handleMouseLeave, children: [
|
|
486
487
|
label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label }),
|
|
@@ -582,7 +583,9 @@ var BarChartComponent = (0, import_react.forwardRef)((originalProps, ref) => {
|
|
|
582
583
|
zIndex: 10,
|
|
583
584
|
opacity: tooltipState ? 1 : 0,
|
|
584
585
|
transition: "opacity 0.1s ease-out",
|
|
585
|
-
visibility: tooltipState ? "visible" : "hidden"
|
|
586
|
+
visibility: tooltipState ? "visible" : "hidden",
|
|
587
|
+
width: "fit-content",
|
|
588
|
+
whiteSpace: "nowrap"
|
|
586
589
|
},
|
|
587
590
|
children: tooltipState && tooltipFormatter(tooltipState)
|
|
588
591
|
}
|
|
@@ -1,13 +1,14 @@
|
|
|
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 Props = {
|
|
7
|
-
percentage: number;
|
|
8
|
-
unit?: string;
|
|
9
8
|
label?: string;
|
|
10
9
|
size?: number;
|
|
10
|
+
percentage: number;
|
|
11
|
+
innerContent?: ReactNode;
|
|
11
12
|
classNames?: SlotsToClasses<CircularProgressSlots>;
|
|
12
13
|
};
|
|
13
14
|
type CircularProgressProps = Props & CircularProgressVariantProps;
|
|
@@ -29,8 +30,7 @@ declare const circularProgressStyle: tailwind_variants.TVReturnType<{
|
|
|
29
30
|
base: string[];
|
|
30
31
|
background: string[];
|
|
31
32
|
progress: string[];
|
|
32
|
-
|
|
33
|
-
unit: string[];
|
|
33
|
+
inner: string[];
|
|
34
34
|
label: string[];
|
|
35
35
|
}, undefined, {
|
|
36
36
|
color: {
|
|
@@ -48,8 +48,7 @@ declare const circularProgressStyle: tailwind_variants.TVReturnType<{
|
|
|
48
48
|
base: string[];
|
|
49
49
|
background: string[];
|
|
50
50
|
progress: string[];
|
|
51
|
-
|
|
52
|
-
unit: string[];
|
|
51
|
+
inner: string[];
|
|
53
52
|
label: string[];
|
|
54
53
|
}, tailwind_variants.TVReturnType<{
|
|
55
54
|
color: {
|
|
@@ -67,8 +66,7 @@ declare const circularProgressStyle: tailwind_variants.TVReturnType<{
|
|
|
67
66
|
base: string[];
|
|
68
67
|
background: string[];
|
|
69
68
|
progress: string[];
|
|
70
|
-
|
|
71
|
-
unit: string[];
|
|
69
|
+
inner: string[];
|
|
72
70
|
label: string[];
|
|
73
71
|
}, undefined, unknown, unknown, undefined>>;
|
|
74
72
|
type CircularProgressVariantProps = VariantProps<typeof circularProgressStyle>;
|
|
@@ -1,13 +1,14 @@
|
|
|
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 Props = {
|
|
7
|
-
percentage: number;
|
|
8
|
-
unit?: string;
|
|
9
8
|
label?: string;
|
|
10
9
|
size?: number;
|
|
10
|
+
percentage: number;
|
|
11
|
+
innerContent?: ReactNode;
|
|
11
12
|
classNames?: SlotsToClasses<CircularProgressSlots>;
|
|
12
13
|
};
|
|
13
14
|
type CircularProgressProps = Props & CircularProgressVariantProps;
|
|
@@ -29,8 +30,7 @@ declare const circularProgressStyle: tailwind_variants.TVReturnType<{
|
|
|
29
30
|
base: string[];
|
|
30
31
|
background: string[];
|
|
31
32
|
progress: string[];
|
|
32
|
-
|
|
33
|
-
unit: string[];
|
|
33
|
+
inner: string[];
|
|
34
34
|
label: string[];
|
|
35
35
|
}, undefined, {
|
|
36
36
|
color: {
|
|
@@ -48,8 +48,7 @@ declare const circularProgressStyle: tailwind_variants.TVReturnType<{
|
|
|
48
48
|
base: string[];
|
|
49
49
|
background: string[];
|
|
50
50
|
progress: string[];
|
|
51
|
-
|
|
52
|
-
unit: string[];
|
|
51
|
+
inner: string[];
|
|
53
52
|
label: string[];
|
|
54
53
|
}, tailwind_variants.TVReturnType<{
|
|
55
54
|
color: {
|
|
@@ -67,8 +66,7 @@ declare const circularProgressStyle: tailwind_variants.TVReturnType<{
|
|
|
67
66
|
base: string[];
|
|
68
67
|
background: string[];
|
|
69
68
|
progress: string[];
|
|
70
|
-
|
|
71
|
-
unit: string[];
|
|
69
|
+
inner: string[];
|
|
72
70
|
label: string[];
|
|
73
71
|
}, undefined, unknown, unknown, undefined>>;
|
|
74
72
|
type CircularProgressVariantProps = VariantProps<typeof circularProgressStyle>;
|
|
@@ -379,7 +379,7 @@ var tv = (0, import_tailwind_variants.createTV)({
|
|
|
379
379
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
380
380
|
var CircularProgress = (0, import_react.forwardRef)((originalProps, ref) => {
|
|
381
381
|
const [props, variantProps] = mapPropsVariants(originalProps, circularProgressStyle.variantKeys);
|
|
382
|
-
const { label, size = 150, percentage,
|
|
382
|
+
const { label, size = 150, percentage, innerContent, classNames } = { ...props, ...variantProps };
|
|
383
383
|
const slots = (0, import_react.useMemo)(() => circularProgressStyle({ ...variantProps }), [variantProps]);
|
|
384
384
|
const data = [
|
|
385
385
|
{
|
|
@@ -412,6 +412,9 @@ var CircularProgress = (0, import_react.forwardRef)((originalProps, ref) => {
|
|
|
412
412
|
const colorValue = originalProps.color;
|
|
413
413
|
const colorKey = colorValue || "blue";
|
|
414
414
|
const currentGradient = gradientColors[colorKey];
|
|
415
|
+
const wrappedInnerContent = (0, import_react.useMemo)(() => {
|
|
416
|
+
return wrapSpanWithClass(innerContent);
|
|
417
|
+
}, [innerContent]);
|
|
415
418
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
416
419
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative", style: { width: size, height: size }, children: [
|
|
417
420
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
@@ -457,10 +460,7 @@ var CircularProgress = (0, import_react.forwardRef)((originalProps, ref) => {
|
|
|
457
460
|
]
|
|
458
461
|
}
|
|
459
462
|
),
|
|
460
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
461
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: slots.percentage({ class: classNames == null ? void 0 : classNames.percentage }), children: percentage }),
|
|
462
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: slots.unit({ class: classNames == null ? void 0 : classNames.unit }), children: unit })
|
|
463
|
-
] })
|
|
463
|
+
innerContent && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: slots.inner({ class: classNames == null ? void 0 : classNames.inner }), children: wrappedInnerContent })
|
|
464
464
|
] }),
|
|
465
465
|
label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label })
|
|
466
466
|
] });
|
|
@@ -472,8 +472,16 @@ var circularProgressStyle = tv({
|
|
|
472
472
|
base: ["flex", "flex-col", "items-center", "gap-[20px]", "select-none"],
|
|
473
473
|
background: ["fill-body-background", "border-neutral-light"],
|
|
474
474
|
progress: ["transition-all", "duration-1000 ease-out"],
|
|
475
|
-
|
|
476
|
-
|
|
475
|
+
inner: [
|
|
476
|
+
"absolute",
|
|
477
|
+
"inset-0",
|
|
478
|
+
"flex",
|
|
479
|
+
"items-center",
|
|
480
|
+
"justify-center",
|
|
481
|
+
"font-bold",
|
|
482
|
+
"text-body-foreground",
|
|
483
|
+
"text-md"
|
|
484
|
+
],
|
|
477
485
|
label: ["text-md", "font-bold", "text-left", "text-body-foreground"]
|
|
478
486
|
},
|
|
479
487
|
variants: {
|
|
@@ -493,3 +501,25 @@ var circularProgressStyle = tv({
|
|
|
493
501
|
color: "blue"
|
|
494
502
|
}
|
|
495
503
|
});
|
|
504
|
+
function wrapSpanWithClass(node) {
|
|
505
|
+
var _a;
|
|
506
|
+
if (Array.isArray(node)) {
|
|
507
|
+
return node.map(wrapSpanWithClass);
|
|
508
|
+
}
|
|
509
|
+
if ((0, import_react.isValidElement)(node)) {
|
|
510
|
+
const element = node;
|
|
511
|
+
if (element.type === "span") {
|
|
512
|
+
const existing = (_a = element.props.className) != null ? _a : "";
|
|
513
|
+
return (0, import_react.cloneElement)(element, {
|
|
514
|
+
className: `text-xl font-bold ${existing}`.trim()
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
if (element.props.children) {
|
|
518
|
+
return (0, import_react.cloneElement)(element, {
|
|
519
|
+
children: wrapSpanWithClass(element.props.children)
|
|
520
|
+
});
|
|
521
|
+
}
|
|
522
|
+
return element;
|
|
523
|
+
}
|
|
524
|
+
return node;
|
|
525
|
+
}
|
|
@@ -385,7 +385,7 @@ var tv = (0, import_tailwind_variants.createTV)({
|
|
|
385
385
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
386
386
|
var CircularProgress = (0, import_react.forwardRef)((originalProps, ref) => {
|
|
387
387
|
const [props, variantProps] = mapPropsVariants(originalProps, circularProgressStyle.variantKeys);
|
|
388
|
-
const { label, size = 150, percentage,
|
|
388
|
+
const { label, size = 150, percentage, innerContent, classNames } = { ...props, ...variantProps };
|
|
389
389
|
const slots = (0, import_react.useMemo)(() => circularProgressStyle({ ...variantProps }), [variantProps]);
|
|
390
390
|
const data = [
|
|
391
391
|
{
|
|
@@ -418,6 +418,9 @@ var CircularProgress = (0, import_react.forwardRef)((originalProps, ref) => {
|
|
|
418
418
|
const colorValue = originalProps.color;
|
|
419
419
|
const colorKey = colorValue || "blue";
|
|
420
420
|
const currentGradient = gradientColors[colorKey];
|
|
421
|
+
const wrappedInnerContent = (0, import_react.useMemo)(() => {
|
|
422
|
+
return wrapSpanWithClass(innerContent);
|
|
423
|
+
}, [innerContent]);
|
|
421
424
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
422
425
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative", style: { width: size, height: size }, children: [
|
|
423
426
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
@@ -463,10 +466,7 @@ var CircularProgress = (0, import_react.forwardRef)((originalProps, ref) => {
|
|
|
463
466
|
]
|
|
464
467
|
}
|
|
465
468
|
),
|
|
466
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
467
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: slots.percentage({ class: classNames == null ? void 0 : classNames.percentage }), children: percentage }),
|
|
468
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: slots.unit({ class: classNames == null ? void 0 : classNames.unit }), children: unit })
|
|
469
|
-
] })
|
|
469
|
+
innerContent && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: slots.inner({ class: classNames == null ? void 0 : classNames.inner }), children: wrappedInnerContent })
|
|
470
470
|
] }),
|
|
471
471
|
label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label })
|
|
472
472
|
] });
|
|
@@ -478,8 +478,16 @@ var circularProgressStyle = tv({
|
|
|
478
478
|
base: ["flex", "flex-col", "items-center", "gap-[20px]", "select-none"],
|
|
479
479
|
background: ["fill-body-background", "border-neutral-light"],
|
|
480
480
|
progress: ["transition-all", "duration-1000 ease-out"],
|
|
481
|
-
|
|
482
|
-
|
|
481
|
+
inner: [
|
|
482
|
+
"absolute",
|
|
483
|
+
"inset-0",
|
|
484
|
+
"flex",
|
|
485
|
+
"items-center",
|
|
486
|
+
"justify-center",
|
|
487
|
+
"font-bold",
|
|
488
|
+
"text-body-foreground",
|
|
489
|
+
"text-md"
|
|
490
|
+
],
|
|
483
491
|
label: ["text-md", "font-bold", "text-left", "text-body-foreground"]
|
|
484
492
|
},
|
|
485
493
|
variants: {
|
|
@@ -499,6 +507,28 @@ var circularProgressStyle = tv({
|
|
|
499
507
|
color: "blue"
|
|
500
508
|
}
|
|
501
509
|
});
|
|
510
|
+
function wrapSpanWithClass(node) {
|
|
511
|
+
var _a;
|
|
512
|
+
if (Array.isArray(node)) {
|
|
513
|
+
return node.map(wrapSpanWithClass);
|
|
514
|
+
}
|
|
515
|
+
if ((0, import_react.isValidElement)(node)) {
|
|
516
|
+
const element = node;
|
|
517
|
+
if (element.type === "span") {
|
|
518
|
+
const existing = (_a = element.props.className) != null ? _a : "";
|
|
519
|
+
return (0, import_react.cloneElement)(element, {
|
|
520
|
+
className: `text-xl font-bold ${existing}`.trim()
|
|
521
|
+
});
|
|
522
|
+
}
|
|
523
|
+
if (element.props.children) {
|
|
524
|
+
return (0, import_react.cloneElement)(element, {
|
|
525
|
+
children: wrapSpanWithClass(element.props.children)
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
return element;
|
|
529
|
+
}
|
|
530
|
+
return node;
|
|
531
|
+
}
|
|
502
532
|
|
|
503
533
|
// src/components/charts/areaChart.tsx
|
|
504
534
|
var import_react2 = require("react");
|
|
@@ -863,13 +893,14 @@ var BarChartComponent = (0, import_react3.forwardRef)((originalProps, ref) => {
|
|
|
863
893
|
const tooltipRect = tooltipRef.current.getBoundingClientRect();
|
|
864
894
|
const chartWidth = chartRect.width;
|
|
865
895
|
const tooltipWidth = tooltipRect.width;
|
|
866
|
-
let
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
896
|
+
let left = tooltipState.x - tooltipWidth / 2;
|
|
897
|
+
const padding2 = 8;
|
|
898
|
+
if (left < padding2) {
|
|
899
|
+
left = padding2;
|
|
900
|
+
} else if (left + tooltipWidth > chartWidth - padding2) {
|
|
901
|
+
left = chartWidth - tooltipWidth - padding2;
|
|
871
902
|
}
|
|
872
|
-
setTooltipLeft(
|
|
903
|
+
setTooltipLeft(left);
|
|
873
904
|
}, [tooltipState]);
|
|
874
905
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { ref: chartRef, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), onMouseLeave: handleMouseLeave, children: [
|
|
875
906
|
label && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label }),
|
|
@@ -971,7 +1002,9 @@ var BarChartComponent = (0, import_react3.forwardRef)((originalProps, ref) => {
|
|
|
971
1002
|
zIndex: 10,
|
|
972
1003
|
opacity: tooltipState ? 1 : 0,
|
|
973
1004
|
transition: "opacity 0.1s ease-out",
|
|
974
|
-
visibility: tooltipState ? "visible" : "hidden"
|
|
1005
|
+
visibility: tooltipState ? "visible" : "hidden",
|
|
1006
|
+
width: "fit-content",
|
|
1007
|
+
whiteSpace: "nowrap"
|
|
975
1008
|
},
|
|
976
1009
|
children: tooltipState && tooltipFormatter(tooltipState)
|
|
977
1010
|
}
|
|
@@ -8,10 +8,10 @@ import "../../chunk-EWS3FESG.mjs";
|
|
|
8
8
|
import {
|
|
9
9
|
BarChartTooltip,
|
|
10
10
|
barChart_default
|
|
11
|
-
} from "../../chunk-
|
|
11
|
+
} from "../../chunk-BRVQTI2T.mjs";
|
|
12
12
|
import {
|
|
13
13
|
circularProgress_default
|
|
14
|
-
} from "../../chunk-
|
|
14
|
+
} from "../../chunk-WA7CSZQ3.mjs";
|
|
15
15
|
import {
|
|
16
16
|
radarChart_default
|
|
17
17
|
} from "../../chunk-U7SYKG2C.mjs";
|
package/dist/index.js
CHANGED
|
@@ -12531,7 +12531,7 @@ var import_react38 = require("react");
|
|
|
12531
12531
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
12532
12532
|
var CircularProgress = (0, import_react38.forwardRef)((originalProps, ref) => {
|
|
12533
12533
|
const [props, variantProps] = mapPropsVariants(originalProps, circularProgressStyle.variantKeys);
|
|
12534
|
-
const { label, size = 150, percentage,
|
|
12534
|
+
const { label, size = 150, percentage, innerContent, classNames } = { ...props, ...variantProps };
|
|
12535
12535
|
const slots = (0, import_react38.useMemo)(() => circularProgressStyle({ ...variantProps }), [variantProps]);
|
|
12536
12536
|
const data = [
|
|
12537
12537
|
{
|
|
@@ -12564,6 +12564,9 @@ var CircularProgress = (0, import_react38.forwardRef)((originalProps, ref) => {
|
|
|
12564
12564
|
const colorValue = originalProps.color;
|
|
12565
12565
|
const colorKey = colorValue || "blue";
|
|
12566
12566
|
const currentGradient = gradientColors[colorKey];
|
|
12567
|
+
const wrappedInnerContent = (0, import_react38.useMemo)(() => {
|
|
12568
|
+
return wrapSpanWithClass(innerContent);
|
|
12569
|
+
}, [innerContent]);
|
|
12567
12570
|
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
12568
12571
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "relative", style: { width: size, height: size }, children: [
|
|
12569
12572
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
@@ -12609,10 +12612,7 @@ var CircularProgress = (0, import_react38.forwardRef)((originalProps, ref) => {
|
|
|
12609
12612
|
]
|
|
12610
12613
|
}
|
|
12611
12614
|
),
|
|
12612
|
-
/* @__PURE__ */ (0, import_jsx_runtime41.
|
|
12613
|
-
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: slots.percentage({ class: classNames == null ? void 0 : classNames.percentage }), children: percentage }),
|
|
12614
|
-
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: slots.unit({ class: classNames == null ? void 0 : classNames.unit }), children: unit })
|
|
12615
|
-
] })
|
|
12615
|
+
innerContent && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: slots.inner({ class: classNames == null ? void 0 : classNames.inner }), children: wrappedInnerContent })
|
|
12616
12616
|
] }),
|
|
12617
12617
|
label && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label })
|
|
12618
12618
|
] });
|
|
@@ -12624,8 +12624,16 @@ var circularProgressStyle = tv({
|
|
|
12624
12624
|
base: ["flex", "flex-col", "items-center", "gap-[20px]", "select-none"],
|
|
12625
12625
|
background: ["fill-body-background", "border-neutral-light"],
|
|
12626
12626
|
progress: ["transition-all", "duration-1000 ease-out"],
|
|
12627
|
-
|
|
12628
|
-
|
|
12627
|
+
inner: [
|
|
12628
|
+
"absolute",
|
|
12629
|
+
"inset-0",
|
|
12630
|
+
"flex",
|
|
12631
|
+
"items-center",
|
|
12632
|
+
"justify-center",
|
|
12633
|
+
"font-bold",
|
|
12634
|
+
"text-body-foreground",
|
|
12635
|
+
"text-md"
|
|
12636
|
+
],
|
|
12629
12637
|
label: ["text-md", "font-bold", "text-left", "text-body-foreground"]
|
|
12630
12638
|
},
|
|
12631
12639
|
variants: {
|
|
@@ -12645,6 +12653,28 @@ var circularProgressStyle = tv({
|
|
|
12645
12653
|
color: "blue"
|
|
12646
12654
|
}
|
|
12647
12655
|
});
|
|
12656
|
+
function wrapSpanWithClass(node) {
|
|
12657
|
+
var _a;
|
|
12658
|
+
if (Array.isArray(node)) {
|
|
12659
|
+
return node.map(wrapSpanWithClass);
|
|
12660
|
+
}
|
|
12661
|
+
if ((0, import_react38.isValidElement)(node)) {
|
|
12662
|
+
const element = node;
|
|
12663
|
+
if (element.type === "span") {
|
|
12664
|
+
const existing = (_a = element.props.className) != null ? _a : "";
|
|
12665
|
+
return (0, import_react38.cloneElement)(element, {
|
|
12666
|
+
className: `text-xl font-bold ${existing}`.trim()
|
|
12667
|
+
});
|
|
12668
|
+
}
|
|
12669
|
+
if (element.props.children) {
|
|
12670
|
+
return (0, import_react38.cloneElement)(element, {
|
|
12671
|
+
children: wrapSpanWithClass(element.props.children)
|
|
12672
|
+
});
|
|
12673
|
+
}
|
|
12674
|
+
return element;
|
|
12675
|
+
}
|
|
12676
|
+
return node;
|
|
12677
|
+
}
|
|
12648
12678
|
|
|
12649
12679
|
// src/components/charts/areaChart.tsx
|
|
12650
12680
|
var import_react39 = require("react");
|
|
@@ -12930,13 +12960,14 @@ var BarChartComponent = (0, import_react40.forwardRef)((originalProps, ref) => {
|
|
|
12930
12960
|
const tooltipRect = tooltipRef.current.getBoundingClientRect();
|
|
12931
12961
|
const chartWidth = chartRect.width;
|
|
12932
12962
|
const tooltipWidth = tooltipRect.width;
|
|
12933
|
-
let
|
|
12934
|
-
|
|
12935
|
-
|
|
12936
|
-
|
|
12937
|
-
|
|
12938
|
-
|
|
12939
|
-
|
|
12963
|
+
let left = tooltipState.x - tooltipWidth / 2;
|
|
12964
|
+
const padding2 = 8;
|
|
12965
|
+
if (left < padding2) {
|
|
12966
|
+
left = padding2;
|
|
12967
|
+
} else if (left + tooltipWidth > chartWidth - padding2) {
|
|
12968
|
+
left = chartWidth - tooltipWidth - padding2;
|
|
12969
|
+
}
|
|
12970
|
+
setTooltipLeft(left);
|
|
12940
12971
|
}, [tooltipState]);
|
|
12941
12972
|
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { ref: chartRef, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), onMouseLeave: handleMouseLeave, children: [
|
|
12942
12973
|
label && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label }),
|
|
@@ -13038,7 +13069,9 @@ var BarChartComponent = (0, import_react40.forwardRef)((originalProps, ref) => {
|
|
|
13038
13069
|
zIndex: 10,
|
|
13039
13070
|
opacity: tooltipState ? 1 : 0,
|
|
13040
13071
|
transition: "opacity 0.1s ease-out",
|
|
13041
|
-
visibility: tooltipState ? "visible" : "hidden"
|
|
13072
|
+
visibility: tooltipState ? "visible" : "hidden",
|
|
13073
|
+
width: "fit-content",
|
|
13074
|
+
whiteSpace: "nowrap"
|
|
13042
13075
|
},
|
|
13043
13076
|
children: tooltipState && tooltipFormatter(tooltipState)
|
|
13044
13077
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -9,10 +9,10 @@ import "./chunk-MBLZYQCN.mjs";
|
|
|
9
9
|
import {
|
|
10
10
|
tree_default
|
|
11
11
|
} from "./chunk-WSBUOY2M.mjs";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-RRAZM5D3.mjs";
|
|
13
13
|
import {
|
|
14
|
-
|
|
15
|
-
} from "./chunk-
|
|
14
|
+
textarea_default
|
|
15
|
+
} from "./chunk-3CRSSRCH.mjs";
|
|
16
16
|
import "./chunk-LUWGOKLG.mjs";
|
|
17
17
|
import {
|
|
18
18
|
ToastProvider,
|
|
@@ -29,14 +29,10 @@ import {
|
|
|
29
29
|
import {
|
|
30
30
|
table_default
|
|
31
31
|
} from "./chunk-PX4RCHOE.mjs";
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import {
|
|
34
|
-
textarea_default
|
|
35
|
-
} from "./chunk-3CRSSRCH.mjs";
|
|
36
|
-
import "./chunk-TPFN22HR.mjs";
|
|
32
|
+
import "./chunk-3MY6LO7N.mjs";
|
|
37
33
|
import {
|
|
38
|
-
|
|
39
|
-
} from "./chunk-
|
|
34
|
+
tabs_default
|
|
35
|
+
} from "./chunk-DW3BX4M2.mjs";
|
|
40
36
|
import "./chunk-MZ76AA76.mjs";
|
|
41
37
|
import {
|
|
42
38
|
skeleton_default
|
|
@@ -49,6 +45,10 @@ import "./chunk-LVFI2NOH.mjs";
|
|
|
49
45
|
import {
|
|
50
46
|
switch_default
|
|
51
47
|
} from "./chunk-AGE57VDD.mjs";
|
|
48
|
+
import "./chunk-TPFN22HR.mjs";
|
|
49
|
+
import {
|
|
50
|
+
radio_default
|
|
51
|
+
} from "./chunk-PRNE3U26.mjs";
|
|
52
52
|
import "./chunk-7B7LRG5J.mjs";
|
|
53
53
|
import {
|
|
54
54
|
pagination_default
|
|
@@ -80,14 +80,14 @@ import "./chunk-DJOG6Z35.mjs";
|
|
|
80
80
|
import {
|
|
81
81
|
modal_default
|
|
82
82
|
} from "./chunk-SCQCMQDP.mjs";
|
|
83
|
-
import "./chunk-MGEWSREV.mjs";
|
|
84
|
-
import {
|
|
85
|
-
chip_default
|
|
86
|
-
} from "./chunk-2B3HDC26.mjs";
|
|
87
83
|
import "./chunk-32GA3YW4.mjs";
|
|
88
84
|
import {
|
|
89
85
|
drawer_default
|
|
90
86
|
} from "./chunk-45Y7ANPK.mjs";
|
|
87
|
+
import "./chunk-MGEWSREV.mjs";
|
|
88
|
+
import {
|
|
89
|
+
chip_default
|
|
90
|
+
} from "./chunk-2B3HDC26.mjs";
|
|
91
91
|
import "./chunk-RLXOHILK.mjs";
|
|
92
92
|
import {
|
|
93
93
|
fileUpload_default
|
|
@@ -111,10 +111,10 @@ import {
|
|
|
111
111
|
import {
|
|
112
112
|
BarChartTooltip,
|
|
113
113
|
barChart_default
|
|
114
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-BRVQTI2T.mjs";
|
|
115
115
|
import {
|
|
116
116
|
circularProgress_default
|
|
117
|
-
} from "./chunk-
|
|
117
|
+
} from "./chunk-WA7CSZQ3.mjs";
|
|
118
118
|
import {
|
|
119
119
|
radarChart_default
|
|
120
120
|
} from "./chunk-U7SYKG2C.mjs";
|