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"),y=require("../AnimatedSpan/index.cjs"),m=require("../../../core/components/Heading/index.cjs"),k=require("../../../core/components/Text/index.cjs"),q=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",B="_spacerLarge_pt2lm_57",C="_codeBlock_pt2lm_85",i={container:M,divider:N,richTextImage:$,richTextLink:S,spacerSmall:H,spacerMedium:b,spacerLarge:B,codeBlock:C},z=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})]})}),I=(n,a,s,u,g)=>{const x=z(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(y.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",{style:{backgroundColor:"rgba(0,0,0,0.1)",padding:"0.2em 0.4em",borderRadius:"4px",fontFamily:"monospace"},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(q,{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}`})}}}},P=({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(()=>I(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=P;
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 y, useEffect as M, useMemo as $ } from "react";
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 C } from "../AnimatedSpan/index.mjs";
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 S from "next/image";
8
- import { useMediaQuery as z } from "../../hooks/useMediaQuery.mjs";
9
- import '../../../assets/index15.css';const I = "_container_pt2lm_1", b = "_divider_pt2lm_13", E = "_richTextImage_pt2lm_27", w = "_richTextLink_pt2lm_35", P = "_spacerSmall_pt2lm_47", R = "_spacerMedium_pt2lm_52", j = "_spacerLarge_pt2lm_57", q = "_codeBlock_pt2lm_85", i = {
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: b,
12
- richTextImage: E,
13
- richTextLink: w,
14
- spacerSmall: P,
15
- spacerMedium: R,
16
- spacerLarge: j,
17
- codeBlock: q
18
- }, F = (n) => ({
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
- }), U = (n, l, r, h, x) => {
32
- const p = F(n);
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 h && r ? /* @__PURE__ */ t(
42
- C,
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 g;
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" && ((g = o == null ? void 0 : o.slug) != null && g.current) && (m = `/${o == null ? void 0 : o.slug.current}`), /* @__PURE__ */ t(
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, _, g;
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
- S,
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: (g = e.asset) == null ? void 0 : g.description })
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: h
131
+ animateText: g
143
132
  }) => {
144
- const x = z("(max-width: 767px)"), p = y(r);
145
- M(() => {
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
- () => U(
138
+ () => A(
150
139
  l,
151
140
  p,
152
141
  r,
153
- h,
142
+ g,
154
143
  x
155
144
  ),
156
- [l, p, r, h, x]
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[]"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "quirk-ui",
3
3
  "private": false,
4
- "version": "0.0.644",
4
+ "version": "0.0.645",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {