@caseparts-org/caseblocks 0.0.160 → 0.0.162

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.
@@ -0,0 +1,21 @@
1
+ import './assets/Cart.css';const t = "_cartIconButton_5jpfu_2", e = "_count_5jpfu_9", o = "_cartContainer_5jpfu_24", n = "_headerWrapper_5jpfu_35", _ = "_header_5jpfu_35", c = "_cartItems_5jpfu_53", a = "_cartItem_5jpfu_53", r = "_topRow_5jpfu_79", u = "_itemInfo_5jpfu_85", m = "_purchaseInformation_5jpfu_90", s = "_itemManagement_5jpfu_97", p = "_itemImage_5jpfu_110", I = "_removeItem_5jpfu_113", f = "_noItems_5jpfu_123", j = "_subtotal_5jpfu_130", i = "_checkoutButton_5jpfu_137", h = {
2
+ cartIconButton: t,
3
+ count: e,
4
+ cartContainer: o,
5
+ headerWrapper: n,
6
+ header: _,
7
+ cartItems: c,
8
+ cartItem: a,
9
+ topRow: r,
10
+ itemInfo: u,
11
+ purchaseInformation: m,
12
+ itemManagement: s,
13
+ itemImage: p,
14
+ removeItem: I,
15
+ noItems: f,
16
+ subtotal: j,
17
+ checkoutButton: i
18
+ };
19
+ export {
20
+ h as s
21
+ };
@@ -1 +1 @@
1
- ._cartIconButton_1dh0n_2{position:relative;border:none;padding:0;margin:0;background-color:transparent}._count_1dh0n_9{position:absolute;top:0;left:14px;border-radius:50%;width:18px;height:18px;display:flex;flex-direction:row;align-items:center;justify-content:center;background-color:var(--color-brand-primary-primary-tangerine);color:var(--color-neutrals-neutral-1);font-weight:var(--font-weight-semibold)}._cartContainer_1dh0n_24{height:100vh;width:100%;min-width:320px;max-width:375px;box-sizing:border-box;display:grid;grid-template-rows:auto 1fr auto auto;gap:var(--spacing-1);padding:var(--spacing-1)}._headerWrapper_1dh0n_35{display:flex;flex-direction:row;align-items:flex-start;gap:var(--spacing-spacing-2xs)}._headerWrapper_1dh0n_35>button{padding:0;margin:0;background-color:transparent;border:none}._header_1dh0n_35{display:flex;flex-direction:column;align-items:flex-start;width:100%}._cartItems_1dh0n_53{height:100%;overflow-y:auto;overflow-x:hidden}._cartItems_1dh0n_53 ul{margin:0;padding:0}._cartItems_1dh0n_53 li{display:grid;grid-template-columns:auto 1fr;gap:var(--spacing-0-5);align-items:center;box-sizing:border-box;position:relative;list-style:none;margin:0;padding:var(--spacing-0-5);width:100%;border-bottom:1px solid var(--color-neutrals-neutral-2)}._cartItems_1dh0n_53 li:first-of-type{border-top:1px solid var(--color-neutrals-neutral-2)}._topRow_1dh0n_78{display:flex;flex-direction:row;align-items:flex-start;justify-content:space-between}._itemInfo_1dh0n_84{display:flex;flex-direction:column;align-items:flex-start}._purchaseInformation_1dh0n_89{display:flex;flex-direction:row;align-items:flex-start;justify-content:space-between;width:100%}._itemManagement_1dh0n_96{display:flex;flex-direction:column;align-items:flex-end;gap:var(--spacing-spacing-3xs)}._cartItems_1dh0n_53 li p{margin:0;padding:0;word-wrap:break-word;white-space:normal;overflow-wrap:break-word}._cartItems_1dh0n_53 img{height:40px;width:40px;object-fit:contain}._removeItem_1dh0n_114{border:none;background-color:transparent;padding:0;margin:0;cursor:pointer;width:min-content;height:min-content}._noItems_1dh0n_124{display:flex;flex-direction:row;align-items:center;justify-content:center;height:100%}._subtotal_1dh0n_131{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:var(--spacing-0-5)}._checkoutButton_1dh0n_138{width:100%}
1
+ ._cartIconButton_5jpfu_2{position:relative;border:none;padding:0;margin:0;background-color:transparent}._count_5jpfu_9{position:absolute;top:0;left:14px;border-radius:50%;width:18px;height:18px;display:flex;flex-direction:row;align-items:center;justify-content:center;background-color:var(--color-brand-primary-primary-tangerine);color:var(--color-neutrals-neutral-1);font-weight:var(--font-weight-semibold)}._cartContainer_5jpfu_24{height:100vh;width:100%;min-width:320px;max-width:375px;box-sizing:border-box;display:grid;grid-template-rows:auto 1fr auto auto;gap:var(--spacing-1);padding:var(--spacing-1)}._headerWrapper_5jpfu_35{display:flex;flex-direction:row;align-items:flex-start;gap:var(--spacing-spacing-2xs)}._headerWrapper_5jpfu_35>button{padding:0;margin:0;background-color:transparent;border:none}._header_5jpfu_35{display:flex;flex-direction:column;align-items:flex-start;width:100%}._cartItems_5jpfu_53{height:100%;overflow-y:auto;overflow-x:hidden}._cartItems_5jpfu_53 ul{margin:0;padding:0;display:flex;flex-direction:column;gap:var(--spacing-spacing-1xs)}._cartItem_5jpfu_53{display:grid;grid-template-columns:auto 1fr;gap:var(--spacing-0-5);align-items:start;box-sizing:border-box;position:relative;list-style:none;margin:0;padding:var(--spacing-0-5);width:100%;border:1px solid var(--color-neutrals-neutral-2);border-radius:var(--border-radius-md)}._topRow_5jpfu_79{display:flex;flex-direction:row;align-items:flex-start;justify-content:space-between}._itemInfo_5jpfu_85{display:flex;flex-direction:column;align-items:flex-start}._purchaseInformation_5jpfu_90{display:flex;flex-direction:row;align-items:flex-start;justify-content:space-between;width:100%}._itemManagement_5jpfu_97{display:flex;flex-direction:column;align-items:flex-end;gap:var(--spacing-spacing-3xs)}._cartItem_5jpfu_53 p{margin:0;padding:0;word-wrap:break-word;white-space:normal;overflow-wrap:break-word}._itemImage_5jpfu_110{object-fit:contain}._removeItem_5jpfu_113{border:none;background-color:transparent;padding:0;margin:0;cursor:pointer;width:min-content;height:min-content}._noItems_5jpfu_123{display:flex;flex-direction:row;align-items:center;justify-content:center;height:100%}._subtotal_5jpfu_130{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:var(--spacing-0-5)}._checkoutButton_5jpfu_137{width:100%}
@@ -19,6 +19,8 @@ export type { ChipProps } from './molecules/Chip/Chip';
19
19
  export { ToggleView } from './molecules/ToggleView/ToggleView';
