quirk-ui 0.0.650 → 0.0.651

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/index31.css');const e=require("react/jsx-runtime"),b="_wrapper_erjwc_1",h="_table_erjwc_5",j="_empty_erjwc_24",m="_clickableRow_erjwc_30",c={wrapper:b,table:h,empty:j,clickableRow:m};function _({data:l,columns:t,emptyMessage:n="No data available",onRowClick:s,className:i,...d}){return e.jsx("div",{className:`${i??""} ${c.wrapper}`,children:e.jsxs("table",{className:c.table,...d,children:[e.jsx("thead",{children:e.jsx("tr",{children:t.map(a=>e.jsx("th",{className:a.className,children:a.header},String(a.accessor)))})}),e.jsx("tbody",{children:l.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:t.length,className:c.empty,children:n})}):l.map((a,p)=>e.jsx("tr",{onClick:()=>s==null?void 0:s(a),className:s?c.clickableRow:"",children:t.map(r=>e.jsx("td",{className:r.className,children:r.cellRenderer?r.cellRenderer(a[r.accessor],a):String(a[r.accessor])},String(r.accessor)))},p))})]})})}exports.Table=_;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../assets/index31.css');const e=require("react/jsx-runtime"),h="_wrapper_erjwc_1",j="_table_erjwc_5",m="_empty_erjwc_24",_="_clickableRow_erjwc_30",t={wrapper:h,table:j,empty:m,clickableRow:_};function x({hasHeadingRow:n=!0,data:l,columns:c,emptyMessage:i="No data available",onRowClick:s,className:d,...p}){return e.jsx("div",{className:`${d??""} ${t.wrapper}`,children:e.jsxs("table",{className:t.table,...p,children:[n&&e.jsx("thead",{children:e.jsx("tr",{children:c.map(a=>e.jsx("th",{className:a.className,children:a.header},String(a.accessor)))})}),e.jsx("tbody",{children:l.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:c.length,className:t.empty,children:i})}):l.map((a,b)=>e.jsx("tr",{onClick:()=>s==null?void 0:s(a),className:s?t.clickableRow:"",children:c.map(r=>e.jsx("td",{className:r.className,children:r.cellRenderer?r.cellRenderer(a[r.accessor],a):String(a[r.accessor])},String(r.accessor)))},b))})]})})}exports.Table=x;
@@ -1,31 +1,32 @@
1
- import { jsx as e, jsxs as h } from "react/jsx-runtime";
2
- import '../../../assets/index31.css';const m = "_wrapper_erjwc_1", b = "_table_erjwc_5", _ = "_empty_erjwc_24", N = "_clickableRow_erjwc_30", s = {
3
- wrapper: m,
4
- table: b,
5
- empty: _,
6
- clickableRow: N
1
+ import { jsx as e, jsxs as m } from "react/jsx-runtime";
2
+ import '../../../assets/index31.css';const b = "_wrapper_erjwc_1", _ = "_table_erjwc_5", N = "_empty_erjwc_24", j = "_clickableRow_erjwc_30", t = {
3
+ wrapper: b,
4
+ table: _,
5
+ empty: N,
6
+ clickableRow: j
7
7
  };
8
- function y({
8
+ function g({
9
+ hasHeadingRow: n = !0,
9
10
  data: l,
10
- columns: t,
11
- emptyMessage: n = "No data available",
11
+ columns: s,
12
+ emptyMessage: d = "No data available",
12
13
  onRowClick: c,
13
- className: d,
14
- ...p
14
+ className: p,
15
+ ...i
15
16
  }) {
16
- return /* @__PURE__ */ e("div", { className: `${d ?? ""} ${s.wrapper}`, children: /* @__PURE__ */ h("table", { className: s.table, ...p, children: [
17
- /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e("tr", { children: t.map((a) => /* @__PURE__ */ e("th", { className: a.className, children: a.header }, String(a.accessor))) }) }),
18
- /* @__PURE__ */ e("tbody", { children: l.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: t.length, className: s.empty, children: n }) }) : l.map((a, i) => /* @__PURE__ */ e(
17
+ return /* @__PURE__ */ e("div", { className: `${p ?? ""} ${t.wrapper}`, children: /* @__PURE__ */ m("table", { className: t.table, ...i, children: [
18
+ n && /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e("tr", { children: s.map((a) => /* @__PURE__ */ e("th", { className: a.className, children: a.header }, String(a.accessor))) }) }),
19
+ /* @__PURE__ */ e("tbody", { children: l.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: s.length, className: t.empty, children: d }) }) : l.map((a, h) => /* @__PURE__ */ e(
19
20
  "tr",
20
21
  {
21
22
  onClick: () => c == null ? void 0 : c(a),
22
- className: c ? s.clickableRow : "",
23
- children: t.map((r) => /* @__PURE__ */ e("td", { className: r.className, children: r.cellRenderer ? r.cellRenderer(a[r.accessor], a) : String(a[r.accessor]) }, String(r.accessor)))
23
+ className: c ? t.clickableRow : "",
24
+ children: s.map((r) => /* @__PURE__ */ e("td", { className: r.className, children: r.cellRenderer ? r.cellRenderer(a[r.accessor], a) : String(a[r.accessor]) }, String(r.accessor)))
24
25
  },
25
- i
26
+ h
26
27
  )) })
27
28
  ] }) });
28
29
  }
29
30
  export {
30
- y as Table
31
+ g as Table
31
32
  };
package/dist/core.d.ts CHANGED
@@ -1167,7 +1167,7 @@ declare type SwitchProps = {
1167
1167
  className?: string;
1168
1168
  } & default_2.InputHTMLAttributes<HTMLInputElement>;
1169
1169
 
1170
- export declare function Table<T>({ data, columns, emptyMessage, onRowClick, className, ...restProps }: TableProps<T>): JSX.Element;
1170
+ export declare function Table<T>({ hasHeadingRow, data, columns, emptyMessage, onRowClick, className, ...restProps }: TableProps<T>): JSX.Element;
1171
1171
 
1172
1172
  export declare type TableColumn<T> = {
1173
1173
  header: string;
@@ -1177,6 +1177,7 @@ export declare type TableColumn<T> = {
1177
1177
  };
1178
1178
 
1179
1179
  declare type TableProps<T> = {
1180
+ hasHeadingRow?: boolean;
1180
1181
  data: T[];
1181
1182
  columns: TableColumn<T>[];
1182
1183
  emptyMessage?: string;
package/dist/main.d.ts CHANGED
@@ -1323,7 +1323,7 @@ declare type SwitchProps = {
1323
1323
  className?: string;
1324
1324
  } & default_2.InputHTMLAttributes<HTMLInputElement>;
1325
1325
 
1326
- export declare function Table<T>({ data, columns, emptyMessage, onRowClick, className, ...restProps }: TableProps<T>): JSX.Element;
1326
+ export declare function Table<T>({ hasHeadingRow, data, columns, emptyMessage, onRowClick, className, ...restProps }: TableProps<T>): JSX.Element;
1327
1327
 
1328
1328
  export declare type TableColumn<T> = {
1329
1329
  header: string;
@@ -1333,6 +1333,7 @@ export declare type TableColumn<T> = {
1333
1333
  };
1334
1334
 
1335
1335
  declare type TableProps<T> = {
1336
+ hasHeadingRow?: boolean;
1336
1337
  data: T[];
1337
1338
  columns: TableColumn<T>[];
1338
1339
  emptyMessage?: string;
@@ -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"),b=require("@portabletext/react"),y=require("../AnimatedSpan/index.cjs"),h=require("../../../core/components/Heading/index.cjs"),q=require("../../../core/components/Text/index.cjs"),L=require("../../../core/components/Table/index.cjs"),M=require("next/image"),N=require("../../hooks/useMediaQuery.cjs"),S="_container_1bbre_1",w="_divider_1bbre_15",H="_richTextImage_1bbre_33",B="_richTextLink_1bbre_41",P="_spacerSmall_1bbre_53",z="_spacerMedium_1bbre_58",I="_spacerLarge_1bbre_63",E="_codeBlock_1bbre_91",d={container:S,divider:w,richTextImage:H,richTextLink:B,spacerSmall:P,spacerMedium:z,spacerLarge:I,codeBlock:E},R=n=>({normal:({children:s})=>t.jsx(q.Text,{className:n,children:s}),h1:({children:s})=>t.jsx(h.Heading,{className:n,level:1,children:s}),h2:({children:s})=>t.jsx(h.Heading,{className:n,level:2,children:s}),h3:({children:s})=>t.jsx(h.Heading,{className:n,level:3,children:s}),h4:({children:s})=>t.jsx(h.Heading,{className:n,level:4,children:s}),h5:({children:s})=>t.jsx(h.Heading,{className:n,level:5,children:s}),h6:({children:s})=>t.jsx(h.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} ${d.codeBlock}`,children:[" ",t.jsx("code",{children:s})]})}),k=(n,l,s,u,g)=>{const _=R(n);return{marks:{coloredText:({children:e,value:r})=>{if(!r)return t.jsx(t.Fragment,{children:e});const{colorClass:c}=r,o=l==null?void 0:l.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 a;const{linkType:c,internalUrl:o,externalUrl:m,blank:p}=r;let i="#";c==="external"&&m?i=m:c==="internal"&&((a=o==null?void 0:o.slug)!=null&&a.current)&&(i=`/${o==null?void 0:o.slug.current}`);const x=c==="external";return t.jsx("a",{href:i,target:p?"_blank":void 0,rel:x?"noopener noreferrer":void 0,className:d.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:_,list:{bullet:({children:e=[]})=>{const r=j.Children.count(e);return t.jsx("ul",{style:{columnCount:g?1:r>7?2:1},className:n,children:e})}},types:{image:({value:e})=>{var c,o,m,p,i,x,a;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} ${d.richTextImage}`,children:[t.jsx(M,{src:e.imageUrls.medium,alt:r,width:1e3,height:800,style:{maxWidth:"100%",height:"auto"}}),(((o=e.asset)==null?void 0:o.title)||((m=e.asset)==null?void 0:m.description))&&t.jsxs("figcaption",{children:[((p=e.asset)==null?void 0:p.title)&&t.jsx("strong",{children:(i=e.asset)==null?void 0:i.title}),((x=e.asset)==null?void 0:x.description)&&t.jsx("p",{children:(a=e.asset)==null?void 0:a.description})]})]})},divider:()=>t.jsx("hr",{className:d.divider}),spacer:({value:e})=>{const r=(e==null?void 0:e.style)||"medium",c={small:d.spacerSmall,medium:d.spacerMedium,large:d.spacerLarge};return t.jsx("span",{className:`${c[r]??d.spacerMedium}`})},table:({value:e})=>{var p;if(!((p=e==null?void 0:e.rows)!=null&&p.length))return null;const r=e.rows[0],c=e.rows.slice(1),o=r.cells.map((i,x)=>({header:t.jsx(b.PortableText,{value:i==null?void 0:i.content,components:k(n,l,s,u,g)}),accessor:`col${x}`,cellRenderer:a=>a?t.jsx(b.PortableText,{value:a,components:k(n,l,s,u,g)}):null})),m=c.map(i=>{var a;const x={};return(a=i.cells)==null||a.forEach((T,$)=>{x[`col${$}`]=T==null?void 0:T.content}),x});return t.jsx(L.Table,{data:m,columns:o})}}}},C=({blocks:n,className:l,textOverride:s,animateText:u})=>{const g=N.useMediaQuery("(max-width: 767px)"),_=j.useRef(s);j.useEffect(()=>{_.current=s},[s]);const f=j.useMemo(()=>k(l,_,s,u,g),[l,_,s,u,g]);return n?typeof n=="string"?(console.warn("RichText component received a string. Expected PortableTextBlock[]"),t.jsx(q.Text,{className:l,children:n})):t.jsx("div",{className:`${d.container} portableTextContainer`,children:t.jsx(b.PortableText,{value:n,components:f})}):null};exports.RichText=C;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../assets/index15.css');const t=require("react/jsx-runtime"),k=require("react"),f=require("@portabletext/react"),H=require("../AnimatedSpan/index.cjs"),j=require("../../../core/components/Heading/index.cjs"),L=require("../../../core/components/Text/index.cjs"),M=require("../../../core/components/Table/index.cjs"),N=require("next/image"),S=require("../../hooks/useMediaQuery.cjs"),B="_container_1bbre_1",P="_divider_1bbre_15",z="_richTextImage_1bbre_33",I="_richTextLink_1bbre_41",R="_spacerSmall_1bbre_53",E="_spacerMedium_1bbre_58",C="_spacerLarge_1bbre_63",A="_codeBlock_1bbre_91",l={container:B,divider:P,richTextImage:z,richTextLink:I,spacerSmall:R,spacerMedium:E,spacerLarge:C,codeBlock:A},Q=n=>({normal:({children:s})=>t.jsx(L.Text,{className:n,children:s}),h1:({children:s})=>t.jsx(j.Heading,{className:n,level:1,children:s}),h2:({children:s})=>t.jsx(j.Heading,{className:n,level:2,children:s}),h3:({children:s})=>t.jsx(j.Heading,{className:n,level:3,children:s}),h4:({children:s})=>t.jsx(j.Heading,{className:n,level:4,children:s}),h5:({children:s})=>t.jsx(j.Heading,{className:n,level:5,children:s}),h6:({children:s})=>t.jsx(j.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} ${l.codeBlock}`,children:[" ",t.jsx("code",{children:s})]})}),$=(n,i,s,p,u)=>{const T=Q(n);return{marks:{coloredText:({children:e,value:r})=>{if(!r)return t.jsx(t.Fragment,{children:e});const{colorClass:c}=r,o=i==null?void 0:i.current;return p&&s?t.jsx(H.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 d;const{linkType:c,internalUrl:o,externalUrl:a,blank:g}=r;let x="#";c==="external"&&a?x=a:c==="internal"&&((d=o==null?void 0:o.slug)!=null&&d.current)&&(x=`/${o==null?void 0:o.slug.current}`);const m=c==="external";return t.jsx("a",{href:x,target:g?"_blank":void 0,rel:m?"noopener noreferrer":void 0,className:l.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:T,list:{bullet:({children:e=[]})=>{const r=k.Children.count(e);return t.jsx("ul",{style:{columnCount:u?1:r>7?2:1},className:n,children:e})}},types:{image:({value:e})=>{var c,o,a,g,x,m,d;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} ${l.richTextImage}`,children:[t.jsx(N,{src:e.imageUrls.medium,alt:r,width:1e3,height:800,style:{maxWidth:"100%",height:"auto"}}),(((o=e.asset)==null?void 0:o.title)||((a=e.asset)==null?void 0:a.description))&&t.jsxs("figcaption",{children:[((g=e.asset)==null?void 0:g.title)&&t.jsx("strong",{children:(x=e.asset)==null?void 0:x.title}),((m=e.asset)==null?void 0:m.description)&&t.jsx("p",{children:(d=e.asset)==null?void 0:d.description})]})]})},divider:()=>t.jsx("hr",{className:l.divider}),spacer:({value:e})=>{const r=(e==null?void 0:e.style)||"medium",c={small:l.spacerSmall,medium:l.spacerMedium,large:l.spacerLarge};return t.jsx("span",{className:`${c[r]??l.spacerMedium}`})},table:({value:e})=>{var m,d;if(!((m=e==null?void 0:e.rows)!=null&&m.length))return null;const{hasHeadingRow:r}=e,c=r?e.rows[0]:null,o=r?e.rows.slice(1):e.rows,a=c||o[0];if(!((d=a==null?void 0:a.cells)!=null&&d.length))return null;const g=a.cells.map((y,h)=>{var b;return{header:c?t.jsx(f.PortableText,{value:(b=c.cells[h])==null?void 0:b.content,components:$(n,i,s,p,u)}):`Column ${h+1}`,accessor:`col${h}`,cellRenderer:_=>_?t.jsx(f.PortableText,{value:_,components:$(n,i,s,p,u)}):null}}),x=o.map(y=>{var b;const h={};return(b=y.cells)==null||b.forEach((_,w)=>{h[`col${w}`]=_==null?void 0:_.content}),h});return t.jsx(M.Table,{hasHeadingRow:r,data:x,columns:g,className:`${n} ${r?"hasHeadingRow":""}`})}}}},U=({blocks:n,className:i,textOverride:s,animateText:p})=>{const u=S.useMediaQuery("(max-width: 767px)"),T=k.useRef(s);k.useEffect(()=>{T.current=s},[s]);const q=k.useMemo(()=>$(i,T,s,p,u),[i,T,s,p,u]);return n?typeof n=="string"?(console.warn("RichText component received a string. Expected PortableTextBlock[]"),t.jsx(L.Text,{className:i,children:n})):t.jsx("div",{className:`${l.container} portableTextContainer`,children:t.jsx(f.PortableText,{value:n,components:q})}):null};exports.RichText=U;
@@ -1,53 +1,53 @@
1
- import { jsx as t, jsxs as b, Fragment as w } from "react/jsx-runtime";
2
- import y, { useRef as M, useEffect as B, useMemo as S } from "react";
3
- import { PortableText as k } from "@portabletext/react";
4
- import { AnimatedSpan as z } from "../AnimatedSpan/index.mjs";
5
- import { Heading as _ } from "../../../core/components/Heading/index.mjs";
6
- import { Text as $ } from "../../../core/components/Text/index.mjs";
7
- import { Table as E } from "../../../core/components/Table/index.mjs";
8
- import I from "next/image";
9
- import { useMediaQuery as j } from "../../hooks/useMediaQuery.mjs";
10
- import '../../../assets/index15.css';const C = "_container_1bbre_1", P = "_divider_1bbre_15", R = "_richTextImage_1bbre_33", q = "_richTextLink_1bbre_41", U = "_spacerSmall_1bbre_53", A = "_spacerMedium_1bbre_58", F = "_spacerLarge_1bbre_63", H = "_codeBlock_1bbre_91", l = {
11
- container: C,
12
- divider: P,
13
- richTextImage: R,
14
- richTextLink: q,
15
- spacerSmall: U,
16
- spacerMedium: A,
17
- spacerLarge: F,
18
- codeBlock: H
19
- }, Q = (n) => ({
20
- normal: ({ children: r }) => /* @__PURE__ */ t($, { className: n, children: r }),
21
- h1: ({ children: r }) => /* @__PURE__ */ t(_, { className: n, level: 1, children: r }),
22
- h2: ({ children: r }) => /* @__PURE__ */ t(_, { className: n, level: 2, children: r }),
23
- h3: ({ children: r }) => /* @__PURE__ */ t(_, { className: n, level: 3, children: r }),
24
- h4: ({ children: r }) => /* @__PURE__ */ t(_, { className: n, level: 4, children: r }),
25
- h5: ({ children: r }) => /* @__PURE__ */ t(_, { className: n, level: 5, children: r }),
26
- h6: ({ children: r }) => /* @__PURE__ */ t(_, { className: n, level: 6, children: r }),
27
- quote: ({ children: r }) => /* @__PURE__ */ t("blockquote", { className: n, children: r }),
28
- code: ({ children: r }) => /* @__PURE__ */ b("pre", { className: `${n} ${l.codeBlock}`, children: [
1
+ import { jsx as t, jsxs as T, Fragment as B } from "react/jsx-runtime";
2
+ import S, { useRef as z, useEffect as E, useMemo as I } from "react";
3
+ import { PortableText as $ } from "@portabletext/react";
4
+ import { AnimatedSpan as R } from "../AnimatedSpan/index.mjs";
5
+ import { Heading as x } from "../../../core/components/Heading/index.mjs";
6
+ import { Text as y } from "../../../core/components/Text/index.mjs";
7
+ import { Table as j } from "../../../core/components/Table/index.mjs";
8
+ import C from "next/image";
9
+ import { useMediaQuery as H } from "../../hooks/useMediaQuery.mjs";
10
+ import '../../../assets/index15.css';const P = "_container_1bbre_1", q = "_divider_1bbre_15", U = "_richTextImage_1bbre_33", A = "_richTextLink_1bbre_41", F = "_spacerSmall_1bbre_53", Q = "_spacerMedium_1bbre_58", W = "_spacerLarge_1bbre_63", D = "_codeBlock_1bbre_91", m = {
11
+ container: P,
12
+ divider: q,
13
+ richTextImage: U,
14
+ richTextLink: A,
15
+ spacerSmall: F,
16
+ spacerMedium: Q,
17
+ spacerLarge: W,
18
+ codeBlock: D
19
+ }, G = (r) => ({
20
+ normal: ({ children: n }) => /* @__PURE__ */ t(y, { className: r, children: n }),
21
+ h1: ({ children: n }) => /* @__PURE__ */ t(x, { className: r, level: 1, children: n }),
22
+ h2: ({ children: n }) => /* @__PURE__ */ t(x, { className: r, level: 2, children: n }),
23
+ h3: ({ children: n }) => /* @__PURE__ */ t(x, { className: r, level: 3, children: n }),
24
+ h4: ({ children: n }) => /* @__PURE__ */ t(x, { className: r, level: 4, children: n }),
25
+ h5: ({ children: n }) => /* @__PURE__ */ t(x, { className: r, level: 5, children: n }),
26
+ h6: ({ children: n }) => /* @__PURE__ */ t(x, { className: r, level: 6, children: n }),
27
+ quote: ({ children: n }) => /* @__PURE__ */ t("blockquote", { className: r, children: n }),
28
+ code: ({ children: n }) => /* @__PURE__ */ T("pre", { className: `${r} ${m.codeBlock}`, children: [
29
29
  " ",
30
- /* @__PURE__ */ t("code", { children: r })
30
+ /* @__PURE__ */ t("code", { children: n })
31
31
  ] })
32
- }), T = (n, a, r, g, u) => {
33
- const f = Q(n);
32
+ }), L = (r, i, n, d, h) => {
33
+ const k = G(r);
34
34
  return {
35
35
  marks: {
36
36
  coloredText: ({
37
37
  children: e,
38
- value: o
38
+ value: c
39
39
  }) => {
40
- if (!o) return /* @__PURE__ */ t(w, { children: e });
41
- const { colorClass: c } = o, s = a == null ? void 0 : a.current;
42
- return g && r ? /* @__PURE__ */ t(
43
- z,
40
+ if (!c) return /* @__PURE__ */ t(B, { children: e });
41
+ const { colorClass: o } = c, s = i == null ? void 0 : i.current;
42
+ return d && n ? /* @__PURE__ */ t(
43
+ R,
44
44
  {
45
- className: c,
46
- text: r,
45
+ className: o,
46
+ text: n,
47
47
  prevText: s
48
48
  },
49
49
  "animated-span"
50
- ) : /* @__PURE__ */ t("span", { className: c, children: e });
50
+ ) : /* @__PURE__ */ t("span", { className: o, children: e });
51
51
  },
52
52
  strong: ({ children: e }) => /* @__PURE__ */ t("strong", { children: e }),
53
53
  em: ({ children: e }) => /* @__PURE__ */ t("em", { children: e }),
@@ -55,38 +55,38 @@ import '../../../assets/index15.css';const C = "_container_1bbre_1", P = "_divid
55
55
  left: ({ children: e }) => /* @__PURE__ */ t("span", { className: "textLeft", children: e }),
56
56
  center: ({ children: e }) => /* @__PURE__ */ t("span", { className: "textCenter", children: e }),
57
57
  right: ({ children: e }) => /* @__PURE__ */ t("span", { className: "textRight", children: e }),
58
- link: ({ children: e, value: o }) => {
59
- var m;
60
- const { linkType: c, internalUrl: s, externalUrl: d, blank: h } = o;
61
- let i = "#";
62
- return c === "external" && d ? i = d : c === "internal" && ((m = s == null ? void 0 : s.slug) != null && m.current) && (i = `/${s == null ? void 0 : s.slug.current}`), /* @__PURE__ */ t(
58
+ link: ({ children: e, value: c }) => {
59
+ var p;
60
+ const { linkType: o, internalUrl: s, externalUrl: l, blank: g } = c;
61
+ let a = "#";
62
+ return o === "external" && l ? a = l : o === "internal" && ((p = s == null ? void 0 : s.slug) != null && p.current) && (a = `/${s == null ? void 0 : s.slug.current}`), /* @__PURE__ */ t(
63
63
  "a",
64
64
  {
65
- href: i,
66
- target: h ? "_blank" : void 0,
67
- rel: c === "external" ? "noopener noreferrer" : void 0,
68
- className: l.richTextLink,
65
+ href: a,
66
+ target: g ? "_blank" : void 0,
67
+ rel: o === "external" ? "noopener noreferrer" : void 0,
68
+ className: m.richTextLink,
69
69
  children: e
70
70
  }
71
71
  );
72
72
  },
73
- textSize: ({ children: e, value: o }) => {
74
- const c = o != null && o.size ? `text-${o.size}` : "";
75
- return /* @__PURE__ */ t("span", { className: c, children: e });
73
+ textSize: ({ children: e, value: c }) => {
74
+ const o = c != null && c.size ? `text-${c.size}` : "";
75
+ return /* @__PURE__ */ t("span", { className: o, children: e });
76
76
  },
77
77
  inlineCode: ({ children: e }) => /* @__PURE__ */ t("code", { children: e })
78
78
  },
79
- block: f,
79
+ block: k,
80
80
  list: {
81
81
  bullet: ({ children: e = [] }) => {
82
- const o = y.Children.count(e);
82
+ const c = S.Children.count(e);
83
83
  return /* @__PURE__ */ t(
84
84
  "ul",
85
85
  {
86
86
  style: {
87
- columnCount: u ? 1 : o > 7 ? 2 : 1
87
+ columnCount: h ? 1 : c > 7 ? 2 : 1
88
88
  },
89
- className: n,
89
+ className: r,
90
90
  children: e
91
91
  }
92
92
  );
@@ -94,101 +94,114 @@ import '../../../assets/index15.css';const C = "_container_1bbre_1", P = "_divid
94
94
  },
95
95
  types: {
96
96
  image: ({ value: e }) => {
97
- var c, s, d, h, i, p, m;
97
+ var o, s, l, g, a, u, p;
98
98
  if (!(e != null && e.imageUrls)) return null;
99
- const o = ((c = e.asset) == null ? void 0 : c.altText) || "Content image";
100
- return /* @__PURE__ */ b("figure", { className: `${n} ${l.richTextImage}`, children: [
99
+ const c = ((o = e.asset) == null ? void 0 : o.altText) || "Content image";
100
+ return /* @__PURE__ */ T("figure", { className: `${r} ${m.richTextImage}`, children: [
101
101
  /* @__PURE__ */ t(
102
- I,
102
+ C,
103
103
  {
104
104
  src: e.imageUrls.medium,
105
- alt: o,
105
+ alt: c,
106
106
  width: 1e3,
107
107
  height: 800,
108
108
  style: { maxWidth: "100%", height: "auto" }
109
109
  }
110
110
  ),
111
- (((s = e.asset) == null ? void 0 : s.title) || ((d = e.asset) == null ? void 0 : d.description)) && /* @__PURE__ */ b("figcaption", { children: [
112
- ((h = e.asset) == null ? void 0 : h.title) && /* @__PURE__ */ t("strong", { children: (i = e.asset) == null ? void 0 : i.title }),
113
- ((p = e.asset) == null ? void 0 : p.description) && /* @__PURE__ */ t("p", { children: (m = e.asset) == null ? void 0 : m.description })
111
+ (((s = e.asset) == null ? void 0 : s.title) || ((l = e.asset) == null ? void 0 : l.description)) && /* @__PURE__ */ T("figcaption", { children: [
112
+ ((g = e.asset) == null ? void 0 : g.title) && /* @__PURE__ */ t("strong", { children: (a = e.asset) == null ? void 0 : a.title }),
113
+ ((u = e.asset) == null ? void 0 : u.description) && /* @__PURE__ */ t("p", { children: (p = e.asset) == null ? void 0 : p.description })
114
114
  ] })
115
115
  ] });
116
116
  },
117
- divider: () => /* @__PURE__ */ t("hr", { className: l.divider }),
117
+ divider: () => /* @__PURE__ */ t("hr", { className: m.divider }),
118
118
  spacer: ({ value: e }) => {
119
- const o = (e == null ? void 0 : e.style) || "medium", c = {
120
- small: l.spacerSmall,
121
- medium: l.spacerMedium,
122
- large: l.spacerLarge
119
+ const c = (e == null ? void 0 : e.style) || "medium", o = {
120
+ small: m.spacerSmall,
121
+ medium: m.spacerMedium,
122
+ large: m.spacerLarge
123
123
  };
124
- return /* @__PURE__ */ t("span", { className: `${c[o] ?? l.spacerMedium}` });
124
+ return /* @__PURE__ */ t("span", { className: `${o[c] ?? m.spacerMedium}` });
125
125
  },
126
126
  table: ({ value: e }) => {
127
- var h;
128
- if (!((h = e == null ? void 0 : e.rows) != null && h.length)) return null;
129
- const o = e.rows[0], c = e.rows.slice(1), s = o.cells.map((i, p) => ({
130
- header: /* @__PURE__ */ t(
131
- k,
132
- {
133
- value: i == null ? void 0 : i.content,
134
- components: T(
135
- n,
136
- a,
137
- r,
138
- g,
139
- u
140
- )
141
- }
142
- ),
143
- accessor: `col${p}`,
144
- cellRenderer: (m) => m ? /* @__PURE__ */ t(
145
- k,
146
- {
147
- value: m,
148
- components: T(
149
- n,
150
- a,
151
- r,
152
- g,
153
- u
154
- )
155
- }
156
- ) : null
157
- })), d = c.map((i) => {
158
- var m;
159
- const p = {};
160
- return (m = i.cells) == null || m.forEach((x, N) => {
161
- p[`col${N}`] = x == null ? void 0 : x.content;
162
- }), p;
127
+ var u, p;
128
+ if (!((u = e == null ? void 0 : e.rows) != null && u.length)) return null;
129
+ const { hasHeadingRow: c } = e, o = c ? e.rows[0] : null, s = c ? e.rows.slice(1) : e.rows, l = o || s[0];
130
+ if (!((p = l == null ? void 0 : l.cells) != null && p.length)) return null;
131
+ const g = l.cells.map((N, _) => {
132
+ var b;
133
+ return {
134
+ header: o ? /* @__PURE__ */ t(
135
+ $,
136
+ {
137
+ value: (b = o.cells[_]) == null ? void 0 : b.content,
138
+ components: L(
139
+ r,
140
+ i,
141
+ n,
142
+ d,
143
+ h
144
+ )
145
+ }
146
+ ) : `Column ${_ + 1}`,
147
+ accessor: `col${_}`,
148
+ cellRenderer: (f) => f ? /* @__PURE__ */ t(
149
+ $,
150
+ {
151
+ value: f,
152
+ components: L(
153
+ r,
154
+ i,
155
+ n,
156
+ d,
157
+ h
158
+ )
159
+ }
160
+ ) : null
161
+ };
162
+ }), a = s.map((N) => {
163
+ var b;
164
+ const _ = {};
165
+ return (b = N.cells) == null || b.forEach((f, M) => {
166
+ _[`col${M}`] = f == null ? void 0 : f.content;
167
+ }), _;
163
168
  });
164
- return /* @__PURE__ */ t(E, { data: d, columns: s });
169
+ return /* @__PURE__ */ t(
170
+ j,
171
+ {
172
+ hasHeadingRow: c,
173
+ data: a,
174
+ columns: g,
175
+ className: `${r} ${c ? "hasHeadingRow" : ""}`
176
+ }
177
+ );
165
178
  }
166
179
  }
167
180
  };
168
- }, v = ({
169
- blocks: n,
170
- className: a,
171
- textOverride: r,
172
- animateText: g
181
+ }, ne = ({
182
+ blocks: r,
183
+ className: i,
184
+ textOverride: n,
185
+ animateText: d
173
186
  }) => {
174
- const u = j("(max-width: 767px)"), f = M(r);
175
- B(() => {
176
- f.current = r;
177
- }, [r]);
178
- const L = S(
179
- () => T(
180
- a,
181
- f,
182
- r,
183
- g,
184
- u
187
+ const h = H("(max-width: 767px)"), k = z(n);
188
+ E(() => {
189
+ k.current = n;
190
+ }, [n]);
191
+ const w = I(
192
+ () => L(
193
+ i,
194
+ k,
195
+ n,
196
+ d,
197
+ h
185
198
  ),
186
- [a, f, r, g, u]
199
+ [i, k, n, d, h]
187
200
  );
188
- return n ? typeof n == "string" ? (console.warn(
201
+ return r ? typeof r == "string" ? (console.warn(
189
202
  "RichText component received a string. Expected PortableTextBlock[]"
190
- ), /* @__PURE__ */ t($, { className: a, children: n })) : /* @__PURE__ */ t("div", { className: `${l.container} portableTextContainer`, children: /* @__PURE__ */ t(k, { value: n, components: L }) }) : null;
203
+ ), /* @__PURE__ */ t(y, { className: i, children: r })) : /* @__PURE__ */ t("div", { className: `${m.container} portableTextContainer`, children: /* @__PURE__ */ t($, { value: r, components: w }) }) : null;
191
204
  };
192
205
  export {
193
- v as RichText
206
+ ne as RichText
194
207
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "quirk-ui",
3
3
  "private": false,
4
- "version": "0.0.650",
4
+ "version": "0.0.651",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {