quirk-ui 0.0.506 → 0.0.507

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.
@@ -1,6 +1,6 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../assets/index67.css');const e=require("react/jsx-runtime"),j=require("react"),q=require("./HeroContext.cjs"),c=require("../../ui/PortableTextRenderer/index.cjs"),p=require("../../ui/CallToActions/index.cjs"),k=require("next/image"),N=require("../../ui/LocaleLink/index.cjs"),F=require("../../hooks/usePrefersReducedMotion.cjs"),U=require("../../../createLucideIcon-DpotSgUx.cjs"),H=require("../../../play-CQBnZgNa.cjs");/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../assets/index67.css');const e=require("react/jsx-runtime"),b=require("react"),U=require("./HeroContext.cjs"),c=require("../../ui/PortableTextRenderer/index.cjs"),p=require("../../ui/CallToActions/index.cjs"),k=require("next/image"),N=require("../../ui/LocaleLink/index.cjs"),H=require("../../hooks/usePrefersReducedMotion.cjs"),S=require("../../../createLucideIcon-DpotSgUx.cjs"),W=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 S=[["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"}]],W=U.createLucideIcon("pause",S),z="_hero_vho5i_1",E="_container_vho5i_7",M="_eyebrow_vho5i_24",V="_disclaimer_vho5i_28",Y="_text_vho5i_33",G="_articleDetails_vho5i_40",J="_articleType_vho5i_53",K="_articleCategories_vho5i_67",Q="_category_vho5i_73",X="_number_vho5i_89",Z="_blog_vho5i_116",g="_overlay_vho5i_140",O="_fullBleed_vho5i_210",A="_split_vho5i_304",D="_image_vho5i_309",ee="_videoControl_vho5i_332",se="_videoWrapper_vho5i_353",te="_videoBackground_vho5i_373",re="_iframe_vho5i_374",s={hero:z,container:E,eyebrow:M,disclaimer:V,text:Y,articleDetails:G,articleType:J,articleCategories:K,category:Q,number:X,default:"_default_vho5i_112",blog:Z,overlay:g,fullBleed:O,split:A,image:D,videoControl:ee,videoWrapper:se,videoBackground:te,iframe:re};function le({heading:l,image:t,video:r,callToAction:i,pageData:a,styleOptions:b}){var L,P;const u=F.usePrefersReducedMotion(),[C,R]=j.useState(!u),{setIsFullbleedHeroAtTop:$}=q.useHeroContext(),x=j.useRef(null),_=(b==null?void 0:b.layout)??"default",f={default:s.default,split:s.split,"full-bleed":s.fullBleed,blog:s.blog}[_],T=((L=a==null?void 0:a.categories)==null?void 0:L.filter(o=>{var n,y;return!((y=(n=o.slug)==null?void 0:n.current)!=null&&y.startsWith("library/type"))}))??[],h=T[0]??null,d=T[1]??null,m=((P=a==null?void 0:a.categories)==null?void 0:P.find(o=>{var n,y;return(y=(n=o.slug)==null?void 0:n.current)==null?void 0:y.startsWith("library/type")}))??null;j.useEffect(()=>{const o=()=>{$(window.scrollY===0)};if(_==="full-bleed"&&typeof window<"u")return $(!0),window.addEventListener("scroll",o),()=>window.removeEventListener("scroll",o)},[_]),j.useEffect(()=>{const o=x.current;o&&(u?o.pause():o.play())},[u]);const v=()=>e.jsx("button",{title:`${C?"Pause the video":"Play the video"}`,className:s.videoControl,onClick:()=>{const o=x.current;o&&(o.paused?(o.play().catch(()=>{}),R(!0)):(o.pause(),R(!1)))},children:C?e.jsx(W,{size:18}):e.jsx(H.Play,{size:18})}),B=()=>{if(!r)return null;const o=r.includes("vimeo.com"),n=r.includes("youtube.com")||r.includes("youtu.be");return o||n?e.jsx("div",{className:s.videoWrapper,children:e.jsx("iframe",{src:o?`${r}?autoplay=1&muted=1&loop=1&background=1`:`${r}?autoplay=1&mute=1&loop=1&playlist=${w(r)}`,allow:"autoplay; fullscreen",allowFullScreen:!0})}):e.jsxs("div",{className:s.videoWrapper,children:[e.jsx(v,{}),e.jsx("video",{ref:x,src:r,autoPlay:!u,loop:!0,muted:!0,playsInline:!0,poster:(t==null?void 0:t.imageUrl)||void 0,preload:"metadata"})]})};function w(o){const n=o.match(/(?:youtube\.com\/.*v=|youtu\.be\/)([^&?/]+)/);return(n==null?void 0:n[1])||""}const I=()=>t&&t.imageUrl?e.jsx("div",{className:s.image,children:e.jsx(k,{src:t.imageUrl,alt:t.asset.altText||t.asset.description||"Hero image",width:600,height:658,priority:!0})}):null;switch(_){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:[l.eyebrow&&e.jsx(c.RichText,{className:s.eyebrow,blocks:l.eyebrow}),e.jsx(c.RichText,{blocks:l.title})]}),l.description&&e.jsx(c.RichText,{blocks:l.description}),i&&e.jsx(p.CallToActions,{items:i.items,alignment:i.alignment}),l.disclaimer&&e.jsx(c.RichText,{className:s.disclaimer,blocks:l.disclaimer})]}),r?e.jsx(B,{}):e.jsx(I,{})]})});case"default":return e.jsx("section",{className:`${s.hero} ${f}`,children:e.jsxs("article",{className:s.container,children:[r?e.jsx(B,{}):e.jsx(I,{}),e.jsxs("div",{className:s.text,children:[e.jsxs("div",{children:[l.eyebrow&&e.jsx(c.RichText,{className:s.eyebrow,blocks:l.eyebrow}),e.jsx(c.RichText,{blocks:l.title})]}),l.description&&e.jsx(c.RichText,{blocks:l.description}),i&&e.jsx(p.CallToActions,{items:i.items,alignment:i.alignment})]})]})});case"full-bleed":return e.jsx("section",{className:`${s.hero} ${f} 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=${w(r)}`,className:s.iframe,allow:"autoplay; fullscreen",allowFullScreen:!0})}):e.jsxs(e.Fragment,{children:[e.jsx(v,{}),e.jsx("video",{ref:x,className:s.videoBackground,src:r,autoPlay:!u,loop:!0,muted:!0,playsInline:!0,poster:(t==null?void 0:t.imageUrl)||void 0})]}):e.jsx(k,{src:(t==null?void 0:t.imageUrl)??"",alt:(t==null?void 0:t.asset.altText)||(t==null?void 0:t.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:[l.eyebrow&&e.jsx(c.RichText,{className:s.eyebrow,blocks:l.eyebrow}),e.jsx(c.RichText,{blocks:l.title})]}),l.description&&e.jsx(c.RichText,{blocks:l.description}),i&&e.jsx(p.CallToActions,{items:i.items,alignment:i.alignment})]})})]})});case"blog":return e.jsx("section",{className:`${s.hero} ${f}`,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=${w(r)}`,className:s.iframe,allow:"autoplay; fullscreen",allowFullScreen:!0})}):e.jsxs(e.Fragment,{children:[e.jsx(v,{}),e.jsx("video",{ref:x,className:s.videoBackground,src:r,autoPlay:!u,loop:!0,muted:!0,playsInline:!0,poster:(t==null?void 0:t.imageUrl)||void 0})]}):e.jsx(k,{src:(t==null?void 0:t.imageUrl)??"",alt:(t==null?void 0:t.asset.altText)||(t==null?void 0:t.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:[l.eyebrow&&e.jsx(c.RichText,{className:s.eyebrow,blocks:l.eyebrow}),a&&e.jsxs("div",{className:s.articleDetails,children:[m&&e.jsx(N.LocaleLink,{href:`/blog/search?categories=${encodeURIComponent(m._id)}`,className:s.articleType,children:m.title},m._id),e.jsxs("div",{className:s.articleCategories,children:[h&&e.jsx(N.LocaleLink,{href:`/blog/search?categories=${encodeURIComponent(h._id)}`,className:s.category,children:h.title},h._id),d&&d.title.toLowerCase()!=="library"&&!d.slug.current.includes("keywords")&&e.jsx(N.LocaleLink,{href:`/blog/search?categories=${encodeURIComponent(d._id)}`,className:s.category,children:d.title},d._id)]}),a.timeToRead&&e.jsx(e.Fragment,{children:e.jsxs("span",{children:[e.jsx("span",{className:s.number,children:a.timeToRead}),"min read"]})})]}),e.jsx(c.RichText,{blocks:l.title})]}),l.description&&e.jsx(c.RichText,{blocks:l.description}),i&&e.jsx(p.CallToActions,{items:i.items,alignment:i.alignment})]})})]})})}}exports.HeroBlock=le;
6
+ */const z=[["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"}]],E=S.createLucideIcon("pause",z),M="_hero_vho5i_1",V="_container_vho5i_7",Y="_eyebrow_vho5i_24",g="_disclaimer_vho5i_28",G="_text_vho5i_33",J="_articleDetails_vho5i_40",K="_articleType_vho5i_53",Q="_articleCategories_vho5i_67",X="_category_vho5i_73",Z="_number_vho5i_89",A="_blog_vho5i_116",D="_overlay_vho5i_140",O="_fullBleed_vho5i_210",ee="_split_vho5i_304",se="_image_vho5i_309",te="_videoControl_vho5i_332",re="_videoWrapper_vho5i_353",le="_videoBackground_vho5i_373",oe="_iframe_vho5i_374",s={hero:M,container:V,eyebrow:Y,disclaimer:g,text:G,articleDetails:J,articleType:K,articleCategories:Q,category:X,number:Z,default:"_default_vho5i_112",blog:A,overlay:D,fullBleed:O,split:ee,image:se,videoControl:te,videoWrapper:re,videoBackground:le,iframe:oe};function ce({heading:l,image:t,video:r,callToAction:i,pageData:a,styleOptions:u}){var L,P,q;const d=H.usePrefersReducedMotion(),[C,R]=b.useState(!d),{setIsFullbleedHeroAtTop:$}=U.useHeroContext(),_=b.useRef(null),h=(u==null?void 0:u.layout)??"default",F=((L=u==null?void 0:u.padding)==null?void 0:L.join(" "))??"",f={default:s.default,split:s.split,"full-bleed":s.fullBleed,blog:s.blog}[h],T=((P=a==null?void 0:a.categories)==null?void 0:P.filter(o=>{var n,y;return!((y=(n=o.slug)==null?void 0:n.current)!=null&&y.startsWith("library/type"))}))??[],m=T[0]??null,x=T[1]??null,j=((q=a==null?void 0:a.categories)==null?void 0:q.find(o=>{var n,y;return(y=(n=o.slug)==null?void 0:n.current)==null?void 0:y.startsWith("library/type")}))??null;b.useEffect(()=>{const o=()=>{$(window.scrollY===0)};if(h==="full-bleed"&&typeof window<"u")return $(!0),window.addEventListener("scroll",o),()=>window.removeEventListener("scroll",o)},[h]),b.useEffect(()=>{const o=_.current;o&&(d?o.pause():o.play())},[d]);const v=()=>e.jsx("button",{title:`${C?"Pause the video":"Play the video"}`,className:s.videoControl,onClick:()=>{const o=_.current;o&&(o.paused?(o.play().catch(()=>{}),R(!0)):(o.pause(),R(!1)))},children:C?e.jsx(E,{size:18}):e.jsx(W.Play,{size:18})}),B=()=>{if(!r)return null;const o=r.includes("vimeo.com"),n=r.includes("youtube.com")||r.includes("youtu.be");return o||n?e.jsx("div",{className:s.videoWrapper,children:e.jsx("iframe",{src:o?`${r}?autoplay=1&muted=1&loop=1&background=1`:`${r}?autoplay=1&mute=1&loop=1&playlist=${w(r)}`,allow:"autoplay; fullscreen",allowFullScreen:!0})}):e.jsxs("div",{className:s.videoWrapper,children:[e.jsx(v,{}),e.jsx("video",{ref:_,src:r,autoPlay:!d,loop:!0,muted:!0,playsInline:!0,poster:(t==null?void 0:t.imageUrl)||void 0,preload:"metadata"})]})};function w(o){const n=o.match(/(?:youtube\.com\/.*v=|youtu\.be\/)([^&?/]+)/);return(n==null?void 0:n[1])||""}const I=()=>t&&t.imageUrl?e.jsx("div",{className:s.image,children:e.jsx(k,{src:t.imageUrl,alt:t.asset.altText||t.asset.description||"Hero image",width:600,height:658,priority:!0})}):null;switch(h){case"split":return e.jsx("section",{className:`${s.hero} ${s.split}`,children:e.jsxs("article",{className:`${F} ${s.container}`,children:[e.jsxs("div",{className:s.text,children:[e.jsxs("div",{children:[l.eyebrow&&e.jsx(c.RichText,{className:s.eyebrow,blocks:l.eyebrow}),e.jsx(c.RichText,{blocks:l.title})]}),l.description&&e.jsx(c.RichText,{blocks:l.description}),i&&e.jsx(p.CallToActions,{items:i.items,alignment:i.alignment}),l.disclaimer&&e.jsx(c.RichText,{className:s.disclaimer,blocks:l.disclaimer})]}),r?e.jsx(B,{}):e.jsx(I,{})]})});case"default":return e.jsx("section",{className:`${s.hero} ${f}`,children:e.jsxs("article",{className:s.container,children:[r?e.jsx(B,{}):e.jsx(I,{}),e.jsxs("div",{className:s.text,children:[e.jsxs("div",{children:[l.eyebrow&&e.jsx(c.RichText,{className:s.eyebrow,blocks:l.eyebrow}),e.jsx(c.RichText,{blocks:l.title})]}),l.description&&e.jsx(c.RichText,{blocks:l.description}),i&&e.jsx(p.CallToActions,{items:i.items,alignment:i.alignment})]})]})});case"full-bleed":return e.jsx("section",{className:`${s.hero} ${f} 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=${w(r)}`,className:s.iframe,allow:"autoplay; fullscreen",allowFullScreen:!0})}):e.jsxs(e.Fragment,{children:[e.jsx(v,{}),e.jsx("video",{ref:_,className:s.videoBackground,src:r,autoPlay:!d,loop:!0,muted:!0,playsInline:!0,poster:(t==null?void 0:t.imageUrl)||void 0})]}):e.jsx(k,{src:(t==null?void 0:t.imageUrl)??"",alt:(t==null?void 0:t.asset.altText)||(t==null?void 0:t.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:[l.eyebrow&&e.jsx(c.RichText,{className:s.eyebrow,blocks:l.eyebrow}),e.jsx(c.RichText,{blocks:l.title})]}),l.description&&e.jsx(c.RichText,{blocks:l.description}),i&&e.jsx(p.CallToActions,{items:i.items,alignment:i.alignment})]})})]})});case"blog":return e.jsx("section",{className:`${s.hero} ${f}`,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=${w(r)}`,className:s.iframe,allow:"autoplay; fullscreen",allowFullScreen:!0})}):e.jsxs(e.Fragment,{children:[e.jsx(v,{}),e.jsx("video",{ref:_,className:s.videoBackground,src:r,autoPlay:!d,loop:!0,muted:!0,playsInline:!0,poster:(t==null?void 0:t.imageUrl)||void 0})]}):e.jsx(k,{src:(t==null?void 0:t.imageUrl)??"",alt:(t==null?void 0:t.asset.altText)||(t==null?void 0:t.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:[l.eyebrow&&e.jsx(c.RichText,{className:s.eyebrow,blocks:l.eyebrow}),a&&e.jsxs("div",{className:s.articleDetails,children:[j&&e.jsx(N.LocaleLink,{href:`/blog/search?categories=${encodeURIComponent(j._id)}`,className:s.articleType,children:j.title},j._id),e.jsxs("div",{className:s.articleCategories,children:[m&&e.jsx(N.LocaleLink,{href:`/blog/search?categories=${encodeURIComponent(m._id)}`,className:s.category,children:m.title},m._id),x&&x.title.toLowerCase()!=="library"&&!x.slug.current.includes("keywords")&&e.jsx(N.LocaleLink,{href:`/blog/search?categories=${encodeURIComponent(x._id)}`,className:s.category,children:x.title},x._id)]}),a.timeToRead&&e.jsx(e.Fragment,{children:e.jsxs("span",{children:[e.jsx("span",{className:s.number,children:a.timeToRead}),"min read"]})})]}),e.jsx(c.RichText,{blocks:l.title})]}),l.description&&e.jsx(c.RichText,{blocks:l.description}),i&&e.jsx(p.CallToActions,{items:i.items,alignment:i.alignment})]})})]})})}}exports.HeroBlock=ce;
@@ -1,99 +1,99 @@
1
1
  import { jsx as e, jsxs as c, Fragment as x } from "react/jsx-runtime";
