@caseparts-org/caseblocks 0.0.233 → 0.0.234
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.
|
@@ -3,76 +3,76 @@ import F from "react";
|
|
|
3
3
|
import { Text as w } from "../../atoms/Text/Text.js";
|
|
4
4
|
import { Link as y } from "../../atoms/Link/Link.js";
|
|
5
5
|
import { Icon as t } from "../../atoms/Icon/Icon.js";
|
|
6
|
-
import { Flex as
|
|
6
|
+
import { Flex as _ } from "../../atoms/Flex/Flex.js";
|
|
7
7
|
import { Grid as Y, Column as Z } from "../../atoms/Grid/Grid.js";
|
|
8
8
|
import { Input as j } from "../../atoms/Input/Input.js";
|
|
9
|
-
import { InputEndAdornmentButton as
|
|
9
|
+
import { InputEndAdornmentButton as N } from "../../atoms/InputEndAdornmentButton/InputEndAdornmentButton.js";
|
|
10
10
|
import { Logo as $ } from "../../molecules/Logo/Logo.js";
|
|
11
11
|
import { HamburgerMenu as V } from "../../molecules/HamburgerMenu/HamburgerMenu.js";
|
|
12
12
|
import { ShoppingCart as P } from "../../molecules/Cart/Cart.js";
|
|
13
13
|
import { Account as ee } from "../../molecules/Account/Account.js";
|
|
14
14
|
import { CategoryNav as ie } from "../../molecules/CategoryNav/CategoryNav.js";
|
|
15
|
-
import { SuggestionDropdown as
|
|
15
|
+
import { SuggestionDropdown as p } from "../SuggestionDropdown/SuggestionDropdown.js";
|
|
16
16
|
import { getHideAtStyles as M } from "../../atoms/HideAt.js";
|
|
17
|
-
import { c as
|
|
18
|
-
import '../../assets/MainNav.css';const oe = "_main_12974_1", ne = "_column_12974_8", se = "_topNav_12974_13", ae = "_logo_12974_21", te = "_operations_12974_24",
|
|
17
|
+
import { c as l } from "../../clsx-OuTLNxxd.js";
|
|
18
|
+
import '../../assets/MainNav.css';const oe = "_main_12974_1", ne = "_column_12974_8", se = "_topNav_12974_13", ae = "_logo_12974_21", te = "_operations_12974_24", le = "_search_12974_31", me = "_mobileSearch_12974_36", ce = "_suggestionDropdown_12974_39", re = "_siteLink_12974_45", de = "_accountArea_12974_72", fe = "_category_12974_84", ue = "_categoryLink_12974_92", ge = "_menuList_12974_108", he = "_menuItemAction_12974_131", _e = "_shortcutIcon_12974_140", e = {
|
|
19
19
|
main: oe,
|
|
20
20
|
column: ne,
|
|
21
21
|
topNav: se,
|
|
22
22
|
logo: ae,
|
|
23
23
|
operations: te,
|
|
24
|
-
search:
|
|
25
|
-
mobileSearch:
|
|
24
|
+
search: le,
|
|
25
|
+
mobileSearch: me,
|
|
26
26
|
suggestionDropdown: ce,
|
|
27
27
|
siteLink: re,
|
|
28
28
|
accountArea: de,
|
|
29
29
|
category: fe,
|
|
30
30
|
categoryLink: ue,
|
|
31
|
-
menuList:
|
|
32
|
-
menuItemAction:
|
|
31
|
+
menuList: ge,
|
|
32
|
+
menuItemAction: he,
|
|
33
33
|
shortcutIcon: _e
|
|
34
34
|
}, je = F.forwardRef(function({
|
|
35
|
-
account:
|
|
35
|
+
account: k,
|
|
36
36
|
categories: r,
|
|
37
37
|
homeRoute: U,
|
|
38
38
|
faqRoute: H,
|
|
39
|
-
customPartsRoute:
|
|
40
|
-
aboutUsRoute:
|
|
41
|
-
contactRoute:
|
|
42
|
-
cart:
|
|
43
|
-
open:
|
|
39
|
+
customPartsRoute: v,
|
|
40
|
+
aboutUsRoute: S,
|
|
41
|
+
contactRoute: L,
|
|
42
|
+
cart: q,
|
|
43
|
+
open: E,
|
|
44
44
|
// consume external panel control props from CartPropsBase
|
|
45
|
-
className:
|
|
46
|
-
onLoginClick:
|
|
45
|
+
className: G,
|
|
46
|
+
onLoginClick: Q,
|
|
47
47
|
searchInputProps: n,
|
|
48
48
|
searchValue: a,
|
|
49
|
-
onClearSearch:
|
|
50
|
-
onSearch:
|
|
49
|
+
onClearSearch: z,
|
|
50
|
+
onSearch: m,
|
|
51
51
|
searchSuggestions: d,
|
|
52
52
|
recentSearches: f,
|
|
53
|
-
onClearRecentSearch:
|
|
54
|
-
onCategoryClick:
|
|
55
|
-
onClickModelSerial:
|
|
56
|
-
onCartClick:
|
|
57
|
-
accountPopoverContent:
|
|
58
|
-
isAccountLoading:
|
|
59
|
-
isCategoriesLoading:
|
|
60
|
-
...
|
|
53
|
+
onClearRecentSearch: x,
|
|
54
|
+
onCategoryClick: g,
|
|
55
|
+
onClickModelSerial: D,
|
|
56
|
+
onCartClick: T,
|
|
57
|
+
accountPopoverContent: W,
|
|
58
|
+
isAccountLoading: J,
|
|
59
|
+
isCategoriesLoading: O,
|
|
60
|
+
...R
|
|
61
61
|
}, X) {
|
|
62
|
-
const [
|
|
62
|
+
const [C, h] = F.useState(!1), b = C && !!a && !!d, K = C && !b && !!(f != null && f.length), I = {
|
|
63
63
|
...n,
|
|
64
64
|
onFocus: (s) => {
|
|
65
65
|
var u;
|
|
66
|
-
(u = n == null ? void 0 : n.onFocus) == null || u.call(n, s),
|
|
66
|
+
(u = n == null ? void 0 : n.onFocus) == null || u.call(n, s), h(!0);
|
|
67
67
|
},
|
|
68
68
|
onBlur: (s) => {
|
|
69
69
|
var u;
|
|
70
|
-
(u = n == null ? void 0 : n.onBlur) == null || u.call(n, s),
|
|
70
|
+
(u = n == null ? void 0 : n.onBlur) == null || u.call(n, s), h(!1);
|
|
71
71
|
}
|
|
72
72
|
};
|
|
73
|
-
return /* @__PURE__ */ i(Y, { ...
|
|
73
|
+
return /* @__PURE__ */ i(Y, { ...R, gridWrapperClassName: l(e.main, G), children: /* @__PURE__ */ o(Z, { span: 12, className: e.column, children: [
|
|
74
74
|
/* @__PURE__ */ o(
|
|
75
|
-
|
|
75
|
+
_,
|
|
76
76
|
{
|
|
77
77
|
flexDirection: "row",
|
|
78
78
|
alignItems: "center",
|
|
@@ -81,14 +81,14 @@ import '../../assets/MainNav.css';const oe = "_main_12974_1", ne = "_column_1297
|
|
|
81
81
|
children: [
|
|
82
82
|
/* @__PURE__ */ i("div", { className: e.logo, children: /* @__PURE__ */ i(y, { href: U, children: /* @__PURE__ */ i($, {}) }) }),
|
|
83
83
|
/* @__PURE__ */ o(
|
|
84
|
-
|
|
84
|
+
_,
|
|
85
85
|
{
|
|
86
86
|
flexDirection: "row",
|
|
87
87
|
alignItems: "center",
|
|
88
88
|
justifyContent: "flex-end",
|
|
89
89
|
className: e.operations,
|
|
90
90
|
children: [
|
|
91
|
-
/* @__PURE__ */ o(
|
|
91
|
+
/* @__PURE__ */ o(_, { flexDirection: "row", hideAt: ["sm"], className: e.search, children: [
|
|
92
92
|
/* @__PURE__ */ i(
|
|
93
93
|
j,
|
|
94
94
|
{
|
|
@@ -98,65 +98,65 @@ import '../../assets/MainNav.css';const oe = "_main_12974_1", ne = "_column_1297
|
|
|
98
98
|
name: "cpc-search",
|
|
99
99
|
autoComplete: "off",
|
|
100
100
|
"aria-autocomplete": "list",
|
|
101
|
-
...
|
|
101
|
+
...I,
|
|
102
102
|
value: a,
|
|
103
103
|
endAdornment: /* @__PURE__ */ o(B, { children: [
|
|
104
104
|
!!a && /* @__PURE__ */ i(
|
|
105
|
-
|
|
105
|
+
N,
|
|
106
106
|
{
|
|
107
107
|
"aria-label": "Clear search",
|
|
108
|
-
onClick:
|
|
108
|
+
onClick: z,
|
|
109
109
|
iconProps: { iconKey: "fa-regular fa-xmark", size: "sm" }
|
|
110
110
|
}
|
|
111
111
|
),
|
|
112
112
|
/* @__PURE__ */ i(
|
|
113
|
-
|
|
113
|
+
N,
|
|
114
114
|
{
|
|
115
115
|
"aria-label": "Submit search",
|
|
116
|
-
onClick: () =>
|
|
116
|
+
onClick: () => m == null ? void 0 : m(a ?? ""),
|
|
117
117
|
iconProps: { iconKey: "fa-regular fa-magnifying-glass", size: "sm" }
|
|
118
118
|
}
|
|
119
119
|
)
|
|
120
120
|
] })
|
|
121
121
|
}
|
|
122
122
|
),
|
|
123
|
-
b && d && /* @__PURE__ */ i(
|
|
124
|
-
|
|
125
|
-
|
|
123
|
+
b && d && /* @__PURE__ */ i(p, { ...d, onSuggestionClick: () => h(!1), className: e.suggestionDropdown }),
|
|
124
|
+
K && /* @__PURE__ */ i(
|
|
125
|
+
p,
|
|
126
126
|
{
|
|
127
127
|
terms: [],
|
|
128
128
|
categories: [],
|
|
129
129
|
items: [],
|
|
130
130
|
view: "recent-searches",
|
|
131
131
|
recentSearches: f,
|
|
132
|
-
onClearRecentSearch:
|
|
132
|
+
onClearRecentSearch: x,
|
|
133
133
|
className: e.suggestionDropdown
|
|
134
134
|
}
|
|
135
135
|
)
|
|
136
136
|
] }),
|
|
137
|
-
/* @__PURE__ */ o("button", { onClick:
|
|
137
|
+
/* @__PURE__ */ o("button", { onClick: D, className: l(e.siteLink, M(["sm", "md"])), children: [
|
|
138
138
|
/* @__PURE__ */ i(t, { iconKey: "fa-regular fa-sparkles", size: "sm" }),
|
|
139
139
|
"Model/Serial"
|
|
140
140
|
] }),
|
|
141
|
-
/* @__PURE__ */ i(c, { href:
|
|
142
|
-
/* @__PURE__ */ i(c, { href:
|
|
141
|
+
/* @__PURE__ */ i(c, { href: v, hideAt: ["sm", "md"], children: "Custom Parts" }),
|
|
142
|
+
/* @__PURE__ */ i(c, { href: L, hideAt: ["sm", "md"], children: "Contact Us" }),
|
|
143
143
|
/* @__PURE__ */ i("div", { className: e.accountArea, children: /* @__PURE__ */ i(
|
|
144
144
|
ee,
|
|
145
145
|
{
|
|
146
|
-
account:
|
|
147
|
-
onLoginClick:
|
|
146
|
+
account: k,
|
|
147
|
+
onLoginClick: Q,
|
|
148
148
|
className: e.avatar,
|
|
149
|
-
popoverContent:
|
|
150
|
-
isAccountLoading:
|
|
149
|
+
popoverContent: W,
|
|
150
|
+
isAccountLoading: J
|
|
151
151
|
}
|
|
152
152
|
) }),
|
|
153
153
|
/* @__PURE__ */ i(
|
|
154
154
|
P,
|
|
155
155
|
{
|
|
156
156
|
ref: X,
|
|
157
|
-
cart:
|
|
158
|
-
open:
|
|
159
|
-
onCartClick:
|
|
157
|
+
cart: q,
|
|
158
|
+
open: E,
|
|
159
|
+
onCartClick: T
|
|
160
160
|
}
|
|
161
161
|
),
|
|
162
162
|
/* @__PURE__ */ o(V, { hideAt: ["lg"], children: [
|
|
@@ -166,28 +166,28 @@ import '../../assets/MainNav.css';const oe = "_main_12974_1", ne = "_column_1297
|
|
|
166
166
|
/* @__PURE__ */ i("li", { className: e.menuItem, children: /* @__PURE__ */ o(
|
|
167
167
|
"button",
|
|
168
168
|
{
|
|
169
|
-
onClick:
|
|
169
|
+
onClick: D,
|
|
170
170
|
"data-hamburger-close": "true",
|
|
171
|
-
className:
|
|
171
|
+
className: l(e.siteLink, e.menuItemAction, M(["lg"])),
|
|
172
172
|
children: [
|
|
173
173
|
/* @__PURE__ */ i(t, { iconKey: "fa-regular fa-sparkles", size: "sm", className: e.shortcutIcon }),
|
|
174
174
|
"Model/Serial"
|
|
175
175
|
]
|
|
176
176
|
}
|
|
177
177
|
) }),
|
|
178
|
-
/* @__PURE__ */ i("li", { className: e.menuItem, children: /* @__PURE__ */ o(c, { href:
|
|
178
|
+
/* @__PURE__ */ i("li", { className: e.menuItem, children: /* @__PURE__ */ o(c, { href: v, className: l(e.siteLink, e.menuItemAction), children: [
|
|
179
179
|
/* @__PURE__ */ i(t, { iconKey: "fa-regular fa-screwdriver-wrench", size: "sm", className: e.shortcutIcon }),
|
|
180
180
|
"Custom Parts"
|
|
181
181
|
] }) }),
|
|
182
|
-
/* @__PURE__ */ i("li", { className: e.menuItem, children: /* @__PURE__ */ o(c, { href:
|
|
182
|
+
/* @__PURE__ */ i("li", { className: e.menuItem, children: /* @__PURE__ */ o(c, { href: L, className: l(e.siteLink, e.menuItemAction), children: [
|
|
183
183
|
/* @__PURE__ */ i(t, { iconKey: "fa-regular fa-envelope", size: "sm", className: e.shortcutIcon }),
|
|
184
184
|
"Contact Us"
|
|
185
185
|
] }) }),
|
|
186
|
-
/* @__PURE__ */ i("li", { className: e.menuItem, children: /* @__PURE__ */ o(c, { href: H, className:
|
|
186
|
+
/* @__PURE__ */ i("li", { className: e.menuItem, children: /* @__PURE__ */ o(c, { href: H, className: l(e.siteLink, e.menuItemAction), children: [
|
|
187
187
|
/* @__PURE__ */ i(t, { iconKey: "fa-solid fa-question", size: "sm", className: e.shortcutIcon }),
|
|
188
188
|
"FAQ"
|
|
189
189
|
] }) }),
|
|
190
|
-
/* @__PURE__ */ i("li", { className: e.menuItem, children: /* @__PURE__ */ o(c, { href:
|
|
190
|
+
/* @__PURE__ */ i("li", { className: e.menuItem, children: /* @__PURE__ */ o(c, { href: S, className: l(e.siteLink, e.menuItemAction), children: [
|
|
191
191
|
/* @__PURE__ */ i(t, { iconKey: "fa-regular fa-people-group", size: "sm", className: e.shortcutIcon }),
|
|
192
192
|
"About Us"
|
|
193
193
|
] }) })
|
|
@@ -200,7 +200,7 @@ import '../../assets/MainNav.css';const oe = "_main_12974_1", ne = "_column_1297
|
|
|
200
200
|
{
|
|
201
201
|
href: s.route,
|
|
202
202
|
className: e.categoryLink,
|
|
203
|
-
onClick: () =>
|
|
203
|
+
onClick: () => g == null ? void 0 : g(s),
|
|
204
204
|
children: [
|
|
205
205
|
/* @__PURE__ */ i(w, { size: "sm", children: s.label }),
|
|
206
206
|
/* @__PURE__ */ i(
|
|
@@ -222,7 +222,7 @@ import '../../assets/MainNav.css';const oe = "_main_12974_1", ne = "_column_1297
|
|
|
222
222
|
]
|
|
223
223
|
}
|
|
224
224
|
),
|
|
225
|
-
/* @__PURE__ */ i(
|
|
225
|
+
/* @__PURE__ */ i(_, { flexDirection: "row", hideAt: ["md", "lg"], className: e.mobileSearch, children: /* @__PURE__ */ o("div", { className: e.search, children: [
|
|
226
226
|
/* @__PURE__ */ i(
|
|
227
227
|
j,
|
|
228
228
|
{
|
|
@@ -232,38 +232,38 @@ import '../../assets/MainNav.css';const oe = "_main_12974_1", ne = "_column_1297
|
|
|
232
232
|
name: "cpc-search",
|
|
233
233
|
autoComplete: "off",
|
|
234
234
|
"aria-autocomplete": "list",
|
|
235
|
-
...
|
|
235
|
+
...I,
|
|
236
236
|
value: a,
|
|
237
237
|
endAdornment: /* @__PURE__ */ o(B, { children: [
|
|
238
238
|
!!a && /* @__PURE__ */ i(
|
|
239
|
-
|
|
239
|
+
N,
|
|
240
240
|
{
|
|
241
241
|
"aria-label": "Clear search",
|
|
242
|
-
onClick:
|
|
242
|
+
onClick: z,
|
|
243
243
|
iconProps: { iconKey: "fa-regular fa-xmark", size: "sm" }
|
|
244
244
|
}
|
|
245
245
|
),
|
|
246
246
|
/* @__PURE__ */ i(
|
|
247
|
-
|
|
247
|
+
N,
|
|
248
248
|
{
|
|
249
249
|
"aria-label": "Submit search",
|
|
250
|
-
onClick: () =>
|
|
250
|
+
onClick: () => m == null ? void 0 : m(a ?? ""),
|
|
251
251
|
iconProps: { iconKey: "fa-regular fa-magnifying-glass", size: "sm" }
|
|
252
252
|
}
|
|
253
253
|
)
|
|
254
254
|
] })
|
|
255
255
|
}
|
|
256
256
|
),
|
|
257
|
-
b && d && /* @__PURE__ */ i(
|
|
258
|
-
|
|
259
|
-
|
|
257
|
+
b && d && /* @__PURE__ */ i(p, { ...d, onSuggestionClick: () => h(!1), className: e.suggestionDropdown }),
|
|
258
|
+
K && /* @__PURE__ */ i(
|
|
259
|
+
p,
|
|
260
260
|
{
|
|
261
261
|
terms: [],
|
|
262
262
|
categories: [],
|
|
263
263
|
items: [],
|
|
264
264
|
view: "recent-searches",
|
|
265
265
|
recentSearches: f,
|
|
266
|
-
onClearRecentSearch:
|
|
266
|
+
onClearRecentSearch: x,
|
|
267
267
|
className: e.suggestionDropdown
|
|
268
268
|
}
|
|
269
269
|
)
|
|
@@ -272,18 +272,18 @@ import '../../assets/MainNav.css';const oe = "_main_12974_1", ne = "_column_1297
|
|
|
272
272
|
ie,
|
|
273
273
|
{
|
|
274
274
|
categories: r,
|
|
275
|
-
isCategoriesLoading:
|
|
276
|
-
onCategoryClick:
|
|
275
|
+
isCategoriesLoading: O,
|
|
276
|
+
onCategoryClick: g
|
|
277
277
|
}
|
|
278
278
|
)
|
|
279
279
|
] }) });
|
|
280
280
|
});
|
|
281
281
|
function c({
|
|
282
282
|
href: A,
|
|
283
|
-
children:
|
|
283
|
+
children: k,
|
|
284
284
|
...r
|
|
285
285
|
}) {
|
|
286
|
-
return /* @__PURE__ */ i(y, { href: A, className: e.siteLink, ...r, children:
|
|
286
|
+
return /* @__PURE__ */ i(y, { href: A, className: e.siteLink, ...r, children: k });
|
|
287
287
|
}
|
|
288
288
|
export {
|
|
289
289
|
je as MainNav
|
|
@@ -24,6 +24,7 @@ export interface SuggestionDropdownProps {
|
|
|
24
24
|
items: SuggestedItem[];
|
|
25
25
|
recentSearches?: RecentSearch[];
|
|
26
26
|
onClearRecentSearch?: (_recentSearch: RecentSearch) => void;
|
|
27
|
+
onSuggestionClick?: () => void;
|
|
27
28
|
className?: string;
|
|
28
29
|
}
|
|
29
|
-
export declare function SuggestionDropdown({ terms, categories, items, view, recentSearches, onClearRecentSearch, className }: SuggestionDropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export declare function SuggestionDropdown({ terms, categories, items, view, recentSearches, onClearRecentSearch, onSuggestionClick, className }: SuggestionDropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,80 +1,81 @@
|
|
|
1
1
|
import { jsxs as t, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { Text as c } from "../../atoms/Text/Text.js";
|
|
3
|
-
import { Link as
|
|
4
|
-
import { Icon as
|
|
3
|
+
import { Link as l } from "../../atoms/Link/Link.js";
|
|
4
|
+
import { Icon as f } from "../../atoms/Icon/Icon.js";
|
|
5
5
|
import { c as r } from "../../clsx-OuTLNxxd.js";
|
|
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:
|
|
6
|
+
import { Image as d } from "../../atoms/Image/Image.js";
|
|
7
|
+
import '../../assets/SuggestionDropdown.css';const y = "_suggestionDropdown_1fc5y_1", S = "_leftColumn_1fc5y_31", p = "_leftColumnFullWidth_1fc5y_55", L = "_suggestionSectionFullHeight_1fc5y_63", k = "_rightColumn_1fc5y_73", N = "_categorySection_1fc5y_95", v = "_suggestions_1fc5y_101", x = "_categories_1fc5y_103", C = "_suggestionsFullHeight_1fc5y_117", F = "_suggestionLink_1fc5y_147", H = "_categoryLink_1fc5y_149", D = "_itemList_1fc5y_163", w = "_item_1fc5y_163", z = "_itemInfo_1fc5y_221", T = "_recentSearches_1fc5y_231", q = "_recentSearchesHeader_1fc5y_245", W = "_recentSearchesList_1fc5y_253", b = "_recentSearch_1fc5y_231", I = "_recentSearchLink_1fc5y_283", j = "_clearRecentSearch_1fc5y_299", n = {
|
|
8
|
+
suggestionDropdown: y,
|
|
9
|
+
leftColumn: S,
|
|
10
|
+
leftColumnFullWidth: p,
|
|
11
|
+
suggestionSectionFullHeight: L,
|
|
12
|
+
rightColumn: k,
|
|
13
|
+
categorySection: N,
|
|
14
|
+
suggestions: v,
|
|
15
|
+
categories: x,
|
|
16
|
+
suggestionsFullHeight: C,
|
|
17
17
|
suggestionLink: F,
|
|
18
18
|
categoryLink: H,
|
|
19
|
-
itemList:
|
|
20
|
-
item:
|
|
21
|
-
itemInfo:
|
|
22
|
-
recentSearches:
|
|
23
|
-
recentSearchesHeader:
|
|
24
|
-
recentSearchesList:
|
|
25
|
-
recentSearch:
|
|
26
|
-
recentSearchLink:
|
|
27
|
-
clearRecentSearch:
|
|
19
|
+
itemList: D,
|
|
20
|
+
item: w,
|
|
21
|
+
itemInfo: z,
|
|
22
|
+
recentSearches: T,
|
|
23
|
+
recentSearchesHeader: q,
|
|
24
|
+
recentSearchesList: W,
|
|
25
|
+
recentSearch: b,
|
|
26
|
+
recentSearchLink: I,
|
|
27
|
+
clearRecentSearch: j
|
|
28
28
|
};
|
|
29
|
-
function
|
|
30
|
-
terms:
|
|
29
|
+
function E({
|
|
30
|
+
terms: o,
|
|
31
31
|
categories: i,
|
|
32
32
|
items: a,
|
|
33
|
-
view:
|
|
34
|
-
recentSearches:
|
|
35
|
-
onClearRecentSearch:
|
|
36
|
-
|
|
33
|
+
view: _ = "suggestions",
|
|
34
|
+
recentSearches: m = [],
|
|
35
|
+
onClearRecentSearch: h,
|
|
36
|
+
onSuggestionClick: g,
|
|
37
|
+
className: u
|
|
37
38
|
}) {
|
|
38
|
-
return
|
|
39
|
+
return _ === "recent-searches" ? /* @__PURE__ */ t(
|
|
39
40
|
"div",
|
|
40
41
|
{
|
|
41
|
-
className: r(n.suggestionDropdown, n.recentSearches,
|
|
42
|
+
className: r(n.suggestionDropdown, n.recentSearches, u),
|
|
42
43
|
onMouseDown: (e) => e.preventDefault(),
|
|
43
44
|
children: [
|
|
44
45
|
/* @__PURE__ */ s("div", { className: n.recentSearchesHeader, children: /* @__PURE__ */ s(c, { size: "xxs", colorToken: "quaternary", children: "Recent Searches" }) }),
|
|
45
|
-
/* @__PURE__ */ s("ol", { className: n.recentSearchesList, children:
|
|
46
|
-
/* @__PURE__ */ s(
|
|
46
|
+
/* @__PURE__ */ s("ol", { className: n.recentSearchesList, children: m.map((e) => /* @__PURE__ */ t("li", { className: n.recentSearch, children: [
|
|
47
|
+
/* @__PURE__ */ s(l, { href: e.url, className: n.recentSearchLink, children: /* @__PURE__ */ s(c, { size: "sm", children: e.term }) }),
|
|
47
48
|
/* @__PURE__ */ s(
|
|
48
49
|
"button",
|
|
49
50
|
{
|
|
50
51
|
type: "button",
|
|
51
52
|
className: n.clearRecentSearch,
|
|
52
53
|
"aria-label": `Clear recent search: ${e.term}`,
|
|
53
|
-
onClick: () =>
|
|
54
|
-
children: /* @__PURE__ */ s(
|
|
54
|
+
onClick: () => h == null ? void 0 : h(e),
|
|
55
|
+
children: /* @__PURE__ */ s(f, { iconKey: "fa-regular fa-xmark", size: "sm" })
|
|
55
56
|
}
|
|
56
57
|
)
|
|
57
58
|
] }, e.url)) })
|
|
58
59
|
]
|
|
59
60
|
}
|
|
60
|
-
) : /* @__PURE__ */ t("div", { className: r(n.suggestionDropdown,
|
|
61
|
-
(
|
|
62
|
-
|
|
61
|
+
) : /* @__PURE__ */ t("div", { className: r(n.suggestionDropdown, u), onMouseDown: (e) => e.preventDefault(), children: [
|
|
62
|
+
(o.length > 0 || i.length > 0) && /* @__PURE__ */ t("div", { className: r(n.leftColumn, { [n.leftColumnFullWidth]: a.length === 0 }), children: [
|
|
63
|
+
o.length > 0 && /* @__PURE__ */ s("div", { className: r(n.suggestionSection, { [n.suggestionSectionFullHeight]: i.length === 0 }), children: /* @__PURE__ */ t("div", { className: r(n.suggestions, { [n.suggestionsFullHeight]: i.length === 0 }), children: [
|
|
63
64
|
/* @__PURE__ */ s(c, { size: "xxs", colorToken: "quaternary", children: "Suggestions" }),
|
|
64
|
-
|
|
65
|
-
(e) => /* @__PURE__ */ s(c, { size: "sm", children: /* @__PURE__ */ s(
|
|
65
|
+
o.map(
|
|
66
|
+
(e) => /* @__PURE__ */ s(c, { size: "sm", children: /* @__PURE__ */ s(l, { href: e.url, className: n.suggestionLink, onClick: g, children: e.name }) }, e.url)
|
|
66
67
|
)
|
|
67
68
|
] }) }),
|
|
68
69
|
i.length > 0 && /* @__PURE__ */ s("div", { className: n.categorySection, children: /* @__PURE__ */ t("div", { className: n.categories, children: [
|
|
69
70
|
/* @__PURE__ */ s(c, { size: "xxs", colorToken: "quaternary", children: "Categories" }),
|
|
70
71
|
i.map(
|
|
71
|
-
(e) => /* @__PURE__ */ s(c, { size: "sm", children: /* @__PURE__ */ s(
|
|
72
|
+
(e) => /* @__PURE__ */ s(c, { size: "sm", children: /* @__PURE__ */ s(l, { href: e.url, className: n.categoryLink, onClick: g, children: e.name }) }, e.name)
|
|
72
73
|
)
|
|
73
74
|
] }) })
|
|
74
75
|
] }),
|
|
75
76
|
a.length > 0 && /* @__PURE__ */ s("div", { className: n.rightColumn, children: /* @__PURE__ */ s("ol", { className: n.itemList, children: a.map(
|
|
76
|
-
(e) => /* @__PURE__ */ s("li", { className: n.item, children: /* @__PURE__ */ t(
|
|
77
|
-
/* @__PURE__ */ s(
|
|
77
|
+
(e) => /* @__PURE__ */ s("li", { className: n.item, children: /* @__PURE__ */ t(l, { href: e.url, onClick: g, children: [
|
|
78
|
+
/* @__PURE__ */ s(d, { src: e.image, alt: `${e.description} product image`, height: 72, width: 72 }),
|
|
78
79
|
/* @__PURE__ */ t("div", { className: n.itemInfo, children: [
|
|
79
80
|
/* @__PURE__ */ s(c, { size: "sm", children: e.description }),
|
|
80
81
|
/* @__PURE__ */ s(c, { size: "sm", colorToken: "quaternary", children: e.itemId })
|
|
@@ -84,5 +85,5 @@ function B({
|
|
|
84
85
|
] });
|
|
85
86
|
}
|
|
86
87
|
export {
|
|
87
|
-
|
|
88
|
+
E as SuggestionDropdown
|
|
88
89
|
};
|