@caseparts-org/caseblocks 0.0.108 → 0.0.110
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/Avatar.css +1 -1
- package/dist/main-client.d.ts +2 -0
- package/dist/main-client.js +35 -33
- package/dist/molecules/Account/Account.d.ts +2 -1
- package/dist/molecules/Account/Account.js +78 -45
- 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/organisms/MainNav/MainNav.d.ts +2 -1
- package/dist/organisms/MainNav/MainNav.js +13 -13
- package/dist/organisms/MainNav/MainNav.stories.js +48 -40
- package/package.json +1 -1
package/dist/assets/Account.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._loggedIn_1aoh3_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_1aoh3_12>a,._customer_1aoh3_12>a:hover{text-decoration:none}._loggedIn_1aoh3_1:hover{background-color:#f3f3f3;border-radius:var(--border-radius-md)}
|
package/dist/assets/Avatar.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._avatar_nvnsd_1{position:relative;background-color:var(--icons-icon-secondary);color:var(--text-text-invert);flex-shrink:0;border-radius:50%;width:28px;height:28px;text-align:center;text-transform:uppercase;cursor:pointer}
|
package/dist/main-client.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ export type { HorizontalScrollProps } from './atoms/HorizontalScroll/HorizontalS
|
|
|
4
4
|
export { SlideInPanel } from './atoms/SlideInPanel/SlideInPanel';
|
|
5
5
|
export type { SlideInPanelProps } from './atoms/SlideInPanel/SlideInPanel';
|
|
6
6
|
export { Tooltip } from './atoms/Tooltip/Tooltip';
|
|
7
|
+
export { Popover } from './atoms/Popover/Popover';
|
|
8
|
+
export type { PopoverProps } from './atoms/Popover/Popover';
|
|
7
9
|
export { Account } from './molecules/Account/Account';
|
|
8
10
|
export type { AccountProps } from './molecules/Account/Account';
|
|
9
11
|
export { Chip } from './molecules/Chip/Chip';
|
package/dist/main-client.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Button as
|
|
1
|
+
import { Button as e } from "./atoms/Button/Button.js";
|
|
2
2
|
import { Flex as p } from "./atoms/Flex/Flex.js";
|
|
3
3
|
import { Column as f, Grid as x } from "./atoms/Grid/Grid.js";
|
|
4
4
|
import { Head as n } from "./atoms/Root/Head.js";
|
|
@@ -7,9 +7,9 @@ import { Root as d } from "./atoms/Root/Root.js";
|
|
|
7
7
|
import { Separator as C } from "./atoms/Separator/Separator.js";
|
|
8
8
|
import { Text as k } from "./atoms/Text/Text.js";
|
|
9
9
|
import { Input as B } from "./atoms/Input/Input.js";
|
|
10
|
-
import { Link as
|
|
11
|
-
import { linkClassName as
|
|
12
|
-
import { configureLink as
|
|
10
|
+
import { Link as v } from "./atoms/Link/Link.js";
|
|
11
|
+
import { linkClassName as L } from "./atoms/Link/linkClassName.js";
|
|
12
|
+
import { configureLink as h, routerOverride as s } from "./atoms/Link/configureLink.js";
|
|
13
13
|
import { LinkButton as F } from "./atoms/LinkButton/LinkButton.js";
|
|
14
14
|
import { configureImage as b } from "./atoms/Image/configureImage.js";
|
|
15
15
|
import { Logo as H } from "./molecules/Logo/Logo.js";
|
|
@@ -24,46 +24,48 @@ import { Breadcrumbs as W } from "./molecules/Breadcrumbs/Breadcrumbs.js";
|
|
|
24
24
|
import { NotFound as Y } from "./organisms/NotFound/NotFound.js";
|
|
25
25
|
import { HorizontalScroll as _ } from "./atoms/HorizontalScroll/HorizontalScroll.js";
|
|
26
26
|
import { SlideInPanel as oo } from "./atoms/SlideInPanel/SlideInPanel.js";
|
|
27
|
-
import { Tooltip as
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
27
|
+
import { Tooltip as eo } from "./atoms/Tooltip/Tooltip.js";
|
|
28
|
+
import { Popover as po } from "./atoms/Popover/Popover.js";
|
|
29
|
+
import { Account as fo } from "./molecules/Account/Account.js";
|
|
30
|
+
import { Chip as ao } from "./molecules/Chip/Chip.js";
|
|
31
|
+
import { ToggleView as io } from "./molecules/ToggleView/ToggleView.js";
|
|
32
|
+
import { CartSlideInPanel as uo } from "./molecules/Cart/CartSlideInPanel.js";
|
|
33
|
+
import { StatefulButton as Co } from "./molecules/StatefulButton/StatefulButton.js";
|
|
34
|
+
import { AnimatedCheckMark as ko } from "./molecules/StatefulButton/AnimatedCheckmark.js";
|
|
35
|
+
import { AddToCart as Bo } from "./molecules/AddToCart/AddToCart.js";
|
|
36
|
+
import { MainNav as vo } from "./organisms/MainNav/MainNav.js";
|
|
37
|
+
import { ChipSelector as Lo } from "./organisms/ChipSelector/ChipSelector.js";
|
|
37
38
|
import { Product as ho } from "./organisms/Product/Product.js";
|
|
38
|
-
import { Carousel as
|
|
39
|
-
import { Footer as
|
|
39
|
+
import { Carousel as To } from "./organisms/Carousel/Carousel.js";
|
|
40
|
+
import { Footer as No } from "./organisms/Footer/Footer.js";
|
|
40
41
|
export {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
fo as Account,
|
|
43
|
+
Bo as AddToCart,
|
|
44
|
+
ko as AnimatedCheckMark,
|
|
44
45
|
V as Availability,
|
|
45
46
|
q as Avatar,
|
|
46
47
|
E as BannerCard,
|
|
47
48
|
W as Breadcrumbs,
|
|
48
|
-
|
|
49
|
+
e as Button,
|
|
49
50
|
K as CardLink,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
To as Carousel,
|
|
52
|
+
uo as CartSlideInPanel,
|
|
53
|
+
ao as Chip,
|
|
54
|
+
Lo as ChipSelector,
|
|
54
55
|
f as Column,
|
|
55
56
|
p as Flex,
|
|
56
|
-
|
|
57
|
+
No as Footer,
|
|
57
58
|
x as Grid,
|
|
58
59
|
n as Head,
|
|
59
60
|
_ as HorizontalScroll,
|
|
60
61
|
l as Icon,
|
|
61
62
|
B as Input,
|
|
62
|
-
|
|
63
|
+
v as Link,
|
|
63
64
|
F as LinkButton,
|
|
64
65
|
H as Logo,
|
|
65
|
-
|
|
66
|
+
vo as MainNav,
|
|
66
67
|
Y as NotFound,
|
|
68
|
+
po as Popover,
|
|
67
69
|
Q as Pricing,
|
|
68
70
|
ho as Product,
|
|
69
71
|
G as QuantityInput,
|
|
@@ -71,12 +73,12 @@ export {
|
|
|
71
73
|
w as SearchBox,
|
|
72
74
|
C as Separator,
|
|
73
75
|
oo as SlideInPanel,
|
|
74
|
-
|
|
76
|
+
Co as StatefulButton,
|
|
75
77
|
k as Text,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
+
io as ToggleView,
|
|
79
|
+
eo as Tooltip,
|
|
78
80
|
b as configureImage,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
h as configureLink,
|
|
82
|
+
L as linkClassName,
|
|
83
|
+
s as routerOverride
|
|
82
84
|
};
|
|
@@ -10,7 +10,8 @@ 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;
|
|
15
16
|
}
|
|
16
17
|
export declare function Account(props: AccountProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,91 +1,124 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { getHideAtStyles as
|
|
1
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
import { getHideAtStyles as c } from "../../atoms/HideAt.js";
|
|
3
3
|
import { Icon as f } from "../../atoms/Icon/Icon.js";
|
|
4
|
-
import { Text as
|
|
4
|
+
import { Text as m } from "../../atoms/Text/Text.js";
|
|
5
5
|
import { Avatar as h } from "../Avatar/Avatar.js";
|
|
6
|
-
import { Flex as
|
|
7
|
-
import { Button as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import '../../assets/Account.css';const
|
|
11
|
-
loggedIn:
|
|
6
|
+
import { Flex as a } from "../../atoms/Flex/Flex.js";
|
|
7
|
+
import { Button as u } from "../../atoms/Button/Button.js";
|
|
8
|
+
import { Popover as p } from "../../atoms/Popover/Popover.js";
|
|
9
|
+
import { c as d } from "../../clsx-OuTLNxxd.js";
|
|
10
|
+
import '../../assets/Account.css';const x = "_loggedIn_1aoh3_1", A = "_customer_1aoh3_12", o = {
|
|
11
|
+
loggedIn: x,
|
|
12
|
+
customer: A
|
|
12
13
|
};
|
|
13
|
-
function I(
|
|
14
|
-
return
|
|
14
|
+
function I(i) {
|
|
15
|
+
return i.account !== void 0;
|
|
15
16
|
}
|
|
16
|
-
function
|
|
17
|
-
return I(
|
|
17
|
+
function P(i) {
|
|
18
|
+
return I(i) ? /* @__PURE__ */ t(v, { ...i }) : /* @__PURE__ */ t(k, { ...i });
|
|
18
19
|
}
|
|
19
|
-
function
|
|
20
|
+
function v(i) {
|
|
20
21
|
const {
|
|
21
|
-
account:
|
|
22
|
-
accountRoute: o,
|
|
23
|
-
onLoginClick: m,
|
|
22
|
+
account: e,
|
|
24
23
|
className: r,
|
|
25
|
-
hideAt:
|
|
24
|
+
hideAt: s,
|
|
25
|
+
popoverContent: l,
|
|
26
26
|
...g
|
|
27
|
-
} =
|
|
28
|
-
return /* @__PURE__ */
|
|
29
|
-
|
|
27
|
+
} = i;
|
|
28
|
+
return l ? /* @__PURE__ */ t(
|
|
29
|
+
p,
|
|
30
30
|
{
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
position: "bottom right",
|
|
32
|
+
trigger: /* @__PURE__ */ n(
|
|
33
|
+
"div",
|
|
34
|
+
{
|
|
35
|
+
className: d(o.loggedIn, c(s), r),
|
|
36
|
+
...g,
|
|
37
|
+
children: [
|
|
38
|
+
/* @__PURE__ */ n(
|
|
39
|
+
a,
|
|
40
|
+
{
|
|
41
|
+
flexDirection: "column",
|
|
42
|
+
alignItems: "flex-end",
|
|
43
|
+
hideAt: ["sm", "md"],
|
|
44
|
+
className: o.customer,
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ n(m, { size: "xxs", children: [
|
|
47
|
+
"Acct: ",
|
|
48
|
+
e == null ? void 0 : e.number
|
|
49
|
+
] }),
|
|
50
|
+
/* @__PURE__ */ n(m, { size: "sm", variant: "display", colorToken: "links", children: [
|
|
51
|
+
"Hello ",
|
|
52
|
+
e == null ? void 0 : e.name
|
|
53
|
+
] })
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
/* @__PURE__ */ t(h, { initials: e.initials })
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
children: l
|
|
62
|
+
}
|
|
63
|
+
) : /* @__PURE__ */ n(
|
|
64
|
+
"div",
|
|
65
|
+
{
|
|
66
|
+
className: d(o.loggedIn, c(s), r),
|
|
34
67
|
...g,
|
|
35
68
|
children: [
|
|
36
69
|
/* @__PURE__ */ n(
|
|
37
|
-
|
|
70
|
+
a,
|
|
38
71
|
{
|
|
39
72
|
flexDirection: "column",
|
|
40
73
|
alignItems: "flex-end",
|
|
41
74
|
hideAt: ["sm", "md"],
|
|
42
|
-
className:
|
|
75
|
+
className: o.customer,
|
|
43
76
|
children: [
|
|
44
|
-
/* @__PURE__ */ n(
|
|
77
|
+
/* @__PURE__ */ n(m, { size: "xxs", children: [
|
|
45
78
|
"Acct: ",
|
|
46
|
-
|
|
79
|
+
e == null ? void 0 : e.number
|
|
47
80
|
] }),
|
|
48
|
-
/* @__PURE__ */
|
|
81
|
+
/* @__PURE__ */ n(m, { size: "sm", variant: "display", colorToken: "links", children: [
|
|
49
82
|
"Hello ",
|
|
50
|
-
|
|
51
|
-
] })
|
|
83
|
+
e == null ? void 0 : e.name
|
|
84
|
+
] })
|
|
52
85
|
]
|
|
53
86
|
}
|
|
54
87
|
),
|
|
55
|
-
/* @__PURE__ */
|
|
88
|
+
/* @__PURE__ */ t(h, { initials: e.initials })
|
|
56
89
|
]
|
|
57
90
|
}
|
|
58
91
|
);
|
|
59
92
|
}
|
|
60
|
-
function
|
|
61
|
-
const {
|
|
93
|
+
function k(i) {
|
|
94
|
+
const { onLoginClick: e, className: r, hideAt: s, ...l } = i;
|
|
62
95
|
return /* @__PURE__ */ n(
|
|
63
|
-
|
|
96
|
+
a,
|
|
64
97
|
{
|
|
65
98
|
flexDirection: "row",
|
|
66
99
|
alignItems: "center",
|
|
67
|
-
...
|
|
68
|
-
className:
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
100
|
+
...l,
|
|
101
|
+
className: d(
|
|
102
|
+
o.unauthenticated,
|
|
103
|
+
c(s),
|
|
104
|
+
r
|
|
72
105
|
),
|
|
73
106
|
children: [
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
-
|
|
107
|
+
/* @__PURE__ */ t(
|
|
108
|
+
u,
|
|
76
109
|
{
|
|
77
|
-
onClick:
|
|
110
|
+
onClick: e,
|
|
78
111
|
size: "sm",
|
|
79
112
|
variant: "primary",
|
|
80
113
|
hideAt: ["sm", "md"],
|
|
81
114
|
children: "Sign In / Register"
|
|
82
115
|
}
|
|
83
116
|
),
|
|
84
|
-
/* @__PURE__ */
|
|
117
|
+
/* @__PURE__ */ t(f, { iconKey: "fa-kit fa-user-anon", size: "lg", hideAt: "lg" })
|
|
85
118
|
]
|
|
86
119
|
}
|
|
87
120
|
);
|
|
88
121
|
}
|
|
89
122
|
export {
|
|
90
|
-
|
|
123
|
+
P as Account
|
|
91
124
|
};
|
|
@@ -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
|
};
|
|
@@ -8,12 +8,13 @@ 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;
|
|
17
18
|
}
|
|
18
19
|
export type MainNavHandle = ShoppingCartHandle;
|
|
19
20
|
export declare const MainNav: React.ForwardRefExoticComponent<MainNavProps & React.RefAttributes<ShoppingCartHandle>>;
|
|
@@ -31,19 +31,19 @@ import '../../assets/MainNav.css';const G = "_main_19pdr_1", K = "_column_19pdr_
|
|
|
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:
|
|
42
|
+
onCartClick: y,
|
|
43
|
+
accountPopoverContent: b,
|
|
44
44
|
...w
|
|
45
45
|
}, j) {
|
|
46
|
-
return /* @__PURE__ */ e(z, { ...w, gridWrapperClassName: s(r.main,
|
|
46
|
+
return /* @__PURE__ */ e(z, { ...w, gridWrapperClassName: s(r.main, C), children: /* @__PURE__ */ o(I, { span: 12, className: r.column, children: [
|
|
47
47
|
/* @__PURE__ */ o(
|
|
48
48
|
t,
|
|
49
49
|
{
|
|
@@ -69,18 +69,18 @@ import '../../assets/MainNav.css';const G = "_main_19pdr_1", K = "_column_19pdr_
|
|
|
69
69
|
H,
|
|
70
70
|
{
|
|
71
71
|
account: c,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
onLoginClick: k,
|
|
73
|
+
className: r.avatar,
|
|
74
|
+
popoverContent: b
|
|
75
75
|
}
|
|
76
76
|
) }),
|
|
77
77
|
/* @__PURE__ */ e(
|
|
78
78
|
F,
|
|
79
79
|
{
|
|
80
80
|
ref: j,
|
|
81
|
-
cart:
|
|
82
|
-
open:
|
|
83
|
-
onCartClick:
|
|
81
|
+
cart: L,
|
|
82
|
+
open: x,
|
|
83
|
+
onCartClick: y
|
|
84
84
|
}
|
|
85
85
|
),
|
|
86
86
|
/* @__PURE__ */ e(U, { hideAt: ["lg"], children: /* @__PURE__ */ o("ul", { className: r.menuList, children: [
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import { jsxs as u, Fragment as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { MainNav as
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { jsxs as u, Fragment as h, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useState as p } from "react";
|
|
3
|
+
import { MainNav as b } from "./MainNav.js";
|
|
4
|
+
import { Text as d } from "../../atoms/Text/Text.js";
|
|
5
|
+
import { Link as s } from "../../atoms/Link/Link.js";
|
|
6
|
+
import { Button as v } from "../../atoms/Button/Button.js";
|
|
7
|
+
import { CartSlideInPanel as g } from "../../molecules/Cart/CartSlideInPanel.js";
|
|
8
|
+
const U = {
|
|
6
9
|
title: "Case Parts/Organisms/MainNav",
|
|
7
|
-
component:
|
|
10
|
+
component: b,
|
|
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
|
+
}, r = [
|
|
14
17
|
{
|
|
15
18
|
id: 0,
|
|
16
19
|
label: "Shop by Brands",
|
|
@@ -103,7 +106,7 @@ const I = {
|
|
|
103
106
|
route: "#",
|
|
104
107
|
children: []
|
|
105
108
|
}
|
|
106
|
-
], 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", n = {
|
|
107
110
|
items: [
|
|
108
111
|
{ id: 1, itemId: "1094-01", description: "Kason Door Closer - Flush", price: "$99.99", quantity: 1, imageUrl: a, availability: "In Stock", availabilityId: "available" },
|
|
109
112
|
{ id: 2, itemId: "810810", description: "True Door Gasket", price: "$99.99", quantity: 1, imageUrl: a, availability: "In Stock", availabilityId: "available" },
|
|
@@ -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
|
-
(t,
|
|
127
|
+
(t, l) => t + (parseFloat(l.price.replace(/[^0-9.]/g, "")) || 0) * l.quantity,
|
|
125
128
|
0
|
|
126
129
|
).toFixed(2)}`;
|
|
127
130
|
}
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
131
|
+
const m = /* @__PURE__ */ u("div", { style: { display: "flex", flexDirection: "column", gap: 8, minWidth: 220 }, children: [
|
|
132
|
+
/* @__PURE__ */ i(d, { size: "sm", weight: "semibold", children: "Account" }),
|
|
133
|
+
/* @__PURE__ */ i(d, { size: "xs", children: "Signed in as Ringo" }),
|
|
134
|
+
/* @__PURE__ */ i(s, { href: "/account", children: "View Account" }),
|
|
135
|
+
/* @__PURE__ */ i(s, { href: "/orders", children: "Order History" }),
|
|
136
|
+
/* @__PURE__ */ i(v, { size: "sm", variant: "secondary", onClick: () => alert("Sign out"), children: "Sign Out" })
|
|
137
|
+
] }), c = (e) => {
|
|
138
|
+
const [o, t] = p(!1);
|
|
139
|
+
return /* @__PURE__ */ u(h, { children: [
|
|
140
|
+
/* @__PURE__ */ i(
|
|
141
|
+
b,
|
|
133
142
|
{
|
|
134
143
|
...e,
|
|
135
|
-
open:
|
|
136
|
-
onCartClick: () => t((
|
|
144
|
+
open: o,
|
|
145
|
+
onCartClick: () => t((l) => !l)
|
|
137
146
|
}
|
|
138
147
|
),
|
|
139
|
-
/* @__PURE__ */
|
|
140
|
-
|
|
148
|
+
/* @__PURE__ */ i(
|
|
149
|
+
g,
|
|
141
150
|
{
|
|
142
|
-
open:
|
|
151
|
+
open: o,
|
|
143
152
|
onClose: () => t(!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
|
+
}, D = {
|
|
156
165
|
args: {
|
|
157
166
|
account: { name: "Ringo", initials: "RS", number: "123456789012" },
|
|
158
|
-
cart:
|
|
167
|
+
cart: n,
|
|
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: r,
|
|
186
|
+
accountPopoverContent: m
|
|
178
187
|
},
|
|
179
|
-
render:
|
|
180
|
-
},
|
|
188
|
+
render: c
|
|
189
|
+
}, $ = {
|
|
181
190
|
args: {
|
|
182
191
|
account: { name: "Ringo", initials: "RS", number: "123456789012" },
|
|
183
|
-
cart:
|
|
192
|
+
cart: n,
|
|
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: r,
|
|
210
|
+
accountPopoverContent: m
|
|
202
211
|
},
|
|
203
|
-
render:
|
|
204
|
-
},
|
|
212
|
+
render: c
|
|
213
|
+
}, L = {
|
|
205
214
|
args: {
|
|
206
|
-
cart:
|
|
215
|
+
cart: n,
|
|
207
216
|
homeRoute: "/",
|
|
208
217
|
customPartsRoute: "/custom",
|
|
209
|
-
accountRoute: "/account",
|
|
210
218
|
onClickModelSerial: () => {
|
|
211
219
|
alert("Model/Serial");
|
|
212
220
|
},
|
|
@@ -221,13 +229,13 @@ const n = (e) => {
|
|
|
221
229
|
},
|
|
222
230
|
onCartClick: () => {
|
|
223
231
|
},
|
|
224
|
-
categories:
|
|
232
|
+
categories: r
|
|
225
233
|
},
|
|
226
|
-
render:
|
|
234
|
+
render: c
|
|
227
235
|
};
|
|
228
236
|
export {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
237
|
+
D as Authenticated,
|
|
238
|
+
L as Unauthenticated,
|
|
239
|
+
$ as WithCartItems,
|
|
240
|
+
U as default
|
|
233
241
|
};
|