@caseparts-org/caseblocks 0.0.225 → 0.0.227
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/Input.css +1 -1
- package/dist/assets/InputEndAdornmentButton.css +1 -0
- package/dist/assets/MainNav.css +1 -1
- package/dist/assets/SuggestionDropdown.css +1 -0
- package/dist/atoms/Input/Input.d.ts +2 -0
- package/dist/atoms/Input/Input.js +44 -31
- package/dist/atoms/InputEndAdornmentButton/InputEndAdornmentButton.d.ts +6 -0
- package/dist/atoms/InputEndAdornmentButton/InputEndAdornmentButton.js +17 -0
- package/dist/main-client.d.ts +2 -0
- package/dist/main-client.js +48 -48
- package/dist/main-server.d.ts +0 -2
- package/dist/main-server.js +35 -37
- package/dist/main.d.ts +2 -2
- package/dist/main.js +28 -28
- package/dist/organisms/MainNav/MainNav.d.ts +12 -1
- package/dist/organisms/MainNav/MainNav.js +218 -109
- package/dist/organisms/MainNav/MainNav.stories.d.ts +1 -0
- package/dist/organisms/MainNav/MainNav.stories.js +125 -64
- package/dist/organisms/SuggestionDropdown/SuggestionDropdown.d.ts +29 -0
- package/dist/organisms/SuggestionDropdown/SuggestionDropdown.js +85 -0
- package/dist/{molecules/SearchBox/SearchBox.stories.d.ts → organisms/SuggestionDropdown/SuggestionDropdown.stories.d.ts} +4 -2
- package/dist/organisms/SuggestionDropdown/SuggestionDropdown.stories.js +64 -0
- package/package.json +1 -1
- package/dist/assets/SearchBox.css +0 -1
- package/dist/molecules/SearchBox/SearchBox.d.ts +0 -7
- package/dist/molecules/SearchBox/SearchBox.js +0 -65
- package/dist/molecules/SearchBox/SearchBox.stories.js +0 -15
|
@@ -1,144 +1,209 @@
|
|
|
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 {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
1
|
+
import { jsx as i, jsxs as o, Fragment as B } from "react/jsx-runtime";
|
|
2
|
+
import F from "react";
|
|
3
|
+
import { Text as w } from "../../atoms/Text/Text.js";
|
|
4
|
+
import { Link as y } from "../../atoms/Link/Link.js";
|
|
5
|
+
import { Icon as a } from "../../atoms/Icon/Icon.js";
|
|
6
|
+
import { Flex as g } from "../../atoms/Flex/Flex.js";
|
|
7
|
+
import { Grid as Y, Column as Z } from "../../atoms/Grid/Grid.js";
|
|
8
|
+
import { Input as j } from "../../atoms/Input/Input.js";
|
|
9
|
+
import { InputEndAdornmentButton as _ } from "../../atoms/InputEndAdornmentButton/InputEndAdornmentButton.js";
|
|
10
|
+
import { Logo as $ } from "../../molecules/Logo/Logo.js";
|
|
11
|
+
import { HamburgerMenu as V } from "../../molecules/HamburgerMenu/HamburgerMenu.js";
|
|
12
|
+
import { ShoppingCart as P } from "../../molecules/Cart/Cart.js";
|
|
13
|
+
import { Account as ee } from "../../molecules/Account/Account.js";
|
|
14
|
+
import { CategoryNav as ie } from "../../molecules/CategoryNav/CategoryNav.js";
|
|
15
|
+
import { SuggestionDropdown as N } from "../SuggestionDropdown/SuggestionDropdown.js";
|
|
16
|
+
import { getHideAtStyles as M } from "../../atoms/HideAt.js";
|
|
15
17
|
import { c as t } from "../../clsx-OuTLNxxd.js";
|
|
16
|
-
import '../../assets/MainNav.css';const
|
|
17
|
-
main:
|
|
18
|
-
column:
|
|
19
|
-
topNav:
|
|
20
|
-
logo:
|
|
21
|
-
operations:
|
|
22
|
-
search:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
18
|
+
import '../../assets/MainNav.css';const oe = "_main_12974_1", se = "_column_12974_8", ne = "_topNav_12974_13", ae = "_logo_12974_21", te = "_operations_12974_24", me = "_search_12974_31", ce = "_mobileSearch_12974_36", le = "_suggestionDropdown_12974_39", re = "_siteLink_12974_45", de = "_accountArea_12974_72", fe = "_category_12974_84", ue = "_categoryLink_12974_92", he = "_menuList_12974_108", ge = "_menuItemAction_12974_131", _e = "_shortcutIcon_12974_140", e = {
|
|
19
|
+
main: oe,
|
|
20
|
+
column: se,
|
|
21
|
+
topNav: ne,
|
|
22
|
+
logo: ae,
|
|
23
|
+
operations: te,
|
|
24
|
+
search: me,
|
|
25
|
+
mobileSearch: ce,
|
|
26
|
+
suggestionDropdown: le,
|
|
27
|
+
siteLink: re,
|
|
28
|
+
accountArea: de,
|
|
29
|
+
category: fe,
|
|
30
|
+
categoryLink: ue,
|
|
31
|
+
menuList: he,
|
|
32
|
+
menuItemAction: ge,
|
|
33
|
+
shortcutIcon: _e
|
|
34
|
+
}, je = F.forwardRef(function({
|
|
35
|
+
account: p,
|
|
36
|
+
categories: l,
|
|
37
|
+
homeRoute: U,
|
|
38
|
+
faqRoute: H,
|
|
39
|
+
customPartsRoute: k,
|
|
40
|
+
aboutUsRoute: q,
|
|
41
|
+
contactRoute: L,
|
|
42
|
+
cart: E,
|
|
43
|
+
open: G,
|
|
40
44
|
// consume external panel control props from CartPropsBase
|
|
41
|
-
className:
|
|
42
|
-
onLoginClick:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
45
|
+
className: Q,
|
|
46
|
+
onLoginClick: T,
|
|
47
|
+
searchInputProps: s,
|
|
48
|
+
searchValue: r,
|
|
49
|
+
onClearSearch: v,
|
|
50
|
+
onSearch: m,
|
|
51
|
+
searchSuggestions: d,
|
|
52
|
+
recentSearches: f,
|
|
53
|
+
onClearRecentSearch: z,
|
|
54
|
+
onCategoryClick: h,
|
|
55
|
+
onClickModelSerial: x,
|
|
56
|
+
onCartClick: W,
|
|
57
|
+
accountPopoverContent: J,
|
|
58
|
+
isAccountLoading: O,
|
|
59
|
+
isCategoriesLoading: R,
|
|
60
|
+
...S
|
|
61
|
+
}, X) {
|
|
62
|
+
const [D, K] = F.useState(!1), b = D && !!r && !!d, I = D && !b && !!(f != null && f.length), C = {
|
|
63
|
+
...s,
|
|
64
|
+
onFocus: (n) => {
|
|
65
|
+
var u;
|
|
66
|
+
(u = s == null ? void 0 : s.onFocus) == null || u.call(s, n), K(!0);
|
|
67
|
+
},
|
|
68
|
+
onBlur: (n) => {
|
|
69
|
+
var u;
|
|
70
|
+
(u = s == null ? void 0 : s.onBlur) == null || u.call(s, n), K(!1);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
return /* @__PURE__ */ i(Y, { ...S, gridWrapperClassName: t(e.main, Q), children: /* @__PURE__ */ o(Z, { span: 12, className: e.column, children: [
|
|
74
|
+
/* @__PURE__ */ o(
|
|
75
|
+
g,
|
|
55
76
|
{
|
|
56
77
|
flexDirection: "row",
|
|
57
78
|
alignItems: "center",
|
|
58
79
|
justifyContent: "space-between",
|
|
59
80
|
className: e.topNav,
|
|
60
81
|
children: [
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
|
|
82
|
+
/* @__PURE__ */ i("div", { className: e.logo, children: /* @__PURE__ */ i(y, { href: U, children: /* @__PURE__ */ i($, {}) }) }),
|
|
83
|
+
/* @__PURE__ */ o(
|
|
84
|
+
g,
|
|
64
85
|
{
|
|
65
86
|
flexDirection: "row",
|
|
66
87
|
alignItems: "center",
|
|
67
88
|
justifyContent: "flex-end",
|
|
68
89
|
className: e.operations,
|
|
69
90
|
children: [
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
-
|
|
72
|
-
|
|
91
|
+
/* @__PURE__ */ o(g, { flexDirection: "row", hideAt: ["sm"], className: e.search, children: [
|
|
92
|
+
/* @__PURE__ */ i(
|
|
93
|
+
j,
|
|
94
|
+
{
|
|
95
|
+
variant: "search",
|
|
96
|
+
label: "Search",
|
|
97
|
+
placeholder: "Search by keyword(s) or Part #....",
|
|
98
|
+
name: "cpc-search",
|
|
99
|
+
autoComplete: "off",
|
|
100
|
+
"aria-autocomplete": "list",
|
|
101
|
+
...C,
|
|
102
|
+
endAdornment: /* @__PURE__ */ o(B, { children: [
|
|
103
|
+
!!r && /* @__PURE__ */ i(
|
|
104
|
+
_,
|
|
105
|
+
{
|
|
106
|
+
"aria-label": "Clear search",
|
|
107
|
+
onClick: v,
|
|
108
|
+
iconProps: { iconKey: "fa-regular fa-xmark", size: "sm" }
|
|
109
|
+
}
|
|
110
|
+
),
|
|
111
|
+
/* @__PURE__ */ i(
|
|
112
|
+
_,
|
|
113
|
+
{
|
|
114
|
+
"aria-label": "Submit search",
|
|
115
|
+
onClick: () => m == null ? void 0 : m(r ?? ""),
|
|
116
|
+
iconProps: { iconKey: "fa-regular fa-magnifying-glass", size: "sm" }
|
|
117
|
+
}
|
|
118
|
+
)
|
|
119
|
+
] })
|
|
120
|
+
}
|
|
121
|
+
),
|
|
122
|
+
b && d && /* @__PURE__ */ i(N, { ...d, className: e.suggestionDropdown }),
|
|
123
|
+
I && /* @__PURE__ */ i(
|
|
124
|
+
N,
|
|
125
|
+
{
|
|
126
|
+
terms: [],
|
|
127
|
+
categories: [],
|
|
128
|
+
items: [],
|
|
129
|
+
view: "recent-searches",
|
|
130
|
+
recentSearches: f,
|
|
131
|
+
onClearRecentSearch: z,
|
|
132
|
+
className: e.suggestionDropdown
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
] }),
|
|
136
|
+
/* @__PURE__ */ o("button", { onClick: x, className: t(e.siteLink, M(["sm", "md"])), children: [
|
|
137
|
+
/* @__PURE__ */ i(a, { iconKey: "fa-regular fa-sparkles", size: "sm" }),
|
|
73
138
|
"Model/Serial"
|
|
74
139
|
] }),
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
/* @__PURE__ */
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
|
|
140
|
+
/* @__PURE__ */ i(c, { href: k, hideAt: ["sm", "md"], children: "Custom Parts" }),
|
|
141
|
+
/* @__PURE__ */ i(c, { href: L, hideAt: ["sm", "md"], children: "Contact Us" }),
|
|
142
|
+
/* @__PURE__ */ i("div", { className: e.accountArea, children: /* @__PURE__ */ i(
|
|
143
|
+
ee,
|
|
79
144
|
{
|
|
80
|
-
account:
|
|
81
|
-
onLoginClick:
|
|
145
|
+
account: p,
|
|
146
|
+
onLoginClick: T,
|
|
82
147
|
className: e.avatar,
|
|
83
|
-
popoverContent:
|
|
84
|
-
isAccountLoading:
|
|
148
|
+
popoverContent: J,
|
|
149
|
+
isAccountLoading: O
|
|
85
150
|
}
|
|
86
151
|
) }),
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
|
|
152
|
+
/* @__PURE__ */ i(
|
|
153
|
+
P,
|
|
89
154
|
{
|
|
90
|
-
ref:
|
|
91
|
-
cart:
|
|
92
|
-
open:
|
|
93
|
-
onCartClick:
|
|
155
|
+
ref: X,
|
|
156
|
+
cart: E,
|
|
157
|
+
open: G,
|
|
158
|
+
onCartClick: W
|
|
94
159
|
}
|
|
95
160
|
),
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
-
/* @__PURE__ */
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
-
/* @__PURE__ */
|
|
100
|
-
/* @__PURE__ */
|
|
161
|
+
/* @__PURE__ */ o(V, { hideAt: ["lg"], children: [
|
|
162
|
+
/* @__PURE__ */ o("section", { children: [
|
|
163
|
+
/* @__PURE__ */ i(w, { size: "md", weight: "semibold", children: "Useful shortcuts" }),
|
|
164
|
+
/* @__PURE__ */ o("ul", { className: e.menuList, children: [
|
|
165
|
+
/* @__PURE__ */ i("li", { className: e.menuItem, children: /* @__PURE__ */ o(
|
|
101
166
|
"button",
|
|
102
167
|
{
|
|
103
|
-
onClick:
|
|
168
|
+
onClick: x,
|
|
104
169
|
"data-hamburger-close": "true",
|
|
105
|
-
className: t(e.siteLink, e.menuItemAction,
|
|
170
|
+
className: t(e.siteLink, e.menuItemAction, M(["lg"])),
|
|
106
171
|
children: [
|
|
107
|
-
/* @__PURE__ */
|
|
172
|
+
/* @__PURE__ */ i(a, { iconKey: "fa-regular fa-sparkles", size: "sm", className: e.shortcutIcon }),
|
|
108
173
|
"Model/Serial"
|
|
109
174
|
]
|
|
110
175
|
}
|
|
111
176
|
) }),
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
/* @__PURE__ */
|
|
177
|
+
/* @__PURE__ */ i("li", { className: e.menuItem, children: /* @__PURE__ */ o(c, { href: k, className: t(e.siteLink, e.menuItemAction), children: [
|
|
178
|
+
/* @__PURE__ */ i(a, { iconKey: "fa-regular fa-screwdriver-wrench", size: "sm", className: e.shortcutIcon }),
|
|
114
179
|
"Custom Parts"
|
|
115
180
|
] }) }),
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
-
/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */ i("li", { className: e.menuItem, children: /* @__PURE__ */ o(c, { href: L, className: t(e.siteLink, e.menuItemAction), children: [
|
|
182
|
+
/* @__PURE__ */ i(a, { iconKey: "fa-regular fa-envelope", size: "sm", className: e.shortcutIcon }),
|
|
118
183
|
"Contact Us"
|
|
119
184
|
] }) }),
|
|
120
|
-
/* @__PURE__ */
|
|
121
|
-
/* @__PURE__ */
|
|
185
|
+
/* @__PURE__ */ i("li", { className: e.menuItem, children: /* @__PURE__ */ o(c, { href: H, className: t(e.siteLink, e.menuItemAction), children: [
|
|
186
|
+
/* @__PURE__ */ i(a, { iconKey: "fa-solid fa-question", size: "sm", className: e.shortcutIcon }),
|
|
122
187
|
"FAQ"
|
|
123
188
|
] }) }),
|
|
124
|
-
/* @__PURE__ */
|
|
125
|
-
/* @__PURE__ */
|
|
189
|
+
/* @__PURE__ */ i("li", { className: e.menuItem, children: /* @__PURE__ */ o(c, { href: q, className: t(e.siteLink, e.menuItemAction), children: [
|
|
190
|
+
/* @__PURE__ */ i(a, { iconKey: "fa-regular fa-people-group", size: "sm", className: e.shortcutIcon }),
|
|
126
191
|
"About Us"
|
|
127
192
|
] }) })
|
|
128
193
|
] })
|
|
129
194
|
] }),
|
|
130
|
-
/* @__PURE__ */
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
-
/* @__PURE__ */
|
|
133
|
-
|
|
195
|
+
/* @__PURE__ */ o("section", { children: [
|
|
196
|
+
/* @__PURE__ */ i(w, { size: "md", weight: "semibold", children: "Shop by category" }),
|
|
197
|
+
/* @__PURE__ */ i("ul", { className: e.menuList, children: l && l.map((n) => /* @__PURE__ */ i("li", { className: e.category, children: /* @__PURE__ */ o(
|
|
198
|
+
y,
|
|
134
199
|
{
|
|
135
|
-
href:
|
|
200
|
+
href: n.route,
|
|
136
201
|
className: e.categoryLink,
|
|
137
|
-
onClick: () =>
|
|
202
|
+
onClick: () => h == null ? void 0 : h(n),
|
|
138
203
|
children: [
|
|
139
|
-
/* @__PURE__ */
|
|
140
|
-
/* @__PURE__ */
|
|
141
|
-
|
|
204
|
+
/* @__PURE__ */ i(w, { size: "sm", children: n.label }),
|
|
205
|
+
/* @__PURE__ */ i(
|
|
206
|
+
a,
|
|
142
207
|
{
|
|
143
208
|
iconKey: "fa-solid fa-chevron-right",
|
|
144
209
|
title: "Navigate",
|
|
@@ -147,7 +212,7 @@ import '../../assets/MainNav.css';const P = "_main_14nx2_1", Q = "_column_14nx2_
|
|
|
147
212
|
)
|
|
148
213
|
]
|
|
149
214
|
}
|
|
150
|
-
) },
|
|
215
|
+
) }, n.id)) })
|
|
151
216
|
] })
|
|
152
217
|
] })
|
|
153
218
|
]
|
|
@@ -156,24 +221,68 @@ import '../../assets/MainNav.css';const P = "_main_14nx2_1", Q = "_column_14nx2_
|
|
|
156
221
|
]
|
|
157
222
|
}
|
|
158
223
|
),
|
|
159
|
-
/* @__PURE__ */
|
|
160
|
-
|
|
161
|
-
|
|
224
|
+
/* @__PURE__ */ i(g, { flexDirection: "row", hideAt: ["md", "lg"], className: e.mobileSearch, children: /* @__PURE__ */ o("div", { className: e.search, children: [
|
|
225
|
+
/* @__PURE__ */ i(
|
|
226
|
+
j,
|
|
227
|
+
{
|
|
228
|
+
variant: "search",
|
|
229
|
+
label: "Search",
|
|
230
|
+
placeholder: "Search by keyword(s) or Part #....",
|
|
231
|
+
name: "cpc-search",
|
|
232
|
+
autoComplete: "off",
|
|
233
|
+
"aria-autocomplete": "list",
|
|
234
|
+
...C,
|
|
235
|
+
endAdornment: /* @__PURE__ */ o(B, { children: [
|
|
236
|
+
!!r && /* @__PURE__ */ i(
|
|
237
|
+
_,
|
|
238
|
+
{
|
|
239
|
+
"aria-label": "Clear search",
|
|
240
|
+
onClick: v,
|
|
241
|
+
iconProps: { iconKey: "fa-regular fa-xmark", size: "sm" }
|
|
242
|
+
}
|
|
243
|
+
),
|
|
244
|
+
/* @__PURE__ */ i(
|
|
245
|
+
_,
|
|
246
|
+
{
|
|
247
|
+
"aria-label": "Submit search",
|
|
248
|
+
onClick: () => m == null ? void 0 : m(r ?? ""),
|
|
249
|
+
iconProps: { iconKey: "fa-regular fa-magnifying-glass", size: "sm" }
|
|
250
|
+
}
|
|
251
|
+
)
|
|
252
|
+
] })
|
|
253
|
+
}
|
|
254
|
+
),
|
|
255
|
+
b && d && /* @__PURE__ */ i(N, { ...d, className: e.suggestionDropdown }),
|
|
256
|
+
I && /* @__PURE__ */ i(
|
|
257
|
+
N,
|
|
258
|
+
{
|
|
259
|
+
terms: [],
|
|
260
|
+
categories: [],
|
|
261
|
+
items: [],
|
|
262
|
+
view: "recent-searches",
|
|
263
|
+
recentSearches: f,
|
|
264
|
+
onClearRecentSearch: z,
|
|
265
|
+
className: e.suggestionDropdown
|
|
266
|
+
}
|
|
267
|
+
)
|
|
268
|
+
] }) }),
|
|
269
|
+
/* @__PURE__ */ i(
|
|
270
|
+
ie,
|
|
162
271
|
{
|
|
163
|
-
categories:
|
|
164
|
-
isCategoriesLoading:
|
|
165
|
-
onCategoryClick:
|
|
272
|
+
categories: l,
|
|
273
|
+
isCategoriesLoading: R,
|
|
274
|
+
onCategoryClick: h
|
|
166
275
|
}
|
|
167
276
|
)
|
|
168
277
|
] }) });
|
|
169
278
|
});
|
|
170
279
|
function c({
|
|
171
|
-
href:
|
|
172
|
-
children:
|
|
173
|
-
...
|
|
280
|
+
href: A,
|
|
281
|
+
children: p,
|
|
282
|
+
...l
|
|
174
283
|
}) {
|
|
175
|
-
return /* @__PURE__ */
|
|
284
|
+
return /* @__PURE__ */ i(y, { href: A, className: e.siteLink, ...l, children: p });
|
|
176
285
|
}
|
|
177
286
|
export {
|
|
178
|
-
|
|
287
|
+
je as MainNav
|
|
179
288
|
};
|
|
@@ -10,5 +10,6 @@ export default meta;
|
|
|
10
10
|
type Story = StoryObj<typeof meta>;
|
|
11
11
|
export declare const Authenticated: Story;
|
|
12
12
|
export declare const WithCartItems: Story;
|
|
13
|
+
export declare const WithSearchSuggestions: Story;
|
|
13
14
|
export declare const Unauthenticated: Story;
|
|
14
15
|
export declare const Loading: Story;
|