quirk-ui 0.1.38 → 0.1.39
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('../../../index8.css');const s=require("react/jsx-runtime"),$=require("react"),P=require("../../../core/components/Carousel/index.cjs"),B=require("../../hooks/useStyleClasses.cjs"),F=require("../../hooks/useMediaQuery.cjs"),v=require("../../../arrow-right-DO6S4vfx.cjs"),z="_featuredDocuments_3oh02_1",Q="_container_3oh02_7",U="_carousel_3oh02_17",Y="_heading_3oh02_25",I="_eyebrow_3oh02_46",R="_flex_3oh02_50",E="_title_3oh02_80",G="_disclaimer_3oh02_99",H="_document_3oh02_107",J="_documents_3oh02_126",K="_col1_3oh02_130",V="_col2_3oh02_147",W="_col3_3oh02_157",X="_col4_3oh02_167",Z="_featuredTop_3oh02_177",O="_featuredLeft_3oh02_217",T="_twoColumn_3oh02_258",e={featuredDocuments:z,container:Q,carousel:U,heading:Y,eyebrow:I,flex:R,title:E,disclaimer:G,document:H,documents:J,col1:K,col2:V,col3:W,col4:X,featuredTop:Z,featuredLeft:O,twoColumn:T};function A(t,i="newest"){return[...t].sort((
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../index8.css');const s=require("react/jsx-runtime"),$=require("react"),P=require("../../../core/components/Carousel/index.cjs"),B=require("../../hooks/useStyleClasses.cjs"),F=require("../../hooks/useMediaQuery.cjs"),v=require("../../../arrow-right-DO6S4vfx.cjs"),z="_featuredDocuments_3oh02_1",Q="_container_3oh02_7",U="_carousel_3oh02_17",Y="_heading_3oh02_25",I="_eyebrow_3oh02_46",R="_flex_3oh02_50",E="_title_3oh02_80",G="_disclaimer_3oh02_99",H="_document_3oh02_107",J="_documents_3oh02_126",K="_col1_3oh02_130",V="_col2_3oh02_147",W="_col3_3oh02_157",X="_col4_3oh02_167",Z="_featuredTop_3oh02_177",O="_featuredLeft_3oh02_217",T="_twoColumn_3oh02_258",e={featuredDocuments:z,container:Q,carousel:U,heading:Y,eyebrow:I,flex:R,title:E,disclaimer:G,document:H,documents:J,col1:K,col2:V,col3:W,col4:X,featuredTop:Z,featuredLeft:O,twoColumn:T};function A(t,i="newest"){return[...t].sort((c,u)=>{switch(i){case"title":return(c.title??"").localeCompare(u.title??"");case"popular":return(u.helpfulYesCount??0)-(c.helpfulYesCount??0);case"newest":default:return(u.publishDate??"").localeCompare(c.publishDate??"")}})}function ee({heading:t,selectionMode:i,layout:c="default",limit:u=4,articles:D,manualArticles:_,sortBy:g,callToAction:o,styleOptions:k,id:q,renderRichText:l,renderLink:h,renderCard:p}){var C,N;const x=$.useRef(null),m=F.useMediaQuery("(max-width: 768px)"),d=i==="manual"?_:D;if(!(d!=null&&d.length))return null;const f=i==="manual"?(_==null?void 0:_.length)??1:u,S=B.useStyleClasses(k),L={featuredTop:e.featuredTop,featuredLeft:e.featuredLeft,twoColumn:e.twoColumn},M={1:e.col1,2:e.col2,3:e.col3,4:e.col4},r=o==null?void 0:o.linkOptions,j=(r==null?void 0:r.linkType)==="internal"?`/${((N=(C=r.internalUrl)==null?void 0:C.slug)==null?void 0:N.current)??""}`:(r==null?void 0:r.linkType)==="external"?r.externalUrl??"/":"/",w=A(d,g).slice(0,f),b=(n,a)=>p?p({article:n,className:e.document,index:a,layout:c,limit:f}):s.jsx("div",{className:e.document,children:s.jsx("p",{children:n.title})},n._id),y=w.map((n,a)=>b(n,a));return s.jsx("section",{id:q,className:`${e.featuredDocuments} ${S}`,children:s.jsxs("article",{className:e.container,children:[(t.title||t.description||(o==null?void 0:o.label))&&s.jsx("div",{className:e.heading,children:s.jsxs("div",{className:e.flex,children:[s.jsxs("div",{children:[t.eyebrow&&(l?l({blocks:t.eyebrow,className:e.eyebrow}):s.jsx("div",{})),l?l({blocks:t.title,className:e.title}):s.jsx("div",{className:e.title}),t.description&&(l?l({blocks:t.description}):s.jsx("div",{}))]}),(o==null?void 0:o.label)&&(h?h({href:j,children:s.jsxs(s.Fragment,{children:[o.label,s.jsx(v.ArrowRight,{size:18})]})}):s.jsxs("a",{href:j,children:[o.label,s.jsx(v.ArrowRight,{size:18})]}))]})}),c==="carousel"&&y.length>1?s.jsx("div",{className:e.carousel,ref:x,children:s.jsx(P.Carousel,{autoplay:!1,itemsPerPage:m?1:4,itemsPerRow:m?1:4,items:y,isSplit:!1,parentRef:x},m?"mobile":"desktop")}):s.jsx("div",{className:[e.documents,L[c]??"",M[String(f)]??""].filter(Boolean).join(" "),children:w.map((n,a)=>b(n,a))}),t.disclaimer&&(l?l({blocks:t.disclaimer,className:e.disclaimer}):s.jsx("div",{className:e.disclaimer}))]})})}exports.FeaturedDocumentsBlock=ee;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as s, jsxs as m, Fragment as z } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as B } from "react";
|
|
3
3
|
import { Carousel as F } from "../../../core/components/Carousel/index.mjs";
|
|
4
4
|
import { useStyleClasses as U } from "../../hooks/useStyleClasses.mjs";
|
|
@@ -23,28 +23,28 @@ import '../../../index8.css';const I = "_featuredDocuments_3oh02_1", Q = "_conta
|
|
|
23
23
|
featuredLeft: A,
|
|
24
24
|
twoColumn: ee
|
|
25
25
|
};
|
|
26
|
-
function
|
|
27
|
-
return [...
|
|
26
|
+
function se(t, i = "newest") {
|
|
27
|
+
return [...t].sort((c, a) => {
|
|
28
28
|
switch (i) {
|
|
29
29
|
case "title":
|
|
30
|
-
return (
|
|
30
|
+
return (c.title ?? "").localeCompare(a.title ?? "");
|
|
31
31
|
case "popular":
|
|
32
|
-
return (a.helpfulYesCount ?? 0) - (
|
|
32
|
+
return (a.helpfulYesCount ?? 0) - (c.helpfulYesCount ?? 0);
|
|
33
33
|
case "newest":
|
|
34
34
|
default:
|
|
35
|
-
return (a.publishDate ?? "").localeCompare(
|
|
35
|
+
return (a.publishDate ?? "").localeCompare(c.publishDate ?? "");
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
function ae({
|
|
40
|
-
heading:
|
|
40
|
+
heading: t,
|
|
41
41
|
selectionMode: i,
|
|
42
|
-
layout:
|
|
42
|
+
layout: c = "default",
|
|
43
43
|
limit: a = 4,
|
|
44
44
|
articles: g,
|
|
45
45
|
manualArticles: _,
|
|
46
46
|
sortBy: x,
|
|
47
|
-
callToAction:
|
|
47
|
+
callToAction: o,
|
|
48
48
|
styleOptions: j,
|
|
49
49
|
id: M,
|
|
50
50
|
renderRichText: l,
|
|
@@ -63,46 +63,46 @@ function ae({
|
|
|
63
63
|
2: e.col2,
|
|
64
64
|
3: e.col3,
|
|
65
65
|
4: e.col4
|
|
66
|
-
},
|
|
66
|
+
}, r = o == null ? void 0 : o.linkOptions, N = (r == null ? void 0 : r.linkType) === "internal" ? `/${((k = (D = r.internalUrl) == null ? void 0 : D.slug) == null ? void 0 : k.current) ?? ""}` : (r == null ? void 0 : r.linkType) === "external" ? r.externalUrl ?? "/" : "/", C = se(d, x).slice(
|
|
67
67
|
0,
|
|
68
68
|
p
|
|
69
69
|
), y = (n, u) => w ? w({
|
|
70
70
|
article: n,
|
|
71
71
|
className: e.document,
|
|
72
72
|
index: u,
|
|
73
|
-
layout:
|
|
73
|
+
layout: c,
|
|
74
74
|
limit: p
|
|
75
75
|
}) : (
|
|
76
76
|
// Plain fallback — replace with your card component via renderCard
|
|
77
|
-
/* @__PURE__ */
|
|
77
|
+
/* @__PURE__ */ s("div", { className: e.document, children: /* @__PURE__ */ s("p", { children: n.title }) }, n._id)
|
|
78
78
|
), v = C.map(
|
|
79
79
|
(n, u) => y(n, u)
|
|
80
80
|
);
|
|
81
|
-
return /* @__PURE__ */
|
|
82
|
-
(
|
|
81
|
+
return /* @__PURE__ */ s("section", { id: M, className: `${e.featuredDocuments} ${P}`, children: /* @__PURE__ */ m("article", { className: e.container, children: [
|
|
82
|
+
(t.title || t.description || (o == null ? void 0 : o.label)) && /* @__PURE__ */ s("div", { className: e.heading, children: /* @__PURE__ */ m("div", { className: e.flex, children: [
|
|
83
83
|
/* @__PURE__ */ m("div", { children: [
|
|
84
|
-
|
|
85
|
-
blocks:
|
|
84
|
+
t.eyebrow && (l ? l({
|
|
85
|
+
blocks: t.eyebrow,
|
|
86
86
|
className: e.eyebrow
|
|
87
|
-
}) : /* @__PURE__ */
|
|
87
|
+
}) : /* @__PURE__ */ s("div", {})),
|
|
88
88
|
l ? l({
|
|
89
|
-
blocks:
|
|
89
|
+
blocks: t.title,
|
|
90
90
|
className: e.title
|
|
91
|
-
}) : /* @__PURE__ */
|
|
92
|
-
|
|
91
|
+
}) : /* @__PURE__ */ s("div", { className: e.title }),
|
|
92
|
+
t.description && (l ? l({ blocks: t.description }) : /* @__PURE__ */ s("div", {}))
|
|
93
93
|
] }),
|
|
94
|
-
(
|
|
94
|
+
(o == null ? void 0 : o.label) && (h ? h({
|
|
95
95
|
href: N,
|
|
96
96
|
children: /* @__PURE__ */ m(z, { children: [
|
|
97
|
-
|
|
98
|
-
/* @__PURE__ */
|
|
97
|
+
o.label,
|
|
98
|
+
/* @__PURE__ */ s(L, { size: 18 })
|
|
99
99
|
] })
|
|
100
100
|
}) : /* @__PURE__ */ m("a", { href: N, children: [
|
|
101
|
-
|
|
102
|
-
/* @__PURE__ */
|
|
101
|
+
o.label,
|
|
102
|
+
/* @__PURE__ */ s(L, { size: 18 })
|
|
103
103
|
] }))
|
|
104
104
|
] }) }),
|
|
105
|
-
|
|
105
|
+
c === "carousel" && v.length > 1 ? /* @__PURE__ */ s("div", { className: e.carousel, ref: b, children: /* @__PURE__ */ s(
|
|
106
106
|
F,
|
|
107
107
|
{
|
|
108
108
|
autoplay: !1,
|
|
@@ -113,12 +113,12 @@ function ae({
|
|
|
113
113
|
parentRef: b
|
|
114
114
|
},
|
|
115
115
|
f ? "mobile" : "desktop"
|
|
116
|
-
) }) : /* @__PURE__ */
|
|
116
|
+
) }) : /* @__PURE__ */ s(
|
|
117
117
|
"div",
|
|
118
118
|
{
|
|
119
119
|
className: [
|
|
120
120
|
e.documents,
|
|
121
|
-
S[
|
|
121
|
+
S[c] ?? "",
|
|
122
122
|
$[String(p)] ?? ""
|
|
123
123
|
].filter(Boolean).join(" "),
|
|
124
124
|
children: C.map(
|
|
@@ -126,10 +126,10 @@ function ae({
|
|
|
126
126
|
)
|
|
127
127
|
}
|
|
128
128
|
),
|
|
129
|
-
|
|
130
|
-
blocks:
|
|
129
|
+
t.disclaimer && (l ? l({
|
|
130
|
+
blocks: t.disclaimer,
|
|
131
131
|
className: e.disclaimer
|
|
132
|
-
}) : /* @__PURE__ */
|
|
132
|
+
}) : /* @__PURE__ */ s("div", { className: e.disclaimer }))
|
|
133
133
|
] }) });
|
|
134
134
|
}
|
|
135
135
|
export {
|