@caseparts-org/caseblocks 0.0.251 → 0.0.252

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 +1 @@
1
- ._availability_1divs_1{font-style:italic;display:flex;align-items:center;gap:var(--spacing-spacing-4xs)}._pointer_1divs_8{cursor:pointer}._tooltip_1divs_12{background-color:#fafafa}._tooltipContent_1divs_16{max-width:370px}._tooltipContent_1divs_16>ul{padding:0;margin:var(--spacing-spacing-2xs) 0}._tooltipContent_1divs_16 li{list-style:none}._available_1divs_29,._in-stock_1divs_29{color:var(--color-alerts-success)}._limited_1divs_32{color:var(--color-alerts-warning)}._discontinued_1divs_35{color:var(--color-alerts-error-warning)}
1
+ ._availability_4sun9_1{font-style:italic;display:flex;align-items:center;gap:var(--spacing-spacing-4xs)}._pointer_4sun9_8{cursor:pointer}._tooltip_4sun9_12{font-family:var(--font-family-body),sans-serif;background-color:var(--surface-surface-primary);border:1px solid var(--color-border-primary);border-radius:var(--border-radius-md);box-shadow:0 .5rem 1.25rem #00000026}._tooltipContent_4sun9_20{width:308px}._tooltipHeader_4sun9_24{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:var(--spacing-spacing-2xs);padding:var(--spacing-spacing-default);border-bottom:1px solid #dfdfdf}._tooltipInfo_4sun9_33{padding:var(--spacing-spacing-default);display:block}._tooltipTitle_4sun9_38{display:grid}._tooltipHeaderIcon_4sun9_42{position:relative;display:grid;width:32px;height:32px;place-items:center;color:var(--color-alerts-success);background-color:var(--color-alerts-light-green);border-radius:50%}._tooltipHeaderAlert_4sun9_53{position:absolute;top:-2px;right:-2px;display:grid;width:12px;height:12px;place-items:center;color:var(--color-brand-primary-white);background-color:var(--color-alerts-warning);border:1px solid var(--surface-surface-primary);border-radius:50%}._warehouseList_4sun9_67{padding:0;margin:0;border-top:1px solid var(--color-border-primary)}._warehouseList_4sun9_67 li{display:flex;align-items:center;justify-content:space-between;padding:var(--spacing-spacing-1xs) var(--spacing-spacing-default);list-style:none;border-bottom:1px solid var(--color-border-primary)}._warehouseName_4sun9_82{display:flex;align-items:center;gap:var(--spacing-spacing-2xs)}._warehouseName_4sun9_82 svg{color:var(--text-text-links)}._fulfillmentNotice_4sun9_93{box-sizing:border-box;margin-top:var(--spacing-spacing-default)}._available_4sun9_98,._in-stock_4sun9_98{color:var(--color-alerts-success)}._limited_4sun9_101{color:var(--color-alerts-warning)}._discontinued_4sun9_104{color:var(--color-alerts-error-warning)}
@@ -1 +1 @@
1
- ._overlay_62mbc_1{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#00000080;display:flex;align-items:center;justify-content:center;z-index:2000}._container_62mbc_11{background-color:var(--surface-surface-primary);color:var(--text-text-primary);border-radius:var(--border-radius-sm);box-shadow:0 4px 6px #0000001a;width:min(800px,92vw);max-height:80vh;display:flex;flex-direction:column;overflow:hidden}@media (max-width:767px){._container_62mbc_11{border-radius:0;width:100%;box-shadow:none;height:100dvh;max-height:100dvh}}._toolbar_62mbc_30{position:sticky;top:0;display:flex;flex-direction:row;align-items:center;justify-content:space-between;background-color:var(--surface-surface-secondary);border-bottom:1px solid var(--border-border-secondary-btn);padding:var(--spacing-spacing-2xs) var(--spacing-spacing-default);gap:var(--spacing-spacing-2xs);z-index:1}@media (max-width:767px){._toolbar_62mbc_30{padding:var(--spacing-spacing-2xs)}}._toolbarPlain_62mbc_47{background-color:transparent;border-bottom:none}._headerGroup_62mbc_52{display:flex;flex-direction:row;align-items:center;gap:var(--spacing-spacing-2xs);flex:1 1 0}._headerLeft_62mbc_60{justify-content:flex-start}._headerRight_62mbc_64{justify-content:flex-end}._closeButton_62mbc_68{position:absolute;right:4px;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;background:transparent;border-radius:var(--radius-radius-md);cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;transition:background-color .2s ease-in}._closeButton_62mbc_68:hover{background-color:var(--color-neutrals-neutral-2)}._content_62mbc_87{overflow:auto;padding:var(--spacing-spacing-default)}@media (max-width:767px){._content_62mbc_87{padding:var(--spacing-spacing-2xs)}}
1
+ ._overlay_1imlv_1{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#00000080;display:flex;align-items:center;justify-content:center;z-index:2000}._container_1imlv_11{display:flex;flex-direction:column;overflow:hidden;background-color:var(--surface-surface-primary);color:var(--text-text-primary);border-radius:var(--border-radius-sm);box-shadow:0 4px 6px #0000001a;width:min(var(--modal-width, 800px),92vw);max-height:80vh}@media (max-width:767px){._container_1imlv_11{border-radius:0;width:100%;box-shadow:none;height:100dvh;max-height:100dvh}}._toolbar_1imlv_30{position:sticky;top:0;display:flex;flex-direction:row;align-items:center;justify-content:space-between;background-color:var(--surface-surface-secondary);border-bottom:1px solid var(--border-border-secondary-btn);padding:var(--spacing-spacing-2xs) var(--spacing-spacing-default);gap:var(--spacing-spacing-2xs);z-index:1}@media (max-width:767px){._toolbar_1imlv_30{padding:var(--spacing-spacing-2xs)}}._toolbarPlain_1imlv_47{background-color:transparent;border-bottom:none}._headerGroup_1imlv_52{display:flex;flex-direction:row;align-items:center;gap:var(--spacing-spacing-2xs);flex:1 1 0}._headerLeft_1imlv_60{justify-content:flex-start}._headerRight_1imlv_64{justify-content:flex-end}._closeButton_1imlv_68{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;background:transparent;border-radius:var(--radius-radius-md);cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;transition:background-color .2s ease-in}._closeButton_1imlv_68:hover{background-color:var(--color-neutrals-neutral-2)}._content_1imlv_87{overflow:auto;padding:var(--spacing-spacing-default)}@media (max-width:767px){._content_1imlv_87{padding:var(--spacing-spacing-2xs)}}
@@ -16,3 +16,9 @@ export interface Inventory {
16
16
  }
17
17
  export type AvailabilityId = "in-stock" | "limited" | "discontinued" | "available" | "not-found";
18
18
  export declare function Availability({ availId: id, availDescription: description, availClassName: className, enableTooltip, inventory }: AvailabilityProps): import("react/jsx-runtime").JSX.Element;
19
+ interface TooltipContentProps {
20
+ availabilityId: AvailabilityId;
21
+ inventory: Inventory;
22
+ }
23
+ export declare function AvailabilityTooltipContent({ availabilityId, inventory }: TooltipContentProps): import("react/jsx-runtime").JSX.Element;
24
+ export {};
@@ -1,74 +1,126 @@
1
- import { jsx as i, jsxs as o, Fragment as _ } from "react/jsx-runtime";
2
- import { c as p } from "../../clsx-OuTLNxxd.js";
1
+ import { jsx as e, jsxs as t, Fragment as N } from "react/jsx-runtime";
2
+ import { c as f } from "../../clsx-OuTLNxxd.js";
3
3
  import { Text as s } from "../../atoms/Text/Text.js";
4
- import { Tooltip as f } from "../../atoms/Tooltip/Tooltip.js";
5
- import { Icon as b } from "../../atoms/Icon/Icon.js";
6
- import '../../assets/Availability.css';const w = "_availability_1divs_1", C = "_pointer_1divs_8", g = "_tooltip_1divs_12", z = "_tooltipContent_1divs_16", k = "_available_1divs_29", x = "_limited_1divs_32", S = "_discontinued_1divs_35", l = {
7
- availability: w,
8
- pointer: C,
9
- tooltip: g,
10
- tooltipContent: z,
11
- available: k,
12
- "in-stock": "_in-stock_1divs_29",
13
- limited: x,
14
- discontinued: S
4
+ import { Tooltip as k } from "../../atoms/Tooltip/Tooltip.js";
5
+ import { Icon as l } from "../../atoms/Icon/Icon.js";
6
+ import { Disclaimer as n } from "../Disclaimer/Disclaimer.js";
7
+ import { Pill as w } from "../../atoms/Pill/Pill.js";
8
+ import '../../assets/Availability.css';const x = "_availability_4sun9_1", g = "_pointer_4sun9_8", y = "_tooltip_4sun9_12", b = "_tooltipContent_4sun9_20", T = "_tooltipHeader_4sun9_24", v = "_tooltipInfo_4sun9_33", z = "_tooltipTitle_4sun9_38", C = "_tooltipHeaderIcon_4sun9_42", H = "_tooltipHeaderAlert_4sun9_53", A = "_warehouseList_4sun9_67", K = "_warehouseName_4sun9_82", L = "_fulfillmentNotice_4sun9_93", S = "_available_4sun9_98", D = "_limited_4sun9_101", I = "_discontinued_4sun9_104", o = {
9
+ availability: x,
10
+ pointer: g,
11
+ tooltip: y,
12
+ tooltipContent: b,
13
+ tooltipHeader: T,
14
+ tooltipInfo: v,
15
+ tooltipTitle: z,
16
+ tooltipHeaderIcon: C,
17
+ tooltipHeaderAlert: H,
18
+ warehouseList: A,
19
+ warehouseName: K,
20
+ fulfillmentNotice: L,
21
+ available: S,
22
+ "in-stock": "_in-stock_4sun9_98",
23
+ limited: D,
24
+ discontinued: I
15
25
  };
16
- function D({
17
- availId: t,
18
- availDescription: e,
19
- availClassName: d,
20
- enableTooltip: n = !1,
21
- inventory: c
26
+ function F({
27
+ availId: i,
28
+ availDescription: r,
29
+ availClassName: c,
30
+ enableTooltip: m = !1,
31
+ inventory: d
22
32
  }) {
23
- const a = n && c && t !== "not-found";
24
- return a ? /* @__PURE__ */ i(
25
- f,
33
+ const a = m && d && i !== "not-found";
34
+ return a ? /* @__PURE__ */ e(
35
+ k,
26
36
  {
27
37
  closeDelay: 0,
28
38
  openDelay: 250,
29
39
  position: "bottom center",
30
- trigger: /* @__PURE__ */ o(s, { size: "xs", className: p(l.availability, l[t], a ? l.pointer : null, d), children: [
31
- e,
32
- /* @__PURE__ */ i(b, { iconKey: "fa-solid fa-chevron-down", size: "3xs" })
40
+ trigger: /* @__PURE__ */ t(s, { size: "xs", className: f(o.availability, o[i], a ? o.pointer : null, c), children: [
41
+ r,
42
+ /* @__PURE__ */ e(l, { iconKey: "fa-solid fa-chevron-down", size: "3xs" })
33
43
  ] }),
34
- contentClassName: l.tooltip,
35
- children: /* @__PURE__ */ i(T, { availabilityId: t, inventory: c })
44
+ contentClassName: o.tooltip,
45
+ children: /* @__PURE__ */ e(P, { availabilityId: i, inventory: d })
36
46
  }
37
- ) : /* @__PURE__ */ i(s, { size: "xs", className: p(l.availability, l[t], a ? l.pointer : null, d), children: e });
47
+ ) : /* @__PURE__ */ e(s, { size: "xs", className: f(o.availability, o[i], a ? o.pointer : null, c), children: r });
38
48
  }
39
- function T({ availabilityId: t, inventory: e }) {
40
- var n, c, a, r, m, h;
41
- const d = (((n = e == null ? void 0 : e.MPK) == null ? void 0 : n.Unreserved) ?? 0) + (((c = e == null ? void 0 : e.SEA) == null ? void 0 : c.Unreserved) ?? 0) + (((a = e == null ? void 0 : e.STL) == null ? void 0 : a.Unreserved) ?? 0);
42
- if (t === "in-stock" || t === "limited") {
43
- const u = t === "in-stock" ? "Additional quantity will be backordered. If you need more than we have at any one warehouse, a CSR will contact you with options." : "Once our stock is depleted, this item will no longer be available.";
44
- return /* @__PURE__ */ o("div", { className: l.tooltipContent, children: [
45
- /* @__PURE__ */ o(s, { size: "sm", children: [
46
- "We currently have (",
47
- d,
48
- ") in stock across our three warehouses:"
49
+ function P({ availabilityId: i, inventory: r }) {
50
+ var u, h, p;
51
+ const c = Math.max(0, ((u = r.MPK) == null ? void 0 : u.Unreserved) ?? 0), m = Math.max(0, ((h = r.SEA) == null ? void 0 : h.Unreserved) ?? 0), d = Math.max(0, ((p = r.STL) == null ? void 0 : p.Unreserved) ?? 0), a = c + m + d;
52
+ if (i === "in-stock" || i === "limited") {
53
+ const _ = i === "in-stock" ? "Additional quantity will be backordered. A customer service representative will contact you if fulfillment requires multiple warehouses." : "Once our stock is depleted, this item will no longer be available.";
54
+ return /* @__PURE__ */ t("div", { className: o.tooltipContent, children: [
55
+ /* @__PURE__ */ t("div", { className: o.tooltipHeader, children: [
56
+ /* @__PURE__ */ e("span", { className: o.tooltipHeaderIcon, children: /* @__PURE__ */ e(l, { colorToken: i === "in-stock" ? "success" : "warning", iconKey: i === "in-stock" ? "fa-solid fa-box" : "fa-solid fa-triangle-exclamation", size: "xs" }) }),
57
+ /* @__PURE__ */ e("div", { className: o.tooltipTitle, children: /* @__PURE__ */ e(s, { size: "sm", weight: "semibold", children: i === "limited" ? "Limited stock across 3 warehouses" : "Available across 3 warehouses" }) }),
58
+ /* @__PURE__ */ t(w, { colorToken: i === "limited" ? "warning" : "success", weight: "semibold", children: [
59
+ a,
60
+ " total"
61
+ ] })
49
62
  ] }),
50
- /* @__PURE__ */ o("ul", { children: [
51
- /* @__PURE__ */ i("li", { children: /* @__PURE__ */ o(s, { size: "sm", children: [
52
- "(",
53
- ((r = e == null ? void 0 : e.MPK) == null ? void 0 : r.Unreserved) ?? 0,
54
- ") Los Angeles"
55
- ] }) }),
56
- /* @__PURE__ */ i("li", { children: /* @__PURE__ */ o(s, { size: "sm", children: [
57
- "(",
58
- ((m = e == null ? void 0 : e.STL) == null ? void 0 : m.Unreserved) ?? 0,
59
- ") St. Louis"
60
- ] }) }),
61
- /* @__PURE__ */ i("li", { children: /* @__PURE__ */ o(s, { size: "sm", children: [
62
- "(",
63
- ((h = e == null ? void 0 : e.SEA) == null ? void 0 : h.Unreserved) ?? 0,
64
- ") Seattle"
65
- ] }) })
63
+ /* @__PURE__ */ t("ul", { className: o.warehouseList, children: [
64
+ /* @__PURE__ */ t("li", { children: [
65
+ /* @__PURE__ */ t(s, { size: "sm", className: o.warehouseName, children: [
66
+ /* @__PURE__ */ e(l, { iconKey: "fa-solid fa-box", size: "xs" }),
67
+ "Los Angeles"
68
+ ] }),
69
+ /* @__PURE__ */ e(s, { size: "sm", weight: "semibold", children: c })
70
+ ] }),
71
+ /* @__PURE__ */ t("li", { children: [
72
+ /* @__PURE__ */ t(s, { size: "sm", className: o.warehouseName, children: [
73
+ /* @__PURE__ */ e(l, { iconKey: "fa-solid fa-box", size: "xs" }),
74
+ "St. Louis"
75
+ ] }),
76
+ /* @__PURE__ */ e(s, { size: "sm", weight: "semibold", children: d })
77
+ ] }),
78
+ /* @__PURE__ */ t("li", { children: [
79
+ /* @__PURE__ */ t(s, { size: "sm", className: o.warehouseName, children: [
80
+ /* @__PURE__ */ e(l, { iconKey: "fa-solid fa-box", size: "xs" }),
81
+ "Seattle"
82
+ ] }),
83
+ /* @__PURE__ */ e(s, { size: "sm", weight: "semibold", children: m })
84
+ ] })
66
85
  ] }),
67
- /* @__PURE__ */ i(s, { size: "sm", children: u })
86
+ /* @__PURE__ */ e(n, { backgroundColorToken: i === "in-stock" ? "neutral" : "warning", layout: "stacked", className: o.fulfillmentNotice, children: /* @__PURE__ */ t(n.Content, { children: [
87
+ /* @__PURE__ */ e(n.Icon, { icon: i === "in-stock" ? "info" : "warning", size: "xs", colorToken: i === "in-stock" ? "secondary" : "warning" }),
88
+ /* @__PURE__ */ e(n.Primary, { children: i === "limited" ? "Available while supplies last" : `Need more than ${a}?` }),
89
+ /* @__PURE__ */ e(n.Subtext, { children: _ })
90
+ ] }) })
68
91
  ] });
69
92
  }
70
- return t === "available" ? /* @__PURE__ */ i("div", { className: l.tooltipContent, children: /* @__PURE__ */ i(s, { size: "sm", children: "While this part is not currently in stock, we will arrange to get it to you asap, and your CSR will keep you advised of the lead time." }) }) : t === "discontinued" ? /* @__PURE__ */ i("div", { className: l.tooltipContent, children: /* @__PURE__ */ i(s, { size: "sm", children: "Unfortunately, this item is no longer available to purchase." }) }) : /* @__PURE__ */ i(_, {});
93
+ return i === "available" ? /* @__PURE__ */ t("div", { className: o.tooltipContent, children: [
94
+ /* @__PURE__ */ t("div", { className: o.tooltipHeader, children: [
95
+ /* @__PURE__ */ e("span", { className: o.tooltipHeaderIcon, children: /* @__PURE__ */ e(l, { colorToken: "warning", iconKey: "fa-solid fa-truck", size: "xs" }) }),
96
+ /* @__PURE__ */ t("div", { className: o.tooltipTitle, children: [
97
+ /* @__PURE__ */ e(s, { size: "sm", weight: "semibold", children: "Not currently in stock" }),
98
+ /* @__PURE__ */ e(s, { size: "xs", colorToken: "quaternary", children: "We can get this part for you." })
99
+ ] })
100
+ ] }),
101
+ /* @__PURE__ */ e(s, { size: "xs", className: o.tooltipInfo, children: "While this part is not currently in stock, we will arrange to get it to you asap, and your CSR will keep you advised of the lead time." }),
102
+ /* @__PURE__ */ e(n, { backgroundColorToken: "neutral", layout: "stacked", className: o.fulfillmentNotice, children: /* @__PURE__ */ t(n.Content, { children: [
103
+ /* @__PURE__ */ e(n.Icon, { icon: "info", size: "xs", colorToken: "secondary" }),
104
+ /* @__PURE__ */ e(n.Primary, { children: "Need it sooner?" }),
105
+ /* @__PURE__ */ e(n.Subtext, { children: "Contact your customer service representative for expedited options or current lead time." })
106
+ ] }) })
107
+ ] }) : i === "discontinued" ? /* @__PURE__ */ t("div", { className: o.tooltipContent, children: [
108
+ /* @__PURE__ */ t("div", { className: o.tooltipHeader, children: [
109
+ /* @__PURE__ */ e("span", { className: o.tooltipHeaderIcon, children: /* @__PURE__ */ e(l, { colorToken: "error-warning", iconKey: "fa-solid fa-empty-set", size: "xs" }) }),
110
+ /* @__PURE__ */ t("div", { className: o.tooltipTitle, children: [
111
+ /* @__PURE__ */ e(s, { size: "sm", weight: "semibold", children: "Discontinued" }),
112
+ /* @__PURE__ */ e(s, { size: "xs", colorToken: "quaternary", children: "This part is no longer available" })
113
+ ] })
114
+ ] }),
115
+ /* @__PURE__ */ e(s, { size: "xs", className: o.tooltipInfo, children: "This item has been discontinued and is no longer in stock. We are unable to special order or restock it." }),
116
+ /* @__PURE__ */ e(n, { backgroundColorToken: "neutral", layout: "stacked", className: o.fulfillmentNotice, children: /* @__PURE__ */ t(n.Content, { children: [
117
+ /* @__PURE__ */ e(n.Icon, { icon: "info", size: "xs", colorToken: "secondary" }),
118
+ /* @__PURE__ */ e(n.Primary, { children: "Need an alternative?" }),
119
+ /* @__PURE__ */ e(n.Subtext, { children: "Contact your customer service representative for replacement options or compatible parts." })
120
+ ] }) })
121
+ ] }) : /* @__PURE__ */ e(N, {});
71
122
  }
72
123
  export {
73
- D as Availability
124
+ F as Availability,
125
+ P as AvailabilityTooltipContent
74
126
  };
@@ -45,3 +45,7 @@ export declare const Available: Story;
45
45
  export declare const NotFound: Story;
46
46
  export declare const InStockWithTooltip: Story;
47
47
  export declare const LimitedWithTooltip: Story;
48
+ export declare const InStockTooltipContent: Story;
49
+ export declare const LimitedTooltipContent: Story;
50
+ export declare const AvailableTooltipContent: Story;
51
+ export declare const DiscontinuedTooltipContent: Story;
@@ -1,12 +1,12 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
- import { Availability as o } from "./Availability.js";
3
- const a = (e) => /* @__PURE__ */ i(o, { ...e }), t = {
2
+ import { Availability as a, AvailabilityTooltipContent as e } from "./Availability.js";
3
+ const n = (o) => /* @__PURE__ */ i(a, { ...o }), t = {
4
4
  MPK: { Unreserved: 5, Available: 5 },
5
5
  SEA: { Unreserved: 3, Available: 3 },
6
6
  STL: { Unreserved: 8, Available: 8 }
7
7
  }, r = {
8
8
  title: "Case Parts/Molecules/Availability",
9
- component: a,
9
+ component: n,
10
10
  parameters: {
11
11
  layout: "centered"
12
12
  },
@@ -42,7 +42,7 @@ const a = (e) => /* @__PURE__ */ i(o, { ...e }), t = {
42
42
  inventory: t
43
43
  },
44
44
  tags: ["autodocs"]
45
- }, l = {
45
+ }, c = {
46
46
  name: "In Stock",
47
47
  args: {
48
48
  availId: "in-stock",
@@ -55,7 +55,7 @@ const a = (e) => /* @__PURE__ */ i(o, { ...e }), t = {
55
55
  }
56
56
  }
57
57
  }
58
- }, c = {
58
+ }, d = {
59
59
  name: "Limited",
60
60
  args: {
61
61
  availId: "limited",
@@ -68,7 +68,7 @@ const a = (e) => /* @__PURE__ */ i(o, { ...e }), t = {
68
68
  }
69
69
  }
70
70
  }
71
- }, d = {
71
+ }, v = {
72
72
  name: "Discontinued",
73
73
  args: {
74
74
  availId: "discontinued",
@@ -81,7 +81,7 @@ const a = (e) => /* @__PURE__ */ i(o, { ...e }), t = {
81
81
  }
82
82
  }
83
83
  }
84
- }, v = {
84
+ }, p = {
85
85
  name: "Available",
86
86
  args: {
87
87
  availId: "available",
@@ -94,7 +94,7 @@ const a = (e) => /* @__PURE__ */ i(o, { ...e }), t = {
94
94
  }
95
95
  }
96
96
  }
97
- }, p = {
97
+ }, m = {
98
98
  name: "Not Found",
99
99
  args: {
100
100
  availId: "not-found",
@@ -107,7 +107,7 @@ const a = (e) => /* @__PURE__ */ i(o, { ...e }), t = {
107
107
  }
108
108
  }
109
109
  }
110
- }, m = {
110
+ }, y = {
111
111
  name: "In Stock with Tooltip",
112
112
  args: {
113
113
  availId: "in-stock",
@@ -122,7 +122,7 @@ const a = (e) => /* @__PURE__ */ i(o, { ...e }), t = {
122
122
  }
123
123
  }
124
124
  }
125
- }, y = {
125
+ }, b = {
126
126
  name: "Limited with Tooltip",
127
127
  args: {
128
128
  availId: "limited",
@@ -141,14 +141,30 @@ const a = (e) => /* @__PURE__ */ i(o, { ...e }), t = {
141
141
  }
142
142
  }
143
143
  }
144
+ }, u = {
145
+ name: "In Stock Tooltip Content",
146
+ render: () => /* @__PURE__ */ i(e, { availabilityId: "in-stock", inventory: t })
147
+ }, I = {
148
+ name: "Limited Tooltip Content",
149
+ render: () => /* @__PURE__ */ i(e, { availabilityId: "limited", inventory: t })
150
+ }, h = {
151
+ name: "Available Tooltip Content",
152
+ render: () => /* @__PURE__ */ i(e, { availabilityId: "available", inventory: t })
153
+ }, T = {
154
+ name: "Discontinued Tooltip Content",
155
+ render: () => /* @__PURE__ */ i(e, { availabilityId: "discontinued", inventory: t })
144
156
  };
145
157
  export {
146
- v as Available,
147
- d as Discontinued,
148
- l as InStock,
149
- m as InStockWithTooltip,
150
- c as Limited,
151
- y as LimitedWithTooltip,
152
- p as NotFound,
158
+ p as Available,
159
+ h as AvailableTooltipContent,
160
+ v as Discontinued,
161
+ T as DiscontinuedTooltipContent,
162
+ c as InStock,
163
+ u as InStockTooltipContent,
164
+ y as InStockWithTooltip,
165
+ d as Limited,
166
+ I as LimitedTooltipContent,
167
+ b as LimitedWithTooltip,
168
+ m as NotFound,
153
169
  r as default
154
170
  };
@@ -6,6 +6,7 @@ export interface ModalProps extends React.HTMLAttributes<HTMLDivElement> {
6
6
  isOpen: boolean;
7
7
  onClose: () => void;
8
8
  closeOnOverlayClick?: boolean;
9
+ width?: React.CSSProperties["width"];
9
10
  }
10
11
  type ModalCompound = React.FC<ModalProps> & {
11
12
  Toolbar: React.FC<ModalToolbarProps>;
@@ -1,75 +1,87 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import f from "react";
3
- import { c as s } from "../../clsx-OuTLNxxd.js";
4
- import { Text as h } from "../../atoms/Text/Text.js";
5
- import { Icon as b } from "../../atoms/Icon/Icon.js";
6
- import '../../assets/Modal.css';const p = "_overlay_62mbc_1", g = "_container_62mbc_11", v = "_toolbar_62mbc_30", y = "_toolbarPlain_62mbc_47", T = "_headerGroup_62mbc_52", x = "_headerLeft_62mbc_60", z = "_headerRight_62mbc_64", B = "_closeButton_62mbc_68", M = "_content_62mbc_87", r = {
7
- overlay: p,
8
- container: g,
9
- toolbar: v,
10
- toolbarPlain: y,
11
- headerGroup: T,
12
- headerLeft: x,
13
- headerRight: z,
14
- closeButton: B,
15
- content: M
16
- }, N = {
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import v from "react";
3
+ import { c as n } from "../../clsx-OuTLNxxd.js";
4
+ import { Text as p } from "../../atoms/Text/Text.js";
5
+ import { Icon as g } from "../../atoms/Icon/Icon.js";
6
+ import '../../assets/Modal.css';const b = "_overlay_1imlv_1", y = "_container_1imlv_11", T = "_toolbar_1imlv_30", x = "_toolbarPlain_1imlv_47", z = "_headerGroup_1imlv_52", B = "_headerLeft_1imlv_60", M = "_headerRight_1imlv_64", N = "_closeButton_1imlv_68", R = "_content_1imlv_87", r = {
7
+ overlay: b,
8
+ container: y,
9
+ toolbar: T,
10
+ toolbarPlain: x,
11
+ headerGroup: z,
12
+ headerLeft: B,
13
+ headerRight: M,
14
+ closeButton: N,
15
+ content: R
16
+ }, w = {
17
17
  sm: "sm",
18
18
  md: "md",
19
19
  lg: "lg"
20
- }, R = {
20
+ }, C = {
21
21
  sm: "sm",
22
22
  md: "md",
23
23
  lg: "md"
24
- }, i = ({
24
+ }, d = ({
25
25
  isOpen: t,
26
26
  onClose: o,
27
27
  closeOnOverlayClick: e = !0,
28
- className: c,
29
- children: l,
30
- ...m
28
+ width: l,
29
+ className: s,
30
+ style: m,
31
+ children: u,
32
+ ..._
31
33
  }) => {
32
- const a = f.useRef(!1);
34
+ const c = v.useRef(!1);
33
35
  if (!t) return null;
34
- const u = (d) => {
35
- e && (a.current = d.target === d.currentTarget);
36
- }, _ = (d) => {
36
+ const h = (i) => {
37
+ e && (c.current = i.target === i.currentTarget);
38
+ }, f = (i) => {
37
39
  if (!e) {
38
- a.current = !1;
40
+ c.current = !1;
39
41
  return;
40
42
  }
41
- a.current && d.target === d.currentTarget && o(), a.current = !1;
43
+ c.current && i.target === i.currentTarget && o(), c.current = !1;
42
44
  };
43
- return /* @__PURE__ */ n("div", { className: s(r.overlay), onMouseDown: u, onMouseUp: _, children: /* @__PURE__ */ n("div", { className: s(r.container, c), role: "dialog", "aria-modal": "true", ...m, children: l }) });
44
- }, w = ({ variant: t = "standard", className: o, children: e, ...c }) => /* @__PURE__ */ n(
45
+ return /* @__PURE__ */ a("div", { className: n(r.overlay), onMouseDown: h, onMouseUp: f, children: /* @__PURE__ */ a(
46
+ "div",
47
+ {
48
+ className: n(r.container, s),
49
+ role: "dialog",
50
+ "aria-modal": "true",
51
+ style: { ...m, "--modal-width": l },
52
+ ..._,
53
+ children: u
54
+ }
55
+ ) });
56
+ }, G = ({ variant: t = "standard", className: o, children: e, ...l }) => /* @__PURE__ */ a(
45
57
  "div",
46
58
  {
47
- className: s(r.toolbar, t === "plain" && r.toolbarPlain, o),
48
- ...c,
59
+ className: n(r.toolbar, t === "plain" && r.toolbarPlain, o),
60
+ ...l,
49
61
  children: e
50
62
  }
51
- ), C = ({
63
+ ), L = ({
52
64
  align: t = "left",
53
65
  size: o = "md",
54
66
  variant: e = "display",
55
- className: c,
56
- children: l,
67
+ className: l,
68
+ children: s,
57
69
  ...m
58
70
  }) => {
59
- const a = typeof l == "string";
60
- return /* @__PURE__ */ n(
71
+ const u = typeof s == "string";
72
+ return /* @__PURE__ */ a(
61
73
  "div",
62
74
  {
63
- className: s(r.headerGroup, t === "left" ? r.headerLeft : r.headerRight, c),
75
+ className: n(r.headerGroup, t === "left" ? r.headerLeft : r.headerRight, l),
64
76
  ...m,
65
- children: a ? /* @__PURE__ */ n(h, { as: "div", size: N[o], variant: e, weight: "medium", children: l }) : l
77
+ children: u ? /* @__PURE__ */ a(p, { as: "div", size: w[o], variant: e, weight: "medium", children: s }) : s
66
78
  }
67
79
  );
68
- }, G = ({ size: t = "md", className: o, ...e }) => /* @__PURE__ */ n("button", { type: "button", className: s(r.closeButton, o), "aria-label": "Close", ...e, children: /* @__PURE__ */ n(b, { iconKey: "fa-regular fa-xmark", size: R[t] }) }), L = ({ className: t, children: o, ...e }) => /* @__PURE__ */ n("div", { className: s(r.content, t), ...e, children: o });
69
- i.Toolbar = w;
70
- i.Header = C;
71
- i.CloseButton = G;
72
- i.Content = L;
80
+ }, P = ({ size: t = "md", className: o, ...e }) => /* @__PURE__ */ a("button", { type: "button", className: n(r.closeButton, o), "aria-label": "Close", ...e, children: /* @__PURE__ */ a(g, { iconKey: "fa-regular fa-xmark", size: C[t] }) }), S = ({ className: t, children: o, ...e }) => /* @__PURE__ */ a("div", { className: n(r.content, t), ...e, children: o });
81
+ d.Toolbar = G;
82
+ d.Header = L;
83
+ d.CloseButton = P;
84
+ d.Content = S;
73
85
  export {
74
- i as Modal
86
+ d as Modal
75
87
  };
@@ -3,5 +3,5 @@ import { Modal } from './Modal';
3
3
  declare const meta: Meta<typeof Modal>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof Modal>;
6
- export declare const Basic: Story;
6
+ export declare const PlainToolbar: Story;
7
7
  export declare const Sizes: Story;
@@ -1,81 +1,79 @@
1
- import { jsx as e, jsxs as n } from "react/jsx-runtime";
2
- import { useState as t } from "react";
3
- import { Modal as l } from "./Modal.js";
4
- import { Text as r } from "../../atoms/Text/Text.js";
5
- import { Button as s } from "../../atoms/Button/Button.js";
1
+ import { jsx as e, jsxs as l } from "react/jsx-runtime";
2
+ import { useState as r } from "react";
3
+ import { Modal as n } from "./Modal.js";
4
+ import { Text as o } from "../../atoms/Text/Text.js";
5
+ import { Button as a } from "../../atoms/Button/Button.js";
6
6
  const v = {
7
7
  title: "Case Parts/Molecules/Modal",
8
- component: l,
8
+ component: n,
9
+ // tags: ["autodocs"],
9
10
  argTypes: {
10
11
  isOpen: { control: { type: "boolean" }, description: "Controls visibility of the modal" },
11
12
  closeOnOverlayClick: { control: { type: "boolean" }, description: "Close when clicking on overlay" }
12
13
  },
13
14
  args: { isOpen: !0, closeOnOverlayClick: !0 }
14
15
  };
15
- function C(i) {
16
- const [a, o] = t(!!i.isOpen);
17
- return /* @__PURE__ */ n("div", { style: { padding: 24 }, children: [
18
- /* @__PURE__ */ e(s, { variant: "primary", size: "md", onClick: () => o(!0), children: "Open Modal" }),
19
- /* @__PURE__ */ n(l, { isOpen: a, onClose: () => o(!1), closeOnOverlayClick: i.closeOnOverlayClick ?? !0, children: [
20
- /* @__PURE__ */ n(l.Toolbar, { children: [
21
- /* @__PURE__ */ e(l.Header, { align: "left", size: "lg", variant: "display", children: "Sample Modal" }),
22
- /* @__PURE__ */ e(l.Header, { align: "right", children: /* @__PURE__ */ e(l.CloseButton, { onClick: () => o(!1) }) })
16
+ function C() {
17
+ const [t, i] = r(!0);
18
+ return /* @__PURE__ */ l("div", { style: { padding: 24 }, children: [
19
+ /* @__PURE__ */ e(a, { variant: "primary", size: "md", onClick: () => i(!0), children: "Open Modal" }),
20
+ /* @__PURE__ */ l(n, { isOpen: t, onClose: () => i(!1), children: [
21
+ /* @__PURE__ */ l(n.Toolbar, { variant: "plain", children: [
22
+ /* @__PURE__ */ e(n.Header, { align: "left", size: "lg", variant: "display", children: "Plain Toolbar" }),
23
+ /* @__PURE__ */ e(n.Header, { align: "right", children: /* @__PURE__ */ e(n.CloseButton, { onClick: () => i(!1) }) })
23
24
  ] }),
24
- /* @__PURE__ */ n(l.Content, { children: [
25
- /* @__PURE__ */ e(r, { as: "p", size: "md", children: "This is a reusable modal with a non-scrollable toolbar. Click the overlay or the X to close." }),
26
- /* @__PURE__ */ e("div", { style: { height: 600 }, children: /* @__PURE__ */ e(r, { as: "p", size: "sm", children: "Scrollable content spacer..." }) })
27
- ] })
25
+ /* @__PURE__ */ e(n.Content, { children: /* @__PURE__ */ e(o, { as: "p", size: "md", children: "This modal uses a toolbar without a background or bottom border." }) })
28
26
  ] })
29
27
  ] });
30
28
  }
31
- const k = {
32
- render: (i) => /* @__PURE__ */ e(C, { ...i })
29
+ const O = {
30
+ render: () => /* @__PURE__ */ e(C, {})
33
31
  };
34
- function g() {
35
- const [i, a] = t(!1), [o, d] = t(!1), [m, c] = t(!1), [p, h] = t(!1);
36
- return /* @__PURE__ */ n("div", { style: { width: "200px", display: "grid", gap: 12 }, children: [
37
- /* @__PURE__ */ e(s, { variant: "secondary", size: "sm", onClick: () => a(!0), children: "Small Header" }),
38
- /* @__PURE__ */ n(l, { isOpen: i, onClose: () => a(!1), children: [
39
- /* @__PURE__ */ n(l.Toolbar, { children: [
40
- /* @__PURE__ */ e(l.Header, { align: "left", size: "sm", variant: "display", children: "Small Header" }),
41
- /* @__PURE__ */ e(l.Header, { align: "right", children: /* @__PURE__ */ e(l.CloseButton, { size: "sm", onClick: () => a(!1) }) })
32
+ function u() {
33
+ const [t, i] = r(!1), [h, s] = r(!1), [m, d] = r(!1), [p, c] = r(!1);
34
+ return /* @__PURE__ */ l("div", { style: { width: "200px", display: "grid", gap: 12 }, children: [
35
+ /* @__PURE__ */ e(a, { variant: "secondary", size: "sm", onClick: () => i(!0), children: "Small Header" }),
36
+ /* @__PURE__ */ l(n, { isOpen: t, onClose: () => i(!1), children: [
37
+ /* @__PURE__ */ l(n.Toolbar, { children: [
38
+ /* @__PURE__ */ e(n.Header, { align: "left", size: "sm", variant: "display", children: "Small Header" }),
39
+ /* @__PURE__ */ e(n.Header, { align: "right", children: /* @__PURE__ */ e(n.CloseButton, { size: "sm", onClick: () => i(!1) }) })
42
40
  ] }),
43
- /* @__PURE__ */ e(l.Content, { children: /* @__PURE__ */ e(r, { as: "p", size: "sm", children: "Small header modal content." }) })
41
+ /* @__PURE__ */ e(n.Content, { children: /* @__PURE__ */ e(o, { as: "p", size: "sm", children: "Small header modal content." }) })
44
42
  ] }),
45
- /* @__PURE__ */ e(s, { variant: "primary", size: "md", onClick: () => d(!0), children: "Medium Header" }),
46
- /* @__PURE__ */ n(l, { isOpen: o, onClose: () => d(!1), children: [
47
- /* @__PURE__ */ n(l.Toolbar, { children: [
48
- /* @__PURE__ */ e(l.Header, { align: "left", size: "md", variant: "display", children: "Medium Header" }),
49
- /* @__PURE__ */ e(l.Header, { align: "right", children: /* @__PURE__ */ e(l.CloseButton, { size: "md", onClick: () => d(!1) }) })
43
+ /* @__PURE__ */ e(a, { variant: "primary", size: "md", onClick: () => s(!0), children: "Medium Header" }),
44
+ /* @__PURE__ */ l(n, { isOpen: h, onClose: () => s(!1), children: [
45
+ /* @__PURE__ */ l(n.Toolbar, { children: [
46
+ /* @__PURE__ */ e(n.Header, { align: "left", size: "md", variant: "display", children: "Medium Header" }),
47
+ /* @__PURE__ */ e(n.Header, { align: "right", children: /* @__PURE__ */ e(n.CloseButton, { size: "md", onClick: () => s(!1) }) })
50
48
  ] }),
51
- /* @__PURE__ */ e(l.Content, { children: /* @__PURE__ */ e(r, { as: "p", size: "md", children: "Medium header modal content." }) })
49
+ /* @__PURE__ */ e(n.Content, { children: /* @__PURE__ */ e(o, { as: "p", size: "md", children: "Medium header modal content." }) })
52
50
  ] }),
53
- /* @__PURE__ */ e(s, { variant: "cta-primary", size: "lg", onClick: () => c(!0), children: "Large Header" }),
54
- /* @__PURE__ */ n(l, { isOpen: m, onClose: () => c(!1), children: [
55
- /* @__PURE__ */ n(l.Toolbar, { children: [
56
- /* @__PURE__ */ e(l.Header, { align: "left", size: "lg", variant: "display", children: "Large Header" }),
57
- /* @__PURE__ */ e(l.Header, { align: "right", children: /* @__PURE__ */ e(l.CloseButton, { size: "md", onClick: () => c(!1) }) })
51
+ /* @__PURE__ */ e(a, { variant: "cta-primary", size: "lg", onClick: () => d(!0), children: "Large Header" }),
52
+ /* @__PURE__ */ l(n, { isOpen: m, onClose: () => d(!1), children: [
53
+ /* @__PURE__ */ l(n.Toolbar, { children: [
54
+ /* @__PURE__ */ e(n.Header, { align: "left", size: "lg", variant: "display", children: "Large Header" }),
55
+ /* @__PURE__ */ e(n.Header, { align: "right", children: /* @__PURE__ */ e(n.CloseButton, { size: "md", onClick: () => d(!1) }) })
58
56
  ] }),
59
- /* @__PURE__ */ e(l.Content, { children: /* @__PURE__ */ e(r, { as: "p", size: "lg", children: "Large header modal content." }) })
57
+ /* @__PURE__ */ e(n.Content, { children: /* @__PURE__ */ e(o, { as: "p", size: "lg", children: "Large header modal content." }) })
60
58
  ] }),
61
- /* @__PURE__ */ e(s, { variant: "tertiary", size: "md", onClick: () => h(!0), children: "Custom Toolbar" }),
62
- /* @__PURE__ */ n(l, { isOpen: p, onClose: () => h(!1), children: [
63
- /* @__PURE__ */ n(l.Toolbar, { children: [
64
- /* @__PURE__ */ e(l.Header, { align: "left", size: "md", variant: "display", children: "Custom Toolbar" }),
65
- /* @__PURE__ */ n(l.Header, { align: "right", children: [
59
+ /* @__PURE__ */ e(a, { variant: "tertiary", size: "md", onClick: () => c(!0), children: "Custom Toolbar" }),
60
+ /* @__PURE__ */ l(n, { isOpen: p, onClose: () => c(!1), children: [
61
+ /* @__PURE__ */ l(n.Toolbar, { children: [
62
+ /* @__PURE__ */ e(n.Header, { align: "left", size: "md", variant: "display", children: "Custom Toolbar" }),
63
+ /* @__PURE__ */ l(n.Header, { align: "right", children: [
66
64
  /* @__PURE__ */ e("button", { onClick: () => alert("Sent!"), children: "Send Email" }),
67
- /* @__PURE__ */ e(l.CloseButton, { size: "md", onClick: () => h(!1) })
65
+ /* @__PURE__ */ e(n.CloseButton, { size: "md", onClick: () => c(!1) })
68
66
  ] })
69
67
  ] }),
70
- /* @__PURE__ */ e(l.Content, { children: /* @__PURE__ */ e(r, { as: "p", size: "md", children: "Modal with custom toolbar functions." }) })
68
+ /* @__PURE__ */ e(n.Content, { children: /* @__PURE__ */ e(o, { as: "p", size: "md", children: "Modal with custom toolbar functions." }) })
71
69
  ] })
72
70
  ] });
73
71
  }
74
- const b = {
75
- render: () => /* @__PURE__ */ e(g, {})
72
+ const H = {
73
+ render: () => /* @__PURE__ */ e(u, {})
76
74
  };
77
75
  export {
78
- k as Basic,
79
- b as Sizes,
76
+ O as PlainToolbar,
77
+ H as Sizes,
80
78
  v as default
81
79
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@caseparts-org/caseblocks",
3
3
  "private": false,
4
- "version": "0.0.251",
4
+ "version": "0.0.252",
5
5
  "type": "module",
6
6
  "module": "dist/main.js",
7
7
  "types": "dist/main.d.ts",