quirk-ui 0.0.514 → 0.0.515
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 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../assets/index4.css');const t=require("react/jsx-runtime"),J=require("react"),X=require("../../hooks/useStyleClasses.cjs"),Y=require("../../../index-BN6814Bi.cjs"),h=require("../../../core/components/Tabs/index.cjs"),l=require("../../ui/PortableTextRenderer/index.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../assets/index4.css');const t=require("react/jsx-runtime"),J=require("react"),X=require("../../hooks/useStyleClasses.cjs"),Y=require("../../../index-BN6814Bi.cjs"),h=require("../../../core/components/Tabs/index.cjs"),l=require("../../ui/PortableTextRenderer/index.cjs"),v=require("../../ui/CallToActions/index.cjs"),u=require("next/image"),Z=require("../../utils/resolveLinkUrl.cjs"),A="_tabs_1x4bo_1",O="_container_1x4bo_7",tt="_heading_1x4bo_25",et="_text_1x4bo_32",at="_headingHorizontal_1x4bo_46",st="_title_1x4bo_54",nt="_headingVertical_1x4bo_64",rt="_tabContent_1x4bo_74",lt="_vertical_1x4bo_97",ct="_tabsContainer_1x4bo_69",it="_tabImage_1x4bo_112",ot="_tabText_1x4bo_120",xt="_gridItems_1x4bo_141",bt="_gridItem_1x4bo_141",dt="_fullBleed_1x4bo_179",_t="_overlay_1x4bo_206",e={tabs:A,container:O,heading:tt,text:et,headingHorizontal:at,title:st,headingVertical:nt,tabContent:rt,vertical:lt,tabsContainer:ct,tabImage:it,tabText:ot,gridItems:xt,gridItem:bt,default:"_default_1x4bo_164",fullBleed:dt,overlay:_t};function ht({heading:s,image:n,items:_,callToAction:c,styleOptions:r}){const[j,K]=J.useState([]);J.useEffect(()=>{async function a(){const i=await Promise.all(_.map(o=>{var x,b;return(x=o==null?void 0:o.content)!=null&&x.tabLink?Z.resolveLinkURL((b=o==null?void 0:o.content)==null?void 0:b.tabLink):void 0}));K(i)}a()},[_]);const m=X.useStyleClasses(r),k=(r==null?void 0:r.layout)??"default",T={horizontal:e.headingHorizontal,vertical:e.headingVertical}[s.headingLayout??"horizontal"],N={default:e.default,"full-bleed":e.fullBleed}[(r==null?void 0:r.layout)??"default"],C={orientationHorizontal:"horizontal",orientationVertical:"vertical"}[(r==null?void 0:r.orientation)??"orientationHorizontal"],Q={themeDefault:"default",themeLight:"light",themeDark:"dark",themeTransparent:"transparent"}[(r==null?void 0:r.theme)??"themeDefault"],I=()=>n&&n.imageUrl?t.jsx("div",{children:t.jsx(u,{src:n.imageUrl,alt:(n==null?void 0:n.asset.altText)||(n==null?void 0:n.asset.description)||"Tabs image",width:600,height:658,priority:!0})}):null,f=t.jsxs(h.Tabs,{defaultIndex:0,orientation:C,theme:Q,children:[t.jsx(h.Tabs.List,{children:_.map((a,i)=>t.jsx(h.Tabs.Trigger,{index:i,children:a.title},a.title))}),_.map((a,i)=>{var o,x,b,L,$,R,p,g,U,q,z,B,w,V,H,y,D,M,S,G,P,E;return t.jsx(h.Tabs.Panel,{index:i,children:t.jsxs("div",{className:`${e.tabContent} ${e[C]}`,children:[((x=(o=a.content)==null?void 0:o.tabImage)==null?void 0:x.imageUrl)&&t.jsx("div",{className:e.tabImage,children:t.jsx(u,{src:(b=a.content)==null?void 0:b.tabImage.imageUrl,alt:((L=a.content)==null?void 0:L.tabImage.asset.altText)||"Tab item image",width:250,height:250})}),t.jsxs("div",{className:e.tabText,children:[(($=a.content)==null?void 0:$.tabText)&&t.jsx(l.RichText,{blocks:a.content.tabText}),((R=a.content)==null?void 0:R.tabGridItem)&&Array.isArray((p=a.content)==null?void 0:p.tabGridItem)&&t.jsx("div",{className:e.gridItems,children:a.content.tabGridItem.map((d,W)=>{var F;return t.jsxs("div",{className:e.gridItem,children:[((F=d.itemImage)==null?void 0:F.imageUrl)&&t.jsx(u,{src:d.itemImage.imageUrl,alt:d.itemImage.asset.altText||"Grid item image",width:200,height:200}),d.itemText&&t.jsx(l.RichText,{blocks:d.itemText})]},W)})}),j[i]&&j[i]!=="#"&&t.jsx(Y.CallToAction,{as:"a",variant:((U=(g=a.content)==null?void 0:g.tabLink)==null?void 0:U.variant)??"primary",href:j[i]??"#",target:((B=(z=(q=a.content)==null?void 0:q.tabLink)==null?void 0:z.linkOptions)==null?void 0:B.linkType)==="external"?"_blank":"_self",rel:((H=(V=(w=a.content)==null?void 0:w.tabLink)==null?void 0:V.linkOptions)==null?void 0:H.linkType)==="external"?"noopener noreferrer":"","aria-label":((D=(y=a.content)==null?void 0:y.tabLink)==null?void 0:D.ariaLabel)||((S=(M=a.content)==null?void 0:M.tabLink)==null?void 0:S.label),children:(P=(G=a.content)==null?void 0:G.tabLink)==null?void 0:P.label},i),((E=a.content)==null?void 0:E.tabDisclaimer)&&t.jsx(l.RichText,{blocks:a.content.tabDisclaimer})]})]},i)},a.title)})]});if(k==="split")return t.jsx("section",{className:`${e.tabs} ${m}`,children:t.jsxs("article",{className:e.container,children:[t.jsxs("div",{className:`${e.heading} ${T}`,children:[t.jsxs("div",{children:[s.eyebrow&&t.jsx(l.RichText,{blocks:s.eyebrow}),t.jsx(l.RichText,{className:e.title,blocks:s.title})]}),s.description&&t.jsx(l.RichText,{blocks:s.description}),c&&t.jsx(v.CallToActions,{items:c.items,alignment:c.alignment}),s.disclaimer&&t.jsx(l.RichText,{blocks:s.disclaimer}),t.jsx("div",{className:e.tabsContainer,children:f})]}),I()]})});if(k==="default")return t.jsx("section",{className:`${e.tabs} ${N} ${m}`,children:t.jsxs("article",{className:e.container,children:[I(),t.jsxs("div",{className:`${e.heading} ${T}`,children:[t.jsx(l.RichText,{className:e.title,blocks:s.title}),((s==null?void 0:s.description)||(c==null?void 0:c.items))&&t.jsx("div",{className:e.text,children:s.description&&t.jsx(l.RichText,{blocks:s.description})})]}),t.jsx("div",{className:e.tabsContainer,children:f}),c&&t.jsx(v.CallToActions,{items:c.items,alignment:c.alignment}),s.disclaimer&&t.jsx(l.RichText,{blocks:s.disclaimer})]})});if(k==="full-bleed")return t.jsx("section",{className:`${e.tabs} ${N} ${m} tabsFullBleed`,children:t.jsxs("article",{className:e.container,children:[(n==null?void 0:n.imageUrl)&&t.jsx(u,{src:n.imageUrl??"",alt:(n==null?void 0:n.asset.altText)||(n==null?void 0:n.asset.description)||"Card image",fill:!0,priority:!0,draggable:!1,sizes:"(max-width: 767px) 650px, 1200px"}),t.jsxs("div",{className:e.overlay,children:[t.jsxs("div",{className:`${e.heading} ${T}`,children:[t.jsx(l.RichText,{className:e.title,blocks:s.title}),s.description&&t.jsx(l.RichText,{blocks:s.description}),t.jsx("div",{className:e.tabsContainer,children:f})]}),c&&t.jsx(v.CallToActions,{items:c.items,alignment:c.alignment}),s.disclaimer&&t.jsx(l.RichText,{blocks:s.disclaimer})]})]})})}exports.TabsBlock=ht;
|
|
@@ -2,12 +2,12 @@ import { jsxs as i, jsx as t } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState as X, useEffect as Y } from "react";
|
|
3
3
|
import { useStyleClasses as Z } from "../../hooks/useStyleClasses.mjs";
|
|
4
4
|
import { C as A } from "../../../index-C-E0ib2G.js";
|
|
5
|
-
import { Tabs as
|
|
5
|
+
import { Tabs as x } from "../../../core/components/Tabs/index.mjs";
|
|
6
6
|
import { RichText as s } from "../../ui/PortableTextRenderer/index.mjs";
|
|
7
7
|
import { CallToActions as I } from "../../ui/CallToActions/index.mjs";
|
|
8
|
-
import
|
|
8
|
+
import f from "next/image";
|
|
9
9
|
import { resolveLinkURL as O } from "../../utils/resolveLinkUrl.mjs";
|
|
10
|
-
import '../../../assets/index4.css';const tt = "_tabs_1x4bo_1", et = "_container_1x4bo_7", at = "_heading_1x4bo_25", rt = "_text_1x4bo_32", nt = "_headingHorizontal_1x4bo_46", lt = "_title_1x4bo_54", st = "_headingVertical_1x4bo_64", ot = "_tabContent_1x4bo_74", it = "_vertical_1x4bo_97", ct = "_tabsContainer_1x4bo_69", bt = "_tabImage_1x4bo_112", dt = "_tabText_1x4bo_120", mt = "_gridItems_1x4bo_141", _t = "_gridItem_1x4bo_141", ht = "_fullBleed_1x4bo_179",
|
|
10
|
+
import '../../../assets/index4.css';const tt = "_tabs_1x4bo_1", et = "_container_1x4bo_7", at = "_heading_1x4bo_25", rt = "_text_1x4bo_32", nt = "_headingHorizontal_1x4bo_46", lt = "_title_1x4bo_54", st = "_headingVertical_1x4bo_64", ot = "_tabContent_1x4bo_74", it = "_vertical_1x4bo_97", ct = "_tabsContainer_1x4bo_69", bt = "_tabImage_1x4bo_112", dt = "_tabText_1x4bo_120", mt = "_gridItems_1x4bo_141", _t = "_gridItem_1x4bo_141", ht = "_fullBleed_1x4bo_179", xt = "_overlay_1x4bo_206", e = {
|
|
11
11
|
tabs: tt,
|
|
12
12
|
container: et,
|
|
13
13
|
heading: at,
|
|
@@ -24,7 +24,7 @@ import '../../../assets/index4.css';const tt = "_tabs_1x4bo_1", et = "_container
|
|
|
24
24
|
gridItem: _t,
|
|
25
25
|
default: "_default_1x4bo_164",
|
|
26
26
|
fullBleed: ht,
|
|
27
|
-
overlay:
|
|
27
|
+
overlay: xt
|
|
28
28
|
};
|
|
29
29
|
function Ut({
|
|
30
30
|
heading: r,
|
|
@@ -33,7 +33,7 @@ function Ut({
|
|
|
33
33
|
callToAction: o,
|
|
34
34
|
styleOptions: l
|
|
35
35
|
}) {
|
|
36
|
-
const [
|
|
36
|
+
const [u, K] = X([]);
|
|
37
37
|
Y(() => {
|
|
38
38
|
async function a() {
|
|
39
39
|
const c = await Promise.all(
|
|
@@ -64,7 +64,7 @@ function Ut({
|
|
|
64
64
|
themeDark: "dark",
|
|
65
65
|
themeTransparent: "transparent"
|
|
66
66
|
}[(l == null ? void 0 : l.theme) ?? "themeDefault"], $ = () => n && n.imageUrl ? /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
|
|
67
|
-
|
|
67
|
+
f,
|
|
68
68
|
{
|
|
69
69
|
src: n.imageUrl,
|
|
70
70
|
alt: (n == null ? void 0 : n.asset.altText) || (n == null ? void 0 : n.asset.description) || "Tabs image",
|
|
@@ -72,17 +72,17 @@ function Ut({
|
|
|
72
72
|
height: 658,
|
|
73
73
|
priority: !0
|
|
74
74
|
}
|
|
75
|
-
) }) : null, p = /* @__PURE__ */ i(
|
|
76
|
-
/* @__PURE__ */ t(
|
|
75
|
+
) }) : null, p = /* @__PURE__ */ i(x, { defaultIndex: 0, orientation: L, theme: Q, children: [
|
|
76
|
+
/* @__PURE__ */ t(x.List, { children: h.map((a, c) => /* @__PURE__ */ t(x.Trigger, { index: c, children: a.title }, a.title)) }),
|
|
77
77
|
h.map((a, c) => {
|
|
78
|
-
var b, d, m, T, U, g, z,
|
|
79
|
-
return /* @__PURE__ */ t(
|
|
78
|
+
var b, d, m, T, U, g, z, B, w, V, H, D, G, M, j, y, P, R, S, E, F, q;
|
|
79
|
+
return /* @__PURE__ */ t(x.Panel, { index: c, children: /* @__PURE__ */ i(
|
|
80
80
|
"div",
|
|
81
81
|
{
|
|
82
82
|
className: `${e.tabContent} ${e[L]}`,
|
|
83
83
|
children: [
|
|
84
84
|
((d = (b = a.content) == null ? void 0 : b.tabImage) == null ? void 0 : d.imageUrl) && /* @__PURE__ */ t("div", { className: e.tabImage, children: /* @__PURE__ */ t(
|
|
85
|
-
|
|
85
|
+
f,
|
|
86
86
|
{
|
|
87
87
|
src: (m = a.content) == null ? void 0 : m.tabImage.imageUrl,
|
|
88
88
|
alt: ((T = a.content) == null ? void 0 : T.tabImage.asset.altText) || "Tab item image",
|
|
@@ -96,7 +96,7 @@ function Ut({
|
|
|
96
96
|
var J;
|
|
97
97
|
return /* @__PURE__ */ i("div", { className: e.gridItem, children: [
|
|
98
98
|
((J = _.itemImage) == null ? void 0 : J.imageUrl) && /* @__PURE__ */ t(
|
|
99
|
-
|
|
99
|
+
f,
|
|
100
100
|
{
|
|
101
101
|
src: _.itemImage.imageUrl,
|
|
102
102
|
alt: _.itemImage.asset.altText || "Grid item image",
|
|
@@ -107,16 +107,16 @@ function Ut({
|
|
|
107
107
|
_.itemText && /* @__PURE__ */ t(s, { blocks: _.itemText })
|
|
108
108
|
] }, W);
|
|
109
109
|
}) }),
|
|
110
|
-
|
|
110
|
+
u[c] && u[c] !== "#" && /* @__PURE__ */ t(
|
|
111
111
|
A,
|
|
112
112
|
{
|
|
113
113
|
as: "a",
|
|
114
|
-
variant: ((
|
|
115
|
-
href:
|
|
114
|
+
variant: ((w = (B = a.content) == null ? void 0 : B.tabLink) == null ? void 0 : w.variant) ?? "primary",
|
|
115
|
+
href: u[c] ?? "#",
|
|
116
116
|
target: ((D = (H = (V = a.content) == null ? void 0 : V.tabLink) == null ? void 0 : H.linkOptions) == null ? void 0 : D.linkType) === "external" ? "_blank" : "_self",
|
|
117
117
|
rel: ((j = (M = (G = a.content) == null ? void 0 : G.tabLink) == null ? void 0 : M.linkOptions) == null ? void 0 : j.linkType) === "external" ? "noopener noreferrer" : "",
|
|
118
|
-
"aria-label": ((
|
|
119
|
-
children: (
|
|
118
|
+
"aria-label": ((P = (y = a.content) == null ? void 0 : y.tabLink) == null ? void 0 : P.ariaLabel) || ((S = (R = a.content) == null ? void 0 : R.tabLink) == null ? void 0 : S.label),
|
|
119
|
+
children: (F = (E = a.content) == null ? void 0 : E.tabLink) == null ? void 0 : F.label
|
|
120
120
|
},
|
|
121
121
|
c
|
|
122
122
|
),
|
|
@@ -172,15 +172,14 @@ function Ut({
|
|
|
172
172
|
className: `${e.tabs} ${C} ${k} tabsFullBleed`,
|
|
173
173
|
children: /* @__PURE__ */ i("article", { className: e.container, children: [
|
|
174
174
|
(n == null ? void 0 : n.imageUrl) && /* @__PURE__ */ t(
|
|
175
|
-
|
|
175
|
+
f,
|
|
176
176
|
{
|
|
177
177
|
src: n.imageUrl ?? "",
|
|
178
178
|
alt: (n == null ? void 0 : n.asset.altText) || (n == null ? void 0 : n.asset.description) || "Card image",
|
|
179
179
|
fill: !0,
|
|
180
180
|
priority: !0,
|
|
181
|
-
style: { objectFit: "cover" },
|
|
182
181
|
draggable: !1,
|
|
183
|
-
sizes: "(
|
|
182
|
+
sizes: "(max-width: 767px) 650px, 1200px"
|
|
184
183
|
}
|
|
185
184
|
),
|
|
186
185
|
/* @__PURE__ */ i("div", { className: e.overlay, children: [
|