@caseparts-org/caseblocks 0.0.90 → 0.0.91

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.
Files changed (46) hide show
  1. package/dist/Cart.module-9txlotpz.js +18 -0
  2. package/dist/assets/Cart.css +1 -1
  3. package/dist/assets/Icon.css +1 -1
  4. package/dist/assets/Popover.css +1 -0
  5. package/dist/assets/SlideInPanel.css +1 -0
  6. package/dist/assets/Tooltip.css +1 -1
  7. package/dist/assets/buttonClassName.css +1 -1
  8. package/dist/atoms/Button/buttonClassName.js +25 -25
  9. package/dist/atoms/Icon/Icon.d.ts +3 -1
  10. package/dist/atoms/Icon/Icon.js +48 -32
  11. package/dist/atoms/Input/Input.js +4 -4
  12. package/dist/atoms/Popover/Popover.d.ts +14 -0
  13. package/dist/atoms/Popover/Popover.js +110 -0
  14. package/dist/atoms/Popover/Popover.stories.d.ts +66 -0
  15. package/dist/atoms/Popover/Popover.stories.js +207 -0
  16. package/dist/atoms/SlideInPanel/SlideInPanel.d.ts +18 -0
  17. package/dist/atoms/SlideInPanel/SlideInPanel.js +99 -0
  18. package/dist/atoms/SlideInPanel/SlideInPanel.stories.d.ts +10 -0
  19. package/dist/atoms/SlideInPanel/SlideInPanel.stories.js +117 -0
  20. package/dist/atoms/Tooltip/Tooltip.d.ts +16 -0
  21. package/dist/atoms/Tooltip/Tooltip.js +126 -0
  22. package/dist/{molecules → atoms}/Tooltip/Tooltip.stories.d.ts +8 -26
  23. package/dist/atoms/Tooltip/Tooltip.stories.js +209 -0
  24. package/dist/index-B4KbmMH3.js +383 -0
  25. package/dist/main-client.d.ts +3 -1
  26. package/dist/main-client.js +40 -38
  27. package/dist/molecules/AddToCart/AddToCart.js +18 -18
  28. package/dist/molecules/Cart/Cart.d.ts +10 -6
  29. package/dist/molecules/Cart/Cart.js +42 -93
  30. package/dist/molecules/Cart/Cart.stories.js +61 -28
  31. package/dist/molecules/Cart/CartSlideInPanel.d.ts +15 -0
  32. package/dist/molecules/Cart/CartSlideInPanel.js +97 -0
  33. package/dist/molecules/CategoryNav/CategoryNav.js +2 -2
  34. package/dist/molecules/StatefulButton/StatefulButton.stories.js +4 -4
  35. package/dist/molecules/ToggleView/ToggleView.js +6 -6
  36. package/dist/organisms/Carousel/Carousel.js +44 -44
  37. package/dist/organisms/Footer/Footer.js +1 -1
  38. package/dist/organisms/MainNav/MainNav.d.ts +13 -11
  39. package/dist/organisms/MainNav/MainNav.js +86 -82
  40. package/dist/organisms/MainNav/MainNav.stories.d.ts +1 -2
  41. package/dist/organisms/MainNav/MainNav.stories.js +85 -58
  42. package/package.json +28 -7
  43. package/dist/molecules/Cart/Cart.stories.d.ts +0 -15
  44. package/dist/molecules/Tooltip/Tooltip.d.ts +0 -12
  45. package/dist/molecules/Tooltip/Tooltip.js +0 -2321
  46. package/dist/molecules/Tooltip/Tooltip.stories.js +0 -202
@@ -1,18 +1,18 @@
1
1
  import { Button as t } from "./atoms/Button/Button.js";
2
2
  import { Flex as p } from "./atoms/Flex/Flex.js";
3
3
  import { Column as f, Grid as x } from "./atoms/Grid/Grid.js";
4
- import { Head as n } from "./atoms/Root/Head.js";
5
- import { Icon as u } from "./atoms/Icon/Icon.js";
4
+ import { Head as a } from "./atoms/Root/Head.js";
5
+ import { Icon as l } from "./atoms/Icon/Icon.js";
6
6
  import { Root as c } from "./atoms/Root/Root.js";
7
7
  import { Separator as C } from "./atoms/Separator/Separator.js";
8
8
  import { Text as k } from "./atoms/Text/Text.js";
