@caseparts-org/caseblocks 0.0.241 → 0.0.243
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/SuggestionDropdown.css +1 -1
- package/dist/main-client.d.ts +1 -1
- package/dist/main.d.ts +1 -1
- package/dist/organisms/MainNav/MainNav.js +110 -109
- package/dist/organisms/MainNav/MainNav.stories.js +17 -13
- package/dist/organisms/SuggestionDropdown/SuggestionDropdown.d.ts +9 -1
- package/dist/organisms/SuggestionDropdown/SuggestionDropdown.js +111 -87
- package/dist/organisms/SuggestionDropdown/SuggestionDropdown.stories.js +10 -6
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._suggestionDropdown_17xzw_1{display:flex;flex-direction:row;width:100%;border:1px solid;border-color:var(--color-neutrals-neutral-2);border-radius:var(--border-radius-sm);box-shadow:0 8px 24px #0f172a14;overflow:hidden}@media (max-width: 767px){._suggestionDropdown_17xzw_1{flex-direction:column}}._leftColumn_17xzw_31{display:flex;flex-direction:column;border-right:1px solid var(--border-border-primary);background-color:#fff;min-width:150px}@media (max-width: 767px){._leftColumn_17xzw_31{border-right:0;border-bottom:1px solid var(--border-border-primary)}}._leftColumnFullWidth_17xzw_55{flex:1}._suggestionSectionFullHeight_17xzw_63{display:flex;flex:1}._rightColumn_17xzw_73{display:flex;flex:1;flex-direction:column;gap:var(--spacing-spacing-1xs);padding:var(--spacing-spacing-default);background:var(--color-brand-primary-primary-pale-gray);min-width:250px}._categorySection_17xzw_95{border-top:1px solid var(--border-border-primary)}._suggestions_17xzw_101,._categories_17xzw_103{display:flex;flex-direction:column;gap:0;padding:0}._suggestionsFullHeight_17xzw_117{flex:1}._customPartLink_17xzw_125{display:flex;align-items:center;gap:var(--spacing-spacing-4xs);box-sizing:border-box;width:100%;padding:var(--spacing-spacing-4xs) var(--spacing-spacing-default);transition:background-color .3s ease-in}._suggestions_17xzw_101>:first-child,._categories_17xzw_103>:first-child{padding-top:var(--spacing-spacing-default);padding-right:var(--spacing-spacing-default);padding-left:var(--spacing-spacing-default);padding-bottom:var(--spacing-spacing-2xs)}._suggestions_17xzw_101>:last-child,._categories_17xzw_103>:last-child{margin-bottom:var(--spacing-spacing-2xs)}._suggestionLink_17xzw_169,._categoryLink_17xzw_171{display:block;box-sizing:border-box;width:100%;padding:var(--spacing-spacing-2xs) var(--spacing-spacing-default);transition:background-color .3s ease-in}._suggestionLink_17xzw_169:hover,._categoryLink_17xzw_171:hover,._customPartLink_17xzw_125:hover{text-decoration:none;background-color:var(--color-alerts-light-teal-blue)}._activeOption_17xzw_207{background:var(--color-alerts-light-teal-blue)}._itemList_17xzw_215{margin:0;padding:0;display:flex;flex-direction:column;gap:var(--spacing-spacing-2xs);width:100%}._item_17xzw_215{display:flex;flex-direction:column;border:1px solid var(--border-border-primary);padding:var(--spacing-spacing-2xs);width:100%;background-color:#fff;transition:background-color .3s ease-in}._item_17xzw_215:hover{background-color:var(--color-alerts-light-teal-blue)}._item_17xzw_215>a:hover{text-decoration:none}._activeItem_17xzw_269{border-color:var(--text-text-links);box-shadow:inset 0 0 0 1px var(--text-text-links)}._item_17xzw_215 img{height:60px;width:60px}._item_17xzw_215 a{display:flex;flex-direction:row;align-items:flex-start;gap:var(--spacing-spacing-2xs)}._itemInfo_17xzw_303{display:grid;gap:var(--spacing-spacing-4xs)}._recentSearches_17xzw_313{display:flex;flex-direction:column;background:var(--color-brand-primary-white);min-width:250px}._recentSearchesHeader_17xzw_327{padding:var(--spacing-spacing-default) var(--spacing-spacing-default) var(--spacing-spacing-2xs)}._recentSearchesList_17xzw_335{display:flex;flex-direction:column;gap:0;margin:0;padding:0}._recentSearch_17xzw_313{display:flex;align-items:center;justify-content:space-between;gap:var(--spacing-spacing-2xs)}._recentSearchLink_17xzw_365{display:flex;flex:1;min-width:0;align-items:center;padding:var(--spacing-spacing-2xs) var(--spacing-spacing-default)}._clearRecentSearch_17xzw_381{display:flex;flex:0 0 auto;align-items:center;justify-content:center;padding:var(--spacing-spacing-2xs) var(--spacing-spacing-default);border:0;background:transparent;color:var(--text-text-primary);cursor:pointer}
|
package/dist/main-client.d.ts
CHANGED
|
@@ -49,7 +49,7 @@ export type { MainNavProps } from './organisms/MainNav/MainNav';
|
|
|
49
49
|
export { ChipSelector } from './organisms/ChipSelector/ChipSelector';
|
|
50
50
|
export type { ChipSelectorProps } from './organisms/ChipSelector/ChipSelector';
|
|
51
51
|
export { SuggestionDropdown } from './organisms/SuggestionDropdown/SuggestionDropdown';
|
|
52
|
-
export type { SuggestionDropdownProps, SuggestedCategory, SuggestedTerm, SuggestedItem, RecentSearch, } from './organisms/SuggestionDropdown/SuggestionDropdown';
|
|
52
|
+
export type { SuggestionDropdownProps, SuggestedCategory, SuggestedTerm, SuggestedItem, SuggestedCustomPart, RecentSearch, } from './organisms/SuggestionDropdown/SuggestionDropdown';
|
|
53
53
|
export { Product } from './organisms/Product/Product';
|
|
54
54
|
export type { ProductProps, ProductView } from './organisms/Product/Product';
|
|
55
55
|
export { Carousel } from './organisms/Carousel/Carousel';
|
package/dist/main.d.ts
CHANGED
|
@@ -34,4 +34,4 @@ export { MainNav } from './organisms/MainNav/MainNav';
|
|
|
34
34
|
export { ChipSelector } from './organisms/ChipSelector/ChipSelector';
|
|
35
35
|
export type { ChipSelectorProps } from './organisms/ChipSelector/ChipSelector';
|
|
36
36
|
export { SuggestionDropdown } from './organisms/SuggestionDropdown/SuggestionDropdown';
|
|
37
|
-
export type { SuggestionDropdownProps, SuggestedCategory, SuggestedTerm, SuggestedItem, RecentSearch, } from './organisms/SuggestionDropdown/SuggestionDropdown';
|
|
37
|
+
export type { SuggestionDropdownProps, SuggestedCategory, SuggestedTerm, SuggestedItem, SuggestedCustomPart, RecentSearch, } from './organisms/SuggestionDropdown/SuggestionDropdown';
|
|
@@ -1,126 +1,127 @@
|
|
|
1
|
-
import { jsx as m, jsxs as d, Fragment as
|
|
1
|
+
import { jsx as m, jsxs as d, Fragment as J } from "react/jsx-runtime";
|
|
2
2
|
import L from "react";
|
|
3
3
|
import { Text as U } from "../../atoms/Text/Text.js";
|
|
4
4
|
import { Link as j } from "../../atoms/Link/Link.js";
|
|
5
5
|
import { Icon as y } from "../../atoms/Icon/Icon.js";
|
|
6
|
-
import { Flex as
|
|
7
|
-
import { Grid as
|
|
8
|
-
import { Input as
|
|
9
|
-
import { InputEndAdornmentButton as
|
|
6
|
+
import { Flex as B } from "../../atoms/Flex/Flex.js";
|
|
7
|
+
import { Grid as di, Column as fi } from "../../atoms/Grid/Grid.js";
|
|
8
|
+
import { Input as X } from "../../atoms/Input/Input.js";
|
|
9
|
+
import { InputEndAdornmentButton as $ } from "../../atoms/InputEndAdornmentButton/InputEndAdornmentButton.js";
|
|
10
10
|
import { Logo as ei } from "../../molecules/Logo/Logo.js";
|
|
11
|
-
import { HamburgerMenu as
|
|
12
|
-
import { ShoppingCart as
|
|
13
|
-
import { Account as
|
|
14
|
-
import { CategoryNav as
|
|
15
|
-
import { SuggestionDropdown as
|
|
16
|
-
import { getHideAtStyles as
|
|
11
|
+
import { HamburgerMenu as si } from "../../molecules/HamburgerMenu/HamburgerMenu.js";
|
|
12
|
+
import { ShoppingCart as ci } from "../../molecules/Cart/Cart.js";
|
|
13
|
+
import { Account as ri } from "../../molecules/Account/Account.js";
|
|
14
|
+
import { CategoryNav as _i } from "../../molecules/CategoryNav/CategoryNav.js";
|
|
15
|
+
import { SuggestionDropdown as u } from "../SuggestionDropdown/SuggestionDropdown.js";
|
|
16
|
+
import { getHideAtStyles as Y } from "../../atoms/HideAt.js";
|
|
17
17
|
import { c as k } from "../../clsx-OuTLNxxd.js";
|
|
18
|
-
import '../../assets/MainNav.css';const
|
|
19
|
-
main:
|
|
18
|
+
import '../../assets/MainNav.css';const Ni = "_main_12974_1", ai = "_column_12974_8", yi = "_topNav_12974_13", ki = "_logo_12974_21", wi = "_operations_12974_24", Ai = "_search_12974_31", bi = "_mobileSearch_12974_36", Di = "_suggestionDropdown_12974_39", vi = "_siteLink_12974_45", xi = "_accountArea_12974_72", Li = "_category_12974_84", Ki = "_categoryLink_12974_92", zi = "_menuList_12974_108", pi = "_menuItemAction_12974_131", Bi = "_shortcutIcon_12974_140", t = {
|
|
19
|
+
main: Ni,
|
|
20
20
|
column: ai,
|
|
21
|
-
topNav:
|
|
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
|
-
},
|
|
21
|
+
topNav: yi,
|
|
22
|
+
logo: ki,
|
|
23
|
+
operations: wi,
|
|
24
|
+
search: Ai,
|
|
25
|
+
mobileSearch: bi,
|
|
26
|
+
suggestionDropdown: Di,
|
|
27
|
+
siteLink: vi,
|
|
28
|
+
accountArea: xi,
|
|
29
|
+
category: Li,
|
|
30
|
+
categoryLink: Ki,
|
|
31
|
+
menuList: zi,
|
|
32
|
+
menuItemAction: pi,
|
|
33
|
+
shortcutIcon: Bi
|
|
34
|
+
}, Xi = L.forwardRef(function({
|
|
35
35
|
account: F,
|
|
36
36
|
categories: b,
|
|
37
|
-
homeRoute:
|
|
38
|
-
faqRoute:
|
|
37
|
+
homeRoute: Z,
|
|
38
|
+
faqRoute: C,
|
|
39
39
|
customPartsRoute: I,
|
|
40
|
-
aboutUsRoute:
|
|
40
|
+
aboutUsRoute: P,
|
|
41
41
|
contactRoute: M,
|
|
42
|
-
cart:
|
|
43
|
-
open:
|
|
42
|
+
cart: g,
|
|
43
|
+
open: V,
|
|
44
44
|
// consume external panel control props from CartPropsBase
|
|
45
|
-
className:
|
|
46
|
-
onLoginClick:
|
|
47
|
-
searchInputProps:
|
|
45
|
+
className: h,
|
|
46
|
+
onLoginClick: S,
|
|
47
|
+
searchInputProps: l,
|
|
48
48
|
searchValue: s,
|
|
49
49
|
onSearchValueChange: n,
|
|
50
50
|
onClearSearch: w,
|
|
51
51
|
onSearch: c,
|
|
52
|
-
searchSuggestions:
|
|
52
|
+
searchSuggestions: o,
|
|
53
53
|
recentSearches: _,
|
|
54
54
|
onClearRecentSearch: H,
|
|
55
55
|
onCategoryClick: K,
|
|
56
56
|
onClickModelSerial: R,
|
|
57
|
-
onCartClick:
|
|
58
|
-
accountPopoverContent:
|
|
59
|
-
isAccountLoading:
|
|
60
|
-
isCategoriesLoading:
|
|
61
|
-
...
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
|
|
57
|
+
onCartClick: ii,
|
|
58
|
+
accountPopoverContent: ti,
|
|
59
|
+
isAccountLoading: mi,
|
|
60
|
+
isCategoriesLoading: oi,
|
|
61
|
+
...li
|
|
62
|
+
}, ni) {
|
|
63
|
+
var G;
|
|
64
|
+
const [T, N] = L.useState(!1), [f, a] = L.useState(-1), z = L.useRef(null), r = L.useId(), D = T && !!s && !!o, O = T && !D && !!(_ != null && _.length), v = D ? ((o == null ? void 0 : o.terms.length) ?? 0) + ((o == null ? void 0 : o.categories.length) ?? 0) + (((G = o == null ? void 0 : o.customParts) == null ? void 0 : G.length) ?? 0) + ((o == null ? void 0 : o.items.length) ?? 0) : O ? (_ == null ? void 0 : _.length) ?? 0 : 0, q = {
|
|
65
|
+
...l,
|
|
65
66
|
onChange: (i) => {
|
|
66
|
-
var
|
|
67
|
-
|
|
67
|
+
var e;
|
|
68
|
+
a(-1), (e = l == null ? void 0 : l.onChange) == null || e.call(l, i);
|
|
68
69
|
},
|
|
69
70
|
onFocus: (i) => {
|
|
70
|
-
var
|
|
71
|
-
(
|
|
71
|
+
var e;
|
|
72
|
+
(e = l == null ? void 0 : l.onFocus) == null || e.call(l, i), N(!0);
|
|
72
73
|
},
|
|
73
74
|
onBlur: (i) => {
|
|
74
|
-
var
|
|
75
|
-
(
|
|
75
|
+
var e;
|
|
76
|
+
(e = l == null ? void 0 : l.onBlur) == null || e.call(l, i), N(!1);
|
|
76
77
|
},
|
|
77
78
|
onKeyDown: (i) => {
|
|
78
|
-
var
|
|
79
|
-
if ((
|
|
79
|
+
var e, Q, W;
|
|
80
|
+
if ((e = l == null ? void 0 : l.onKeyDown) == null || e.call(l, i), !i.defaultPrevented) {
|
|
80
81
|
if (i.key === "ArrowDown" && v > 0) {
|
|
81
|
-
i.preventDefault(),
|
|
82
|
+
i.preventDefault(), a((x) => x >= v - 1 ? 0 : x + 1);
|
|
82
83
|
return;
|
|
83
84
|
}
|
|
84
85
|
if (i.key === "ArrowUp" && v > 0) {
|
|
85
|
-
i.preventDefault(),
|
|
86
|
+
i.preventDefault(), a((x) => x <= 0 ? v - 1 : x - 1);
|
|
86
87
|
return;
|
|
87
88
|
}
|
|
88
|
-
if (i.key === "Tab" && D &&
|
|
89
|
-
i.preventDefault(), n == null || n((
|
|
89
|
+
if (i.key === "Tab" && D && f >= 0 && f < ((o == null ? void 0 : o.terms.length) ?? 0)) {
|
|
90
|
+
i.preventDefault(), n == null || n((o == null ? void 0 : o.terms[f].name) ?? ""), a(-1);
|
|
90
91
|
return;
|
|
91
92
|
}
|
|
92
|
-
if (i.key === "Enter" &&
|
|
93
|
-
i.preventDefault(), (
|
|
93
|
+
if (i.key === "Enter" && f >= 0 && f < v) {
|
|
94
|
+
i.preventDefault(), (Q = document.getElementById(`${r}-${f}`)) == null || Q.click();
|
|
94
95
|
return;
|
|
95
96
|
}
|
|
96
|
-
i.key === "Enter" && (i.preventDefault(),
|
|
97
|
+
i.key === "Enter" && (i.preventDefault(), N(!1), (W = z.current) == null || W.blur(), c == null || c(s ?? ""));
|
|
97
98
|
}
|
|
98
99
|
}
|
|
99
100
|
}, p = (i) => {
|
|
100
|
-
var
|
|
101
|
-
i.key.length !== 1 || i.altKey || i.ctrlKey || i.metaKey || (i.preventDefault(),
|
|
101
|
+
var e;
|
|
102
|
+
i.key.length !== 1 || i.altKey || i.ctrlKey || i.metaKey || (i.preventDefault(), a(-1), n == null || n(`${s ?? ""}${i.key}`), (e = z.current) == null || e.focus());
|
|
102
103
|
};
|
|
103
|
-
return /* @__PURE__ */ m(
|
|
104
|
+
return /* @__PURE__ */ m(di, { ...li, gridWrapperClassName: k(t.main, h), children: /* @__PURE__ */ d(fi, { span: 12, className: t.column, children: [
|
|
104
105
|
/* @__PURE__ */ d(
|
|
105
|
-
|
|
106
|
+
B,
|
|
106
107
|
{
|
|
107
108
|
flexDirection: "row",
|
|
108
109
|
alignItems: "center",
|
|
109
110
|
justifyContent: "space-between",
|
|
110
111
|
className: t.topNav,
|
|
111
112
|
children: [
|
|
112
|
-
/* @__PURE__ */ m("div", { className: t.logo, children: /* @__PURE__ */ m(j, { href:
|
|
113
|
+
/* @__PURE__ */ m("div", { className: t.logo, children: /* @__PURE__ */ m(j, { href: Z, children: /* @__PURE__ */ m(ei, {}) }) }),
|
|
113
114
|
/* @__PURE__ */ d(
|
|
114
|
-
|
|
115
|
+
B,
|
|
115
116
|
{
|
|
116
117
|
flexDirection: "row",
|
|
117
118
|
alignItems: "center",
|
|
118
119
|
justifyContent: "flex-end",
|
|
119
120
|
className: t.operations,
|
|
120
121
|
children: [
|
|
121
|
-
/* @__PURE__ */ d(
|
|
122
|
+
/* @__PURE__ */ d(B, { flexDirection: "row", hideAt: ["sm"], className: t.search, children: [
|
|
122
123
|
/* @__PURE__ */ m(
|
|
123
|
-
|
|
124
|
+
X,
|
|
124
125
|
{
|
|
125
126
|
variant: "search",
|
|
126
127
|
label: "Search",
|
|
@@ -129,23 +130,23 @@ import '../../assets/MainNav.css';const _i = "_main_12974_1", ai = "_column_1297
|
|
|
129
130
|
autoComplete: "off",
|
|
130
131
|
"aria-autocomplete": "list",
|
|
131
132
|
"aria-controls": r,
|
|
132
|
-
"aria-activedescendant":
|
|
133
|
+
"aria-activedescendant": f >= 0 ? `${r}-${f}` : void 0,
|
|
133
134
|
...q,
|
|
134
135
|
ref: z,
|
|
135
136
|
value: s,
|
|
136
|
-
endAdornment: /* @__PURE__ */ d(
|
|
137
|
+
endAdornment: /* @__PURE__ */ d(J, { children: [
|
|
137
138
|
!!s && /* @__PURE__ */ m(
|
|
138
|
-
|
|
139
|
+
$,
|
|
139
140
|
{
|
|
140
141
|
"aria-label": "Clear search",
|
|
141
142
|
onClick: () => {
|
|
142
|
-
|
|
143
|
+
a(-1), w == null || w();
|
|
143
144
|
},
|
|
144
145
|
iconProps: { iconKey: "fa-regular fa-xmark", size: "sm" }
|
|
145
146
|
}
|
|
146
147
|
),
|
|
147
148
|
/* @__PURE__ */ m(
|
|
148
|
-
|
|
149
|
+
$,
|
|
149
150
|
{
|
|
150
151
|
"aria-label": "Submit search",
|
|
151
152
|
onClick: () => c == null ? void 0 : c(s ?? ""),
|
|
@@ -155,21 +156,21 @@ import '../../assets/MainNav.css';const _i = "_main_12974_1", ai = "_column_1297
|
|
|
155
156
|
] })
|
|
156
157
|
}
|
|
157
158
|
),
|
|
158
|
-
D &&
|
|
159
|
-
|
|
159
|
+
D && o && /* @__PURE__ */ m(
|
|
160
|
+
u,
|
|
160
161
|
{
|
|
161
|
-
...
|
|
162
|
-
activeOptionIndex:
|
|
162
|
+
...o,
|
|
163
|
+
activeOptionIndex: f,
|
|
163
164
|
optionIdPrefix: r,
|
|
164
165
|
onKeyDown: p,
|
|
165
166
|
onSuggestionClick: (i) => {
|
|
166
|
-
n == null || n((i == null ? void 0 : i.name) ?? s ?? ""),
|
|
167
|
+
n == null || n((i == null ? void 0 : i.name) ?? s ?? ""), N(!1);
|
|
167
168
|
},
|
|
168
169
|
className: t.suggestionDropdown
|
|
169
170
|
}
|
|
170
171
|
),
|
|
171
172
|
O && /* @__PURE__ */ m(
|
|
172
|
-
|
|
173
|
+
u,
|
|
173
174
|
{
|
|
174
175
|
terms: [],
|
|
175
176
|
categories: [],
|
|
@@ -177,42 +178,42 @@ import '../../assets/MainNav.css';const _i = "_main_12974_1", ai = "_column_1297
|
|
|
177
178
|
view: "recent-searches",
|
|
178
179
|
recentSearches: _,
|
|
179
180
|
onClearRecentSearch: H,
|
|
180
|
-
activeOptionIndex:
|
|
181
|
+
activeOptionIndex: f,
|
|
181
182
|
optionIdPrefix: r,
|
|
182
183
|
onKeyDown: p,
|
|
183
184
|
onSuggestionClick: (i) => {
|
|
184
|
-
n == null || n((i == null ? void 0 : i.term) ?? s ?? ""),
|
|
185
|
+
n == null || n((i == null ? void 0 : i.term) ?? s ?? ""), N(!1);
|
|
185
186
|
},
|
|
186
187
|
className: t.suggestionDropdown
|
|
187
188
|
}
|
|
188
189
|
)
|
|
189
190
|
] }),
|
|
190
|
-
/* @__PURE__ */ d("button", { onClick: R, className: k(t.siteLink,
|
|
191
|
+
/* @__PURE__ */ d("button", { onClick: R, className: k(t.siteLink, Y(["sm", "md"])), children: [
|
|
191
192
|
/* @__PURE__ */ m(y, { iconKey: "fa-regular fa-sparkles", size: "sm" }),
|
|
192
193
|
"Model/Serial"
|
|
193
194
|
] }),
|
|
194
195
|
/* @__PURE__ */ m(A, { href: I, hideAt: ["sm", "md"], children: "Custom Parts" }),
|
|
195
196
|
/* @__PURE__ */ m(A, { href: M, hideAt: ["sm", "md"], children: "Contact Us" }),
|
|
196
197
|
/* @__PURE__ */ m("div", { className: t.accountArea, children: /* @__PURE__ */ m(
|
|
197
|
-
|
|
198
|
+
ri,
|
|
198
199
|
{
|
|
199
200
|
account: F,
|
|
200
|
-
onLoginClick:
|
|
201
|
+
onLoginClick: S,
|
|
201
202
|
className: t.avatar,
|
|
202
|
-
popoverContent:
|
|
203
|
-
isAccountLoading:
|
|
203
|
+
popoverContent: ti,
|
|
204
|
+
isAccountLoading: mi
|
|
204
205
|
}
|
|
205
206
|
) }),
|
|
206
207
|
/* @__PURE__ */ m(
|
|
207
|
-
|
|
208
|
+
ci,
|
|
208
209
|
{
|
|
209
|
-
ref:
|
|
210
|
-
cart:
|
|
211
|
-
open:
|
|
212
|
-
onCartClick:
|
|
210
|
+
ref: ni,
|
|
211
|
+
cart: g,
|
|
212
|
+
open: V,
|
|
213
|
+
onCartClick: ii
|
|
213
214
|
}
|
|
214
215
|
),
|
|
215
|
-
/* @__PURE__ */ d(
|
|
216
|
+
/* @__PURE__ */ d(si, { hideAt: ["lg"], children: [
|
|
216
217
|
/* @__PURE__ */ d("section", { children: [
|
|
217
218
|
/* @__PURE__ */ m(U, { size: "md", weight: "semibold", children: "Useful shortcuts" }),
|
|
218
219
|
/* @__PURE__ */ d("ul", { className: t.menuList, children: [
|
|
@@ -221,7 +222,7 @@ import '../../assets/MainNav.css';const _i = "_main_12974_1", ai = "_column_1297
|
|
|
221
222
|
{
|
|
222
223
|
onClick: R,
|
|
223
224
|
"data-hamburger-close": "true",
|
|
224
|
-
className: k(t.siteLink, t.menuItemAction,
|
|
225
|
+
className: k(t.siteLink, t.menuItemAction, Y(["lg"])),
|
|
225
226
|
children: [
|
|
226
227
|
/* @__PURE__ */ m(y, { iconKey: "fa-regular fa-sparkles", size: "sm", className: t.shortcutIcon }),
|
|
227
228
|
"Model/Serial"
|
|
@@ -236,11 +237,11 @@ import '../../assets/MainNav.css';const _i = "_main_12974_1", ai = "_column_1297
|
|
|
236
237
|
/* @__PURE__ */ m(y, { iconKey: "fa-regular fa-envelope", size: "sm", className: t.shortcutIcon }),
|
|
237
238
|
"Contact Us"
|
|
238
239
|
] }) }),
|
|
239
|
-
/* @__PURE__ */ m("li", { className: t.menuItem, children: /* @__PURE__ */ d(A, { href:
|
|
240
|
+
/* @__PURE__ */ m("li", { className: t.menuItem, children: /* @__PURE__ */ d(A, { href: C, className: k(t.siteLink, t.menuItemAction), children: [
|
|
240
241
|
/* @__PURE__ */ m(y, { iconKey: "fa-solid fa-question", size: "sm", className: t.shortcutIcon }),
|
|
241
242
|
"FAQ"
|
|
242
243
|
] }) }),
|
|
243
|
-
/* @__PURE__ */ m("li", { className: t.menuItem, children: /* @__PURE__ */ d(A, { href:
|
|
244
|
+
/* @__PURE__ */ m("li", { className: t.menuItem, children: /* @__PURE__ */ d(A, { href: P, className: k(t.siteLink, t.menuItemAction), children: [
|
|
244
245
|
/* @__PURE__ */ m(y, { iconKey: "fa-regular fa-people-group", size: "sm", className: t.shortcutIcon }),
|
|
245
246
|
"About Us"
|
|
246
247
|
] }) })
|
|
@@ -275,9 +276,9 @@ import '../../assets/MainNav.css';const _i = "_main_12974_1", ai = "_column_1297
|
|
|
275
276
|
]
|
|
276
277
|
}
|
|
277
278
|
),
|
|
278
|
-
/* @__PURE__ */ m(
|
|
279
|
+
/* @__PURE__ */ m(B, { flexDirection: "row", hideAt: ["md", "lg"], className: t.mobileSearch, children: /* @__PURE__ */ d("div", { className: t.search, children: [
|
|
279
280
|
/* @__PURE__ */ m(
|
|
280
|
-
|
|
281
|
+
X,
|
|
281
282
|
{
|
|
282
283
|
variant: "search",
|
|
283
284
|
label: "Search",
|
|
@@ -286,23 +287,23 @@ import '../../assets/MainNav.css';const _i = "_main_12974_1", ai = "_column_1297
|
|
|
286
287
|
autoComplete: "off",
|
|
287
288
|
"aria-autocomplete": "list",
|
|
288
289
|
"aria-controls": r,
|
|
289
|
-
"aria-activedescendant":
|
|
290
|
+
"aria-activedescendant": f >= 0 ? `${r}-${f}` : void 0,
|
|
290
291
|
...q,
|
|
291
292
|
ref: z,
|
|
292
293
|
value: s,
|
|
293
|
-
endAdornment: /* @__PURE__ */ d(
|
|
294
|
+
endAdornment: /* @__PURE__ */ d(J, { children: [
|
|
294
295
|
!!s && /* @__PURE__ */ m(
|
|
295
|
-
|
|
296
|
+
$,
|
|
296
297
|
{
|
|
297
298
|
"aria-label": "Clear search",
|
|
298
299
|
onClick: () => {
|
|
299
|
-
|
|
300
|
+
a(-1), w == null || w();
|
|
300
301
|
},
|
|
301
302
|
iconProps: { iconKey: "fa-regular fa-xmark", size: "sm" }
|
|
302
303
|
}
|
|
303
304
|
),
|
|
304
305
|
/* @__PURE__ */ m(
|
|
305
|
-
|
|
306
|
+
$,
|
|
306
307
|
{
|
|
307
308
|
"aria-label": "Submit search",
|
|
308
309
|
onClick: () => c == null ? void 0 : c(s ?? ""),
|
|
@@ -312,11 +313,11 @@ import '../../assets/MainNav.css';const _i = "_main_12974_1", ai = "_column_1297
|
|
|
312
313
|
] })
|
|
313
314
|
}
|
|
314
315
|
),
|
|
315
|
-
D &&
|
|
316
|
-
n == null || n((i == null ? void 0 : i.name) ?? s ?? ""),
|
|
316
|
+
D && o && /* @__PURE__ */ m(u, { ...o, activeOptionIndex: f, optionIdPrefix: r, onKeyDown: p, onSuggestionClick: (i) => {
|
|
317
|
+
n == null || n((i == null ? void 0 : i.name) ?? s ?? ""), N(!1);
|
|
317
318
|
}, className: t.suggestionDropdown }),
|
|
318
319
|
O && /* @__PURE__ */ m(
|
|
319
|
-
|
|
320
|
+
u,
|
|
320
321
|
{
|
|
321
322
|
terms: [],
|
|
322
323
|
categories: [],
|
|
@@ -324,21 +325,21 @@ import '../../assets/MainNav.css';const _i = "_main_12974_1", ai = "_column_1297
|
|
|
324
325
|
view: "recent-searches",
|
|
325
326
|
recentSearches: _,
|
|
326
327
|
onClearRecentSearch: H,
|
|
327
|
-
activeOptionIndex:
|
|
328
|
+
activeOptionIndex: f,
|
|
328
329
|
optionIdPrefix: r,
|
|
329
330
|
onKeyDown: p,
|
|
330
331
|
onSuggestionClick: (i) => {
|
|
331
|
-
n == null || n((i == null ? void 0 : i.term) ?? s ?? ""),
|
|
332
|
+
n == null || n((i == null ? void 0 : i.term) ?? s ?? ""), N(!1);
|
|
332
333
|
},
|
|
333
334
|
className: t.suggestionDropdown
|
|
334
335
|
}
|
|
335
336
|
)
|
|
336
337
|
] }) }),
|
|
337
338
|
/* @__PURE__ */ m(
|
|
338
|
-
|
|
339
|
+
_i,
|
|
339
340
|
{
|
|
340
341
|
categories: b,
|
|
341
|
-
isCategoriesLoading:
|
|
342
|
+
isCategoriesLoading: oi,
|
|
342
343
|
onCategoryClick: K
|
|
343
344
|
}
|
|
344
345
|
)
|
|
@@ -352,5 +353,5 @@ function A({
|
|
|
352
353
|
return /* @__PURE__ */ m(j, { href: E, className: t.siteLink, ...b, children: F });
|
|
353
354
|
}
|
|
354
355
|
export {
|
|
355
|
-
|
|
356
|
+
Xi as MainNav
|
|
356
357
|
};
|
|
@@ -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,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 {};
|
|
@@ -1,133 +1,157 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as a, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { Text as h } from "../../atoms/Text/Text.js";
|
|
3
|
-
import { Link as
|
|
4
|
-
import { Icon as
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
3
|
+
import { Link as g } from "../../atoms/Link/Link.js";
|
|
4
|
+
import { Icon as x } from "../../atoms/Icon/Icon.js";
|
|
5
|
+
import { c as o } from "../../clsx-OuTLNxxd.js";
|
|
6
|
+
import { Image as N } from "../../atoms/Image/Image.js";
|
|
7
|
+
import '../../assets/SuggestionDropdown.css';const y = "_suggestionDropdown_17xzw_1", v = "_leftColumn_17xzw_31", F = "_leftColumnFullWidth_17xzw_55", H = "_suggestionSectionFullHeight_17xzw_63", $ = "_rightColumn_17xzw_73", D = "_categorySection_17xzw_95", b = "_suggestions_17xzw_101", T = "_categories_17xzw_103", k = "_suggestionsFullHeight_17xzw_117", q = "_customPartLink_17xzw_125", W = "_suggestionLink_17xzw_169", j = "_categoryLink_17xzw_171", K = "_activeOption_17xzw_207", M = "_itemList_17xzw_215", O = "_item_17xzw_215", R = "_activeItem_17xzw_269", A = "_itemInfo_17xzw_303", B = "_recentSearches_17xzw_313", E = "_recentSearchesHeader_17xzw_327", G = "_recentSearchesList_17xzw_335", J = "_recentSearch_17xzw_313", Q = "_recentSearchLink_17xzw_365", U = "_clearRecentSearch_17xzw_381", l = {
|
|
8
|
+
suggestionDropdown: y,
|
|
9
|
+
leftColumn: v,
|
|
10
|
+
leftColumnFullWidth: F,
|
|
11
|
+
suggestionSectionFullHeight: H,
|
|
12
|
+
rightColumn: $,
|
|
13
|
+
categorySection: D,
|
|
14
|
+
suggestions: b,
|
|
15
|
+
categories: T,
|
|
16
|
+
suggestionsFullHeight: k,
|
|
17
|
+
customPartLink: q,
|
|
18
|
+
suggestionLink: W,
|
|
19
|
+
categoryLink: j,
|
|
20
|
+
activeOption: K,
|
|
21
|
+
itemList: M,
|
|
22
|
+
item: O,
|
|
23
|
+
activeItem: R,
|
|
24
|
+
itemInfo: A,
|
|
25
|
+
recentSearches: B,
|
|
26
|
+
recentSearchesHeader: E,
|
|
27
|
+
recentSearchesList: G,
|
|
28
|
+
recentSearch: J,
|
|
29
|
+
recentSearchLink: Q,
|
|
30
|
+
clearRecentSearch: U
|
|
30
31
|
};
|
|
31
|
-
function
|
|
32
|
-
terms:
|
|
33
|
-
categories:
|
|
32
|
+
function I({
|
|
33
|
+
terms: i,
|
|
34
|
+
categories: r,
|
|
34
35
|
items: u,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
customParts: _ = [],
|
|
37
|
+
view: p = "suggestions",
|
|
38
|
+
recentSearches: m = [],
|
|
39
|
+
onClearRecentSearch: z,
|
|
40
|
+
onSuggestionClick: n,
|
|
41
|
+
activeOptionIndex: c = -1,
|
|
42
|
+
optionIdPrefix: d,
|
|
43
|
+
onKeyDown: f,
|
|
44
|
+
className: L
|
|
43
45
|
}) {
|
|
44
|
-
return
|
|
46
|
+
return i.length === 0 && r.length === 0 && u.length === 0 && _.length === 0 && m.length === 0 ? null : p === "recent-searches" ? /* @__PURE__ */ a(
|
|
45
47
|
"div",
|
|
46
48
|
{
|
|
47
|
-
id:
|
|
49
|
+
id: d,
|
|
48
50
|
role: "listbox",
|
|
49
|
-
className:
|
|
50
|
-
onKeyDown:
|
|
51
|
+
className: o(l.suggestionDropdown, l.recentSearches, L),
|
|
52
|
+
onKeyDown: f,
|
|
51
53
|
onMouseDown: (e) => e.preventDefault(),
|
|
52
54
|
children: [
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
/* @__PURE__ */
|
|
56
|
-
|
|
55
|
+
/* @__PURE__ */ t("div", { className: l.recentSearchesHeader, children: /* @__PURE__ */ t(h, { size: "xxs", colorToken: "quaternary", children: "Recent Searches" }) }),
|
|
56
|
+
/* @__PURE__ */ t("ol", { className: l.recentSearchesList, children: m.map((e) => /* @__PURE__ */ a("li", { className: l.recentSearch, children: [
|
|
57
|
+
/* @__PURE__ */ t(
|
|
58
|
+
g,
|
|
57
59
|
{
|
|
58
60
|
href: e.url,
|
|
59
|
-
id: `${
|
|
61
|
+
id: `${d}-${m.indexOf(e)}`,
|
|
60
62
|
role: "option",
|
|
61
|
-
"aria-selected":
|
|
62
|
-
className:
|
|
63
|
-
onClick: () =>
|
|
64
|
-
children: /* @__PURE__ */
|
|
63
|
+
"aria-selected": c === m.indexOf(e),
|
|
64
|
+
className: o(l.recentSearchLink, { [l.activeOption]: c === m.indexOf(e) }),
|
|
65
|
+
onClick: () => n == null ? void 0 : n(e),
|
|
66
|
+
children: /* @__PURE__ */ t(h, { size: "sm", children: e.term })
|
|
65
67
|
}
|
|
66
68
|
),
|
|
67
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ t(
|
|
68
70
|
"button",
|
|
69
71
|
{
|
|
70
72
|
type: "button",
|
|
71
|
-
className:
|
|
73
|
+
className: l.clearRecentSearch,
|
|
72
74
|
"aria-label": `Clear recent search: ${e.term}`,
|
|
73
|
-
onClick: () =>
|
|
74
|
-
children: /* @__PURE__ */
|
|
75
|
+
onClick: () => z == null ? void 0 : z(e),
|
|
76
|
+
children: /* @__PURE__ */ t(x, { iconKey: "fa-regular fa-xmark", size: "sm" })
|
|
75
77
|
}
|
|
76
78
|
)
|
|
77
79
|
] }, e.url)) })
|
|
78
80
|
]
|
|
79
81
|
}
|
|
80
|
-
) : /* @__PURE__ */
|
|
81
|
-
(
|
|
82
|
-
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
|
|
85
|
-
(e,
|
|
86
|
-
|
|
82
|
+
) : /* @__PURE__ */ a("div", { id: d, role: "listbox", className: o(l.suggestionDropdown, L), onKeyDown: f, onMouseDown: (e) => e.preventDefault(), children: [
|
|
83
|
+
(i.length > 0 || r.length > 0 || _.length > 0) && /* @__PURE__ */ a("div", { className: o(l.leftColumn, { [l.leftColumnFullWidth]: u.length === 0 }), children: [
|
|
84
|
+
i.length > 0 && /* @__PURE__ */ t("div", { className: o(l.suggestionSection, { [l.suggestionSectionFullHeight]: r.length === 0 }), children: /* @__PURE__ */ a("div", { className: o(l.suggestions, { [l.suggestionsFullHeight]: r.length === 0 }), children: [
|
|
85
|
+
/* @__PURE__ */ t(h, { size: "xxs", colorToken: "quaternary", children: "Suggestions" }),
|
|
86
|
+
i.map(
|
|
87
|
+
(e, s) => /* @__PURE__ */ t(h, { size: "sm", children: /* @__PURE__ */ t(
|
|
88
|
+
g,
|
|
87
89
|
{
|
|
88
90
|
href: e.url,
|
|
89
|
-
id: `${
|
|
91
|
+
id: `${d}-${s}`,
|
|
90
92
|
role: "option",
|
|
91
|
-
"aria-selected":
|
|
92
|
-
className:
|
|
93
|
-
onClick: () =>
|
|
93
|
+
"aria-selected": c === s,
|
|
94
|
+
className: o(l.suggestionLink, { [l.activeOption]: c === s }),
|
|
95
|
+
onClick: () => n == null ? void 0 : n(e),
|
|
94
96
|
children: e.name
|
|
95
97
|
}
|
|
96
98
|
) }, e.url)
|
|
97
99
|
)
|
|
98
100
|
] }) }),
|
|
99
|
-
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
-
|
|
102
|
-
(e,
|
|
103
|
-
|
|
101
|
+
r.length > 0 && /* @__PURE__ */ t("div", { className: l.categorySection, children: /* @__PURE__ */ a("div", { className: l.categories, children: [
|
|
102
|
+
/* @__PURE__ */ t(h, { size: "xxs", colorToken: "quaternary", children: "Categories" }),
|
|
103
|
+
r.map(
|
|
104
|
+
(e, s) => /* @__PURE__ */ t(h, { size: "sm", children: /* @__PURE__ */ t(
|
|
105
|
+
g,
|
|
104
106
|
{
|
|
105
107
|
href: e.url,
|
|
106
|
-
id: `${
|
|
108
|
+
id: `${d}-${i.length + s}`,
|
|
107
109
|
role: "option",
|
|
108
|
-
"aria-selected":
|
|
109
|
-
className:
|
|
110
|
-
onClick: () =>
|
|
110
|
+
"aria-selected": c === i.length + s,
|
|
111
|
+
className: o(l.categoryLink, { [l.activeOption]: c === i.length + s }),
|
|
112
|
+
onClick: () => n == null ? void 0 : n(),
|
|
111
113
|
children: e.name
|
|
112
114
|
}
|
|
113
115
|
) }, e.categoryKey)
|
|
114
116
|
)
|
|
117
|
+
] }) }),
|
|
118
|
+
_.length > 0 && /* @__PURE__ */ t("div", { className: l.categorySection, children: /* @__PURE__ */ a("div", { className: l.categories, children: [
|
|
119
|
+
/* @__PURE__ */ t(h, { size: "xxs", colorToken: "quaternary", children: "Custom Parts" }),
|
|
120
|
+
_.map((e, s) => {
|
|
121
|
+
const w = i.length + r.length + s;
|
|
122
|
+
return /* @__PURE__ */ a(
|
|
123
|
+
g,
|
|
124
|
+
{
|
|
125
|
+
href: e.url,
|
|
126
|
+
id: `${d}-${w}`,
|
|
127
|
+
role: "option",
|
|
128
|
+
"aria-selected": c === w,
|
|
129
|
+
className: o(l.customPartLink, { [l.activeOption]: c === w }),
|
|
130
|
+
onClick: () => n == null ? void 0 : n(),
|
|
131
|
+
children: [
|
|
132
|
+
/* @__PURE__ */ t(x, { iconKey: e.icon, size: "sm" }),
|
|
133
|
+
/* @__PURE__ */ t(h, { size: "sm", children: e.label })
|
|
134
|
+
]
|
|
135
|
+
},
|
|
136
|
+
e.id
|
|
137
|
+
);
|
|
138
|
+
})
|
|
115
139
|
] }) })
|
|
116
140
|
] }),
|
|
117
|
-
u.length > 0 && /* @__PURE__ */
|
|
118
|
-
(e,
|
|
119
|
-
|
|
141
|
+
u.length > 0 && /* @__PURE__ */ t("div", { className: l.rightColumn, children: /* @__PURE__ */ t("ol", { className: l.itemList, children: u.map(
|
|
142
|
+
(e, s) => /* @__PURE__ */ t("li", { className: o(l.item, { [l.activeItem]: c === i.length + r.length + _.length + s }), children: /* @__PURE__ */ a(
|
|
143
|
+
g,
|
|
120
144
|
{
|
|
121
145
|
href: e.url,
|
|
122
|
-
id: `${
|
|
146
|
+
id: `${d}-${i.length + r.length + _.length + s}`,
|
|
123
147
|
role: "option",
|
|
124
|
-
"aria-selected":
|
|
125
|
-
onClick: () =>
|
|
148
|
+
"aria-selected": c === i.length + r.length + _.length + s,
|
|
149
|
+
onClick: () => n == null ? void 0 : n(),
|
|
126
150
|
children: [
|
|
127
|
-
/* @__PURE__ */
|
|
128
|
-
/* @__PURE__ */
|
|
129
|
-
/* @__PURE__ */
|
|
130
|
-
/* @__PURE__ */
|
|
151
|
+
/* @__PURE__ */ t(N, { src: e.image, alt: `${e.description} product image`, height: 72, width: 72 }),
|
|
152
|
+
/* @__PURE__ */ a("div", { className: l.itemInfo, children: [
|
|
153
|
+
/* @__PURE__ */ t(h, { size: "sm", children: e.description }),
|
|
154
|
+
/* @__PURE__ */ t(h, { size: "xs", colorToken: "quaternary", children: e.itemId })
|
|
131
155
|
] })
|
|
132
156
|
]
|
|
133
157
|
}
|
|
@@ -136,5 +160,5 @@ function Y({
|
|
|
136
160
|
] });
|
|
137
161
|
}
|
|
138
162
|
export {
|
|
139
|
-
|
|
163
|
+
I as SuggestionDropdown
|
|
140
164
|
};
|
|
@@ -19,19 +19,23 @@ const a = {
|
|
|
19
19
|
{ categoryKey: 2, name: "Accessories", url: "/categories/accessories" },
|
|
20
20
|
{ categoryKey: 3, name: "Controls", url: "/categories/controls" }
|
|
21
21
|
],
|
|
22
|
+
customParts: [
|
|
23
|
+
{ id: "gasket", label: "Gaskets", url: "/custom/gasket", icon: "fa-kit fa-gaskets" },
|
|
24
|
+
{ id: "heater", label: "Bent Heaters", url: "/custom/heater", icon: "fa-kit fa-coils" }
|
|
25
|
+
],
|
|
22
26
|
items: [
|
|
23
27
|
{
|
|
24
28
|
itemKey: 1,
|
|
25
29
|
itemId: "P-1001",
|
|
26
30
|
description: "Smart Thermostat",
|
|
27
|
-
image: "https://placehold.co/120x80/png?text=
|
|
31
|
+
image: "https://placehold.co/120x80/png?text=T-Stat",
|
|
28
32
|
url: "/parts/p-1001"
|
|
29
33
|
},
|
|
30
34
|
{
|
|
31
35
|
itemKey: 2,
|
|
32
36
|
itemId: "P-1002",
|
|
33
37
|
description: "Wire Harness",
|
|
34
|
-
image: "https://placehold.co/120x80/png?text=
|
|
38
|
+
image: "https://placehold.co/120x80/png?text=Gasket",
|
|
35
39
|
url: "/parts/p-1002"
|
|
36
40
|
},
|
|
37
41
|
{
|
|
@@ -53,13 +57,13 @@ const a = {
|
|
|
53
57
|
...e.args,
|
|
54
58
|
items: []
|
|
55
59
|
}
|
|
56
|
-
},
|
|
60
|
+
}, i = {
|
|
57
61
|
args: {
|
|
58
62
|
...e.args,
|
|
59
63
|
terms: [],
|
|
60
64
|
categories: []
|
|
61
65
|
}
|
|
62
|
-
},
|
|
66
|
+
}, n = {
|
|
63
67
|
args: {
|
|
64
68
|
view: "recent-searches",
|
|
65
69
|
terms: [],
|
|
@@ -75,8 +79,8 @@ const a = {
|
|
|
75
79
|
};
|
|
76
80
|
export {
|
|
77
81
|
e as Default,
|
|
78
|
-
|
|
79
|
-
|
|
82
|
+
i as OnlyItems,
|
|
83
|
+
n as RecentSearches,
|
|
80
84
|
o as WithoutCategories,
|
|
81
85
|
c as WithoutItems,
|
|
82
86
|
a as default
|