@caseparts-org/caseblocks 0.0.238 → 0.0.239
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,126 +1,126 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { Text as
|
|
4
|
-
import { Link as
|
|
5
|
-
import { Icon as
|
|
6
|
-
import { Flex as
|
|
7
|
-
import { Grid as
|
|
8
|
-
import { Input as
|
|
9
|
-
import { InputEndAdornmentButton as
|
|
10
|
-
import { Logo as
|
|
11
|
-
import { HamburgerMenu as
|
|
1
|
+
import { jsx as m, jsxs as d, Fragment as W } from "react/jsx-runtime";
|
|
2
|
+
import L from "react";
|
|
3
|
+
import { Text as U } from "../../atoms/Text/Text.js";
|
|
4
|
+
import { Link as j } from "../../atoms/Link/Link.js";
|
|
5
|
+
import { Icon as y } from "../../atoms/Icon/Icon.js";
|
|
6
|
+
import { Flex as u } from "../../atoms/Flex/Flex.js";
|
|
7
|
+
import { Grid as ni, Column as di } from "../../atoms/Grid/Grid.js";
|
|
8
|
+
import { Input as J } from "../../atoms/Input/Input.js";
|
|
9
|
+
import { InputEndAdornmentButton as B } from "../../atoms/InputEndAdornmentButton/InputEndAdornmentButton.js";
|
|
10
|
+
import { Logo as ei } from "../../molecules/Logo/Logo.js";
|
|
11
|
+
import { HamburgerMenu as fi } from "../../molecules/HamburgerMenu/HamburgerMenu.js";
|
|
12
12
|
import { ShoppingCart as si } from "../../molecules/Cart/Cart.js";
|
|
13
|
-
import { Account as
|
|
13
|
+
import { Account as ci } from "../../molecules/Account/Account.js";
|
|
14
14
|
import { CategoryNav as ri } from "../../molecules/CategoryNav/CategoryNav.js";
|
|
15
|
-
import { SuggestionDropdown as
|
|
16
|
-
import { getHideAtStyles as
|
|
17
|
-
import { c as
|
|
18
|
-
import '../../assets/MainNav.css';const
|
|
19
|
-
main:
|
|
20
|
-
column:
|
|
15
|
+
import { SuggestionDropdown as $ } from "../SuggestionDropdown/SuggestionDropdown.js";
|
|
16
|
+
import { getHideAtStyles as X } from "../../atoms/HideAt.js";
|
|
17
|
+
import { c as k } from "../../clsx-OuTLNxxd.js";
|
|
18
|
+
import '../../assets/MainNav.css';const _i = "_main_12974_1", ai = "_column_12974_8", Ni = "_topNav_12974_13", yi = "_logo_12974_21", ki = "_operations_12974_24", wi = "_search_12974_31", Ai = "_mobileSearch_12974_36", bi = "_suggestionDropdown_12974_39", Di = "_siteLink_12974_45", vi = "_accountArea_12974_72", xi = "_category_12974_84", Li = "_categoryLink_12974_92", Ki = "_menuList_12974_108", zi = "_menuItemAction_12974_131", pi = "_shortcutIcon_12974_140", t = {
|
|
19
|
+
main: _i,
|
|
20
|
+
column: ai,
|
|
21
21
|
topNav: Ni,
|
|
22
|
-
logo:
|
|
23
|
-
operations:
|
|
24
|
-
search:
|
|
25
|
-
mobileSearch:
|
|
26
|
-
suggestionDropdown:
|
|
27
|
-
siteLink:
|
|
28
|
-
accountArea:
|
|
29
|
-
category:
|
|
30
|
-
categoryLink:
|
|
31
|
-
menuList:
|
|
32
|
-
menuItemAction:
|
|
33
|
-
shortcutIcon:
|
|
34
|
-
},
|
|
35
|
-
account:
|
|
36
|
-
categories:
|
|
37
|
-
homeRoute:
|
|
38
|
-
faqRoute:
|
|
39
|
-
customPartsRoute:
|
|
40
|
-
aboutUsRoute:
|
|
41
|
-
contactRoute:
|
|
22
|
+
logo: yi,
|
|
23
|
+
operations: ki,
|
|
24
|
+
search: wi,
|
|
25
|
+
mobileSearch: Ai,
|
|
26
|
+
suggestionDropdown: bi,
|
|
27
|
+
siteLink: Di,
|
|
28
|
+
accountArea: vi,
|
|
29
|
+
category: xi,
|
|
30
|
+
categoryLink: Li,
|
|
31
|
+
menuList: Ki,
|
|
32
|
+
menuItemAction: zi,
|
|
33
|
+
shortcutIcon: pi
|
|
34
|
+
}, Ji = L.forwardRef(function({
|
|
35
|
+
account: F,
|
|
36
|
+
categories: b,
|
|
37
|
+
homeRoute: Y,
|
|
38
|
+
faqRoute: Z,
|
|
39
|
+
customPartsRoute: I,
|
|
40
|
+
aboutUsRoute: g,
|
|
41
|
+
contactRoute: M,
|
|
42
42
|
cart: C,
|
|
43
|
-
open:
|
|
43
|
+
open: P,
|
|
44
44
|
// consume external panel control props from CartPropsBase
|
|
45
|
-
className:
|
|
46
|
-
onLoginClick:
|
|
47
|
-
searchInputProps:
|
|
48
|
-
searchValue:
|
|
49
|
-
onSearchValueChange:
|
|
50
|
-
onClearSearch:
|
|
51
|
-
onSearch:
|
|
52
|
-
searchSuggestions:
|
|
53
|
-
recentSearches:
|
|
54
|
-
onClearRecentSearch:
|
|
55
|
-
onCategoryClick:
|
|
56
|
-
onClickModelSerial:
|
|
45
|
+
className: V,
|
|
46
|
+
onLoginClick: h,
|
|
47
|
+
searchInputProps: o,
|
|
48
|
+
searchValue: s,
|
|
49
|
+
onSearchValueChange: n,
|
|
50
|
+
onClearSearch: w,
|
|
51
|
+
onSearch: c,
|
|
52
|
+
searchSuggestions: l,
|
|
53
|
+
recentSearches: _,
|
|
54
|
+
onClearRecentSearch: H,
|
|
55
|
+
onCategoryClick: K,
|
|
56
|
+
onClickModelSerial: R,
|
|
57
57
|
onCartClick: S,
|
|
58
58
|
accountPopoverContent: ii,
|
|
59
|
-
isAccountLoading:
|
|
60
|
-
isCategoriesLoading:
|
|
61
|
-
...
|
|
62
|
-
},
|
|
63
|
-
const [
|
|
64
|
-
...
|
|
65
|
-
onChange: (
|
|
66
|
-
var
|
|
67
|
-
|
|
59
|
+
isAccountLoading: ti,
|
|
60
|
+
isCategoriesLoading: mi,
|
|
61
|
+
...oi
|
|
62
|
+
}, li) {
|
|
63
|
+
const [T, a] = L.useState(!1), [e, N] = L.useState(-1), z = L.useRef(null), r = L.useId(), D = T && !!s && !!l, O = T && !D && !!(_ != null && _.length), v = D ? ((l == null ? void 0 : l.terms.length) ?? 0) + ((l == null ? void 0 : l.categories.length) ?? 0) + ((l == null ? void 0 : l.items.length) ?? 0) : O ? (_ == null ? void 0 : _.length) ?? 0 : 0, q = {
|
|
64
|
+
...o,
|
|
65
|
+
onChange: (i) => {
|
|
66
|
+
var f;
|
|
67
|
+
N(-1), (f = o == null ? void 0 : o.onChange) == null || f.call(o, i);
|
|
68
68
|
},
|
|
69
|
-
onFocus: (
|
|
70
|
-
var
|
|
71
|
-
(
|
|
69
|
+
onFocus: (i) => {
|
|
70
|
+
var f;
|
|
71
|
+
(f = o == null ? void 0 : o.onFocus) == null || f.call(o, i), a(!0);
|
|
72
72
|
},
|
|
73
|
-
onBlur: (
|
|
74
|
-
var
|
|
75
|
-
(
|
|
73
|
+
onBlur: (i) => {
|
|
74
|
+
var f;
|
|
75
|
+
(f = o == null ? void 0 : o.onBlur) == null || f.call(o, i), a(!1);
|
|
76
76
|
},
|
|
77
|
-
onKeyDown: (
|
|
78
|
-
var
|
|
79
|
-
if ((
|
|
80
|
-
if (
|
|
81
|
-
|
|
77
|
+
onKeyDown: (i) => {
|
|
78
|
+
var f, G, Q;
|
|
79
|
+
if ((f = o == null ? void 0 : o.onKeyDown) == null || f.call(o, i), !i.defaultPrevented) {
|
|
80
|
+
if (i.key === "ArrowDown" && v > 0) {
|
|
81
|
+
i.preventDefault(), N((x) => x >= v - 1 ? 0 : x + 1);
|
|
82
82
|
return;
|
|
83
83
|
}
|
|
84
|
-
if (
|
|
85
|
-
|
|
84
|
+
if (i.key === "ArrowUp" && v > 0) {
|
|
85
|
+
i.preventDefault(), N((x) => x <= 0 ? v - 1 : x - 1);
|
|
86
86
|
return;
|
|
87
87
|
}
|
|
88
|
-
if (
|
|
89
|
-
|
|
88
|
+
if (i.key === "Tab" && D && e >= 0 && e < ((l == null ? void 0 : l.terms.length) ?? 0)) {
|
|
89
|
+
i.preventDefault(), n == null || n((l == null ? void 0 : l.terms[e].name) ?? ""), N(-1);
|
|
90
90
|
return;
|
|
91
91
|
}
|
|
92
|
-
if (
|
|
93
|
-
|
|
92
|
+
if (i.key === "Enter" && e >= 0 && e < v) {
|
|
93
|
+
i.preventDefault(), (G = document.getElementById(`${r}-${e}`)) == null || G.click();
|
|
94
94
|
return;
|
|
95
95
|
}
|
|
96
|
-
|
|
96
|
+
i.key === "Enter" && (i.preventDefault(), a(!1), (Q = z.current) == null || Q.blur(), c == null || c(s ?? ""));
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
},
|
|
100
|
-
var
|
|
101
|
-
|
|
99
|
+
}, p = (i) => {
|
|
100
|
+
var f;
|
|
101
|
+
i.key.length !== 1 || i.altKey || i.ctrlKey || i.metaKey || (i.preventDefault(), N(-1), n == null || n(`${s ?? ""}${i.key}`), (f = z.current) == null || f.focus());
|
|
102
102
|
};
|
|
103
|
-
return /* @__PURE__ */
|
|
104
|
-
/* @__PURE__ */
|
|
105
|
-
|
|
103
|
+
return /* @__PURE__ */ m(ni, { ...oi, gridWrapperClassName: k(t.main, V), children: /* @__PURE__ */ d(di, { span: 12, className: t.column, children: [
|
|
104
|
+
/* @__PURE__ */ d(
|
|
105
|
+
u,
|
|
106
106
|
{
|
|
107
107
|
flexDirection: "row",
|
|
108
108
|
alignItems: "center",
|
|
109
109
|
justifyContent: "space-between",
|
|
110
|
-
className:
|
|
110
|
+
className: t.topNav,
|
|
111
111
|
children: [
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
/* @__PURE__ */
|
|
114
|
-
|
|
112
|
+
/* @__PURE__ */ m("div", { className: t.logo, children: /* @__PURE__ */ m(j, { href: Y, children: /* @__PURE__ */ m(ei, {}) }) }),
|
|
113
|
+
/* @__PURE__ */ d(
|
|
114
|
+
u,
|
|
115
115
|
{
|
|
116
116
|
flexDirection: "row",
|
|
117
117
|
alignItems: "center",
|
|
118
118
|
justifyContent: "flex-end",
|
|
119
|
-
className:
|
|
119
|
+
className: t.operations,
|
|
120
120
|
children: [
|
|
121
|
-
/* @__PURE__ */
|
|
122
|
-
/* @__PURE__ */
|
|
123
|
-
|
|
121
|
+
/* @__PURE__ */ d(u, { flexDirection: "row", hideAt: ["sm"], className: t.search, children: [
|
|
122
|
+
/* @__PURE__ */ m(
|
|
123
|
+
J,
|
|
124
124
|
{
|
|
125
125
|
variant: "search",
|
|
126
126
|
label: "Search",
|
|
@@ -128,122 +128,136 @@ import '../../assets/MainNav.css';const fi = "_main_12974_1", _i = "_column_1297
|
|
|
128
128
|
name: "cpc-search",
|
|
129
129
|
autoComplete: "off",
|
|
130
130
|
"aria-autocomplete": "list",
|
|
131
|
-
"aria-controls":
|
|
132
|
-
"aria-activedescendant":
|
|
133
|
-
...
|
|
134
|
-
ref:
|
|
135
|
-
value:
|
|
136
|
-
endAdornment: /* @__PURE__ */
|
|
137
|
-
!!
|
|
138
|
-
|
|
131
|
+
"aria-controls": r,
|
|
132
|
+
"aria-activedescendant": e >= 0 ? `${r}-${e}` : void 0,
|
|
133
|
+
...q,
|
|
134
|
+
ref: z,
|
|
135
|
+
value: s,
|
|
136
|
+
endAdornment: /* @__PURE__ */ d(W, { children: [
|
|
137
|
+
!!s && /* @__PURE__ */ m(
|
|
138
|
+
B,
|
|
139
139
|
{
|
|
140
140
|
"aria-label": "Clear search",
|
|
141
141
|
onClick: () => {
|
|
142
|
-
|
|
142
|
+
N(-1), w == null || w();
|
|
143
143
|
},
|
|
144
144
|
iconProps: { iconKey: "fa-regular fa-xmark", size: "sm" }
|
|
145
145
|
}
|
|
146
146
|
),
|
|
147
|
-
/* @__PURE__ */
|
|
148
|
-
|
|
147
|
+
/* @__PURE__ */ m(
|
|
148
|
+
B,
|
|
149
149
|
{
|
|
150
150
|
"aria-label": "Submit search",
|
|
151
|
-
onClick: () =>
|
|
151
|
+
onClick: () => c == null ? void 0 : c(s ?? ""),
|
|
152
152
|
iconProps: { iconKey: "fa-regular fa-magnifying-glass", size: "sm" }
|
|
153
153
|
}
|
|
154
154
|
)
|
|
155
155
|
] })
|
|
156
156
|
}
|
|
157
157
|
),
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
158
|
+
D && l && /* @__PURE__ */ m(
|
|
159
|
+
$,
|
|
160
|
+
{
|
|
161
|
+
...l,
|
|
162
|
+
activeOptionIndex: e,
|
|
163
|
+
optionIdPrefix: r,
|
|
164
|
+
onKeyDown: p,
|
|
165
|
+
onSuggestionClick: (i) => {
|
|
166
|
+
n == null || n((i == null ? void 0 : i.name) ?? s ?? ""), a(!1);
|
|
167
|
+
},
|
|
168
|
+
className: t.suggestionDropdown
|
|
169
|
+
}
|
|
170
|
+
),
|
|
171
|
+
O && /* @__PURE__ */ m(
|
|
172
|
+
$,
|
|
161
173
|
{
|
|
162
174
|
terms: [],
|
|
163
175
|
categories: [],
|
|
164
176
|
items: [],
|
|
165
177
|
view: "recent-searches",
|
|
166
|
-
recentSearches:
|
|
167
|
-
onClearRecentSearch:
|
|
168
|
-
activeOptionIndex:
|
|
169
|
-
optionIdPrefix:
|
|
170
|
-
onKeyDown:
|
|
171
|
-
onSuggestionClick: () =>
|
|
172
|
-
|
|
178
|
+
recentSearches: _,
|
|
179
|
+
onClearRecentSearch: H,
|
|
180
|
+
activeOptionIndex: e,
|
|
181
|
+
optionIdPrefix: r,
|
|
182
|
+
onKeyDown: p,
|
|
183
|
+
onSuggestionClick: (i) => {
|
|
184
|
+
n == null || n((i == null ? void 0 : i.term) ?? s ?? ""), a(!1);
|
|
185
|
+
},
|
|
186
|
+
className: t.suggestionDropdown
|
|
173
187
|
}
|
|
174
188
|
)
|
|
175
189
|
] }),
|
|
176
|
-
/* @__PURE__ */
|
|
177
|
-
/* @__PURE__ */
|
|
190
|
+
/* @__PURE__ */ d("button", { onClick: R, className: k(t.siteLink, X(["sm", "md"])), children: [
|
|
191
|
+
/* @__PURE__ */ m(y, { iconKey: "fa-regular fa-sparkles", size: "sm" }),
|
|
178
192
|
"Model/Serial"
|
|
179
193
|
] }),
|
|
180
|
-
/* @__PURE__ */
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
-
/* @__PURE__ */
|
|
183
|
-
|
|
194
|
+
/* @__PURE__ */ m(A, { href: I, hideAt: ["sm", "md"], children: "Custom Parts" }),
|
|
195
|
+
/* @__PURE__ */ m(A, { href: M, hideAt: ["sm", "md"], children: "Contact Us" }),
|
|
196
|
+
/* @__PURE__ */ m("div", { className: t.accountArea, children: /* @__PURE__ */ m(
|
|
197
|
+
ci,
|
|
184
198
|
{
|
|
185
|
-
account:
|
|
186
|
-
onLoginClick:
|
|
187
|
-
className:
|
|
199
|
+
account: F,
|
|
200
|
+
onLoginClick: h,
|
|
201
|
+
className: t.avatar,
|
|
188
202
|
popoverContent: ii,
|
|
189
|
-
isAccountLoading:
|
|
203
|
+
isAccountLoading: ti
|
|
190
204
|
}
|
|
191
205
|
) }),
|
|
192
|
-
/* @__PURE__ */
|
|
206
|
+
/* @__PURE__ */ m(
|
|
193
207
|
si,
|
|
194
208
|
{
|
|
195
|
-
ref:
|
|
209
|
+
ref: li,
|
|
196
210
|
cart: C,
|
|
197
|
-
open:
|
|
211
|
+
open: P,
|
|
198
212
|
onCartClick: S
|
|
199
213
|
}
|
|
200
214
|
),
|
|
201
|
-
/* @__PURE__ */
|
|
202
|
-
/* @__PURE__ */
|
|
203
|
-
/* @__PURE__ */
|
|
204
|
-
/* @__PURE__ */
|
|
205
|
-
/* @__PURE__ */
|
|
215
|
+
/* @__PURE__ */ d(fi, { hideAt: ["lg"], children: [
|
|
216
|
+
/* @__PURE__ */ d("section", { children: [
|
|
217
|
+
/* @__PURE__ */ m(U, { size: "md", weight: "semibold", children: "Useful shortcuts" }),
|
|
218
|
+
/* @__PURE__ */ d("ul", { className: t.menuList, children: [
|
|
219
|
+
/* @__PURE__ */ m("li", { className: t.menuItem, children: /* @__PURE__ */ d(
|
|
206
220
|
"button",
|
|
207
221
|
{
|
|
208
|
-
onClick:
|
|
222
|
+
onClick: R,
|
|
209
223
|
"data-hamburger-close": "true",
|
|
210
|
-
className:
|
|
224
|
+
className: k(t.siteLink, t.menuItemAction, X(["lg"])),
|
|
211
225
|
children: [
|
|
212
|
-
/* @__PURE__ */
|
|
226
|
+
/* @__PURE__ */ m(y, { iconKey: "fa-regular fa-sparkles", size: "sm", className: t.shortcutIcon }),
|
|
213
227
|
"Model/Serial"
|
|
214
228
|
]
|
|
215
229
|
}
|
|
216
230
|
) }),
|
|
217
|
-
/* @__PURE__ */
|
|
218
|
-
/* @__PURE__ */
|
|
231
|
+
/* @__PURE__ */ m("li", { className: t.menuItem, children: /* @__PURE__ */ d(A, { href: I, className: k(t.siteLink, t.menuItemAction), children: [
|
|
232
|
+
/* @__PURE__ */ m(y, { iconKey: "fa-regular fa-screwdriver-wrench", size: "sm", className: t.shortcutIcon }),
|
|
219
233
|
"Custom Parts"
|
|
220
234
|
] }) }),
|
|
221
|
-
/* @__PURE__ */
|
|
222
|
-
/* @__PURE__ */
|
|
235
|
+
/* @__PURE__ */ m("li", { className: t.menuItem, children: /* @__PURE__ */ d(A, { href: M, className: k(t.siteLink, t.menuItemAction), children: [
|
|
236
|
+
/* @__PURE__ */ m(y, { iconKey: "fa-regular fa-envelope", size: "sm", className: t.shortcutIcon }),
|
|
223
237
|
"Contact Us"
|
|
224
238
|
] }) }),
|
|
225
|
-
/* @__PURE__ */
|
|
226
|
-
/* @__PURE__ */
|
|
239
|
+
/* @__PURE__ */ m("li", { className: t.menuItem, children: /* @__PURE__ */ d(A, { href: Z, className: k(t.siteLink, t.menuItemAction), children: [
|
|
240
|
+
/* @__PURE__ */ m(y, { iconKey: "fa-solid fa-question", size: "sm", className: t.shortcutIcon }),
|
|
227
241
|
"FAQ"
|
|
228
242
|
] }) }),
|
|
229
|
-
/* @__PURE__ */
|
|
230
|
-
/* @__PURE__ */
|
|
243
|
+
/* @__PURE__ */ m("li", { className: t.menuItem, children: /* @__PURE__ */ d(A, { href: g, className: k(t.siteLink, t.menuItemAction), children: [
|
|
244
|
+
/* @__PURE__ */ m(y, { iconKey: "fa-regular fa-people-group", size: "sm", className: t.shortcutIcon }),
|
|
231
245
|
"About Us"
|
|
232
246
|
] }) })
|
|
233
247
|
] })
|
|
234
248
|
] }),
|
|
235
|
-
/* @__PURE__ */
|
|
236
|
-
/* @__PURE__ */
|
|
237
|
-
/* @__PURE__ */
|
|
238
|
-
|
|
249
|
+
/* @__PURE__ */ d("section", { children: [
|
|
250
|
+
/* @__PURE__ */ m(U, { size: "md", weight: "semibold", children: "Shop by category" }),
|
|
251
|
+
/* @__PURE__ */ m("ul", { className: t.menuList, children: b && b.map((i) => /* @__PURE__ */ m("li", { className: t.category, children: /* @__PURE__ */ d(
|
|
252
|
+
j,
|
|
239
253
|
{
|
|
240
|
-
href:
|
|
241
|
-
className:
|
|
242
|
-
onClick: () =>
|
|
254
|
+
href: i.route,
|
|
255
|
+
className: t.categoryLink,
|
|
256
|
+
onClick: () => K == null ? void 0 : K(i),
|
|
243
257
|
children: [
|
|
244
|
-
/* @__PURE__ */
|
|
245
|
-
/* @__PURE__ */
|
|
246
|
-
|
|
258
|
+
/* @__PURE__ */ m(U, { size: "sm", children: i.label }),
|
|
259
|
+
/* @__PURE__ */ m(
|
|
260
|
+
y,
|
|
247
261
|
{
|
|
248
262
|
iconKey: "fa-solid fa-chevron-right",
|
|
249
263
|
title: "Navigate",
|
|
@@ -252,7 +266,7 @@ import '../../assets/MainNav.css';const fi = "_main_12974_1", _i = "_column_1297
|
|
|
252
266
|
)
|
|
253
267
|
]
|
|
254
268
|
}
|
|
255
|
-
) },
|
|
269
|
+
) }, i.id)) })
|
|
256
270
|
] })
|
|
257
271
|
] })
|
|
258
272
|
]
|
|
@@ -261,9 +275,9 @@ import '../../assets/MainNav.css';const fi = "_main_12974_1", _i = "_column_1297
|
|
|
261
275
|
]
|
|
262
276
|
}
|
|
263
277
|
),
|
|
264
|
-
/* @__PURE__ */
|
|
265
|
-
/* @__PURE__ */
|
|
266
|
-
|
|
278
|
+
/* @__PURE__ */ m(u, { flexDirection: "row", hideAt: ["md", "lg"], className: t.mobileSearch, children: /* @__PURE__ */ d("div", { className: t.search, children: [
|
|
279
|
+
/* @__PURE__ */ m(
|
|
280
|
+
J,
|
|
267
281
|
{
|
|
268
282
|
variant: "search",
|
|
269
283
|
label: "Search",
|
|
@@ -271,68 +285,72 @@ import '../../assets/MainNav.css';const fi = "_main_12974_1", _i = "_column_1297
|
|
|
271
285
|
name: "cpc-search",
|
|
272
286
|
autoComplete: "off",
|
|
273
287
|
"aria-autocomplete": "list",
|
|
274
|
-
"aria-controls":
|
|
275
|
-
"aria-activedescendant":
|
|
276
|
-
...
|
|
277
|
-
ref:
|
|
278
|
-
value:
|
|
279
|
-
endAdornment: /* @__PURE__ */
|
|
280
|
-
!!
|
|
281
|
-
|
|
288
|
+
"aria-controls": r,
|
|
289
|
+
"aria-activedescendant": e >= 0 ? `${r}-${e}` : void 0,
|
|
290
|
+
...q,
|
|
291
|
+
ref: z,
|
|
292
|
+
value: s,
|
|
293
|
+
endAdornment: /* @__PURE__ */ d(W, { children: [
|
|
294
|
+
!!s && /* @__PURE__ */ m(
|
|
295
|
+
B,
|
|
282
296
|
{
|
|
283
297
|
"aria-label": "Clear search",
|
|
284
298
|
onClick: () => {
|
|
285
|
-
|
|
299
|
+
N(-1), w == null || w();
|
|
286
300
|
},
|
|
287
301
|
iconProps: { iconKey: "fa-regular fa-xmark", size: "sm" }
|
|
288
302
|
}
|
|
289
303
|
),
|
|
290
|
-
/* @__PURE__ */
|
|
291
|
-
|
|
304
|
+
/* @__PURE__ */ m(
|
|
305
|
+
B,
|
|
292
306
|
{
|
|
293
307
|
"aria-label": "Submit search",
|
|
294
|
-
onClick: () =>
|
|
308
|
+
onClick: () => c == null ? void 0 : c(s ?? ""),
|
|
295
309
|
iconProps: { iconKey: "fa-regular fa-magnifying-glass", size: "sm" }
|
|
296
310
|
}
|
|
297
311
|
)
|
|
298
312
|
] })
|
|
299
313
|
}
|
|
300
314
|
),
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
315
|
+
D && l && /* @__PURE__ */ m($, { ...l, activeOptionIndex: e, optionIdPrefix: r, onKeyDown: p, onSuggestionClick: (i) => {
|
|
316
|
+
n == null || n((i == null ? void 0 : i.name) ?? s ?? ""), a(!1);
|
|
317
|
+
}, className: t.suggestionDropdown }),
|
|
318
|
+
O && /* @__PURE__ */ m(
|
|
319
|
+
$,
|
|
304
320
|
{
|
|
305
321
|
terms: [],
|
|
306
322
|
categories: [],
|
|
307
323
|
items: [],
|
|
308
324
|
view: "recent-searches",
|
|
309
|
-
recentSearches:
|
|
310
|
-
onClearRecentSearch:
|
|
311
|
-
activeOptionIndex:
|
|
312
|
-
optionIdPrefix:
|
|
313
|
-
onKeyDown:
|
|
314
|
-
onSuggestionClick: () =>
|
|
315
|
-
|
|
325
|
+
recentSearches: _,
|
|
326
|
+
onClearRecentSearch: H,
|
|
327
|
+
activeOptionIndex: e,
|
|
328
|
+
optionIdPrefix: r,
|
|
329
|
+
onKeyDown: p,
|
|
330
|
+
onSuggestionClick: (i) => {
|
|
331
|
+
n == null || n((i == null ? void 0 : i.term) ?? s ?? ""), a(!1);
|
|
332
|
+
},
|
|
333
|
+
className: t.suggestionDropdown
|
|
316
334
|
}
|
|
317
335
|
)
|
|
318
336
|
] }) }),
|
|
319
|
-
/* @__PURE__ */
|
|
337
|
+
/* @__PURE__ */ m(
|
|
320
338
|
ri,
|
|
321
339
|
{
|
|
322
|
-
categories:
|
|
323
|
-
isCategoriesLoading:
|
|
324
|
-
onCategoryClick:
|
|
340
|
+
categories: b,
|
|
341
|
+
isCategoriesLoading: mi,
|
|
342
|
+
onCategoryClick: K
|
|
325
343
|
}
|
|
326
344
|
)
|
|
327
345
|
] }) });
|
|
328
346
|
});
|
|
329
|
-
function
|
|
330
|
-
href:
|
|
331
|
-
children:
|
|
332
|
-
...
|
|
347
|
+
function A({
|
|
348
|
+
href: E,
|
|
349
|
+
children: F,
|
|
350
|
+
...b
|
|
333
351
|
}) {
|
|
334
|
-
return /* @__PURE__ */
|
|
352
|
+
return /* @__PURE__ */ m(j, { href: E, className: t.siteLink, ...b, children: F });
|
|
335
353
|
}
|
|
336
354
|
export {
|
|
337
|
-
|
|
355
|
+
Ji as MainNav
|
|
338
356
|
};
|
|
@@ -18,6 +18,10 @@ export type RecentSearch = {
|
|
|
18
18
|
term: string;
|
|
19
19
|
url: string;
|
|
20
20
|
};
|
|
21
|
+
type SearchSelection = {
|
|
22
|
+
name?: string;
|
|
23
|
+
term?: string;
|
|
24
|
+
};
|
|
21
25
|
export interface SuggestionDropdownProps {
|
|
22
26
|
view?: "suggestions" | "recent-searches";
|
|
23
27
|
terms: SuggestedTerm[];
|
|
@@ -25,10 +29,11 @@ export interface SuggestionDropdownProps {
|
|
|
25
29
|
items: SuggestedItem[];
|
|
26
30
|
recentSearches?: RecentSearch[];
|
|
27
31
|
onClearRecentSearch?: (_recentSearch: RecentSearch) => void;
|
|
28
|
-
onSuggestionClick?: () => void;
|
|
32
|
+
onSuggestionClick?: (_suggestion?: SearchSelection) => void;
|
|
29
33
|
activeOptionIndex?: number;
|
|
30
34
|
optionIdPrefix?: string;
|
|
31
35
|
onKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;
|
|
32
36
|
className?: string;
|
|
33
37
|
}
|
|
34
38
|
export declare function SuggestionDropdown({ terms, categories, items, view, recentSearches, onClearRecentSearch, onSuggestionClick, activeOptionIndex, optionIdPrefix, onKeyDown, className }: SuggestionDropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
export {};
|
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Text as
|
|
3
|
-
import { Link as
|
|
1
|
+
import { jsxs as o, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { Text as h } from "../../atoms/Text/Text.js";
|
|
3
|
+
import { Link as d } from "../../atoms/Link/Link.js";
|
|
4
4
|
import { Icon as L } from "../../atoms/Icon/Icon.js";
|
|
5
|
-
import { c as
|
|
6
|
-
import { Image as
|
|
7
|
-
import '../../assets/SuggestionDropdown.css';const
|
|
8
|
-
suggestionDropdown:
|
|
9
|
-
leftColumn:
|
|
10
|
-
leftColumnFullWidth:
|
|
11
|
-
suggestionSectionFullHeight:
|
|
12
|
-
rightColumn:
|
|
13
|
-
categorySection:
|
|
14
|
-
suggestions:
|
|
15
|
-
categories:
|
|
16
|
-
suggestionsFullHeight:
|
|
17
|
-
suggestionLink:
|
|
18
|
-
categoryLink:
|
|
19
|
-
activeOption:
|
|
20
|
-
itemList:
|
|
21
|
-
item:
|
|
22
|
-
activeItem:
|
|
23
|
-
itemInfo:
|
|
24
|
-
recentSearches:
|
|
25
|
-
recentSearchesHeader:
|
|
26
|
-
recentSearchesList:
|
|
27
|
-
recentSearch:
|
|
28
|
-
recentSearchLink:
|
|
29
|
-
clearRecentSearch:
|
|
5
|
+
import { c as r } from "../../clsx-OuTLNxxd.js";
|
|
6
|
+
import { Image as N } from "../../atoms/Image/Image.js";
|
|
7
|
+
import '../../assets/SuggestionDropdown.css';const v = "_suggestionDropdown_1udz7_1", y = "_leftColumn_1udz7_31", F = "_leftColumnFullWidth_1udz7_55", H = "_suggestionSectionFullHeight_1udz7_63", $ = "_rightColumn_1udz7_73", D = "_categorySection_1udz7_95", w = "_suggestions_1udz7_101", b = "_categories_1udz7_103", T = "_suggestionsFullHeight_1udz7_117", k = "_suggestionLink_1udz7_147", q = "_categoryLink_1udz7_149", W = "_activeOption_1udz7_163", j = "_itemList_1udz7_175", M = "_item_1udz7_175", O = "_activeItem_1udz7_209", S = "_itemInfo_1udz7_243", K = "_recentSearches_1udz7_253", R = "_recentSearchesHeader_1udz7_267", A = "_recentSearchesList_1udz7_275", B = "_recentSearch_1udz7_253", E = "_recentSearchLink_1udz7_305", G = "_clearRecentSearch_1udz7_321", t = {
|
|
8
|
+
suggestionDropdown: v,
|
|
9
|
+
leftColumn: y,
|
|
10
|
+
leftColumnFullWidth: F,
|
|
11
|
+
suggestionSectionFullHeight: H,
|
|
12
|
+
rightColumn: $,
|
|
13
|
+
categorySection: D,
|
|
14
|
+
suggestions: w,
|
|
15
|
+
categories: b,
|
|
16
|
+
suggestionsFullHeight: T,
|
|
17
|
+
suggestionLink: k,
|
|
18
|
+
categoryLink: q,
|
|
19
|
+
activeOption: W,
|
|
20
|
+
itemList: j,
|
|
21
|
+
item: M,
|
|
22
|
+
activeItem: O,
|
|
23
|
+
itemInfo: S,
|
|
24
|
+
recentSearches: K,
|
|
25
|
+
recentSearchesHeader: R,
|
|
26
|
+
recentSearchesList: A,
|
|
27
|
+
recentSearch: B,
|
|
28
|
+
recentSearchLink: E,
|
|
29
|
+
clearRecentSearch: G
|
|
30
30
|
};
|
|
31
|
-
function
|
|
31
|
+
function Z({
|
|
32
32
|
terms: n,
|
|
33
33
|
categories: c,
|
|
34
|
-
items:
|
|
34
|
+
items: m,
|
|
35
35
|
view: p = "suggestions",
|
|
36
|
-
recentSearches:
|
|
37
|
-
onClearRecentSearch:
|
|
38
|
-
onSuggestionClick:
|
|
39
|
-
activeOptionIndex:
|
|
36
|
+
recentSearches: _ = [],
|
|
37
|
+
onClearRecentSearch: g,
|
|
38
|
+
onSuggestionClick: l,
|
|
39
|
+
activeOptionIndex: a = -1,
|
|
40
40
|
optionIdPrefix: u,
|
|
41
41
|
onKeyDown: z,
|
|
42
42
|
className: f
|
|
43
43
|
}) {
|
|
44
|
-
return p === "recent-searches" ? /* @__PURE__ */
|
|
44
|
+
return p === "recent-searches" ? /* @__PURE__ */ o(
|
|
45
45
|
"div",
|
|
46
46
|
{
|
|
47
47
|
id: u,
|
|
48
48
|
role: "listbox",
|
|
49
|
-
className:
|
|
49
|
+
className: r(t.suggestionDropdown, t.recentSearches, f),
|
|
50
50
|
onKeyDown: z,
|
|
51
51
|
onMouseDown: (e) => e.preventDefault(),
|
|
52
52
|
children: [
|
|
53
|
-
/* @__PURE__ */ s("div", { className: t.recentSearchesHeader, children: /* @__PURE__ */ s(
|
|
54
|
-
/* @__PURE__ */ s("ol", { className: t.recentSearchesList, children:
|
|
53
|
+
/* @__PURE__ */ s("div", { className: t.recentSearchesHeader, children: /* @__PURE__ */ s(h, { size: "xxs", colorToken: "quaternary", children: "Recent Searches" }) }),
|
|
54
|
+
/* @__PURE__ */ s("ol", { className: t.recentSearchesList, children: _.map((e) => /* @__PURE__ */ o("li", { className: t.recentSearch, children: [
|
|
55
55
|
/* @__PURE__ */ s(
|
|
56
|
-
|
|
56
|
+
d,
|
|
57
57
|
{
|
|
58
58
|
href: e.url,
|
|
59
|
-
id: `${u}-${
|
|
59
|
+
id: `${u}-${_.indexOf(e)}`,
|
|
60
60
|
role: "option",
|
|
61
|
-
"aria-selected":
|
|
62
|
-
className:
|
|
63
|
-
onClick:
|
|
64
|
-
children: /* @__PURE__ */ s(
|
|
61
|
+
"aria-selected": a === _.indexOf(e),
|
|
62
|
+
className: r(t.recentSearchLink, { [t.activeOption]: a === _.indexOf(e) }),
|
|
63
|
+
onClick: () => l == null ? void 0 : l(e),
|
|
64
|
+
children: /* @__PURE__ */ s(h, { size: "sm", children: e.term })
|
|
65
65
|
}
|
|
66
66
|
),
|
|
67
67
|
/* @__PURE__ */ s(
|
|
@@ -70,64 +70,64 @@ function Y({
|
|
|
70
70
|
type: "button",
|
|
71
71
|
className: t.clearRecentSearch,
|
|
72
72
|
"aria-label": `Clear recent search: ${e.term}`,
|
|
73
|
-
onClick: () =>
|
|
73
|
+
onClick: () => g == null ? void 0 : g(e),
|
|
74
74
|
children: /* @__PURE__ */ s(L, { iconKey: "fa-regular fa-xmark", size: "sm" })
|
|
75
75
|
}
|
|
76
76
|
)
|
|
77
77
|
] }, e.url)) })
|
|
78
78
|
]
|
|
79
79
|
}
|
|
80
|
-
) : /* @__PURE__ */
|
|
81
|
-
(n.length > 0 || c.length > 0) && /* @__PURE__ */
|
|
82
|
-
n.length > 0 && /* @__PURE__ */ s("div", { className:
|
|
83
|
-
/* @__PURE__ */ s(
|
|
80
|
+
) : /* @__PURE__ */ o("div", { id: u, role: "listbox", className: r(t.suggestionDropdown, f), onKeyDown: z, onMouseDown: (e) => e.preventDefault(), children: [
|
|
81
|
+
(n.length > 0 || c.length > 0) && /* @__PURE__ */ o("div", { className: r(t.leftColumn, { [t.leftColumnFullWidth]: m.length === 0 }), children: [
|
|
82
|
+
n.length > 0 && /* @__PURE__ */ s("div", { className: r(t.suggestionSection, { [t.suggestionSectionFullHeight]: c.length === 0 }), children: /* @__PURE__ */ o("div", { className: r(t.suggestions, { [t.suggestionsFullHeight]: c.length === 0 }), children: [
|
|
83
|
+
/* @__PURE__ */ s(h, { size: "xxs", colorToken: "quaternary", children: "Suggestions" }),
|
|
84
84
|
n.map(
|
|
85
|
-
(e, i) => /* @__PURE__ */ s(
|
|
86
|
-
|
|
85
|
+
(e, i) => /* @__PURE__ */ s(h, { size: "sm", children: /* @__PURE__ */ s(
|
|
86
|
+
d,
|
|
87
87
|
{
|
|
88
88
|
href: e.url,
|
|
89
89
|
id: `${u}-${i}`,
|
|
90
90
|
role: "option",
|
|
91
|
-
"aria-selected":
|
|
92
|
-
className:
|
|
93
|
-
onClick:
|
|
91
|
+
"aria-selected": a === i,
|
|
92
|
+
className: r(t.suggestionLink, { [t.activeOption]: a === i }),
|
|
93
|
+
onClick: () => l == null ? void 0 : l(e),
|
|
94
94
|
children: e.name
|
|
95
95
|
}
|
|
96
96
|
) }, e.url)
|
|
97
97
|
)
|
|
98
98
|
] }) }),
|
|
99
|
-
c.length > 0 && /* @__PURE__ */ s("div", { className: t.categorySection, children: /* @__PURE__ */
|
|
100
|
-
/* @__PURE__ */ s(
|
|
99
|
+
c.length > 0 && /* @__PURE__ */ s("div", { className: t.categorySection, children: /* @__PURE__ */ o("div", { className: t.categories, children: [
|
|
100
|
+
/* @__PURE__ */ s(h, { size: "xxs", colorToken: "quaternary", children: "Categories" }),
|
|
101
101
|
c.map(
|
|
102
|
-
(e, i) => /* @__PURE__ */ s(
|
|
103
|
-
|
|
102
|
+
(e, i) => /* @__PURE__ */ s(h, { size: "sm", children: /* @__PURE__ */ s(
|
|
103
|
+
d,
|
|
104
104
|
{
|
|
105
105
|
href: e.url,
|
|
106
106
|
id: `${u}-${n.length + i}`,
|
|
107
107
|
role: "option",
|
|
108
|
-
"aria-selected":
|
|
109
|
-
className:
|
|
110
|
-
onClick:
|
|
108
|
+
"aria-selected": a === n.length + i,
|
|
109
|
+
className: r(t.categoryLink, { [t.activeOption]: a === n.length + i }),
|
|
110
|
+
onClick: () => l == null ? void 0 : l(),
|
|
111
111
|
children: e.name
|
|
112
112
|
}
|
|
113
113
|
) }, e.categoryKey)
|
|
114
114
|
)
|
|
115
115
|
] }) })
|
|
116
116
|
] }),
|
|
117
|
-
|
|
118
|
-
(e, i) => /* @__PURE__ */ s("li", { className:
|
|
119
|
-
|
|
117
|
+
m.length > 0 && /* @__PURE__ */ s("div", { className: t.rightColumn, children: /* @__PURE__ */ s("ol", { className: t.itemList, children: m.map(
|
|
118
|
+
(e, i) => /* @__PURE__ */ s("li", { className: r(t.item, { [t.activeItem]: a === n.length + c.length + i }), children: /* @__PURE__ */ o(
|
|
119
|
+
d,
|
|
120
120
|
{
|
|
121
121
|
href: e.url,
|
|
122
122
|
id: `${u}-${n.length + c.length + i}`,
|
|
123
123
|
role: "option",
|
|
124
|
-
"aria-selected":
|
|
125
|
-
onClick:
|
|
124
|
+
"aria-selected": a === n.length + c.length + i,
|
|
125
|
+
onClick: () => l == null ? void 0 : l(),
|
|
126
126
|
children: [
|
|
127
|
-
/* @__PURE__ */ s(
|
|
128
|
-
/* @__PURE__ */
|
|
129
|
-
/* @__PURE__ */ s(
|
|
130
|
-
/* @__PURE__ */ s(
|
|
127
|
+
/* @__PURE__ */ s(N, { src: e.image, alt: `${e.description} product image`, height: 72, width: 72 }),
|
|
128
|
+
/* @__PURE__ */ o("div", { className: t.itemInfo, children: [
|
|
129
|
+
/* @__PURE__ */ s(h, { size: "sm", children: e.description }),
|
|
130
|
+
/* @__PURE__ */ s(h, { size: "sm", colorToken: "quaternary", children: e.itemId })
|
|
131
131
|
] })
|
|
132
132
|
]
|
|
133
133
|
}
|
|
@@ -136,5 +136,5 @@ function Y({
|
|
|
136
136
|
] });
|
|
137
137
|
}
|
|
138
138
|
export {
|
|
139
|
-
|
|
139
|
+
Z as SuggestionDropdown
|
|
140
140
|
};
|