@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
|
|
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
|
-
] },
|
|
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:
|
|
52361
|
-
/* @__PURE__ */ f("div", { className: "flex flex-col gap-2 flex-1", children:
|
|
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:
|
|
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 [
|
|
52525
|
-
() => t.map((
|
|
52526
|
-
name:
|
|
52527
|
-
value:
|
|
52528
|
-
color:
|
|
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
|
-
),
|
|
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(
|
|
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:
|
|
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:
|
|
52545
|
+
data: u,
|
|
52545
52546
|
cx: "50%",
|
|
52546
52547
|
cy: "50%",
|
|
52547
|
-
innerRadius:
|
|
52548
|
-
outerRadius:
|
|
52548
|
+
innerRadius: m,
|
|
52549
|
+
outerRadius: g,
|
|
52549
52550
|
paddingAngle: 2,
|
|
52550
52551
|
dataKey: "value",
|
|
52551
52552
|
nameKey: "name",
|
|
52552
|
-
onMouseEnter: (
|
|
52553
|
-
onMouseLeave: () =>
|
|
52554
|
-
shape: (
|
|
52555
|
-
var
|
|
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
|
-
...
|
|
52560
|
-
fill: (
|
|
52560
|
+
...w,
|
|
52561
|
+
fill: (M = u[v]) == null ? void 0 : M.color,
|
|
52561
52562
|
stroke: "transparent",
|
|
52562
|
-
opacity:
|
|
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:
|
|
52573
|
-
chartData:
|
|
52573
|
+
activeIndex: l,
|
|
52574
|
+
chartData: u,
|
|
52574
52575
|
formatValue: n,
|
|
52575
|
-
total:
|
|
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:
|
|
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(
|
|
52592
|
+
/* @__PURE__ */ f("div", { className: C(p ? "flex-1 min-w-0" : ""), children: /* @__PURE__ */ f(
|
|
52592
52593
|
_T,
|
|
52593
52594
|
{
|
|
52594
|
-
chartData:
|
|
52595
|
-
total:
|
|
52595
|
+
chartData: u,
|
|
52596
|
+
total: d,
|
|
52596
52597
|
formatValue: n,
|
|
52597
|
-
activeIndex:
|
|
52598
|
-
onHover:
|
|
52598
|
+
activeIndex: l,
|
|
52599
|
+
onHover: c
|
|
52599
52600
|
}
|
|
52600
52601
|
) })
|
|
52601
52602
|
] })
|