umwd-components 0.1.850 → 0.1.852

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.
@@ -3,4 +3,4 @@
3
3
  * @copyright Jelle Paulus
4
4
  * @license MIT
5
5
  */
6
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("@mui/material/Grid"),i=require("@mui/material/Card"),t=require("@mui/material/Button"),a=require("@mui/material/Typography"),s=require("@mui/material/Box"),n=require("./ProductCard.js"),l=require("../../common/markdown/MarkdownDisplay.js");exports.default=function({category:d,sx:o=[]}){const{title:c,description:u,slug:m,products:x}=d;return e.jsx(i,{sx:[{width:"100%",height:"100%",pt:2,pl:2,pb:2,mb:2},...Array.isArray(o)?o:[o]],children:e.jsxs(r,{container:!0,spacing:2,size:12,children:[e.jsxs(r,{sx:{display:"flex",justifyContent:"start",alignItems:"center",gap:2,flexDirection:"column"},size:{xs:12,sm:6,md:3},children:[e.jsx(a,{variant:"h4",component:"h1",align:"center",children:c}),u&&e.jsx(s,{sx:{textAlign:"center",p:2,overflow:"hidden"},children:e.jsx(l.default,{children:u})}),e.jsxs(t,{variant:"contained",color:"primary",href:`/shop/categories/${m}`,children:["See all ",d.title]}),x.data.length-3>0&&e.jsxs(a,{variant:"body2",children:[x.data.length-3," more..."]})]}),x.data.slice(0,3).map(i=>e.jsx(r,{size:{xs:12,sm:6,md:3},children:e.jsx(n.default,{product:i},i.documentId)}))]})})};
6
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("@mui/material/Grid"),i=require("@mui/material/Card"),t=require("@mui/material/Button"),s=require("@mui/material/Typography"),a=require("@mui/material/Box"),n=require("./ProductCard.js"),l=require("../../common/markdown/MarkdownDisplay.js");exports.default=function({category:d,sx:o=[]}){const{title:c,description:u,slug:m,products:x}=d,h=Array.isArray(x)?x:x.data;return e.jsx(i,{sx:[{width:"100%",height:"100%",pt:2,pl:2,pb:2,mb:2},...Array.isArray(o)?o:[o]],children:e.jsxs(r,{container:!0,spacing:2,size:12,children:[e.jsxs(r,{sx:{display:"flex",justifyContent:"start",alignItems:"center",gap:2,flexDirection:"column"},size:{xs:12,sm:6,md:3},children:[e.jsx(s,{variant:"h4",component:"h1",align:"center",children:c}),u&&e.jsx(a,{sx:{textAlign:"center",p:2,overflow:"hidden"},children:e.jsx(l.default,{children:u})}),e.jsxs(t,{variant:"contained",color:"primary",href:`/shop/categories/${m}`,children:["See all ",d.title]}),h.length-3>0&&e.jsxs(s,{variant:"body2",children:[h.length-3," more..."]})]}),h.slice(0,3).map(i=>e.jsx(r,{size:{xs:12,sm:6,md:3},children:e.jsx(n.default,{product:i})},i.documentId))]})})};
@@ -1,4 +1,4 @@
1
- declare function descendingComparator<T>(a: T, b: T, orderBy: keyof T): 1 | 0 | -1;
1
+ declare function descendingComparator<T>(a: T, b: T, orderBy: keyof T): 0 | 1 | -1;
2
2
  type Order = "asc" | "desc";
