@caseparts-org/caseblocks 0.0.110 → 0.0.112
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 +5 -2
- package/dist/molecules/Account/Account.js +46 -37
- package/dist/molecules/Account/Account.stories.d.ts +1 -0
- package/dist/molecules/Account/Account.stories.js +27 -8
- package/dist/molecules/CategoryNav/CategoryNav.d.ts +2 -1
- package/dist/molecules/CategoryNav/CategoryNav.js +25 -23
- package/dist/organisms/MainNav/MainNav.d.ts +2 -0
- package/dist/organisms/MainNav/MainNav.js +35 -32
- package/dist/organisms/MainNav/MainNav.stories.d.ts +1 -0
- package/dist/organisms/MainNav/MainNav.stories.js +70 -43
- package/package.json +1 -1
package/dist/assets/Account.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._loggedIn_1sipy_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_1sipy_12>a,._customer_1sipy_12>a:hover{text-decoration:none}._loggedIn_1sipy_1:hover{background-color:#f3f3f3;border-radius:var(--border-radius-md)}._placeholder_1sipy_21{width:32px;width:120px}@media (max-width:1280px){._placeholder_1sipy_21{width:32px;height:32px;background-color:#f3f3f3;border-radius:100%}}
|
|
@@ -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}
|
|
@@ -7,11 +7,14 @@ export interface AccountProps extends React.HTMLAttributes<HTMLDivElement>, Hide
|
|
|
7
7
|
number: string;
|
|
8
8
|
/** The account user's name. */
|
|
9
9
|
name: string;
|
|
10
|
-
/** The account user's initials. */
|
|
11
|
-
initials
|
|
10
|
+
/** The account user's initials. Used when no custom avatar JSX is provided. */
|
|
11
|
+
initials?: string;
|
|
12
|
+
/** Optional custom avatar content. If provided, it will be rendered instead of the default Avatar. */
|
|
13
|
+
avatar?: React.ReactNode;
|
|
12
14
|
};
|
|
13
15
|
onLoginClick: () => void;
|
|
14
16
|
/** Optional content to show when clicking the authenticated container */
|
|
15
17
|
popoverContent?: React.ReactNode;
|
|
18
|
+
isAccountLoading?: boolean;
|
|
16
19
|
}
|
|
17
20
|
export declare function Account(props: AccountProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,111 +1,120 @@
|
|
|
1
1
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
2
|
-
import { getHideAtStyles as
|
|
2
|
+
import { getHideAtStyles as m } from "../../atoms/HideAt.js";
|
|
3
3
|
import { Icon as f } from "../../atoms/Icon/Icon.js";
|
|
4
|
-
import { Text as
|
|
5
|
-
import { Avatar as
|
|
6
|
-
import { Flex as
|
|
7
|
-
import { Button as
|
|
8
|
-
import { Popover as
|
|
9
|
-
import { c as
|
|
10
|
-
import '../../assets/Account.css';const x = "
|
|
4
|
+
import { Text as c } from "../../atoms/Text/Text.js";
|
|
5
|
+
import { Avatar as u } from "../Avatar/Avatar.js";
|
|
6
|
+
import { Flex as d } from "../../atoms/Flex/Flex.js";
|
|
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_1sipy_1", v = "_customer_1sipy_12", I = "_placeholder_1sipy_21", o = {
|
|
11
11
|
loggedIn: x,
|
|
12
|
-
customer:
|
|
12
|
+
customer: v,
|
|
13
|
+
placeholder: I
|
|
13
14
|
};
|
|
14
|
-
function
|
|
15
|
+
function y(i) {
|
|
15
16
|
return i.account !== void 0;
|
|
16
17
|
}
|
|
17
|
-
function
|
|
18
|
-
return
|
|
18
|
+
function j(i) {
|
|
19
|
+
return i.isAccountLoading ? /* @__PURE__ */ t("div", { className: o.placeholder }) : y(i) ? /* @__PURE__ */ t(_, { ...i }) : /* @__PURE__ */ t(N, { ...i });
|
|
19
20
|
}
|
|
20
|
-
function
|
|
21
|
+
function _(i) {
|
|
21
22
|
const {
|
|
22
23
|
account: e,
|
|
23
24
|
className: r,
|
|
24
25
|
hideAt: s,
|
|
25
|
-
popoverContent:
|
|
26
|
-
|
|
26
|
+
popoverContent: a,
|
|
27
|
+
isAccountLoading: h,
|
|
28
|
+
...l
|
|
27
29
|
} = i;
|
|
28
|
-
return
|
|
29
|
-
|
|
30
|
+
return a ? /* @__PURE__ */ t(
|
|
31
|
+
A,
|
|
30
32
|
{
|
|
31
33
|
position: "bottom right",
|
|
32
34
|
trigger: /* @__PURE__ */ n(
|
|
33
35
|
"div",
|
|
34
36
|
{
|
|
35
|
-
className:
|
|
36
|
-
...
|
|
37
|
+
className: g(o.loggedIn, m(s), r),
|
|
38
|
+
...l,
|
|
37
39
|
children: [
|
|
38
40
|
/* @__PURE__ */ n(
|
|
39
|
-
|
|
41
|
+
d,
|
|
40
42
|
{
|
|
41
43
|
flexDirection: "column",
|
|
42
44
|
alignItems: "flex-end",
|
|
43
45
|
hideAt: ["sm", "md"],
|
|
44
46
|
className: o.customer,
|
|
45
47
|
children: [
|
|
46
|
-
/* @__PURE__ */ n(
|
|
48
|
+
/* @__PURE__ */ n(c, { size: "xxs", children: [
|
|
47
49
|
"Acct: ",
|
|
48
50
|
e == null ? void 0 : e.number
|
|
49
51
|
] }),
|
|
50
|
-
/* @__PURE__ */ n(
|
|
52
|
+
/* @__PURE__ */ n(c, { size: "sm", variant: "display", colorToken: "links", children: [
|
|
51
53
|
"Hello ",
|
|
52
54
|
e == null ? void 0 : e.name
|
|
53
55
|
] })
|
|
54
56
|
]
|
|
55
57
|
}
|
|
56
58
|
),
|
|
57
|
-
/* @__PURE__ */ t(
|
|
59
|
+
e.avatar ?? (e.initials ? /* @__PURE__ */ t(u, { initials: e.initials }) : null)
|
|
58
60
|
]
|
|
59
61
|
}
|
|
60
62
|
),
|
|
61
|
-
children:
|
|
63
|
+
children: a
|
|
62
64
|
}
|
|
63
65
|
) : /* @__PURE__ */ n(
|
|
64
66
|
"div",
|
|
65
67
|
{
|
|
66
|
-
className:
|
|
67
|
-
...
|
|
68
|
+
className: g(o.loggedIn, m(s), r),
|
|
69
|
+
...l,
|
|
68
70
|
children: [
|
|
69
71
|
/* @__PURE__ */ n(
|
|
70
|
-
|
|
72
|
+
d,
|
|
71
73
|
{
|
|
72
74
|
flexDirection: "column",
|
|
73
75
|
alignItems: "flex-end",
|
|
74
76
|
hideAt: ["sm", "md"],
|
|
75
77
|
className: o.customer,
|
|
76
78
|
children: [
|
|
77
|
-
/* @__PURE__ */ n(
|
|
79
|
+
/* @__PURE__ */ n(c, { size: "xxs", children: [
|
|
78
80
|
"Acct: ",
|
|
79
81
|
e == null ? void 0 : e.number
|
|
80
82
|
] }),
|
|
81
|
-
/* @__PURE__ */ n(
|
|
83
|
+
/* @__PURE__ */ n(c, { size: "sm", variant: "display", colorToken: "links", children: [
|
|
82
84
|
"Hello ",
|
|
83
85
|
e == null ? void 0 : e.name
|
|
84
86
|
] })
|
|
85
87
|
]
|
|
86
88
|
}
|
|
87
89
|
),
|
|
88
|
-
/* @__PURE__ */ t(
|
|
90
|
+
e.avatar ?? (e.initials ? /* @__PURE__ */ t(u, { initials: e.initials }) : null)
|
|
89
91
|
]
|
|
90
92
|
}
|
|
91
93
|
);
|
|
92
94
|
}
|
|
93
|
-
function
|
|
94
|
-
const {
|
|
95
|
+
function N(i) {
|
|
96
|
+
const {
|
|
97
|
+
onLoginClick: e,
|
|
98
|
+
className: r,
|
|
99
|
+
hideAt: s,
|
|
100
|
+
popoverContent: a,
|
|
101
|
+
isAccountLoading: h,
|
|
102
|
+
...l
|
|
103
|
+
} = i;
|
|
95
104
|
return /* @__PURE__ */ n(
|
|
96
|
-
|
|
105
|
+
d,
|
|
97
106
|
{
|
|
98
107
|
flexDirection: "row",
|
|
99
108
|
alignItems: "center",
|
|
100
109
|
...l,
|
|
101
|
-
className:
|
|
110
|
+
className: g(
|
|
102
111
|
o.unauthenticated,
|
|
103
|
-
|
|
112
|
+
m(s),
|
|
104
113
|
r
|
|
105
114
|
),
|
|
106
115
|
children: [
|
|
107
116
|
/* @__PURE__ */ t(
|
|
108
|
-
|
|
117
|
+
p,
|
|
109
118
|
{
|
|
110
119
|
onClick: e,
|
|
111
120
|
size: "sm",
|
|
@@ -120,5 +129,5 @@ function k(i) {
|
|
|
120
129
|
);
|
|
121
130
|
}
|
|
122
131
|
export {
|
|
123
|
-
|
|
132
|
+
j as Account
|
|
124
133
|
};
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { Account as a } from "./Account.js";
|
|
3
|
+
const e = {
|
|
3
4
|
title: "Case Parts/Molecules/Account",
|
|
4
|
-
component:
|
|
5
|
+
component: a,
|
|
5
6
|
parameters: {
|
|
6
7
|
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
|
|
7
8
|
layout: "centered"
|
|
8
9
|
},
|
|
9
10
|
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
10
11
|
tags: ["autodocs"]
|
|
11
|
-
},
|
|
12
|
+
}, c = {
|
|
12
13
|
args: {
|
|
13
14
|
onLoginClick: () => {
|
|
14
15
|
}
|
|
15
16
|
}
|
|
16
|
-
},
|
|
17
|
+
}, s = {
|
|
17
18
|
args: {
|
|
18
19
|
account: {
|
|
19
20
|
name: "Ringo",
|
|
@@ -23,9 +24,27 @@ const o = {
|
|
|
23
24
|
onLoginClick: () => {
|
|
24
25
|
}
|
|
25
26
|
}
|
|
27
|
+
}, i = {
|
|
28
|
+
args: {
|
|
29
|
+
account: {
|
|
30
|
+
name: "Ringo",
|
|
31
|
+
number: "123456789012",
|
|
32
|
+
avatar: /* @__PURE__ */ t(
|
|
33
|
+
"img",
|
|
34
|
+
{
|
|
35
|
+
src: "https://avatars.githubusercontent.com/u/9919?s=80&v=4",
|
|
36
|
+
alt: "Custom Avatar",
|
|
37
|
+
style: { width: 32, height: 32, borderRadius: 9999 }
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
},
|
|
41
|
+
onLoginClick: () => {
|
|
42
|
+
}
|
|
43
|
+
}
|
|
26
44
|
};
|
|
27
45
|
export {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
46
|
+
s as Authenticated,
|
|
47
|
+
i as AuthenticatedWithCustomAvatar,
|
|
48
|
+
c as Unauthenticated,
|
|
49
|
+
e as default
|
|
31
50
|
};
|
|
@@ -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
|
};
|
|
@@ -15,6 +15,8 @@ export interface MainNavProps extends CartPropsBase, React.HTMLAttributes<HTMLDi
|
|
|
15
15
|
onClickModelSerial: () => void;
|
|
16
16
|
/** Content shown in the account popover when authenticated */
|
|
17
17
|
accountPopoverContent?: React.ReactNode;
|
|
18
|
+
isAccountLoading?: boolean;
|
|
19
|
+
isCategoriesLoading?: boolean;
|
|
18
20
|
}
|
|
19
21
|
export type MainNavHandle = ShoppingCartHandle;
|
|
20
22
|
export declare const MainNav: React.ForwardRefExoticComponent<MainNavProps & React.RefAttributes<ShoppingCartHandle>>;
|
|
@@ -1,30 +1,30 @@
|
|
|
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,
|
|
@@ -41,9 +41,11 @@ import '../../assets/MainNav.css';const G = "_main_19pdr_1", K = "_column_19pdr_
|
|
|
41
41
|
onClickModelSerial: f,
|
|
42
42
|
onCartClick: y,
|
|
43
43
|
accountPopoverContent: b,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
74
|
onLoginClick: k,
|
|
73
75
|
className: r.avatar,
|
|
74
|
-
popoverContent: b
|
|
76
|
+
popoverContent: b,
|
|
77
|
+
isAccountLoading: w
|
|
75
78
|
}
|
|
76
79
|
) }),
|
|
77
80
|
/* @__PURE__ */ e(
|
|
78
|
-
|
|
81
|
+
B,
|
|
79
82
|
{
|
|
80
|
-
ref:
|
|
83
|
+
ref: M,
|
|
81
84
|
cart: L,
|
|
82
85
|
open: x,
|
|
83
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,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
|
|
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
8
|
const U = {
|
|
9
9
|
title: "Case Parts/Organisms/MainNav",
|
|
10
|
-
component:
|
|
10
|
+
component: m,
|
|
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
|
+
}, l = [
|
|
17
17
|
{
|
|
18
18
|
id: 0,
|
|
19
19
|
label: "Shop by Brands",
|
|
@@ -106,7 +106,7 @@ const U = {
|
|
|
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", r = {
|
|
110
110
|
items: [
|
|
111
111
|
{ id: 1, itemId: "1094-01", description: "Kason Door Closer - Flush", price: "$99.99", quantity: 1, imageUrl: a, availability: "In Stock", availabilityId: "available" },
|
|
112
112
|
{ id: 2, itemId: "810810", description: "True Door Gasket", price: "$99.99", quantity: 1, imageUrl: a, availability: "In Stock", availabilityId: "available" },
|
|
@@ -124,32 +124,32 @@ const U = {
|
|
|
124
124
|
};
|
|
125
125
|
function y(e) {
|
|
126
126
|
return `$${e.items.reduce(
|
|
127
|
-
(
|
|
127
|
+
(i, o) => i + (parseFloat(o.price.replace(/[^0-9.]/g, "")) || 0) * o.quantity,
|
|
128
128
|
0
|
|
129
129
|
).toFixed(2)}`;
|
|
130
130
|
}
|
|
131
|
-
const
|
|
132
|
-
/* @__PURE__ */
|
|
133
|
-
/* @__PURE__ */
|
|
134
|
-
/* @__PURE__ */
|
|
135
|
-
/* @__PURE__ */
|
|
136
|
-
/* @__PURE__ */
|
|
137
|
-
] }),
|
|
138
|
-
const [
|
|
139
|
-
return /* @__PURE__ */
|
|
140
|
-
/* @__PURE__ */
|
|
141
|
-
|
|
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,
|
|
142
142
|
{
|
|
143
143
|
...e,
|
|
144
|
-
open:
|
|
145
|
-
onCartClick: () =>
|
|
144
|
+
open: c,
|
|
145
|
+
onCartClick: () => i((o) => !o)
|
|
146
146
|
}
|
|
147
147
|
),
|
|
148
|
-
/* @__PURE__ */
|
|
149
|
-
|
|
148
|
+
/* @__PURE__ */ t(
|
|
149
|
+
v,
|
|
150
150
|
{
|
|
151
|
-
open:
|
|
152
|
-
onClose: () =>
|
|
151
|
+
open: c,
|
|
152
|
+
onClose: () => i(!1),
|
|
153
153
|
cart: e.cart,
|
|
154
154
|
subtotal: y(e.cart),
|
|
155
155
|
itemPriceLabel: "List Price",
|
|
@@ -161,10 +161,10 @@ const m = /* @__PURE__ */ u("div", { style: { display: "flex", flexDirection: "c
|
|
|
161
161
|
}
|
|
162
162
|
)
|
|
163
163
|
] });
|
|
164
|
-
},
|
|
164
|
+
}, $ = {
|
|
165
165
|
args: {
|
|
166
166
|
account: { name: "Ringo", initials: "RS", number: "123456789012" },
|
|
167
|
-
cart:
|
|
167
|
+
cart: r,
|
|
168
168
|
homeRoute: "/",
|
|
169
169
|
customPartsRoute: "/custom",
|
|
170
170
|
onClickModelSerial: () => {
|
|
@@ -182,14 +182,14 @@ const m = /* @__PURE__ */ u("div", { style: { display: "flex", flexDirection: "c
|
|
|
182
182
|
onCartClick: () => {
|
|
183
183
|
},
|
|
184
184
|
// placeholder required by component
|
|
185
|
-
categories:
|
|
186
|
-
accountPopoverContent:
|
|
185
|
+
categories: l,
|
|
186
|
+
accountPopoverContent: d
|
|
187
187
|
},
|
|
188
|
-
render:
|
|
189
|
-
},
|
|
188
|
+
render: n
|
|
189
|
+
}, D = {
|
|
190
190
|
args: {
|
|
191
191
|
account: { name: "Ringo", initials: "RS", number: "123456789012" },
|
|
192
|
-
cart:
|
|
192
|
+
cart: r,
|
|
193
193
|
homeRoute: "/",
|
|
194
194
|
customPartsRoute: "/custom",
|
|
195
195
|
onClickModelSerial: () => {
|
|
@@ -206,13 +206,36 @@ const m = /* @__PURE__ */ u("div", { style: { display: "flex", flexDirection: "c
|
|
|
206
206
|
},
|
|
207
207
|
onCartClick: () => {
|
|
208
208
|
},
|
|
209
|
-
categories:
|
|
210
|
-
accountPopoverContent:
|
|
209
|
+
categories: l,
|
|
210
|
+
accountPopoverContent: d
|
|
211
211
|
},
|
|
212
|
-
render:
|
|
212
|
+
render: n
|
|
213
213
|
}, L = {
|
|
214
214
|
args: {
|
|
215
|
-
cart:
|
|
215
|
+
cart: r,
|
|
216
|
+
homeRoute: "/",
|
|
217
|
+
customPartsRoute: "/custom",
|
|
218
|
+
onClickModelSerial: () => {
|
|
219
|
+
alert("Model/Serial");
|
|
220
|
+
},
|
|
221
|
+
faqRoute: "/faq",
|
|
222
|
+
aboutUsRoute: "/about",
|
|
223
|
+
contactRoute: "/contact",
|
|
224
|
+
onLoginClick: () => {
|
|
225
|
+
alert("Login");
|
|
226
|
+
},
|
|
227
|
+
onSearch: (e) => {
|
|
228
|
+
alert(`Search ${e}`);
|
|
229
|
+
},
|
|
230
|
+
onCartClick: () => {
|
|
231
|
+
},
|
|
232
|
+
categories: l
|
|
233
|
+
},
|
|
234
|
+
render: n
|
|
235
|
+
}, M = {
|
|
236
|
+
args: {
|
|
237
|
+
account: { name: "Ringo", initials: "RS", number: "123456789012" },
|
|
238
|
+
cart: r,
|
|
216
239
|
homeRoute: "/",
|
|
217
240
|
customPartsRoute: "/custom",
|
|
218
241
|
onClickModelSerial: () => {
|
|
@@ -229,13 +252,17 @@ const m = /* @__PURE__ */ u("div", { style: { display: "flex", flexDirection: "c
|
|
|
229
252
|
},
|
|
230
253
|
onCartClick: () => {
|
|
231
254
|
},
|
|
232
|
-
categories:
|
|
255
|
+
categories: l,
|
|
256
|
+
accountPopoverContent: d,
|
|
257
|
+
isAccountLoading: !0,
|
|
258
|
+
isCategoriesLoading: !0
|
|
233
259
|
},
|
|
234
|
-
render:
|
|
260
|
+
render: n
|
|
235
261
|
};
|
|
236
262
|
export {
|
|
237
|
-
|
|
263
|
+
$ as Authenticated,
|
|
264
|
+
M as Loading,
|
|
238
265
|
L as Unauthenticated,
|
|
239
|
-
|
|
266
|
+
D as WithCartItems,
|
|
240
267
|
U as default
|
|
241
268
|
};
|