@particle-academy/react-fancy 1.3.1 → 1.3.2
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/dist/index.cjs +21 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +21 -16
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -7121,6 +7121,14 @@ function ChartBar({
|
|
|
7121
7121
|
[data]
|
|
7122
7122
|
);
|
|
7123
7123
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("w-full", className), "data-react-fancy-chart-bar": "", children: [
|
|
7124
|
+
showValues && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-1 flex gap-2", children: data.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7125
|
+
"div",
|
|
7126
|
+
{
|
|
7127
|
+
className: "flex-1 text-center text-xs font-medium text-zinc-500 dark:text-zinc-400",
|
|
7128
|
+
children: item.value
|
|
7129
|
+
},
|
|
7130
|
+
item.label
|
|
7131
|
+
)) }),
|
|
7124
7132
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7125
7133
|
"div",
|
|
7126
7134
|
{
|
|
@@ -7129,26 +7137,23 @@ function ChartBar({
|
|
|
7129
7137
|
children: data.map((item, i) => {
|
|
7130
7138
|
const barHeight = item.value / maxValue * 100;
|
|
7131
7139
|
const color = item.color ?? DEFAULT_COLORS[i % DEFAULT_COLORS.length];
|
|
7132
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
7140
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7133
7141
|
"div",
|
|
7134
7142
|
{
|
|
7135
|
-
className: "flex h-full flex-1
|
|
7143
|
+
className: "flex h-full flex-1 items-end justify-center",
|
|
7136
7144
|
"data-react-fancy-chart-bar-column": "",
|
|
7137
|
-
children:
|
|
7138
|
-
|
|
7139
|
-
|
|
7140
|
-
"
|
|
7141
|
-
|
|
7142
|
-
|
|
7143
|
-
|
|
7144
|
-
|
|
7145
|
-
|
|
7146
|
-
backgroundColor: color,
|
|
7147
|
-
minHeight: 4
|
|
7148
|
-
}
|
|
7145
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7146
|
+
"div",
|
|
7147
|
+
{
|
|
7148
|
+
"data-react-fancy-chart-bar-item": "",
|
|
7149
|
+
className: "w-full rounded-t-md transition-all duration-500",
|
|
7150
|
+
style: {
|
|
7151
|
+
height: `${barHeight}%`,
|
|
7152
|
+
backgroundColor: color,
|
|
7153
|
+
minHeight: 4
|
|
7149
7154
|
}
|
|
7150
|
-
|
|
7151
|
-
|
|
7155
|
+
}
|
|
7156
|
+
)
|
|
7152
7157
|
},
|
|
7153
7158
|
item.label
|
|
7154
7159
|
);
|