@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.
Files changed (176) hide show
  1. package/README.md +6 -1
  2. package/component-meta.json +663 -38
  3. package/deprecations.json +1 -1
  4. package/dist/alert-dialog.cjs +1 -1
  5. package/dist/alert-dialog.d.ts +32 -3
  6. package/dist/alert-dialog.d.ts.map +1 -1
  7. package/dist/alert-dialog.js +61 -58
  8. package/dist/alert.cjs +1 -1
  9. package/dist/alert.d.ts.map +1 -1
  10. package/dist/alert.js +58 -57
  11. package/dist/badge.cjs +1 -1
  12. package/dist/badge.d.ts +9 -0
  13. package/dist/badge.d.ts.map +1 -1
  14. package/dist/badge.js +50 -30
  15. package/dist/banner.cjs +1 -0
  16. package/dist/banner.d.ts +81 -0
  17. package/dist/banner.d.ts.map +1 -0
  18. package/dist/banner.js +176 -0
  19. package/dist/blocks/empty-state.cjs +1 -1
  20. package/dist/blocks/empty-state.d.ts +4 -3
  21. package/dist/blocks/empty-state.d.ts.map +1 -1
  22. package/dist/blocks/empty-state.js +21 -20
  23. package/dist/blocks/progress-state.d.ts +2 -2
  24. package/dist/blocks/sidebar.cjs +1 -1
  25. package/dist/blocks/sidebar.d.ts +17 -0
  26. package/dist/blocks/sidebar.d.ts.map +1 -1
  27. package/dist/blocks/sidebar.js +8 -2
  28. package/dist/brand-illustration-motif.d.ts +1 -1
  29. package/dist/card.cjs +1 -1
  30. package/dist/card.d.ts +86 -6
  31. package/dist/card.d.ts.map +1 -1
  32. package/dist/card.js +185 -96
  33. package/dist/chart.cjs +3 -3
  34. package/dist/chart.d.ts +231 -13
  35. package/dist/chart.d.ts.map +1 -1
  36. package/dist/chart.js +466 -306
  37. package/dist/checkbox.cjs +1 -1
  38. package/dist/checkbox.d.ts +1 -1
  39. package/dist/checkbox.d.ts.map +1 -1
  40. package/dist/checkbox.js +2 -1
  41. package/dist/combobox.cjs +1 -1
  42. package/dist/combobox.js +2 -2
  43. package/dist/command.cjs +1 -1
  44. package/dist/command.js +1 -1
  45. package/dist/data-table.cjs +1 -1
  46. package/dist/data-table.d.ts +169 -22
  47. package/dist/data-table.d.ts.map +1 -1
  48. package/dist/data-table.js +695 -561
  49. package/dist/grid.d.ts +24 -1
  50. package/dist/grid.d.ts.map +1 -1
  51. package/dist/hooks/use-breakpoint.cjs +1 -1
  52. package/dist/hooks/use-breakpoint.d.ts +1 -1
  53. package/dist/hooks/use-breakpoint.d.ts.map +1 -1
  54. package/dist/hooks/use-breakpoint.js +1 -0
  55. package/dist/index.cjs +1 -1
  56. package/dist/index.d.ts +5 -0
  57. package/dist/index.d.ts.map +1 -1
  58. package/dist/index.js +593 -561
  59. package/dist/info-tooltip.cjs +1 -0
  60. package/dist/info-tooltip.d.ts +39 -0
  61. package/dist/info-tooltip.d.ts.map +1 -0
  62. package/dist/info-tooltip.js +41 -0
  63. package/dist/input-chip.cjs +1 -1
  64. package/dist/input-chip.js +1 -1
  65. package/dist/input-group.cjs +1 -1
  66. package/dist/input-group.d.ts +33 -2
  67. package/dist/input-group.d.ts.map +1 -1
  68. package/dist/input-group.js +167 -54
  69. package/dist/input-otp.cjs +1 -1
  70. package/dist/input-otp.js +9 -9
  71. package/dist/input-password.cjs +1 -1
  72. package/dist/input-password.d.ts +28 -6
  73. package/dist/input-password.d.ts.map +1 -1
  74. package/dist/input-password.js +5 -5
  75. package/dist/input.cjs +1 -1
  76. package/dist/input.js +10 -10
  77. package/dist/lib/block-illustration.cjs +1 -1
  78. package/dist/lib/block-illustration.d.ts +4 -1
  79. package/dist/lib/block-illustration.d.ts.map +1 -1
  80. package/dist/lib/block-illustration.js +12 -11
  81. package/dist/lib/utils.cjs +1 -1
  82. package/dist/lib/utils.d.ts.map +1 -1
  83. package/dist/lib/utils.js +4 -3
  84. package/dist/list.cjs +1 -1
  85. package/dist/list.js +1 -1
  86. package/dist/multi-select-filter.cjs +1 -0
  87. package/dist/multi-select-filter.d.ts +178 -0
  88. package/dist/multi-select-filter.d.ts.map +1 -0
  89. package/dist/multi-select-filter.js +463 -0
  90. package/dist/progress.cjs +1 -1
  91. package/dist/progress.d.ts +123 -16
  92. package/dist/progress.d.ts.map +1 -1
  93. package/dist/progress.js +89 -75
  94. package/dist/rating.cjs +1 -1
  95. package/dist/rating.js +18 -18
  96. package/dist/relative-date.cjs +1 -0
  97. package/dist/relative-date.d.ts +65 -0
  98. package/dist/relative-date.d.ts.map +1 -0
  99. package/dist/relative-date.js +128 -0
  100. package/dist/select.cjs +2 -2
  101. package/dist/select.d.ts +11 -1
  102. package/dist/select.d.ts.map +1 -1
  103. package/dist/select.js +97 -81
  104. package/dist/sheet.cjs +1 -1
  105. package/dist/sheet.d.ts +78 -2
  106. package/dist/sheet.d.ts.map +1 -1
  107. package/dist/sheet.js +192 -85
  108. package/dist/single-select-filter.cjs +1 -0
  109. package/dist/single-select-filter.d.ts +81 -0
  110. package/dist/single-select-filter.d.ts.map +1 -0
  111. package/dist/single-select-filter.js +226 -0
  112. package/dist/sonner.cjs +1 -1
  113. package/dist/sonner.d.ts.map +1 -1
  114. package/dist/sonner.js +22 -22
  115. package/dist/split-layout.cjs +1 -1
  116. package/dist/split-layout.d.ts +1 -1
  117. package/dist/split-layout.js +13 -13
  118. package/dist/table.cjs +1 -1
  119. package/dist/table.d.ts +45 -4
  120. package/dist/table.d.ts.map +1 -1
  121. package/dist/table.js +90 -73
  122. package/dist/tabs.cjs +1 -1
  123. package/dist/tabs.d.ts +12 -1
  124. package/dist/tabs.d.ts.map +1 -1
  125. package/dist/tabs.js +148 -126
  126. package/dist/textarea.cjs +1 -1
  127. package/dist/textarea.js +1 -1
  128. package/dist/tooltip.cjs +1 -1
  129. package/dist/tooltip.d.ts +38 -36
  130. package/dist/tooltip.d.ts.map +1 -1
  131. package/dist/tooltip.js +262 -73
  132. package/dist/typography-text.d.ts +1 -2
  133. package/dist/typography-text.d.ts.map +1 -1
  134. package/dist/typography.d.ts +1 -1
  135. package/package.json +5 -6
  136. package/src/blocks/empty-state.tsx +8 -3
  137. package/src/blocks/progress-state.tsx +2 -2
  138. package/src/blocks/sidebar.tsx +26 -2
  139. package/src/components/alert-dialog.tsx +50 -5
  140. package/src/components/alert.tsx +16 -8
  141. package/src/components/badge.tsx +40 -3
  142. package/src/components/banner.tsx +288 -0
  143. package/src/components/brand-illustration-motif.tsx +1 -1
  144. package/src/components/card.tsx +211 -24
  145. package/src/components/chart.tsx +523 -35
  146. package/src/components/checkbox.tsx +1 -1
  147. package/src/components/combobox.tsx +2 -2
  148. package/src/components/command.tsx +1 -1
  149. package/src/components/data-table.tsx +778 -195
  150. package/src/components/grid.tsx +32 -1
  151. package/src/components/info-tooltip.tsx +94 -0
  152. package/src/components/input-chip.tsx +1 -1
  153. package/src/components/input-group.tsx +246 -11
  154. package/src/components/input-otp.tsx +1 -1
  155. package/src/components/input-password.tsx +33 -11
  156. package/src/components/input.tsx +1 -1
  157. package/src/components/list.tsx +1 -1
  158. package/src/components/multi-select-filter.tsx +912 -0
  159. package/src/components/progress.tsx +190 -31
  160. package/src/components/rating.tsx +1 -1
  161. package/src/components/relative-date.tsx +230 -0
  162. package/src/components/select.tsx +35 -5
  163. package/src/components/sheet.tsx +240 -4
  164. package/src/components/single-select-filter.tsx +443 -0
  165. package/src/components/sonner.tsx +16 -5
  166. package/src/components/split-layout.tsx +2 -2
  167. package/src/components/table.tsx +71 -11
  168. package/src/components/tabs.tsx +93 -46
  169. package/src/components/textarea.tsx +1 -1
  170. package/src/components/tooltip.tsx +440 -68
  171. package/src/components/typography-text.tsx +1 -2
  172. package/src/components/typography.tsx +1 -1
  173. package/src/hooks/use-breakpoint.ts +2 -1
  174. package/src/index.ts +5 -0
  175. package/src/lib/block-illustration.tsx +5 -1
  176. package/src/lib/utils.ts +1 -0
