@caseparts-org/caseblocks 0.0.161 → 0.0.163
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,12 +1,20 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
import { ContactUsLinkBehavior } from '../Availability/Availability';
|
|
2
3
|
export interface CartPartProps extends Omit<React.LiHTMLAttributes<HTMLLIElement>, "title"> {
|
|
3
4
|
imageUrl?: string;
|
|
4
5
|
imageAlt?: string;
|
|
5
6
|
title: React.ReactNode;
|
|
6
7
|
titleHref?: string;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
partNumber?: string | number;
|
|
9
|
+
custom?: boolean;
|
|
10
|
+
availabilityId?: string;
|
|
11
|
+
availability?: string;
|
|
12
|
+
contactHref?: string;
|
|
13
|
+
contactLinkBehavior?: ContactUsLinkBehavior;
|
|
14
|
+
priceLabel?: string;
|
|
15
|
+
price?: string;
|
|
16
|
+
quantity?: number;
|
|
17
|
+
onQuantityChange?: (_quantity: number) => void;
|
|
18
|
+
onRemove?: () => void;
|
|
11
19
|
}
|
|
12
|
-
export declare function CartPart({ imageUrl, imageAlt, title, titleHref,
|
|
20
|
+
export declare function CartPart({ imageUrl, imageAlt, title, titleHref, partNumber, custom, availabilityId, availability, contactHref, contactLinkBehavior, priceLabel, price, quantity, onQuantityChange, onRemove, className, ...otherProps }: CartPartProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,38 +1,70 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Link as
|
|
3
|
-
import { Text as
|
|
4
|
-
import { s as
|
|
5
|
-
import { Image as
|
|
6
|
-
import { c as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Link as N } from "../../atoms/Link/Link.js";
|
|
3
|
+
import { Text as m } from "../../atoms/Text/Text.js";
|
|
4
|
+
import { s as r } from "../../Cart.module-B-yc1ax6.js";
|
|
5
|
+
import { Image as z } from "../../atoms/Image/Image.js";
|
|
6
|
+
import { c as P } from "../../clsx-OuTLNxxd.js";
|
|
7
|
+
import { Availability as w } from "../Availability/Availability.js";
|
|
8
|
+
import { Pricing as y } from "../Pricing/Pricing.js";
|
|
9
|
+
import { QuantityInput as k } from "../QuantityInput/QuantityInput.js";
|
|
10
|
+
import { Icon as L } from "../../atoms/Icon/Icon.js";
|
|
11
|
+
function B({
|
|
12
|
+
imageUrl: f,
|
|
13
|
+
imageAlt: h = "Product image",
|
|
14
|
+
title: a,
|
|
11
15
|
titleHref: s,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
partNumber: t,
|
|
17
|
+
custom: p,
|
|
18
|
+
availabilityId: u,
|
|
19
|
+
availability: o,
|
|
20
|
+
contactHref: I,
|
|
21
|
+
contactLinkBehavior: g = "new-tab",
|
|
22
|
+
priceLabel: v = "List Price",
|
|
23
|
+
price: c,
|
|
24
|
+
quantity: l,
|
|
25
|
+
onQuantityChange: n,
|
|
26
|
+
onRemove: d,
|
|
27
|
+
className: b,
|
|
28
|
+
...x
|
|
18
29
|
}) {
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
-
/* @__PURE__ */
|
|
22
|
-
/* @__PURE__ */
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
-
/* @__PURE__ */ m
|
|
25
|
-
|
|
30
|
+
return /* @__PURE__ */ i("li", { className: P(r.cartItem, b), ...x, children: [
|
|
31
|
+
/* @__PURE__ */ e(z, { height: 50, width: 50, src: f || "", alt: h, className: r.itemImage }),
|
|
32
|
+
/* @__PURE__ */ i("div", { children: [
|
|
33
|
+
/* @__PURE__ */ i("div", { className: r.topRow, children: [
|
|
34
|
+
/* @__PURE__ */ i("div", { className: r.itemInfo, children: [
|
|
35
|
+
/* @__PURE__ */ e(m, { size: "sm", weight: "semibold", children: s ? /* @__PURE__ */ e(N, { href: s, children: a }) : a }),
|
|
36
|
+
t != null && /* @__PURE__ */ i(m, { size: "sm", children: [
|
|
37
|
+
/* @__PURE__ */ e(m, { colorToken: "quaternary", size: "xs", children: p ? "Specs " : "Part # " }),
|
|
38
|
+
t
|
|
39
|
+
] })
|
|
26
40
|
] }),
|
|
27
|
-
|
|
41
|
+
d && /* @__PURE__ */ e("button", { onClick: d, className: r.removeItem, "aria-label": "Remove item", type: "button", children: /* @__PURE__ */ e(L, { iconKey: "fa-regular fa-trash", size: "sm" }) })
|
|
28
42
|
] }),
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
|
|
31
|
-
|
|
43
|
+
/* @__PURE__ */ i("div", { className: r.itemManagement, children: [
|
|
44
|
+
/* @__PURE__ */ i("div", { className: r.purchaseInformation, children: [
|
|
45
|
+
o && /* @__PURE__ */ e(
|
|
46
|
+
w,
|
|
47
|
+
{
|
|
48
|
+
availId: u || "",
|
|
49
|
+
availDescription: o,
|
|
50
|
+
contactHref: I || "",
|
|
51
|
+
contactLinkBehavior: g
|
|
52
|
+
}
|
|
53
|
+
),
|
|
54
|
+
c && /* @__PURE__ */ e(y, { pricingLabel: v, price: c })
|
|
55
|
+
] }),
|
|
56
|
+
typeof l == "number" && n && /* @__PURE__ */ e(
|
|
57
|
+
k,
|
|
58
|
+
{
|
|
59
|
+
quantity: l,
|
|
60
|
+
onQuantityChange: n,
|
|
61
|
+
size: "sm"
|
|
62
|
+
}
|
|
63
|
+
)
|
|
32
64
|
] })
|
|
33
65
|
] })
|
|
34
66
|
] });
|
|
35
67
|
}
|
|
36
68
|
export {
|
|
37
|
-
|
|
69
|
+
B as CartPart
|
|
38
70
|
};
|
|
@@ -12,7 +12,17 @@ declare const meta: {
|
|
|
12
12
|
imageAlt: string;
|
|
13
13
|
title: string;
|
|
14
14
|
titleHref: string;
|
|
15
|
-
|
|
15
|
+
partNumber: string;
|
|
16
|
+
custom: false;
|
|
17
|
+
availabilityId: string;
|
|
18
|
+
availability: string;
|
|
19
|
+
contactHref: string;
|
|
20
|
+
contactLinkBehavior: "new-tab";
|
|
21
|
+
priceLabel: string;
|
|
22
|
+
price: string;
|
|
23
|
+
quantity: number;
|
|
24
|
+
onQuantityChange: () => void;
|
|
25
|
+
onRemove: () => void;
|
|
16
26
|
};
|
|
17
27
|
};
|
|
18
28
|
export default meta;
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { Button as l } from "../../atoms/Button/Button.js";
|
|
5
|
-
import { Availability as o } from "../Availability/Availability.js";
|
|
6
|
-
import { Pricing as c } from "../Pricing/Pricing.js";
|
|
7
|
-
import { QuantityInput as d } from "../QuantityInput/QuantityInput.js";
|
|
8
|
-
import { CartPart as r } from "./CartPart.js";
|
|
9
|
-
const v = {
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { CartPart as e } from "./CartPart.js";
|
|
3
|
+
const l = {
|
|
10
4
|
title: "Case Parts/Molecules/CartPart",
|
|
11
|
-
component:
|
|
5
|
+
component: e,
|
|
12
6
|
parameters: {
|
|
13
7
|
layout: "centered"
|
|
14
8
|
},
|
|
@@ -18,63 +12,35 @@ const v = {
|
|
|
18
12
|
imageAlt: "1094-01 product image",
|
|
19
13
|
title: "Kason Door Closer - Flush",
|
|
20
14
|
titleHref: "#",
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
partNumber: "1094-01",
|
|
16
|
+
custom: !1,
|
|
17
|
+
availabilityId: "available",
|
|
18
|
+
availability: "In Stock",
|
|
19
|
+
contactHref: "#",
|
|
20
|
+
contactLinkBehavior: "new-tab",
|
|
21
|
+
priceLabel: "List Price",
|
|
22
|
+
price: "$99.99",
|
|
23
|
+
quantity: 1,
|
|
24
|
+
onQuantityChange: () => {
|
|
25
|
+
},
|
|
26
|
+
onRemove: () => {
|
|
27
|
+
}
|
|
25
28
|
}
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
/* @__PURE__ */ t(
|
|
30
|
-
o,
|
|
31
|
-
{
|
|
32
|
-
availId: "available",
|
|
33
|
-
availDescription: "In Stock",
|
|
34
|
-
contactHref: "#",
|
|
35
|
-
contactLinkBehavior: "new-tab"
|
|
36
|
-
}
|
|
37
|
-
),
|
|
38
|
-
/* @__PURE__ */ t(c, { pricingLabel: "List Price", price: "$99.99" })
|
|
39
|
-
] }),
|
|
40
|
-
actions: /* @__PURE__ */ t(
|
|
41
|
-
d,
|
|
42
|
-
{
|
|
43
|
-
quantity: 1,
|
|
44
|
-
onQuantityChange: () => {
|
|
45
|
-
},
|
|
46
|
-
size: "sm"
|
|
47
|
-
}
|
|
48
|
-
),
|
|
49
|
-
topAction: /* @__PURE__ */ t("button", { type: "button", "aria-label": "Remove item", style: { border: "none", background: "transparent", padding: 0 }, children: /* @__PURE__ */ t(s, { iconKey: "fa-regular fa-trash", size: "sm" }) })
|
|
50
|
-
},
|
|
51
|
-
render: (i) => /* @__PURE__ */ t("div", { style: { width: 360 }, children: /* @__PURE__ */ t("ul", { style: { margin: 0, padding: 0 }, children: /* @__PURE__ */ t(r, { ...i }) }) })
|
|
52
|
-
}, k = {
|
|
29
|
+
}, o = {
|
|
30
|
+
render: (a) => /* @__PURE__ */ t("div", { style: { width: 360 }, children: /* @__PURE__ */ t("ul", { style: { margin: 0, padding: 0 }, children: /* @__PURE__ */ t(e, { ...a }) }) })
|
|
31
|
+
}, s = {
|
|
53
32
|
args: {
|
|
54
33
|
title: "Custom-Molded Snap-In Magnetic Gasket",
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
/* @__PURE__ */ t(
|
|
61
|
-
o,
|
|
62
|
-
{
|
|
63
|
-
availId: "contact",
|
|
64
|
-
availDescription: "Contact us for availability",
|
|
65
|
-
contactHref: "#",
|
|
66
|
-
contactLinkBehavior: "new-tab"
|
|
67
|
-
}
|
|
68
|
-
),
|
|
69
|
-
/* @__PURE__ */ t(c, { pricingLabel: "List Price", price: "$129.99" })
|
|
70
|
-
] }),
|
|
71
|
-
actions: /* @__PURE__ */ t(l, { type: "button", variant: "secondary", size: "sm", children: "Remove" }),
|
|
72
|
-
topAction: null
|
|
34
|
+
partNumber: 'MG064 36" x 79" 3-Sided Dart-to-Dart Gasket',
|
|
35
|
+
custom: !0,
|
|
36
|
+
availabilityId: "contact",
|
|
37
|
+
availability: "Contact us for availability",
|
|
38
|
+
price: "$129.99"
|
|
73
39
|
},
|
|
74
|
-
render: (
|
|
40
|
+
render: (a) => /* @__PURE__ */ t("div", { style: { width: 360 }, children: /* @__PURE__ */ t("ul", { style: { margin: 0, padding: 0 }, children: /* @__PURE__ */ t(e, { ...a }) }) })
|
|
75
41
|
};
|
|
76
42
|
export {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
43
|
+
o as Basic,
|
|
44
|
+
s as CustomSpecs,
|
|
45
|
+
l as default
|
|
80
46
|
};
|
|
@@ -1,91 +1,74 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as i, jsxs as r } from "react/jsx-runtime";
|
|
2
2
|
import { SlideInPanel as b } from "../../atoms/SlideInPanel/SlideInPanel.js";
|
|
3
|
-
import { Text as
|
|
4
|
-
import { Button as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
function j({
|
|
12
|
-
open: d,
|
|
13
|
-
onClose: l,
|
|
3
|
+
import { Text as l } from "../../atoms/Text/Text.js";
|
|
4
|
+
import { Button as f } from "../../atoms/Button/Button.js";
|
|
5
|
+
import { Icon as v } from "../../atoms/Icon/Icon.js";
|
|
6
|
+
import { CartPart as I } from "./CartPart.js";
|
|
7
|
+
import { s as a } from "../../Cart.module-B-yc1ax6.js";
|
|
8
|
+
function q({
|
|
9
|
+
open: o,
|
|
10
|
+
onClose: m,
|
|
14
11
|
cart: t,
|
|
15
|
-
subtotal:
|
|
16
|
-
itemPriceLabel:
|
|
17
|
-
contactHref:
|
|
18
|
-
contactLinkBehavior:
|
|
19
|
-
onItemQtyChange:
|
|
20
|
-
onItemDelete:
|
|
12
|
+
subtotal: n,
|
|
13
|
+
itemPriceLabel: d,
|
|
14
|
+
contactHref: c,
|
|
15
|
+
contactLinkBehavior: h,
|
|
16
|
+
onItemQtyChange: p,
|
|
17
|
+
onItemDelete: u,
|
|
21
18
|
onCheckout: y
|
|
22
19
|
}) {
|
|
23
|
-
var
|
|
24
|
-
return t = t || { items: [] }, /* @__PURE__ */
|
|
20
|
+
var s;
|
|
21
|
+
return t = t || { items: [] }, /* @__PURE__ */ i(
|
|
25
22
|
b,
|
|
26
23
|
{
|
|
27
24
|
side: "right",
|
|
28
|
-
open:
|
|
29
|
-
onClose:
|
|
25
|
+
open: o,
|
|
26
|
+
onClose: m,
|
|
30
27
|
ariaLabel: "Shopping Cart",
|
|
31
|
-
children: /* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
-
/* @__PURE__ */
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
(
|
|
28
|
+
children: /* @__PURE__ */ r("div", { id: "cart-panel", className: a.cartContainer, children: [
|
|
29
|
+
/* @__PURE__ */ r("div", { className: a.headerWrapper, children: [
|
|
30
|
+
/* @__PURE__ */ r("div", { className: a.header, children: [
|
|
31
|
+
/* @__PURE__ */ i(l, { size: "2xl", children: "Cart" }),
|
|
32
|
+
/* @__PURE__ */ r(l, { size: "xs", colorToken: "quaternary", children: [
|
|
33
|
+
(s = t == null ? void 0 : t.items) == null ? void 0 : s.length,
|
|
37
34
|
" items in your cart"
|
|
38
35
|
] })
|
|
39
36
|
] }),
|
|
40
|
-
/* @__PURE__ */
|
|
37
|
+
/* @__PURE__ */ i("button", { onClick: m, children: /* @__PURE__ */ i(v, { iconKey: "fa-regular fa-xmark", size: "md" }) })
|
|
41
38
|
] }),
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
|
|
39
|
+
/* @__PURE__ */ i("div", { className: a.cartItems, children: t.items.length > 0 ? /* @__PURE__ */ i("ul", { children: t.items.map((e) => /* @__PURE__ */ i(
|
|
40
|
+
I,
|
|
44
41
|
{
|
|
45
|
-
imageUrl:
|
|
46
|
-
imageAlt: `${
|
|
47
|
-
title:
|
|
48
|
-
titleHref:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
contactHref: p || "",
|
|
61
|
-
contactLinkBehavior: u || "new-tab"
|
|
62
|
-
}
|
|
63
|
-
),
|
|
64
|
-
/* @__PURE__ */ e(z, { pricingLabel: h || "List Price", price: i.price })
|
|
65
|
-
] }),
|
|
66
|
-
actions: /* @__PURE__ */ e(
|
|
67
|
-
k,
|
|
68
|
-
{
|
|
69
|
-
quantity: i.quantity,
|
|
70
|
-
onQuantityChange: (v) => f(i, v),
|
|
71
|
-
size: "sm"
|
|
72
|
-
}
|
|
73
|
-
)
|
|
42
|
+
imageUrl: e.imageUrl,
|
|
43
|
+
imageAlt: `${e.itemId} product image`,
|
|
44
|
+
title: e.description,
|
|
45
|
+
titleHref: e.itemHref || `/part/${e.itemId}`,
|
|
46
|
+
partNumber: e.itemId,
|
|
47
|
+
custom: !!e.custom,
|
|
48
|
+
availabilityId: e.availabilityId,
|
|
49
|
+
availability: e.availability,
|
|
50
|
+
contactHref: c,
|
|
51
|
+
contactLinkBehavior: h,
|
|
52
|
+
price: e.price,
|
|
53
|
+
priceLabel: d || "List Price",
|
|
54
|
+
quantity: e.quantity,
|
|
55
|
+
onQuantityChange: (g) => p(e, g),
|
|
56
|
+
onRemove: () => u(e)
|
|
74
57
|
},
|
|
75
|
-
|
|
76
|
-
)) }) : /* @__PURE__ */
|
|
77
|
-
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
/* @__PURE__ */
|
|
58
|
+
e.id
|
|
59
|
+
)) }) : /* @__PURE__ */ i("div", { className: a.noItems, children: /* @__PURE__ */ i(l, { as: "p", size: "sm", children: "No items in your cart yet" }) }) }),
|
|
60
|
+
n && /* @__PURE__ */ r("div", { className: a.subtotal, children: [
|
|
61
|
+
/* @__PURE__ */ i(l, { size: "md", weight: "semibold", children: "Subtotal" }),
|
|
62
|
+
/* @__PURE__ */ i(l, { size: "md", weight: "semibold", children: n })
|
|
80
63
|
] }),
|
|
81
|
-
/* @__PURE__ */
|
|
82
|
-
|
|
64
|
+
/* @__PURE__ */ i(
|
|
65
|
+
f,
|
|
83
66
|
{
|
|
84
67
|
disabled: t.items.length === 0,
|
|
85
68
|
onClick: y,
|
|
86
69
|
variant: "cta-primary",
|
|
87
70
|
size: "md",
|
|
88
|
-
className:
|
|
71
|
+
className: a.checkoutButton,
|
|
89
72
|
children: "Checkout"
|
|
90
73
|
}
|
|
91
74
|
)
|
|
@@ -94,5 +77,5 @@ function j({
|
|
|
94
77
|
);
|
|
95
78
|
}
|
|
96
79
|
export {
|
|
97
|
-
|
|
80
|
+
q as CartSlideInPanel
|
|
98
81
|
};
|