@caseparts-org/caseblocks 0.0.176 → 0.0.178
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/molecules/CategoryNav/CategoryNav.d.ts +5 -2
- package/dist/molecules/CategoryNav/CategoryNav.js +26 -25
- package/dist/organisms/MainNav/MainNav.d.ts +1 -0
- package/dist/organisms/MainNav/MainNav.js +90 -82
- package/dist/organisms/MainNav/MainNav.stories.js +24 -12
- package/dist/organisms/Product/Product.d.ts +2 -1
- package/dist/organisms/Product/Product.js +84 -83
- package/package.json +1 -1
|
@@ -7,7 +7,10 @@ export interface CategoryWithChildren extends Category {
|
|
|
7
7
|
children: Category[];
|
|
8
8
|
showChevron?: boolean;
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
interface CategoryNavProps {
|
|
11
11
|
categories?: CategoryWithChildren[];
|
|
12
12
|
isCategoriesLoading?: boolean;
|
|
13
|
-
|
|
13
|
+
onCategoryClick?: (_category: Category) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare function CategoryNav({ categories, isCategoriesLoading, onCategoryClick, }: CategoryNavProps): import("react/jsx-runtime").JSX.Element | null;
|
|
16
|
+
export {};
|
|
@@ -1,31 +1,32 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { c } from "../../clsx-OuTLNxxd.js";
|
|
3
|
-
import { Text as
|
|
4
|
-
import { Link as
|
|
5
|
-
import { Icon as
|
|
6
|
-
import { getHideAtStyles as
|
|
7
|
-
import { Tooltip as
|
|
8
|
-
import '../../assets/CategoryNav.css';const
|
|
9
|
-
categories:
|
|
10
|
-
placeholder:
|
|
11
|
-
category:
|
|
12
|
-
submenuTooltip:
|
|
1
|
+
import { jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import { c as p } from "../../clsx-OuTLNxxd.js";
|
|
3
|
+
import { Text as m } from "../../atoms/Text/Text.js";
|
|
4
|
+
import { Link as t } from "../../atoms/Link/Link.js";
|
|
5
|
+
import { Icon as d } from "../../atoms/Icon/Icon.js";
|
|
6
|
+
import { getHideAtStyles as u } from "../../atoms/HideAt.js";
|
|
7
|
+
import { Tooltip as f } from "../../atoms/Tooltip/Tooltip.js";
|
|
8
|
+
import '../../assets/CategoryNav.css';const c = "_categories_19tew_1", a = "_placeholder_19tew_17", b = "_category_19tew_25", _ = "_submenuTooltip_19tew_51", i = {
|
|
9
|
+
categories: c,
|
|
10
|
+
placeholder: a,
|
|
11
|
+
category: b,
|
|
12
|
+
submenuTooltip: _
|
|
13
13
|
};
|
|
14
|
-
function
|
|
15
|
-
categories:
|
|
16
|
-
isCategoriesLoading:
|
|
14
|
+
function D({
|
|
15
|
+
categories: n,
|
|
16
|
+
isCategoriesLoading: h,
|
|
17
|
+
onCategoryClick: s
|
|
17
18
|
}) {
|
|
18
|
-
return
|
|
19
|
+
return h ? /* @__PURE__ */ e("div", { className: i.placeholder }) : !n || n.length === 0 ? null : /* @__PURE__ */ e("ul", { className: p(i.categories, u(["sm"])), children: n.map(
|
|
19
20
|
(l) => l.children.length > 0 ? /* @__PURE__ */ e(
|
|
20
|
-
|
|
21
|
+
f,
|
|
21
22
|
{
|
|
22
23
|
openDelay: 180,
|
|
23
24
|
closeDelay: 0,
|
|
24
25
|
tooltipOffset: 0,
|
|
25
|
-
trigger: /* @__PURE__ */ e("li", { className: i.category, tabIndex: 0, children: /* @__PURE__ */
|
|
26
|
-
/* @__PURE__ */ e(
|
|
26
|
+
trigger: /* @__PURE__ */ e("li", { className: i.category, tabIndex: 0, children: /* @__PURE__ */ o(t, { href: l.route, onClick: () => s == null ? void 0 : s(l), children: [
|
|
27
|
+
/* @__PURE__ */ e(m, { size: "sm", weight: "semibold", children: l.label }),
|
|
27
28
|
l.showChevron && /* @__PURE__ */ e(
|
|
28
|
-
|
|
29
|
+
d,
|
|
29
30
|
{
|
|
30
31
|
iconKey: "fa-regular fa-angle-down",
|
|
31
32
|
title: "Expand",
|
|
@@ -34,13 +35,13 @@ function v({
|
|
|
34
35
|
)
|
|
35
36
|
] }) }),
|
|
36
37
|
position: "bottom center",
|
|
37
|
-
children: /* @__PURE__ */ e("ul", { className: i.submenuTooltip, children: l.children.map((r) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
38
|
+
children: /* @__PURE__ */ e("ul", { className: i.submenuTooltip, children: l.children.map((r) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(t, { href: r.route, onClick: () => s == null ? void 0 : s(r), children: /* @__PURE__ */ e(m, { size: "sm", weight: "semibold", children: r.label }) }) }, r.id)) })
|
|
38
39
|
},
|
|
39
40
|
l.id
|
|
40
|
-
) : /* @__PURE__ */ e("li", { className: i.category, children: /* @__PURE__ */
|
|
41
|
-
/* @__PURE__ */ e(
|
|
41
|
+
) : /* @__PURE__ */ e("li", { className: i.category, children: /* @__PURE__ */ o(t, { href: l.route, onClick: () => s == null ? void 0 : s(l), children: [
|
|
42
|
+
/* @__PURE__ */ e(m, { size: "sm", weight: "semibold", children: l.label }),
|
|
42
43
|
l.showChevron && /* @__PURE__ */ e(
|
|
43
|
-
|
|
44
|
+
d,
|
|
44
45
|
{
|
|
45
46
|
iconKey: "fa-regular fa-angle-down",
|
|
46
47
|
title: "Expand",
|
|
@@ -51,5 +52,5 @@ function v({
|
|
|
51
52
|
) });
|
|
52
53
|
}
|
|
53
54
|
export {
|
|
54
|
-
|
|
55
|
+
D as CategoryNav
|
|
55
56
|
};
|
|
@@ -12,6 +12,7 @@ export interface MainNavProps extends CartPropsBase, React.HTMLAttributes<HTMLDi
|
|
|
12
12
|
cart: ShoppingCart;
|
|
13
13
|
onLoginClick: () => void;
|
|
14
14
|
onSearch: (_input: string) => void;
|
|
15
|
+
onCategoryClick?: (_category: CategoryWithChildren | CategoryWithChildren["children"][number]) => void;
|
|
15
16
|
onClickModelSerial: () => void;
|
|
16
17
|
/** Content shown in the account popover when authenticated */
|
|
17
18
|
accountPopoverContent?: React.ReactNode;
|
|
@@ -1,123 +1,124 @@
|
|
|
1
1
|
import { jsx as e, jsxs as r } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import S from "react";
|
|
3
3
|
import { Text as l } from "../../atoms/Text/Text.js";
|
|
4
|
-
import { Link as
|
|
5
|
-
import { Icon as
|
|
6
|
-
import { Flex as
|
|
7
|
-
import { Grid as
|
|
8
|
-
import { Logo as
|
|
9
|
-
import { SearchBox as
|
|
10
|
-
import { HamburgerMenu as
|
|
11
|
-
import { ShoppingCart as
|
|
12
|
-
import { Account as
|
|
13
|
-
import { CategoryNav as
|
|
4
|
+
import { Link as d } from "../../atoms/Link/Link.js";
|
|
5
|
+
import { Icon as s } from "../../atoms/Icon/Icon.js";
|
|
6
|
+
import { Flex as a } from "../../atoms/Flex/Flex.js";
|
|
7
|
+
import { Grid as U, Column as C } from "../../atoms/Grid/Grid.js";
|
|
8
|
+
import { Logo as F } from "../../molecules/Logo/Logo.js";
|
|
9
|
+
import { SearchBox as b } from "../../molecules/SearchBox/SearchBox.js";
|
|
10
|
+
import { HamburgerMenu as H } from "../../molecules/HamburgerMenu/HamburgerMenu.js";
|
|
11
|
+
import { ShoppingCart as q } from "../../molecules/Cart/Cart.js";
|
|
12
|
+
import { Account as B } from "../../molecules/Account/Account.js";
|
|
13
|
+
import { CategoryNav as G } from "../../molecules/CategoryNav/CategoryNav.js";
|
|
14
14
|
import { getHideAtStyles as g } from "../../atoms/HideAt.js";
|
|
15
|
-
import { c as
|
|
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
|
-
},
|
|
28
|
-
account:
|
|
29
|
-
categories:
|
|
30
|
-
homeRoute:
|
|
31
|
-
faqRoute:
|
|
32
|
-
customPartsRoute:
|
|
33
|
-
aboutUsRoute:
|
|
34
|
-
contactRoute:
|
|
35
|
-
cart:
|
|
36
|
-
open:
|
|
15
|
+
import { c as h } from "../../clsx-OuTLNxxd.js";
|
|
16
|
+
import '../../assets/MainNav.css';const P = "_main_t25b8_1", Q = "_column_t25b8_8", T = "_topNav_t25b8_13", W = "_logo_t25b8_21", E = "_operations_t25b8_24", J = "_search_t25b8_31", O = "_siteLink_t25b8_34", R = "_accountArea_t25b8_54", V = "_category_t25b8_66", X = "_menuList_t25b8_91", i = {
|
|
17
|
+
main: P,
|
|
18
|
+
column: Q,
|
|
19
|
+
topNav: T,
|
|
20
|
+
logo: W,
|
|
21
|
+
operations: E,
|
|
22
|
+
search: J,
|
|
23
|
+
siteLink: O,
|
|
24
|
+
accountArea: R,
|
|
25
|
+
category: V,
|
|
26
|
+
menuList: X
|
|
27
|
+
}, de = S.forwardRef(function({
|
|
28
|
+
account: m,
|
|
29
|
+
categories: t,
|
|
30
|
+
homeRoute: v,
|
|
31
|
+
faqRoute: L,
|
|
32
|
+
customPartsRoute: u,
|
|
33
|
+
aboutUsRoute: A,
|
|
34
|
+
contactRoute: p,
|
|
35
|
+
cart: x,
|
|
36
|
+
open: w,
|
|
37
37
|
// consume external panel control props from CartPropsBase
|
|
38
|
-
className:
|
|
39
|
-
onLoginClick:
|
|
40
|
-
onSearch:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
38
|
+
className: y,
|
|
39
|
+
onLoginClick: z,
|
|
40
|
+
onSearch: _,
|
|
41
|
+
onCategoryClick: o,
|
|
42
|
+
onClickModelSerial: N,
|
|
43
|
+
onCartClick: I,
|
|
44
|
+
accountPopoverContent: k,
|
|
45
|
+
isAccountLoading: K,
|
|
46
|
+
isCategoriesLoading: j,
|
|
47
|
+
...D
|
|
48
|
+
}, M) {
|
|
49
|
+
return /* @__PURE__ */ e(U, { ...D, gridWrapperClassName: h(i.main, y), children: /* @__PURE__ */ r(C, { span: 12, className: i.column, children: [
|
|
49
50
|
/* @__PURE__ */ r(
|
|
50
|
-
|
|
51
|
+
a,
|
|
51
52
|
{
|
|
52
53
|
flexDirection: "row",
|
|
53
54
|
alignItems: "center",
|
|
54
55
|
justifyContent: "space-between",
|
|
55
56
|
className: i.topNav,
|
|
56
57
|
children: [
|
|
57
|
-
/* @__PURE__ */ e("div", { className: i.logo, children: /* @__PURE__ */ e(
|
|
58
|
+
/* @__PURE__ */ e("div", { className: i.logo, children: /* @__PURE__ */ e(d, { href: v, children: /* @__PURE__ */ e(F, {}) }) }),
|
|
58
59
|
/* @__PURE__ */ r(
|
|
59
|
-
|
|
60
|
+
a,
|
|
60
61
|
{
|
|
61
62
|
flexDirection: "row",
|
|
62
63
|
alignItems: "center",
|
|
63
64
|
justifyContent: "flex-end",
|
|
64
65
|
className: i.operations,
|
|
65
66
|
children: [
|
|
66
|
-
/* @__PURE__ */ e(
|
|
67
|
-
/* @__PURE__ */ e("button", { onClick:
|
|
68
|
-
/* @__PURE__ */ e(
|
|
69
|
-
/* @__PURE__ */ e(
|
|
67
|
+
/* @__PURE__ */ e(a, { flexDirection: "row", hideAt: ["sm"], className: i.search, children: /* @__PURE__ */ e(b, { onSearch: _, inputName: "cpc-search" }) }),
|
|
68
|
+
/* @__PURE__ */ e("button", { onClick: N, className: h(i.siteLink, g(["sm", "md"])), children: "Model/Serial" }),
|
|
69
|
+
/* @__PURE__ */ e(n, { href: u, hideAt: ["sm", "md"], children: "Custom Parts" }),
|
|
70
|
+
/* @__PURE__ */ e(n, { href: p, hideAt: ["sm", "md"], children: "Contact Us" }),
|
|
70
71
|
/* @__PURE__ */ e("div", { className: i.accountArea, children: /* @__PURE__ */ e(
|
|
71
|
-
|
|
72
|
+
B,
|
|
72
73
|
{
|
|
73
|
-
account:
|
|
74
|
-
onLoginClick:
|
|
74
|
+
account: m,
|
|
75
|
+
onLoginClick: z,
|
|
75
76
|
className: i.avatar,
|
|
76
|
-
popoverContent:
|
|
77
|
-
isAccountLoading:
|
|
77
|
+
popoverContent: k,
|
|
78
|
+
isAccountLoading: K
|
|
78
79
|
}
|
|
79
80
|
) }),
|
|
80
81
|
/* @__PURE__ */ e(
|
|
81
|
-
|
|
82
|
+
q,
|
|
82
83
|
{
|
|
83
|
-
ref:
|
|
84
|
-
cart:
|
|
85
|
-
open:
|
|
86
|
-
onCartClick:
|
|
84
|
+
ref: M,
|
|
85
|
+
cart: x,
|
|
86
|
+
open: w,
|
|
87
|
+
onCartClick: I
|
|
87
88
|
}
|
|
88
89
|
),
|
|
89
|
-
/* @__PURE__ */ r(
|
|
90
|
+
/* @__PURE__ */ r(H, { hideAt: ["lg"], children: [
|
|
90
91
|
/* @__PURE__ */ r("section", { children: [
|
|
91
92
|
/* @__PURE__ */ e(l, { size: "md", weight: "semibold", children: "Useful shortcuts" }),
|
|
92
93
|
/* @__PURE__ */ r("ul", { className: i.menuList, children: [
|
|
93
94
|
/* @__PURE__ */ r("li", { className: i.menuItem, children: [
|
|
94
|
-
/* @__PURE__ */ e(
|
|
95
|
-
/* @__PURE__ */ e("button", { onClick:
|
|
95
|
+
/* @__PURE__ */ e(s, { iconKey: "fa-regular fa-book", size: "sm" }),
|
|
96
|
+
/* @__PURE__ */ e("button", { onClick: N, className: h(i.siteLink, g(["lg"])), children: "Model/Serial" })
|
|
96
97
|
] }),
|
|
97
98
|
/* @__PURE__ */ r("li", { className: i.menuItem, children: [
|
|
98
|
-
/* @__PURE__ */ e(
|
|
99
|
-
/* @__PURE__ */ e(
|
|
99
|
+
/* @__PURE__ */ e(s, { iconKey: "fa-regular fa-screwdriver-wrench", size: "sm" }),
|
|
100
|
+
/* @__PURE__ */ e(n, { href: u, children: "Custom Parts" })
|
|
100
101
|
] }),
|
|
101
102
|
/* @__PURE__ */ r("li", { className: i.menuItem, children: [
|
|
102
|
-
/* @__PURE__ */ e(
|
|
103
|
-
/* @__PURE__ */ e(
|
|
103
|
+
/* @__PURE__ */ e(s, { iconKey: "fa-regular fa-envelope", size: "sm" }),
|
|
104
|
+
/* @__PURE__ */ e(n, { href: p, children: "Contact Us" })
|
|
104
105
|
] }),
|
|
105
106
|
/* @__PURE__ */ r("li", { className: i.menuItem, children: [
|
|
106
|
-
/* @__PURE__ */ e(
|
|
107
|
-
/* @__PURE__ */ e(
|
|
107
|
+
/* @__PURE__ */ e(s, { iconKey: "fa-solid fa-question", size: "sm" }),
|
|
108
|
+
/* @__PURE__ */ e(n, { href: L, children: "FAQ" })
|
|
108
109
|
] }),
|
|
109
110
|
/* @__PURE__ */ r("li", { className: i.menuItem, children: [
|
|
110
|
-
/* @__PURE__ */ e(
|
|
111
|
-
/* @__PURE__ */ e(
|
|
111
|
+
/* @__PURE__ */ e(s, { iconKey: "fa-regular fa-people-group", size: "sm" }),
|
|
112
|
+
/* @__PURE__ */ e(n, { href: A, children: "About Us" })
|
|
112
113
|
] })
|
|
113
114
|
] })
|
|
114
115
|
] }),
|
|
115
116
|
/* @__PURE__ */ r("section", { children: [
|
|
116
117
|
/* @__PURE__ */ e(l, { size: "md", weight: "semibold", children: "Shop by category" }),
|
|
117
|
-
/* @__PURE__ */ e("ul", { className: i.menuList, children:
|
|
118
|
+
/* @__PURE__ */ e("ul", { className: i.menuList, children: t && t.map((c) => /* @__PURE__ */ e("li", { className: i.category, children: /* @__PURE__ */ r(d, { href: c.route, onClick: () => o == null ? void 0 : o(c), children: [
|
|
118
119
|
/* @__PURE__ */ e(l, { size: "sm", children: c.label }),
|
|
119
120
|
/* @__PURE__ */ e(
|
|
120
|
-
|
|
121
|
+
s,
|
|
121
122
|
{
|
|
122
123
|
iconKey: "fa-solid fa-chevron-right",
|
|
123
124
|
title: "Navigate",
|
|
@@ -133,17 +134,24 @@ import '../../assets/MainNav.css';const G = "_main_t25b8_1", P = "_column_t25b8_
|
|
|
133
134
|
]
|
|
134
135
|
}
|
|
135
136
|
),
|
|
136
|
-
/* @__PURE__ */ e(
|
|
137
|
-
/* @__PURE__ */ e(
|
|
137
|
+
/* @__PURE__ */ e(a, { flexDirection: "row", hideAt: ["md", "lg"], children: /* @__PURE__ */ e(b, { onSearch: _, inputName: "cpc-search", className: i.search }) }),
|
|
138
|
+
/* @__PURE__ */ e(
|
|
139
|
+
G,
|
|
140
|
+
{
|
|
141
|
+
categories: t,
|
|
142
|
+
isCategoriesLoading: j,
|
|
143
|
+
onCategoryClick: o
|
|
144
|
+
}
|
|
145
|
+
)
|
|
138
146
|
] }) });
|
|
139
147
|
});
|
|
140
|
-
function
|
|
141
|
-
href:
|
|
142
|
-
children:
|
|
143
|
-
...
|
|
148
|
+
function n({
|
|
149
|
+
href: f,
|
|
150
|
+
children: m,
|
|
151
|
+
...t
|
|
144
152
|
}) {
|
|
145
|
-
return /* @__PURE__ */ e(
|
|
153
|
+
return /* @__PURE__ */ e(d, { href: f, className: i.siteLink, ...t, children: m });
|
|
146
154
|
}
|
|
147
155
|
export {
|
|
148
|
-
|
|
156
|
+
de as MainNav
|
|
149
157
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsxs as b, Fragment as g, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
2
|
+
import { useState as y } from "react";
|
|
3
3
|
import { MainNav as m } from "./MainNav.js";
|
|
4
4
|
import { Text as s } from "../../atoms/Text/Text.js";
|
|
5
5
|
import { Link as u } from "../../atoms/Link/Link.js";
|
|
6
|
-
import { Button as
|
|
7
|
-
import { CartSlideInPanel as
|
|
8
|
-
const
|
|
6
|
+
import { Button as h } from "../../atoms/Button/Button.js";
|
|
7
|
+
import { CartSlideInPanel as p } from "../../molecules/Cart/CartSlideInPanel.js";
|
|
8
|
+
const q = {
|
|
9
9
|
title: "Case Parts/Organisms/MainNav",
|
|
10
10
|
component: m,
|
|
11
11
|
parameters: {
|
|
@@ -122,7 +122,7 @@ const U = {
|
|
|
122
122
|
{ id: 12, itemId: "1092-02", description: "Kason Door Closer - Offset", price: "$99.99", quantity: 1, imageUrl: a, availability: "In Stock", availabilityId: "available" }
|
|
123
123
|
]
|
|
124
124
|
};
|
|
125
|
-
function
|
|
125
|
+
function v(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
|
|
@@ -133,9 +133,9 @@ const d = /* @__PURE__ */ b("div", { style: { display: "flex", flexDirection: "c
|
|
|
133
133
|
/* @__PURE__ */ t(s, { size: "xs", children: "Signed in as Ringo" }),
|
|
134
134
|
/* @__PURE__ */ t(u, { href: "/account", "data-popover-close": "true", children: "View Account" }),
|
|
135
135
|
/* @__PURE__ */ t(u, { href: "/orders", "data-popover-close": "true", children: "Order History" }),
|
|
136
|
-
/* @__PURE__ */ t(
|
|
136
|
+
/* @__PURE__ */ t(h, { size: "sm", variant: "secondary", "data-popover-close": "true", onClick: () => alert("Sign out"), children: "Sign Out" })
|
|
137
137
|
] }), n = (e) => {
|
|
138
|
-
const [c, i] =
|
|
138
|
+
const [c, i] = y(!1);
|
|
139
139
|
return /* @__PURE__ */ b(g, { children: [
|
|
140
140
|
/* @__PURE__ */ t(
|
|
141
141
|
m,
|
|
@@ -146,12 +146,12 @@ const d = /* @__PURE__ */ b("div", { style: { display: "flex", flexDirection: "c
|
|
|
146
146
|
}
|
|
147
147
|
),
|
|
148
148
|
/* @__PURE__ */ t(
|
|
149
|
-
|
|
149
|
+
p,
|
|
150
150
|
{
|
|
151
151
|
open: c,
|
|
152
152
|
onClose: () => i(!1),
|
|
153
153
|
cart: e.cart,
|
|
154
|
-
subtotal:
|
|
154
|
+
subtotal: v(e.cart),
|
|
155
155
|
itemPriceLabel: "List Price",
|
|
156
156
|
contactHref: e.contactRoute,
|
|
157
157
|
contactLinkBehavior: "new-tab",
|
|
@@ -161,7 +161,7 @@ const d = /* @__PURE__ */ b("div", { style: { display: "flex", flexDirection: "c
|
|
|
161
161
|
}
|
|
162
162
|
)
|
|
163
163
|
] });
|
|
164
|
-
},
|
|
164
|
+
}, U = {
|
|
165
165
|
args: {
|
|
166
166
|
account: { name: "Ringo", initials: "RS", number: "123456789012" },
|
|
167
167
|
cart: r,
|
|
@@ -179,6 +179,9 @@ const d = /* @__PURE__ */ b("div", { style: { display: "flex", flexDirection: "c
|
|
|
179
179
|
onSearch: (e) => {
|
|
180
180
|
alert(`Search ${e}`);
|
|
181
181
|
},
|
|
182
|
+
onCategoryClick: (e) => {
|
|
183
|
+
alert(`Category ${e.label}`);
|
|
184
|
+
},
|
|
182
185
|
onCartClick: () => {
|
|
183
186
|
},
|
|
184
187
|
// placeholder required by component
|
|
@@ -204,6 +207,9 @@ const d = /* @__PURE__ */ b("div", { style: { display: "flex", flexDirection: "c
|
|
|
204
207
|
onSearch: (e) => {
|
|
205
208
|
alert(`Search ${e}`);
|
|
206
209
|
},
|
|
210
|
+
onCategoryClick: (e) => {
|
|
211
|
+
alert(`Category ${e.label}`);
|
|
212
|
+
},
|
|
207
213
|
onCartClick: () => {
|
|
208
214
|
},
|
|
209
215
|
categories: l,
|
|
@@ -227,6 +233,9 @@ const d = /* @__PURE__ */ b("div", { style: { display: "flex", flexDirection: "c
|
|
|
227
233
|
onSearch: (e) => {
|
|
228
234
|
alert(`Search ${e}`);
|
|
229
235
|
},
|
|
236
|
+
onCategoryClick: (e) => {
|
|
237
|
+
alert(`Category ${e.label}`);
|
|
238
|
+
},
|
|
230
239
|
onCartClick: () => {
|
|
231
240
|
},
|
|
232
241
|
categories: l
|
|
@@ -250,6 +259,9 @@ const d = /* @__PURE__ */ b("div", { style: { display: "flex", flexDirection: "c
|
|
|
250
259
|
onSearch: (e) => {
|
|
251
260
|
alert(`Search ${e}`);
|
|
252
261
|
},
|
|
262
|
+
onCategoryClick: (e) => {
|
|
263
|
+
alert(`Category ${e.label}`);
|
|
264
|
+
},
|
|
253
265
|
onCartClick: () => {
|
|
254
266
|
},
|
|
255
267
|
categories: l,
|
|
@@ -260,9 +272,9 @@ const d = /* @__PURE__ */ b("div", { style: { display: "flex", flexDirection: "c
|
|
|
260
272
|
render: n
|
|
261
273
|
};
|
|
262
274
|
export {
|
|
263
|
-
|
|
275
|
+
U as Authenticated,
|
|
264
276
|
M as Loading,
|
|
265
277
|
L as Unauthenticated,
|
|
266
278
|
D as WithCartItems,
|
|
267
|
-
|
|
279
|
+
q as default
|
|
268
280
|
};
|
|
@@ -21,5 +21,6 @@ export interface ProductProps extends AvailabilityProps {
|
|
|
21
21
|
flat?: boolean;
|
|
22
22
|
size?: Size;
|
|
23
23
|
showQuantity?: boolean;
|
|
24
|
+
onLinkClicked?: (_itemKey: number) => void;
|
|
24
25
|
}
|
|
25
|
-
export declare function Product({ productView, itemKey, partNumber, productDescription, availDescription, availId, contactHref, contactLinkBehavior, productHref, priceLabel, price, imgSrc, attributes, className, onAddToCart, onClose, flat, size, showQuantity, ...otherProps }: ProductProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare function Product({ productView, itemKey, partNumber, productDescription, availDescription, availId, contactHref, contactLinkBehavior, productHref, priceLabel, price, imgSrc, attributes, className, onAddToCart, onClose, flat, size, showQuantity, onLinkClicked, ...otherProps }: ProductProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,97 +1,98 @@
|
|
|
1
1
|
import { jsxs as o, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { Image as
|
|
3
|
-
import { Link as
|
|
2
|
+
import { Image as B } from "../../atoms/Image/Image.js";
|
|
3
|
+
import { Link as A } from "../../atoms/Link/Link.js";
|
|
4
4
|
import { Text as e } from "../../atoms/Text/Text.js";
|
|
5
|
-
import { Availability as
|
|
6
|
-
import { Pricing as
|
|
7
|
-
import { AddToCart as
|
|
8
|
-
import { Icon as
|
|
9
|
-
import { c as
|
|
10
|
-
import '../../assets/Product.css';const
|
|
11
|
-
productCard:
|
|
12
|
-
sm:
|
|
5
|
+
import { Availability as R } from "../../molecules/Availability/Availability.js";
|
|
6
|
+
import { Pricing as $ } from "../../molecules/Pricing/Pricing.js";
|
|
7
|
+
import { AddToCart as D } from "../../molecules/AddToCart/AddToCart.js";
|
|
8
|
+
import { Icon as L } from "../../atoms/Icon/Icon.js";
|
|
9
|
+
import { c as P } from "../../clsx-OuTLNxxd.js";
|
|
10
|
+
import '../../assets/Product.css';const V = "_productCard_nx8r7_3", q = "_sm_nx8r7_15", y = "_productInformation_nx8r7_25", E = "_purchaseInformation_nx8r7_32", F = "_addToCart_nx8r7_40", G = "_addToCartButton_nx8r7_43", J = "_partNumber_nx8r7_53", M = "_partNumberLabel_nx8r7_60", O = "_productTile_nx8r7_64", U = "_topRow_nx8r7_83", W = "_productData_nx8r7_114", X = "_purchase_nx8r7_32", Y = "_attributeContainer_nx8r7_151", Z = "_elevated_nx8r7_199", H = "_noImage_nx8r7_205", r = {
|
|
11
|
+
productCard: V,
|
|
12
|
+
sm: q,
|
|
13
13
|
productInformation: y,
|
|
14
|
-
purchaseInformation:
|
|
15
|
-
addToCart:
|
|
16
|
-
addToCartButton:
|
|
17
|
-
partNumber:
|
|
18
|
-
partNumberLabel:
|
|
19
|
-
productTile:
|
|
20
|
-
topRow:
|
|
21
|
-
productData:
|
|
22
|
-
purchase:
|
|
23
|
-
attributeContainer:
|
|
24
|
-
elevated:
|
|
25
|
-
noImage:
|
|
14
|
+
purchaseInformation: E,
|
|
15
|
+
addToCart: F,
|
|
16
|
+
addToCartButton: G,
|
|
17
|
+
partNumber: J,
|
|
18
|
+
partNumberLabel: M,
|
|
19
|
+
productTile: O,
|
|
20
|
+
topRow: U,
|
|
21
|
+
productData: W,
|
|
22
|
+
purchase: X,
|
|
23
|
+
attributeContainer: Y,
|
|
24
|
+
elevated: Z,
|
|
25
|
+
noImage: H
|
|
26
26
|
};
|
|
27
|
-
function
|
|
28
|
-
productView:
|
|
29
|
-
itemKey:
|
|
30
|
-
partNumber:
|
|
31
|
-
productDescription:
|
|
32
|
-
availDescription:
|
|
33
|
-
availId:
|
|
34
|
-
contactHref:
|
|
35
|
-
contactLinkBehavior:
|
|
36
|
-
productHref:
|
|
37
|
-
priceLabel:
|
|
38
|
-
price:
|
|
27
|
+
function nr({
|
|
28
|
+
productView: j,
|
|
29
|
+
itemKey: d,
|
|
30
|
+
partNumber: c,
|
|
31
|
+
productDescription: h,
|
|
32
|
+
availDescription: x,
|
|
33
|
+
availId: s,
|
|
34
|
+
contactHref: b,
|
|
35
|
+
contactLinkBehavior: N,
|
|
36
|
+
productHref: f,
|
|
37
|
+
priceLabel: C,
|
|
38
|
+
price: m,
|
|
39
39
|
imgSrc: n,
|
|
40
40
|
attributes: u,
|
|
41
|
-
className:
|
|
42
|
-
onAddToCart:
|
|
43
|
-
onClose:
|
|
44
|
-
flat:
|
|
41
|
+
className: T,
|
|
42
|
+
onAddToCart: g,
|
|
43
|
+
onClose: v,
|
|
44
|
+
flat: I,
|
|
45
45
|
size: a = "md",
|
|
46
46
|
showQuantity: p = !0,
|
|
47
|
-
|
|
47
|
+
onLinkClicked: _,
|
|
48
|
+
...w
|
|
48
49
|
}) {
|
|
49
|
-
const
|
|
50
|
-
return
|
|
50
|
+
const l = a === "sm" ? "xs" : "sm";
|
|
51
|
+
return j === "Card" ? /* @__PURE__ */ o(
|
|
51
52
|
"div",
|
|
52
53
|
{
|
|
53
|
-
className:
|
|
54
|
+
className: P(
|
|
54
55
|
r.productCard,
|
|
55
56
|
a && r[a],
|
|
56
|
-
|
|
57
|
-
!
|
|
57
|
+
T,
|
|
58
|
+
!I && r.elevated,
|
|
58
59
|
!n && r.noImage
|
|
59
60
|
),
|
|
60
|
-
...
|
|
61
|
+
...w,
|
|
61
62
|
children: [
|
|
62
63
|
n && /* @__PURE__ */ t(
|
|
63
|
-
|
|
64
|
+
B,
|
|
64
65
|
{
|
|
65
66
|
src: n,
|
|
66
|
-
alt: `${
|
|
67
|
+
alt: `${c} product image`,
|
|
67
68
|
height: a === "sm" ? 78 : 96,
|
|
68
69
|
width: a === "sm" ? 78 : 96
|
|
69
70
|
}
|
|
70
71
|
),
|
|
71
72
|
/* @__PURE__ */ o("div", { className: r.productInformation, children: [
|
|
72
|
-
/* @__PURE__ */ t(
|
|
73
|
+
/* @__PURE__ */ t(A, { onClick: () => _ == null ? void 0 : _(d), size: a, href: f, children: h }),
|
|
73
74
|
/* @__PURE__ */ o("div", { className: r.partNumber, children: [
|
|
74
|
-
/* @__PURE__ */ t(e, { size:
|
|
75
|
-
/* @__PURE__ */ t(e, { size:
|
|
75
|
+
/* @__PURE__ */ t(e, { size: l, className: r.partNumberLabel, children: "Part #" }),
|
|
76
|
+
/* @__PURE__ */ t(e, { size: l, weight: "semibold", children: c })
|
|
76
77
|
] })
|
|
77
78
|
] }),
|
|
78
79
|
/* @__PURE__ */ o("div", { className: r.purchaseInformation, children: [
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
s && /* @__PURE__ */ t(
|
|
81
|
+
R,
|
|
81
82
|
{
|
|
82
|
-
availId:
|
|
83
|
-
availDescription:
|
|
84
|
-
contactHref:
|
|
85
|
-
contactLinkBehavior:
|
|
83
|
+
availId: s,
|
|
84
|
+
availDescription: x,
|
|
85
|
+
contactHref: b,
|
|
86
|
+
contactLinkBehavior: N
|
|
86
87
|
}
|
|
87
88
|
),
|
|
88
|
-
|
|
89
|
+
m && /* @__PURE__ */ t($, { pricingLabel: C, price: m })
|
|
89
90
|
] }),
|
|
90
91
|
/* @__PURE__ */ t(
|
|
91
|
-
|
|
92
|
+
D,
|
|
92
93
|
{
|
|
93
|
-
itemKey:
|
|
94
|
-
onAdd:
|
|
94
|
+
itemKey: d,
|
|
95
|
+
onAdd: g,
|
|
95
96
|
className: r.addToCart,
|
|
96
97
|
addButtonClassName: r.addToCartButton,
|
|
97
98
|
addButtonVariant: p ? "cta-primary" : "secondary",
|
|
@@ -103,18 +104,18 @@ function or({
|
|
|
103
104
|
)
|
|
104
105
|
]
|
|
105
106
|
}
|
|
106
|
-
) : /* @__PURE__ */ o("div", { className:
|
|
107
|
+
) : /* @__PURE__ */ o("div", { className: P(
|
|
107
108
|
r.productTile,
|
|
108
|
-
|
|
109
|
+
T,
|
|
109
110
|
a && r[a],
|
|
110
|
-
!
|
|
111
|
+
!I && r.elevated,
|
|
111
112
|
!n && r.noImage
|
|
112
|
-
), ...
|
|
113
|
+
), ...w, children: [
|
|
113
114
|
n && /* @__PURE__ */ t(
|
|
114
|
-
|
|
115
|
+
B,
|
|
115
116
|
{
|
|
116
117
|
src: n,
|
|
117
|
-
alt: `${
|
|
118
|
+
alt: `${c} product image`,
|
|
118
119
|
height: a === "sm" ? 86 : 108,
|
|
119
120
|
width: a === "sm" ? 86 : 108
|
|
120
121
|
}
|
|
@@ -122,39 +123,39 @@ function or({
|
|
|
122
123
|
/* @__PURE__ */ o("div", { className: r.productData, children: [
|
|
123
124
|
/* @__PURE__ */ o("div", { className: r.topRow, children: [
|
|
124
125
|
/* @__PURE__ */ o("div", { className: r.productInformation, children: [
|
|
125
|
-
/* @__PURE__ */ t(
|
|
126
|
+
/* @__PURE__ */ t(A, { size: a, href: f, children: h }),
|
|
126
127
|
/* @__PURE__ */ o("div", { className: r.partNumber, children: [
|
|
127
|
-
/* @__PURE__ */ t(e, { size:
|
|
128
|
-
/* @__PURE__ */ t(e, { size:
|
|
128
|
+
/* @__PURE__ */ t(e, { size: l, className: r.partNumberLabel, children: "Part #" }),
|
|
129
|
+
/* @__PURE__ */ t(e, { size: l, weight: "semibold", children: c })
|
|
129
130
|
] })
|
|
130
131
|
] }),
|
|
131
|
-
|
|
132
|
+
v && /* @__PURE__ */ t("button", { onClick: () => v(d), children: /* @__PURE__ */ t(L, { size: "sm", iconKey: "fa-light fa-xmark" }) })
|
|
132
133
|
] }),
|
|
133
134
|
/* @__PURE__ */ o("div", { className: r.purchase, children: [
|
|
134
135
|
/* @__PURE__ */ o("div", { className: r.purchaseInformation, children: [
|
|
135
|
-
|
|
136
|
-
|
|
136
|
+
s && /* @__PURE__ */ t(
|
|
137
|
+
R,
|
|
137
138
|
{
|
|
138
|
-
availId:
|
|
139
|
-
availDescription:
|
|
140
|
-
contactHref:
|
|
141
|
-
contactLinkBehavior:
|
|
139
|
+
availId: s,
|
|
140
|
+
availDescription: x,
|
|
141
|
+
contactHref: b,
|
|
142
|
+
contactLinkBehavior: N
|
|
142
143
|
}
|
|
143
144
|
),
|
|
144
|
-
|
|
145
|
+
m && /* @__PURE__ */ t($, { pricingLabel: C, price: m })
|
|
145
146
|
] }),
|
|
146
|
-
/* @__PURE__ */ t(
|
|
147
|
+
/* @__PURE__ */ t(D, { size: a, itemKey: d, onAdd: g, className: r.addToCart, addButtonClassName: r.addToCartButton })
|
|
147
148
|
] }),
|
|
148
|
-
u && u.length > 0 && /* @__PURE__ */ t("ul", { className: r.attributeContainer, children: u.map((
|
|
149
|
+
u && u.length > 0 && /* @__PURE__ */ t("ul", { className: r.attributeContainer, children: u.map((i) => /* @__PURE__ */ o("li", { children: [
|
|
149
150
|
/* @__PURE__ */ o(e, { size: "xs", weight: "light", children: [
|
|
150
|
-
|
|
151
|
+
i.label,
|
|
151
152
|
":"
|
|
152
153
|
] }),
|
|
153
|
-
/* @__PURE__ */ t(e, { size: "xs", weight: "semibold", children:
|
|
154
|
-
] }, `${
|
|
154
|
+
/* @__PURE__ */ t(e, { size: "xs", weight: "semibold", children: i.value })
|
|
155
|
+
] }, `${i.label}.${i.value}`)) })
|
|
155
156
|
] })
|
|
156
157
|
] });
|
|
157
158
|
}
|
|
158
159
|
export {
|
|
159
|
-
|
|
160
|
+
nr as Product
|
|
160
161
|
};
|