impact-nova 1.6.3 → 1.6.4
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/components/ui/accordion.js +31 -31
- package/dist/components/ui/chart/chart.js +103 -94
- package/dist/components/ui/select/select.js +76 -76
- package/dist/components/ui/statistics-card.d.ts +4 -10
- package/dist/components/ui/statistics-card.hooks.d.ts +2 -0
- package/dist/components/ui/statistics-card.hooks.js +26 -24
- package/dist/components/ui/statistics-card.js +103 -102
- package/dist/components/ui/types/chart.types.d.ts +1 -0
- package/dist/components/ui/types/statistics-card.types.d.ts +1 -1
- package/dist/impact-nova.css +1 -1
- package/package.json +1 -1
|
@@ -1,108 +1,108 @@
|
|
|
1
1
|
import { jsxs as h, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import * as n from "react";
|
|
3
|
-
import { cn as
|
|
3
|
+
import { cn as c } from "../../lib/utils.js";
|
|
4
4
|
import { Checkbox as T } from "./checkbox.js";
|
|
5
5
|
import { Tooltip as R, TooltipTrigger as I, TooltipContent as D } from "./tooltip.js";
|
|
6
|
-
import { Info as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { useStatisticsChartData as L, useStatisticsChartLabel as G, useStatisticsChartSeries as O, useStatisticsChartOptions as W } from "./statistics-card.hooks.js";
|
|
6
|
+
import { Info as j } from "../../icons/index.js";
|
|
7
|
+
import { Chart as B } from "./chart/chart.js";
|
|
8
|
+
import { useStatisticsChartData as L, useStatisticsChartLabel as P, useStatisticsChartSeries as W, useStatisticsChartOptions as G } from "./statistics-card.hooks.js";
|
|
10
9
|
const N = n.createContext(null), y = () => {
|
|
11
|
-
const
|
|
12
|
-
if (!
|
|
10
|
+
const a = n.useContext(N);
|
|
11
|
+
if (!a)
|
|
13
12
|
throw new Error("StatisticsCard.* components must be used within a StatisticsCardRoot");
|
|
14
|
-
return
|
|
13
|
+
return a;
|
|
15
14
|
}, $ = n.forwardRef(
|
|
16
|
-
({ className:
|
|
15
|
+
({ className: a, items: e, onItemToggle: s, chartSize: t = 110, config: o, mapItem: l, children: m, ...d }, i) => {
|
|
17
16
|
const p = n.useMemo(
|
|
18
|
-
() => l ?
|
|
19
|
-
[
|
|
20
|
-
), f = "#f8f9fb", x = "px-5 py-4",
|
|
21
|
-
return /* @__PURE__ */ r(N.Provider, { value: { items: p, onItemToggle: s, chartSize:
|
|
17
|
+
() => l ? e.map((v, k) => l(v, k)) : e,
|
|
18
|
+
[e, l]
|
|
19
|
+
), f = "#f8f9fb", x = "px-5 py-4", g = "gap-4 md:gap-6 lg:gap-8", u = "w-full min-w-0 max-w-[439px]", C = o?.colors?.background || f, b = o?.spacing?.rootPadding || x, S = o?.spacing?.rootGap || g, w = o?.spacing?.rootWidth || u;
|
|
20
|
+
return /* @__PURE__ */ r(N.Provider, { value: { items: p, onItemToggle: s, chartSize: t, config: o }, children: /* @__PURE__ */ r(
|
|
22
21
|
"div",
|
|
23
22
|
{
|
|
24
23
|
ref: i,
|
|
25
24
|
role: "region",
|
|
26
25
|
"aria-roledescription": "statistics card",
|
|
27
26
|
"data-component": "statistics-card",
|
|
28
|
-
className:
|
|
27
|
+
className: c(
|
|
29
28
|
"flex flex-row flex-wrap md:flex-nowrap items-center justify-between rounded-lg box-border min-w-0 overflow-hidden",
|
|
30
|
-
|
|
29
|
+
w,
|
|
31
30
|
b,
|
|
32
31
|
S,
|
|
33
|
-
|
|
32
|
+
a
|
|
34
33
|
),
|
|
35
34
|
style: {
|
|
36
|
-
backgroundColor:
|
|
35
|
+
backgroundColor: C
|
|
37
36
|
},
|
|
38
|
-
...
|
|
37
|
+
...d,
|
|
39
38
|
children: m
|
|
40
39
|
}
|
|
41
40
|
) });
|
|
42
41
|
}
|
|
43
42
|
);
|
|
44
43
|
$.displayName = "StatisticsCardRoot";
|
|
45
|
-
const E = n.forwardRef(({ className:
|
|
44
|
+
const E = n.forwardRef(({ className: a, children: e, ...s }, t) => /* @__PURE__ */ r(
|
|
46
45
|
"div",
|
|
47
46
|
{
|
|
48
|
-
ref:
|
|
49
|
-
className:
|
|
47
|
+
ref: t,
|
|
48
|
+
className: c("flex flex-col items-start gap-4 flex-shrink-0 min-w-0", a),
|
|
50
49
|
...s,
|
|
51
|
-
children:
|
|
50
|
+
children: e
|
|
52
51
|
}
|
|
53
52
|
));
|
|
54
53
|
E.displayName = "StatisticsCardHeader";
|
|
55
|
-
const
|
|
56
|
-
({ className:
|
|
54
|
+
const O = n.forwardRef(
|
|
55
|
+
({ className: a, children: e, ...s }, t) => /* @__PURE__ */ r(
|
|
57
56
|
"div",
|
|
58
57
|
{
|
|
59
|
-
ref:
|
|
60
|
-
className:
|
|
58
|
+
ref: t,
|
|
59
|
+
className: c("flex flex-row items-center gap-1.5 min-w-0 max-w-[150px]", a),
|
|
61
60
|
...s,
|
|
62
|
-
children:
|
|
61
|
+
children: e
|
|
63
62
|
}
|
|
64
63
|
)
|
|
65
64
|
);
|
|
66
|
-
|
|
67
|
-
const
|
|
68
|
-
({ icon:
|
|
65
|
+
O.displayName = "StatisticsCardTitle";
|
|
66
|
+
const F = n.forwardRef(
|
|
67
|
+
({ icon: a, className: e, ...s }, t) => /* @__PURE__ */ r(
|
|
69
68
|
"div",
|
|
70
69
|
{
|
|
71
|
-
ref:
|
|
72
|
-
className:
|
|
70
|
+
ref: t,
|
|
71
|
+
className: c("flex items-center justify-center w-6 h-6 p-1.5 bg-[#ECEEFD] rounded-full shrink-0", e),
|
|
73
72
|
...s,
|
|
74
|
-
children:
|
|
73
|
+
children: a
|
|
75
74
|
}
|
|
76
75
|
)
|
|
77
76
|
);
|
|
78
|
-
|
|
79
|
-
const
|
|
80
|
-
({ className:
|
|
77
|
+
F.displayName = "StatisticsCardTitleIcon";
|
|
78
|
+
const H = n.forwardRef(
|
|
79
|
+
({ className: a, children: e, ...s }, t) => /* @__PURE__ */ r(
|
|
81
80
|
"span",
|
|
82
81
|
{
|
|
83
|
-
ref:
|
|
84
|
-
className:
|
|
82
|
+
ref: t,
|
|
83
|
+
className: c("font-semibold text-base leading-[1.5em] text-[#777980] truncate line-clamp-1", a),
|
|
85
84
|
...s,
|
|
86
|
-
children:
|
|
85
|
+
children: e
|
|
87
86
|
}
|
|
88
87
|
)
|
|
89
88
|
);
|
|
90
|
-
|
|
91
|
-
const
|
|
92
|
-
({ content:
|
|
93
|
-
/* @__PURE__ */ r(I, { asChild: !0, children:
|
|
94
|
-
/* @__PURE__ */ r(D, { variant: "tertiary", side: "top", children:
|
|
89
|
+
H.displayName = "StatisticsCardTitleText";
|
|
90
|
+
const M = n.forwardRef(
|
|
91
|
+
({ content: a, icon: e, ...s }, t) => /* @__PURE__ */ r("div", { ref: t, ...s, children: /* @__PURE__ */ h(R, { children: [
|
|
92
|
+
/* @__PURE__ */ r(I, { asChild: !0, children: e || /* @__PURE__ */ r(j, { size: "sm", className: "text-[#60697D] cursor-pointer shrink-0" }) }),
|
|
93
|
+
/* @__PURE__ */ r(D, { variant: "tertiary", side: "top", children: a })
|
|
95
94
|
] }) })
|
|
96
95
|
);
|
|
97
|
-
|
|
98
|
-
const
|
|
99
|
-
({ className:
|
|
100
|
-
const { items: m, onItemToggle:
|
|
101
|
-
...
|
|
96
|
+
M.displayName = "StatisticsCardTitleTooltip";
|
|
97
|
+
const q = n.forwardRef(
|
|
98
|
+
({ className: a, centerLabel: e, chartConfig: s, chartSize: t = 104, ...o }, l) => {
|
|
99
|
+
const { items: m, onItemToggle: d } = y(), { total: i, checkedTotal: p, hasChecked: f } = L(m), x = P(e, f, p, i), g = W(m, f), u = G(m, d, s), C = {
|
|
100
|
+
...u,
|
|
102
101
|
chart: {
|
|
102
|
+
...u.chart,
|
|
103
103
|
type: "pie",
|
|
104
|
-
height:
|
|
105
|
-
width:
|
|
104
|
+
height: t,
|
|
105
|
+
width: t,
|
|
106
106
|
margin: [0, 0, 0, 0],
|
|
107
107
|
spacing: [0, 0, 0, 0],
|
|
108
108
|
backgroundColor: "transparent"
|
|
@@ -111,22 +111,23 @@ const A = n.forwardRef(
|
|
|
111
111
|
credits: { enabled: !1 },
|
|
112
112
|
exporting: { enabled: !1 },
|
|
113
113
|
navigation: { buttonOptions: { enabled: !1 } },
|
|
114
|
-
series:
|
|
114
|
+
series: g
|
|
115
115
|
};
|
|
116
116
|
return /* @__PURE__ */ h(
|
|
117
117
|
"div",
|
|
118
118
|
{
|
|
119
119
|
ref: l,
|
|
120
|
-
className:
|
|
121
|
-
style: { width: `${
|
|
120
|
+
className: c("relative flex items-center justify-center flex-shrink-0", a),
|
|
121
|
+
style: { width: `${t}px`, height: `${t}px` },
|
|
122
122
|
...o,
|
|
123
123
|
children: [
|
|
124
124
|
/* @__PURE__ */ r(
|
|
125
|
-
|
|
125
|
+
B,
|
|
126
126
|
{
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
127
|
+
options: C,
|
|
128
|
+
height: t,
|
|
129
|
+
width: t,
|
|
130
|
+
noWrapper: !0
|
|
130
131
|
}
|
|
131
132
|
),
|
|
132
133
|
x && /* @__PURE__ */ r("div", { className: "absolute inset-0 flex items-center justify-center pointer-events-none", children: /* @__PURE__ */ r("span", { className: "font-black text-[12px] leading-[9.536px] text-[#1F2B4D]", children: x }) })
|
|
@@ -135,59 +136,59 @@ const A = n.forwardRef(
|
|
|
135
136
|
);
|
|
136
137
|
}
|
|
137
138
|
);
|
|
138
|
-
|
|
139
|
-
const
|
|
140
|
-
const { config: o } = y(), l = "w-full md:w-auto md:min-w-[190px] md:max-w-[208px]", m = "gap-2",
|
|
139
|
+
q.displayName = "StatisticsCardChart";
|
|
140
|
+
const A = n.forwardRef(({ className: a, children: e, ...s }, t) => {
|
|
141
|
+
const { config: o } = y(), l = "w-full md:w-auto md:min-w-[190px] md:max-w-[208px]", m = "gap-2", d = o?.spacing?.legendWidth || l, i = o?.spacing?.itemGap || m;
|
|
141
142
|
return /* @__PURE__ */ r(
|
|
142
143
|
"div",
|
|
143
144
|
{
|
|
144
|
-
ref:
|
|
145
|
+
ref: t,
|
|
145
146
|
role: "list",
|
|
146
|
-
className:
|
|
147
|
+
className: c(
|
|
147
148
|
"flex flex-col justify-center min-w-0 flex-1 md:flex-none",
|
|
148
|
-
|
|
149
|
+
d,
|
|
149
150
|
i,
|
|
150
|
-
|
|
151
|
+
a
|
|
151
152
|
),
|
|
152
153
|
...s,
|
|
153
|
-
children:
|
|
154
|
+
children: e
|
|
154
155
|
}
|
|
155
156
|
);
|
|
156
157
|
});
|
|
157
|
-
|
|
158
|
-
const
|
|
159
|
-
({ className:
|
|
160
|
-
const { items: l, onItemToggle: m, config:
|
|
158
|
+
A.displayName = "StatisticsCardLegend";
|
|
159
|
+
const J = n.forwardRef(
|
|
160
|
+
({ className: a, index: e, item: s, ...t }, o) => {
|
|
161
|
+
const { items: l, onItemToggle: m, config: d } = y();
|
|
161
162
|
let i = s, p = -1;
|
|
162
|
-
if (!i &&
|
|
163
|
-
const f = "bg-white", x = "px-3 py-1.5",
|
|
164
|
-
|
|
165
|
-
const S =
|
|
163
|
+
if (!i && e !== void 0 ? (i = l[e], p = e) : i && (p = l.findIndex((w) => w === i)), !i || p === -1) return null;
|
|
164
|
+
const f = "bg-white", x = "px-3 py-1.5", g = "#E7CDF9", u = "#0D152C", C = d?.colors?.background || f, b = d?.spacing?.itemPadding || x;
|
|
165
|
+
d?.colors?.outlineChecked;
|
|
166
|
+
const S = d?.colors?.text || u;
|
|
166
167
|
return /* @__PURE__ */ h(
|
|
167
168
|
"div",
|
|
168
169
|
{
|
|
169
170
|
ref: o,
|
|
170
171
|
role: "listitem",
|
|
171
172
|
"aria-label": `${i.label}: ${i.value}`,
|
|
172
|
-
className:
|
|
173
|
+
className: c(
|
|
173
174
|
"flex flex-row items-center gap-2 rounded-md border-l-2 transition-all",
|
|
174
|
-
|
|
175
|
+
C,
|
|
175
176
|
b,
|
|
176
|
-
|
|
177
|
+
a
|
|
177
178
|
),
|
|
178
179
|
style: {
|
|
179
180
|
borderLeftColor: i.borderColor,
|
|
180
|
-
boxShadow: i.checked ? `0 0 0
|
|
181
|
+
boxShadow: i.checked ? `0 0 0 3px ${i.borderColor}` : "0px 0px 4px 0px rgba(0,0,0,0.12)",
|
|
181
182
|
"--item-color": i.borderColor
|
|
182
183
|
},
|
|
183
|
-
...
|
|
184
|
+
...t,
|
|
184
185
|
children: [
|
|
185
186
|
/* @__PURE__ */ h("div", { className: "flex flex-row items-center gap-2 flex-1 min-w-0", children: [
|
|
186
187
|
/* @__PURE__ */ r(
|
|
187
188
|
T,
|
|
188
189
|
{
|
|
189
190
|
checked: i.checked ?? !1,
|
|
190
|
-
onCheckedChange: (
|
|
191
|
+
onCheckedChange: (w) => m?.(p, w === !0),
|
|
191
192
|
"aria-label": `Select ${i.label}`,
|
|
192
193
|
className: "shrink-0"
|
|
193
194
|
}
|
|
@@ -206,26 +207,26 @@ const K = n.forwardRef(
|
|
|
206
207
|
);
|
|
207
208
|
}
|
|
208
209
|
);
|
|
209
|
-
|
|
210
|
-
const
|
|
211
|
-
({ className:
|
|
210
|
+
J.displayName = "StatisticsCardLegendItem";
|
|
211
|
+
const K = n.forwardRef(
|
|
212
|
+
({ className: a, children: e, ...s }, t) => /* @__PURE__ */ r(
|
|
212
213
|
"div",
|
|
213
214
|
{
|
|
214
|
-
ref:
|
|
215
|
-
className:
|
|
215
|
+
ref: t,
|
|
216
|
+
className: c("flex flex-wrap items-center gap-3 self-center text-[11px] font-medium text-[#60697D]", a),
|
|
216
217
|
...s,
|
|
217
|
-
children:
|
|
218
|
+
children: e
|
|
218
219
|
}
|
|
219
220
|
)
|
|
220
221
|
);
|
|
221
|
-
|
|
222
|
-
const
|
|
223
|
-
({ className:
|
|
222
|
+
K.displayName = "StatisticsCardSummary";
|
|
223
|
+
const Q = n.forwardRef(
|
|
224
|
+
({ className: a, label: e, count: s, color: t = "#60697D", ...o }, l) => /* @__PURE__ */ h(
|
|
224
225
|
"div",
|
|
225
226
|
{
|
|
226
227
|
ref: l,
|
|
227
|
-
className:
|
|
228
|
-
style: { "--summary-color":
|
|
228
|
+
className: c("flex items-center gap-1", a),
|
|
229
|
+
style: { "--summary-color": t },
|
|
229
230
|
...o,
|
|
230
231
|
children: [
|
|
231
232
|
/* @__PURE__ */ r(
|
|
@@ -235,7 +236,7 @@ const U = n.forwardRef(
|
|
|
235
236
|
}
|
|
236
237
|
),
|
|
237
238
|
/* @__PURE__ */ h("span", { children: [
|
|
238
|
-
|
|
239
|
+
e,
|
|
239
240
|
": ",
|
|
240
241
|
s
|
|
241
242
|
] })
|
|
@@ -243,17 +244,17 @@ const U = n.forwardRef(
|
|
|
243
244
|
}
|
|
244
245
|
)
|
|
245
246
|
);
|
|
246
|
-
|
|
247
|
+
Q.displayName = "StatisticsCardSummaryItem";
|
|
247
248
|
export {
|
|
248
|
-
|
|
249
|
+
q as StatisticsCardChart,
|
|
249
250
|
E as StatisticsCardHeader,
|
|
250
|
-
|
|
251
|
-
|
|
251
|
+
A as StatisticsCardLegend,
|
|
252
|
+
J as StatisticsCardLegendItem,
|
|
252
253
|
$ as StatisticsCardRoot,
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
254
|
+
K as StatisticsCardSummary,
|
|
255
|
+
Q as StatisticsCardSummaryItem,
|
|
256
|
+
O as StatisticsCardTitle,
|
|
257
|
+
F as StatisticsCardTitleIcon,
|
|
258
|
+
H as StatisticsCardTitleText,
|
|
259
|
+
M as StatisticsCardTitleTooltip
|
|
259
260
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { StatisticsCardItem, StatisticsCardConfig, StatisticsCardChartConfig, StatisticsCardRootProps,
|
|
1
|
+
export type { StatisticsCardItem, StatisticsCardConfig, StatisticsCardChartConfig, StatisticsCardRootProps, StatisticsCardChartProps, StatisticsCardLegendItemProps, } from '../statistics-card';
|