quirk-ui 0.0.644 → 0.0.645
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/index15.css');const t=require("react/jsx-runtime"),j=require("react"),f=require("@portabletext/react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../assets/index15.css');const t=require("react/jsx-runtime"),j=require("react"),f=require("@portabletext/react"),q=require("../AnimatedSpan/index.cjs"),m=require("../../../core/components/Heading/index.cjs"),k=require("../../../core/components/Text/index.cjs"),y=require("next/image"),L=require("../../hooks/useMediaQuery.cjs"),M="_container_pt2lm_1",N="_divider_pt2lm_13",$="_richTextImage_pt2lm_27",S="_richTextLink_pt2lm_35",H="_spacerSmall_pt2lm_47",B="_spacerMedium_pt2lm_52",z="_spacerLarge_pt2lm_57",C="_codeBlock_pt2lm_85",i={container:M,divider:N,richTextImage:$,richTextLink:S,spacerSmall:H,spacerMedium:B,spacerLarge:z,codeBlock:C},I=n=>({normal:({children:s})=>t.jsx(k.Text,{className:n,children:s}),h1:({children:s})=>t.jsx(m.Heading,{className:n,level:1,children:s}),h2:({children:s})=>t.jsx(m.Heading,{className:n,level:2,children:s}),h3:({children:s})=>t.jsx(m.Heading,{className:n,level:3,children:s}),h4:({children:s})=>t.jsx(m.Heading,{className:n,level:4,children:s}),h5:({children:s})=>t.jsx(m.Heading,{className:n,level:5,children:s}),h6:({children:s})=>t.jsx(m.Heading,{className:n,level:6,children:s}),quote:({children:s})=>t.jsx("blockquote",{className:n,children:s}),code:({children:s})=>t.jsxs("pre",{className:`${n} ${i.codeBlock}`,children:[" ",t.jsx("code",{children:s})]})}),P=(n,a,s,u,g)=>{const x=I(n);return{marks:{coloredText:({children:e,value:r})=>{if(!r)return t.jsx(t.Fragment,{children:e});const{colorClass:c}=r,o=a==null?void 0:a.current;return u&&s?t.jsx(q.AnimatedSpan,{className:c,text:s,prevText:o},"animated-span"):t.jsx("span",{className:c,children:e})},strong:({children:e})=>t.jsx("strong",{children:e}),em:({children:e})=>t.jsx("em",{children:e}),number:({children:e})=>t.jsx("span",{className:"inlineNumber",children:e}),left:({children:e})=>t.jsx("span",{className:"textLeft",children:e}),center:({children:e})=>t.jsx("span",{className:"textCenter",children:e}),right:({children:e})=>t.jsx("span",{className:"textRight",children:e}),link:({children:e,value:r})=>{var p;const{linkType:c,internalUrl:o,externalUrl:d,blank:_}=r;let l="#";c==="external"&&d?l=d:c==="internal"&&((p=o==null?void 0:o.slug)!=null&&p.current)&&(l=`/${o==null?void 0:o.slug.current}`);const h=c==="external";return t.jsx("a",{href:l,target:_?"_blank":void 0,rel:h?"noopener noreferrer":void 0,className:i.richTextLink,children:e})},textSize:({children:e,value:r})=>{const c=r!=null&&r.size?`text-${r.size}`:"";return t.jsx("span",{className:c,children:e})},inlineCode:({children:e})=>t.jsx("code",{children:e})},block:x,list:{bullet:({children:e=[]})=>{const r=j.Children.count(e);return t.jsx("ul",{style:{columnCount:g?1:r>5?2:1},className:n,children:e})}},types:{image:({value:e})=>{var c,o,d,_,l,h,p;if(!(e!=null&&e.imageUrls))return null;const r=((c=e.asset)==null?void 0:c.altText)||"Content image";return t.jsxs("figure",{className:`${n} ${i.richTextImage}`,children:[t.jsx(y,{src:e.imageUrls.medium,alt:r,width:1e3,height:800,style:{maxWidth:"100%",height:"auto"}}),(((o=e.asset)==null?void 0:o.title)||((d=e.asset)==null?void 0:d.description))&&t.jsxs("figcaption",{children:[((_=e.asset)==null?void 0:_.title)&&t.jsx("strong",{children:(l=e.asset)==null?void 0:l.title}),((h=e.asset)==null?void 0:h.description)&&t.jsx("p",{children:(p=e.asset)==null?void 0:p.description})]})]})},divider:()=>t.jsx("hr",{className:i.divider}),spacer:({value:e})=>{const r=(e==null?void 0:e.style)||"medium",c={small:i.spacerSmall,medium:i.spacerMedium,large:i.spacerLarge};return t.jsx("span",{className:`${c[r]??i.spacerMedium}`})}}}},b=({blocks:n,className:a,textOverride:s,animateText:u})=>{const g=L.useMediaQuery("(max-width: 767px)"),x=j.useRef(s);j.useEffect(()=>{x.current=s},[s]);const T=j.useMemo(()=>P(a,x,s,u,g),[a,x,s,u,g]);return n?typeof n=="string"?(console.warn("RichText component received a string. Expected PortableTextBlock[]"),t.jsx(k.Text,{className:a,children:n})):t.jsx("div",{className:`${i.container} portableTextContainer`,children:t.jsx(f.PortableText,{value:n,components:T})}):null};exports.RichText=b;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { jsx as t, jsxs as f, Fragment as L } from "react/jsx-runtime";
|
|
2
|
-
import N, { useRef as
|
|
2
|
+
import N, { useRef as M, useEffect as y, useMemo as $ } from "react";
|
|
3
3
|
import { PortableText as B } from "@portabletext/react";
|
|
4
|
-
import { AnimatedSpan as
|
|
4
|
+
import { AnimatedSpan as S } from "../AnimatedSpan/index.mjs";
|
|
5
5
|
import { Heading as a } from "../../../core/components/Heading/index.mjs";
|
|
6
6
|
import { Text as k } from "../../../core/components/Text/index.mjs";
|
|
7
|
-
import
|
|
8
|
-
import { useMediaQuery as
|
|
9
|
-
import '../../../assets/index15.css';const I = "_container_pt2lm_1",
|
|
7
|
+
import z from "next/image";
|
|
8
|
+
import { useMediaQuery as C } from "../../hooks/useMediaQuery.mjs";
|
|
9
|
+
import '../../../assets/index15.css';const I = "_container_pt2lm_1", E = "_divider_pt2lm_13", w = "_richTextImage_pt2lm_27", P = "_richTextLink_pt2lm_35", j = "_spacerSmall_pt2lm_47", q = "_spacerMedium_pt2lm_52", R = "_spacerLarge_pt2lm_57", U = "_codeBlock_pt2lm_85", i = {
|
|
10
10
|
container: I,
|
|
11
|
-
divider:
|
|
12
|
-
richTextImage:
|
|
13
|
-
richTextLink:
|
|
14
|
-
spacerSmall:
|
|
15
|
-
spacerMedium:
|
|
16
|
-
spacerLarge:
|
|
17
|
-
codeBlock:
|
|
18
|
-
},
|
|
11
|
+
divider: E,
|
|
12
|
+
richTextImage: w,
|
|
13
|
+
richTextLink: P,
|
|
14
|
+
spacerSmall: j,
|
|
15
|
+
spacerMedium: q,
|
|
16
|
+
spacerLarge: R,
|
|
17
|
+
codeBlock: U
|
|
18
|
+
}, b = (n) => ({
|
|
19
19
|
normal: ({ children: r }) => /* @__PURE__ */ t(k, { className: n, children: r }),
|
|
20
20
|
h1: ({ children: r }) => /* @__PURE__ */ t(a, { className: n, level: 1, children: r }),
|
|
21
21
|
h2: ({ children: r }) => /* @__PURE__ */ t(a, { className: n, level: 2, children: r }),
|
|
@@ -28,8 +28,8 @@ import '../../../assets/index15.css';const I = "_container_pt2lm_1", b = "_divid
|
|
|
28
28
|
" ",
|
|
29
29
|
/* @__PURE__ */ t("code", { children: r })
|
|
30
30
|
] })
|
|
31
|
-
}),
|
|
32
|
-
const p =
|
|
31
|
+
}), A = (n, l, r, g, x) => {
|
|
32
|
+
const p = b(n);
|
|
33
33
|
return {
|
|
34
34
|
marks: {
|
|
35
35
|
coloredText: ({
|
|
@@ -38,8 +38,8 @@ import '../../../assets/index15.css';const I = "_container_pt2lm_1", b = "_divid
|
|
|
38
38
|
}) => {
|
|
39
39
|
if (!s) return /* @__PURE__ */ t(L, { children: e });
|
|
40
40
|
const { colorClass: c } = s, o = l == null ? void 0 : l.current;
|
|
41
|
-
return
|
|
42
|
-
|
|
41
|
+
return g && r ? /* @__PURE__ */ t(
|
|
42
|
+
S,
|
|
43
43
|
{
|
|
44
44
|
className: c,
|
|
45
45
|
text: r,
|
|
@@ -55,10 +55,10 @@ import '../../../assets/index15.css';const I = "_container_pt2lm_1", b = "_divid
|
|
|
55
55
|
center: ({ children: e }) => /* @__PURE__ */ t("span", { className: "textCenter", children: e }),
|
|
56
56
|
right: ({ children: e }) => /* @__PURE__ */ t("span", { className: "textRight", children: e }),
|
|
57
57
|
link: ({ children: e, value: s }) => {
|
|
58
|
-
var
|
|
58
|
+
var h;
|
|
59
59
|
const { linkType: c, internalUrl: o, externalUrl: d, blank: u } = s;
|
|
60
60
|
let m = "#";
|
|
61
|
-
return c === "external" && d ? m = d : c === "internal" && ((
|
|
61
|
+
return c === "external" && d ? m = d : c === "internal" && ((h = o == null ? void 0 : o.slug) != null && h.current) && (m = `/${o == null ? void 0 : o.slug.current}`), /* @__PURE__ */ t(
|
|
62
62
|
"a",
|
|
63
63
|
{
|
|
64
64
|
href: m,
|
|
@@ -73,18 +73,7 @@ import '../../../assets/index15.css';const I = "_container_pt2lm_1", b = "_divid
|
|
|
73
73
|
const c = s != null && s.size ? `text-${s.size}` : "";
|
|
74
74
|
return /* @__PURE__ */ t("span", { className: c, children: e });
|
|
75
75
|
},
|
|
76
|
-
inlineCode: ({ children: e }) => /* @__PURE__ */ t(
|
|
77
|
-
"code",
|
|
78
|
-
{
|
|
79
|
-
style: {
|
|
80
|
-
backgroundColor: "rgba(0,0,0,0.1)",
|
|
81
|
-
padding: "0.2em 0.4em",
|
|
82
|
-
borderRadius: "4px",
|
|
83
|
-
fontFamily: "monospace"
|
|
84
|
-
},
|
|
85
|
-
children: e
|
|
86
|
-
}
|
|
87
|
-
)
|
|
76
|
+
inlineCode: ({ children: e }) => /* @__PURE__ */ t("code", { children: e })
|
|
88
77
|
},
|
|
89
78
|
block: p,
|
|
90
79
|
list: {
|
|
@@ -104,12 +93,12 @@ import '../../../assets/index15.css';const I = "_container_pt2lm_1", b = "_divid
|
|
|
104
93
|
},
|
|
105
94
|
types: {
|
|
106
95
|
image: ({ value: e }) => {
|
|
107
|
-
var c, o, d, u, m, _,
|
|
96
|
+
var c, o, d, u, m, _, h;
|
|
108
97
|
if (!(e != null && e.imageUrls)) return null;
|
|
109
98
|
const s = ((c = e.asset) == null ? void 0 : c.altText) || "Content image";
|
|
110
99
|
return /* @__PURE__ */ f("figure", { className: `${n} ${i.richTextImage}`, children: [
|
|
111
100
|
/* @__PURE__ */ t(
|
|
112
|
-
|
|
101
|
+
z,
|
|
113
102
|
{
|
|
114
103
|
src: e.imageUrls.medium,
|
|
115
104
|
alt: s,
|
|
@@ -120,7 +109,7 @@ import '../../../assets/index15.css';const I = "_container_pt2lm_1", b = "_divid
|
|
|
120
109
|
),
|
|
121
110
|
(((o = e.asset) == null ? void 0 : o.title) || ((d = e.asset) == null ? void 0 : d.description)) && /* @__PURE__ */ f("figcaption", { children: [
|
|
122
111
|
((u = e.asset) == null ? void 0 : u.title) && /* @__PURE__ */ t("strong", { children: (m = e.asset) == null ? void 0 : m.title }),
|
|
123
|
-
((_ = e.asset) == null ? void 0 : _.description) && /* @__PURE__ */ t("p", { children: (
|
|
112
|
+
((_ = e.asset) == null ? void 0 : _.description) && /* @__PURE__ */ t("p", { children: (h = e.asset) == null ? void 0 : h.description })
|
|
124
113
|
] })
|
|
125
114
|
] });
|
|
126
115
|
},
|
|
@@ -139,21 +128,21 @@ import '../../../assets/index15.css';const I = "_container_pt2lm_1", b = "_divid
|
|
|
139
128
|
blocks: n,
|
|
140
129
|
className: l,
|
|
141
130
|
textOverride: r,
|
|
142
|
-
animateText:
|
|
131
|
+
animateText: g
|
|
143
132
|
}) => {
|
|
144
|
-
const x =
|
|
145
|
-
|
|
133
|
+
const x = C("(max-width: 767px)"), p = M(r);
|
|
134
|
+
y(() => {
|
|
146
135
|
p.current = r;
|
|
147
136
|
}, [r]);
|
|
148
137
|
const T = $(
|
|
149
|
-
() =>
|
|
138
|
+
() => A(
|
|
150
139
|
l,
|
|
151
140
|
p,
|
|
152
141
|
r,
|
|
153
|
-
|
|
142
|
+
g,
|
|
154
143
|
x
|
|
155
144
|
),
|
|
156
|
-
[l, p, r,
|
|
145
|
+
[l, p, r, g, x]
|
|
157
146
|
);
|
|
158
147
|
return n ? typeof n == "string" ? (console.warn(
|
|
159
148
|
"RichText component received a string. Expected PortableTextBlock[]"
|