@caseparts-org/caseblocks 0.0.240 → 0.0.242
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/Availability.css +1 -1
- package/dist/assets/Product.css +1 -1
- package/dist/assets/SuggestionDropdown.css +1 -1
- package/dist/main-client.d.ts +1 -1
- package/dist/main.d.ts +1 -1
- package/dist/molecules/Availability/Availability.js +44 -40
- package/dist/organisms/MainNav/MainNav.js +110 -109
- package/dist/organisms/MainNav/MainNav.stories.js +17 -13
- package/dist/organisms/Product/Product.js +102 -102
- package/dist/organisms/SuggestionDropdown/SuggestionDropdown.d.ts +9 -1
- package/dist/organisms/SuggestionDropdown/SuggestionDropdown.js +110 -86
- package/dist/organisms/SuggestionDropdown/SuggestionDropdown.stories.js +10 -6
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsxs as p, Fragment as
|
|
1
|
+
import { jsxs as p, Fragment as C, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { useState as g } from "react";
|
|
3
3
|
import { MainNav as b } from "./MainNav.js";
|
|
4
|
-
import { Text as
|
|
5
|
-
import { Link as
|
|
4
|
+
import { Text as h } from "../../atoms/Text/Text.js";
|
|
5
|
+
import { Link as y } from "../../atoms/Link/Link.js";
|
|
6
6
|
import { Button as S } from "../../atoms/Button/Button.js";
|
|
7
7
|
import { CartSlideInPanel as v } from "../../molecules/Cart/CartSlideInPanel.js";
|
|
8
8
|
const P = {
|
|
@@ -119,6 +119,10 @@ const P = {
|
|
|
119
119
|
{ categoryKey: 46971, name: "Magnetic Gaskets", url: "/category/46971" },
|
|
120
120
|
{ categoryKey: 47501, name: "Magnetic Gaskets", url: "/category/47501" }
|
|
121
121
|
],
|
|
122
|
+
customParts: [
|
|
123
|
+
{ id: "gasket", label: "Gaskets", url: "/custom/gasket", icon: "fa-kit fa-gaskets" },
|
|
124
|
+
{ id: "heater", label: "Bent Heaters", url: "/custom/heater", icon: "fa-kit fa-coils" }
|
|
125
|
+
],
|
|
122
126
|
items: [
|
|
123
127
|
{ itemKey: 13503, itemId: "GASKET-RING", description: "Gasket Sample Ring", image: a, url: "/part/GASKET-RING" },
|
|
124
128
|
{ itemKey: 13968, itemId: "810719", description: "26-5/8 x 54-1/4 Door Gasket For True", image: a, url: "/part/810719" },
|
|
@@ -126,7 +130,7 @@ const P = {
|
|
|
126
130
|
{ itemKey: 435, itemId: "810803", description: "25-5/8 x 54-1/8 Door Gasket For True", image: a, url: "/part/810803" },
|
|
127
131
|
{ itemKey: 14622, itemId: "932587", description: "26-3/4 x 26-3/4 Door Gasket For True", image: a, url: "/part/932587" }
|
|
128
132
|
]
|
|
129
|
-
},
|
|
133
|
+
}, f = [
|
|
130
134
|
{ term: "door gasket", url: "/search/door-gasket" },
|
|
131
135
|
{ term: "walk-in cooler", url: "/search/walk-in-cooler" },
|
|
132
136
|
{ term: "thermostat", url: "/search/thermostat" }
|
|
@@ -146,21 +150,21 @@ const P = {
|
|
|
146
150
|
{ id: 12, itemId: "1092-02", description: "Kason Door Closer - Offset", price: "$99.99", quantity: 1, imageUrl: a, availability: "In Stock", availabilityId: "available" }
|
|
147
151
|
]
|
|
148
152
|
};
|
|
149
|
-
function
|
|
153
|
+
function R(e) {
|
|
150
154
|
return `$${e.items.reduce(
|
|
151
155
|
(t, r) => t + (parseFloat(r.price.replace(/[^0-9.]/g, "")) || 0) * r.quantity,
|
|
152
156
|
0
|
|
153
157
|
).toFixed(2)}`;
|
|
154
158
|
}
|
|
155
159
|
const u = /* @__PURE__ */ p("div", { style: { display: "flex", flexDirection: "column", gap: 8, minWidth: 220 }, children: [
|
|
156
|
-
/* @__PURE__ */ i(
|
|
157
|
-
/* @__PURE__ */ i(
|
|
158
|
-
/* @__PURE__ */ i(
|
|
159
|
-
/* @__PURE__ */ i(
|
|
160
|
+
/* @__PURE__ */ i(h, { size: "sm", weight: "semibold", children: "Account" }),
|
|
161
|
+
/* @__PURE__ */ i(h, { size: "xs", children: "Signed in as Ringo" }),
|
|
162
|
+
/* @__PURE__ */ i(y, { href: "/account", "data-popover-close": "true", children: "View Account" }),
|
|
163
|
+
/* @__PURE__ */ i(y, { href: "/orders", "data-popover-close": "true", children: "Order History" }),
|
|
160
164
|
/* @__PURE__ */ i(S, { size: "sm", variant: "secondary", "data-popover-close": "true", onClick: () => alert("Sign out"), children: "Sign Out" })
|
|
161
165
|
] }), m = (e) => {
|
|
162
166
|
const [o, t] = g(!1);
|
|
163
|
-
return /* @__PURE__ */ p(
|
|
167
|
+
return /* @__PURE__ */ p(C, { children: [
|
|
164
168
|
/* @__PURE__ */ i(
|
|
165
169
|
b,
|
|
166
170
|
{
|
|
@@ -175,7 +179,7 @@ const u = /* @__PURE__ */ p("div", { style: { display: "flex", flexDirection: "c
|
|
|
175
179
|
open: o,
|
|
176
180
|
onClose: () => t(!1),
|
|
177
181
|
cart: e.cart,
|
|
178
|
-
subtotal:
|
|
182
|
+
subtotal: R(e.cart),
|
|
179
183
|
itemPriceLabel: "List Price",
|
|
180
184
|
onItemQtyChange: () => alert("Qty Change"),
|
|
181
185
|
onItemDelete: () => alert("Delete"),
|
|
@@ -184,7 +188,7 @@ const u = /* @__PURE__ */ p("div", { style: { display: "flex", flexDirection: "c
|
|
|
184
188
|
)
|
|
185
189
|
] });
|
|
186
190
|
}, G = (e) => {
|
|
187
|
-
const [o, t] = g(""), [r,
|
|
191
|
+
const [o, t] = g(""), [r, k] = g(f);
|
|
188
192
|
return /* @__PURE__ */ i(
|
|
189
193
|
b,
|
|
190
194
|
{
|
|
@@ -196,7 +200,7 @@ const u = /* @__PURE__ */ p("div", { style: { display: "flex", flexDirection: "c
|
|
|
196
200
|
searchSuggestions: o ? I : void 0,
|
|
197
201
|
recentSearches: r,
|
|
198
202
|
onClearRecentSearch: (l) => {
|
|
199
|
-
|
|
203
|
+
k((n) => n.filter((d) => d.url !== l.url));
|
|
200
204
|
},
|
|
201
205
|
searchInputProps: {
|
|
202
206
|
...e.searchInputProps,
|
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
import { jsxs as e, jsx as
|
|
2
|
-
import { Image as
|
|
3
|
-
import { Link as
|
|
1
|
+
import { jsxs as e, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { Image as P } from "../../atoms/Image/Image.js";
|
|
3
|
+
import { Link as j } 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 { CustomWizardBadge 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
|
-
productData:
|
|
21
|
-
purchase:
|
|
22
|
-
attributeContainer:
|
|
23
|
-
elevated:
|
|
24
|
-
noImage:
|
|
5
|
+
import { Availability as D } from "../../molecules/Availability/Availability.js";
|
|
6
|
+
import { Pricing as V } from "../../molecules/Pricing/Pricing.js";
|
|
7
|
+
import { AddToCart as E } from "../../molecules/AddToCart/AddToCart.js";
|
|
8
|
+
import { CustomWizardBadge as F } from "../../molecules/CustomWizardBadge/CustomWizardBadge.js";
|
|
9
|
+
import { c as G } from "../../clsx-OuTLNxxd.js";
|
|
10
|
+
import '../../assets/Product.css';const M = "_productCard_h4utb_3", O = "_sm_h4utb_16", R = "_productInformation_h4utb_26", X = "_purchaseInformation_h4utb_33", Y = "_addToCart_h4utb_41", Z = "_addToCartButton_h4utb_44", q = "_partNumber_h4utb_54", H = "_partNumberLabel_h4utb_61", y = "_productTile_h4utb_65", L = "_productData_h4utb_92", K = "_purchase_h4utb_33", Q = "_attributeContainer_h4utb_129", S = "_elevated_h4utb_177", U = "_noImage_h4utb_183", t = {
|
|
11
|
+
productCard: M,
|
|
12
|
+
sm: O,
|
|
13
|
+
productInformation: R,
|
|
14
|
+
purchaseInformation: X,
|
|
15
|
+
addToCart: Y,
|
|
16
|
+
addToCartButton: Z,
|
|
17
|
+
partNumber: q,
|
|
18
|
+
partNumberLabel: H,
|
|
19
|
+
productTile: y,
|
|
20
|
+
productData: L,
|
|
21
|
+
purchase: K,
|
|
22
|
+
attributeContainer: Q,
|
|
23
|
+
elevated: S,
|
|
24
|
+
noImage: U
|
|
25
25
|
};
|
|
26
|
-
function
|
|
27
|
-
productView:
|
|
26
|
+
function nt({
|
|
27
|
+
productView: J,
|
|
28
28
|
itemKey: c,
|
|
29
29
|
partNumber: s,
|
|
30
|
-
productDescription:
|
|
30
|
+
productDescription: i,
|
|
31
31
|
availDescription: f,
|
|
32
32
|
availId: m,
|
|
33
33
|
inventory: N,
|
|
34
34
|
productHref: T,
|
|
35
|
-
customWizardUrl:
|
|
36
|
-
customWizardText:
|
|
37
|
-
customWizardColorToken:
|
|
38
|
-
priceLabel:
|
|
39
|
-
price:
|
|
35
|
+
customWizardUrl: u,
|
|
36
|
+
customWizardText: C = "Customize",
|
|
37
|
+
customWizardColorToken: g = "secondary",
|
|
38
|
+
priceLabel: v,
|
|
39
|
+
price: l,
|
|
40
40
|
imgSrc: o,
|
|
41
41
|
attributes: _,
|
|
42
|
-
className:
|
|
43
|
-
onAddToCart:
|
|
44
|
-
flat:
|
|
45
|
-
size:
|
|
46
|
-
showQuantity:
|
|
42
|
+
className: x,
|
|
43
|
+
onAddToCart: I,
|
|
44
|
+
flat: B,
|
|
45
|
+
size: r = "md",
|
|
46
|
+
showQuantity: b = !0,
|
|
47
47
|
onLinkClicked: d,
|
|
48
|
-
requiresUnitDetails:
|
|
49
|
-
maxQuantity:
|
|
50
|
-
|
|
48
|
+
requiresUnitDetails: A = !1,
|
|
49
|
+
maxQuantity: w,
|
|
50
|
+
...$
|
|
51
51
|
}) {
|
|
52
|
-
const
|
|
53
|
-
return
|
|
52
|
+
const h = r === "sm" ? "xs" : "sm";
|
|
53
|
+
return J === "Card" ? /* @__PURE__ */ e(
|
|
54
54
|
"div",
|
|
55
55
|
{
|
|
56
|
-
className:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
!
|
|
61
|
-
!o &&
|
|
56
|
+
className: G(
|
|
57
|
+
t.productCard,
|
|
58
|
+
r && t[r],
|
|
59
|
+
x,
|
|
60
|
+
!B && t.elevated,
|
|
61
|
+
!o && t.noImage
|
|
62
62
|
),
|
|
63
|
-
|
|
63
|
+
...$,
|
|
64
64
|
children: [
|
|
65
|
-
|
|
66
|
-
o && /* @__PURE__ */
|
|
67
|
-
|
|
65
|
+
u && /* @__PURE__ */ a(F, { href: u, text: C, colorToken: g }),
|
|
66
|
+
o && /* @__PURE__ */ a(
|
|
67
|
+
P,
|
|
68
68
|
{
|
|
69
69
|
src: o,
|
|
70
70
|
alt: `${s} product image`,
|
|
71
|
-
height:
|
|
72
|
-
width:
|
|
71
|
+
height: r === "sm" ? 78 : 96,
|
|
72
|
+
width: r === "sm" ? 78 : 96
|
|
73
73
|
}
|
|
74
74
|
),
|
|
75
|
-
/* @__PURE__ */ e("div", { className:
|
|
76
|
-
/* @__PURE__ */
|
|
77
|
-
/* @__PURE__ */ e("div", { className:
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
/* @__PURE__ */
|
|
75
|
+
/* @__PURE__ */ e("div", { className: t.productInformation, children: [
|
|
76
|
+
/* @__PURE__ */ a(j, { onClick: () => d == null ? void 0 : d(c), size: r, href: T || "#", children: i }),
|
|
77
|
+
/* @__PURE__ */ e("div", { className: t.partNumber, children: [
|
|
78
|
+
/* @__PURE__ */ a(n, { size: h, className: t.partNumberLabel, children: "Part #" }),
|
|
79
|
+
/* @__PURE__ */ a(n, { size: h, weight: "semibold", children: s })
|
|
80
80
|
] })
|
|
81
81
|
] }),
|
|
82
|
-
/* @__PURE__ */ e("div", { className:
|
|
83
|
-
m && /* @__PURE__ */
|
|
84
|
-
|
|
82
|
+
/* @__PURE__ */ e("div", { className: t.purchaseInformation, children: [
|
|
83
|
+
m && /* @__PURE__ */ a(
|
|
84
|
+
D,
|
|
85
85
|
{
|
|
86
86
|
availId: m,
|
|
87
87
|
availDescription: f,
|
|
@@ -89,55 +89,55 @@ function nr({
|
|
|
89
89
|
enableTooltip: !0
|
|
90
90
|
}
|
|
91
91
|
),
|
|
92
|
-
|
|
92
|
+
l && /* @__PURE__ */ a(V, { pricingLabel: v, price: l })
|
|
93
93
|
] }),
|
|
94
|
-
/* @__PURE__ */
|
|
95
|
-
|
|
94
|
+
/* @__PURE__ */ a(
|
|
95
|
+
E,
|
|
96
96
|
{
|
|
97
97
|
itemKey: c,
|
|
98
|
-
onAdd:
|
|
99
|
-
max:
|
|
100
|
-
className:
|
|
101
|
-
addButtonClassName:
|
|
102
|
-
addButtonVariant:
|
|
103
|
-
size:
|
|
98
|
+
onAdd: I,
|
|
99
|
+
max: w,
|
|
100
|
+
className: t.addToCart,
|
|
101
|
+
addButtonClassName: t.addToCartButton,
|
|
102
|
+
addButtonVariant: b ? "cta-primary" : "secondary",
|
|
103
|
+
size: r,
|
|
104
104
|
buttonDoneText: "",
|
|
105
|
-
buttonText:
|
|
106
|
-
showQuantity:
|
|
107
|
-
requiresUnitDetails:
|
|
105
|
+
buttonText: b ? "Add" : "Add to Cart",
|
|
106
|
+
showQuantity: b,
|
|
107
|
+
requiresUnitDetails: A
|
|
108
108
|
}
|
|
109
109
|
)
|
|
110
110
|
]
|
|
111
111
|
}
|
|
112
|
-
) : /* @__PURE__ */ e("div", { className:
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
!
|
|
117
|
-
!o &&
|
|
118
|
-
),
|
|
119
|
-
|
|
120
|
-
o && /* @__PURE__ */
|
|
121
|
-
|
|
112
|
+
) : /* @__PURE__ */ e("div", { className: G(
|
|
113
|
+
t.productTile,
|
|
114
|
+
x,
|
|
115
|
+
r && t[r],
|
|
116
|
+
!B && t.elevated,
|
|
117
|
+
!o && t.noImage
|
|
118
|
+
), ...$, children: [
|
|
119
|
+
u && /* @__PURE__ */ a(F, { href: u, text: C, colorToken: g }),
|
|
120
|
+
o && /* @__PURE__ */ a(
|
|
121
|
+
P,
|
|
122
122
|
{
|
|
123
123
|
src: o,
|
|
124
124
|
alt: `${s} product image`,
|
|
125
|
-
height:
|
|
126
|
-
width:
|
|
125
|
+
height: r === "sm" ? 86 : 108,
|
|
126
|
+
width: r === "sm" ? 86 : 108
|
|
127
127
|
}
|
|
128
128
|
),
|
|
129
|
-
/* @__PURE__ */ e("div", { className:
|
|
130
|
-
/* @__PURE__ */ e("div", { className:
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
-
/* @__PURE__ */ e("div", { className:
|
|
133
|
-
/* @__PURE__ */
|
|
134
|
-
/* @__PURE__ */
|
|
129
|
+
/* @__PURE__ */ e("div", { className: t.productData, children: [
|
|
130
|
+
/* @__PURE__ */ e("div", { className: t.productInformation, children: [
|
|
131
|
+
/* @__PURE__ */ a(j, { onClick: () => d == null ? void 0 : d(c), size: r, href: T || "#", children: i }),
|
|
132
|
+
/* @__PURE__ */ e("div", { className: t.partNumber, children: [
|
|
133
|
+
/* @__PURE__ */ a(n, { size: h, className: t.partNumberLabel, children: "Part #" }),
|
|
134
|
+
/* @__PURE__ */ a(n, { size: h, weight: "semibold", children: s })
|
|
135
135
|
] })
|
|
136
136
|
] }),
|
|
137
|
-
/* @__PURE__ */ e("div", { className:
|
|
138
|
-
/* @__PURE__ */ e("div", { className:
|
|
139
|
-
m && /* @__PURE__ */
|
|
140
|
-
|
|
137
|
+
/* @__PURE__ */ e("div", { className: t.purchase, children: [
|
|
138
|
+
/* @__PURE__ */ e("div", { className: t.purchaseInformation, children: [
|
|
139
|
+
m && /* @__PURE__ */ a(
|
|
140
|
+
D,
|
|
141
141
|
{
|
|
142
142
|
availId: m,
|
|
143
143
|
availDescription: f,
|
|
@@ -145,20 +145,20 @@ function nr({
|
|
|
145
145
|
enableTooltip: !0
|
|
146
146
|
}
|
|
147
147
|
),
|
|
148
|
-
|
|
148
|
+
l && /* @__PURE__ */ a(V, { pricingLabel: v, price: l })
|
|
149
149
|
] }),
|
|
150
|
-
/* @__PURE__ */
|
|
150
|
+
/* @__PURE__ */ a(E, { size: r, itemKey: c, onAdd: I, max: w, className: t.addToCart, addButtonClassName: t.addToCartButton, requiresUnitDetails: A })
|
|
151
151
|
] }),
|
|
152
|
-
_ && _.length > 0 && /* @__PURE__ */
|
|
152
|
+
_ && _.length > 0 && /* @__PURE__ */ a("ul", { className: t.attributeContainer, children: _.map((p) => /* @__PURE__ */ e("li", { children: [
|
|
153
153
|
/* @__PURE__ */ e(n, { size: "xs", weight: "light", children: [
|
|
154
|
-
|
|
154
|
+
p.label,
|
|
155
155
|
":"
|
|
156
156
|
] }),
|
|
157
|
-
/* @__PURE__ */
|
|
158
|
-
] }, `${
|
|
157
|
+
/* @__PURE__ */ a(n, { size: "xs", weight: "semibold", children: p.value })
|
|
158
|
+
] }, `${p.label}.${p.value}`)) })
|
|
159
159
|
] })
|
|
160
160
|
] });
|
|
161
161
|
}
|
|
162
162
|
export {
|
|
163
|
-
|
|
163
|
+
nt as Product
|
|
164
164
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IconProps } from '../../atoms/Icon/Icon';
|
|
1
2
|
export type SuggestedCategory = {
|
|
2
3
|
categoryKey: number;
|
|
3
4
|
name: string;
|
|
@@ -14,6 +15,12 @@ export type SuggestedItem = {
|
|
|
14
15
|
image: string;
|
|
15
16
|
url: string;
|
|
16
17
|
};
|
|
18
|
+
export type SuggestedCustomPart = {
|
|
19
|
+
id: string;
|
|
20
|
+
label: string;
|
|
21
|
+
url: string;
|
|
22
|
+
icon: IconProps["iconKey"];
|
|
23
|
+
};
|
|
17
24
|
export type RecentSearch = {
|
|
18
25
|
term: string;
|
|
19
26
|
url: string;
|
|
@@ -27,6 +34,7 @@ export interface SuggestionDropdownProps {
|
|
|
27
34
|
terms: SuggestedTerm[];
|
|
28
35
|
categories: SuggestedCategory[];
|
|
29
36
|
items: SuggestedItem[];
|
|
37
|
+
customParts?: SuggestedCustomPart[];
|
|
30
38
|
recentSearches?: RecentSearch[];
|
|
31
39
|
onClearRecentSearch?: (_recentSearch: RecentSearch) => void;
|
|
32
40
|
onSuggestionClick?: (_suggestion?: SearchSelection) => void;
|
|
@@ -35,5 +43,5 @@ export interface SuggestionDropdownProps {
|
|
|
35
43
|
onKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;
|
|
36
44
|
className?: string;
|
|
37
45
|
}
|
|
38
|
-
export declare function SuggestionDropdown({ terms, categories, items, view, recentSearches, onClearRecentSearch, onSuggestionClick, activeOptionIndex, optionIdPrefix, onKeyDown, className }: SuggestionDropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
export declare function SuggestionDropdown({ terms, categories, items, customParts, view, recentSearches, onClearRecentSearch, onSuggestionClick, activeOptionIndex, optionIdPrefix, onKeyDown, className }: SuggestionDropdownProps): import("react/jsx-runtime").JSX.Element | null;
|
|
39
47
|
export {};
|