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