@pibit.ai/cure-design-system 0.6.43 → 0.6.45
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/_virtual/index.js +3 -2
- package/dist/_virtual/index2.js +2 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +251 -249
- package/dist/node_modules/recharts/es6/util/ReactUtils.js +1 -1
- package/dist/node_modules/use-sync-external-store/shim/index.js +1 -1
- package/dist/patterns/table/index.d.ts +2 -2
- package/dist/patterns/table/index.d.ts.map +1 -1
- package/dist/patterns/table/toolbar/TableToolbar.d.ts +3 -0
- package/dist/patterns/table/toolbar/TableToolbar.d.ts.map +1 -1
- package/dist/patterns/table/toolbar/TableToolbar.js +137 -134
- package/dist/patterns/table/toolbar/ToolbarRefreshButton.d.ts +12 -0
- package/dist/patterns/table/toolbar/ToolbarRefreshButton.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/ToolbarRefreshButton.js +20 -0
- package/dist/patterns/table/toolbar/index.d.ts +1 -0
- package/dist/patterns/table/toolbar/index.d.ts.map +1 -1
- package/dist/primitives/donut-chart/donut-chart.d.ts +5 -2
- package/dist/primitives/donut-chart/donut-chart.d.ts.map +1 -1
- package/dist/primitives/donut-chart/donut-chart.js +83 -73
- package/dist/styles/components.css +1 -1
- package/package.json +1 -1
|
@@ -1,111 +1,121 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo as p } from "react";
|
|
3
|
-
import { ResponsiveContainer as
|
|
4
|
-
import { PieChart as
|
|
5
|
-
import { Pie as
|
|
6
|
-
import { Cell as
|
|
7
|
-
const
|
|
8
|
-
if (
|
|
9
|
-
return
|
|
10
|
-
const o = [...
|
|
11
|
-
for (let
|
|
12
|
-
const
|
|
13
|
-
o.push(`hsl(${
|
|
3
|
+
import { ResponsiveContainer as $ } from "../../node_modules/recharts/es6/component/ResponsiveContainer.js";
|
|
4
|
+
import { PieChart as j } from "../../node_modules/recharts/es6/chart/PieChart.js";
|
|
5
|
+
import { Pie as C } from "../../node_modules/recharts/es6/polar/Pie.js";
|
|
6
|
+
import { Cell as k } from "../../node_modules/recharts/es6/component/Cell.js";
|
|
7
|
+
const A = (a, r) => {
|
|
8
|
+
if (a <= r.length)
|
|
9
|
+
return r.slice(0, a);
|
|
10
|
+
const o = [...r], m = a - r.length;
|
|
11
|
+
for (let i = 0; i < m; i++) {
|
|
12
|
+
const d = i * 360 / m, h = 65 + i % 3 * 10, c = 50 + i % 2 * 10;
|
|
13
|
+
o.push(`hsl(${d}, ${h}%, ${c}%)`);
|
|
14
14
|
}
|
|
15
15
|
return o;
|
|
16
16
|
};
|
|
17
|
-
function
|
|
18
|
-
data:
|
|
19
|
-
colors:
|
|
17
|
+
function B({
|
|
18
|
+
data: a,
|
|
19
|
+
colors: r,
|
|
20
20
|
innerRadius: o = 72,
|
|
21
|
-
outerRadius:
|
|
22
|
-
isPercentage:
|
|
23
|
-
showLegend:
|
|
24
|
-
showCenterLabel:
|
|
25
|
-
centerSubLabel:
|
|
21
|
+
outerRadius: m = 120,
|
|
22
|
+
isPercentage: i = !0,
|
|
23
|
+
showLegend: d = !1,
|
|
24
|
+
showCenterLabel: h = !1,
|
|
25
|
+
centerSubLabel: c,
|
|
26
26
|
title: g,
|
|
27
|
-
size:
|
|
28
|
-
compact: f = !1
|
|
27
|
+
size: u = 240,
|
|
28
|
+
compact: f = !1,
|
|
29
|
+
"aria-label": v
|
|
29
30
|
}) {
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
31
|
+
const l = p(() => [...a], [a]), y = p(() => A(l.length, r), [l, r]), N = p(() => l.reduce((t, n) => t + (Number.isFinite(n.value) ? n.value : 0), 0), [l]), w = (t) => `${Number.isFinite(t) ? t : 0}${i ? "%" : ""}`, b = v ?? l.map((t) => `${String(t.name)} ${w(t.value)}`).join(", "), x = /* @__PURE__ */ s(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
className: "pointer-events-none relative",
|
|
35
|
+
style: { width: u, height: u },
|
|
36
|
+
role: "img",
|
|
37
|
+
"aria-label": b,
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ e($, { width: "100%", height: "100%", children: /* @__PURE__ */ e(j, { children: /* @__PURE__ */ e(
|
|
40
|
+
C,
|
|
41
|
+
{
|
|
42
|
+
data: l,
|
|
43
|
+
dataKey: "value",
|
|
44
|
+
nameKey: "name",
|
|
45
|
+
cx: "50%",
|
|
46
|
+
cy: "50%",
|
|
47
|
+
innerRadius: o,
|
|
48
|
+
outerRadius: m,
|
|
49
|
+
startAngle: 90,
|
|
50
|
+
endAngle: -270,
|
|
51
|
+
paddingAngle: f ? 0 : 2,
|
|
52
|
+
strokeWidth: 0,
|
|
53
|
+
cornerRadius: f ? 0 : 4,
|
|
54
|
+
style: { outline: "none" },
|
|
55
|
+
isAnimationActive: !1,
|
|
56
|
+
children: l.map((t, n) => /* @__PURE__ */ e(
|
|
57
|
+
k,
|
|
58
|
+
{
|
|
59
|
+
fill: y[n],
|
|
60
|
+
stroke: "none",
|
|
61
|
+
style: { outline: "none", cursor: "default" }
|
|
62
|
+
},
|
|
63
|
+
`cell-${n}`
|
|
64
|
+
))
|
|
65
|
+
}
|
|
66
|
+
) }) }),
|
|
67
|
+
h && /* @__PURE__ */ s(
|
|
68
|
+
"div",
|
|
50
69
|
{
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"aria-hidden": !0,
|
|
64
|
-
children: [
|
|
65
|
-
/* @__PURE__ */ e("span", { className: "text-2xl font-semibold tabular-nums text-primary", children: Number.isFinite(y) ? y : 0 }),
|
|
66
|
-
m ? /* @__PURE__ */ e("span", { className: "mt-1 max-w-[7.5rem] text-sm font-normal leading-snug text-secondary text-center", children: m }) : null
|
|
67
|
-
]
|
|
68
|
-
}
|
|
69
|
-
)
|
|
70
|
-
] });
|
|
71
|
-
return u ? /* @__PURE__ */ a("div", { className: "flex w-full min-w-0 max-w-[1100px] flex-col gap-3 bg-white", style: { outline: "none" }, children: [
|
|
70
|
+
className: "pointer-events-none absolute inset-0 flex flex-col items-center justify-center px-4 text-center",
|
|
71
|
+
"aria-hidden": !0,
|
|
72
|
+
children: [
|
|
73
|
+
/* @__PURE__ */ e("span", { className: "text-2xl font-semibold tabular-nums text-primary", children: Number.isFinite(N) ? N : 0 }),
|
|
74
|
+
c ? /* @__PURE__ */ e("span", { className: "mt-1 max-w-[7.5rem] text-sm font-normal leading-snug text-secondary text-center", children: c }) : null
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
return d ? /* @__PURE__ */ s("div", { className: "flex w-full min-w-0 max-w-[1100px] flex-col gap-3 bg-primary", style: { outline: "none" }, children: [
|
|
72
82
|
g ? /* @__PURE__ */ e("h4", { className: "text-sm font-normal text-primary", children: g }) : null,
|
|
73
|
-
/* @__PURE__ */
|
|
83
|
+
/* @__PURE__ */ s("div", { className: "flex w-full min-w-0 flex-row flex-wrap items-center gap-[60px]", children: [
|
|
74
84
|
x,
|
|
75
|
-
|
|
85
|
+
l.length > 0 ? /* @__PURE__ */ e("ul", { className: "flex min-h-[2.75rem] min-w-0 flex-1 flex-row flex-wrap content-center items-stretch gap-x-[60px] gap-y-4", children: l.map((t, n) => /* @__PURE__ */ s("li", { className: "flex w-[132px] items-stretch gap-2.5", children: [
|
|
76
86
|
/* @__PURE__ */ e(
|
|
77
87
|
"div",
|
|
78
88
|
{
|
|
79
89
|
className: "w-1.5 shrink-0 rounded-sm",
|
|
80
90
|
style: {
|
|
81
|
-
backgroundColor:
|
|
91
|
+
backgroundColor: y[n],
|
|
82
92
|
minHeight: "2.75rem"
|
|
83
93
|
}
|
|
84
94
|
}
|
|
85
95
|
),
|
|
86
|
-
/* @__PURE__ */
|
|
96
|
+
/* @__PURE__ */ s("div", { className: "flex min-w-0 flex-col justify-center", children: [
|
|
87
97
|
/* @__PURE__ */ e("span", { className: "text-xs text-secondary", children: t.name }),
|
|
88
|
-
/* @__PURE__ */ e("span", { className: "text-xl font-semibold tabular-nums text-primary", children:
|
|
98
|
+
/* @__PURE__ */ e("span", { className: "text-xl font-semibold tabular-nums text-primary", children: w(t.value) })
|
|
89
99
|
] })
|
|
90
|
-
] }, `${String(t.name)}-${
|
|
100
|
+
] }, `${String(t.name)}-${n}`)) }) : null
|
|
91
101
|
] })
|
|
92
102
|
] }) : f ? /* @__PURE__ */ e(
|
|
93
103
|
"div",
|
|
94
104
|
{
|
|
95
105
|
className: "flex items-center justify-center",
|
|
96
|
-
style: { outline: "none", width:
|
|
106
|
+
style: { outline: "none", width: u, height: u },
|
|
97
107
|
children: x
|
|
98
108
|
}
|
|
99
109
|
) : /* @__PURE__ */ e(
|
|
100
110
|
"div",
|
|
101
111
|
{
|
|
102
|
-
className: "flex h-full min-h-[150px] w-full items-center justify-center bg-
|
|
112
|
+
className: "flex h-full min-h-[150px] w-full items-center justify-center bg-primary",
|
|
103
113
|
style: { outline: "none" },
|
|
104
114
|
children: x
|
|
105
115
|
}
|
|
106
116
|
);
|
|
107
117
|
}
|
|
108
118
|
export {
|
|
109
|
-
|
|
110
|
-
|
|
119
|
+
B as DonutChart,
|
|
120
|
+
B as default
|
|
111
121
|
};
|