@caseparts-org/caseblocks 0.0.186 → 0.0.188
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/Cart.module-BwqCrR3s.js +25 -0
- package/dist/assets/AddToCart.css +1 -1
- package/dist/assets/Cart.css +1 -1
- package/dist/assets/SlideInPanel.css +1 -1
- package/dist/atoms/SlideInPanel/SlideInPanel.js +44 -44
- package/dist/molecules/AddToCart/AddToCart.d.ts +2 -1
- package/dist/molecules/AddToCart/AddToCart.js +60 -52
- package/dist/molecules/AddToCart/AddToCart.stories.d.ts +4 -0
- package/dist/molecules/AddToCart/AddToCart.stories.js +15 -10
- package/dist/molecules/Cart/Cart.js +1 -1
- package/dist/molecules/Cart/CartPart.d.ts +2 -1
- package/dist/molecules/Cart/CartPart.js +70 -50
- package/dist/molecules/Cart/CartPart.stories.d.ts +1 -0
- package/dist/molecules/Cart/CartPart.stories.js +1 -0
- package/dist/molecules/Cart/CartSlideInPanel.d.ts +2 -1
- package/dist/molecules/Cart/CartSlideInPanel.js +54 -41
- package/dist/organisms/Product/Product.d.ts +2 -1
- package/dist/organisms/Product/Product.js +59 -57
- package/dist/organisms/Product/Product.stories.d.ts +4 -0
- package/dist/organisms/Product/Product.stories.js +12 -10
- package/package.json +1 -1
- package/dist/Cart.module-B0W9CeI5.js +0 -25
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import './assets/Cart.css';const t = "_cartIconButton_gazlm_2", a = "_count_gazlm_9", o = "_cartContainer_gazlm_24", e = "_headerWrapper_gazlm_35", n = "_header_gazlm_35", _ = "_cartItems_gazlm_53", m = "_cartItem_gazlm_53", c = "_topRow_gazlm_79", r = "_itemInfo_gazlm_85", l = "_editUnit_gazlm_90", s = "_purchaseInformation_gazlm_104", i = "_availabilitySlot_gazlm_110", g = "_priceSlot_gazlm_113", I = "_itemManagement_gazlm_116", u = "_quantitySlot_gazlm_122", z = "_itemImage_gazlm_132", p = "_removeItem_gazlm_135", h = "_noItems_gazlm_145", d = "_subtotal_gazlm_152", S = "_checkoutButton_gazlm_159", y = {
|
|
2
|
+
cartIconButton: t,
|
|
3
|
+
count: a,
|
|
4
|
+
cartContainer: o,
|
|
5
|
+
headerWrapper: e,
|
|
6
|
+
header: n,
|
|
7
|
+
cartItems: _,
|
|
8
|
+
cartItem: m,
|
|
9
|
+
topRow: c,
|
|
10
|
+
itemInfo: r,
|
|
11
|
+
editUnit: l,
|
|
12
|
+
purchaseInformation: s,
|
|
13
|
+
availabilitySlot: i,
|
|
14
|
+
priceSlot: g,
|
|
15
|
+
itemManagement: I,
|
|
16
|
+
quantitySlot: u,
|
|
17
|
+
itemImage: z,
|
|
18
|
+
removeItem: p,
|
|
19
|
+
noItems: h,
|
|
20
|
+
subtotal: d,
|
|
21
|
+
checkoutButton: S
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
y as s
|
|
25
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._container_12mfp_1{display:flex;flex-direction:row;align-items:flex-end;justify-content:space-between;gap:var(--spacing-0-5)}._tooltipContent_12mfp_9{display:inline-flex;align-items:center;gap:var(--spacing-spacing-3xs)}
|
package/dist/assets/Cart.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._cartIconButton_gazlm_2{position:relative;border:none;padding:0;margin:0;background-color:transparent}._count_gazlm_9{position:absolute;top:0;left:14px;border-radius:50%;width:18px;height:18px;display:flex;flex-direction:row;align-items:center;justify-content:center;background-color:var(--color-brand-primary-primary-tangerine);color:var(--color-neutrals-neutral-1);font-weight:var(--font-weight-semibold)}._cartContainer_gazlm_24{height:100vh;width:100%;min-width:320px;max-width:375px;box-sizing:border-box;display:grid;grid-template-rows:auto auto 1fr auto auto;gap:var(--spacing-1);padding:var(--spacing-1)}._headerWrapper_gazlm_35{display:flex;flex-direction:row;align-items:flex-start;gap:var(--spacing-spacing-2xs)}._headerWrapper_gazlm_35>button{padding:0;margin:0;background-color:transparent;border:none}._header_gazlm_35{display:flex;flex-direction:column;align-items:flex-start;width:100%}._cartItems_gazlm_53{height:100%;overflow-y:auto;overflow-x:hidden}._cartItems_gazlm_53 ul{margin:0;padding:0;display:flex;flex-direction:column;gap:var(--spacing-spacing-1xs)}._cartItem_gazlm_53{display:grid;grid-template-columns:auto 1fr;gap:var(--spacing-0-5);align-items:start;box-sizing:border-box;position:relative;list-style:none;margin:0;padding:var(--spacing-0-5);width:100%;border:1px solid var(--color-neutrals-neutral-2);border-radius:var(--border-radius-md)}._topRow_gazlm_79{display:flex;flex-direction:row;align-items:flex-start;justify-content:space-between}._itemInfo_gazlm_85{display:flex;flex-direction:column;align-items:flex-start}._editUnit_gazlm_90{display:flex;align-items:center;text-align:start;gap:var(--spacing-spacing-3xs);border:none;background-color:transparent;padding:0;margin:0;cursor:pointer;color:var(--text-text-links);word-break:break-all;word-wrap:break-word}._purchaseInformation_gazlm_104{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:flex-start;width:100%}._availabilitySlot_gazlm_110{min-width:0}._priceSlot_gazlm_113{justify-self:end}._itemManagement_gazlm_116{display:flex;flex-direction:column;align-items:stretch;gap:var(--spacing-spacing-3xs)}._quantitySlot_gazlm_122{align-self:flex-end}._cartItem_gazlm_53 p{margin:0;padding:0;word-wrap:break-word;white-space:normal;overflow-wrap:break-word}._itemImage_gazlm_132{object-fit:contain}._removeItem_gazlm_135{border:none;background-color:transparent;padding:0;margin:0;cursor:pointer;width:min-content;height:min-content}._noItems_gazlm_145{display:flex;flex-direction:row;align-items:center;justify-content:center;height:100%}._subtotal_gazlm_152{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:var(--spacing-0-5)}._checkoutButton_gazlm_159{width:100%;height:fit-content}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._root_ncbhm_1{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1000;pointer-events:none}._overlay_ncbhm_8{position:absolute;top:0;right:0;bottom:0;left:0;background:#00000073;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);pointer-events:auto}._panel_ncbhm_16{position:absolute;background:#fff;box-shadow:0 4px 18px #00000040;display:flex;flex-direction:column;overflow:auto;pointer-events:auto;transition:transform .28s cubic-bezier(.28,.8,.32,1),opacity .28s;will-change:transform}._panel-left_ncbhm_29{top:0;left:0;height:100dvh;max-width:100%;transform:translate(-100%)}._panel-right_ncbhm_36{top:0;right:0;height:100dvh;max-width:100%;transform:translate(100%)}._panel-bottom_ncbhm_43{left:0;bottom:0;width:100%;max-height:100%;transform:translateY(100%)}._active_ncbhm_52._from-left_ncbhm_52 ._panel-left_ncbhm_29,._active_ncbhm_52._from-right_ncbhm_53 ._panel-right_ncbhm_36{transform:translate(0)}._active_ncbhm_52._from-bottom_ncbhm_54 ._panel-bottom_ncbhm_43{transform:translateY(0)}
|
|
@@ -1,89 +1,89 @@
|
|
|
1
1
|
import { jsxs as k, jsx as u } from "react/jsx-runtime";
|
|
2
2
|
import * as r from "react";
|
|
3
3
|
import { r as A } from "../../index-BkF-BQ3Q.js";
|
|
4
|
-
import { c } from "../../clsx-OuTLNxxd.js";
|
|
4
|
+
import { c as m } from "../../clsx-OuTLNxxd.js";
|
|
5
5
|
import { getHideAtStyles as N } from "../HideAt.js";
|
|
6
|
-
import '../../assets/SlideInPanel.css';const q = "
|
|
6
|
+
import '../../assets/SlideInPanel.css';const q = "_root_ncbhm_1", P = "_overlay_ncbhm_8", R = "_panel_ncbhm_16", j = "_active_ncbhm_52", o = {
|
|
7
7
|
root: q,
|
|
8
8
|
overlay: P,
|
|
9
9
|
panel: R,
|
|
10
|
-
"panel-left": "_panel-
|
|
11
|
-
"panel-right": "_panel-
|
|
12
|
-
"panel-bottom": "_panel-
|
|
10
|
+
"panel-left": "_panel-left_ncbhm_29",
|
|
11
|
+
"panel-right": "_panel-right_ncbhm_36",
|
|
12
|
+
"panel-bottom": "_panel-bottom_ncbhm_43",
|
|
13
13
|
active: j,
|
|
14
|
-
"from-left": "_from-
|
|
15
|
-
"from-right": "_from-
|
|
16
|
-
"from-bottom": "_from-
|
|
14
|
+
"from-left": "_from-left_ncbhm_52",
|
|
15
|
+
"from-right": "_from-right_ncbhm_53",
|
|
16
|
+
"from-bottom": "_from-bottom_ncbhm_54"
|
|
17
17
|
}, D = ({
|
|
18
|
-
side:
|
|
19
|
-
open:
|
|
20
|
-
onClose:
|
|
18
|
+
side: n,
|
|
19
|
+
open: e,
|
|
20
|
+
onClose: a,
|
|
21
21
|
children: d,
|
|
22
|
-
width:
|
|
23
|
-
height:
|
|
24
|
-
className:
|
|
25
|
-
overlayClassName:
|
|
26
|
-
panelClassName:
|
|
22
|
+
width: b = 375,
|
|
23
|
+
height: h = "50%",
|
|
24
|
+
className: v,
|
|
25
|
+
overlayClassName: p,
|
|
26
|
+
panelClassName: y,
|
|
27
27
|
closeOnOverlayClick: x = !0,
|
|
28
|
-
disableEsc:
|
|
28
|
+
disableEsc: f = !1,
|
|
29
29
|
hideAt: E,
|
|
30
30
|
ariaLabel: g = "Panel"
|
|
31
31
|
}) => {
|
|
32
|
-
const [
|
|
32
|
+
const [c, _] = r.useState(e), [l, s] = r.useState(!1);
|
|
33
33
|
r.useEffect(() => {
|
|
34
|
-
|
|
35
|
-
requestAnimationFrame(() =>
|
|
36
|
-
})) :
|
|
37
|
-
}, [
|
|
38
|
-
if (!
|
|
39
|
-
const
|
|
40
|
-
S.key === "Escape" &&
|
|
34
|
+
e ? (c || _(!0), s(!1), requestAnimationFrame(() => {
|
|
35
|
+
requestAnimationFrame(() => s(!0));
|
|
36
|
+
})) : s(!1);
|
|
37
|
+
}, [e, c]), r.useEffect(() => {
|
|
38
|
+
if (!e || f) return;
|
|
39
|
+
const t = (S) => {
|
|
40
|
+
S.key === "Escape" && a();
|
|
41
41
|
};
|
|
42
|
-
return window.addEventListener("keydown",
|
|
43
|
-
}, [
|
|
44
|
-
const
|
|
42
|
+
return window.addEventListener("keydown", t), () => window.removeEventListener("keydown", t);
|
|
43
|
+
}, [e, f, a]);
|
|
44
|
+
const i = r.useRef(null);
|
|
45
45
|
if (r.useEffect(() => {
|
|
46
|
-
if (
|
|
47
|
-
const
|
|
46
|
+
if (e && l && i.current) {
|
|
47
|
+
const t = i.current.querySelector(
|
|
48
48
|
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
49
49
|
);
|
|
50
|
-
|
|
50
|
+
t == null || t.focus();
|
|
51
51
|
}
|
|
52
|
-
}, [
|
|
53
|
-
const w =
|
|
52
|
+
}, [e, l]), !c || typeof document > "u") return null;
|
|
53
|
+
const w = n === "bottom" ? { height: h } : { width: b };
|
|
54
54
|
return A.createPortal(
|
|
55
55
|
/* @__PURE__ */ k(
|
|
56
56
|
"div",
|
|
57
57
|
{
|
|
58
|
-
className:
|
|
58
|
+
className: m(
|
|
59
59
|
o.root,
|
|
60
|
-
o[`from-${
|
|
61
|
-
|
|
60
|
+
o[`from-${n}`],
|
|
61
|
+
l && o.active,
|
|
62
62
|
N(E),
|
|
63
|
-
|
|
63
|
+
v
|
|
64
64
|
),
|
|
65
|
-
"aria-hidden": !
|
|
65
|
+
"aria-hidden": !e,
|
|
66
66
|
children: [
|
|
67
67
|
/* @__PURE__ */ u(
|
|
68
68
|
"div",
|
|
69
69
|
{
|
|
70
|
-
className:
|
|
70
|
+
className: m(o.overlay, p),
|
|
71
71
|
onClick: () => {
|
|
72
|
-
|
|
72
|
+
e && x && a();
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
),
|
|
76
76
|
/* @__PURE__ */ u(
|
|
77
77
|
"div",
|
|
78
78
|
{
|
|
79
|
-
ref:
|
|
79
|
+
ref: i,
|
|
80
80
|
role: "dialog",
|
|
81
81
|
"aria-modal": "true",
|
|
82
82
|
"aria-label": g,
|
|
83
|
-
className:
|
|
83
|
+
className: m(o.panel, o[`panel-${n}`], y),
|
|
84
84
|
style: w,
|
|
85
|
-
onTransitionEnd: (
|
|
86
|
-
|
|
85
|
+
onTransitionEnd: (t) => {
|
|
86
|
+
t.propertyName === "transform" && !e && _(!1);
|
|
87
87
|
},
|
|
88
88
|
children: d
|
|
89
89
|
}
|
|
@@ -16,5 +16,6 @@ export interface AddToCartProps {
|
|
|
16
16
|
buttonText?: string;
|
|
17
17
|
buttonDoneText?: string;
|
|
18
18
|
size?: "sm" | "md";
|
|
19
|
+
requiresUnitDetails?: boolean;
|
|
19
20
|
}
|
|
20
|
-
export declare function AddToCart({ itemKey, disableButton, initialQuantity, min, max, onQuantityChange, onAdd, autoHideDelayMs, showQuantity, className, addButtonClassName, addButtonVariant, buttonText, buttonDoneText, size }: AddToCartProps): React.ReactElement | null;
|
|
21
|
+
export declare function AddToCart({ itemKey, disableButton, initialQuantity, min, max, onQuantityChange, onAdd, autoHideDelayMs, showQuantity, className, addButtonClassName, addButtonVariant, buttonText, buttonDoneText, size, requiresUnitDetails }: AddToCartProps): React.ReactElement | null;
|
|
@@ -1,66 +1,74 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { c as
|
|
4
|
-
import { StatefulButton as
|
|
1
|
+
import { jsxs as u, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import o from "react";
|
|
3
|
+
import { c as j } from "../../clsx-OuTLNxxd.js";
|
|
4
|
+
import { StatefulButton as q } from "../StatefulButton/StatefulButton.js";
|
|
5
5
|
import { QuantityInput as y } from "../QuantityInput/QuantityInput.js";
|
|
6
|
-
import
|
|
7
|
-
|
|
6
|
+
import { Tooltip as B } from "../../atoms/Tooltip/Tooltip.js";
|
|
7
|
+
import { Text as I } from "../../atoms/Text/Text.js";
|
|
8
|
+
import { Icon as M } from "../../atoms/Icon/Icon.js";
|
|
9
|
+
import '../../assets/AddToCart.css';const w = "_container_12mfp_1", E = "_tooltipContent_12mfp_9", m = {
|
|
10
|
+
container: w,
|
|
11
|
+
tooltipContent: E
|
|
8
12
|
};
|
|
9
|
-
function
|
|
10
|
-
itemKey:
|
|
11
|
-
disableButton:
|
|
12
|
-
initialQuantity:
|
|
13
|
-
min:
|
|
14
|
-
max:
|
|
15
|
-
onQuantityChange:
|
|
16
|
-
onAdd:
|
|
17
|
-
autoHideDelayMs:
|
|
18
|
-
showQuantity:
|
|
19
|
-
className:
|
|
20
|
-
addButtonClassName:
|
|
21
|
-
addButtonVariant:
|
|
22
|
-
buttonText:
|
|
23
|
-
buttonDoneText:
|
|
24
|
-
size: a
|
|
13
|
+
function V({
|
|
14
|
+
itemKey: c,
|
|
15
|
+
disableButton: f,
|
|
16
|
+
initialQuantity: p = 1,
|
|
17
|
+
min: s = 1,
|
|
18
|
+
max: _,
|
|
19
|
+
onQuantityChange: n,
|
|
20
|
+
onAdd: x,
|
|
21
|
+
autoHideDelayMs: T = 3e3,
|
|
22
|
+
showQuantity: b = !0,
|
|
23
|
+
className: A,
|
|
24
|
+
addButtonClassName: N,
|
|
25
|
+
addButtonVariant: R,
|
|
26
|
+
buttonText: S,
|
|
27
|
+
buttonDoneText: k,
|
|
28
|
+
size: a,
|
|
29
|
+
requiresUnitDetails: v = !1
|
|
25
30
|
}) {
|
|
26
|
-
const [
|
|
27
|
-
const e = Number(
|
|
28
|
-
return e <
|
|
29
|
-
}), [
|
|
30
|
-
|
|
31
|
+
const [i, z] = o.useState(() => {
|
|
32
|
+
const e = Number(p) || 1;
|
|
33
|
+
return e < s ? s : e;
|
|
34
|
+
}), [C, d] = o.useState(!1), t = o.useRef(null);
|
|
35
|
+
o.useEffect(() => () => {
|
|
31
36
|
t.current && clearTimeout(t.current);
|
|
32
37
|
}, []);
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
}, [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
const h = o.useCallback((e) => {
|
|
39
|
+
z(e), n == null || n(e);
|
|
40
|
+
}, [n]), l = /* @__PURE__ */ r(
|
|
41
|
+
q,
|
|
42
|
+
{
|
|
43
|
+
size: a || "md",
|
|
44
|
+
variant: R || "cta-primary",
|
|
45
|
+
completed: C,
|
|
46
|
+
onClick: async () => {
|
|
47
|
+
c && (await x(c, i), d(!0), t.current && clearTimeout(t.current), t.current = setTimeout(() => d(!1), T));
|
|
48
|
+
},
|
|
49
|
+
text: S,
|
|
50
|
+
completedText: k,
|
|
51
|
+
disabled: !c || f,
|
|
52
|
+
className: N
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
return /* @__PURE__ */ u("div", { className: j(m.container, A), children: [
|
|
56
|
+
b && /* @__PURE__ */ r(
|
|
40
57
|
y,
|
|
41
58
|
{
|
|
42
|
-
quantity:
|
|
43
|
-
onQuantityChange:
|
|
44
|
-
min:
|
|
45
|
-
max:
|
|
59
|
+
quantity: i,
|
|
60
|
+
onQuantityChange: h,
|
|
61
|
+
min: s,
|
|
62
|
+
max: _,
|
|
46
63
|
size: a || "md"
|
|
47
64
|
}
|
|
48
65
|
),
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
|
|
51
|
-
{
|
|
52
|
-
|
|
53
|
-
variant: b || "cta-primary",
|
|
54
|
-
completed: R,
|
|
55
|
-
onClick: j,
|
|
56
|
-
text: k,
|
|
57
|
-
completedText: A,
|
|
58
|
-
disabled: !s || i,
|
|
59
|
-
className: _
|
|
60
|
-
}
|
|
61
|
-
)
|
|
66
|
+
v ? /* @__PURE__ */ r(B, { trigger: l, children: /* @__PURE__ */ u("div", { className: m.tooltipContent, children: [
|
|
67
|
+
/* @__PURE__ */ r(M, { iconKey: "fa-regular fa-barcode-read", size: "sm" }),
|
|
68
|
+
/* @__PURE__ */ r(I, { size: "sm", children: "Requires Make, Model, and Serial" })
|
|
69
|
+
] }) }) : l
|
|
62
70
|
] });
|
|
63
71
|
}
|
|
64
72
|
export {
|
|
65
|
-
|
|
73
|
+
V as AddToCart
|
|
66
74
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AddToCart as
|
|
2
|
-
const
|
|
1
|
+
import { AddToCart as n } from "./AddToCart.js";
|
|
2
|
+
const a = {
|
|
3
3
|
title: "Case Parts/Molecules/AddToCart",
|
|
4
|
-
component:
|
|
4
|
+
component: n,
|
|
5
5
|
parameters: { layout: "centered" },
|
|
6
6
|
argTypes: {
|
|
7
7
|
itemKey: {
|
|
@@ -43,6 +43,10 @@ const i = {
|
|
|
43
43
|
control: "text",
|
|
44
44
|
description: "Label after add completes"
|
|
45
45
|
},
|
|
46
|
+
requiresUnitDetails: {
|
|
47
|
+
control: "boolean",
|
|
48
|
+
description: "Shows a tooltip on the add button when unit details are required"
|
|
49
|
+
},
|
|
46
50
|
className: { control: "text" },
|
|
47
51
|
addButtonClassName: { control: "text" }
|
|
48
52
|
},
|
|
@@ -53,10 +57,11 @@ const i = {
|
|
|
53
57
|
max: void 0,
|
|
54
58
|
autoHideDelayMs: 2500,
|
|
55
59
|
showQuantity: !0,
|
|
60
|
+
requiresUnitDetails: !1,
|
|
56
61
|
buttonText: "Add",
|
|
57
62
|
buttonDoneText: "Added!",
|
|
58
63
|
onAdd: async (t, e) => {
|
|
59
|
-
await new Promise((
|
|
64
|
+
await new Promise((o) => setTimeout(o, 600)), alert(`Added (story default):${JSON.stringify({ itemKey: t, quantity: e })}`);
|
|
60
65
|
}
|
|
61
66
|
},
|
|
62
67
|
tags: ["autodocs"]
|
|
@@ -76,11 +81,11 @@ const i = {
|
|
|
76
81
|
buttonText: "Add to Cart",
|
|
77
82
|
buttonDoneText: "In Cart"
|
|
78
83
|
}
|
|
79
|
-
},
|
|
84
|
+
}, l = {
|
|
80
85
|
name: "Async (Simulated Slow)",
|
|
81
86
|
args: {
|
|
82
87
|
onAdd: async (t, e) => {
|
|
83
|
-
await new Promise((
|
|
88
|
+
await new Promise((o) => setTimeout(o, 1800)), console.log("Slow add complete:", { itemKey: t, quantity: e });
|
|
84
89
|
}
|
|
85
90
|
},
|
|
86
91
|
parameters: {
|
|
@@ -90,17 +95,17 @@ const i = {
|
|
|
90
95
|
}
|
|
91
96
|
}
|
|
92
97
|
}
|
|
93
|
-
},
|
|
98
|
+
}, c = {
|
|
94
99
|
args: {
|
|
95
100
|
autoHideDelayMs: 5e3
|
|
96
101
|
}
|
|
97
102
|
};
|
|
98
103
|
export {
|
|
99
|
-
|
|
100
|
-
|
|
104
|
+
l as AsyncSlowAdd,
|
|
105
|
+
c as CustomAutoHideDelay,
|
|
101
106
|
u as CustomTexts,
|
|
102
107
|
s as Default,
|
|
103
108
|
d as HiddenQuantity,
|
|
104
109
|
r as WithMaxConstraint,
|
|
105
|
-
|
|
110
|
+
a as default
|
|
106
111
|
};
|
|
@@ -2,7 +2,7 @@ import { jsx as a, jsxs as d } from "react/jsx-runtime";
|
|
|
2
2
|
import l from "react";
|
|
3
3
|
import { Icon as g } from "../../atoms/Icon/Icon.js";
|
|
4
4
|
import { Text as p } from "../../atoms/Text/Text.js";
|
|
5
|
-
import { s as m } from "../../Cart.module-
|
|
5
|
+
import { s as m } from "../../Cart.module-BwqCrR3s.js";
|
|
6
6
|
const S = l.forwardRef(function({
|
|
7
7
|
cart: i,
|
|
8
8
|
open: t = !1,
|
|
@@ -22,5 +22,6 @@ export interface CartPartProps extends Omit<React.LiHTMLAttributes<HTMLLIElement
|
|
|
22
22
|
onQuantityChange?: (_quantity: number) => void;
|
|
23
23
|
onRemove?: () => void;
|
|
24
24
|
onUnitEditClick?: () => void;
|
|
25
|
+
requiresUnitDetails?: boolean;
|
|
25
26
|
}
|
|
26
|
-
export declare function CartPart({ imageUrl, imageAlt, title, titleHref, onTitleNavigate, partNumber, unit, make, model, serial, custom, availabilityId, availability, contactHref, contactLinkBehavior, priceLabel, price, quantity, onQuantityChange, onRemove, onUnitEditClick, className, ...otherProps }: CartPartProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare function CartPart({ imageUrl, imageAlt, title, titleHref, onTitleNavigate, partNumber, unit, make, model, serial, custom, availabilityId, availability, contactHref, contactLinkBehavior, priceLabel, price, quantity, onQuantityChange, onRemove, onUnitEditClick, requiresUnitDetails, className, ...otherProps }: CartPartProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,86 +1,106 @@
|
|
|
1
|
-
import { jsxs as a, jsx as
|
|
1
|
+
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { Link as q } from "../../atoms/Link/Link.js";
|
|
3
|
-
import { Text as
|
|
4
|
-
import { Image as
|
|
5
|
-
import { Availability as
|
|
6
|
-
import { Pricing as
|
|
7
|
-
import { QuantityInput as
|
|
8
|
-
import { Icon as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
3
|
+
import { Text as m } from "../../atoms/Text/Text.js";
|
|
4
|
+
import { Image as R } from "../../atoms/Image/Image.js";
|
|
5
|
+
import { Availability as T } from "../Availability/Availability.js";
|
|
6
|
+
import { Pricing as v } from "../Pricing/Pricing.js";
|
|
7
|
+
import { QuantityInput as A } from "../QuantityInput/QuantityInput.js";
|
|
8
|
+
import { Icon as o } from "../../atoms/Icon/Icon.js";
|
|
9
|
+
import { Tooltip as B } from "../../atoms/Tooltip/Tooltip.js";
|
|
10
|
+
import { c as D } from "../../clsx-OuTLNxxd.js";
|
|
11
|
+
import { s as i } from "../../Cart.module-BwqCrR3s.js";
|
|
12
|
+
function X({
|
|
12
13
|
imageUrl: b,
|
|
13
14
|
imageAlt: g = "Product image",
|
|
14
|
-
title:
|
|
15
|
-
titleHref:
|
|
15
|
+
title: c,
|
|
16
|
+
titleHref: n,
|
|
16
17
|
onTitleNavigate: t,
|
|
17
|
-
partNumber:
|
|
18
|
+
partNumber: d,
|
|
18
19
|
unit: I,
|
|
19
20
|
make: k,
|
|
20
|
-
model:
|
|
21
|
-
serial:
|
|
22
|
-
custom:
|
|
23
|
-
availabilityId:
|
|
24
|
-
availability:
|
|
21
|
+
model: z,
|
|
22
|
+
serial: K,
|
|
23
|
+
custom: N,
|
|
24
|
+
availabilityId: x,
|
|
25
|
+
availability: f,
|
|
25
26
|
contactHref: P,
|
|
26
27
|
contactLinkBehavior: S = "new-tab",
|
|
27
28
|
priceLabel: w = "List Price",
|
|
28
|
-
price:
|
|
29
|
-
quantity:
|
|
30
|
-
onQuantityChange:
|
|
31
|
-
onRemove:
|
|
32
|
-
onUnitEditClick:
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
price: h,
|
|
30
|
+
quantity: u,
|
|
31
|
+
onQuantityChange: p,
|
|
32
|
+
onRemove: y,
|
|
33
|
+
onUnitEditClick: l,
|
|
34
|
+
requiresUnitDetails: j = !1,
|
|
35
|
+
className: C,
|
|
36
|
+
...L
|
|
35
37
|
}) {
|
|
36
|
-
function
|
|
37
|
-
|
|
38
|
+
function M(r) {
|
|
39
|
+
r.defaultPrevented || r.button === 0 && (r.metaKey || r.altKey || r.ctrlKey || r.shiftKey || r.currentTarget.target && r.currentTarget.target !== "_self" || t == null || t(r));
|
|
38
40
|
}
|
|
39
|
-
const
|
|
40
|
-
return /* @__PURE__ */ a("li", { className:
|
|
41
|
-
/* @__PURE__ */
|
|
41
|
+
const s = I || [k, z, K].filter(Boolean).join(" / ");
|
|
42
|
+
return /* @__PURE__ */ a("li", { className: D(i.cartItem, C), ...L, children: [
|
|
43
|
+
/* @__PURE__ */ e(R, { height: 50, width: 50, src: b || "", alt: g, className: i.itemImage }),
|
|
42
44
|
/* @__PURE__ */ a("div", { children: [
|
|
43
45
|
/* @__PURE__ */ a("div", { className: i.topRow, children: [
|
|
44
46
|
/* @__PURE__ */ a("div", { className: i.itemInfo, children: [
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
|
|
47
|
+
/* @__PURE__ */ e(m, { size: "sm", weight: "semibold", children: n ? /* @__PURE__ */ e(q, { href: n, onClick: M, children: c }) : c }),
|
|
48
|
+
d != null && /* @__PURE__ */ a(m, { size: "sm", children: [
|
|
49
|
+
/* @__PURE__ */ e(m, { colorToken: "quaternary", size: "xs", children: N ? "Specs " : "Part # " }),
|
|
50
|
+
d
|
|
49
51
|
] }),
|
|
50
|
-
|
|
52
|
+
s && l && (j ? /* @__PURE__ */ e(
|
|
53
|
+
B,
|
|
54
|
+
{
|
|
55
|
+
trigger: /* @__PURE__ */ a(
|
|
56
|
+
"button",
|
|
57
|
+
{
|
|
58
|
+
onClick: l,
|
|
59
|
+
className: i.editUnit,
|
|
60
|
+
"aria-label": "Edit make, model, and serial",
|
|
61
|
+
type: "button",
|
|
62
|
+
children: [
|
|
63
|
+
/* @__PURE__ */ e(o, { iconKey: "fa-light fa-file-pen", size: "sm" }),
|
|
64
|
+
s
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
),
|
|
68
|
+
children: "Requires Make, Model, and Serial"
|
|
69
|
+
}
|
|
70
|
+
) : /* @__PURE__ */ a(
|
|
51
71
|
"button",
|
|
52
72
|
{
|
|
53
|
-
onClick:
|
|
73
|
+
onClick: l,
|
|
54
74
|
className: i.editUnit,
|
|
55
75
|
"aria-label": "Edit make, model, and serial",
|
|
56
76
|
type: "button",
|
|
57
77
|
children: [
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
|
|
78
|
+
/* @__PURE__ */ e(o, { iconKey: "fa-light fa-file-pen", size: "sm" }),
|
|
79
|
+
s
|
|
60
80
|
]
|
|
61
81
|
}
|
|
62
|
-
)
|
|
82
|
+
))
|
|
63
83
|
] }),
|
|
64
|
-
|
|
84
|
+
y && /* @__PURE__ */ e("button", { onClick: y, className: i.removeItem, "aria-label": "Remove item", type: "button", children: /* @__PURE__ */ e(o, { iconKey: "fa-regular fa-trash", size: "sm" }) })
|
|
65
85
|
] }),
|
|
66
86
|
/* @__PURE__ */ a("div", { className: i.itemManagement, children: [
|
|
67
87
|
/* @__PURE__ */ a("div", { className: i.purchaseInformation, children: [
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
-
|
|
88
|
+
/* @__PURE__ */ e("div", { className: i.availabilitySlot, children: f && /* @__PURE__ */ e(
|
|
89
|
+
T,
|
|
70
90
|
{
|
|
71
|
-
availId:
|
|
72
|
-
availDescription:
|
|
91
|
+
availId: x || "",
|
|
92
|
+
availDescription: f,
|
|
73
93
|
contactHref: P || "",
|
|
74
94
|
contactLinkBehavior: S
|
|
75
95
|
}
|
|
76
96
|
) }),
|
|
77
|
-
/* @__PURE__ */
|
|
97
|
+
/* @__PURE__ */ e("div", { className: i.priceSlot, children: h && /* @__PURE__ */ e(v, { pricingLabel: w, price: h }) })
|
|
78
98
|
] }),
|
|
79
|
-
typeof
|
|
80
|
-
|
|
99
|
+
typeof u == "number" && p && /* @__PURE__ */ e("div", { className: i.quantitySlot, children: /* @__PURE__ */ e(
|
|
100
|
+
A,
|
|
81
101
|
{
|
|
82
|
-
quantity:
|
|
83
|
-
onQuantityChange:
|
|
102
|
+
quantity: u,
|
|
103
|
+
onQuantityChange: p,
|
|
84
104
|
size: "sm"
|
|
85
105
|
}
|
|
86
106
|
) })
|
|
@@ -89,5 +109,5 @@ function U({
|
|
|
89
109
|
] });
|
|
90
110
|
}
|
|
91
111
|
export {
|
|
92
|
-
|
|
112
|
+
X as CartPart
|
|
93
113
|
};
|
|
@@ -12,6 +12,7 @@ export interface CartSlideInPanelProps {
|
|
|
12
12
|
onItemDelete: (_item: CartItem) => void;
|
|
13
13
|
onUnitEditClick?: (_item: CartItem) => void;
|
|
14
14
|
onItemNavigate?: (_item: CartItem) => void;
|
|
15
|
+
requiresUnitDetails?: boolean;
|
|
15
16
|
onCheckout: () => void;
|
|
16
17
|
}
|
|
17
|
-
export declare function CartSlideInPanel({ open, onClose, cart, subtotal, itemPriceLabel, contactHref, contactLinkBehavior, onItemQtyChange, onItemDelete, onUnitEditClick, onItemNavigate, onCheckout }: CartSlideInPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function CartSlideInPanel({ open, onClose, cart, subtotal, itemPriceLabel, contactHref, contactLinkBehavior, onItemQtyChange, onItemDelete, onUnitEditClick, onItemNavigate, requiresUnitDetails, onCheckout }: CartSlideInPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,44 +1,56 @@
|
|
|
1
|
-
import { jsx as i, jsxs as
|
|
2
|
-
import { SlideInPanel as
|
|
3
|
-
import { Text as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { Icon as
|
|
1
|
+
import { jsx as i, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import { SlideInPanel as C } from "../../atoms/SlideInPanel/SlideInPanel.js";
|
|
3
|
+
import { Text as r } from "../../atoms/Text/Text.js";
|
|
4
|
+
import { Button as h } from "../../atoms/Button/Button.js";
|
|
5
|
+
import { Icon as z } from "../../atoms/Icon/Icon.js";
|
|
6
6
|
import { CartPart as x } from "./CartPart.js";
|
|
7
|
-
import { s as t } from "../../Cart.module-
|
|
8
|
-
function
|
|
9
|
-
open:
|
|
7
|
+
import { s as t } from "../../Cart.module-BwqCrR3s.js";
|
|
8
|
+
function L({
|
|
9
|
+
open: u,
|
|
10
10
|
onClose: s,
|
|
11
|
-
cart:
|
|
11
|
+
cart: a,
|
|
12
12
|
subtotal: n,
|
|
13
|
-
itemPriceLabel:
|
|
14
|
-
contactHref:
|
|
15
|
-
contactLinkBehavior:
|
|
16
|
-
onItemQtyChange:
|
|
17
|
-
onItemDelete:
|
|
13
|
+
itemPriceLabel: p,
|
|
14
|
+
contactHref: y,
|
|
15
|
+
contactLinkBehavior: b,
|
|
16
|
+
onItemQtyChange: f,
|
|
17
|
+
onItemDelete: g,
|
|
18
18
|
onUnitEditClick: d,
|
|
19
19
|
onItemNavigate: m,
|
|
20
|
-
|
|
20
|
+
requiresUnitDetails: k = !1,
|
|
21
|
+
onCheckout: o
|
|
21
22
|
}) {
|
|
22
|
-
var
|
|
23
|
-
return
|
|
24
|
-
|
|
23
|
+
var c;
|
|
24
|
+
return a = a || { items: [] }, /* @__PURE__ */ i(
|
|
25
|
+
C,
|
|
25
26
|
{
|
|
26
27
|
side: "right",
|
|
27
|
-
open:
|
|
28
|
+
open: u,
|
|
28
29
|
onClose: s,
|
|
29
30
|
ariaLabel: "Shopping Cart",
|
|
30
|
-
children: /* @__PURE__ */
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
/* @__PURE__ */ i(
|
|
34
|
-
/* @__PURE__ */
|
|
35
|
-
(
|
|
31
|
+
children: /* @__PURE__ */ l("div", { id: "cart-panel", className: t.cartContainer, children: [
|
|
32
|
+
/* @__PURE__ */ l("div", { className: t.headerWrapper, children: [
|
|
33
|
+
/* @__PURE__ */ l("div", { className: t.header, children: [
|
|
34
|
+
/* @__PURE__ */ i(r, { size: "2xl", children: "Cart" }),
|
|
35
|
+
/* @__PURE__ */ l(r, { size: "xs", colorToken: "quaternary", children: [
|
|
36
|
+
(c = a == null ? void 0 : a.items) == null ? void 0 : c.length,
|
|
36
37
|
" items in your cart"
|
|
37
38
|
] })
|
|
38
39
|
] }),
|
|
39
|
-
/* @__PURE__ */ i("button", { onClick: s, children: /* @__PURE__ */ i(
|
|
40
|
+
/* @__PURE__ */ i("button", { onClick: s, children: /* @__PURE__ */ i(z, { iconKey: "fa-regular fa-xmark", size: "md" }) })
|
|
40
41
|
] }),
|
|
41
|
-
/* @__PURE__ */ i(
|
|
42
|
+
/* @__PURE__ */ i(
|
|
43
|
+
h,
|
|
44
|
+
{
|
|
45
|
+
disabled: a.items.length === 0,
|
|
46
|
+
onClick: o,
|
|
47
|
+
variant: "secondary",
|
|
48
|
+
size: "md",
|
|
49
|
+
className: t.checkoutButton,
|
|
50
|
+
children: "Checkout"
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
/* @__PURE__ */ i("div", { className: t.cartItems, children: a.items.length > 0 ? /* @__PURE__ */ i("ul", { children: a.items.map((e) => /* @__PURE__ */ i(
|
|
42
54
|
x,
|
|
43
55
|
{
|
|
44
56
|
imageUrl: e.imageUrl,
|
|
@@ -54,26 +66,27 @@ function B({
|
|
|
54
66
|
custom: !!e.custom,
|
|
55
67
|
availabilityId: e.availabilityId,
|
|
56
68
|
availability: e.availability,
|
|
57
|
-
contactHref:
|
|
58
|
-
contactLinkBehavior:
|
|
69
|
+
contactHref: y,
|
|
70
|
+
contactLinkBehavior: b,
|
|
59
71
|
price: e.price,
|
|
60
|
-
priceLabel:
|
|
72
|
+
priceLabel: p || "List Price",
|
|
61
73
|
quantity: e.quantity,
|
|
62
|
-
onQuantityChange: (
|
|
63
|
-
onRemove: () =>
|
|
64
|
-
onUnitEditClick: d ? () => d(e) : void 0
|
|
74
|
+
onQuantityChange: (v) => f(e, v),
|
|
75
|
+
onRemove: () => g(e),
|
|
76
|
+
onUnitEditClick: d ? () => d(e) : void 0,
|
|
77
|
+
requiresUnitDetails: k
|
|
65
78
|
},
|
|
66
79
|
`${e.id}-${e.make ?? ""}-${e.model ?? ""}-${e.serial ?? ""}`
|
|
67
|
-
)) }) : /* @__PURE__ */ i("div", { className: t.noItems, children: /* @__PURE__ */ i(
|
|
68
|
-
n && /* @__PURE__ */
|
|
69
|
-
/* @__PURE__ */ i(
|
|
70
|
-
/* @__PURE__ */ i(
|
|
80
|
+
)) }) : /* @__PURE__ */ i("div", { className: t.noItems, children: /* @__PURE__ */ i(r, { as: "p", size: "sm", children: "No items in your cart yet" }) }) }),
|
|
81
|
+
n && /* @__PURE__ */ l("div", { className: t.subtotal, children: [
|
|
82
|
+
/* @__PURE__ */ i(r, { size: "md", weight: "semibold", children: "Subtotal" }),
|
|
83
|
+
/* @__PURE__ */ i(r, { size: "md", weight: "semibold", children: n })
|
|
71
84
|
] }),
|
|
72
85
|
/* @__PURE__ */ i(
|
|
73
|
-
|
|
86
|
+
h,
|
|
74
87
|
{
|
|
75
|
-
disabled:
|
|
76
|
-
onClick:
|
|
88
|
+
disabled: a.items.length === 0,
|
|
89
|
+
onClick: o,
|
|
77
90
|
variant: "cta-primary",
|
|
78
91
|
size: "md",
|
|
79
92
|
className: t.checkoutButton,
|
|
@@ -85,5 +98,5 @@ function B({
|
|
|
85
98
|
);
|
|
86
99
|
}
|
|
87
100
|
export {
|
|
88
|
-
|
|
101
|
+
L as CartSlideInPanel
|
|
89
102
|
};
|
|
@@ -22,5 +22,6 @@ export interface ProductProps extends AvailabilityProps {
|
|
|
22
22
|
size?: Size;
|
|
23
23
|
showQuantity?: boolean;
|
|
24
24
|
onLinkClicked?: (_itemKey: number) => void;
|
|
25
|
+
requiresUnitDetails?: boolean;
|
|
25
26
|
}
|
|
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;
|
|
27
|
+
export declare function Product({ productView, itemKey, partNumber, productDescription, availDescription, availId, contactHref, contactLinkBehavior, productHref, priceLabel, price, imgSrc, attributes, className, onAddToCart, onClose, flat, size, showQuantity, onLinkClicked, requiresUnitDetails, ...otherProps }: ProductProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import { jsxs as o, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { Image as
|
|
3
|
-
import { Link as
|
|
2
|
+
import { Image as A } from "../../atoms/Image/Image.js";
|
|
3
|
+
import { Link as R } from "../../atoms/Link/Link.js";
|
|
4
4
|
import { Text as n } from "../../atoms/Text/Text.js";
|
|
5
|
-
import { Availability as
|
|
6
|
-
import { Pricing as
|
|
7
|
-
import { AddToCart as
|
|
8
|
-
import { Icon as
|
|
9
|
-
import { c as
|
|
10
|
-
import '../../assets/Product.css';const
|
|
11
|
-
productCard:
|
|
12
|
-
sm:
|
|
13
|
-
productInformation:
|
|
14
|
-
purchaseInformation:
|
|
15
|
-
addToCart:
|
|
16
|
-
addToCartButton:
|
|
17
|
-
partNumber:
|
|
18
|
-
partNumberLabel:
|
|
19
|
-
productTile:
|
|
20
|
-
topRow:
|
|
21
|
-
productData:
|
|
22
|
-
purchase:
|
|
23
|
-
attributeContainer:
|
|
24
|
-
elevated:
|
|
25
|
-
noImage:
|
|
5
|
+
import { Availability as $ } from "../../molecules/Availability/Availability.js";
|
|
6
|
+
import { Pricing as P } from "../../molecules/Pricing/Pricing.js";
|
|
7
|
+
import { AddToCart as j } from "../../molecules/AddToCart/AddToCart.js";
|
|
8
|
+
import { Icon as E } from "../../atoms/Icon/Icon.js";
|
|
9
|
+
import { c as D } from "../../clsx-OuTLNxxd.js";
|
|
10
|
+
import '../../assets/Product.css';const F = "_productCard_nx8r7_3", G = "_sm_nx8r7_15", J = "_productInformation_nx8r7_25", M = "_purchaseInformation_nx8r7_32", O = "_addToCart_nx8r7_40", W = "_addToCartButton_nx8r7_43", X = "_partNumber_nx8r7_53", Y = "_partNumberLabel_nx8r7_60", Z = "_productTile_nx8r7_64", q = "_topRow_nx8r7_83", y = "_productData_nx8r7_114", U = "_purchase_nx8r7_32", H = "_attributeContainer_nx8r7_151", Q = "_elevated_nx8r7_199", K = "_noImage_nx8r7_205", r = {
|
|
11
|
+
productCard: F,
|
|
12
|
+
sm: G,
|
|
13
|
+
productInformation: J,
|
|
14
|
+
purchaseInformation: M,
|
|
15
|
+
addToCart: O,
|
|
16
|
+
addToCartButton: W,
|
|
17
|
+
partNumber: X,
|
|
18
|
+
partNumberLabel: Y,
|
|
19
|
+
productTile: Z,
|
|
20
|
+
topRow: q,
|
|
21
|
+
productData: y,
|
|
22
|
+
purchase: U,
|
|
23
|
+
attributeContainer: H,
|
|
24
|
+
elevated: Q,
|
|
25
|
+
noImage: K
|
|
26
26
|
};
|
|
27
27
|
function er({
|
|
28
|
-
productView:
|
|
29
|
-
itemKey:
|
|
30
|
-
partNumber:
|
|
28
|
+
productView: V,
|
|
29
|
+
itemKey: c,
|
|
30
|
+
partNumber: s,
|
|
31
31
|
productDescription: h,
|
|
32
32
|
availDescription: x,
|
|
33
33
|
availId: m,
|
|
@@ -36,7 +36,7 @@ function er({
|
|
|
36
36
|
productHref: f,
|
|
37
37
|
priceLabel: T,
|
|
38
38
|
price: l,
|
|
39
|
-
imgSrc:
|
|
39
|
+
imgSrc: d,
|
|
40
40
|
attributes: p,
|
|
41
41
|
className: g,
|
|
42
42
|
onAddToCart: C,
|
|
@@ -44,41 +44,42 @@ function er({
|
|
|
44
44
|
flat: I,
|
|
45
45
|
size: a = "md",
|
|
46
46
|
showQuantity: _ = !0,
|
|
47
|
-
onLinkClicked:
|
|
48
|
-
|
|
47
|
+
onLinkClicked: e,
|
|
48
|
+
requiresUnitDetails: w = !1,
|
|
49
|
+
...B
|
|
49
50
|
}) {
|
|
50
51
|
const u = a === "sm" ? "xs" : "sm";
|
|
51
|
-
return
|
|
52
|
+
return V === "Card" ? /* @__PURE__ */ o(
|
|
52
53
|
"div",
|
|
53
54
|
{
|
|
54
|
-
className:
|
|
55
|
+
className: D(
|
|
55
56
|
r.productCard,
|
|
56
57
|
a && r[a],
|
|
57
58
|
g,
|
|
58
59
|
!I && r.elevated,
|
|
59
|
-
!
|
|
60
|
+
!d && r.noImage
|
|
60
61
|
),
|
|
61
|
-
...
|
|
62
|
+
...B,
|
|
62
63
|
children: [
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
d && /* @__PURE__ */ t(
|
|
65
|
+
A,
|
|
65
66
|
{
|
|
66
|
-
src:
|
|
67
|
-
alt: `${
|
|
67
|
+
src: d,
|
|
68
|
+
alt: `${s} product image`,
|
|
68
69
|
height: a === "sm" ? 78 : 96,
|
|
69
70
|
width: a === "sm" ? 78 : 96
|
|
70
71
|
}
|
|
71
72
|
),
|
|
72
73
|
/* @__PURE__ */ o("div", { className: r.productInformation, children: [
|
|
73
|
-
/* @__PURE__ */ t(
|
|
74
|
+
/* @__PURE__ */ t(R, { onClick: () => e == null ? void 0 : e(c), size: a, href: f || "#", children: h }),
|
|
74
75
|
/* @__PURE__ */ o("div", { className: r.partNumber, children: [
|
|
75
76
|
/* @__PURE__ */ t(n, { size: u, className: r.partNumberLabel, children: "Part #" }),
|
|
76
|
-
/* @__PURE__ */ t(n, { size: u, weight: "semibold", children:
|
|
77
|
+
/* @__PURE__ */ t(n, { size: u, weight: "semibold", children: s })
|
|
77
78
|
] })
|
|
78
79
|
] }),
|
|
79
80
|
/* @__PURE__ */ o("div", { className: r.purchaseInformation, children: [
|
|
80
81
|
m && /* @__PURE__ */ t(
|
|
81
|
-
|
|
82
|
+
$,
|
|
82
83
|
{
|
|
83
84
|
availId: m,
|
|
84
85
|
availDescription: x,
|
|
@@ -86,12 +87,12 @@ function er({
|
|
|
86
87
|
contactLinkBehavior: N
|
|
87
88
|
}
|
|
88
89
|
),
|
|
89
|
-
l && /* @__PURE__ */ t(
|
|
90
|
+
l && /* @__PURE__ */ t(P, { pricingLabel: T, price: l })
|
|
90
91
|
] }),
|
|
91
92
|
/* @__PURE__ */ t(
|
|
92
|
-
|
|
93
|
+
j,
|
|
93
94
|
{
|
|
94
|
-
itemKey:
|
|
95
|
+
itemKey: c,
|
|
95
96
|
onAdd: C,
|
|
96
97
|
className: r.addToCart,
|
|
97
98
|
addButtonClassName: r.addToCartButton,
|
|
@@ -99,23 +100,24 @@ function er({
|
|
|
99
100
|
size: a,
|
|
100
101
|
buttonDoneText: "",
|
|
101
102
|
buttonText: _ ? "Add" : "Add to Cart",
|
|
102
|
-
showQuantity: _
|
|
103
|
+
showQuantity: _,
|
|
104
|
+
requiresUnitDetails: w
|
|
103
105
|
}
|
|
104
106
|
)
|
|
105
107
|
]
|
|
106
108
|
}
|
|
107
|
-
) : /* @__PURE__ */ o("div", { className:
|
|
109
|
+
) : /* @__PURE__ */ o("div", { className: D(
|
|
108
110
|
r.productTile,
|
|
109
111
|
g,
|
|
110
112
|
a && r[a],
|
|
111
113
|
!I && r.elevated,
|
|
112
|
-
!
|
|
113
|
-
), ...
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
!d && r.noImage
|
|
115
|
+
), ...B, children: [
|
|
116
|
+
d && /* @__PURE__ */ t(
|
|
117
|
+
A,
|
|
116
118
|
{
|
|
117
|
-
src:
|
|
118
|
-
alt: `${
|
|
119
|
+
src: d,
|
|
120
|
+
alt: `${s} product image`,
|
|
119
121
|
height: a === "sm" ? 86 : 108,
|
|
120
122
|
width: a === "sm" ? 86 : 108
|
|
121
123
|
}
|
|
@@ -123,18 +125,18 @@ function er({
|
|
|
123
125
|
/* @__PURE__ */ o("div", { className: r.productData, children: [
|
|
124
126
|
/* @__PURE__ */ o("div", { className: r.topRow, children: [
|
|
125
127
|
/* @__PURE__ */ o("div", { className: r.productInformation, children: [
|
|
126
|
-
/* @__PURE__ */ t(
|
|
128
|
+
/* @__PURE__ */ t(R, { onClick: () => e == null ? void 0 : e(c), size: a, href: f || "#", children: h }),
|
|
127
129
|
/* @__PURE__ */ o("div", { className: r.partNumber, children: [
|
|
128
130
|
/* @__PURE__ */ t(n, { size: u, className: r.partNumberLabel, children: "Part #" }),
|
|
129
|
-
/* @__PURE__ */ t(n, { size: u, weight: "semibold", children:
|
|
131
|
+
/* @__PURE__ */ t(n, { size: u, weight: "semibold", children: s })
|
|
130
132
|
] })
|
|
131
133
|
] }),
|
|
132
|
-
v && /* @__PURE__ */ t("button", { onClick: () => v(
|
|
134
|
+
v && /* @__PURE__ */ t("button", { onClick: () => v(c), children: /* @__PURE__ */ t(E, { size: "sm", iconKey: "fa-light fa-xmark" }) })
|
|
133
135
|
] }),
|
|
134
136
|
/* @__PURE__ */ o("div", { className: r.purchase, children: [
|
|
135
137
|
/* @__PURE__ */ o("div", { className: r.purchaseInformation, children: [
|
|
136
138
|
m && /* @__PURE__ */ t(
|
|
137
|
-
|
|
139
|
+
$,
|
|
138
140
|
{
|
|
139
141
|
availId: m,
|
|
140
142
|
availDescription: x,
|
|
@@ -142,9 +144,9 @@ function er({
|
|
|
142
144
|
contactLinkBehavior: N
|
|
143
145
|
}
|
|
144
146
|
),
|
|
145
|
-
l && /* @__PURE__ */ t(
|
|
147
|
+
l && /* @__PURE__ */ t(P, { pricingLabel: T, price: l })
|
|
146
148
|
] }),
|
|
147
|
-
/* @__PURE__ */ t(
|
|
149
|
+
/* @__PURE__ */ t(j, { size: a, itemKey: c, onAdd: C, className: r.addToCart, addButtonClassName: r.addToCartButton, requiresUnitDetails: w })
|
|
148
150
|
] }),
|
|
149
151
|
p && p.length > 0 && /* @__PURE__ */ t("ul", { className: r.attributeContainer, children: p.map((i) => /* @__PURE__ */ o("li", { children: [
|
|
150
152
|
/* @__PURE__ */ o(n, { size: "xs", weight: "light", children: [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Product as
|
|
1
|
+
import { Product as a } from "./Product.js";
|
|
2
2
|
const o = [
|
|
3
3
|
{ label: "Color", value: "Gray" },
|
|
4
4
|
{ label: "Brand", value: "Kason" },
|
|
@@ -13,7 +13,7 @@ const o = [
|
|
|
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: {
|
|
@@ -52,7 +52,8 @@ const o = [
|
|
|
52
52
|
control: { type: "select" },
|
|
53
53
|
options: ["md", "sm"]
|
|
54
54
|
},
|
|
55
|
-
showQuantity: { control: "boolean", description: "Shows/Hides add to cart quantity" }
|
|
55
|
+
showQuantity: { control: "boolean", description: "Shows/Hides add to cart quantity" },
|
|
56
|
+
requiresUnitDetails: { control: "boolean", description: "Shows unit details tooltip on add button" }
|
|
56
57
|
},
|
|
57
58
|
args: {
|
|
58
59
|
productView: "Card",
|
|
@@ -70,15 +71,16 @@ const o = [
|
|
|
70
71
|
imgSrc: "https://dev.caseparts.com/graphics/photos/R-23_IMG_2009.png",
|
|
71
72
|
// imgSrc: 'https://www.caseparts.com/Ortery/360/Optimized/1092-01_/1092-01_04.webp',
|
|
72
73
|
attributes: o,
|
|
73
|
-
onAddToCart: (t,
|
|
74
|
-
alert(`Add to cart (story) ${JSON.stringify({ itemKey: t, quantity:
|
|
74
|
+
onAddToCart: (t, e) => {
|
|
75
|
+
alert(`Add to cart (story) ${JSON.stringify({ itemKey: t, quantity: e })}`);
|
|
75
76
|
},
|
|
76
77
|
onClose: (t) => {
|
|
77
78
|
alert(`On close clicked ${t}`);
|
|
78
79
|
},
|
|
79
80
|
flat: !1,
|
|
80
81
|
size: "md",
|
|
81
|
-
showQuantity: !0
|
|
82
|
+
showQuantity: !0,
|
|
83
|
+
requiresUnitDetails: !1
|
|
82
84
|
},
|
|
83
85
|
tags: ["autodocs"]
|
|
84
86
|
}, l = {}, c = {
|
|
@@ -114,12 +116,12 @@ const o = [
|
|
|
114
116
|
productView: "Card",
|
|
115
117
|
imgSrc: void 0
|
|
116
118
|
}
|
|
117
|
-
},
|
|
119
|
+
}, b = {
|
|
118
120
|
args: {
|
|
119
121
|
productView: "Tile",
|
|
120
122
|
flat: !0
|
|
121
123
|
}
|
|
122
|
-
},
|
|
124
|
+
}, v = {
|
|
123
125
|
args: {
|
|
124
126
|
productView: "Card",
|
|
125
127
|
imgSrc: void 0,
|
|
@@ -130,10 +132,10 @@ export {
|
|
|
130
132
|
s as ContactForAvailability,
|
|
131
133
|
l as Default,
|
|
132
134
|
p as DifferentPriceLabel,
|
|
133
|
-
|
|
135
|
+
b as FlatTile,
|
|
134
136
|
c as LimitedStock,
|
|
135
137
|
u as NoImageCard,
|
|
136
|
-
|
|
138
|
+
v as NoImageFlatCard,
|
|
137
139
|
d as TileView,
|
|
138
140
|
n as Unavailable,
|
|
139
141
|
r as default
|
package/package.json
CHANGED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import './assets/Cart.css';const t = "_cartIconButton_a7g4s_2", a = "_count_a7g4s_9", o = "_cartContainer_a7g4s_24", e = "_headerWrapper_a7g4s_35", n = "_header_a7g4s_35", _ = "_cartItems_a7g4s_53", s = "_cartItem_a7g4s_53", c = "_topRow_a7g4s_79", r = "_itemInfo_a7g4s_85", i = "_editUnit_a7g4s_90", m = "_purchaseInformation_a7g4s_104", g = "_availabilitySlot_a7g4s_110", I = "_priceSlot_a7g4s_113", u = "_itemManagement_a7g4s_116", l = "_quantitySlot_a7g4s_122", p = "_itemImage_a7g4s_132", h = "_removeItem_a7g4s_135", d = "_noItems_a7g4s_145", S = "_subtotal_a7g4s_152", y = "_checkoutButton_a7g4s_159", b = {
|
|
2
|
-
cartIconButton: t,
|
|
3
|
-
count: a,
|
|
4
|
-
cartContainer: o,
|
|
5
|
-
headerWrapper: e,
|
|
6
|
-
header: n,
|
|
7
|
-
cartItems: _,
|
|
8
|
-
cartItem: s,
|
|
9
|
-
topRow: c,
|
|
10
|
-
itemInfo: r,
|
|
11
|
-
editUnit: i,
|
|
12
|
-
purchaseInformation: m,
|
|
13
|
-
availabilitySlot: g,
|
|
14
|
-
priceSlot: I,
|
|
15
|
-
itemManagement: u,
|
|
16
|
-
quantitySlot: l,
|
|
17
|
-
itemImage: p,
|
|
18
|
-
removeItem: h,
|
|
19
|
-
noItems: d,
|
|
20
|
-
subtotal: S,
|
|
21
|
-
checkoutButton: y
|
|
22
|
-
};
|
|
23
|
-
export {
|
|
24
|
-
b as s
|
|
25
|
-
};
|