quirk-ui 0.0.472 → 0.0.474
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/AdditionalCategoriesBlock/index.cjs +1 -1
- package/dist/next/blocks/AdditionalCategoriesBlock/index.mjs +15 -15
- package/dist/next/blocks/DocumentListBlock/index.cjs +1 -1
- package/dist/next/blocks/DocumentListBlock/index.mjs +105 -97
- package/dist/next/blocks/HeroBlock/index.cjs +2 -2
- package/dist/next/blocks/HeroBlock/index.mjs +17 -17
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../assets/index11.css');const n=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../assets/index11.css');const n=require("react/jsx-runtime"),l=require("../../ui/LocaleLink/index.cjs"),o="_additionalCategories_1wmnv_1",a="_container_1wmnv_6",c="_categories_1wmnv_12",r="_list_1wmnv_23",d="_category_1wmnv_31",i={additionalCategories:o,container:a,categories:c,list:r,category:d};function _({categories:e,type:s}){if((e==null?void 0:e.length)!==0)return console.log("CAT",e),n.jsx("section",{className:`${i.additionalCategories} ${s=="article"?"blog":""}`,children:n.jsx("article",{className:i.container,children:n.jsxs("div",{className:i.categories,children:[n.jsx("p",{children:"In this article:"}),n.jsx("div",{className:i.list,children:e&&e.length>0&&e.map(t=>t.slug.current.includes("keyword")&&n.jsx(l.LocaleLink,{href:`/blog/search?categories=${encodeURIComponent(t._id)}`,className:i.category,children:t.title},t._id))})]})})})}exports.AdditionalCategoriesBlock=_;
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as i, jsxs as l } from "react/jsx-runtime";
|
|
2
2
|
import { LocaleLink as s } from "../../ui/LocaleLink/index.mjs";
|
|
3
|
-
import '../../../assets/index11.css';const a = "_additionalCategories_1wmnv_1", c = "_container_1wmnv_6", r = "_categories_1wmnv_12", d = "_list_1wmnv_23",
|
|
3
|
+
import '../../../assets/index11.css';const a = "_additionalCategories_1wmnv_1", c = "_container_1wmnv_6", r = "_categories_1wmnv_12", d = "_list_1wmnv_23", _ = "_category_1wmnv_31", e = {
|
|
4
4
|
additionalCategories: a,
|
|
5
5
|
container: c,
|
|
6
6
|
categories: r,
|
|
7
7
|
list: d,
|
|
8
|
-
category:
|
|
8
|
+
category: _
|
|
9
9
|
};
|
|
10
10
|
function g({
|
|
11
11
|
categories: n,
|
|
12
|
-
type:
|
|
12
|
+
type: o
|
|
13
13
|
}) {
|
|
14
14
|
if ((n == null ? void 0 : n.length) !== 0)
|
|
15
|
-
return console.log("CAT", n), /* @__PURE__ */
|
|
15
|
+
return console.log("CAT", n), /* @__PURE__ */ i(
|
|
16
16
|
"section",
|
|
17
17
|
{
|
|
18
|
-
className: `${
|
|
19
|
-
children: /* @__PURE__ */
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
-
/* @__PURE__ */
|
|
22
|
-
(
|
|
18
|
+
className: `${e.additionalCategories} ${o == "article" ? "blog" : ""}`,
|
|
19
|
+
children: /* @__PURE__ */ i("article", { className: e.container, children: /* @__PURE__ */ l("div", { className: e.categories, children: [
|
|
20
|
+
/* @__PURE__ */ i("p", { children: "In this article:" }),
|
|
21
|
+
/* @__PURE__ */ i("div", { className: e.list, children: n && n.length > 0 && n.map(
|
|
22
|
+
(t) => t.slug.current.includes("keyword") && /* @__PURE__ */ i(
|
|
23
23
|
s,
|
|
24
24
|
{
|
|
25
|
-
href: `/blog/search?
|
|
26
|
-
|
|
25
|
+
href: `/blog/search?categories=${encodeURIComponent(
|
|
26
|
+
t._id
|
|
27
27
|
)}`,
|
|
28
|
-
className:
|
|
29
|
-
children:
|
|
28
|
+
className: e.category,
|
|
29
|
+
children: t.title
|
|
30
30
|
},
|
|
31
|
-
|
|
31
|
+
t._id
|
|
32
32
|
)
|
|
33
33
|
) })
|
|
34
34
|
] }) })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("react"),B=require("../../ui/PortableTextRenderer/index.cjs"),X=require("../../hooks/useStyleClasses.cjs"),J=require("../../contexts/LocaleBridge.cjs"),C=require("../../../index-DpYgzTme.cjs"),K=require("../../../core/components/Input/index.cjs"),Q=require("../../../core/components/Select/index.cjs"),V=require("../../cards/BlogArticleCard/index.cjs"),l=require("../../../CategoryFilters-CJsgwMGz.cjs"),Y=require("../../../x-Dft9NVe_.cjs"),F=[{label:"Newest",value:"date-desc"},{label:"Oldest",value:"date-asc"},{label:"Title A-Z",value:"title-asc"},{label:"Title Z-A",value:"title-desc"},{label:"Most Popular",value:"popular-desc"}];function ee({heading:o,layout:$="grid",includeFilters:y,excludeFilters:x,limit:w=3,categoryFilters:u,documentType:_,styleOptions:P}){const[g,r]=s.useState([]),[M,z]=s.useState(null),[N,D]=s.useState("date-desc"),[m,S]=s.useState([]),[T,I]=s.useState(null),[L,c]=s.useState(0),[i,k]=s.useState(!1),[h,p]=s.useState(!1),[q,a]=s.useState(!0),[f,v]=s.useState(""),[j,U]=s.useState(""),{locale:H}=J.useLocaleBridge(),O=X.useStyleClasses(P),W={list:l.styles.list}[$??"grid"];s.useEffect(()=>{if(typeof window>"u")return;const t=new URLSearchParams(window.location.search),n=t.getAll("categories");n.length>0&&S(n);const d=t.get("type");d&&I(d),r([]),c(0),a(!0)},[]);const Z=t=>{D(t.target.value),r([]),c(0),a(!0)},A=()=>{p(!h)},G=()=>{r([]),c(0),a(!0),S([]),v(""),p(!1)},E=async()=>{if(i||!q)return;k(!0);const t=new URLSearchParams({start:String(L),limit:String(w),sort:N,documentType:_,locale:H});T&&t.append("type",T),j&&t.append("search",j),m.forEach(n=>t.append("categories",n)),y==null||y.forEach(n=>t.append("include",n._id)),x==null||x.forEach(n=>t.append("exclude",n._id));try{const d=await(await fetch(`/api/articles?${t.toString()}`,{method:"GET"})).json();r(b=>[...b,...d.articles]),c(b=>b+w),z(d.totalCount),L+d.articles.length>=d.totalCount&&a(!1)}catch(n){console.error("Failed to load articles:",n),a(!1)}finally{k(!1)}},R=s.useCallback(()=>{typeof window<"u"&&window.innerWidth>768&&(p(!1),typeof document<"u"&&(document.body.style.overflow=""))},[]);return s.useEffect(()=>{const t=typeof window<"u";return t&&window.addEventListener("resize",R),()=>{t&&window.removeEventListener("resize",R)}},[]),s.useEffect(()=>{if(typeof document<"u")return document.body.style.overflow=h?"hidden":"",()=>{document.body.style.overflow=""}},[h]),s.useEffect(()=>{const t=setTimeout(()=>{U(f)},1e3);return()=>clearTimeout(t)},[f]),s.useEffect(()=>{E()},[j,N,m.join(",")]),e.jsx("section",{className:`${l.styles.documentList} ${O}`,children:e.jsxs("article",{className:l.styles.container,children:[e.jsxs("div",{className:l.styles.heading,children:[(o==null?void 0:o.title)&&e.jsx(B.RichText,{blocks:o==null?void 0:o.title}),(o==null?void 0:o.description)&&e.jsx(B.RichText,{blocks:o==null?void 0:o.description})]}),e.jsxs("div",{className:l.styles.listContainer,children:[(u==null?void 0:u.length)&&e.jsxs("div",{className:l.styles.filterToggle,children:[e.jsx(C.CallToAction,{as:"button",variant:"secondary",onClick:A,disabled:i,icon:"settings",iconAlignment:"left",children:"Filters"}),e.jsx(C.CallToAction,{as:"button",variant:"link",onClick:G,disabled:i||m.length===0&&f.length===0,children:"Reset"})]}),u&&e.jsx(l.CategoryFilters,{categoryFilters:u,selectedCategories:m,setSelectedCategories:S,setArticles:r,setStart:c,setHasMore:a,showFilters:h,toggleFilters:A,isLoading:i}),e.jsxs("div",{className:l.styles.listWrapper,children:[e.jsxs("div",{className:l.styles.listHeader,children:[e.jsxs("div",{className:l.styles.listResults,children:["Results: ",e.jsx("span",{children:M})]}),e.jsxs("div",{className:l.styles.listHeaderFilters,children:[e.jsxs("div",{className:l.styles.listSearch,children:[e.jsx(K.Input,{type:"text",name:"list-search",placeholder:"Search articles",value:f,onChange:t=>{v(t.target.value),r([]),c(0),a(!0)}}),f&&e.jsx("button",{className:l.styles.clearSearch,onClick:()=>{v(""),r([]),c(0),a(!0)},children:e.jsx(Y.X,{size:21})})]}),e.jsx("div",{className:l.styles.listSort,children:e.jsx(Q.Select,{id:"list-sort",name:"list-sort",options:F,onChange:Z})})]})]}),e.jsx("div",{className:`${l.styles.list} ${W}`,children:g&&g.map(t=>_=="blog"&&e.jsx(V.BlogArticleCard,{article:t},t._id))}),q&&e.jsx("div",{className:l.styles.loadMore,children:e.jsx(C.CallToAction,{as:"button",variant:"primary",onClick:E,disabled:i,icon:"refresh",iconAlignment:"left",className:i?l.styles.buttonIsLoading:"",children:i?"Loading...":"Load more"})})]})]})]})})}exports.DocumentListBlock=ee;
|
|
@@ -1,102 +1,110 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { RichText as
|
|
4
|
-
import { useStyleClasses as
|
|
5
|
-
import { useLocaleBridge as
|
|
1
|
+
import { jsx as t, jsxs as r } from "react/jsx-runtime";
|
|
2
|
+
import { useState as a, useEffect as p, useCallback as K } from "react";
|
|
3
|
+
import { RichText as B } from "../../ui/PortableTextRenderer/index.mjs";
|
|
4
|
+
import { useStyleClasses as Q } from "../../hooks/useStyleClasses.mjs";
|
|
5
|
+
import { useLocaleBridge as V } from "../../contexts/LocaleBridge.mjs";
|
|
6
6
|
import { C as L } from "../../../index-CIb65n0z.js";
|
|
7
|
-
import { Input as
|
|
8
|
-
import { Select as
|
|
9
|
-
import { BlogArticleCard as
|
|
10
|
-
import { s, C as
|
|
11
|
-
import { X as
|
|
12
|
-
const
|
|
7
|
+
import { Input as Y } from "../../../core/components/Input/index.mjs";
|
|
8
|
+
import { Select as F } from "../../../core/components/Select/index.mjs";
|
|
9
|
+
import { BlogArticleCard as ee } from "../../cards/BlogArticleCard/index.mjs";
|
|
10
|
+
import { s, C as te } from "../../../CategoryFilters-BrPk0efZ.js";
|
|
11
|
+
import { X as se } from "../../../x-CnsEH4Ox.js";
|
|
12
|
+
const oe = [
|
|
13
13
|
{ label: "Newest", value: "date-desc" },
|
|
14
14
|
{ label: "Oldest", value: "date-asc" },
|
|
15
15
|
{ label: "Title A-Z", value: "title-asc" },
|
|
16
16
|
{ label: "Title Z-A", value: "title-desc" },
|
|
17
17
|
{ label: "Most Popular", value: "popular-desc" }
|
|
18
18
|
];
|
|
19
|
-
function
|
|
19
|
+
function he({
|
|
20
20
|
heading: o,
|
|
21
|
-
layout:
|
|
22
|
-
includeFilters:
|
|
23
|
-
excludeFilters:
|
|
24
|
-
limit:
|
|
25
|
-
categoryFilters:
|
|
26
|
-
documentType:
|
|
21
|
+
layout: H = "grid",
|
|
22
|
+
includeFilters: b,
|
|
23
|
+
excludeFilters: C,
|
|
24
|
+
limit: T = 3,
|
|
25
|
+
categoryFilters: f,
|
|
26
|
+
documentType: k,
|
|
27
27
|
// filterMode,
|
|
28
|
-
styleOptions:
|
|
28
|
+
styleOptions: I
|
|
29
29
|
}) {
|
|
30
|
-
const [A,
|
|
30
|
+
const [A, i] = a([]), [W, _] = a(null), [E, x] = a("date-desc"), [h, S] = a([]), [R, D] = a(null), [$, c] = a(0), [d, j] = a(!1), [v, w] = a(!1), [z, n] = a(!0), [u, y] = a(""), [N, O] = a(""), { locale: Z } = V(), q = Q(I), G = {
|
|
31
31
|
//grid: styles.grid,
|
|
32
32
|
list: s.list
|
|
33
|
-
}[
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
}[H ?? "grid"];
|
|
34
|
+
p(() => {
|
|
35
|
+
if (typeof window > "u") return;
|
|
36
|
+
const e = new URLSearchParams(window.location.search), l = e.getAll("categories");
|
|
37
|
+
l.length > 0 && S(l);
|
|
38
|
+
const m = e.get("type");
|
|
39
|
+
m && D(m), i([]), c(0), n(!0);
|
|
40
|
+
}, []);
|
|
41
|
+
const X = (e) => {
|
|
42
|
+
x(e.target.value), i([]), c(0), n(!0);
|
|
43
|
+
}, M = () => {
|
|
44
|
+
w(!v);
|
|
45
|
+
}, J = () => {
|
|
46
|
+
i([]), c(0), n(!0), S([]), y(""), w(!1);
|
|
47
|
+
}, P = async () => {
|
|
48
|
+
if (d || !z) return;
|
|
49
|
+
j(!0);
|
|
42
50
|
const e = new URLSearchParams({
|
|
43
|
-
start: String(
|
|
44
|
-
limit: String(
|
|
45
|
-
sort:
|
|
46
|
-
documentType:
|
|
47
|
-
locale:
|
|
51
|
+
start: String($),
|
|
52
|
+
limit: String(T),
|
|
53
|
+
sort: E,
|
|
54
|
+
documentType: k,
|
|
55
|
+
locale: Z
|
|
48
56
|
});
|
|
49
|
-
N && e.append("search", N),
|
|
50
|
-
(
|
|
57
|
+
R && e.append("type", R), N && e.append("search", N), h.forEach(
|
|
58
|
+
(l) => e.append("categories", l)
|
|
59
|
+
), b == null || b.forEach(
|
|
60
|
+
(l) => e.append("include", l._id)
|
|
51
61
|
), C == null || C.forEach(
|
|
52
|
-
(
|
|
53
|
-
), w == null || w.forEach(
|
|
54
|
-
(r) => e.append("exclude", r._id)
|
|
62
|
+
(l) => e.append("exclude", l._id)
|
|
55
63
|
);
|
|
56
64
|
try {
|
|
57
|
-
const
|
|
65
|
+
const m = await (await fetch(`/api/articles?${e.toString()}`, {
|
|
58
66
|
method: "GET"
|
|
59
67
|
})).json();
|
|
60
|
-
|
|
61
|
-
} catch (
|
|
62
|
-
console.error("Failed to load articles:",
|
|
68
|
+
i((g) => [...g, ...m.articles]), c((g) => g + T), _(m.totalCount), $ + m.articles.length >= m.totalCount && n(!1);
|
|
69
|
+
} catch (l) {
|
|
70
|
+
console.error("Failed to load articles:", l), n(!1);
|
|
63
71
|
} finally {
|
|
64
|
-
|
|
72
|
+
j(!1);
|
|
65
73
|
}
|
|
66
|
-
},
|
|
67
|
-
typeof window < "u" && window.innerWidth > 768 && (
|
|
74
|
+
}, U = K(() => {
|
|
75
|
+
typeof window < "u" && window.innerWidth > 768 && (w(!1), typeof document < "u" && (document.body.style.overflow = ""));
|
|
68
76
|
}, []);
|
|
69
|
-
return
|
|
77
|
+
return p(() => {
|
|
70
78
|
const e = typeof window < "u";
|
|
71
|
-
return e && window.addEventListener("resize",
|
|
72
|
-
e && window.removeEventListener("resize",
|
|
79
|
+
return e && window.addEventListener("resize", U), () => {
|
|
80
|
+
e && window.removeEventListener("resize", U);
|
|
73
81
|
};
|
|
74
|
-
}, []),
|
|
82
|
+
}, []), p(() => {
|
|
75
83
|
if (typeof document < "u")
|
|
76
|
-
return document.body.style.overflow =
|
|
84
|
+
return document.body.style.overflow = v ? "hidden" : "", () => {
|
|
77
85
|
document.body.style.overflow = "";
|
|
78
86
|
};
|
|
79
|
-
}, [
|
|
87
|
+
}, [v]), p(() => {
|
|
80
88
|
const e = setTimeout(() => {
|
|
81
|
-
|
|
89
|
+
O(u);
|
|
82
90
|
}, 1e3);
|
|
83
91
|
return () => clearTimeout(e);
|
|
84
|
-
}, [
|
|
85
|
-
|
|
86
|
-
}, [N,
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
(o == null ? void 0 : o.title) && /* @__PURE__ */ t(
|
|
89
|
-
(o == null ? void 0 : o.description) && /* @__PURE__ */ t(
|
|
92
|
+
}, [u]), p(() => {
|
|
93
|
+
P();
|
|
94
|
+
}, [N, E, h.join(",")]), /* @__PURE__ */ t("section", { className: `${s.documentList} ${q}`, children: /* @__PURE__ */ r("article", { className: s.container, children: [
|
|
95
|
+
/* @__PURE__ */ r("div", { className: s.heading, children: [
|
|
96
|
+
(o == null ? void 0 : o.title) && /* @__PURE__ */ t(B, { blocks: o == null ? void 0 : o.title }),
|
|
97
|
+
(o == null ? void 0 : o.description) && /* @__PURE__ */ t(B, { blocks: o == null ? void 0 : o.description })
|
|
90
98
|
] }),
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
(
|
|
99
|
+
/* @__PURE__ */ r("div", { className: s.listContainer, children: [
|
|
100
|
+
(f == null ? void 0 : f.length) && /* @__PURE__ */ r("div", { className: s.filterToggle, children: [
|
|
93
101
|
/* @__PURE__ */ t(
|
|
94
102
|
L,
|
|
95
103
|
{
|
|
96
104
|
as: "button",
|
|
97
105
|
variant: "secondary",
|
|
98
|
-
onClick:
|
|
99
|
-
disabled:
|
|
106
|
+
onClick: M,
|
|
107
|
+
disabled: d,
|
|
100
108
|
icon: "settings",
|
|
101
109
|
iconAlignment: "left",
|
|
102
110
|
children: "Filters"
|
|
@@ -107,82 +115,82 @@ function ue({
|
|
|
107
115
|
{
|
|
108
116
|
as: "button",
|
|
109
117
|
variant: "link",
|
|
110
|
-
onClick:
|
|
111
|
-
disabled:
|
|
118
|
+
onClick: J,
|
|
119
|
+
disabled: d || h.length === 0 && u.length === 0,
|
|
112
120
|
children: "Reset"
|
|
113
121
|
}
|
|
114
122
|
)
|
|
115
123
|
] }),
|
|
116
|
-
|
|
117
|
-
|
|
124
|
+
f && /* @__PURE__ */ t(
|
|
125
|
+
te,
|
|
118
126
|
{
|
|
119
|
-
categoryFilters:
|
|
120
|
-
selectedCategories:
|
|
121
|
-
setSelectedCategories:
|
|
122
|
-
setArticles:
|
|
123
|
-
setStart:
|
|
127
|
+
categoryFilters: f,
|
|
128
|
+
selectedCategories: h,
|
|
129
|
+
setSelectedCategories: S,
|
|
130
|
+
setArticles: i,
|
|
131
|
+
setStart: c,
|
|
124
132
|
setHasMore: n,
|
|
125
|
-
showFilters:
|
|
126
|
-
toggleFilters:
|
|
127
|
-
isLoading:
|
|
133
|
+
showFilters: v,
|
|
134
|
+
toggleFilters: M,
|
|
135
|
+
isLoading: d
|
|
128
136
|
}
|
|
129
137
|
),
|
|
130
|
-
/* @__PURE__ */
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ r("div", { className: s.listWrapper, children: [
|
|
139
|
+
/* @__PURE__ */ r("div", { className: s.listHeader, children: [
|
|
140
|
+
/* @__PURE__ */ r("div", { className: s.listResults, children: [
|
|
133
141
|
"Results: ",
|
|
134
142
|
/* @__PURE__ */ t("span", { children: W })
|
|
135
143
|
] }),
|
|
136
|
-
/* @__PURE__ */
|
|
137
|
-
/* @__PURE__ */
|
|
144
|
+
/* @__PURE__ */ r("div", { className: s.listHeaderFilters, children: [
|
|
145
|
+
/* @__PURE__ */ r("div", { className: s.listSearch, children: [
|
|
138
146
|
/* @__PURE__ */ t(
|
|
139
|
-
|
|
147
|
+
Y,
|
|
140
148
|
{
|
|
141
149
|
type: "text",
|
|
142
150
|
name: "list-search",
|
|
143
151
|
placeholder: "Search articles",
|
|
144
|
-
value:
|
|
152
|
+
value: u,
|
|
145
153
|
onChange: (e) => {
|
|
146
|
-
|
|
154
|
+
y(e.target.value), i([]), c(0), n(!0);
|
|
147
155
|
}
|
|
148
156
|
}
|
|
149
157
|
),
|
|
150
|
-
|
|
158
|
+
u && /* @__PURE__ */ t(
|
|
151
159
|
"button",
|
|
152
160
|
{
|
|
153
161
|
className: s.clearSearch,
|
|
154
162
|
onClick: () => {
|
|
155
|
-
|
|
163
|
+
y(""), i([]), c(0), n(!0);
|
|
156
164
|
},
|
|
157
|
-
children: /* @__PURE__ */ t(
|
|
165
|
+
children: /* @__PURE__ */ t(se, { size: 21 })
|
|
158
166
|
}
|
|
159
167
|
)
|
|
160
168
|
] }),
|
|
161
169
|
/* @__PURE__ */ t("div", { className: s.listSort, children: /* @__PURE__ */ t(
|
|
162
|
-
|
|
170
|
+
F,
|
|
163
171
|
{
|
|
164
172
|
id: "list-sort",
|
|
165
173
|
name: "list-sort",
|
|
166
|
-
options:
|
|
167
|
-
onChange:
|
|
174
|
+
options: oe,
|
|
175
|
+
onChange: X
|
|
168
176
|
}
|
|
169
177
|
) })
|
|
170
178
|
] })
|
|
171
179
|
] }),
|
|
172
|
-
/* @__PURE__ */ t("div", { className: `${s.list} ${
|
|
173
|
-
(e) =>
|
|
180
|
+
/* @__PURE__ */ t("div", { className: `${s.list} ${G}`, children: A && A.map(
|
|
181
|
+
(e) => k == "blog" && /* @__PURE__ */ t(ee, { article: e }, e._id)
|
|
174
182
|
) }),
|
|
175
|
-
|
|
183
|
+
z && /* @__PURE__ */ t("div", { className: s.loadMore, children: /* @__PURE__ */ t(
|
|
176
184
|
L,
|
|
177
185
|
{
|
|
178
186
|
as: "button",
|
|
179
187
|
variant: "primary",
|
|
180
|
-
onClick:
|
|
181
|
-
disabled:
|
|
188
|
+
onClick: P,
|
|
189
|
+
disabled: d,
|
|
182
190
|
icon: "refresh",
|
|
183
191
|
iconAlignment: "left",
|
|
184
|
-
className:
|
|
185
|
-
children:
|
|
192
|
+
className: d ? s.buttonIsLoading : "",
|
|
193
|
+
children: d ? "Loading..." : "Load more"
|
|
186
194
|
}
|
|
187
195
|
) })
|
|
188
196
|
] })
|
|
@@ -190,5 +198,5 @@ function ue({
|
|
|
190
198
|
] }) });
|
|
191
199
|
}
|
|
192
200
|
export {
|
|
193
|
-
|
|
201
|
+
he as DocumentListBlock
|
|
194
202
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../assets/index67.css');const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../assets/index67.css');const e=require("react/jsx-runtime"),h=require("react"),I=require("./HeroContext.cjs"),i=require("../../ui/PortableTextRenderer/index.cjs"),m=require("../../ui/CallToActions/index.cjs"),v=require("next/image"),w=require("../../ui/LocaleLink/index.cjs"),L=require("../../hooks/usePrefersReducedMotion.cjs"),P=require("../../../createLucideIcon-DpotSgUx.cjs"),q=require("../../../play-CQBnZgNa.cjs");/**
|
|
2
2
|
* @license lucide-react v0.488.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const F=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],U=P.createLucideIcon("pause",F),H="_hero_vho5i_1",S="_container_vho5i_7",z="_eyebrow_vho5i_24",W="_disclaimer_vho5i_28",E="_text_vho5i_33",M="_articleDetails_vho5i_40",V="_articleType_vho5i_53",Y="_articleCategories_vho5i_67",G="_category_vho5i_73",J="_number_vho5i_89",K="_blog_vho5i_116",Q="_overlay_vho5i_140",X="_fullBleed_vho5i_210",Z="_split_vho5i_304",O="_image_vho5i_309",A="_videoControl_vho5i_332",g="_videoWrapper_vho5i_353",D="_videoBackground_vho5i_373",ee="_iframe_vho5i_374",s={hero:H,container:S,eyebrow:z,disclaimer:W,text:E,articleDetails:M,articleType:V,articleCategories:Y,category:G,number:J,default:"_default_vho5i_112",blog:K,overlay:Q,fullBleed:X,split:Z,image:O,videoControl:A,videoWrapper:g,videoBackground:D,iframe:ee};function se({heading:t,image:
|
|
6
|
+
*/const F=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],U=P.createLucideIcon("pause",F),H="_hero_vho5i_1",S="_container_vho5i_7",z="_eyebrow_vho5i_24",W="_disclaimer_vho5i_28",E="_text_vho5i_33",M="_articleDetails_vho5i_40",V="_articleType_vho5i_53",Y="_articleCategories_vho5i_67",G="_category_vho5i_73",J="_number_vho5i_89",K="_blog_vho5i_116",Q="_overlay_vho5i_140",X="_fullBleed_vho5i_210",Z="_split_vho5i_304",O="_image_vho5i_309",A="_videoControl_vho5i_332",g="_videoWrapper_vho5i_353",D="_videoBackground_vho5i_373",ee="_iframe_vho5i_374",s={hero:H,container:S,eyebrow:z,disclaimer:W,text:E,articleDetails:M,articleType:V,articleCategories:Y,category:G,number:J,default:"_default_vho5i_112",blog:K,overlay:Q,fullBleed:X,split:Z,image:O,videoControl:A,videoWrapper:g,videoBackground:D,iframe:ee};function se({heading:t,image:l,video:r,callToAction:n,pageData:o,styleOptions:j}){var $,B;const u=L.usePrefersReducedMotion(),[k,N]=h.useState(!u),{setIsFullbleedHeroAtTop:C}=I.useHeroContext(),a=h.useRef(null),y=(j==null?void 0:j.layout)??"default",b={default:s.default,split:s.split,"full-bleed":s.fullBleed,blog:s.blog}[y],_=($=o==null?void 0:o.categories)!=null&&$.length?o==null?void 0:o.categories[0]:null,d=(B=o==null?void 0:o.categories)!=null&&B.length?o==null?void 0:o.categories[1]:null;h.useEffect(()=>{const c=()=>{C(window.scrollY===0)};if(y==="full-bleed"&&typeof window<"u")return C(!0),window.addEventListener("scroll",c),()=>window.removeEventListener("scroll",c)},[y]),h.useEffect(()=>{const c=a.current;c&&(u?c.pause():c.play())},[u]);const p=()=>e.jsx("button",{title:`${k?"Pause the video":"Play the video"}`,className:s.videoControl,onClick:()=>{const c=a.current;c&&(c.paused?(c.play().catch(()=>{}),N(!0)):(c.pause(),N(!1)))},children:k?e.jsx(U,{size:18}):e.jsx(q.Play,{size:18})}),R=()=>{if(!r)return null;const c=r.includes("vimeo.com"),x=r.includes("youtube.com")||r.includes("youtu.be");return c||x?e.jsx("div",{className:s.videoWrapper,children:e.jsx("iframe",{src:c?`${r}?autoplay=1&muted=1&loop=1&background=1`:`${r}?autoplay=1&mute=1&loop=1&playlist=${f(r)}`,allow:"autoplay; fullscreen",allowFullScreen:!0})}):e.jsxs("div",{className:s.videoWrapper,children:[e.jsx(p,{}),e.jsx("video",{ref:a,src:r,autoPlay:!u,loop:!0,muted:!0,playsInline:!0,poster:(l==null?void 0:l.imageUrl)||void 0,preload:"metadata"})]})};function f(c){const x=c.match(/(?:youtube\.com\/.*v=|youtu\.be\/)([^&?/]+)/);return(x==null?void 0:x[1])||""}const T=()=>l&&l.imageUrl?e.jsx("div",{className:s.image,children:e.jsx(v,{src:l.imageUrl,alt:l.asset.altText||l.asset.description||"Hero image",width:600,height:658,priority:!0})}):null;switch(y){case"split":return e.jsx("section",{className:`${s.hero} ${s.split}`,children:e.jsxs("article",{className:s.container,children:[e.jsxs("div",{className:s.text,children:[e.jsxs("div",{children:[t.eyebrow&&e.jsx(i.RichText,{className:s.eyebrow,blocks:t.eyebrow}),e.jsx(i.RichText,{blocks:t.title})]}),t.description&&e.jsx(i.RichText,{blocks:t.description}),n&&e.jsx(m.CallToActions,{items:n.items,alignment:n.alignment}),t.disclaimer&&e.jsx(i.RichText,{className:s.disclaimer,blocks:t.disclaimer})]}),r?e.jsx(R,{}):e.jsx(T,{})]})});case"default":return e.jsx("section",{className:`${s.hero} ${b}`,children:e.jsxs("article",{className:s.container,children:[r?e.jsx(R,{}):e.jsx(T,{}),e.jsxs("div",{className:s.text,children:[e.jsxs("div",{children:[t.eyebrow&&e.jsx(i.RichText,{className:s.eyebrow,blocks:t.eyebrow}),e.jsx(i.RichText,{blocks:t.title})]}),t.description&&e.jsx(i.RichText,{blocks:t.description}),n&&e.jsx(m.CallToActions,{items:n.items,alignment:n.alignment})]})]})});case"full-bleed":return e.jsx("section",{className:`${s.hero} ${b} heroFullBleed`,children:e.jsxs("article",{className:s.container,children:[r?r.includes("vimeo.com")||r.includes("youtube.com")||r.includes("youtu.be")?e.jsx("div",{className:s.videoBackground,children:e.jsx("iframe",{src:r.includes("vimeo.com")?`${r}?autoplay=1&muted=1&loop=1&background=1`:`${r}?autoplay=1&mute=1&loop=1&playlist=${f(r)}`,className:s.iframe,allow:"autoplay; fullscreen",allowFullScreen:!0})}):e.jsxs(e.Fragment,{children:[e.jsx(p,{}),e.jsx("video",{ref:a,className:s.videoBackground,src:r,autoPlay:!u,loop:!0,muted:!0,playsInline:!0,poster:(l==null?void 0:l.imageUrl)||void 0})]}):e.jsx(v,{src:(l==null?void 0:l.imageUrl)??"",alt:(l==null?void 0:l.asset.altText)||(l==null?void 0:l.asset.description)||"Card image",fill:!0,priority:!0,style:{objectFit:"cover"},draggable:!1,sizes:"(min-width: 500px) 500px, 100vw"}),e.jsx("div",{className:s.overlay,children:e.jsxs("div",{className:s.text,children:[e.jsxs("div",{children:[t.eyebrow&&e.jsx(i.RichText,{className:s.eyebrow,blocks:t.eyebrow}),e.jsx(i.RichText,{blocks:t.title})]}),t.description&&e.jsx(i.RichText,{blocks:t.description}),n&&e.jsx(m.CallToActions,{items:n.items,alignment:n.alignment})]})})]})});case"blog":return e.jsx("section",{className:`${s.hero} ${b}`,children:e.jsxs("article",{className:s.container,children:[r?r.includes("vimeo.com")||r.includes("youtube.com")||r.includes("youtu.be")?e.jsx("div",{className:s.videoBackground,children:e.jsx("iframe",{src:r.includes("vimeo.com")?`${r}?autoplay=1&muted=1&loop=1&background=1`:`${r}?autoplay=1&mute=1&loop=1&playlist=${f(r)}`,className:s.iframe,allow:"autoplay; fullscreen",allowFullScreen:!0})}):e.jsxs(e.Fragment,{children:[e.jsx(p,{}),e.jsx("video",{ref:a,className:s.videoBackground,src:r,autoPlay:!u,loop:!0,muted:!0,playsInline:!0,poster:(l==null?void 0:l.imageUrl)||void 0})]}):e.jsx(v,{src:(l==null?void 0:l.imageUrl)??"",alt:(l==null?void 0:l.asset.altText)||(l==null?void 0:l.asset.description)||"Card image",fill:!0,priority:!0,style:{objectFit:"cover"},draggable:!1,sizes:"(min-width: 500px) 500px, 100vw"}),e.jsx("div",{className:s.overlay,children:e.jsxs("div",{className:s.text,children:[e.jsxs("div",{children:[t.eyebrow&&e.jsx(i.RichText,{className:s.eyebrow,blocks:t.eyebrow}),o&&e.jsxs("div",{className:s.articleDetails,children:[o.articleType&&e.jsx(w.LocaleLink,{href:`/blog/search?type=${encodeURIComponent(o.articleType)}`,className:s.articleType,children:o.articleType},o.articleType),e.jsxs("div",{className:s.articleCategories,children:[_&&e.jsx(w.LocaleLink,{href:`/blog/search?categories=${encodeURIComponent(_._id)}`,className:s.category,children:_.title},_._id),d&&d.title.toLowerCase()!=="library"&&!d.slug.current.includes("keywords")&&e.jsx(w.LocaleLink,{href:`/blog/search?categories=${encodeURIComponent(d._id)}`,className:s.category,children:d.title},d._id)]}),o.timeToRead&&e.jsx(e.Fragment,{children:e.jsxs("span",{children:[e.jsx("span",{className:s.number,children:o.timeToRead}),"min read"]})})]}),e.jsx(i.RichText,{blocks:t.title})]}),t.description&&e.jsx(i.RichText,{blocks:t.description}),n&&e.jsx(m.CallToActions,{items:n.items,alignment:n.alignment})]})})]})})}}exports.HeroBlock=se;
|
|
@@ -2,7 +2,7 @@ import { jsx as e, jsxs as c, Fragment as N } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState as T, useRef as z, useEffect as F } from "react";
|
|
3
3
|
import { useHeroContext as L } from "./HeroContext.mjs";
|
|
4
4
|
import { RichText as n } from "../../ui/PortableTextRenderer/index.mjs";
|
|
5
|
-
import { CallToActions as
|
|
5
|
+
import { CallToActions as h } from "../../ui/CallToActions/index.mjs";
|
|
6
6
|
import k from "next/image";
|
|
7
7
|
import { LocaleLink as x } from "../../ui/LocaleLink/index.mjs";
|
|
8
8
|
import { usePrefersReducedMotion as S } from "../../hooks/usePrefersReducedMotion.mjs";
|
|
@@ -39,21 +39,21 @@ const H = [
|
|
|
39
39
|
videoBackground: oe,
|
|
40
40
|
iframe: te
|
|
41
41
|
};
|
|
42
|
-
function
|
|
42
|
+
function _e({
|
|
43
43
|
heading: t,
|
|
44
44
|
image: l,
|
|
45
45
|
video: o,
|
|
46
46
|
callToAction: u,
|
|
47
47
|
pageData: s,
|
|
48
|
-
styleOptions:
|
|
48
|
+
styleOptions: b
|
|
49
49
|
}) {
|
|
50
50
|
var R, U;
|
|
51
|
-
const d = S(), [C, $] = T(!d), { setIsFullbleedHeroAtTop: B } = L(), m = z(null), p = (
|
|
51
|
+
const d = S(), [C, $] = T(!d), { setIsFullbleedHeroAtTop: B } = L(), m = z(null), p = (b == null ? void 0 : b.layout) ?? "default", f = {
|
|
52
52
|
default: r.default,
|
|
53
53
|
split: r.split,
|
|
54
54
|
"full-bleed": r.fullBleed,
|
|
55
55
|
blog: r.blog
|
|
56
|
-
}[p],
|
|
56
|
+
}[p], _ = (R = s == null ? void 0 : s.categories) != null && R.length ? s == null ? void 0 : s.categories[0] : null, a = (U = s == null ? void 0 : s.categories) != null && U.length ? s == null ? void 0 : s.categories[1] : null;
|
|
57
57
|
F(() => {
|
|
58
58
|
const i = () => {
|
|
59
59
|
B(window.scrollY === 0);
|
|
@@ -135,7 +135,7 @@ function he({
|
|
|
135
135
|
] }),
|
|
136
136
|
t.description && /* @__PURE__ */ e(n, { blocks: t.description }),
|
|
137
137
|
u && /* @__PURE__ */ e(
|
|
138
|
-
|
|
138
|
+
h,
|
|
139
139
|
{
|
|
140
140
|
items: u.items,
|
|
141
141
|
alignment: u.alignment
|
|
@@ -167,7 +167,7 @@ function he({
|
|
|
167
167
|
] }),
|
|
168
168
|
t.description && /* @__PURE__ */ e(n, { blocks: t.description }),
|
|
169
169
|
u && /* @__PURE__ */ e(
|
|
170
|
-
|
|
170
|
+
h,
|
|
171
171
|
{
|
|
172
172
|
items: u.items,
|
|
173
173
|
alignment: u.alignment
|
|
@@ -227,7 +227,7 @@ function he({
|
|
|
227
227
|
] }),
|
|
228
228
|
t.description && /* @__PURE__ */ e(n, { blocks: t.description }),
|
|
229
229
|
u && /* @__PURE__ */ e(
|
|
230
|
-
|
|
230
|
+
h,
|
|
231
231
|
{
|
|
232
232
|
items: u.items,
|
|
233
233
|
alignment: u.alignment
|
|
@@ -296,24 +296,24 @@ function he({
|
|
|
296
296
|
s.articleType
|
|
297
297
|
),
|
|
298
298
|
/* @__PURE__ */ c("div", { className: r.articleCategories, children: [
|
|
299
|
-
|
|
299
|
+
_ && /* @__PURE__ */ e(
|
|
300
300
|
x,
|
|
301
301
|
{
|
|
302
|
-
href: `/blog/search?
|
|
303
|
-
|
|
302
|
+
href: `/blog/search?categories=${encodeURIComponent(
|
|
303
|
+
_._id
|
|
304
304
|
)}`,
|
|
305
305
|
className: r.category,
|
|
306
|
-
children:
|
|
306
|
+
children: _.title
|
|
307
307
|
},
|
|
308
|
-
|
|
308
|
+
_._id
|
|
309
309
|
),
|
|
310
310
|
a && a.title.toLowerCase() !== "library" && !a.slug.current.includes(
|
|
311
311
|
"keywords"
|
|
312
312
|
) && /* @__PURE__ */ e(
|
|
313
313
|
x,
|
|
314
314
|
{
|
|
315
|
-
href: `/blog/search?
|
|
316
|
-
a.
|
|
315
|
+
href: `/blog/search?categories=${encodeURIComponent(
|
|
316
|
+
a._id
|
|
317
317
|
)}`,
|
|
318
318
|
className: r.category,
|
|
319
319
|
children: a.title
|
|
@@ -330,7 +330,7 @@ function he({
|
|
|
330
330
|
] }),
|
|
331
331
|
t.description && /* @__PURE__ */ e(n, { blocks: t.description }),
|
|
332
332
|
u && /* @__PURE__ */ e(
|
|
333
|
-
|
|
333
|
+
h,
|
|
334
334
|
{
|
|
335
335
|
items: u.items,
|
|
336
336
|
alignment: u.alignment
|
|
@@ -341,5 +341,5 @@ function he({
|
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
343
|
export {
|
|
344
|
-
|
|
344
|
+
_e as HeroBlock
|
|
345
345
|
};
|