@caseparts-org/caseblocks 0.0.178 → 0.0.180

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.
@@ -6,5 +6,6 @@ export interface CardLinkProps {
6
6
  title: string;
7
7
  description: string;
8
8
  shortDescription: string;
9
+ onClick?: (event: React.MouseEvent<HTMLAnchorElement>) => void;
9
10
  }
10
- export declare function CardLink({ href, src, alt, callout, title, description, shortDescription, }: CardLinkProps): import("react/jsx-runtime").JSX.Element;
11
+ export declare function CardLink({ href, src, alt, callout, title, description, shortDescription, onClick, }: CardLinkProps): import("react/jsx-runtime").JSX.Element;
@@ -1,37 +1,38 @@
1
1
  import { jsx as a, jsxs as t } from "react/jsx-runtime";
2
2
  import { Text as r } from "../../atoms/Text/Text.js";
3
- import { Link as g } from "../../atoms/Link/Link.js";
4
- import { Image as _ } from "../../atoms/Image/Image.js";
5
- import '../../assets/CardLink.css';const u = "_card_g08nt_1", h = "_cardLink_g08nt_61", x = "_callout_g08nt_24", T = "_calloutText_g08nt_89", N = "_cardImage_g08nt_17", k = "_cardBody_g08nt_10", p = "_cardTitle_g08nt_127", y = "_cardDescription_g08nt_135", c = {
6
- card: u,
7
- cardLink: h,
8
- callout: x,
9
- calloutText: T,
10
- cardImage: N,
11
- cardBody: k,
12
- cardTitle: p,
13
- cardDescription: y
3
+ import { Link as _ } from "../../atoms/Link/Link.js";
4
+ import { Image as u } from "../../atoms/Image/Image.js";
5
+ import '../../assets/CardLink.css';const h = "_card_g08nt_1", x = "_cardLink_g08nt_61", T = "_callout_g08nt_24", N = "_calloutText_g08nt_89", k = "_cardImage_g08nt_17", p = "_cardBody_g08nt_10", y = "_cardTitle_g08nt_127", f = "_cardDescription_g08nt_135", c = {
6
+ card: h,
7
+ cardLink: x,
8
+ callout: T,
9
+ calloutText: N,
10
+ cardImage: k,
11
+ cardBody: p,
12
+ cardTitle: y,
13
+ cardDescription: f
14
14
  };
15
- function I({
15
+ function v({
16
16
  href: d,
17
17
  src: l,
18
18
  alt: i = "",
19
19
  callout: s = "Customize",
20
20
  title: n,
21
21
  description: o,
22
- shortDescription: e
22
+ shortDescription: e,
23
+ onClick: m
23
24
  }) {
24
- const m = e && e.length > 70 ? e.slice(0, 70) + "..." : e;
25
- return /* @__PURE__ */ a(g, { href: d, unstyled: !0, className: c.cardLink, children: /* @__PURE__ */ t("div", { className: c.card, children: [
26
- /* @__PURE__ */ a(_, { src: l, alt: i, width: 208, height: 104, className: c.cardImage }),
25
+ const g = e && e.length > 70 ? e.slice(0, 70) + "..." : e;
26
+ return /* @__PURE__ */ a(_, { href: d, unstyled: !0, className: c.cardLink, onClick: m, children: /* @__PURE__ */ t("div", { className: c.card, children: [
27
+ /* @__PURE__ */ a(u, { src: l, alt: i, width: 208, height: 104, className: c.cardImage }),
27
28
  /* @__PURE__ */ a("div", { className: c.callout, children: /* @__PURE__ */ a(r, { size: "xs", weight: "regular", colorToken: "default-inverted", className: c.calloutText, children: s }) }),
28
29
  /* @__PURE__ */ t("div", { className: c.cardBody, children: [
29
30
  /* @__PURE__ */ a(r, { size: "sm", weight: "regular", colorToken: "secondary", className: c.cardTitle, children: n }),
30
31
  /* @__PURE__ */ a(r, { size: "xs", weight: "regular", className: c.cardDescription, hideAt: ["sm"], children: o }),
31
- /* @__PURE__ */ a(r, { size: "xs", weight: "regular", className: c.cardDescription, hideAt: ["md", "lg"], children: m })
32
+ /* @__PURE__ */ a(r, { size: "xs", weight: "regular", className: c.cardDescription, hideAt: ["md", "lg"], children: g })
32
33
  ] })
33
34
  ] }) });
34
35
  }
35
36
  export {
36
- I as CardLink
37
+ v as CardLink
37
38
  };
@@ -5,7 +5,7 @@ export interface ProductProps extends AvailabilityProps {
5
5
  productView: ProductView;
6
6
  productDescription: string;
7
7
  availDescription: string;
8
- productHref: string;
8
+ productHref?: string;
9
9
  itemKey: number;
10
10
  partNumber: string;
11
11
  priceLabel: string;
@@ -1,120 +1,120 @@
1
1
  import { jsxs as o, jsx as t } from "react/jsx-runtime";
2
2
  import { Image as B } from "../../atoms/Image/Image.js";
3
3
  import { Link as A } from "../../atoms/Link/Link.js";
4
- import { Text as e } from "../../atoms/Text/Text.js";
4
+ import { Text as n } from "../../atoms/Text/Text.js";
5
5
  import { Availability as R } from "../../molecules/Availability/Availability.js";
6
6
  import { Pricing as $ } from "../../molecules/Pricing/Pricing.js";
7
7
  import { AddToCart as D } from "../../molecules/AddToCart/AddToCart.js";
8
- import { Icon as L } from "../../atoms/Icon/Icon.js";
8
+ import { Icon as V } from "../../atoms/Icon/Icon.js";
9
9
  import { c as P } from "../../clsx-OuTLNxxd.js";
10
- import '../../assets/Product.css';const V = "_productCard_nx8r7_3", q = "_sm_nx8r7_15", y = "_productInformation_nx8r7_25", E = "_purchaseInformation_nx8r7_32", F = "_addToCart_nx8r7_40", G = "_addToCartButton_nx8r7_43", J = "_partNumber_nx8r7_53", M = "_partNumberLabel_nx8r7_60", O = "_productTile_nx8r7_64", U = "_topRow_nx8r7_83", W = "_productData_nx8r7_114", X = "_purchase_nx8r7_32", Y = "_attributeContainer_nx8r7_151", Z = "_elevated_nx8r7_199", H = "_noImage_nx8r7_205", r = {
11
- productCard: V,
12
- sm: q,
13
- productInformation: y,
14
- purchaseInformation: E,
15
- addToCart: F,
16
- addToCartButton: G,
17
- partNumber: J,
18
- partNumberLabel: M,
19
- productTile: O,
20
- topRow: U,
21
- productData: W,
22
- purchase: X,
23
- attributeContainer: Y,
24
- elevated: Z,
25
- noImage: H
10
+ import '../../assets/Product.css';const q = "_productCard_nx8r7_3", E = "_sm_nx8r7_15", F = "_productInformation_nx8r7_25", G = "_purchaseInformation_nx8r7_32", J = "_addToCart_nx8r7_40", M = "_addToCartButton_nx8r7_43", O = "_partNumber_nx8r7_53", U = "_partNumberLabel_nx8r7_60", W = "_productTile_nx8r7_64", X = "_topRow_nx8r7_83", Y = "_productData_nx8r7_114", Z = "_purchase_nx8r7_32", y = "_attributeContainer_nx8r7_151", H = "_elevated_nx8r7_199", Q = "_noImage_nx8r7_205", r = {
11
+ productCard: q,
12
+ sm: E,
13
+ productInformation: F,
14
+ purchaseInformation: G,
15
+ addToCart: J,
16
+ addToCartButton: M,
17
+ partNumber: O,
18
+ partNumberLabel: U,
19
+ productTile: W,
20
+ topRow: X,
21
+ productData: Y,
22
+ purchase: Z,
23
+ attributeContainer: y,
24
+ elevated: H,
25
+ noImage: Q
26
26
  };
27
- function nr({
27
+ function er({
28
28
  productView: j,
29
- itemKey: d,
29
+ itemKey: s,
30
30
  partNumber: c,
31
31
  productDescription: h,
32
32
  availDescription: x,
33
- availId: s,
33
+ availId: m,
34
34
  contactHref: b,
35
35
  contactLinkBehavior: N,
36
36
  productHref: f,
37
- priceLabel: C,
38
- price: m,
39
- imgSrc: n,
40
- attributes: u,
41
- className: T,
42
- onAddToCart: g,
37
+ priceLabel: T,
38
+ price: l,
39
+ imgSrc: e,
40
+ attributes: p,
41
+ className: g,
42
+ onAddToCart: C,
43
43
  onClose: v,
44
44
  flat: I,
45
45
  size: a = "md",
46
- showQuantity: p = !0,
47
- onLinkClicked: _,
46
+ showQuantity: _ = !0,
47
+ onLinkClicked: d,
48
48
  ...w
49
49
  }) {
50
- const l = a === "sm" ? "xs" : "sm";
50
+ const u = a === "sm" ? "xs" : "sm";
51
51
  return j === "Card" ? /* @__PURE__ */ o(
52
52
  "div",
53
53
  {
54
54
  className: P(
55
55
  r.productCard,
56
56
  a && r[a],
57
- T,
57
+ g,
58
58
  !I && r.elevated,
59
- !n && r.noImage
59
+ !e && r.noImage
60
60
  ),
61
61
  ...w,
62
62
  children: [
63
- n && /* @__PURE__ */ t(
63
+ e && /* @__PURE__ */ t(
64
64
  B,
65
65
  {
66
- src: n,
66
+ src: e,
67
67
  alt: `${c} product image`,
68
68
  height: a === "sm" ? 78 : 96,
69
69
  width: a === "sm" ? 78 : 96
70
70
  }
71
71
  ),
72
72
  /* @__PURE__ */ o("div", { className: r.productInformation, children: [
73
- /* @__PURE__ */ t(A, { onClick: () => _ == null ? void 0 : _(d), size: a, href: f, children: h }),
73
+ /* @__PURE__ */ t(A, { onClick: () => d == null ? void 0 : d(s), size: a, href: f || "#", children: h }),
74
74
  /* @__PURE__ */ o("div", { className: r.partNumber, children: [
75
- /* @__PURE__ */ t(e, { size: l, className: r.partNumberLabel, children: "Part #" }),
76
- /* @__PURE__ */ t(e, { size: l, weight: "semibold", children: c })
75
+ /* @__PURE__ */ t(n, { size: u, className: r.partNumberLabel, children: "Part #" }),
76
+ /* @__PURE__ */ t(n, { size: u, weight: "semibold", children: c })
77
77
  ] })
78
78
  ] }),
79
79
  /* @__PURE__ */ o("div", { className: r.purchaseInformation, children: [
80
- s && /* @__PURE__ */ t(
80
+ m && /* @__PURE__ */ t(
81
81
  R,
82
82
  {
83
- availId: s,
83
+ availId: m,
84
84
  availDescription: x,
85
85
  contactHref: b,
86
86
  contactLinkBehavior: N
87
87
  }
88
88
  ),
89
- m && /* @__PURE__ */ t($, { pricingLabel: C, price: m })
89
+ l && /* @__PURE__ */ t($, { pricingLabel: T, price: l })
90
90
  ] }),
91
91
  /* @__PURE__ */ t(
92
92
  D,
93
93
  {
94
- itemKey: d,
95
- onAdd: g,
94
+ itemKey: s,
95
+ onAdd: C,
96
96
  className: r.addToCart,
97
97
  addButtonClassName: r.addToCartButton,
98
- addButtonVariant: p ? "cta-primary" : "secondary",
98
+ addButtonVariant: _ ? "cta-primary" : "secondary",
99
99
  size: a,
100
100
  buttonDoneText: "",
101
- buttonText: p ? "Add" : "Add to Cart",
102
- showQuantity: p
101
+ buttonText: _ ? "Add" : "Add to Cart",
102
+ showQuantity: _
103
103
  }
104
104
  )
105
105
  ]
106
106
  }
107
107
  ) : /* @__PURE__ */ o("div", { className: P(
108
108
  r.productTile,
109
- T,
109
+ g,
110
110
  a && r[a],
111
111
  !I && r.elevated,
112
- !n && r.noImage
112
+ !e && r.noImage
113
113
  ), ...w, children: [
114
- n && /* @__PURE__ */ t(
114
+ e && /* @__PURE__ */ t(
115
115
  B,
116
116
  {
117
- src: n,
117
+ src: e,
118
118
  alt: `${c} product image`,
119
119
  height: a === "sm" ? 86 : 108,
120
120
  width: a === "sm" ? 86 : 108
@@ -123,39 +123,39 @@ function nr({
123
123
  /* @__PURE__ */ o("div", { className: r.productData, children: [
124
124
  /* @__PURE__ */ o("div", { className: r.topRow, children: [
125
125
  /* @__PURE__ */ o("div", { className: r.productInformation, children: [
126
- /* @__PURE__ */ t(A, { size: a, href: f, children: h }),
126
+ /* @__PURE__ */ t(A, { onClick: () => d == null ? void 0 : d(s), size: a, href: f || "#", children: h }),
127
127
  /* @__PURE__ */ o("div", { className: r.partNumber, children: [
128
- /* @__PURE__ */ t(e, { size: l, className: r.partNumberLabel, children: "Part #" }),
129
- /* @__PURE__ */ t(e, { size: l, weight: "semibold", children: c })
128
+ /* @__PURE__ */ t(n, { size: u, className: r.partNumberLabel, children: "Part #" }),
129
+ /* @__PURE__ */ t(n, { size: u, weight: "semibold", children: c })
130
130
  ] })
131
131
  ] }),
132
- v && /* @__PURE__ */ t("button", { onClick: () => v(d), children: /* @__PURE__ */ t(L, { size: "sm", iconKey: "fa-light fa-xmark" }) })
132
+ v && /* @__PURE__ */ t("button", { onClick: () => v(s), children: /* @__PURE__ */ t(V, { size: "sm", iconKey: "fa-light fa-xmark" }) })
133
133
  ] }),
134
134
  /* @__PURE__ */ o("div", { className: r.purchase, children: [
135
135
  /* @__PURE__ */ o("div", { className: r.purchaseInformation, children: [
136
- s && /* @__PURE__ */ t(
136
+ m && /* @__PURE__ */ t(
137
137
  R,
138
138
  {
139
- availId: s,
139
+ availId: m,
140
140
  availDescription: x,
141
141
  contactHref: b,
142
142
  contactLinkBehavior: N
143
143
  }
144
144
  ),
145
- m && /* @__PURE__ */ t($, { pricingLabel: C, price: m })
145
+ l && /* @__PURE__ */ t($, { pricingLabel: T, price: l })
146
146
  ] }),
147
- /* @__PURE__ */ t(D, { size: a, itemKey: d, onAdd: g, className: r.addToCart, addButtonClassName: r.addToCartButton })
147
+ /* @__PURE__ */ t(D, { size: a, itemKey: s, onAdd: C, className: r.addToCart, addButtonClassName: r.addToCartButton })
148
148
  ] }),
149
- u && u.length > 0 && /* @__PURE__ */ t("ul", { className: r.attributeContainer, children: u.map((i) => /* @__PURE__ */ o("li", { children: [
150
- /* @__PURE__ */ o(e, { size: "xs", weight: "light", children: [
149
+ p && p.length > 0 && /* @__PURE__ */ t("ul", { className: r.attributeContainer, children: p.map((i) => /* @__PURE__ */ o("li", { children: [
150
+ /* @__PURE__ */ o(n, { size: "xs", weight: "light", children: [
151
151
  i.label,
152
152
  ":"
153
153
  ] }),
154
- /* @__PURE__ */ t(e, { size: "xs", weight: "semibold", children: i.value })
154
+ /* @__PURE__ */ t(n, { size: "xs", weight: "semibold", children: i.value })
155
155
  ] }, `${i.label}.${i.value}`)) })
156
156
  ] })
157
157
  ] });
158
158
  }
159
159
  export {
160
- nr as Product
160
+ er as Product
161
161
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@caseparts-org/caseblocks",
3
3
  "private": false,
4
- "version": "0.0.178",
4
+ "version": "0.0.180",
5
5
  "type": "module",
6
6
  "module": "dist/main.js",
7
7
  "types": "dist/main.d.ts",