@caseparts-org/caseblocks 0.0.188 → 0.0.189

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,25 @@
1
+ import './assets/Cart.css';const t = "_cartIconButton_pzhyb_2", o = "_count_pzhyb_9", e = "_cartContainer_pzhyb_24", n = "_headerWrapper_pzhyb_35", _ = "_header_pzhyb_35", a = "_cartItems_pzhyb_53", c = "_cartItem_pzhyb_53", r = "_topRow_pzhyb_79", s = "_itemInfo_pzhyb_85", i = "_editUnit_pzhyb_90", p = "_purchaseInformation_pzhyb_106", m = "_availabilitySlot_pzhyb_112", h = "_priceSlot_pzhyb_115", y = "_itemManagement_pzhyb_118", b = "_quantitySlot_pzhyb_124", I = "_itemImage_pzhyb_134", u = "_removeItem_pzhyb_137", z = "_noItems_pzhyb_147", l = "_subtotal_pzhyb_154", d = "_checkoutButton_pzhyb_161", S = {
2
+ cartIconButton: t,
3
+ count: o,
4
+ cartContainer: e,
5
+ headerWrapper: n,
6
+ header: _,
7
+ cartItems: a,
8
+ cartItem: c,
9
+ topRow: r,
10
+ itemInfo: s,
11
+ editUnit: i,
12
+ purchaseInformation: p,
13
+ availabilitySlot: m,
14
+ priceSlot: h,
15
+ itemManagement: y,
16
+ quantitySlot: b,
17
+ itemImage: I,
18
+ removeItem: u,
19
+ noItems: z,
20
+ subtotal: l,
21
+ checkoutButton: d
22
+ };
23
+ export {
24
+ S as s
25
+ };
@@ -1 +1 @@
1
- ._cartIconButton_gazlm_2{position:relative;border:none;padding:0;margin:0;background-color:transparent}._count_gazlm_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_gazlm_24{height:100vh;width:100%;min-width:320px;max-width:375px;box-sizing:border-box;display:grid;grid-template-rows:auto auto 1fr auto auto;gap:var(--spacing-1);padding:var(--spacing-1)}._headerWrapper_gazlm_35{display:flex;flex-direction:row;align-items:flex-start;gap:var(--spacing-spacing-2xs)}._headerWrapper_gazlm_35>button{padding:0;margin:0;background-color:transparent;border:none}._header_gazlm_35{display:flex;flex-direction:column;align-items:flex-start;width:100%}._cartItems_gazlm_53{height:100%;overflow-y:auto;overflow-x:hidden}._cartItems_gazlm_53 ul{margin:0;padding:0;display:flex;flex-direction:column;gap:var(--spacing-spacing-1xs)}._cartItem_gazlm_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_gazlm_79{display:flex;flex-direction:row;align-items:flex-start;justify-content:space-between}._itemInfo_gazlm_85{display:flex;flex-direction:column;align-items:flex-start}._editUnit_gazlm_90{display:flex;align-items:center;text-align:start;gap:var(--spacing-spacing-3xs);border:none;background-color:transparent;padding:0;margin:0;cursor:pointer;color:var(--text-text-links);word-break:break-all;word-wrap:break-word}._purchaseInformation_gazlm_104{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:flex-start;width:100%}._availabilitySlot_gazlm_110{min-width:0}._priceSlot_gazlm_113{justify-self:end}._itemManagement_gazlm_116{display:flex;flex-direction:column;align-items:stretch;gap:var(--spacing-spacing-3xs)}._quantitySlot_gazlm_122{align-self:flex-end}._cartItem_gazlm_53 p{margin:0;padding:0;word-wrap:break-word;white-space:normal;overflow-wrap:break-word}._itemImage_gazlm_132{object-fit:contain}._removeItem_gazlm_135{border:none;background-color:transparent;padding:0;margin:0;cursor:pointer;width:min-content;height:min-content}._noItems_gazlm_145{display:flex;flex-direction:row;align-items:center;justify-content:center;height:100%}._subtotal_gazlm_152{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:var(--spacing-0-5)}._checkoutButton_gazlm_159{width:100%;height:fit-content}
1
+ ._cartIconButton_pzhyb_2{position:relative;border:none;padding:0;margin:0;background-color:transparent}._count_pzhyb_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_pzhyb_24{height:100vh;width:100%;min-width:320px;max-width:375px;box-sizing:border-box;display:grid;grid-template-rows:auto auto 1fr auto auto;gap:var(--spacing-1);padding:var(--spacing-1)}._headerWrapper_pzhyb_35{display:flex;flex-direction:row;align-items:flex-start;gap:var(--spacing-spacing-2xs)}._headerWrapper_pzhyb_35>button{padding:0;margin:0;background-color:transparent;border:none}._header_pzhyb_35{display:flex;flex-direction:column;align-items:flex-start;width:100%}._cartItems_pzhyb_53{height:100%;overflow-y:auto;overflow-x:hidden}._cartItems_pzhyb_53 ul{margin:0;padding:0;display:flex;flex-direction:column;gap:var(--spacing-spacing-1xs)}._cartItem_pzhyb_53{display:grid;grid-template-columns:auto minmax(0,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_pzhyb_79{display:flex;flex-direction:row;align-items:flex-start;justify-content:space-between}._itemInfo_pzhyb_85{display:flex;flex-direction:column;align-items:flex-start}._editUnit_pzhyb_90{display:flex;align-items:center;text-align:start;gap:var(--spacing-spacing-3xs);border:none;background-color:transparent;padding:0;margin:0;cursor:pointer;color:var(--text-text-links);word-wrap:break-word;font-size:var(--font-size-xs);font-weight:var(--font-weight-semibold)}._purchaseInformation_pzhyb_106{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:flex-start;width:100%}._availabilitySlot_pzhyb_112{min-width:0}._priceSlot_pzhyb_115{justify-self:end}._itemManagement_pzhyb_118{display:flex;flex-direction:column;align-items:stretch;gap:var(--spacing-spacing-3xs)}._quantitySlot_pzhyb_124{align-self:flex-end}._cartItem_pzhyb_53 p{margin:0;padding:0;word-wrap:break-word;white-space:normal;overflow-wrap:break-word}._itemImage_pzhyb_134{object-fit:contain}._removeItem_pzhyb_137{border:none;background-color:transparent;padding:0;margin:0;cursor:pointer;width:min-content;height:min-content}._noItems_pzhyb_147{display:flex;flex-direction:row;align-items:center;justify-content:center;height:100%}._subtotal_pzhyb_154{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:var(--spacing-0-5)}._checkoutButton_pzhyb_161{width:100%;height:fit-content}
@@ -6,6 +6,7 @@ export interface CartItem {
6
6
  description: string | undefined;
7
7
  price: string;
8
8
  quantity: number;
9
+ maxQuantity?: number;
9
10
  imageUrl: string | undefined;
10
11
  unit?: string;
11
12
  make?: string;
@@ -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-BwqCrR3s.js";
5
+ import { s as m } from "../../Cart.module-Jz43jenN.js";
6
6
  const S = l.forwardRef(function({
7
7
  cart: i,
8
8
  open: t = !1,
@@ -19,9 +19,10 @@ export interface CartPartProps extends Omit<React.LiHTMLAttributes<HTMLLIElement
19
19
  priceLabel?: string;
20
20
  price?: string;
21
21
  quantity?: number;
22
+ maxQuantity?: number;
22
23
  onQuantityChange?: (_quantity: number) => void;
23
24
  onRemove?: () => void;
24
25
  onUnitEditClick?: () => void;
25
26
  requiresUnitDetails?: boolean;
26
27
  }
27
- export declare function CartPart({ imageUrl, imageAlt, title, titleHref, onTitleNavigate, partNumber, unit, make, model, serial, custom, availabilityId, availability, contactHref, contactLinkBehavior, priceLabel, price, quantity, onQuantityChange, onRemove, onUnitEditClick, requiresUnitDetails, className, ...otherProps }: CartPartProps): import("react/jsx-runtime").JSX.Element;
28
+ export declare function CartPart({ imageUrl, imageAlt, title, titleHref, onTitleNavigate, partNumber, unit, make, model, serial, custom, availabilityId, availability, contactHref, contactLinkBehavior, priceLabel, price, quantity, maxQuantity, onQuantityChange, onRemove, onUnitEditClick, requiresUnitDetails, className, ...otherProps }: CartPartProps): import("react/jsx-runtime").JSX.Element;
@@ -1,67 +1,68 @@
1
1
  import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
- import { Link as q } from "../../atoms/Link/Link.js";
3
- import { Text as m } from "../../atoms/Text/Text.js";
4
- import { Image as R } from "../../atoms/Image/Image.js";
5
- import { Availability as T } from "../Availability/Availability.js";
6
- import { Pricing as v } from "../Pricing/Pricing.js";
7
- import { QuantityInput as A } from "../QuantityInput/QuantityInput.js";
8
- import { Icon as o } from "../../atoms/Icon/Icon.js";
9
- import { Tooltip as B } from "../../atoms/Tooltip/Tooltip.js";
10
- import { c as D } from "../../clsx-OuTLNxxd.js";
11
- import { s as i } from "../../Cart.module-BwqCrR3s.js";
12
- function X({
13
- imageUrl: b,
14
- imageAlt: g = "Product image",
15
- title: c,
16
- titleHref: n,
2
+ import { Link as R } from "../../atoms/Link/Link.js";
3
+ import { Text as o } from "../../atoms/Text/Text.js";
4
+ import { Image as T } from "../../atoms/Image/Image.js";
5
+ import { Availability as A } from "../Availability/Availability.js";
6
+ import { Pricing as B } from "../Pricing/Pricing.js";
7
+ import { QuantityInput as D } from "../QuantityInput/QuantityInput.js";
8
+ import { Icon as c } from "../../atoms/Icon/Icon.js";
9
+ import { Tooltip as F } from "../../atoms/Tooltip/Tooltip.js";
10
+ import { c as _ } from "../../clsx-OuTLNxxd.js";
11
+ import { s as i } from "../../Cart.module-Jz43jenN.js";
12
+ function $({
13
+ imageUrl: g,
14
+ imageAlt: I = "Product image",
15
+ title: n,
16
+ titleHref: d,
17
17
  onTitleNavigate: t,
18
- partNumber: d,
19
- unit: I,
20
- make: k,
21
- model: z,
18
+ partNumber: f,
19
+ unit: k,
20
+ make: z,
21
+ model: N,
22
22
  serial: K,
23
- custom: N,
24
- availabilityId: x,
25
- availability: f,
26
- contactHref: P,
27
- contactLinkBehavior: S = "new-tab",
28
- priceLabel: w = "List Price",
29
- price: h,
30
- quantity: u,
31
- onQuantityChange: p,
23
+ custom: x,
24
+ availabilityId: P,
25
+ availability: h,
26
+ contactHref: S,
27
+ contactLinkBehavior: w = "new-tab",
28
+ priceLabel: M = "List Price",
29
+ price: u,
30
+ quantity: p,
31
+ maxQuantity: l,
32
+ onQuantityChange: b,
32
33
  onRemove: y,
33
- onUnitEditClick: l,
34
+ onUnitEditClick: s,
34
35
  requiresUnitDetails: j = !1,
35
36
  className: C,
36
37
  ...L
37
38
  }) {
38
- function M(r) {
39
+ function q(r) {
39
40
  r.defaultPrevented || r.button === 0 && (r.metaKey || r.altKey || r.ctrlKey || r.shiftKey || r.currentTarget.target && r.currentTarget.target !== "_self" || t == null || t(r));
40
41
  }
41
- const s = I || [k, z, K].filter(Boolean).join(" / ");
42
- return /* @__PURE__ */ a("li", { className: D(i.cartItem, C), ...L, children: [
43
- /* @__PURE__ */ e(R, { height: 50, width: 50, src: b || "", alt: g, className: i.itemImage }),
42
+ const m = k || [z, N, K].filter(Boolean).join(" / "), v = typeof l == "number" && Number.isFinite(l) ? l : void 0;
43
+ return /* @__PURE__ */ a("li", { className: _(i.cartItem, C), ...L, children: [
44
+ /* @__PURE__ */ e(T, { height: 50, width: 50, src: g || "", alt: I, className: i.itemImage }),
44
45
  /* @__PURE__ */ a("div", { children: [
45
46
  /* @__PURE__ */ a("div", { className: i.topRow, children: [
46
47
  /* @__PURE__ */ a("div", { className: i.itemInfo, children: [
47
- /* @__PURE__ */ e(m, { size: "sm", weight: "semibold", children: n ? /* @__PURE__ */ e(q, { href: n, onClick: M, children: c }) : c }),
48
- d != null && /* @__PURE__ */ a(m, { size: "sm", children: [
49
- /* @__PURE__ */ e(m, { colorToken: "quaternary", size: "xs", children: N ? "Specs " : "Part # " }),
50
- d
48
+ /* @__PURE__ */ e(o, { size: "sm", weight: "semibold", children: d ? /* @__PURE__ */ e(R, { href: d, onClick: q, children: n }) : n }),
49
+ f != null && /* @__PURE__ */ a(o, { size: "sm", children: [
50
+ /* @__PURE__ */ e(o, { colorToken: "quaternary", size: "xs", children: x ? "Specs " : "Part # " }),
51
+ f
51
52
  ] }),
52
- s && l && (j ? /* @__PURE__ */ e(
53
- B,
53
+ m && s && (j ? /* @__PURE__ */ e(
54
+ F,
54
55
  {
55
56
  trigger: /* @__PURE__ */ a(
56
57
  "button",
57
58
  {
58
- onClick: l,
59
+ onClick: s,
59
60
  className: i.editUnit,
60
61
  "aria-label": "Edit make, model, and serial",
61
62
  type: "button",
62
63
  children: [
63
- /* @__PURE__ */ e(o, { iconKey: "fa-light fa-file-pen", size: "sm" }),
64
- s
64
+ /* @__PURE__ */ e(c, { iconKey: "fa-light fa-file-pen", size: "sm" }),
65
+ m
65
66
  ]
66
67
  }
67
68
  ),
@@ -70,37 +71,38 @@ function X({
70
71
  ) : /* @__PURE__ */ a(
71
72
  "button",
72
73
  {
73
- onClick: l,
74
+ onClick: s,
74
75
  className: i.editUnit,
75
76
  "aria-label": "Edit make, model, and serial",
76
77
  type: "button",
77
78
  children: [
78
- /* @__PURE__ */ e(o, { iconKey: "fa-light fa-file-pen", size: "sm" }),
79
- s
79
+ /* @__PURE__ */ e(c, { iconKey: "fa-light fa-file-pen", size: "sm" }),
80
+ m
80
81
  ]
81
82
  }
82
83
  ))
83
84
  ] }),
84
- y && /* @__PURE__ */ e("button", { onClick: y, className: i.removeItem, "aria-label": "Remove item", type: "button", children: /* @__PURE__ */ e(o, { iconKey: "fa-regular fa-trash", size: "sm" }) })
85
+ y && /* @__PURE__ */ e("button", { onClick: y, className: i.removeItem, "aria-label": "Remove item", type: "button", children: /* @__PURE__ */ e(c, { iconKey: "fa-regular fa-trash", size: "sm" }) })
85
86
  ] }),
86
87
  /* @__PURE__ */ a("div", { className: i.itemManagement, children: [
87
88
  /* @__PURE__ */ a("div", { className: i.purchaseInformation, children: [
88
- /* @__PURE__ */ e("div", { className: i.availabilitySlot, children: f && /* @__PURE__ */ e(
89
- T,
89
+ /* @__PURE__ */ e("div", { className: i.availabilitySlot, children: h && /* @__PURE__ */ e(
90
+ A,
90
91
  {
91
- availId: x || "",
92
- availDescription: f,
93
- contactHref: P || "",
94
- contactLinkBehavior: S
92
+ availId: P || "",
93
+ availDescription: h,
94
+ contactHref: S || "",
95
+ contactLinkBehavior: w
95
96
  }
96
97
  ) }),
97
- /* @__PURE__ */ e("div", { className: i.priceSlot, children: h && /* @__PURE__ */ e(v, { pricingLabel: w, price: h }) })
98
+ /* @__PURE__ */ e("div", { className: i.priceSlot, children: u && /* @__PURE__ */ e(B, { pricingLabel: M, price: u }) })
98
99
  ] }),
99
- typeof u == "number" && p && /* @__PURE__ */ e("div", { className: i.quantitySlot, children: /* @__PURE__ */ e(
100
- A,
100
+ typeof p == "number" && b && /* @__PURE__ */ e("div", { className: i.quantitySlot, children: /* @__PURE__ */ e(
101
+ D,
101
102
  {
102
- quantity: u,
103
- onQuantityChange: p,
103
+ quantity: p,
104
+ onQuantityChange: b,
105
+ max: v,
104
106
  size: "sm"
105
107
  }
106
108
  ) })
@@ -109,5 +111,5 @@ function X({
109
111
  ] });
110
112
  }
111
113
  export {
112
- X as CartPart
114
+ $ as CartPart
113
115
  };
@@ -25,6 +25,7 @@ declare const meta: {
25
25
  priceLabel: string;
26
26
  price: string;
27
27
  quantity: number;
28
+ maxQuantity: undefined;
28
29
  requiresUnitDetails: false;
29
30
  onQuantityChange: () => void;
30
31
  onRemove: () => void;
@@ -36,3 +37,4 @@ type Story = StoryObj<typeof meta>;
36
37
  export declare const Basic: Story;
37
38
  export declare const CustomSpecs: Story;
38
39
  export declare const WithoutAvailability: Story;
40
+ export declare const MaxQuantityCapped: Story;
@@ -1,8 +1,8 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import { CartPart as i } from "./CartPart.js";
3
- const l = {
2
+ import { CartPart as a } from "./CartPart.js";
3
+ const r = {
4
4
  title: "Case Parts/Molecules/CartPart",
5
- component: i,
5
+ component: a,
6
6
  parameters: {
7
7
  layout: "centered"
8
8
  },
@@ -25,6 +25,7 @@ const l = {
25
25
  priceLabel: "List Price",
26
26
  price: "$99.99",
27
27
  quantity: 1,
28
+ maxQuantity: void 0,
28
29
  requiresUnitDetails: !1,
29
30
  onQuantityChange: () => {
30
31
  },
@@ -35,8 +36,8 @@ const l = {
35
36
  }
36
37
  }
37
38
  }, n = {
38
- render: (a) => /* @__PURE__ */ t("div", { style: { width: 360 }, children: /* @__PURE__ */ t("ul", { style: { margin: 0, padding: 0 }, children: /* @__PURE__ */ t(i, { ...a }) }) })
39
- }, o = {
39
+ render: (i) => /* @__PURE__ */ t("div", { style: { width: 360 }, children: /* @__PURE__ */ t("ul", { style: { margin: 0, padding: 0 }, children: /* @__PURE__ */ t(a, { ...i }) }) })
40
+ }, d = {
40
41
  args: {
41
42
  title: "Custom-Molded Snap-In Magnetic Gasket",
42
43
  partNumber: 'MG064 36" x 79" 3-Sided Dart-to-Dart Gasket',
@@ -45,18 +46,27 @@ const l = {
45
46
  availability: "Contact us for availability",
46
47
  price: "$129.99"
47
48
  },
48
- render: (a) => /* @__PURE__ */ t("div", { style: { width: 360 }, children: /* @__PURE__ */ t("ul", { style: { margin: 0, padding: 0 }, children: /* @__PURE__ */ t(i, { ...a }) }) })
49
+ render: (i) => /* @__PURE__ */ t("div", { style: { width: 360 }, children: /* @__PURE__ */ t("ul", { style: { margin: 0, padding: 0 }, children: /* @__PURE__ */ t(a, { ...i }) }) })
49
50
  }, s = {
50
51
  args: {
51
52
  availabilityId: void 0,
52
53
  availability: void 0,
53
54
  price: "$99.99"
54
55
  },
55
- render: (a) => /* @__PURE__ */ t("div", { style: { width: 360 }, children: /* @__PURE__ */ t("ul", { style: { margin: 0, padding: 0 }, children: /* @__PURE__ */ t(i, { ...a }) }) })
56
+ render: (i) => /* @__PURE__ */ t("div", { style: { width: 360 }, children: /* @__PURE__ */ t("ul", { style: { margin: 0, padding: 0 }, children: /* @__PURE__ */ t(a, { ...i }) }) })
57
+ }, o = {
58
+ args: {
59
+ availabilityId: "limited",
60
+ availability: "Discontinued - limited stock",
61
+ quantity: 2,
62
+ maxQuantity: 2
63
+ },
64
+ render: (i) => /* @__PURE__ */ t("div", { style: { width: 360 }, children: /* @__PURE__ */ t("ul", { style: { margin: 0, padding: 0 }, children: /* @__PURE__ */ t(a, { ...i }) }) })
56
65
  };
57
66
  export {
58
67
  n as Basic,
59
- o as CustomSpecs,
68
+ d as CustomSpecs,
69
+ o as MaxQuantityCapped,
60
70
  s as WithoutAvailability,
61
- l as default
71
+ r as default
62
72
  };
@@ -1,45 +1,45 @@
1
- import { jsx as i, jsxs as l } from "react/jsx-runtime";
2
- import { SlideInPanel as C } from "../../atoms/SlideInPanel/SlideInPanel.js";
3
- import { Text as r } from "../../atoms/Text/Text.js";
1
+ import { jsx as i, jsxs as r } from "react/jsx-runtime";
2
+ import { SlideInPanel as z } from "../../atoms/SlideInPanel/SlideInPanel.js";
3
+ import { Text as l } from "../../atoms/Text/Text.js";
4
4
  import { Button as h } from "../../atoms/Button/Button.js";
5
- import { Icon as z } from "../../atoms/Icon/Icon.js";
6
- import { CartPart as x } from "./CartPart.js";
7
- import { s as t } from "../../Cart.module-BwqCrR3s.js";
8
- function L({
9
- open: u,
5
+ import { Icon as u } from "../../atoms/Icon/Icon.js";
6
+ import { CartPart as C } from "./CartPart.js";
7
+ import { s as t } from "../../Cart.module-Jz43jenN.js";
8
+ function w({
9
+ open: p,
10
10
  onClose: s,
11
11
  cart: a,
12
12
  subtotal: n,
13
- itemPriceLabel: p,
14
- contactHref: y,
15
- contactLinkBehavior: b,
16
- onItemQtyChange: f,
17
- onItemDelete: g,
13
+ itemPriceLabel: y,
14
+ contactHref: f,
15
+ contactLinkBehavior: g,
16
+ onItemQtyChange: b,
17
+ onItemDelete: k,
18
18
  onUnitEditClick: d,
19
19
  onItemNavigate: m,
20
- requiresUnitDetails: k = !1,
20
+ requiresUnitDetails: v = !1,
21
21
  onCheckout: o
22
22
  }) {
23
23
  var c;
24
24
  return a = a || { items: [] }, /* @__PURE__ */ i(
25
- C,
25
+ z,
26
26
  {
27
27
  side: "right",
28
- open: u,
28
+ open: p,
29
29
  onClose: s,
30
30
  ariaLabel: "Shopping Cart",
31
- children: /* @__PURE__ */ l("div", { id: "cart-panel", className: t.cartContainer, children: [
32
- /* @__PURE__ */ l("div", { className: t.headerWrapper, children: [
33
- /* @__PURE__ */ l("div", { className: t.header, children: [
34
- /* @__PURE__ */ i(r, { size: "2xl", children: "Cart" }),
35
- /* @__PURE__ */ l(r, { size: "xs", colorToken: "quaternary", children: [
31
+ children: /* @__PURE__ */ r("div", { id: "cart-panel", className: t.cartContainer, children: [
32
+ /* @__PURE__ */ r("div", { className: t.headerWrapper, children: [
33
+ /* @__PURE__ */ r("div", { className: t.header, children: [
34
+ /* @__PURE__ */ i(l, { size: "2xl", children: "Cart" }),
35
+ /* @__PURE__ */ r(l, { size: "xs", colorToken: "quaternary", children: [
36
36
  (c = a == null ? void 0 : a.items) == null ? void 0 : c.length,
37
37
  " items in your cart"
38
38
  ] })
39
39
  ] }),
40
- /* @__PURE__ */ i("button", { onClick: s, children: /* @__PURE__ */ i(z, { iconKey: "fa-regular fa-xmark", size: "md" }) })
40
+ /* @__PURE__ */ i("button", { onClick: s, children: /* @__PURE__ */ i(u, { iconKey: "fa-regular fa-xmark", size: "md" }) })
41
41
  ] }),
42
- /* @__PURE__ */ i(
42
+ /* @__PURE__ */ r(
43
43
  h,
44
44
  {
45
45
  disabled: a.items.length === 0,
@@ -47,11 +47,14 @@ function L({
47
47
  variant: "secondary",
48
48
  size: "md",
49
49
  className: t.checkoutButton,
50
- children: "Checkout"
50
+ children: [
51
+ "Proceed to Checkout",
52
+ /* @__PURE__ */ i(u, { iconKey: "fa-regular fa-arrow-right-long", size: "sm" })
53
+ ]
51
54
  }
52
55
  ),
53
56
  /* @__PURE__ */ i("div", { className: t.cartItems, children: a.items.length > 0 ? /* @__PURE__ */ i("ul", { children: a.items.map((e) => /* @__PURE__ */ i(
54
- x,
57
+ C,
55
58
  {
56
59
  imageUrl: e.imageUrl,
57
60
  imageAlt: `${e.itemId} product image`,
@@ -66,21 +69,22 @@ function L({
66
69
  custom: !!e.custom,
67
70
  availabilityId: e.availabilityId,
68
71
  availability: e.availability,
69
- contactHref: y,
70
- contactLinkBehavior: b,
72
+ contactHref: f,
73
+ contactLinkBehavior: g,
71
74
  price: e.price,
72
- priceLabel: p || "List Price",
75
+ priceLabel: y || "List Price",
73
76
  quantity: e.quantity,
74
- onQuantityChange: (v) => f(e, v),
75
- onRemove: () => g(e),
77
+ maxQuantity: e.maxQuantity,
78
+ onQuantityChange: (x) => b(e, x),
79
+ onRemove: () => k(e),
76
80
  onUnitEditClick: d ? () => d(e) : void 0,
77
- requiresUnitDetails: k
81
+ requiresUnitDetails: v
78
82
  },
79
83
  `${e.id}-${e.make ?? ""}-${e.model ?? ""}-${e.serial ?? ""}`
80
- )) }) : /* @__PURE__ */ i("div", { className: t.noItems, children: /* @__PURE__ */ i(r, { as: "p", size: "sm", children: "No items in your cart yet" }) }) }),
81
- n && /* @__PURE__ */ l("div", { className: t.subtotal, children: [
82
- /* @__PURE__ */ i(r, { size: "md", weight: "semibold", children: "Subtotal" }),
83
- /* @__PURE__ */ i(r, { size: "md", weight: "semibold", children: n })
84
+ )) }) : /* @__PURE__ */ i("div", { className: t.noItems, children: /* @__PURE__ */ i(l, { as: "p", size: "sm", children: "No items in your cart yet" }) }) }),
85
+ n && /* @__PURE__ */ r("div", { className: t.subtotal, children: [
86
+ /* @__PURE__ */ i(l, { size: "md", weight: "semibold", children: "Subtotal" }),
87
+ /* @__PURE__ */ i(l, { size: "md", weight: "semibold", children: n })
84
88
  ] }),
85
89
  /* @__PURE__ */ i(
86
90
  h,
@@ -98,5 +102,5 @@ function L({
98
102
  );
99
103
  }
100
104
  export {
101
- L as CartSlideInPanel
105
+ w as CartSlideInPanel
102
106
  };
@@ -23,5 +23,6 @@ export interface ProductProps extends AvailabilityProps {
23
23
  showQuantity?: boolean;
24
24
  onLinkClicked?: (_itemKey: number) => void;
25
25
  requiresUnitDetails?: boolean;
26
+ maxQuantity?: number;
26
27
  }
27
- export declare function Product({ productView, itemKey, partNumber, productDescription, availDescription, availId, contactHref, contactLinkBehavior, productHref, priceLabel, price, imgSrc, attributes, className, onAddToCart, onClose, flat, size, showQuantity, onLinkClicked, requiresUnitDetails, ...otherProps }: ProductProps): import("react/jsx-runtime").JSX.Element;
28
+ export declare function Product({ productView, itemKey, partNumber, productDescription, availDescription, availId, contactHref, contactLinkBehavior, productHref, priceLabel, price, imgSrc, attributes, className, onAddToCart, onClose, flat, size, showQuantity, onLinkClicked, requiresUnitDetails, maxQuantity, ...otherProps }: ProductProps): import("react/jsx-runtime").JSX.Element;
@@ -1,31 +1,31 @@
1
1
  import { jsxs as o, jsx as t } from "react/jsx-runtime";
2
- import { Image as A } from "../../atoms/Image/Image.js";
3
- import { Link as R } from "../../atoms/Link/Link.js";
2
+ import { Image as R } from "../../atoms/Image/Image.js";
3
+ import { Link as $ } from "../../atoms/Link/Link.js";
4
4
  import { Text as n } from "../../atoms/Text/Text.js";
5
- import { Availability as $ } from "../../molecules/Availability/Availability.js";
6
- import { Pricing as P } from "../../molecules/Pricing/Pricing.js";
7
- import { AddToCart as j } from "../../molecules/AddToCart/AddToCart.js";
8
- import { Icon as E } from "../../atoms/Icon/Icon.js";
9
- import { c as D } from "../../clsx-OuTLNxxd.js";
10
- import '../../assets/Product.css';const F = "_productCard_nx8r7_3", G = "_sm_nx8r7_15", J = "_productInformation_nx8r7_25", M = "_purchaseInformation_nx8r7_32", O = "_addToCart_nx8r7_40", W = "_addToCartButton_nx8r7_43", X = "_partNumber_nx8r7_53", Y = "_partNumberLabel_nx8r7_60", Z = "_productTile_nx8r7_64", q = "_topRow_nx8r7_83", y = "_productData_nx8r7_114", U = "_purchase_nx8r7_32", H = "_attributeContainer_nx8r7_151", Q = "_elevated_nx8r7_199", K = "_noImage_nx8r7_205", r = {
11
- productCard: F,
12
- sm: G,
13
- productInformation: J,
14
- purchaseInformation: M,
15
- addToCart: O,
16
- addToCartButton: W,
17
- partNumber: X,
18
- partNumberLabel: Y,
19
- productTile: Z,
20
- topRow: q,
5
+ import { Availability as P } from "../../molecules/Availability/Availability.js";
6
+ import { Pricing as j } from "../../molecules/Pricing/Pricing.js";
7
+ import { AddToCart as D } from "../../molecules/AddToCart/AddToCart.js";
8
+ import { Icon as F } from "../../atoms/Icon/Icon.js";
9
+ import { c as V } from "../../clsx-OuTLNxxd.js";
10
+ import '../../assets/Product.css';const G = "_productCard_nx8r7_3", J = "_sm_nx8r7_15", M = "_productInformation_nx8r7_25", O = "_purchaseInformation_nx8r7_32", W = "_addToCart_nx8r7_40", X = "_addToCartButton_nx8r7_43", Y = "_partNumber_nx8r7_53", Z = "_partNumberLabel_nx8r7_60", q = "_productTile_nx8r7_64", U = "_topRow_nx8r7_83", y = "_productData_nx8r7_114", H = "_purchase_nx8r7_32", K = "_attributeContainer_nx8r7_151", L = "_elevated_nx8r7_199", Q = "_noImage_nx8r7_205", r = {
11
+ productCard: G,
12
+ sm: J,
13
+ productInformation: M,
14
+ purchaseInformation: O,
15
+ addToCart: W,
16
+ addToCartButton: X,
17
+ partNumber: Y,
18
+ partNumberLabel: Z,
19
+ productTile: q,
20
+ topRow: U,
21
21
  productData: y,
22
- purchase: U,
23
- attributeContainer: H,
24
- elevated: Q,
25
- noImage: K
22
+ purchase: H,
23
+ attributeContainer: K,
24
+ elevated: L,
25
+ noImage: Q
26
26
  };
27
- function er({
28
- productView: V,
27
+ function nr({
28
+ productView: E,
29
29
  itemKey: c,
30
30
  partNumber: s,
31
31
  productDescription: h,
@@ -46,23 +46,24 @@ function er({
46
46
  showQuantity: _ = !0,
47
47
  onLinkClicked: e,
48
48
  requiresUnitDetails: w = !1,
49
- ...B
49
+ maxQuantity: B,
50
+ ...A
50
51
  }) {
51
52
  const u = a === "sm" ? "xs" : "sm";
52
- return V === "Card" ? /* @__PURE__ */ o(
53
+ return E === "Card" ? /* @__PURE__ */ o(
53
54
  "div",
54
55
  {
55
- className: D(
56
+ className: V(
56
57
  r.productCard,
57
58
  a && r[a],
58
59
  g,
59
60
  !I && r.elevated,
60
61
  !d && r.noImage
61
62
  ),
62
- ...B,
63
+ ...A,
63
64
  children: [
64
65
  d && /* @__PURE__ */ t(
65
- A,
66
+ R,
66
67
  {
67
68
  src: d,
68
69
  alt: `${s} product image`,
@@ -71,7 +72,7 @@ function er({
71
72
  }
72
73
  ),
73
74
  /* @__PURE__ */ o("div", { className: r.productInformation, children: [
74
- /* @__PURE__ */ t(R, { onClick: () => e == null ? void 0 : e(c), size: a, href: f || "#", children: h }),
75
+ /* @__PURE__ */ t($, { onClick: () => e == null ? void 0 : e(c), size: a, href: f || "#", children: h }),
75
76
  /* @__PURE__ */ o("div", { className: r.partNumber, children: [
76
77
  /* @__PURE__ */ t(n, { size: u, className: r.partNumberLabel, children: "Part #" }),
77
78
  /* @__PURE__ */ t(n, { size: u, weight: "semibold", children: s })
@@ -79,7 +80,7 @@ function er({
79
80
  ] }),
80
81
  /* @__PURE__ */ o("div", { className: r.purchaseInformation, children: [
81
82
  m && /* @__PURE__ */ t(
82
- $,
83
+ P,
83
84
  {
84
85
  availId: m,
85
86
  availDescription: x,
@@ -87,13 +88,14 @@ function er({
87
88
  contactLinkBehavior: N
88
89
  }
89
90
  ),
90
- l && /* @__PURE__ */ t(P, { pricingLabel: T, price: l })
91
+ l && /* @__PURE__ */ t(j, { pricingLabel: T, price: l })
91
92
  ] }),
92
93
  /* @__PURE__ */ t(
93
- j,
94
+ D,
94
95
  {
95
96
  itemKey: c,
96
97
  onAdd: C,
98
+ max: B,
97
99
  className: r.addToCart,
98
100
  addButtonClassName: r.addToCartButton,
99
101
  addButtonVariant: _ ? "cta-primary" : "secondary",
@@ -106,15 +108,15 @@ function er({
106
108
  )
107
109
  ]
108
110
  }
109
- ) : /* @__PURE__ */ o("div", { className: D(
111
+ ) : /* @__PURE__ */ o("div", { className: V(
110
112
  r.productTile,
111
113
  g,
112
114
  a && r[a],
113
115
  !I && r.elevated,
114
116
  !d && r.noImage
115
- ), ...B, children: [
117
+ ), ...A, children: [
116
118
  d && /* @__PURE__ */ t(
117
- A,
119
+ R,
118
120
  {
119
121
  src: d,
120
122
  alt: `${s} product image`,
@@ -125,18 +127,18 @@ function er({
125
127
  /* @__PURE__ */ o("div", { className: r.productData, children: [
126
128
  /* @__PURE__ */ o("div", { className: r.topRow, children: [
127
129
  /* @__PURE__ */ o("div", { className: r.productInformation, children: [
128
- /* @__PURE__ */ t(R, { onClick: () => e == null ? void 0 : e(c), size: a, href: f || "#", children: h }),
130
+ /* @__PURE__ */ t($, { onClick: () => e == null ? void 0 : e(c), size: a, href: f || "#", children: h }),
129
131
  /* @__PURE__ */ o("div", { className: r.partNumber, children: [
130
132
  /* @__PURE__ */ t(n, { size: u, className: r.partNumberLabel, children: "Part #" }),
131
133
  /* @__PURE__ */ t(n, { size: u, weight: "semibold", children: s })
132
134
  ] })
133
135
  ] }),
134
- v && /* @__PURE__ */ t("button", { onClick: () => v(c), children: /* @__PURE__ */ t(E, { size: "sm", iconKey: "fa-light fa-xmark" }) })
136
+ v && /* @__PURE__ */ t("button", { onClick: () => v(c), children: /* @__PURE__ */ t(F, { size: "sm", iconKey: "fa-light fa-xmark" }) })
135
137
  ] }),
136
138
  /* @__PURE__ */ o("div", { className: r.purchase, children: [
137
139
  /* @__PURE__ */ o("div", { className: r.purchaseInformation, children: [
138
140
  m && /* @__PURE__ */ t(
139
- $,
141
+ P,
140
142
  {
141
143
  availId: m,
142
144
  availDescription: x,
@@ -144,9 +146,9 @@ function er({
144
146
  contactLinkBehavior: N
145
147
  }
146
148
  ),
147
- l && /* @__PURE__ */ t(P, { pricingLabel: T, price: l })
149
+ l && /* @__PURE__ */ t(j, { pricingLabel: T, price: l })
148
150
  ] }),
149
- /* @__PURE__ */ t(j, { size: a, itemKey: c, onAdd: C, className: r.addToCart, addButtonClassName: r.addToCartButton, requiresUnitDetails: w })
151
+ /* @__PURE__ */ t(D, { size: a, itemKey: c, onAdd: C, max: B, className: r.addToCart, addButtonClassName: r.addToCartButton, requiresUnitDetails: w })
150
152
  ] }),
151
153
  p && p.length > 0 && /* @__PURE__ */ t("ul", { className: r.attributeContainer, children: p.map((i) => /* @__PURE__ */ o("li", { children: [
152
154
  /* @__PURE__ */ o(n, { size: "xs", weight: "light", children: [
@@ -159,5 +161,5 @@ function er({
159
161
  ] });
160
162
  }
161
163
  export {
162
- er as Product
164
+ nr as Product
163
165
  };
@@ -83,6 +83,10 @@ declare const meta: {
83
83
  control: "boolean";
84
84
  description: string;
85
85
  };
86
+ maxQuantity: {
87
+ control: "number";
88
+ description: string;
89
+ };
86
90
  };
87
91
  args: ProductProps;
88
92
  tags: string[];
@@ -98,3 +102,5 @@ export declare const DifferentPriceLabel: Story;
98
102
  export declare const NoImageCard: Story;
99
103
  export declare const FlatTile: Story;
100
104
  export declare const NoImageFlatCard: Story;
105
+ export declare const MaxQuantityCard: Story;
106
+ export declare const MaxQuantityTile: Story;
@@ -1,5 +1,5 @@
1
- import { Product as a } from "./Product.js";
2
- const o = [
1
+ import { Product as e } from "./Product.js";
2
+ const i = [
3
3
  { label: "Color", value: "Gray" },
4
4
  { label: "Brand", value: "Kason" },
5
5
  { label: "Finish", value: "Chrome" },
@@ -13,7 +13,7 @@ const o = [
13
13
  { label: "Attribute", value: "Placeholder" }
14
14
  ], r = {
15
15
  title: "Case Parts/Organisms/Product",
16
- component: a,
16
+ component: e,
17
17
  parameters: { layout: "centered" },
18
18
  argTypes: {
19
19
  productView: {
@@ -53,7 +53,8 @@ const o = [
53
53
  options: ["md", "sm"]
54
54
  },
55
55
  showQuantity: { control: "boolean", description: "Shows/Hides add to cart quantity" },
56
- requiresUnitDetails: { control: "boolean", description: "Shows unit details tooltip on add button" }
56
+ requiresUnitDetails: { control: "boolean", description: "Shows unit details tooltip on add button" },
57
+ maxQuantity: { control: "number", description: "Maximum quantity allowed in AddToCart" }
57
58
  },
58
59
  args: {
59
60
  productView: "Card",
@@ -70,9 +71,9 @@ const o = [
70
71
  price: "$129.99",
71
72
  imgSrc: "https://dev.caseparts.com/graphics/photos/R-23_IMG_2009.png",
72
73
  // imgSrc: 'https://www.caseparts.com/Ortery/360/Optimized/1092-01_/1092-01_04.webp',
73
- attributes: o,
74
- onAddToCart: (t, e) => {
75
- alert(`Add to cart (story) ${JSON.stringify({ itemKey: t, quantity: e })}`);
74
+ attributes: i,
75
+ onAddToCart: (t, a) => {
76
+ alert(`Add to cart (story) ${JSON.stringify({ itemKey: t, quantity: a })}`);
76
77
  },
77
78
  onClose: (t) => {
78
79
  alert(`On close clicked ${t}`);
@@ -80,15 +81,16 @@ const o = [
80
81
  flat: !1,
81
82
  size: "md",
82
83
  showQuantity: !0,
83
- requiresUnitDetails: !1
84
+ requiresUnitDetails: !1,
85
+ maxQuantity: void 0
84
86
  },
85
87
  tags: ["autodocs"]
86
- }, l = {}, c = {
88
+ }, l = {}, n = {
87
89
  args: {
88
90
  availId: "limited",
89
91
  availDescription: "Limited stock"
90
92
  }
91
- }, n = {
93
+ }, c = {
92
94
  args: {
93
95
  availId: "unavailable",
94
96
  availDescription: "Out of stock",
@@ -116,27 +118,43 @@ const o = [
116
118
  productView: "Card",
117
119
  imgSrc: void 0
118
120
  }
119
- }, b = {
121
+ }, v = {
120
122
  args: {
121
123
  productView: "Tile",
122
124
  flat: !0
123
125
  }
124
- }, v = {
126
+ }, m = {
125
127
  args: {
126
128
  productView: "Card",
127
129
  imgSrc: void 0,
128
130
  flat: !0
129
131
  }
132
+ }, b = {
133
+ args: {
134
+ productView: "Card",
135
+ availId: "limited",
136
+ availDescription: "This part is discontinued and stock is limited",
137
+ maxQuantity: 2
138
+ }
139
+ }, y = {
140
+ args: {
141
+ productView: "Tile",
142
+ availId: "limited",
143
+ availDescription: "This part is discontinued and stock is limited",
144
+ maxQuantity: 3
145
+ }
130
146
  };
131
147
  export {
132
148
  s as ContactForAvailability,
133
149
  l as Default,
134
150
  p as DifferentPriceLabel,
135
- b as FlatTile,
136
- c as LimitedStock,
151
+ v as FlatTile,
152
+ n as LimitedStock,
153
+ b as MaxQuantityCard,
154
+ y as MaxQuantityTile,
137
155
  u as NoImageCard,
138
- v as NoImageFlatCard,
156
+ m as NoImageFlatCard,
139
157
  d as TileView,
140
- n as Unavailable,
158
+ c as Unavailable,
141
159
  r as default
142
160
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@caseparts-org/caseblocks",
3
3
  "private": false,
4
- "version": "0.0.188",
4
+ "version": "0.0.189",
5
5
  "type": "module",
6
6
  "module": "dist/main.js",
7
7
  "types": "dist/main.d.ts",
@@ -1,25 +0,0 @@
1
- import './assets/Cart.css';const t = "_cartIconButton_gazlm_2", a = "_count_gazlm_9", o = "_cartContainer_gazlm_24", e = "_headerWrapper_gazlm_35", n = "_header_gazlm_35", _ = "_cartItems_gazlm_53", m = "_cartItem_gazlm_53", c = "_topRow_gazlm_79", r = "_itemInfo_gazlm_85", l = "_editUnit_gazlm_90", s = "_purchaseInformation_gazlm_104", i = "_availabilitySlot_gazlm_110", g = "_priceSlot_gazlm_113", I = "_itemManagement_gazlm_116", u = "_quantitySlot_gazlm_122", z = "_itemImage_gazlm_132", p = "_removeItem_gazlm_135", h = "_noItems_gazlm_145", d = "_subtotal_gazlm_152", S = "_checkoutButton_gazlm_159", y = {
2
- cartIconButton: t,
3
- count: a,
4
- cartContainer: o,
5
- headerWrapper: e,
6
- header: n,
7
- cartItems: _,
8
- cartItem: m,
9
- topRow: c,
10
- itemInfo: r,
11
- editUnit: l,
12
- purchaseInformation: s,
13
- availabilitySlot: i,
14
- priceSlot: g,
15
- itemManagement: I,
16
- quantitySlot: u,
17
- itemImage: z,
18
- removeItem: p,
19
- noItems: h,
20
- subtotal: d,
21
- checkoutButton: S
22
- };
23
- export {
24
- y as s
25
- };