2
- import { useState as S, useRef as j, useEffect as L } from "react";
3
- import { useHeroContext as H } from "./HeroContext.mjs";
2
+ import { useState as H, useRef as T, useEffect as j } from "react";
3
+ import { useHeroContext as V } from "./HeroContext.mjs";
4
4
  import { RichText as i } from "../../ui/PortableTextRenderer/index.mjs";
5
- import { CallToActions as h } from "../../ui/CallToActions/index.mjs";
5
+ import { CallToActions as v } from "../../ui/CallToActions/index.mjs";
6
6
  import C from "next/image";
7
7
  import { LocaleLink as $ } from "../../ui/LocaleLink/index.mjs";
8
- import { usePrefersReducedMotion as T } from "../../hooks/usePrefersReducedMotion.mjs";
9
- import { c as V } from "../../../createLucideIcon-C8GTh_Qx.js";
10
- import { P as E } from "../../../play-DYgKiSaf.js";
8
+ import { usePrefersReducedMotion as E } from "../../hooks/usePrefersReducedMotion.mjs";
9
+ import { c as Y } from "../../../createLucideIcon-C8GTh_Qx.js";
10
+ import { P as M } from "../../../play-DYgKiSaf.js";
11
11
  import '../../../assets/index67.css';/**
12
12
  * @license lucide-react v0.488.0 - ISC
13
13
  *
14
14
  * This source code is licensed under the ISC license.
15
15
  * See the LICENSE file in the root directory of this source tree.
16
16
  */