9
- import { Input as B } from "./atoms/Input/Input.js";
10
- import { Link as S } from "./atoms/Link/Link.js";
11
- import { linkClassName as v } from "./atoms/Link/linkClassName.js";
9
+ import { Input as A } from "./atoms/Input/Input.js";
10
+ import { Link as I } from "./atoms/Link/Link.js";
11
+ import { linkClassName as h } from "./atoms/Link/linkClassName.js";
12
12
  import { configureLink as T, routerOverride as s } from "./atoms/Link/configureLink.js";
13
13
  import { LinkButton as N } from "./atoms/LinkButton/LinkButton.js";
14
- import { configureImage as H } from "./atoms/Image/configureImage.js";
15
- import { Logo as P } from "./molecules/Logo/Logo.js";
14
+ import { configureImage as y } from "./atoms/Image/configureImage.js";
15
+ import { Logo as M } from "./molecules/Logo/Logo.js";
16
16
  import { SearchBox as w } from "./molecules/SearchBox/SearchBox.js";
17
17
  import { QuantityInput as G } from "./molecules/QuantityInput/QuantityInput.js";
18
18
  import { Pricing as Q } from "./molecules/Pricing/Pricing.js";
@@ -22,55 +22,57 @@ import { BannerCard as E } from "./molecules/BannerCard/BannerCard.js";
22
22
  import { CardLink as K } from "./molecules/CardLink/CardLink.js";
23
23
  import { NotFound as W } from "./organisms/NotFound/NotFound.js";
24
24
  import { HorizontalScroll as Y } from "./atoms/HorizontalScroll/HorizontalScroll.js";
25
- import { Tooltip as _ } from "./molecules/Tooltip/Tooltip.js";
26
- import { Account as oo } from "./molecules/Account/Account.js";
27
- import { Chip as to } from "./molecules/Chip/Chip.js";
28
- import { ToggleView as po } from "./molecules/ToggleView/ToggleView.js";
29
- import { StatefulButton as fo } from "./molecules/StatefulButton/StatefulButton.js";
30
- import { AnimatedCheckMark as ao } from "./molecules/StatefulButton/AnimatedCheckmark.js";
31
- import { AddToCart as io } from "./molecules/AddToCart/AddToCart.js";
32
- import { MainNav as lo } from "./organisms/MainNav/MainNav.js";
33
- import { ChipSelector as Co } from "./organisms/ChipSelector/ChipSelector.js";
34
- import { Product as ko } from "./organisms/Product/Product.js";
35
- import { Carousel as Bo } from "./organisms/Carousel/Carousel.js";
36
- import { Footer as So } from "./organisms/Footer/Footer.js";
25
+ import { SlideInPanel as _ } from "./atoms/SlideInPanel/SlideInPanel.js";
26
+ import { Tooltip as oo } from "./atoms/Tooltip/Tooltip.js";
27
+ import { Account as to } from "./molecules/Account/Account.js";
28
+ import { Chip as po } from "./molecules/Chip/Chip.js";
29
+ import { ToggleView as fo } from "./molecules/ToggleView/ToggleView.js";
30
+ import { StatefulButton as no } from "./molecules/StatefulButton/StatefulButton.js";
31
+ import { AnimatedCheckMark as io } from "./molecules/StatefulButton/AnimatedCheckmark.js";
32
+ import { AddToCart as uo } from "./molecules/AddToCart/AddToCart.js";
33
+ import { MainNav as Co } from "./organisms/MainNav/MainNav.js";
34
+ import { ChipSelector as ko } from "./organisms/ChipSelector/ChipSelector.js";
35
+ import { Product as Ao } from "./organisms/Product/Product.js";
36
+ import { Carousel as Io } from "./organisms/Carousel/Carousel.js";
37
+ import { Footer as ho } from "./organisms/Footer/Footer.js";
37
38
  export {
38
- oo as Account,
39
- io as AddToCart,
40
- ao as AnimatedCheckMark,
39
+ to as Account,
40
+ uo as AddToCart,
41
+ io as AnimatedCheckMark,
41
42
  V as Availability,
42
43
  q as Avatar,
43
44
  E as BannerCard,
44
45
  t as Button,
45
46
  K as CardLink,
46
- Bo as Carousel,
47
- to as Chip,
48
- Co as ChipSelector,
47
+ Io as Carousel,
48
+ po as Chip,
49
+ ko as ChipSelector,
49
50
  f as Column,
50
51
  p as Flex,
51
- So as Footer,
52
+ ho as Footer,
52
53
  x as Grid,
53
- n as Head,
54
+ a as Head,
54
55
  Y as HorizontalScroll,
55
- u as Icon,
56
- B as Input,
57
- S as Link,
56
+ l as Icon,
57
+ A as Input,
58
+ I as Link,
58
59
  N as LinkButton,
59
- P as Logo,
60
- lo as MainNav,
60
+ M as Logo,
61
+ Co as MainNav,
61
62
  W as NotFound,
62
63
  Q as Pricing,
63
- ko as Product,
64
+ Ao as Product,
64
65
  G as QuantityInput,
65
66
  c as Root,
66
67
  w as SearchBox,
67
68
  C as Separator,
68
- fo as StatefulButton,
69
+ _ as SlideInPanel,
70
+ no as StatefulButton,
69
71
  k as Text,
70
- po as ToggleView,
71
- _ as Tooltip,
72
- H as configureImage,
72
+ fo as ToggleView,
73
+ oo as Tooltip,
74
+ y as configureImage,
73
75
  T as configureLink,
74
- v as linkClassName,
76
+ h as linkClassName,
75
77
  s as routerOverride
76
78
  };