20
20
  export type { ToggleViewProps, ToggleOptionProps, ToggleOptionBaseProps, } from './molecules/ToggleView/ToggleView';
21
21
  export type { ShoppingCart, CartItem } from './molecules/Cart/Cart';
22
+ export { CartPart } from './molecules/Cart/CartPart';
23
+ export type { CartPartProps } from './molecules/Cart/CartPart';
22
24
  export { CartSlideInPanel } from './molecules/Cart/CartSlideInPanel';
23
25
  export type { CartSlideInPanelProps } from './molecules/Cart/CartSlideInPanel';
24
26
  export type { StatefulButtonProps } from './molecules/StatefulButton/StatefulButton';
@@ -5,9 +5,9 @@ import { Head as n } 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 C } from "./atoms/Text/Text.js";
8
+ import { Text as k } from "./atoms/Text/Text.js";
9
9
  import { Input as S } from "./atoms/Input/Input.js";
10
- import { Link as P } from "./atoms/Link/Link.js";
10
+ import { Link as I } from "./atoms/Link/Link.js";
11
11
  import { linkClassName as A } from "./atoms/Link/linkClassName.js";
12
12
  import { configureLink as M, routerOverride as T } from "./atoms/Link/configureLink.js";
13
13
  import { LinkButton as L } from "./atoms/LinkButton/LinkButton.js";
