@caseparts-org/caseblocks 0.0.109 → 0.0.111
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/Account.css +1 -1
- package/dist/assets/CategoryNav.css +1 -1
- package/dist/molecules/Account/Account.d.ts +3 -1
- package/dist/molecules/Account/Account.js +84 -41
- package/dist/molecules/Account/Account.stories.js +4 -6
- package/dist/molecules/Avatar/Avatar.d.ts +0 -1
- package/dist/molecules/Avatar/Avatar.js +21 -22
- package/dist/molecules/Avatar/Avatar.stories.js +1 -2
- package/dist/molecules/CategoryNav/CategoryNav.d.ts +2 -1
- package/dist/molecules/CategoryNav/CategoryNav.js +25 -23
- package/dist/organisms/MainNav/MainNav.d.ts +4 -1
- package/dist/organisms/MainNav/MainNav.js +46 -43
- package/dist/organisms/MainNav/MainNav.stories.d.ts +1 -0
- package/dist/organisms/MainNav/MainNav.stories.js +69 -34
- package/package.json +1 -1
package/dist/assets/Account.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._loggedIn_w7zna_1{flex-shrink:0;gap:var(--spacing-spacing-2xs);cursor:pointer;transition:all .3s linear;display:flex;flex-direction:row;align-items:center;justify-content:center;padding:var(--spacing-spacing-3xs)}._customer_w7zna_12>a,._customer_w7zna_12>a:hover{text-decoration:none}._loggedIn_w7zna_1:hover{background-color:#f3f3f3;border-radius:var(--border-radius-md)}._placeholder_w7zna_21{height:30px;width:120px}@media (max-width:1280px){._placeholder_w7zna_21{width:30px;height:30px}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._categories_19tew_1{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:0;margin:0 90px 0 47px}@media (max-width: 1281px){._categories_19tew_1{display:none}}._placeholder_19tew_17{height:24px;width:100%}@media (max-width:1280px){._placeholder_19tew_17{display:none}}._category_19tew_25{list-style:none}._category_19tew_25 a{color:var(--text-text-primary);font-weight:var(--font-weight-semibold);text-decoration:none;display:flex;flex-direction:row;align-items:center}@media (max-width: 1281px){._category_19tew_25 a{justify-content:space-between;width:100%}}._category_19tew_25 a:hover{color:var(--color-brand-primary-primary-teal-blue);text-decoration:none}._category_19tew_25 a path{fill:var(--color-brand-primary-primary-teal-blue)}._submenuTooltip_19tew_51{list-style:none;padding:0;margin:0;height:min-content;display:flex;flex-direction:column;gap:var(--spacing-spacing-3xs);flex-wrap:wrap;max-height:400px}
|
|
@@ -10,7 +10,9 @@ export interface AccountProps extends React.HTMLAttributes<HTMLDivElement>, Hide
|
|
|
10
10
|
/** The account user's initials. */
|
|
11
11
|
initials: string;
|
|
12
12
|
};
|
|
13
|
-
accountRoute: string;
|
|
14
13
|
onLoginClick: () => void;
|
|
14
|
+
/** Optional content to show when clicking the authenticated container */
|
|
15
|
+
popoverContent?: React.ReactNode;
|
|
16
|
+
isAccountLoading?: boolean;
|
|
15
17
|
}
|
|
16
18
|
export declare function Account(props: AccountProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,36 +1,72 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as o, jsxs as n } from "react/jsx-runtime";
|
|
2
2
|
import { getHideAtStyles as a } from "../../atoms/HideAt.js";
|
|
3
3
|
import { Icon as f } from "../../atoms/Icon/Icon.js";
|
|
4
|
-
import { Text as
|
|
4
|
+
import { Text as c } from "../../atoms/Text/Text.js";
|
|
5
5
|
import { Avatar as h } from "../Avatar/Avatar.js";
|
|
6
6
|
import { Flex as d } from "../../atoms/Flex/Flex.js";
|
|
7
|
-
import { Button as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import '../../assets/Account.css';const
|
|
11
|
-
loggedIn:
|
|
12
|
-
customer:
|
|
7
|
+
import { Button as p } from "../../atoms/Button/Button.js";
|
|
8
|
+
import { Popover as A } from "../../atoms/Popover/Popover.js";
|
|
9
|
+
import { c as g } from "../../clsx-OuTLNxxd.js";
|
|
10
|
+
import '../../assets/Account.css';const x = "_loggedIn_w7zna_1", v = "_customer_w7zna_12", I = "_placeholder_w7zna_21", t = {
|
|
11
|
+
loggedIn: x,
|
|
12
|
+
customer: v,
|
|
13
|
+
placeholder: I
|
|
13
14
|
};
|
|
14
|
-
function
|
|
15
|
-
return
|
|
15
|
+
function z(i) {
|
|
16
|
+
return i.account !== void 0;
|
|
16
17
|
}
|
|
17
|
-
function
|
|
18
|
-
return
|
|
18
|
+
function T(i) {
|
|
19
|
+
return i.isAccountLoading ? /* @__PURE__ */ o("div", { className: t.placeholder }) : z(i) ? /* @__PURE__ */ o(_, { ...i }) : /* @__PURE__ */ o(N, { ...i });
|
|
19
20
|
}
|
|
20
|
-
function
|
|
21
|
+
function _(i) {
|
|
21
22
|
const {
|
|
22
|
-
account:
|
|
23
|
-
accountRoute: o,
|
|
24
|
-
onLoginClick: m,
|
|
23
|
+
account: e,
|
|
25
24
|
className: r,
|
|
26
|
-
hideAt:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
hideAt: s,
|
|
26
|
+
popoverContent: m,
|
|
27
|
+
isAccountLoading: u,
|
|
28
|
+
...l
|
|
29
|
+
} = i;
|
|
30
|
+
return m ? /* @__PURE__ */ o(
|
|
31
|
+
A,
|
|
32
|
+
{
|
|
33
|
+
position: "bottom right",
|
|
34
|
+
trigger: /* @__PURE__ */ n(
|
|
35
|
+
"div",
|
|
36
|
+
{
|
|
37
|
+
className: g(t.loggedIn, a(s), r),
|
|
38
|
+
...l,
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ n(
|
|
41
|
+
d,
|
|
42
|
+
{
|
|
43
|
+
flexDirection: "column",
|
|
44
|
+
alignItems: "flex-end",
|
|
45
|
+
hideAt: ["sm", "md"],
|
|
46
|
+
className: t.customer,
|
|
47
|
+
children: [
|
|
48
|
+
/* @__PURE__ */ n(c, { size: "xxs", children: [
|
|
49
|
+
"Acct: ",
|
|
50
|
+
e == null ? void 0 : e.number
|
|
51
|
+
] }),
|
|
52
|
+
/* @__PURE__ */ n(c, { size: "sm", variant: "display", colorToken: "links", children: [
|
|
53
|
+
"Hello ",
|
|
54
|
+
e == null ? void 0 : e.name
|
|
55
|
+
] })
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
),
|
|
59
|
+
/* @__PURE__ */ o(h, { initials: e.initials })
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
),
|
|
63
|
+
children: m
|
|
64
|
+
}
|
|
65
|
+
) : /* @__PURE__ */ n(
|
|
30
66
|
"div",
|
|
31
67
|
{
|
|
32
|
-
className:
|
|
33
|
-
...
|
|
68
|
+
className: g(t.loggedIn, a(s), r),
|
|
69
|
+
...l,
|
|
34
70
|
children: [
|
|
35
71
|
/* @__PURE__ */ n(
|
|
36
72
|
d,
|
|
@@ -38,53 +74,60 @@ function k(e) {
|
|
|
38
74
|
flexDirection: "column",
|
|
39
75
|
alignItems: "flex-end",
|
|
40
76
|
hideAt: ["sm", "md"],
|
|
41
|
-
className:
|
|
77
|
+
className: t.customer,
|
|
42
78
|
children: [
|
|
43
|
-
/* @__PURE__ */ n(
|
|
79
|
+
/* @__PURE__ */ n(c, { size: "xxs", children: [
|
|
44
80
|
"Acct: ",
|
|
45
|
-
|
|
81
|
+
e == null ? void 0 : e.number
|
|
46
82
|
] }),
|
|
47
|
-
/* @__PURE__ */
|
|
83
|
+
/* @__PURE__ */ n(c, { size: "sm", variant: "display", colorToken: "links", children: [
|
|
48
84
|
"Hello ",
|
|
49
|
-
|
|
50
|
-
] })
|
|
85
|
+
e == null ? void 0 : e.name
|
|
86
|
+
] })
|
|
51
87
|
]
|
|
52
88
|
}
|
|
53
89
|
),
|
|
54
|
-
/* @__PURE__ */
|
|
90
|
+
/* @__PURE__ */ o(h, { initials: e.initials })
|
|
55
91
|
]
|
|
56
92
|
}
|
|
57
93
|
);
|
|
58
94
|
}
|
|
59
|
-
function
|
|
60
|
-
const {
|
|
95
|
+
function N(i) {
|
|
96
|
+
const {
|
|
97
|
+
onLoginClick: e,
|
|
98
|
+
className: r,
|
|
99
|
+
hideAt: s,
|
|
100
|
+
popoverContent: m,
|
|
101
|
+
isAccountLoading: u,
|
|
102
|
+
...l
|
|
103
|
+
} = i;
|
|
61
104
|
return /* @__PURE__ */ n(
|
|
62
105
|
d,
|
|
63
106
|
{
|
|
64
107
|
flexDirection: "row",
|
|
65
108
|
alignItems: "center",
|
|
66
|
-
...
|
|
67
|
-
className:
|
|
68
|
-
|
|
69
|
-
a(
|
|
70
|
-
|
|
109
|
+
...l,
|
|
110
|
+
className: g(
|
|
111
|
+
t.unauthenticated,
|
|
112
|
+
a(s),
|
|
113
|
+
r
|
|
71
114
|
),
|
|
72
115
|
children: [
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
-
|
|
116
|
+
/* @__PURE__ */ o(
|
|
117
|
+
p,
|
|
75
118
|
{
|
|
76
|
-
onClick:
|
|
119
|
+
onClick: e,
|
|
77
120
|
size: "sm",
|
|
78
121
|
variant: "primary",
|
|
79
122
|
hideAt: ["sm", "md"],
|
|
80
123
|
children: "Sign In / Register"
|
|
81
124
|
}
|
|
82
125
|
),
|
|
83
|
-
/* @__PURE__ */
|
|
126
|
+
/* @__PURE__ */ o(f, { iconKey: "fa-kit fa-user-anon", size: "lg", hideAt: "lg" })
|
|
84
127
|
]
|
|
85
128
|
}
|
|
86
129
|
);
|
|
87
130
|
}
|
|
88
131
|
export {
|
|
89
|
-
|
|
132
|
+
T as Account
|
|
90
133
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Account as t } from "./Account.js";
|
|
2
|
-
const
|
|
2
|
+
const o = {
|
|
3
3
|
title: "Case Parts/Molecules/Account",
|
|
4
4
|
component: t,
|
|
5
5
|
parameters: {
|
|
@@ -8,9 +8,8 @@ const c = {
|
|
|
8
8
|
},
|
|
9
9
|
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
10
10
|
tags: ["autodocs"]
|
|
11
|
-
},
|
|
11
|
+
}, e = {
|
|
12
12
|
args: {
|
|
13
|
-
accountRoute: "/account",
|
|
14
13
|
onLoginClick: () => {
|
|
15
14
|
}
|
|
16
15
|
}
|
|
@@ -21,13 +20,12 @@ const c = {
|
|
|
21
20
|
initials: "RS",
|
|
22
21
|
number: "123456789012"
|
|
23
22
|
},
|
|
24
|
-
accountRoute: "/account",
|
|
25
23
|
onLoginClick: () => {
|
|
26
24
|
}
|
|
27
25
|
}
|
|
28
26
|
};
|
|
29
27
|
export {
|
|
30
28
|
a as Authenticated,
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
e as Unauthenticated,
|
|
30
|
+
o as default
|
|
33
31
|
};
|
|
@@ -2,6 +2,5 @@ import { HideAtProps } from '../../atoms/HideAt';
|
|
|
2
2
|
export interface AvatarProps extends React.HTMLAttributes<HTMLDivElement>, HideAtProps {
|
|
3
3
|
/** The user's initials (2 characters) */
|
|
4
4
|
initials: string;
|
|
5
|
-
accountRoute: string;
|
|
6
5
|
}
|
|
7
6
|
export declare function Avatar(props: AvatarProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,32 +1,31 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Flex as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
avatar: p
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { Flex as n } from "../../atoms/Flex/Flex.js";
|
|
3
|
+
import { getHideAtStyles as m } from "../../atoms/HideAt.js";
|
|
4
|
+
import { c } from "../../clsx-OuTLNxxd.js";
|
|
5
|
+
import { t } from "../../Text.module-Dzhzk2fH.js";
|
|
6
|
+
import '../../assets/Avatar.css';const l = "_avatar_nvnsd_1", f = {
|
|
7
|
+
avatar: l
|
|
9
8
|
};
|
|
10
|
-
function
|
|
11
|
-
const {
|
|
12
|
-
return /* @__PURE__ */
|
|
13
|
-
|
|
9
|
+
function u(r) {
|
|
10
|
+
const { initials: e, className: a, hideAt: s, ...i } = r;
|
|
11
|
+
return /* @__PURE__ */ o(
|
|
12
|
+
n,
|
|
14
13
|
{
|
|
15
14
|
flexDirection: "row",
|
|
16
15
|
alignItems: "center",
|
|
17
16
|
justifyContent: "center",
|
|
18
|
-
className:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
className: c(
|
|
18
|
+
f.avatar,
|
|
19
|
+
t["text-display"],
|
|
20
|
+
t["text-md"],
|
|
21
|
+
m(s),
|
|
22
|
+
a
|
|
24
23
|
),
|
|
25
|
-
...
|
|
26
|
-
children:
|
|
24
|
+
...i,
|
|
25
|
+
children: e.substring(0, 2)
|
|
27
26
|
}
|
|
28
|
-
)
|
|
27
|
+
);
|
|
29
28
|
}
|
|
30
29
|
export {
|
|
31
|
-
|
|
30
|
+
u as Avatar
|
|
32
31
|
};
|
|
@@ -7,6 +7,7 @@ export interface CategoryWithChildren extends Category {
|
|
|
7
7
|
children: Category[];
|
|
8
8
|
showChevron?: boolean;
|
|
9
9
|
}
|
|
10
|
-
export declare function CategoryNav({ categories, }: {
|
|
10
|
+
export declare function CategoryNav({ categories, isCategoriesLoading, }: {
|
|
11
11
|
categories?: CategoryWithChildren[];
|
|
12
|
+
isCategoriesLoading?: boolean;
|
|
12
13
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,28 +1,30 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { c
|
|
3
|
-
import { Text as
|
|
1
|
+
import { jsx as e, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
import { c } from "../../clsx-OuTLNxxd.js";
|
|
3
|
+
import { Text as t } from "../../atoms/Text/Text.js";
|
|
4
4
|
import { Link as s } from "../../atoms/Link/Link.js";
|
|
5
5
|
import { Icon as m } from "../../atoms/Icon/Icon.js";
|
|
6
|
-
import { getHideAtStyles as
|
|
7
|
-
import { Tooltip as
|
|
8
|
-
import '../../assets/CategoryNav.css';const
|
|
9
|
-
categories:
|
|
6
|
+
import { getHideAtStyles as d } from "../../atoms/HideAt.js";
|
|
7
|
+
import { Tooltip as h } from "../../atoms/Tooltip/Tooltip.js";
|
|
8
|
+
import '../../assets/CategoryNav.css';const p = "_categories_19tew_1", u = "_placeholder_19tew_17", f = "_category_19tew_25", b = "_submenuTooltip_19tew_51", i = {
|
|
9
|
+
categories: p,
|
|
10
|
+
placeholder: u,
|
|
10
11
|
category: f,
|
|
11
|
-
submenuTooltip:
|
|
12
|
+
submenuTooltip: b
|
|
12
13
|
};
|
|
13
|
-
function
|
|
14
|
-
categories:
|
|
14
|
+
function v({
|
|
15
|
+
categories: o,
|
|
16
|
+
isCategoriesLoading: a
|
|
15
17
|
}) {
|
|
16
|
-
return !
|
|
17
|
-
(
|
|
18
|
-
|
|
18
|
+
return a ? /* @__PURE__ */ e("div", { className: i.placeholder }) : !o || o.length === 0 ? null : /* @__PURE__ */ e("ul", { className: c(i.categories, d(["sm"])), children: o.map(
|
|
19
|
+
(l) => l.children.length > 0 ? /* @__PURE__ */ e(
|
|
20
|
+
h,
|
|
19
21
|
{
|
|
20
22
|
openDelay: 180,
|
|
21
23
|
closeDelay: 0,
|
|
22
24
|
tooltipOffset: 0,
|
|
23
|
-
trigger: /* @__PURE__ */ e("li", { className:
|
|
24
|
-
/* @__PURE__ */ e(
|
|
25
|
-
|
|
25
|
+
trigger: /* @__PURE__ */ e("li", { className: i.category, tabIndex: 0, children: /* @__PURE__ */ n(s, { href: l.route, children: [
|
|
26
|
+
/* @__PURE__ */ e(t, { size: "sm", weight: "semibold", children: l.label }),
|
|
27
|
+
l.showChevron && /* @__PURE__ */ e(
|
|
26
28
|
m,
|
|
27
29
|
{
|
|
28
30
|
iconKey: "fa-regular fa-angle-down",
|
|
@@ -32,12 +34,12 @@ function z({
|
|
|
32
34
|
)
|
|
33
35
|
] }) }),
|
|
34
36
|
position: "bottom center",
|
|
35
|
-
children: /* @__PURE__ */ e("ul", { className:
|
|
37
|
+
children: /* @__PURE__ */ e("ul", { className: i.submenuTooltip, children: l.children.map((r) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(s, { href: r.route, children: /* @__PURE__ */ e(t, { size: "sm", weight: "semibold", children: r.label }) }) }, r.id)) })
|
|
36
38
|
},
|
|
37
|
-
|
|
38
|
-
) : /* @__PURE__ */ e("li", { className:
|
|
39
|
-
/* @__PURE__ */ e(
|
|
40
|
-
|
|
39
|
+
l.id
|
|
40
|
+
) : /* @__PURE__ */ e("li", { className: i.category, children: /* @__PURE__ */ n(s, { href: l.route, children: [
|
|
41
|
+
/* @__PURE__ */ e(t, { size: "sm", weight: "semibold", children: l.label }),
|
|
42
|
+
l.showChevron && /* @__PURE__ */ e(
|
|
41
43
|
m,
|
|
42
44
|
{
|
|
43
45
|
iconKey: "fa-regular fa-angle-down",
|
|
@@ -45,9 +47,9 @@ function z({
|
|
|
45
47
|
size: "sm"
|
|
46
48
|
}
|
|
47
49
|
)
|
|
48
|
-
] }) },
|
|
50
|
+
] }) }, l.id)
|
|
49
51
|
) });
|
|
50
52
|
}
|
|
51
53
|
export {
|
|
52
|
-
|
|
54
|
+
v as CategoryNav
|
|
53
55
|
};
|
|
@@ -8,12 +8,15 @@ export interface MainNavProps extends CartPropsBase, React.HTMLAttributes<HTMLDi
|
|
|
8
8
|
faqRoute: string;
|
|
9
9
|
customPartsRoute: string;
|
|
10
10
|
aboutUsRoute: string;
|
|
11
|
-
accountRoute: string;
|
|
12
11
|
contactRoute: string;
|
|
13
12
|
cart: ShoppingCart;
|
|
14
13
|
onLoginClick: () => void;
|
|
15
14
|
onSearch: (_input: string) => void;
|
|
16
15
|
onClickModelSerial: () => void;
|
|
16
|
+
/** Content shown in the account popover when authenticated */
|
|
17
|
+
accountPopoverContent?: React.ReactNode;
|
|
18
|
+
isAccountLoading?: boolean;
|
|
19
|
+
isCategoriesLoading?: boolean;
|
|
17
20
|
}
|
|
18
21
|
export type MainNavHandle = ShoppingCartHandle;
|
|
19
22
|
export declare const MainNav: React.ForwardRefExoticComponent<MainNavProps & React.RefAttributes<ShoppingCartHandle>>;
|
|
@@ -1,49 +1,51 @@
|
|
|
1
1
|
import { jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import z from "react";
|
|
3
3
|
import { Text as N } from "../../atoms/Text/Text.js";
|
|
4
4
|
import { Link as l } from "../../atoms/Link/Link.js";
|
|
5
|
-
import { Icon as
|
|
5
|
+
import { Icon as I } from "../../atoms/Icon/Icon.js";
|
|
6
6
|
import { Flex as t } from "../../atoms/Flex/Flex.js";
|
|
7
|
-
import { Grid as
|
|
8
|
-
import { Logo as
|
|
7
|
+
import { Grid as S, Column as U } from "../../atoms/Grid/Grid.js";
|
|
8
|
+
import { Logo as F } from "../../molecules/Logo/Logo.js";
|
|
9
9
|
import { SearchBox as _ } from "../../molecules/SearchBox/SearchBox.js";
|
|
10
|
-
import { HamburgerMenu as
|
|
11
|
-
import { ShoppingCart as
|
|
12
|
-
import { Account as
|
|
13
|
-
import { CategoryNav as
|
|
10
|
+
import { HamburgerMenu as H } from "../../molecules/HamburgerMenu/HamburgerMenu.js";
|
|
11
|
+
import { ShoppingCart as B } from "../../molecules/Cart/Cart.js";
|
|
12
|
+
import { Account as G } from "../../molecules/Account/Account.js";
|
|
13
|
+
import { CategoryNav as K } from "../../molecules/CategoryNav/CategoryNav.js";
|
|
14
14
|
import { c as s } from "../../clsx-OuTLNxxd.js";
|
|
15
15
|
import { getHideAtStyles as u } from "../../atoms/HideAt.js";
|
|
16
|
-
import '../../assets/MainNav.css';const
|
|
17
|
-
main:
|
|
18
|
-
column:
|
|
19
|
-
topNav:
|
|
20
|
-
logo:
|
|
21
|
-
operations:
|
|
22
|
-
search:
|
|
23
|
-
siteLink:
|
|
24
|
-
accountArea:
|
|
25
|
-
category:
|
|
26
|
-
menuList:
|
|
27
|
-
},
|
|
16
|
+
import '../../assets/MainNav.css';const P = "_main_19pdr_1", Q = "_column_19pdr_8", T = "_topNav_19pdr_13", W = "_logo_19pdr_21", q = "_operations_19pdr_24", E = "_search_19pdr_31", J = "_siteLink_19pdr_34", O = "_accountArea_19pdr_48", R = "_category_19pdr_60", V = "_menuList_19pdr_82", r = {
|
|
17
|
+
main: P,
|
|
18
|
+
column: Q,
|
|
19
|
+
topNav: T,
|
|
20
|
+
logo: W,
|
|
21
|
+
operations: q,
|
|
22
|
+
search: E,
|
|
23
|
+
siteLink: J,
|
|
24
|
+
accountArea: O,
|
|
25
|
+
category: R,
|
|
26
|
+
menuList: V
|
|
27
|
+
}, de = z.forwardRef(function({
|
|
28
28
|
account: c,
|
|
29
29
|
categories: n,
|
|
30
30
|
homeRoute: g,
|
|
31
31
|
faqRoute: v,
|
|
32
32
|
customPartsRoute: d,
|
|
33
33
|
aboutUsRoute: A,
|
|
34
|
-
accountRoute: L,
|
|
35
34
|
contactRoute: h,
|
|
36
|
-
cart:
|
|
37
|
-
open:
|
|
35
|
+
cart: L,
|
|
36
|
+
open: x,
|
|
38
37
|
// consume external panel control props from CartPropsBase
|
|
39
|
-
className:
|
|
40
|
-
onLoginClick:
|
|
38
|
+
className: C,
|
|
39
|
+
onLoginClick: k,
|
|
41
40
|
onSearch: p,
|
|
42
41
|
onClickModelSerial: f,
|
|
43
|
-
onCartClick:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
onCartClick: y,
|
|
43
|
+
accountPopoverContent: b,
|
|
44
|
+
isAccountLoading: w,
|
|
45
|
+
isCategoriesLoading: j,
|
|
46
|
+
...D
|
|
47
|
+
}, M) {
|
|
48
|
+
return /* @__PURE__ */ e(S, { ...D, gridWrapperClassName: s(r.main, C), children: /* @__PURE__ */ o(U, { span: 12, className: r.column, children: [
|
|
47
49
|
/* @__PURE__ */ o(
|
|
48
50
|
t,
|
|
49
51
|
{
|
|
@@ -52,7 +54,7 @@ import '../../assets/MainNav.css';const G = "_main_19pdr_1", K = "_column_19pdr_
|
|
|
52
54
|
justifyContent: "space-between",
|
|
53
55
|
className: r.topNav,
|
|
54
56
|
children: [
|
|
55
|
-
/* @__PURE__ */ e("div", { className: r.logo, children: /* @__PURE__ */ e(l, { href: g, children: /* @__PURE__ */ e(
|
|
57
|
+
/* @__PURE__ */ e("div", { className: r.logo, children: /* @__PURE__ */ e(l, { href: g, children: /* @__PURE__ */ e(F, {}) }) }),
|
|
56
58
|
/* @__PURE__ */ o(
|
|
57
59
|
t,
|
|
58
60
|
{
|
|
@@ -66,24 +68,25 @@ import '../../assets/MainNav.css';const G = "_main_19pdr_1", K = "_column_19pdr_
|
|
|
66
68
|
/* @__PURE__ */ e(i, { href: d, hideAt: ["sm", "md"], children: "Custom Parts" }),
|
|
67
69
|
/* @__PURE__ */ e(i, { href: h, hideAt: ["sm", "md"], children: "Contact Us" }),
|
|
68
70
|
/* @__PURE__ */ e("div", { className: r.accountArea, children: /* @__PURE__ */ e(
|
|
69
|
-
|
|
71
|
+
G,
|
|
70
72
|
{
|
|
71
73
|
account: c,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
74
|
+
onLoginClick: k,
|
|
75
|
+
className: r.avatar,
|
|
76
|
+
popoverContent: b,
|
|
77
|
+
isAccountLoading: w
|
|
75
78
|
}
|
|
76
79
|
) }),
|
|
77
80
|
/* @__PURE__ */ e(
|
|
78
|
-
|
|
81
|
+
B,
|
|
79
82
|
{
|
|
80
|
-
ref:
|
|
81
|
-
cart:
|
|
82
|
-
open:
|
|
83
|
-
onCartClick:
|
|
83
|
+
ref: M,
|
|
84
|
+
cart: L,
|
|
85
|
+
open: x,
|
|
86
|
+
onCartClick: y
|
|
84
87
|
}
|
|
85
88
|
),
|
|
86
|
-
/* @__PURE__ */ e(
|
|
89
|
+
/* @__PURE__ */ e(H, { hideAt: ["lg"], children: /* @__PURE__ */ o("ul", { className: r.menuList, children: [
|
|
87
90
|
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { onClick: f, className: s(r.siteLink, u(["lg"])), children: "Model/Serial" }) }),
|
|
88
91
|
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(i, { href: d, children: "Custom Parts" }) }),
|
|
89
92
|
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(i, { href: h, children: "Contact Us" }) }),
|
|
@@ -92,7 +95,7 @@ import '../../assets/MainNav.css';const G = "_main_19pdr_1", K = "_column_19pdr_
|
|
|
92
95
|
n && n.map((a) => /* @__PURE__ */ e("li", { className: r.category, children: /* @__PURE__ */ o(l, { href: a.route, children: [
|
|
93
96
|
/* @__PURE__ */ e(N, { size: "sm", weight: "semibold", children: a.label }),
|
|
94
97
|
/* @__PURE__ */ e(
|
|
95
|
-
|
|
98
|
+
I,
|
|
96
99
|
{
|
|
97
100
|
iconKey: "fa-solid fa-chevron-right",
|
|
98
101
|
title: "Navigate",
|
|
@@ -108,7 +111,7 @@ import '../../assets/MainNav.css';const G = "_main_19pdr_1", K = "_column_19pdr_
|
|
|
108
111
|
}
|
|
109
112
|
),
|
|
110
113
|
/* @__PURE__ */ e(t, { flexDirection: "row", hideAt: ["md", "lg"], children: /* @__PURE__ */ e(_, { onSearch: p, inputName: "cpc-search", className: r.search }) }),
|
|
111
|
-
/* @__PURE__ */ e(
|
|
114
|
+
/* @__PURE__ */ e(K, { categories: n, isCategoriesLoading: j })
|
|
112
115
|
] }) });
|
|
113
116
|
});
|
|
114
117
|
function i({
|
|
@@ -119,5 +122,5 @@ function i({
|
|
|
119
122
|
return /* @__PURE__ */ e(l, { href: m, className: r.siteLink, ...n, children: /* @__PURE__ */ e(N, { size: "md", variant: "display", children: c }) });
|
|
120
123
|
}
|
|
121
124
|
export {
|
|
122
|
-
|
|
125
|
+
de as MainNav
|
|
123
126
|
};
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { MainNav as
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { jsxs as b, Fragment as g, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useState as h } from "react";
|
|
3
|
+
import { MainNav as m } from "./MainNav.js";
|
|
4
|
+
import { Text as s } from "../../atoms/Text/Text.js";
|
|
5
|
+
import { Link as u } from "../../atoms/Link/Link.js";
|
|
6
|
+
import { Button as p } from "../../atoms/Button/Button.js";
|
|
7
|
+
import { CartSlideInPanel as v } from "../../molecules/Cart/CartSlideInPanel.js";
|
|
8
|
+
const U = {
|
|
6
9
|
title: "Case Parts/Organisms/MainNav",
|
|
7
|
-
component:
|
|
10
|
+
component: m,
|
|
8
11
|
parameters: {
|
|
9
12
|
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
|
|
10
13
|
layout: "fullscreen"
|
|
11
14
|
}
|
|
12
15
|
// tags: ["autodocs"],
|
|
13
|
-
},
|
|
16
|
+
}, l = [
|
|
14
17
|
{
|
|
15
18
|
id: 0,
|
|
16
19
|
label: "Shop by Brands",
|
|
@@ -119,30 +122,36 @@ const I = {
|
|
|
119
122
|
{ id: 12, itemId: "1092-02", description: "Kason Door Closer - Offset", price: "$99.99", quantity: 1, imageUrl: a, availability: "In Stock", availabilityId: "available" }
|
|
120
123
|
]
|
|
121
124
|
};
|
|
122
|
-
function
|
|
125
|
+
function y(e) {
|
|
123
126
|
return `$${e.items.reduce(
|
|
124
|
-
(
|
|
127
|
+
(i, o) => i + (parseFloat(o.price.replace(/[^0-9.]/g, "")) || 0) * o.quantity,
|
|
125
128
|
0
|
|
126
129
|
).toFixed(2)}`;
|
|
127
130
|
}
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
131
|
+
const d = /* @__PURE__ */ b("div", { style: { display: "flex", flexDirection: "column", gap: 8, minWidth: 220 }, children: [
|
|
132
|
+
/* @__PURE__ */ t(s, { size: "sm", weight: "semibold", children: "Account" }),
|
|
133
|
+
/* @__PURE__ */ t(s, { size: "xs", children: "Signed in as Ringo" }),
|
|
134
|
+
/* @__PURE__ */ t(u, { href: "/account", children: "View Account" }),
|
|
135
|
+
/* @__PURE__ */ t(u, { href: "/orders", children: "Order History" }),
|
|
136
|
+
/* @__PURE__ */ t(p, { size: "sm", variant: "secondary", onClick: () => alert("Sign out"), children: "Sign Out" })
|
|
137
|
+
] }), n = (e) => {
|
|
138
|
+
const [c, i] = h(!1);
|
|
139
|
+
return /* @__PURE__ */ b(g, { children: [
|
|
140
|
+
/* @__PURE__ */ t(
|
|
141
|
+
m,
|
|
133
142
|
{
|
|
134
143
|
...e,
|
|
135
|
-
open:
|
|
136
|
-
onCartClick: () =>
|
|
144
|
+
open: c,
|
|
145
|
+
onCartClick: () => i((o) => !o)
|
|
137
146
|
}
|
|
138
147
|
),
|
|
139
|
-
/* @__PURE__ */
|
|
140
|
-
|
|
148
|
+
/* @__PURE__ */ t(
|
|
149
|
+
v,
|
|
141
150
|
{
|
|
142
|
-
open:
|
|
143
|
-
onClose: () =>
|
|
151
|
+
open: c,
|
|
152
|
+
onClose: () => i(!1),
|
|
144
153
|
cart: e.cart,
|
|
145
|
-
subtotal:
|
|
154
|
+
subtotal: y(e.cart),
|
|
146
155
|
itemPriceLabel: "List Price",
|
|
147
156
|
contactHref: e.contactRoute,
|
|
148
157
|
contactLinkBehavior: "new-tab",
|
|
@@ -152,13 +161,12 @@ const n = (e) => {
|
|
|
152
161
|
}
|
|
153
162
|
)
|
|
154
163
|
] });
|
|
155
|
-
},
|
|
164
|
+
}, $ = {
|
|
156
165
|
args: {
|
|
157
166
|
account: { name: "Ringo", initials: "RS", number: "123456789012" },
|
|
158
167
|
cart: r,
|
|
159
168
|
homeRoute: "/",
|
|
160
169
|
customPartsRoute: "/custom",
|
|
161
|
-
accountRoute: "/account",
|
|
162
170
|
onClickModelSerial: () => {
|
|
163
171
|
alert("Model/Serial");
|
|
164
172
|
},
|
|
@@ -174,16 +182,16 @@ const n = (e) => {
|
|
|
174
182
|
onCartClick: () => {
|
|
175
183
|
},
|
|
176
184
|
// placeholder required by component
|
|
177
|
-
categories:
|
|
185
|
+
categories: l,
|
|
186
|
+
accountPopoverContent: d
|
|
178
187
|
},
|
|
179
188
|
render: n
|
|
180
|
-
},
|
|
189
|
+
}, D = {
|
|
181
190
|
args: {
|
|
182
191
|
account: { name: "Ringo", initials: "RS", number: "123456789012" },
|
|
183
192
|
cart: r,
|
|
184
193
|
homeRoute: "/",
|
|
185
194
|
customPartsRoute: "/custom",
|
|
186
|
-
accountRoute: "/account",
|
|
187
195
|
onClickModelSerial: () => {
|
|
188
196
|
alert("Model/Serial");
|
|
189
197
|
},
|
|
@@ -198,15 +206,15 @@ const n = (e) => {
|
|
|
198
206
|
},
|
|
199
207
|
onCartClick: () => {
|
|
200
208
|
},
|
|
201
|
-
categories:
|
|
209
|
+
categories: l,
|
|
210
|
+
accountPopoverContent: d
|
|
202
211
|
},
|
|
203
212
|
render: n
|
|
204
|
-
},
|
|
213
|
+
}, L = {
|
|
205
214
|
args: {
|
|
206
215
|
cart: r,
|
|
207
216
|
homeRoute: "/",
|
|
208
217
|
customPartsRoute: "/custom",
|
|
209
|
-
accountRoute: "/account",
|
|
210
218
|
onClickModelSerial: () => {
|
|
211
219
|
alert("Model/Serial");
|
|
212
220
|
},
|
|
@@ -221,13 +229,40 @@ const n = (e) => {
|
|
|
221
229
|
},
|
|
222
230
|
onCartClick: () => {
|
|
223
231
|
},
|
|
224
|
-
categories:
|
|
232
|
+
categories: l
|
|
233
|
+
},
|
|
234
|
+
render: n
|
|
235
|
+
}, M = {
|
|
236
|
+
args: {
|
|
237
|
+
account: { name: "Ringo", initials: "RS", number: "123456789012" },
|
|
238
|
+
cart: r,
|
|
239
|
+
homeRoute: "/",
|
|
240
|
+
customPartsRoute: "/custom",
|
|
241
|
+
onClickModelSerial: () => {
|
|
242
|
+
alert("Model/Serial");
|
|
243
|
+
},
|
|
244
|
+
faqRoute: "/faq",
|
|
245
|
+
aboutUsRoute: "/about",
|
|
246
|
+
contactRoute: "/contact",
|
|
247
|
+
onLoginClick: () => {
|
|
248
|
+
alert("Login");
|
|
249
|
+
},
|
|
250
|
+
onSearch: (e) => {
|
|
251
|
+
alert(`Search ${e}`);
|
|
252
|
+
},
|
|
253
|
+
onCartClick: () => {
|
|
254
|
+
},
|
|
255
|
+
categories: l,
|
|
256
|
+
accountPopoverContent: d,
|
|
257
|
+
isAccountLoading: !0,
|
|
258
|
+
isCategoriesLoading: !0
|
|
225
259
|
},
|
|
226
260
|
render: n
|
|
227
261
|
};
|
|
228
262
|
export {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
263
|
+
$ as Authenticated,
|
|
264
|
+
M as Loading,
|
|
265
|
+
L as Unauthenticated,
|
|
266
|
+
D as WithCartItems,
|
|
267
|
+
U as default
|
|
233
268
|
};
|