@caseparts-org/caseblocks 0.0.155 → 0.0.156
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.
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import './assets/Cart.css';const t = "_cartIconButton_1dh0n_2", n = "_count_1dh0n_9", o = "_cartContainer_1dh0n_24", e = "_headerWrapper_1dh0n_35", _ = "_header_1dh0n_35", c = "_cartItems_1dh0n_53", a = "_topRow_1dh0n_78", r = "_itemInfo_1dh0n_84", s = "_purchaseInformation_1dh0n_89", h = "_itemManagement_1dh0n_96", m = "_removeItem_1dh0n_114", d = "_noItems_1dh0n_124", u = "_subtotal_1dh0n_131", I = "_checkoutButton_1dh0n_138", p = {
|
|
2
|
+
cartIconButton: t,
|
|
3
|
+
count: n,
|
|
4
|
+
cartContainer: o,
|
|
5
|
+
headerWrapper: e,
|
|
6
|
+
header: _,
|
|
7
|
+
cartItems: c,
|
|
8
|
+
topRow: a,
|
|
9
|
+
itemInfo: r,
|
|
10
|
+
purchaseInformation: s,
|
|
11
|
+
itemManagement: h,
|
|
12
|
+
removeItem: m,
|
|
13
|
+
noItems: d,
|
|
14
|
+
subtotal: u,
|
|
15
|
+
checkoutButton: I
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
p as s
|
|
19
|
+
};
|
package/dist/assets/Cart.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._cartIconButton_1dh0n_2{position:relative;border:none;padding:0;margin:0;background-color:transparent}._count_1dh0n_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_1dh0n_24{height:100vh;width:100%;min-width:320px;max-width:375px;box-sizing:border-box;display:grid;grid-template-rows:auto 1fr auto auto;gap:var(--spacing-1);padding:var(--spacing-1)}._headerWrapper_1dh0n_35{display:flex;flex-direction:row;align-items:flex-start;gap:var(--spacing-spacing-2xs)}._headerWrapper_1dh0n_35>button{padding:0;margin:0;background-color:transparent;border:none}._header_1dh0n_35{display:flex;flex-direction:column;align-items:flex-start;width:100%}._cartItems_1dh0n_53{height:100%;overflow-y:auto;overflow-x:hidden}._cartItems_1dh0n_53 ul{margin:0;padding:0}._cartItems_1dh0n_53 li{display:grid;grid-template-columns:auto 1fr;gap:var(--spacing-0-5);align-items:center;box-sizing:border-box;position:relative;list-style:none;margin:0;padding:var(--spacing-0-5);width:100%;border-bottom:1px solid var(--color-neutrals-neutral-2)}._cartItems_1dh0n_53 li:first-of-type{border-top:1px solid var(--color-neutrals-neutral-2)}._topRow_1dh0n_78{display:flex;flex-direction:row;align-items:flex-start;justify-content:space-between}._itemInfo_1dh0n_84{display:flex;flex-direction:column;align-items:flex-start}._purchaseInformation_1dh0n_89{display:flex;flex-direction:row;align-items:flex-start;justify-content:space-between;width:100%}._itemManagement_1dh0n_96{display:flex;flex-direction:column;align-items:flex-end;gap:var(--spacing-spacing-3xs)}._cartItems_1dh0n_53 li p{margin:0;padding:0;word-wrap:break-word;white-space:normal;overflow-wrap:break-word}._cartItems_1dh0n_53 img{height:40px;width:40px;object-fit:contain}._removeItem_1dh0n_114{border:none;background-color:transparent;padding:0;margin:0;cursor:pointer;width:min-content;height:min-content}._noItems_1dh0n_124{display:flex;flex-direction:row;align-items:center;justify-content:center;height:100%}._subtotal_1dh0n_131{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:var(--spacing-0-5)}._checkoutButton_1dh0n_138{width:100%}
|
|
@@ -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-gkb4IOVS.js";
|
|
6
6
|
const S = l.forwardRef(function({
|
|
7
7
|
cart: i,
|
|
8
8
|
open: t = !1,
|
|
@@ -1,86 +1,89 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { SlideInPanel as
|
|
1
|
+
import { jsx as e, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { SlideInPanel as y } from "../../atoms/SlideInPanel/SlideInPanel.js";
|
|
3
3
|
import { Text as n } from "../../atoms/Text/Text.js";
|
|
4
|
-
import { Link as
|
|
5
|
-
import { Button as
|
|
6
|
-
import { Pricing as
|
|
7
|
-
import { QuantityInput as
|
|
8
|
-
import { Availability as
|
|
9
|
-
import { Icon as
|
|
10
|
-
import { s as r } from "../../Cart.module-
|
|
4
|
+
import { Link as I } from "../../atoms/Link/Link.js";
|
|
5
|
+
import { Button as b } from "../../atoms/Button/Button.js";
|
|
6
|
+
import { Pricing as N } from "../Pricing/Pricing.js";
|
|
7
|
+
import { QuantityInput as z } from "../QuantityInput/QuantityInput.js";
|
|
8
|
+
import { Availability as k } from "../Availability/Availability.js";
|
|
9
|
+
import { Icon as c } from "../../atoms/Icon/Icon.js";
|
|
10
|
+
import { s as r } from "../../Cart.module-gkb4IOVS.js";
|
|
11
11
|
function H({
|
|
12
|
-
open:
|
|
13
|
-
onClose:
|
|
14
|
-
cart:
|
|
15
|
-
subtotal:
|
|
16
|
-
itemPriceLabel:
|
|
17
|
-
contactHref:
|
|
18
|
-
contactLinkBehavior:
|
|
19
|
-
onItemQtyChange:
|
|
20
|
-
onItemDelete:
|
|
12
|
+
open: o,
|
|
13
|
+
onClose: l,
|
|
14
|
+
cart: t,
|
|
15
|
+
subtotal: m,
|
|
16
|
+
itemPriceLabel: d,
|
|
17
|
+
contactHref: h,
|
|
18
|
+
contactLinkBehavior: p,
|
|
19
|
+
onItemQtyChange: u,
|
|
20
|
+
onItemDelete: f,
|
|
21
21
|
onCheckout: v
|
|
22
22
|
}) {
|
|
23
23
|
var s;
|
|
24
|
-
return
|
|
25
|
-
|
|
24
|
+
return t = t || { items: [] }, /* @__PURE__ */ e(
|
|
25
|
+
y,
|
|
26
26
|
{
|
|
27
27
|
side: "right",
|
|
28
|
-
open:
|
|
29
|
-
onClose:
|
|
28
|
+
open: o,
|
|
29
|
+
onClose: l,
|
|
30
30
|
ariaLabel: "Shopping Cart",
|
|
31
|
-
children: /* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
children: /* @__PURE__ */ a("div", { id: "cart-panel", className: r.cartContainer, children: [
|
|
32
|
+
/* @__PURE__ */ a("div", { className: r.headerWrapper, children: [
|
|
33
|
+
/* @__PURE__ */ a("div", { className: r.header, children: [
|
|
34
|
+
/* @__PURE__ */ e(n, { size: "2xl", children: "Cart" }),
|
|
35
|
+
/* @__PURE__ */ a(n, { size: "xs", colorToken: "quaternary", children: [
|
|
36
|
+
(s = t == null ? void 0 : t.items) == null ? void 0 : s.length,
|
|
37
|
+
" items in your cart"
|
|
38
|
+
] })
|
|
39
|
+
] }),
|
|
40
|
+
/* @__PURE__ */ e("button", { onClick: l, children: /* @__PURE__ */ e(c, { iconKey: "fa-regular fa-xmark", size: "md" }) })
|
|
38
41
|
] }),
|
|
39
|
-
/* @__PURE__ */ e("div", { className: r.cartItems, children:
|
|
42
|
+
/* @__PURE__ */ e("div", { className: r.cartItems, children: t.items.length > 0 ? /* @__PURE__ */ e("ul", { children: t.items.map((i) => /* @__PURE__ */ a("li", { className: r.cartItem, children: [
|
|
40
43
|
/* @__PURE__ */ e("img", { src: i.imageUrl, alt: `${i.itemId} product image` }),
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
/* @__PURE__ */ e(n, { size: "sm", weight: "semibold", children: /* @__PURE__ */ e(
|
|
45
|
-
/* @__PURE__ */
|
|
44
|
+
/* @__PURE__ */ a("div", { children: [
|
|
45
|
+
/* @__PURE__ */ a("div", { className: r.topRow, children: [
|
|
46
|
+
/* @__PURE__ */ a("div", { className: r.itemInfo, children: [
|
|
47
|
+
/* @__PURE__ */ e(n, { size: "sm", weight: "semibold", children: /* @__PURE__ */ e(I, { href: i.itemHref || `/part/${i.itemId}`, children: i.description }) }),
|
|
48
|
+
/* @__PURE__ */ a(n, { size: "sm", children: [
|
|
46
49
|
/* @__PURE__ */ e(n, { colorToken: "quaternary", size: "xs", children: i.custom ? "Specs " : "Part # " }),
|
|
47
50
|
i.itemId
|
|
48
51
|
] })
|
|
49
52
|
] }),
|
|
50
|
-
/* @__PURE__ */ e("button", { onClick: () =>
|
|
53
|
+
/* @__PURE__ */ e("button", { onClick: () => f(i), className: r.removeItem, "aria-label": "Remove item", children: /* @__PURE__ */ e(c, { iconKey: "fa-regular fa-trash", size: "sm" }) })
|
|
51
54
|
] }),
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
/* @__PURE__ */
|
|
55
|
+
/* @__PURE__ */ a("div", { className: r.itemManagement, children: [
|
|
56
|
+
/* @__PURE__ */ a("div", { className: r.purchaseInformation, children: [
|
|
54
57
|
/* @__PURE__ */ e(
|
|
55
|
-
|
|
58
|
+
k,
|
|
56
59
|
{
|
|
57
60
|
availId: i.availabilityId || "",
|
|
58
61
|
availDescription: i.availability || "",
|
|
59
|
-
contactHref:
|
|
60
|
-
contactLinkBehavior:
|
|
62
|
+
contactHref: h || "",
|
|
63
|
+
contactLinkBehavior: p || "new-tab"
|
|
61
64
|
}
|
|
62
65
|
),
|
|
63
|
-
/* @__PURE__ */ e(
|
|
66
|
+
/* @__PURE__ */ e(N, { pricingLabel: d || "List Price", price: i.price })
|
|
64
67
|
] }),
|
|
65
68
|
/* @__PURE__ */ e(
|
|
66
|
-
|
|
69
|
+
z,
|
|
67
70
|
{
|
|
68
71
|
quantity: i.quantity,
|
|
69
|
-
onQuantityChange: (
|
|
72
|
+
onQuantityChange: (g) => u(i, g),
|
|
70
73
|
size: "sm"
|
|
71
74
|
}
|
|
72
75
|
)
|
|
73
76
|
] })
|
|
74
77
|
] })
|
|
75
78
|
] }, i.id)) }) : /* @__PURE__ */ e("div", { className: r.noItems, children: /* @__PURE__ */ e(n, { as: "p", size: "sm", children: "No items in your cart yet" }) }) }),
|
|
76
|
-
|
|
79
|
+
m && /* @__PURE__ */ a("div", { className: r.subtotal, children: [
|
|
77
80
|
/* @__PURE__ */ e(n, { size: "md", weight: "semibold", children: "Subtotal" }),
|
|
78
|
-
/* @__PURE__ */ e(n, { size: "md", weight: "semibold", children:
|
|
81
|
+
/* @__PURE__ */ e(n, { size: "md", weight: "semibold", children: m })
|
|
79
82
|
] }),
|
|
80
83
|
/* @__PURE__ */ e(
|
|
81
|
-
|
|
84
|
+
b,
|
|
82
85
|
{
|
|
83
|
-
disabled:
|
|
86
|
+
disabled: t.items.length === 0,
|
|
84
87
|
onClick: v,
|
|
85
88
|
variant: "cta-primary",
|
|
86
89
|
size: "md",
|
package/package.json
CHANGED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import './assets/Cart.css';const t = "_cartIconButton_pkqoj_2", o = "_count_pkqoj_9", n = "_cartContainer_pkqoj_24", e = "_header_pkqoj_35", _ = "_cartItems_pkqoj_40", c = "_topRow_pkqoj_65", a = "_itemInfo_pkqoj_71", s = "_purchaseInformation_pkqoj_76", r = "_itemManagement_pkqoj_83", m = "_removeItem_pkqoj_101", p = "_noItems_pkqoj_111", u = "_subtotal_pkqoj_118", I = "_checkoutButton_pkqoj_125", k = {
|
|
2
|
-
cartIconButton: t,
|
|
3
|
-
count: o,
|
|
4
|
-
cartContainer: n,
|
|
5
|
-
header: e,
|
|
6
|
-
cartItems: _,
|
|
7
|
-
topRow: c,
|
|
8
|
-
itemInfo: a,
|
|
9
|
-
purchaseInformation: s,
|
|
10
|
-
itemManagement: r,
|
|
11
|
-
removeItem: m,
|
|
12
|
-
noItems: p,
|
|
13
|
-
subtotal: u,
|
|
14
|
-
checkoutButton: I
|
|
15
|
-
};
|
|
16
|
-
export {
|
|
17
|
-
k as s
|
|
18
|
-
};
|