@caseparts-org/caseblocks 0.0.170 → 0.0.172
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/AddToCartPart.css +1 -0
- package/dist/main-client.d.ts +2 -0
- package/dist/main-client.js +42 -40
- package/dist/molecules/AddToCartPart/AddToCartPart.d.ts +18 -0
- package/dist/molecules/AddToCartPart/AddToCartPart.js +114 -0
- package/dist/molecules/AddToCartPart/AddToCartPart.stories.d.ts +62 -0
- package/dist/molecules/AddToCartPart/AddToCartPart.stories.js +61 -0
- package/dist/molecules/Cart/CartPart.d.ts +2 -1
- package/dist/molecules/Cart/CartPart.js +53 -49
- package/dist/molecules/Cart/CartSlideInPanel.d.ts +2 -1
- package/dist/molecules/Cart/CartSlideInPanel.js +41 -39
- package/dist/molecules/Logo/Logo.js +12 -12
- package/package.json +1 -1
|
@@ -1,74 +1,76 @@
|
|
|
1
|
-
import { jsx as i, jsxs as
|
|
2
|
-
import { SlideInPanel as
|
|
1
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { SlideInPanel as g } from "../../atoms/SlideInPanel/SlideInPanel.js";
|
|
3
3
|
import { Text as l } from "../../atoms/Text/Text.js";
|
|
4
|
-
import { Button as
|
|
5
|
-
import { Icon as
|
|
6
|
-
import { CartPart as
|
|
7
|
-
import { s as
|
|
8
|
-
function
|
|
4
|
+
import { Button as v } from "../../atoms/Button/Button.js";
|
|
5
|
+
import { Icon as C } from "../../atoms/Icon/Icon.js";
|
|
6
|
+
import { CartPart as x } from "./CartPart.js";
|
|
7
|
+
import { s as t } from "../../Cart.module-DzPBP5QJ.js";
|
|
8
|
+
function B({
|
|
9
9
|
open: o,
|
|
10
|
-
onClose:
|
|
11
|
-
cart:
|
|
10
|
+
onClose: s,
|
|
11
|
+
cart: r,
|
|
12
12
|
subtotal: n,
|
|
13
|
-
itemPriceLabel:
|
|
14
|
-
contactHref:
|
|
15
|
-
contactLinkBehavior:
|
|
16
|
-
onItemQtyChange:
|
|
17
|
-
onItemDelete:
|
|
18
|
-
|
|
13
|
+
itemPriceLabel: c,
|
|
14
|
+
contactHref: h,
|
|
15
|
+
contactLinkBehavior: p,
|
|
16
|
+
onItemQtyChange: u,
|
|
17
|
+
onItemDelete: y,
|
|
18
|
+
onItemNavigate: m,
|
|
19
|
+
onCheckout: b
|
|
19
20
|
}) {
|
|
20
|
-
var
|
|
21
|
-
return
|
|
22
|
-
|
|
21
|
+
var d;
|
|
22
|
+
return r = r || { items: [] }, /* @__PURE__ */ i(
|
|
23
|
+
g,
|
|
23
24
|
{
|
|
24
25
|
side: "right",
|
|
25
26
|
open: o,
|
|
26
|
-
onClose:
|
|
27
|
+
onClose: s,
|
|
27
28
|
ariaLabel: "Shopping Cart",
|
|
28
|
-
children: /* @__PURE__ */
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */
|
|
29
|
+
children: /* @__PURE__ */ a("div", { id: "cart-panel", className: t.cartContainer, children: [
|
|
30
|
+
/* @__PURE__ */ a("div", { className: t.headerWrapper, children: [
|
|
31
|
+
/* @__PURE__ */ a("div", { className: t.header, children: [
|
|
31
32
|
/* @__PURE__ */ i(l, { size: "2xl", children: "Cart" }),
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
(
|
|
33
|
+
/* @__PURE__ */ a(l, { size: "xs", colorToken: "quaternary", children: [
|
|
34
|
+
(d = r == null ? void 0 : r.items) == null ? void 0 : d.length,
|
|
34
35
|
" items in your cart"
|
|
35
36
|
] })
|
|
36
37
|
] }),
|
|
37
|
-
/* @__PURE__ */ i("button", { onClick:
|
|
38
|
+
/* @__PURE__ */ i("button", { onClick: s, children: /* @__PURE__ */ i(C, { iconKey: "fa-regular fa-xmark", size: "md" }) })
|
|
38
39
|
] }),
|
|
39
|
-
/* @__PURE__ */ i("div", { className:
|
|
40
|
-
|
|
40
|
+
/* @__PURE__ */ i("div", { className: t.cartItems, children: r.items.length > 0 ? /* @__PURE__ */ i("ul", { children: r.items.map((e) => /* @__PURE__ */ i(
|
|
41
|
+
x,
|
|
41
42
|
{
|
|
42
43
|
imageUrl: e.imageUrl,
|
|
43
44
|
imageAlt: `${e.itemId} product image`,
|
|
44
45
|
title: e.description,
|
|
45
46
|
titleHref: e.itemHref || `/part/${e.itemId}`,
|
|
47
|
+
onTitleNavigate: () => m == null ? void 0 : m(e),
|
|
46
48
|
partNumber: e.itemId,
|
|
47
49
|
custom: !!e.custom,
|
|
48
50
|
availabilityId: e.availabilityId,
|
|
49
51
|
availability: e.availability,
|
|
50
|
-
contactHref:
|
|
51
|
-
contactLinkBehavior:
|
|
52
|
+
contactHref: h,
|
|
53
|
+
contactLinkBehavior: p,
|
|
52
54
|
price: e.price,
|
|
53
|
-
priceLabel:
|
|
55
|
+
priceLabel: c || "List Price",
|
|
54
56
|
quantity: e.quantity,
|
|
55
|
-
onQuantityChange: (
|
|
56
|
-
onRemove: () =>
|
|
57
|
+
onQuantityChange: (f) => u(e, f),
|
|
58
|
+
onRemove: () => y(e)
|
|
57
59
|
},
|
|
58
60
|
e.id
|
|
59
|
-
)) }) : /* @__PURE__ */ i("div", { className:
|
|
60
|
-
n && /* @__PURE__ */
|
|
61
|
+
)) }) : /* @__PURE__ */ i("div", { className: t.noItems, children: /* @__PURE__ */ i(l, { as: "p", size: "sm", children: "No items in your cart yet" }) }) }),
|
|
62
|
+
n && /* @__PURE__ */ a("div", { className: t.subtotal, children: [
|
|
61
63
|
/* @__PURE__ */ i(l, { size: "md", weight: "semibold", children: "Subtotal" }),
|
|
62
64
|
/* @__PURE__ */ i(l, { size: "md", weight: "semibold", children: n })
|
|
63
65
|
] }),
|
|
64
66
|
/* @__PURE__ */ i(
|
|
65
|
-
|
|
67
|
+
v,
|
|
66
68
|
{
|
|
67
|
-
disabled:
|
|
68
|
-
onClick:
|
|
69
|
+
disabled: r.items.length === 0,
|
|
70
|
+
onClick: b,
|
|
69
71
|
variant: "cta-primary",
|
|
70
72
|
size: "md",
|
|
71
|
-
className:
|
|
73
|
+
className: t.checkoutButton,
|
|
72
74
|
children: "Checkout"
|
|
73
75
|
}
|
|
74
76
|
)
|
|
@@ -77,5 +79,5 @@ function q({
|
|
|
77
79
|
);
|
|
78
80
|
}
|
|
79
81
|
export {
|
|
80
|
-
|
|
82
|
+
B as CartSlideInPanel
|
|
81
83
|
};
|