@@ -1,4 +1,4 @@
1
- import { jsxs as _, jsx as i } from "react/jsx-runtime";
1
+ import { jsxs as S, jsx as d } from "react/jsx-runtime";
2
2
  import r from "react";
3
3
  import { c as j } from "../../clsx-OuTLNxxd.js";
4
4
  import { StatefulButton as v } from "../StatefulButton/StatefulButton.js";
@@ -8,7 +8,7 @@ import '../../assets/AddToCart.css';const w = "_container_1xk40_1", y = {
8
8
  };
9
9
  function F({
10
10
  itemKey: s,
11
- initialQuantity: d = 1,
11
+ initialQuantity: i = 1,
12
12
  min: o = 1,
13
13
  max: l,
14
14
  onQuantityChange: c,
@@ -17,42 +17,42 @@ function F({
17
17
  showQuantity: p = !0,
18
18
  className: x,
19
19
  addButtonClassName: T,
20
- buttonText: b,
21
- buttonDoneText: k,
20
+ buttonText: _,
21
+ buttonDoneText: b,
22
22
  size: a
23
23
  }) {
24
- const [u, A] = r.useState(() => {
25
- const e = Number(d) || 1;
24
+ const [u, k] = r.useState(() => {
25
+ const e = Number(i) || 1;
26
26
  return e < o ? o : e;
27
- }), [N, n] = r.useState(!1), t = r.useRef(null);
27
+ }), [A, n] = r.useState(!1), t = r.useRef(null);
28
28
  r.useEffect(() => () => {
29
29
  t.current && clearTimeout(t.current);
30
30
  }, []);
31
- const R = r.useCallback((e) => {
32
- A(e), c == null || c(e);
33
- }, [c]), S = async () => {
31
+ const N = r.useCallback((e) => {
32
+ k(e), c == null || c(e);
33
+ }, [c]), R = async () => {
34
34
  s && (await m(s, u), n(!0), t.current && clearTimeout(t.current), t.current = setTimeout(() => n(!1), f));
35
35
  };
36
- return /* @__PURE__ */ _("div", { className: j(y.container, x), children: [
37
- p && /* @__PURE__ */ i(
36
+ return /* @__PURE__ */ S("div", { className: j(y.container, x), children: [
37
+ p && /* @__PURE__ */ d(
38
38
  q,
39
39
  {
40
40
  quantity: u,
41
- onQuantityChange: R,
41
+ onQuantityChange: N,
42
42
  min: o,
43
43
  max: l,
44
44
  size: a || "md"
45
45
  }
46
46
  ),
47
- /* @__PURE__ */ i(
47
+ /* @__PURE__ */ d(
48
48
  v,
49
49
  {
50
50
  size: a || "md",
51
51
  variant: "cta-primary",
52
- completed: N,
53
- onClick: S,
54
- text: b,
55
- completedText: k,
52
+ completed: A,
53
+ onClick: R,
54
+ text: _,
55
+ completedText: b,
56
56
  disabled: !s,
57
57
  className: T
58
58
  }
@@ -1,5 +1,4 @@
1
1
  import { default as React } from 'react';
2
- import { ContactUsLinkBehavior } from '../Availability/Availability';
3
2
  export interface CartItem {
4
3
  id: string | number;
5
4
  itemId: string | undefined;
@@ -17,15 +16,20 @@ export interface ShoppingCart {
17
16
  export interface CartPropsBase {
18
17
  onItemQtyChange: (_item: CartItem, _newQuantity: number) => void;
19
18
  onItemDelete: (_item: CartItem) => void;
20
- onItemEdit: (_item: CartItem) => void;
21
19
  onCheckout: () => void;
20
+ cart: ShoppingCart;
22
21
  subtotal?: string;
23
22
  itemPriceLabel?: string;
24
- cart: ShoppingCart;
25
23
  contactHref?: string;
26
- contactLinkBehavior?: ContactUsLinkBehavior;
24
+ open?: boolean;
25
+ onCartClick: () => void;
26
+ }
27
+ export interface ShoppingCartHandle {
28
+ open: () => void;
29
+ close: () => void;
30
+ toggle: () => void;
27
31
  }
28
- interface CartProps extends CartPropsBase, React.HtmlHTMLAttributes<HTMLButtonElement> {
32
+ interface CartProps extends CartPropsBase, React.ButtonHTMLAttributes<HTMLButtonElement> {
29
33
  }
30
- export declare function ShoppingCart({ cart, onItemQtyChange, onItemDelete, onCheckout, subtotal, contactHref, contactLinkBehavior, itemPriceLabel, ...otherProps }: CartProps): import("react/jsx-runtime").JSX.Element;
34
+ export declare const ShoppingCart: React.ForwardRefExoticComponent<CartProps & React.RefAttributes<ShoppingCartHandle>>;
31
35
  export {};
@@ -1,97 +1,46 @@
1
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
2
- import { Icon as m } from "../../atoms/Icon/Icon.js";
3
- import { Text as a } from "../../atoms/Text/Text.js";
4
- import { Link as u } from "../../atoms/Link/Link.js";
5
- import { Button as f } from "../../atoms/Button/Button.js";
6
- import { Tooltip as g } from "../Tooltip/Tooltip.js";
7
- import { Pricing as v } from "../Pricing/Pricing.js";
8
- import { QuantityInput as w } from "../QuantityInput/QuantityInput.js";
9
- import { Availability as x } from "../Availability/Availability.js";
10
- import '../../assets/Cart.css';const b = "_cart_11wxn_2", y = "_count_11wxn_9", N = "_cartTooltip_11wxn_24", C = "_cartContainer_11wxn_27", z = "_cartItems_11wxn_35", k = "_topRow_11wxn_57", T = "_itemInfo_11wxn_63", L = "_purchaseInformation_11wxn_68", M = "_itemManagement_11wxn_75", R = "_removeItem_11wxn_93", P = "_noItems_11wxn_101", S = "_subtotal_11wxn_108", i = {
11
- cart: b,
12
- count: y,
13
- cartTooltip: N,
14
- cartContainer: C,
15
- cartItems: z,
16
- topRow: k,
17
- itemInfo: T,
18
- purchaseInformation: L,
19
- itemManagement: M,
20
- removeItem: R,
21
- noItems: P,
22
- subtotal: S
23
- };
24
- function U({
25
- cart: o,
26
- onItemQtyChange: s,
27
- onItemDelete: c,
28
- onCheckout: l,
29
- subtotal: r,
30
- contactHref: d,
31
- contactLinkBehavior: h,
32
- itemPriceLabel: p,
33
- ..._
34
- }) {
35
- return o = o || { items: [] }, /* @__PURE__ */ t(
36
- g,
1
+ import { jsx as a, jsxs as d } from "react/jsx-runtime";
2
+ import l from "react";
3
+ import { Icon as g } from "../../atoms/Icon/Icon.js";
4
+ import { Text as p } from "../../atoms/Text/Text.js";
5
+ import { s as m } from "../../Cart.module-9txlotpz.js";
6
+ const S = l.forwardRef(function({
7
+ cart: i,
8
+ open: t = !1,
9
+ onCartClick: e,
10
+ className: c,
11
+ ...n
12
+ }, o) {
13
+ i = i || { items: [] }, l.useImperativeHandle(o, () => ({
14
+ open: () => {
15
+ t || e();
16
+ },
17
+ close: () => {
18
+ t && e();
19
+ },
20
+ toggle: () => {
21
+ e();
22
+ }
23
+ }), [t, e]);
24
+ const f = (r) => {
25
+ var s;
26
+ (s = n.onClick) == null || s.call(n, r), e();
27
+ };
28
+ return /* @__PURE__ */ a("div", { className: c, children: /* @__PURE__ */ d(
29
+ "button",
37
30
  {
38
- tooltipClassName: i.cartTooltip,
39
- trigger: /* @__PURE__ */ n("button", { className: i.cart, tabIndex: 0, ..._, children: [
40
- /* @__PURE__ */ t(
41
- m,
42
- {
43
- iconKey: "fa-kit fa-shoppingcart-empty",
44
- title: "Shopping Cart",
45
- size: "lg"
46
- }
47
- ),
48
- o.items.length > 0 && /* @__PURE__ */ t("div", { className: i.count, children: /* @__PURE__ */ t(a, { size: "xxs", children: o.items.length }) })
49
- ] }),
50
- placement: "bottom",
51
- on: "click",
52
- children: /* @__PURE__ */ n("div", { className: i.cartContainer, children: [
53
- /* @__PURE__ */ t(a, { size: "2xl", children: "Cart" }),
54
- /* @__PURE__ */ t("div", { className: i.cartItems, children: o.items.length > 0 ? /* @__PURE__ */ t("ul", { children: o.items.map(
55
- (e) => /* @__PURE__ */ n("li", { className: i.cartItem, children: [
56
- /* @__PURE__ */ t("img", { src: e.imageUrl, alt: `${e.itemId} product image` }),
57
- /* @__PURE__ */ n("div", { children: [
58
- /* @__PURE__ */ n("div", { className: i.topRow, children: [
59
- /* @__PURE__ */ n("div", { className: i.itemInfo, children: [
60
- /* @__PURE__ */ t(a, { size: "sm", weight: "semibold", children: /* @__PURE__ */ t(u, { href: e.itemHref || `/part/${e.itemId}`, children: e.description }) }),
61
- /* @__PURE__ */ n(a, { size: "sm", children: [
62
- "Part # ",
63
- e.itemId
64
- ] })
65
- ] }),
66
- /* @__PURE__ */ t("button", { onClick: () => c(e), className: i.removeItem, children: /* @__PURE__ */ t(m, { iconKey: "fa-regular fa-trash", size: "sm" }) })
67
- ] }),
68
- /* @__PURE__ */ n("div", { className: i.itemManagement, children: [
69
- /* @__PURE__ */ n("div", { className: i.purchaseInformation, children: [
70
- /* @__PURE__ */ t(
71
- x,
72
- {
73
- availId: e.availabilityId || "",
74
- availDescription: e.availability || "",
75
- contactHref: d || "",
76
- contactLinkBehavior: h || "new-tab"
77
- }
78
- ),
79
- /* @__PURE__ */ t(v, { pricingLabel: p || "List Price", price: e.price })
80
- ] }),
81
- /* @__PURE__ */ t(w, { quantity: e.quantity, onQuantityChange: (I) => s(e, I), size: "sm" })
82
- ] })
83
- ] })
84
- ] }, e.id)
85
- ) }) : /* @__PURE__ */ t("div", { className: i.noItems, children: /* @__PURE__ */ t(a, { as: "p", size: "sm", children: "No items in your cart yet" }) }) }),
86
- r && /* @__PURE__ */ n("div", { className: i.subtotal, children: [
87
- /* @__PURE__ */ t(a, { size: "md", weight: "semibold", children: "Subtotal" }),
88
- /* @__PURE__ */ t(a, { size: "md", weight: "semibold", children: r })
89
- ] }),
90
- /* @__PURE__ */ t(f, { disabled: o.items.length === 0, onClick: l, variant: "cta-primary", size: "md", children: "Checkout" })
91
- ] })
31
+ className: m.cartIconButton,
32
+ tabIndex: 0,
33
+ "aria-expanded": t,
34
+ "aria-controls": "cart-panel",
35
+ onClick: f,
36
+ ...n,
37
+ children: [
38
+ /* @__PURE__ */ a(g, { iconKey: "fa-kit fa-shoppingcart-empty", title: "Shopping Cart", size: "lg" }),
39
+ i.items.length > 0 && /* @__PURE__ */ a("div", { className: m.count, children: /* @__PURE__ */ a(p, { size: "xxs", children: i.items.length }) })
40
+ ]
92
41
  }
93
- );
94
- }
42
+ ) });
43
+ });
95
44
  export {
96
- U as ShoppingCart
45
+ S as ShoppingCart
97
46
  };
@@ -1,12 +1,15 @@
1
- import { ShoppingCart as i } from "./Cart.js";
2
- const r = {
1
+ import { jsxs as c, jsx as o } from "react/jsx-runtime";
2
+ import { useState as d } from "react";
3
+ import { ShoppingCart as r } from "./Cart.js";
4
+ import { CartSlideInPanel as s } from "./CartSlideInPanel.js";
5
+ const u = {
3
6
  title: "Case Parts/Molecules/Cart",
4
- component: i,
7
+ component: r,
5
8
  parameters: {
6
9
  layout: "centered"
7
10
  },
8
11
  tags: ["autodocs"]
9
- }, a = "https://m.media-amazon.com/images/I/216+JEttsYL._UF1000,1000_QL80_.jpg", t = {
12
+ }, a = "https://m.media-amazon.com/images/I/216+JEttsYL._UF1000,1000_QL80_.jpg", m = {
10
13
  items: [
11
14
  { id: 1, itemId: "1094-01", description: "Kason Door Closer - Flush", price: "$99.99", quantity: 1, imageUrl: a, availability: "In Stock", availabilityId: "available" },
12
15
  { id: 2, itemId: "810810", description: "True Door Gasket", price: "$99.99", quantity: 1, imageUrl: a, availability: "In Stock", availabilityId: "available" },
@@ -21,14 +24,41 @@ const r = {
21
24
  { id: 11, itemId: "1092-01", description: "Kason Door Closer - Flush", price: "$99.99", quantity: 1, imageUrl: a, availability: "In Stock", availabilityId: "available" },
22
25
  { id: 12, itemId: "1092-02", description: "Kason Door Closer - Offset", price: "$99.99", quantity: 1, imageUrl: a, availability: "In Stock", availabilityId: "available" }
23
26
  ]
24
- }, e = {
27
+ }, y = {
25
28
  items: [
26
29
  { id: 1, itemId: "1094-01", description: "Kason Door Closer - Flush", price: "$99.99", quantity: 1, imageUrl: a, availability: "In Stock", availabilityId: "available" },
27
30
  { id: 2, itemId: "810810", description: "True Door Gasket", price: "$99.99", quantity: 1, imageUrl: a, availability: "In Stock", availabilityId: "available" },
28
31
  { id: 3, itemId: "MG064", description: '36" x 79" 3-Sided Dart-to-Dart Gasket', price: "$99.99", quantity: 1, imageUrl: a, availability: "In Stock", availabilityId: "available" },
29
32
  { id: 4, itemId: "MG064-B", description: '36" x 79" 3-Sided Dart-to-Dart Gasket', price: "$99.99", quantity: 1, imageUrl: a, availability: "In Stock", availabilityId: "available" }
30
33
  ]
31
- }, o = {
34
+ }, t = (i) => {
35
+ const [e, l] = d(!1);
36
+ return /* @__PURE__ */ c("div", { style: { width: "100%", display: "flex", justifyContent: "center" }, children: [
37
+ /* @__PURE__ */ o(
38
+ r,
39
+ {
40
+ ...i,
41
+ open: e,
42
+ onCartClick: () => l((n) => !n)
43
+ }
44
+ ),
45
+ /* @__PURE__ */ o(
46
+ s,
47
+ {
48
+ open: e,
49
+ onClose: () => l(!1),
50
+ cart: i.cart,
51
+ subtotal: i.subtotal,
52
+ itemPriceLabel: i.itemPriceLabel,
53
+ contactHref: i.contactHref,
54
+ onItemQtyChange: i.onItemQtyChange,
55
+ onItemDelete: i.onItemDelete,
56
+ onCheckout: i.onCheckout,
57
+ contactLinkBehavior: "new-tab"
58
+ }
59
+ )
60
+ ] });
61
+ }, C = {
32
62
  args: {
33
63
  cart: { items: [] },
34
64
  onCheckout: () => {
@@ -37,51 +67,54 @@ const r = {
37
67
  onItemDelete: () => {
38
68
  alert("Delete");
39
69
  },
40
- onItemEdit: () => {
41
- alert("Edit");
42
- },
43
70
  onItemQtyChange: () => {
44
71
  alert("Qty Change");
72
+ },
73
+ onCartClick: () => {
45
74
  }
46
- }
47
- }, n = {
75
+ // required placeholder (overridden in render)
76
+ },
77
+ render: t
78
+ }, k = {
48
79
  args: {
49
- cart: t,
80
+ cart: m,
50
81
  onCheckout: () => {
51
82
  alert("Checkout");
52
83
  },
53
84
  onItemDelete: () => {
54
85
  alert("Delete");
55
86
  },
56
- onItemEdit: () => {
57
- alert("Edit");
58
- },
59
87
  onItemQtyChange: () => {
60
88
  alert("Qty Change");
61
89
  },
62
- subtotal: "$748.98"
63
- }
64
- }, d = {
90
+ subtotal: "$748.98",
91
+ onCartClick: () => {
92
+ }
93
+ // required
94
+ },
95
+ render: t
96
+ }, g = {
65
97
  args: {
66
- cart: e,
98
+ cart: y,
67
99
  onCheckout: () => {
68
100
  alert("Checkout");
69
101
  },
70
102
  onItemDelete: () => {
71
103
  alert("Delete");
72
104
  },
73
- onItemEdit: () => {
74
- alert("Edit");
75
- },
76
105
  onItemQtyChange: () => {
77
106
  alert("Qty Change");
78
107
  },
79
- subtotal: "$748.98"
80
- }
108
+ subtotal: "$748.98",
109
+ onCartClick: () => {
110
+ }
111
+ // required
112
+ },
113
+ render: t
81
114
  };
82
115
  export {
83
- o as EmptyCart,
84
- n as LargeCart,
85
- d as SmallCart,
86
- r as default
116
+ C as EmptyCart,
117
+ k as LargeCart,
118
+ g as SmallCart,
119
+ u as default
87
120
  };
@@ -0,0 +1,15 @@
1
+ import { ContactUsLinkBehavior } from '../Availability/Availability';
2
+ import { CartItem, ShoppingCart } from './Cart';
3
+ export interface CartSlideInPanelProps {
4
+ open: boolean;
5
+ onClose: () => void;
6
+ cart: ShoppingCart;
7
+ subtotal?: string;
8
+ itemPriceLabel?: string;
9
+ contactHref?: string;
10
+ contactLinkBehavior?: ContactUsLinkBehavior;
11
+ onItemQtyChange: (_item: CartItem, _newQty: number) => void;
12
+ onItemDelete: (_item: CartItem) => void;
13
+ onCheckout: () => void;
14
+ }
15
+ export declare function CartSlideInPanel({ open, onClose, cart, subtotal, itemPriceLabel, contactHref, contactLinkBehavior, onItemQtyChange, onItemDelete, onCheckout }: CartSlideInPanelProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,97 @@
1
+ import { jsx as e, jsxs as a } from "react/jsx-runtime";
2
+ import { SlideInPanel as g } 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 y } from "../../atoms/Button/Button.js";
6
+ import { Pricing as b } from "../Pricing/Pricing.js";
7
+ import { QuantityInput as N } from "../QuantityInput/QuantityInput.js";
8
+ import { Availability as z } from "../Availability/Availability.js";
9
+ import { Icon as C } from "../../atoms/Icon/Icon.js";
10
+ import { s as t } from "../../Cart.module-9txlotpz.js";
11
+ function Q({
12
+ open: s,
13
+ onClose: o,
14
+ cart: r,
15
+ subtotal: l,
16
+ itemPriceLabel: c,
17
+ contactHref: d,
18
+ contactLinkBehavior: h,
19
+ onItemQtyChange: p,
20
+ onItemDelete: u,
21
+ onCheckout: v
22
+ }) {
23
+ var m;
24
+ return r = r || { items: [] }, /* @__PURE__ */ e(
25
+ g,
26
+ {
27
+ side: "right",
28
+ open: s,
29
+ onClose: o,
30
+ ariaLabel: "Shopping Cart",
31
+ children: /* @__PURE__ */ a("div", { id: "cart-panel", className: t.cartContainer, children: [
32
+ /* @__PURE__ */ a("div", { className: t.header, children: [
33
+ /* @__PURE__ */ e(n, { size: "2xl", children: "Cart" }),
34
+ /* @__PURE__ */ a(n, { size: "xs", colorToken: "quaternary", children: [
35
+ (m = r == null ? void 0 : r.items) == null ? void 0 : m.length,
36
+ " items in your cart"
37
+ ] })
38
+ ] }),
39
+ /* @__PURE__ */ e("div", { className: t.cartItems, children: r.items.length > 0 ? /* @__PURE__ */ e("ul", { children: r.items.map((i) => /* @__PURE__ */ a("li", { className: t.cartItem, children: [
40
+ /* @__PURE__ */ e("img", { src: i.imageUrl, alt: `${i.itemId} product image` }),
41
+ /* @__PURE__ */ a("div", { children: [
42
+ /* @__PURE__ */ a("div", { className: t.topRow, children: [
43
+ /* @__PURE__ */ a("div", { className: t.itemInfo, children: [
44
+ /* @__PURE__ */ e(n, { size: "sm", weight: "semibold", children: /* @__PURE__ */ e(I, { href: i.itemHref || `/part/${i.itemId}`, children: i.description }) }),
45
+ /* @__PURE__ */ a(n, { size: "sm", children: [
46
+ "Part # ",
47
+ i.itemId
48
+ ] })
49
+ ] }),
50
+ /* @__PURE__ */ e("button", { onClick: () => u(i), className: t.removeItem, "aria-label": "Remove item", children: /* @__PURE__ */ e(C, { iconKey: "fa-regular fa-trash", size: "sm" }) })
51
+ ] }),
52
+ /* @__PURE__ */ a("div", { className: t.itemManagement, children: [
53
+ /* @__PURE__ */ a("div", { className: t.purchaseInformation, children: [
54
+ /* @__PURE__ */ e(
55
+ z,
56
+ {
57
+ availId: i.availabilityId || "",
58
+ availDescription: i.availability || "",
59
+ contactHref: d || "",
60
+ contactLinkBehavior: h || "new-tab"
61
+ }
62
+ ),
63
+ /* @__PURE__ */ e(b, { pricingLabel: c || "List Price", price: i.price })
64
+ ] }),
65
+ /* @__PURE__ */ e(
66
+ N,
67
+ {
68
+ quantity: i.quantity,
69
+ onQuantityChange: (f) => p(i, f),
70
+ size: "sm"
71
+ }
72
+ )
73
+ ] })
74
+ ] })
75
+ ] }, i.id)) }) : /* @__PURE__ */ e("div", { className: t.noItems, children: /* @__PURE__ */ e(n, { as: "p", size: "sm", children: "No items in your cart yet" }) }) }),
76
+ l && /* @__PURE__ */ a("div", { className: t.subtotal, children: [
77
+ /* @__PURE__ */ e(n, { size: "md", weight: "semibold", children: "Subtotal" }),
78
+ /* @__PURE__ */ e(n, { size: "md", weight: "semibold", children: l })
79
+ ] }),
80
+ /* @__PURE__ */ e(
81
+ y,
82
+ {
83
+ disabled: r.items.length === 0,
84
+ onClick: v,
85
+ variant: "cta-primary",
86
+ size: "md",
87
+ className: t.checkoutButton,
88
+ children: "Checkout"
89
+ }
90
+ )
91
+ ] })
92
+ }
93
+ );
94
+ }
95
+ export {
96
+ Q as CartSlideInPanel
97
+ };
@@ -4,7 +4,7 @@ import { Text as n } from "../../atoms/Text/Text.js";
4
4
  import { Link as s } from "../../atoms/Link/Link.js";
5
5
  import { Icon as m } from "../../atoms/Icon/Icon.js";
6
6
  import { getHideAtStyles as d } from "../../atoms/HideAt.js";
7
- import { Tooltip as c } from "../Tooltip/Tooltip.js";
7
+ import { Tooltip as c } from "../../atoms/Tooltip/Tooltip.js";
8
8
  import '../../assets/CategoryNav.css';const h = "_categories_13aed_1", u = "_category_13aed_17", p = "_submenuTooltip_13aed_43", l = {
9
9
  categories: h,
10
10
  category: u,
@@ -28,7 +28,7 @@ function z({
28
28
  }
29
29
  )
30
30
  ] }) }),
31
- placement: "bottom",
31
+ position: "bottom center",
32
32
  children: /* @__PURE__ */ e("ul", { className: l.submenuTooltip, children: i.children.map((r) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(s, { href: r.route, children: /* @__PURE__ */ e(n, { size: "sm", weight: "semibold", children: r.label }) }) }, r.id)) })
33
33
  },
34
34
  i.id