@caseparts-org/caseblocks 0.0.264 → 0.0.266
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,6 +1,6 @@
|
|
|
1
|
-
import { jsx as m, jsxs as
|
|
1
|
+
import { jsx as m, jsxs as d, Fragment as Y } from "react/jsx-runtime";
|
|
2
2
|
import D from "react";
|
|
3
|
-
import { Text as
|
|
3
|
+
import { Text as I } from "../../atoms/Text/Text.js";
|
|
4
4
|
import { Link as U } from "../../atoms/Link/Link.js";
|
|
5
5
|
import { Icon as k } from "../../atoms/Icon/Icon.js";
|
|
6
6
|
import { Flex as u } from "../../atoms/Flex/Flex.js";
|
|
@@ -12,16 +12,16 @@ import { HamburgerMenu as si } from "../../molecules/HamburgerMenu/HamburgerMenu
|
|
|
12
12
|
import { ShoppingCart as _i } from "../../molecules/Cart/Cart.js";
|
|
13
13
|
import { Account as Ni } from "../../molecules/Account/Account.js";
|
|
14
14
|
import { CategoryNav as yi } from "../../molecules/CategoryNav/CategoryNav.js";
|
|
15
|
-
import { SuggestionDropdown as
|
|
15
|
+
import { SuggestionDropdown as O } from "../SuggestionDropdown/SuggestionDropdown.js";
|
|
16
16
|
import { getHideAtStyles as C } from "../../atoms/HideAt.js";
|
|
17
|
-
import { c as
|
|
18
|
-
import '../../assets/MainNav.css';const ki = "_main_12974_1",
|
|
17
|
+
import { c as w } from "../../clsx-OuTLNxxd.js";
|
|
18
|
+
import '../../assets/MainNav.css';const ki = "_main_12974_1", wi = "_column_12974_8", ai = "_topNav_12974_13", Di = "_logo_12974_21", Ai = "_operations_12974_24", bi = "_search_12974_31", vi = "_mobileSearch_12974_36", xi = "_suggestionDropdown_12974_39", Li = "_siteLink_12974_45", Ki = "_accountArea_12974_72", pi = "_category_12974_84", zi = "_categoryLink_12974_92", ui = "_menuList_12974_108", Bi = "_menuItemAction_12974_131", Oi = "_shortcutIcon_12974_140", t = {
|
|
19
19
|
main: ki,
|
|
20
|
-
column:
|
|
21
|
-
topNav:
|
|
20
|
+
column: wi,
|
|
21
|
+
topNav: ai,
|
|
22
22
|
logo: Di,
|
|
23
|
-
operations:
|
|
24
|
-
search:
|
|
23
|
+
operations: Ai,
|
|
24
|
+
search: bi,
|
|
25
25
|
mobileSearch: vi,
|
|
26
26
|
suggestionDropdown: xi,
|
|
27
27
|
siteLink: Li,
|
|
@@ -30,13 +30,13 @@ import '../../assets/MainNav.css';const ki = "_main_12974_1", ai = "_column_1297
|
|
|
30
30
|
categoryLink: zi,
|
|
31
31
|
menuList: ui,
|
|
32
32
|
menuItemAction: Bi,
|
|
33
|
-
shortcutIcon:
|
|
33
|
+
shortcutIcon: Oi
|
|
34
34
|
}, Zi = D.forwardRef(function({
|
|
35
|
-
account:
|
|
36
|
-
categories:
|
|
35
|
+
account: $,
|
|
36
|
+
categories: b,
|
|
37
37
|
homeRoute: P,
|
|
38
38
|
faqRoute: V,
|
|
39
|
-
customPartsRoute:
|
|
39
|
+
customPartsRoute: M,
|
|
40
40
|
aboutUsRoute: g,
|
|
41
41
|
contactRoute: R,
|
|
42
42
|
cart: h,
|
|
@@ -46,8 +46,8 @@ import '../../assets/MainNav.css';const ki = "_main_12974_1", ai = "_column_1297
|
|
|
46
46
|
onLoginClick: ti,
|
|
47
47
|
searchInputProps: l,
|
|
48
48
|
searchValue: c,
|
|
49
|
-
onSearchValueChange:
|
|
50
|
-
onClearSearch:
|
|
49
|
+
onSearchValueChange: f,
|
|
50
|
+
onClearSearch: a,
|
|
51
51
|
onSearch: r,
|
|
52
52
|
searchSuggestions: o,
|
|
53
53
|
recentSearches: _,
|
|
@@ -58,13 +58,13 @@ import '../../assets/MainNav.css';const ki = "_main_12974_1", ai = "_column_1297
|
|
|
58
58
|
accountPopoverContent: oi,
|
|
59
59
|
isAccountLoading: li,
|
|
60
60
|
isCategoriesLoading: ni,
|
|
61
|
-
...
|
|
62
|
-
},
|
|
61
|
+
...fi
|
|
62
|
+
}, di) {
|
|
63
63
|
var W;
|
|
64
|
-
const [q, N] = D.useState(!1), [e, y] = D.useState(-1), p = D.useRef(null),
|
|
64
|
+
const [q, N] = D.useState(!1), [e, y] = D.useState(-1), p = D.useRef(null), F = D.useRef(null), s = D.useId(), G = () => {
|
|
65
65
|
var i;
|
|
66
|
-
return (i = p.current) != null && i.offsetParent ? p.current :
|
|
67
|
-
}, v = q && !!c && !!o,
|
|
66
|
+
return (i = p.current) != null && i.offsetParent ? p.current : F.current;
|
|
67
|
+
}, v = q && !!c && !!o, E = q && !v && !!(_ != null && _.length), x = v ? ((o == null ? void 0 : o.terms.length) ?? 0) + ((o == null ? void 0 : o.categories.length) ?? 0) + (((W = o == null ? void 0 : o.customParts) == null ? void 0 : W.length) ?? 0) + ((o == null ? void 0 : o.items.length) ?? 0) : E ? (_ == null ? void 0 : _.length) ?? 0 : 0, Q = {
|
|
68
68
|
...l,
|
|
69
69
|
onChange: (i) => {
|
|
70
70
|
var n;
|
|
@@ -90,7 +90,7 @@ import '../../assets/MainNav.css';const ki = "_main_12974_1", ai = "_column_1297
|
|
|
90
90
|
return;
|
|
91
91
|
}
|
|
92
92
|
if (i.key === "Tab" && v && e >= 0 && e < ((o == null ? void 0 : o.terms.length) ?? 0)) {
|
|
93
|
-
i.preventDefault(),
|
|
93
|
+
i.preventDefault(), f == null || f((o == null ? void 0 : o.terms[e].name) ?? ""), y(-1);
|
|
94
94
|
return;
|
|
95
95
|
}
|
|
96
96
|
if (i.key === "Enter" && e >= 0 && e < x) {
|
|
@@ -102,10 +102,10 @@ import '../../assets/MainNav.css';const ki = "_main_12974_1", ai = "_column_1297
|
|
|
102
102
|
}
|
|
103
103
|
}, z = (i) => {
|
|
104
104
|
var n;
|
|
105
|
-
i.key.length !== 1 || i.altKey || i.ctrlKey || i.metaKey || (i.preventDefault(), y(-1),
|
|
105
|
+
i.key.length !== 1 || i.altKey || i.ctrlKey || i.metaKey || (i.preventDefault(), y(-1), f == null || f(`${c ?? ""}${i.key}`), (n = G()) == null || n.focus());
|
|
106
106
|
};
|
|
107
|
-
return /* @__PURE__ */ m(ei, { ...
|
|
108
|
-
/* @__PURE__ */
|
|
107
|
+
return /* @__PURE__ */ m(ei, { ...fi, gridWrapperClassName: w(t.main, ii), children: /* @__PURE__ */ d(ci, { span: 12, className: t.column, children: [
|
|
108
|
+
/* @__PURE__ */ d(
|
|
109
109
|
u,
|
|
110
110
|
{
|
|
111
111
|
flexDirection: "row",
|
|
@@ -114,7 +114,7 @@ import '../../assets/MainNav.css';const ki = "_main_12974_1", ai = "_column_1297
|
|
|
114
114
|
className: t.topNav,
|
|
115
115
|
children: [
|
|
116
116
|
/* @__PURE__ */ m("div", { className: t.logo, children: /* @__PURE__ */ m(U, { href: P, children: /* @__PURE__ */ m(ri, {}) }) }),
|
|
117
|
-
/* @__PURE__ */
|
|
117
|
+
/* @__PURE__ */ d(
|
|
118
118
|
u,
|
|
119
119
|
{
|
|
120
120
|
flexDirection: "row",
|
|
@@ -122,7 +122,7 @@ import '../../assets/MainNav.css';const ki = "_main_12974_1", ai = "_column_1297
|
|
|
122
122
|
justifyContent: "flex-end",
|
|
123
123
|
className: t.operations,
|
|
124
124
|
children: [
|
|
125
|
-
/* @__PURE__ */
|
|
125
|
+
/* @__PURE__ */ d(u, { flexDirection: "row", hideAt: ["sm"], className: t.search, children: [
|
|
126
126
|
/* @__PURE__ */ m(
|
|
127
127
|
Z,
|
|
128
128
|
{
|
|
@@ -137,7 +137,7 @@ import '../../assets/MainNav.css';const ki = "_main_12974_1", ai = "_column_1297
|
|
|
137
137
|
...Q,
|
|
138
138
|
ref: p,
|
|
139
139
|
value: c,
|
|
140
|
-
endAdornment: /* @__PURE__ */
|
|
140
|
+
endAdornment: /* @__PURE__ */ d(Y, { children: [
|
|
141
141
|
!!c && /* @__PURE__ */ m(
|
|
142
142
|
B,
|
|
143
143
|
{
|
|
@@ -145,7 +145,7 @@ import '../../assets/MainNav.css';const ki = "_main_12974_1", ai = "_column_1297
|
|
|
145
145
|
onMouseDown: (i) => i.preventDefault(),
|
|
146
146
|
onClick: () => {
|
|
147
147
|
var i;
|
|
148
|
-
y(-1),
|
|
148
|
+
y(-1), a == null || a(), (i = p.current) == null || i.focus();
|
|
149
149
|
},
|
|
150
150
|
iconProps: { iconKey: "fa-regular fa-xmark", size: "sm" }
|
|
151
151
|
}
|
|
@@ -162,7 +162,7 @@ import '../../assets/MainNav.css';const ki = "_main_12974_1", ai = "_column_1297
|
|
|
162
162
|
}
|
|
163
163
|
),
|
|
164
164
|
v && o && /* @__PURE__ */ m(
|
|
165
|
-
|
|
165
|
+
O,
|
|
166
166
|
{
|
|
167
167
|
...o,
|
|
168
168
|
activeOptionIndex: e,
|
|
@@ -170,13 +170,13 @@ import '../../assets/MainNav.css';const ki = "_main_12974_1", ai = "_column_1297
|
|
|
170
170
|
onKeyDown: z,
|
|
171
171
|
onSuggestionClick: (i) => {
|
|
172
172
|
var n;
|
|
173
|
-
(n = o.onSuggestionClick) == null || n.call(o, i),
|
|
173
|
+
(n = o.onSuggestionClick) == null || n.call(o, i), f == null || f((i == null ? void 0 : i.name) ?? c ?? ""), N(!1);
|
|
174
174
|
},
|
|
175
175
|
className: t.suggestionDropdown
|
|
176
176
|
}
|
|
177
177
|
),
|
|
178
|
-
|
|
179
|
-
|
|
178
|
+
E && /* @__PURE__ */ m(
|
|
179
|
+
O,
|
|
180
180
|
{
|
|
181
181
|
terms: [],
|
|
182
182
|
categories: [],
|
|
@@ -188,22 +188,22 @@ import '../../assets/MainNav.css';const ki = "_main_12974_1", ai = "_column_1297
|
|
|
188
188
|
optionIdPrefix: s,
|
|
189
189
|
onKeyDown: z,
|
|
190
190
|
onSuggestionClick: (i) => {
|
|
191
|
-
|
|
191
|
+
f == null || f((i == null ? void 0 : i.term) ?? c ?? ""), N(!1);
|
|
192
192
|
},
|
|
193
193
|
className: t.suggestionDropdown
|
|
194
194
|
}
|
|
195
195
|
)
|
|
196
196
|
] }),
|
|
197
|
-
/* @__PURE__ */
|
|
197
|
+
/* @__PURE__ */ d("button", { onClick: T, className: w(t.siteLink, C(["sm", "md"])), children: [
|
|
198
198
|
/* @__PURE__ */ m(k, { iconKey: "fa-regular fa-sparkles", size: "sm" }),
|
|
199
|
-
"
|
|
199
|
+
"Ask Our Experts"
|
|
200
200
|
] }),
|
|
201
|
-
/* @__PURE__ */ m(
|
|
202
|
-
/* @__PURE__ */ m(
|
|
201
|
+
/* @__PURE__ */ m(A, { href: M, hideAt: ["sm", "md"], children: "Custom Parts" }),
|
|
202
|
+
/* @__PURE__ */ m(A, { href: R, hideAt: ["sm", "md"], children: "Contact Us" }),
|
|
203
203
|
/* @__PURE__ */ m("div", { className: t.accountArea, children: /* @__PURE__ */ m(
|
|
204
204
|
Ni,
|
|
205
205
|
{
|
|
206
|
-
account:
|
|
206
|
+
account: $,
|
|
207
207
|
onLoginClick: ti,
|
|
208
208
|
className: t.avatar,
|
|
209
209
|
popoverContent: oi,
|
|
@@ -213,56 +213,56 @@ import '../../assets/MainNav.css';const ki = "_main_12974_1", ai = "_column_1297
|
|
|
213
213
|
/* @__PURE__ */ m(
|
|
214
214
|
_i,
|
|
215
215
|
{
|
|
216
|
-
ref:
|
|
216
|
+
ref: di,
|
|
217
217
|
cart: h,
|
|
218
218
|
open: S,
|
|
219
219
|
onCartClick: mi
|
|
220
220
|
}
|
|
221
221
|
),
|
|
222
|
-
/* @__PURE__ */
|
|
223
|
-
/* @__PURE__ */
|
|
224
|
-
/* @__PURE__ */ m(
|
|
225
|
-
/* @__PURE__ */
|
|
226
|
-
/* @__PURE__ */ m("li", { className: t.menuItem, children: /* @__PURE__ */
|
|
222
|
+
/* @__PURE__ */ d(si, { hideAt: ["lg"], children: [
|
|
223
|
+
/* @__PURE__ */ d("section", { children: [
|
|
224
|
+
/* @__PURE__ */ m(I, { size: "md", weight: "semibold", children: "Useful shortcuts" }),
|
|
225
|
+
/* @__PURE__ */ d("ul", { className: t.menuList, children: [
|
|
226
|
+
/* @__PURE__ */ m("li", { className: t.menuItem, children: /* @__PURE__ */ d(
|
|
227
227
|
"button",
|
|
228
228
|
{
|
|
229
229
|
onClick: T,
|
|
230
230
|
"data-hamburger-close": "true",
|
|
231
|
-
className:
|
|
231
|
+
className: w(t.siteLink, t.menuItemAction, C(["lg"])),
|
|
232
232
|
children: [
|
|
233
233
|
/* @__PURE__ */ m(k, { iconKey: "fa-regular fa-sparkles", size: "sm", className: t.shortcutIcon }),
|
|
234
|
-
"
|
|
234
|
+
"Ask Our Experts"
|
|
235
235
|
]
|
|
236
236
|
}
|
|
237
237
|
) }),
|
|
238
|
-
/* @__PURE__ */ m("li", { className: t.menuItem, children: /* @__PURE__ */
|
|
238
|
+
/* @__PURE__ */ m("li", { className: t.menuItem, children: /* @__PURE__ */ d(A, { href: M, className: w(t.siteLink, t.menuItemAction), children: [
|
|
239
239
|
/* @__PURE__ */ m(k, { iconKey: "fa-regular fa-screwdriver-wrench", size: "sm", className: t.shortcutIcon }),
|
|
240
240
|
"Custom Parts"
|
|
241
241
|
] }) }),
|
|
242
|
-
/* @__PURE__ */ m("li", { className: t.menuItem, children: /* @__PURE__ */
|
|
242
|
+
/* @__PURE__ */ m("li", { className: t.menuItem, children: /* @__PURE__ */ d(A, { href: R, className: w(t.siteLink, t.menuItemAction), children: [
|
|
243
243
|
/* @__PURE__ */ m(k, { iconKey: "fa-regular fa-envelope", size: "sm", className: t.shortcutIcon }),
|
|
244
244
|
"Contact Us"
|
|
245
245
|
] }) }),
|
|
246
|
-
/* @__PURE__ */ m("li", { className: t.menuItem, children: /* @__PURE__ */
|
|
246
|
+
/* @__PURE__ */ m("li", { className: t.menuItem, children: /* @__PURE__ */ d(A, { href: V, className: w(t.siteLink, t.menuItemAction), children: [
|
|
247
247
|
/* @__PURE__ */ m(k, { iconKey: "fa-solid fa-question", size: "sm", className: t.shortcutIcon }),
|
|
248
248
|
"FAQ"
|
|
249
249
|
] }) }),
|
|
250
|
-
/* @__PURE__ */ m("li", { className: t.menuItem, children: /* @__PURE__ */
|
|
250
|
+
/* @__PURE__ */ m("li", { className: t.menuItem, children: /* @__PURE__ */ d(A, { href: g, className: w(t.siteLink, t.menuItemAction), children: [
|
|
251
251
|
/* @__PURE__ */ m(k, { iconKey: "fa-regular fa-people-group", size: "sm", className: t.shortcutIcon }),
|
|
252
252
|
"About Us"
|
|
253
253
|
] }) })
|
|
254
254
|
] })
|
|
255
255
|
] }),
|
|
256
|
-
/* @__PURE__ */
|
|
257
|
-
/* @__PURE__ */ m(
|
|
258
|
-
/* @__PURE__ */ m("ul", { className: t.menuList, children:
|
|
256
|
+
/* @__PURE__ */ d("section", { children: [
|
|
257
|
+
/* @__PURE__ */ m(I, { size: "md", weight: "semibold", children: "Shop by category" }),
|
|
258
|
+
/* @__PURE__ */ m("ul", { className: t.menuList, children: b && b.map((i) => /* @__PURE__ */ m("li", { className: t.category, children: /* @__PURE__ */ d(
|
|
259
259
|
U,
|
|
260
260
|
{
|
|
261
261
|
href: i.route,
|
|
262
262
|
className: t.categoryLink,
|
|
263
263
|
onClick: () => K == null ? void 0 : K(i),
|
|
264
264
|
children: [
|
|
265
|
-
/* @__PURE__ */ m(
|
|
265
|
+
/* @__PURE__ */ m(I, { size: "sm", children: i.label }),
|
|
266
266
|
/* @__PURE__ */ m(
|
|
267
267
|
k,
|
|
268
268
|
{
|
|
@@ -282,7 +282,7 @@ import '../../assets/MainNav.css';const ki = "_main_12974_1", ai = "_column_1297
|
|
|
282
282
|
]
|
|
283
283
|
}
|
|
284
284
|
),
|
|
285
|
-
/* @__PURE__ */ m(u, { flexDirection: "row", hideAt: ["md", "lg"], className: t.mobileSearch, children: /* @__PURE__ */
|
|
285
|
+
/* @__PURE__ */ m(u, { flexDirection: "row", hideAt: ["md", "lg"], className: t.mobileSearch, children: /* @__PURE__ */ d("div", { className: t.search, children: [
|
|
286
286
|
/* @__PURE__ */ m(
|
|
287
287
|
Z,
|
|
288
288
|
{
|
|
@@ -295,9 +295,9 @@ import '../../assets/MainNav.css';const ki = "_main_12974_1", ai = "_column_1297
|
|
|
295
295
|
"aria-controls": s,
|
|
296
296
|
"aria-activedescendant": e >= 0 ? `${s}-${e}` : void 0,
|
|
297
297
|
...Q,
|
|
298
|
-
ref:
|
|
298
|
+
ref: F,
|
|
299
299
|
value: c,
|
|
300
|
-
endAdornment: /* @__PURE__ */
|
|
300
|
+
endAdornment: /* @__PURE__ */ d(Y, { children: [
|
|
301
301
|
!!c && /* @__PURE__ */ m(
|
|
302
302
|
B,
|
|
303
303
|
{
|
|
@@ -305,7 +305,7 @@ import '../../assets/MainNav.css';const ki = "_main_12974_1", ai = "_column_1297
|
|
|
305
305
|
onMouseDown: (i) => i.preventDefault(),
|
|
306
306
|
onClick: () => {
|
|
307
307
|
var i;
|
|
308
|
-
y(-1),
|
|
308
|
+
y(-1), a == null || a(), (i = F.current) == null || i.focus();
|
|
309
309
|
},
|
|
310
310
|
iconProps: { iconKey: "fa-regular fa-xmark", size: "sm" }
|
|
311
311
|
}
|
|
@@ -321,12 +321,12 @@ import '../../assets/MainNav.css';const ki = "_main_12974_1", ai = "_column_1297
|
|
|
321
321
|
] })
|
|
322
322
|
}
|
|
323
323
|
),
|
|
324
|
-
v && o && /* @__PURE__ */ m(
|
|
324
|
+
v && o && /* @__PURE__ */ m(O, { ...o, activeOptionIndex: e, optionIdPrefix: s, onKeyDown: z, onSuggestionClick: (i) => {
|
|
325
325
|
var n;
|
|
326
|
-
(n = o.onSuggestionClick) == null || n.call(o, i),
|
|
326
|
+
(n = o.onSuggestionClick) == null || n.call(o, i), f == null || f((i == null ? void 0 : i.name) ?? c ?? ""), N(!1);
|
|
327
327
|
}, className: t.suggestionDropdown }),
|
|
328
|
-
|
|
329
|
-
|
|
328
|
+
E && /* @__PURE__ */ m(
|
|
329
|
+
O,
|
|
330
330
|
{
|
|
331
331
|
terms: [],
|
|
332
332
|
categories: [],
|
|
@@ -338,7 +338,7 @@ import '../../assets/MainNav.css';const ki = "_main_12974_1", ai = "_column_1297
|
|
|
338
338
|
optionIdPrefix: s,
|
|
339
339
|
onKeyDown: z,
|
|
340
340
|
onSuggestionClick: (i) => {
|
|
341
|
-
|
|
341
|
+
f == null || f((i == null ? void 0 : i.term) ?? c ?? ""), N(!1);
|
|
342
342
|
},
|
|
343
343
|
className: t.suggestionDropdown
|
|
344
344
|
}
|
|
@@ -347,19 +347,19 @@ import '../../assets/MainNav.css';const ki = "_main_12974_1", ai = "_column_1297
|
|
|
347
347
|
/* @__PURE__ */ m(
|
|
348
348
|
yi,
|
|
349
349
|
{
|
|
350
|
-
categories:
|
|
350
|
+
categories: b,
|
|
351
351
|
isCategoriesLoading: ni,
|
|
352
352
|
onCategoryClick: K
|
|
353
353
|
}
|
|
354
354
|
)
|
|
355
355
|
] }) });
|
|
356
356
|
});
|
|
357
|
-
function
|
|
357
|
+
function A({
|
|
358
358
|
href: j,
|
|
359
|
-
children:
|
|
360
|
-
...
|
|
359
|
+
children: $,
|
|
360
|
+
...b
|
|
361
361
|
}) {
|
|
362
|
-
return /* @__PURE__ */ m(U, { href: j, className: t.siteLink, ...
|
|
362
|
+
return /* @__PURE__ */ m(U, { href: j, className: t.siteLink, ...b, children: $ });
|
|
363
363
|
}
|
|
364
364
|
export {
|
|
365
365
|
Zi as MainNav
|