package/dist/card.js CHANGED
@@ -1,42 +1,53 @@
1
- import { jsx as n } from "react/jsx-runtime";
1
+ import { jsx as i, jsxs as w } from "react/jsx-runtime";
2
2
  import * as s from "react";
3
- import { Slot as y } from "@radix-ui/react-slot";
4
- import { cva as u } from "class-variance-authority";
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 f = s.createContext({ flush: !1, density: "default" });
7
- function m(e, t) {
8
- return !e && (t === "condensed" ? "px-3" : "px-section-md");
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 v = u(
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-card",
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
- border: [
30
- "bg-transparent",
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
- default: ["gap-8", "py-section-md"],
39
- condensed: ["gap-3", "py-3"]
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: t = "filled",
51
- density: a = "default",
61
+ variant: a = "filled",
62
+ density: t = "default",
52
63
  dataHook: r,
53
64
  trackingEl: o,
54
- trackingLabel: i,
65
+ trackingLabel: n,
55
66
  maxWidth: d,
56
- children: c,
57
- style: p,
58
- ...h
59
- }, x) => {
60
- const g = t === "transparent-flush";
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 C = d !== void 0 ? {
77
+ const x = d !== void 0 ? {
67
78
  maxWidth: typeof d == "number" ? `${d}px` : d
68
79
  } : void 0;
69
- return /* @__PURE__ */ n(f.Provider, { value: { flush: g, density: a }, children: /* @__PURE__ */ n(
80
+ return /* @__PURE__ */ i(u.Provider, { value: { flush: b, density: t, variant: a }, children: /* @__PURE__ */ i(
70
81
  "div",
71
82
  {
72
- ref: x,
73
- className: l(v({ variant: t, density: a }), e),
74
- "data-density": a,
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-${t}`,
78
- "data-tracking-label": i,
79
- style: { ...C, ...p },
80
- ...h,
81
- children: c
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 w = u(
88
- "@container/card-header grid auto-rows-min grid-rows-[auto_auto] gap-1.5 has-data-[slot=card-action]:grid-cols-[1fr_auto]",
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
- ), b = s.forwardRef(
102
- ({ className: e, align: t = "left", dataHook: a, ...r }, o) => {
103
- const { flush: i, density: d } = s.useContext(f);
104
- return /* @__PURE__ */ n(
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: o,
125
+ ref: d,
108
126
  className: l(
109
- w({ align: t }),
110
- m(i, d),
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-hook": a,
142
+ "data-divider": t ? "" : void 0,
143
+ "data-hook": o,
114
144
  "data-slot": "card-header",
115
- ...r
145
+ "data-sticky": r ? "" : void 0,
146
+ ...n
116
147
  }
117
148
  );
118
149
  }
119
150
  );
120
- b.displayName = "CardHeader";
121
- const k = u("", {
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
- }), R = s.forwardRef(
132
- ({ className: e, size: t = "default", level: a, asChild: r = !1, dataHook: o, ...i }, d) => {
133
- const c = {
134
- className: l(k({ size: t }), e),
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
- ...i
168
+ ...n
138
169
  };
139
170
  if (r)
140
- return /* @__PURE__ */ n(y, { ref: d, ...c });
141
- if (a) {
142
- const p = `h${a}`;
143
- return /* @__PURE__ */ n(p, { ref: d, ...c });
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__ */ n("div", { ref: d, ...c });
176
+ return /* @__PURE__ */ i("div", { ref: d, ...f });
146
177
  }
147
178
  );
148
- R.displayName = "CardTitle";
149
- const V = u("text-body-sm text-muted-foreground", {
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: t, dataHook: a, ...r }, o) => /* @__PURE__ */ n(
189
+ ({ className: e, align: a, dataHook: t, ...r }, o) => /* @__PURE__ */ i(
159
190
  "div",
160
191
  {
161
192
  ref: o,
162
- className: l(V({ align: t }), e),
163
- "data-hook": a,
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: t, ...a }, r) => /* @__PURE__ */ n(
202
+ ({ className: e, dataHook: a, ...t }, r) => /* @__PURE__ */ i(
172
203
  "div",
173
204
  {
174
205
  ref: r,
175
206
  className: l(
176
- "col-start-2 row-span-2 row-start-1 self-start justify-self-end",
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": t,
212
+ "data-hook": a,
180
213
  "data-slot": "card-action",
181
- ...a
214
+ ...t
182
215
  }
183
216
  )
184
217
  );
185
218
  H.displayName = "CardAction";
186
- const T = s.forwardRef(
187
- ({ className: e, children: t, dataHook: a, ...r }, o) => {
188
- const { flush: i, density: d } = s.useContext(f);
189
- return /* @__PURE__ */ n(
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(m(i, d), e),
194
- "data-hook": a,
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__ */ n("div", { className: "overflow-hidden rounded-md", "data-slot": "card-media-clip", children: t })
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
- T.displayName = "CardMedia";
203
- const j = s.forwardRef(
204
- ({ className: e, dataHook: t, ...a }, r) => {
205
- const { flush: o, density: i } = s.useContext(f);
206
- return /* @__PURE__ */ n(
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: r,
210
- className: l(m(o, i), e),
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
- ...a
257
+ ...r
214
258
  }
215
259
  );
216
260
  }
217
261
  );
218
- j.displayName = "CardContent";
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, dataHook: t, ...a }, r) => {
221
- const { flush: o, density: i } = s.useContext(f);
222
- return /* @__PURE__ */ n(
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
- m(o, i),
314
+ p(o, n),
315
+ n === "data" && "pt-6",
229
316
  e
230
317
  ),
231
- "data-hook": t,
318
+ "data-hook": a,
232
319
  "data-slot": "card-footer",
233
- ...a
320
+ ...t
234
321
  }
235
322
  );
236
323
  }
237
324
  );
238
- E.displayName = "CardFooter";
325
+ S.displayName = "CardFooter";
239
326
  export {
240
327
  N as Card,
241
328
  H as CardAction,
242
- j as CardContent,
329
+ _ as CardContent,
243
330
  D as CardDescription,
244
- E as CardFooter,
245
- b as CardHeader,
246
- T as CardMedia,
247
- R as CardTitle
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 a=require("react/jsx-runtime"),X=require("react"),s=require("recharts"),b=require("@brightlocal/ui-components/lib/utils");function N(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 y=N(X),P=N(s),_=y.createContext(null);function R(){const e=y.useContext(_);if(!e)throw new Error("useChart must be used within a <ChartContainer />");return e}const $=y.forwardRef(({id:e,className:r,children:l,config:t,dataHook:n,width:o,height:i,minWidth:d,minHeight:c,maxHeight:h,trackingEl:f,trackingLabel:m,...g},C)=>{const x=y.useId(),p=`chart-${e||x.replace(/:/g,"")}`;return a.jsx(_.Provider,{value:{config:t},children:a.jsxs("div",{ref:C,className:b.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":n,"data-slot":"chart-container","data-tracking-el":f,"data-tracking-label":m,...g,children:[a.jsx(S,{config:t,id:p}),a.jsx(P.ResponsiveContainer,{height:i??"100%",initialDimension:{width:1,height:1},maxHeight:h,minHeight:c,minWidth:d??0,width:o??"100%",children:l})]})})});$.displayName="ChartContainer";function S({id:e,config:r}){const l=Object.entries(r).filter(([,t])=>t.theme||t.color);return l.length?a.jsx("style",{dangerouslySetInnerHTML:{__html:l.map(([t,n])=>{const o=typeof n.color=="string"?n.color.replace(/^hsl\((.*)\)$/,"$1"):null;return o?`
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
- `:n.theme?Object.entries(n.theme).map(([i,d])=>`
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;