@caseparts-org/caseblocks 0.0.251 → 0.0.253

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,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
  };
@@ -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-CqE2A_OG.js";
5
+ import { s as m } from "../../Cart.module-CV0POv9_.js";
6
6
  const S = l.forwardRef(function({
7
7
  cart: i,
8
8
  open: t = !1,
@@ -8,7 +8,7 @@ import { QuantityInput as B } from "../QuantityInput/QuantityInput.js";
8
8
  import { Icon as n } from "../../atoms/Icon/Icon.js";
9
9
  import { Tooltip as D } from "../../atoms/Tooltip/Tooltip.js";
10
10
  import { c as F } from "../../clsx-OuTLNxxd.js";
11
- import { s as i } from "../../Cart.module-CqE2A_OG.js";
11
+ import { s as i } from "../../Cart.module-CV0POv9_.js";
12
12
  function $({
13
13
  imageUrl: g,
14
14
  imageAlt: I = "Product image",
@@ -4,12 +4,12 @@ import { Text as l } from "../../atoms/Text/Text.js";
4
4
  import { Button as h } from "../../atoms/Button/Button.js";
5
5
  import { Icon as u } from "../../atoms/Icon/Icon.js";
6
6
  import { CartPart as x } from "./CartPart.js";
7
- import { s as t } from "../../Cart.module-CqE2A_OG.js";
7
+ import { s as t } from "../../Cart.module-CV0POv9_.js";
8
8
  function S({
9
9
  open: p,
10
- onClose: s,
10
+ onClose: n,
11
11
  cart: a,
12
- subtotal: n,
12
+ subtotal: s,
13
13
  itemPriceLabel: y,
14
14
  onItemQtyChange: f,
15
15
  onItemDelete: g,
@@ -24,7 +24,7 @@ function S({
24
24
  {
25
25
  side: "right",
26
26
  open: p,
27
- onClose: s,
27
+ onClose: n,
28
28
  ariaLabel: "Shopping Cart",
29
29
  children: /* @__PURE__ */ r("div", { id: "cart-panel", className: t.cartContainer, children: [
30
30
  /* @__PURE__ */ r("div", { className: t.headerWrapper, children: [
@@ -35,7 +35,7 @@ function S({
35
35
  " items in your cart"
36
36
  ] })
37
37
  ] }),
38
- /* @__PURE__ */ i("button", { onClick: s, children: /* @__PURE__ */ i(u, { iconKey: "fa-regular fa-xmark", size: "md" }) })
38
+ /* @__PURE__ */ i("button", { onClick: n, children: /* @__PURE__ */ i(u, { iconKey: "fa-regular fa-xmark", size: "md" }) })
39
39
  ] }),
40
40
  /* @__PURE__ */ r(
41
41
  h,
@@ -47,7 +47,7 @@ function S({
47
47
  className: t.checkoutButton,
48
48
  children: [
49
49
  "Proceed to Checkout",
50
- /* @__PURE__ */ i(u, { iconKey: "fa-regular fa-arrow-right-long", size: "sm" })
50
+ /* @__PURE__ */ i(u, { iconKey: "fa-regular fa-arrow-right-long", size: "sm", noPadding: !0 })
51
51
  ]
52
52
  }
53
53
  ),
@@ -78,9 +78,9 @@ function S({
78
78
  },
79
79
  `${e.id}-${e.make ?? ""}-${e.model ?? ""}-${e.serial ?? ""}`
80
80
  )) }) : /* @__PURE__ */ i("div", { className: t.noItems, children: /* @__PURE__ */ i(l, { as: "p", size: "sm", children: "No items in your cart yet" }) }) }),
81
- n && /* @__PURE__ */ r("div", { className: t.subtotal, children: [
81
+ s && /* @__PURE__ */ r("div", { className: t.subtotal, children: [
82
82
  /* @__PURE__ */ i(l, { size: "md", weight: "semibold", children: "Subtotal" }),
83
- /* @__PURE__ */ i(l, { size: "md", weight: "semibold", children: n })
83
+ /* @__PURE__ */ i(l, { size: "md", weight: "semibold", children: s })
84
84
  ] }),
85
85
  /* @__PURE__ */ i(
86
86
  h,
@@ -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;