@iclips/ui 1.3.26 → 1.3.27

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
@@ -52351,17 +52351,17 @@ const S1 = [
52351
52351
  function JT(t) {
52352
52352
  return new Intl.NumberFormat("pt-BR", { style: "currency", currency: "BRL" }).format(t);
52353
52353
  }
52354
- function KT({ layout: t }) {
52355
- const e = [1, 2, 3].map((n) => /* @__PURE__ */ b("div", { className: "flex items-center gap-2", children: [
52354
+ function KT({ layout: t, chartSize: e }) {
52355
+ const n = [1, 2, 3].map((r) => /* @__PURE__ */ b("div", { className: "flex items-center gap-2", children: [
52356
52356
  /* @__PURE__ */ f("div", { className: "w-2.5 h-2.5 rounded-full bg-muted shrink-0" }),
52357
52357
  /* @__PURE__ */ f("div", { className: "h-3 bg-muted rounded flex-1" })
52358
- ] }, n));
52358
+ ] }, r));
52359
52359
  return t === "horizontal" ? /* @__PURE__ */ b("div", { className: "flex items-center gap-6 w-full animate-pulse", children: [
52360
- /* @__PURE__ */ f("div", { className: "rounded-full bg-muted shrink-0", style: { width: 144, height: 144 } }),
52361
- /* @__PURE__ */ f("div", { className: "flex flex-col gap-2 flex-1", children: e })
52360
+ /* @__PURE__ */ f("div", { className: "rounded-full bg-muted shrink-0", style: { width: e, height: e } }),
52361
+ /* @__PURE__ */ f("div", { className: "flex flex-col gap-2 flex-1", children: n })
52362
52362
  ] }) : /* @__PURE__ */ b("div", { className: "flex flex-col items-center justify-center w-full animate-pulse gap-4", children: [
52363
52363
  /* @__PURE__ */ f("div", { className: "rounded-full bg-muted", style: { width: 140, height: 140 } }),
52364
- /* @__PURE__ */ f("div", { className: "flex flex-col gap-2 w-full max-w-50", children: e })
52364
+ /* @__PURE__ */ f("div", { className: "flex flex-col gap-2 w-full max-w-50", children: n })
52365
52365
  ] });
52366
52366
  }
52367
52367
  function qT() {
@@ -52519,47 +52519,48 @@ function SR({
52519
52519
  className: r,
52520
52520
  isLoading: i = !1,
52521
52521
  layout: a = "vertical",
52522
- activeLabel: o = !1
52522
+ activeLabel: o = !1,
52523
+ chartSize: s
52523
52524
  }) {
52524
- const [s, l] = I.useState(null), c = I.useMemo(() => t.reduce((g, w) => g + w.value, 0), [t]), d = I.useMemo(
52525
- () => t.map((g, w) => ({
52526
- name: g.label,
52527
- value: g.value,
52528
- color: g.color ?? S1[w % S1.length]
52525
+ const [l, c] = I.useState(null), d = I.useMemo(() => t.reduce((w, v) => w + v.value, 0), [t]), u = I.useMemo(
52526
+ () => t.map((w, v) => ({
52527
+ name: w.label,
52528
+ value: w.value,
52529
+ color: w.color ?? S1[v % S1.length]
52529
52530
  })),
52530
52531
  [t]
52531
- ), u = a === "horizontal", p = u ? 48 : 55, h = u ? 72 : 85, m = u ? 180 : 220;
52532
+ ), p = a === "horizontal", h = s ?? (p ? 140 : 220), m = p ? Math.round(h * 0.34) : 55, g = p ? Math.round(h * 0.51) : 85;
52532
52533
  return /* @__PURE__ */ b("div", { className: C("flex flex-col gap-4 w-full", r), children: [
52533
52534
  e && /* @__PURE__ */ f("div", { className: "text-sm font-semibold text-foreground", children: e }),
52534
- i ? /* @__PURE__ */ f(KT, { layout: a }) : t.length === 0 ? /* @__PURE__ */ f(qT, {}) : /* @__PURE__ */ b("div", { className: C(u ? "flex items-center gap-4" : "flex flex-col gap-4"), children: [
52535
+ i ? /* @__PURE__ */ f(KT, { layout: a, chartSize: h }) : t.length === 0 ? /* @__PURE__ */ f(qT, {}) : /* @__PURE__ */ b("div", { className: C(p ? "flex items-center gap-4" : "flex flex-col gap-4"), children: [
52535
52536
  /* @__PURE__ */ f(
52536
52537
  "div",
52537
52538
  {
52538
52539
  className: "shrink-0",
52539
- style: u ? { width: m, height: m } : { width: "100%", height: m },
52540
+ style: p ? { width: h, height: h } : { width: "100%", height: h },
52540
52541
  children: /* @__PURE__ */ f(ky, { width: "100%", height: "100%", children: /* @__PURE__ */ b(Sy, { children: [
52541
52542
  /* @__PURE__ */ f(
52542
52543
  Iy,
52543
52544
  {
52544
- data: d,
52545
+ data: u,
52545
52546
  cx: "50%",
52546
52547
  cy: "50%",
52547
- innerRadius: p,
52548
- outerRadius: h,
52548
+ innerRadius: m,
52549
+ outerRadius: g,
52549
52550
  paddingAngle: 2,
52550
52551
  dataKey: "value",
52551
52552
  nameKey: "name",
52552
- onMouseEnter: (g, w) => l(w),
52553
- onMouseLeave: () => l(null),
52554
- shape: (g, w) => {
52555
- var v;
52553
+ onMouseEnter: (w, v) => c(v),
52554
+ onMouseLeave: () => c(null),
52555
+ shape: (w, v) => {
52556
+ var M;
52556
52557
  return /* @__PURE__ */ f(
52557
52558
  Ey,
52558
52559
  {
52559
- ...g,
52560
- fill: (v = d[w]) == null ? void 0 : v.color,
52560
+ ...w,
52561
+ fill: (M = u[v]) == null ? void 0 : M.color,
52561
52562
  stroke: "transparent",
52562
- opacity: s !== null && s !== w ? 0.4 : 1
52563
+ opacity: l !== null && l !== v ? 0.4 : 1
52563
52564
  }
52564
52565
  );
52565
52566
  },
@@ -52569,10 +52570,10 @@ function SR({
52569
52570
  content: /* @__PURE__ */ f(
52570
52571
  XT,
52571
52572
  {
52572
- activeIndex: s,
52573
- chartData: d,
52573
+ activeIndex: l,
52574
+ chartData: u,
52574
52575
  formatValue: n,
52575
- total: c
52576
+ total: d
52576
52577
  }
52577
52578
  )
52578
52579
  }
@@ -52582,20 +52583,20 @@ function SR({
52582
52583
  !o && /* @__PURE__ */ f(
52583
52584
  Ty,
52584
52585
  {
52585
- content: /* @__PURE__ */ f(ZT, { formatValue: n, total: c })
52586
+ content: /* @__PURE__ */ f(ZT, { formatValue: n, total: d })
52586
52587
  }
52587
52588
  )
52588
52589
  ] }) })
52589
52590
  }
52590
52591
  ),
52591
- /* @__PURE__ */ f("div", { className: C(u ? "flex-1 min-w-0" : ""), children: /* @__PURE__ */ f(
52592
+ /* @__PURE__ */ f("div", { className: C(p ? "flex-1 min-w-0" : ""), children: /* @__PURE__ */ f(
52592
52593
  _T,
52593
52594
  {
52594
- chartData: d,
52595
- total: c,
52595
+ chartData: u,
52596
+ total: d,
52596
52597
  formatValue: n,
52597
- activeIndex: s,
52598
- onHover: l
52598
+ activeIndex: l,
52599
+ onHover: c
52599
52600
  }
52600
52601
  ) })
52601
52602
  ] })