@caseparts-org/caseblocks 0.0.272 → 0.0.274

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
- ._pricingInformation_u1dqz_1{display:flex;flex-direction:column;align-items:flex-end}
1
+ ._pricingInformation_1bvkh_1{display:flex;flex-direction:column;align-items:flex-end}._prices_1bvkh_6{display:flex;flex-direction:column;align-self:flex-end;align-items:flex-end;margin-left:auto;gap:var(--spacing-spacing-4xs)}._priceRow_1bvkh_15{display:flex;align-items:center;justify-content:flex-end;gap:var(--spacing-spacing-3xs);white-space:nowrap}._discountedTotal_1bvkh_23{align-self:stretch;text-align:left}._totalPriceHidden_1bvkh_28{visibility:hidden}
@@ -1 +1 @@
1
- ._productCard_h4utb_3{box-sizing:border-box;position:relative;background:var(--surface-surface-primary, #FFF);display:flex;width:232px;height:296px;padding:var(--spacing-spacing-default, 16px) var(--spacing-spacing-sm, 20px);flex-direction:column;align-items:flex-start;gap:var(--spacing-spacing-2xs)}._productCard_h4utb_3._sm_h4utb_16{width:180px;height:230px}._productCard_h4utb_3>img{object-fit:contain;flex-shrink:0;margin:0 auto}._productCard_h4utb_3 ._productInformation_h4utb_26{display:flex;flex-direction:column;align-items:flex-start;gap:2px;margin-top:auto}._productCard_h4utb_3 ._purchaseInformation_h4utb_33{display:flex;flex-direction:row;align-items:flex-start;justify-content:space-between;width:100%}._productCard_h4utb_3 ._addToCart_h4utb_41,._productCard_h4utb_3 ._addToCartButton_h4utb_44{width:100%}._productInformation_h4utb_26>a{font-weight:var(--font-weight-semibold);white-space:break-spaces;word-wrap:normal}._partNumber_h4utb_54{display:flex;flex-direction:row;align-items:center;gap:var(--spacing-spacing-3xs)}._partNumberLabel_h4utb_61{color:var(--text-text-quaternary)}._productTile_h4utb_65{box-sizing:border-box;position:relative;width:100%;max-width:1072px;display:flex;flex-direction:row;align-items:flex-start;background:var(--surface-surface-primary, #FFF);padding:var(--spacing-spacing-default, 16px) var(--spacing-spacing-sm, 20px);gap:var(--spacing-spacing-1xs)}._productTile_h4utb_65>img{object-fit:contain}._productTile_h4utb_65 ._productInformation_h4utb_26{display:flex;flex-direction:column;align-items:flex-start;gap:2px}._productTile_h4utb_65 ._productData_h4utb_92{display:flex;flex-direction:column;align-items:flex-start;width:100%;gap:var(--spacing-spacing-2xs)}._productTile_h4utb_65 ._purchase_h4utb_33{display:flex;flex-direction:row;align-items:flex-end;justify-content:space-between;width:100%}@media (max-width: 480px){._productTile_h4utb_65 ._purchase_h4utb_33{flex-direction:column;align-items:flex-start;gap:var(--spacing-spacing-3xs)}}._productTile_h4utb_65 ._purchaseInformation_h4utb_33{display:flex;flex-direction:column;align-items:flex-start;gap:var(--spacing-spacing-2xs)}@media (max-width: 480px){._productTile_h4utb_65 ._purchaseInformation_h4utb_33{flex-direction:row;align-items:flex-start;justify-content:space-between;width:100%;gap:0px}}._productTile_h4utb_65 ._attributeContainer_h4utb_129{margin:0;padding:0;padding-top:var(--spacing-spacing-1xs);border-top:1px solid var(--border-border-primary);width:100%;list-style:none;display:flex;flex-direction:row;align-items:center;justify-content:flex-start;flex-wrap:wrap;column-gap:var(--spacing-spacing-lg);row-gap:var(--spacing-spacing-3xs)}@media (max-width: 640px){._productTile_h4utb_65 ._attributeContainer_h4utb_129{display:none}}._productTile_h4utb_65 ._attributeContainer_h4utb_129 li{display:flex;flex-direction:row;align-items:center;gap:var(--spacing-spacing-3xs)}._productTile_h4utb_65 ._addToCart_h4utb_41{display:flex;flex-direction:row;align-items:center;gap:var(--spacing-spacing-md)}@media (max-width: 480px){._productTile_h4utb_65 ._addToCart_h4utb_41{gap:var(--spacing-spacing-2xs);width:100%}}._productTile_h4utb_65 ._addToCartButton_h4utb_44{width:96px;font-size:var(--font-size-md);font-weight:var(--font-weight-semibold)}@media (max-width: 640px){._productTile_h4utb_65 ._addToCartButton_h4utb_44{width:100%}}._elevated_h4utb_177{border:1px solid var(--border-border-primary, #DFDFDF);box-shadow:2px 4px 12px #00000026}._noImage_h4utb_183 ._productInformation_h4utb_26{margin-top:0}._sm_h4utb_16{padding:var(--spacing-spacing-1xs)}
1
+ ._productCard_ntcb7_3{box-sizing:border-box;position:relative;background:var(--surface-surface-primary, #FFF);display:flex;width:244px;height:308px;padding:var(--spacing-spacing-default, 16px) var(--spacing-spacing-sm, 20px);flex-direction:column;align-items:flex-start;gap:var(--spacing-spacing-2xs)}._productCard_ntcb7_3._sm_ntcb7_16{width:180px;height:230px}._productCard_ntcb7_3>img{object-fit:contain;flex-shrink:0;margin:0 auto}._productCard_ntcb7_3 ._productInformation_ntcb7_26{display:flex;flex-direction:column;align-items:flex-start;gap:2px;margin-top:auto}._productCard_ntcb7_3 ._purchaseInformation_ntcb7_33{display:flex;align-items:flex-start;width:100%}._productCard_ntcb7_3 ._purchaseControls_ntcb7_39{display:flex;flex-direction:column;width:100%;gap:var(--spacing-spacing-3xs)}._productCard_ntcb7_3 ._addToCart_ntcb7_46,._productCard_ntcb7_3 ._addToCartButton_ntcb7_49{width:100%}._productCard_ntcb7_3 ._pricing_ntcb7_53{align-self:stretch;width:100%}._productInformation_ntcb7_26>a{font-weight:var(--font-weight-semibold);white-space:break-spaces;word-wrap:normal}._partNumber_ntcb7_64{display:flex;flex-direction:row;align-items:center;gap:var(--spacing-spacing-3xs)}._partNumberLabel_ntcb7_71{color:var(--text-text-quaternary)}._productTile_ntcb7_75{box-sizing:border-box;position:relative;width:100%;max-width:1072px;display:flex;flex-direction:row;align-items:flex-start;background:var(--surface-surface-primary, #FFF);padding:var(--spacing-spacing-default, 16px) var(--spacing-spacing-sm, 20px);gap:var(--spacing-spacing-1xs)}._productTile_ntcb7_75>img{object-fit:contain}._productTile_ntcb7_75 ._productInformation_ntcb7_26{display:flex;flex-direction:column;align-items:flex-start;gap:2px}._productTile_ntcb7_75 ._productData_ntcb7_102{display:flex;flex-direction:column;align-items:flex-start;width:100%;gap:var(--spacing-spacing-2xs)}._productTile_ntcb7_75 ._purchase_ntcb7_33{display:flex;flex-direction:column;align-items:stretch;justify-content:space-between;width:100%}@media (max-width: 480px){._productTile_ntcb7_75 ._purchase_ntcb7_33{align-items:flex-start;gap:var(--spacing-spacing-3xs)}}._purchase_ntcb7_33{gap:var(--spacing-spacing-2xs)}._productTile_ntcb7_75 ._purchaseInformation_ntcb7_33{display:flex;align-items:flex-start;width:100%}._productTile_ntcb7_75 ._purchaseControls_ntcb7_39{display:flex;flex-direction:column;align-self:flex-end;width:232px;gap:var(--spacing-spacing-3xs)}@media (max-width: 480px){._productTile_ntcb7_75 ._purchaseControls_ntcb7_39{align-self:stretch;width:100%}}._productTile_ntcb7_75 ._pricing_ntcb7_53{width:100%}._productTile_ntcb7_75 ._attributeContainer_ntcb7_148{margin:0;padding:0;padding-top:var(--spacing-spacing-1xs);border-top:1px solid var(--border-border-primary);width:100%;list-style:none;display:flex;flex-direction:row;align-items:center;justify-content:flex-start;flex-wrap:wrap;column-gap:var(--spacing-spacing-lg);row-gap:var(--spacing-spacing-3xs)}@media (max-width: 640px){._productTile_ntcb7_75 ._attributeContainer_ntcb7_148{display:none}}._productTile_ntcb7_75 ._attributeContainer_ntcb7_148 li{display:flex;flex-direction:row;align-items:center;gap:var(--spacing-spacing-3xs)}._productTile_ntcb7_75 ._addToCart_ntcb7_46{display:flex;flex-direction:row;align-items:center;gap:var(--spacing-spacing-default);width:100%}@media (max-width: 480px){._productTile_ntcb7_75 ._addToCart_ntcb7_46{gap:var(--spacing-spacing-2xs)}}._productTile_ntcb7_75 ._addToCartButton_ntcb7_49{width:96px;font-size:var(--font-size-md);font-weight:var(--font-weight-semibold)}@media (max-width: 480px){._productTile_ntcb7_75 ._addToCartButton_ntcb7_49{width:100%}}._elevated_ntcb7_196{border:1px solid var(--border-border-primary, #DFDFDF);box-shadow:2px 4px 12px #00000026}._noImage_ntcb7_202 ._productInformation_ntcb7_26{margin-top:0}._sm_ntcb7_16{padding:var(--spacing-spacing-1xs)}
@@ -1 +1 @@
1
- ._qty-container_18e2j_1{display:flex;flex-direction:row;align-items:center}._qty-container_18e2j_1>button{font-size:1.25rem;border:1px solid var(--border-border-primary);background-color:#fff;box-sizing:border-box}._qty-container_18e2j_1>input{text-align:center;font-size:var(--font-size-md);border:1px solid var(--border-border-primary);box-sizing:border-box;outline:none}._qty-container_18e2j_1>input::-webkit-outer-spin-button,._qty-container_18e2j_1>input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}._qty-container_18e2j_1>input[type=number]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}._decrease-btn_18e2j_35{position:relative;left:2px;z-index:0;display:flex;flex-direction:row;align-items:center;justify-content:center;cursor:pointer}._increase-btn_18e2j_46{position:relative;left:-2px;z-index:0;display:flex;flex-direction:row;align-items:center;justify-content:center;cursor:pointer}._decrease-btn_18e2j_35:disabled,._increase-btn_18e2j_46:disabled{pointer-events:none}._decrease-btn_18e2j_35:disabled svg,._increase-btn_18e2j_46:disabled svg{fill:var(--color-neutrals-neutral-4)}._button-sm_18e2j_67{width:1.25rem;height:1.25rem}._button-md_18e2j_71{width:2rem;height:2rem}._button-lg_18e2j_75{width:2.5rem;height:2.5rem}._qty-input-sm_18e2j_79{width:2.5rem;height:1.25rem}._qty-input-md_18e2j_83{width:2.5rem;height:2rem}._qty-input-lg_18e2j_87{width:3rem;height:2.5rem}
1
+ ._qty-container_1va75_1{display:flex;flex-direction:row;align-items:center}._qty-container_1va75_1>button{font-size:1.25rem;border:1px solid var(--border-border-primary);background-color:#f9f9f9;box-sizing:border-box}._qty-container_1va75_1>input{text-align:center;font-size:var(--font-size-md);border:1px solid var(--border-border-primary);box-sizing:border-box;outline:none}._qty-container_1va75_1>input::-webkit-outer-spin-button,._qty-container_1va75_1>input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}._qty-container_1va75_1>input[type=number]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}._decrease-btn_1va75_34{position:relative;left:2px;z-index:0;display:flex;flex-direction:row;align-items:center;justify-content:center;cursor:pointer;border-top-left-radius:4px;border-bottom-left-radius:4px}._increase-btn_1va75_47{position:relative;left:-2px;z-index:0;display:flex;flex-direction:row;align-items:center;justify-content:center;cursor:pointer;border-top-right-radius:4px;border-bottom-right-radius:4px}._decrease-btn_1va75_34._button-sm_1va75_60{border-top-left-radius:2px;border-bottom-left-radius:2px}._increase-btn_1va75_47._button-sm_1va75_60{border-top-right-radius:2px;border-bottom-right-radius:2px}._decrease-btn_1va75_34:disabled,._increase-btn_1va75_47:disabled{pointer-events:none}._decrease-btn_1va75_34:disabled svg,._increase-btn_1va75_47:disabled svg{fill:var(--color-neutrals-neutral-4)}._button-sm_1va75_60{width:1.25rem;height:1.25rem}._button-md_1va75_83{width:2rem;height:2rem}._button-lg_1va75_87{width:2.5rem;height:2.5rem}._qty-input-sm_1va75_91{width:2.5rem;height:1.25rem}._qty-input-md_1va75_95{width:2.5rem;height:2rem}._qty-input-lg_1va75_99{width:3rem;height:2.5rem}
@@ -16,23 +16,23 @@ import { s as l } from "../../Cart.module-C_gb-xil.js";
16
16
  function be({
17
17
  imageUrl: S,
18
18
  imageAlt: _ = "Product image",
19
- title: o,
20
- titleHref: u,
19
+ title: u,
20
+ titleHref: I,
21
21
  onTitleNavigate: d,
22
- partNumber: I,
22
+ partNumber: g,
23
23
  unit: E,
24
24
  make: M,
25
25
  model: R,
26
26
  serial: w,
27
- custom: g,
27
+ custom: N,
28
28
  availabilityId: D,
29
- availability: N,
29
+ availability: y,
30
30
  inventory: L,
31
31
  source: i = "none",
32
32
  priceLabel: j = "List Price",
33
- price: y,
34
- quantity: b,
35
- maxQuantity: h,
33
+ price: b,
34
+ quantity: h,
35
+ maxQuantity: o,
36
36
  onQuantityChange: x,
37
37
  onRemove: T,
38
38
  onUnitEditClick: p,
@@ -47,17 +47,17 @@ function be({
47
47
  function G(a) {
48
48
  a.defaultPrevented || a.button === 0 && (a.metaKey || a.altKey || a.ctrlKey || a.shiftKey || a.currentTarget.target && a.currentTarget.target !== "_self" || d == null || d(a));
49
49
  }
50
- const m = E || [M, R, w].filter(Boolean).join(" / "), H = typeof h == "number" && Number.isFinite(h) ? h : void 0;
50
+ const m = E || [M, R, w].filter(Boolean).join(" / "), H = typeof o == "number" && Number.isFinite(o) ? o : void 0;
51
51
  return /* @__PURE__ */ c("li", { className: f(l.cartItem, q), ...B, children: [
52
52
  /* @__PURE__ */ c("div", { className: l.cartItemContent, children: [
53
53
  /* @__PURE__ */ r(X, { height: 50, width: 50, src: S || "", alt: _, className: l.itemImage }),
54
54
  /* @__PURE__ */ c("div", { className: l.itemContainer, children: [
55
55
  /* @__PURE__ */ c("div", { className: l.topRow, children: [
56
56
  /* @__PURE__ */ c("div", { className: l.itemInfo, children: [
57
- /* @__PURE__ */ r(t, { size: "sm", weight: "semibold", children: u ? /* @__PURE__ */ r(W, { href: u, onClick: G, children: o }) : o }),
58
- I != null && /* @__PURE__ */ c(t, { size: g ? "xs" : "sm", children: [
59
- /* @__PURE__ */ r(t, { colorToken: "quaternary", size: "xs", children: g ? "Specs " : "Part # " }),
60
- I
57
+ /* @__PURE__ */ r(t, { size: "sm", weight: "semibold", children: I ? /* @__PURE__ */ r(W, { href: I, onClick: G, children: u }) : u }),
58
+ g != null && /* @__PURE__ */ c(t, { size: N ? "xs" : "sm", children: [
59
+ /* @__PURE__ */ r(t, { colorToken: "quaternary", size: "xs", children: N ? "Specs " : "Part # " }),
60
+ g
61
61
  ] })
62
62
  ] }),
63
63
  T && /* @__PURE__ */ r("button", { onClick: T, className: l.removeItem, "aria-label": "Remove item", type: "button", children: /* @__PURE__ */ r(n, { iconKey: "fa-regular fa-trash", size: "sm" }) })
@@ -95,11 +95,11 @@ function be({
95
95
  ) : /* @__PURE__ */ r(t, { size: "xs", children: m }) }),
96
96
  /* @__PURE__ */ c("div", { className: l.itemManagement, children: [
97
97
  /* @__PURE__ */ c("div", { className: l.availabilitySlot, children: [
98
- N && /* @__PURE__ */ r(
98
+ y && /* @__PURE__ */ r(
99
99
  Y,
100
100
  {
101
101
  availId: D || "not-found",
102
- availDescription: N,
102
+ availDescription: y,
103
103
  enableTooltip: !0,
104
104
  inventory: L
105
105
  }
@@ -116,11 +116,19 @@ function be({
116
116
  )
117
117
  ] }),
118
118
  /* @__PURE__ */ c("div", { className: l.purchaseInformation, children: [
119
- /* @__PURE__ */ r("div", { className: l.priceSlot, children: y && /* @__PURE__ */ r(Z, { pricingLabel: j, price: y }) }),
120
- typeof b == "number" && x && /* @__PURE__ */ r(
119
+ /* @__PURE__ */ r("div", { className: l.priceSlot, children: b && /* @__PURE__ */ r(
120
+ Z,
121
+ {
122
+ pricingLabel: j,
123
+ price: b,
124
+ quantity: h,
125
+ presentation: "total"
126
+ }
127
+ ) }),
128
+ typeof h == "number" && x && /* @__PURE__ */ r(
121
129
  $,
122
130
  {
123
- quantity: b,
131
+ quantity: h,
124
132
  onQuantityChange: x,
125
133
  max: H,
126
134
  size: "sm"
@@ -1,6 +1,9 @@
1
1
  export interface PricingProps {
2
2
  pricingLabel?: string;
3
3
  price?: string;
4
+ listPrice?: string;
5
+ quantity?: number;
6
+ presentation?: "unit" | "total";
4
7
  className?: string;
5
8
  }
6
- export declare function Pricing({ pricingLabel, price, className }: PricingProps): import("react/jsx-runtime").JSX.Element;
9
+ export declare function Pricing({ pricingLabel, price, listPrice, quantity, presentation, className, }: PricingProps): import("react/jsx-runtime").JSX.Element;
@@ -1,15 +1,66 @@
1
- import { jsxs as c, jsx as i } from "react/jsx-runtime";
2
- import { c as s } from "../../clsx-OuTLNxxd.js";
3
- import { Text as n } from "../../atoms/Text/Text.js";
4
- import '../../assets/Pricing.css';const e = "_pricingInformation_u1dqz_1", m = {
5
- pricingInformation: e
1
+ import { jsx as i, jsxs as c, Fragment as a } from "react/jsx-runtime";
2
+ import { c as m } from "../../clsx-OuTLNxxd.js";
3
+ import { Text as o } from "../../atoms/Text/Text.js";
4
+ import '../../assets/Pricing.css';const _ = "_pricingInformation_1bvkh_1", x = "_prices_1bvkh_6", f = "_priceRow_1bvkh_15", T = "_discountedTotal_1bvkh_23", g = "_totalPriceHidden_1bvkh_28", t = {
5
+ pricingInformation: _,
6
+ prices: x,
7
+ priceRow: f,
8
+ discountedTotal: T,
9
+ totalPriceHidden: g
6
10
  };
7
- function a({ pricingLabel: r, price: o, className: t }) {
8
- return /* @__PURE__ */ c("div", { className: s(m.pricingInformation, t), children: [
9
- /* @__PURE__ */ i(n, { size: "xxs", children: r }),
10
- /* @__PURE__ */ i(n, { size: "lg", weight: "bold", children: o })
11
- ] });
11
+ function s(n) {
12
+ const e = Number(n.replace(/[^0-9.-]/g, ""));
13
+ return Number.isFinite(e) ? e : void 0;
14
+ }
15
+ function k(n, e) {
16
+ const r = s(n);
17
+ if (r !== void 0)
18
+ return new Intl.NumberFormat("en-US", {
19
+ style: "currency",
20
+ currency: "USD"
21
+ }).format(r * e);
22
+ }
23
+ function P({
24
+ pricingLabel: n,
25
+ price: e,
26
+ listPrice: r,
27
+ quantity: l = 1,
28
+ presentation: u = "unit",
29
+ className: h
30
+ }) {
31
+ const d = e ? k(e, l) : void 0, v = !!(e && r && s(r) !== void 0 && s(e) !== void 0 && s(r) > s(e));
32
+ return /* @__PURE__ */ i("div", { className: m(t.pricingInformation, h), children: u === "unit" ? /* @__PURE__ */ c(a, { children: [
33
+ /* @__PURE__ */ c("div", { className: t.prices, children: [
34
+ v && /* @__PURE__ */ c("div", { className: t.priceRow, children: [
35
+ /* @__PURE__ */ i(o, { size: "xxs", colorToken: "quaternary", children: "List Price" }),
36
+ /* @__PURE__ */ i(o, { size: "xxs", colorToken: "quaternary", children: r })
37
+ ] }),
38
+ /* @__PURE__ */ c("div", { className: t.priceRow, children: [
39
+ /* @__PURE__ */ i(o, { size: "xs", children: n }),
40
+ /* @__PURE__ */ i(o, { size: "sm", weight: "bold", children: e })
41
+ ] })
42
+ ] }),
43
+ /* @__PURE__ */ i(
44
+ o,
45
+ {
46
+ size: "xs",
47
+ colorToken: "quaternary",
48
+ className: m(
49
+ l <= 1 && t.totalPriceHidden,
50
+ t.discountedTotal
51
+ ),
52
+ children: d ? `Total ${d}` : "Total"
53
+ }
54
+ )
55
+ ] }) : /* @__PURE__ */ c(a, { children: [
56
+ n && /* @__PURE__ */ i(o, { size: "xxs", children: n }),
57
+ /* @__PURE__ */ i(o, { size: "lg", weight: "bold", children: d ?? e }),
58
+ /* @__PURE__ */ c(o, { size: "xs", colorToken: "quaternary", children: [
59
+ e,
60
+ " each"
61
+ ] })
62
+ ] }) });
12
63
  }
13
64
  export {
14
- a as Pricing
65
+ P as Pricing
15
66
  };
@@ -1,75 +1,75 @@
1
- import { jsxs as N, jsx as i } from "react/jsx-runtime";
2
- import { c as a } from "../../clsx-OuTLNxxd.js";
1
+ import { jsxs as N, jsx as c } from "react/jsx-runtime";
2
+ import { c as r } from "../../clsx-OuTLNxxd.js";
3
3
  import { Icon as l } from "../../atoms/Icon/Icon.js";
4
4
  import { getHideAtStyles as g } from "../../atoms/HideAt.js";
5
5
  import '../../assets/QuantityInput.css';const s = {
6
- "qty-container": "_qty-container_18e2j_1",
7
- "decrease-btn": "_decrease-btn_18e2j_35",
8
- "increase-btn": "_increase-btn_18e2j_46",
9
- "button-sm": "_button-sm_18e2j_67",
10
- "button-md": "_button-md_18e2j_71",
11
- "button-lg": "_button-lg_18e2j_75",
12
- "qty-input-sm": "_qty-input-sm_18e2j_79",
13
- "qty-input-md": "_qty-input-md_18e2j_83",
14
- "qty-input-lg": "_qty-input-lg_18e2j_87"
6
+ "qty-container": "_qty-container_1va75_1",
7
+ "decrease-btn": "_decrease-btn_1va75_34",
8
+ "increase-btn": "_increase-btn_1va75_47",
9
+ "button-sm": "_button-sm_1va75_60",
10
+ "button-md": "_button-md_1va75_83",
11
+ "button-lg": "_button-lg_1va75_87",
12
+ "qty-input-sm": "_qty-input-sm_1va75_91",
13
+ "qty-input-md": "_qty-input-md_1va75_95",
14
+ "qty-input-lg": "_qty-input-lg_1va75_99"
15
15
  };
16
- function C({
17
- quantity: o = 1,
16
+ function $({
17
+ quantity: a = 1,
18
18
  onQuantityChange: _,
19
- min: e = 1,
20
- max: n = 9999,
19
+ min: n = 1,
20
+ max: e = 9999,
21
21
  className: b,
22
22
  wrapperClassName: d,
23
23
  hideAt: p,
24
- size: r = "md",
24
+ size: o = "md",
25
25
  ...y
26
26
  }) {
27
- const m = (t) => (e !== void 0 && t < e && (t = e), n !== void 0 && n !== void 0 && t > n && (t = n), t), u = (t) => {
28
- const c = m(Number.isNaN(t) ? e ?? 1 : t);
29
- _(c);
30
- }, f = () => u(o - 1), j = () => u(o + 1);
31
- return /* @__PURE__ */ N("div", { className: a(s["qty-container"], g(p), d), children: [
32
- /* @__PURE__ */ i(
27
+ const v = (t) => (n !== void 0 && t < n && (t = n), e !== void 0 && e !== void 0 && t > e && (t = e), t), u = (t) => {
28
+ const i = v(Number.isNaN(t) ? n ?? 1 : t);
29
+ _(i);
30
+ }, m = () => u(a - 1), f = () => u(a + 1);
31
+ return /* @__PURE__ */ N("div", { className: r(s["qty-container"], g(p), d), children: [
32
+ /* @__PURE__ */ c(
33
33
  "button",
34
34
  {
35
35
  type: "button",
36
- className: a(s["decrease-btn"], s[`button-${r}`]),
37
- onClick: f,
38
- disabled: o <= (e ?? 1),
36
+ className: r(s["decrease-btn"], s[`button-${o}`]),
37
+ onClick: m,
38
+ disabled: a <= (n ?? 1),
39
39
  "aria-label": "Decrease quantity",
40
- children: /* @__PURE__ */ i(l, { iconKey: "fa-solid fa-minus", size: "sm" })
40
+ children: /* @__PURE__ */ c(l, { iconKey: "fa-solid fa-minus", size: o === "sm" ? "3xs" : "xs" })
41
41
  }
42
42
  ),
43
- /* @__PURE__ */ i(
43
+ /* @__PURE__ */ c(
44
44
  "input",
45
45
  {
46
- className: a(s["qty-input"], s[`qty-input-${r}`], b),
46
+ className: r(s["qty-input"], s[`qty-input-${o}`], b),
47
47
  type: "number",
48
- min: e,
49
- max: n,
50
- value: o,
48
+ min: n,
49
+ max: e,
50
+ value: a,
51
51
  onFocus: (t) => t.currentTarget.select(),
52
52
  onChange: (t) => {
53
- const c = parseInt(t.target.value, 10);
54
- u(Number.isNaN(c) ? e ?? 1 : c);
53
+ const i = parseInt(t.target.value, 10);
54
+ u(Number.isNaN(i) ? n ?? 1 : i);
55
55
  },
56
56
  "aria-label": "Quantity",
57
57
  ...y
58
58
  }
59
59
  ),
60
- /* @__PURE__ */ i(
60
+ /* @__PURE__ */ c(
61
61
  "button",
62
62
  {
63
63
  type: "button",
64
- className: a(s["increase-btn"], s[`button-${r}`]),
65
- onClick: j,
66
- disabled: n !== void 0 && o >= n,
64
+ className: r(s["increase-btn"], s[`button-${o}`]),
65
+ onClick: f,
66
+ disabled: e !== void 0 && a >= e,
67
67
  "aria-label": "Increase quantity",
68
- children: /* @__PURE__ */ i(l, { iconKey: "fa-solid fa-plus", size: "sm" })
68
+ children: /* @__PURE__ */ c(l, { iconKey: "fa-solid fa-plus", size: o === "sm" ? "3xs" : "xs" })
69
69
  }
70
70
  )
71
71
  ] });
72
72
  }
73
73
  export {
74
- C as QuantityInput
74
+ $ as QuantityInput
75
75
  };
@@ -12,8 +12,10 @@ export interface ProductProps extends AvailabilityProps {
12
12
  productHref?: string;
13
13
  itemKey: number;
14
14
  partNumber: string;
15
- priceLabel: string;
16
15
  price: string;
16
+ listPrice?: string;
17
+ isSignedIn?: boolean;
18
+ customerClass?: string;
17
19
  imgSrc?: string;
18
20
  attributes?: {
19
21
  label: string;
@@ -28,4 +30,4 @@ export interface ProductProps extends AvailabilityProps {
28
30
  requiresUnitDetails?: boolean;
29
31
  maxQuantity?: number;
30
32
  }
31
- export declare function Product({ productView, itemKey, partNumber, productDescription, availDescription, availId, inventory, productHref, customWizardUrl, customWizardText, customWizardColorToken, priceLabel, price, imgSrc, attributes, className, onAddToCart, flat, size, showQuantity, onLinkClicked, requiresUnitDetails, maxQuantity, ...otherProps }: ProductProps): import("react/jsx-runtime").JSX.Element;
33
+ export declare function Product({ productView, itemKey, partNumber, productDescription, availDescription, availId, inventory, productHref, customWizardUrl, customWizardText, customWizardColorToken, price, listPrice, isSignedIn, customerClass, imgSrc, attributes, className, onAddToCart, flat, size, showQuantity, onLinkClicked, requiresUnitDetails, maxQuantity, ...otherProps }: ProductProps): import("react/jsx-runtime").JSX.Element;
@@ -1,70 +1,75 @@
1
1
  import { jsxs as e, jsx as a } from "react/jsx-runtime";
2
- import { Image as P } from "../../atoms/Image/Image.js";
3
- import { Link as j } from "../../atoms/Link/Link.js";
2
+ import J from "react";
3
+ import { Image as E } from "../../atoms/Image/Image.js";
4
+ import { Link as Y } from "../../atoms/Link/Link.js";
4
5
  import { Text as n } from "../../atoms/Text/Text.js";
5
- import { Availability as D } from "../../molecules/Availability/Availability.js";
6
- import { Pricing as V } from "../../molecules/Pricing/Pricing.js";
7
- import { AddToCart as E } from "../../molecules/AddToCart/AddToCart.js";
8
- import { CustomWizardBadge as F } from "../../molecules/CustomWizardBadge/CustomWizardBadge.js";
9
- import { c as G } from "../../clsx-OuTLNxxd.js";
10
- import '../../assets/Product.css';const M = "_productCard_h4utb_3", O = "_sm_h4utb_16", R = "_productInformation_h4utb_26", X = "_purchaseInformation_h4utb_33", Y = "_addToCart_h4utb_41", Z = "_addToCartButton_h4utb_44", q = "_partNumber_h4utb_54", H = "_partNumberLabel_h4utb_61", y = "_productTile_h4utb_65", L = "_productData_h4utb_92", K = "_purchase_h4utb_33", Q = "_attributeContainer_h4utb_129", S = "_elevated_h4utb_177", U = "_noImage_h4utb_183", t = {
6
+ import { Availability as L } from "../../molecules/Availability/Availability.js";
7
+ import { Pricing as R } from "../../molecules/Pricing/Pricing.js";
8
+ import { AddToCart as V } from "../../molecules/AddToCart/AddToCart.js";
9
+ import { CustomWizardBadge as q } from "../../molecules/CustomWizardBadge/CustomWizardBadge.js";
10
+ import { c as F } from "../../clsx-OuTLNxxd.js";
11
+ import '../../assets/Product.css';const M = "_productCard_ntcb7_3", O = "_sm_ntcb7_16", Q = "_productInformation_ntcb7_26", X = "_purchaseInformation_ntcb7_33", Z = "_purchaseControls_ntcb7_39", H = "_addToCart_ntcb7_46", U = "_addToCartButton_ntcb7_49", K = "_pricing_ntcb7_53", W = "_partNumber_ntcb7_64", S = "_partNumberLabel_ntcb7_71", z = "_productTile_ntcb7_75", k = "_productData_ntcb7_102", tt = "_purchase_ntcb7_33", at = "_attributeContainer_ntcb7_148", rt = "_elevated_ntcb7_196", et = "_noImage_ntcb7_202", t = {
11
12
  productCard: M,
12
13
  sm: O,
13
- productInformation: R,
14
+ productInformation: Q,
14
15
  purchaseInformation: X,
15
- addToCart: Y,
16
- addToCartButton: Z,
17
- partNumber: q,
18
- partNumberLabel: H,
19
- productTile: y,
20
- productData: L,
21
- purchase: K,
22
- attributeContainer: Q,
23
- elevated: S,
24
- noImage: U
16
+ purchaseControls: Z,
17
+ addToCart: H,
18
+ addToCartButton: U,
19
+ pricing: K,
20
+ partNumber: W,
21
+ partNumberLabel: S,
22
+ productTile: z,
23
+ productData: k,
24
+ purchase: tt,
25
+ attributeContainer: at,
26
+ elevated: rt,
27
+ noImage: et
25
28
  };
26
- function nt({
27
- productView: J,
28
- itemKey: c,
29
+ function ht({
30
+ productView: G,
31
+ itemKey: d,
29
32
  partNumber: s,
30
- productDescription: i,
33
+ productDescription: N,
31
34
  availDescription: f,
32
- availId: m,
33
- inventory: N,
35
+ availId: l,
36
+ inventory: C,
34
37
  productHref: T,
35
- customWizardUrl: u,
36
- customWizardText: C = "Customize",
37
- customWizardColorToken: g = "secondary",
38
- priceLabel: v,
39
- price: l,
38
+ customWizardUrl: m,
39
+ customWizardText: g = "Customize",
40
+ customWizardColorToken: v = "secondary",
41
+ price: i,
42
+ listPrice: x,
43
+ isSignedIn: u = !1,
44
+ customerClass: I,
40
45
  imgSrc: o,
41
46
  attributes: _,
42
- className: x,
43
- onAddToCart: I,
44
- flat: B,
47
+ className: B,
48
+ onAddToCart: P,
49
+ flat: A,
45
50
  size: r = "md",
46
51
  showQuantity: b = !0,
47
- onLinkClicked: d,
48
- requiresUnitDetails: A = !1,
49
- maxQuantity: w,
50
- ...$
52
+ onLinkClicked: c,
53
+ requiresUnitDetails: w = !1,
54
+ maxQuantity: $,
55
+ ...j
51
56
  }) {
52
- const h = r === "sm" ? "xs" : "sm";
53
- return J === "Card" ? /* @__PURE__ */ e(
57
+ const [y, D] = J.useState(1), p = r === "sm" ? "xs" : "sm";
58
+ return G === "Card" ? /* @__PURE__ */ e(
54
59
  "div",
55
60
  {
56
- className: G(
61
+ className: F(
57
62
  t.productCard,
58
63
  r && t[r],
59
- x,
60
- !B && t.elevated,
64
+ B,
65
+ !A && t.elevated,
61
66
  !o && t.noImage
62
67
  ),
63
- ...$,
68
+ ...j,
64
69
  children: [
65
- u && /* @__PURE__ */ a(F, { href: u, text: C, colorToken: g }),
70
+ m && /* @__PURE__ */ a(q, { href: m, text: g, colorToken: v }),
66
71
  o && /* @__PURE__ */ a(
67
- P,
72
+ E,
68
73
  {
69
74
  src: o,
70
75
  alt: `${s} product image`,
@@ -73,52 +78,62 @@ function nt({
73
78
  }
74
79
  ),
75
80
  /* @__PURE__ */ e("div", { className: t.productInformation, children: [
76
- /* @__PURE__ */ a(j, { onClick: () => d == null ? void 0 : d(c), size: r, href: T || "#", children: i }),
81
+ /* @__PURE__ */ a(Y, { onClick: () => c == null ? void 0 : c(d), size: r, href: T || "#", children: N }),
77
82
  /* @__PURE__ */ e("div", { className: t.partNumber, children: [
78
- /* @__PURE__ */ a(n, { size: h, className: t.partNumberLabel, children: "Part #" }),
79
- /* @__PURE__ */ a(n, { size: h, weight: "semibold", children: s })
83
+ /* @__PURE__ */ a(n, { size: p, className: t.partNumberLabel, children: "Part #" }),
84
+ /* @__PURE__ */ a(n, { size: p, weight: "semibold", children: s })
80
85
  ] })
81
86
  ] }),
82
- /* @__PURE__ */ e("div", { className: t.purchaseInformation, children: [
83
- m && /* @__PURE__ */ a(
84
- D,
87
+ /* @__PURE__ */ a("div", { className: t.purchaseInformation, children: l && /* @__PURE__ */ a(
88
+ L,
89
+ {
90
+ availId: l,
91
+ availDescription: f,
92
+ inventory: C,
93
+ enableTooltip: !0
94
+ }
95
+ ) }),
96
+ /* @__PURE__ */ e("div", { className: t.purchaseControls, children: [
97
+ i && /* @__PURE__ */ a(
98
+ R,
85
99
  {
86
- availId: m,
87
- availDescription: f,
88
- inventory: N,
89
- enableTooltip: !0
100
+ pricingLabel: u ? "Your Price" : "List Price",
101
+ price: i,
102
+ listPrice: u && I !== "EndUser" ? x : void 0,
103
+ quantity: y,
104
+ className: t.pricing
90
105
  }
91
106
  ),
92
- l && /* @__PURE__ */ a(V, { pricingLabel: v, price: l })
93
- ] }),
94
- /* @__PURE__ */ a(
95
- E,
96
- {
97
- itemKey: c,
98
- onAdd: I,
99
- max: w,
100
- className: t.addToCart,
101
- addButtonClassName: t.addToCartButton,
102
- addButtonVariant: b ? "cta-primary" : "secondary",
103
- size: r,
104
- buttonDoneText: "",
105
- buttonText: b ? "Add" : "Add to Cart",
106
- showQuantity: b,
107
- requiresUnitDetails: A
108
- }
109
- )
107
+ /* @__PURE__ */ a(
108
+ V,
109
+ {
110
+ itemKey: d,
111
+ onAdd: P,
112
+ max: $,
113
+ className: t.addToCart,
114
+ addButtonClassName: t.addToCartButton,
115
+ addButtonVariant: b ? "cta-primary" : "secondary",
116
+ size: r,
117
+ buttonDoneText: "",
118
+ buttonText: b ? "Add" : "Add to Cart",
119
+ showQuantity: b,
120
+ requiresUnitDetails: w,
121
+ onQuantityChange: D
122
+ }
123
+ )
124
+ ] })
110
125
  ]
111
126
  }
112
- ) : /* @__PURE__ */ e("div", { className: G(
127
+ ) : /* @__PURE__ */ e("div", { className: F(
113
128
  t.productTile,
114
- x,
129
+ B,
115
130
  r && t[r],
116
- !B && t.elevated,
131
+ !A && t.elevated,
117
132
  !o && t.noImage
118
- ), ...$, children: [
119
- u && /* @__PURE__ */ a(F, { href: u, text: C, colorToken: g }),
133
+ ), ...j, children: [
134
+ m && /* @__PURE__ */ a(q, { href: m, text: g, colorToken: v }),
120
135
  o && /* @__PURE__ */ a(
121
- P,
136
+ E,
122
137
  {
123
138
  src: o,
124
139
  alt: `${s} product image`,
@@ -128,37 +143,46 @@ function nt({
128
143
  ),
129
144
  /* @__PURE__ */ e("div", { className: t.productData, children: [
130
145
  /* @__PURE__ */ e("div", { className: t.productInformation, children: [
131
- /* @__PURE__ */ a(j, { onClick: () => d == null ? void 0 : d(c), size: r, href: T || "#", children: i }),
146
+ /* @__PURE__ */ a(Y, { onClick: () => c == null ? void 0 : c(d), size: r, href: T || "#", children: N }),
132
147
  /* @__PURE__ */ e("div", { className: t.partNumber, children: [
133
- /* @__PURE__ */ a(n, { size: h, className: t.partNumberLabel, children: "Part #" }),
134
- /* @__PURE__ */ a(n, { size: h, weight: "semibold", children: s })
148
+ /* @__PURE__ */ a(n, { size: p, className: t.partNumberLabel, children: "Part #" }),
149
+ /* @__PURE__ */ a(n, { size: p, weight: "semibold", children: s })
135
150
  ] })
136
151
  ] }),
137
152
  /* @__PURE__ */ e("div", { className: t.purchase, children: [
138
- /* @__PURE__ */ e("div", { className: t.purchaseInformation, children: [
139
- m && /* @__PURE__ */ a(
140
- D,
153
+ /* @__PURE__ */ a("div", { className: t.purchaseInformation, children: l && /* @__PURE__ */ a(
154
+ L,
155
+ {
156
+ availId: l,
157
+ availDescription: f,
158
+ inventory: C,
159
+ enableTooltip: !0
160
+ }
161
+ ) }),
162
+ /* @__PURE__ */ e("div", { className: t.purchaseControls, children: [
163
+ i && /* @__PURE__ */ a(
164
+ R,
141
165
  {
142
- availId: m,
143
- availDescription: f,
144
- inventory: N,
145
- enableTooltip: !0
166
+ pricingLabel: u ? "Your Price" : "List Price",
167
+ price: i,
168
+ listPrice: u && I !== "EndUser" ? x : void 0,
169
+ quantity: y,
170
+ className: t.pricing
146
171
  }
147
172
  ),
148
- l && /* @__PURE__ */ a(V, { pricingLabel: v, price: l })
149
- ] }),
150
- /* @__PURE__ */ a(E, { size: r, itemKey: c, onAdd: I, max: w, className: t.addToCart, addButtonClassName: t.addToCartButton, requiresUnitDetails: A })
173
+ /* @__PURE__ */ a(V, { size: r, itemKey: d, onAdd: P, max: $, className: t.addToCart, addButtonClassName: t.addToCartButton, requiresUnitDetails: w, onQuantityChange: D })
174
+ ] })
151
175
  ] }),
152
- _ && _.length > 0 && /* @__PURE__ */ a("ul", { className: t.attributeContainer, children: _.map((p) => /* @__PURE__ */ e("li", { children: [
176
+ _ && _.length > 0 && /* @__PURE__ */ a("ul", { className: t.attributeContainer, children: _.map((h) => /* @__PURE__ */ e("li", { children: [
153
177
  /* @__PURE__ */ e(n, { size: "xs", weight: "light", children: [
154
- p.label,
178
+ h.label,
155
179
  ":"
156
180
  ] }),
157
- /* @__PURE__ */ a(n, { size: "xs", weight: "semibold", children: p.value })
158
- ] }, `${p.label}.${p.value}`)) })
181
+ /* @__PURE__ */ a(n, { size: "xs", weight: "semibold", children: h.value })
182
+ ] }, `${h.label}.${h.value}`)) })
159
183
  ] })
160
184
  ] });
161
185
  }
162
186
  export {
163
- nt as Product
187
+ ht as Product
164
188
  };
@@ -44,10 +44,16 @@ declare const meta: {
44
44
  partNumber: {
45
45
  control: "text";
46
46
  };
47
- priceLabel: {
47
+ price: {
48
48
  control: "text";
49
49
  };
50
- price: {
50
+ listPrice: {
51
+ control: "text";
52
+ };
53
+ isSignedIn: {
54
+ control: "boolean";
55
+ };
56
+ customerClass: {
51
57
  control: "text";
52
58
  };
53
59
  imgSrc: {
@@ -93,7 +99,7 @@ export declare const LimitedStock: Story;
93
99
  export declare const Unavailable: Story;
94
100
  export declare const ContactForAvailability: Story;
95
101
  export declare const TileView: Story;
96
- export declare const DifferentPriceLabel: Story;
102
+ export declare const GuestPrice: Story;
97
103
  export declare const NoImageCard: Story;
98
104
  export declare const FlatTile: Story;
99
105
  export declare const NoImageFlatCard: Story;
@@ -1,4 +1,4 @@
1
- import { Product as i } from "./Product.js";
1
+ import { Product as a } from "./Product.js";
2
2
  const e = [
3
3
  { label: "Color", value: "Gray" },
4
4
  { label: "Brand", value: "Kason" },
@@ -13,7 +13,7 @@ const e = [
13
13
  { label: "Attribute", value: "Placeholder" }
14
14
  ], r = {
15
15
  title: "Case Parts/Organisms/Product",
16
- component: i,
16
+ component: a,
17
17
  parameters: { layout: "centered" },
18
18
  argTypes: {
19
19
  productView: {
@@ -35,8 +35,10 @@ const e = [
35
35
  customWizardText: { control: "text" },
36
36
  productHref: { control: "text" },
37
37
  partNumber: { control: "text" },
38
- priceLabel: { control: "text" },
39
38
  price: { control: "text" },
39
+ listPrice: { control: "text" },
40
+ isSignedIn: { control: "boolean" },
41
+ customerClass: { control: "text" },
40
42
  imgSrc: { control: "text" },
41
43
  itemKey: { control: "number" },
42
44
  onAddToCart: { action: "addToCart", description: "(itemKey, quantity)" },
@@ -60,13 +62,15 @@ const e = [
60
62
  productHref: "https://mobiledev.caseparts.com/part/1092-01/Kason-1092-Hydraulic-Door-Closer",
61
63
  availId: "available",
62
64
  availDescription: "In stock",
63
- priceLabel: "List Price",
64
65
  price: "$129.99",
66
+ listPrice: "$149.99",
67
+ isSignedIn: !0,
68
+ customerClass: "Dealer",
65
69
  imgSrc: "https://dev.caseparts.com/graphics/photos/R-23_IMG_2009.png",
66
70
  // imgSrc: 'https://www.caseparts.com/Ortery/360/Optimized/1092-01_/1092-01_04.webp',
67
71
  attributes: e,
68
- onAddToCart: (t, a) => {
69
- alert(`Add to cart (story) ${JSON.stringify({ itemKey: t, quantity: a })}`);
72
+ onAddToCart: (t, i) => {
73
+ alert(`Add to cart (story) ${JSON.stringify({ itemKey: t, quantity: i })}`);
70
74
  },
71
75
  flat: !1,
72
76
  size: "md",
@@ -75,16 +79,15 @@ const e = [
75
79
  maxQuantity: void 0
76
80
  },
77
81
  tags: ["autodocs"]
78
- }, l = {}, n = {
82
+ }, l = {}, s = {
79
83
  args: {
80
84
  availId: "limited",
81
85
  availDescription: "Limited stock"
82
86
  }
83
- }, s = {
87
+ }, n = {
84
88
  args: {
85
89
  availId: "not-found",
86
- availDescription: "Out of stock",
87
- priceLabel: "Last Known"
90
+ availDescription: "Out of stock"
88
91
  }
89
92
  }, c = {
90
93
  args: {
@@ -98,8 +101,9 @@ const e = [
98
101
  }
99
102
  }, u = {
100
103
  args: {
101
- priceLabel: "Member",
102
- price: "$118.49"
104
+ price: "$118.49",
105
+ isSignedIn: !1,
106
+ listPrice: void 0
103
107
  }
104
108
  }, p = {
105
109
  args: {
@@ -135,14 +139,14 @@ const e = [
135
139
  export {
136
140
  c as ContactForAvailability,
137
141
  l as Default,
138
- u as DifferentPriceLabel,
139
142
  m as FlatTile,
140
- n as LimitedStock,
143
+ u as GuestPrice,
144
+ s as LimitedStock,
141
145
  b as MaxQuantityCard,
142
146
  y as MaxQuantityTile,
143
147
  p as NoImageCard,
144
148
  v as NoImageFlatCard,
145
149
  d as TileView,
146
- s as Unavailable,
150
+ n as Unavailable,
147
151
  r as default
148
152
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@caseparts-org/caseblocks",
3
3
  "private": false,
4
- "version": "0.0.272",
4
+ "version": "0.0.274",
5
5
  "type": "module",
6
6
  "module": "dist/main.js",
7
7
  "types": "dist/main.d.ts",