@clearstory/drywall-react 8.0.2 → 8.0.3
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,104 +1,147 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { n
|
|
3
|
-
import { useContext as
|
|
1
|
+
import { jsxs as x, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { n, h } from "../../index-SzwnPTHF.js";
|
|
3
|
+
import { useContext as b, useCallback as w } from "react";
|
|
4
4
|
import "../../icons/ClearstoryIcon.js";
|
|
5
5
|
import "../../icons/InternalOnlyIcon.js";
|
|
6
6
|
import "../../icons/MoneyBucketIcon.js";
|
|
7
7
|
import "../../icons/MoreCircleOutlineIcon.js";
|
|
8
8
|
import "../../icons/SparkleIcon.js";
|
|
9
|
-
import { I
|
|
10
|
-
import { C as
|
|
11
|
-
import { ToastLabelContext as
|
|
12
|
-
import { B as
|
|
9
|
+
import { I, E as C, W as R, C as S } from "../../WarningAmberOutlined-DMySBPYG.js";
|
|
10
|
+
import { C as A } from "../../Close-DFkW1yae.js";
|
|
11
|
+
import { ToastLabelContext as B } from "./ToastLabelContext.js";
|
|
12
|
+
import { B as y } from "../../Box-tMEqMAfx.js";
|
|
13
13
|
import { A as m } from "../../Alert-BzbQJE20.js";
|
|
14
|
-
import { I as
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
if (!
|
|
14
|
+
import { I as k } from "../../IconButton-B1h37ok8.js";
|
|
15
|
+
const D = () => {
|
|
16
|
+
const a = b(B);
|
|
17
|
+
if (!a)
|
|
18
18
|
throw new Error(
|
|
19
19
|
'useToast must be used within a ToastProvider. Make sure to wrap your component with <ToastProvider closeAriaLabel="...">'
|
|
20
20
|
);
|
|
21
|
-
const { closeAriaLabel:
|
|
21
|
+
const { closeAriaLabel: s } = a;
|
|
22
22
|
return {
|
|
23
|
-
notify:
|
|
24
|
-
(c,
|
|
25
|
-
const { type:
|
|
23
|
+
notify: w(
|
|
24
|
+
(c, d = {}) => {
|
|
25
|
+
const { type: e = "info", details: i, ...p } = d, l = {
|
|
26
26
|
success: "success",
|
|
27
27
|
warning: "warning",
|
|
28
28
|
error: "error",
|
|
29
29
|
info: "info"
|
|
30
|
-
},
|
|
31
|
-
success: /* @__PURE__ */
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
}, u = {
|
|
31
|
+
success: /* @__PURE__ */ r(
|
|
32
|
+
S,
|
|
33
|
+
{
|
|
34
|
+
sx: {
|
|
35
|
+
color: ({ vars: o }) => o?.palette.success.main,
|
|
36
|
+
marginRight: 0.5
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
),
|
|
40
|
+
warning: /* @__PURE__ */ r(
|
|
41
|
+
R,
|
|
42
|
+
{
|
|
43
|
+
sx: {
|
|
44
|
+
color: ({ vars: o }) => o?.palette.warning.main,
|
|
45
|
+
marginRight: 0.5
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
),
|
|
49
|
+
error: /* @__PURE__ */ r(
|
|
50
|
+
C,
|
|
51
|
+
{
|
|
52
|
+
sx: {
|
|
53
|
+
color: ({ vars: o }) => o?.palette.error.main,
|
|
54
|
+
marginRight: 0.5
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
info: /* @__PURE__ */ r(
|
|
59
|
+
I,
|
|
60
|
+
{
|
|
61
|
+
sx: {
|
|
62
|
+
color: ({ vars: o }) => o?.palette.info.main,
|
|
63
|
+
marginRight: 0.5
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
)
|
|
35
67
|
};
|
|
36
|
-
return
|
|
37
|
-
(
|
|
38
|
-
const
|
|
39
|
-
return /* @__PURE__ */
|
|
40
|
-
|
|
68
|
+
return n(
|
|
69
|
+
(o) => {
|
|
70
|
+
const f = h(c, o);
|
|
71
|
+
return /* @__PURE__ */ x(
|
|
72
|
+
y,
|
|
41
73
|
{
|
|
42
74
|
sx: {
|
|
75
|
+
borderRadius: "4px",
|
|
76
|
+
boxShadow: 2,
|
|
43
77
|
minWidth: { xs: "auto", sm: "18rem" },
|
|
44
78
|
maxWidth: "18rem"
|
|
45
79
|
},
|
|
46
80
|
children: [
|
|
47
|
-
/* @__PURE__ */
|
|
81
|
+
/* @__PURE__ */ r(
|
|
48
82
|
m,
|
|
49
83
|
{
|
|
50
84
|
role: "none",
|
|
51
|
-
severity:
|
|
52
|
-
variant: "
|
|
53
|
-
icon:
|
|
54
|
-
action: /* @__PURE__ */
|
|
55
|
-
|
|
85
|
+
severity: l[e],
|
|
86
|
+
variant: "standard",
|
|
87
|
+
icon: u[e],
|
|
88
|
+
action: /* @__PURE__ */ r(
|
|
89
|
+
k,
|
|
56
90
|
{
|
|
57
91
|
color: "inherit",
|
|
58
92
|
size: "small",
|
|
59
|
-
onClick: () =>
|
|
60
|
-
"aria-label":
|
|
93
|
+
onClick: () => n.dismiss(o.id),
|
|
94
|
+
"aria-label": s,
|
|
61
95
|
sx: {
|
|
62
96
|
marginLeft: 0.5
|
|
63
97
|
},
|
|
64
|
-
children: /* @__PURE__ */
|
|
98
|
+
children: /* @__PURE__ */ r(A, { fontSize: "small" })
|
|
65
99
|
}
|
|
66
100
|
),
|
|
67
101
|
sx: [
|
|
68
102
|
{
|
|
69
|
-
boxShadow:
|
|
103
|
+
boxShadow: 0,
|
|
70
104
|
fontSize: "0.875rem",
|
|
71
105
|
zIndex: 2
|
|
72
106
|
},
|
|
73
|
-
!!
|
|
107
|
+
!!i && {
|
|
74
108
|
borderBottomLeftRadius: 0,
|
|
75
109
|
borderBottomRightRadius: 0
|
|
76
110
|
}
|
|
77
111
|
],
|
|
78
|
-
children:
|
|
112
|
+
children: f
|
|
79
113
|
}
|
|
80
114
|
),
|
|
81
|
-
|
|
115
|
+
i && /* @__PURE__ */ r(
|
|
82
116
|
m,
|
|
83
117
|
{
|
|
84
118
|
role: "none",
|
|
85
119
|
icon: !1,
|
|
86
|
-
severity:
|
|
120
|
+
severity: l[e],
|
|
87
121
|
variant: "outlined",
|
|
88
|
-
sx: ({ vars:
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
122
|
+
sx: ({ vars: t }) => {
|
|
123
|
+
const g = {
|
|
124
|
+
success: t?.palette.Alert.successStandardBg,
|
|
125
|
+
warning: t?.palette.Alert.warningStandardBg,
|
|
126
|
+
error: t?.palette.Alert.errorStandardBg,
|
|
127
|
+
info: t?.palette.Alert.infoStandardBg
|
|
128
|
+
};
|
|
129
|
+
return {
|
|
130
|
+
backgroundColor: t?.palette.background.paper,
|
|
131
|
+
borderColor: g[e],
|
|
132
|
+
borderTopLeftRadius: 0,
|
|
133
|
+
borderTopRightRadius: 0,
|
|
134
|
+
boxShadow: 0,
|
|
135
|
+
fontSize: "0.75rem",
|
|
136
|
+
alignItems: "flex-start",
|
|
137
|
+
fontWeight: "normal",
|
|
138
|
+
maxHeight: "7rem",
|
|
139
|
+
overflowX: "auto",
|
|
140
|
+
overflowY: "auto",
|
|
141
|
+
zIndex: 1
|
|
142
|
+
};
|
|
143
|
+
},
|
|
144
|
+
children: i
|
|
102
145
|
}
|
|
103
146
|
)
|
|
104
147
|
]
|
|
@@ -113,18 +156,18 @@ const q = () => {
|
|
|
113
156
|
background: "none",
|
|
114
157
|
boxShadow: "none"
|
|
115
158
|
},
|
|
116
|
-
duration:
|
|
159
|
+
duration: e === "error" || e === "warning" ? 1 / 0 : 5e3,
|
|
117
160
|
icon: null,
|
|
118
|
-
...
|
|
161
|
+
...p
|
|
119
162
|
}
|
|
120
163
|
);
|
|
121
164
|
},
|
|
122
|
-
[
|
|
165
|
+
[s]
|
|
123
166
|
),
|
|
124
|
-
dismissNotification:
|
|
125
|
-
removeNotifications:
|
|
167
|
+
dismissNotification: n.dismiss,
|
|
168
|
+
removeNotifications: n.remove
|
|
126
169
|
};
|
|
127
170
|
};
|
|
128
171
|
export {
|
|
129
|
-
|
|
172
|
+
D as useToast
|
|
130
173
|
};
|