@brightlocal/ui-components 3.1.0 → 3.2.0
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/README.md +6 -1
- package/component-meta.json +663 -38
- package/deprecations.json +1 -1
- package/dist/alert-dialog.cjs +1 -1
- package/dist/alert-dialog.d.ts +32 -3
- package/dist/alert-dialog.d.ts.map +1 -1
- package/dist/alert-dialog.js +61 -58
- package/dist/alert.cjs +1 -1
- package/dist/alert.d.ts.map +1 -1
- package/dist/alert.js +58 -57
- package/dist/badge.cjs +1 -1
- package/dist/badge.d.ts +9 -0
- package/dist/badge.d.ts.map +1 -1
- package/dist/badge.js +50 -30
- package/dist/banner.cjs +1 -0
- package/dist/banner.d.ts +81 -0
- package/dist/banner.d.ts.map +1 -0
- package/dist/banner.js +176 -0
- package/dist/blocks/empty-state.cjs +1 -1
- package/dist/blocks/empty-state.d.ts +4 -3
- package/dist/blocks/empty-state.d.ts.map +1 -1
- package/dist/blocks/empty-state.js +21 -20
- package/dist/blocks/progress-state.d.ts +2 -2
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts +17 -0
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +8 -2
- package/dist/brand-illustration-motif.d.ts +1 -1
- package/dist/card.cjs +1 -1
- package/dist/card.d.ts +86 -6
- package/dist/card.d.ts.map +1 -1
- package/dist/card.js +185 -96
- package/dist/chart.cjs +3 -3
- package/dist/chart.d.ts +231 -13
- package/dist/chart.d.ts.map +1 -1
- package/dist/chart.js +466 -306
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.d.ts +1 -1
- package/dist/checkbox.d.ts.map +1 -1
- package/dist/checkbox.js +2 -1
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.js +2 -2
- package/dist/command.cjs +1 -1
- package/dist/command.js +1 -1
- package/dist/data-table.cjs +1 -1
- package/dist/data-table.d.ts +169 -22
- package/dist/data-table.d.ts.map +1 -1
- package/dist/data-table.js +695 -561
- package/dist/grid.d.ts +24 -1
- package/dist/grid.d.ts.map +1 -1
- package/dist/hooks/use-breakpoint.cjs +1 -1
- package/dist/hooks/use-breakpoint.d.ts +1 -1
- package/dist/hooks/use-breakpoint.d.ts.map +1 -1
- package/dist/hooks/use-breakpoint.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +593 -561
- package/dist/info-tooltip.cjs +1 -0
- package/dist/info-tooltip.d.ts +39 -0
- package/dist/info-tooltip.d.ts.map +1 -0
- package/dist/info-tooltip.js +41 -0
- package/dist/input-chip.cjs +1 -1
- package/dist/input-chip.js +1 -1
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.d.ts +33 -2
- package/dist/input-group.d.ts.map +1 -1
- package/dist/input-group.js +167 -54
- package/dist/input-otp.cjs +1 -1
- package/dist/input-otp.js +9 -9
- package/dist/input-password.cjs +1 -1
- package/dist/input-password.d.ts +28 -6
- package/dist/input-password.d.ts.map +1 -1
- package/dist/input-password.js +5 -5
- package/dist/input.cjs +1 -1
- package/dist/input.js +10 -10
- package/dist/lib/block-illustration.cjs +1 -1
- package/dist/lib/block-illustration.d.ts +4 -1
- package/dist/lib/block-illustration.d.ts.map +1 -1
- package/dist/lib/block-illustration.js +12 -11
- package/dist/lib/utils.cjs +1 -1
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +4 -3
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/multi-select-filter.cjs +1 -0
- package/dist/multi-select-filter.d.ts +178 -0
- package/dist/multi-select-filter.d.ts.map +1 -0
- package/dist/multi-select-filter.js +463 -0
- package/dist/progress.cjs +1 -1
- package/dist/progress.d.ts +123 -16
- package/dist/progress.d.ts.map +1 -1
- package/dist/progress.js +89 -75
- package/dist/rating.cjs +1 -1
- package/dist/rating.js +18 -18
- package/dist/relative-date.cjs +1 -0
- package/dist/relative-date.d.ts +65 -0
- package/dist/relative-date.d.ts.map +1 -0
- package/dist/relative-date.js +128 -0
- package/dist/select.cjs +2 -2
- package/dist/select.d.ts +11 -1
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +97 -81
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +78 -2
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +192 -85
- package/dist/single-select-filter.cjs +1 -0
- package/dist/single-select-filter.d.ts +81 -0
- package/dist/single-select-filter.d.ts.map +1 -0
- package/dist/single-select-filter.js +226 -0
- package/dist/sonner.cjs +1 -1
- package/dist/sonner.d.ts.map +1 -1
- package/dist/sonner.js +22 -22
- package/dist/split-layout.cjs +1 -1
- package/dist/split-layout.d.ts +1 -1
- package/dist/split-layout.js +13 -13
- package/dist/table.cjs +1 -1
- package/dist/table.d.ts +45 -4
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +90 -73
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.d.ts +12 -1
- package/dist/tabs.d.ts.map +1 -1
- package/dist/tabs.js +148 -126
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +1 -1
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.d.ts +38 -36
- package/dist/tooltip.d.ts.map +1 -1
- package/dist/tooltip.js +262 -73
- package/dist/typography-text.d.ts +1 -2
- package/dist/typography-text.d.ts.map +1 -1
- package/dist/typography.d.ts +1 -1
- package/package.json +5 -6
- package/src/blocks/empty-state.tsx +8 -3
- package/src/blocks/progress-state.tsx +2 -2
- package/src/blocks/sidebar.tsx +26 -2
- package/src/components/alert-dialog.tsx +50 -5
- package/src/components/alert.tsx +16 -8
- package/src/components/badge.tsx +40 -3
- package/src/components/banner.tsx +288 -0
- package/src/components/brand-illustration-motif.tsx +1 -1
- package/src/components/card.tsx +211 -24
- package/src/components/chart.tsx +523 -35
- package/src/components/checkbox.tsx +1 -1
- package/src/components/combobox.tsx +2 -2
- package/src/components/command.tsx +1 -1
- package/src/components/data-table.tsx +778 -195
- package/src/components/grid.tsx +32 -1
- package/src/components/info-tooltip.tsx +94 -0
- package/src/components/input-chip.tsx +1 -1
- package/src/components/input-group.tsx +246 -11
- package/src/components/input-otp.tsx +1 -1
- package/src/components/input-password.tsx +33 -11
- package/src/components/input.tsx +1 -1
- package/src/components/list.tsx +1 -1
- package/src/components/multi-select-filter.tsx +912 -0
- package/src/components/progress.tsx +190 -31
- package/src/components/rating.tsx +1 -1
- package/src/components/relative-date.tsx +230 -0
- package/src/components/select.tsx +35 -5
- package/src/components/sheet.tsx +240 -4
- package/src/components/single-select-filter.tsx +443 -0
- package/src/components/sonner.tsx +16 -5
- package/src/components/split-layout.tsx +2 -2
- package/src/components/table.tsx +71 -11
- package/src/components/tabs.tsx +93 -46
- package/src/components/textarea.tsx +1 -1
- package/src/components/tooltip.tsx +440 -68
- package/src/components/typography-text.tsx +1 -2
- package/src/components/typography.tsx +1 -1
- package/src/hooks/use-breakpoint.ts +2 -1
- package/src/index.ts +5 -0
- package/src/lib/block-illustration.tsx +5 -1
- package/src/lib/utils.ts +1 -0
package/dist/card.js
CHANGED
|
@@ -1,42 +1,53 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as i, jsxs as w } from "react/jsx-runtime";
|
|
2
2
|
import * as s from "react";
|
|
3
|
-
import { Slot as
|
|
4
|
-
import { cva as
|
|
3
|
+
import { Slot as C } from "@radix-ui/react-slot";
|
|
4
|
+
import { cva as m } from "class-variance-authority";
|
|
5
5
|
import { cn as l } from "@brightlocal/ui-components/lib/utils";
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
const u = s.createContext({ flush: !1, density: "default", variant: "filled" }), v = {
|
|
7
|
+
filled: "bg-muted",
|
|
8
|
+
border: "bg-card",
|
|
9
|
+
transparent: "bg-background",
|
|
10
|
+
"transparent-flush": "bg-background"
|
|
11
|
+
};
|
|
12
|
+
function p(e, a) {
|
|
13
|
+
return e ? !1 : a === "condensed" ? "px-3" : a === "data" ? "px-content" : "px-section-md";
|
|
9
14
|
}
|
|
10
|
-
const
|
|
15
|
+
const y = m(
|
|
11
16
|
[
|
|
12
17
|
"flex",
|
|
13
18
|
"flex-col",
|
|
14
19
|
"rounded-xl",
|
|
15
20
|
"transition-colors duration-fast ease-out",
|
|
16
|
-
"w-full"
|
|
17
|
-
"max-w-[400px]"
|
|
21
|
+
"w-full"
|
|
18
22
|
],
|
|
19
23
|
{
|
|
20
24
|
variants: {
|
|
21
25
|
variant: {
|
|
26
|
+
// The tinted fill: the muted surface, a step below the white card.
|
|
22
27
|
filled: [
|
|
23
|
-
"bg-
|
|
28
|
+
"bg-muted",
|
|
24
29
|
"text-card-foreground",
|
|
25
30
|
"border",
|
|
26
31
|
"border-card-border"
|
|
27
32
|
],
|
|
28
33
|
transparent: ["bg-transparent", "text-foreground"],
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"text-foreground",
|
|
32
|
-
"border",
|
|
33
|
-
"border-border"
|
|
34
|
-
],
|
|
34
|
+
// The card surface: solid white on the off-white page, neutral-900 in dark.
|
|
35
|
+
border: ["bg-card", "text-foreground", "border", "border-border"],
|
|
35
36
|
"transparent-flush": ["bg-transparent", "text-foreground"]
|
|
36
37
|
},
|
|
37
38
|
density: {
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
// Flush content right after a divider header cancels the root gap so
|
|
40
|
+
// it sits on the line, as it does in the data density.
|
|
41
|
+
default: [
|
|
42
|
+
"gap-8",
|
|
43
|
+
"py-section-md",
|
|
44
|
+
"[&>[data-divider]+[data-flush]]:-mt-8"
|
|
45
|
+
],
|
|
46
|
+
condensed: ["gap-3", "py-3", "[&>[data-divider]+[data-flush]]:-mt-3"],
|
|
47
|
+
// Data cards space via the sub-components, not a root gap: the header
|
|
48
|
+
// owns the top padding and its divider; content/footer pad below it.
|
|
49
|
+
// This lets flush content sit directly against the header divider.
|
|
50
|
+
data: ["pb-6"]
|
|
40
51
|
}
|
|
41
52
|
},
|
|
42
53
|
defaultVariants: {
|
|
@@ -47,45 +58,45 @@ const v = u(
|
|
|
47
58
|
), N = s.forwardRef(
|
|
48
59
|
({
|
|
49
60
|
className: e,
|
|
50
|
-
variant:
|
|
51
|
-
density:
|
|
61
|
+
variant: a = "filled",
|
|
62
|
+
density: t = "default",
|
|
52
63
|
dataHook: r,
|
|
53
64
|
trackingEl: o,
|
|
54
|
-
trackingLabel:
|
|
65
|
+
trackingLabel: n,
|
|
55
66
|
maxWidth: d,
|
|
56
|
-
children:
|
|
57
|
-
style:
|
|
58
|
-
...
|
|
59
|
-
},
|
|
60
|
-
const
|
|
67
|
+
children: f,
|
|
68
|
+
style: c,
|
|
69
|
+
...g
|
|
70
|
+
}, h) => {
|
|
71
|
+
const b = a === "transparent-flush";
|
|
61
72
|
s.useEffect(() => {
|
|
62
73
|
process.env.NODE_ENV !== "production" && d !== void 0 && console.warn(
|
|
63
74
|
'Card: the "maxWidth" prop is deprecated. Use Tailwind max-width utilities via className instead (e.g., className="max-w-sm").'
|
|
64
75
|
);
|
|
65
76
|
}, [d]);
|
|
66
|
-
const
|
|
77
|
+
const x = d !== void 0 ? {
|
|
67
78
|
maxWidth: typeof d == "number" ? `${d}px` : d
|
|
68
79
|
} : void 0;
|
|
69
|
-
return /* @__PURE__ */
|
|
80
|
+
return /* @__PURE__ */ i(u.Provider, { value: { flush: b, density: t, variant: a }, children: /* @__PURE__ */ i(
|
|
70
81
|
"div",
|
|
71
82
|
{
|
|
72
|
-
ref:
|
|
73
|
-
className: l(
|
|
74
|
-
"data-density":
|
|
83
|
+
ref: h,
|
|
84
|
+
className: l(y({ variant: a, density: t }), e),
|
|
85
|
+
"data-density": t,
|
|
75
86
|
"data-hook": r,
|
|
76
87
|
"data-slot": "card",
|
|
77
|
-
"data-tracking-el": o || `card-${
|
|
78
|
-
"data-tracking-label":
|
|
79
|
-
style: { ...
|
|
80
|
-
...
|
|
81
|
-
children:
|
|
88
|
+
"data-tracking-el": o || `card-${a}`,
|
|
89
|
+
"data-tracking-label": n,
|
|
90
|
+
style: { ...x, ...c },
|
|
91
|
+
...g,
|
|
92
|
+
children: f
|
|
82
93
|
}
|
|
83
94
|
) });
|
|
84
95
|
}
|
|
85
96
|
);
|
|
86
97
|
N.displayName = "Card";
|
|
87
|
-
const
|
|
88
|
-
"@container/card-header grid auto-rows-min grid-rows-[auto_auto] gap-1
|
|
98
|
+
const k = m(
|
|
99
|
+
"@container/card-header grid auto-rows-min grid-rows-[auto_auto] gap-1 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-metric]:grid-cols-[1fr_auto]",
|
|
89
100
|
{
|
|
90
101
|
variants: {
|
|
91
102
|
align: {
|
|
@@ -98,27 +109,47 @@ const w = u(
|
|
|
98
109
|
align: "left"
|
|
99
110
|
}
|
|
100
111
|
}
|
|
101
|
-
),
|
|
102
|
-
({
|
|
103
|
-
|
|
104
|
-
|
|
112
|
+
), R = s.forwardRef(
|
|
113
|
+
({
|
|
114
|
+
className: e,
|
|
115
|
+
align: a = "left",
|
|
116
|
+
divider: t = !1,
|
|
117
|
+
sticky: r = !1,
|
|
118
|
+
dataHook: o,
|
|
119
|
+
...n
|
|
120
|
+
}, d) => {
|
|
121
|
+
const { flush: f, density: c, variant: g } = s.useContext(u);
|
|
122
|
+
return /* @__PURE__ */ i(
|
|
105
123
|
"div",
|
|
106
124
|
{
|
|
107
|
-
ref:
|
|
125
|
+
ref: d,
|
|
108
126
|
className: l(
|
|
109
|
-
|
|
110
|
-
|
|
127
|
+
k({ align: a }),
|
|
128
|
+
p(f, c),
|
|
129
|
+
// Data cards: the header owns the card's top padding (DS-989).
|
|
130
|
+
c === "data" && "pt-4 pb-4",
|
|
131
|
+
// Other densities have no header padding of their own; with a
|
|
132
|
+
// divider the line gets the density's section spacing above it.
|
|
133
|
+
t && c === "default" && "pb-8",
|
|
134
|
+
t && c === "condensed" && "pb-3",
|
|
135
|
+
t && "border-border border-b",
|
|
136
|
+
r && [
|
|
137
|
+
"sticky top-(--ds-section-padding-y-sm) z-10 rounded-t-xl",
|
|
138
|
+
v[g]
|
|
139
|
+
],
|
|
111
140
|
e
|
|
112
141
|
),
|
|
113
|
-
"data-
|
|
142
|
+
"data-divider": t ? "" : void 0,
|
|
143
|
+
"data-hook": o,
|
|
114
144
|
"data-slot": "card-header",
|
|
115
|
-
|
|
145
|
+
"data-sticky": r ? "" : void 0,
|
|
146
|
+
...n
|
|
116
147
|
}
|
|
117
148
|
);
|
|
118
149
|
}
|
|
119
150
|
);
|
|
120
|
-
|
|
121
|
-
const
|
|
151
|
+
R.displayName = "CardHeader";
|
|
152
|
+
const V = m("", {
|
|
122
153
|
variants: {
|
|
123
154
|
size: {
|
|
124
155
|
small: "text-heading-subsection",
|
|
@@ -128,25 +159,25 @@ const k = u("", {
|
|
|
128
159
|
defaultVariants: {
|
|
129
160
|
size: "default"
|
|
130
161
|
}
|
|
131
|
-
}),
|
|
132
|
-
({ className: e, size:
|
|
133
|
-
const
|
|
134
|
-
className: l(
|
|
162
|
+
}), j = s.forwardRef(
|
|
163
|
+
({ className: e, size: a = "default", level: t, asChild: r = !1, dataHook: o, ...n }, d) => {
|
|
164
|
+
const f = {
|
|
165
|
+
className: l(V({ size: a }), e),
|
|
135
166
|
"data-hook": o,
|
|
136
167
|
"data-slot": "card-title",
|
|
137
|
-
...
|
|
168
|
+
...n
|
|
138
169
|
};
|
|
139
170
|
if (r)
|
|
140
|
-
return /* @__PURE__ */
|
|
141
|
-
if (
|
|
142
|
-
const
|
|
143
|
-
return /* @__PURE__ */
|
|
171
|
+
return /* @__PURE__ */ i(C, { ref: d, ...f });
|
|
172
|
+
if (t) {
|
|
173
|
+
const c = `h${t}`;
|
|
174
|
+
return /* @__PURE__ */ i(c, { ref: d, ...f });
|
|
144
175
|
}
|
|
145
|
-
return /* @__PURE__ */
|
|
176
|
+
return /* @__PURE__ */ i("div", { ref: d, ...f });
|
|
146
177
|
}
|
|
147
178
|
);
|
|
148
|
-
|
|
149
|
-
const
|
|
179
|
+
j.displayName = "CardTitle";
|
|
180
|
+
const T = m("text-body-sm text-muted-foreground", {
|
|
150
181
|
variants: {
|
|
151
182
|
align: {
|
|
152
183
|
left: "text-left",
|
|
@@ -155,12 +186,12 @@ const V = u("text-body-sm text-muted-foreground", {
|
|
|
155
186
|
}
|
|
156
187
|
}
|
|
157
188
|
}), D = s.forwardRef(
|
|
158
|
-
({ className: e, align:
|
|
189
|
+
({ className: e, align: a, dataHook: t, ...r }, o) => /* @__PURE__ */ i(
|
|
159
190
|
"div",
|
|
160
191
|
{
|
|
161
192
|
ref: o,
|
|
162
|
-
className: l(
|
|
163
|
-
"data-hook":
|
|
193
|
+
className: l(T({ align: a }), e),
|
|
194
|
+
"data-hook": t,
|
|
164
195
|
"data-slot": "card-description",
|
|
165
196
|
...r
|
|
166
197
|
}
|
|
@@ -168,81 +199,139 @@ const V = u("text-body-sm text-muted-foreground", {
|
|
|
168
199
|
);
|
|
169
200
|
D.displayName = "CardDescription";
|
|
170
201
|
const H = s.forwardRef(
|
|
171
|
-
({ className: e, dataHook:
|
|
202
|
+
({ className: e, dataHook: a, ...t }, r) => /* @__PURE__ */ i(
|
|
172
203
|
"div",
|
|
173
204
|
{
|
|
174
205
|
ref: r,
|
|
175
206
|
className: l(
|
|
176
|
-
|
|
207
|
+
// Vertically centered against the title block, per the header spec
|
|
208
|
+
// (DS-989) — Figma's Title Row centers its slot on the cross axis.
|
|
209
|
+
"col-start-2 row-span-2 row-start-1 self-center justify-self-end",
|
|
177
210
|
e
|
|
178
211
|
),
|
|
179
|
-
"data-hook":
|
|
212
|
+
"data-hook": a,
|
|
180
213
|
"data-slot": "card-action",
|
|
181
|
-
...
|
|
214
|
+
...t
|
|
182
215
|
}
|
|
183
216
|
)
|
|
184
217
|
);
|
|
185
218
|
H.displayName = "CardAction";
|
|
186
|
-
const
|
|
187
|
-
({ className: e, children:
|
|
188
|
-
const { flush:
|
|
189
|
-
return /* @__PURE__ */
|
|
219
|
+
const M = s.forwardRef(
|
|
220
|
+
({ className: e, children: a, dataHook: t, ...r }, o) => {
|
|
221
|
+
const { flush: n, density: d } = s.useContext(u);
|
|
222
|
+
return /* @__PURE__ */ i(
|
|
190
223
|
"div",
|
|
191
224
|
{
|
|
192
225
|
ref: o,
|
|
193
|
-
className: l(
|
|
194
|
-
|
|
226
|
+
className: l(
|
|
227
|
+
p(n, d),
|
|
228
|
+
d === "data" && "pt-6",
|
|
229
|
+
e
|
|
230
|
+
),
|
|
231
|
+
"data-hook": t,
|
|
195
232
|
"data-slot": "card-media",
|
|
196
233
|
...r,
|
|
197
|
-
children: /* @__PURE__ */
|
|
234
|
+
children: /* @__PURE__ */ i("div", { className: "overflow-hidden rounded-md", "data-slot": "card-media-clip", children: a })
|
|
198
235
|
}
|
|
199
236
|
);
|
|
200
237
|
}
|
|
201
238
|
);
|
|
202
|
-
|
|
203
|
-
const
|
|
204
|
-
({ className: e, dataHook: t, ...
|
|
205
|
-
const { flush:
|
|
206
|
-
return /* @__PURE__ */
|
|
239
|
+
M.displayName = "CardMedia";
|
|
240
|
+
const _ = s.forwardRef(
|
|
241
|
+
({ className: e, flush: a = !1, dataHook: t, ...r }, o) => {
|
|
242
|
+
const { flush: n, density: d } = s.useContext(u);
|
|
243
|
+
return /* @__PURE__ */ i(
|
|
207
244
|
"div",
|
|
208
245
|
{
|
|
209
|
-
ref:
|
|
210
|
-
className: l(
|
|
246
|
+
ref: o,
|
|
247
|
+
className: l(
|
|
248
|
+
a ? !1 : p(n, d),
|
|
249
|
+
// Data cards space below the header divider per section; flush
|
|
250
|
+
// content instead sits directly against the divider.
|
|
251
|
+
d === "data" && !a && "pt-6",
|
|
252
|
+
e
|
|
253
|
+
),
|
|
254
|
+
"data-flush": a ? "" : void 0,
|
|
211
255
|
"data-hook": t,
|
|
212
256
|
"data-slot": "card-content",
|
|
213
|
-
...
|
|
257
|
+
...r
|
|
214
258
|
}
|
|
215
259
|
);
|
|
216
260
|
}
|
|
217
261
|
);
|
|
218
|
-
|
|
262
|
+
_.displayName = "CardContent";
|
|
263
|
+
const z = s.forwardRef(
|
|
264
|
+
({ className: e, dataHook: a, ...t }, r) => /* @__PURE__ */ i(
|
|
265
|
+
"div",
|
|
266
|
+
{
|
|
267
|
+
ref: r,
|
|
268
|
+
className: l(
|
|
269
|
+
// mt-2 + the header's gap-1 = the 12px title-block → filters gap.
|
|
270
|
+
// justify-self-stretch keeps the full width under align="center".
|
|
271
|
+
"col-span-full mt-2 flex flex-wrap items-center gap-2 justify-self-stretch",
|
|
272
|
+
"[&>[data-slot=data-table-search]]:max-w-90 [&>[data-slot=data-table-search]]:min-w-0 [&>[data-slot=input-group]]:max-w-90 [&>[data-slot=input-group]]:min-w-0 [&>[data-slot=input]]:max-w-90 [&>[data-slot=input]]:min-w-0",
|
|
273
|
+
// Select/combobox triggers are w-full for form layouts; in a filter
|
|
274
|
+
// row they hug their value instead.
|
|
275
|
+
"[&>[data-slot=combobox-trigger]]:w-fit [&>[data-slot=select-trigger]]:w-fit",
|
|
276
|
+
e
|
|
277
|
+
),
|
|
278
|
+
"data-hook": a,
|
|
279
|
+
"data-slot": "card-toolbar",
|
|
280
|
+
...t
|
|
281
|
+
}
|
|
282
|
+
)
|
|
283
|
+
);
|
|
284
|
+
z.displayName = "CardToolbar";
|
|
219
285
|
const E = s.forwardRef(
|
|
220
|
-
({ className: e,
|
|
221
|
-
|
|
222
|
-
|
|
286
|
+
({ className: e, value: a, trend: t, dataHook: r, ...o }, n) => /* @__PURE__ */ w(
|
|
287
|
+
"div",
|
|
288
|
+
{
|
|
289
|
+
ref: n,
|
|
290
|
+
className: l(
|
|
291
|
+
"col-start-2 row-span-2 row-start-1 flex items-baseline gap-2 self-center justify-self-end",
|
|
292
|
+
e
|
|
293
|
+
),
|
|
294
|
+
"data-hook": r,
|
|
295
|
+
"data-slot": "card-metric",
|
|
296
|
+
...o,
|
|
297
|
+
children: [
|
|
298
|
+
/* @__PURE__ */ i("span", { className: "text-metric", "data-slot": "card-metric-value", children: a }),
|
|
299
|
+
t
|
|
300
|
+
]
|
|
301
|
+
}
|
|
302
|
+
)
|
|
303
|
+
);
|
|
304
|
+
E.displayName = "CardMetric";
|
|
305
|
+
const S = s.forwardRef(
|
|
306
|
+
({ className: e, dataHook: a, ...t }, r) => {
|
|
307
|
+
const { flush: o, density: n } = s.useContext(u);
|
|
308
|
+
return /* @__PURE__ */ i(
|
|
223
309
|
"div",
|
|
224
310
|
{
|
|
225
311
|
ref: r,
|
|
226
312
|
className: l(
|
|
227
313
|
"flex items-center",
|
|
228
|
-
|
|
314
|
+
p(o, n),
|
|
315
|
+
n === "data" && "pt-6",
|
|
229
316
|
e
|
|
230
317
|
),
|
|
231
|
-
"data-hook":
|
|
318
|
+
"data-hook": a,
|
|
232
319
|
"data-slot": "card-footer",
|
|
233
|
-
...
|
|
320
|
+
...t
|
|
234
321
|
}
|
|
235
322
|
);
|
|
236
323
|
}
|
|
237
324
|
);
|
|
238
|
-
|
|
325
|
+
S.displayName = "CardFooter";
|
|
239
326
|
export {
|
|
240
327
|
N as Card,
|
|
241
328
|
H as CardAction,
|
|
242
|
-
|
|
329
|
+
_ as CardContent,
|
|
243
330
|
D as CardDescription,
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
331
|
+
S as CardFooter,
|
|
332
|
+
R as CardHeader,
|
|
333
|
+
M as CardMedia,
|
|
334
|
+
E as CardMetric,
|
|
335
|
+
j as CardTitle,
|
|
336
|
+
z as CardToolbar
|
|
248
337
|
};
|
package/dist/chart.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),J=require("react"),c=require("recharts"),$=require("@radix-ui/react-slot"),Q=require("class-variance-authority"),x=require("@brightlocal/ui-components/lib/utils");function z(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const l in e)if(l!=="default"){const t=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(r,l,t.get?t:{enumerable:!0,get:()=>e[l]})}}return r.default=e,Object.freeze(r)}const v=z(J),k=z(c),O=v.createContext(null);function A(){const e=v.useContext(O);if(!e)throw new Error("useChart must be used within a <ChartContainer />");return e}function U(){return v.useContext(O)}const T=v.forwardRef(({id:e,className:r,children:l,config:t,dataHook:a,width:o,height:i,minWidth:d,minHeight:s,maxHeight:g,trackingEl:f,trackingLabel:b,...m},j)=>{const y=v.useId(),p=`chart-${e||y.replace(/:/g,"")}`;return n.jsx(O.Provider,{value:{config:t},children:n.jsxs("div",{ref:j,className:x.cn("[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-polar-radius-axis-tick-value]:fill-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-pie-sector]:stroke-background text-body-xs flex aspect-video justify-center [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-pie-sector]:stroke-2 [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none [&_svg_g]:outline-none [&_svg_g]:focus:outline-none",r),"data-chart":p,"data-hook":a,"data-slot":"chart-container","data-tracking-el":f,"data-tracking-label":b,...m,children:[n.jsx(I,{config:t,id:p}),n.jsx(k.ResponsiveContainer,{height:i??"100%",initialDimension:{width:1,height:1},maxHeight:g,minHeight:s,minWidth:d??0,width:o??"100%",children:l})]})})});T.displayName="ChartContainer";function I({id:e,config:r}){const l=Object.entries(r).filter(([,t])=>t.theme||t.color);return l.length?n.jsx("style",{dangerouslySetInnerHTML:{__html:l.map(([t,a])=>{const o=typeof a.color=="string"?a.color.replace(/^hsl\((.*)\)$/,"$1"):null;return o?`
|
|
2
2
|
[data-chart=${e}] {
|
|
3
3
|
--color-${t}: ${o};
|
|
4
4
|
}
|
|
5
|
-
`:
|
|
5
|
+
`:a.theme?Object.entries(a.theme).map(([i,d])=>`
|
|
6
6
|
.${i} [data-chart=${e}] {
|
|
7
7
|
--color-${t}: ${d.replace(/^hsl\((.*)\)$/,"$1")};
|
|
8
8
|
}
|
|
9
9
|
`).join(""):""}).join(`
|
|
10
|
-
`)}}):null}function O(e){return e==null||e===""?!1:typeof e=="number"?Number.isFinite(e):!0}function w({...e}){return a.jsx(P.Tooltip,{...e})}w.displayName="ChartTooltip";function A({active:e,payload:r,className:l,indicator:t="dot",hideLabel:n=!1,hideIndicator:o=!1,label:i,labelFormatter:d,labelClassName:c,formatter:h,color:f,nameKey:m,labelKey:g}){const{config:C}=R(),x=y.useMemo(()=>{if(n||!r?.length)return null;const[u]=r;if(!u)return null;const L=`${g||u.dataKey||u.name||"value"}`,v=C[L],j=!g&&typeof i=="string"?C[i]?.label||i:v?.label;return d?a.jsx("div",{className:b.cn("font-medium",c),children:d(j,r)}):j?a.jsx("div",{className:b.cn("font-medium",c),children:j}):null},[i,d,r,n,c,C,g]);if(!e||!r?.length)return null;const p=r.length===1&&t!=="dot";return a.jsxs("div",{className:b.cn("border-border/50 bg-background text-body-xs grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 shadow-xl",l),"data-slot":"chart-tooltip-content",children:[p?null:x,a.jsx("div",{className:"grid gap-1.5",children:r.map((u,L)=>{const v=`${m||u.name||u.dataKey||"value"}`,j=C[v],k=f||u.color||u.payload.fill||`var(--color-${v})`;return a.jsx("div",{className:b.cn("[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2",t==="dot"&&"items-center"),"data-slot":"chart-tooltip-item",children:h&&O(u.value)&&u.name?h(u.value,u.name,u,L,r):a.jsxs(a.Fragment,{children:[j?.icon&&!o?a.jsx(j.icon,{size:10}):!o&&a.jsx("div",{className:b.cn("shrink-0 rounded-[2px]",{"h-2.5 w-2.5":t==="dot","w-1":t==="line","w-0 border-[1.5px] border-dashed bg-transparent":t==="dashed","my-0.5":p&&t==="dashed"}),style:{backgroundColor:t==="dashed"?"transparent":k,borderColor:k}}),a.jsxs("div",{className:b.cn("flex flex-1 justify-between gap-2 leading-none",p?"items-end":"items-center"),children:[a.jsxs("div",{className:"grid gap-1.5",children:[p?x:null,a.jsx("span",{className:"text-muted-foreground","data-slot":"chart-tooltip-item-name",children:j?.label||u.name})]}),O(u.value)&&a.jsx("span",{className:"text-foreground tabular-nums","data-slot":"chart-tooltip-item-value",children:typeof u.value=="number"?u.value.toLocaleString():u.value})]})]})},u.dataKey)})})]})}A.displayName="ChartTooltipContent";function T({...e}){return a.jsx(P.Legend,{...e})}T.displayName="ChartLegend";function D({className:e,hideIcon:r=!1,payload:l,verticalAlign:t="bottom",nameKey:n}){const{config:o}=R();return l?.length?a.jsx("div",{className:b.cn("flex items-center justify-center gap-4",t==="top"?"pb-4":"pt-4",e),"data-slot":"chart-legend-content",children:l.map(i=>{const d=`${n||i.dataKey||"value"}`,c=o[d];return a.jsxs("div",{className:b.cn("[&>svg]:text-muted-foreground flex items-center gap-1.5"),children:[c?.icon&&!r?a.jsx(c.icon,{size:12}):a.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:i.color}}),c?.label||i.value]},i.value)})}):null}D.displayName="ChartLegendContent";function G({colorKey:e,color:r,fill:l,stroke:t,payload:n}){return(e&&typeof n?.[e]=="string"?n[e]:void 0)??r??l??t??"currentColor"}function W({size:e=8,custom:r=!1,color:l,colorKey:t,cx:n,cy:o,stroke:i,fill:d,payload:c}){if(n==null||o==null)return null;const h=G({colorKey:t,color:l,fill:d,stroke:i,payload:c});return a.jsx("circle",{className:r?"fill-background":void 0,cx:n,cy:o,"data-slot":"chart-dot",fill:r?void 0:h,r:e/2,stroke:r?h:"none",strokeWidth:r?2:void 0})}W.displayName="ChartDot";function B({size:e=6,color:r,colorKey:l,cx:t,cy:n,stroke:o,fill:i,payload:d}){if(t==null||n==null)return null;const c=G({colorKey:l,color:r,fill:i,stroke:o,payload:d});return a.jsx("circle",{className:"stroke-background",cx:t,cy:n,"data-slot":"chart-dot-on-stroke",fill:c,r:e/2,strokeWidth:2})}B.displayName="ChartDotOnStroke";function M({type:e="default",filled:r=!1,fillColor:l="var(--chart-teal)",fillOpacity:t=.2,boundaryOnly:n=!1,radialLines:o,className:i,...d}){const c=e==="circle"?"circle":"polygon",f=n?`[&_.${c==="circle"?"recharts-polar-grid-concentric-circle":"recharts-polar-grid-concentric-polygon"}:not(:last-of-type)]:stroke-transparent`:void 0;return r?a.jsx(P.PolarGrid,{className:b.cn(f,i),fill:l,fillOpacity:t,gridType:c,radialLines:o??!1,stroke:"none",...d}):a.jsx(P.PolarGrid,{className:b.cn(f,i),gridType:c,radialLines:o,...d})}M.displayName="ChartRadarGrid";function z({type:e="default",data:r,primaryKey:l,secondaryKey:t,x:n,y:o,textAnchor:i,payload:d,index:c}){const h=r!=null&&c!=null?r[c]:void 0,f=h&&l!=null?h[l]:void 0,m=h&&t!=null?h[t]:void 0,g=e==="default"&&f!=null?m!=null?`${String(f)}/${String(m)}`:String(f):null;return a.jsxs("text",{className:"text-body-xs","data-slot":"chart-radar-label-wrapper",textAnchor:i,x:n,y:o,children:[g!=null&&a.jsx("tspan",{className:"fill-card-foreground",dy:"-0.5em",x:n,children:g}),a.jsx("tspan",{className:"fill-muted-foreground",dy:g!=null?"1.2em":void 0,x:n,children:d?.value})]})}z.displayName="ChartRadarLabelWrapper";function q({nameKey:e,config:r,radiusRatio:l=.5,cx:t,cy:n,midAngle:o=0,innerRadius:i=0,outerRadius:d=0,payload:c,name:h}){if(t==null||n==null)return null;const f=Math.PI/180,m=i+(d-i)*l,g=t+m*Math.cos(-o*f),C=n+m*Math.sin(-o*f),x=e!=null&&c!=null?c[e]:void 0,p=x!=null?String(x):h,u=p!=null?r?.[p]?.label??p:p;return a.jsx("text",{className:"fill-foreground text-body-xs","data-slot":"chart-pie-label-list",dominantBaseline:"middle",textAnchor:"middle",x:g,y:C,children:u})}q.displayName="ChartPieLabelList";function I({valueKey:e,x:r,y:l,textAnchor:t,payload:n,value:o}){if(r==null||l==null)return null;const i=e!=null&&n!=null?n[e]:o;return a.jsx("text",{className:"fill-foreground text-body-xs","data-slot":"chart-pie-label-wrapper",dominantBaseline:"middle",textAnchor:t,x:r,y:l,children:i})}I.displayName="ChartPieLabelWrapper";const Y={"2xl":"text-metric","3xl":"font-sans text-3xl font-semibold","4xl":"font-sans text-4xl font-semibold"};function V({primary:e,secondary:r,size:l="3xl",viewBox:t}){if(t==null||typeof t!="object"||!("cx"in t)||!("cy"in t))return null;const{cx:n,cy:o}=t;return a.jsxs("text",{"data-slot":"chart-center-label",dominantBaseline:"middle",textAnchor:"middle",x:n,y:o,children:[a.jsx("tspan",{className:b.cn("fill-foreground",Y[l]),x:n,y:o,children:e}),r!=null&&a.jsx("tspan",{className:"fill-muted-foreground text-body-xs",x:n,y:o+24,children:r})]})}V.displayName="ChartCenterLabel";Object.defineProperty(exports,"Area",{enumerable:!0,get:()=>s.Area});Object.defineProperty(exports,"AreaChart",{enumerable:!0,get:()=>s.AreaChart});Object.defineProperty(exports,"Bar",{enumerable:!0,get:()=>s.Bar});Object.defineProperty(exports,"BarChart",{enumerable:!0,get:()=>s.BarChart});Object.defineProperty(exports,"CartesianGrid",{enumerable:!0,get:()=>s.CartesianGrid});Object.defineProperty(exports,"Cell",{enumerable:!0,get:()=>s.Cell});Object.defineProperty(exports,"ChartLabel",{enumerable:!0,get:()=>s.Label});Object.defineProperty(exports,"ChartsLegend",{enumerable:!0,get:()=>s.Legend});Object.defineProperty(exports,"ChartsTooltip",{enumerable:!0,get:()=>s.Tooltip});Object.defineProperty(exports,"Customized",{enumerable:!0,get:()=>s.Customized});Object.defineProperty(exports,"LabelList",{enumerable:!0,get:()=>s.LabelList});Object.defineProperty(exports,"Line",{enumerable:!0,get:()=>s.Line});Object.defineProperty(exports,"LineChart",{enumerable:!0,get:()=>s.LineChart});Object.defineProperty(exports,"Pie",{enumerable:!0,get:()=>s.Pie});Object.defineProperty(exports,"PieChart",{enumerable:!0,get:()=>s.PieChart});Object.defineProperty(exports,"PolarAngleAxis",{enumerable:!0,get:()=>s.PolarAngleAxis});Object.defineProperty(exports,"PolarGrid",{enumerable:!0,get:()=>s.PolarGrid});Object.defineProperty(exports,"PolarRadiusAxis",{enumerable:!0,get:()=>s.PolarRadiusAxis});Object.defineProperty(exports,"Radar",{enumerable:!0,get:()=>s.Radar});Object.defineProperty(exports,"RadarChart",{enumerable:!0,get:()=>s.RadarChart});Object.defineProperty(exports,"RadialBar",{enumerable:!0,get:()=>s.RadialBar});Object.defineProperty(exports,"RadialBarChart",{enumerable:!0,get:()=>s.RadialBarChart});Object.defineProperty(exports,"Rectangle",{enumerable:!0,get:()=>s.Rectangle});Object.defineProperty(exports,"ReferenceLine",{enumerable:!0,get:()=>s.ReferenceLine});Object.defineProperty(exports,"ResponsiveContainer",{enumerable:!0,get:()=>s.ResponsiveContainer});Object.defineProperty(exports,"Sector",{enumerable:!0,get:()=>s.Sector});Object.defineProperty(exports,"XAxis",{enumerable:!0,get:()=>s.XAxis});Object.defineProperty(exports,"YAxis",{enumerable:!0,get:()=>s.YAxis});exports.ChartCenterLabel=V;exports.ChartContainer=$;exports.ChartDot=W;exports.ChartDotOnStroke=B;exports.ChartLegend=T;exports.ChartLegendContent=D;exports.ChartPieLabelList=q;exports.ChartPieLabelWrapper=I;exports.ChartRadarGrid=M;exports.ChartRadarLabelWrapper=z;exports.ChartStyle=S;exports.ChartTooltip=w;exports.ChartTooltipContent=A;
|
|
10
|
+
`)}}):null}function w(e){return e==null||e===""?!1:typeof e=="number"?Number.isFinite(e):!0}function D({...e}){return n.jsx(k.Tooltip,{...e})}D.displayName="ChartTooltip";function G({active:e,payload:r,className:l,indicator:t="dot",hideLabel:a=!1,hideIndicator:o=!1,label:i,labelFormatter:d,labelClassName:s,formatter:g,color:f,nameKey:b,labelKey:m}){const{config:j}=A(),y=v.useMemo(()=>{if(a||!r?.length)return null;const[u]=r;if(!u)return null;const P=`${m||u.dataKey||u.name||"value"}`,h=j[P],C=!m&&typeof i=="string"?j[i]?.label||i:h?.label;return d?n.jsx("div",{className:x.cn("font-medium",s),children:d(C,r)}):C?n.jsx("div",{className:x.cn("font-medium",s),children:C}):null},[i,d,r,a,s,j,m]);if(!e||!r?.length)return null;const p=r.length===1&&t!=="dot";return n.jsxs("div",{className:x.cn("border-border/50 bg-background text-body-xs grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 shadow-xl",l),"data-slot":"chart-tooltip-content",children:[p?null:y,n.jsx("div",{className:"grid gap-1.5",children:r.map((u,P)=>{const h=`${b||u.name||u.dataKey||"value"}`,C=j[h],L=f||u.color||u.payload.fill||`var(--color-${h})`;return n.jsx("div",{className:x.cn("[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2",t==="dot"&&"items-center"),"data-slot":"chart-tooltip-item",children:g&&w(u.value)&&u.name?g(u.value,u.name,u,P,r):n.jsxs(n.Fragment,{children:[C?.icon&&!o?n.jsx(C.icon,{size:10}):!o&&n.jsx("div",{className:x.cn("shrink-0 rounded-[2px]",{"h-2.5 w-2.5":t==="dot","w-1":t==="line","w-0 border-[1.5px] border-dashed bg-transparent":t==="dashed","my-0.5":p&&t==="dashed"}),style:{backgroundColor:t==="dashed"?"transparent":L,borderColor:L}}),n.jsxs("div",{className:x.cn("flex flex-1 justify-between gap-2 leading-none",p?"items-end":"items-center"),children:[n.jsxs("div",{className:"grid gap-1.5",children:[p?y:null,n.jsx("span",{className:"text-muted-foreground","data-slot":"chart-tooltip-item-name",children:C?.label||u.name})]}),w(u.value)&&n.jsx("span",{className:"text-foreground tabular-nums","data-slot":"chart-tooltip-item-value",children:typeof u.value=="number"?u.value.toLocaleString():u.value})]})]})},u.dataKey)})})]})}G.displayName="ChartTooltipContent";function V({...e}){return n.jsx(k.Legend,{...e})}V.displayName="ChartLegend";const _=v.forwardRef(({asChild:e=!1,children:r,className:l,color:t,dataHook:a,hidden:o=!1,hideIcon:i=!1,muted:d=!1,seriesKey:s,trackingEl:g,trackingLabel:f,value:b,...m},j)=>{const y=U(),p=s?y?.config[s]:void 0,u=t??p?.color??(s?`var(--color-${s})`:void 0),P=!!s&&!t&&(!y||!!y.standalone&&!p?.color);v.useEffect(()=>{process.env.NODE_ENV!=="production"&&P&&console.warn(`ChartLegendItem: seriesKey="${s}" has no colour to resolve — render it inside a ChartContainer, give the ChartLegendList config a \`color\` for this key (a \`theme\` only resolves inside a container), or set \`color\`.`)},[s,P]);const h=e?$.Slot:"div",C=r??p?.label??s;return n.jsxs(h,{ref:j,className:x.cn("[&>svg]:text-muted-foreground focus-visible:shadow-default flex items-center gap-1.5 rounded-sm outline-none group-data-[size=md]/legend:gap-2 [&>svg]:size-3 group-data-[size=md]/legend:[&>svg]:size-3.5",(d||o)&&"text-muted-foreground",o&&"line-through [&_:is(button,a)]:line-through",l),"data-hidden":o||void 0,"data-hook":a,"data-muted":d||o||void 0,"data-slot":"chart-legend-item","data-tracking-el":g,"data-tracking-label":f,...m,children:[p?.icon&&!i?n.jsx(p.icon,{size:12}):n.jsx("span",{"aria-hidden":"true",className:x.cn("duration-fast block size-2 shrink-0 rounded-[2px] transition-opacity ease-out group-data-[size=md]/legend:size-2.5",(d||o)&&"opacity-40"),"data-slot":"chart-legend-item-swatch",style:{backgroundColor:u}}),n.jsx($.Slottable,{children:C}),b!=null&&n.jsx("span",{className:"ml-auto pl-0.5 tabular-nums","data-slot":"chart-legend-item-value",children:n.jsx("span",{className:"inline-block",children:b})})]})});_.displayName="ChartLegendItem";const Z=Q.cva("group/legend flex",{variants:{size:{sm:"text-body-xs",md:"text-body-sm"},orientation:{horizontal:"flex-wrap items-center justify-center gap-x-4 gap-y-1",vertical:"flex-col items-stretch gap-3"}},defaultVariants:{orientation:"horizontal",size:"sm"}}),R=v.forwardRef(({ariaLabel:e,children:r,className:l,config:t,dataHook:a,orientation:o="horizontal",size:i="sm",trackingEl:d,trackingLabel:s,...g},f)=>{const b=v.useMemo(()=>t?{config:t,standalone:!0}:null,[t]),m=n.jsx("div",{ref:f,"aria-label":e??"Chart legend",className:x.cn(Z({orientation:o,size:i}),l),"data-hook":a,"data-orientation":o,"data-size":i,"data-slot":"chart-legend-list","data-tracking-el":d,"data-tracking-label":s,role:"group",...g,children:r});return b?n.jsx(O.Provider,{value:b,children:m}):m});R.displayName="ChartLegendList";const K=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");function W({ariaLabel:e,className:r,dataHook:l="chart-legend",hideIcon:t=!1,nameKey:a,orientation:o="horizontal",payload:i,renderItem:d,showValue:s=!1,size:g="sm",sortBy:f,valueFormatter:b,valueKey:m,verticalAlign:j="bottom"}){const{config:y}=A();if(!i?.length)return null;const p=h=>String(h.dataKey??(a?h.payload?.[a]:void 0)??h.value),u=h=>{const C=Array.isArray(f)?f.indexOf(p(h)):-1;return C===-1?Number.POSITIVE_INFINITY:C},P=f?[...i].sort(Array.isArray(f)?(h,C)=>{const L=u(h),N=u(C);return L===N?0:L-N}:f):i;return n.jsx(R,{ariaLabel:e,className:x.cn(j==="top"&&"pb-4",j==="bottom"&&"pt-4",r),"data-slot":"chart-legend-content",dataHook:l,orientation:o,size:g,children:P.map(h=>{const C=p(h),L=y[C],N=s?b?b(h):h.payload?.[m??h.dataKey??"value"]:void 0,S=n.jsx(_,{color:h.color,dataHook:`${l}-${K(C)}`,hideIcon:t,seriesKey:C,value:N,children:L?.label||h.value},h.value);return d?n.jsx(v.Fragment,{children:d(h,S)},h.value):S})})}W.displayName="ChartLegendContent";function M({colorKey:e,color:r,fill:l,stroke:t,payload:a}){return(e&&typeof a?.[e]=="string"?a[e]:void 0)??r??l??t??"currentColor"}function q({size:e=8,custom:r=!1,color:l,colorKey:t,cx:a,cy:o,stroke:i,fill:d,payload:s}){if(a==null||o==null)return null;const g=M({colorKey:t,color:l,fill:d,stroke:i,payload:s});return n.jsx("circle",{className:r?"fill-background":void 0,cx:a,cy:o,"data-slot":"chart-dot",fill:r?void 0:g,r:e/2,stroke:r?g:"none",strokeWidth:r?2:void 0})}q.displayName="ChartDot";function E({size:e=6,color:r,colorKey:l,cx:t,cy:a,stroke:o,fill:i,payload:d}){if(t==null||a==null)return null;const s=M({colorKey:l,color:r,fill:i,stroke:o,payload:d});return n.jsx("circle",{className:"stroke-background",cx:t,cy:a,"data-slot":"chart-dot-on-stroke",fill:s,r:e/2,strokeWidth:2})}E.displayName="ChartDotOnStroke";function B({type:e="default",filled:r=!1,fillColor:l="var(--chart-teal)",fillOpacity:t=.2,boundaryOnly:a=!1,radialLines:o,className:i,...d}){const s=e==="circle"?"circle":"polygon",f=a?`[&_.${s==="circle"?"recharts-polar-grid-concentric-circle":"recharts-polar-grid-concentric-polygon"}:not(:last-of-type)]:stroke-transparent`:void 0;return r?n.jsx(k.PolarGrid,{className:x.cn(f,i),fill:l,fillOpacity:t,gridType:s,radialLines:o??!1,stroke:"none",...d}):n.jsx(k.PolarGrid,{className:x.cn(f,i),gridType:s,radialLines:o,...d})}B.displayName="ChartRadarGrid";function Y({type:e="default",data:r,primaryKey:l,secondaryKey:t,x:a,y:o,textAnchor:i,payload:d,index:s}){const g=r!=null&&s!=null?r[s]:void 0,f=g&&l!=null?g[l]:void 0,b=g&&t!=null?g[t]:void 0,m=e==="default"&&f!=null?b!=null?`${String(f)}/${String(b)}`:String(f):null;return n.jsxs("text",{className:"text-body-xs","data-slot":"chart-radar-label-wrapper",textAnchor:i,x:a,y:o,children:[m!=null&&n.jsx("tspan",{className:"fill-card-foreground",dy:"-0.5em",x:a,children:m}),n.jsx("tspan",{className:"fill-muted-foreground",dy:m!=null?"1.2em":void 0,x:a,children:d?.value})]})}Y.displayName="ChartRadarLabelWrapper";function X({nameKey:e,config:r,radiusRatio:l=.5,cx:t,cy:a,midAngle:o=0,innerRadius:i=0,outerRadius:d=0,payload:s,name:g}){if(t==null||a==null)return null;const f=Math.PI/180,b=i+(d-i)*l,m=t+b*Math.cos(-o*f),j=a+b*Math.sin(-o*f),y=e!=null&&s!=null?s[e]:void 0,p=y!=null?String(y):g,u=p!=null?r?.[p]?.label??p:p;return n.jsx("text",{className:"fill-foreground text-body-xs","data-slot":"chart-pie-label-list",dominantBaseline:"middle",textAnchor:"middle",x:m,y:j,children:u})}X.displayName="ChartPieLabelList";function F({valueKey:e,x:r,y:l,textAnchor:t,payload:a,value:o}){if(r==null||l==null)return null;const i=e!=null&&a!=null?a[e]:o;return n.jsx("text",{className:"fill-foreground text-body-xs","data-slot":"chart-pie-label-wrapper",dominantBaseline:"middle",textAnchor:t,x:r,y:l,children:i})}F.displayName="ChartPieLabelWrapper";const ee={"2xl":"text-metric","3xl":"font-sans text-3xl font-semibold","4xl":"font-sans text-4xl font-semibold"};function H({primary:e,secondary:r,size:l="3xl",viewBox:t}){if(t==null||typeof t!="object"||!("cx"in t)||!("cy"in t))return null;const{cx:a,cy:o}=t;return n.jsxs("text",{"data-slot":"chart-center-label",dominantBaseline:"middle",textAnchor:"middle",x:a,y:o,children:[n.jsx("tspan",{className:x.cn("fill-foreground",ee[l]),x:a,y:o,children:e}),r!=null&&n.jsx("tspan",{className:"fill-muted-foreground text-body-xs",x:a,y:o+24,children:r})]})}H.displayName="ChartCenterLabel";Object.defineProperty(exports,"Area",{enumerable:!0,get:()=>c.Area});Object.defineProperty(exports,"AreaChart",{enumerable:!0,get:()=>c.AreaChart});Object.defineProperty(exports,"Bar",{enumerable:!0,get:()=>c.Bar});Object.defineProperty(exports,"BarChart",{enumerable:!0,get:()=>c.BarChart});Object.defineProperty(exports,"CartesianGrid",{enumerable:!0,get:()=>c.CartesianGrid});Object.defineProperty(exports,"Cell",{enumerable:!0,get:()=>c.Cell});Object.defineProperty(exports,"ChartLabel",{enumerable:!0,get:()=>c.Label});Object.defineProperty(exports,"ChartsLegend",{enumerable:!0,get:()=>c.Legend});Object.defineProperty(exports,"ChartsTooltip",{enumerable:!0,get:()=>c.Tooltip});Object.defineProperty(exports,"Customized",{enumerable:!0,get:()=>c.Customized});Object.defineProperty(exports,"LabelList",{enumerable:!0,get:()=>c.LabelList});Object.defineProperty(exports,"Line",{enumerable:!0,get:()=>c.Line});Object.defineProperty(exports,"LineChart",{enumerable:!0,get:()=>c.LineChart});Object.defineProperty(exports,"Pie",{enumerable:!0,get:()=>c.Pie});Object.defineProperty(exports,"PieChart",{enumerable:!0,get:()=>c.PieChart});Object.defineProperty(exports,"PolarAngleAxis",{enumerable:!0,get:()=>c.PolarAngleAxis});Object.defineProperty(exports,"PolarGrid",{enumerable:!0,get:()=>c.PolarGrid});Object.defineProperty(exports,"PolarRadiusAxis",{enumerable:!0,get:()=>c.PolarRadiusAxis});Object.defineProperty(exports,"Radar",{enumerable:!0,get:()=>c.Radar});Object.defineProperty(exports,"RadarChart",{enumerable:!0,get:()=>c.RadarChart});Object.defineProperty(exports,"RadialBar",{enumerable:!0,get:()=>c.RadialBar});Object.defineProperty(exports,"RadialBarChart",{enumerable:!0,get:()=>c.RadialBarChart});Object.defineProperty(exports,"Rectangle",{enumerable:!0,get:()=>c.Rectangle});Object.defineProperty(exports,"ReferenceLine",{enumerable:!0,get:()=>c.ReferenceLine});Object.defineProperty(exports,"ResponsiveContainer",{enumerable:!0,get:()=>c.ResponsiveContainer});Object.defineProperty(exports,"Sector",{enumerable:!0,get:()=>c.Sector});Object.defineProperty(exports,"XAxis",{enumerable:!0,get:()=>c.XAxis});Object.defineProperty(exports,"YAxis",{enumerable:!0,get:()=>c.YAxis});exports.ChartCenterLabel=H;exports.ChartContainer=T;exports.ChartDot=q;exports.ChartDotOnStroke=E;exports.ChartLegend=V;exports.ChartLegendContent=W;exports.ChartLegendItem=_;exports.ChartLegendList=R;exports.ChartPieLabelList=X;exports.ChartPieLabelWrapper=F;exports.ChartRadarGrid=B;exports.ChartRadarLabelWrapper=Y;exports.ChartStyle=I;exports.ChartTooltip=D;exports.ChartTooltipContent=G;
|