quirk-ui 0.1.174 → 0.1.176
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/{HeroSubComponents-YccxoWkF.js → HeroSubComponents-DTPCJy_O.js} +27 -27
- package/dist/{HeroSubComponents-DkzKitT-.cjs → HeroSubComponents-DcZdRPTj.cjs} +2 -2
- package/dist/HeroSubComponents.css +1 -1
- package/dist/core/components/Button/Button.test.cjs +1 -1
- package/dist/core/components/Button/Button.test.mjs +165 -198
- package/dist/core/components/NavBar/NavBar.test.cjs +1 -1
- package/dist/core/components/NavBar/NavBar.test.mjs +40 -42
- package/dist/core.d.ts +0 -7
- package/dist/main.d.ts +0 -7
- package/dist/next/blocks/HeroBlock/HeroSubComponents.cjs +1 -1
- package/dist/next/blocks/HeroBlock/HeroSubComponents.mjs +1 -1
- package/dist/next/blocks/HeroBlock/HeroSubComponents.test.cjs +1 -1
- package/dist/next/blocks/HeroBlock/HeroSubComponents.test.mjs +1 -1
- package/dist/next/blocks/HeroBlock/index.cjs +1 -1
- package/dist/next/blocks/HeroBlock/index.mjs +1 -1
- package/dist/next/ui/CallToAction/index.cjs +1 -1
- package/dist/next/ui/CallToAction/index.mjs +35 -36
- package/package.json +1 -1
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { jsx as t, jsxs as h } from "react/jsx-runtime";
|
|
2
|
-
import { memo as
|
|
3
|
-
import { buildEmbedSrc as
|
|
4
|
-
import { c as
|
|
5
|
-
import { P as
|
|
2
|
+
import { memo as y, forwardRef as p, useRef as v, useImperativeHandle as b, useEffect as g } from "react";
|
|
3
|
+
import { buildEmbedSrc as x, resolveImageUrl as w, resolveAltText as N } from "./next/utils/mediaUtils.mjs";
|
|
4
|
+
import { c as C } from "./createLucideIcon-C8GTh_Qx.js";
|
|
5
|
+
import { P as k } from "./play-DYgKiSaf.js";
|
|
6
6
|
import './HeroSubComponents.css';/**
|
|
7
7
|
* @license lucide-react v0.488.0 - ISC
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
10
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
11
11
|
*/
|
|
12
|
-
const
|
|
12
|
+
const B = [
|
|
13
13
|
["rect", { x: "14", y: "4", width: "4", height: "16", rx: "1", key: "zuxfzm" }],
|
|
14
14
|
["rect", { x: "6", y: "4", width: "4", height: "16", rx: "1", key: "1okwgv" }]
|
|
15
|
-
],
|
|
16
|
-
hero:
|
|
17
|
-
container:
|
|
18
|
-
heading:
|
|
19
|
-
text:
|
|
20
|
-
eyebrow:
|
|
15
|
+
], V = C("pause", B), I = "_hero_c3yy9_1", E = "_container_c3yy9_7", z = "_heading_c3yy9_15", T = "_text_c3yy9_22", j = "_eyebrow_c3yy9_37", H = "_disclaimer_c3yy9_41", P = "_articleDetails_c3yy9_52", D = "_articleType_c3yy9_65", F = "_articleCategories_c3yy9_79", R = "_category_c3yy9_85", A = "_number_c3yy9_101", S = "_blog_c3yy9_128", L = "_overlay_c3yy9_154", U = "_tile_c3yy9_213", Y = "_fullBleed_c3yy9_322", q = "_media_c3yy9_349", G = "_splitAlt_c3yy9_437", J = "_split_c3yy9_437", K = "_videoControl_c3yy9_511", M = "_videoBackground_c3yy9_559", O = "_iframe_c3yy9_560", l = {
|
|
16
|
+
hero: I,
|
|
17
|
+
container: E,
|
|
18
|
+
heading: z,
|
|
19
|
+
text: T,
|
|
20
|
+
eyebrow: j,
|
|
21
21
|
disclaimer: H,
|
|
22
22
|
articleDetails: P,
|
|
23
23
|
articleType: D,
|
|
24
24
|
articleCategories: F,
|
|
25
25
|
category: R,
|
|
26
26
|
number: A,
|
|
27
|
-
default: "
|
|
27
|
+
default: "_default_c3yy9_124",
|
|
28
28
|
blog: S,
|
|
29
29
|
overlay: L,
|
|
30
30
|
tile: U,
|
|
@@ -35,7 +35,7 @@ const C = [
|
|
|
35
35
|
videoControl: K,
|
|
36
36
|
videoBackground: M,
|
|
37
37
|
iframe: O
|
|
38
|
-
}, Q =
|
|
38
|
+
}, Q = y(function({
|
|
39
39
|
isPlaying: e,
|
|
40
40
|
onToggle: i
|
|
41
41
|
}) {
|
|
@@ -47,16 +47,16 @@ const C = [
|
|
|
47
47
|
"aria-label": e ? "Pause video" : "Play video",
|
|
48
48
|
className: l.videoControl,
|
|
49
49
|
onClick: i,
|
|
50
|
-
children: e ? /* @__PURE__ */ t(
|
|
50
|
+
children: e ? /* @__PURE__ */ t(V, { size: 18, "aria-hidden": !0 }) : /* @__PURE__ */ t(k, { size: 18, "aria-hidden": !0 })
|
|
51
51
|
}
|
|
52
52
|
);
|
|
53
|
-
}),
|
|
53
|
+
}), m = y(function({
|
|
54
54
|
url: e,
|
|
55
55
|
provider: i,
|
|
56
56
|
wrapperClassName: a,
|
|
57
57
|
iframeClassName: c
|
|
58
58
|
}) {
|
|
59
|
-
const r =
|
|
59
|
+
const r = x(e, i);
|
|
60
60
|
return /* @__PURE__ */ t("div", { className: a, children: /* @__PURE__ */ t(
|
|
61
61
|
"iframe",
|
|
62
62
|
{
|
|
@@ -68,7 +68,7 @@ const C = [
|
|
|
68
68
|
"aria-label": "Background video"
|
|
69
69
|
}
|
|
70
70
|
) });
|
|
71
|
-
}), f =
|
|
71
|
+
}), f = y(
|
|
72
72
|
p(function({
|
|
73
73
|
src: e,
|
|
74
74
|
autoPlay: i,
|
|
@@ -77,9 +77,9 @@ const C = [
|
|
|
77
77
|
videoClassName: r,
|
|
78
78
|
isPlaying: s,
|
|
79
79
|
onToggle: d
|
|
80
|
-
},
|
|
80
|
+
}, _) {
|
|
81
81
|
const n = v(null);
|
|
82
|
-
return
|
|
82
|
+
return b(_, () => ({
|
|
83
83
|
play() {
|
|
84
84
|
var o;
|
|
85
85
|
(o = n.current) == null || o.play().catch(() => {
|
|
@@ -112,7 +112,7 @@ const C = [
|
|
|
112
112
|
)
|
|
113
113
|
] });
|
|
114
114
|
})
|
|
115
|
-
), te =
|
|
115
|
+
), te = y(function({
|
|
116
116
|
url: e,
|
|
117
117
|
autoPlay: i,
|
|
118
118
|
posterUrl: a,
|
|
@@ -120,9 +120,9 @@ const C = [
|
|
|
120
120
|
onToggle: r,
|
|
121
121
|
variant: s
|
|
122
122
|
}) {
|
|
123
|
-
const d = e.includes("vimeo.com"),
|
|
123
|
+
const d = e.includes("vimeo.com"), _ = e.includes("youtube.com") || e.includes("youtu.be"), n = d || _, o = d ? "vimeo" : "youtube";
|
|
124
124
|
return s === "inline" ? n ? /* @__PURE__ */ t(
|
|
125
|
-
|
|
125
|
+
m,
|
|
126
126
|
{
|
|
127
127
|
url: e,
|
|
128
128
|
provider: o,
|
|
@@ -139,7 +139,7 @@ const C = [
|
|
|
139
139
|
onToggle: r
|
|
140
140
|
}
|
|
141
141
|
) : n ? /* @__PURE__ */ t(
|
|
142
|
-
|
|
142
|
+
m,
|
|
143
143
|
{
|
|
144
144
|
url: e,
|
|
145
145
|
provider: o,
|
|
@@ -157,15 +157,15 @@ const C = [
|
|
|
157
157
|
onToggle: r
|
|
158
158
|
}
|
|
159
159
|
);
|
|
160
|
-
}), oe =
|
|
160
|
+
}), oe = y(function({
|
|
161
161
|
image: e,
|
|
162
162
|
mode: i,
|
|
163
163
|
variant: a,
|
|
164
164
|
imageAdapter: c
|
|
165
165
|
}) {
|
|
166
|
-
const r =
|
|
166
|
+
const r = w(e, i, "medium");
|
|
167
167
|
if (!r) return null;
|
|
168
|
-
const s =
|
|
168
|
+
const s = N(e, i), d = /* @__PURE__ */ t(
|
|
169
169
|
"img",
|
|
170
170
|
{
|
|
171
171
|
fetchPriority: "high",
|
|
@@ -198,6 +198,6 @@ export {
|
|
|
198
198
|
f as N,
|
|
199
199
|
te as V,
|
|
200
200
|
Q as a,
|
|
201
|
-
b,
|
|
201
|
+
m as b,
|
|
202
202
|
l as s
|
|
203
203
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";require('./HeroSubComponents.css');const t=require("react/jsx-runtime"),l=require("react"),
|
|
1
|
+
"use strict";require('./HeroSubComponents.css');const t=require("react/jsx-runtime"),l=require("react"),m=require("./next/utils/mediaUtils.cjs"),p=require("./createLucideIcon-DpotSgUx.cjs"),x=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
|
|
6
|
+
*/const b=[["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"}]],g=p.createLucideIcon("pause",b),j="_hero_c3yy9_1",w="_container_c3yy9_7",C="_heading_c3yy9_15",N="_text_c3yy9_22",k="_eyebrow_c3yy9_37",B="_disclaimer_c3yy9_41",V="_articleDetails_c3yy9_52",I="_articleType_c3yy9_65",E="_articleCategories_c3yy9_79",q="_category_c3yy9_85",z="_number_c3yy9_101",T="_blog_c3yy9_128",H="_overlay_c3yy9_154",R="_tile_c3yy9_213",D="_fullBleed_c3yy9_322",F="_media_c3yy9_349",P="_splitAlt_c3yy9_437",A="_split_c3yy9_437",L="_videoControl_c3yy9_511",S="_videoBackground_c3yy9_559",U="_iframe_c3yy9_560",n={hero:j,container:w,heading:C,text:N,eyebrow:k,disclaimer:B,articleDetails:V,articleType:I,articleCategories:E,category:q,number:z,default:"_default_c3yy9_124",blog:T,overlay:H,tile:R,fullBleed:D,media:F,splitAlt:P,split:A,videoControl:L,videoBackground:S,iframe:U},v=l.memo(function({isPlaying:e,onToggle:i}){return t.jsx("button",{type:"button",title:e?"Pause the video":"Play the video","aria-label":e?"Pause video":"Play video",className:n.videoControl,onClick:i,children:e?t.jsx(g,{size:18,"aria-hidden":!0}):t.jsx(x.Play,{size:18,"aria-hidden":!0})})}),h=l.memo(function({url:e,provider:i,wrapperClassName:s,iframeClassName:r}){const c=m.buildEmbedSrc(e,i);return t.jsx("div",{className:s,children:t.jsx("iframe",{src:c,className:r,allow:"autoplay; fullscreen",allowFullScreen:!0,title:"Embedded video","aria-label":"Background video"})})}),f=l.memo(l.forwardRef(function({src:e,autoPlay:i,posterUrl:s,wrapperClassName:r,videoClassName:c,isPlaying:a,onToggle:u},_){const d=l.useRef(null);return l.useImperativeHandle(_,()=>({play(){var o;(o=d.current)==null||o.play().catch(()=>{})},pause(){var o;(o=d.current)==null||o.pause()}})),l.useEffect(()=>{const o=d.current;o&&(a?o.play().catch(()=>{}):o.pause())},[a]),t.jsxs("div",{className:r,children:[t.jsx(v,{isPlaying:a,onToggle:u}),t.jsx("video",{ref:d,src:e,autoPlay:i,loop:!0,muted:!0,playsInline:!0,poster:s,preload:"metadata",className:c,"aria-label":"Background video"})]})})),$=l.memo(function({url:e,autoPlay:i,posterUrl:s,isPlaying:r,onToggle:c,variant:a}){const u=e.includes("vimeo.com"),_=e.includes("youtube.com")||e.includes("youtu.be"),d=u||_,o=u?"vimeo":"youtube";return a==="inline"?d?t.jsx(h,{url:e,provider:o,wrapperClassName:n.media}):t.jsx(f,{src:e,autoPlay:i,posterUrl:s,wrapperClassName:n.media,isPlaying:r,onToggle:c}):d?t.jsx(h,{url:e,provider:o,wrapperClassName:n.videoBackground,iframeClassName:n.iframe}):t.jsx(f,{src:e,autoPlay:i,posterUrl:s,videoClassName:n.videoBackground,isPlaying:r,onToggle:c})}),Y=l.memo(function({image:e,mode:i,variant:s,imageAdapter:r}){const c=m.resolveImageUrl(e,i,"medium");if(!c)return null;const a=m.resolveAltText(e,i),u=t.jsx("img",{fetchPriority:"high",src:c,alt:a,draggable:!1,style:s==="fill"?{objectFit:"cover",width:"100%",height:"100%"}:{width:"100%",height:"100%"}});return r?t.jsx("div",{className:n.media,children:s==="fill"?r.render({src:c,alt:a,fill:!0,priority:!0,fetchPriority:"high",style:{objectFit:"cover"},draggable:!1,sizes:"(max-width: 767px) 600px, 1200px"}):r.render({src:c,alt:a,width:650,height:750,priority:!0,fetchPriority:"high"})}):t.jsx("div",{className:n.media,children:u})});exports.HeroImage=Y;exports.NativeVideo=f;exports.VideoBlock=$;exports.VideoControl=v;exports.VideoEmbed=h;exports.styles=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
._hero_cjz9b_1{width:100%;padding-top:var(--spacing-xl);padding-bottom:var(--spacing-xl)}._container_cjz9b_7{width:100%;max-width:var(--layout-width, 1300px);margin:0 auto;padding-left:var(--spacing-md);padding-right:var(--spacing-md)}._heading_cjz9b_15{display:flex;flex-direction:column;width:100%;flex:1;gap:var(--spacing-md)}._heading_cjz9b_15:not(:has(._text_cjz9b_22 .portableTextContainer)){gap:var(--spacing-lg)}._heading_cjz9b_15 h1,._heading_cjz9b_15 h2,._heading_cjz9b_15 h3,._heading_cjz9b_15 h4,._heading_cjz9b_15 h5,._heading_cjz9b_15 h6{width:100%;margin-block:0}._eyebrow_cjz9b_37{font-weight:var(--font-weight-bold)}._disclaimer_cjz9b_41{font-size:var(--font-size-sm)}._text_cjz9b_22{flex:1;display:flex;flex-direction:column;gap:var(--spacing-md)}._articleDetails_cjz9b_52{color:var(--color-secondary-75);display:flex;align-items:center;margin-bottom:var(--spacing-md);gap:var(--spacing-md)}@media (max-width: 767px){._articleDetails_cjz9b_52{flex-wrap:wrap;gap:var(--spacing-md)}}._articleType_cjz9b_65{display:flex;align-items:center;justify-content:center;background-color:var(--color-secondary-75);padding:0 var(--spacing-md);color:#fff;width:auto;height:36px;border-radius:var(--radius-full);text-transform:capitalize;text-decoration:none}._articleCategories_cjz9b_79{display:flex;flex-wrap:wrap;gap:var(--spacing-sm)}._category_cjz9b_85{border:1px solid var(--color-secondary-75);display:flex;align-items:center;justify-content:center;background-color:transparent;padding:0 var(--spacing-md);color:var(--color-secondary-75);width:auto;height:36px;border-radius:var(--radius-full);text-transform:capitalize;text-decoration:none}._number_cjz9b_101{display:inline-flex;align-items:center;justify-content:center;background-color:var(--color-secondary-75);color:#fff;width:25px;height:25px;border-radius:var(--radius-full);text-transform:capitalize;margin-right:var(--spacing-xs)}._pipe_cjz9b_114{margin:0 var(--spacing-sm)}@media (max-width: 767px){._pipe_cjz9b_114._hide_cjz9b_117{display:none}}._default_cjz9b_124{position:relative}._blog_cjz9b_128{position:relative;padding:0 var(--spacing-md)}._blog_cjz9b_128 ._container_cjz9b_7{max-width:var(--layout-width, 1300px);position:relative;display:flex;align-items:flex-end;width:100%;min-height:450px;height:100%;overflow:hidden;flex-grow:1;padding:0;border-radius:var(--radius-md)}._blog_cjz9b_128 ._container_cjz9b_7 img{z-index:1;transition:width .3s ease-in-out,height .3s ease-in-out}@media (max-width: 767px){._blog_cjz9b_128 ._overlay_cjz9b_154{width:100%;padding:4rem var(--spacing-md) var(--spacing-xl)}}._blog_cjz9b_128 ._text_cjz9b_22{z-index:3;position:relative;max-width:650px;background-color:var(--color-background);padding:var(--spacing-xl);border-radius:var(--radius-md)}@media (min-width: 768px){._blog_cjz9b_128 ._text_cjz9b_22{border-radius:var(--radius-md) var(--radius-md) 0 0}._blog_cjz9b_128 ._text_cjz9b_22:before{content:"";position:absolute;top:-25px;left:0;height:25px;width:20px;border-bottom-left-radius:var(--radius-md);box-shadow:-20px 20px 0 20px var(--color-background)}._blog_cjz9b_128 ._text_cjz9b_22:after{content:"";position:absolute;bottom:0;right:-20px;height:25px;width:20px;border-bottom-left-radius:var(--radius-md);box-shadow:0 10px 0 0 var(--color-background)}}._tile_cjz9b_213{position:relative;padding:0 var(--spacing-md)}._tile_cjz9b_213 ._container_cjz9b_7{max-width:var(--layout-width, 1300px);position:relative;display:flex;align-items:flex-end;width:100%;min-height:550px;height:100%;overflow:hidden;flex-grow:1;padding:0;border-radius:var(--radius-md)}._tile_cjz9b_213 ._container_cjz9b_7 img{z-index:1;transition:width .3s ease-in-out,height .3s ease-in-out}@media (max-width: 767px){._tile_cjz9b_213 ._overlay_cjz9b_154{width:100%;padding:var(--spacing-md)}}@media (max-width: 767px){._tile_cjz9b_213:has(video) ._overlay_cjz9b_154{padding-bottom:3rem}}._tile_cjz9b_213 ._text_cjz9b_22{z-index:3;position:relative;max-width:650px;background-color:var(--color-background);padding:var(--spacing-xl);border-radius:var(--radius-md)}@media (min-width: 768px){._tile_cjz9b_213 ._text_cjz9b_22{border-radius:var(--radius-md) var(--radius-md) 0 0}._tile_cjz9b_213 ._text_cjz9b_22:before{content:"";position:absolute;top:-25px;left:0;height:25px;width:20px;border-bottom-left-radius:var(--radius-md);box-shadow:-20px 20px 0 20px var(--color-background)}._tile_cjz9b_213 ._text_cjz9b_22:after{content:"";position:absolute;bottom:0;right:-20px;height:25px;width:20px;border-bottom-left-radius:var(--radius-md);box-shadow:0 10px 0 0 var(--color-background)}}._fullBleed_cjz9b_322{position:relative;padding-top:0;padding-bottom:0}._fullBleed_cjz9b_322 ._container_cjz9b_7{max-width:var(--layout-width, 1300px);position:relative;display:flex;align-items:flex-end;width:100%;min-height:550px;height:100%;overflow:hidden;flex-grow:1;border-radius:0}._fullBleed_cjz9b_322 ._container_cjz9b_7 img{z-index:1;transition:width .3s ease-in-out,height .3s ease-in-out}._fullBleed_cjz9b_322 ._media_cjz9b_349{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;z-index:1;border-radius:0}._fullBleed_cjz9b_322 ._media_cjz9b_349 img,._fullBleed_cjz9b_322 ._media_cjz9b_349 video,._fullBleed_cjz9b_322 ._media_cjz9b_349 iframe{width:100%;height:100%;object-fit:cover;display:block}._fullBleed_cjz9b_322 ._overlay_cjz9b_154{position:relative;z-index:1;min-height:80vh;display:flex;align-items:flex-end;background:linear-gradient(to top,#000000a6,#0000004d,#0000)}@media (max-width: 767px){._fullBleed_cjz9b_322 ._overlay_cjz9b_154{min-height:60vh}}._fullBleed_cjz9b_322 ._text_cjz9b_22{max-width:700px;color:#fff;background-color:transparent;padding:0;border-radius:0;z-index:3;position:relative;max-width:650px;background-color:var(--color-background);padding:var(--spacing-xl);margin-top:var(--spacing-md);margin-bottom:var(--spacing-md);border-radius:var(--radius-md)}._fullBleed_cjz9b_322 ._text_cjz9b_22:before,._fullBleed_cjz9b_322 ._text_cjz9b_22:after{display:none}@media (max-width: 767px){._fullBleed_cjz9b_322:has(video) ._text_cjz9b_22{margin-bottom:3rem}}._default_cjz9b_124 ._media_cjz9b_349{position:relative;width:100%;height:480px;margin-bottom:var(--spacing-md);border-radius:var(--radius-md);overflow:hidden}@media (max-width: 767px){._default_cjz9b_124 ._media_cjz9b_349{height:280px}}._default_cjz9b_124 ._media_cjz9b_349 img{width:100%;height:100%;object-fit:cover;object-position:center;display:block}._splitAlt_cjz9b_437 ._media_cjz9b_349,._split_cjz9b_437 ._media_cjz9b_349{height:100%;padding-bottom:0;margin-bottom:0}._splitAlt_cjz9b_437 ._media_cjz9b_349 video,._splitAlt_cjz9b_437 ._media_cjz9b_349 iframe,._split_cjz9b_437 ._media_cjz9b_349 video,._split_cjz9b_437 ._media_cjz9b_349 iframe{position:relative;border-radius:var(--radius-md)}._splitAlt_cjz9b_437 ._media_cjz9b_349 img,._split_cjz9b_437 ._media_cjz9b_349 img{border-radius:var(--radius-md);width:100%;height:auto;max-height:500px;object-fit:contain}._splitAlt_cjz9b_437 ._container_cjz9b_7{display:flex;align-items:center;gap:3rem}@media (max-width: 767px){._splitAlt_cjz9b_437 ._container_cjz9b_7{flex-direction:column-reverse;gap:var(--spacing-xl)}._splitAlt_cjz9b_437 ._container_cjz9b_7 ._media_cjz9b_349{width:100%;max-width:500px}}._splitAlt_cjz9b_437 ._container_cjz9b_7 ._media_cjz9b_349{flex:.65}._splitAlt_cjz9b_437 ._container_cjz9b_7 ._heading_cjz9b_15{flex:.35}._split_cjz9b_437 ._container_cjz9b_7{display:flex;align-items:center;gap:3rem}._split_cjz9b_437 ._container_cjz9b_7 ._media_cjz9b_349{flex:1}._split_cjz9b_437 ._container_cjz9b_7 ._media_cjz9b_349 img{width:100%;height:auto;max-height:500px;object-fit:contain}@media (max-width: 767px){._split_cjz9b_437 ._container_cjz9b_7{flex-direction:column-reverse;gap:var(--spacing-xl)}._split_cjz9b_437 ._container_cjz9b_7 ._media_cjz9b_349{width:100%;max-width:500px}}._videoControl_cjz9b_511{position:absolute;bottom:var(--spacing-sm);right:var(--spacing-sm);z-index:5;background:#00000080;border:none;border-radius:50%;padding:var(--spacing-sm);cursor:pointer;color:#fff;display:flex;align-items:center;justify-content:center;transition:color .3s ease-in-out}._videoControl_cjz9b_511 svg{width:16px;height:16px}._videoControl_cjz9b_511:hover{color:var(--color-primary-25)}._media_cjz9b_349{position:relative;width:100%;height:0;overflow:hidden;border-radius:var(--radius-md);flex:1;margin-bottom:var(--spacing-md);line-height:0}._media_cjz9b_349 iframe,._media_cjz9b_349 video{position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover}._videoBackground_cjz9b_559,._iframe_cjz9b_560{position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover;z-index:0;pointer-events:none}._iframe_cjz9b_560{border:none}.splitAlt ._text_cjz9b_22{flex:.65}.vAlignmentTop._split_cjz9b_437 ._heading_cjz9b_15,.vAlignmentTop._splitAlt_cjz9b_437 ._heading_cjz9b_15,.vAlignmentTop._blog_cjz9b_128 ._overlay_cjz9b_154,.vAlignmentTop._tile_cjz9b_213 ._overlay_cjz9b_154{align-self:flex-start}@media (min-width: 768px){.vAlignmentTop._blog_cjz9b_128.hAlignmentLeft ._text_cjz9b_22,.vAlignmentTop._tile_cjz9b_213.hAlignmentLeft ._text_cjz9b_22{border-radius:0 0 var(--radius-md) 0}.vAlignmentTop._blog_cjz9b_128.hAlignmentLeft ._text_cjz9b_22:before,.vAlignmentTop._tile_cjz9b_213.hAlignmentLeft ._text_cjz9b_22:before{content:"";position:absolute;top:unset;right:unset;bottom:-25px;left:0;height:25px;width:20px;border-top-left-radius:var(--radius-md);border-bottom-left-radius:unset;box-shadow:-20px -25px 0 20px var(--color-background)}.vAlignmentTop._blog_cjz9b_128.hAlignmentLeft ._text_cjz9b_22:after,.vAlignmentTop._tile_cjz9b_213.hAlignmentLeft ._text_cjz9b_22:after{content:"";position:absolute;top:0;right:-20px;bottom:unset;left:unset;height:25px;width:20px;border-top-left-radius:var(--radius-md);border-bottom-left-radius:unset;box-shadow:-25px -20px 0 20px var(--color-background)}}@media (min-width: 768px){.vAlignmentTop._blog_cjz9b_128.hAlignmentCenter ._text_cjz9b_22,.vAlignmentTop._tile_cjz9b_213.hAlignmentCenter ._text_cjz9b_22{border-radius:0 0 var(--radius-md) var(--radius-md)}.vAlignmentTop._blog_cjz9b_128.hAlignmentCenter ._text_cjz9b_22:before,.vAlignmentTop._tile_cjz9b_213.hAlignmentCenter ._text_cjz9b_22:before{content:"";position:absolute;top:0;left:-20px;bottom:unset;right:unset;height:25px;width:20px;border-top-right-radius:var(--radius-md);border-bottom-right-radius:unset;box-shadow:20px -20px 0 20px var(--color-background)}.vAlignmentTop._blog_cjz9b_128.hAlignmentCenter ._text_cjz9b_22:after,.vAlignmentTop._tile_cjz9b_213.hAlignmentCenter ._text_cjz9b_22:after{content:"";position:absolute;top:0;right:-20px;bottom:unset;left:unset;height:25px;width:20px;border-top-left-radius:var(--radius-md);border-top-right-radius:unset;border-bottom-left-radius:unset;box-shadow:-25px -20px 0 20px var(--color-background)}}@media (min-width: 768px){.vAlignmentTop._blog_cjz9b_128.hAlignmentRight ._text_cjz9b_22,.vAlignmentTop._tile_cjz9b_213.hAlignmentRight ._text_cjz9b_22{border-radius:0 0 0 var(--radius-md)}.vAlignmentTop._blog_cjz9b_128.hAlignmentRight ._text_cjz9b_22:before,.vAlignmentTop._tile_cjz9b_213.hAlignmentRight ._text_cjz9b_22:before{content:"";position:absolute;top:0;left:-20px;bottom:unset;right:unset;height:25px;width:20px;border-top-right-radius:var(--radius-md);box-shadow:20px -20px 0 20px var(--color-background)}.vAlignmentTop._blog_cjz9b_128.hAlignmentRight ._text_cjz9b_22:after,.vAlignmentTop._tile_cjz9b_213.hAlignmentRight ._text_cjz9b_22:after{content:"";position:absolute;bottom:-25px;right:0;top:unset;left:unset;height:25px;width:20px;border-top-right-radius:var(--radius-md);box-shadow:20px -20px 0 20px var(--color-background)}}.vAlignmentTop._default_cjz9b_124 ._text_cjz9b_22,.vAlignmentTop._fullBleed_cjz9b_322 ._text_cjz9b_22{align-self:flex-start}.vAlignmentMiddle._split_cjz9b_437 ._heading_cjz9b_15,.vAlignmentMiddle._splitAlt_cjz9b_437 ._heading_cjz9b_15,.vAlignmentMiddle._blog_cjz9b_128 ._overlay_cjz9b_154,.vAlignmentMiddle._tile_cjz9b_213 ._overlay_cjz9b_154{align-self:center}@media (min-width: 768px){.vAlignmentMiddle._blog_cjz9b_128.hAlignmentLeft ._text_cjz9b_22,.vAlignmentMiddle._tile_cjz9b_213.hAlignmentLeft ._text_cjz9b_22{border-radius:0 var(--radius-md) var(--radius-md) 0}.vAlignmentMiddle._blog_cjz9b_128.hAlignmentLeft ._text_cjz9b_22:before,.vAlignmentMiddle._tile_cjz9b_213.hAlignmentLeft ._text_cjz9b_22:before{content:"";position:absolute;top:-25px;right:0;left:unset;height:25px;width:20px;border-bottom-right-radius:var(--radius-md);box-shadow:25px 20px 0 20px var(--color-background)}.vAlignmentMiddle._blog_cjz9b_128.hAlignmentLeft ._text_cjz9b_22:after,.vAlignmentMiddle._tile_cjz9b_213.hAlignmentLeft ._text_cjz9b_22:after{content:"";position:absolute;bottom:-25px;right:0;height:25px;width:20px;border-top-right-radius:var(--radius-md);box-shadow:20px -20px 0 20px var(--color-background)}}@media (min-width: 768px){.vAlignmentMiddle._blog_cjz9b_128.hAlignmentCenter ._text_cjz9b_22,.vAlignmentMiddle._tile_cjz9b_213.hAlignmentCenter ._text_cjz9b_22{border-radius:var(--radius-md)}.vAlignmentMiddle._blog_cjz9b_128.hAlignmentCenter ._text_cjz9b_22:before,.vAlignmentMiddle._tile_cjz9b_213.hAlignmentCenter ._text_cjz9b_22:before{content:none}.vAlignmentMiddle._blog_cjz9b_128.hAlignmentCenter ._text_cjz9b_22:after,.vAlignmentMiddle._tile_cjz9b_213.hAlignmentCenter ._text_cjz9b_22:after{content:none}}@media (min-width: 768px){.vAlignmentMiddle._blog_cjz9b_128.hAlignmentRight ._text_cjz9b_22,.vAlignmentMiddle._tile_cjz9b_213.hAlignmentRight ._text_cjz9b_22{border-radius:var(--radius-md) 0 0 var(--radius-md)}.vAlignmentMiddle._blog_cjz9b_128.hAlignmentRight ._text_cjz9b_22:before,.vAlignmentMiddle._tile_cjz9b_213.hAlignmentRight ._text_cjz9b_22:before{content:"";position:absolute;top:-25px;right:0;left:unset;height:25px;width:20px;border-bottom-right-radius:var(--radius-md);box-shadow:25px 20px 0 20px var(--color-background)}.vAlignmentMiddle._blog_cjz9b_128.hAlignmentRight ._text_cjz9b_22:after,.vAlignmentMiddle._tile_cjz9b_213.hAlignmentRight ._text_cjz9b_22:after{content:"";position:absolute;bottom:-25px;right:0;height:25px;width:20px;border-top-right-radius:var(--radius-md);box-shadow:20px -20px 0 20px var(--color-background)}}.vAlignmentMiddle._default_cjz9b_124 ._text_cjz9b_22,.vAlignmentMiddle._fullBleed_cjz9b_322 ._text_cjz9b_22{align-self:center}.vAlignmentBottom._split_cjz9b_437 ._heading_cjz9b_15,.vAlignmentBottom._splitAlt_cjz9b_437 ._heading_cjz9b_15,.vAlignmentBottom._blog_cjz9b_128 ._overlay_cjz9b_154,.vAlignmentBottom._tile_cjz9b_213 ._overlay_cjz9b_154{align-self:flex-end}@media (min-width: 768px){.vAlignmentBottom._blog_cjz9b_128.hAlignmentLeft ._text_cjz9b_22,.vAlignmentBottom._tile_cjz9b_213.hAlignmentLeft ._text_cjz9b_22{border-radius:0 var(--radius-md) 0 0}.vAlignmentBottom._blog_cjz9b_128.hAlignmentLeft ._text_cjz9b_22:before,.vAlignmentBottom._tile_cjz9b_213.hAlignmentLeft ._text_cjz9b_22:before{content:"";position:absolute;top:-25px;right:unset;bottom:unset;left:0;height:25px;width:20px;border-top-left-radius:unset;border-bottom-left-radius:var(--radius-md);box-shadow:-20px 20px 0 20px var(--color-background)}.vAlignmentBottom._blog_cjz9b_128.hAlignmentLeft ._text_cjz9b_22:after,.vAlignmentBottom._tile_cjz9b_213.hAlignmentLeft ._text_cjz9b_22:after{content:"";position:absolute;top:unset;right:-20px;bottom:0;left:unset;height:25px;width:20px;border-top-left-radius:unset;border-bottom-left-radius:var(--radius-md);box-shadow:-20px 20px 0 20px var(--color-background)}}@media (min-width: 768px){.vAlignmentBottom._blog_cjz9b_128.hAlignmentCenter ._text_cjz9b_22,.vAlignmentBottom._tile_cjz9b_213.hAlignmentCenter ._text_cjz9b_22{border-radius:var(--radius-md) var(--radius-md) 0 0}.vAlignmentBottom._blog_cjz9b_128.hAlignmentCenter ._text_cjz9b_22:before,.vAlignmentBottom._tile_cjz9b_213.hAlignmentCenter ._text_cjz9b_22:before{content:"";position:absolute;top:unset;left:-20px;bottom:0;right:unset;height:25px;width:20px;border-top-right-radius:unset;border-bottom-right-radius:var(--radius-md);box-shadow:20px 20px 0 20px var(--color-background);border-bottom-left-radius:unset}.vAlignmentBottom._blog_cjz9b_128.hAlignmentCenter ._text_cjz9b_22:after,.vAlignmentBottom._tile_cjz9b_213.hAlignmentCenter ._text_cjz9b_22:after{content:"";position:absolute;top:unset;right:-20px;bottom:0;left:unset;height:25px;width:20px;border-top-left-radius:unset;border-top-right-radius:unset;border-bottom-left-radius:var(--radius-md);box-shadow:-20px 20px 0 20px var(--color-background)}}@media (min-width: 768px){.vAlignmentBottom._blog_cjz9b_128.hAlignmentRight ._text_cjz9b_22,.vAlignmentBottom._tile_cjz9b_213.hAlignmentRight ._text_cjz9b_22{border-radius:var(--radius-md) 0 0 0}.vAlignmentBottom._blog_cjz9b_128.hAlignmentRight ._text_cjz9b_22:before,.vAlignmentBottom._tile_cjz9b_213.hAlignmentRight ._text_cjz9b_22:before{content:"";position:absolute;top:-25px;right:0;left:unset;height:25px;width:20px;border-bottom-right-radius:var(--radius-md);box-shadow:25px 20px 0 20px var(--color-background)}.vAlignmentBottom._blog_cjz9b_128.hAlignmentRight ._text_cjz9b_22:after,.vAlignmentBottom._tile_cjz9b_213.hAlignmentRight ._text_cjz9b_22:after{content:"";position:absolute;top:unset;left:-20px;bottom:0;right:unset;height:25px;width:20px;border-top-right-radius:unset;border-bottom-right-radius:var(--radius-md);box-shadow:20px 20px 0 20px var(--color-background);border-bottom-left-radius:unset}}.vAlignmentBottom._default_cjz9b_124 ._text_cjz9b_22,.vAlignmentBottom._fullBleed_cjz9b_322 ._text_cjz9b_22{align-self:flex-end}.hAlignmentLeft ._container_cjz9b_7{justify-content:flex-start}.hAlignmentCenter ._container_cjz9b_7{justify-content:center}@media (min-width: 768px){.hAlignmentCenter._blog_cjz9b_128 ._text_cjz9b_22,.hAlignmentCenter._tile_cjz9b_213 ._text_cjz9b_22{border-radius:var(--radius-md) var(--radius-md) 0 0}.hAlignmentCenter._blog_cjz9b_128 ._text_cjz9b_22:before,.hAlignmentCenter._tile_cjz9b_213 ._text_cjz9b_22:before{content:"";position:absolute;top:-25px;right:0;height:25px;width:20px;border-bottom-right-radius:var(--radius-md);box-shadow:20px 20px 0 20px var(--color-background)}.hAlignmentCenter._blog_cjz9b_128 ._text_cjz9b_22:after,.hAlignmentCenter._tile_cjz9b_213 ._text_cjz9b_22:after{content:"";position:absolute;bottom:-25px;right:0;height:25px;width:20px;border-top-right-radius:var(--radius-md);box-shadow:20px -20px 0 20px var(--color-background)}}.hAlignmentRight ._container_cjz9b_7{justify-content:flex-end}
|
|
1
|
+
._hero_c3yy9_1{width:100%;padding-top:var(--spacing-xl);padding-bottom:var(--spacing-xl)}._container_c3yy9_7{width:100%;max-width:var(--layout-width, 1300px);margin:0 auto;padding-left:var(--spacing-md);padding-right:var(--spacing-md)}._heading_c3yy9_15{display:flex;flex-direction:column;width:100%;flex:1;gap:var(--spacing-md)}._heading_c3yy9_15:not(:has(._text_c3yy9_22 .portableTextContainer)){gap:var(--spacing-lg)}._heading_c3yy9_15 h1,._heading_c3yy9_15 h2,._heading_c3yy9_15 h3,._heading_c3yy9_15 h4,._heading_c3yy9_15 h5,._heading_c3yy9_15 h6{width:100%;margin-block:0}._eyebrow_c3yy9_37{font-weight:var(--font-weight-bold)}._disclaimer_c3yy9_41{font-size:var(--font-size-sm)}._text_c3yy9_22{flex:1;display:flex;flex-direction:column;gap:var(--spacing-md)}._articleDetails_c3yy9_52{color:var(--color-secondary-75);display:flex;align-items:center;margin-bottom:var(--spacing-md);gap:var(--spacing-md)}@media (max-width: 767px){._articleDetails_c3yy9_52{flex-wrap:wrap;gap:var(--spacing-md)}}._articleType_c3yy9_65{display:flex;align-items:center;justify-content:center;background-color:var(--color-secondary-75);padding:0 var(--spacing-md);color:#fff;width:auto;height:36px;border-radius:var(--radius-full);text-transform:capitalize;text-decoration:none}._articleCategories_c3yy9_79{display:flex;flex-wrap:wrap;gap:var(--spacing-sm)}._category_c3yy9_85{border:1px solid var(--color-secondary-75);display:flex;align-items:center;justify-content:center;background-color:transparent;padding:0 var(--spacing-md);color:var(--color-secondary-75);width:auto;height:36px;border-radius:var(--radius-full);text-transform:capitalize;text-decoration:none}._number_c3yy9_101{display:inline-flex;align-items:center;justify-content:center;background-color:var(--color-secondary-75);color:#fff;width:25px;height:25px;border-radius:var(--radius-full);text-transform:capitalize;margin-right:var(--spacing-xs)}._pipe_c3yy9_114{margin:0 var(--spacing-sm)}@media (max-width: 767px){._pipe_c3yy9_114._hide_c3yy9_117{display:none}}._default_c3yy9_124{position:relative}._blog_c3yy9_128{position:relative;padding:0 var(--spacing-md)}._blog_c3yy9_128 ._container_c3yy9_7{max-width:var(--layout-width, 1300px);position:relative;display:flex;align-items:flex-end;width:100%;min-height:450px;height:100%;overflow:hidden;flex-grow:1;padding:0;border-radius:var(--radius-md)}._blog_c3yy9_128 ._container_c3yy9_7 img{z-index:1;transition:width .3s ease-in-out,height .3s ease-in-out}@media (max-width: 767px){._blog_c3yy9_128 ._overlay_c3yy9_154{width:100%;padding:4rem var(--spacing-md) var(--spacing-xl)}}._blog_c3yy9_128 ._text_c3yy9_22{z-index:3;position:relative;max-width:650px;background-color:var(--color-background);padding:var(--spacing-xl);border-radius:var(--radius-md)}@media (min-width: 768px){._blog_c3yy9_128 ._text_c3yy9_22{border-radius:var(--radius-md) var(--radius-md) 0 0}._blog_c3yy9_128 ._text_c3yy9_22:before{content:"";position:absolute;top:-25px;left:0;height:25px;width:20px;border-bottom-left-radius:var(--radius-md);box-shadow:-20px 20px 0 20px var(--color-background)}._blog_c3yy9_128 ._text_c3yy9_22:after{content:"";position:absolute;bottom:0;right:-20px;height:25px;width:20px;border-bottom-left-radius:var(--radius-md);box-shadow:0 10px 0 0 var(--color-background)}}._tile_c3yy9_213{position:relative;padding:0 var(--spacing-md)}._tile_c3yy9_213 ._container_c3yy9_7{max-width:var(--layout-width, 1300px);position:relative;display:flex;align-items:flex-end;width:100%;min-height:550px;height:100%;overflow:hidden;flex-grow:1;padding:0;border-radius:var(--radius-md)}._tile_c3yy9_213 ._container_c3yy9_7 img{z-index:1;transition:width .3s ease-in-out,height .3s ease-in-out}@media (max-width: 767px){._tile_c3yy9_213 ._overlay_c3yy9_154{width:100%;padding:var(--spacing-md)}}@media (max-width: 767px){._tile_c3yy9_213:has(video) ._overlay_c3yy9_154{padding-bottom:3rem}}._tile_c3yy9_213 ._text_c3yy9_22{z-index:3;position:relative;max-width:650px;background-color:var(--color-background);padding:var(--spacing-xl);border-radius:var(--radius-md)}@media (min-width: 768px){._tile_c3yy9_213 ._text_c3yy9_22{border-radius:var(--radius-md) var(--radius-md) 0 0}._tile_c3yy9_213 ._text_c3yy9_22:before{content:"";position:absolute;top:-25px;left:0;height:25px;width:20px;border-bottom-left-radius:var(--radius-md);box-shadow:-20px 20px 0 20px var(--color-background)}._tile_c3yy9_213 ._text_c3yy9_22:after{content:"";position:absolute;bottom:0;right:-20px;height:25px;width:20px;border-bottom-left-radius:var(--radius-md);box-shadow:0 10px 0 0 var(--color-background)}}._fullBleed_c3yy9_322{position:relative;padding-top:0;padding-bottom:0}._fullBleed_c3yy9_322 ._container_c3yy9_7{max-width:var(--layout-width, 1300px);position:relative;display:flex;align-items:flex-end;width:100%;min-height:550px;height:100%;overflow:hidden;flex-grow:1;border-radius:0}._fullBleed_c3yy9_322 ._container_c3yy9_7 img{z-index:1;transition:width .3s ease-in-out,height .3s ease-in-out}._fullBleed_c3yy9_322 ._media_c3yy9_349{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;z-index:1;border-radius:0}._fullBleed_c3yy9_322 ._media_c3yy9_349 img,._fullBleed_c3yy9_322 ._media_c3yy9_349 video,._fullBleed_c3yy9_322 ._media_c3yy9_349 iframe{width:100%;height:100%;object-fit:cover;display:block}._fullBleed_c3yy9_322 ._overlay_c3yy9_154{position:relative;z-index:1;min-height:80vh;display:flex;align-items:flex-end;background:linear-gradient(to top,#000000a6,#0000004d,#0000)}@media (max-width: 767px){._fullBleed_c3yy9_322 ._overlay_c3yy9_154{min-height:60vh}}._fullBleed_c3yy9_322 ._text_c3yy9_22{max-width:700px;color:#fff;background-color:transparent;padding:0;border-radius:0;z-index:3;position:relative;max-width:650px;background-color:var(--color-background);padding:var(--spacing-xl);margin-top:var(--spacing-md);margin-bottom:var(--spacing-md);border-radius:var(--radius-md)}._fullBleed_c3yy9_322 ._text_c3yy9_22:before,._fullBleed_c3yy9_322 ._text_c3yy9_22:after{display:none}@media (max-width: 767px){._fullBleed_c3yy9_322:has(video) ._text_c3yy9_22{margin-bottom:3rem}}._default_c3yy9_124 ._media_c3yy9_349{position:relative;width:100%;height:480px;margin-bottom:var(--spacing-md);border-radius:var(--radius-md);overflow:hidden}@media (max-width: 767px){._default_c3yy9_124 ._media_c3yy9_349{height:280px}}._default_c3yy9_124 ._media_c3yy9_349 img{width:100%;height:100%;object-fit:cover;object-position:center;display:block}._splitAlt_c3yy9_437 ._media_c3yy9_349,._split_c3yy9_437 ._media_c3yy9_349{height:100%;padding-bottom:0;margin-bottom:0}._splitAlt_c3yy9_437 ._media_c3yy9_349 video,._splitAlt_c3yy9_437 ._media_c3yy9_349 iframe,._split_c3yy9_437 ._media_c3yy9_349 video,._split_c3yy9_437 ._media_c3yy9_349 iframe{position:relative;border-radius:var(--radius-md)}._splitAlt_c3yy9_437 ._media_c3yy9_349 img,._split_c3yy9_437 ._media_c3yy9_349 img{border-radius:var(--radius-md);width:100%;height:auto;max-height:500px;object-fit:contain}._splitAlt_c3yy9_437 ._container_c3yy9_7{display:flex;align-items:center;gap:3rem}@media (max-width: 767px){._splitAlt_c3yy9_437 ._container_c3yy9_7{flex-direction:column-reverse;gap:var(--spacing-xl)}._splitAlt_c3yy9_437 ._container_c3yy9_7 ._media_c3yy9_349{width:100%;max-width:500px}}._splitAlt_c3yy9_437 ._container_c3yy9_7 ._media_c3yy9_349{flex:.65}._splitAlt_c3yy9_437 ._container_c3yy9_7 ._heading_c3yy9_15{flex:.35}._split_c3yy9_437 ._container_c3yy9_7{display:flex;align-items:center;gap:3rem}._split_c3yy9_437 ._container_c3yy9_7 ._media_c3yy9_349{flex:1}._split_c3yy9_437 ._container_c3yy9_7 ._media_c3yy9_349 img{width:100%;height:auto;max-height:500px;object-fit:contain}@media (max-width: 767px){._split_c3yy9_437 ._container_c3yy9_7{flex-direction:column-reverse;gap:var(--spacing-xl)}._split_c3yy9_437 ._container_c3yy9_7 ._media_c3yy9_349{width:100%;max-width:500px}}._videoControl_c3yy9_511{position:absolute;bottom:var(--spacing-sm);right:var(--spacing-sm);z-index:5;background:#00000080;border:none;border-radius:50%;padding:var(--spacing-sm);cursor:pointer;color:#fff;display:flex;align-items:center;justify-content:center;transition:color .3s ease-in-out}._videoControl_c3yy9_511 svg{width:16px;height:16px}._videoControl_c3yy9_511:hover{color:var(--color-primary-25)}._media_c3yy9_349{position:relative;width:100%;height:0;overflow:hidden;border-radius:var(--radius-md);flex:1;margin-bottom:var(--spacing-md);line-height:0}._media_c3yy9_349 iframe,._media_c3yy9_349 video{position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover}._videoBackground_c3yy9_559,._iframe_c3yy9_560{position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover;z-index:0;pointer-events:none}._iframe_c3yy9_560{border:none}.splitAlt ._text_c3yy9_22{flex:.65}.vAlignmentTop._split_c3yy9_437 ._heading_c3yy9_15,.vAlignmentTop._splitAlt_c3yy9_437 ._heading_c3yy9_15,.vAlignmentTop._blog_c3yy9_128 ._overlay_c3yy9_154,.vAlignmentTop._tile_c3yy9_213 ._overlay_c3yy9_154{align-self:flex-start}@media (min-width: 768px){.vAlignmentTop._blog_c3yy9_128.hAlignmentLeft ._text_c3yy9_22,.vAlignmentTop._tile_c3yy9_213.hAlignmentLeft ._text_c3yy9_22{border-radius:0 0 var(--radius-md) 0}.vAlignmentTop._blog_c3yy9_128.hAlignmentLeft ._text_c3yy9_22:before,.vAlignmentTop._tile_c3yy9_213.hAlignmentLeft ._text_c3yy9_22:before{content:"";position:absolute;top:unset;right:unset;bottom:-25px;left:0;height:25px;width:20px;border-top-left-radius:var(--radius-md);border-bottom-left-radius:unset;box-shadow:-20px -25px 0 20px var(--color-background)}.vAlignmentTop._blog_c3yy9_128.hAlignmentLeft ._text_c3yy9_22:after,.vAlignmentTop._tile_c3yy9_213.hAlignmentLeft ._text_c3yy9_22:after{content:"";position:absolute;top:0;right:-20px;bottom:unset;left:unset;height:25px;width:20px;border-top-left-radius:var(--radius-md);border-bottom-left-radius:unset;box-shadow:-25px -20px 0 20px var(--color-background)}}@media (min-width: 768px){.vAlignmentTop._blog_c3yy9_128.hAlignmentCenter ._text_c3yy9_22,.vAlignmentTop._tile_c3yy9_213.hAlignmentCenter ._text_c3yy9_22{border-radius:0 0 var(--radius-md) var(--radius-md)}.vAlignmentTop._blog_c3yy9_128.hAlignmentCenter ._text_c3yy9_22:before,.vAlignmentTop._tile_c3yy9_213.hAlignmentCenter ._text_c3yy9_22:before{content:"";position:absolute;top:0;left:-20px;bottom:unset;right:unset;height:25px;width:20px;border-top-right-radius:var(--radius-md);border-bottom-right-radius:unset;box-shadow:20px -20px 0 20px var(--color-background)}.vAlignmentTop._blog_c3yy9_128.hAlignmentCenter ._text_c3yy9_22:after,.vAlignmentTop._tile_c3yy9_213.hAlignmentCenter ._text_c3yy9_22:after{content:"";position:absolute;top:0;right:-20px;bottom:unset;left:unset;height:25px;width:20px;border-top-left-radius:var(--radius-md);border-top-right-radius:unset;border-bottom-left-radius:unset;box-shadow:-25px -20px 0 20px var(--color-background)}}@media (min-width: 768px){.vAlignmentTop._blog_c3yy9_128.hAlignmentRight ._text_c3yy9_22,.vAlignmentTop._tile_c3yy9_213.hAlignmentRight ._text_c3yy9_22{border-radius:0 0 0 var(--radius-md)}.vAlignmentTop._blog_c3yy9_128.hAlignmentRight ._text_c3yy9_22:before,.vAlignmentTop._tile_c3yy9_213.hAlignmentRight ._text_c3yy9_22:before{content:"";position:absolute;top:0;left:-20px;bottom:unset;right:unset;height:25px;width:20px;border-top-right-radius:var(--radius-md);box-shadow:20px -20px 0 20px var(--color-background)}.vAlignmentTop._blog_c3yy9_128.hAlignmentRight ._text_c3yy9_22:after,.vAlignmentTop._tile_c3yy9_213.hAlignmentRight ._text_c3yy9_22:after{content:"";position:absolute;bottom:-25px;right:0;top:unset;left:unset;height:25px;width:20px;border-top-right-radius:var(--radius-md);box-shadow:20px -20px 0 20px var(--color-background)}}.vAlignmentTop._default_c3yy9_124 ._text_c3yy9_22,.vAlignmentTop._fullBleed_c3yy9_322 ._text_c3yy9_22{align-self:flex-start}.vAlignmentMiddle._split_c3yy9_437 ._heading_c3yy9_15,.vAlignmentMiddle._splitAlt_c3yy9_437 ._heading_c3yy9_15,.vAlignmentMiddle._blog_c3yy9_128 ._overlay_c3yy9_154,.vAlignmentMiddle._tile_c3yy9_213 ._overlay_c3yy9_154{align-self:center}@media (min-width: 768px){.vAlignmentMiddle._blog_c3yy9_128.hAlignmentLeft ._text_c3yy9_22,.vAlignmentMiddle._tile_c3yy9_213.hAlignmentLeft ._text_c3yy9_22{border-radius:0 var(--radius-md) var(--radius-md) 0}.vAlignmentMiddle._blog_c3yy9_128.hAlignmentLeft ._text_c3yy9_22:before,.vAlignmentMiddle._tile_c3yy9_213.hAlignmentLeft ._text_c3yy9_22:before{content:"";position:absolute;top:-25px;right:unset;left:0;height:25px;width:20px;border-bottom-right-radius:unset;box-shadow:-20px 20px 0 20px var(--color-background);border-bottom-left-radius:var(--radius-md)}.vAlignmentMiddle._blog_c3yy9_128.hAlignmentLeft ._text_c3yy9_22:after,.vAlignmentMiddle._tile_c3yy9_213.hAlignmentLeft ._text_c3yy9_22:after{content:"";position:absolute;bottom:-25px;right:unset;height:25px;width:20px;border-top-right-radius:unset;box-shadow:-20px -20px 0 20px var(--color-background);left:0;border-top-left-radius:var(--radius-md);border-bottom-left-radius:unset}}@media (min-width: 768px){.vAlignmentMiddle._blog_c3yy9_128.hAlignmentCenter ._text_c3yy9_22,.vAlignmentMiddle._tile_c3yy9_213.hAlignmentCenter ._text_c3yy9_22{border-radius:var(--radius-md)}.vAlignmentMiddle._blog_c3yy9_128.hAlignmentCenter ._text_c3yy9_22:before,.vAlignmentMiddle._tile_c3yy9_213.hAlignmentCenter ._text_c3yy9_22:before{content:none}.vAlignmentMiddle._blog_c3yy9_128.hAlignmentCenter ._text_c3yy9_22:after,.vAlignmentMiddle._tile_c3yy9_213.hAlignmentCenter ._text_c3yy9_22:after{content:none}}@media (min-width: 768px){.vAlignmentMiddle._blog_c3yy9_128.hAlignmentRight ._text_c3yy9_22,.vAlignmentMiddle._tile_c3yy9_213.hAlignmentRight ._text_c3yy9_22{border-radius:var(--radius-md) 0 0 var(--radius-md)}.vAlignmentMiddle._blog_c3yy9_128.hAlignmentRight ._text_c3yy9_22:before,.vAlignmentMiddle._tile_c3yy9_213.hAlignmentRight ._text_c3yy9_22:before{content:"";position:absolute;top:-25px;right:0;left:unset;height:25px;width:20px;border-bottom-right-radius:var(--radius-md);box-shadow:25px 20px 0 20px var(--color-background)}.vAlignmentMiddle._blog_c3yy9_128.hAlignmentRight ._text_c3yy9_22:after,.vAlignmentMiddle._tile_c3yy9_213.hAlignmentRight ._text_c3yy9_22:after{content:"";position:absolute;bottom:-25px;right:0;height:25px;width:20px;border-top-right-radius:var(--radius-md);box-shadow:20px -20px 0 20px var(--color-background)}}.vAlignmentMiddle._default_c3yy9_124 ._text_c3yy9_22,.vAlignmentMiddle._fullBleed_c3yy9_322 ._text_c3yy9_22{align-self:center}.vAlignmentBottom._split_c3yy9_437 ._heading_c3yy9_15,.vAlignmentBottom._splitAlt_c3yy9_437 ._heading_c3yy9_15,.vAlignmentBottom._blog_c3yy9_128 ._overlay_c3yy9_154,.vAlignmentBottom._tile_c3yy9_213 ._overlay_c3yy9_154{align-self:flex-end}@media (min-width: 768px){.vAlignmentBottom._blog_c3yy9_128.hAlignmentLeft ._text_c3yy9_22,.vAlignmentBottom._tile_c3yy9_213.hAlignmentLeft ._text_c3yy9_22{border-radius:0 var(--radius-md) 0 0}.vAlignmentBottom._blog_c3yy9_128.hAlignmentLeft ._text_c3yy9_22:before,.vAlignmentBottom._tile_c3yy9_213.hAlignmentLeft ._text_c3yy9_22:before{content:"";position:absolute;top:-25px;right:unset;bottom:unset;left:0;height:25px;width:20px;border-top-left-radius:unset;border-bottom-left-radius:var(--radius-md);box-shadow:-20px 20px 0 20px var(--color-background)}.vAlignmentBottom._blog_c3yy9_128.hAlignmentLeft ._text_c3yy9_22:after,.vAlignmentBottom._tile_c3yy9_213.hAlignmentLeft ._text_c3yy9_22:after{content:"";position:absolute;top:unset;right:-20px;bottom:0;left:unset;height:25px;width:20px;border-top-left-radius:unset;border-bottom-left-radius:var(--radius-md);box-shadow:-20px 20px 0 20px var(--color-background)}}@media (min-width: 768px){.vAlignmentBottom._blog_c3yy9_128.hAlignmentCenter ._text_c3yy9_22,.vAlignmentBottom._tile_c3yy9_213.hAlignmentCenter ._text_c3yy9_22{border-radius:var(--radius-md) var(--radius-md) 0 0}.vAlignmentBottom._blog_c3yy9_128.hAlignmentCenter ._text_c3yy9_22:before,.vAlignmentBottom._tile_c3yy9_213.hAlignmentCenter ._text_c3yy9_22:before{content:"";position:absolute;top:unset;left:-20px;bottom:0;right:unset;height:25px;width:20px;border-top-right-radius:unset;border-bottom-right-radius:var(--radius-md);box-shadow:20px 20px 0 20px var(--color-background);border-bottom-left-radius:unset}.vAlignmentBottom._blog_c3yy9_128.hAlignmentCenter ._text_c3yy9_22:after,.vAlignmentBottom._tile_c3yy9_213.hAlignmentCenter ._text_c3yy9_22:after{content:"";position:absolute;top:unset;right:-20px;bottom:0;left:unset;height:25px;width:20px;border-top-left-radius:unset;border-top-right-radius:unset;border-bottom-left-radius:var(--radius-md);box-shadow:-20px 20px 0 20px var(--color-background)}}@media (min-width: 768px){.vAlignmentBottom._blog_c3yy9_128.hAlignmentRight ._text_c3yy9_22,.vAlignmentBottom._tile_c3yy9_213.hAlignmentRight ._text_c3yy9_22{border-radius:var(--radius-md) 0 0 0}.vAlignmentBottom._blog_c3yy9_128.hAlignmentRight ._text_c3yy9_22:before,.vAlignmentBottom._tile_c3yy9_213.hAlignmentRight ._text_c3yy9_22:before{content:"";position:absolute;top:-25px;right:0;left:unset;height:25px;width:20px;border-bottom-right-radius:var(--radius-md);box-shadow:25px 20px 0 20px var(--color-background)}.vAlignmentBottom._blog_c3yy9_128.hAlignmentRight ._text_c3yy9_22:after,.vAlignmentBottom._tile_c3yy9_213.hAlignmentRight ._text_c3yy9_22:after{content:"";position:absolute;top:unset;left:-20px;bottom:0;right:unset;height:25px;width:20px;border-top-right-radius:unset;border-bottom-right-radius:var(--radius-md);box-shadow:20px 20px 0 20px var(--color-background);border-bottom-left-radius:unset}}.vAlignmentBottom._default_c3yy9_124 ._text_c3yy9_22,.vAlignmentBottom._fullBleed_c3yy9_322 ._text_c3yy9_22{align-self:flex-end}.hAlignmentLeft ._container_c3yy9_7{justify-content:flex-start}.hAlignmentCenter ._container_c3yy9_7{justify-content:center}@media (min-width: 768px){.hAlignmentCenter._blog_c3yy9_128 ._text_c3yy9_22,.hAlignmentCenter._tile_c3yy9_213 ._text_c3yy9_22{border-radius:var(--radius-md) var(--radius-md) 0 0}.hAlignmentCenter._blog_c3yy9_128 ._text_c3yy9_22:before,.hAlignmentCenter._tile_c3yy9_213 ._text_c3yy9_22:before{content:"";position:absolute;top:-25px;right:0;height:25px;width:20px;border-bottom-right-radius:var(--radius-md);box-shadow:20px 20px 0 20px var(--color-background)}.hAlignmentCenter._blog_c3yy9_128 ._text_c3yy9_22:after,.hAlignmentCenter._tile_c3yy9_213 ._text_c3yy9_22:after{content:"";position:absolute;bottom:-25px;right:0;height:25px;width:20px;border-top-right-radius:var(--radius-md);box-shadow:20px -20px 0 20px var(--color-background)}}.hAlignmentRight ._container_c3yy9_7{justify-content:flex-end}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n=require("react/jsx-runtime"),e=require("../../../react.esm-C_9Ma9mj.cjs"),r=require("../../../index-0SVQqhAg.cjs");require("../../../index-CW_Ehh1q.cjs");const a=e.vi.fn();e.vi.mock("../../context/ModalContext",()=>({useModal:()=>({open:a})}));e.describe("Button",()=>{e.describe("Rendering as button",()=>{e.it("renders as a button by default",()=>{e.render(n.jsx(r.Button,{variant:"primary",children:"Click Me"}));const t=e.screen.getByRole("button",{name:"Click Me"});e.globalExpect(t).toBeInTheDocument(),e.globalExpect(t.tagName).toBe("BUTTON")}),e.it("renders as a button when 'as' is set to 'button'",()=>{e.render(n.jsx(r.Button,{as:"button",variant:"primary",children:"Click Me"}));const t=e.screen.getByRole("button",{name:"Click Me"});e.globalExpect(t).toBeInTheDocument(),e.globalExpect(t).toHaveClass("button","primary")}),e.it("has type='button' by default",()=>{e.render(n.jsx(r.Button,{variant:"primary",children:"Click Me"}));const t=e.screen.getByRole("button");e.globalExpect(t).toHaveAttribute("type","button")}),e.it("respects the disabled prop on buttons",()=>{e.render(n.jsx(r.Button,{as:"button",variant:"primary",disabled:!0,children:"Disabled"}));const t=e.screen.getByRole("button",{name:"Disabled"});e.globalExpect(t).toBeDisabled()}),e.it("calls onClick when clicked",()=>{const t=e.vi.fn();e.render(n.jsx(r.Button,{variant:"primary",onClick:t,children:"Click Me"})),e.fireEvent.click(e.screen.getByRole("button")),e.globalExpect(t).toHaveBeenCalledTimes(1)}),e.it("does not call onClick when disabled",()=>{const t=e.vi.fn();e.render(n.jsx(r.Button,{variant:"primary",onClick:t,disabled:!0,children:"Disabled"})),e.fireEvent.click(e.screen.getByRole("button")),e.globalExpect(t).not.toHaveBeenCalled()})}),e.describe("Rendering as anchor",()=>{e.it("renders as an anchor when 'as' is set to 'a'",()=>{e.render(n.jsx(r.Button,{as:"a",href:"/test",variant:"link",children:"Click Me"}));const t=e.screen.getByRole("link",{name:"Click Me"});e.globalExpect(t).toBeInTheDocument(),e.globalExpect(t.tagName).toBe("A"),e.globalExpect(t).toHaveAttribute("href","/test"),e.globalExpect(t).toHaveClass("button","link")}),e.it("adds rel='noopener noreferrer' when target is '_blank'",()=>{e.render(n.jsx(r.Button,{as:"a",href:"/test",target:"_blank",variant:"link",children:"External"})),e.globalExpect(e.screen.getByRole("link",{name:"External"})).toHaveAttribute("rel","noopener noreferrer")}),e.it("preserves custom rel attribute and adds security",()=>{e.render(n.jsx(r.Button,{as:"a",href:"/test",target:"_blank",rel:"author",variant:"link",children:"External"})),e.globalExpect(e.screen.getByRole("link")).toHaveAttribute("rel","author noopener noreferrer")}),e.it("does not add security rel for internal links",()=>{e.render(n.jsx(r.Button,{as:"a",href:"/test",variant:"link",children:"Internal"})),e.globalExpect(e.screen.getByRole("link")).not.toHaveAttribute("rel")}),e.it("adds aria-disabled when disabled",()=>{e.render(n.jsx(r.Button,{as:"a",href:"/test",variant:"link",disabled:!0,children:"Disabled Link"})),e.globalExpect(e.screen.getByRole("link")).toHaveAttribute("aria-disabled","true")})}),e.describe("Scroll button",()=>{e.it("renders as a scroll button when 'as' is set to 'scroll'",()=>{e.render(n.jsx(r.Button,{as:"scroll",scrollTarget:"section-1",variant:"primary",children:"Scroll Down"})),e.globalExpect(e.screen.getByRole("button",{name:"Scroll to section-1"})).toBeInTheDocument()}),e.it("has proper aria-label for scroll button",()=>{e.render(n.jsx(r.Button,{as:"scroll",scrollTarget:"footer",variant:"primary",children:"To Footer"})),e.globalExpect(e.screen.getByRole("button")).toHaveAttribute("aria-label","Scroll to footer")}),e.it("scrolls to target element when clicked",()=>{const t=document.createElement("div");t.id="target-section",document.body.appendChild(t);const o=e.vi.fn();t.scrollIntoView=o,e.render(n.jsx(r.Button,{as:"scroll",scrollTarget:"target-section",variant:"primary",children:"Scroll"})),e.fireEvent.click(e.screen.getByRole("button")),e.globalExpect(o).toHaveBeenCalledWith({behavior:"smooth",block:"start"}),document.body.removeChild(t)}),e.it("uses scrollTo with offset when scrollOffset is set",()=>{const t=document.createElement("div");t.id="offset-section",document.body.appendChild(t);const o=e.vi.fn();window.scrollTo=o,e.vi.spyOn(t,"getBoundingClientRect").mockReturnValue({top:200}),e.render(n.jsx(r.Button,{as:"scroll",scrollTarget:"offset-section",scrollOffset:80,variant:"primary",children:"Scroll"})),e.fireEvent.click(e.screen.getByRole("button")),e.globalExpect(o).toHaveBeenCalledWith({top:e.globalExpect.any(Number),behavior:"smooth"}),document.body.removeChild(t)}),e.it("does not error if scroll target does not exist",()=>{e.render(n.jsx(r.Button,{as:"scroll",scrollTarget:"non-existent",variant:"primary",children:"Scroll"})),e.globalExpect(()=>e.fireEvent.click(e.screen.getByRole("button"))).not.toThrow()})}),e.describe("Modal button",()=>{e.it("renders as a button when 'as' is set to 'modal'",()=>{e.render(n.jsx(r.Button,{as:"modal",modalPayload:{heading:{title:[{_type:"block",_key:"a",children:[{_type:"span",_key:"b",text:"Contact Us",marks:[]}],markDefs:[],style:"normal"}]}},variant:"primary",children:"Open Modal"})),e.globalExpect(e.screen.getByRole("button",{name:"Open Modal"})).toBeInTheDocument()}),e.it("calls useModal open with the payload when clicked",()=>{const t={heading:{title:[{_type:"block",_key:"a",children:[{_type:"span",_key:"b",text:"Contact Us",marks:[]}],markDefs:[],style:"normal"}]},formReference:{_id:"form-123",heading:{title:[{_type:"block",_key:"c",children:[{_type:"span",_key:"d",text:"Contact",marks:[]}],markDefs:[],style:"normal"}]}}};e.render(n.jsx(r.Button,{as:"modal",modalPayload:t,variant:"primary",children:"Open Form"})),e.fireEvent.click(e.screen.getByRole("button",{name:"Open Form"})),e.globalExpect(a).toHaveBeenCalledWith(t)}),e.it("is disabled when disabled prop is set",()=>{e.render(n.jsx(r.Button,{as:"modal",modalPayload:{heading:{title:[{_type:"block",_key:"a",children:[{_type:"span",_key:"b",text:"Test",marks:[]}],markDefs:[],style:"normal"}]}},variant:"primary",disabled:!0,children:"Disabled Modal"})),e.globalExpect(e.screen.getByRole("button")).toBeDisabled()}),e.it("does not call open when disabled",()=>{a.mockClear(),e.render(n.jsx(r.Button,{as:"modal",modalPayload:{heading:{title:[{_type:"block",_key:"a",children:[{_type:"span",_key:"b",text:"Test",marks:[]}],markDefs:[],style:"normal"}]}},variant:"primary",disabled:!0,children:"Disabled"})),e.fireEvent.click(e.screen.getByRole("button")),e.globalExpect(a).not.toHaveBeenCalled()})}),e.describe("Variants",()=>{["primary","primaryInverted","secondary","secondaryInverted","link","linkInverted","underline","underlineInverted","blurred","blurredInverted"].forEach(o=>{e.it(`applies ${o} variant class`,()=>{e.render(n.jsx(r.Button,{variant:o,children:"Button"})),e.globalExpect(e.screen.getByRole("button")).toHaveClass(o)})}),e.it("uses primary variant by default",()=>{e.render(n.jsx(r.Button,{children:"Default"})),e.globalExpect(e.screen.getByRole("button")).toHaveClass("primary")})}),e.describe("Icons",()=>{e.it("includes icon when icon prop is provided",()=>{e.render(n.jsx(r.Button,{variant:"primary",icon:"arrow-right",children:"Next"})),e.globalExpect(document.querySelector(".icon")).toBeInTheDocument(),e.globalExpect(document.querySelector(".icon svg")).toBeInTheDocument()}),e.it("places icon on the left when iconAlignment is 'left'",()=>{e.render(n.jsx(r.Button,{variant:"primary",icon:"arrow-left",iconAlignment:"left",children:"Back"})),e.globalExpect(document.querySelector(".content")).toHaveClass("iconLeft")}),e.it("places icon on the right when iconAlignment is 'right'",()=>{e.render(n.jsx(r.Button,{variant:"primary",icon:"arrow-right",iconAlignment:"right",children:"Next"})),e.globalExpect(document.querySelector(".content")).toHaveClass("iconRight")}),e.it("uses right alignment by default",()=>{e.render(n.jsx(r.Button,{variant:"primary",icon:"arrow-right",children:"Default Icon"})),e.globalExpect(document.querySelector(".content")).toHaveClass("iconRight")}),e.it("icon has aria-hidden attribute",()=>{e.render(n.jsx(r.Button,{variant:"primary",icon:"settings",children:"Settings"})),e.globalExpect(document.querySelector(".icon")).toHaveAttribute("aria-hidden","true")})}),e.describe("Image display",()=>{e.it("renders image when displayType is 'image' and imageSrc is provided",()=>{e.render(n.jsx(r.Button,{variant:"primary",displayType:"image",imageSrc:"/logo.png",imageAlt:"Company Logo",children:"Text not shown"}));const t=document.querySelector("img");e.globalExpect(t).toHaveAttribute("src","/logo.png"),e.globalExpect(t).toHaveAttribute("alt","Company Logo")}),e.it("renders ImageComponent when provided",()=>{const t=()=>n.jsx("div",{"data-testid":"custom-image",children:"Custom"});e.render(n.jsx(r.Button,{variant:"primary",displayType:"image",ImageComponent:n.jsx(t,{}),children:"Text"})),e.globalExpect(e.screen.getByTestId("custom-image")).toBeInTheDocument()}),e.it("applies image class when displayType is image",()=>{e.render(n.jsx(r.Button,{variant:"primary",displayType:"image",imageSrc:"/logo.png",children:"Text"}));const t=e.screen.getByRole("button");e.globalExpect(t).toHaveClass("image"),e.globalExpect(t).not.toHaveClass("primary")})}),e.describe("Custom className",()=>{e.it("applies custom className",()=>{e.render(n.jsx(r.Button,{variant:"primary",className:"custom-button",children:"Custom"}));const t=e.screen.getByRole("button");e.globalExpect(t).toHaveClass("custom-button","button","primary")})}),e.describe("Accessibility",()=>{e.it("has button role for button element",()=>{e.render(n.jsx(r.Button,{variant:"primary",children:"Click"})),e.globalExpect(e.screen.getByRole("button")).toBeInTheDocument()}),e.it("has link role for anchor element",()=>{e.render(n.jsx(r.Button,{as:"a",href:"/test",variant:"link",children:"Link"})),e.globalExpect(e.screen.getByRole("link")).toBeInTheDocument()}),e.it("supports aria attributes",()=>{e.render(n.jsx(r.Button,{variant:"primary","aria-label":"Custom Label","aria-describedby":"desc",children:"Button"}));const t=e.screen.getByRole("button");e.globalExpect(t).toHaveAttribute("aria-label","Custom Label"),e.globalExpect(t).toHaveAttribute("aria-describedby","desc")})}),e.describe("Edge cases",()=>{e.it("handles undefined variant",()=>{e.render(n.jsx(r.Button,{variant:void 0,children:"No Variant"})),e.globalExpect(e.screen.getByRole("button")).toHaveClass("button")}),e.it("handles complex children",()=>{e.render(n.jsxs(r.Button,{variant:"primary",children:[n.jsx("span",{children:"Complex"}),n.jsx("strong",{children:"Children"})]})),e.globalExpect(e.screen.getByText("Complex")).toBeInTheDocument(),e.globalExpect(e.screen.getByText("Children")).toBeInTheDocument()})})});
|
|
1
|
+
"use strict";const n=require("react/jsx-runtime"),e=require("../../../react.esm-C_9Ma9mj.cjs"),r=require("../../../index-0SVQqhAg.cjs");require("../../../index-CW_Ehh1q.cjs");const a=e.vi.fn();e.vi.mock("../../context/ModalContext",()=>({useModal:()=>({open:a})}));e.describe("Button",()=>{e.describe("Rendering as button",()=>{e.it("renders as a button by default",()=>{e.render(n.jsx(r.Button,{variant:"primary",children:"Click Me"}));const t=e.screen.getByRole("button",{name:"Click Me"});e.globalExpect(t).toBeInTheDocument(),e.globalExpect(t.tagName).toBe("BUTTON")}),e.it("renders as a button when 'as' is set to 'button'",()=>{e.render(n.jsx(r.Button,{as:"button",variant:"primary",children:"Click Me"}));const t=e.screen.getByRole("button",{name:"Click Me"});e.globalExpect(t).toBeInTheDocument(),e.globalExpect(t).toHaveClass("button","primary")}),e.it("has type='button' by default",()=>{e.render(n.jsx(r.Button,{variant:"primary",children:"Click Me"}));const t=e.screen.getByRole("button");e.globalExpect(t).toHaveAttribute("type","button")}),e.it("respects the disabled prop on buttons",()=>{e.render(n.jsx(r.Button,{as:"button",variant:"primary",disabled:!0,children:"Disabled"}));const t=e.screen.getByRole("button",{name:"Disabled"});e.globalExpect(t).toBeDisabled()}),e.it("calls onClick when clicked",()=>{const t=e.vi.fn();e.render(n.jsx(r.Button,{variant:"primary",onClick:t,children:"Click Me"})),e.fireEvent.click(e.screen.getByRole("button")),e.globalExpect(t).toHaveBeenCalledTimes(1)}),e.it("does not call onClick when disabled",()=>{const t=e.vi.fn();e.render(n.jsx(r.Button,{variant:"primary",onClick:t,disabled:!0,children:"Disabled"})),e.fireEvent.click(e.screen.getByRole("button")),e.globalExpect(t).not.toHaveBeenCalled()})}),e.describe("Rendering as anchor",()=>{e.it("renders as an anchor when 'as' is set to 'a'",()=>{e.render(n.jsx(r.Button,{as:"a",href:"/test",variant:"link",children:"Click Me"}));const t=e.screen.getByRole("link",{name:"Click Me"});e.globalExpect(t).toBeInTheDocument(),e.globalExpect(t.tagName).toBe("A"),e.globalExpect(t).toHaveAttribute("href","/test"),e.globalExpect(t).toHaveClass("button","link")}),e.it("adds rel='noopener noreferrer' when target is '_blank'",()=>{e.render(n.jsx(r.Button,{as:"a",href:"/test",target:"_blank",variant:"link",children:"External"})),e.globalExpect(e.screen.getByRole("link",{name:"External"})).toHaveAttribute("rel","noopener noreferrer")}),e.it("preserves custom rel attribute and adds security",()=>{e.render(n.jsx(r.Button,{as:"a",href:"/test",target:"_blank",rel:"author",variant:"link",children:"External"})),e.globalExpect(e.screen.getByRole("link")).toHaveAttribute("rel","author noopener noreferrer")}),e.it("does not add security rel for internal links",()=>{e.render(n.jsx(r.Button,{as:"a",href:"/test",variant:"link",children:"Internal"})),e.globalExpect(e.screen.getByRole("link")).not.toHaveAttribute("rel")}),e.it("adds aria-disabled when disabled",()=>{e.render(n.jsx(r.Button,{as:"a",href:"/test",variant:"link",disabled:!0,children:"Disabled Link"})),e.globalExpect(e.screen.getByRole("link")).toHaveAttribute("aria-disabled","true")})}),e.describe("Scroll button",()=>{e.it("renders as a scroll button when 'as' is set to 'scroll'",()=>{e.render(n.jsx(r.Button,{as:"scroll",scrollTarget:"section-1",variant:"primary",children:"Scroll Down"})),e.globalExpect(e.screen.getByRole("button",{name:"Scroll to section-1"})).toBeInTheDocument()}),e.it("has proper aria-label for scroll button",()=>{e.render(n.jsx(r.Button,{as:"scroll",scrollTarget:"footer",variant:"primary",children:"To Footer"})),e.globalExpect(e.screen.getByRole("button")).toHaveAttribute("aria-label","Scroll to footer")}),e.it("scrolls to target element when clicked",()=>{const t=document.createElement("div");t.id="target-section",document.body.appendChild(t);const o=e.vi.fn();t.scrollIntoView=o,e.render(n.jsx(r.Button,{as:"scroll",scrollTarget:"target-section",variant:"primary",children:"Scroll"})),e.fireEvent.click(e.screen.getByRole("button")),e.globalExpect(o).toHaveBeenCalledWith({behavior:"smooth",block:"start"}),document.body.removeChild(t)}),e.it("uses scrollTo with offset when scrollOffset is set",()=>{const t=document.createElement("div");t.id="offset-section",document.body.appendChild(t);const o=e.vi.fn();window.scrollTo=o,e.vi.spyOn(t,"getBoundingClientRect").mockReturnValue({top:200}),e.render(n.jsx(r.Button,{as:"scroll",scrollTarget:"offset-section",scrollOffset:80,variant:"primary",children:"Scroll"})),e.fireEvent.click(e.screen.getByRole("button")),e.globalExpect(o).toHaveBeenCalledWith({top:e.globalExpect.any(Number),behavior:"smooth"}),document.body.removeChild(t)}),e.it("does not error if scroll target does not exist",()=>{e.render(n.jsx(r.Button,{as:"scroll",scrollTarget:"non-existent",variant:"primary",children:"Scroll"})),e.globalExpect(()=>e.fireEvent.click(e.screen.getByRole("button"))).not.toThrow()})}),e.describe("Modal button",()=>{e.it("renders as a button when 'as' is set to 'modal'",()=>{e.render(n.jsx(r.Button,{as:"modal",modalPayload:{formReference:{_id:"form-modal",heading:{title:[{_type:"block",_key:"a",children:[{_type:"span",_key:"b",text:"Contact Us",marks:[]}],markDefs:[],style:"normal"}]}}},variant:"primary",children:"Open Modal"})),e.globalExpect(e.screen.getByRole("button",{name:"Open Modal"})).toBeInTheDocument()}),e.it("calls useModal open with the payload when clicked",()=>{const t={formReference:{_id:"form-123",heading:{title:[{_type:"block",_key:"c",children:[{_type:"span",_key:"d",text:"Contact",marks:[]}],markDefs:[],style:"normal"}]}}};e.render(n.jsx(r.Button,{as:"modal",modalPayload:t,variant:"primary",children:"Open Form"})),e.fireEvent.click(e.screen.getByRole("button",{name:"Open Form"})),e.globalExpect(a).toHaveBeenCalledWith(t)}),e.it("is disabled when disabled prop is set",()=>{e.render(n.jsx(r.Button,{as:"modal",modalPayload:{formReference:{_id:"form-disabled"}},variant:"primary",disabled:!0,children:"Disabled Modal"})),e.globalExpect(e.screen.getByRole("button")).toBeDisabled()}),e.it("does not call open when disabled",()=>{a.mockClear(),e.render(n.jsx(r.Button,{as:"modal",modalPayload:{formReference:{_id:"form-disabled"}},variant:"primary",disabled:!0,children:"Disabled"})),e.fireEvent.click(e.screen.getByRole("button")),e.globalExpect(a).not.toHaveBeenCalled()})}),e.describe("Variants",()=>{["primary","primaryInverted","secondary","secondaryInverted","link","linkInverted","underline","underlineInverted","blurred","blurredInverted"].forEach(o=>{e.it(`applies ${o} variant class`,()=>{e.render(n.jsx(r.Button,{variant:o,children:"Button"})),e.globalExpect(e.screen.getByRole("button")).toHaveClass(o)})}),e.it("uses primary variant by default",()=>{e.render(n.jsx(r.Button,{children:"Default"})),e.globalExpect(e.screen.getByRole("button")).toHaveClass("primary")})}),e.describe("Icons",()=>{e.it("includes icon when icon prop is provided",()=>{e.render(n.jsx(r.Button,{variant:"primary",icon:"arrow-right",children:"Next"})),e.globalExpect(document.querySelector(".icon")).toBeInTheDocument(),e.globalExpect(document.querySelector(".icon svg")).toBeInTheDocument()}),e.it("places icon on the left when iconAlignment is 'left'",()=>{e.render(n.jsx(r.Button,{variant:"primary",icon:"arrow-left",iconAlignment:"left",children:"Back"})),e.globalExpect(document.querySelector(".content")).toHaveClass("iconLeft")}),e.it("places icon on the right when iconAlignment is 'right'",()=>{e.render(n.jsx(r.Button,{variant:"primary",icon:"arrow-right",iconAlignment:"right",children:"Next"})),e.globalExpect(document.querySelector(".content")).toHaveClass("iconRight")}),e.it("uses right alignment by default",()=>{e.render(n.jsx(r.Button,{variant:"primary",icon:"arrow-right",children:"Default Icon"})),e.globalExpect(document.querySelector(".content")).toHaveClass("iconRight")}),e.it("icon has aria-hidden attribute",()=>{e.render(n.jsx(r.Button,{variant:"primary",icon:"settings",children:"Settings"})),e.globalExpect(document.querySelector(".icon")).toHaveAttribute("aria-hidden","true")})}),e.describe("Image display",()=>{e.it("renders image when displayType is 'image' and imageSrc is provided",()=>{e.render(n.jsx(r.Button,{variant:"primary",displayType:"image",imageSrc:"/logo.png",imageAlt:"Company Logo",children:"Text not shown"}));const t=document.querySelector("img");e.globalExpect(t).toHaveAttribute("src","/logo.png"),e.globalExpect(t).toHaveAttribute("alt","Company Logo")}),e.it("renders ImageComponent when provided",()=>{const t=()=>n.jsx("div",{"data-testid":"custom-image",children:"Custom"});e.render(n.jsx(r.Button,{variant:"primary",displayType:"image",ImageComponent:n.jsx(t,{}),children:"Text"})),e.globalExpect(e.screen.getByTestId("custom-image")).toBeInTheDocument()}),e.it("applies image class when displayType is image",()=>{e.render(n.jsx(r.Button,{variant:"primary",displayType:"image",imageSrc:"/logo.png",children:"Text"}));const t=e.screen.getByRole("button");e.globalExpect(t).toHaveClass("image"),e.globalExpect(t).not.toHaveClass("primary")})}),e.describe("Custom className",()=>{e.it("applies custom className",()=>{e.render(n.jsx(r.Button,{variant:"primary",className:"custom-button",children:"Custom"}));const t=e.screen.getByRole("button");e.globalExpect(t).toHaveClass("custom-button","button","primary")})}),e.describe("Accessibility",()=>{e.it("has button role for button element",()=>{e.render(n.jsx(r.Button,{variant:"primary",children:"Click"})),e.globalExpect(e.screen.getByRole("button")).toBeInTheDocument()}),e.it("has link role for anchor element",()=>{e.render(n.jsx(r.Button,{as:"a",href:"/test",variant:"link",children:"Link"})),e.globalExpect(e.screen.getByRole("link")).toBeInTheDocument()}),e.it("supports aria attributes",()=>{e.render(n.jsx(r.Button,{variant:"primary","aria-label":"Custom Label","aria-describedby":"desc",children:"Button"}));const t=e.screen.getByRole("button");e.globalExpect(t).toHaveAttribute("aria-label","Custom Label"),e.globalExpect(t).toHaveAttribute("aria-describedby","desc")})}),e.describe("Edge cases",()=>{e.it("handles undefined variant",()=>{e.render(n.jsx(r.Button,{variant:void 0,children:"No Variant"})),e.globalExpect(e.screen.getByRole("button")).toHaveClass("button")}),e.it("handles complex children",()=>{e.render(n.jsxs(r.Button,{variant:"primary",children:[n.jsx("span",{children:"Complex"}),n.jsx("strong",{children:"Children"})]})),e.globalExpect(e.screen.getByText("Complex")).toBeInTheDocument(),e.globalExpect(e.screen.getByText("Children")).toBeInTheDocument()})})});
|