@caseparts-org/caseblocks 0.0.177 → 0.0.178

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