@cfx-dev/ui-components 5.0.25 → 5.0.27
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/{BurgerMenu.module-DA0ojIYf.js → BurgerMenu.module-Dy-zFg88.js} +4 -3
- package/dist/assets/all_css.css +1 -0
- package/dist/assets/css/BurgerMenu.css +1 -1
- package/dist/assets/css/Button.css +1 -1
- package/dist/assets/css/Lightbox.css +1 -0
- package/dist/assets/general/global.css +1 -1
- package/dist/components/BurgerMenu/BurgerMenu.d.ts +4 -2
- package/dist/components/BurgerMenu/BurgerMenu.js +55 -54
- package/dist/components/BurgerMenu/BurgerMenuButton.js +1 -1
- package/dist/components/BurgerMenu/BurgerMenuShowcase.js +26 -23
- package/dist/components/Button/Button.d.ts +2 -1
- package/dist/components/Button/Button.js +71 -65
- package/dist/components/Button/ButtonShowcase.js +46 -22
- package/dist/components/Lightbox/Lightbox.d.ts +9 -0
- package/dist/components/Lightbox/Lightbox.js +172 -0
- package/dist/components/Lightbox/LightboxShowcase.d.ts +6 -0
- package/dist/components/Lightbox/LightboxShowcase.js +137 -0
- package/dist/components/Lightbox/index.d.ts +2 -0
- package/dist/components/Lightbox/index.js +4 -0
- package/dist/components/Lightbox/types.d.ts +51 -0
- package/dist/components/Lightbox/types.js +1 -0
- package/dist/components/Logos/fivem/WhiteLogo.js +9 -9
- package/dist/components/Logos/redm/WhiteLogo.js +8 -30
- package/dist/components/Shroud/Shroud.js +3 -3
- package/dist/components/Table/TableCell.js +35 -33
- package/dist/embla-carousel-react.esm-BE464U1q.js +1252 -0
- package/dist/main.d.ts +2 -1
- package/dist/main.js +225 -224
- package/dist/styles-scss/tokens.scss +1 -1
- package/dist/utils/contexts/AnalyticsContext/AnalyticsContext.d.ts +15 -2
- package/dist/utils/contexts/AnalyticsContext/AnalyticsContext.js +9 -3
- package/dist/utils/contexts/AnalyticsContext/index.d.ts +2 -2
- package/dist/utils/contexts/AnalyticsContext/index.js +8 -7
- package/dist/utils/contexts/AnalyticsContext/useSiteLinkClick.js +12 -12
- package/dist/utils/hooks/useBodyScrollLock.d.ts +1 -0
- package/dist/utils/hooks/useBodyScrollLock.js +9 -0
- package/dist/utils/hooks/useCarousel.js +17 -1264
- package/dist/utils/hooks/useKeyboardArrows.d.ts +5 -0
- package/dist/utils/hooks/useKeyboardArrows.js +13 -0
- package/dist/utils/hooks/useLightbox.d.ts +21 -0
- package/dist/utils/hooks/useLightbox.js +80 -0
- package/dist/utils/hooks/usePopoverController.js +25 -22
- package/package.json +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import d from "react";
|
|
3
|
+
import t from "../Flex/Flex.js";
|
|
4
4
|
import { Text as n } from "../Text/Text.js";
|
|
5
5
|
import "../../utils/ui/ui.js";
|
|
6
6
|
import i from "./Button.js";
|
|
7
|
-
import { ButtonBar as
|
|
7
|
+
import { ButtonBar as c } from "./ButtonBar.js";
|
|
8
8
|
import { LinkButton as l } from "./LinkButton.js";
|
|
9
9
|
function h() {
|
|
10
|
-
return /* @__PURE__ */ t
|
|
11
|
-
/* @__PURE__ */ t
|
|
10
|
+
return /* @__PURE__ */ r(t, { gap: "large", vertical: !0, children: [
|
|
11
|
+
/* @__PURE__ */ r(t, { gap: "medium", vertical: !0, children: [
|
|
12
12
|
/* @__PURE__ */ e(n, { children: "Default Icon Right" }),
|
|
13
13
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
14
14
|
i,
|
|
@@ -19,7 +19,7 @@ function h() {
|
|
|
19
19
|
}
|
|
20
20
|
) })
|
|
21
21
|
] }),
|
|
22
|
-
/* @__PURE__ */ t
|
|
22
|
+
/* @__PURE__ */ r(t, { gap: "medium", vertical: !0, children: [
|
|
23
23
|
/* @__PURE__ */ e(n, { children: "Default Icon Left" }),
|
|
24
24
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
25
25
|
i,
|
|
@@ -30,7 +30,7 @@ function h() {
|
|
|
30
30
|
}
|
|
31
31
|
) })
|
|
32
32
|
] }),
|
|
33
|
-
/* @__PURE__ */ t
|
|
33
|
+
/* @__PURE__ */ r(t, { gap: "medium", vertical: !0, children: [
|
|
34
34
|
/* @__PURE__ */ e(n, { children: "Primary" }),
|
|
35
35
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
36
36
|
i,
|
|
@@ -41,7 +41,31 @@ function h() {
|
|
|
41
41
|
}
|
|
42
42
|
) })
|
|
43
43
|
] }),
|
|
44
|
-
/* @__PURE__ */ t
|
|
44
|
+
/* @__PURE__ */ r(t, { gap: "medium", vertical: !0, children: [
|
|
45
|
+
/* @__PURE__ */ e(n, { children: "Primary With Border Shredded" }),
|
|
46
|
+
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
47
|
+
i,
|
|
48
|
+
{
|
|
49
|
+
text: "Sign In",
|
|
50
|
+
theme: "primary",
|
|
51
|
+
icon: "Users",
|
|
52
|
+
borderShredded: !0
|
|
53
|
+
}
|
|
54
|
+
) })
|
|
55
|
+
] }),
|
|
56
|
+
/* @__PURE__ */ r(t, { gap: "medium", vertical: !0, children: [
|
|
57
|
+
/* @__PURE__ */ e(n, { children: "Secondary With Border Shredded" }),
|
|
58
|
+
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
59
|
+
i,
|
|
60
|
+
{
|
|
61
|
+
text: "Sign In",
|
|
62
|
+
theme: "secondary",
|
|
63
|
+
icon: "Users",
|
|
64
|
+
borderShredded: !0
|
|
65
|
+
}
|
|
66
|
+
) })
|
|
67
|
+
] }),
|
|
68
|
+
/* @__PURE__ */ r(t, { gap: "medium", vertical: !0, children: [
|
|
45
69
|
/* @__PURE__ */ e(n, { children: "Secondary" }),
|
|
46
70
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
47
71
|
i,
|
|
@@ -52,7 +76,7 @@ function h() {
|
|
|
52
76
|
}
|
|
53
77
|
) })
|
|
54
78
|
] }),
|
|
55
|
-
/* @__PURE__ */ t
|
|
79
|
+
/* @__PURE__ */ r(t, { gap: "medium", vertical: !0, children: [
|
|
56
80
|
/* @__PURE__ */ e(n, { children: "Tertiary (Default)" }),
|
|
57
81
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
58
82
|
i,
|
|
@@ -63,7 +87,7 @@ function h() {
|
|
|
63
87
|
}
|
|
64
88
|
) })
|
|
65
89
|
] }),
|
|
66
|
-
/* @__PURE__ */ t
|
|
90
|
+
/* @__PURE__ */ r(t, { gap: "medium", vertical: !0, children: [
|
|
67
91
|
/* @__PURE__ */ e(n, { children: "On Light" }),
|
|
68
92
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
69
93
|
i,
|
|
@@ -74,7 +98,7 @@ function h() {
|
|
|
74
98
|
}
|
|
75
99
|
) })
|
|
76
100
|
] }),
|
|
77
|
-
/* @__PURE__ */ t
|
|
101
|
+
/* @__PURE__ */ r(t, { gap: "medium", vertical: !0, children: [
|
|
78
102
|
/* @__PURE__ */ e(n, { children: "Quick Link" }),
|
|
79
103
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
80
104
|
i,
|
|
@@ -85,7 +109,7 @@ function h() {
|
|
|
85
109
|
}
|
|
86
110
|
) })
|
|
87
111
|
] }),
|
|
88
|
-
/* @__PURE__ */ t
|
|
112
|
+
/* @__PURE__ */ r(t, { gap: "medium", vertical: !0, children: [
|
|
89
113
|
/* @__PURE__ */ e(n, { children: "No Icon" }),
|
|
90
114
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
91
115
|
i,
|
|
@@ -95,7 +119,7 @@ function h() {
|
|
|
95
119
|
}
|
|
96
120
|
) })
|
|
97
121
|
] }),
|
|
98
|
-
/* @__PURE__ */ t
|
|
122
|
+
/* @__PURE__ */ r(t, { gap: "medium", vertical: !0, children: [
|
|
99
123
|
/* @__PURE__ */ e(n, { children: "Disabled" }),
|
|
100
124
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
101
125
|
i,
|
|
@@ -107,7 +131,7 @@ function h() {
|
|
|
107
131
|
}
|
|
108
132
|
) })
|
|
109
133
|
] }),
|
|
110
|
-
/* @__PURE__ */ t
|
|
134
|
+
/* @__PURE__ */ r(t, { gap: "medium", vertical: !0, children: [
|
|
111
135
|
/* @__PURE__ */ e(n, { children: "Full Width" }),
|
|
112
136
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
113
137
|
i,
|
|
@@ -119,9 +143,9 @@ function h() {
|
|
|
119
143
|
}
|
|
120
144
|
) })
|
|
121
145
|
] }),
|
|
122
|
-
/* @__PURE__ */ t
|
|
146
|
+
/* @__PURE__ */ r(t, { gap: "medium", vertical: !0, children: [
|
|
123
147
|
/* @__PURE__ */ e(n, { children: "Linked" }),
|
|
124
|
-
/* @__PURE__ */ t
|
|
148
|
+
/* @__PURE__ */ r(t, { p: 4, style: { backgroundColor: "var(--color-modal-background)" }, children: [
|
|
125
149
|
/* @__PURE__ */ e(
|
|
126
150
|
i,
|
|
127
151
|
{
|
|
@@ -141,7 +165,7 @@ function h() {
|
|
|
141
165
|
)
|
|
142
166
|
] })
|
|
143
167
|
] }),
|
|
144
|
-
/* @__PURE__ */ t
|
|
168
|
+
/* @__PURE__ */ r(t, { gap: "medium", vertical: !0, children: [
|
|
145
169
|
/* @__PURE__ */ e(n, { children: "LinkButton - look like button but its anchor" }),
|
|
146
170
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
147
171
|
l,
|
|
@@ -153,16 +177,16 @@ function h() {
|
|
|
153
177
|
}
|
|
154
178
|
) })
|
|
155
179
|
] }),
|
|
156
|
-
/* @__PURE__ */ t
|
|
180
|
+
/* @__PURE__ */ r(t, { gap: "medium", vertical: !0, children: [
|
|
157
181
|
/* @__PURE__ */ e(n, { children: "Button Bar" }),
|
|
158
|
-
/* @__PURE__ */ e("div", { children: /* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ r(c, { children: [
|
|
159
183
|
/* @__PURE__ */ e(i, { text: "Sign In", theme: "primary", icon: "Users" }),
|
|
160
184
|
/* @__PURE__ */ e(i, { text: "Register", theme: "secondary", icon: "Users" }),
|
|
161
185
|
/* @__PURE__ */ e(i, { text: "Sign Out", theme: "on-light", icon: "Users" }),
|
|
162
186
|
/* @__PURE__ */ e(i, { text: "Create Account", theme: "tertiary", icon: "Users" })
|
|
163
187
|
] }) })
|
|
164
188
|
] }),
|
|
165
|
-
/* @__PURE__ */ t
|
|
189
|
+
/* @__PURE__ */ r(t, { gap: "medium", vertical: !0, children: [
|
|
166
190
|
/* @__PURE__ */ e(n, { children: "Long text" }),
|
|
167
191
|
/* @__PURE__ */ e("div", { style: { maxWidth: "300px" }, children: /* @__PURE__ */ e(
|
|
168
192
|
i,
|
|
@@ -175,7 +199,7 @@ function h() {
|
|
|
175
199
|
] })
|
|
176
200
|
] });
|
|
177
201
|
}
|
|
178
|
-
const x =
|
|
202
|
+
const x = d.memo(h);
|
|
179
203
|
export {
|
|
180
204
|
x as default
|
|
181
205
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { LightboxImageComponentProps, LightboxProps, VideoComponentProps } from './types';
|
|
3
|
+
|
|
4
|
+
interface LightboxComponentProps extends LightboxProps {
|
|
5
|
+
LightboxImageComponent: React.ComponentType<LightboxImageComponentProps>;
|
|
6
|
+
VideoComponent: React.ComponentType<VideoComponentProps>;
|
|
7
|
+
}
|
|
8
|
+
declare function Lightbox({ LightboxImageComponent, VideoComponent, ...props }: LightboxComponentProps): import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
export default Lightbox;
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { jsx as t, jsxs as b, Fragment as P } from "react/jsx-runtime";
|
|
2
|
+
import l from "react";
|
|
3
|
+
import d from "../Flex/Flex.js";
|
|
4
|
+
import { clsx as x } from "../../utils/clsx.js";
|
|
5
|
+
import m from "../IconButton/IconButton.js";
|
|
6
|
+
import { Text as S } from "../Text/Text.js";
|
|
7
|
+
import "../../utils/ui/ui.js";
|
|
8
|
+
import "../../utils/hooks/useGlobalKeyboardEvent.js";
|
|
9
|
+
import { useKeyboardClose as K } from "../../utils/hooks/useKeyboardClose.js";
|
|
10
|
+
import "../../index-CUyjBl1Y.js";
|
|
11
|
+
import { useKeyboardArrows as M } from "../../utils/hooks/useKeyboardArrows.js";
|
|
12
|
+
import { useLightbox as z } from "../../utils/hooks/useLightbox.js";
|
|
13
|
+
const V = "cfxui__Lightbox__lightboxOverlay__dc0eb", A = "cfxui__Lightbox__lightboxContainer__26f04", F = "cfxui__Lightbox__lightboxImageContainer__eea35", $ = "cfxui__Lightbox__lightboxImage__0f73c", j = "cfxui__Lightbox__lightboxVideo__cffdb", T = "cfxui__Lightbox__lightboxControlBtn__41c50", q = "cfxui__Lightbox__lightboxClose__b2b96", G = "cfxui__Lightbox__lightboxNav__60d29", H = "cfxui__Lightbox__lightboxPrev__35acc", J = "cfxui__Lightbox__lightboxNext__09f51", Q = "cfxui__Lightbox__lightboxCounter__8824a", W = "cfxui__Lightbox__lightboxEmbla__546be", X = "cfxui__Lightbox__lightboxEmblaContainer__3b54b", Y = "cfxui__Lightbox__lightboxEmblaSlide__64f0b", o = {
|
|
14
|
+
lightboxOverlay: V,
|
|
15
|
+
lightboxContainer: A,
|
|
16
|
+
lightboxImageContainer: F,
|
|
17
|
+
lightboxImage: $,
|
|
18
|
+
lightboxVideo: j,
|
|
19
|
+
lightboxControlBtn: T,
|
|
20
|
+
lightboxClose: q,
|
|
21
|
+
lightboxNav: G,
|
|
22
|
+
lightboxPrev: H,
|
|
23
|
+
lightboxNext: J,
|
|
24
|
+
lightboxCounter: Q,
|
|
25
|
+
lightboxEmbla: W,
|
|
26
|
+
lightboxEmblaContainer: X,
|
|
27
|
+
lightboxEmblaSlide: Y
|
|
28
|
+
};
|
|
29
|
+
function he({
|
|
30
|
+
LightboxImageComponent: v,
|
|
31
|
+
VideoComponent: p,
|
|
32
|
+
...N
|
|
33
|
+
}) {
|
|
34
|
+
const {
|
|
35
|
+
lightboxItems: i,
|
|
36
|
+
currentIndex: a,
|
|
37
|
+
isOpen: r,
|
|
38
|
+
onClose: c,
|
|
39
|
+
onIndexChange: y,
|
|
40
|
+
className: L,
|
|
41
|
+
showNavigation: I = !0,
|
|
42
|
+
showCounter: w = !0,
|
|
43
|
+
showCloseButton: E = !0
|
|
44
|
+
} = N, n = l.useRef(null), h = l.useRef(null), g = l.useRef(!1), {
|
|
45
|
+
emblaRef: R,
|
|
46
|
+
getSelectedIndex: O,
|
|
47
|
+
handlePrevious: s,
|
|
48
|
+
handleNext: _,
|
|
49
|
+
handleOverlayClick: f,
|
|
50
|
+
handleOverlayKeyDown: D
|
|
51
|
+
} = z({
|
|
52
|
+
currentIndex: a,
|
|
53
|
+
isOpen: r,
|
|
54
|
+
onClose: c,
|
|
55
|
+
onIndexChange: y,
|
|
56
|
+
initialIndex: n.current ?? a
|
|
57
|
+
}), C = O(), k = l.useCallback((e) => {
|
|
58
|
+
e.target === h.current && (g.current = !0);
|
|
59
|
+
}, []), B = l.useCallback((e) => {
|
|
60
|
+
e.target === h.current && g.current && f(e), g.current = !1;
|
|
61
|
+
}, [f]), U = l.useCallback((e) => {
|
|
62
|
+
e === "left" ? s() : e === "right" && _();
|
|
63
|
+
}, [s, _]);
|
|
64
|
+
return M(U), K(c), l.useEffect(() => {
|
|
65
|
+
r && n.current === null && (n.current = a), r || (n.current = null);
|
|
66
|
+
}, [r, a]), !r || !i.length ? null : /* @__PURE__ */ t(
|
|
67
|
+
"div",
|
|
68
|
+
{
|
|
69
|
+
className: x(o.lightboxOverlay, L),
|
|
70
|
+
onMouseDown: k,
|
|
71
|
+
onMouseUp: B,
|
|
72
|
+
onKeyDown: D,
|
|
73
|
+
role: "button",
|
|
74
|
+
"aria-label": "Close lightbox",
|
|
75
|
+
tabIndex: 0,
|
|
76
|
+
ref: h,
|
|
77
|
+
children: /* @__PURE__ */ b("div", { className: o.lightboxContainer, children: [
|
|
78
|
+
" ",
|
|
79
|
+
E && /* @__PURE__ */ t(
|
|
80
|
+
m,
|
|
81
|
+
{
|
|
82
|
+
name: "Close",
|
|
83
|
+
className: x(o.lightboxClose, o.lightboxControlBtn),
|
|
84
|
+
onClick: c,
|
|
85
|
+
"aria-label": "Close lightbox",
|
|
86
|
+
size: "medium"
|
|
87
|
+
}
|
|
88
|
+
),
|
|
89
|
+
/* @__PURE__ */ t("div", { className: o.lightboxImageContainer, children: /* @__PURE__ */ t(
|
|
90
|
+
"div",
|
|
91
|
+
{
|
|
92
|
+
className: o.lightboxEmbla,
|
|
93
|
+
ref: R,
|
|
94
|
+
children: /* @__PURE__ */ t(d, { className: o.lightboxEmblaContainer, children: i.map((e, u) => /* @__PURE__ */ b(
|
|
95
|
+
d,
|
|
96
|
+
{
|
|
97
|
+
centered: !0,
|
|
98
|
+
className: o.lightboxEmblaSlide,
|
|
99
|
+
children: [
|
|
100
|
+
e.type === "video" && e.videoUrl && /* @__PURE__ */ t(
|
|
101
|
+
p,
|
|
102
|
+
{
|
|
103
|
+
src: e.videoUrl,
|
|
104
|
+
title: e.videoTitle,
|
|
105
|
+
className: o.lightboxVideo,
|
|
106
|
+
allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",
|
|
107
|
+
allowFullScreen: !0,
|
|
108
|
+
isActive: u === C
|
|
109
|
+
}
|
|
110
|
+
),
|
|
111
|
+
e.type === "image" && e.src && /* @__PURE__ */ t(
|
|
112
|
+
v,
|
|
113
|
+
{
|
|
114
|
+
src: e.src,
|
|
115
|
+
alt: e.alt ?? `Image ${u + 1} of ${i.length}`,
|
|
116
|
+
placeholder: e.blurDataURL ? "blur" : "empty",
|
|
117
|
+
blurDataURL: e.blurDataURL,
|
|
118
|
+
fill: !0,
|
|
119
|
+
className: o.lightboxImage
|
|
120
|
+
}
|
|
121
|
+
)
|
|
122
|
+
]
|
|
123
|
+
},
|
|
124
|
+
e.id ?? u
|
|
125
|
+
)) })
|
|
126
|
+
},
|
|
127
|
+
r && n.current !== null ? `open-${n.current}` : "closed"
|
|
128
|
+
) }),
|
|
129
|
+
" ",
|
|
130
|
+
I && i.length > 1 && /* @__PURE__ */ b(P, { children: [
|
|
131
|
+
/* @__PURE__ */ t(
|
|
132
|
+
m,
|
|
133
|
+
{
|
|
134
|
+
name: "LeftChevron",
|
|
135
|
+
className: x(o.lightboxNav, o.lightboxPrev, o.lightboxControlBtn),
|
|
136
|
+
onClick: s,
|
|
137
|
+
"aria-label": "Previous image",
|
|
138
|
+
size: "large"
|
|
139
|
+
}
|
|
140
|
+
),
|
|
141
|
+
/* @__PURE__ */ t(
|
|
142
|
+
m,
|
|
143
|
+
{
|
|
144
|
+
name: "RightChevron",
|
|
145
|
+
className: x(o.lightboxNav, o.lightboxNext, o.lightboxControlBtn),
|
|
146
|
+
onClick: _,
|
|
147
|
+
"aria-label": "Next image",
|
|
148
|
+
size: "large"
|
|
149
|
+
}
|
|
150
|
+
)
|
|
151
|
+
] }),
|
|
152
|
+
w && i.length > 1 && /* @__PURE__ */ b(
|
|
153
|
+
S,
|
|
154
|
+
{
|
|
155
|
+
color: "primary",
|
|
156
|
+
size: "xsmall",
|
|
157
|
+
className: o.lightboxCounter,
|
|
158
|
+
children: [
|
|
159
|
+
C + 1,
|
|
160
|
+
" ",
|
|
161
|
+
"/",
|
|
162
|
+
i.length
|
|
163
|
+
]
|
|
164
|
+
}
|
|
165
|
+
)
|
|
166
|
+
] })
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
export {
|
|
171
|
+
he as default
|
|
172
|
+
};
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { jsx as e, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import c from "react";
|
|
3
|
+
import s from "../Flex/Flex.js";
|
|
4
|
+
import { Interactive as m } from "../Interactive/Interactive.js";
|
|
5
|
+
import h from "./Lightbox.js";
|
|
6
|
+
const a = [
|
|
7
|
+
{
|
|
8
|
+
id: "1",
|
|
9
|
+
type: "image",
|
|
10
|
+
src: "https://picsum.photos/1200/800?1",
|
|
11
|
+
alt: "Image 1"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
id: "2",
|
|
15
|
+
type: "image",
|
|
16
|
+
src: "https://picsum.photos/1200/800?2",
|
|
17
|
+
alt: "Image 2"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
id: "3",
|
|
21
|
+
type: "image",
|
|
22
|
+
src: "https://picsum.photos/1200/800?3",
|
|
23
|
+
alt: "Image 3"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: "4",
|
|
27
|
+
type: "video",
|
|
28
|
+
videoUrl: "https://www.youtube.com/embed/dQw4w9WgXcQ",
|
|
29
|
+
videoTitle: "YouTube Demo Video"
|
|
30
|
+
}
|
|
31
|
+
];
|
|
32
|
+
function p({
|
|
33
|
+
src: r,
|
|
34
|
+
alt: o,
|
|
35
|
+
width: n,
|
|
36
|
+
height: i,
|
|
37
|
+
className: t
|
|
38
|
+
}) {
|
|
39
|
+
return /* @__PURE__ */ e(
|
|
40
|
+
"img",
|
|
41
|
+
{
|
|
42
|
+
src: r,
|
|
43
|
+
alt: o,
|
|
44
|
+
width: n,
|
|
45
|
+
height: i,
|
|
46
|
+
className: t,
|
|
47
|
+
style: {
|
|
48
|
+
objectFit: "cover",
|
|
49
|
+
width: "100%",
|
|
50
|
+
height: "100%"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
function u({
|
|
56
|
+
src: r,
|
|
57
|
+
className: o,
|
|
58
|
+
title: n,
|
|
59
|
+
allow: i,
|
|
60
|
+
allowFullScreen: t
|
|
61
|
+
}) {
|
|
62
|
+
return /* @__PURE__ */ e(
|
|
63
|
+
"iframe",
|
|
64
|
+
{
|
|
65
|
+
src: r,
|
|
66
|
+
title: n,
|
|
67
|
+
className: o,
|
|
68
|
+
allow: i,
|
|
69
|
+
allowFullScreen: t,
|
|
70
|
+
style: {
|
|
71
|
+
width: "100%",
|
|
72
|
+
height: "100%",
|
|
73
|
+
border: 0
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
function I() {
|
|
79
|
+
const [r, o] = c.useState(!1), [n, i] = c.useState(0);
|
|
80
|
+
return /* @__PURE__ */ e(s, { direction: "column", gap: "large", children: /* @__PURE__ */ d(s, { direction: "column", gap: "small", children: [
|
|
81
|
+
/* @__PURE__ */ e("h4", { children: "Default" }),
|
|
82
|
+
/* @__PURE__ */ e(s, { gap: "small", children: a.map((t, l) => /* @__PURE__ */ e(
|
|
83
|
+
m,
|
|
84
|
+
{
|
|
85
|
+
onClick: () => {
|
|
86
|
+
i(l), o(!0);
|
|
87
|
+
},
|
|
88
|
+
children: t.type === "image" ? /* @__PURE__ */ e(
|
|
89
|
+
"img",
|
|
90
|
+
{
|
|
91
|
+
src: t.src,
|
|
92
|
+
alt: t.alt,
|
|
93
|
+
width: 150,
|
|
94
|
+
height: 100,
|
|
95
|
+
style: {
|
|
96
|
+
cursor: "pointer",
|
|
97
|
+
objectFit: "cover"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
) : /* @__PURE__ */ e(
|
|
101
|
+
"div",
|
|
102
|
+
{
|
|
103
|
+
style: {
|
|
104
|
+
width: 150,
|
|
105
|
+
height: 100,
|
|
106
|
+
background: "#000",
|
|
107
|
+
color: "#fff",
|
|
108
|
+
display: "flex",
|
|
109
|
+
alignItems: "center",
|
|
110
|
+
justifyContent: "center",
|
|
111
|
+
fontSize: 14,
|
|
112
|
+
cursor: "pointer"
|
|
113
|
+
},
|
|
114
|
+
children: "YouTube Video"
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
},
|
|
118
|
+
t.id
|
|
119
|
+
)) }),
|
|
120
|
+
/* @__PURE__ */ e(
|
|
121
|
+
h,
|
|
122
|
+
{
|
|
123
|
+
lightboxItems: a,
|
|
124
|
+
currentIndex: n,
|
|
125
|
+
isOpen: r,
|
|
126
|
+
onClose: () => o(!1),
|
|
127
|
+
onIndexChange: i,
|
|
128
|
+
LightboxImageComponent: p,
|
|
129
|
+
VideoComponent: u
|
|
130
|
+
}
|
|
131
|
+
)
|
|
132
|
+
] }) });
|
|
133
|
+
}
|
|
134
|
+
export {
|
|
135
|
+
I as default,
|
|
136
|
+
a as items
|
|
137
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export type LightboxImageItem = {
|
|
2
|
+
type: 'image';
|
|
3
|
+
src: string;
|
|
4
|
+
alt?: string;
|
|
5
|
+
id?: string | number;
|
|
6
|
+
blurDataURL?: string;
|
|
7
|
+
};
|
|
8
|
+
export type LightboxVideoItem = {
|
|
9
|
+
type: 'video';
|
|
10
|
+
videoUrl: string;
|
|
11
|
+
videoTitle?: string;
|
|
12
|
+
id?: string | number;
|
|
13
|
+
};
|
|
14
|
+
export type MediaItem = LightboxImageItem | LightboxVideoItem;
|
|
15
|
+
export interface UseLightboxOptions {
|
|
16
|
+
lightboxItems: MediaItem[];
|
|
17
|
+
currentIndex: number;
|
|
18
|
+
isOpen: boolean;
|
|
19
|
+
onClose: () => void;
|
|
20
|
+
onIndexChange: (idx: number) => void;
|
|
21
|
+
}
|
|
22
|
+
export interface LightboxProps {
|
|
23
|
+
lightboxItems: MediaItem[];
|
|
24
|
+
currentIndex: number;
|
|
25
|
+
isOpen: boolean;
|
|
26
|
+
onClose: () => void;
|
|
27
|
+
onIndexChange: (index: number) => void;
|
|
28
|
+
className?: string;
|
|
29
|
+
showNavigation?: boolean;
|
|
30
|
+
showCounter?: boolean;
|
|
31
|
+
showCloseButton?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export type SwipeDirection = 'left' | 'right';
|
|
34
|
+
export interface LightboxImageComponentProps {
|
|
35
|
+
src: string;
|
|
36
|
+
alt?: string;
|
|
37
|
+
width?: number;
|
|
38
|
+
height?: number;
|
|
39
|
+
className?: string;
|
|
40
|
+
placeholder?: 'blur' | 'empty';
|
|
41
|
+
blurDataURL?: string;
|
|
42
|
+
fill?: boolean;
|
|
43
|
+
}
|
|
44
|
+
export interface VideoComponentProps {
|
|
45
|
+
src: string;
|
|
46
|
+
title?: string;
|
|
47
|
+
className?: string;
|
|
48
|
+
allow: string;
|
|
49
|
+
allowFullScreen?: boolean;
|
|
50
|
+
isActive?: boolean;
|
|
51
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
function
|
|
4
|
-
return /* @__PURE__ */
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import e from "react";
|
|
3
|
+
function L(t) {
|
|
4
|
+
return /* @__PURE__ */ o(
|
|
5
5
|
"svg",
|
|
6
6
|
{
|
|
7
|
-
viewBox: "0 0
|
|
7
|
+
viewBox: "0 0 51 60",
|
|
8
8
|
fill: "none",
|
|
9
9
|
xmlns: "http://www.w3.org/2000/svg",
|
|
10
|
-
...
|
|
11
|
-
children: /* @__PURE__ */
|
|
10
|
+
...t,
|
|
11
|
+
children: /* @__PURE__ */ o(
|
|
12
12
|
"path",
|
|
13
13
|
{
|
|
14
|
-
d: "
|
|
14
|
+
d: "M10.9844 27.123L19.5344 1.473C19.8284 0.591 20.6504 0 21.5774 0H31.0154L32.8124 5.403L10.9844 27.123ZM35.6954 14.07L27.6494 22.107L38.8424 60H50.9744L35.6954 14.07ZM5.17339 44.553L0.0253906 60H12.1484L21.6134 28.137L5.17339 44.556V44.553Z",
|
|
15
15
|
fill: "#F1F1E4"
|
|
16
16
|
}
|
|
17
17
|
)
|
|
18
18
|
}
|
|
19
19
|
);
|
|
20
20
|
}
|
|
21
|
-
const r =
|
|
21
|
+
const r = e.memo(L);
|
|
22
22
|
export {
|
|
23
23
|
r as default
|
|
24
24
|
};
|
|
@@ -1,40 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
function e(
|
|
4
|
-
return /* @__PURE__ */
|
|
1
|
+
import { jsx as L } from "react/jsx-runtime";
|
|
2
|
+
import t from "react";
|
|
3
|
+
function e(o) {
|
|
4
|
+
return /* @__PURE__ */ L(
|
|
5
5
|
"svg",
|
|
6
6
|
{
|
|
7
|
-
viewBox: "0 0
|
|
7
|
+
viewBox: "0 0 34 60",
|
|
8
8
|
fill: "none",
|
|
9
9
|
xmlns: "http://www.w3.org/2000/svg",
|
|
10
|
-
...
|
|
11
|
-
children:
|
|
12
|
-
/* @__PURE__ */ L(
|
|
13
|
-
"path",
|
|
14
|
-
{
|
|
15
|
-
d: "M18.3867 17.7033L18.1967 17.6833L18.5167 16.06L18.7533 14.8667L18.7767 14.7533L18.7833 14.7267L18.6267 14.7033L18.4667 14.68L18.1333 14.63L17.9 14.5967L15.67 14.2667L15.6433 14.3967L15.53 14.9333L15.5167 15L15.4533 15.3L15.4367 15.3867L15.0467 17.57H12.9667L13.0833 15.9833L13.1467 15.1367V15.0867L13.1533 15.0367L13.1733 14.7733L13.18 14.6933L13.4 11.6767V9.46L13.4167 9.04L13.43 8.71667L13.4433 8.47L13.4633 7.99L13.48 7.62333L13.49 7.37333L13.55 5.16L11.2433 5.08667L10.2933 5.05333L10.3033 5.29333L10.2767 5.75333V8.13333L10.2567 8.41L10.2233 8.77667V12.29L10.1367 12.48L10.1433 12.6567L10.0933 13.4533L10.06 13.9933L10 14.2633V14.7533L10.0067 14.9933V24.9967H20.3033V24.35L20.7633 17.5933L19.0867 17.7033H18.3867ZM12.8467 22L13.01 21.19V20.62L12.8467 20.24H17.8733L17.82 21.0233L17.8733 22H12.8467Z",
|
|
16
|
-
fill: "#F1F1E4"
|
|
17
|
-
}
|
|
18
|
-
),
|
|
19
|
-
/* @__PURE__ */ L(
|
|
20
|
-
"path",
|
|
21
|
-
{
|
|
22
|
-
d: "M10.25 5.81L10.2767 5.78333L10.25 5.75667V5.81Z",
|
|
23
|
-
fill: "#F1F1E4"
|
|
24
|
-
}
|
|
25
|
-
),
|
|
26
|
-
/* @__PURE__ */ L(
|
|
27
|
-
"path",
|
|
28
|
-
{
|
|
29
|
-
d: "M18.2 5L17.8733 5.94L17.78 6.22L17.4567 7.16L17.3633 7.43667L17.24 7.79L16.9567 8.62333L16.5767 9.94333L16.3733 10.9033L18.0167 11.15L19.62 11.3867L19.98 9.97L20.6233 6.69333L20.69 6.36L20.74 6.09333L20.84 5.59L20.96 5H18.2Z",
|
|
30
|
-
fill: "#F1F1E4"
|
|
31
|
-
}
|
|
32
|
-
)
|
|
33
|
-
]
|
|
10
|
+
...o,
|
|
11
|
+
children: /* @__PURE__ */ L("path", { d: "M20.376 13.719L21.195 10.869L22.047 8.367L22.413 7.311L22.698 6.477L23.247 4.881L23.664 3.663L23.946 2.817L24.921 0H33.27L33.063 0.621L32.838 1.77L32.661 3.072L32.388 4.08L32.187 5.085L31.377 9.225L20.37 13.722L20.376 13.719ZM27.585 38.112L32.616 37.785L31.233 58.056V59.997H0.345L0 44.391L0.129 36.225L0.114 33.516L0.324 30.567L0.507 26.991L0.609 25.371L0.762 22.986L0.741 22.458L0.861 18.399L0.996 15.201V12.099V11.346L1.026 11.01L1.098 10.236L1.158 9.402V2.268L1.239 0.885L1.209 0.165L4.014 0.255L5.862 0.315L10.935 0.48L10.752 7.119L10.731 7.872L10.677 8.97L10.62 10.413L10.581 11.157L10.539 12.123L10.488 13.383V20.031L10.095 25.374L9.822 29.079L9.804 29.316L9.747 30.111L9.735 30.264L9.723 30.411L9.537 32.952L9.186 37.71H15.426L16.278 32.952L16.599 31.161L16.647 30.897L16.839 29.997L16.881 29.796L17.223 28.188L17.307 27.795L18.141 23.856L29.112 19.425L26.655 29.187L26.64 29.262L26.574 29.601L25.869 33.18L24.909 38.052L25.479 38.112H27.582H27.585ZM23.946 51.003L23.784 48.075L23.946 45.726H8.862L9.054 47.604V49.311L8.862 51H23.946V51.003Z", fill: "#EBEBEB" })
|
|
34
12
|
}
|
|
35
13
|
);
|
|
36
14
|
}
|
|
37
|
-
const r =
|
|
15
|
+
const r = t.memo(e);
|
|
38
16
|
export {
|
|
39
17
|
r as default
|
|
40
18
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as t, jsxs as _ } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import s from "react";
|
|
3
3
|
import { TITLE_OUTLET_ID as h } from "../Title/Title.js";
|
|
4
4
|
import "../../utils/hooks/useGlobalKeyboardEvent.js";
|
|
5
5
|
import "../../utils/hooks/useKeyboardClose.js";
|
|
@@ -14,7 +14,7 @@ function R(c) {
|
|
|
14
14
|
const {
|
|
15
15
|
forRef: r,
|
|
16
16
|
ref: n
|
|
17
|
-
} = c, [u, f] =
|
|
17
|
+
} = c, [u, f] = s.useState({}), d = b(h, "before"), i = s.useCallback(() => {
|
|
18
18
|
if (!r.current)
|
|
19
19
|
return;
|
|
20
20
|
const o = r.current.getBoundingClientRect(), m = {
|
|
@@ -34,7 +34,7 @@ function R(c) {
|
|
|
34
34
|
)
|
|
35
35
|
);
|
|
36
36
|
}, [r]);
|
|
37
|
-
return
|
|
37
|
+
return s.useEffect(i, [i]), p(i), /* @__PURE__ */ t(d, { children: /* @__PURE__ */ _("div", { ref: n, className: e.root, style: u, children: [
|
|
38
38
|
/* @__PURE__ */ t("div", { className: e.tile, "data-top": !0 }),
|
|
39
39
|
/* @__PURE__ */ t("div", { className: e.tile, "data-left": !0 }),
|
|
40
40
|
/* @__PURE__ */ t("div", { className: e.tile, "data-right": !0 }),
|