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