@particle-academy/react-fancy 1.3.1 → 1.3.3

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.js CHANGED
@@ -2220,7 +2220,6 @@ var SingleSlider = forwardRef(
2220
2220
  );
2221
2221
  const slider = /* @__PURE__ */ jsxs("div", { "data-react-fancy-slider": "", className: cn("flex flex-col gap-1", className), children: [
2222
2222
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
2223
- prefix && /* @__PURE__ */ jsx("span", { className: "shrink-0 text-sm text-zinc-500 dark:text-zinc-400", "data-react-fancy-slider-prefix": "", children: prefix }),
2224
2223
  /* @__PURE__ */ jsx(
2225
2224
  "input",
2226
2225
  {
@@ -2247,8 +2246,11 @@ var SingleSlider = forwardRef(
2247
2246
  )
2248
2247
  }
2249
2248
  ),
2250
- suffix && /* @__PURE__ */ jsx("span", { className: "shrink-0 text-sm text-zinc-500 dark:text-zinc-400", "data-react-fancy-slider-suffix": "", children: suffix }),
2251
- showValue && /* @__PURE__ */ jsx("span", { className: "min-w-[3ch] text-right text-sm font-medium text-zinc-700 dark:text-zinc-300", children: value })
2249
+ showValue && /* @__PURE__ */ jsxs("span", { className: "min-w-[3ch] shrink-0 whitespace-nowrap text-right text-sm font-medium text-zinc-700 dark:text-zinc-300", children: [
2250
+ prefix,
2251
+ value,
2252
+ suffix
2253
+ ] })
2252
2254
  ] }),
2253
2255
  marks && marks.length > 0 && /* @__PURE__ */ jsx(SliderMarks, { marks, min, max })
2254
2256
  ] });
@@ -2296,7 +2298,6 @@ var RangeSlider = forwardRef(
2296
2298
  const rightPercent = (value[1] - min) / (max - min) * 100;
2297
2299
  const slider = /* @__PURE__ */ jsxs("div", { "data-react-fancy-slider": "", className: cn("flex flex-col gap-1", className), children: [
2298
2300
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
2299
- prefix && /* @__PURE__ */ jsx("span", { className: "shrink-0 text-sm text-zinc-500 dark:text-zinc-400", "data-react-fancy-slider-prefix": "", children: prefix }),
2300
2301
  /* @__PURE__ */ jsxs("div", { className: "relative w-full", children: [
2301
2302
  /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute top-1/2 h-1.5 w-full -translate-y-1/2 rounded-full bg-zinc-200 dark:bg-zinc-700" }),
2302
2303
  /* @__PURE__ */ jsx(
@@ -2338,11 +2339,14 @@ var RangeSlider = forwardRef(
2338
2339
  ),
2339
2340
  /* @__PURE__ */ jsx("div", { className: "h-6" })
2340
2341
  ] }),
2341
- suffix && /* @__PURE__ */ jsx("span", { className: "shrink-0 text-sm text-zinc-500 dark:text-zinc-400", "data-react-fancy-slider-suffix": "", children: suffix }),
2342
- showValue && /* @__PURE__ */ jsxs("span", { className: "min-w-[6ch] whitespace-nowrap text-right text-sm font-medium text-zinc-700 dark:text-zinc-300", children: [
2342
+ showValue && /* @__PURE__ */ jsxs("span", { className: "min-w-[6ch] shrink-0 whitespace-nowrap text-right text-sm font-medium text-zinc-700 dark:text-zinc-300", children: [
2343
+ prefix,
2343
2344
  value[0],
2345
+ suffix,
2344
2346
  "\u2013",
2345
- value[1]
2347
+ prefix,
2348
+ value[1],
2349
+ suffix
2346
2350
  ] })
2347
2351
  ] }),
2348
2352
  marks && marks.length > 0 && /* @__PURE__ */ jsx(SliderMarks, { marks, min, max })
@@ -6811,6 +6815,14 @@ function ChartBar({
6811
6815
  [data]
6812
6816
  );
6813
6817
  return /* @__PURE__ */ jsxs("div", { className: cn("w-full", className), "data-react-fancy-chart-bar": "", children: [
6818
+ showValues && /* @__PURE__ */ jsx("div", { className: "mb-1 flex gap-2", children: data.map((item) => /* @__PURE__ */ jsx(
6819
+ "div",
6820
+ {
6821
+ className: "flex-1 text-center text-xs font-medium text-zinc-500 dark:text-zinc-400",
6822
+ children: item.value
6823
+ },
6824
+ item.label
6825
+ )) }),
6814
6826
  /* @__PURE__ */ jsx(
6815
6827
  "div",
6816
6828
  {
@@ -6819,26 +6831,23 @@ function ChartBar({
6819
6831
  children: data.map((item, i) => {
6820
6832
  const barHeight = item.value / maxValue * 100;
6821
6833
  const color = item.color ?? DEFAULT_COLORS[i % DEFAULT_COLORS.length];
6822
- return /* @__PURE__ */ jsxs(
6834
+ return /* @__PURE__ */ jsx(
6823
6835
  "div",
6824
6836
  {
6825
- className: "flex h-full flex-1 flex-col items-center justify-end gap-1",
6837
+ className: "flex h-full flex-1 items-end justify-center",
6826
6838
  "data-react-fancy-chart-bar-column": "",
6827
- children: [
6828
- showValues && /* @__PURE__ */ jsx("span", { className: "text-xs font-medium text-zinc-500", children: item.value }),
6829
- /* @__PURE__ */ jsx(
6830
- "div",
6831
- {
6832
- "data-react-fancy-chart-bar-item": "",
6833
- className: "w-full rounded-t-md transition-all duration-500",
6834
- style: {
6835
- height: `${barHeight}%`,
6836
- backgroundColor: color,
6837
- minHeight: 4
6838
- }
6839
+ children: /* @__PURE__ */ jsx(
6840
+ "div",
6841
+ {
6842
+ "data-react-fancy-chart-bar-item": "",
6843
+ className: "w-full rounded-t-md transition-all duration-500",
6844
+ style: {
6845
+ height: `${barHeight}%`,
6846
+ backgroundColor: color,
6847
+ minHeight: 4
6839
6848
  }
6840
- )
6841
- ]
6849
+ }
6850
+ )
6842
6851
  },
6843
6852
  item.label
6844
6853
  );