quirk-ui 0.0.313 → 0.0.315
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/next/blocks/HeroBlock/index.js +128 -171
- package/package.json +1 -1
|
@@ -1,184 +1,141 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { useHeroContext as
|
|
4
|
-
import { R as n, I
|
|
5
|
-
import { CallToActions as
|
|
6
|
-
import { usePrefersReducedMotion as
|
|
7
|
-
import { c as
|
|
8
|
-
import { P as
|
|
1
|
+
import { jsx as e, jsxs as o, Fragment as p } from "react/jsx-runtime";
|
|
2
|
+
import { useState as R, useRef as z, useEffect as P } from "react";
|
|
3
|
+
import { useHeroContext as F } from "./HeroContext.js";
|
|
4
|
+
import { R as n, I } from "../../../index-Dc6Lwt_I.js";
|
|
5
|
+
import { CallToActions as f } from "../../ui/CallToActions/index.js";
|
|
6
|
+
import { usePrefersReducedMotion as j } from "../../hooks/usePrefersReducedMotion.js";
|
|
7
|
+
import { c as L } from "../../../createLucideIcon-C8GTh_Qx.js";
|
|
8
|
+
import { P as S } from "../../../index-ClN4LY9C.js";
|
|
9
9
|
import '../../../assets/index45.css';/**
|
|
10
10
|
* @license lucide-react v0.488.0 - ISC
|
|
11
11
|
*
|
|
12
12
|
* This source code is licensed under the ISC license.
|
|
13
13
|
* See the LICENSE file in the root directory of this source tree.
|
|
14
14
|
*/
|
|
15
|
-
const
|
|
15
|
+
const U = [
|
|
16
16
|
["rect", { x: "14", y: "4", width: "4", height: "16", rx: "1", key: "zuxfzm" }],
|
|
17
17
|
["rect", { x: "6", y: "4", width: "4", height: "16", rx: "1", key: "1okwgv" }]
|
|
18
|
-
],
|
|
19
|
-
hero:
|
|
20
|
-
container:
|
|
21
|
-
eyebrow:
|
|
22
|
-
disclaimer:
|
|
23
|
-
text:
|
|
24
|
-
articleDetails:
|
|
25
|
-
articleType:
|
|
26
|
-
articleCategories:
|
|
27
|
-
category:
|
|
28
|
-
number:
|
|
18
|
+
], E = L("pause", U), H = "_hero_c7i2h_1", T = "_container_c7i2h_7", M = "_eyebrow_c7i2h_27", Y = "_disclaimer_c7i2h_31", V = "_text_c7i2h_36", q = "_articleDetails_c7i2h_43", G = "_articleType_c7i2h_56", J = "_articleCategories_c7i2h_69", K = "_category_c7i2h_75", Q = "_number_c7i2h_90", W = "_blog_c7i2h_117", X = "_overlay_c7i2h_141", Z = "_fullBleed_c7i2h_211", O = "_split_c7i2h_305", A = "_videoControl_c7i2h_333", D = "_videoBackground_c7i2h_374", g = "_iframe_c7i2h_375", l = {
|
|
19
|
+
hero: H,
|
|
20
|
+
container: T,
|
|
21
|
+
eyebrow: M,
|
|
22
|
+
disclaimer: Y,
|
|
23
|
+
text: V,
|
|
24
|
+
articleDetails: q,
|
|
25
|
+
articleType: G,
|
|
26
|
+
articleCategories: J,
|
|
27
|
+
category: K,
|
|
28
|
+
number: Q,
|
|
29
29
|
default: "_default_c7i2h_113",
|
|
30
|
-
blog:
|
|
31
|
-
overlay:
|
|
32
|
-
fullBleed:
|
|
33
|
-
split:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
videoBackground: re,
|
|
38
|
-
iframe: se
|
|
30
|
+
blog: W,
|
|
31
|
+
overlay: X,
|
|
32
|
+
fullBleed: Z,
|
|
33
|
+
split: O,
|
|
34
|
+
videoControl: A,
|
|
35
|
+
videoBackground: D,
|
|
36
|
+
iframe: g
|
|
39
37
|
};
|
|
40
|
-
function
|
|
41
|
-
heading:
|
|
38
|
+
function ne({
|
|
39
|
+
heading: s,
|
|
42
40
|
image: r,
|
|
43
|
-
video:
|
|
41
|
+
video: t,
|
|
44
42
|
callToAction: u,
|
|
45
|
-
pageData:
|
|
46
|
-
styleOptions:
|
|
43
|
+
pageData: c,
|
|
44
|
+
styleOptions: b
|
|
47
45
|
}) {
|
|
48
|
-
var
|
|
49
|
-
const a =
|
|
46
|
+
var $, B;
|
|
47
|
+
const a = j(), [v, w] = R(!a), { setIsFullbleedHeroAtTop: N } = F(), m = z(null), d = (b == null ? void 0 : b.layout) ?? "default", _ = {
|
|
50
48
|
default: l.default,
|
|
51
49
|
split: l.split,
|
|
52
50
|
"full-bleed": l.fullBleed,
|
|
53
51
|
blog: l.blog
|
|
54
|
-
}[d],
|
|
55
|
-
|
|
52
|
+
}[d], k = ($ = c == null ? void 0 : c.categories) != null && $.length ? c == null ? void 0 : c.categories[0] : null, y = (B = c == null ? void 0 : c.categories) != null && B.length ? c == null ? void 0 : c.categories[1] : null;
|
|
53
|
+
P(() => {
|
|
56
54
|
const i = () => {
|
|
57
|
-
|
|
55
|
+
N(window.scrollY === 0);
|
|
58
56
|
};
|
|
59
57
|
if (d === "full-bleed" && typeof window < "u")
|
|
60
|
-
return
|
|
61
|
-
}, [d]),
|
|
58
|
+
return N(!0), window.addEventListener("scroll", i), () => window.removeEventListener("scroll", i);
|
|
59
|
+
}, [d]), P(() => {
|
|
62
60
|
const i = m.current;
|
|
63
61
|
i && (a ? i.pause() : i.play());
|
|
64
62
|
}, [a]);
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
title: `${k ? "Pause the video" : "Play the video"}`,
|
|
69
|
-
className: l.videoControl,
|
|
70
|
-
onClick: () => {
|
|
71
|
-
const i = m.current;
|
|
72
|
-
i && (i.paused ? (i.play().catch(() => {
|
|
73
|
-
}), x(!0)) : (i.pause(), x(!1)));
|
|
74
|
-
},
|
|
75
|
-
children: k ? /* @__PURE__ */ e(L, { size: 18 }) : /* @__PURE__ */ e(j, { size: 18 })
|
|
76
|
-
}
|
|
77
|
-
), B = () => {
|
|
78
|
-
if (!s) return null;
|
|
79
|
-
const i = s.includes("vimeo.com"), y = s.includes("youtube.com") || s.includes("youtu.be");
|
|
80
|
-
return i || y ? /* @__PURE__ */ e("div", { className: l.videoWrapper, children: /* @__PURE__ */ e(
|
|
81
|
-
"iframe",
|
|
63
|
+
function x() {
|
|
64
|
+
return /* @__PURE__ */ e(
|
|
65
|
+
"button",
|
|
82
66
|
{
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
)
|
|
86
|
-
|
|
87
|
-
|
|
67
|
+
title: `${v ? "Pause the video" : "Play the video"}`,
|
|
68
|
+
className: l.videoControl,
|
|
69
|
+
onClick: () => {
|
|
70
|
+
const i = m.current;
|
|
71
|
+
i && (i.paused ? (i.play().catch(() => {
|
|
72
|
+
}), w(!0)) : (i.pause(), w(!1)));
|
|
73
|
+
},
|
|
74
|
+
children: v ? /* @__PURE__ */ e(E, { size: 18 }) : /* @__PURE__ */ e(S, { size: 18 })
|
|
88
75
|
}
|
|
89
|
-
)
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
ref: m,
|
|
95
|
-
src: s,
|
|
96
|
-
autoPlay: !a,
|
|
97
|
-
loop: !0,
|
|
98
|
-
muted: !0,
|
|
99
|
-
playsInline: !0,
|
|
100
|
-
poster: (r == null ? void 0 : r.imageUrl) || void 0
|
|
101
|
-
}
|
|
102
|
-
)
|
|
103
|
-
] });
|
|
104
|
-
};
|
|
105
|
-
function w(i) {
|
|
106
|
-
const y = i.match(/(?:youtube\.com\/.*v=|youtu\.be\/)([^&?/]+)/);
|
|
107
|
-
return (y == null ? void 0 : y[1]) || "";
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
function C(i) {
|
|
79
|
+
const h = i.match(/(?:youtube\.com\/.*v=|youtu\.be\/)([^&?/]+)/);
|
|
80
|
+
return (h == null ? void 0 : h[1]) || "";
|
|
108
81
|
}
|
|
109
|
-
const P = () => r && r.imageUrl ? /* @__PURE__ */ e("div", { className: l.image, children: /* @__PURE__ */ e(
|
|
110
|
-
N,
|
|
111
|
-
{
|
|
112
|
-
src: r.imageUrl,
|
|
113
|
-
alt: r.asset.altText || r.asset.description || "Hero image",
|
|
114
|
-
width: 600,
|
|
115
|
-
height: 658,
|
|
116
|
-
priority: !0
|
|
117
|
-
}
|
|
118
|
-
) }) : null;
|
|
119
82
|
if (d === "split")
|
|
120
|
-
return /* @__PURE__ */ e("section", { className: `${l.hero} ${l.split}`, children: /* @__PURE__ */
|
|
121
|
-
/* @__PURE__ */
|
|
122
|
-
/* @__PURE__ */
|
|
123
|
-
|
|
124
|
-
/* @__PURE__ */ e(n, { blocks: t.title })
|
|
125
|
-
] }),
|
|
126
|
-
t.description && /* @__PURE__ */ e(n, { blocks: t.description }),
|
|
127
|
-
u && /* @__PURE__ */ e(
|
|
128
|
-
p,
|
|
129
|
-
{
|
|
130
|
-
items: u.items,
|
|
131
|
-
alignment: u.alignment
|
|
132
|
-
}
|
|
133
|
-
),
|
|
134
|
-
t.disclaimer && /* @__PURE__ */ e(
|
|
135
|
-
n,
|
|
136
|
-
{
|
|
137
|
-
className: l.disclaimer,
|
|
138
|
-
blocks: t.disclaimer
|
|
139
|
-
}
|
|
140
|
-
)
|
|
83
|
+
return /* @__PURE__ */ e("section", { className: `${l.hero} ${l.split}`, children: /* @__PURE__ */ e("article", { className: l.container, children: /* @__PURE__ */ o("div", { className: l.text, children: [
|
|
84
|
+
/* @__PURE__ */ o("div", { children: [
|
|
85
|
+
s.eyebrow && /* @__PURE__ */ e(n, { className: l.eyebrow, blocks: s.eyebrow }),
|
|
86
|
+
/* @__PURE__ */ e(n, { blocks: s.title })
|
|
141
87
|
] }),
|
|
142
|
-
s
|
|
143
|
-
|
|
88
|
+
s.description && /* @__PURE__ */ e(n, { blocks: s.description }),
|
|
89
|
+
u && /* @__PURE__ */ e(
|
|
90
|
+
f,
|
|
91
|
+
{
|
|
92
|
+
items: u.items,
|
|
93
|
+
alignment: u.alignment
|
|
94
|
+
}
|
|
95
|
+
),
|
|
96
|
+
s.disclaimer && /* @__PURE__ */ e(
|
|
97
|
+
n,
|
|
98
|
+
{
|
|
99
|
+
className: l.disclaimer,
|
|
100
|
+
blocks: s.disclaimer
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
] }) }) });
|
|
144
104
|
if (d === "default")
|
|
145
|
-
return /* @__PURE__ */ e("section", { className: `${l.hero} ${
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
/* @__PURE__ */
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
)
|
|
160
|
-
] })
|
|
161
|
-
] }) });
|
|
105
|
+
return /* @__PURE__ */ e("section", { className: `${l.hero} ${_}`, children: /* @__PURE__ */ e("article", { className: l.container, children: /* @__PURE__ */ o("div", { className: l.text, children: [
|
|
106
|
+
/* @__PURE__ */ o("div", { children: [
|
|
107
|
+
s.eyebrow && /* @__PURE__ */ e(n, { className: l.eyebrow, blocks: s.eyebrow }),
|
|
108
|
+
/* @__PURE__ */ e(n, { blocks: s.title })
|
|
109
|
+
] }),
|
|
110
|
+
s.description && /* @__PURE__ */ e(n, { blocks: s.description }),
|
|
111
|
+
u && /* @__PURE__ */ e(
|
|
112
|
+
f,
|
|
113
|
+
{
|
|
114
|
+
items: u.items,
|
|
115
|
+
alignment: u.alignment
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
] }) }) });
|
|
162
119
|
if (d === "full-bleed")
|
|
163
|
-
return /* @__PURE__ */ e("section", { className: `${l.hero} ${
|
|
164
|
-
|
|
120
|
+
return /* @__PURE__ */ e("section", { className: `${l.hero} ${_}`, children: /* @__PURE__ */ o("article", { className: l.container, children: [
|
|
121
|
+
t ? t.includes("vimeo.com") || t.includes("youtube.com") || t.includes("youtu.be") ? /* @__PURE__ */ e("div", { className: l.videoBackground, children: /* @__PURE__ */ e(
|
|
165
122
|
"iframe",
|
|
166
123
|
{
|
|
167
|
-
src:
|
|
168
|
-
|
|
124
|
+
src: t.includes("vimeo.com") ? `${t}?autoplay=1&muted=1&loop=1&background=1` : `${t}?autoplay=1&mute=1&loop=1&playlist=${C(
|
|
125
|
+
t
|
|
169
126
|
)}`,
|
|
170
127
|
className: l.iframe,
|
|
171
128
|
allow: "autoplay; fullscreen",
|
|
172
129
|
allowFullScreen: !0
|
|
173
130
|
}
|
|
174
|
-
) }) : /* @__PURE__ */
|
|
175
|
-
|
|
131
|
+
) }) : /* @__PURE__ */ o(p, { children: [
|
|
132
|
+
x(),
|
|
176
133
|
/* @__PURE__ */ e(
|
|
177
134
|
"video",
|
|
178
135
|
{
|
|
179
136
|
ref: m,
|
|
180
137
|
className: l.videoBackground,
|
|
181
|
-
src:
|
|
138
|
+
src: t,
|
|
182
139
|
autoPlay: !a,
|
|
183
140
|
loop: !0,
|
|
184
141
|
muted: !0,
|
|
@@ -187,7 +144,7 @@ function me({
|
|
|
187
144
|
}
|
|
188
145
|
)
|
|
189
146
|
] }) : /* @__PURE__ */ e(
|
|
190
|
-
|
|
147
|
+
I,
|
|
191
148
|
{
|
|
192
149
|
src: (r == null ? void 0 : r.imageUrl) ?? "",
|
|
193
150
|
alt: (r == null ? void 0 : r.asset.altText) || (r == null ? void 0 : r.asset.description) || "Card image",
|
|
@@ -198,20 +155,20 @@ function me({
|
|
|
198
155
|
sizes: "(min-width: 500px) 500px, 100vw"
|
|
199
156
|
}
|
|
200
157
|
),
|
|
201
|
-
/* @__PURE__ */ e("div", { className: l.overlay, children: /* @__PURE__ */
|
|
202
|
-
/* @__PURE__ */
|
|
203
|
-
|
|
158
|
+
/* @__PURE__ */ e("div", { className: l.overlay, children: /* @__PURE__ */ o("div", { className: l.text, children: [
|
|
159
|
+
/* @__PURE__ */ o("div", { children: [
|
|
160
|
+
s.eyebrow && /* @__PURE__ */ e(
|
|
204
161
|
n,
|
|
205
162
|
{
|
|
206
163
|
className: l.eyebrow,
|
|
207
|
-
blocks:
|
|
164
|
+
blocks: s.eyebrow
|
|
208
165
|
}
|
|
209
166
|
),
|
|
210
|
-
/* @__PURE__ */ e(n, { blocks:
|
|
167
|
+
/* @__PURE__ */ e(n, { blocks: s.title })
|
|
211
168
|
] }),
|
|
212
|
-
|
|
169
|
+
s.description && /* @__PURE__ */ e(n, { blocks: s.description }),
|
|
213
170
|
u && /* @__PURE__ */ e(
|
|
214
|
-
|
|
171
|
+
f,
|
|
215
172
|
{
|
|
216
173
|
items: u.items,
|
|
217
174
|
alignment: u.alignment
|
|
@@ -220,25 +177,25 @@ function me({
|
|
|
220
177
|
] }) })
|
|
221
178
|
] }) });
|
|
222
179
|
if (d === "blog")
|
|
223
|
-
return /* @__PURE__ */ e("section", { className: `${l.hero} ${
|
|
224
|
-
|
|
180
|
+
return /* @__PURE__ */ e("section", { className: `${l.hero} ${_}`, children: /* @__PURE__ */ o("article", { className: l.container, children: [
|
|
181
|
+
t ? t.includes("vimeo.com") || t.includes("youtube.com") || t.includes("youtu.be") ? /* @__PURE__ */ e("div", { className: l.videoBackground, children: /* @__PURE__ */ e(
|
|
225
182
|
"iframe",
|
|
226
183
|
{
|
|
227
|
-
src:
|
|
228
|
-
|
|
184
|
+
src: t.includes("vimeo.com") ? `${t}?autoplay=1&muted=1&loop=1&background=1` : `${t}?autoplay=1&mute=1&loop=1&playlist=${C(
|
|
185
|
+
t
|
|
229
186
|
)}`,
|
|
230
187
|
className: l.iframe,
|
|
231
188
|
allow: "autoplay; fullscreen",
|
|
232
189
|
allowFullScreen: !0
|
|
233
190
|
}
|
|
234
|
-
) }) : /* @__PURE__ */
|
|
235
|
-
|
|
191
|
+
) }) : /* @__PURE__ */ o(p, { children: [
|
|
192
|
+
x(),
|
|
236
193
|
/* @__PURE__ */ e(
|
|
237
194
|
"video",
|
|
238
195
|
{
|
|
239
196
|
ref: m,
|
|
240
197
|
className: l.videoBackground,
|
|
241
|
-
src:
|
|
198
|
+
src: t,
|
|
242
199
|
autoPlay: !a,
|
|
243
200
|
loop: !0,
|
|
244
201
|
muted: !0,
|
|
@@ -247,7 +204,7 @@ function me({
|
|
|
247
204
|
}
|
|
248
205
|
)
|
|
249
206
|
] }) : /* @__PURE__ */ e(
|
|
250
|
-
|
|
207
|
+
I,
|
|
251
208
|
{
|
|
252
209
|
src: (r == null ? void 0 : r.imageUrl) ?? "",
|
|
253
210
|
alt: (r == null ? void 0 : r.asset.altText) || (r == null ? void 0 : r.asset.description) || "Card image",
|
|
@@ -258,33 +215,33 @@ function me({
|
|
|
258
215
|
sizes: "(min-width: 500px) 500px, 100vw"
|
|
259
216
|
}
|
|
260
217
|
),
|
|
261
|
-
/* @__PURE__ */ e("div", { className: l.overlay, children: /* @__PURE__ */
|
|
262
|
-
/* @__PURE__ */
|
|
263
|
-
|
|
218
|
+
/* @__PURE__ */ e("div", { className: l.overlay, children: /* @__PURE__ */ o("div", { className: l.text, children: [
|
|
219
|
+
/* @__PURE__ */ o("div", { children: [
|
|
220
|
+
s.eyebrow && /* @__PURE__ */ e(
|
|
264
221
|
n,
|
|
265
222
|
{
|
|
266
223
|
className: l.eyebrow,
|
|
267
|
-
blocks:
|
|
224
|
+
blocks: s.eyebrow
|
|
268
225
|
}
|
|
269
226
|
),
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
/* @__PURE__ */
|
|
273
|
-
|
|
274
|
-
|
|
227
|
+
c && /* @__PURE__ */ o("div", { className: l.articleDetails, children: [
|
|
228
|
+
c.articleType && /* @__PURE__ */ e("div", { className: l.articleType, children: c.articleType }),
|
|
229
|
+
/* @__PURE__ */ o("div", { className: l.articleCategories, children: [
|
|
230
|
+
k && /* @__PURE__ */ e("span", { className: l.category, children: k.title }),
|
|
231
|
+
y && y.title.toLowerCase() !== "library" && !y.slug.current.includes(
|
|
275
232
|
"keywords"
|
|
276
|
-
) && /* @__PURE__ */ e("span", { className: l.category, children:
|
|
233
|
+
) && /* @__PURE__ */ e("span", { className: l.category, children: y.title })
|
|
277
234
|
] }),
|
|
278
|
-
|
|
279
|
-
/* @__PURE__ */ e("span", { className: l.number, children:
|
|
235
|
+
c.timeToRead && /* @__PURE__ */ e(p, { children: /* @__PURE__ */ o("span", { children: [
|
|
236
|
+
/* @__PURE__ */ e("span", { className: l.number, children: c.timeToRead }),
|
|
280
237
|
"min read"
|
|
281
238
|
] }) })
|
|
282
239
|
] }),
|
|
283
|
-
/* @__PURE__ */ e(n, { blocks:
|
|
240
|
+
/* @__PURE__ */ e(n, { blocks: s.title })
|
|
284
241
|
] }),
|
|
285
|
-
|
|
242
|
+
s.description && /* @__PURE__ */ e(n, { blocks: s.description }),
|
|
286
243
|
u && /* @__PURE__ */ e(
|
|
287
|
-
|
|
244
|
+
f,
|
|
288
245
|
{
|
|
289
246
|
items: u.items,
|
|
290
247
|
alignment: u.alignment
|
|
@@ -294,5 +251,5 @@ function me({
|
|
|
294
251
|
] }) });
|
|
295
252
|
}
|
|
296
253
|
export {
|
|
297
|
-
|
|
254
|
+
ne as HeroBlock
|
|
298
255
|
};
|