@caseparts-org/caseblocks 0.0.92 → 0.0.93
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.
|
@@ -2,7 +2,7 @@ import { jsxs as c, Fragment as d, jsx as o } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState as s } from "react";
|
|
3
3
|
import { ShoppingCart as n } from "./Cart.js";
|
|
4
4
|
import { CartSlideInPanel as m } from "./CartSlideInPanel.js";
|
|
5
|
-
const
|
|
5
|
+
const g = {
|
|
6
6
|
title: "Case Parts/Molecules/Cart",
|
|
7
7
|
component: n,
|
|
8
8
|
parameters: {
|
|
@@ -61,16 +61,13 @@ const r = (i) => {
|
|
|
61
61
|
contactLinkBehavior: "new-tab",
|
|
62
62
|
onItemDelete: () => alert("Delete"),
|
|
63
63
|
onItemQtyChange: () => alert("Qty Change"),
|
|
64
|
-
onCheckout:
|
|
64
|
+
onCheckout: () => alert("checkout")
|
|
65
65
|
}
|
|
66
66
|
)
|
|
67
67
|
] });
|
|
68
|
-
},
|
|
68
|
+
}, C = {
|
|
69
69
|
args: {
|
|
70
70
|
cart: { items: [] },
|
|
71
|
-
onCheckout: () => {
|
|
72
|
-
alert("Checkout");
|
|
73
|
-
},
|
|
74
71
|
onCartClick: () => {
|
|
75
72
|
}
|
|
76
73
|
// placeholder
|
|
@@ -79,27 +76,21 @@ const r = (i) => {
|
|
|
79
76
|
}, S = {
|
|
80
77
|
args: {
|
|
81
78
|
cart: p,
|
|
82
|
-
onCheckout: () => {
|
|
83
|
-
alert("Checkout");
|
|
84
|
-
},
|
|
85
79
|
onCartClick: () => {
|
|
86
80
|
}
|
|
87
81
|
},
|
|
88
82
|
render: r
|
|
89
|
-
},
|
|
83
|
+
}, D = {
|
|
90
84
|
args: {
|
|
91
85
|
cart: y,
|
|
92
|
-
onCheckout: () => {
|
|
93
|
-
alert("Checkout");
|
|
94
|
-
},
|
|
95
86
|
onCartClick: () => {
|
|
96
87
|
}
|
|
97
88
|
},
|
|
98
89
|
render: r
|
|
99
90
|
};
|
|
100
91
|
export {
|
|
101
|
-
|
|
92
|
+
C as EmptyCart,
|
|
102
93
|
S as LargeCart,
|
|
103
|
-
|
|
104
|
-
|
|
94
|
+
D as SmallCart,
|
|
95
|
+
g as default
|
|
105
96
|
};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import { jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import b from "react";
|
|
3
3
|
import { Text as _ } from "../../atoms/Text/Text.js";
|
|
4
4
|
import { Link as l } from "../../atoms/Link/Link.js";
|
|
5
|
-
import { Icon as
|
|
5
|
+
import { Icon as j } from "../../atoms/Icon/Icon.js";
|
|
6
6
|
import { Flex as t } from "../../atoms/Flex/Flex.js";
|
|
7
|
-
import { Grid as
|
|
8
|
-
import { Logo as
|
|
7
|
+
import { Grid as D, Column as M } from "../../atoms/Grid/Grid.js";
|
|
8
|
+
import { Logo as z } from "../../molecules/Logo/Logo.js";
|
|
9
9
|
import { SearchBox as p } from "../../molecules/SearchBox/SearchBox.js";
|
|
10
|
-
import { HamburgerMenu as
|
|
11
|
-
import { ShoppingCart as
|
|
12
|
-
import { Account as
|
|
13
|
-
import { CategoryNav as
|
|
14
|
-
import { c as
|
|
15
|
-
import '../../assets/MainNav.css';const
|
|
16
|
-
main:
|
|
17
|
-
column:
|
|
18
|
-
topNav:
|
|
19
|
-
logo:
|
|
20
|
-
operations:
|
|
21
|
-
search:
|
|
22
|
-
siteLink:
|
|
23
|
-
accountArea:
|
|
24
|
-
category:
|
|
25
|
-
menuList:
|
|
26
|
-
},
|
|
10
|
+
import { HamburgerMenu as I } from "../../molecules/HamburgerMenu/HamburgerMenu.js";
|
|
11
|
+
import { ShoppingCart as U } from "../../molecules/Cart/Cart.js";
|
|
12
|
+
import { Account as F } from "../../molecules/Account/Account.js";
|
|
13
|
+
import { CategoryNav as S } from "../../molecules/CategoryNav/CategoryNav.js";
|
|
14
|
+
import { c as B } from "../../clsx-OuTLNxxd.js";
|
|
15
|
+
import '../../assets/MainNav.css';const G = "_main_1l043_1", H = "_column_1l043_8", K = "_topNav_1l043_13", P = "_logo_1l043_21", Q = "_operations_1l043_24", T = "_search_1l043_31", W = "_siteLink_1l043_34", q = "_accountArea_1l043_38", E = "_category_1l043_50", J = "_menuList_1l043_72", r = {
|
|
16
|
+
main: G,
|
|
17
|
+
column: H,
|
|
18
|
+
topNav: K,
|
|
19
|
+
logo: P,
|
|
20
|
+
operations: Q,
|
|
21
|
+
search: T,
|
|
22
|
+
siteLink: W,
|
|
23
|
+
accountArea: q,
|
|
24
|
+
category: E,
|
|
25
|
+
menuList: J
|
|
26
|
+
}, ae = b.forwardRef(function({
|
|
27
27
|
account: c,
|
|
28
28
|
categories: n,
|
|
29
29
|
byModelSerialRoute: m,
|
|
@@ -36,15 +36,14 @@ import '../../assets/MainNav.css';const H = "_main_1l043_1", K = "_column_1l043_
|
|
|
36
36
|
cart: A,
|
|
37
37
|
onLoginClick: x,
|
|
38
38
|
onSearch: f,
|
|
39
|
-
|
|
40
|
-
open: C,
|
|
39
|
+
open: L,
|
|
41
40
|
// NEW: consume external panel control props from CartPropsBase
|
|
42
|
-
onCartClick:
|
|
41
|
+
onCartClick: C,
|
|
43
42
|
// NEW: callback from consumer
|
|
44
|
-
className:
|
|
45
|
-
...
|
|
46
|
-
},
|
|
47
|
-
return /* @__PURE__ */ e(
|
|
43
|
+
className: k,
|
|
44
|
+
...w
|
|
45
|
+
}, y) {
|
|
46
|
+
return /* @__PURE__ */ e(D, { ...w, gridWrapperClassName: B(r.main, k), children: /* @__PURE__ */ o(M, { span: 12, className: r.column, children: [
|
|
48
47
|
/* @__PURE__ */ o(
|
|
49
48
|
t,
|
|
50
49
|
{
|
|
@@ -53,7 +52,7 @@ import '../../assets/MainNav.css';const H = "_main_1l043_1", K = "_column_1l043_
|
|
|
53
52
|
justifyContent: "space-between",
|
|
54
53
|
className: r.topNav,
|
|
55
54
|
children: [
|
|
56
|
-
/* @__PURE__ */ e("div", { className: r.logo, children: /* @__PURE__ */ e(l, { href: u, children: /* @__PURE__ */ e(
|
|
55
|
+
/* @__PURE__ */ e("div", { className: r.logo, children: /* @__PURE__ */ e(l, { href: u, children: /* @__PURE__ */ e(z, {}) }) }),
|
|
57
56
|
/* @__PURE__ */ o(
|
|
58
57
|
t,
|
|
59
58
|
{
|
|
@@ -67,7 +66,7 @@ import '../../assets/MainNav.css';const H = "_main_1l043_1", K = "_column_1l043_
|
|
|
67
66
|
/* @__PURE__ */ e(i, { href: h, hideAt: ["sm", "md"], children: "Custom Parts" }),
|
|
68
67
|
/* @__PURE__ */ e(i, { href: d, hideAt: ["sm", "md"], children: "Contact Us" }),
|
|
69
68
|
/* @__PURE__ */ e("div", { className: r.accountArea, children: /* @__PURE__ */ e(
|
|
70
|
-
|
|
69
|
+
F,
|
|
71
70
|
{
|
|
72
71
|
account: c,
|
|
73
72
|
accountRoute: v,
|
|
@@ -76,16 +75,15 @@ import '../../assets/MainNav.css';const H = "_main_1l043_1", K = "_column_1l043_
|
|
|
76
75
|
}
|
|
77
76
|
) }),
|
|
78
77
|
/* @__PURE__ */ e(
|
|
79
|
-
|
|
78
|
+
U,
|
|
80
79
|
{
|
|
81
|
-
ref:
|
|
80
|
+
ref: y,
|
|
82
81
|
cart: A,
|
|
83
|
-
open:
|
|
84
|
-
onCartClick:
|
|
85
|
-
onCheckout: L
|
|
82
|
+
open: L,
|
|
83
|
+
onCartClick: C
|
|
86
84
|
}
|
|
87
85
|
),
|
|
88
|
-
/* @__PURE__ */ e(
|
|
86
|
+
/* @__PURE__ */ e(I, { hideAt: ["lg"], children: /* @__PURE__ */ o("ul", { className: r.menuList, children: [
|
|
89
87
|
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(i, { href: m, children: "Make/Serial" }) }),
|
|
90
88
|
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(i, { href: h, children: "Custom Parts" }) }),
|
|
91
89
|
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(i, { href: d, children: "Contact Us" }) }),
|
|
@@ -94,7 +92,7 @@ import '../../assets/MainNav.css';const H = "_main_1l043_1", K = "_column_1l043_
|
|
|
94
92
|
n && n.map((a) => /* @__PURE__ */ e("li", { className: r.category, children: /* @__PURE__ */ o(l, { href: a.route, children: [
|
|
95
93
|
/* @__PURE__ */ e(_, { size: "sm", weight: "semibold", children: a.label }),
|
|
96
94
|
/* @__PURE__ */ e(
|
|
97
|
-
|
|
95
|
+
j,
|
|
98
96
|
{
|
|
99
97
|
iconKey: "fa-solid fa-chevron-right",
|
|
100
98
|
title: "Navigate",
|
|
@@ -110,7 +108,7 @@ import '../../assets/MainNav.css';const H = "_main_1l043_1", K = "_column_1l043_
|
|
|
110
108
|
}
|
|
111
109
|
),
|
|
112
110
|
/* @__PURE__ */ e(t, { flexDirection: "row", hideAt: ["md", "lg"], children: /* @__PURE__ */ e(p, { onSearch: f, inputName: "cpc-search", className: r.search }) }),
|
|
113
|
-
/* @__PURE__ */ e(
|
|
111
|
+
/* @__PURE__ */ e(S, { categories: n })
|
|
114
112
|
] }) });
|
|
115
113
|
});
|
|
116
114
|
function i({
|
|
@@ -121,5 +119,5 @@ function i({
|
|
|
121
119
|
return /* @__PURE__ */ e(l, { href: s, className: r.siteLink, ...n, children: /* @__PURE__ */ e(_, { size: "md", variant: "display", children: c }) });
|
|
122
120
|
}
|
|
123
121
|
export {
|
|
124
|
-
|
|
122
|
+
ae as MainNav
|
|
125
123
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as s, Fragment as u, jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import { useState as b } from "react";
|
|
3
3
|
import { MainNav as d } from "./MainNav.js";
|
|
4
4
|
import { CartSlideInPanel as m } from "../../molecules/Cart/CartSlideInPanel.js";
|
|
@@ -88,56 +88,56 @@ const g = {
|
|
|
88
88
|
route: "#",
|
|
89
89
|
children: []
|
|
90
90
|
}
|
|
91
|
-
],
|
|
91
|
+
], a = "https://m.media-amazon.com/images/I/216+JEttsYL._UF1000,1000_QL80_.jpg", r = {
|
|
92
92
|
items: [
|
|
93
|
-
{ id: 1, itemId: "1094-01", description: "Kason Door Closer - Flush", price: "$99.99", quantity: 1, imageUrl:
|
|
94
|
-
{ id: 2, itemId: "810810", description: "True Door Gasket", price: "$99.99", quantity: 1, imageUrl:
|
|
95
|
-
{ id: 3, itemId: "MG064", description: '36" x 79" 3-Sided Dart-to-Dart Gasket', price: "$99.99", quantity: 1, imageUrl:
|
|
96
|
-
{ id: 4, itemId: "MG064-B", description: '36" x 79" 3-Sided Dart-to-Dart Gasket', price: "$99.99", quantity: 1, imageUrl:
|
|
97
|
-
{ id: 5, itemId: "Warmer Wire", description: '228" 7.0 OHMS 115V', price: "$99.99", quantity: 1, imageUrl:
|
|
98
|
-
{ id: 6, itemId: "810803", description: "True Door Gasket", price: "$99.99", quantity: 1, imageUrl:
|
|
99
|
-
{ id: 7, itemId: "ABG-12114-PF", description: "Adhesive Sponge Gasket 1/4", price: "$99.99", quantity: 10, imageUrl:
|
|
100
|
-
{ id: 8, itemId: "ABG-12138-PF", description: "Adhesive Sponge Gasket 3/8", price: "$99.99", quantity: 10, imageUrl:
|
|
101
|
-
{ id: 9, itemId: "1094-C1", description: "Kason Door Closer - Flush", price: "$99.99", quantity: 1, imageUrl:
|
|
102
|
-
{ id: 10, itemId: "1094-02", description: "Kason Door Closer - Offset", price: "$99.99", quantity: 1, imageUrl:
|
|
103
|
-
{ id: 11, itemId: "1092-01", description: "Kason Door Closer - Flush", price: "$99.99", quantity: 1, imageUrl:
|
|
104
|
-
{ id: 12, itemId: "1092-02", description: "Kason Door Closer - Offset", price: "$99.99", quantity: 1, imageUrl:
|
|
93
|
+
{ id: 1, itemId: "1094-01", description: "Kason Door Closer - Flush", price: "$99.99", quantity: 1, imageUrl: a, availability: "In Stock", availabilityId: "available" },
|
|
94
|
+
{ id: 2, itemId: "810810", description: "True Door Gasket", price: "$99.99", quantity: 1, imageUrl: a, availability: "In Stock", availabilityId: "available" },
|
|
95
|
+
{ id: 3, itemId: "MG064", description: '36" x 79" 3-Sided Dart-to-Dart Gasket', price: "$99.99", quantity: 1, imageUrl: a, availability: "In Stock", availabilityId: "available" },
|
|
96
|
+
{ id: 4, itemId: "MG064-B", description: '36" x 79" 3-Sided Dart-to-Dart Gasket', price: "$99.99", quantity: 1, imageUrl: a, availability: "In Stock", availabilityId: "available" },
|
|
97
|
+
{ id: 5, itemId: "Warmer Wire", description: '228" 7.0 OHMS 115V', price: "$99.99", quantity: 1, imageUrl: a, availability: "", availabilityId: "available" },
|
|
98
|
+
{ id: 6, itemId: "810803", description: "True Door Gasket", price: "$99.99", quantity: 1, imageUrl: a, availability: "In Stock", availabilityId: "available" },
|
|
99
|
+
{ id: 7, itemId: "ABG-12114-PF", description: "Adhesive Sponge Gasket 1/4", price: "$99.99", quantity: 10, imageUrl: a, availability: "In Stock", availabilityId: "available" },
|
|
100
|
+
{ id: 8, itemId: "ABG-12138-PF", description: "Adhesive Sponge Gasket 3/8", price: "$99.99", quantity: 10, imageUrl: a, availability: "In Stock", availabilityId: "available" },
|
|
101
|
+
{ id: 9, itemId: "1094-C1", description: "Kason Door Closer - Flush", price: "$99.99", quantity: 1, imageUrl: a, availability: "In Stock", availabilityId: "available" },
|
|
102
|
+
{ id: 10, itemId: "1094-02", description: "Kason Door Closer - Offset", price: "$99.99", quantity: 1, imageUrl: a, availability: "In Stock", availabilityId: "available" },
|
|
103
|
+
{ id: 11, itemId: "1092-01", description: "Kason Door Closer - Flush", price: "$99.99", quantity: 1, imageUrl: a, availability: "In Stock", availabilityId: "available" },
|
|
104
|
+
{ id: 12, itemId: "1092-02", description: "Kason Door Closer - Offset", price: "$99.99", quantity: 1, imageUrl: a, availability: "In Stock", availabilityId: "available" }
|
|
105
105
|
]
|
|
106
106
|
};
|
|
107
|
-
function
|
|
107
|
+
function y(e) {
|
|
108
108
|
return `$${e.items.reduce(
|
|
109
|
-
(
|
|
109
|
+
(t, i) => t + (parseFloat(i.price.replace(/[^0-9.]/g, "")) || 0) * i.quantity,
|
|
110
110
|
0
|
|
111
111
|
).toFixed(2)}`;
|
|
112
112
|
}
|
|
113
113
|
const n = (e) => {
|
|
114
|
-
const [o,
|
|
115
|
-
return /* @__PURE__ */ u
|
|
114
|
+
const [o, t] = b(!1);
|
|
115
|
+
return /* @__PURE__ */ s(u, { children: [
|
|
116
116
|
/* @__PURE__ */ c(
|
|
117
117
|
d,
|
|
118
118
|
{
|
|
119
119
|
...e,
|
|
120
120
|
open: o,
|
|
121
|
-
onCartClick: () =>
|
|
121
|
+
onCartClick: () => t((i) => !i)
|
|
122
122
|
}
|
|
123
123
|
),
|
|
124
124
|
/* @__PURE__ */ c(
|
|
125
125
|
m,
|
|
126
126
|
{
|
|
127
127
|
open: o,
|
|
128
|
-
onClose: () =>
|
|
128
|
+
onClose: () => t(!1),
|
|
129
129
|
cart: e.cart,
|
|
130
|
-
subtotal:
|
|
130
|
+
subtotal: y(e.cart),
|
|
131
131
|
itemPriceLabel: "List Price",
|
|
132
132
|
contactHref: e.contactRoute,
|
|
133
133
|
contactLinkBehavior: "new-tab",
|
|
134
134
|
onItemQtyChange: () => alert("Qty Change"),
|
|
135
135
|
onItemDelete: () => alert("Delete"),
|
|
136
|
-
onCheckout:
|
|
136
|
+
onCheckout: () => alert("checkout")
|
|
137
137
|
}
|
|
138
138
|
)
|
|
139
139
|
] });
|
|
140
|
-
},
|
|
140
|
+
}, S = {
|
|
141
141
|
args: {
|
|
142
142
|
account: { name: "Ringo", initials: "RS", number: "123456789012" },
|
|
143
143
|
cart: r,
|
|
@@ -151,9 +151,6 @@ const n = (e) => {
|
|
|
151
151
|
onLoginClick: () => {
|
|
152
152
|
alert("Login");
|
|
153
153
|
},
|
|
154
|
-
onCheckout: () => {
|
|
155
|
-
alert("Checkout");
|
|
156
|
-
},
|
|
157
154
|
onSearch: (e) => {
|
|
158
155
|
alert(`Search ${e}`);
|
|
159
156
|
},
|
|
@@ -177,9 +174,6 @@ const n = (e) => {
|
|
|
177
174
|
onLoginClick: () => {
|
|
178
175
|
alert("Login");
|
|
179
176
|
},
|
|
180
|
-
onCheckout: () => {
|
|
181
|
-
alert("Checkout");
|
|
182
|
-
},
|
|
183
177
|
onSearch: (e) => {
|
|
184
178
|
alert(`Search ${e}`);
|
|
185
179
|
},
|
|
@@ -188,7 +182,7 @@ const n = (e) => {
|
|
|
188
182
|
categories: l
|
|
189
183
|
},
|
|
190
184
|
render: n
|
|
191
|
-
},
|
|
185
|
+
}, C = {
|
|
192
186
|
args: {
|
|
193
187
|
cart: r,
|
|
194
188
|
homeRoute: "/",
|
|
@@ -201,9 +195,6 @@ const n = (e) => {
|
|
|
201
195
|
onLoginClick: () => {
|
|
202
196
|
alert("Login");
|
|
203
197
|
},
|
|
204
|
-
onCheckout: () => {
|
|
205
|
-
alert("Checkout");
|
|
206
|
-
},
|
|
207
198
|
onSearch: (e) => {
|
|
208
199
|
alert(`Search ${e}`);
|
|
209
200
|
},
|
|
@@ -214,8 +205,8 @@ const n = (e) => {
|
|
|
214
205
|
render: n
|
|
215
206
|
};
|
|
216
207
|
export {
|
|
217
|
-
|
|
218
|
-
|
|
208
|
+
S as Authenticated,
|
|
209
|
+
C as Unauthenticated,
|
|
219
210
|
k as WithCartItems,
|
|
220
211
|
g as default
|
|
221
212
|
};
|