@caseparts-org/caseblocks 0.0.129 → 0.0.131
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/Product.css +1 -1
- package/dist/assets/linkClassName.css +1 -1
- package/dist/atoms/Button/buttonClassName.d.ts +4 -2
- package/dist/atoms/Link/Link.d.ts +4 -1
- package/dist/atoms/Link/Link.js +8 -6
- package/dist/atoms/Link/linkClassName.d.ts +4 -1
- package/dist/atoms/Link/linkClassName.js +18 -14
- package/dist/atoms/LinkButton/LinkButton.d.ts +1 -1
- package/dist/atoms/Text/Text.d.ts +4 -2
- package/dist/main-client.d.ts +2 -2
- package/dist/main-client.js +31 -31
- package/dist/molecules/AddToCart/AddToCart.d.ts +3 -1
- package/dist/molecules/AddToCart/AddToCart.js +25 -24
- package/dist/organisms/Product/Product.d.ts +4 -1
- package/dist/organisms/Product/Product.js +129 -106
- package/dist/organisms/Product/Product.stories.d.ts +10 -0
- package/dist/organisms/Product/Product.stories.js +9 -2
- package/package.json +1 -1
package/dist/assets/Product.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._productCard_tpx1r_3{box-sizing:border-box;background:var(--surface-surface-primary, #FFF);display:flex;width:232px;height:296px;padding:var(--spacing-spacing-default, 16px) var(--spacing-spacing-sm, 20px);flex-direction:column;align-items:flex-start;gap:var(--spacing-spacing-2xs)}._productCard_tpx1r_3._sm_tpx1r_15{width:180px;height:230px}._productCard_tpx1r_3>img{width:78px;height:78px;object-fit:contain;flex-shrink:0;margin:0 auto}._productCard_tpx1r_3 ._productInformation_tpx1r_27{display:flex;flex-direction:column;align-items:flex-start;gap:2px;margin-top:auto}._productCard_tpx1r_3 ._purchaseInformation_tpx1r_34{display:flex;flex-direction:row;align-items:flex-start;justify-content:space-between;width:100%}._productCard_tpx1r_3 ._addToCart_tpx1r_42,._productCard_tpx1r_3 ._addToCartButton_tpx1r_45{width:100%}._productInformation_tpx1r_27>a{font-weight:var(--font-weight-semibold)}._partNumber_tpx1r_53{display:flex;flex-direction:row;align-items:center;gap:var(--spacing-spacing-3xs)}._partNumberLabel_tpx1r_60{color:var(--text-text-quaternary)}._productTile_tpx1r_64{box-sizing:border-box;width:100%;max-width:1072px;display:flex;flex-direction:row;align-items:flex-start;background:var(--surface-surface-primary, #FFF);padding:var(--spacing-spacing-default, 16px) var(--spacing-spacing-sm, 20px);gap:var(--spacing-spacing-1xs)}._productTile_tpx1r_64>img{width:108px;height:108px;object-fit:contain}._productTile_tpx1r_64 ._topRow_tpx1r_83{display:grid;grid-template-columns:1fr auto;width:100%}._productTile_tpx1r_64 ._topRow_tpx1r_83 button{background-color:transparent;padding:0;margin:0;outline:none;border:none;height:min-content;width:min-content}._productTile_tpx1r_64 ._topRow_tpx1r_83 path{fill:var(--icons-icon-search)}._productTile_tpx1r_64 ._topRow_tpx1r_83 svg{padding:0}._productTile_tpx1r_64 ._productInformation_tpx1r_27{display:flex;flex-direction:column;align-items:flex-start;gap:2px}._productTile_tpx1r_64 ._productData_tpx1r_114{display:flex;flex-direction:column;align-items:flex-start;width:100%;gap:var(--spacing-spacing-2xs)}._productTile_tpx1r_64 ._purchase_tpx1r_34{display:flex;flex-direction:row;align-items:flex-end;justify-content:space-between;width:100%}@media (max-width: 480px){._productTile_tpx1r_64 ._purchase_tpx1r_34{flex-direction:column;align-items:flex-start;gap:var(--spacing-spacing-3xs)}}._productTile_tpx1r_64 ._purchaseInformation_tpx1r_34{display:flex;flex-direction:column;align-items:flex-start;gap:var(--spacing-spacing-2xs)}@media (max-width: 480px){._productTile_tpx1r_64 ._purchaseInformation_tpx1r_34{flex-direction:row;align-items:flex-start;justify-content:space-between;width:100%;gap:0px}}._productTile_tpx1r_64 ._attributeContainer_tpx1r_151{margin:0;padding:0;padding-top:var(--spacing-spacing-1xs);border-top:1px solid var(--border-border-primary);width:100%;list-style:none;display:flex;flex-direction:row;align-items:center;justify-content:flex-start;flex-wrap:wrap;column-gap:var(--spacing-spacing-lg);row-gap:var(--spacing-spacing-3xs)}@media (max-width: 640px){._productTile_tpx1r_64 ._attributeContainer_tpx1r_151{display:none}}._productTile_tpx1r_64 ._attributeContainer_tpx1r_151 li{display:flex;flex-direction:row;align-items:center;gap:var(--spacing-spacing-3xs)}._productTile_tpx1r_64 ._addToCart_tpx1r_42{display:flex;flex-direction:row;align-items:center;gap:var(--spacing-spacing-md)}@media (max-width: 480px){._productTile_tpx1r_64 ._addToCart_tpx1r_42{gap:var(--spacing-spacing-2xs);width:100%}}._productTile_tpx1r_64 ._addToCartButton_tpx1r_45{width:96px;font-size:var(--font-size-md);font-weight:var(--font-weight-semibold)}@media (max-width: 640px){._productTile_tpx1r_64 ._addToCartButton_tpx1r_45{width:100%}}._elevated_tpx1r_199{border:1px solid var(--border-border-primary, #DFDFDF);box-shadow:2px 4px 12px #00000026}._noImage_tpx1r_205 ._productInformation_tpx1r_27{margin-top:0}._sm_tpx1r_15{padding:var(--spacing-spacing-1xs)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._link_f9a12_1{color:var(--text-text-links);text-decoration:none}._link_f9a12_1:hover{text-decoration:underline}._link_f9a12_1:focus{text-decoration:underline;font-weight:var(--font-weight-semibold)}._link_f9a12_1._disabled_f9a12_14{color:var(--text-text-disabled);cursor:not-allowed}._link_f9a12_1._disabled_f9a12_14:hover{text-decoration:none}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { HideAtProps } from '../HideAt';
|
|
2
|
+
export type ButtonVariant = "primary" | "secondary" | "secondary-transparent" | "cta-primary" | "tertiary" | "destructive";
|
|
3
|
+
export type ButtonSize = "xxs" | "xs" | "sm" | "md" | "lg" | "xl";
|
|
2
4
|
export interface ButtonStyleProps {
|
|
3
5
|
disabled?: boolean;
|
|
4
|
-
size:
|
|
5
|
-
variant:
|
|
6
|
+
size: ButtonSize;
|
|
7
|
+
variant: ButtonVariant;
|
|
6
8
|
}
|
|
7
9
|
export declare function buttonClassNames({ size, variant, hideAt, className, disabled, }: ButtonStyleProps & {
|
|
8
10
|
hideAt?: HideAtProps["hideAt"];
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { HideAtProps } from '../HideAt';
|
|
3
|
+
import { TextSize, TextWeight } from '../Text/Text';
|
|
3
4
|
export interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement>, HideAtProps {
|
|
4
5
|
href: string;
|
|
5
6
|
disabled?: boolean;
|
|
6
7
|
unstyled?: boolean;
|
|
7
8
|
children: React.ReactNode;
|
|
8
9
|
implementation?: LinkImplementation;
|
|
10
|
+
size?: TextSize;
|
|
11
|
+
weight?: TextWeight;
|
|
9
12
|
}
|
|
10
13
|
/** Router component contract (e.g. next/link or react-router Link) */
|
|
11
14
|
export type LinkImplementation = React.ComponentType<{
|
|
@@ -13,4 +16,4 @@ export type LinkImplementation = React.ComponentType<{
|
|
|
13
16
|
className?: string;
|
|
14
17
|
children: React.ReactNode;
|
|
15
18
|
} & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, "href">>;
|
|
16
|
-
export declare function Link({ href, disabled, unstyled, hideAt, className, children, implementation, ...rest }: LinkProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare function Link({ href, disabled, unstyled, hideAt, className, children, implementation, size, weight, ...rest }: LinkProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/atoms/Link/Link.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import { routerOverride as i } from "./configureLink.js";
|
|
3
|
-
import { linkClassName as
|
|
4
|
-
function
|
|
3
|
+
import { linkClassName as x } from "./linkClassName.js";
|
|
4
|
+
function b({
|
|
5
5
|
href: f,
|
|
6
6
|
disabled: o = !1,
|
|
7
7
|
unstyled: m = !1,
|
|
@@ -9,16 +9,18 @@ function L({
|
|
|
9
9
|
className: c,
|
|
10
10
|
children: e,
|
|
11
11
|
implementation: a,
|
|
12
|
+
size: p,
|
|
13
|
+
weight: s,
|
|
12
14
|
...r
|
|
13
15
|
}) {
|
|
14
|
-
const
|
|
16
|
+
const d = x({ className: c, size: p, weight: s, unstyled: m, disabled: o, hideAt: u }), t = {
|
|
15
17
|
...r,
|
|
16
18
|
href: o ? "#" : f,
|
|
17
|
-
className:
|
|
19
|
+
className: d,
|
|
18
20
|
"aria-disabled": o || void 0,
|
|
19
21
|
tabIndex: o ? -1 : r.tabIndex,
|
|
20
22
|
role: o ? "link" : r.role
|
|
21
|
-
},
|
|
23
|
+
}, g = typeof globalThis < "u" && globalThis.__CASEBLOCKS_LINK_IMPL || null, n = a || i || g;
|
|
22
24
|
return n ? /* @__PURE__ */ l(
|
|
23
25
|
n,
|
|
24
26
|
{
|
|
@@ -29,5 +31,5 @@ function L({
|
|
|
29
31
|
) : /* @__PURE__ */ l("a", { ...t, "data-router-adapter": "anchor", children: e });
|
|
30
32
|
}
|
|
31
33
|
export {
|
|
32
|
-
|
|
34
|
+
b as Link
|
|
33
35
|
};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { HideAtProps } from '../HideAt';
|
|
2
|
-
|
|
2
|
+
import { TextSize, TextWeight } from '../Text/Text';
|
|
3
|
+
export declare function linkClassName({ className, size, weight, unstyled, disabled, hideAt }: {
|
|
3
4
|
className?: string;
|
|
5
|
+
size?: TextSize;
|
|
6
|
+
weight?: TextWeight;
|
|
4
7
|
unstyled?: boolean;
|
|
5
8
|
disabled?: boolean;
|
|
6
9
|
hideAt?: HideAtProps["hideAt"];
|
|
@@ -1,24 +1,28 @@
|
|
|
1
|
-
import { t as o } from "../../Text.module-Dzhzk2fH.js";
|
|
2
1
|
import { c as n } from "../../clsx-OuTLNxxd.js";
|
|
3
2
|
import { getHideAtStyles as d } from "../HideAt.js";
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import { t as i } from "../../Text.module-Dzhzk2fH.js";
|
|
4
|
+
import '../../assets/linkClassName.css';const m = "_link_f9a12_1", c = "_disabled_f9a12_14", e = {
|
|
5
|
+
link: m,
|
|
6
|
+
disabled: c
|
|
7
7
|
};
|
|
8
|
-
function
|
|
9
|
-
className:
|
|
8
|
+
function b({
|
|
9
|
+
className: l,
|
|
10
|
+
size: o,
|
|
11
|
+
weight: s,
|
|
10
12
|
unstyled: t,
|
|
11
|
-
disabled:
|
|
12
|
-
hideAt:
|
|
13
|
+
disabled: a,
|
|
14
|
+
hideAt: r
|
|
13
15
|
}) {
|
|
14
16
|
return n(
|
|
15
|
-
|
|
16
|
-
!t && o[
|
|
17
|
-
!t && s
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
l,
|
|
18
|
+
!t && o && i[`text-${o}`],
|
|
19
|
+
!t && s && i[`text-${s}`],
|
|
20
|
+
!t && i["text-body"],
|
|
21
|
+
!t && e.link,
|
|
22
|
+
a && e.disabled,
|
|
23
|
+
d(r)
|
|
20
24
|
);
|
|
21
25
|
}
|
|
22
26
|
export {
|
|
23
|
-
|
|
27
|
+
b as linkClassName
|
|
24
28
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HideAtProps } from '../HideAt';
|
|
2
2
|
import { LinkProps } from '../Link/Link';
|
|
3
3
|
import { ButtonStyleProps } from '../Button/buttonClassName';
|
|
4
|
-
export interface LinkButtonProps extends LinkProps, HideAtProps, ButtonStyleProps {
|
|
4
|
+
export interface LinkButtonProps extends Omit<LinkProps, "size" | "weight">, HideAtProps, ButtonStyleProps {
|
|
5
5
|
}
|
|
6
6
|
export declare function LinkButton({ href, children, size, variant, hideAt, className, disabled, ...otherProps }: LinkButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { HideAtProps } from '../HideAt';
|
|
2
2
|
import { JSX } from 'react';
|
|
3
3
|
type ElementType = keyof Pick<JSX.IntrinsicElements, "span" | "p" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div">;
|
|
4
|
+
export type TextSize = "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl";
|
|
5
|
+
export type TextWeight = "thin" | "extra-light" | "light" | "regular" | "medium" | "semibold" | "bold";
|
|
4
6
|
/** A text element. */
|
|
5
7
|
export type TextProps<T extends ElementType = "span"> = HideAtProps & {
|
|
6
8
|
/** The HTML element to render as */
|
|
7
9
|
as?: ElementType;
|
|
8
10
|
/** The size of the text. */
|
|
9
|
-
size:
|
|
11
|
+
size: TextSize;
|
|
10
12
|
/** The variant of the text. */
|
|
11
13
|
variant?: "body" | "display";
|
|
12
14
|
/** The weight of the text. */
|
|
13
|
-
weight?:
|
|
15
|
+
weight?: TextWeight;
|
|
14
16
|
colorToken?: 'inherit' | 'warning' | 'disabled' | 'error-warning' | 'default-inverted' | 'links' | 'links-hover-press' | 'primary' | 'quaternary' | 'search-bar' | 'secondary' | 'success' | 'tertiary' | 'footer';
|
|
15
17
|
} & Omit<React.ComponentPropsWithoutRef<T>, "size">;
|
|
16
18
|
export declare function Text<T extends ElementType = "span">({ as, size, variant, weight, colorToken, children, hideAt, className, ...otherProps }: TextProps<T>): import("react/jsx-runtime").JSX.Element;
|
package/dist/main-client.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ export { SlideInPanel } from './atoms/SlideInPanel/SlideInPanel';
|
|
|
5
5
|
export type { SlideInPanelProps } from './atoms/SlideInPanel/SlideInPanel';
|
|
6
6
|
export { Markdown } from './atoms/Markdown/Markdown';
|
|
7
7
|
export type { MarkdownProps } from './atoms/Markdown/Markdown';
|
|
8
|
-
export { PreprocessedMarkdown
|
|
9
|
-
export type { PreprocessedMarkdownProps
|
|
8
|
+
export { PreprocessedMarkdown } from './atoms/Markdown/PreprocessedMarkdown';
|
|
9
|
+
export type { PreprocessedMarkdownProps } from './atoms/Markdown/PreprocessedMarkdown';
|
|
10
10
|
export { usePreprocessedMarkdown } from './atoms/Markdown/usePreprocessedMarkdown';
|
|
11
11
|
export type { LinkTarget, ValidateToken } from './atoms/Markdown/usePreprocessedMarkdown';
|
|
12
12
|
export { Tooltip } from './atoms/Tooltip/Tooltip';
|
package/dist/main-client.js
CHANGED
|
@@ -4,21 +4,21 @@ import { Column as f, Grid as x } from "./atoms/Grid/Grid.js";
|
|
|
4
4
|
import { Head as n } from "./atoms/Root/Head.js";
|
|
5
5
|
import { Icon as d } from "./atoms/Icon/Icon.js";
|
|
6
6
|
import { Root as u } from "./atoms/Root/Root.js";
|
|
7
|
-
import { Separator as
|
|
7
|
+
import { Separator as k } from "./atoms/Separator/Separator.js";
|
|
8
8
|
import { Text as C } from "./atoms/Text/Text.js";
|
|
9
|
-
import { Input as
|
|
10
|
-
import { Link as
|
|
11
|
-
import { linkClassName as
|
|
9
|
+
import { Input as S } from "./atoms/Input/Input.js";
|
|
10
|
+
import { Link as P } from "./atoms/Link/Link.js";
|
|
11
|
+
import { linkClassName as B } from "./atoms/Link/linkClassName.js";
|
|
12
12
|
import { configureLink as v, routerOverride as A } from "./atoms/Link/configureLink.js";
|
|
13
13
|
import { LinkButton as h } from "./atoms/LinkButton/LinkButton.js";
|
|
14
14
|
import { configureImage as F } from "./atoms/Image/configureImage.js";
|
|
15
15
|
import { Logo as V } from "./molecules/Logo/Logo.js";
|
|
16
16
|
import { SearchBox as y } from "./molecules/SearchBox/SearchBox.js";
|
|
17
17
|
import { QuantityInput as z } from "./molecules/QuantityInput/QuantityInput.js";
|
|
18
|
-
import { Pricing as
|
|
19
|
-
import { Availability as
|
|
20
|
-
import { Avatar as
|
|
21
|
-
import { BannerCard as
|
|
18
|
+
import { Pricing as O } from "./molecules/Pricing/Pricing.js";
|
|
19
|
+
import { Availability as R } from "./molecules/Availability/Availability.js";
|
|
20
|
+
import { Avatar as j } from "./molecules/Avatar/Avatar.js";
|
|
21
|
+
import { BannerCard as D } from "./molecules/BannerCard/BannerCard.js";
|
|
22
22
|
import { CardLink as J } from "./molecules/CardLink/CardLink.js";
|
|
23
23
|
import { Breadcrumbs as U } from "./molecules/Breadcrumbs/Breadcrumbs.js";
|
|
24
24
|
import { NotFound as X } from "./organisms/NotFound/NotFound.js";
|
|
@@ -30,45 +30,44 @@ import { usePreprocessedMarkdown as fo } from "./atoms/Markdown/usePreprocessedM
|
|
|
30
30
|
import { Tooltip as ao } from "./atoms/Tooltip/Tooltip.js";
|
|
31
31
|
import { Popover as io } from "./atoms/Popover/Popover.js";
|
|
32
32
|
import { Account as uo } from "./molecules/Account/Account.js";
|
|
33
|
-
import { Chip as
|
|
33
|
+
import { Chip as ko } from "./molecules/Chip/Chip.js";
|
|
34
34
|
import { ToggleView as Co } from "./molecules/ToggleView/ToggleView.js";
|
|
35
|
-
import { CartSlideInPanel as
|
|
36
|
-
import { StatefulButton as
|
|
37
|
-
import { AnimatedCheckMark as
|
|
35
|
+
import { CartSlideInPanel as So } from "./molecules/Cart/CartSlideInPanel.js";
|
|
36
|
+
import { StatefulButton as Po } from "./molecules/StatefulButton/StatefulButton.js";
|
|
37
|
+
import { AnimatedCheckMark as Bo } from "./molecules/StatefulButton/AnimatedCheckmark.js";
|
|
38
38
|
import { AddToCart as vo } from "./molecules/AddToCart/AddToCart.js";
|
|
39
39
|
import { Modal as Lo } from "./molecules/Modal/Modal.js";
|
|
40
40
|
import { ImageViewer as To } from "./molecules/ImageViewer/ImageViewer.js";
|
|
41
41
|
import { MainNav as No } from "./organisms/MainNav/MainNav.js";
|
|
42
42
|
import { ChipSelector as bo } from "./organisms/ChipSelector/ChipSelector.js";
|
|
43
43
|
import { Product as Ho } from "./organisms/Product/Product.js";
|
|
44
|
-
import { Carousel as
|
|
45
|
-
import { Footer as
|
|
46
|
-
import { default as
|
|
44
|
+
import { Carousel as Go } from "./organisms/Carousel/Carousel.js";
|
|
45
|
+
import { Footer as Qo } from "./organisms/Footer/Footer.js";
|
|
46
|
+
import { default as Zo } from "./organisms/SpinZoomViewer/SpinZoomViewer.js";
|
|
47
47
|
export {
|
|
48
48
|
uo as Account,
|
|
49
49
|
vo as AddToCart,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
Bo as AnimatedCheckMark,
|
|
51
|
+
R as Availability,
|
|
52
|
+
j as Avatar,
|
|
53
|
+
D as BannerCard,
|
|
54
54
|
U as Breadcrumbs,
|
|
55
55
|
e as Button,
|
|
56
56
|
J as CardLink,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
Go as Carousel,
|
|
58
|
+
So as CartSlideInPanel,
|
|
59
|
+
ko as Chip,
|
|
60
60
|
bo as ChipSelector,
|
|
61
61
|
f as Column,
|
|
62
62
|
p as Flex,
|
|
63
|
-
|
|
63
|
+
Qo as Footer,
|
|
64
64
|
x as Grid,
|
|
65
65
|
n as Head,
|
|
66
66
|
_ as HorizontalScroll,
|
|
67
67
|
d as Icon,
|
|
68
68
|
To as ImageViewer,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
w as Link,
|
|
69
|
+
S as Input,
|
|
70
|
+
P as Link,
|
|
72
71
|
h as LinkButton,
|
|
73
72
|
V as Logo,
|
|
74
73
|
No as MainNav,
|
|
@@ -76,21 +75,22 @@ export {
|
|
|
76
75
|
Lo as Modal,
|
|
77
76
|
X as NotFound,
|
|
78
77
|
io as Popover,
|
|
79
|
-
|
|
78
|
+
po as PreprocessedMarkdown,
|
|
79
|
+
O as Pricing,
|
|
80
80
|
Ho as Product,
|
|
81
81
|
z as QuantityInput,
|
|
82
82
|
u as Root,
|
|
83
83
|
y as SearchBox,
|
|
84
|
-
|
|
84
|
+
k as Separator,
|
|
85
85
|
oo as SlideInPanel,
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
Zo as SpinZoomViewer,
|
|
87
|
+
Po as StatefulButton,
|
|
88
88
|
C as Text,
|
|
89
89
|
Co as ToggleView,
|
|
90
90
|
ao as Tooltip,
|
|
91
91
|
F as configureImage,
|
|
92
92
|
v as configureLink,
|
|
93
|
-
|
|
93
|
+
B as linkClassName,
|
|
94
94
|
A as routerOverride,
|
|
95
95
|
fo as usePreprocessedMarkdown
|
|
96
96
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
import { ButtonVariant } from '../../atoms/Button/buttonClassName';
|
|
2
3
|
export interface AddToCartProps {
|
|
3
4
|
itemKey: number;
|
|
4
5
|
initialQuantity?: number;
|
|
@@ -10,8 +11,9 @@ export interface AddToCartProps {
|
|
|
10
11
|
showQuantity?: boolean;
|
|
11
12
|
className?: string;
|
|
12
13
|
addButtonClassName?: string;
|
|
14
|
+
addButtonVariant?: ButtonVariant;
|
|
13
15
|
buttonText?: string;
|
|
14
16
|
buttonDoneText?: string;
|
|
15
17
|
size?: "sm" | "md";
|
|
16
18
|
}
|
|
17
|
-
export declare function AddToCart({ itemKey, initialQuantity, min, max, onQuantityChange, onAdd, autoHideDelayMs, showQuantity, className, addButtonClassName, buttonText, buttonDoneText, size }: AddToCartProps): React.ReactElement | null;
|
|
19
|
+
export declare function AddToCart({ itemKey, initialQuantity, min, max, onQuantityChange, onAdd, autoHideDelayMs, showQuantity, className, addButtonClassName, addButtonVariant, buttonText, buttonDoneText, size }: AddToCartProps): React.ReactElement | null;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as j, jsx as d } from "react/jsx-runtime";
|
|
2
2
|
import r from "react";
|
|
3
|
-
import { c as
|
|
4
|
-
import { StatefulButton as
|
|
5
|
-
import { QuantityInput as
|
|
6
|
-
import '../../assets/AddToCart.css';const
|
|
7
|
-
container:
|
|
3
|
+
import { c as v } from "../../clsx-OuTLNxxd.js";
|
|
4
|
+
import { StatefulButton as q } from "../StatefulButton/StatefulButton.js";
|
|
5
|
+
import { QuantityInput as w } from "../QuantityInput/QuantityInput.js";
|
|
6
|
+
import '../../assets/AddToCart.css';const y = "_container_1xk40_1", z = {
|
|
7
|
+
container: y
|
|
8
8
|
};
|
|
9
|
-
function
|
|
9
|
+
function G({
|
|
10
10
|
itemKey: s,
|
|
11
11
|
initialQuantity: i = 1,
|
|
12
12
|
min: o = 1,
|
|
@@ -17,42 +17,43 @@ function F({
|
|
|
17
17
|
showQuantity: p = !0,
|
|
18
18
|
className: x,
|
|
19
19
|
addButtonClassName: T,
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
addButtonVariant: _,
|
|
21
|
+
buttonText: b,
|
|
22
|
+
buttonDoneText: k,
|
|
22
23
|
size: a
|
|
23
24
|
}) {
|
|
24
|
-
const [u,
|
|
25
|
+
const [u, A] = r.useState(() => {
|
|
25
26
|
const e = Number(i) || 1;
|
|
26
27
|
return e < o ? o : e;
|
|
27
|
-
}), [
|
|
28
|
+
}), [N, n] = r.useState(!1), t = r.useRef(null);
|
|
28
29
|
r.useEffect(() => () => {
|
|
29
30
|
t.current && clearTimeout(t.current);
|
|
30
31
|
}, []);
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
}, [c]),
|
|
32
|
+
const R = r.useCallback((e) => {
|
|
33
|
+
A(e), c == null || c(e);
|
|
34
|
+
}, [c]), S = async () => {
|
|
34
35
|
s && (await m(s, u), n(!0), t.current && clearTimeout(t.current), t.current = setTimeout(() => n(!1), f));
|
|
35
36
|
};
|
|
36
|
-
return /* @__PURE__ */
|
|
37
|
+
return /* @__PURE__ */ j("div", { className: v(z.container, x), children: [
|
|
37
38
|
p && /* @__PURE__ */ d(
|
|
38
|
-
|
|
39
|
+
w,
|
|
39
40
|
{
|
|
40
41
|
quantity: u,
|
|
41
|
-
onQuantityChange:
|
|
42
|
+
onQuantityChange: R,
|
|
42
43
|
min: o,
|
|
43
44
|
max: l,
|
|
44
45
|
size: a || "md"
|
|
45
46
|
}
|
|
46
47
|
),
|
|
47
48
|
/* @__PURE__ */ d(
|
|
48
|
-
|
|
49
|
+
q,
|
|
49
50
|
{
|
|
50
51
|
size: a || "md",
|
|
51
|
-
variant: "cta-primary",
|
|
52
|
-
completed:
|
|
53
|
-
onClick:
|
|
54
|
-
text:
|
|
55
|
-
completedText:
|
|
52
|
+
variant: _ || "cta-primary",
|
|
53
|
+
completed: N,
|
|
54
|
+
onClick: S,
|
|
55
|
+
text: b,
|
|
56
|
+
completedText: k,
|
|
56
57
|
disabled: !s,
|
|
57
58
|
className: T
|
|
58
59
|
}
|
|
@@ -60,5 +61,5 @@ function F({
|
|
|
60
61
|
] });
|
|
61
62
|
}
|
|
62
63
|
export {
|
|
63
|
-
|
|
64
|
+
G as AddToCart
|
|
64
65
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AvailabilityProps } from '../../molecules/Availability/Availability';
|
|
2
2
|
export type ProductView = "Card" | "Tile";
|
|
3
|
+
export type Size = "md" | "sm";
|
|
3
4
|
export interface ProductProps extends AvailabilityProps {
|
|
4
5
|
productView: ProductView;
|
|
5
6
|
productDescription: string;
|
|
@@ -18,5 +19,7 @@ export interface ProductProps extends AvailabilityProps {
|
|
|
18
19
|
onAddToCart: (_itemKey: number, _quantity: number) => void;
|
|
19
20
|
onClose?: (_itemKey: number) => void;
|
|
20
21
|
flat?: boolean;
|
|
22
|
+
size?: Size;
|
|
23
|
+
showQuantity?: boolean;
|
|
21
24
|
}
|
|
22
|
-
export declare function Product({ productView, itemKey, partNumber, productDescription, availDescription, availId, contactHref, contactLinkBehavior, productHref, priceLabel, price, imgSrc, attributes, className, onAddToCart, onClose, flat, ...otherProps }: ProductProps): import("react/jsx-runtime").JSX.Element;
|
|
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;
|
|
@@ -1,134 +1,157 @@
|
|
|
1
|
-
import { jsxs as a, jsx as
|
|
2
|
-
import { Image as
|
|
3
|
-
import { Link as
|
|
4
|
-
import { Text as
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
import { jsxs as a, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { Image as I } from "../../atoms/Image/Image.js";
|
|
3
|
+
import { Link as w } from "../../atoms/Link/Link.js";
|
|
4
|
+
import { Text as n } from "../../atoms/Text/Text.js";
|
|
5
|
+
import { Availability as B } from "../../molecules/Availability/Availability.js";
|
|
6
|
+
import { Pricing as L } from "../../molecules/Pricing/Pricing.js";
|
|
7
|
+
import { AddToCart as A } from "../../molecules/AddToCart/AddToCart.js";
|
|
8
|
+
import { Icon as D } from "../../atoms/Icon/Icon.js";
|
|
9
|
+
import { c as R } from "../../clsx-OuTLNxxd.js";
|
|
10
|
+
import '../../assets/Product.css';const P = "_productCard_tpx1r_3", j = "_sm_tpx1r_15", k = "_productInformation_tpx1r_27", z = "_purchaseInformation_tpx1r_34", y = "_addToCart_tpx1r_42", V = "_addToCartButton_tpx1r_45", q = "_partNumber_tpx1r_53", E = "_partNumberLabel_tpx1r_60", F = "_productTile_tpx1r_64", G = "_topRow_tpx1r_83", J = "_productData_tpx1r_114", M = "_purchase_tpx1r_34", O = "_attributeContainer_tpx1r_151", U = "_elevated_tpx1r_199", W = "_noImage_tpx1r_205", t = {
|
|
11
|
+
productCard: P,
|
|
12
|
+
sm: j,
|
|
13
|
+
productInformation: k,
|
|
14
|
+
purchaseInformation: z,
|
|
15
|
+
addToCart: y,
|
|
16
|
+
addToCartButton: V,
|
|
17
|
+
partNumber: q,
|
|
18
|
+
partNumberLabel: E,
|
|
19
|
+
productTile: F,
|
|
20
|
+
topRow: G,
|
|
21
|
+
productData: J,
|
|
22
|
+
purchase: M,
|
|
23
|
+
attributeContainer: O,
|
|
24
|
+
elevated: U,
|
|
25
|
+
noImage: W
|
|
25
26
|
};
|
|
26
|
-
function
|
|
27
|
-
productView:
|
|
28
|
-
itemKey:
|
|
29
|
-
partNumber:
|
|
30
|
-
productDescription:
|
|
31
|
-
availDescription:
|
|
32
|
-
availId:
|
|
27
|
+
function at({
|
|
28
|
+
productView: $,
|
|
29
|
+
itemKey: m,
|
|
30
|
+
partNumber: c,
|
|
31
|
+
productDescription: u,
|
|
32
|
+
availDescription: _,
|
|
33
|
+
availId: s,
|
|
33
34
|
contactHref: h,
|
|
34
|
-
contactLinkBehavior:
|
|
35
|
-
productHref:
|
|
35
|
+
contactLinkBehavior: x,
|
|
36
|
+
productHref: b,
|
|
36
37
|
priceLabel: N,
|
|
37
|
-
price:
|
|
38
|
-
imgSrc:
|
|
38
|
+
price: i,
|
|
39
|
+
imgSrc: d,
|
|
39
40
|
attributes: l,
|
|
40
|
-
className:
|
|
41
|
-
onAddToCart:
|
|
42
|
-
onClose:
|
|
43
|
-
flat:
|
|
44
|
-
|
|
41
|
+
className: f,
|
|
42
|
+
onAddToCart: C,
|
|
43
|
+
onClose: T,
|
|
44
|
+
flat: g,
|
|
45
|
+
size: o = "md",
|
|
46
|
+
showQuantity: p = !0,
|
|
47
|
+
...v
|
|
45
48
|
}) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
if ($ === "Card") {
|
|
50
|
+
const e = o === "sm" ? "xs" : "sm";
|
|
51
|
+
return /* @__PURE__ */ a(
|
|
52
|
+
"div",
|
|
49
53
|
{
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
54
|
+
className: R(
|
|
55
|
+
t.productCard,
|
|
56
|
+
o && t[o],
|
|
57
|
+
f,
|
|
58
|
+
!g && t.elevated,
|
|
59
|
+
!d && t.noImage
|
|
60
|
+
),
|
|
61
|
+
...v,
|
|
62
|
+
children: [
|
|
63
|
+
d && /* @__PURE__ */ r(
|
|
64
|
+
I,
|
|
65
|
+
{
|
|
66
|
+
src: d,
|
|
67
|
+
alt: `${c} product image`,
|
|
68
|
+
height: o === "sm" ? 78 : 96,
|
|
69
|
+
width: o === "sm" ? 78 : 96
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
/* @__PURE__ */ a("div", { className: t.productInformation, children: [
|
|
73
|
+
/* @__PURE__ */ r(w, { size: o, href: b, children: u }),
|
|
74
|
+
/* @__PURE__ */ a("div", { className: t.partNumber, children: [
|
|
75
|
+
/* @__PURE__ */ r(n, { size: e, className: t.partNumberLabel, children: "Part #" }),
|
|
76
|
+
/* @__PURE__ */ r(n, { size: e, weight: "semibold", children: c })
|
|
77
|
+
] })
|
|
78
|
+
] }),
|
|
79
|
+
/* @__PURE__ */ a("div", { className: t.purchaseInformation, children: [
|
|
80
|
+
s && /* @__PURE__ */ r(
|
|
81
|
+
B,
|
|
82
|
+
{
|
|
83
|
+
availId: s,
|
|
84
|
+
availDescription: _,
|
|
85
|
+
contactHref: h,
|
|
86
|
+
contactLinkBehavior: x
|
|
87
|
+
}
|
|
88
|
+
),
|
|
89
|
+
i && /* @__PURE__ */ r(L, { pricingLabel: N, price: i })
|
|
90
|
+
] }),
|
|
91
|
+
/* @__PURE__ */ r(
|
|
92
|
+
A,
|
|
93
|
+
{
|
|
94
|
+
itemKey: m,
|
|
95
|
+
onAdd: C,
|
|
96
|
+
className: t.addToCart,
|
|
97
|
+
addButtonClassName: t.addToCartButton,
|
|
98
|
+
addButtonVariant: p ? "cta-primary" : "secondary",
|
|
99
|
+
size: o,
|
|
100
|
+
buttonDoneText: "",
|
|
101
|
+
buttonText: p ? "Add" : "Add to Cart",
|
|
102
|
+
showQuantity: p
|
|
103
|
+
}
|
|
104
|
+
)
|
|
105
|
+
]
|
|
84
106
|
}
|
|
85
|
-
)
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
return /* @__PURE__ */ a("div", { className: R(t.productTile, f, !g && t.elevated, !d && t.noImage), ...v, children: [
|
|
110
|
+
d && /* @__PURE__ */ r(
|
|
111
|
+
I,
|
|
89
112
|
{
|
|
90
|
-
src:
|
|
91
|
-
alt: `${
|
|
113
|
+
src: d,
|
|
114
|
+
alt: `${c} product image`,
|
|
92
115
|
height: 108,
|
|
93
116
|
width: 108
|
|
94
117
|
}
|
|
95
118
|
),
|
|
96
|
-
/* @__PURE__ */ a("div", { className:
|
|
97
|
-
/* @__PURE__ */ a("div", { className:
|
|
98
|
-
/* @__PURE__ */ a("div", { className:
|
|
99
|
-
/* @__PURE__ */
|
|
100
|
-
/* @__PURE__ */ a("div", { className:
|
|
101
|
-
/* @__PURE__ */
|
|
102
|
-
/* @__PURE__ */
|
|
119
|
+
/* @__PURE__ */ a("div", { className: t.productData, children: [
|
|
120
|
+
/* @__PURE__ */ a("div", { className: t.topRow, children: [
|
|
121
|
+
/* @__PURE__ */ a("div", { className: t.productInformation, children: [
|
|
122
|
+
/* @__PURE__ */ r(w, { href: b, children: u }),
|
|
123
|
+
/* @__PURE__ */ a("div", { className: t.partNumber, children: [
|
|
124
|
+
/* @__PURE__ */ r(n, { size: "sm", className: t.partNumberLabel, children: "Part #" }),
|
|
125
|
+
/* @__PURE__ */ r(n, { size: "sm", weight: "semibold", children: c })
|
|
103
126
|
] })
|
|
104
127
|
] }),
|
|
105
|
-
|
|
128
|
+
T && /* @__PURE__ */ r("button", { onClick: () => T(m), children: /* @__PURE__ */ r(D, { size: "sm", iconKey: "fa-light fa-xmark" }) })
|
|
106
129
|
] }),
|
|
107
|
-
/* @__PURE__ */ a("div", { className:
|
|
108
|
-
/* @__PURE__ */ a("div", { className:
|
|
109
|
-
|
|
110
|
-
|
|
130
|
+
/* @__PURE__ */ a("div", { className: t.purchase, children: [
|
|
131
|
+
/* @__PURE__ */ a("div", { className: t.purchaseInformation, children: [
|
|
132
|
+
s && /* @__PURE__ */ r(
|
|
133
|
+
B,
|
|
111
134
|
{
|
|
112
|
-
availId:
|
|
113
|
-
availDescription:
|
|
135
|
+
availId: s,
|
|
136
|
+
availDescription: _,
|
|
114
137
|
contactHref: h,
|
|
115
|
-
contactLinkBehavior:
|
|
138
|
+
contactLinkBehavior: x
|
|
116
139
|
}
|
|
117
140
|
),
|
|
118
|
-
|
|
141
|
+
i && /* @__PURE__ */ r(L, { pricingLabel: N, price: i })
|
|
119
142
|
] }),
|
|
120
|
-
/* @__PURE__ */
|
|
143
|
+
/* @__PURE__ */ r(A, { itemKey: m, onAdd: C, className: t.addToCart, addButtonClassName: t.addToCartButton })
|
|
121
144
|
] }),
|
|
122
|
-
l && l.length > 0 && /* @__PURE__ */
|
|
123
|
-
/* @__PURE__ */ a(
|
|
124
|
-
|
|
145
|
+
l && l.length > 0 && /* @__PURE__ */ r("ul", { className: t.attributeContainer, children: l.map((e) => /* @__PURE__ */ a("li", { children: [
|
|
146
|
+
/* @__PURE__ */ a(n, { size: "xs", weight: "light", children: [
|
|
147
|
+
e.label,
|
|
125
148
|
":"
|
|
126
149
|
] }),
|
|
127
|
-
/* @__PURE__ */
|
|
128
|
-
] }, `${
|
|
150
|
+
/* @__PURE__ */ r(n, { size: "xs", weight: "semibold", children: e.value })
|
|
151
|
+
] }, `${e.label}.${e.value}`)) })
|
|
129
152
|
] })
|
|
130
153
|
] });
|
|
131
154
|
}
|
|
132
155
|
export {
|
|
133
|
-
|
|
156
|
+
at as Product
|
|
134
157
|
};
|
|
@@ -69,6 +69,16 @@ declare const meta: {
|
|
|
69
69
|
control: "boolean";
|
|
70
70
|
description: string;
|
|
71
71
|
};
|
|
72
|
+
size: {
|
|
73
|
+
control: {
|
|
74
|
+
type: "select";
|
|
75
|
+
};
|
|
76
|
+
options: string[];
|
|
77
|
+
};
|
|
78
|
+
showQuantity: {
|
|
79
|
+
control: "boolean";
|
|
80
|
+
description: string;
|
|
81
|
+
};
|
|
72
82
|
};
|
|
73
83
|
args: ProductProps;
|
|
74
84
|
tags: string[];
|
|
@@ -47,7 +47,12 @@ const o = [
|
|
|
47
47
|
imgSrc: { control: "text" },
|
|
48
48
|
itemKey: { control: "number" },
|
|
49
49
|
onAddToCart: { action: "addToCart", description: "(itemKey, quantity)" },
|
|
50
|
-
flat: { control: "boolean", description: "Removes border and shadow" }
|
|
50
|
+
flat: { control: "boolean", description: "Removes border and shadow" },
|
|
51
|
+
size: {
|
|
52
|
+
control: { type: "select" },
|
|
53
|
+
options: ["md", "sm"]
|
|
54
|
+
},
|
|
55
|
+
showQuantity: { control: "boolean", description: "Shows/Hides add to cart quantity" }
|
|
51
56
|
},
|
|
52
57
|
args: {
|
|
53
58
|
productView: "Card",
|
|
@@ -71,7 +76,9 @@ const o = [
|
|
|
71
76
|
onClose: (t) => {
|
|
72
77
|
alert(`On close clicked ${t}`);
|
|
73
78
|
},
|
|
74
|
-
flat: !1
|
|
79
|
+
flat: !1,
|
|
80
|
+
size: "md",
|
|
81
|
+
showQuantity: !0
|
|
75
82
|
},
|
|
76
83
|
tags: ["autodocs"]
|
|
77
84
|
}, l = {}, c = {
|