@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.
- 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.cjs +1 -1
- package/dist/alert.d.ts +22 -1
- package/dist/alert.d.ts.map +1 -1
- package/dist/alert.js +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 +38 -307
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +411 -508
- 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 +16 -1
- package/dist/calendar.d.ts.map +1 -1
- package/dist/calendar.js +31 -29
- 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 -15
- package/dist/centred-layout.d.ts.map +1 -1
- package/dist/centred-layout.js +44 -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 +28 -18
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +191 -160
- 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 +120 -122
- 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 +221 -82
- 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 +26 -6
- package/dist/field.d.ts.map +1 -1
- package/dist/field.js +55 -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 +367 -386
- 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-otp.cjs +1 -1
- package/dist/input-otp.js +1 -1
- package/dist/input-password.cjs +1 -1
- package/dist/input-password.d.ts.map +1 -1
- package/dist/input-password.js +25 -26
- 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/link.cjs +1 -1
- package/dist/link.js +1 -1
- package/dist/logo.cjs +1 -1
- package/dist/logo.d.ts +9 -4
- package/dist/logo.d.ts.map +1 -1
- package/dist/logo.js +20 -21
- package/dist/menubar.cjs +1 -1
- package/dist/menubar.d.ts +43 -6
- package/dist/menubar.d.ts.map +1 -1
- package/dist/menubar.js +100 -78
- package/dist/navigation-menu.cjs +1 -1
- package/dist/navigation-menu.d.ts +6 -54
- package/dist/navigation-menu.d.ts.map +1 -1
- package/dist/navigation-menu.js +73 -84
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.d.ts +8 -10
- package/dist/pagination.d.ts.map +1 -1
- package/dist/pagination.js +78 -86
- 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.cjs +1 -1
- package/dist/radio-group.d.ts +33 -10
- package/dist/radio-group.d.ts.map +1 -1
- package/dist/radio-group.js +56 -66
- 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 +58 -6
- package/dist/resizable.d.ts.map +1 -1
- package/dist/resizable.js +38 -37
- 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 +52 -5
- package/dist/separator.d.ts.map +1 -1
- package/dist/separator.js +45 -35
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +85 -19
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +117 -115
- 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 +21 -22
- package/dist/sonner.d.ts.map +1 -1
- package/dist/sonner.js +46 -48
- package/dist/split-layout.d.ts +4 -1
- package/dist/split-layout.d.ts.map +1 -1
- package/dist/switch.cjs +1 -1
- package/dist/switch.d.ts +2 -12
- package/dist/switch.d.ts.map +1 -1
- package/dist/switch.js +37 -41
- package/dist/table.cjs +1 -1
- package/dist/table.d.ts +16 -12
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +56 -58
- package/dist/tabs.d.ts +27 -3
- package/dist/tabs.d.ts.map +1 -1
- package/dist/toggle-group.cjs +1 -1
- package/dist/toggle-group.d.ts +57 -7
- package/dist/toggle-group.d.ts.map +1 -1
- package/dist/toggle-group.js +60 -67
- package/dist/toggle.cjs +1 -1
- package/dist/toggle.d.ts +12 -26
- package/dist/toggle.d.ts.map +1 -1
- package/dist/toggle.js +16 -20
- package/package.json +9 -3
- package/src/blocks/data-table.tsx +43 -33
- package/src/blocks/sidebar.tsx +158 -541
- package/src/components/accordion.tsx +164 -78
- package/src/components/alert-dialog.tsx +156 -111
- package/src/components/alert.tsx +27 -14
- 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 +159 -83
- package/src/components/button.tsx +42 -63
- package/src/components/calendar.tsx +22 -6
- package/src/components/card.tsx +92 -40
- package/src/components/carousel.tsx +240 -115
- package/src/components/centred-layout.tsx +68 -49
- package/src/components/chart.tsx +118 -47
- package/src/components/checkbox.tsx +43 -79
- package/src/components/collapsible.tsx +95 -26
- package/src/components/combobox.tsx +243 -153
- package/src/components/command.tsx +295 -121
- package/src/components/context-menu.tsx +279 -82
- package/src/components/date-picker.tsx +282 -31
- package/src/components/description.tsx +60 -0
- package/src/components/dialog.tsx +163 -87
- package/src/components/drawer.tsx +76 -2
- package/src/components/dropdown-menu.tsx +143 -37
- package/src/components/field.tsx +38 -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-otp.tsx +1 -1
- package/src/components/input-password.tsx +4 -5
- package/src/components/input.tsx +93 -186
- package/src/components/label.tsx +56 -15
- package/src/components/link.tsx +1 -1
- package/src/components/logo.tsx +12 -7
- package/src/components/menubar.tsx +61 -5
- package/src/components/navigation-menu.tsx +37 -99
- package/src/components/pagination.tsx +13 -19
- package/src/components/popover.tsx +103 -20
- package/src/components/progress.tsx +82 -60
- package/src/components/radio-group.tsx +44 -25
- package/src/components/rating.tsx +4 -0
- package/src/components/resizable.tsx +88 -38
- package/src/components/scroll-area.tsx +123 -56
- package/src/components/select.tsx +22 -2
- package/src/components/separator.tsx +101 -24
- package/src/components/sheet.tsx +186 -90
- package/src/components/skeleton.tsx +40 -10
- package/src/components/slider.tsx +83 -57
- package/src/components/sonner.tsx +34 -34
- package/src/components/split-layout.tsx +4 -1
- package/src/components/switch.figma.tsx +7 -11
- package/src/components/switch.tsx +9 -19
- package/src/components/table.tsx +23 -18
- package/src/components/tabs.tsx +27 -3
- package/src/components/toggle-group.tsx +115 -86
- package/src/components/toggle.figma.tsx +13 -19
- package/src/components/toggle.tsx +20 -34
- 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"),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;
|
package/dist/centred-layout.d.ts
CHANGED
|
@@ -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
|
|
22
|
+
export type CentredLayoutBreakpoint = "xl" | "lg" | "md" | "sm";
|
|
23
|
+
interface CentredLayoutProps extends React.ComponentProps<"div"> {
|
|
19
24
|
/**
|
|
20
|
-
*
|
|
25
|
+
* Data hook for automated testing (required)
|
|
21
26
|
*/
|
|
22
|
-
|
|
27
|
+
dataHook: string;
|
|
23
28
|
/**
|
|
24
|
-
*
|
|
29
|
+
* Tracking element identifier for analytics
|
|
25
30
|
*/
|
|
26
|
-
|
|
31
|
+
trackingEl?: string;
|
|
27
32
|
/**
|
|
28
|
-
*
|
|
33
|
+
* Tracking label for analytics context
|
|
29
34
|
*/
|
|
30
|
-
|
|
35
|
+
trackingLabel?: string;
|
|
31
36
|
/**
|
|
32
|
-
*
|
|
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
|
-
|
|
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
|
|
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"}
|
package/dist/centred-layout.js
CHANGED
|
@@ -1,35 +1,46 @@
|
|
|
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 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
|
-
|
|
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
|
|
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=$;
|