@caseparts-org/caseblocks 0.0.273 → 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.
- package/dist/assets/Pricing.css +1 -1
- package/dist/assets/Product.css +1 -1
- package/dist/assets/QuantityInput.css +1 -1
- package/dist/molecules/Cart/CartPart.js +26 -18
- package/dist/molecules/Pricing/Pricing.d.ts +4 -1
- package/dist/molecules/Pricing/Pricing.js +62 -11
- package/dist/molecules/QuantityInput/QuantityInput.js +39 -39
- package/dist/organisms/Product/Product.d.ts +4 -2
- package/dist/organisms/Product/Product.js +121 -97
- package/dist/organisms/Product/Product.stories.d.ts +9 -3
- package/dist/organisms/Product/Product.stories.js +19 -15
- package/package.json +1 -1
package/dist/assets/Pricing.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
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}
|
package/dist/assets/Product.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
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-
|
|
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:
|
|
20
|
-
titleHref:
|
|
19
|
+
title: u,
|
|
20
|
+
titleHref: I,
|
|
21
21
|
onTitleNavigate: d,
|
|
22
|
-
partNumber:
|
|
22
|
+
partNumber: g,
|
|
23
23
|
unit: E,
|
|
24
24
|
make: M,
|
|
25
25
|
model: R,
|
|
26
26
|
serial: w,
|
|
27
|
-
custom:
|
|
27
|
+
custom: N,
|
|
28
28
|
availabilityId: D,
|
|
29
|
-
availability:
|
|
29
|
+
availability: y,
|
|
30
30
|
inventory: L,
|
|
31
31
|
source: i = "none",
|
|
32
32
|
priceLabel: j = "List Price",
|
|
33
|
-
price:
|
|
34
|
-
quantity:
|
|
35
|
-
maxQuantity:
|
|
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
|
|
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:
|
|
58
|
-
|
|
59
|
-
/* @__PURE__ */ r(t, { colorToken: "quaternary", size: "xs", children:
|
|
60
|
-
|
|
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
|
-
|
|
98
|
+
y && /* @__PURE__ */ r(
|
|
99
99
|
Y,
|
|
100
100
|
{
|
|
101
101
|
availId: D || "not-found",
|
|
102
|
-
availDescription:
|
|
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:
|
|
120
|
-
|
|
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:
|
|
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,
|
|
2
|
-
import { c as
|
|
3
|
-
import { Text as
|
|
4
|
-
import '../../assets/Pricing.css';const
|
|
5
|
-
pricingInformation:
|
|
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
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
65
|
+
P as Pricing
|
|
15
66
|
};
|
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as N, jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import { c as r } from "../../clsx-OuTLNxxd.js";
|
|
3
3
|
import { Icon as l } from "../../atoms/Icon/Icon.js";
|
|
4
|
-
import { getHideAtStyles as
|
|
4
|
+
import { getHideAtStyles as g } from "../../atoms/HideAt.js";
|
|
5
5
|
import '../../assets/QuantityInput.css';const s = {
|
|
6
|
-
"qty-container": "_qty-
|
|
7
|
-
"decrease-btn": "_decrease-
|
|
8
|
-
"increase-btn": "_increase-
|
|
9
|
-
"button-sm": "_button-
|
|
10
|
-
"button-md": "_button-
|
|
11
|
-
"button-lg": "_button-
|
|
12
|
-
"qty-input-sm": "_qty-input-
|
|
13
|
-
"qty-input-md": "_qty-input-
|
|
14
|
-
"qty-input-lg": "_qty-input-
|
|
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
16
|
function $({
|
|
17
|
-
quantity:
|
|
17
|
+
quantity: a = 1,
|
|
18
18
|
onQuantityChange: _,
|
|
19
|
-
min:
|
|
20
|
-
max:
|
|
19
|
+
min: n = 1,
|
|
20
|
+
max: e = 9999,
|
|
21
21
|
className: b,
|
|
22
|
-
wrapperClassName:
|
|
23
|
-
hideAt:
|
|
24
|
-
size:
|
|
25
|
-
...
|
|
22
|
+
wrapperClassName: d,
|
|
23
|
+
hideAt: p,
|
|
24
|
+
size: o = "md",
|
|
25
|
+
...y
|
|
26
26
|
}) {
|
|
27
|
-
const
|
|
28
|
-
const 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
29
|
_(i);
|
|
30
|
-
},
|
|
31
|
-
return /* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */
|
|
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: r(s["decrease-btn"], s[`button-${
|
|
37
|
-
onClick:
|
|
38
|
-
disabled:
|
|
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__ */
|
|
40
|
+
children: /* @__PURE__ */ c(l, { iconKey: "fa-solid fa-minus", size: o === "sm" ? "3xs" : "xs" })
|
|
41
41
|
}
|
|
42
42
|
),
|
|
43
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ c(
|
|
44
44
|
"input",
|
|
45
45
|
{
|
|
46
|
-
className: r(s["qty-input"], s[`qty-input-${
|
|
46
|
+
className: r(s["qty-input"], s[`qty-input-${o}`], b),
|
|
47
47
|
type: "number",
|
|
48
|
-
min:
|
|
49
|
-
max:
|
|
50
|
-
value:
|
|
48
|
+
min: n,
|
|
49
|
+
max: e,
|
|
50
|
+
value: a,
|
|
51
51
|
onFocus: (t) => t.currentTarget.select(),
|
|
52
52
|
onChange: (t) => {
|
|
53
53
|
const i = parseInt(t.target.value, 10);
|
|
54
|
-
u(Number.isNaN(i) ?
|
|
54
|
+
u(Number.isNaN(i) ? n ?? 1 : i);
|
|
55
55
|
},
|
|
56
56
|
"aria-label": "Quantity",
|
|
57
|
-
...
|
|
57
|
+
...y
|
|
58
58
|
}
|
|
59
59
|
),
|
|
60
|
-
/* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ c(
|
|
61
61
|
"button",
|
|
62
62
|
{
|
|
63
63
|
type: "button",
|
|
64
|
-
className: r(s["increase-btn"], s[`button-${
|
|
65
|
-
onClick:
|
|
66
|
-
disabled:
|
|
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__ */
|
|
68
|
+
children: /* @__PURE__ */ c(l, { iconKey: "fa-solid fa-plus", size: o === "sm" ? "3xs" : "xs" })
|
|
69
69
|
}
|
|
70
70
|
)
|
|
71
71
|
] });
|
|
@@ -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,
|
|
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
|
|
3
|
-
import {
|
|
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
|
|
6
|
-
import { Pricing as
|
|
7
|
-
import { AddToCart as
|
|
8
|
-
import { CustomWizardBadge as
|
|
9
|
-
import { c as
|
|
10
|
-
import '../../assets/Product.css';const M = "
|
|
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:
|
|
14
|
+
productInformation: Q,
|
|
14
15
|
purchaseInformation: X,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
|
27
|
-
productView:
|
|
28
|
-
itemKey:
|
|
29
|
+
function ht({
|
|
30
|
+
productView: G,
|
|
31
|
+
itemKey: d,
|
|
29
32
|
partNumber: s,
|
|
30
|
-
productDescription:
|
|
33
|
+
productDescription: N,
|
|
31
34
|
availDescription: f,
|
|
32
|
-
availId:
|
|
33
|
-
inventory:
|
|
35
|
+
availId: l,
|
|
36
|
+
inventory: C,
|
|
34
37
|
productHref: T,
|
|
35
|
-
customWizardUrl:
|
|
36
|
-
customWizardText:
|
|
37
|
-
customWizardColorToken:
|
|
38
|
-
|
|
39
|
-
|
|
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:
|
|
43
|
-
onAddToCart:
|
|
44
|
-
flat:
|
|
47
|
+
className: B,
|
|
48
|
+
onAddToCart: P,
|
|
49
|
+
flat: A,
|
|
45
50
|
size: r = "md",
|
|
46
51
|
showQuantity: b = !0,
|
|
47
|
-
onLinkClicked:
|
|
48
|
-
requiresUnitDetails:
|
|
49
|
-
maxQuantity:
|
|
50
|
-
|
|
52
|
+
onLinkClicked: c,
|
|
53
|
+
requiresUnitDetails: w = !1,
|
|
54
|
+
maxQuantity: $,
|
|
55
|
+
...j
|
|
51
56
|
}) {
|
|
52
|
-
const
|
|
53
|
-
return
|
|
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:
|
|
61
|
+
className: F(
|
|
57
62
|
t.productCard,
|
|
58
63
|
r && t[r],
|
|
59
|
-
|
|
60
|
-
!
|
|
64
|
+
B,
|
|
65
|
+
!A && t.elevated,
|
|
61
66
|
!o && t.noImage
|
|
62
67
|
),
|
|
63
|
-
|
|
68
|
+
...j,
|
|
64
69
|
children: [
|
|
65
|
-
|
|
70
|
+
m && /* @__PURE__ */ a(q, { href: m, text: g, colorToken: v }),
|
|
66
71
|
o && /* @__PURE__ */ a(
|
|
67
|
-
|
|
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(
|
|
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:
|
|
79
|
-
/* @__PURE__ */ a(n, { size:
|
|
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__ */
|
|
83
|
-
|
|
84
|
-
|
|
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
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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:
|
|
127
|
+
) : /* @__PURE__ */ e("div", { className: F(
|
|
113
128
|
t.productTile,
|
|
114
|
-
|
|
129
|
+
B,
|
|
115
130
|
r && t[r],
|
|
116
|
-
!
|
|
131
|
+
!A && t.elevated,
|
|
117
132
|
!o && t.noImage
|
|
118
|
-
),
|
|
119
|
-
|
|
133
|
+
), ...j, children: [
|
|
134
|
+
m && /* @__PURE__ */ a(q, { href: m, text: g, colorToken: v }),
|
|
120
135
|
o && /* @__PURE__ */ a(
|
|
121
|
-
|
|
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(
|
|
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:
|
|
134
|
-
/* @__PURE__ */ a(n, { size:
|
|
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__ */
|
|
139
|
-
|
|
140
|
-
|
|
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
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
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
|
-
|
|
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((
|
|
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
|
-
|
|
178
|
+
h.label,
|
|
155
179
|
":"
|
|
156
180
|
] }),
|
|
157
|
-
/* @__PURE__ */ a(n, { size: "xs", weight: "semibold", children:
|
|
158
|
-
] }, `${
|
|
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
|
-
|
|
187
|
+
ht as Product
|
|
164
188
|
};
|
|
@@ -44,10 +44,16 @@ declare const meta: {
|
|
|
44
44
|
partNumber: {
|
|
45
45
|
control: "text";
|
|
46
46
|
};
|
|
47
|
-
|
|
47
|
+
price: {
|
|
48
48
|
control: "text";
|
|
49
49
|
};
|
|
50
|
-
|
|
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
|
|
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
|
|
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:
|
|
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,
|
|
69
|
-
alert(`Add to cart (story) ${JSON.stringify({ itemKey: t, quantity:
|
|
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 = {},
|
|
82
|
+
}, l = {}, s = {
|
|
79
83
|
args: {
|
|
80
84
|
availId: "limited",
|
|
81
85
|
availDescription: "Limited stock"
|
|
82
86
|
}
|
|
83
|
-
},
|
|
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
|
-
|
|
102
|
-
|
|
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
|
-
|
|
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
|
-
|
|
150
|
+
n as Unavailable,
|
|
147
151
|
r as default
|
|
148
152
|
};
|