@brightlocal/ui-components 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (281) hide show
  1. package/dist/accordion.cjs +1 -1
  2. package/dist/accordion.d.ts +74 -4
  3. package/dist/accordion.d.ts.map +1 -1
  4. package/dist/accordion.js +100 -105
  5. package/dist/alert-dialog.cjs +1 -1
  6. package/dist/alert-dialog.d.ts +30 -10
  7. package/dist/alert-dialog.d.ts.map +1 -1
  8. package/dist/alert-dialog.js +129 -132
  9. package/dist/alert.cjs +1 -1
  10. package/dist/alert.d.ts +22 -1
  11. package/dist/alert.d.ts.map +1 -1
  12. package/dist/alert.js +1 -1
  13. package/dist/aspect-ratio.cjs +1 -1
  14. package/dist/aspect-ratio.d.ts +11 -1
  15. package/dist/aspect-ratio.d.ts.map +1 -1
  16. package/dist/aspect-ratio.js +16 -20
  17. package/dist/avatar.cjs +1 -1
  18. package/dist/avatar.d.ts +43 -3
  19. package/dist/avatar.d.ts.map +1 -1
  20. package/dist/avatar.js +18 -16
  21. package/dist/badge.cjs +1 -1
  22. package/dist/badge.d.ts +24 -9
  23. package/dist/badge.d.ts.map +1 -1
  24. package/dist/badge.js +34 -32
  25. package/dist/blocks/data-table.cjs +1 -1
  26. package/dist/blocks/data-table.d.ts.map +1 -1
  27. package/dist/blocks/data-table.js +177 -170
  28. package/dist/blocks/sidebar.cjs +1 -1
  29. package/dist/blocks/sidebar.d.ts +38 -307
  30. package/dist/blocks/sidebar.d.ts.map +1 -1
  31. package/dist/blocks/sidebar.js +411 -508
  32. package/dist/breadcrumb.cjs +1 -1
  33. package/dist/breadcrumb.d.ts +63 -8
  34. package/dist/breadcrumb.d.ts.map +1 -1
  35. package/dist/breadcrumb.js +97 -93
  36. package/dist/button.cjs +1 -1
  37. package/dist/button.d.ts +17 -45
  38. package/dist/button.d.ts.map +1 -1
  39. package/dist/button.js +49 -50
  40. package/dist/calendar.cjs +1 -1
  41. package/dist/calendar.d.ts +16 -1
  42. package/dist/calendar.d.ts.map +1 -1
  43. package/dist/calendar.js +31 -29
  44. package/dist/card.cjs +1 -1
  45. package/dist/card.d.ts +58 -18
  46. package/dist/card.d.ts.map +1 -1
  47. package/dist/card.js +60 -51
  48. package/dist/carousel.cjs +1 -1
  49. package/dist/carousel.d.ts +99 -9
  50. package/dist/carousel.d.ts.map +1 -1
  51. package/dist/carousel.js +142 -128
  52. package/dist/centred-layout.cjs +1 -1
  53. package/dist/centred-layout.d.ts +18 -15
  54. package/dist/centred-layout.d.ts.map +1 -1
  55. package/dist/centred-layout.js +44 -33
  56. package/dist/chart.cjs +4 -4
  57. package/dist/chart.d.ts +70 -7
  58. package/dist/chart.d.ts.map +1 -1
  59. package/dist/chart.js +71 -66
  60. package/dist/checkbox.cjs +1 -1
  61. package/dist/checkbox.d.ts +9 -5
  62. package/dist/checkbox.d.ts.map +1 -1
  63. package/dist/checkbox.js +61 -82
  64. package/dist/collapsible.cjs +1 -1
  65. package/dist/collapsible.d.ts +65 -8
  66. package/dist/collapsible.d.ts.map +1 -1
  67. package/dist/collapsible.js +41 -55
  68. package/dist/combobox.cjs +1 -1
  69. package/dist/combobox.d.ts +28 -18
  70. package/dist/combobox.d.ts.map +1 -1
  71. package/dist/combobox.js +191 -160
  72. package/dist/command.cjs +1 -1
  73. package/dist/command.d.ts +115 -9
  74. package/dist/command.d.ts.map +1 -1
  75. package/dist/command.js +176 -152
  76. package/dist/context-menu.cjs +1 -1
  77. package/dist/context-menu.d.ts +188 -20
  78. package/dist/context-menu.d.ts.map +1 -1
  79. package/dist/context-menu.js +120 -122
  80. package/dist/date-picker.cjs +1 -1
  81. package/dist/date-picker.d.ts +75 -9
  82. package/dist/date-picker.d.ts.map +1 -1
  83. package/dist/date-picker.js +221 -82
  84. package/dist/description.cjs +1 -0
  85. package/dist/description.d.ts +37 -0
  86. package/dist/description.d.ts.map +1 -0
  87. package/dist/description.js +25 -0
  88. package/dist/dialog.cjs +1 -1
  89. package/dist/dialog.d.ts +73 -9
  90. package/dist/dialog.d.ts.map +1 -1
  91. package/dist/dialog.js +103 -112
  92. package/dist/drawer.cjs +1 -1
  93. package/dist/drawer.d.ts +92 -0
  94. package/dist/drawer.d.ts.map +1 -1
  95. package/dist/drawer.js +67 -52
  96. package/dist/dropdown-menu.cjs +1 -1
  97. package/dist/dropdown-menu.d.ts +95 -11
  98. package/dist/dropdown-menu.d.ts.map +1 -1
  99. package/dist/dropdown-menu.js +146 -106
  100. package/dist/field.cjs +1 -1
  101. package/dist/field.d.ts +26 -6
  102. package/dist/field.d.ts.map +1 -1
  103. package/dist/field.js +55 -53
  104. package/dist/global-layout.cjs +1 -1
  105. package/dist/global-layout.d.ts +27 -17
  106. package/dist/global-layout.d.ts.map +1 -1
  107. package/dist/global-layout.js +86 -79
  108. package/dist/hover-card.cjs +1 -1
  109. package/dist/hover-card.d.ts +36 -6
  110. package/dist/hover-card.d.ts.map +1 -1
  111. package/dist/hover-card.js +44 -42
  112. package/dist/index.cjs +1 -1
  113. package/dist/index.d.ts +1 -1
  114. package/dist/index.d.ts.map +1 -1
  115. package/dist/index.js +367 -386
  116. package/dist/input-group.cjs +1 -1
  117. package/dist/input-group.d.ts +21 -2
  118. package/dist/input-group.d.ts.map +1 -1
  119. package/dist/input-group.js +51 -41
  120. package/dist/input-otp.cjs +1 -1
  121. package/dist/input-otp.js +1 -1
  122. package/dist/input-password.cjs +1 -1
  123. package/dist/input-password.d.ts.map +1 -1
  124. package/dist/input-password.js +25 -26
  125. package/dist/input.cjs +1 -1
  126. package/dist/input.d.ts +38 -24
  127. package/dist/input.d.ts.map +1 -1
  128. package/dist/input.js +68 -136
  129. package/dist/label.cjs +1 -1
  130. package/dist/label.d.ts +20 -1
  131. package/dist/label.d.ts.map +1 -1
  132. package/dist/label.js +31 -18
  133. package/dist/link.cjs +1 -1
  134. package/dist/link.js +1 -1
  135. package/dist/logo.cjs +1 -1
  136. package/dist/logo.d.ts +9 -4
  137. package/dist/logo.d.ts.map +1 -1
  138. package/dist/logo.js +20 -21
  139. package/dist/menubar.cjs +1 -1
  140. package/dist/menubar.d.ts +43 -6
  141. package/dist/menubar.d.ts.map +1 -1
  142. package/dist/menubar.js +100 -78
  143. package/dist/navigation-menu.cjs +1 -1
  144. package/dist/navigation-menu.d.ts +6 -54
  145. package/dist/navigation-menu.d.ts.map +1 -1
  146. package/dist/navigation-menu.js +73 -84
  147. package/dist/pagination.cjs +1 -1
  148. package/dist/pagination.d.ts +8 -10
  149. package/dist/pagination.d.ts.map +1 -1
  150. package/dist/pagination.js +78 -86
  151. package/dist/popover.cjs +1 -1
  152. package/dist/popover.d.ts +59 -4
  153. package/dist/popover.d.ts.map +1 -1
  154. package/dist/popover.js +42 -34
  155. package/dist/progress.cjs +1 -1
  156. package/dist/progress.d.ts +9 -2
  157. package/dist/progress.d.ts.map +1 -1
  158. package/dist/progress.js +71 -59
  159. package/dist/radio-group.cjs +1 -1
  160. package/dist/radio-group.d.ts +33 -10
  161. package/dist/radio-group.d.ts.map +1 -1
  162. package/dist/radio-group.js +56 -66
  163. package/dist/rating.d.ts +4 -0
  164. package/dist/rating.d.ts.map +1 -1
  165. package/dist/resizable.cjs +1 -1
  166. package/dist/resizable.d.ts +58 -6
  167. package/dist/resizable.d.ts.map +1 -1
  168. package/dist/resizable.js +38 -37
  169. package/dist/scroll-area.cjs +1 -1
  170. package/dist/scroll-area.d.ts +46 -5
  171. package/dist/scroll-area.d.ts.map +1 -1
  172. package/dist/scroll-area.js +42 -38
  173. package/dist/select.cjs +1 -1
  174. package/dist/select.d.ts +30 -0
  175. package/dist/select.d.ts.map +1 -1
  176. package/dist/select.js +64 -54
  177. package/dist/separator.cjs +1 -1
  178. package/dist/separator.d.ts +52 -5
  179. package/dist/separator.d.ts.map +1 -1
  180. package/dist/separator.js +45 -35
  181. package/dist/sheet.cjs +1 -1
  182. package/dist/sheet.d.ts +85 -19
  183. package/dist/sheet.d.ts.map +1 -1
  184. package/dist/sheet.js +117 -115
  185. package/dist/skeleton.cjs +1 -1
  186. package/dist/skeleton.d.ts +24 -2
  187. package/dist/skeleton.d.ts.map +1 -1
  188. package/dist/skeleton.js +15 -9
  189. package/dist/slider.cjs +1 -1
  190. package/dist/slider.d.ts +18 -4
  191. package/dist/slider.d.ts.map +1 -1
  192. package/dist/slider.js +72 -66
  193. package/dist/sonner.cjs +1 -1
  194. package/dist/sonner.d.ts +21 -22
  195. package/dist/sonner.d.ts.map +1 -1
  196. package/dist/sonner.js +46 -48
  197. package/dist/split-layout.d.ts +4 -1
  198. package/dist/split-layout.d.ts.map +1 -1
  199. package/dist/switch.cjs +1 -1
  200. package/dist/switch.d.ts +2 -12
  201. package/dist/switch.d.ts.map +1 -1
  202. package/dist/switch.js +37 -41
  203. package/dist/table.cjs +1 -1
  204. package/dist/table.d.ts +16 -12
  205. package/dist/table.d.ts.map +1 -1
  206. package/dist/table.js +56 -58
  207. package/dist/tabs.d.ts +27 -3
  208. package/dist/tabs.d.ts.map +1 -1
  209. package/dist/toggle-group.cjs +1 -1
  210. package/dist/toggle-group.d.ts +57 -7
  211. package/dist/toggle-group.d.ts.map +1 -1
  212. package/dist/toggle-group.js +60 -67
  213. package/dist/toggle.cjs +1 -1
  214. package/dist/toggle.d.ts +12 -26
  215. package/dist/toggle.d.ts.map +1 -1
  216. package/dist/toggle.js +16 -20
  217. package/package.json +9 -3
  218. package/src/blocks/data-table.tsx +43 -33
  219. package/src/blocks/sidebar.tsx +158 -541
  220. package/src/components/accordion.tsx +164 -78
  221. package/src/components/alert-dialog.tsx +156 -111
  222. package/src/components/alert.tsx +27 -14
  223. package/src/components/aspect-ratio.tsx +25 -16
  224. package/src/components/avatar.tsx +56 -8
  225. package/src/components/badge.tsx +65 -42
  226. package/src/components/breadcrumb.tsx +159 -83
  227. package/src/components/button.tsx +42 -63
  228. package/src/components/calendar.tsx +22 -6
  229. package/src/components/card.tsx +92 -40
  230. package/src/components/carousel.tsx +240 -115
  231. package/src/components/centred-layout.tsx +68 -49
  232. package/src/components/chart.tsx +118 -47
  233. package/src/components/checkbox.tsx +43 -79
  234. package/src/components/collapsible.tsx +95 -26
  235. package/src/components/combobox.tsx +243 -153
  236. package/src/components/command.tsx +295 -121
  237. package/src/components/context-menu.tsx +279 -82
  238. package/src/components/date-picker.tsx +282 -31
  239. package/src/components/description.tsx +60 -0
  240. package/src/components/dialog.tsx +163 -87
  241. package/src/components/drawer.tsx +76 -2
  242. package/src/components/dropdown-menu.tsx +143 -37
  243. package/src/components/field.tsx +38 -11
  244. package/src/components/global-layout.tsx +116 -77
  245. package/src/components/hover-card.tsx +54 -14
  246. package/src/components/input-group.tsx +56 -18
  247. package/src/components/input-otp.tsx +1 -1
  248. package/src/components/input-password.tsx +4 -5
  249. package/src/components/input.tsx +93 -186
  250. package/src/components/label.tsx +56 -15
  251. package/src/components/link.tsx +1 -1
  252. package/src/components/logo.tsx +12 -7
  253. package/src/components/menubar.tsx +61 -5
  254. package/src/components/navigation-menu.tsx +37 -99
  255. package/src/components/pagination.tsx +13 -19
  256. package/src/components/popover.tsx +103 -20
  257. package/src/components/progress.tsx +82 -60
  258. package/src/components/radio-group.tsx +44 -25
  259. package/src/components/rating.tsx +4 -0
  260. package/src/components/resizable.tsx +88 -38
  261. package/src/components/scroll-area.tsx +123 -56
  262. package/src/components/select.tsx +22 -2
  263. package/src/components/separator.tsx +101 -24
  264. package/src/components/sheet.tsx +186 -90
  265. package/src/components/skeleton.tsx +40 -10
  266. package/src/components/slider.tsx +83 -57
  267. package/src/components/sonner.tsx +34 -34
  268. package/src/components/split-layout.tsx +4 -1
  269. package/src/components/switch.figma.tsx +7 -11
  270. package/src/components/switch.tsx +9 -19
  271. package/src/components/table.tsx +23 -18
  272. package/src/components/tabs.tsx +27 -3
  273. package/src/components/toggle-group.tsx +115 -86
  274. package/src/components/toggle.figma.tsx +13 -19
  275. package/src/components/toggle.tsx +20 -34
  276. package/src/index.ts +1 -1
  277. package/dist/input-base.cjs +0 -1
  278. package/dist/input-base.d.ts +0 -28
  279. package/dist/input-base.d.ts.map +0 -1
  280. package/dist/input-base.js +0 -56
  281. package/src/components/input-base.tsx +0 -86
