@caseparts-org/caseblocks 0.0.170 → 0.0.172
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/AddToCartPart.css +1 -0
- package/dist/main-client.d.ts +2 -0
- package/dist/main-client.js +42 -40
- package/dist/molecules/AddToCartPart/AddToCartPart.d.ts +18 -0
- package/dist/molecules/AddToCartPart/AddToCartPart.js +114 -0
- package/dist/molecules/AddToCartPart/AddToCartPart.stories.d.ts +62 -0
- package/dist/molecules/AddToCartPart/AddToCartPart.stories.js +61 -0
- package/dist/molecules/Cart/CartPart.d.ts +2 -1
- package/dist/molecules/Cart/CartPart.js +53 -49
- package/dist/molecules/Cart/CartSlideInPanel.d.ts +2 -1
- package/dist/molecules/Cart/CartSlideInPanel.js +41 -39
- package/dist/molecules/Logo/Logo.js +12 -12
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._container_srwcp_1{width:min(100%,360px);display:flex;flex-direction:column;gap:var(--spacing-spacing-2xs);padding:var(--spacing-spacing-2xs);background:var(--surface-surface-primary, #fff);border:1px solid var(--border-border-primary, #dfdfdf);border-radius:var(--border-radius-md);box-shadow:2px 4px 12px #00000026;box-sizing:border-box}._header_srwcp_14{display:flex;align-items:center;justify-content:space-between;gap:var(--spacing-spacing-2xs)}._confirmation_srwcp_21{display:flex;align-items:center;gap:var(--spacing-spacing-3xs)}._confirmationIcon_srwcp_27{color:var(--icons-icon-accent, var(--text-text-accent))}._dismissButton_srwcp_31{display:flex;align-items:center;justify-content:center;width:min-content;height:min-content;padding:0;margin:0;border:none;background:transparent;color:var(--text-text-quaternary);cursor:pointer}._content_srwcp_45{display:grid;grid-template-columns:auto 1fr;gap:var(--spacing-0-5);align-items:start}._mediaSlot_srwcp_52{width:56px;height:56px;display:flex;align-items:center;justify-content:center;border-radius:var(--border-radius-md);background:var(--surface-surface-primary, #fff);overflow:hidden;flex-shrink:0}._image_srwcp_64{object-fit:contain}._imageFallback_srwcp_68{display:flex;align-items:center;justify-content:center;width:100%;height:100%;color:var(--text-text-quaternary)}._summary_srwcp_77{display:flex;flex-direction:column;gap:var(--spacing-spacing-3xs);min-width:0}._summary_srwcp_77 p{margin:0;padding:0;word-wrap:break-word;white-space:normal;overflow-wrap:break-word}._titleBlock_srwcp_92{display:flex;flex-direction:column;align-items:flex-start}._purchaseRow_srwcp_98{display:grid;grid-template-columns:auto 1fr;gap:var(--spacing-spacing-2xs);align-items:end}._quantityBlock_srwcp_105{display:flex;flex-direction:column;align-items:flex-start}._pricing_srwcp_111{justify-self:end}._checkoutButton_srwcp_115{width:100%}@media (max-width: 480px){._container_srwcp_1{width:min(100%,320px)}}
|
package/dist/main-client.d.ts
CHANGED
|
@@ -21,6 +21,8 @@ export type { ToggleViewProps, ToggleOptionProps, ToggleOptionBaseProps, } from
|
|
|
21
21
|
export type { ShoppingCart, CartItem } from './molecules/Cart/Cart';
|
|
22
22
|
export { CartPart } from './molecules/Cart/CartPart';
|
|
23
23
|
export type { CartPartProps } from './molecules/Cart/CartPart';
|
|
24
|
+
export { AddToCartPart } from './molecules/AddToCartPart/AddToCartPart';
|
|
25
|
+
export type { AddToCartPartProps } from './molecules/AddToCartPart/AddToCartPart';
|
|
24
26
|
export { CartSlideInPanel } from './molecules/Cart/CartSlideInPanel';
|
|
25
27
|
export type { CartSlideInPanelProps } from './molecules/Cart/CartSlideInPanel';
|
|
26
28
|
export type { StatefulButtonProps } from './molecules/StatefulButton/StatefulButton';
|
package/dist/main-client.js
CHANGED
|
@@ -5,10 +5,10 @@ import { Head as i } from "./atoms/Root/Head.js";
|
|
|
5
5
|
import { Icon as l } from "./atoms/Icon/Icon.js";
|
|
6
6
|
import { Root as u } from "./atoms/Root/Root.js";
|
|
7
7
|
import { Separator as s } from "./atoms/Separator/Separator.js";
|
|
8
|
-
import { Text as
|
|
8
|
+
import { Text as g } from "./atoms/Text/Text.js";
|
|
9
9
|
import { Input as S } from "./atoms/Input/Input.js";
|
|
10
|
-
import { ToggleSwitch as
|
|
11
|
-
import { Link as
|
|
10
|
+
import { ToggleSwitch as T } from "./atoms/ToggleSwitch/ToggleSwitch.js";
|
|
11
|
+
import { Link as A } from "./atoms/Link/Link.js";
|
|
12
12
|
import { linkClassName as B } from "./atoms/Link/linkClassName.js";
|
|
13
13
|
import { configureLink as h, routerOverride as v } from "./atoms/Link/configureLink.js";
|
|
14
14
|
import { LinkButton as b } from "./atoms/LinkButton/LinkButton.js";
|
|
@@ -31,73 +31,75 @@ import { Markdown as ar } from "./atoms/Markdown/Markdown.js";
|
|
|
31
31
|
import { PreprocessedMarkdown as nr } from "./atoms/Markdown/PreprocessedMarkdown.js";
|
|
32
32
|
import { usePreprocessedMarkdown as dr } from "./atoms/Markdown/usePreprocessedMarkdown.js";
|
|
33
33
|
import { Tooltip as cr } from "./atoms/Tooltip/Tooltip.js";
|
|
34
|
-
import { Popover as
|
|
34
|
+
import { Popover as Cr } from "./atoms/Popover/Popover.js";
|
|
35
35
|
import { Account as kr } from "./molecules/Account/Account.js";
|
|
36
36
|
import { Chip as Pr } from "./molecules/Chip/Chip.js";
|
|
37
|
-
import { ToggleView as
|
|
38
|
-
import { CartPart as
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
37
|
+
import { ToggleView as wr } from "./molecules/ToggleView/ToggleView.js";
|
|
38
|
+
import { CartPart as Ir } from "./molecules/Cart/CartPart.js";
|
|
39
|
+
import { AddToCartPart as Mr } from "./molecules/AddToCartPart/AddToCartPart.js";
|
|
40
|
+
import { CartSlideInPanel as vr } from "./molecules/Cart/CartSlideInPanel.js";
|
|
41
|
+
import { StatefulButton as br } from "./molecules/StatefulButton/StatefulButton.js";
|
|
42
|
+
import { AnimatedCheckMark as Fr } from "./molecules/StatefulButton/AnimatedCheckmark.js";
|
|
43
|
+
import { AddToCart as Nr } from "./molecules/AddToCart/AddToCart.js";
|
|
44
|
+
import { Modal as zr } from "./molecules/Modal/Modal.js";
|
|
45
|
+
import { ImageViewer as Er } from "./molecules/ImageViewer/ImageViewer.js";
|
|
46
|
+
import { T as Or } from "./Table-BX4PtCNE.js";
|
|
47
|
+
import { Error as Rr } from "./molecules/Error/Error.js";
|
|
48
|
+
import { MainNav as jr } from "./organisms/MainNav/MainNav.js";
|
|
49
|
+
import { ChipSelector as Jr } from "./organisms/ChipSelector/ChipSelector.js";
|
|
50
|
+
import { Product as Ur } from "./organisms/Product/Product.js";
|
|
51
|
+
import { Carousel as Xr } from "./organisms/Carousel/Carousel.js";
|
|
52
|
+
import { Footer as _r } from "./organisms/Footer/Footer.js";
|
|
53
|
+
import { default as ro } from "./organisms/SpinZoomViewer/SpinZoomViewer.js";
|
|
53
54
|
export {
|
|
54
55
|
kr as Account,
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
Nr as AddToCart,
|
|
57
|
+
Mr as AddToCartPart,
|
|
58
|
+
Fr as AnimatedCheckMark,
|
|
57
59
|
j as Availability,
|
|
58
60
|
J as Avatar,
|
|
59
61
|
U as BannerCard,
|
|
60
62
|
_ as Breadcrumbs,
|
|
61
63
|
e as Button,
|
|
62
64
|
X as CardLink,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
Xr as Carousel,
|
|
66
|
+
Ir as CartPart,
|
|
67
|
+
vr as CartSlideInPanel,
|
|
66
68
|
Pr as Chip,
|
|
67
|
-
|
|
69
|
+
Jr as ChipSelector,
|
|
68
70
|
f as Column,
|
|
69
71
|
rr as Disclaimer,
|
|
70
|
-
|
|
72
|
+
Rr as Error,
|
|
71
73
|
p as Flex,
|
|
72
|
-
|
|
74
|
+
_r as Footer,
|
|
73
75
|
x as Grid,
|
|
74
76
|
i as Head,
|
|
75
77
|
pr as HorizontalScroll,
|
|
76
78
|
l as Icon,
|
|
77
|
-
|
|
79
|
+
Er as ImageViewer,
|
|
78
80
|
S as Input,
|
|
79
|
-
|
|
81
|
+
A as Link,
|
|
80
82
|
b as LinkButton,
|
|
81
83
|
z as Logo,
|
|
82
|
-
|
|
84
|
+
jr as MainNav,
|
|
83
85
|
ar as Markdown,
|
|
84
|
-
|
|
86
|
+
zr as Modal,
|
|
85
87
|
er as NotFound,
|
|
86
|
-
|
|
88
|
+
Cr as Popover,
|
|
87
89
|
nr as PreprocessedMarkdown,
|
|
88
90
|
R as Pricing,
|
|
89
|
-
|
|
91
|
+
Ur as Product,
|
|
90
92
|
O as QuantityInput,
|
|
91
93
|
u as Root,
|
|
92
94
|
E as SearchBox,
|
|
93
95
|
s as Separator,
|
|
94
96
|
fr as SlideInPanel,
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
97
|
+
ro as SpinZoomViewer,
|
|
98
|
+
br as StatefulButton,
|
|
99
|
+
Or as Table,
|
|
100
|
+
g as Text,
|
|
101
|
+
T as ToggleSwitch,
|
|
102
|
+
wr as ToggleView,
|
|
101
103
|
cr as Tooltip,
|
|
102
104
|
F as configureImage,
|
|
103
105
|
h as configureLink,
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface AddToCartPartProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
|
|
3
|
+
imageUrl?: string;
|
|
4
|
+
imageAlt?: string;
|
|
5
|
+
title: React.ReactNode;
|
|
6
|
+
titleHref?: string;
|
|
7
|
+
partNumber?: string | number;
|
|
8
|
+
partNumberLabel?: React.ReactNode;
|
|
9
|
+
quantity: number;
|
|
10
|
+
quantityLabel?: string;
|
|
11
|
+
priceLabel?: string;
|
|
12
|
+
price?: string;
|
|
13
|
+
confirmationText?: React.ReactNode;
|
|
14
|
+
checkoutLabel?: React.ReactNode;
|
|
15
|
+
onCheckout?: () => void;
|
|
16
|
+
onDismiss?: () => void;
|
|
17
|
+
}
|
|
18
|
+
export declare function AddToCartPart({ imageUrl, imageAlt, title, titleHref, partNumber, partNumberLabel, quantity, quantityLabel, priceLabel, price, confirmationText, checkoutLabel, onCheckout, onDismiss, className, ...otherProps }: AddToCartPartProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { jsxs as e, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { c as B } from "../../clsx-OuTLNxxd.js";
|
|
3
|
+
import { Button as N } from "../../atoms/Button/Button.js";
|
|
4
|
+
import { Icon as a } from "../../atoms/Icon/Icon.js";
|
|
5
|
+
import { Image as b } from "../../atoms/Image/Image.js";
|
|
6
|
+
import { Link as v } from "../../atoms/Link/Link.js";
|
|
7
|
+
import { Text as t } from "../../atoms/Text/Text.js";
|
|
8
|
+
import { Pricing as x } from "../Pricing/Pricing.js";
|
|
9
|
+
import '../../assets/AddToCartPart.css';const z = "_container_srwcp_1", q = "_header_srwcp_14", I = "_confirmation_srwcp_21", P = "_confirmationIcon_srwcp_27", F = "_dismissButton_srwcp_31", R = "_content_srwcp_45", S = "_mediaSlot_srwcp_52", T = "_image_srwcp_64", C = "_imageFallback_srwcp_68", K = "_summary_srwcp_77", L = "_titleBlock_srwcp_92", j = "_purchaseRow_srwcp_98", A = "_quantityBlock_srwcp_105", Q = "_pricing_srwcp_111", D = "_checkoutButton_srwcp_115", i = {
|
|
10
|
+
container: z,
|
|
11
|
+
header: q,
|
|
12
|
+
confirmation: I,
|
|
13
|
+
confirmationIcon: P,
|
|
14
|
+
dismissButton: F,
|
|
15
|
+
content: R,
|
|
16
|
+
mediaSlot: S,
|
|
17
|
+
image: T,
|
|
18
|
+
imageFallback: C,
|
|
19
|
+
summary: K,
|
|
20
|
+
titleBlock: L,
|
|
21
|
+
purchaseRow: j,
|
|
22
|
+
quantityBlock: A,
|
|
23
|
+
pricing: Q,
|
|
24
|
+
checkoutButton: D
|
|
25
|
+
};
|
|
26
|
+
function Y({
|
|
27
|
+
imageUrl: o,
|
|
28
|
+
imageAlt: _ = "Product image",
|
|
29
|
+
title: s,
|
|
30
|
+
titleHref: n,
|
|
31
|
+
partNumber: r,
|
|
32
|
+
partNumberLabel: h = "Part #",
|
|
33
|
+
quantity: u,
|
|
34
|
+
quantityLabel: p = "Qty",
|
|
35
|
+
priceLabel: f = "List Price",
|
|
36
|
+
price: m,
|
|
37
|
+
confirmationText: g = "Added to cart",
|
|
38
|
+
checkoutLabel: k = "Checkout",
|
|
39
|
+
onCheckout: l,
|
|
40
|
+
onDismiss: d,
|
|
41
|
+
className: w,
|
|
42
|
+
...y
|
|
43
|
+
}) {
|
|
44
|
+
return /* @__PURE__ */ e("div", { className: B(i.container, w), ...y, children: [
|
|
45
|
+
/* @__PURE__ */ e("div", { className: i.header, children: [
|
|
46
|
+
/* @__PURE__ */ e("div", { className: i.confirmation, children: [
|
|
47
|
+
/* @__PURE__ */ c(
|
|
48
|
+
a,
|
|
49
|
+
{
|
|
50
|
+
iconKey: "fa-regular fa-cart-circle-check",
|
|
51
|
+
size: "md",
|
|
52
|
+
className: i.confirmationIcon,
|
|
53
|
+
"aria-hidden": "true"
|
|
54
|
+
}
|
|
55
|
+
),
|
|
56
|
+
/* @__PURE__ */ c(t, { size: "sm", weight: "semibold", children: g })
|
|
57
|
+
] }),
|
|
58
|
+
d && /* @__PURE__ */ c(
|
|
59
|
+
"button",
|
|
60
|
+
{
|
|
61
|
+
type: "button",
|
|
62
|
+
onClick: d,
|
|
63
|
+
className: i.dismissButton,
|
|
64
|
+
"aria-label": "Dismiss add to cart message",
|
|
65
|
+
children: /* @__PURE__ */ c(a, { iconKey: "fa-regular fa-xmark", size: "sm" })
|
|
66
|
+
}
|
|
67
|
+
)
|
|
68
|
+
] }),
|
|
69
|
+
/* @__PURE__ */ e("div", { className: i.content, children: [
|
|
70
|
+
/* @__PURE__ */ c("div", { className: i.mediaSlot, children: o ? /* @__PURE__ */ c(
|
|
71
|
+
b,
|
|
72
|
+
{
|
|
73
|
+
height: 56,
|
|
74
|
+
width: 56,
|
|
75
|
+
src: o,
|
|
76
|
+
alt: _,
|
|
77
|
+
className: i.image
|
|
78
|
+
}
|
|
79
|
+
) : /* @__PURE__ */ c("div", { className: i.imageFallback, "aria-hidden": "true", children: /* @__PURE__ */ c(a, { iconKey: "fa-regular fa-box-open", size: "md" }) }) }),
|
|
80
|
+
/* @__PURE__ */ e("div", { className: i.summary, children: [
|
|
81
|
+
/* @__PURE__ */ e("div", { className: i.titleBlock, children: [
|
|
82
|
+
/* @__PURE__ */ c(t, { size: "sm", weight: "semibold", children: n ? /* @__PURE__ */ c(v, { href: n, children: s }) : s }),
|
|
83
|
+
r != null && /* @__PURE__ */ e(t, { size: "sm", children: [
|
|
84
|
+
/* @__PURE__ */ c(t, { colorToken: "quaternary", size: "xs", children: h }),
|
|
85
|
+
" ",
|
|
86
|
+
r
|
|
87
|
+
] })
|
|
88
|
+
] }),
|
|
89
|
+
/* @__PURE__ */ e("div", { className: i.purchaseRow, children: [
|
|
90
|
+
/* @__PURE__ */ e("div", { className: i.quantityBlock, children: [
|
|
91
|
+
/* @__PURE__ */ c(t, { size: "xxs", colorToken: "quaternary", children: p }),
|
|
92
|
+
/* @__PURE__ */ c(t, { size: "sm", weight: "semibold", children: u })
|
|
93
|
+
] }),
|
|
94
|
+
m && /* @__PURE__ */ c(x, { pricingLabel: f, price: m, className: i.pricing })
|
|
95
|
+
] })
|
|
96
|
+
] })
|
|
97
|
+
] }),
|
|
98
|
+
/* @__PURE__ */ c(
|
|
99
|
+
N,
|
|
100
|
+
{
|
|
101
|
+
type: "button",
|
|
102
|
+
onClick: l,
|
|
103
|
+
disabled: !l,
|
|
104
|
+
variant: "cta-primary",
|
|
105
|
+
size: "md",
|
|
106
|
+
className: i.checkoutButton,
|
|
107
|
+
children: k
|
|
108
|
+
}
|
|
109
|
+
)
|
|
110
|
+
] });
|
|
111
|
+
}
|
|
112
|
+
export {
|
|
113
|
+
Y as AddToCartPart
|
|
114
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import { AddToCartPart, AddToCartPartProps } from './AddToCartPart';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof AddToCartPart;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
argTypes: {
|
|
10
|
+
title: {
|
|
11
|
+
control: "text";
|
|
12
|
+
};
|
|
13
|
+
titleHref: {
|
|
14
|
+
control: "text";
|
|
15
|
+
};
|
|
16
|
+
partNumber: {
|
|
17
|
+
control: "text";
|
|
18
|
+
};
|
|
19
|
+
partNumberLabel: {
|
|
20
|
+
control: "text";
|
|
21
|
+
};
|
|
22
|
+
quantity: {
|
|
23
|
+
control: "number";
|
|
24
|
+
};
|
|
25
|
+
quantityLabel: {
|
|
26
|
+
control: "text";
|
|
27
|
+
};
|
|
28
|
+
priceLabel: {
|
|
29
|
+
control: "text";
|
|
30
|
+
};
|
|
31
|
+
price: {
|
|
32
|
+
control: "text";
|
|
33
|
+
};
|
|
34
|
+
imageUrl: {
|
|
35
|
+
control: "text";
|
|
36
|
+
};
|
|
37
|
+
imageAlt: {
|
|
38
|
+
control: "text";
|
|
39
|
+
};
|
|
40
|
+
confirmationText: {
|
|
41
|
+
control: "text";
|
|
42
|
+
};
|
|
43
|
+
checkoutLabel: {
|
|
44
|
+
control: "text";
|
|
45
|
+
};
|
|
46
|
+
onCheckout: {
|
|
47
|
+
action: string;
|
|
48
|
+
};
|
|
49
|
+
onDismiss: {
|
|
50
|
+
action: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
args: AddToCartPartProps;
|
|
54
|
+
tags: string[];
|
|
55
|
+
};
|
|
56
|
+
export default meta;
|
|
57
|
+
type Story = StoryObj<typeof meta>;
|
|
58
|
+
export declare const Default: Story;
|
|
59
|
+
export declare const WithoutImage: Story;
|
|
60
|
+
export declare const WithoutPrice: Story;
|
|
61
|
+
export declare const NoDismiss: Story;
|
|
62
|
+
export declare const CustomPartLabel: Story;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { AddToCartPart as t } from "./AddToCartPart.js";
|
|
2
|
+
const o = {
|
|
3
|
+
title: "Case Parts/Molecules/AddToCartPart",
|
|
4
|
+
component: t,
|
|
5
|
+
parameters: { layout: "centered" },
|
|
6
|
+
argTypes: {
|
|
7
|
+
title: { control: "text" },
|
|
8
|
+
titleHref: { control: "text" },
|
|
9
|
+
partNumber: { control: "text" },
|
|
10
|
+
partNumberLabel: { control: "text" },
|
|
11
|
+
quantity: { control: "number" },
|
|
12
|
+
quantityLabel: { control: "text" },
|
|
13
|
+
priceLabel: { control: "text" },
|
|
14
|
+
price: { control: "text" },
|
|
15
|
+
imageUrl: { control: "text" },
|
|
16
|
+
imageAlt: { control: "text" },
|
|
17
|
+
confirmationText: { control: "text" },
|
|
18
|
+
checkoutLabel: { control: "text" },
|
|
19
|
+
onCheckout: { action: "checkoutClicked" },
|
|
20
|
+
onDismiss: { action: "dismissClicked" }
|
|
21
|
+
},
|
|
22
|
+
args: {
|
|
23
|
+
title: "Kason 1092 Hydraulic Door Closer",
|
|
24
|
+
titleHref: "/part/1092-01/Kason-1092-Hydraulic-Door-Closer",
|
|
25
|
+
partNumber: "1092-01",
|
|
26
|
+
partNumberLabel: "Part #",
|
|
27
|
+
quantity: 2,
|
|
28
|
+
quantityLabel: "Qty",
|
|
29
|
+
priceLabel: "List Price",
|
|
30
|
+
price: "$129.99",
|
|
31
|
+
imageUrl: "https://dev.caseparts.com/graphics/photos/R-23_IMG_2009.png",
|
|
32
|
+
confirmationText: "Added to cart",
|
|
33
|
+
checkoutLabel: "Checkout"
|
|
34
|
+
},
|
|
35
|
+
tags: ["autodocs"]
|
|
36
|
+
}, r = {}, a = {
|
|
37
|
+
args: {
|
|
38
|
+
imageUrl: void 0
|
|
39
|
+
}
|
|
40
|
+
}, c = {
|
|
41
|
+
args: {
|
|
42
|
+
price: void 0
|
|
43
|
+
}
|
|
44
|
+
}, i = {
|
|
45
|
+
args: {
|
|
46
|
+
onDismiss: void 0
|
|
47
|
+
}
|
|
48
|
+
}, s = {
|
|
49
|
+
args: {
|
|
50
|
+
partNumberLabel: "Specs",
|
|
51
|
+
partNumber: '22" x 29" x 63"'
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
export {
|
|
55
|
+
s as CustomPartLabel,
|
|
56
|
+
r as Default,
|
|
57
|
+
i as NoDismiss,
|
|
58
|
+
a as WithoutImage,
|
|
59
|
+
c as WithoutPrice,
|
|
60
|
+
o as default
|
|
61
|
+
};
|
|
@@ -5,6 +5,7 @@ export interface CartPartProps extends Omit<React.LiHTMLAttributes<HTMLLIElement
|
|
|
5
5
|
imageAlt?: string;
|
|
6
6
|
title: React.ReactNode;
|
|
7
7
|
titleHref?: string;
|
|
8
|
+
onTitleNavigate?: React.MouseEventHandler<HTMLAnchorElement>;
|
|
8
9
|
partNumber?: string | number;
|
|
9
10
|
custom?: boolean;
|
|
10
11
|
availabilityId?: string;
|
|
@@ -17,4 +18,4 @@ export interface CartPartProps extends Omit<React.LiHTMLAttributes<HTMLLIElement
|
|
|
17
18
|
onQuantityChange?: (_quantity: number) => void;
|
|
18
19
|
onRemove?: () => void;
|
|
19
20
|
}
|
|
20
|
-
export declare function CartPart({ imageUrl, imageAlt, title, titleHref, partNumber, custom, availabilityId, availability, contactHref, contactLinkBehavior, priceLabel, price, quantity, onQuantityChange, onRemove, className, ...otherProps }: CartPartProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare function CartPart({ imageUrl, imageAlt, title, titleHref, onTitleNavigate, partNumber, custom, availabilityId, availability, contactHref, contactLinkBehavior, priceLabel, price, quantity, onQuantityChange, onRemove, className, ...otherProps }: CartPartProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,63 +1,67 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Link as
|
|
3
|
-
import { Text as
|
|
4
|
-
import { Image as
|
|
5
|
-
import { Availability as
|
|
6
|
-
import { Pricing as
|
|
7
|
-
import { QuantityInput as
|
|
8
|
-
import { Icon as
|
|
9
|
-
import { c as
|
|
10
|
-
import { s as
|
|
11
|
-
function
|
|
12
|
-
imageUrl:
|
|
1
|
+
import { jsxs as t, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { Link as K } from "../../atoms/Link/Link.js";
|
|
3
|
+
import { Text as c } from "../../atoms/Text/Text.js";
|
|
4
|
+
import { Image as N } from "../../atoms/Image/Image.js";
|
|
5
|
+
import { Availability as w } from "../Availability/Availability.js";
|
|
6
|
+
import { Pricing as S } from "../Pricing/Pricing.js";
|
|
7
|
+
import { QuantityInput as C } from "../QuantityInput/QuantityInput.js";
|
|
8
|
+
import { Icon as L } from "../../atoms/Icon/Icon.js";
|
|
9
|
+
import { c as j } from "../../clsx-OuTLNxxd.js";
|
|
10
|
+
import { s as i } from "../../Cart.module-DzPBP5QJ.js";
|
|
11
|
+
function F({
|
|
12
|
+
imageUrl: u,
|
|
13
13
|
imageAlt: p = "Product image",
|
|
14
14
|
title: m,
|
|
15
15
|
titleHref: s,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
16
|
+
onTitleNavigate: a,
|
|
17
|
+
partNumber: l,
|
|
18
|
+
custom: y,
|
|
19
|
+
availabilityId: I,
|
|
20
|
+
availability: o,
|
|
21
|
+
contactHref: b,
|
|
22
|
+
contactLinkBehavior: g = "new-tab",
|
|
23
|
+
priceLabel: x = "List Price",
|
|
24
|
+
price: n,
|
|
25
|
+
quantity: d,
|
|
26
|
+
onQuantityChange: f,
|
|
27
|
+
onRemove: h,
|
|
28
|
+
className: P,
|
|
29
|
+
...k
|
|
29
30
|
}) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
31
|
+
function z(e) {
|
|
32
|
+
e.defaultPrevented || e.button === 0 && (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey || e.currentTarget.target && e.currentTarget.target !== "_self" || a == null || a(e));
|
|
33
|
+
}
|
|
34
|
+
return /* @__PURE__ */ t("li", { className: j(i.cartItem, P), ...k, children: [
|
|
35
|
+
/* @__PURE__ */ r(N, { height: 50, width: 50, src: u || "", alt: p, className: i.itemImage }),
|
|
36
|
+
/* @__PURE__ */ t("div", { children: [
|
|
37
|
+
/* @__PURE__ */ t("div", { className: i.topRow, children: [
|
|
38
|
+
/* @__PURE__ */ t("div", { className: i.itemInfo, children: [
|
|
39
|
+
/* @__PURE__ */ r(c, { size: "sm", weight: "semibold", children: s ? /* @__PURE__ */ r(K, { href: s, onClick: z, children: m }) : m }),
|
|
40
|
+
l != null && /* @__PURE__ */ t(c, { size: "sm", children: [
|
|
41
|
+
/* @__PURE__ */ r(c, { colorToken: "quaternary", size: "xs", children: y ? "Specs " : "Part # " }),
|
|
42
|
+
l
|
|
39
43
|
] })
|
|
40
44
|
] }),
|
|
41
|
-
|
|
45
|
+
h && /* @__PURE__ */ r("button", { onClick: h, className: i.removeItem, "aria-label": "Remove item", type: "button", children: /* @__PURE__ */ r(L, { iconKey: "fa-regular fa-trash", size: "sm" }) })
|
|
42
46
|
] }),
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
|
|
47
|
+
/* @__PURE__ */ t("div", { className: i.itemManagement, children: [
|
|
48
|
+
/* @__PURE__ */ t("div", { className: i.purchaseInformation, children: [
|
|
49
|
+
/* @__PURE__ */ r("div", { className: i.availabilitySlot, children: o && /* @__PURE__ */ r(
|
|
50
|
+
w,
|
|
47
51
|
{
|
|
48
|
-
availId:
|
|
49
|
-
availDescription:
|
|
50
|
-
contactHref:
|
|
51
|
-
contactLinkBehavior:
|
|
52
|
+
availId: I || "",
|
|
53
|
+
availDescription: o,
|
|
54
|
+
contactHref: b || "",
|
|
55
|
+
contactLinkBehavior: g
|
|
52
56
|
}
|
|
53
57
|
) }),
|
|
54
|
-
/* @__PURE__ */
|
|
58
|
+
/* @__PURE__ */ r("div", { className: i.priceSlot, children: n && /* @__PURE__ */ r(S, { pricingLabel: x, price: n }) })
|
|
55
59
|
] }),
|
|
56
|
-
typeof
|
|
57
|
-
|
|
60
|
+
typeof d == "number" && f && /* @__PURE__ */ r("div", { className: i.quantitySlot, children: /* @__PURE__ */ r(
|
|
61
|
+
C,
|
|
58
62
|
{
|
|
59
|
-
quantity:
|
|
60
|
-
onQuantityChange:
|
|
63
|
+
quantity: d,
|
|
64
|
+
onQuantityChange: f,
|
|
61
65
|
size: "sm"
|
|
62
66
|
}
|
|
63
67
|
) })
|
|
@@ -66,5 +70,5 @@ function B({
|
|
|
66
70
|
] });
|
|
67
71
|
}
|
|
68
72
|
export {
|
|
69
|
-
|
|
73
|
+
F as CartPart
|
|
70
74
|
};
|
|
@@ -10,6 +10,7 @@ export interface CartSlideInPanelProps {
|
|
|
10
10
|
contactLinkBehavior?: ContactUsLinkBehavior;
|
|
11
11
|
onItemQtyChange: (_item: CartItem, _newQty: number) => void;
|
|
12
12
|
onItemDelete: (_item: CartItem) => void;
|
|
13
|
+
onItemNavigate?: (_item: CartItem) => void;
|
|
13
14
|
onCheckout: () => void;
|
|
14
15
|
}
|
|
15
|
-
export declare function CartSlideInPanel({ open, onClose, cart, subtotal, itemPriceLabel, contactHref, contactLinkBehavior, onItemQtyChange, onItemDelete, onCheckout }: CartSlideInPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function CartSlideInPanel({ open, onClose, cart, subtotal, itemPriceLabel, contactHref, contactLinkBehavior, onItemQtyChange, onItemDelete, onItemNavigate, onCheckout }: CartSlideInPanelProps): import("react/jsx-runtime").JSX.Element;
|