17
- const Y = [
17
+ const q = [
18
18
  ["rect", { x: "14", y: "4", width: "4", height: "16", rx: "1", key: "zuxfzm" }],
19
19
  ["rect", { x: "6", y: "4", width: "4", height: "16", rx: "1", key: "1okwgv" }]
20
- ], M = V("pause", Y), q = "_hero_vho5i_1", G = "_container_vho5i_7", J = "_eyebrow_vho5i_24", K = "_disclaimer_vho5i_28", Q = "_text_vho5i_33", X = "_articleDetails_vho5i_40", Z = "_articleType_vho5i_53", O = "_articleCategories_vho5i_67", g = "_category_vho5i_73", D = "_number_vho5i_89", A = "_blog_vho5i_116", ee = "_overlay_vho5i_140", re = "_fullBleed_vho5i_210", te = "_split_vho5i_304", le = "_image_vho5i_309", oe = "_videoControl_vho5i_332", se = "_videoWrapper_vho5i_353", ce = "_videoBackground_vho5i_373", ie = "_iframe_vho5i_374", r = {
21
- hero: q,
22
- container: G,
23
- eyebrow: J,
24
- disclaimer: K,
25
- text: Q,
26
- articleDetails: X,
27
- articleType: Z,
28
- articleCategories: O,
29
- category: g,
30
- number: D,
20
+ ], G = Y("pause", q), J = "_hero_vho5i_1", K = "_container_vho5i_7", Q = "_eyebrow_vho5i_24", X = "_disclaimer_vho5i_28", Z = "_text_vho5i_33", g = "_articleDetails_vho5i_40", D = "_articleType_vho5i_53", A = "_articleCategories_vho5i_67", O = "_category_vho5i_73", ee = "_number_vho5i_89", re = "_blog_vho5i_116", le = "_overlay_vho5i_140", oe = "_fullBleed_vho5i_210", te = "_split_vho5i_304", se = "_image_vho5i_309", ce = "_videoControl_vho5i_332", ie = "_videoWrapper_vho5i_353", ne = "_videoBackground_vho5i_373", ae = "_iframe_vho5i_374", r = {
21
+ hero: J,
22
+ container: K,
23
+ eyebrow: Q,
24
+ disclaimer: X,
25
+ text: Z,
26
+ articleDetails: g,
27
+ articleType: D,
28
+ articleCategories: A,
29
+ category: O,
30
+ number: ee,
31
31
  default: "_default_vho5i_112",
32
- blog: A,
33
- overlay: ee,
34
- fullBleed: re,
32
+ blog: re,
33
+ overlay: le,
34
+ fullBleed: oe,
35
35
  split: te,
36
- image: le,
37
- videoControl: oe,
38
- videoWrapper: se,
39
- videoBackground: ce,
40
- iframe: ie
36
+ image: se,
37
+ videoControl: ce,
38
+ videoWrapper: ie,
39
+ videoBackground: ne,
40
+ iframe: ae
41
41
  };
42
- function he({
43
- heading: o,
44
- image: t,
45
- video: l,
42
+ function we({
43
+ heading: t,
44
+ image: l,
45
+ video: o,
46
46
  callToAction: n,
47
47
  pageData: u,
48
- styleOptions: v
48
+ styleOptions: d
49
49
  }) {
50
- var W, z;
51
- const d = T(), [B, I] = S(!d), { setIsFullbleedHeroAtTop: P } = H(), y = j(null), _ = (v == null ? void 0 : v.layout) ?? "default", w = {
50
+ var W, z, L;
51
+ const m = E(), [B, I] = H(!m), { setIsFullbleedHeroAtTop: P } = V(), p = T(null), b = (d == null ? void 0 : d.layout) ?? "default", S = ((W = d == null ? void 0 : d.padding) == null ? void 0 : W.join(" ")) ?? "", w = {
52
52
  default: r.default,
53
53
  split: r.split,
54
54
  "full-bleed": r.fullBleed,
55
55
  blog: r.blog
56
- }[_], R = ((W = u == null ? void 0 : u.categories) == null ? void 0 : W.filter(
56
+ }[b], R = ((z = u == null ? void 0 : u.categories) == null ? void 0 : z.filter(
57
57
  (s) => {
58
- var a, p;
59
- return !((p = (a = s.slug) == null ? void 0 : a.current) != null && p.startsWith("library/type"));
58
+ var a, _;
59
+ return !((_ = (a = s.slug) == null ? void 0 : a.current) != null && _.startsWith("library/type"));
60
60
  }
61
- )) ?? [], b = R[0] ?? null, m = R[1] ?? null, f = ((z = u == null ? void 0 : u.categories) == null ? void 0 : z.find(
61
+ )) ?? [], f = R[0] ?? null, y = R[1] ?? null, h = ((L = u == null ? void 0 : u.categories) == null ? void 0 : L.find(
62
62
  (s) => {
63
- var a, p;
64
- return (p = (a = s.slug) == null ? void 0 : a.current) == null ? void 0 : p.startsWith("library/type");
63
+ var a, _;
64
+ return (_ = (a = s.slug) == null ? void 0 : a.current) == null ? void 0 : _.startsWith("library/type");
65
65
  }
66
66
  )) ?? null;
67
- L(() => {
67
+ j(() => {
68
68
  const s = () => {
69
69
  P(window.scrollY === 0);
70
70
  };
71
- if (_ === "full-bleed" && typeof window < "u")
71
+ if (b === "full-bleed" && typeof window < "u")
72
72
  return P(!0), window.addEventListener("scroll", s), () => window.removeEventListener("scroll", s);
73
- }, [_]), L(() => {
74
- const s = y.current;
75
- s && (d ? s.pause() : s.play());
76
- }, [d]);
73
+ }, [b]), j(() => {
74
+ const s = p.current;
75
+ s && (m ? s.pause() : s.play());
76
+ }, [m]);
77
77
  const N = () => /* @__PURE__ */ e(
78
78
  "button",
79
79
  {
80
80
  title: `${B ? "Pause the video" : "Play the video"}`,
81
81
  className: r.videoControl,
82
82
  onClick: () => {
83
- const s = y.current;
83
+ const s = p.current;
84
84
  s && (s.paused ? (s.play().catch(() => {
85
85
  }), I(!0)) : (s.pause(), I(!1)));
86
86
  },
87
- children: B ? /* @__PURE__ */ e(M, { size: 18 }) : /* @__PURE__ */ e(E, { size: 18 })
87
+ children: B ? /* @__PURE__ */ e(G, { size: 18 }) : /* @__PURE__ */ e(M, { size: 18 })
88
88
  }
89
89
  ), U = () => {
90
- if (!l) return null;
91
- const s = l.includes("vimeo.com"), a = l.includes("youtube.com") || l.includes("youtu.be");
90
+ if (!o) return null;
91
+ const s = o.includes("vimeo.com"), a = o.includes("youtube.com") || o.includes("youtu.be");
92
92
  return s || a ? /* @__PURE__ */ e("div", { className: r.videoWrapper, children: /* @__PURE__ */ e(
93
93
  "iframe",
94
94
  {
95
- src: s ? `${l}?autoplay=1&muted=1&loop=1&background=1` : `${l}?autoplay=1&mute=1&loop=1&playlist=${k(
96
- l
95
+ src: s ? `${o}?autoplay=1&muted=1&loop=1&background=1` : `${o}?autoplay=1&mute=1&loop=1&playlist=${k(
96
+ o
97
97
  )}`,
98
98
  allow: "autoplay; fullscreen",
99
99
  allowFullScreen: !0
@@ -103,13 +103,13 @@ function he({
103
103
  /* @__PURE__ */ e(
104
104
  "video",
105
105
  {
106
- ref: y,
107
- src: l,
108
- autoPlay: !d,
106
+ ref: p,
107
+ src: o,
108
+ autoPlay: !m,
109
109
  loop: !0,
110
110
  muted: !0,
111
111
  playsInline: !0,
112
- poster: (t == null ? void 0 : t.imageUrl) || void 0,
112
+ poster: (l == null ? void 0 : l.imageUrl) || void 0,
113
113
  preload: "metadata"
114
114
  }
115
115
  )
@@ -119,65 +119,65 @@ function he({
119
119
  const a = s.match(/(?:youtube\.com\/.*v=|youtu\.be\/)([^&?/]+)/);
120
120
  return (a == null ? void 0 : a[1]) || "";
121
121
  }
122
- const F = () => t && t.imageUrl ? /* @__PURE__ */ e("div", { className: r.image, children: /* @__PURE__ */ e(
122
+ const F = () => l && l.imageUrl ? /* @__PURE__ */ e("div", { className: r.image, children: /* @__PURE__ */ e(
123
123
  C,
124
124
  {
125
- src: t.imageUrl,
126
- alt: t.asset.altText || t.asset.description || "Hero image",
125
+ src: l.imageUrl,
126
+ alt: l.asset.altText || l.asset.description || "Hero image",
127
127
  width: 600,
128
128
  height: 658,
129
129
  priority: !0
130
130
  }
131
131
  ) }) : null;
132
- switch (_) {
132
+ switch (b) {
133
133
  case "split":
134
- return /* @__PURE__ */ e("section", { className: `${r.hero} ${r.split}`, children: /* @__PURE__ */ c("article", { className: r.container, children: [
134
+ return /* @__PURE__ */ e("section", { className: `${r.hero} ${r.split}`, children: /* @__PURE__ */ c("article", { className: `${S} ${r.container}`, children: [
135
135
  /* @__PURE__ */ c("div", { className: r.text, children: [
136
136
  /* @__PURE__ */ c("div", { children: [
137
- o.eyebrow && /* @__PURE__ */ e(
137
+ t.eyebrow && /* @__PURE__ */ e(
138
138
  i,
139
139
  {
140
140
  className: r.eyebrow,
141
- blocks: o.eyebrow
141
+ blocks: t.eyebrow
142
142
  }
143
143
  ),
144
- /* @__PURE__ */ e(i, { blocks: o.title })
144
+ /* @__PURE__ */ e(i, { blocks: t.title })
145
145
  ] }),
146
- o.description && /* @__PURE__ */ e(i, { blocks: o.description }),
146
+ t.description && /* @__PURE__ */ e(i, { blocks: t.description }),
147
147
  n && /* @__PURE__ */ e(
148
- h,
148
+ v,
149
149
  {
150
150
  items: n.items,
151
151
  alignment: n.alignment
152
152
  }
153
153
  ),
154
- o.disclaimer && /* @__PURE__ */ e(
154
+ t.disclaimer && /* @__PURE__ */ e(
155
155
  i,
156
156
  {
157
157
  className: r.disclaimer,
158
- blocks: o.disclaimer
158
+ blocks: t.disclaimer
159
159
  }
160
160
  )
161
161
  ] }),
162
- l ? /* @__PURE__ */ e(U, {}) : /* @__PURE__ */ e(F, {})
162
+ o ? /* @__PURE__ */ e(U, {}) : /* @__PURE__ */ e(F, {})
163
163
  ] }) });
164
164
  case "default":
165
165
  return /* @__PURE__ */ e("section", { className: `${r.hero} ${w}`, children: /* @__PURE__ */ c("article", { className: r.container, children: [
166
- l ? /* @__PURE__ */ e(U, {}) : /* @__PURE__ */ e(F, {}),
166
+ o ? /* @__PURE__ */ e(U, {}) : /* @__PURE__ */ e(F, {}),
167
167
  /* @__PURE__ */ c("div", { className: r.text, children: [
168
168
  /* @__PURE__ */ c("div", { children: [
169
- o.eyebrow && /* @__PURE__ */ e(
169
+ t.eyebrow && /* @__PURE__ */ e(
170
170
  i,
171
171
  {
172
172
  className: r.eyebrow,
173
- blocks: o.eyebrow
173
+ blocks: t.eyebrow
174
174
  }
175
175
  ),
176
- /* @__PURE__ */ e(i, { blocks: o.title })
176
+ /* @__PURE__ */ e(i, { blocks: t.title })
177
177
  ] }),
178
- o.description && /* @__PURE__ */ e(i, { blocks: o.description }),
178
+ t.description && /* @__PURE__ */ e(i, { blocks: t.description }),
179
179
  n && /* @__PURE__ */ e(
180
- h,
180
+ v,
181
181
  {
182
182
  items: n.items,
183
183
  alignment: n.alignment
@@ -187,11 +187,11 @@ function he({
187
187
  ] }) });
188
188
  case "full-bleed":
189
189
  return /* @__PURE__ */ e("section", { className: `${r.hero} ${w} heroFullBleed`, children: /* @__PURE__ */ c("article", { className: r.container, children: [
190
- l ? l.includes("vimeo.com") || l.includes("youtube.com") || l.includes("youtu.be") ? /* @__PURE__ */ e("div", { className: r.videoBackground, children: /* @__PURE__ */ e(
190
+ o ? o.includes("vimeo.com") || o.includes("youtube.com") || o.includes("youtu.be") ? /* @__PURE__ */ e("div", { className: r.videoBackground, children: /* @__PURE__ */ e(
191
191
  "iframe",
192
192
  {
193
- src: l.includes("vimeo.com") ? `${l}?autoplay=1&muted=1&loop=1&background=1` : `${l}?autoplay=1&mute=1&loop=1&playlist=${k(
194
- l
193
+ src: o.includes("vimeo.com") ? `${o}?autoplay=1&muted=1&loop=1&background=1` : `${o}?autoplay=1&mute=1&loop=1&playlist=${k(
194
+ o
195
195
  )}`,
196
196
  className: r.iframe,
197
197
  allow: "autoplay; fullscreen",
@@ -202,21 +202,21 @@ function he({
202
202
  /* @__PURE__ */ e(
203
203
  "video",
204
204
  {
205
- ref: y,
205
+ ref: p,
206
206
  className: r.videoBackground,
207
- src: l,
208
- autoPlay: !d,
207
+ src: o,
208
+ autoPlay: !m,
209
209
  loop: !0,
210
210
  muted: !0,
211
211
  playsInline: !0,
212
- poster: (t == null ? void 0 : t.imageUrl) || void 0
212
+ poster: (l == null ? void 0 : l.imageUrl) || void 0
213
213
  }
214
214
  )
215
215
  ] }) : /* @__PURE__ */ e(
216
216
  C,
217
217
  {
218
- src: (t == null ? void 0 : t.imageUrl) ?? "",
219
- alt: (t == null ? void 0 : t.asset.altText) || (t == null ? void 0 : t.asset.description) || "Card image",
218
+ src: (l == null ? void 0 : l.imageUrl) ?? "",
219
+ alt: (l == null ? void 0 : l.asset.altText) || (l == null ? void 0 : l.asset.description) || "Card image",
220
220
  fill: !0,
221
221
  priority: !0,
222
222
  style: { objectFit: "cover" },
@@ -226,18 +226,18 @@ function he({
226
226
  ),
227
227
  /* @__PURE__ */ e("div", { className: r.overlay, children: /* @__PURE__ */ c("div", { className: r.text, children: [
228
228
  /* @__PURE__ */ c("div", { children: [
229
- o.eyebrow && /* @__PURE__ */ e(
229
+ t.eyebrow && /* @__PURE__ */ e(
230
230
  i,
231
231
  {
232
232
  className: r.eyebrow,
233
- blocks: o.eyebrow
233
+ blocks: t.eyebrow
234
234
  }
235
235
  ),
236
- /* @__PURE__ */ e(i, { blocks: o.title })
236
+ /* @__PURE__ */ e(i, { blocks: t.title })
237
237
  ] }),
238
- o.description && /* @__PURE__ */ e(i, { blocks: o.description }),
238
+ t.description && /* @__PURE__ */ e(i, { blocks: t.description }),
239
239
  n && /* @__PURE__ */ e(
240
- h,
240
+ v,
241
241
  {
242
242
  items: n.items,
243
243
  alignment: n.alignment
@@ -247,11 +247,11 @@ function he({
247
247
  ] }) });
248
248
  case "blog":
249
249
  return /* @__PURE__ */ e("section", { className: `${r.hero} ${w}`, children: /* @__PURE__ */ c("article", { className: r.container, children: [
250
- l ? l.includes("vimeo.com") || l.includes("youtube.com") || l.includes("youtu.be") ? /* @__PURE__ */ e("div", { className: r.videoBackground, children: /* @__PURE__ */ e(
250
+ o ? o.includes("vimeo.com") || o.includes("youtube.com") || o.includes("youtu.be") ? /* @__PURE__ */ e("div", { className: r.videoBackground, children: /* @__PURE__ */ e(
251
251
  "iframe",
252
252
  {
253
- src: l.includes("vimeo.com") ? `${l}?autoplay=1&muted=1&loop=1&background=1` : `${l}?autoplay=1&mute=1&loop=1&playlist=${k(
254
- l
253
+ src: o.includes("vimeo.com") ? `${o}?autoplay=1&muted=1&loop=1&background=1` : `${o}?autoplay=1&mute=1&loop=1&playlist=${k(
254
+ o
255
255
  )}`,
256
256
  className: r.iframe,
257
257
  allow: "autoplay; fullscreen",
@@ -262,21 +262,21 @@ function he({
262
262
  /* @__PURE__ */ e(
263
263
  "video",
264
264
  {
265
- ref: y,
265
+ ref: p,
266
266
  className: r.videoBackground,
267
- src: l,
268
- autoPlay: !d,
267
+ src: o,
268
+ autoPlay: !m,
269
269
  loop: !0,
270
270
  muted: !0,
271
271
  playsInline: !0,
272
- poster: (t == null ? void 0 : t.imageUrl) || void 0
272
+ poster: (l == null ? void 0 : l.imageUrl) || void 0
273
273
  }
274
274
  )
275
275
  ] }) : /* @__PURE__ */ e(
276
276
  C,
277
277
  {
278
- src: (t == null ? void 0 : t.imageUrl) ?? "",
279
- alt: (t == null ? void 0 : t.asset.altText) || (t == null ? void 0 : t.asset.description) || "Card image",
278
+ src: (l == null ? void 0 : l.imageUrl) ?? "",
279
+ alt: (l == null ? void 0 : l.asset.altText) || (l == null ? void 0 : l.asset.description) || "Card image",
280
280
  fill: !0,
281
281
  priority: !0,
282
282
  style: { objectFit: "cover" },
@@ -286,49 +286,49 @@ function he({
286
286
  ),
287
287
  /* @__PURE__ */ e("div", { className: r.overlay, children: /* @__PURE__ */ c("div", { className: r.text, children: [
288
288
  /* @__PURE__ */ c("div", { children: [
289
- o.eyebrow && /* @__PURE__ */ e(
289
+ t.eyebrow && /* @__PURE__ */ e(
290
290
  i,
291
291
  {
292
292
  className: r.eyebrow,
293
- blocks: o.eyebrow
293
+ blocks: t.eyebrow
294
294
  }
295
295
  ),
296
296
  u && /* @__PURE__ */ c("div", { className: r.articleDetails, children: [
297
- f && /* @__PURE__ */ e(
297
+ h && /* @__PURE__ */ e(
298
298
  $,
299
299
  {
300
300
  href: `/blog/search?categories=${encodeURIComponent(
301
- f._id
301
+ h._id
302
302
  )}`,
303
303
  className: r.articleType,
304
- children: f.title
304
+ children: h.title
305
305
  },
306
- f._id
306
+ h._id
307
307
  ),
308
308
  /* @__PURE__ */ c("div", { className: r.articleCategories, children: [
309
- b && /* @__PURE__ */ e(
309
+ f && /* @__PURE__ */ e(
310
310
  $,
311
311
  {
312
312
  href: `/blog/search?categories=${encodeURIComponent(
313
- b._id
313
+ f._id
314
314
  )}`,
315
315
  className: r.category,
316
- children: b.title
316
+ children: f.title
317
317
  },
318
- b._id
318
+ f._id
319
319
  ),
320
- m && m.title.toLowerCase() !== "library" && !m.slug.current.includes(
320
+ y && y.title.toLowerCase() !== "library" && !y.slug.current.includes(
321
321
  "keywords"
322
322
  ) && /* @__PURE__ */ e(
323
323
  $,
324
324
  {
325
325
  href: `/blog/search?categories=${encodeURIComponent(
326
- m._id
326
+ y._id
327
327
  )}`,
328
328
  className: r.category,
329
- children: m.title
329
+ children: y.title
330
330
  },
331
- m._id
331
+ y._id
332
332
  )
333
333
  ] }),
334
334
  u.timeToRead && /* @__PURE__ */ e(x, { children: /* @__PURE__ */ c("span", { children: [
@@ -336,11 +336,11 @@ function he({
336
336
  "min read"
337
337
  ] }) })
338
338
  ] }),
339
- /* @__PURE__ */ e(i, { blocks: o.title })
339
+ /* @__PURE__ */ e(i, { blocks: t.title })
340
340
  ] }),
341
- o.description && /* @__PURE__ */ e(i, { blocks: o.description }),
341
+ t.description && /* @__PURE__ */ e(i, { blocks: t.description }),
342
342
  n && /* @__PURE__ */ e(
343
- h,
343
+ v,
344
344
  {
345
345
  items: n.items,
346
346
  alignment: n.alignment
@@ -351,5 +351,5 @@ function he({
351
351
  }
352
352
  }
353
353
  export {
354
- he as HeroBlock
354
+ we as HeroBlock
355
355
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "quirk-ui",
3
3
  "private": false,
4
- "version": "0.0.506",
4
+ "version": "0.0.507",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {