@caseparts-org/caseblocks 0.0.226 → 0.0.228
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/InputEndAdornmentButton.css +1 -0
- package/dist/assets/MainNav.css +1 -1
- package/dist/assets/StatusPage.css +1 -0
- package/dist/assets/SuggestionDropdown.css +1 -1
- package/dist/atoms/Input/Input.js +10 -1
- 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 +80 -78
- package/dist/main-server.d.ts +2 -2
- package/dist/main-server.js +39 -39
- package/dist/main.d.ts +2 -2
- package/dist/main.js +28 -28
- package/dist/not-found-DhBNR9yc.js +4 -0
- 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/NotFound/NotFound.js +26 -25
- package/dist/organisms/StatusPage/StatusPage.d.ts +28 -0
- package/dist/organisms/StatusPage/StatusPage.js +106 -0
- package/dist/organisms/StatusPage/StatusPage.stories.d.ts +7 -0
- package/dist/organisms/StatusPage/StatusPage.stories.js +81 -0
- package/dist/organisms/SuggestionDropdown/SuggestionDropdown.d.ts +13 -2
- package/dist/organisms/SuggestionDropdown/SuggestionDropdown.js +72 -38
- package/dist/organisms/SuggestionDropdown/SuggestionDropdown.stories.d.ts +1 -0
- package/dist/organisms/SuggestionDropdown/SuggestionDropdown.stories.js +24 -5
- 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 -36
- package/dist/molecules/SearchBox/SearchBox.stories.d.ts +0 -12
- package/dist/molecules/SearchBox/SearchBox.stories.js +0 -15
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { MainNav as
|
|
4
|
-
import { Text as
|
|
5
|
-
import { Link as
|
|
6
|
-
import { Button as
|
|
7
|
-
import { CartSlideInPanel as
|
|
8
|
-
const
|
|
1
|
+
import { jsxs as y, Fragment as k, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useState as g } from "react";
|
|
3
|
+
import { MainNav as b } from "./MainNav.js";
|
|
4
|
+
import { Text as p } from "../../atoms/Text/Text.js";
|
|
5
|
+
import { Link as h } from "../../atoms/Link/Link.js";
|
|
6
|
+
import { Button as S } from "../../atoms/Button/Button.js";
|
|
7
|
+
import { CartSlideInPanel as v } from "../../molecules/Cart/CartSlideInPanel.js";
|
|
8
|
+
const x = {
|
|
9
9
|
title: "Case Parts/Organisms/MainNav",
|
|
10
|
-
component:
|
|
10
|
+
component: b,
|
|
11
11
|
parameters: {
|
|
12
12
|
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
|
|
13
13
|
layout: "fullscreen"
|
|
14
14
|
}
|
|
15
15
|
// tags: ["autodocs"],
|
|
16
|
-
},
|
|
16
|
+
}, c = [
|
|
17
17
|
{
|
|
18
18
|
id: 0,
|
|
19
19
|
label: "Shop by Brands",
|
|
@@ -106,7 +106,31 @@ const q = {
|
|
|
106
106
|
route: "#",
|
|
107
107
|
children: []
|
|
108
108
|
}
|
|
109
|
-
], a = "https://m.media-amazon.com/images/I/216+JEttsYL._UF1000,1000_QL80_.jpg",
|
|
109
|
+
], a = "https://m.media-amazon.com/images/I/216+JEttsYL._UF1000,1000_QL80_.jpg", I = {
|
|
110
|
+
terms: [
|
|
111
|
+
{ name: "gasket", url: "/search/gasket" },
|
|
112
|
+
{ name: "gasket strip", url: "/search/gasket-strip" },
|
|
113
|
+
{ name: "gasket material", url: "/search/gasket-material" }
|
|
114
|
+
],
|
|
115
|
+
categories: [
|
|
116
|
+
{ name: "Magnetic Door Gaskets and Sweeper Gasket", url: "/category/47432" },
|
|
117
|
+
{ name: "01 Gaskets", url: "/category/46795" },
|
|
118
|
+
{ name: "Door Gaskets", url: "/category/47022" },
|
|
119
|
+
{ name: "Magnetic Gaskets", url: "/category/46971" },
|
|
120
|
+
{ name: "Magnetic Gaskets", url: "/category/47501" }
|
|
121
|
+
],
|
|
122
|
+
items: [
|
|
123
|
+
{ itemKey: 13503, itemId: "GASKET-RING", description: "Gasket Sample Ring", image: a, url: "/part/GASKET-RING" },
|
|
124
|
+
{ itemKey: 13968, itemId: "810719", description: "26-5/8 x 54-1/4 Door Gasket For True", image: a, url: "/part/810719" },
|
|
125
|
+
{ itemKey: 14853, itemId: "932588", description: "23-3/8 x 26-3/4 Door Gasket For True", image: a, url: "/part/932588" },
|
|
126
|
+
{ itemKey: 435, itemId: "810803", description: "25-5/8 x 54-1/8 Door Gasket For True", image: a, url: "/part/810803" },
|
|
127
|
+
{ itemKey: 14622, itemId: "932587", description: "26-3/4 x 26-3/4 Door Gasket For True", image: a, url: "/part/932587" }
|
|
128
|
+
]
|
|
129
|
+
}, R = [
|
|
130
|
+
{ term: "door gasket", url: "/search/door-gasket" },
|
|
131
|
+
{ term: "walk-in cooler", url: "/search/walk-in-cooler" },
|
|
132
|
+
{ term: "thermostat", url: "/search/thermostat" }
|
|
133
|
+
], s = {
|
|
110
134
|
items: [
|
|
111
135
|
{ id: 1, itemId: "1094-01", description: "Kason Door Closer - Flush", price: "$99.99", quantity: 1, imageUrl: a, availability: "In Stock", availabilityId: "available" },
|
|
112
136
|
{ id: 2, itemId: "810810", description: "True Door Gasket", price: "$99.99", quantity: 1, imageUrl: a, availability: "In Stock", availabilityId: "available" },
|
|
@@ -122,36 +146,36 @@ const q = {
|
|
|
122
146
|
{ id: 12, itemId: "1092-02", description: "Kason Door Closer - Offset", price: "$99.99", quantity: 1, imageUrl: a, availability: "In Stock", availabilityId: "available" }
|
|
123
147
|
]
|
|
124
148
|
};
|
|
125
|
-
function
|
|
149
|
+
function f(e) {
|
|
126
150
|
return `$${e.items.reduce(
|
|
127
|
-
(
|
|
151
|
+
(o, r) => o + (parseFloat(r.price.replace(/[^0-9.]/g, "")) || 0) * r.quantity,
|
|
128
152
|
0
|
|
129
153
|
).toFixed(2)}`;
|
|
130
154
|
}
|
|
131
|
-
const
|
|
132
|
-
/* @__PURE__ */ t(
|
|
133
|
-
/* @__PURE__ */ t(
|
|
134
|
-
/* @__PURE__ */ t(
|
|
135
|
-
/* @__PURE__ */ t(
|
|
136
|
-
/* @__PURE__ */ t(
|
|
137
|
-
] }),
|
|
138
|
-
const [
|
|
139
|
-
return /* @__PURE__ */
|
|
155
|
+
const u = /* @__PURE__ */ y("div", { style: { display: "flex", flexDirection: "column", gap: 8, minWidth: 220 }, children: [
|
|
156
|
+
/* @__PURE__ */ t(p, { size: "sm", weight: "semibold", children: "Account" }),
|
|
157
|
+
/* @__PURE__ */ t(p, { size: "xs", children: "Signed in as Ringo" }),
|
|
158
|
+
/* @__PURE__ */ t(h, { href: "/account", "data-popover-close": "true", children: "View Account" }),
|
|
159
|
+
/* @__PURE__ */ t(h, { href: "/orders", "data-popover-close": "true", children: "Order History" }),
|
|
160
|
+
/* @__PURE__ */ t(S, { size: "sm", variant: "secondary", "data-popover-close": "true", onClick: () => alert("Sign out"), children: "Sign Out" })
|
|
161
|
+
] }), m = (e) => {
|
|
162
|
+
const [i, o] = g(!1);
|
|
163
|
+
return /* @__PURE__ */ y(k, { children: [
|
|
140
164
|
/* @__PURE__ */ t(
|
|
141
|
-
|
|
165
|
+
b,
|
|
142
166
|
{
|
|
143
167
|
...e,
|
|
144
|
-
open:
|
|
145
|
-
onCartClick: () =>
|
|
168
|
+
open: i,
|
|
169
|
+
onCartClick: () => o((r) => !r)
|
|
146
170
|
}
|
|
147
171
|
),
|
|
148
172
|
/* @__PURE__ */ t(
|
|
149
|
-
|
|
173
|
+
v,
|
|
150
174
|
{
|
|
151
|
-
open:
|
|
152
|
-
onClose: () =>
|
|
175
|
+
open: i,
|
|
176
|
+
onClose: () => o(!1),
|
|
153
177
|
cart: e.cart,
|
|
154
|
-
subtotal:
|
|
178
|
+
subtotal: f(e.cart),
|
|
155
179
|
itemPriceLabel: "List Price",
|
|
156
180
|
onItemQtyChange: () => alert("Qty Change"),
|
|
157
181
|
onItemDelete: () => alert("Delete"),
|
|
@@ -159,10 +183,34 @@ const d = /* @__PURE__ */ b("div", { style: { display: "flex", flexDirection: "c
|
|
|
159
183
|
}
|
|
160
184
|
)
|
|
161
185
|
] });
|
|
162
|
-
},
|
|
186
|
+
}, G = (e) => {
|
|
187
|
+
const [i, o] = g(""), [r, C] = g(R);
|
|
188
|
+
return /* @__PURE__ */ t(
|
|
189
|
+
b,
|
|
190
|
+
{
|
|
191
|
+
...e,
|
|
192
|
+
searchValue: i,
|
|
193
|
+
onClearSearch: () => o(""),
|
|
194
|
+
onSearch: (l) => alert(`Search for ${l}`),
|
|
195
|
+
searchSuggestions: i ? I : void 0,
|
|
196
|
+
recentSearches: r,
|
|
197
|
+
onClearRecentSearch: (l) => {
|
|
198
|
+
C((n) => n.filter((d) => d.url !== l.url));
|
|
199
|
+
},
|
|
200
|
+
searchInputProps: {
|
|
201
|
+
...e.searchInputProps,
|
|
202
|
+
value: i,
|
|
203
|
+
onChange: (l) => {
|
|
204
|
+
var n, d;
|
|
205
|
+
(d = (n = e.searchInputProps) == null ? void 0 : n.onChange) == null || d.call(n, l), o(l.target.value);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
);
|
|
210
|
+
}, A = {
|
|
163
211
|
args: {
|
|
164
212
|
account: { name: "Ringo", initials: "RS", number: "123456789012" },
|
|
165
|
-
cart:
|
|
213
|
+
cart: s,
|
|
166
214
|
homeRoute: "/",
|
|
167
215
|
customPartsRoute: "/custom",
|
|
168
216
|
onClickModelSerial: () => {
|
|
@@ -174,23 +222,20 @@ const d = /* @__PURE__ */ b("div", { style: { display: "flex", flexDirection: "c
|
|
|
174
222
|
onLoginClick: () => {
|
|
175
223
|
alert("Login");
|
|
176
224
|
},
|
|
177
|
-
onSearch: (e) => {
|
|
178
|
-
alert(`Search ${e}`);
|
|
179
|
-
},
|
|
180
225
|
onCategoryClick: (e) => {
|
|
181
226
|
alert(`Category ${e.label}`);
|
|
182
227
|
},
|
|
183
228
|
onCartClick: () => {
|
|
184
229
|
},
|
|
185
230
|
// placeholder required by component
|
|
186
|
-
categories:
|
|
187
|
-
accountPopoverContent:
|
|
231
|
+
categories: c,
|
|
232
|
+
accountPopoverContent: u
|
|
188
233
|
},
|
|
189
|
-
render:
|
|
190
|
-
},
|
|
234
|
+
render: m
|
|
235
|
+
}, F = {
|
|
191
236
|
args: {
|
|
192
237
|
account: { name: "Ringo", initials: "RS", number: "123456789012" },
|
|
193
|
-
cart:
|
|
238
|
+
cart: s,
|
|
194
239
|
homeRoute: "/",
|
|
195
240
|
customPartsRoute: "/custom",
|
|
196
241
|
onClickModelSerial: () => {
|
|
@@ -202,21 +247,19 @@ const d = /* @__PURE__ */ b("div", { style: { display: "flex", flexDirection: "c
|
|
|
202
247
|
onLoginClick: () => {
|
|
203
248
|
alert("Login");
|
|
204
249
|
},
|
|
205
|
-
onSearch: (e) => {
|
|
206
|
-
alert(`Search ${e}`);
|
|
207
|
-
},
|
|
208
250
|
onCategoryClick: (e) => {
|
|
209
251
|
alert(`Category ${e.label}`);
|
|
210
252
|
},
|
|
211
253
|
onCartClick: () => {
|
|
212
254
|
},
|
|
213
|
-
categories:
|
|
214
|
-
accountPopoverContent:
|
|
255
|
+
categories: c,
|
|
256
|
+
accountPopoverContent: u
|
|
215
257
|
},
|
|
216
|
-
render:
|
|
217
|
-
},
|
|
258
|
+
render: m
|
|
259
|
+
}, w = {
|
|
218
260
|
args: {
|
|
219
|
-
|
|
261
|
+
account: { name: "Ringo", initials: "RS", number: "123456789012" },
|
|
262
|
+
cart: s,
|
|
220
263
|
homeRoute: "/",
|
|
221
264
|
customPartsRoute: "/custom",
|
|
222
265
|
onClickModelSerial: () => {
|
|
@@ -228,21 +271,41 @@ const d = /* @__PURE__ */ b("div", { style: { display: "flex", flexDirection: "c
|
|
|
228
271
|
onLoginClick: () => {
|
|
229
272
|
alert("Login");
|
|
230
273
|
},
|
|
231
|
-
|
|
232
|
-
alert(`
|
|
274
|
+
onCategoryClick: (e) => {
|
|
275
|
+
alert(`Category ${e.label}`);
|
|
276
|
+
},
|
|
277
|
+
onCartClick: () => {
|
|
278
|
+
},
|
|
279
|
+
categories: c,
|
|
280
|
+
accountPopoverContent: u
|
|
281
|
+
},
|
|
282
|
+
render: G
|
|
283
|
+
}, K = {
|
|
284
|
+
args: {
|
|
285
|
+
cart: s,
|
|
286
|
+
homeRoute: "/",
|
|
287
|
+
customPartsRoute: "/custom",
|
|
288
|
+
onClickModelSerial: () => {
|
|
289
|
+
alert("Model/Serial");
|
|
290
|
+
},
|
|
291
|
+
faqRoute: "/faq",
|
|
292
|
+
aboutUsRoute: "/about",
|
|
293
|
+
contactRoute: "/contact",
|
|
294
|
+
onLoginClick: () => {
|
|
295
|
+
alert("Login");
|
|
233
296
|
},
|
|
234
297
|
onCategoryClick: (e) => {
|
|
235
298
|
alert(`Category ${e.label}`);
|
|
236
299
|
},
|
|
237
300
|
onCartClick: () => {
|
|
238
301
|
},
|
|
239
|
-
categories:
|
|
302
|
+
categories: c
|
|
240
303
|
},
|
|
241
|
-
render:
|
|
242
|
-
},
|
|
304
|
+
render: m
|
|
305
|
+
}, T = {
|
|
243
306
|
args: {
|
|
244
307
|
account: { name: "Ringo", initials: "RS", number: "123456789012" },
|
|
245
|
-
cart:
|
|
308
|
+
cart: s,
|
|
246
309
|
homeRoute: "/",
|
|
247
310
|
customPartsRoute: "/custom",
|
|
248
311
|
onClickModelSerial: () => {
|
|
@@ -254,25 +317,23 @@ const d = /* @__PURE__ */ b("div", { style: { display: "flex", flexDirection: "c
|
|
|
254
317
|
onLoginClick: () => {
|
|
255
318
|
alert("Login");
|
|
256
319
|
},
|
|
257
|
-
onSearch: (e) => {
|
|
258
|
-
alert(`Search ${e}`);
|
|
259
|
-
},
|
|
260
320
|
onCategoryClick: (e) => {
|
|
261
321
|
alert(`Category ${e.label}`);
|
|
262
322
|
},
|
|
263
323
|
onCartClick: () => {
|
|
264
324
|
},
|
|
265
|
-
categories:
|
|
266
|
-
accountPopoverContent:
|
|
325
|
+
categories: c,
|
|
326
|
+
accountPopoverContent: u,
|
|
267
327
|
isAccountLoading: !0,
|
|
268
328
|
isCategoriesLoading: !0
|
|
269
329
|
},
|
|
270
|
-
render:
|
|
330
|
+
render: m
|
|
271
331
|
};
|
|
272
332
|
export {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
333
|
+
A as Authenticated,
|
|
334
|
+
T as Loading,
|
|
335
|
+
K as Unauthenticated,
|
|
336
|
+
F as WithCartItems,
|
|
337
|
+
w as WithSearchSuggestions,
|
|
338
|
+
x as default
|
|
278
339
|
};
|
|
@@ -1,37 +1,38 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Image as
|
|
3
|
-
import { Text as
|
|
4
|
-
import { LinkButton as
|
|
5
|
-
import { Flex as
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { jsxs as n, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { Image as l } from "../../atoms/Image/Image.js";
|
|
3
|
+
import { Text as r } from "../../atoms/Text/Text.js";
|
|
4
|
+
import { LinkButton as t } from "../../atoms/LinkButton/LinkButton.js";
|
|
5
|
+
import { Flex as a } from "../../atoms/Flex/Flex.js";
|
|
6
|
+
import { n as c } from "../../not-found-DhBNR9yc.js";
|
|
7
|
+
import { c as m } from "../../clsx-OuTLNxxd.js";
|
|
8
|
+
import '../../assets/NotFound.css';const d = "_main_1dfh4_1", h = "_column_1dfh4_10", f = "_description_1dfh4_14", _ = "_header_1dfh4_19", p = "_links_1dfh4_24", e = {
|
|
9
|
+
main: d,
|
|
10
|
+
column: h,
|
|
11
|
+
description: f,
|
|
12
|
+
header: _,
|
|
12
13
|
links: p
|
|
13
14
|
};
|
|
14
|
-
function
|
|
15
|
-
primaryLinkButtonProps:
|
|
16
|
-
secondaryLinkButtonProps:
|
|
15
|
+
function b({
|
|
16
|
+
primaryLinkButtonProps: s,
|
|
17
|
+
secondaryLinkButtonProps: o
|
|
17
18
|
}) {
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
/* @__PURE__ */
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
-
/* @__PURE__ */
|
|
22
|
-
/* @__PURE__ */
|
|
19
|
+
return /* @__PURE__ */ n(a, { flexDirection: "row", alignItems: "center", justifyContent: "center", className: e.main, children: [
|
|
20
|
+
/* @__PURE__ */ i("div", { className: e.column, children: /* @__PURE__ */ i(l, { src: c, alt: "Not found image", width: 336, height: 392 }) }),
|
|
21
|
+
/* @__PURE__ */ n("div", { className: m(e.description, e.column), children: [
|
|
22
|
+
/* @__PURE__ */ i(r, { size: "6xl", variant: "display", as: "h1", className: e.header, children: "404" }),
|
|
23
|
+
/* @__PURE__ */ n(r, { size: "xl", children: [
|
|
23
24
|
"Oops! Well this is embarrassing...",
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
+
/* @__PURE__ */ i("br", {}),
|
|
25
26
|
"what you're looking for is missing or something is on the fritz."
|
|
26
27
|
] }),
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */
|
|
28
|
+
/* @__PURE__ */ i(r, { size: "xl", children: "Don't worry—for assistance call us at 1-800-421-0271" }),
|
|
29
|
+
/* @__PURE__ */ n("div", { className: e.links, children: [
|
|
30
|
+
/* @__PURE__ */ i(t, { variant: "primary", size: "md", href: s.href, children: s.label }),
|
|
31
|
+
/* @__PURE__ */ i(t, { variant: "secondary", size: "md", href: o.href, children: o.label })
|
|
31
32
|
] })
|
|
32
33
|
] })
|
|
33
34
|
] });
|
|
34
35
|
}
|
|
35
36
|
export {
|
|
36
|
-
|
|
37
|
+
b as NotFound
|
|
37
38
|
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { IconProps } from '../../atoms/Icon/Icon';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export type StatusPageActionProps = {
|
|
4
|
+
label: string;
|
|
5
|
+
href: string;
|
|
6
|
+
iconKey?: IconProps['iconKey'];
|
|
7
|
+
};
|
|
8
|
+
export interface StatusPageProps {
|
|
9
|
+
statusCode: string;
|
|
10
|
+
heading: string;
|
|
11
|
+
description: ReactNode;
|
|
12
|
+
illustrationSrc?: string;
|
|
13
|
+
illustrationAlt: string;
|
|
14
|
+
illustrationWidth?: number;
|
|
15
|
+
illustrationHeight?: number;
|
|
16
|
+
statusLabel?: string;
|
|
17
|
+
statusLabelIconKey?: IconProps['iconKey'];
|
|
18
|
+
illustrationCaption?: ReactNode;
|
|
19
|
+
calloutTitle?: string;
|
|
20
|
+
calloutDescription?: ReactNode;
|
|
21
|
+
calloutIconKey?: IconProps['iconKey'];
|
|
22
|
+
primaryLinkButtonProps: StatusPageActionProps;
|
|
23
|
+
secondaryLinkButtonProps?: StatusPageActionProps;
|
|
24
|
+
primaryFirst?: boolean;
|
|
25
|
+
helpText?: ReactNode;
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare function StatusPage({ statusCode, heading, description, illustrationSrc, illustrationAlt, illustrationWidth, illustrationHeight, statusLabel, statusLabelIconKey, illustrationCaption, calloutTitle, calloutDescription, calloutIconKey, primaryLinkButtonProps, secondaryLinkButtonProps, primaryFirst, helpText, className, }: StatusPageProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { jsxs as a, jsx as e, Fragment as f } from "react/jsx-runtime";
|
|
2
|
+
import { Flex as u } from "../../atoms/Flex/Flex.js";
|
|
3
|
+
import { Icon as t } from "../../atoms/Icon/Icon.js";
|
|
4
|
+
import { Image as y } from "../../atoms/Image/Image.js";
|
|
5
|
+
import { LinkButton as c } from "../../atoms/LinkButton/LinkButton.js";
|
|
6
|
+
import { Pill as R } from "../../atoms/Pill/Pill.js";
|
|
7
|
+
import { Text as s } from "../../atoms/Text/Text.js";
|
|
8
|
+
import { c as T } from "../../clsx-OuTLNxxd.js";
|
|
9
|
+
import { n as j } from "../../not-found-DhBNR9yc.js";
|
|
10
|
+
import '../../assets/StatusPage.css';const F = "_main_1t7pe_1", I = "_visual_1t7pe_10", S = "_content_1t7pe_44", q = "_statusCode_1t7pe_64", A = "_heading_1t7pe_70", E = "_badge_1t7pe_74", G = "_badgeContent_1t7pe_82", H = "_calloutTitle_1t7pe_83", J = "_actionContent_1t7pe_84", M = "_helpRow_1t7pe_85", O = "_illustration_1t7pe_91", Q = "_illustrationCaption_1t7pe_99", U = "_callout_1t7pe_83", V = "_actions_1t7pe_117", W = "_help_1t7pe_85", i = {
|
|
11
|
+
main: F,
|
|
12
|
+
visual: I,
|
|
13
|
+
content: S,
|
|
14
|
+
statusCode: q,
|
|
15
|
+
heading: A,
|
|
16
|
+
badge: E,
|
|
17
|
+
badgeContent: G,
|
|
18
|
+
calloutTitle: H,
|
|
19
|
+
actionContent: J,
|
|
20
|
+
helpRow: M,
|
|
21
|
+
illustration: O,
|
|
22
|
+
illustrationCaption: Q,
|
|
23
|
+
callout: U,
|
|
24
|
+
actions: V,
|
|
25
|
+
help: W
|
|
26
|
+
};
|
|
27
|
+
function ee({
|
|
28
|
+
statusCode: g,
|
|
29
|
+
heading: p,
|
|
30
|
+
description: z,
|
|
31
|
+
illustrationSrc: C = j,
|
|
32
|
+
illustrationAlt: v,
|
|
33
|
+
illustrationWidth: N = 336,
|
|
34
|
+
illustrationHeight: x = 392,
|
|
35
|
+
statusLabel: h,
|
|
36
|
+
statusLabelIconKey: m,
|
|
37
|
+
illustrationCaption: r,
|
|
38
|
+
calloutTitle: o,
|
|
39
|
+
calloutDescription: d,
|
|
40
|
+
calloutIconKey: K = "fa-solid fa-circle-info",
|
|
41
|
+
primaryLinkButtonProps: n,
|
|
42
|
+
secondaryLinkButtonProps: l,
|
|
43
|
+
primaryFirst: b = !0,
|
|
44
|
+
helpText: _,
|
|
45
|
+
className: w
|
|
46
|
+
}) {
|
|
47
|
+
return /* @__PURE__ */ a(u, { flexDirection: "row", alignItems: "stretch", justifyContent: "center", className: T(i.main, w), children: [
|
|
48
|
+
/* @__PURE__ */ a("div", { className: i.visual, children: [
|
|
49
|
+
h && /* @__PURE__ */ e(R, { size: "sm", className: i.badge, children: /* @__PURE__ */ a("span", { className: i.badgeContent, children: [
|
|
50
|
+
m && /* @__PURE__ */ e(t, { iconKey: m, size: "xs" }),
|
|
51
|
+
h
|
|
52
|
+
] }) }),
|
|
53
|
+
/* @__PURE__ */ e(
|
|
54
|
+
y,
|
|
55
|
+
{
|
|
56
|
+
src: C,
|
|
57
|
+
alt: v,
|
|
58
|
+
width: N,
|
|
59
|
+
height: x,
|
|
60
|
+
className: i.illustration
|
|
61
|
+
}
|
|
62
|
+
),
|
|
63
|
+
r && /* @__PURE__ */ e(s, { size: "sm", className: i.illustrationCaption, children: r })
|
|
64
|
+
] }),
|
|
65
|
+
/* @__PURE__ */ a("div", { className: i.content, children: [
|
|
66
|
+
/* @__PURE__ */ a("div", { children: [
|
|
67
|
+
/* @__PURE__ */ e(s, { size: "6xl", weight: "bold", variant: "display", as: "div", className: i.statusCode, children: g }),
|
|
68
|
+
/* @__PURE__ */ e(s, { size: "3xl", weight: "bold", variant: "display", as: "div", className: i.heading, children: p })
|
|
69
|
+
] }),
|
|
70
|
+
/* @__PURE__ */ e(s, { size: "xl", children: z }),
|
|
71
|
+
(o || d) && /* @__PURE__ */ a("div", { className: i.callout, children: [
|
|
72
|
+
o && /* @__PURE__ */ a(s, { size: "lg", weight: "bold", className: i.calloutTitle, children: [
|
|
73
|
+
/* @__PURE__ */ e(t, { iconKey: K, colorToken: "secondary", size: "xs" }),
|
|
74
|
+
o
|
|
75
|
+
] }),
|
|
76
|
+
d && /* @__PURE__ */ e(s, { size: "md", children: d })
|
|
77
|
+
] }),
|
|
78
|
+
/* @__PURE__ */ e("div", { className: i.actions, children: b ? /* @__PURE__ */ a(f, { children: [
|
|
79
|
+
/* @__PURE__ */ e(c, { variant: "primary", size: "md", href: n.href, children: /* @__PURE__ */ a("span", { className: i.actionContent, children: [
|
|
80
|
+
n.iconKey && /* @__PURE__ */ e(t, { iconKey: n.iconKey, size: "xs" }),
|
|
81
|
+
n.label
|
|
82
|
+
] }) }),
|
|
83
|
+
l && /* @__PURE__ */ e(c, { variant: "secondary", size: "md", href: l.href, children: /* @__PURE__ */ a("span", { className: i.actionContent, children: [
|
|
84
|
+
l.iconKey && /* @__PURE__ */ e(t, { iconKey: l.iconKey, size: "xs" }),
|
|
85
|
+
l.label
|
|
86
|
+
] }) })
|
|
87
|
+
] }) : /* @__PURE__ */ a(f, { children: [
|
|
88
|
+
l && /* @__PURE__ */ e(c, { variant: "secondary", size: "md", href: l.href, children: /* @__PURE__ */ a("span", { className: i.actionContent, children: [
|
|
89
|
+
l.iconKey && /* @__PURE__ */ e(t, { iconKey: l.iconKey, size: "xs" }),
|
|
90
|
+
l.label
|
|
91
|
+
] }) }),
|
|
92
|
+
/* @__PURE__ */ e(c, { variant: "primary", size: "md", href: n.href, children: /* @__PURE__ */ a("span", { className: i.actionContent, children: [
|
|
93
|
+
n.iconKey && /* @__PURE__ */ e(t, { iconKey: n.iconKey, size: "xs" }),
|
|
94
|
+
n.label
|
|
95
|
+
] }) })
|
|
96
|
+
] }) }),
|
|
97
|
+
_ && /* @__PURE__ */ e("div", { className: i.help, children: /* @__PURE__ */ a(s, { size: "sm", className: i.helpRow, children: [
|
|
98
|
+
/* @__PURE__ */ e(t, { iconKey: "fa-solid fa-circle-info", colorToken: "secondary", size: "xs" }),
|
|
99
|
+
_
|
|
100
|
+
] }) })
|
|
101
|
+
] })
|
|
102
|
+
] });
|
|
103
|
+
}
|
|
104
|
+
export {
|
|
105
|
+
ee as StatusPage
|
|
106
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { StatusPage } from './StatusPage';
|
|
3
|
+
declare const meta: Meta<typeof StatusPage>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const NotFound404: Story;
|
|
7
|
+
export declare const Unauthorized403: Story;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { StatusPage as a } from "./StatusPage.js";
|
|
3
|
+
import { n as e } from "../../not-found-DhBNR9yc.js";
|
|
4
|
+
const n = {
|
|
5
|
+
title: "Case Parts/Organisms/StatusPage",
|
|
6
|
+
component: a,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: "fullscreen",
|
|
10
|
+
docs: {
|
|
11
|
+
description: {
|
|
12
|
+
component: [
|
|
13
|
+
"Reusable status layout for pages like 404 (not found) and 403 (unauthorized).",
|
|
14
|
+
"Use this component to keep status page structure consistent while varying copy, callouts, and actions.",
|
|
15
|
+
"",
|
|
16
|
+
"Required props: statusCode, heading, description, illustrationAlt, primaryLinkButtonProps.",
|
|
17
|
+
"Optional props: illustrationSrc, statusLabel, statusLabelIconKey, illustrationCaption, calloutTitle, calloutDescription,",
|
|
18
|
+
"calloutIconKey, secondaryLinkButtonProps, primaryFirst, helpText."
|
|
19
|
+
].join(" ")
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
decorators: [
|
|
24
|
+
(o) => /* @__PURE__ */ t("div", { style: { padding: "32px 24px", display: "flex", justifyContent: "center" }, children: /* @__PURE__ */ t("div", { style: { width: "100%", maxWidth: "1130px" }, children: /* @__PURE__ */ t(o, {}) }) })
|
|
25
|
+
]
|
|
26
|
+
}, l = {
|
|
27
|
+
args: {
|
|
28
|
+
statusCode: "404",
|
|
29
|
+
statusLabel: "Page Not Found",
|
|
30
|
+
statusLabelIconKey: "fa-solid fa-magnifying-glass",
|
|
31
|
+
heading: "We couldn't find that page",
|
|
32
|
+
description: "The page may have moved, the address may be incorrect, or the content may no longer be available.",
|
|
33
|
+
illustrationSrc: e,
|
|
34
|
+
illustrationAlt: "Page not found",
|
|
35
|
+
illustrationCaption: "The requested page could not be located on CaseParts.com.",
|
|
36
|
+
calloutTitle: "What can I do?",
|
|
37
|
+
calloutDescription: "Check the address and try again, search for a part, or use one of the options below to continue.",
|
|
38
|
+
primaryLinkButtonProps: {
|
|
39
|
+
label: "Return to CaseParts.com",
|
|
40
|
+
href: "/",
|
|
41
|
+
iconKey: "fa-solid fa-house"
|
|
42
|
+
},
|
|
43
|
+
secondaryLinkButtonProps: {
|
|
44
|
+
label: "Go to My Account",
|
|
45
|
+
href: "/account",
|
|
46
|
+
iconKey: "fa-regular fa-user"
|
|
47
|
+
},
|
|
48
|
+
primaryFirst: !0,
|
|
49
|
+
helpText: "Still need help? Email hello@caseparts.com or call 1-800-421-0271."
|
|
50
|
+
}
|
|
51
|
+
}, c = {
|
|
52
|
+
args: {
|
|
53
|
+
statusCode: "403",
|
|
54
|
+
statusLabel: "Restricted Area",
|
|
55
|
+
statusLabelIconKey: "fa-solid fa-shield",
|
|
56
|
+
heading: "Unauthorized access",
|
|
57
|
+
description: "Your account is signed in, but it does not currently have the permissions required to view this content.",
|
|
58
|
+
illustrationSrc: e,
|
|
59
|
+
illustrationAlt: "Restricted access",
|
|
60
|
+
illustrationCaption: "This page is available only to users with the required account permissions.",
|
|
61
|
+
calloutTitle: "Why am I seeing this?",
|
|
62
|
+
calloutDescription: "Access may be limited by your company administrator, account role, or the permissions assigned to your CaseParts user.",
|
|
63
|
+
primaryLinkButtonProps: {
|
|
64
|
+
label: "Go to My Account",
|
|
65
|
+
href: "/account",
|
|
66
|
+
iconKey: "fa-regular fa-user"
|
|
67
|
+
},
|
|
68
|
+
secondaryLinkButtonProps: {
|
|
69
|
+
label: "Return to CaseParts.com",
|
|
70
|
+
href: "/",
|
|
71
|
+
iconKey: "fa-solid fa-house"
|
|
72
|
+
},
|
|
73
|
+
primaryFirst: !0,
|
|
74
|
+
helpText: "Need access? Contact your company administrator or email hello@caseparts.com. You can also call 1-800-421-0271."
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
export {
|
|
78
|
+
l as NotFound404,
|
|
79
|
+
c as Unauthorized403,
|
|
80
|
+
n as default
|
|
81
|
+
};
|
|
@@ -2,6 +2,10 @@ export type SuggestedCategory = {
|
|
|
2
2
|
name: string;
|
|
3
3
|
url: string;
|
|
4
4
|
};
|
|
5
|
+
export type SuggestedTerm = {
|
|
6
|
+
name: string;
|
|
7
|
+
url: string;
|
|
8
|
+
};
|
|
5
9
|
export type SuggestedItem = {
|
|
6
10
|
itemKey: number;
|
|
7
11
|
itemId: string;
|
|
@@ -9,10 +13,17 @@ export type SuggestedItem = {
|
|
|
9
13
|
image: string;
|
|
10
14
|
url: string;
|
|
11
15
|
};
|
|
16
|
+
export type RecentSearch = {
|
|
17
|
+
term: string;
|
|
18
|
+
url: string;
|
|
19
|
+
};
|
|
12
20
|
export interface SuggestionDropdownProps {
|
|
13
|
-
|
|
21
|
+
view?: "suggestions" | "recent-searches";
|
|
22
|
+
terms: SuggestedTerm[];
|
|
14
23
|
categories: SuggestedCategory[];
|
|
15
24
|
items: SuggestedItem[];
|
|
25
|
+
recentSearches?: RecentSearch[];
|
|
26
|
+
onClearRecentSearch?: (_recentSearch: RecentSearch) => void;
|
|
16
27
|
className?: string;
|
|
17
28
|
}
|
|
18
|
-
export declare function SuggestionDropdown({ terms
|
|
29
|
+
export declare function SuggestionDropdown({ terms, categories, items, view, recentSearches, onClearRecentSearch, className }: SuggestionDropdownProps): import("react/jsx-runtime").JSX.Element;
|