@@ -23,80 +23,82 @@ import { BannerCard as J } from "./molecules/BannerCard/BannerCard.js";
23
23
  import { CardLink as U } from "./molecules/CardLink/CardLink.js";
24
24
  import { Breadcrumbs as X } from "./molecules/Breadcrumbs/Breadcrumbs.js";
25
25
  import { NotFound as _ } from "./organisms/NotFound/NotFound.js";
26
- import { HorizontalScroll as oo } from "./atoms/HorizontalScroll/HorizontalScroll.js";
27
- import { SlideInPanel as eo } from "./atoms/SlideInPanel/SlideInPanel.js";
28
- import { Markdown as po } from "./atoms/Markdown/Markdown.js";
29
- import { PreprocessedMarkdown as fo } from "./atoms/Markdown/PreprocessedMarkdown.js";
30
- import { usePreprocessedMarkdown as ao } from "./atoms/Markdown/usePreprocessedMarkdown.js";
31
- import { Tooltip as io } from "./atoms/Tooltip/Tooltip.js";
32
- import { Popover as uo } from "./atoms/Popover/Popover.js";
33
- import { Account as so } from "./molecules/Account/Account.js";
34
- import { Chip as Co } from "./molecules/Chip/Chip.js";
35
- import { ToggleView as So } from "./molecules/ToggleView/ToggleView.js";
36
- import { CartSlideInPanel as Po } from "./molecules/Cart/CartSlideInPanel.js";
37
- import { StatefulButton as Ao } from "./molecules/StatefulButton/StatefulButton.js";
38
- import { AnimatedCheckMark as Mo } from "./molecules/StatefulButton/AnimatedCheckmark.js";
39
- import { AddToCart as vo } from "./molecules/AddToCart/AddToCart.js";
40
- import { Modal as ho } from "./molecules/Modal/Modal.js";
41
- import { ImageViewer as yo } from "./molecules/ImageViewer/ImageViewer.js";
42
- import { T as Ho } from "./Table-BX4PtCNE.js";
43
- import { Error as Vo } from "./molecules/Error/Error.js";
44
- import { MainNav as Eo } from "./organisms/MainNav/MainNav.js";
45
- import { ChipSelector as Oo } from "./organisms/ChipSelector/ChipSelector.js";
46
- import { Product as Ro } from "./organisms/Product/Product.js";
47
- import { Carousel as jo } from "./organisms/Carousel/Carousel.js";
48
- import { Footer as Do } from "./organisms/Footer/Footer.js";
49
- import { default as Ko } from "./organisms/SpinZoomViewer/SpinZoomViewer.js";
26
+ import { HorizontalScroll as rr } from "./atoms/HorizontalScroll/HorizontalScroll.js";
27
+ import { SlideInPanel as er } from "./atoms/SlideInPanel/SlideInPanel.js";
28
+ import { Markdown as pr } from "./atoms/Markdown/Markdown.js";
29
+ import { PreprocessedMarkdown as fr } from "./atoms/Markdown/PreprocessedMarkdown.js";
30
+ import { usePreprocessedMarkdown as ar } from "./atoms/Markdown/usePreprocessedMarkdown.js";
31
+ import { Tooltip as ir } from "./atoms/Tooltip/Tooltip.js";
32
+ import { Popover as dr } from "./atoms/Popover/Popover.js";
33
+ import { Account as cr } from "./molecules/Account/Account.js";
34
+ import { Chip as Cr } from "./molecules/Chip/Chip.js";
35
+ import { ToggleView as gr } from "./molecules/ToggleView/ToggleView.js";
36
+ import { CartPart as Pr } from "./molecules/Cart/CartPart.js";
37
+ import { CartSlideInPanel as wr } from "./molecules/Cart/CartSlideInPanel.js";
38
+ import { StatefulButton as Br } from "./molecules/StatefulButton/StatefulButton.js";
39
+ import { AnimatedCheckMark as Tr } from "./molecules/StatefulButton/AnimatedCheckmark.js";
40
+ import { AddToCart as Lr } from "./molecules/AddToCart/AddToCart.js";
41
+ import { Modal as br } from "./molecules/Modal/Modal.js";
42
+ import { ImageViewer as Fr } from "./molecules/ImageViewer/ImageViewer.js";
43
+ import { T as Nr } from "./Table-BX4PtCNE.js";
44
+ import { Error as zr } from "./molecules/Error/Error.js";
45
+ import { MainNav as Gr } from "./organisms/MainNav/MainNav.js";
46
+ import { ChipSelector as Qr } from "./organisms/ChipSelector/ChipSelector.js";
47
+ import { Product as Zr } from "./organisms/Product/Product.js";
48
+ import { Carousel as qr } from "./organisms/Carousel/Carousel.js";
49
+ import { Footer as Jr } from "./organisms/Footer/Footer.js";
50
+ import { default as Ur } from "./organisms/SpinZoomViewer/SpinZoomViewer.js";
50
51
  export {
51
- so as Account,
52
- vo as AddToCart,
53
- Mo as AnimatedCheckMark,
52
+ cr as Account,
53
+ Lr as AddToCart,
54
+ Tr as AnimatedCheckMark,
54
55
  Z as Availability,
55
56
  q as Avatar,
56
57
  J as BannerCard,
57
58
  X as Breadcrumbs,
58
59
  e as Button,
59
60
  U as CardLink,
60
- jo as Carousel,
61
- Po as CartSlideInPanel,
62
- Co as Chip,
63
- Oo as ChipSelector,
61
+ qr as Carousel,
62
+ Pr as CartPart,
63
+ wr as CartSlideInPanel,
64
+ Cr as Chip,
65
+ Qr as ChipSelector,
64
66
  f as Column,
65
- Vo as Error,
67
+ zr as Error,
66
68
  p as Flex,
67
- Do as Footer,
69
+ Jr as Footer,
68
70
  x as Grid,
69
71
  n as Head,
70
- oo as HorizontalScroll,
72
+ rr as HorizontalScroll,
71
73
  l as Icon,
72
- yo as ImageViewer,
74
+ Fr as ImageViewer,
73
75
  S as Input,
74
- P as Link,
76
+ I as Link,
75
77
  L as LinkButton,
76
78
  N as Logo,
77
- Eo as MainNav,
78
- po as Markdown,
79
- ho as Modal,
79
+ Gr as MainNav,
80
+ pr as Markdown,
81
+ br as Modal,
80
82
  _ as NotFound,
81
- uo as Popover,
82
- fo as PreprocessedMarkdown,
83
+ dr as Popover,
84
+ fr as PreprocessedMarkdown,
83
85
  Q as Pricing,
84
- Ro as Product,
86
+ Zr as Product,
85
87
  G as QuantityInput,
86
88
  u as Root,
87
89
  z as SearchBox,
88
90
  s as Separator,
89
- eo as SlideInPanel,
90
- Ko as SpinZoomViewer,
91
- Ao as StatefulButton,
92
- Ho as Table,
93
- C as Text,
94
- So as ToggleView,
95
- io as Tooltip,
91
+ er as SlideInPanel,
92
+ Ur as SpinZoomViewer,
93
+ Br as StatefulButton,
94
+ Nr as Table,
95
+ k as Text,
96
+ gr as ToggleView,
97
+ ir as Tooltip,
96
98
  b as configureImage,
97
99
  M as configureLink,
98
100
  F as getHideAtStyles,
99
101
  A as linkClassName,
100
102
  T as routerOverride,
101
- ao as usePreprocessedMarkdown
103
+ ar as usePreprocessedMarkdown
102
104
  };
