@brightlocal/ui-components 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accordion.cjs +1 -1
- package/dist/accordion.d.ts +74 -4
- package/dist/accordion.d.ts.map +1 -1
- package/dist/accordion.js +100 -105
- package/dist/alert-dialog.cjs +1 -1
- package/dist/alert-dialog.d.ts +30 -10
- package/dist/alert-dialog.d.ts.map +1 -1
- package/dist/alert-dialog.js +129 -132
- package/dist/alert.d.ts +22 -1
- package/dist/alert.d.ts.map +1 -1
- package/dist/aspect-ratio.cjs +1 -1
- package/dist/aspect-ratio.d.ts +11 -1
- package/dist/aspect-ratio.d.ts.map +1 -1
- package/dist/aspect-ratio.js +16 -20
- package/dist/avatar.cjs +1 -1
- package/dist/avatar.d.ts +43 -3
- package/dist/avatar.d.ts.map +1 -1
- package/dist/avatar.js +18 -16
- package/dist/badge.cjs +1 -1
- package/dist/badge.d.ts +24 -9
- package/dist/badge.d.ts.map +1 -1
- package/dist/badge.js +34 -32
- package/dist/blocks/data-table.cjs +1 -1
- package/dist/blocks/data-table.d.ts.map +1 -1
- package/dist/blocks/data-table.js +177 -170
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts +1 -1
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +154 -154
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.d.ts +63 -8
- package/dist/breadcrumb.d.ts.map +1 -1
- package/dist/breadcrumb.js +97 -93
- package/dist/button.cjs +1 -1
- package/dist/button.d.ts +17 -45
- package/dist/button.d.ts.map +1 -1
- package/dist/button.js +49 -50
- package/dist/calendar.cjs +1 -1
- package/dist/calendar.d.ts +12 -0
- package/dist/calendar.d.ts.map +1 -1
- package/dist/calendar.js +10 -8
- package/dist/card.cjs +1 -1
- package/dist/card.d.ts +58 -18
- package/dist/card.d.ts.map +1 -1
- package/dist/card.js +60 -51
- package/dist/carousel.cjs +1 -1
- package/dist/carousel.d.ts +99 -9
- package/dist/carousel.d.ts.map +1 -1
- package/dist/carousel.js +142 -128
- package/dist/centred-layout.cjs +1 -1
- package/dist/centred-layout.d.ts +18 -2
- package/dist/centred-layout.d.ts.map +1 -1
- package/dist/centred-layout.js +46 -33
- package/dist/chart.cjs +4 -4
- package/dist/chart.d.ts +70 -7
- package/dist/chart.d.ts.map +1 -1
- package/dist/chart.js +71 -66
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.d.ts +9 -5
- package/dist/checkbox.d.ts.map +1 -1
- package/dist/checkbox.js +61 -82
- package/dist/collapsible.cjs +1 -1
- package/dist/collapsible.d.ts +65 -8
- package/dist/collapsible.d.ts.map +1 -1
- package/dist/collapsible.js +41 -55
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.d.ts +29 -11
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +193 -159
- package/dist/command.cjs +1 -1
- package/dist/command.d.ts +115 -9
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +176 -152
- package/dist/context-menu.cjs +1 -1
- package/dist/context-menu.d.ts +188 -20
- package/dist/context-menu.d.ts.map +1 -1
- package/dist/context-menu.js +119 -121
- package/dist/date-picker.cjs +1 -1
- package/dist/date-picker.d.ts +75 -9
- package/dist/date-picker.d.ts.map +1 -1
- package/dist/date-picker.js +220 -81
- package/dist/description.cjs +1 -0
- package/dist/description.d.ts +37 -0
- package/dist/description.d.ts.map +1 -0
- package/dist/description.js +25 -0
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.d.ts +73 -9
- package/dist/dialog.d.ts.map +1 -1
- package/dist/dialog.js +103 -112
- package/dist/drawer.cjs +1 -1
- package/dist/drawer.d.ts +92 -0
- package/dist/drawer.d.ts.map +1 -1
- package/dist/drawer.js +67 -52
- package/dist/dropdown-menu.cjs +1 -1
- package/dist/dropdown-menu.d.ts +95 -11
- package/dist/dropdown-menu.d.ts.map +1 -1
- package/dist/dropdown-menu.js +146 -106
- package/dist/field.cjs +1 -1
- package/dist/field.d.ts +23 -6
- package/dist/field.d.ts.map +1 -1
- package/dist/field.js +54 -53
- package/dist/global-layout.cjs +1 -1
- package/dist/global-layout.d.ts +27 -17
- package/dist/global-layout.d.ts.map +1 -1
- package/dist/global-layout.js +86 -79
- package/dist/hover-card.cjs +1 -1
- package/dist/hover-card.d.ts +36 -6
- package/dist/hover-card.d.ts.map +1 -1
- package/dist/hover-card.js +44 -42
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +383 -387
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.d.ts +21 -2
- package/dist/input-group.d.ts.map +1 -1
- package/dist/input-group.js +51 -41
- package/dist/input-password.cjs +1 -1
- package/dist/input-password.d.ts.map +1 -1
- package/dist/input-password.js +24 -25
- package/dist/input.cjs +1 -1
- package/dist/input.d.ts +38 -24
- package/dist/input.d.ts.map +1 -1
- package/dist/input.js +68 -136
- package/dist/label.cjs +1 -1
- package/dist/label.d.ts +20 -1
- package/dist/label.d.ts.map +1 -1
- package/dist/label.js +31 -18
- package/dist/logo.cjs +1 -1
- package/dist/logo.d.ts +3 -0
- package/dist/logo.d.ts.map +1 -1
- package/dist/logo.js +12 -10
- package/dist/menubar.cjs +1 -1
- package/dist/menubar.d.ts +40 -6
- package/dist/menubar.d.ts.map +1 -1
- package/dist/menubar.js +97 -76
- package/dist/popover.cjs +1 -1
- package/dist/popover.d.ts +59 -4
- package/dist/popover.d.ts.map +1 -1
- package/dist/popover.js +42 -34
- package/dist/progress.cjs +1 -1
- package/dist/progress.d.ts +9 -2
- package/dist/progress.d.ts.map +1 -1
- package/dist/progress.js +71 -59
- package/dist/radio-group.d.ts +40 -0
- package/dist/radio-group.d.ts.map +1 -1
- package/dist/rating.d.ts +4 -0
- package/dist/rating.d.ts.map +1 -1
- package/dist/resizable.cjs +1 -1
- package/dist/resizable.d.ts +65 -4
- package/dist/resizable.d.ts.map +1 -1
- package/dist/resizable.js +53 -36
- package/dist/scroll-area.cjs +1 -1
- package/dist/scroll-area.d.ts +46 -5
- package/dist/scroll-area.d.ts.map +1 -1
- package/dist/scroll-area.js +42 -38
- package/dist/select.cjs +1 -1
- package/dist/select.d.ts +30 -0
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +64 -54
- package/dist/separator.cjs +1 -1
- package/dist/separator.d.ts +49 -2
- package/dist/separator.d.ts.map +1 -1
- package/dist/separator.js +48 -36
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +80 -9
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +117 -113
- package/dist/skeleton.cjs +1 -1
- package/dist/skeleton.d.ts +24 -2
- package/dist/skeleton.d.ts.map +1 -1
- package/dist/skeleton.js +15 -9
- package/dist/slider.cjs +1 -1
- package/dist/slider.d.ts +18 -4
- package/dist/slider.d.ts.map +1 -1
- package/dist/slider.js +72 -66
- package/dist/sonner.cjs +1 -1
- package/dist/sonner.d.ts +4 -2
- package/dist/sonner.d.ts.map +1 -1
- package/dist/sonner.js +29 -28
- package/dist/split-layout.d.ts +4 -1
- package/dist/split-layout.d.ts.map +1 -1
- package/package.json +8 -2
- package/src/blocks/data-table.tsx +42 -32
- package/src/blocks/sidebar.tsx +4 -12
- package/src/components/accordion.tsx +163 -77
- package/src/components/alert-dialog.tsx +156 -111
- package/src/components/alert.tsx +26 -13
- package/src/components/aspect-ratio.tsx +25 -16
- package/src/components/avatar.tsx +56 -8
- package/src/components/badge.tsx +65 -42
- package/src/components/breadcrumb.tsx +158 -82
- package/src/components/button.tsx +41 -62
- package/src/components/calendar.tsx +16 -2
- package/src/components/card.tsx +92 -40
- package/src/components/carousel.tsx +240 -115
- package/src/components/centred-layout.tsx +67 -35
- package/src/components/chart.tsx +118 -47
- package/src/components/checkbox.tsx +42 -78
- package/src/components/collapsible.tsx +95 -26
- package/src/components/combobox.tsx +242 -144
- package/src/components/command.tsx +295 -121
- package/src/components/context-menu.tsx +278 -81
- package/src/components/date-picker.tsx +281 -30
- package/src/components/description.tsx +60 -0
- package/src/components/dialog.tsx +162 -86
- package/src/components/drawer.tsx +76 -2
- package/src/components/dropdown-menu.tsx +143 -37
- package/src/components/field.tsx +36 -11
- package/src/components/global-layout.tsx +116 -77
- package/src/components/hover-card.tsx +54 -14
- package/src/components/input-group.tsx +56 -18
- package/src/components/input-password.tsx +3 -4
- package/src/components/input.tsx +93 -186
- package/src/components/label.tsx +56 -15
- package/src/components/logo.tsx +3 -0
- package/src/components/menubar.tsx +58 -4
- package/src/components/popover.tsx +103 -20
- package/src/components/progress.tsx +82 -60
- package/src/components/radio-group.tsx +40 -0
- package/src/components/rating.tsx +4 -0
- package/src/components/resizable.tsx +119 -31
- package/src/components/scroll-area.tsx +123 -56
- package/src/components/select.tsx +21 -1
- package/src/components/separator.tsx +97 -20
- package/src/components/sheet.tsx +180 -79
- package/src/components/skeleton.tsx +40 -10
- package/src/components/slider.tsx +83 -57
- package/src/components/sonner.tsx +10 -7
- package/src/components/split-layout.tsx +4 -1
- package/src/index.ts +1 -1
- package/dist/input-base.cjs +0 -1
- package/dist/input-base.d.ts +0 -28
- package/dist/input-base.d.ts.map +0 -1
- package/dist/input-base.js +0 -56
- package/src/components/input-base.tsx +0 -86
package/dist/carousel.js
CHANGED
|
@@ -1,185 +1,199 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
4
|
-
import { ArrowLeft as I, ArrowRight as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { Button as
|
|
7
|
-
const
|
|
8
|
-
function
|
|
9
|
-
const e =
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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:
|
|
83
|
-
className:
|
|
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__ */
|
|
95
|
+
children: /* @__PURE__ */ s(
|
|
89
96
|
"div",
|
|
90
97
|
{
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
98
|
+
ref: t,
|
|
99
|
+
className: f(
|
|
100
|
+
"flex",
|
|
101
|
+
n ? "-mt-4 h-full w-full flex-col" : "-ml-4"
|
|
95
102
|
),
|
|
96
|
-
...
|
|
103
|
+
...l
|
|
97
104
|
}
|
|
98
105
|
)
|
|
99
106
|
}
|
|
100
107
|
);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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:
|
|
117
|
+
className: f(
|
|
109
118
|
"min-w-0 shrink-0 grow-0 basis-full",
|
|
110
|
-
|
|
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
|
-
...
|
|
124
|
+
...l
|
|
116
125
|
}
|
|
117
126
|
);
|
|
118
|
-
}
|
|
119
|
-
|
|
127
|
+
});
|
|
128
|
+
O.displayName = "CarouselItem";
|
|
129
|
+
function B({
|
|
120
130
|
className: e,
|
|
121
|
-
variant:
|
|
122
|
-
size: t =
|
|
123
|
-
dataHook:
|
|
124
|
-
...
|
|
131
|
+
variant: l = "outline",
|
|
132
|
+
size: t = "default",
|
|
133
|
+
dataHook: a = "carousel-previous",
|
|
134
|
+
...i
|
|
125
135
|
}) {
|
|
126
|
-
const { orientation:
|
|
136
|
+
const { orientation: n, scrollPrev: d, canScrollPrev: m } = C();
|
|
127
137
|
return /* @__PURE__ */ p(
|
|
128
|
-
|
|
138
|
+
N,
|
|
129
139
|
{
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
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:
|
|
137
|
-
disabled: !
|
|
147
|
+
dataHook: a,
|
|
148
|
+
disabled: !m,
|
|
138
149
|
size: t,
|
|
139
|
-
variant:
|
|
150
|
+
variant: l,
|
|
140
151
|
onClick: d,
|
|
141
|
-
...
|
|
152
|
+
...i,
|
|
142
153
|
children: [
|
|
143
|
-
/* @__PURE__ */
|
|
144
|
-
/* @__PURE__ */
|
|
154
|
+
/* @__PURE__ */ s(I, {}),
|
|
155
|
+
/* @__PURE__ */ s("span", { className: "sr-only", children: "Previous slide" })
|
|
145
156
|
]
|
|
146
157
|
}
|
|
147
158
|
);
|
|
148
159
|
}
|
|
149
|
-
|
|
160
|
+
B.displayName = "CarouselPrevious";
|
|
161
|
+
function U({
|
|
150
162
|
className: e,
|
|
151
|
-
variant:
|
|
152
|
-
size: t =
|
|
153
|
-
dataHook:
|
|
154
|
-
...
|
|
163
|
+
variant: l = "outline",
|
|
164
|
+
size: t = "default",
|
|
165
|
+
dataHook: a = "carousel-next",
|
|
166
|
+
...i
|
|
155
167
|
}) {
|
|
156
|
-
const { orientation:
|
|
168
|
+
const { orientation: n, scrollNext: d, canScrollNext: m } = C();
|
|
157
169
|
return /* @__PURE__ */ p(
|
|
158
|
-
|
|
170
|
+
N,
|
|
159
171
|
{
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
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:
|
|
167
|
-
disabled: !
|
|
179
|
+
dataHook: a,
|
|
180
|
+
disabled: !m,
|
|
168
181
|
size: t,
|
|
169
|
-
variant:
|
|
182
|
+
variant: l,
|
|
170
183
|
onClick: d,
|
|
171
|
-
...
|
|
184
|
+
...i,
|
|
172
185
|
children: [
|
|
173
|
-
/* @__PURE__ */
|
|
174
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
195
|
+
L as CarouselContent,
|
|
182
196
|
O as CarouselItem,
|
|
183
|
-
|
|
184
|
-
|
|
197
|
+
U as CarouselNext,
|
|
198
|
+
B as CarouselPrevious
|
|
185
199
|
};
|
package/dist/centred-layout.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react/jsx-runtime"),x=require("react"),b=require("@brightlocal/ui-components/lib/utils");function g(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const y=g(x);var n=(e=>(e.XL="xl",e.LG="lg",e.MD="md",e.SM="sm",e))(n||{});const l=y.forwardRef(({className:e,breakpoint:r="xl",maxWidth:t,children:a,dataHook:c,trackingEl:o,trackingLabel:s,...u},i)=>{const d={xl:"max-w-7xl",lg:"max-w-5xl",md:"max-w-3xl",sm:"max-w-2xl"},m=t!==void 0?{maxWidth:typeof t=="number"?`${t}px`:t}:void 0;return f.jsx("div",{ref:i,className:b.cn("bg-background flex min-h-screen items-center justify-center p-6",!t&&d[r],e),"data-hook":c,"data-slot":"centred-layout","data-tracking-el":o,"data-tracking-label":s,style:m,...u,children:a})});l.displayName="CentredLayout";exports.CentredLayout=l;exports.CentredLayoutBreakpoint=n;
|
package/dist/centred-layout.d.ts
CHANGED
|
@@ -35,7 +35,20 @@ export declare enum CentredLayoutBreakpoint {
|
|
|
35
35
|
}
|
|
36
36
|
interface CentredLayoutProps extends React.ComponentProps<"div"> {
|
|
37
37
|
/**
|
|
38
|
-
*
|
|
38
|
+
* Data hook for automated testing (required)
|
|
39
|
+
*/
|
|
40
|
+
dataHook: string;
|
|
41
|
+
/**
|
|
42
|
+
* Tracking element identifier for analytics
|
|
43
|
+
*/
|
|
44
|
+
trackingEl?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Tracking label for analytics context
|
|
47
|
+
*/
|
|
48
|
+
trackingLabel?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Breakpoint size variant
|
|
51
|
+
* @default "xl"
|
|
39
52
|
*/
|
|
40
53
|
breakpoint?: CentredLayoutBreakpoint;
|
|
41
54
|
/**
|
|
@@ -43,7 +56,10 @@ interface CentredLayoutProps extends React.ComponentProps<"div"> {
|
|
|
43
56
|
*/
|
|
44
57
|
maxWidth?: string | number;
|
|
45
58
|
}
|
|
46
|
-
|
|
59
|
+
/**
|
|
60
|
+
* CentredLayout component for centering content with responsive max-width constraints.
|
|
61
|
+
*/
|
|
62
|
+
declare const CentredLayout: React.ForwardRefExoticComponent<Omit<CentredLayoutProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
47
63
|
export { CentredLayout };
|
|
48
64
|
export type { CentredLayoutProps };
|
|
49
65
|
//# 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,
|
|
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,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"}
|
package/dist/centred-layout.js
CHANGED
|
@@ -1,35 +1,48 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import * as i from "react";
|
|
3
|
+
import { cn as f } from "@brightlocal/ui-components/lib/utils";
|
|
4
|
+
var g = /* @__PURE__ */ ((a) => (a.XL = "xl", a.LG = "lg", a.MD = "md", a.SM = "sm", a))(g || {});
|
|
5
|
+
const p = i.forwardRef(
|
|
6
|
+
({
|
|
7
|
+
className: a,
|
|
8
|
+
breakpoint: l = "xl",
|
|
9
|
+
maxWidth: t,
|
|
10
|
+
children: e,
|
|
11
|
+
dataHook: r,
|
|
12
|
+
trackingEl: m,
|
|
13
|
+
trackingLabel: s,
|
|
14
|
+
...o
|
|
15
|
+
}, x) => {
|
|
16
|
+
const c = {
|
|
17
|
+
xl: "max-w-7xl",
|
|
18
|
+
lg: "max-w-5xl",
|
|
19
|
+
md: "max-w-3xl",
|
|
20
|
+
sm: "max-w-2xl"
|
|
21
|
+
}, n = t !== void 0 ? {
|
|
22
|
+
maxWidth: typeof t == "number" ? `${t}px` : t
|
|
23
|
+
} : void 0;
|
|
24
|
+
return /* @__PURE__ */ d(
|
|
25
|
+
"div",
|
|
26
|
+
{
|
|
27
|
+
ref: x,
|
|
28
|
+
className: f(
|
|
29
|
+
"bg-background flex min-h-screen items-center justify-center p-6",
|
|
30
|
+
!t && c[l],
|
|
31
|
+
a
|
|
32
|
+
),
|
|
33
|
+
"data-hook": r,
|
|
34
|
+
"data-slot": "centred-layout",
|
|
35
|
+
"data-tracking-el": m,
|
|
36
|
+
"data-tracking-label": s,
|
|
37
|
+
style: n,
|
|
38
|
+
...o,
|
|
39
|
+
children: e
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
p.displayName = "CentredLayout";
|
|
32
45
|
export {
|
|
33
|
-
|
|
34
|
-
|
|
46
|
+
p as CentredLayout,
|
|
47
|
+
g as CentredLayoutBreakpoint
|
|
35
48
|
};
|
package/dist/chart.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
[data-chart=${
|
|
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=${
|
|
6
|
+
.${c} [data-chart=${t}] {
|
|
7
7
|
--color-${n}: ${u.replace(/^hsl\((.*)\)$/,"$1")};
|
|
8
8
|
}
|
|
9
9
|
`).join(""):""}).join(`
|
|
10
|
-
`)}}):null}function
|
|
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=$;
|
package/dist/chart.d.ts
CHANGED
|
@@ -15,34 +15,76 @@ export interface ChartConfig {
|
|
|
15
15
|
type ChartContextProps = {
|
|
16
16
|
config: ChartConfig;
|
|
17
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* Props for the ChartContainer component.
|
|
20
|
+
*/
|
|
18
21
|
interface ChartContainerProps extends React.ComponentProps<"div">, ChartContextProps {
|
|
22
|
+
/**
|
|
23
|
+
* Chart content (typically a Recharts chart component)
|
|
24
|
+
*/
|
|
19
25
|
children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>["children"];
|
|
26
|
+
/**
|
|
27
|
+
* Configuration object for chart colors and labels
|
|
28
|
+
*/
|
|
20
29
|
config: ChartConfig;
|
|
30
|
+
/**
|
|
31
|
+
* Data hook for automated testing (required)
|
|
32
|
+
*/
|
|
21
33
|
dataHook: string;
|
|
34
|
+
/**
|
|
35
|
+
* Tracking element identifier for analytics
|
|
36
|
+
*/
|
|
22
37
|
trackingEl?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Tracking label for analytics context
|
|
40
|
+
*/
|
|
23
41
|
trackingLabel?: string;
|
|
24
42
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
43
|
+
/**
|
|
44
|
+
* ChartContainer wraps Recharts charts with theme-aware styling,
|
|
45
|
+
* responsive container, and configuration context.
|
|
46
|
+
*/
|
|
47
|
+
declare const ChartContainer: React.ForwardRefExoticComponent<Omit<ChartContainerProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
29
48
|
declare function ChartStyle({ id, config }: {
|
|
30
49
|
id: string;
|
|
31
50
|
config: ChartConfig;
|
|
32
51
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
52
|
+
/**
|
|
53
|
+
* Props for the ChartTooltip component.
|
|
54
|
+
*/
|
|
33
55
|
interface ChartTooltipProps extends React.ComponentProps<typeof RechartsPrimitive.Tooltip> {
|
|
56
|
+
/** Hide the tooltip label */
|
|
34
57
|
hideLabel?: boolean;
|
|
58
|
+
/** Hide the color indicator */
|
|
35
59
|
hideIndicator?: boolean;
|
|
60
|
+
/** Style of the color indicator */
|
|
36
61
|
indicator?: "line" | "dot" | "dashed";
|
|
62
|
+
/** Key to use for the series name */
|
|
37
63
|
nameKey?: string;
|
|
64
|
+
/** Key to use for the label */
|
|
38
65
|
labelKey?: string;
|
|
39
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* ChartTooltip displays data values on hover.
|
|
69
|
+
*/
|
|
40
70
|
declare function ChartTooltip({ ...props }: ChartTooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
71
|
+
declare namespace ChartTooltip {
|
|
72
|
+
var displayName: string;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Props for the ChartTooltipContent component.
|
|
76
|
+
*/
|
|
41
77
|
interface ChartTooltipContentProps extends React.ComponentProps<"div">, Pick<ChartTooltipProps, "hideLabel" | "hideIndicator" | "indicator" | "nameKey" | "labelKey"> {
|
|
78
|
+
/** Custom label formatter function */
|
|
42
79
|
labelFormatter?: (value: unknown, payload: unknown[]) => React.ReactNode;
|
|
80
|
+
/** Additional CSS class for the label */
|
|
43
81
|
labelClassName?: string;
|
|
82
|
+
/** Custom value formatter function */
|
|
44
83
|
formatter?: (value: unknown, name: string, item: unknown, index: number, payload: unknown[]) => React.ReactNode;
|
|
45
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* ChartTooltipContent renders the content inside the tooltip.
|
|
87
|
+
*/
|
|
46
88
|
declare function ChartTooltipContent({ active, payload, className, indicator, hideLabel, hideIndicator, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, }: ChartTooltipContentProps & {
|
|
47
89
|
active?: boolean;
|
|
48
90
|
payload?: Array<{
|
|
@@ -58,22 +100,43 @@ declare function ChartTooltipContent({ active, payload, className, indicator, hi
|
|
|
58
100
|
declare namespace ChartTooltipContent {
|
|
59
101
|
var displayName: string;
|
|
60
102
|
}
|
|
103
|
+
/**
|
|
104
|
+
* Props for the ChartLegend component.
|
|
105
|
+
*/
|
|
61
106
|
interface ChartLegendProps extends React.ComponentProps<typeof RechartsPrimitive.Legend> {
|
|
107
|
+
/** Key to use for the series name */
|
|
62
108
|
nameKey?: string;
|
|
63
109
|
}
|
|
110
|
+
/**
|
|
111
|
+
* ChartLegend displays a legend for the chart series.
|
|
112
|
+
*/
|
|
64
113
|
declare function ChartLegend({ ...props }: ChartLegendProps): import("react/jsx-runtime").JSX.Element;
|
|
114
|
+
declare namespace ChartLegend {
|
|
115
|
+
var displayName: string;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Props for the ChartLegendContent component.
|
|
119
|
+
*/
|
|
65
120
|
interface ChartLegendContentProps extends React.ComponentProps<"div">, Pick<ChartLegendProps, "nameKey"> {
|
|
121
|
+
/** Hide the series icon in the legend */
|
|
66
122
|
hideIcon?: boolean;
|
|
123
|
+
/** Legend payload from Recharts (automatically provided) */
|
|
67
124
|
payload?: Array<{
|
|
68
125
|
value: string;
|
|
69
126
|
dataKey: string;
|
|
70
127
|
color?: string;
|
|
71
128
|
payload: Record<string, unknown>;
|
|
72
129
|
}>;
|
|
73
|
-
|
|
74
|
-
|
|
130
|
+
/**
|
|
131
|
+
* Vertical alignment of the legend relative to the chart
|
|
132
|
+
* @default "bottom"
|
|
133
|
+
*/
|
|
75
134
|
verticalAlign?: "top" | "bottom";
|
|
76
|
-
}
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* ChartLegendContent renders the content inside the legend.
|
|
138
|
+
*/
|
|
139
|
+
declare function ChartLegendContent({ className, hideIcon, payload, verticalAlign, nameKey, }: ChartLegendContentProps): import("react/jsx-runtime").JSX.Element | null;
|
|
77
140
|
declare namespace ChartLegendContent {
|
|
78
141
|
var displayName: string;
|
|
79
142
|
}
|