@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.
@@ -1,74 +1,76 @@
1
- import { jsx as i, jsxs as r } from "react/jsx-runtime";
2
- import { SlideInPanel as b } from "../../atoms/SlideInPanel/SlideInPanel.js";
1
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
2
+ import { SlideInPanel as g } from "../../atoms/SlideInPanel/SlideInPanel.js";
3
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-DzPBP5QJ.js";
8
- function q({
4
+ import { Button as v } from "../../atoms/Button/Button.js";
5
+ import { Icon as C } from "../../atoms/Icon/Icon.js";
6
+ import { CartPart as x } from "./CartPart.js";
7
+ import { s as t } from "../../Cart.module-DzPBP5QJ.js";
8
+ function B({
9
9
  open: o,
10
- onClose: m,
11
- cart: t,
10
+ onClose: s,
11
+ cart: r,
12
12
  subtotal: n,
13
- itemPriceLabel: d,
14
- contactHref: c,
15
- contactLinkBehavior: h,
16
- onItemQtyChange: p,
17
- onItemDelete: u,
18
- onCheckout: y
13
+ itemPriceLabel: c,
14
+ contactHref: h,
15
+ contactLinkBehavior: p,
16
+ onItemQtyChange: u,
17
+ onItemDelete: y,
18
+ onItemNavigate: m,
19
+ onCheckout: b
19
20
  }) {
20
- var s;
21
- return t = t || { items: [] }, /* @__PURE__ */ i(
22
- b,
21
+ var d;
22
+ return r = r || { items: [] }, /* @__PURE__ */ i(
23
+ g,
23
24
  {
24
25
  side: "right",
25
26
  open: o,
26
- onClose: m,
27
+ onClose: s,
27
28
  ariaLabel: "Shopping Cart",
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: [
29
+ children: /* @__PURE__ */ a("div", { id: "cart-panel", className: t.cartContainer, children: [
30
+ /* @__PURE__ */ a("div", { className: t.headerWrapper, children: [
31
+ /* @__PURE__ */ a("div", { className: t.header, children: [
31
32
  /* @__PURE__ */ i(l, { size: "2xl", children: "Cart" }),
32
- /* @__PURE__ */ r(l, { size: "xs", colorToken: "quaternary", children: [
33
- (s = t == null ? void 0 : t.items) == null ? void 0 : s.length,
33
+ /* @__PURE__ */ a(l, { size: "xs", colorToken: "quaternary", children: [
34
+ (d = r == null ? void 0 : r.items) == null ? void 0 : d.length,
34
35
  " items in your cart"
35
36
  ] })
36
37
  ] }),
37
- /* @__PURE__ */ i("button", { onClick: m, children: /* @__PURE__ */ i(v, { iconKey: "fa-regular fa-xmark", size: "md" }) })
38
+ /* @__PURE__ */ i("button", { onClick: s, children: /* @__PURE__ */ i(C, { iconKey: "fa-regular fa-xmark", size: "md" }) })
38
39
  ] }),
39
- /* @__PURE__ */ i("div", { className: a.cartItems, children: t.items.length > 0 ? /* @__PURE__ */ i("ul", { children: t.items.map((e) => /* @__PURE__ */ i(
40
- I,
40
+ /* @__PURE__ */ i("div", { className: t.cartItems, children: r.items.length > 0 ? /* @__PURE__ */ i("ul", { children: r.items.map((e) => /* @__PURE__ */ i(
41
+ x,
41
42
  {
42
43
  imageUrl: e.imageUrl,
43
44
  imageAlt: `${e.itemId} product image`,
44
45
  title: e.description,
45
46
  titleHref: e.itemHref || `/part/${e.itemId}`,
47
+ onTitleNavigate: () => m == null ? void 0 : m(e),
46
48
  partNumber: e.itemId,
47
49
  custom: !!e.custom,
48
50
  availabilityId: e.availabilityId,
49
51
  availability: e.availability,
50
- contactHref: c,
51
- contactLinkBehavior: h,
52
+ contactHref: h,
53
+ contactLinkBehavior: p,
52
54
  price: e.price,
53
- priceLabel: d || "List Price",
55
+ priceLabel: c || "List Price",
54
56
  quantity: e.quantity,
55
- onQuantityChange: (g) => p(e, g),
56
- onRemove: () => u(e)
57
+ onQuantityChange: (f) => u(e, f),
58
+ onRemove: () => y(e)
57
59
  },
58
60
  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("div", { className: t.noItems, children: /* @__PURE__ */ i(l, { as: "p", size: "sm", children: "No items in your cart yet" }) }) }),
62
+ n && /* @__PURE__ */ a("div", { className: t.subtotal, children: [
61
63
  /* @__PURE__ */ i(l, { size: "md", weight: "semibold", children: "Subtotal" }),
62
64
  /* @__PURE__ */ i(l, { size: "md", weight: "semibold", children: n })
63
65
  ] }),
64
66
  /* @__PURE__ */ i(
65
- f,
67
+ v,
66
68
  {
67
- disabled: t.items.length === 0,
68
- onClick: y,
69
+ disabled: r.items.length === 0,
70
+ onClick: b,
69
71
  variant: "cta-primary",
70
72
  size: "md",
71
- className: a.checkoutButton,
73
+ className: t.checkoutButton,
72
74
  children: "Checkout"
73
75
  }
74
76
  )
@@ -77,5 +79,5 @@ function q({
77
79
  );
78
80
  }
79
81
  export {
80
- q as CartSlideInPanel
82
+ B as CartSlideInPanel
81
83
  };