@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.
- package/dist/Cart.module-CV0POv9_.js +25 -0
- package/dist/{Table-f_q_CCA-.js → Table-_UT9976g.js} +63 -63
- package/dist/assets/Availability.css +1 -1
- package/dist/assets/Cart.css +1 -1
- package/dist/assets/Icon.css +1 -1
- package/dist/assets/Modal.css +1 -1
- package/dist/assets/Table.css +1 -1
- package/dist/atoms/Icon/Icon.d.ts +3 -2
- package/dist/atoms/Icon/Icon.js +33 -29
- package/dist/atoms/Icon/Icon.stories.d.ts +5 -0
- package/dist/atoms/Icon/Icon.stories.js +15 -11
- package/dist/main-client.js +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/Cart/Cart.js +1 -1
- package/dist/molecules/Cart/CartPart.js +1 -1
- package/dist/molecules/Cart/CartSlideInPanel.js +8 -8
- 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/dist/molecules/Table/Table.js +1 -1
- package/dist/molecules/Table/Table.stories.js +1 -1
- package/package.json +1 -1
- package/dist/Cart.module-CqE2A_OG.js +0 -25
|
@@ -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
|
};
|
|
@@ -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-
|
|
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-
|
|
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-
|
|
7
|
+
import { s as t } from "../../Cart.module-CV0POv9_.js";
|
|
8
8
|
function S({
|
|
9
9
|
open: p,
|
|
10
|
-
onClose:
|
|
10
|
+
onClose: n,
|
|
11
11
|
cart: a,
|
|
12
|
-
subtotal:
|
|
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:
|
|
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:
|
|
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
|
-
|
|
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:
|
|
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
|
|
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
|
};
|