@caseparts-org/caseblocks 0.0.177 → 0.0.179

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.
@@ -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;
@@ -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,120 +1,121 @@
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";
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,
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
2
+ import { Image as B } from "../../atoms/Image/Image.js";
3
+ import { Link as A } from "../../atoms/Link/Link.js";
4
+ import { Text as n } from "../../atoms/Text/Text.js";
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 V } from "../../atoms/Icon/Icon.js";
9
+ import { c as P } from "../../clsx-OuTLNxxd.js";
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 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,
39
- imgSrc: n,
40
- attributes: u,
41
- className: C,
42
- onAddToCart: T,
43
- onClose: g,
44
- flat: v,
27
+ function er({
28
+ productView: j,
29
+ itemKey: s,
30
+ partNumber: c,
31
+ productDescription: h,
32
+ availDescription: x,
33
+ availId: m,
34
+ contactHref: b,
35
+ contactLinkBehavior: N,
36
+ productHref: f,
37
+ priceLabel: T,
38
+ price: l,
39
+ imgSrc: e,
40
+ attributes: p,
41
+ className: g,
42
+ onAddToCart: C,
43
+ onClose: v,
44
+ flat: I,
45
45
  size: a = "md",
46
- showQuantity: p = !0,
47
- ...I
46
+ showQuantity: _ = !0,
47
+ onLinkClicked: d,
48
+ ...w
48
49
  }) {
49
- const m = a === "sm" ? "xs" : "sm";
50
- return D === "Card" ? /* @__PURE__ */ o(
50
+ const u = 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,
58
- !n && r.noImage
57
+ g,
58
+ !I && r.elevated,
59
+ !e && r.noImage
59
60
  ),
60
- ...I,
61
+ ...w,
61
62
  children: [
62
- n && /* @__PURE__ */ t(
63
- w,
63
+ e && /* @__PURE__ */ t(
64
+ B,
64
65
  {
65
- src: n,
66
- alt: `${d} product image`,
66
+ src: e,
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: () => d == null ? void 0 : d(s), 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(n, { size: u, className: r.partNumberLabel, children: "Part #" }),
76
+ /* @__PURE__ */ t(n, { size: u, weight: "semibold", children: c })
76
77
  ] })
77
78
  ] }),
78
79
  /* @__PURE__ */ o("div", { className: r.purchaseInformation, children: [
79
- c && /* @__PURE__ */ t(
80
- L,
80
+ m && /* @__PURE__ */ t(
81
+ R,
81
82
  {
82
- availId: c,
83
- availDescription: h,
84
- contactHref: x,
85
- contactLinkBehavior: b
83
+ availId: m,
84
+ availDescription: x,
85
+ contactHref: b,
86
+ contactLinkBehavior: N
86
87
  }
87
88
  ),
88
- s && /* @__PURE__ */ t(A, { pricingLabel: f, price: s })
89
+ l && /* @__PURE__ */ t($, { pricingLabel: T, price: l })
89
90
  ] }),
90
91
  /* @__PURE__ */ t(
91
- R,
92
+ D,
92
93
  {
93
- itemKey: i,
94
- onAdd: T,
94
+ itemKey: s,
95
+ onAdd: C,
95
96
  className: r.addToCart,
96
97
  addButtonClassName: r.addToCartButton,
97
- addButtonVariant: p ? "cta-primary" : "secondary",
98
+ addButtonVariant: _ ? "cta-primary" : "secondary",
98
99
  size: a,
99
100
  buttonDoneText: "",
100
- buttonText: p ? "Add" : "Add to Cart",
101
- showQuantity: p
101
+ buttonText: _ ? "Add" : "Add to Cart",
102
+ showQuantity: _
102
103
  }
103
104
  )
104
105
  ]
105
106
  }
106
- ) : /* @__PURE__ */ o("div", { className: $(
107
+ ) : /* @__PURE__ */ o("div", { className: P(
107
108
  r.productTile,
108
- C,
109
+ g,
109
110
  a && r[a],
110
- !v && r.elevated,
111
- !n && r.noImage
112
- ), ...I, children: [
113
- n && /* @__PURE__ */ t(
114
- w,
111
+ !I && r.elevated,
112
+ !e && r.noImage
113
+ ), ...w, children: [
114
+ e && /* @__PURE__ */ t(
115
+ B,
115
116
  {
116
- src: n,
117
- alt: `${d} product image`,
117
+ src: e,
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, { onClick: () => d == null ? void 0 : d(s), 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(n, { size: u, className: r.partNumberLabel, children: "Part #" }),
129
+ /* @__PURE__ */ t(n, { size: u, 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(s), children: /* @__PURE__ */ t(V, { 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
+ m && /* @__PURE__ */ t(
137
+ R,
137
138
  {
138
- availId: c,
139
- availDescription: h,
140
- contactHref: x,
141
- contactLinkBehavior: b
139
+ availId: m,
140
+ availDescription: x,
141
+ contactHref: b,
142
+ contactLinkBehavior: N
142
143
  }
143
144
  ),
144
- s && /* @__PURE__ */ t(A, { pricingLabel: f, price: s })
145
+ l && /* @__PURE__ */ t($, { pricingLabel: T, price: l })
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: s, onAdd: C, 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
- /* @__PURE__ */ o(e, { size: "xs", weight: "light", children: [
150
- l.label,
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
+ 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(n, { 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
+ er 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.179",
5
5
  "type": "module",
6
6
  "module": "dist/main.js",
7
7
  "types": "dist/main.d.ts",