package/dist/carousel.js CHANGED
@@ -1,185 +1,199 @@
1
- import { jsx as a, jsxs as p } from "react/jsx-runtime";
2
- import * as l from "react";
3
- import D from "embla-carousel-react";
4
- import { ArrowLeft as I, ArrowRight as R } from "lucide-react";
5
- import { cn as i } from "@brightlocal/ui-components/lib/utils";
6
- import { Button as v, ButtonVariant as N, ButtonSize as w } from "@brightlocal/ui-components/button";
7
- const S = l.createContext(null);
8
- function m() {
9
- const e = l.useContext(S);
1
+ import { jsx as s, jsxs as p } from "react/jsx-runtime";
2
+ import * as o from "react";
3
+ import E from "embla-carousel-react";
4
+ import { ArrowLeft as I, ArrowRight as K } from "@brightlocal/icons";
5
+ import { cn as f } from "@brightlocal/ui-components/lib/utils";
6
+ import { Button as N } from "@brightlocal/ui-components/button";
7
+ const v = o.createContext(null);
8
+ function C() {
9
+ const e = o.useContext(v);
10
10
  if (!e)
11
11
  throw new Error("useCarousel must be used within a <Carousel />");
12
12
  return e;
13
13
  }
14
- function j({
15
- orientation: e = "horizontal",
16
- opts: r,
17
- setApi: t,
18
- plugins: s,
19
- className: u,
20
- children: f,
21
- ...d
22
- }) {
23
- const [x, o] = D(
24
- {
25
- ...r,
26
- axis: e === "horizontal" ? "x" : "y"
27
- },
28
- s
29
- ), [b, y] = l.useState(!1), [z, P] = l.useState(!1), c = l.useCallback((n) => {
30
- n && (y(n.canScrollPrev()), P(n.canScrollNext()));
31
- }, []), h = l.useCallback(() => {
32
- o?.scrollPrev();
33
- }, [o]), C = l.useCallback(() => {
34
- o?.scrollNext();
35
- }, [o]), k = l.useCallback(
36
- (n) => {
37
- const g = e === "horizontal" ? "ArrowLeft" : "ArrowUp", E = e === "horizontal" ? "ArrowRight" : "ArrowDown";
38
- n.key === g ? (n.preventDefault(), h()) : n.key === E && (n.preventDefault(), C());
39
- },
40
- [e, h, C]
41
- );
42
- return l.useEffect(() => {
43
- !o || !t || t(o);
44
- }, [o, t]), l.useEffect(() => {
45
- if (o)
46
- return c(o), o.on("reInit", c), o.on("select", c), () => {
47
- o?.off("reInit", c), o?.off("select", c);
48
- };
49
- }, [o, c]), /* @__PURE__ */ a(
50
- S.Provider,
51
- {
52
- value: {
53
- carouselRef: x,
54
- api: o,
55
- opts: r,
56
- orientation: e || (r?.axis === "y" ? "vertical" : "horizontal"),
57
- scrollPrev: h,
58
- scrollNext: C,
59
- canScrollPrev: b,
60
- canScrollNext: z
14
+ const j = o.forwardRef(
15
+ ({
16
+ orientation: e = "horizontal",
17
+ opts: l,
18
+ setApi: t,
19
+ plugins: a,
20
+ className: i,
21
+ children: n,
22
+ dataHook: d,
23
+ trackingEl: m,
24
+ trackingLabel: w,
25
+ ...y
26
+ }, b) => {
27
+ const [k, r] = E(
28
+ {
29
+ ...l,
30
+ axis: e === "horizontal" ? "x" : "y"
61
31
  },
62
- children: /* @__PURE__ */ a(
63
- "div",
64
- {
65
- "aria-roledescription": "carousel",
66
- className: i("relative", u),
67
- "data-slot": "carousel",
68
- role: "region",
69
- onKeyDownCapture: k,
70
- ...d,
71
- children: f
72
- }
73
- )
74
- }
75
- );
76
- }
77
- function M({ className: e, ...r }) {
78
- const { carouselRef: t, orientation: s } = m();
79
- return /* @__PURE__ */ a(
32
+ a
33
+ ), [P, S] = o.useState(!1), [g, z] = o.useState(!1), u = o.useCallback((c) => {
34
+ c && (S(c.canScrollPrev()), z(c.canScrollNext()));
35
+ }, []), x = o.useCallback(() => {
36
+ r?.scrollPrev();
37
+ }, [r]), h = o.useCallback(() => {
38
+ r?.scrollNext();
39
+ }, [r]), R = o.useCallback(
40
+ (c) => {
41
+ const D = e === "horizontal" ? "ArrowLeft" : "ArrowUp", A = e === "horizontal" ? "ArrowRight" : "ArrowDown";
42
+ c.key === D ? (c.preventDefault(), x()) : c.key === A && (c.preventDefault(), h());
43
+ },
44
+ [e, x, h]
45
+ );
46
+ return o.useEffect(() => {
47
+ !r || !t || t(r);
48
+ }, [r, t]), o.useEffect(() => {
49
+ if (r)
50
+ return u(r), r.on("reInit", u), r.on("select", u), () => {
51
+ r?.off("reInit", u), r?.off("select", u);
52
+ };
53
+ }, [r, u]), /* @__PURE__ */ s(
54
+ v.Provider,
55
+ {
56
+ value: {
57
+ carouselRef: k,
58
+ api: r,
59
+ opts: l,
60
+ orientation: e || (l?.axis === "y" ? "vertical" : "horizontal"),
61
+ scrollPrev: x,
62
+ scrollNext: h,
63
+ canScrollPrev: P,
64
+ canScrollNext: g
65
+ },
66
+ children: /* @__PURE__ */ s(
67
+ "div",
68
+ {
69
+ ref: b,
70
+ "aria-roledescription": "carousel",
71
+ className: f("relative", i),
72
+ "data-hook": d,
73
+ "data-slot": "carousel",
74
+ "data-tracking-el": m,
75
+ "data-tracking-label": w,
76
+ role: "region",
77
+ onKeyDownCapture: R,
78
+ ...y,
79
+ children: n
80
+ }
81
+ )
82
+ }
83
+ );
84
+ }
85
+ );
86
+ j.displayName = "Carousel";
87
+ const L = o.forwardRef(({ className: e, ...l }, t) => {
88
+ const { carouselRef: a, orientation: i } = C(), n = i === "vertical";
89
+ return /* @__PURE__ */ s(
80
90
  "div",
81
91
  {
82
- ref: t,
83
- className: i(
84
- "overflow-hidden",
85
- s === "vertical" && "h-[400px]"
86
- ),
92
+ ref: a,
93
+ className: f("overflow-hidden", n && "w-full", e),
87
94
  "data-slot": "carousel-content",
88
- children: /* @__PURE__ */ a(
95
+ children: /* @__PURE__ */ s(
89
96
  "div",
90
97
  {
91
- className: i(
92
- "flex gap-4",
93
- s === "horizontal" ? "" : "h-full flex-col",
94
- e
98
+ ref: t,
99
+ className: f(
100
+ "flex",
101
+ n ? "-mt-4 h-full w-full flex-col" : "-ml-4"
95
102
  ),
96
- ...r
103
+ ...l
97
104
  }
98
105
  )
99
106
  }
100
107
  );
101
- }
102
- function O({ className: e, ...r }) {
103
- const { orientation: t } = m();
104
- return /* @__PURE__ */ a(
108
+ });
109
+ L.displayName = "CarouselContent";
110
+ const O = o.forwardRef(({ className: e, ...l }, t) => {
111
+ const { orientation: a } = C();
112
+ return /* @__PURE__ */ s(
105
113
  "div",
106
114
  {
115
+ ref: t,
107
116
  "aria-roledescription": "slide",
108
- className: i(
117
+ className: f(
109
118
  "min-w-0 shrink-0 grow-0 basis-full",
110
- t === "horizontal" ? "pl-1" : "pt-1",
119
+ a === "horizontal" ? "pl-4" : "w-full pt-4",
111
120
  e
112
121
  ),
113
122
  "data-slot": "carousel-item",
114
123
  role: "group",
115
- ...r
124
+ ...l
116
125
  }
117
126
  );
118
- }
119
- function T({
127
+ });
128
+ O.displayName = "CarouselItem";
129
+ function B({
120
130
  className: e,
121
- variant: r = N.OUTLINE,
122
- size: t = w.SM,
123
- dataHook: s = "carousel-previous",
124
- ...u
131
+ variant: l = "outline",
132
+ size: t = "default",
133
+ dataHook: a = "carousel-previous",
134
+ ...i
125
135
  }) {
126
- const { orientation: f, scrollPrev: d, canScrollPrev: x } = m();
136
+ const { orientation: n, scrollPrev: d, canScrollPrev: m } = C();
127
137
  return /* @__PURE__ */ p(
128
- v,
138
+ N,
129
139
  {
130
- className: i(
131
- "absolute size-8 rounded-full",
132
- f === "horizontal" ? "top-1/2 -left-12 -translate-y-1/2" : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
140
+ iconOnly: !0,
141
+ className: f(
142
+ "absolute",
143
+ n === "horizontal" ? "top-1/2 -left-12 -translate-y-1/2" : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
133
144
  e
134
145
  ),
135
146
  "data-slot": "carousel-previous",
136
- dataHook: s,
137
- disabled: !x,
147
+ dataHook: a,
148
+ disabled: !m,
138
149
  size: t,
139
- variant: r,
150
+ variant: l,
140
151
  onClick: d,
141
- ...u,
152
+ ...i,
142
153
  children: [
143
- /* @__PURE__ */ a(I, {}),
144
- /* @__PURE__ */ a("span", { className: "sr-only", children: "Previous slide" })
154
+ /* @__PURE__ */ s(I, {}),
155
+ /* @__PURE__ */ s("span", { className: "sr-only", children: "Previous slide" })
145
156
  ]
146
157
  }
147
158
  );
148
159
  }
149
- function V({
160
+ B.displayName = "CarouselPrevious";
161
+ function U({
150
162
  className: e,
151
- variant: r = N.OUTLINE,
152
- size: t = w.SM,
153
- dataHook: s = "carousel-next",
154
- ...u
163
+ variant: l = "outline",
164
+ size: t = "default",
165
+ dataHook: a = "carousel-next",
166
+ ...i
155
167
  }) {
156
- const { orientation: f, scrollNext: d, canScrollNext: x } = m();
168
+ const { orientation: n, scrollNext: d, canScrollNext: m } = C();
157
169
  return /* @__PURE__ */ p(
158
- v,
170
+ N,
159
171
  {
160
- className: i(
161
- "absolute size-8 rounded-full",
162
- f === "horizontal" ? "top-1/2 -right-12 -translate-y-1/2" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
172
+ iconOnly: !0,
173
+ className: f(
174
+ "absolute",
175
+ n === "horizontal" ? "top-1/2 -right-12 -translate-y-1/2" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
163
176
  e
164
177
  ),
165
178
  "data-slot": "carousel-next",
166
- dataHook: s,
167
- disabled: !x,
179
+ dataHook: a,
180
+ disabled: !m,
168
181
  size: t,
169
- variant: r,
182
+ variant: l,
170
183
  onClick: d,
171
- ...u,
184
+ ...i,
172
185
  children: [
173
- /* @__PURE__ */ a(R, {}),
174
- /* @__PURE__ */ a("span", { className: "sr-only", children: "Next slide" })
186
+ /* @__PURE__ */ s(K, {}),
187
+ /* @__PURE__ */ s("span", { className: "sr-only", children: "Next slide" })
175
188
  ]
176
189
  }
177
190
  );
178
191
  }
192
+ U.displayName = "CarouselNext";
179
193
  export {
180
194
  j as Carousel,
181
- M as CarouselContent,
195
+ L as CarouselContent,
182
196
  O as CarouselItem,
183
- V as CarouselNext,
184
- T as CarouselPrevious
197
+ U as CarouselNext,
198
+ B as CarouselPrevious
185
199
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),x=require("@brightlocal/ui-components/lib/utils");var l=(e=>(e.XL="xl",e.LG="lg",e.MD="md",e.SM="sm",e))(l||{});function a({className:e,breakpoint:s="xl",maxWidth:t,children:n,...r}){const c={xl:"max-w-7xl",lg:"max-w-5xl",md:"max-w-3xl",sm:"max-w-2xl"},o=t!==void 0?{maxWidth:typeof t=="number"?`${t}px`:t}:void 0;return u.jsx("div",{className:x.cn("bg-background flex min-h-screen items-center justify-center p-6",!t&&c[s],e),"data-slot":"centred-layout",style:o,...r,children:n})}exports.CentredLayout=a;exports.CentredLayoutBreakpoint=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react/jsx-runtime"),m=require("react"),y=require("@brightlocal/ui-components/lib/utils");function b(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(a,e,r.get?r:{enumerable:!0,get:()=>t[e]})}}return a.default=t,Object.freeze(a)}const x=b(m),n=x.forwardRef(({className:t,breakpoint:a="xl",maxWidth:e,children:r,dataHook:o,trackingEl:c,trackingLabel:l,...s},u)=>{const i={xl:"max-w-7xl",lg:"max-w-5xl",md:"max-w-3xl",sm:"max-w-2xl"},d=e!==void 0?{maxWidth:typeof e=="number"?`${e}px`:e}:void 0;return f.jsx("div",{ref:u,className:y.cn("bg-background flex min-h-screen items-center justify-center p-6",!e&&i[a],t),"data-hook":o,"data-slot":"centred-layout","data-tracking-el":c,"data-tracking-label":l,style:d,...s,children:r})});n.displayName="CentredLayout";exports.CentredLayout=n;
@@ -14,28 +14,28 @@ import * as React from "react";
14
14
  */
15
15
  /**
16
16
  * Breakpoint variants for CentredLayout
17
+ * - xl: Extra large breakpoint (1280px max-width)
18
+ * - lg: Large breakpoint (1024px max-width)
19
+ * - md: Medium breakpoint (768px max-width)
20
+ * - sm: Small breakpoint (640px max-width)
17
21
  */
18
- export declare enum CentredLayoutBreakpoint {
22
+ export type CentredLayoutBreakpoint = "xl" | "lg" | "md" | "sm";
23
+ interface CentredLayoutProps extends React.ComponentProps<"div"> {
19
24
  /**
20
- * Extra large breakpoint (1280px max-width)
25
+ * Data hook for automated testing (required)
21
26
  */
22
- XL = "xl",
27
+ dataHook: string;
23
28
  /**
24
- * Large breakpoint (1024px max-width)
29
+ * Tracking element identifier for analytics
25
30
  */
26
- LG = "lg",
31
+ trackingEl?: string;
27
32
  /**
28
- * Medium breakpoint (768px max-width)
33
+ * Tracking label for analytics context
29
34
  */
30
- MD = "md",
35
+ trackingLabel?: string;
31
36
  /**
32
- * Small breakpoint (640px max-width)
33
- */
34
- SM = "sm"
35
- }
36
- interface CentredLayoutProps extends React.ComponentProps<"div"> {
37
- /**
38
- * Breakpoint size variant (default: xl)
37
+ * Breakpoint size variant
38
+ * @default "xl"
39
39
  */
40
40
  breakpoint?: CentredLayoutBreakpoint;
41
41
  /**
@@ -43,7 +43,10 @@ interface CentredLayoutProps extends React.ComponentProps<"div"> {
43
43
  */
44
44
  maxWidth?: string | number;
45
45
  }
46
- declare function CentredLayout({ className, breakpoint, maxWidth, children, ...props }: CentredLayoutProps): import("react/jsx-runtime").JSX.Element;
46
+ /**
47
+ * CentredLayout component for centering content with responsive max-width constraints.
48
+ */
49
+ declare const CentredLayout: React.ForwardRefExoticComponent<Omit<CentredLayoutProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
47
50
  export { CentredLayout };
48
51
  export type { CentredLayoutProps };
49
52
  //# sourceMappingURL=centred-layout.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"centred-layout.d.ts","sourceRoot":"","sources":["../../src/components/centred-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B;;;;;;;;;;;;GAYG;AAEH;;GAEG;AACH,oBAAY,uBAAuB;IACjC;;OAEG;IACH,EAAE,OAAO;IACT;;OAEG;IACH,EAAE,OAAO;IACT;;OAEG;IACH,EAAE,OAAO;IACT;;OAEG;IACH,EAAE,OAAO;CACV;AAED,UAAU,kBAAmB,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IAC9D;;OAEG;IACH,UAAU,CAAC,EAAE,uBAAuB,CAAC;IACrC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC5B;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,UAAuC,EACvC,QAAQ,EACR,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,kBAAkB,2CA6BpB;AAED,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB,YAAY,EAAE,kBAAkB,EAAE,CAAC"}
1
+ {"version":3,"file":"centred-layout.d.ts","sourceRoot":"","sources":["../../src/components/centred-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B;;;;;;;;;;;;GAYG;AAEH;;;;;;GAMG;AACH,MAAM,MAAM,uBAAuB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEhE,UAAU,kBAAmB,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IAC9D;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,UAAU,CAAC,EAAE,uBAAuB,CAAC;IACrC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC5B;AAED;;GAEG;AACH,QAAA,MAAM,aAAa,wGAiDlB,CAAC;AAIF,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB,YAAY,EAAE,kBAAkB,EAAE,CAAC"}
@@ -1,35 +1,46 @@
1
- import { jsx as c } from "react/jsx-runtime";
2
- import { cn as n } from "@brightlocal/ui-components/lib/utils";
3
- var o = /* @__PURE__ */ ((l) => (l.XL = "xl", l.LG = "lg", l.MD = "md", l.SM = "sm", l))(o || {});
4
- function i({
5
- className: l,
6
- breakpoint: s = "xl",
7
- maxWidth: m,
8
- children: x,
9
- ...e
10
- }) {
11
- const r = {
12
- xl: "max-w-7xl",
13
- lg: "max-w-5xl",
14
- md: "max-w-3xl",
15
- sm: "max-w-2xl"
16
- }, t = m !== void 0 ? { maxWidth: typeof m == "number" ? `${m}px` : m } : void 0;
17
- return /* @__PURE__ */ c(
18
- "div",
19
- {
20
- className: n(
21
- "bg-background flex min-h-screen items-center justify-center p-6",
22
- !m && r[s],
23
- l
24
- ),
25
- "data-slot": "centred-layout",
26
- style: t,
27
- ...e,
28
- children: x
29
- }
30
- );
31
- }
1
+ import { jsx as x } from "react/jsx-runtime";
2
+ import * as i from "react";
3
+ import { cn as p } from "@brightlocal/ui-components/lib/utils";
4
+ const f = i.forwardRef(
5
+ ({
6
+ className: a,
7
+ breakpoint: e = "xl",
8
+ maxWidth: t,
9
+ children: o,
10
+ dataHook: r,
11
+ trackingEl: l,
12
+ trackingLabel: n,
13
+ ...s
14
+ }, m) => {
15
+ const c = {
16
+ xl: "max-w-7xl",
17
+ lg: "max-w-5xl",
18
+ md: "max-w-3xl",
19
+ sm: "max-w-2xl"
20
+ }, d = t !== void 0 ? {
21
+ maxWidth: typeof t == "number" ? `${t}px` : t
22
+ } : void 0;
23
+ return /* @__PURE__ */ x(
24
+ "div",
25
+ {
26
+ ref: m,
27
+ className: p(
28
+ "bg-background flex min-h-screen items-center justify-center p-6",
29
+ !t && c[e],
30
+ a
31
+ ),
32
+ "data-hook": r,
33
+ "data-slot": "centred-layout",
34
+ "data-tracking-el": l,
35
+ "data-tracking-label": n,
36
+ style: d,
37
+ ...s,
38
+ children: o
39
+ }
40
+ );
41
+ }
42
+ );
43
+ f.displayName = "CentredLayout";
32
44
  export {
33
- i as CentredLayout,
34
- o as CentredLayoutBreakpoint
45
+ f as CentredLayout
35
46
  };
package/dist/chart.cjs CHANGED
@@ -1,10 +1,10 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),T=require("react"),e=require("recharts"),g=require("@brightlocal/ui-components/lib/utils");function O(r){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const s in r)if(s!=="default"){const n=Object.getOwnPropertyDescriptor(r,s);Object.defineProperty(o,s,n.get?n:{enumerable:!0,get:()=>r[s]})}}return o.default=r,Object.freeze(o)}const j=O(T),y=O(e),_=j.createContext(null);function k(){const r=j.useContext(_);if(!r)throw new Error("useChart must be used within a <ChartContainer />");return r}function L({id:r,className:o,children:s,config:n,dataHook:l,trackingEl:i,trackingLabel:c,...u}){const d=j.useId(),f=`chart-${r||d.replace(/:/g,"")}`;return t.jsx(_.Provider,{value:{config:n},children:t.jsxs("div",{className:g.cn("[&_.recharts-cartesian-axis-tick_text]:fill-muted-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 flex aspect-video justify-center text-xs [&_.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",o),"data-chart":f,"data-hook":l,"data-slot":"chart-container","data-tracking-el":i,"data-tracking-label":c,...u,children:[t.jsx(R,{config:n,id:f}),t.jsx(y.ResponsiveContainer,{children:s})]})})}L.displayName="ChartContainer";function R({id:r,config:o}){const s=Object.entries(o).filter(([,n])=>n.theme||n.color);return s.length?t.jsx("style",{dangerouslySetInnerHTML:{__html:s.map(([n,l])=>{const i=typeof l.color=="string"?l.color.replace(/^hsl\((.*)\)$/,"$1"):null;return i?`
2
- [data-chart=${r}] {
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),B=require("react"),e=require("recharts"),g=require("@brightlocal/ui-components/lib/utils");function _(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const s in t)if(s!=="default"){const n=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(o,s,n.get?n:{enumerable:!0,get:()=>t[s]})}}return o.default=t,Object.freeze(o)}const f=_(B),v=_(e),k=f.createContext(null);function L(){const t=f.useContext(k);if(!t)throw new Error("useChart must be used within a <ChartContainer />");return t}const R=f.forwardRef(({id:t,className:o,children:s,config:n,dataHook:l,trackingEl:i,trackingLabel:c,...u},d)=>{const b=f.useId(),p=`chart-${t||b.replace(/:/g,"")}`;return r.jsx(k.Provider,{value:{config:n},children:r.jsxs("div",{ref:d,className:g.cn("[&_.recharts-cartesian-axis-tick_text]:fill-muted-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 flex aspect-video justify-center text-xs [&_.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",o),"data-chart":p,"data-hook":l,"data-slot":"chart-container","data-tracking-el":i,"data-tracking-label":c,...u,children:[r.jsx(N,{config:n,id:p}),r.jsx(v.ResponsiveContainer,{children:s})]})})});R.displayName="ChartContainer";function N({id:t,config:o}){const s=Object.entries(o).filter(([,n])=>n.theme||n.color);return s.length?r.jsx("style",{dangerouslySetInnerHTML:{__html:s.map(([n,l])=>{const i=typeof l.color=="string"?l.color.replace(/^hsl\((.*)\)$/,"$1"):null;return i?`
2
+ [data-chart=${t}] {
3
3
  --color-${n}: ${i};
4
4
  }
5
5
  `:l.theme?Object.entries(l.theme).map(([c,u])=>`
6
- .${c} [data-chart=${r}] {
6
+ .${c} [data-chart=${t}] {
7
7
  --color-${n}: ${u.replace(/^hsl\((.*)\)$/,"$1")};
8
8
  }
9
9
  `).join(""):""}).join(`
10
- `)}}):null}function S({...r}){return t.jsx(y.Tooltip,{...r})}function N({active:r,payload:o,className:s,indicator:n="dot",hideLabel:l=!1,hideIndicator:i=!1,label:c,labelFormatter:u,labelClassName:d,formatter:f,color:w,nameKey:A,labelKey:C}){const{config:b}=k(),v=j.useMemo(()=>{if(l||!o?.length)return null;const[a]=o;if(!a)return null;const x=`${C||a.dataKey||a.name||"value"}`,m=b[x],h=!C&&typeof c=="string"?b[c]?.label||c:m?.label;return u?t.jsx("div",{className:g.cn("font-medium",d),children:u(h,o)}):h?t.jsx("div",{className:g.cn("font-medium",d),children:h}):null},[c,u,o,l,d,b,C]);if(!r||!o?.length)return null;const p=o.length===1&&n!=="dot";return t.jsxs("div",{className:g.cn("border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl",s),"data-slot":"chart-tooltip-content",children:[p?null:v,t.jsx("div",{className:"grid gap-1.5",children:o.map((a,x)=>{const m=`${A||a.name||a.dataKey||"value"}`,h=b[m],P=w||a.color||a.payload.fill||`var(--color-${m})`;return t.jsx("div",{className:g.cn("[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5",n==="dot"&&"items-center"),children:f&&a?.value!==void 0&&a.name?f(a.value,a.name,a,x,o):t.jsxs(t.Fragment,{children:[h?.icon&&!i?t.jsx(h.icon,{}):!i&&t.jsx("div",{className:g.cn("shrink-0 rounded-[2px]",{"h-2.5 w-2.5":n==="dot","w-1":n==="line","w-0 border-[1.5px] border-dashed bg-transparent":n==="dashed","my-0.5":p&&n==="dashed"}),style:{backgroundColor:n==="dashed"?"transparent":P,borderColor:P}}),t.jsxs("div",{className:g.cn("flex flex-1 justify-between leading-none",p?"items-end":"items-center"),children:[t.jsxs("div",{className:"grid gap-1.5",children:[p?v:null,t.jsx("span",{className:"text-muted-foreground",children:h?.label||a.name})]}),a.value&&t.jsx("span",{className:"text-foreground font-mono font-medium tabular-nums",children:typeof a.value=="number"?a.value.toLocaleString():a.value})]})]})},a.dataKey)})})]})}N.displayName="ChartTooltipContent";function B({...r}){return t.jsx(y.Legend,{...r})}function $({className:r,hideIcon:o=!1,payload:s,verticalAlign:n="bottom",nameKey:l}){const{config:i}=k();return s?.length?t.jsx("div",{className:g.cn("flex items-center justify-center gap-4",n==="top"?"pb-4":"pt-4",r),"data-slot":"chart-legend-content",children:s.map(c=>{const u=`${l||c.dataKey||"value"}`,d=i[u];return t.jsxs("div",{className:g.cn("[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3"),children:[d?.icon&&!o?t.jsx(d.icon,{}):t.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:c.color}}),d?.label||c.value]},c.value)})}):null}$.displayName="ChartLegendContent";Object.defineProperty(exports,"Area",{enumerable:!0,get:()=>e.Area});Object.defineProperty(exports,"AreaChart",{enumerable:!0,get:()=>e.AreaChart});Object.defineProperty(exports,"Bar",{enumerable:!0,get:()=>e.Bar});Object.defineProperty(exports,"BarChart",{enumerable:!0,get:()=>e.BarChart});Object.defineProperty(exports,"CartesianGrid",{enumerable:!0,get:()=>e.CartesianGrid});Object.defineProperty(exports,"Cell",{enumerable:!0,get:()=>e.Cell});Object.defineProperty(exports,"ChartLabel",{enumerable:!0,get:()=>e.Label});Object.defineProperty(exports,"ChartsLegend",{enumerable:!0,get:()=>e.Legend});Object.defineProperty(exports,"ChartsTooltip",{enumerable:!0,get:()=>e.Tooltip});Object.defineProperty(exports,"Customized",{enumerable:!0,get:()=>e.Customized});Object.defineProperty(exports,"LabelList",{enumerable:!0,get:()=>e.LabelList});Object.defineProperty(exports,"Line",{enumerable:!0,get:()=>e.Line});Object.defineProperty(exports,"LineChart",{enumerable:!0,get:()=>e.LineChart});Object.defineProperty(exports,"Pie",{enumerable:!0,get:()=>e.Pie});Object.defineProperty(exports,"PieChart",{enumerable:!0,get:()=>e.PieChart});Object.defineProperty(exports,"PolarAngleAxis",{enumerable:!0,get:()=>e.PolarAngleAxis});Object.defineProperty(exports,"PolarGrid",{enumerable:!0,get:()=>e.PolarGrid});Object.defineProperty(exports,"PolarRadiusAxis",{enumerable:!0,get:()=>e.PolarRadiusAxis});Object.defineProperty(exports,"Radar",{enumerable:!0,get:()=>e.Radar});Object.defineProperty(exports,"RadarChart",{enumerable:!0,get:()=>e.RadarChart});Object.defineProperty(exports,"RadialBar",{enumerable:!0,get:()=>e.RadialBar});Object.defineProperty(exports,"RadialBarChart",{enumerable:!0,get:()=>e.RadialBarChart});Object.defineProperty(exports,"Rectangle",{enumerable:!0,get:()=>e.Rectangle});Object.defineProperty(exports,"ReferenceLine",{enumerable:!0,get:()=>e.ReferenceLine});Object.defineProperty(exports,"ResponsiveContainer",{enumerable:!0,get:()=>e.ResponsiveContainer});Object.defineProperty(exports,"Sector",{enumerable:!0,get:()=>e.Sector});Object.defineProperty(exports,"XAxis",{enumerable:!0,get:()=>e.XAxis});Object.defineProperty(exports,"YAxis",{enumerable:!0,get:()=>e.YAxis});exports.ChartContainer=L;exports.ChartLegend=B;exports.ChartLegendContent=$;exports.ChartStyle=R;exports.ChartTooltip=S;exports.ChartTooltipContent=N;
10
+ `)}}):null}function w({...t}){return r.jsx(v.Tooltip,{...t})}w.displayName="ChartTooltip";function $({active:t,payload:o,className:s,indicator:n="dot",hideLabel:l=!1,hideIndicator:i=!1,label:c,labelFormatter:u,labelClassName:d,formatter:b,color:p,nameKey:S,labelKey:x}){const{config:m}=L(),P=f.useMemo(()=>{if(l||!o?.length)return null;const[a]=o;if(!a)return null;const y=`${x||a.dataKey||a.name||"value"}`,C=m[y],h=!x&&typeof c=="string"?m[c]?.label||c:C?.label;return u?r.jsx("div",{className:g.cn("font-medium",d),children:u(h,o)}):h?r.jsx("div",{className:g.cn("font-medium",d),children:h}):null},[c,u,o,l,d,m,x]);if(!t||!o?.length)return null;const j=o.length===1&&n!=="dot";return r.jsxs("div",{className:g.cn("border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl",s),"data-slot":"chart-tooltip-content",children:[j?null:P,r.jsx("div",{className:"grid gap-1.5",children:o.map((a,y)=>{const C=`${S||a.name||a.dataKey||"value"}`,h=m[C],O=p||a.color||a.payload.fill||`var(--color-${C})`;return r.jsx("div",{className:g.cn("[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5",n==="dot"&&"items-center"),children:b&&a?.value!==void 0&&a.name?b(a.value,a.name,a,y,o):r.jsxs(r.Fragment,{children:[h?.icon&&!i?r.jsx(h.icon,{}):!i&&r.jsx("div",{className:g.cn("shrink-0 rounded-[2px]",{"h-2.5 w-2.5":n==="dot","w-1":n==="line","w-0 border-[1.5px] border-dashed bg-transparent":n==="dashed","my-0.5":j&&n==="dashed"}),style:{backgroundColor:n==="dashed"?"transparent":O,borderColor:O}}),r.jsxs("div",{className:g.cn("flex flex-1 justify-between leading-none",j?"items-end":"items-center"),children:[r.jsxs("div",{className:"grid gap-1.5",children:[j?P:null,r.jsx("span",{className:"text-muted-foreground",children:h?.label||a.name})]}),a.value&&r.jsx("span",{className:"text-foreground font-mono font-medium tabular-nums",children:typeof a.value=="number"?a.value.toLocaleString():a.value})]})]})},a.dataKey)})})]})}$.displayName="ChartTooltipContent";function A({...t}){return r.jsx(v.Legend,{...t})}A.displayName="ChartLegend";function T({className:t,hideIcon:o=!1,payload:s,verticalAlign:n="bottom",nameKey:l}){const{config:i}=L();return s?.length?r.jsx("div",{className:g.cn("flex items-center justify-center gap-4",n==="top"?"pb-4":"pt-4",t),"data-slot":"chart-legend-content",children:s.map(c=>{const u=`${l||c.dataKey||"value"}`,d=i[u];return r.jsxs("div",{className:g.cn("[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3"),children:[d?.icon&&!o?r.jsx(d.icon,{}):r.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:c.color}}),d?.label||c.value]},c.value)})}):null}T.displayName="ChartLegendContent";Object.defineProperty(exports,"Area",{enumerable:!0,get:()=>e.Area});Object.defineProperty(exports,"AreaChart",{enumerable:!0,get:()=>e.AreaChart});Object.defineProperty(exports,"Bar",{enumerable:!0,get:()=>e.Bar});Object.defineProperty(exports,"BarChart",{enumerable:!0,get:()=>e.BarChart});Object.defineProperty(exports,"CartesianGrid",{enumerable:!0,get:()=>e.CartesianGrid});Object.defineProperty(exports,"Cell",{enumerable:!0,get:()=>e.Cell});Object.defineProperty(exports,"ChartLabel",{enumerable:!0,get:()=>e.Label});Object.defineProperty(exports,"ChartsLegend",{enumerable:!0,get:()=>e.Legend});Object.defineProperty(exports,"ChartsTooltip",{enumerable:!0,get:()=>e.Tooltip});Object.defineProperty(exports,"Customized",{enumerable:!0,get:()=>e.Customized});Object.defineProperty(exports,"LabelList",{enumerable:!0,get:()=>e.LabelList});Object.defineProperty(exports,"Line",{enumerable:!0,get:()=>e.Line});Object.defineProperty(exports,"LineChart",{enumerable:!0,get:()=>e.LineChart});Object.defineProperty(exports,"Pie",{enumerable:!0,get:()=>e.Pie});Object.defineProperty(exports,"PieChart",{enumerable:!0,get:()=>e.PieChart});Object.defineProperty(exports,"PolarAngleAxis",{enumerable:!0,get:()=>e.PolarAngleAxis});Object.defineProperty(exports,"PolarGrid",{enumerable:!0,get:()=>e.PolarGrid});Object.defineProperty(exports,"PolarRadiusAxis",{enumerable:!0,get:()=>e.PolarRadiusAxis});Object.defineProperty(exports,"Radar",{enumerable:!0,get:()=>e.Radar});Object.defineProperty(exports,"RadarChart",{enumerable:!0,get:()=>e.RadarChart});Object.defineProperty(exports,"RadialBar",{enumerable:!0,get:()=>e.RadialBar});Object.defineProperty(exports,"RadialBarChart",{enumerable:!0,get:()=>e.RadialBarChart});Object.defineProperty(exports,"Rectangle",{enumerable:!0,get:()=>e.Rectangle});Object.defineProperty(exports,"ReferenceLine",{enumerable:!0,get:()=>e.ReferenceLine});Object.defineProperty(exports,"ResponsiveContainer",{enumerable:!0,get:()=>e.ResponsiveContainer});Object.defineProperty(exports,"Sector",{enumerable:!0,get:()=>e.Sector});Object.defineProperty(exports,"XAxis",{enumerable:!0,get:()=>e.XAxis});Object.defineProperty(exports,"YAxis",{enumerable:!0,get:()=>e.YAxis});exports.ChartContainer=R;exports.ChartLegend=A;exports.ChartLegendContent=T;exports.ChartStyle=N;exports.ChartTooltip=w;exports.ChartTooltipContent=$;