quirk-ui 0.0.478 → 0.0.479

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"});const e=require("react/jsx-runtime"),o=require("react"),B=require("../../ui/PortableTextRenderer/index.cjs"),G=require("../../hooks/useStyleClasses.cjs"),X=require("../../contexts/LocaleBridge.cjs"),b=require("../../../index-DpYgzTme.cjs"),J=require("../../../core/components/Input/index.cjs"),K=require("../../../core/components/Select/index.cjs"),Q=require("../../cards/BlogArticleCard/index.cjs"),s=require("../../../CategoryFilters-CJsgwMGz.cjs"),V=require("../../../x-Dft9NVe_.cjs"),Y=[{label:"Newest",value:"date-desc"},{label:"Oldest",value:"date-asc"},{label:"Title A-Z",value:"title-asc"},{label:"Title Z-A",value:"title-desc"},{label:"Most Popular",value:"popular-desc"}];function F({heading:l,layout:P="grid",includeFilters:y,excludeFilters:x,limit:C=3,categoryFilters:d,documentType:_,styleOptions:$}){const[N,r]=o.useState([]),[M,z]=o.useState(null),[g,D]=o.useState("date-desc"),[f,L]=o.useState(()=>typeof window>"u"?[]:Array.from(new URLSearchParams(window.location.search).getAll("categories"))),[S]=o.useState(()=>typeof window>"u"?null:new URLSearchParams(window.location.search).get("type")),[T,c]=o.useState(0),[i,A]=o.useState(!1),[m,h]=o.useState(!1),[k,n]=o.useState(!0),[u,w]=o.useState(""),[v,I]=o.useState(""),{locale:H}=X.useLocaleBridge(),O=G.useStyleClasses($),U={list:s.styles.list}[P??"grid"],W=t=>{D(t.target.value),r([]),c(0),n(!0)},q=()=>{h(!m)},Z=()=>{r([]),c(0),n(!0),L([]),w(""),h(!1)},R=async()=>{if(i||!k)return;A(!0);const t=new URLSearchParams({start:String(T),limit:String(C),sort:g,documentType:_,locale:H});S&&t.append("type",S),v&&t.append("search",v),f.forEach(a=>t.append("categories",a)),y==null||y.forEach(a=>t.append("include",a._id)),x==null||x.forEach(a=>t.append("exclude",a._id));try{const p=await(await fetch(`/api/articles?${t.toString()}`,{method:"GET"})).json();r(j=>[...j,...p.articles]),c(j=>j+C),z(p.totalCount),T+p.articles.length>=p.totalCount&&n(!1)}catch(a){console.error("Failed to load articles:",a),n(!1)}finally{A(!1)}},E=o.useCallback(()=>{typeof window<"u"&&window.innerWidth>768&&(h(!1),typeof document<"u"&&(document.body.style.overflow=""))},[]);return o.useEffect(()=>{const t=typeof window<"u";return t&&window.addEventListener("resize",E),()=>{t&&window.removeEventListener("resize",E)}},[]),o.useEffect(()=>{if(typeof document<"u")return document.body.style.overflow=m?"hidden":"",()=>{document.body.style.overflow=""}},[m]),o.useEffect(()=>{const t=setTimeout(()=>{I(u)},1e3);return()=>clearTimeout(t)},[u]),o.useEffect(()=>{r([]),c(0),n(!0),R()},[v,g,f.join(","),S]),e.jsx("section",{className:`${s.styles.documentList} ${O}`,children:e.jsxs("article",{className:s.styles.container,children:[e.jsxs("div",{className:s.styles.heading,children:[(l==null?void 0:l.title)&&e.jsx(B.RichText,{blocks:l==null?void 0:l.title}),(l==null?void 0:l.description)&&e.jsx(B.RichText,{blocks:l==null?void 0:l.description})]}),e.jsxs("div",{className:s.styles.listContainer,children:[(d==null?void 0:d.length)&&e.jsxs("div",{className:s.styles.filterToggle,children:[e.jsx(b.CallToAction,{as:"button",variant:"secondary",onClick:q,disabled:i,icon:"settings",iconAlignment:"left",children:"Filters"}),e.jsx(b.CallToAction,{as:"button",variant:"link",onClick:Z,disabled:i||f.length===0&&u.length===0,children:"Reset"})]}),d&&e.jsx(s.CategoryFilters,{categoryFilters:d,selectedCategories:f,setSelectedCategories:L,setArticles:r,setStart:c,setHasMore:n,showFilters:m,toggleFilters:q,isLoading:i}),e.jsxs("div",{className:s.styles.listWrapper,children:[e.jsxs("div",{className:s.styles.listHeader,children:[e.jsxs("div",{className:s.styles.listResults,children:["Results: ",e.jsx("span",{children:M})]}),e.jsxs("div",{className:s.styles.listHeaderFilters,children:[e.jsxs("div",{className:s.styles.listSearch,children:[e.jsx(J.Input,{type:"text",name:"list-search",placeholder:"Search articles",value:u,onChange:t=>{w(t.target.value),r([]),c(0),n(!0)}}),u&&e.jsx("button",{className:s.styles.clearSearch,onClick:()=>{w(""),r([]),c(0),n(!0)},children:e.jsx(V.X,{size:21})})]}),e.jsx("div",{className:s.styles.listSort,children:e.jsx(K.Select,{id:"list-sort",name:"list-sort",options:Y,onChange:W})})]})]}),e.jsx("div",{className:`${s.styles.list} ${U}`,children:N&&N.map(t=>_=="blog"&&e.jsx(Q.BlogArticleCard,{article:t},t._id))}),k&&e.jsx("div",{className:s.styles.loadMore,children:e.jsx(b.CallToAction,{as:"button",variant:"primary",onClick:R,disabled:i,icon:"refresh",iconAlignment:"left",className:i?s.styles.buttonIsLoading:"",children:i?"Loading...":"Load more"})})]})]})]})})}exports.DocumentListBlock=F;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("react"),R=require("../../ui/PortableTextRenderer/index.cjs"),Z=require("../../hooks/useStyleClasses.cjs"),G=require("../../contexts/LocaleBridge.cjs"),b=require("../../../index-DpYgzTme.cjs"),X=require("../../../core/components/Input/index.cjs"),J=require("../../../core/components/Select/index.cjs"),K=require("../../cards/BlogArticleCard/index.cjs"),t=require("../../../CategoryFilters-CJsgwMGz.cjs"),Q=require("../../../x-Dft9NVe_.cjs"),V=[{label:"Newest",value:"date-desc"},{label:"Oldest",value:"date-asc"},{label:"Title A-Z",value:"title-asc"},{label:"Title Z-A",value:"title-desc"},{label:"Most Popular",value:"popular-desc"}];function Y({heading:o,layout:B="grid",includeFilters:y,excludeFilters:p,limit:C=3,categoryFilters:d,documentType:w,styleOptions:$}){const[_,c]=l.useState([]),[P,M]=l.useState(null),[N,z]=l.useState("date-desc"),[f,g]=l.useState(()=>typeof window>"u"?[]:Array.from(new URLSearchParams(window.location.search).getAll("categories"))),[L,i]=l.useState(0),[a,A]=l.useState(!1),[m,h]=l.useState(!1),[T,r]=l.useState(!0),[u,S]=l.useState(""),[v,D]=l.useState(""),{locale:I}=G.useLocaleBridge(),H=Z.useStyleClasses($),O={list:t.styles.list}[B??"grid"],W=s=>{z(s.target.value),c([]),i(0),r(!0)},k=()=>{h(!m)},U=()=>{c([]),i(0),r(!0),g([]),S(""),h(!1)},q=async()=>{if(a||!T)return;A(!0);const s=new URLSearchParams({start:String(L),limit:String(C),sort:N,documentType:w,locale:I});v&&s.append("search",v),f.forEach(n=>s.append("categories",n)),y==null||y.forEach(n=>s.append("include",n._id)),p==null||p.forEach(n=>s.append("exclude",n._id));try{const x=await(await fetch(`/api/articles?${s.toString()}`,{method:"GET"})).json();c(j=>[...j,...x.articles]),i(j=>j+C),M(x.totalCount),L+x.articles.length>=x.totalCount&&r(!1)}catch(n){console.error("Failed to load articles:",n),r(!1)}finally{A(!1)}},E=l.useCallback(()=>{typeof window<"u"&&window.innerWidth>768&&(h(!1),typeof document<"u"&&(document.body.style.overflow=""))},[]);return l.useEffect(()=>{const s=typeof window<"u";return s&&window.addEventListener("resize",E),()=>{s&&window.removeEventListener("resize",E)}},[]),l.useEffect(()=>{if(typeof document<"u")return document.body.style.overflow=m?"hidden":"",()=>{document.body.style.overflow=""}},[m]),l.useEffect(()=>{const s=setTimeout(()=>{D(u)},1e3);return()=>clearTimeout(s)},[u]),l.useEffect(()=>{q()},[v,N,f.join(",")]),e.jsx("section",{className:`${t.styles.documentList} ${H}`,children:e.jsxs("article",{className:t.styles.container,children:[e.jsxs("div",{className:t.styles.heading,children:[(o==null?void 0:o.title)&&e.jsx(R.RichText,{blocks:o==null?void 0:o.title}),(o==null?void 0:o.description)&&e.jsx(R.RichText,{blocks:o==null?void 0:o.description})]}),e.jsxs("div",{className:t.styles.listContainer,children:[(d==null?void 0:d.length)&&e.jsxs("div",{className:t.styles.filterToggle,children:[e.jsx(b.CallToAction,{as:"button",variant:"secondary",onClick:k,disabled:a,icon:"settings",iconAlignment:"left",children:"Filters"}),e.jsx(b.CallToAction,{as:"button",variant:"link",onClick:U,disabled:a||f.length===0&&u.length===0,children:"Reset"})]}),d&&e.jsx(t.CategoryFilters,{categoryFilters:d,selectedCategories:f,setSelectedCategories:g,setArticles:c,setStart:i,setHasMore:r,showFilters:m,toggleFilters:k,isLoading:a}),e.jsxs("div",{className:t.styles.listWrapper,children:[e.jsxs("div",{className:t.styles.listHeader,children:[e.jsxs("div",{className:t.styles.listResults,children:["Results: ",e.jsx("span",{children:P})]}),e.jsxs("div",{className:t.styles.listHeaderFilters,children:[e.jsxs("div",{className:t.styles.listSearch,children:[e.jsx(X.Input,{type:"text",name:"list-search",placeholder:"Search articles",value:u,onChange:s=>{S(s.target.value),c([]),i(0),r(!0)}}),u&&e.jsx("button",{className:t.styles.clearSearch,onClick:()=>{S(""),c([]),i(0),r(!0)},children:e.jsx(Q.X,{size:21})})]}),e.jsx("div",{className:t.styles.listSort,children:e.jsx(J.Select,{id:"list-sort",name:"list-sort",options:V,onChange:W})})]})]}),e.jsx("div",{className:`${t.styles.list} ${O}`,children:_&&_.map(s=>w=="blog"&&e.jsx(K.BlogArticleCard,{article:s},s._id))}),T&&e.jsx("div",{className:t.styles.loadMore,children:e.jsx(b.CallToAction,{as:"button",variant:"primary",onClick:q,disabled:a,icon:"refresh",iconAlignment:"left",className:a?t.styles.buttonIsLoading:"",children:a?"Loading...":"Load more"})})]})]})]})})}exports.DocumentListBlock=Y;
@@ -1,190 +1,190 @@
1
- import { jsx as t, jsxs as a } from "react/jsx-runtime";
2
- import { useState as r, useCallback as J, useEffect as v } from "react";
3
- import { RichText as H } from "../../ui/PortableTextRenderer/index.mjs";
4
- import { useStyleClasses as K } from "../../hooks/useStyleClasses.mjs";
5
- import { useLocaleBridge as Q } from "../../contexts/LocaleBridge.mjs";
6
- import { C as g } from "../../../index-CIb65n0z.js";
7
- import { Input as V } from "../../../core/components/Input/index.mjs";
8
- import { Select as Y } from "../../../core/components/Select/index.mjs";
9
- import { BlogArticleCard as F } from "../../cards/BlogArticleCard/index.mjs";
10
- import { s, C as ee } from "../../../CategoryFilters-BrPk0efZ.js";
11
- import { X as te } from "../../../x-CnsEH4Ox.js";
12
- const se = [
1
+ import { jsx as t, jsxs as r } from "react/jsx-runtime";
2
+ import { useState as a, useCallback as X, useEffect as w } from "react";
3
+ import { RichText as B } from "../../ui/PortableTextRenderer/index.mjs";
4
+ import { useStyleClasses as J } from "../../hooks/useStyleClasses.mjs";
5
+ import { useLocaleBridge as K } from "../../contexts/LocaleBridge.mjs";
6
+ import { C as L } from "../../../index-CIb65n0z.js";
7
+ import { Input as Q } from "../../../core/components/Input/index.mjs";
8
+ import { Select as V } from "../../../core/components/Select/index.mjs";
9
+ import { BlogArticleCard as Y } from "../../cards/BlogArticleCard/index.mjs";
10
+ import { s, C as F } from "../../../CategoryFilters-BrPk0efZ.js";
11
+ import { X as ee } from "../../../x-CnsEH4Ox.js";
12
+ const te = [
13
13
  { label: "Newest", value: "date-desc" },
14
14
  { label: "Oldest", value: "date-asc" },
15
15
  { label: "Title A-Z", value: "title-asc" },
16
16
  { label: "Title Z-A", value: "title-desc" },
17
17
  { label: "Most Popular", value: "popular-desc" }
18
18
  ];
19
- function pe({
19
+ function ue({
20
20
  heading: o,
21
- layout: I = "grid",
21
+ layout: H = "grid",
22
22
  includeFilters: b,
23
23
  excludeFilters: C,
24
- limit: A = 3,
25
- categoryFilters: f,
26
- documentType: k,
24
+ limit: g = 3,
25
+ categoryFilters: m,
26
+ documentType: A,
27
27
  // filterMode,
28
- styleOptions: U
28
+ styleOptions: I
29
29
  }) {
30
- const [T, i] = r([]), [W, _] = r(null), [R, x] = r("date-desc"), [u, E] = r(() => typeof window > "u" ? [] : Array.from(
30
+ const [k, c] = a([]), [W, _] = a(null), [T, x] = a("date-desc"), [u, E] = a(() => typeof window > "u" ? [] : Array.from(
31
31
  new URLSearchParams(window.location.search).getAll("categories")
32
- )), [S] = r(() => typeof window > "u" ? null : new URLSearchParams(window.location.search).get("type")), [P, c] = r(0), [d, $] = r(!1), [p, h] = r(!1), [j, l] = r(!0), [m, y] = r(""), [N, D] = r(""), { locale: O } = Q(), Z = K(U), q = {
32
+ )), [R, d] = a(0), [n, $] = a(!1), [p, h] = a(!1), [j, i] = a(!0), [f, S] = a(""), [N, D] = a(""), { locale: O } = K(), U = J(I), Z = {
33
33
  //grid: styles.grid,
34
34
  list: s.list
35
- }[I ?? "grid"], G = (e) => {
36
- x(e.target.value), i([]), c(0), l(!0);
35
+ }[H ?? "grid"], q = (e) => {
36
+ x(e.target.value), c([]), d(0), i(!0);
37
37
  }, z = () => {
38
38
  h(!p);
39
- }, X = () => {
40
- i([]), c(0), l(!0), E([]), y(""), h(!1);
39
+ }, G = () => {
40
+ c([]), d(0), i(!0), E([]), S(""), h(!1);
41
41
  }, M = async () => {
42
- if (d || !j) return;
42
+ if (n || !j) return;
43
43
  $(!0);
44
44
  const e = new URLSearchParams({
45
- start: String(P),
46
- limit: String(A),
47
- sort: R,
48
- documentType: k,
45
+ start: String(R),
46
+ limit: String(g),
47
+ sort: T,
48
+ documentType: A,
49
49
  locale: O
50
50
  });
51
- S && e.append("type", S), N && e.append("search", N), u.forEach(
52
- (n) => e.append("categories", n)
51
+ N && e.append("search", N), u.forEach(
52
+ (l) => e.append("categories", l)
53
53
  ), b == null || b.forEach(
54
- (n) => e.append("include", n._id)
54
+ (l) => e.append("include", l._id)
55
55
  ), C == null || C.forEach(
56
- (n) => e.append("exclude", n._id)
56
+ (l) => e.append("exclude", l._id)
57
57
  );
58
58
  try {
59
- const w = await (await fetch(`/api/articles?${e.toString()}`, {
59
+ const v = await (await fetch(`/api/articles?${e.toString()}`, {
60
60
  method: "GET"
61
61
  })).json();
62
- i((L) => [...L, ...w.articles]), c((L) => L + A), _(w.totalCount), P + w.articles.length >= w.totalCount && l(!1);
63
- } catch (n) {
64
- console.error("Failed to load articles:", n), l(!1);
62
+ c((y) => [...y, ...v.articles]), d((y) => y + g), _(v.totalCount), R + v.articles.length >= v.totalCount && i(!1);
63
+ } catch (l) {
64
+ console.error("Failed to load articles:", l), i(!1);
65
65
  } finally {
66
66
  $(!1);
67
67
  }
68
- }, B = J(() => {
68
+ }, P = X(() => {
69
69
  typeof window < "u" && window.innerWidth > 768 && (h(!1), typeof document < "u" && (document.body.style.overflow = ""));
70
70
  }, []);
71
- return v(() => {
71
+ return w(() => {
72
72
  const e = typeof window < "u";
73
- return e && window.addEventListener("resize", B), () => {
74
- e && window.removeEventListener("resize", B);
73
+ return e && window.addEventListener("resize", P), () => {
74
+ e && window.removeEventListener("resize", P);
75
75
  };
76
- }, []), v(() => {
76
+ }, []), w(() => {
77
77
  if (typeof document < "u")
78
78
  return document.body.style.overflow = p ? "hidden" : "", () => {
79
79
  document.body.style.overflow = "";
80
80
  };
81
- }, [p]), v(() => {
81
+ }, [p]), w(() => {
82
82
  const e = setTimeout(() => {
83
- D(m);
83
+ D(f);
84
84
  }, 1e3);
85
85
  return () => clearTimeout(e);
86
- }, [m]), v(() => {
87
- i([]), c(0), l(!0), M();
88
- }, [N, R, u.join(","), S]), /* @__PURE__ */ t("section", { className: `${s.documentList} ${Z}`, children: /* @__PURE__ */ a("article", { className: s.container, children: [
89
- /* @__PURE__ */ a("div", { className: s.heading, children: [
90
- (o == null ? void 0 : o.title) && /* @__PURE__ */ t(H, { blocks: o == null ? void 0 : o.title }),
91
- (o == null ? void 0 : o.description) && /* @__PURE__ */ t(H, { blocks: o == null ? void 0 : o.description })
86
+ }, [f]), w(() => {
87
+ M();
88
+ }, [N, T, u.join(",")]), /* @__PURE__ */ t("section", { className: `${s.documentList} ${U}`, children: /* @__PURE__ */ r("article", { className: s.container, children: [
89
+ /* @__PURE__ */ r("div", { className: s.heading, children: [
90
+ (o == null ? void 0 : o.title) && /* @__PURE__ */ t(B, { blocks: o == null ? void 0 : o.title }),
91
+ (o == null ? void 0 : o.description) && /* @__PURE__ */ t(B, { blocks: o == null ? void 0 : o.description })
92
92
  ] }),
93
- /* @__PURE__ */ a("div", { className: s.listContainer, children: [
94
- (f == null ? void 0 : f.length) && /* @__PURE__ */ a("div", { className: s.filterToggle, children: [
93
+ /* @__PURE__ */ r("div", { className: s.listContainer, children: [
94
+ (m == null ? void 0 : m.length) && /* @__PURE__ */ r("div", { className: s.filterToggle, children: [
95
95
  /* @__PURE__ */ t(
96
- g,
96
+ L,
97
97
  {
98
98
  as: "button",
99
99
  variant: "secondary",
100
100
  onClick: z,
101
- disabled: d,
101
+ disabled: n,
102
102
  icon: "settings",
103
103
  iconAlignment: "left",
104
104
  children: "Filters"
105
105
  }
106
106
  ),
107
107
  /* @__PURE__ */ t(
108
- g,
108
+ L,
109
109
  {
110
110
  as: "button",
111
111
  variant: "link",
112
- onClick: X,
113
- disabled: d || u.length === 0 && m.length === 0,
112
+ onClick: G,
113
+ disabled: n || u.length === 0 && f.length === 0,
114
114
  children: "Reset"
115
115
  }
116
116
  )
117
117
  ] }),
118
- f && /* @__PURE__ */ t(
119
- ee,
118
+ m && /* @__PURE__ */ t(
119
+ F,
120
120
  {
121
- categoryFilters: f,
121
+ categoryFilters: m,
122
122
  selectedCategories: u,
123
123
  setSelectedCategories: E,
124
- setArticles: i,
125
- setStart: c,
126
- setHasMore: l,
124
+ setArticles: c,
125
+ setStart: d,
126
+ setHasMore: i,
127
127
  showFilters: p,
128
128
  toggleFilters: z,
129
- isLoading: d
129
+ isLoading: n
130
130
  }
131
131
  ),
132
- /* @__PURE__ */ a("div", { className: s.listWrapper, children: [
133
- /* @__PURE__ */ a("div", { className: s.listHeader, children: [
134
- /* @__PURE__ */ a("div", { className: s.listResults, children: [
132
+ /* @__PURE__ */ r("div", { className: s.listWrapper, children: [
133
+ /* @__PURE__ */ r("div", { className: s.listHeader, children: [
134
+ /* @__PURE__ */ r("div", { className: s.listResults, children: [
135
135
  "Results: ",
136
136
  /* @__PURE__ */ t("span", { children: W })
137
137
  ] }),
138
- /* @__PURE__ */ a("div", { className: s.listHeaderFilters, children: [
139
- /* @__PURE__ */ a("div", { className: s.listSearch, children: [
138
+ /* @__PURE__ */ r("div", { className: s.listHeaderFilters, children: [
139
+ /* @__PURE__ */ r("div", { className: s.listSearch, children: [
140
140
  /* @__PURE__ */ t(
141
- V,
141
+ Q,
142
142
  {
143
143
  type: "text",
144
144
  name: "list-search",
145
145
  placeholder: "Search articles",
146
- value: m,
146
+ value: f,
147
147
  onChange: (e) => {
148
- y(e.target.value), i([]), c(0), l(!0);
148
+ S(e.target.value), c([]), d(0), i(!0);
149
149
  }
150
150
  }
151
151
  ),
152
- m && /* @__PURE__ */ t(
152
+ f && /* @__PURE__ */ t(
153
153
  "button",
154
154
  {
155
155
  className: s.clearSearch,
156
156
  onClick: () => {
157
- y(""), i([]), c(0), l(!0);
157
+ S(""), c([]), d(0), i(!0);
158
158
  },
159
- children: /* @__PURE__ */ t(te, { size: 21 })
159
+ children: /* @__PURE__ */ t(ee, { size: 21 })
160
160
  }
161
161
  )
162
162
  ] }),
163
163
  /* @__PURE__ */ t("div", { className: s.listSort, children: /* @__PURE__ */ t(
164
- Y,
164
+ V,
165
165
  {
166
166
  id: "list-sort",
167
167
  name: "list-sort",
168
- options: se,
169
- onChange: G
168
+ options: te,
169
+ onChange: q
170
170
  }
171
171
  ) })
172
172
  ] })
173
173
  ] }),
174
- /* @__PURE__ */ t("div", { className: `${s.list} ${q}`, children: T && T.map(
175
- (e) => k == "blog" && /* @__PURE__ */ t(F, { article: e }, e._id)
174
+ /* @__PURE__ */ t("div", { className: `${s.list} ${Z}`, children: k && k.map(
175
+ (e) => A == "blog" && /* @__PURE__ */ t(Y, { article: e }, e._id)
176
176
  ) }),
177
177
  j && /* @__PURE__ */ t("div", { className: s.loadMore, children: /* @__PURE__ */ t(
178
- g,
178
+ L,
179
179
  {
180
180
  as: "button",
181
181
  variant: "primary",
182
182
  onClick: M,
183
- disabled: d,
183
+ disabled: n,
184
184
  icon: "refresh",
185
185
  iconAlignment: "left",
186
- className: d ? s.buttonIsLoading : "",
187
- children: d ? "Loading..." : "Load more"
186
+ className: n ? s.buttonIsLoading : "",
187
+ children: n ? "Loading..." : "Load more"
188
188
  }
189
189
  ) })
190
190
  ] })
@@ -192,5 +192,5 @@ function pe({
192
192
  ] }) });
193
193
  }
194
194
  export {
195
- pe as DocumentListBlock
195
+ ue as DocumentListBlock
196
196
  };
@@ -1,6 +1,6 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../assets/index68.css');const t=require("react/jsx-runtime"),_=require("next/image"),d=require("../../ui/LocaleLink/index.cjs"),g=require("../../../createLucideIcon-DpotSgUx.cjs");/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../assets/index68.css');const t=require("react/jsx-runtime"),f=require("next/image"),x=require("../../ui/LocaleLink/index.cjs"),y=require("../../../createLucideIcon-DpotSgUx.cjs");/**
2
2
  * @license lucide-react v0.488.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const h=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],f=g.createLucideIcon("arrow-up-right",h),u="_item_1fhn6_1",x="_itemImage_1fhn6_14",y="_itemTitle_1fhn6_20",p="_callToAction_1fhn6_26",j="_icon_1fhn6_33",v="_single_1fhn6_39",I="_first_1fhn6_40",T="_itemContent_1fhn6_41",N="_itemExcerpt_1fhn6_88",C="_imagePlaceholder_1fhn6_179",E="_category_1fhn6_227",b="_itemEyebrow_1fhn6_246",i={item:u,itemImage:x,itemTitle:y,callToAction:p,icon:j,single:v,first:I,itemContent:T,itemExcerpt:N,imagePlaceholder:C,category:E,itemEyebrow:b};function w({article:e,className:r="",index:a,limit:m}){var s,c,o;const l=`/blog/articles/${e.slug.current}`,n=(s=e.categories)!=null&&s.length?e.categories[0]:null;return t.jsxs(d.LocaleLink,{href:l,className:`${i.item} ${r??""} ${a===0?i.first:""} ${m===1?i.single:""}`,children:[t.jsxs("div",{className:i.itemImage,children:[e.articleType&&t.jsx("div",{className:i.category,children:e.articleType}),e.featuredImage&&e.featuredImage.imageUrl?t.jsx(_,{src:e.featuredImage.imageUrl??"",alt:((c=e.featuredImage)==null?void 0:c.asset.altText)||((o=e==null?void 0:e.featuredImage)==null?void 0:o.asset.description)||"Content image",width:600,height:400,priority:!0}):t.jsx("div",{className:i.imagePlaceholder})]}),t.jsxs("div",{className:i.itemContent,children:[n&&t.jsx("div",{className:i.itemEyebrow,children:n.title}),t.jsxs("div",{className:i.itemTitle,children:[t.jsx("h3",{children:e.title}),t.jsx("div",{className:i.callToAction,children:t.jsx("div",{className:i.icon,children:t.jsx(f,{size:45})})})]}),e.excerpt&&t.jsx("p",{className:i.itemExcerpt,children:e.excerpt})]})]})}exports.BlogArticleCard=w;
6
+ */const p=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],j=y.createLucideIcon("arrow-up-right",p),v="_item_1fhn6_1",I="_itemImage_1fhn6_14",N="_itemTitle_1fhn6_20",T="_callToAction_1fhn6_26",b="_icon_1fhn6_33",C="_single_1fhn6_39",E="_first_1fhn6_40",w="_itemContent_1fhn6_41",A="_itemExcerpt_1fhn6_88",$="_imagePlaceholder_1fhn6_179",L="_category_1fhn6_227",k="_itemEyebrow_1fhn6_246",i={item:v,itemImage:I,itemTitle:N,callToAction:T,icon:b,single:C,first:E,itemContent:w,itemExcerpt:A,imagePlaceholder:$,category:L,itemEyebrow:k};function q({article:e,className:_="",index:g,limit:h}){var a,l,m,d;const u=`/blog/articles/${e.slug.current}`,r=((a=e.categories)==null?void 0:a.find(c=>{var s,n;(n=(s=c.slug)==null?void 0:s.current)!=null&&n.startsWith("library/type")}))??null,o=(l=e.categories)==null?void 0:l.find(c=>{var s,n;(n=(s=c.slug)==null?void 0:s.current)==null||n.startsWith("library/type")});return t.jsxs(x.LocaleLink,{href:u,className:`${i.item} ${_??""} ${g===0?i.first:""} ${h===1?i.single:""}`,children:[t.jsxs("div",{className:i.itemImage,children:[o&&t.jsx("div",{className:i.category,children:o.title}),e.featuredImage&&e.featuredImage.imageUrl?t.jsx(f,{src:e.featuredImage.imageUrl??"",alt:((m=e.featuredImage)==null?void 0:m.asset.altText)||((d=e==null?void 0:e.featuredImage)==null?void 0:d.asset.description)||"Content image",width:600,height:400,priority:!0}):t.jsx("div",{className:i.imagePlaceholder})]}),t.jsxs("div",{className:i.itemContent,children:[r&&t.jsx("div",{className:i.itemEyebrow,children:r.title}),t.jsxs("div",{className:i.itemTitle,children:[t.jsx("h3",{children:e.title}),t.jsx("div",{className:i.callToAction,children:t.jsx("div",{className:i.icon,children:t.jsx(j,{size:45})})})]}),e.excerpt&&t.jsx("p",{className:i.itemExcerpt,children:e.excerpt})]})]})}exports.BlogArticleCard=q;
@@ -1,63 +1,69 @@
1
- import { jsxs as n, jsx as i } from "react/jsx-runtime";
2
- import h from "next/image";
3
- import { LocaleLink as g } from "../../ui/LocaleLink/index.mjs";
4
- import { c as d } from "../../../createLucideIcon-C8GTh_Qx.js";
1
+ import { jsxs as s, jsx as i } from "react/jsx-runtime";
2
+ import y from "next/image";
3
+ import { LocaleLink as u } from "../../ui/LocaleLink/index.mjs";
4
+ import { c as v } from "../../../createLucideIcon-C8GTh_Qx.js";
5
5
  import '../../../assets/index68.css';/**
6
6
  * @license lucide-react v0.488.0 - ISC
7
7
  *
8
8
  * This source code is licensed under the ISC license.
9
9
  * See the LICENSE file in the root directory of this source tree.
10
10
  */
11
- const f = [
11
+ const I = [
12
12
  ["path", { d: "M7 7h10v10", key: "1tivn9" }],
13
13
  ["path", { d: "M7 17 17 7", key: "1vkiza" }]
14
- ], p = d("arrow-up-right", f), y = "_item_1fhn6_1", u = "_itemImage_1fhn6_14", v = "_itemTitle_1fhn6_20", I = "_callToAction_1fhn6_26", N = "_icon_1fhn6_33", T = "_single_1fhn6_39", x = "_first_1fhn6_40", E = "_itemContent_1fhn6_41", w = "_itemExcerpt_1fhn6_88", C = "_imagePlaceholder_1fhn6_179", A = "_category_1fhn6_227", b = "_itemEyebrow_1fhn6_246", t = {
15
- item: y,
16
- itemImage: u,
17
- itemTitle: v,
18
- callToAction: I,
19
- icon: N,
20
- single: T,
21
- first: x,
22
- itemContent: E,
23
- itemExcerpt: w,
24
- imagePlaceholder: C,
25
- category: A,
26
- itemEyebrow: b
14
+ ], N = v("arrow-up-right", I), x = "_item_1fhn6_1", T = "_itemImage_1fhn6_14", C = "_itemTitle_1fhn6_20", E = "_callToAction_1fhn6_26", b = "_icon_1fhn6_33", w = "_single_1fhn6_39", A = "_first_1fhn6_40", $ = "_itemContent_1fhn6_41", k = "_itemExcerpt_1fhn6_88", P = "_imagePlaceholder_1fhn6_179", L = "_category_1fhn6_227", U = "_itemEyebrow_1fhn6_246", t = {
15
+ item: x,
16
+ itemImage: T,
17
+ itemTitle: C,
18
+ callToAction: E,
19
+ icon: b,
20
+ single: w,
21
+ first: A,
22
+ itemContent: $,
23
+ itemExcerpt: k,
24
+ imagePlaceholder: P,
25
+ category: L,
26
+ itemEyebrow: U
27
27
  };
28
- function U({
28
+ function B({
29
29
  article: e,
30
- className: a = "",
31
- index: r,
30
+ className: g = "",
31
+ index: d,
32
32
  //layout,
33
- limit: l
33
+ limit: f
34
34
  }) {
35
- var c, s, m;
36
- const _ = `/blog/articles/${e.slug.current}`, o = (c = e.categories) != null && c.length ? e.categories[0] : null;
37
- return /* @__PURE__ */ n(
38
- g,
35
+ var m, l, h, _;
36
+ const p = `/blog/articles/${e.slug.current}`, c = ((m = e.categories) == null ? void 0 : m.find((r) => {
37
+ var n, o;
38
+ (o = (n = r.slug) == null ? void 0 : n.current) != null && o.startsWith("library/type");
39
+ })) ?? null, a = (l = e.categories) == null ? void 0 : l.find((r) => {
40
+ var n, o;
41
+ (o = (n = r.slug) == null ? void 0 : n.current) == null || o.startsWith("library/type");
42
+ });
43
+ return /* @__PURE__ */ s(
44
+ u,
39
45
  {
40
- href: _,
41
- className: `${t.item} ${a ?? ""} ${r === 0 ? t.first : ""} ${l === 1 ? t.single : ""}`,
46
+ href: p,
47
+ className: `${t.item} ${g ?? ""} ${d === 0 ? t.first : ""} ${f === 1 ? t.single : ""}`,
42
48
  children: [
43
- /* @__PURE__ */ n("div", { className: t.itemImage, children: [
44
- e.articleType && /* @__PURE__ */ i("div", { className: t.category, children: e.articleType }),
49
+ /* @__PURE__ */ s("div", { className: t.itemImage, children: [
50
+ a && /* @__PURE__ */ i("div", { className: t.category, children: a.title }),
45
51
  e.featuredImage && e.featuredImage.imageUrl ? /* @__PURE__ */ i(
46
- h,
52
+ y,
47
53
  {
48
54
  src: e.featuredImage.imageUrl ?? "",
49
- alt: ((s = e.featuredImage) == null ? void 0 : s.asset.altText) || ((m = e == null ? void 0 : e.featuredImage) == null ? void 0 : m.asset.description) || "Content image",
55
+ alt: ((h = e.featuredImage) == null ? void 0 : h.asset.altText) || ((_ = e == null ? void 0 : e.featuredImage) == null ? void 0 : _.asset.description) || "Content image",
50
56
  width: 600,
51
57
  height: 400,
52
58
  priority: !0
53
59
  }
54
60
  ) : /* @__PURE__ */ i("div", { className: t.imagePlaceholder })
55
61
  ] }),
56
- /* @__PURE__ */ n("div", { className: t.itemContent, children: [
57
- o && /* @__PURE__ */ i("div", { className: t.itemEyebrow, children: o.title }),
58
- /* @__PURE__ */ n("div", { className: t.itemTitle, children: [
62
+ /* @__PURE__ */ s("div", { className: t.itemContent, children: [
63
+ c && /* @__PURE__ */ i("div", { className: t.itemEyebrow, children: c.title }),
64
+ /* @__PURE__ */ s("div", { className: t.itemTitle, children: [
59
65
  /* @__PURE__ */ i("h3", { children: e.title }),
60
- /* @__PURE__ */ i("div", { className: t.callToAction, children: /* @__PURE__ */ i("div", { className: t.icon, children: /* @__PURE__ */ i(p, { size: 45 }) }) })
66
+ /* @__PURE__ */ i("div", { className: t.callToAction, children: /* @__PURE__ */ i("div", { className: t.icon, children: /* @__PURE__ */ i(N, { size: 45 }) }) })
61
67
  ] }),
62
68
  e.excerpt && /* @__PURE__ */ i("p", { className: t.itemExcerpt, children: e.excerpt })
63
69
  ] })
@@ -66,5 +72,5 @@ function U({
66
72
  );
67
73
  }
68
74
  export {
69
- U as BlogArticleCard
75
+ B as BlogArticleCard
70
76
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "quirk-ui",
3
3
  "private": false,
4
- "version": "0.0.478",
4
+ "version": "0.0.479",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {