shadcn-packaged 2025.9.15 → 2025.9.22
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/package.json +4 -4
- package/ui/chart.jsx +23 -19
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "shadcn-packaged",
|
3
3
|
"private": false,
|
4
|
-
"version": "2025.9.
|
4
|
+
"version": "2025.9.22",
|
5
5
|
"type": "module",
|
6
6
|
"module": "index.mjs",
|
7
7
|
"scripts": {
|
@@ -56,13 +56,13 @@
|
|
56
56
|
"embla-carousel-react": "^8.6.0",
|
57
57
|
"input-otp": "^1.4.2",
|
58
58
|
"next-themes": "^0.4.6",
|
59
|
-
"react-day-picker": "^9.
|
60
|
-
"react-hook-form": "^7.
|
59
|
+
"react-day-picker": "^9.11.0",
|
60
|
+
"react-hook-form": "^7.63.0",
|
61
61
|
"react-resizable-panels": "^3.0.6",
|
62
62
|
"recharts": "^2.15.4",
|
63
63
|
"sonner": "^2.0.7",
|
64
64
|
"vaul": "^1.1.2",
|
65
|
-
"zod": "^4.1.
|
65
|
+
"zod": "^4.1.11"
|
66
66
|
},
|
67
67
|
"devDependencies": {
|
68
68
|
"@types/node": "^22.10.7",
|
package/ui/chart.jsx
CHANGED
@@ -84,13 +84,15 @@ const ChartTooltipContent = React.forwardRef(({ active, payload, className, indi
|
|
84
84
|
return (<div ref={ref} className={cn("grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl", className)}>
|
85
85
|
{!nestLabel ? tooltipLabel : null}
|
86
86
|
<div className="grid gap-1.5">
|
87
|
-
{payload
|
87
|
+
{payload
|
88
|
+
.filter((item) => item.type !== "none")
|
89
|
+
.map((item, index) => {
|
88
90
|
const key = `${nameKey || item.name || item.dataKey || "value"}`;
|
89
91
|
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
90
92
|
const indicatorColor = color || item.payload.fill || item.color;
|
91
93
|
return (<div key={item.dataKey} className={cn("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground", indicator === "dot" && "items-center")}>
|
92
|
-
|
93
|
-
|
94
|
+
{formatter && item?.value !== undefined && item.name ? (formatter(item.value, item.name, item, index, item.payload)) : (<>
|
95
|
+
{itemConfig?.icon ? (<itemConfig.icon />) : (!hideIndicator && (<div className={cn("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]", {
|
94
96
|
"h-2.5 w-2.5": indicator === "dot",
|
95
97
|
"w-1": indicator === "line",
|
96
98
|
"w-0 border-[1.5px] border-dashed bg-transparent": indicator === "dashed",
|
@@ -99,19 +101,19 @@ const ChartTooltipContent = React.forwardRef(({ active, payload, className, indi
|
|
99
101
|
"--color-bg": indicatorColor,
|
100
102
|
"--color-border": indicatorColor,
|
101
103
|
}}/>))}
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
104
|
+
<div className={cn("flex flex-1 justify-between leading-none", nestLabel ? "items-end" : "items-center")}>
|
105
|
+
<div className="grid gap-1.5">
|
106
|
+
{nestLabel ? tooltipLabel : null}
|
107
|
+
<span className="text-muted-foreground">
|
108
|
+
{itemConfig?.label || item.name}
|
109
|
+
</span>
|
110
|
+
</div>
|
111
|
+
{item.value && (<span className="font-mono font-medium tabular-nums text-foreground">
|
112
|
+
{item.value.toLocaleString()}
|
113
|
+
</span>)}
|
108
114
|
</div>
|
109
|
-
|
110
|
-
|
111
|
-
</span>)}
|
112
|
-
</div>
|
113
|
-
</>)}
|
114
|
-
</div>);
|
115
|
+
</>)}
|
116
|
+
</div>);
|
115
117
|
})}
|
116
118
|
</div>
|
117
119
|
</div>);
|
@@ -124,15 +126,17 @@ const ChartLegendContent = React.forwardRef(({ className, hideIcon = false, payl
|
|
124
126
|
return null;
|
125
127
|
}
|
126
128
|
return (<div ref={ref} className={cn("flex items-center justify-center gap-4", verticalAlign === "top" ? "pb-3" : "pt-3", className)}>
|
127
|
-
{payload
|
129
|
+
{payload
|
130
|
+
.filter((item) => item.type !== "none")
|
131
|
+
.map((item) => {
|
128
132
|
const key = `${nameKey || item.dataKey || "value"}`;
|
129
133
|
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
130
134
|
return (<div key={item.value} className={cn("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground")}>
|
131
|
-
|
135
|
+
{itemConfig?.icon && !hideIcon ? (<itemConfig.icon />) : (<div className="h-2 w-2 shrink-0 rounded-[2px]" style={{
|
132
136
|
backgroundColor: item.color,
|
133
137
|
}}/>)}
|
134
|
-
|
135
|
-
|
138
|
+
{itemConfig?.label}
|
139
|
+
</div>);
|
136
140
|
})}
|
137
141
|
</div>);
|
138
142
|
});
|