3
3
  declare function getComparator<Key extends keyof any>(order: Order, orderBy: Key): (a: {
4
4
  [key in Key]: number | string;
@@ -5,7 +5,7 @@ interface ProductCategoryCardProps {
5
5
  title: string;
6
6
  description: string;
7
7
  slug: string;
8
- products: {
8
+ products: ExtendedProduct[] | {
9
9
  data: ExtendedProduct[];
10
10
  };
11
11
  };
@@ -36,11 +36,11 @@ declare const schemaUpdate: z.ZodObject<{
36
36
  }, "strip", z.ZodTypeAny, {
37
37
  id: string;
38
38
  __component: string;
39
+ title?: string | undefined;
39
40
  link?: {
40
41
  text?: string | undefined;
41
42
  url?: string | undefined;
42
43
  } | undefined;
43
- title?: string | undefined;
44
44
  heading?: string | undefined;
45
45
  subHeading?: string | undefined;
46
46
  subtitle?: string | undefined;
@@ -52,11 +52,11 @@ declare const schemaUpdate: z.ZodObject<{
52
52
  }, {
53
53
  id: string;
54
54
  __component: string;
55
+ title?: string | undefined;
55
56
  link?: {
56
57
  text?: string | undefined;
57
58
  url?: string | undefined;
58
59
  } | undefined;
59
- title?: string | undefined;
60
60
  heading?: string | undefined;
61
61
  subHeading?: string | undefined;
62
62
  subtitle?: string | undefined;
@@ -67,17 +67,17 @@ declare const schemaUpdate: z.ZodObject<{
67
67
  } | undefined;
68
68
  }>, "many">>;
69
69
  }, "strip", z.ZodTypeAny, {
70
- documentId: string;
71
70
  title: string;
72
71
  description: string;
72
+ documentId: string;
73
73
  blocks?: {
74
74
  id: string;
75
75
  __component: string;
76
+ title?: string | undefined;
76
77
  link?: {
77
78
  text?: string | undefined;
78
79
  url?: string | undefined;
79
80
  } | undefined;
80
- title?: string | undefined;
81
81
  heading?: string | undefined;
82
82
  subHeading?: string | undefined;
83
83
  subtitle?: string | undefined;
@@ -88,17 +88,17 @@ declare const schemaUpdate: z.ZodObject<{
88
88
  } | undefined;
89
89
  }[] | undefined;
90
90
  }, {
91
- documentId: string;
92
91
  title: string;
93
92
  description: string;
93
+ documentId: string;
94
94
  blocks?: {
95
95
  id: string;
96
96
  __component: string;
97
+ title?: string | undefined;
97
98
  link?: {
98
99
  text?: string | undefined;
99
100
  url?: string | undefined;
100
101
  } | undefined;
101
- title?: string | undefined;
102
102
  heading?: string | undefined;
103
103
  subHeading?: string | undefined;
104
104
  subtitle?: string | undefined;
@@ -16,6 +16,7 @@ import MarkdownDisplay from '../../common/markdown/MarkdownDisplay.js';
16
16
  function ProductCategoryCard({ category, sx = [] }) {
17
17
  const { title, description, slug, products } = category;
18
18
  const PRODUCTS_PER_CATEGORY = 3;
19
+ const productArray = Array.isArray(products) ? products : products.data;
19
20
  return (jsx(Card, { sx: [
20
21
  // You cannot spread `sx` directly because `SxProps` (typeof sx) can be an array.
21
22
  { width: "100%", height: "100%", pt: 2, pl: 2, pb: 2, mb: 2 },
@@ -30,11 +31,11 @@ function ProductCategoryCard({ category, sx = [] }) {
30
31
  xs: 12,
31
32
  sm: 6,
32
33
  md: 3
33
- }, children: [jsx(Typography, { variant: "h4", component: "h1", align: "center", children: title }), description && (jsx(Box, { sx: { textAlign: "center", p: 2, overflow: "hidden" }, children: jsx(MarkdownDisplay, { children: description }) })), jsxs(Button, { variant: "contained", color: "primary", href: `/shop/categories/${slug}`, children: ["See all ", category.title] }), products.data.length - PRODUCTS_PER_CATEGORY > 0 && (jsxs(Typography, { variant: "body2", children: [products.data.length - PRODUCTS_PER_CATEGORY, " more..."] }))] }), products.data.slice(0, PRODUCTS_PER_CATEGORY).map((product) => (jsx(Grid, { size: {
34
+ }, children: [jsx(Typography, { variant: "h4", component: "h1", align: "center", children: title }), description && (jsx(Box, { sx: { textAlign: "center", p: 2, overflow: "hidden" }, children: jsx(MarkdownDisplay, { children: description }) })), jsxs(Button, { variant: "contained", color: "primary", href: `/shop/categories/${slug}`, children: ["See all ", category.title] }), productArray.length - PRODUCTS_PER_CATEGORY > 0 && (jsxs(Typography, { variant: "body2", children: [productArray.length - PRODUCTS_PER_CATEGORY, " more..."] }))] }), productArray.slice(0, PRODUCTS_PER_CATEGORY).map((product) => (jsx(Grid, { size: {
34
35
  xs: 12,
35
36
  sm: 6,
36
37
  md: 3
37
- }, children: jsx(ProductCard, { product: product }, product.documentId) })))] }) }));
38
+ }, children: jsx(ProductCard, { product: product }) }, product.documentId)))] }) }));
38
39
  }
39
40
 
40
41
  export { ProductCategoryCard as default };