@@ -2,7 +2,7 @@ import { jsx as a, jsxs as d } from "react/jsx-runtime";
2
2
  import l from "react";
3
3
  import { Icon as g } from "../../atoms/Icon/Icon.js";
4
4
  import { Text as p } from "../../atoms/Text/Text.js";
5
- import { s as m } from "../../Cart.module-gkb4IOVS.js";
5
+ import { s as m } from "../../Cart.module-B-yc1ax6.js";
6
6
  const S = l.forwardRef(function({
7
7
  cart: i,
8
8
  open: t = !1,
@@ -0,0 +1,20 @@
1
+ import { default as React } from 'react';
2
+ import { ContactUsLinkBehavior } from '../Availability/Availability';
3
+ export interface CartPartProps extends Omit<React.LiHTMLAttributes<HTMLLIElement>, "title"> {
4
+ imageUrl?: string;
5
+ imageAlt?: string;
6
+ title: React.ReactNode;
7
+ titleHref?: string;
8
+ partNumber?: string | number;
9
+ custom?: boolean;
10
+ availabilityId?: string;
11
+ availability?: string;
12
+ contactHref?: string;
13
+ contactLinkBehavior?: ContactUsLinkBehavior;
14
+ priceLabel?: string;
15
+ price?: string;
16
+ quantity?: number;
17
+ onQuantityChange?: (_quantity: number) => void;
18
+ onRemove?: () => void;
19
+ }
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;
@@ -0,0 +1,70 @@
1
+ import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
+ import { Link as N } from "../../atoms/Link/Link.js";
3
+ import { Text as m } from "../../atoms/Text/Text.js";
4
+ import { s as r } from "../../Cart.module-B-yc1ax6.js";
5
+ import { Image as z } from "../../atoms/Image/Image.js";
6
+ import { c as P } from "../../clsx-OuTLNxxd.js";
7
+ import { Availability as w } from "../Availability/Availability.js";
8
+ import { Pricing as y } from "../Pricing/Pricing.js";
9
+ import { QuantityInput as k } from "../QuantityInput/QuantityInput.js";
10
+ import { Icon as L } from "../../atoms/Icon/Icon.js";
11
+ function B({
12
+ imageUrl: f,
13
+ imageAlt: h = "Product image",
14
+ title: a,
15
+ titleHref: s,
16
+ partNumber: t,
17
+ custom: p,
18
+ availabilityId: u,
19
+ availability: o,
20
+ contactHref: I,
21
+ contactLinkBehavior: g = "new-tab",
22
+ priceLabel: v = "List Price",
23
+ price: c,
24
+ quantity: l,
25
+ onQuantityChange: n,
26
+ onRemove: d,
27
+ className: b,
28
+ ...x
29
+ }) {
30
+ return /* @__PURE__ */ i("li", { className: P(r.cartItem, b), ...x, children: [
31
+ /* @__PURE__ */ e(z, { height: 50, width: 50, src: f || "", alt: h, className: r.itemImage }),
32
+ /* @__PURE__ */ i("div", { children: [
33
+ /* @__PURE__ */ i("div", { className: r.topRow, children: [
34
+ /* @__PURE__ */ i("div", { className: r.itemInfo, children: [
35
+ /* @__PURE__ */ e(m, { size: "sm", weight: "semibold", children: s ? /* @__PURE__ */ e(N, { href: s, children: a }) : a }),
36
+ t != null && /* @__PURE__ */ i(m, { size: "sm", children: [
37
+ /* @__PURE__ */ e(m, { colorToken: "quaternary", size: "xs", children: p ? "Specs " : "Part # " }),
38
+ t
39
+ ] })
40
+ ] }),
41
+ d && /* @__PURE__ */ e("button", { onClick: d, className: r.removeItem, "aria-label": "Remove item", type: "button", children: /* @__PURE__ */ e(L, { iconKey: "fa-regular fa-trash", size: "sm" }) })
42
+ ] }),
43
+ /* @__PURE__ */ i("div", { className: r.itemManagement, children: [
44
+ /* @__PURE__ */ i("div", { className: r.purchaseInformation, children: [
45
+ o && /* @__PURE__ */ e(
46
+ w,
47
+ {
48
+ availId: u || "",
49
+ availDescription: o,
50
+ contactHref: I || "",
51
+ contactLinkBehavior: g
52
+ }
53
+ ),
54
+ c && /* @__PURE__ */ e(y, { pricingLabel: v, price: c })
55
+ ] }),
56
+ typeof l == "number" && n && /* @__PURE__ */ e(
57
+ k,
58
+ {
59
+ quantity: l,
60
+ onQuantityChange: n,
61
+ size: "sm"
62
+ }
63
+ )
64
+ ] })
65
+ ] })
66
+ ] });
67
+ }
68
+ export {
69
+ B as CartPart
70
+ };
@@ -0,0 +1,31 @@
1
+ import { StoryObj } from '@storybook/react-vite';
2
+ import { CartPart } from './CartPart';
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof CartPart;
6
+ parameters: {
7
+ layout: string;
8
+ };
9
+ tags: string[];
10
+ args: {
11
+ imageUrl: string;
12
+ imageAlt: string;
13
+ title: string;
14
+ titleHref: string;
15
+ partNumber: string;
16
+ custom: false;
17
+ availabilityId: string;
18
+ availability: string;
19
+ contactHref: string;
20
+ contactLinkBehavior: "new-tab";
21
+ priceLabel: string;
22
+ price: string;
23
+ quantity: number;
24
+ onQuantityChange: () => void;
25
+ onRemove: () => void;
26
+ };
27
+ };
28
+ export default meta;
29
+ type Story = StoryObj<typeof meta>;
30
+ export declare const Basic: Story;
31
+ export declare const CustomSpecs: Story;
@@ -0,0 +1,46 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { CartPart as e } from "./CartPart.js";
3
+ const l = {
4
+ title: "Case Parts/Molecules/CartPart",
5
+ component: e,
6
+ parameters: {
7
+ layout: "centered"
8
+ },
9
+ tags: ["autodocs"],
10
+ args: {
11
+ imageUrl: "https://m.media-amazon.com/images/I/216+JEttsYL._UF1000,1000_QL80_.jpg",
12
+ imageAlt: "1094-01 product image",
13
+ title: "Kason Door Closer - Flush",
14
+ titleHref: "#",
15
+ partNumber: "1094-01",
16
+ custom: !1,
17
+ availabilityId: "available",
18
+ availability: "In Stock",
19
+ contactHref: "#",
20
+ contactLinkBehavior: "new-tab",
21
+ priceLabel: "List Price",
22
+ price: "$99.99",
23
+ quantity: 1,
24
+ onQuantityChange: () => {
25
+ },
26
+ onRemove: () => {
27
+ }
28
+ }
29
+ }, o = {
30
+ render: (a) => /* @__PURE__ */ t("div", { style: { width: 360 }, children: /* @__PURE__ */ t("ul", { style: { margin: 0, padding: 0 }, children: /* @__PURE__ */ t(e, { ...a }) }) })
31
+ }, s = {
32
+ args: {
33
+ title: "Custom-Molded Snap-In Magnetic Gasket",
34
+ partNumber: 'MG064 36" x 79" 3-Sided Dart-to-Dart Gasket',
35
+ custom: !0,
36
+ availabilityId: "contact",
37
+ availability: "Contact us for availability",
38
+ price: "$129.99"
39
+ },
40
+ render: (a) => /* @__PURE__ */ t("div", { style: { width: 360 }, children: /* @__PURE__ */ t("ul", { style: { margin: 0, padding: 0 }, children: /* @__PURE__ */ t(e, { ...a }) }) })
41
+ };
42
+ export {
43
+ o as Basic,
44
+ s as CustomSpecs,
45
+ l as default
46
+ };
@@ -1,93 +1,74 @@
1
- import { jsx as e, jsxs as a } from "react/jsx-runtime";
2
- import { SlideInPanel as y } from "../../atoms/SlideInPanel/SlideInPanel.js";
3
- import { Text as n } from "../../atoms/Text/Text.js";
4
- import { Link as I } from "../../atoms/Link/Link.js";
5
- import { Button as b } from "../../atoms/Button/Button.js";
6
- import { Pricing as N } from "../Pricing/Pricing.js";
7
- import { QuantityInput as z } from "../QuantityInput/QuantityInput.js";
8
- import { Availability as k } from "../Availability/Availability.js";
9
- import { Icon as c } from "../../atoms/Icon/Icon.js";
10
- import { s as r } from "../../Cart.module-gkb4IOVS.js";
11
- function H({
1
+ import { jsx as i, jsxs as r } from "react/jsx-runtime";
2
+ import { SlideInPanel as b } from "../../atoms/SlideInPanel/SlideInPanel.js";
3
+ import { Text as l } from "../../atoms/Text/Text.js";
4
+ import { Button as f } from "../../atoms/Button/Button.js";
5
+ import { Icon as v } from "../../atoms/Icon/Icon.js";
6
+ import { CartPart as I } from "./CartPart.js";
7
+ import { s as a } from "../../Cart.module-B-yc1ax6.js";
8
+ function q({
12
9
  open: o,
13
- onClose: l,
10
+ onClose: m,
14
11
  cart: t,
15
- subtotal: m,
12
+ subtotal: n,
16
13
  itemPriceLabel: d,
17
- contactHref: h,
18
- contactLinkBehavior: p,
19
- onItemQtyChange: u,
20
- onItemDelete: f,
21
- onCheckout: v
14
+ contactHref: c,
15
+ contactLinkBehavior: h,
16
+ onItemQtyChange: p,
17
+ onItemDelete: u,
18
+ onCheckout: y
22
19
  }) {
23
20
  var s;
24
- return t = t || { items: [] }, /* @__PURE__ */ e(
25
- y,
21
+ return t = t || { items: [] }, /* @__PURE__ */ i(
22
+ b,
26
23
  {
27
24
  side: "right",
28
25
  open: o,
29
- onClose: l,
26
+ onClose: m,
30
27
  ariaLabel: "Shopping Cart",
31
- children: /* @__PURE__ */ a("div", { id: "cart-panel", className: r.cartContainer, children: [
32
- /* @__PURE__ */ a("div", { className: r.headerWrapper, children: [
33
- /* @__PURE__ */ a("div", { className: r.header, children: [
34
- /* @__PURE__ */ e(n, { size: "2xl", children: "Cart" }),
35
- /* @__PURE__ */ a(n, { size: "xs", colorToken: "quaternary", children: [
28
+ children: /* @__PURE__ */ r("div", { id: "cart-panel", className: a.cartContainer, children: [
29
+ /* @__PURE__ */ r("div", { className: a.headerWrapper, children: [
30
+ /* @__PURE__ */ r("div", { className: a.header, children: [
31
+ /* @__PURE__ */ i(l, { size: "2xl", children: "Cart" }),
32
+ /* @__PURE__ */ r(l, { size: "xs", colorToken: "quaternary", children: [
36
33
  (s = t == null ? void 0 : t.items) == null ? void 0 : s.length,
37
34
  " items in your cart"
38
35
  ] })
39
36
  ] }),
40
- /* @__PURE__ */ e("button", { onClick: l, children: /* @__PURE__ */ e(c, { iconKey: "fa-regular fa-xmark", size: "md" }) })
37
+ /* @__PURE__ */ i("button", { onClick: m, children: /* @__PURE__ */ i(v, { iconKey: "fa-regular fa-xmark", size: "md" }) })
41
38
  ] }),
42
- /* @__PURE__ */ e("div", { className: r.cartItems, children: t.items.length > 0 ? /* @__PURE__ */ e("ul", { children: t.items.map((i) => /* @__PURE__ */ a("li", { className: r.cartItem, children: [
43
- /* @__PURE__ */ e("img", { src: i.imageUrl, alt: `${i.itemId} product image` }),
44
- /* @__PURE__ */ a("div", { children: [
45
- /* @__PURE__ */ a("div", { className: r.topRow, children: [
46
- /* @__PURE__ */ a("div", { className: r.itemInfo, children: [
47
- /* @__PURE__ */ e(n, { size: "sm", weight: "semibold", children: /* @__PURE__ */ e(I, { href: i.itemHref || `/part/${i.itemId}`, children: i.description }) }),
48
- /* @__PURE__ */ a(n, { size: "sm", children: [
49
- /* @__PURE__ */ e(n, { colorToken: "quaternary", size: "xs", children: i.custom ? "Specs " : "Part # " }),
50
- i.itemId
51
- ] })
52
- ] }),
53
- /* @__PURE__ */ e("button", { onClick: () => f(i), className: r.removeItem, "aria-label": "Remove item", children: /* @__PURE__ */ e(c, { iconKey: "fa-regular fa-trash", size: "sm" }) })
54
- ] }),
55
- /* @__PURE__ */ a("div", { className: r.itemManagement, children: [
56
- /* @__PURE__ */ a("div", { className: r.purchaseInformation, children: [
57
- /* @__PURE__ */ e(
58
- k,
59
- {
60
- availId: i.availabilityId || "",
61
- availDescription: i.availability || "",
62
- contactHref: h || "",
63
- contactLinkBehavior: p || "new-tab"
64
- }
65
- ),
66
- /* @__PURE__ */ e(N, { pricingLabel: d || "List Price", price: i.price })
67
- ] }),
68
- /* @__PURE__ */ e(
69
- z,
70
- {
71
- quantity: i.quantity,
72
- onQuantityChange: (g) => u(i, g),
73
- size: "sm"
74
- }
75
- )
76
- ] })
77
- ] })
78
- ] }, i.id)) }) : /* @__PURE__ */ e("div", { className: r.noItems, children: /* @__PURE__ */ e(n, { as: "p", size: "sm", children: "No items in your cart yet" }) }) }),
79
- m && /* @__PURE__ */ a("div", { className: r.subtotal, children: [
80
- /* @__PURE__ */ e(n, { size: "md", weight: "semibold", children: "Subtotal" }),
81
- /* @__PURE__ */ e(n, { size: "md", weight: "semibold", children: m })
39
+ /* @__PURE__ */ i("div", { className: a.cartItems, children: t.items.length > 0 ? /* @__PURE__ */ i("ul", { children: t.items.map((e) => /* @__PURE__ */ i(
40
+ I,
41
+ {
42
+ imageUrl: e.imageUrl,
43
+ imageAlt: `${e.itemId} product image`,
44
+ title: e.description,
45
+ titleHref: e.itemHref || `/part/${e.itemId}`,
46
+ partNumber: e.itemId,
47
+ custom: !!e.custom,
48
+ availabilityId: e.availabilityId,
49
+ availability: e.availability,
50
+ contactHref: c,
51
+ contactLinkBehavior: h,
52
+ price: e.price,
53
+ priceLabel: d || "List Price",
54
+ quantity: e.quantity,
55
+ onQuantityChange: (g) => p(e, g),
56
+ onRemove: () => u(e)
57
+ },
58
+ e.id
59
+ )) }) : /* @__PURE__ */ i("div", { className: a.noItems, children: /* @__PURE__ */ i(l, { as: "p", size: "sm", children: "No items in your cart yet" }) }) }),
60
+ n && /* @__PURE__ */ r("div", { className: a.subtotal, children: [
61
+ /* @__PURE__ */ i(l, { size: "md", weight: "semibold", children: "Subtotal" }),
62
+ /* @__PURE__ */ i(l, { size: "md", weight: "semibold", children: n })
82
63
  ] }),
83
- /* @__PURE__ */ e(
84
- b,
64
+ /* @__PURE__ */ i(
65
+ f,
85
66
  {
86
67
  disabled: t.items.length === 0,
87
- onClick: v,
68
+ onClick: y,
88
69
  variant: "cta-primary",
89
70
  size: "md",
90
- className: r.checkoutButton,
71
+ className: a.checkoutButton,
91
72
  children: "Checkout"
92
73
  }
93
74
  )
@@ -96,5 +77,5 @@ function H({
96
77
  );
97
78
  }
98
79
  export {
99
- H as CartSlideInPanel
80
+ q as CartSlideInPanel
100
81
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@caseparts-org/caseblocks",
3
3
  "private": false,
4
- "version": "0.0.160",
4
+ "version": "0.0.162",
5
5
  "type": "module",
6
6
  "module": "dist/main.js",
7
7
  "types": "dist/main.d.ts",
@@ -1,19 +0,0 @@
1
- import './assets/Cart.css';const t = "_cartIconButton_1dh0n_2", n = "_count_1dh0n_9", o = "_cartContainer_1dh0n_24", e = "_headerWrapper_1dh0n_35", _ = "_header_1dh0n_35", c = "_cartItems_1dh0n_53", a = "_topRow_1dh0n_78", r = "_itemInfo_1dh0n_84", s = "_purchaseInformation_1dh0n_89", h = "_itemManagement_1dh0n_96", m = "_removeItem_1dh0n_114", d = "_noItems_1dh0n_124", u = "_subtotal_1dh0n_131", I = "_checkoutButton_1dh0n_138", p = {
2
- cartIconButton: t,
3
- count: n,
4
- cartContainer: o,
5
- headerWrapper: e,
6
- header: _,
7
- cartItems: c,
8
- topRow: a,
9
- itemInfo: r,
10
- purchaseInformation: s,
11
- itemManagement: h,
12
- removeItem: m,
13
- noItems: d,
14
- subtotal: u,
15
- checkoutButton: I
16
- };
17
- export {
18
- p as s
19
- };