quirk-ui 0.1.36 → 0.1.37

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((r,a)=>{switch(i){case"title":return(r.title??"").localeCompare(a.title??"");case"popular":return(a.helpfulYesCount??0)-(r.helpfulYesCount??0);case"newest":default:return(a.publishDate??"").localeCompare(r.publishDate??"")}})}function ee({heading:t,selectionMode:i,layout:r="default",limit:a=4,articles:g,manualArticles:_,sortBy:D,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"?_:g;if(!(d!=null&&d.length))return null;const f=i==="manual"?(_==null?void 0:_.length)??1:a,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},c=o==null?void 0:o.linkOptions,j=(c==null?void 0:c.linkType)==="internal"?`/${((N=(C=c.internalUrl)==null?void 0:C.slug)==null?void 0:N.current)??""}`:(c==null?void 0:c.linkType)==="external"?c.externalUrl??"/":"/",w=A(d,D).slice(0,f),b=(n,u)=>p?p({article:n,className:e.document,index:u,layout:r,limit:f}):s.jsx("div",{className:e.document,children:s.jsx("p",{children:n.title})},n._id),y=w.map((n,u)=>b(n,u));return s.jsx("section",{id:q,className:`${e.featuredDocuments} ${S}`,children:s.jsxs("article",{className:e.container,children:[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})]}))]})}),r==="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[r]??"",M[String(f)]??""].filter(Boolean).join(" "),children:w.map((n,u)=>b(n,u))}),t.disclaimer&&(l?l({blocks:t.disclaimer,className:e.disclaimer}):s.jsx("div",{className:e.disclaimer}))]})})}exports.FeaturedDocumentsBlock=ee;
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((r,u)=>{switch(i){case"title":return(r.title??"").localeCompare(u.title??"");case"popular":return(u.helpfulYesCount??0)-(r.helpfulYesCount??0);case"newest":default:return(u.publishDate??"").localeCompare(r.publishDate??"")}})}function ee({heading:t,selectionMode:i,layout:r="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},c=o==null?void 0:o.linkOptions,j=(c==null?void 0:c.linkType)==="internal"?`/${((N=(C=c.internalUrl)==null?void 0:C.slug)==null?void 0:N.current)??""}`:(c==null?void 0:c.linkType)==="external"?c.externalUrl??"/":"/",w=A(d,g).slice(0,f),b=(n,a)=>p?p({article:n,className:e.document,index:a,layout:r,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)&&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})]}))]})}),r==="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[r]??"",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;
@@ -3,7 +3,7 @@ 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";
5
5
  import { useMediaQuery as Y } from "../../hooks/useMediaQuery.mjs";
6
- import { A as k } from "../../../arrow-right-QEwnX3Sk.js";
6
+ import { A as L } from "../../../arrow-right-QEwnX3Sk.js";
7
7
  import '../../../index8.css';const I = "_featuredDocuments_3oh02_1", Q = "_container_3oh02_7", q = "_carousel_3oh02_17", E = "_heading_3oh02_25", G = "_eyebrow_3oh02_46", H = "_flex_3oh02_50", J = "_title_3oh02_80", K = "_disclaimer_3oh02_99", V = "_document_3oh02_107", W = "_documents_3oh02_126", X = "_col1_3oh02_130", Z = "_col2_3oh02_147", O = "_col3_3oh02_157", R = "_col4_3oh02_167", T = "_featuredTop_3oh02_177", A = "_featuredLeft_3oh02_217", ee = "_twoColumn_3oh02_258", e = {
8
8
  featuredDocuments: I,
9
9
  container: Q,
@@ -41,8 +41,8 @@ function ae({
41
41
  selectionMode: i,
42
42
  layout: r = "default",
43
43
  limit: a = 4,
44
- articles: L,
45
- manualArticles: d,
44
+ articles: g,
45
+ manualArticles: _,
46
46
  sortBy: x,
47
47
  callToAction: t,
48
48
  styleOptions: j,
@@ -51,10 +51,10 @@ function ae({
51
51
  renderLink: h,
52
52
  renderCard: w
53
53
  }) {
54
- var D, g;
55
- const b = B(null), f = Y("(max-width: 768px)"), _ = i === "manual" ? d : L;
56
- if (!(_ != null && _.length)) return null;
57
- const p = i === "manual" ? (d == null ? void 0 : d.length) ?? 1 : a, P = U(j), S = {
54
+ var D, k;
55
+ const b = B(null), f = Y("(max-width: 768px)"), d = i === "manual" ? _ : g;
56
+ if (!(d != null && d.length)) return null;
57
+ const p = i === "manual" ? (_ == null ? void 0 : _.length) ?? 1 : a, P = U(j), S = {
58
58
  featuredTop: e.featuredTop,
59
59
  featuredLeft: e.featuredLeft,
60
60
  twoColumn: e.twoColumn
@@ -63,7 +63,7 @@ function ae({
63
63
  2: e.col2,
64
64
  3: e.col3,
65
65
  4: e.col4
66
- }, c = t == null ? void 0 : t.linkOptions, N = (c == null ? void 0 : c.linkType) === "internal" ? `/${((g = (D = c.internalUrl) == null ? void 0 : D.slug) == null ? void 0 : g.current) ?? ""}` : (c == null ? void 0 : c.linkType) === "external" ? c.externalUrl ?? "/" : "/", C = oe(_, x).slice(
66
+ }, c = t == null ? void 0 : t.linkOptions, N = (c == null ? void 0 : c.linkType) === "internal" ? `/${((k = (D = c.internalUrl) == null ? void 0 : D.slug) == null ? void 0 : k.current) ?? ""}` : (c == null ? void 0 : c.linkType) === "external" ? c.externalUrl ?? "/" : "/", C = oe(d, x).slice(
67
67
  0,
68
68
  p
69
69
  ), y = (n, u) => w ? w({
@@ -79,7 +79,7 @@ function ae({
79
79
  (n, u) => y(n, u)
80
80
  );
81
81
  return /* @__PURE__ */ o("section", { id: M, className: `${e.featuredDocuments} ${P}`, children: /* @__PURE__ */ m("article", { className: e.container, children: [
82
- /* @__PURE__ */ o("div", { className: e.heading, children: /* @__PURE__ */ m("div", { className: e.flex, children: [
82
+ (s.title || s.description || t) && /* @__PURE__ */ o("div", { className: e.heading, children: /* @__PURE__ */ m("div", { className: e.flex, children: [
83
83
  /* @__PURE__ */ m("div", { children: [
84
84
  s.eyebrow && (l ? l({
85
85
  blocks: s.eyebrow,
@@ -95,11 +95,11 @@ function ae({
95
95
  href: N,
96
96
  children: /* @__PURE__ */ m(z, { children: [
97
97
  t.label,
98
- /* @__PURE__ */ o(k, { size: 18 })
98
+ /* @__PURE__ */ o(L, { size: 18 })
99
99
  ] })
100
100
  }) : /* @__PURE__ */ m("a", { href: N, children: [
101
101
  t.label,
102
- /* @__PURE__ */ o(k, { size: 18 })
102
+ /* @__PURE__ */ o(L, { size: 18 })
103
103
  ] }))
104
104
  ] }) }),
105
105
  r === "carousel" && v.length > 1 ? /* @__PURE__ */ o("div", { className: e.carousel, ref: b, children: /* @__PURE__ */ o(
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "quirk-ui",
3
3
  "private": false,
4
- "version": "0.1.36",
4
+ "version": "0.1.37",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {