@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.
- package/dist/assets/Availability.css +1 -1
- package/dist/assets/Modal.css +1 -1
- package/dist/molecules/Availability/Availability.d.ts +6 -0
- package/dist/molecules/Availability/Availability.js +109 -57
- package/dist/molecules/Availability/Availability.stories.d.ts +4 -0
- package/dist/molecules/Availability/Availability.stories.js +33 -17
- package/dist/molecules/Modal/Modal.d.ts +1 -0
- package/dist/molecules/Modal/Modal.js +56 -44
- package/dist/molecules/Modal/Modal.stories.d.ts +1 -1
- package/dist/molecules/Modal/Modal.stories.js +50 -52
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
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)}
|
package/dist/assets/Modal.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
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
|
|
2
|
-
import { c as
|
|
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
|
|
5
|
-
import { Icon as
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
|
17
|
-
availId:
|
|
18
|
-
availDescription:
|
|
19
|
-
availClassName:
|
|
20
|
-
enableTooltip:
|
|
21
|
-
inventory:
|
|
26
|
+
function F({
|
|
27
|
+
availId: i,
|
|
28
|
+
availDescription: r,
|
|
29
|
+
availClassName: c,
|
|
30
|
+
enableTooltip: m = !1,
|
|
31
|
+
inventory: d
|
|
22
32
|
}) {
|
|
23
|
-
const a =
|
|
24
|
-
return a ? /* @__PURE__ */
|
|
25
|
-
|
|
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__ */
|
|
31
|
-
|
|
32
|
-
/* @__PURE__ */
|
|
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:
|
|
35
|
-
children: /* @__PURE__ */
|
|
44
|
+
contentClassName: o.tooltip,
|
|
45
|
+
children: /* @__PURE__ */ e(P, { availabilityId: i, inventory: d })
|
|
36
46
|
}
|
|
37
|
-
) : /* @__PURE__ */
|
|
47
|
+
) : /* @__PURE__ */ e(s, { size: "xs", className: f(o.availability, o[i], a ? o.pointer : null, c), children: r });
|
|
38
48
|
}
|
|
39
|
-
function
|
|
40
|
-
var
|
|
41
|
-
const
|
|
42
|
-
if (
|
|
43
|
-
const
|
|
44
|
-
return /* @__PURE__ */
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
"
|
|
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__ */
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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__ */
|
|
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
|
|
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
|
-
|
|
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
|
|
3
|
-
const
|
|
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:
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
c as
|
|
151
|
-
|
|
152
|
-
|
|
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
|
|
2
|
-
import
|
|
3
|
-
import { c as
|
|
4
|
-
import { Text as
|
|
5
|
-
import { Icon as
|
|
6
|
-
import '../../assets/Modal.css';const
|
|
7
|
-
overlay:
|
|
8
|
-
container:
|
|
9
|
-
toolbar:
|
|
10
|
-
toolbarPlain:
|
|
11
|
-
headerGroup:
|
|
12
|
-
headerLeft:
|
|
13
|
-
headerRight:
|
|
14
|
-
closeButton:
|
|
15
|
-
content:
|
|
16
|
-
},
|
|
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
|
-
},
|
|
20
|
+
}, C = {
|
|
21
21
|
sm: "sm",
|
|
22
22
|
md: "md",
|
|
23
23
|
lg: "md"
|
|
24
|
-
},
|
|
24
|
+
}, d = ({
|
|
25
25
|
isOpen: t,
|
|
26
26
|
onClose: o,
|
|
27
27
|
closeOnOverlayClick: e = !0,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
width: l,
|
|
29
|
+
className: s,
|
|
30
|
+
style: m,
|
|
31
|
+
children: u,
|
|
32
|
+
..._
|
|
31
33
|
}) => {
|
|
32
|
-
const
|
|
34
|
+
const c = v.useRef(!1);
|
|
33
35
|
if (!t) return null;
|
|
34
|
-
const
|
|
35
|
-
e && (
|
|
36
|
-
},
|
|
36
|
+
const h = (i) => {
|
|
37
|
+
e && (c.current = i.target === i.currentTarget);
|
|
38
|
+
}, f = (i) => {
|
|
37
39
|
if (!e) {
|
|
38
|
-
|
|
40
|
+
c.current = !1;
|
|
39
41
|
return;
|
|
40
42
|
}
|
|
41
|
-
|
|
43
|
+
c.current && i.target === i.currentTarget && o(), c.current = !1;
|
|
42
44
|
};
|
|
43
|
-
return /* @__PURE__ */
|
|
44
|
-
|
|
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:
|
|
48
|
-
...
|
|
59
|
+
className: n(r.toolbar, t === "plain" && r.toolbarPlain, o),
|
|
60
|
+
...l,
|
|
49
61
|
children: e
|
|
50
62
|
}
|
|
51
|
-
),
|
|
63
|
+
), L = ({
|
|
52
64
|
align: t = "left",
|
|
53
65
|
size: o = "md",
|
|
54
66
|
variant: e = "display",
|
|
55
|
-
className:
|
|
56
|
-
children:
|
|
67
|
+
className: l,
|
|
68
|
+
children: s,
|
|
57
69
|
...m
|
|
58
70
|
}) => {
|
|
59
|
-
const
|
|
60
|
-
return /* @__PURE__ */
|
|
71
|
+
const u = typeof s == "string";
|
|
72
|
+
return /* @__PURE__ */ a(
|
|
61
73
|
"div",
|
|
62
74
|
{
|
|
63
|
-
className:
|
|
75
|
+
className: n(r.headerGroup, t === "left" ? r.headerLeft : r.headerRight, l),
|
|
64
76
|
...m,
|
|
65
|
-
children:
|
|
77
|
+
children: u ? /* @__PURE__ */ a(p, { as: "div", size: w[o], variant: e, weight: "medium", children: s }) : s
|
|
66
78
|
}
|
|
67
79
|
);
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
-
|
|
86
|
+
d as Modal
|
|
75
87
|
};
|
|
@@ -1,81 +1,79 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Modal as
|
|
4
|
-
import { Text as
|
|
5
|
-
import { Button as
|
|
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:
|
|
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(
|
|
16
|
-
const [
|
|
17
|
-
return /* @__PURE__ */
|
|
18
|
-
/* @__PURE__ */ e(
|
|
19
|
-
/* @__PURE__ */ n
|
|
20
|
-
/* @__PURE__ */ n
|
|
21
|
-
/* @__PURE__ */ e(
|
|
22
|
-
/* @__PURE__ */ e(
|
|
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
|
|
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
|
|
32
|
-
render: (
|
|
29
|
+
const O = {
|
|
30
|
+
render: () => /* @__PURE__ */ e(C, {})
|
|
33
31
|
};
|
|
34
|
-
function
|
|
35
|
-
const [
|
|
36
|
-
return /* @__PURE__ */
|
|
37
|
-
/* @__PURE__ */ e(
|
|
38
|
-
/* @__PURE__ */ n
|
|
39
|
-
/* @__PURE__ */ n
|
|
40
|
-
/* @__PURE__ */ e(
|
|
41
|
-
/* @__PURE__ */ e(
|
|
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(
|
|
41
|
+
/* @__PURE__ */ e(n.Content, { children: /* @__PURE__ */ e(o, { as: "p", size: "sm", children: "Small header modal content." }) })
|
|
44
42
|
] }),
|
|
45
|
-
/* @__PURE__ */ e(
|
|
46
|
-
/* @__PURE__ */ n
|
|
47
|
-
/* @__PURE__ */ n
|
|
48
|
-
/* @__PURE__ */ e(
|
|
49
|
-
/* @__PURE__ */ e(
|
|
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(
|
|
49
|
+
/* @__PURE__ */ e(n.Content, { children: /* @__PURE__ */ e(o, { as: "p", size: "md", children: "Medium header modal content." }) })
|
|
52
50
|
] }),
|
|
53
|
-
/* @__PURE__ */ e(
|
|
54
|
-
/* @__PURE__ */ n
|
|
55
|
-
/* @__PURE__ */ n
|
|
56
|
-
/* @__PURE__ */ e(
|
|
57
|
-
/* @__PURE__ */ e(
|
|
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(
|
|
57
|
+
/* @__PURE__ */ e(n.Content, { children: /* @__PURE__ */ e(o, { as: "p", size: "lg", children: "Large header modal content." }) })
|
|
60
58
|
] }),
|
|
61
|
-
/* @__PURE__ */ e(
|
|
62
|
-
/* @__PURE__ */ n
|
|
63
|
-
/* @__PURE__ */ n
|
|
64
|
-
/* @__PURE__ */ e(
|
|
65
|
-
/* @__PURE__ */ n
|
|
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(
|
|
65
|
+
/* @__PURE__ */ e(n.CloseButton, { size: "md", onClick: () => c(!1) })
|
|
68
66
|
] })
|
|
69
67
|
] }),
|
|
70
|
-
/* @__PURE__ */ e(
|
|
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
|
|
75
|
-
render: () => /* @__PURE__ */ e(
|
|
72
|
+
const H = {
|
|
73
|
+
render: () => /* @__PURE__ */ e(u, {})
|
|
76
74
|
};
|
|
77
75
|
export {
|
|
78
|
-
|
|
79
|
-
|
|
76
|
+
O as PlainToolbar,
|
|
77
|
+
H as Sizes,
|
|
80
78
|
v as default
|
|
81
79
|
};
|