@elliemae/ds-legacy-toast 1.0.0-rc.1
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/cjs/DSToastDefinitions.js +68 -0
- package/dist/cjs/DSToastDefinitions.js.map +7 -0
- package/dist/cjs/config/useToast.js +81 -0
- package/dist/cjs/config/useToast.js.map +7 -0
- package/dist/cjs/constants.js +79 -0
- package/dist/cjs/constants.js.map +7 -0
- package/dist/cjs/index.js +62 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/package.json +7 -0
- package/dist/cjs/parts/CloseButton.js +52 -0
- package/dist/cjs/parts/CloseButton.js.map +7 -0
- package/dist/cjs/parts/DSToast.js +84 -0
- package/dist/cjs/parts/DSToast.js.map +7 -0
- package/dist/cjs/parts/DSToastAction.js +63 -0
- package/dist/cjs/parts/DSToastAction.js.map +7 -0
- package/dist/cjs/parts/DSToastActionLink.js +44 -0
- package/dist/cjs/parts/DSToastActionLink.js.map +7 -0
- package/dist/cjs/parts/DSToastContent.js +57 -0
- package/dist/cjs/parts/DSToastContent.js.map +7 -0
- package/dist/cjs/parts/styled.js +379 -0
- package/dist/cjs/parts/styled.js.map +7 -0
- package/dist/cjs/react-desc-prop-types.js +78 -0
- package/dist/cjs/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/toast.js +46 -0
- package/dist/cjs/toast.js.map +7 -0
- package/dist/esm/DSToastDefinitions.js +38 -0
- package/dist/esm/DSToastDefinitions.js.map +7 -0
- package/dist/esm/config/useToast.js +51 -0
- package/dist/esm/config/useToast.js.map +7 -0
- package/dist/esm/constants.js +49 -0
- package/dist/esm/constants.js.map +7 -0
- package/dist/esm/index.js +42 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/package.json +7 -0
- package/dist/esm/parts/CloseButton.js +22 -0
- package/dist/esm/parts/CloseButton.js.map +7 -0
- package/dist/esm/parts/DSToast.js +54 -0
- package/dist/esm/parts/DSToast.js.map +7 -0
- package/dist/esm/parts/DSToastAction.js +38 -0
- package/dist/esm/parts/DSToastAction.js.map +7 -0
- package/dist/esm/parts/DSToastActionLink.js +14 -0
- package/dist/esm/parts/DSToastActionLink.js.map +7 -0
- package/dist/esm/parts/DSToastContent.js +33 -0
- package/dist/esm/parts/DSToastContent.js.map +7 -0
- package/dist/esm/parts/styled.js +356 -0
- package/dist/esm/parts/styled.js.map +7 -0
- package/dist/esm/react-desc-prop-types.js +48 -0
- package/dist/esm/react-desc-prop-types.js.map +7 -0
- package/dist/esm/toast.js +16 -0
- package/dist/esm/toast.js.map +7 -0
- package/dist/types/DSToastDefinitions.d.ts +23 -0
- package/dist/types/config/useToast.d.ts +9 -0
- package/dist/types/constants.d.ts +31 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/parts/CloseButton.d.ts +8 -0
- package/dist/types/parts/DSToast.d.ts +6 -0
- package/dist/types/parts/DSToastAction.d.ts +5 -0
- package/dist/types/parts/DSToastContent.d.ts +11 -0
- package/dist/types/react-desc-prop-types.d.ts +42 -0
- package/dist/types/tests/toast-axe.test.d.ts +1 -0
- package/dist/types/tests/toast-render.test.d.ts +1 -0
- package/dist/types/toast.d.ts +35 -0
- package/package.json +96 -0
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { DSButtonV2 } from "@elliemae/ds-legacy-button-v2";
|
|
3
|
+
import { styled, th, xStyledCommonProps } from "@elliemae/ds-legacy-system";
|
|
4
|
+
import {
|
|
5
|
+
DSToastActionLinkName,
|
|
6
|
+
DSToastActionName,
|
|
7
|
+
DSToastActionSlots,
|
|
8
|
+
DSToastActionLinkSlots,
|
|
9
|
+
DSToastName,
|
|
10
|
+
DSToastSlots
|
|
11
|
+
} from "../DSToastDefinitions.js";
|
|
12
|
+
const StyledLink = styled("span", { name: DSToastActionLinkName, slot: DSToastActionLinkSlots.ROOT })`
|
|
13
|
+
color: brand-600;
|
|
14
|
+
${xStyledCommonProps}
|
|
15
|
+
`;
|
|
16
|
+
const StyledContainer = styled("div", { name: DSToastName, slot: DSToastSlots.CONTAINER })`
|
|
17
|
+
display: flex;
|
|
18
|
+
padding: ${th.space("xxs")};
|
|
19
|
+
padding-right: ${th.space("s")};
|
|
20
|
+
`;
|
|
21
|
+
const StyledIconContainer = styled("div", { name: DSToastName, slot: DSToastSlots.ICON_CONTAINER })`
|
|
22
|
+
margin-top: ${th.space("xxxs")};
|
|
23
|
+
margin-right: ${th.space("xxs")};
|
|
24
|
+
`;
|
|
25
|
+
const StyledMessageContent = styled("div", { name: DSToastName, slot: DSToastSlots.MESSAGE_CONTENT })`
|
|
26
|
+
flex: 1;
|
|
27
|
+
`;
|
|
28
|
+
const StyledMessageHeader = styled("div", { name: DSToastName, slot: DSToastSlots.MESSAGE_HEADER })`
|
|
29
|
+
margin-top: ${th.space("xxxs")};
|
|
30
|
+
margin-bottom: ${th.space("xxs")};
|
|
31
|
+
color: neutral-700;
|
|
32
|
+
font-weight: 600;
|
|
33
|
+
font-size: 1rem;
|
|
34
|
+
`;
|
|
35
|
+
const StyledMessageText = styled("span", { name: DSToastName, slot: DSToastSlots.MESSAGE_TEXT })`
|
|
36
|
+
color: neutral-500;
|
|
37
|
+
font-size: 1rem;
|
|
38
|
+
`;
|
|
39
|
+
const StyledAction = styled("div", { name: DSToastActionName, slot: DSToastActionSlots.ROOT })`
|
|
40
|
+
position: relative;
|
|
41
|
+
&:focus {
|
|
42
|
+
&:after {
|
|
43
|
+
position: absolute;
|
|
44
|
+
content: '';
|
|
45
|
+
border: 2px solid brand-700;
|
|
46
|
+
top: -1px;
|
|
47
|
+
left: -1px;
|
|
48
|
+
width: calc(100% + 2px);
|
|
49
|
+
height: calc(100% + 2px);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
&:focus-visible {
|
|
53
|
+
outline: none;
|
|
54
|
+
}
|
|
55
|
+
${xStyledCommonProps}
|
|
56
|
+
`;
|
|
57
|
+
const StyledButton = styled(DSButtonV2, { name: DSToastName, slot: DSToastSlots.CLOSE_BUTTON })`
|
|
58
|
+
position: absolute;
|
|
59
|
+
top: 4px;
|
|
60
|
+
right: 4px;
|
|
61
|
+
|
|
62
|
+
fill: ${th.color("neutral-300")};
|
|
63
|
+
`;
|
|
64
|
+
const ToastifyWrapper = styled("div", { name: DSToastName, slot: DSToastSlots.ROOT })`
|
|
65
|
+
.Toastify__toast-container {
|
|
66
|
+
z-index: 9999;
|
|
67
|
+
position: fixed;
|
|
68
|
+
width: 300px;
|
|
69
|
+
box-sizing: border-box;
|
|
70
|
+
color: #fff;
|
|
71
|
+
&--top-left {
|
|
72
|
+
top: 1em;
|
|
73
|
+
left: 1em;
|
|
74
|
+
}
|
|
75
|
+
&--top-center {
|
|
76
|
+
top: 1em;
|
|
77
|
+
left: 50%;
|
|
78
|
+
margin-left: -150px;
|
|
79
|
+
}
|
|
80
|
+
&--top-right {
|
|
81
|
+
top: 1em;
|
|
82
|
+
right: 1em;
|
|
83
|
+
}
|
|
84
|
+
&--bottom-left {
|
|
85
|
+
bottom: 1em;
|
|
86
|
+
left: 1em;
|
|
87
|
+
}
|
|
88
|
+
&--bottom-center {
|
|
89
|
+
bottom: 1em;
|
|
90
|
+
left: 50%;
|
|
91
|
+
margin-left: -150px;
|
|
92
|
+
}
|
|
93
|
+
&--bottom-right {
|
|
94
|
+
bottom: 1em;
|
|
95
|
+
right: 1em;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&:not(.with-progressbar) {
|
|
99
|
+
.Toastify__toast {
|
|
100
|
+
&--default {
|
|
101
|
+
border-color: neutral-400;
|
|
102
|
+
}
|
|
103
|
+
&--info {
|
|
104
|
+
border-color: brand-400;
|
|
105
|
+
}
|
|
106
|
+
&--success {
|
|
107
|
+
border-color: success-900;
|
|
108
|
+
}
|
|
109
|
+
&--warning {
|
|
110
|
+
border-color: warning-900;
|
|
111
|
+
}
|
|
112
|
+
&--error {
|
|
113
|
+
border-color: danger-900;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&.with-progressbar {
|
|
119
|
+
.Toastify__toast {
|
|
120
|
+
&--default {
|
|
121
|
+
border-color: neutral-300;
|
|
122
|
+
}
|
|
123
|
+
&--info {
|
|
124
|
+
border-color: brand-300;
|
|
125
|
+
}
|
|
126
|
+
&--success {
|
|
127
|
+
border-color: success-300;
|
|
128
|
+
}
|
|
129
|
+
&--warning {
|
|
130
|
+
border-color: warning-600;
|
|
131
|
+
}
|
|
132
|
+
&--error {
|
|
133
|
+
border-color: danger-200;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.Toastify__toast {
|
|
140
|
+
position: relative;
|
|
141
|
+
min-height: 76px;
|
|
142
|
+
box-sizing: border-box;
|
|
143
|
+
border-radius: 1px;
|
|
144
|
+
display: flex;
|
|
145
|
+
justify-content: space-between;
|
|
146
|
+
cursor: pointer;
|
|
147
|
+
direction: ltr;
|
|
148
|
+
background-color: neutral-000;
|
|
149
|
+
border-left: 5px solid;
|
|
150
|
+
box-shadow: 0 4px 10px 1px neutral-400;
|
|
151
|
+
margin-bottom: ${th.space("xxs")};
|
|
152
|
+
&--rtl {
|
|
153
|
+
direction: rtl;
|
|
154
|
+
}
|
|
155
|
+
&-body {
|
|
156
|
+
margin: 0;
|
|
157
|
+
flex: 1;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.Toastify__progress-bar {
|
|
162
|
+
position: absolute;
|
|
163
|
+
bottom: 0;
|
|
164
|
+
left: -5px;
|
|
165
|
+
width: 5px;
|
|
166
|
+
height: 0;
|
|
167
|
+
z-index: 9999;
|
|
168
|
+
opacity: 0.7;
|
|
169
|
+
animation: Toastify__trackProgress linear 1;
|
|
170
|
+
background-color: brand-200;
|
|
171
|
+
|
|
172
|
+
&--rtl {
|
|
173
|
+
right: 0;
|
|
174
|
+
left: initial;
|
|
175
|
+
}
|
|
176
|
+
&--default {
|
|
177
|
+
background-color: neutral-400;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
&--info {
|
|
181
|
+
background-color: brand-400;
|
|
182
|
+
}
|
|
183
|
+
&--success {
|
|
184
|
+
background-color: success-900;
|
|
185
|
+
}
|
|
186
|
+
&--warning {
|
|
187
|
+
background-color: warning-900;
|
|
188
|
+
}
|
|
189
|
+
&--error {
|
|
190
|
+
background-color: danger-900;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
@media only screen and (max-width: 480px) {
|
|
195
|
+
.Toastify__toast-container {
|
|
196
|
+
width: 100vw;
|
|
197
|
+
padding: 0;
|
|
198
|
+
left: 0;
|
|
199
|
+
margin: 0;
|
|
200
|
+
&--top-left,
|
|
201
|
+
&--top-center,
|
|
202
|
+
&--top-right {
|
|
203
|
+
top: 0;
|
|
204
|
+
}
|
|
205
|
+
&--bottom-left,
|
|
206
|
+
&--bottom-center,
|
|
207
|
+
&--bottom-right {
|
|
208
|
+
bottom: 0;
|
|
209
|
+
}
|
|
210
|
+
&--rtl {
|
|
211
|
+
right: 0;
|
|
212
|
+
left: initial;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.Toastify__toast {
|
|
217
|
+
margin-bottom: 0;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
@keyframes Toastify__trackProgress {
|
|
222
|
+
from {
|
|
223
|
+
height: 100%;
|
|
224
|
+
}
|
|
225
|
+
to {
|
|
226
|
+
height: 0;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
@keyframes Toastify__slideInRight {
|
|
231
|
+
from {
|
|
232
|
+
transform: translate3d(110%, 0, 0);
|
|
233
|
+
visibility: visible;
|
|
234
|
+
}
|
|
235
|
+
to {
|
|
236
|
+
transform: translate3d(0, 0, 0);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
@keyframes Toastify__slideInLeft {
|
|
241
|
+
from {
|
|
242
|
+
transform: translate3d(-110%, 0, 0);
|
|
243
|
+
visibility: visible;
|
|
244
|
+
}
|
|
245
|
+
to {
|
|
246
|
+
transform: translate3d(0, 0, 0);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
@keyframes Toastify__slideInUp {
|
|
251
|
+
from {
|
|
252
|
+
transform: translate3d(0, 110%, 0);
|
|
253
|
+
visibility: visible;
|
|
254
|
+
}
|
|
255
|
+
to {
|
|
256
|
+
transform: translate3d(0, 0, 0);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
@keyframes Toastify__slideInDown {
|
|
261
|
+
from {
|
|
262
|
+
transform: translate3d(0, -110%, 0);
|
|
263
|
+
visibility: visible;
|
|
264
|
+
}
|
|
265
|
+
to {
|
|
266
|
+
transform: translate3d(0, 0, 0);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
@keyframes Toastify__slideOutRight {
|
|
271
|
+
from {
|
|
272
|
+
transform: translate3d(0, 0, 0);
|
|
273
|
+
}
|
|
274
|
+
to {
|
|
275
|
+
visibility: hidden;
|
|
276
|
+
transform: translate3d(110%, 0, 0);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
@keyframes Toastify__slideOutLeft {
|
|
281
|
+
from {
|
|
282
|
+
transform: translate3d(0, 0, 0);
|
|
283
|
+
}
|
|
284
|
+
to {
|
|
285
|
+
visibility: hidden;
|
|
286
|
+
transform: translate3d(-110%, 0, 0);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
@keyframes Toastify__slideOutDown {
|
|
291
|
+
from {
|
|
292
|
+
transform: translate3d(0, 0, 0);
|
|
293
|
+
}
|
|
294
|
+
to {
|
|
295
|
+
visibility: hidden;
|
|
296
|
+
transform: translate3d(0, 500px, 0);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
@keyframes Toastify__slideOutUp {
|
|
301
|
+
from {
|
|
302
|
+
transform: translate3d(0, 0, 0);
|
|
303
|
+
}
|
|
304
|
+
to {
|
|
305
|
+
visibility: hidden;
|
|
306
|
+
transform: translate3d(0, -500px, 0);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.Toastify__slide-enter {
|
|
311
|
+
&--top-left,
|
|
312
|
+
&--bottom-left {
|
|
313
|
+
animation-name: Toastify__slideInLeft;
|
|
314
|
+
}
|
|
315
|
+
&--top-right,
|
|
316
|
+
&--bottom-right {
|
|
317
|
+
animation-name: Toastify__slideInRight;
|
|
318
|
+
}
|
|
319
|
+
&--top-center {
|
|
320
|
+
animation-name: Toastify__slideInDown;
|
|
321
|
+
}
|
|
322
|
+
&--bottom-center {
|
|
323
|
+
animation-name: Toastify__slideInUp;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.Toastify__slide-exit {
|
|
328
|
+
&--top-left,
|
|
329
|
+
&--bottom-left {
|
|
330
|
+
animation-name: Toastify__slideOutLeft;
|
|
331
|
+
}
|
|
332
|
+
&--top-right,
|
|
333
|
+
&--bottom-right {
|
|
334
|
+
animation-name: Toastify__slideOutRight;
|
|
335
|
+
}
|
|
336
|
+
&--top-center {
|
|
337
|
+
animation-name: Toastify__slideOutUp;
|
|
338
|
+
}
|
|
339
|
+
&--bottom-center {
|
|
340
|
+
animation-name: Toastify__slideOutDown;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
${xStyledCommonProps}
|
|
344
|
+
`;
|
|
345
|
+
export {
|
|
346
|
+
StyledAction,
|
|
347
|
+
StyledButton,
|
|
348
|
+
StyledContainer,
|
|
349
|
+
StyledIconContainer,
|
|
350
|
+
StyledLink,
|
|
351
|
+
StyledMessageContent,
|
|
352
|
+
StyledMessageHeader,
|
|
353
|
+
StyledMessageText,
|
|
354
|
+
ToastifyWrapper
|
|
355
|
+
};
|
|
356
|
+
//# sourceMappingURL=styled.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/styled.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport { DSButtonV2 } from '@elliemae/ds-legacy-button-v2';\nimport { styled, th, xStyledCommonProps } from '@elliemae/ds-legacy-system';\nimport {\n DSToastActionLinkName,\n DSToastActionName,\n DSToastActionSlots,\n DSToastActionLinkSlots,\n DSToastName,\n DSToastSlots,\n} from '../DSToastDefinitions.js';\n\nexport const StyledLink = styled('span', { name: DSToastActionLinkName, slot: DSToastActionLinkSlots.ROOT })`\n color: brand-600;\n ${xStyledCommonProps}\n`;\n\nexport const StyledContainer = styled('div', { name: DSToastName, slot: DSToastSlots.CONTAINER })`\n display: flex;\n padding: ${th.space('xxs')};\n padding-right: ${th.space('s')};\n`;\n\nexport const StyledIconContainer = styled('div', { name: DSToastName, slot: DSToastSlots.ICON_CONTAINER })`\n margin-top: ${th.space('xxxs')};\n margin-right: ${th.space('xxs')};\n`;\n\nexport const StyledMessageContent = styled('div', { name: DSToastName, slot: DSToastSlots.MESSAGE_CONTENT })`\n flex: 1;\n`;\n\nexport const StyledMessageHeader = styled('div', { name: DSToastName, slot: DSToastSlots.MESSAGE_HEADER })`\n margin-top: ${th.space('xxxs')};\n margin-bottom: ${th.space('xxs')};\n color: neutral-700;\n font-weight: 600;\n font-size: 1rem;\n`;\n\nexport const StyledMessageText = styled('span', { name: DSToastName, slot: DSToastSlots.MESSAGE_TEXT })`\n color: neutral-500;\n font-size: 1rem;\n`;\n\nexport const StyledAction = styled('div', { name: DSToastActionName, slot: DSToastActionSlots.ROOT })`\n position: relative;\n &:focus {\n &:after {\n position: absolute;\n content: '';\n border: 2px solid brand-700;\n top: -1px;\n left: -1px;\n width: calc(100% + 2px);\n height: calc(100% + 2px);\n }\n }\n &:focus-visible {\n outline: none;\n }\n ${xStyledCommonProps}\n`;\n\nexport const StyledButton = styled(DSButtonV2, { name: DSToastName, slot: DSToastSlots.CLOSE_BUTTON })`\n position: absolute;\n top: 4px;\n right: 4px;\n\n fill: ${th.color('neutral-300')};\n`;\n\nexport const ToastifyWrapper = styled('div', { name: DSToastName, slot: DSToastSlots.ROOT })`\n .Toastify__toast-container {\n z-index: 9999;\n position: fixed;\n width: 300px;\n box-sizing: border-box;\n color: #fff;\n &--top-left {\n top: 1em;\n left: 1em;\n }\n &--top-center {\n top: 1em;\n left: 50%;\n margin-left: -150px;\n }\n &--top-right {\n top: 1em;\n right: 1em;\n }\n &--bottom-left {\n bottom: 1em;\n left: 1em;\n }\n &--bottom-center {\n bottom: 1em;\n left: 50%;\n margin-left: -150px;\n }\n &--bottom-right {\n bottom: 1em;\n right: 1em;\n }\n\n &:not(.with-progressbar) {\n .Toastify__toast {\n &--default {\n border-color: neutral-400;\n }\n &--info {\n border-color: brand-400;\n }\n &--success {\n border-color: success-900;\n }\n &--warning {\n border-color: warning-900;\n }\n &--error {\n border-color: danger-900;\n }\n }\n }\n\n &.with-progressbar {\n .Toastify__toast {\n &--default {\n border-color: neutral-300;\n }\n &--info {\n border-color: brand-300;\n }\n &--success {\n border-color: success-300;\n }\n &--warning {\n border-color: warning-600;\n }\n &--error {\n border-color: danger-200;\n }\n }\n }\n }\n\n .Toastify__toast {\n position: relative;\n min-height: 76px;\n box-sizing: border-box;\n border-radius: 1px;\n display: flex;\n justify-content: space-between;\n cursor: pointer;\n direction: ltr;\n background-color: neutral-000;\n border-left: 5px solid;\n box-shadow: 0 4px 10px 1px neutral-400;\n margin-bottom: ${th.space('xxs')};\n &--rtl {\n direction: rtl;\n }\n &-body {\n margin: 0;\n flex: 1;\n }\n }\n\n .Toastify__progress-bar {\n position: absolute;\n bottom: 0;\n left: -5px;\n width: 5px;\n height: 0;\n z-index: 9999;\n opacity: 0.7;\n animation: Toastify__trackProgress linear 1;\n background-color: brand-200;\n\n &--rtl {\n right: 0;\n left: initial;\n }\n &--default {\n background-color: neutral-400;\n }\n\n &--info {\n background-color: brand-400;\n }\n &--success {\n background-color: success-900;\n }\n &--warning {\n background-color: warning-900;\n }\n &--error {\n background-color: danger-900;\n }\n }\n\n @media only screen and (max-width: 480px) {\n .Toastify__toast-container {\n width: 100vw;\n padding: 0;\n left: 0;\n margin: 0;\n &--top-left,\n &--top-center,\n &--top-right {\n top: 0;\n }\n &--bottom-left,\n &--bottom-center,\n &--bottom-right {\n bottom: 0;\n }\n &--rtl {\n right: 0;\n left: initial;\n }\n }\n\n .Toastify__toast {\n margin-bottom: 0;\n }\n }\n\n @keyframes Toastify__trackProgress {\n from {\n height: 100%;\n }\n to {\n height: 0;\n }\n }\n\n @keyframes Toastify__slideInRight {\n from {\n transform: translate3d(110%, 0, 0);\n visibility: visible;\n }\n to {\n transform: translate3d(0, 0, 0);\n }\n }\n\n @keyframes Toastify__slideInLeft {\n from {\n transform: translate3d(-110%, 0, 0);\n visibility: visible;\n }\n to {\n transform: translate3d(0, 0, 0);\n }\n }\n\n @keyframes Toastify__slideInUp {\n from {\n transform: translate3d(0, 110%, 0);\n visibility: visible;\n }\n to {\n transform: translate3d(0, 0, 0);\n }\n }\n\n @keyframes Toastify__slideInDown {\n from {\n transform: translate3d(0, -110%, 0);\n visibility: visible;\n }\n to {\n transform: translate3d(0, 0, 0);\n }\n }\n\n @keyframes Toastify__slideOutRight {\n from {\n transform: translate3d(0, 0, 0);\n }\n to {\n visibility: hidden;\n transform: translate3d(110%, 0, 0);\n }\n }\n\n @keyframes Toastify__slideOutLeft {\n from {\n transform: translate3d(0, 0, 0);\n }\n to {\n visibility: hidden;\n transform: translate3d(-110%, 0, 0);\n }\n }\n\n @keyframes Toastify__slideOutDown {\n from {\n transform: translate3d(0, 0, 0);\n }\n to {\n visibility: hidden;\n transform: translate3d(0, 500px, 0);\n }\n }\n\n @keyframes Toastify__slideOutUp {\n from {\n transform: translate3d(0, 0, 0);\n }\n to {\n visibility: hidden;\n transform: translate3d(0, -500px, 0);\n }\n }\n\n .Toastify__slide-enter {\n &--top-left,\n &--bottom-left {\n animation-name: Toastify__slideInLeft;\n }\n &--top-right,\n &--bottom-right {\n animation-name: Toastify__slideInRight;\n }\n &--top-center {\n animation-name: Toastify__slideInDown;\n }\n &--bottom-center {\n animation-name: Toastify__slideInUp;\n }\n }\n\n .Toastify__slide-exit {\n &--top-left,\n &--bottom-left {\n animation-name: Toastify__slideOutLeft;\n }\n &--top-right,\n &--bottom-right {\n animation-name: Toastify__slideOutRight;\n }\n &--top-center {\n animation-name: Toastify__slideOutUp;\n }\n &--bottom-center {\n animation-name: Toastify__slideOutDown;\n }\n }\n ${xStyledCommonProps}\n`;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,kBAAkB;AAC3B,SAAS,QAAQ,IAAI,0BAA0B;AAC/C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEA,MAAM,aAAa,OAAO,QAAQ,EAAE,MAAM,uBAAuB,MAAM,uBAAuB,KAAK,CAAC;AAAA;AAAA,IAEvG;AAAA;AAGG,MAAM,kBAAkB,OAAO,OAAO,EAAE,MAAM,aAAa,MAAM,aAAa,UAAU,CAAC;AAAA;AAAA,aAEnF,GAAG,MAAM,KAAK;AAAA,mBACR,GAAG,MAAM,GAAG;AAAA;AAGxB,MAAM,sBAAsB,OAAO,OAAO,EAAE,MAAM,aAAa,MAAM,aAAa,eAAe,CAAC;AAAA,gBACzF,GAAG,MAAM,MAAM;AAAA,kBACb,GAAG,MAAM,KAAK;AAAA;AAGzB,MAAM,uBAAuB,OAAO,OAAO,EAAE,MAAM,aAAa,MAAM,aAAa,gBAAgB,CAAC;AAAA;AAAA;AAIpG,MAAM,sBAAsB,OAAO,OAAO,EAAE,MAAM,aAAa,MAAM,aAAa,eAAe,CAAC;AAAA,gBACzF,GAAG,MAAM,MAAM;AAAA,mBACZ,GAAG,MAAM,KAAK;AAAA;AAAA;AAAA;AAAA;AAM1B,MAAM,oBAAoB,OAAO,QAAQ,EAAE,MAAM,aAAa,MAAM,aAAa,aAAa,CAAC;AAAA;AAAA;AAAA;AAK/F,MAAM,eAAe,OAAO,OAAO,EAAE,MAAM,mBAAmB,MAAM,mBAAmB,KAAK,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAgBhG;AAAA;AAGG,MAAM,eAAe,OAAO,YAAY,EAAE,MAAM,aAAa,MAAM,aAAa,aAAa,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,UAK3F,GAAG,MAAM,aAAa;AAAA;AAGzB,MAAM,kBAAkB,OAAO,OAAO,EAAE,MAAM,aAAa,MAAM,aAAa,KAAK,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAuFtE,GAAG,MAAM,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAgM/B;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { PropTypes } from "@elliemae/ds-legacy-props-helpers";
|
|
3
|
+
import { toastsPositions } from "./constants.js";
|
|
4
|
+
const defaultProps = {
|
|
5
|
+
containerProps: {},
|
|
6
|
+
position: "bottom-left",
|
|
7
|
+
autoClose: 5e3,
|
|
8
|
+
showProgressBar: false,
|
|
9
|
+
closeOnClick: false,
|
|
10
|
+
enableMultiContainer: false
|
|
11
|
+
};
|
|
12
|
+
const actionDefaultProps = {};
|
|
13
|
+
const DSToastPropTypes = {
|
|
14
|
+
/** inject props to wrapper */
|
|
15
|
+
containerProps: PropTypes.object.description("inject props to wrapper").defaultValue({}),
|
|
16
|
+
/** Position on the screen to show the toast */
|
|
17
|
+
position: PropTypes.oneOf(toastsPositions).description("Position on the screen to show the toast").defaultValue("bottom-left"),
|
|
18
|
+
/** ms to autoclose the toast */
|
|
19
|
+
autoClose: PropTypes.oneOfType([PropTypes.number, PropTypes.oneOf([false])]).description("ms to autoclose the toast, false if you don't want to automatically close").defaultValue(5e3),
|
|
20
|
+
/** Whether to show a progress bar indicating when the toast is going to be closed */
|
|
21
|
+
showProgressBar: PropTypes.bool.description("Whether to show a progress bar indicating when the toast is going to be closed").defaultValue(false),
|
|
22
|
+
/** Close toast handler */
|
|
23
|
+
closeOnClick: PropTypes.bool.description("Close toast handler").defaultValue(false),
|
|
24
|
+
/** Allows instantiating multiple Toast containers */
|
|
25
|
+
enableMultiContainer: PropTypes.bool.description("Allows instantiating multiple Toast containers").defaultValue(false),
|
|
26
|
+
/** unique id for multi container */
|
|
27
|
+
containerId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description("unique id for multi container")
|
|
28
|
+
};
|
|
29
|
+
const DSToastActionLinkPropTypes = {
|
|
30
|
+
/** link text */
|
|
31
|
+
children: PropTypes.node.isRequired.description("link text")
|
|
32
|
+
};
|
|
33
|
+
const DSToastActionPropsTypes = {
|
|
34
|
+
/** DSToastActionLink component or text string */
|
|
35
|
+
children: PropTypes.node.description("DSToastActionLink component or text string"),
|
|
36
|
+
/** click handler */
|
|
37
|
+
onClick: PropTypes.func.description("click handler"),
|
|
38
|
+
/** key down handler */
|
|
39
|
+
onKeyDown: PropTypes.func.description("key down handler")
|
|
40
|
+
};
|
|
41
|
+
export {
|
|
42
|
+
DSToastActionLinkPropTypes,
|
|
43
|
+
DSToastActionPropsTypes,
|
|
44
|
+
DSToastPropTypes,
|
|
45
|
+
actionDefaultProps,
|
|
46
|
+
defaultProps
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type React from 'react';\nimport type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-legacy-props-helpers';\nimport { PropTypes } from '@elliemae/ds-legacy-props-helpers';\nimport type { WeakValidationMap } from 'react';\nimport { toastsPositions } from './constants.js';\nimport type { toastTypes } from './constants.js';\n\nexport declare namespace DSToastT {\n type PropsT<D, R, O, E> = Partial<D> &\n R &\n O &\n Omit<GlobalAttributesT<E>, keyof D | keyof R | keyof O> &\n Omit<XstyledProps, keyof D | keyof R | keyof O>;\n type InternalPropsT<D, R, O, E> = D &\n R &\n O &\n Omit<GlobalAttributesT<E>, keyof D | keyof R | keyof O> &\n Omit<XstyledProps, keyof D | keyof R | keyof O>;\n\n export type ToastPositions = (typeof toastsPositions)[number];\n\n export type ToastTypes = (typeof toastTypes)[number];\n\n export interface DefaultProps {\n containerProps: Record<string, unknown>;\n position: ToastPositions;\n autoClose: number;\n showProgressBar: boolean;\n closeOnClick: boolean;\n enableMultiContainer: boolean;\n }\n\n export interface OptionalProps {\n containerId?: string | number;\n closeButtonRef?: React.MutableRefObject<HTMLButtonElement | null>;\n }\n\n export interface RequiredProps {}\n\n export type Props = PropsT<DefaultProps, RequiredProps, OptionalProps, HTMLDivElement>;\n\n export type InternalProps = InternalPropsT<DefaultProps, RequiredProps, OptionalProps, HTMLDivElement>;\n\n export interface ActionDefaultProps {}\n\n export interface ActionOptionalProps {\n onClick?: React.MouseEventHandler;\n onKeyDown?: React.KeyboardEventHandler;\n }\n\n export interface ActionRequiredProps {\n children: React.ReactNode;\n }\n\n export type ActionProps = PropsT<ActionDefaultProps, ActionRequiredProps, ActionOptionalProps, HTMLDivElement>;\n\n export type ActionInternalProps = InternalPropsT<\n ActionDefaultProps,\n ActionRequiredProps,\n ActionOptionalProps,\n HTMLDivElement\n >;\n}\n\nexport const defaultProps: DSToastT.DefaultProps = {\n containerProps: {},\n position: 'bottom-left',\n autoClose: 5000,\n showProgressBar: false,\n closeOnClick: false,\n enableMultiContainer: false,\n};\n\nexport const actionDefaultProps: DSToastT.ActionDefaultProps = {};\n\n// =============================================================================\n// PropTypes\n// =============================================================================\nexport const DSToastPropTypes = {\n /** inject props to wrapper */\n containerProps: PropTypes.object.description('inject props to wrapper').defaultValue({}),\n /** Position on the screen to show the toast */\n position: PropTypes.oneOf(toastsPositions as unknown as string[])\n .description('Position on the screen to show the toast')\n .defaultValue('bottom-left'),\n /** ms to autoclose the toast */\n autoClose: PropTypes.oneOfType([PropTypes.number, PropTypes.oneOf([false])])\n .description(\"ms to autoclose the toast, false if you don't want to automatically close\")\n .defaultValue(5000),\n /** Whether to show a progress bar indicating when the toast is going to be closed */\n showProgressBar: PropTypes.bool\n .description('Whether to show a progress bar indicating when the toast is going to be closed')\n .defaultValue(false),\n /** Close toast handler */\n closeOnClick: PropTypes.bool.description('Close toast handler').defaultValue(false),\n /** Allows instantiating multiple Toast containers */\n enableMultiContainer: PropTypes.bool\n .description('Allows instantiating multiple Toast containers')\n .defaultValue(false),\n /** unique id for multi container */\n containerId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('unique id for multi container'),\n} as WeakValidationMap<unknown>;\n\nexport const DSToastActionLinkPropTypes = {\n /** link text */\n children: PropTypes.node.isRequired.description('link text'),\n} as React.WeakValidationMap<unknown>;\n\nexport const DSToastActionPropsTypes = {\n /** DSToastActionLink component or text string */\n children: PropTypes.node.description('DSToastActionLink component or text string'),\n /** click handler */\n onClick: PropTypes.func.description('click handler'),\n /** key down handler */\n onKeyDown: PropTypes.func.description('key down handler'),\n} as React.WeakValidationMap<unknown>;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,iBAAiB;AAE1B,SAAS,uBAAuB;AA4DzB,MAAM,eAAsC;AAAA,EACjD,gBAAgB,CAAC;AAAA,EACjB,UAAU;AAAA,EACV,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,sBAAsB;AACxB;AAEO,MAAM,qBAAkD,CAAC;AAKzD,MAAM,mBAAmB;AAAA;AAAA,EAE9B,gBAAgB,UAAU,OAAO,YAAY,yBAAyB,EAAE,aAAa,CAAC,CAAC;AAAA;AAAA,EAEvF,UAAU,UAAU,MAAM,eAAsC,EAC7D,YAAY,0CAA0C,EACtD,aAAa,aAAa;AAAA;AAAA,EAE7B,WAAW,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EACxE,YAAY,2EAA2E,EACvF,aAAa,GAAI;AAAA;AAAA,EAEpB,iBAAiB,UAAU,KACxB,YAAY,gFAAgF,EAC5F,aAAa,KAAK;AAAA;AAAA,EAErB,cAAc,UAAU,KAAK,YAAY,qBAAqB,EAAE,aAAa,KAAK;AAAA;AAAA,EAElF,sBAAsB,UAAU,KAC7B,YAAY,gDAAgD,EAC5D,aAAa,KAAK;AAAA;AAAA,EAErB,aAAa,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,EAAE,YAAY,+BAA+B;AACpH;AAEO,MAAM,6BAA6B;AAAA;AAAA,EAExC,UAAU,UAAU,KAAK,WAAW,YAAY,WAAW;AAC7D;AAEO,MAAM,0BAA0B;AAAA;AAAA,EAErC,UAAU,UAAU,KAAK,YAAY,4CAA4C;AAAA;AAAA,EAEjF,SAAS,UAAU,KAAK,YAAY,eAAe;AAAA;AAAA,EAEnD,WAAW,UAAU,KAAK,YAAY,kBAAkB;AAC1D;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { toast as toastifyToast } from "react-toastify";
|
|
4
|
+
import { DSToastContent } from "./parts/DSToastContent.js";
|
|
5
|
+
const toast = Object.assign(
|
|
6
|
+
({ type, messageTitle, messageText, ...rest }, options) => toastifyToast(/* @__PURE__ */ jsx(DSToastContent, { messageText, messageTitle, type }), {
|
|
7
|
+
...rest,
|
|
8
|
+
...options,
|
|
9
|
+
type
|
|
10
|
+
}),
|
|
11
|
+
{ ...toastifyToast, isActive: (id) => toastifyToast.isActive(id) }
|
|
12
|
+
);
|
|
13
|
+
export {
|
|
14
|
+
toast
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=toast.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/toast.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport type { ToastOptions } from 'react-toastify';\nimport { toast as toastifyToast } from 'react-toastify';\nimport type { DSToastContentProps } from './parts/DSToastContent.js';\nimport { DSToastContent } from './parts/DSToastContent.js';\n\nconst toast = Object.assign(\n ({ type, messageTitle, messageText, ...rest }: DSToastContentProps, options: ToastOptions) =>\n toastifyToast(<DSToastContent messageText={messageText} messageTitle={messageTitle} type={type} />, {\n ...rest,\n ...options,\n type,\n }),\n { ...toastifyToast, isActive: (id: string | number) => toastifyToast.isActive(id) },\n);\n\nexport { toast };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACQL;AANlB,SAAS,SAAS,qBAAqB;AAEvC,SAAS,sBAAsB;AAE/B,MAAM,QAAQ,OAAO;AAAA,EACnB,CAAC,EAAE,MAAM,cAAc,aAAa,GAAG,KAAK,GAAwB,YAClE,cAAc,oBAAC,kBAAe,aAA0B,cAA4B,MAAY,GAAI;AAAA,IAClG,GAAG;AAAA,IACH,GAAG;AAAA,IACH;AAAA,EACF,CAAC;AAAA,EACH,EAAE,GAAG,eAAe,UAAU,CAAC,OAAwB,cAAc,SAAS,EAAE,EAAE;AACpF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const DSToastName = "DSToast";
|
|
2
|
+
export declare const DSToastActionLinkName = "DSToastActionLink";
|
|
3
|
+
export declare const DSToastActionName = "DSToastAction";
|
|
4
|
+
export declare const DSToastSlots: {
|
|
5
|
+
ROOT: string;
|
|
6
|
+
CLOSE_BUTTON: string;
|
|
7
|
+
CONTAINER: string;
|
|
8
|
+
ICON_CONTAINER: string;
|
|
9
|
+
MESSAGE_CONTENT: string;
|
|
10
|
+
MESSAGE_HEADER: string;
|
|
11
|
+
MESSAGE_TEXT: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const DSToastActionSlots: {
|
|
14
|
+
ROOT: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const DSToastActionLinkSlots: {
|
|
17
|
+
ROOT: string;
|
|
18
|
+
};
|
|
19
|
+
export declare const DSToastDataTestIds: {
|
|
20
|
+
CONTAINER: string;
|
|
21
|
+
};
|
|
22
|
+
export declare const DSToastActionDataTestIds: Record<string, string>;
|
|
23
|
+
export declare const DSToastActionLinkDataTestIds: Record<string, string>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { DSToastT } from '../react-desc-prop-types.js';
|
|
3
|
+
export declare const useToast: (props: DSToastT.Props) => {
|
|
4
|
+
propsWithDefault: DSToastT.InternalProps;
|
|
5
|
+
toastifyWrapperRef: import("react").MutableRefObject<HTMLDivElement | null>;
|
|
6
|
+
onKeyDown: (event: React.KeyboardEvent<HTMLDivElement>) => void;
|
|
7
|
+
globalAttributes: import("@elliemae/ds-legacy-props-helpers").GlobalAttributesT<Element>;
|
|
8
|
+
xstyledAttributes: import("@elliemae/ds-legacy-props-helpers").XstyledProps;
|
|
9
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare const ToastPosition: {
|
|
2
|
+
readonly TOP_RIGHT: "top-right";
|
|
3
|
+
readonly TOP_CENTER: "top-center";
|
|
4
|
+
readonly TOP_LEFT: "top-left";
|
|
5
|
+
readonly BOTTOM_RIGHT: "bottom-right";
|
|
6
|
+
readonly BOTTOM_CENTER: "bottom-center";
|
|
7
|
+
readonly BOTTOM_LEFT: "bottom-left";
|
|
8
|
+
};
|
|
9
|
+
export declare const toastsPositions: readonly ["top-right", "top-center", "top-left", "bottom-right", "bottom-center", "bottom-left"];
|
|
10
|
+
export declare const ToastType: {
|
|
11
|
+
readonly INFO: "info";
|
|
12
|
+
readonly SUCCESS: "success";
|
|
13
|
+
readonly WARNING: "warning";
|
|
14
|
+
readonly ERROR: "error";
|
|
15
|
+
readonly DEFAULT: "default";
|
|
16
|
+
};
|
|
17
|
+
export declare const toastTypes: readonly ["info", "success", "warning", "error", "default"];
|
|
18
|
+
export declare const TYPE_TO_ICON: {
|
|
19
|
+
readonly success: (props: import("@elliemae/ds-legacy-icons").SvgIconT.Props) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
readonly warning: (props: import("@elliemae/ds-legacy-icons").SvgIconT.Props) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
readonly info: (rest: import("@elliemae/ds-legacy-icons").SvgIconT.Props) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
readonly error: (props: import("@elliemae/ds-legacy-icons").SvgIconT.Props) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
readonly default: () => null;
|
|
24
|
+
};
|
|
25
|
+
export declare const TYPE_TO_ICON_COLOR: {
|
|
26
|
+
readonly success: readonly ["success", "900"];
|
|
27
|
+
readonly warning: readonly ["warning", "900"];
|
|
28
|
+
readonly info: readonly ["brand-primary", "400"];
|
|
29
|
+
readonly error: readonly ["danger", "900"];
|
|
30
|
+
readonly default: readonly ["neutral", "400"];
|
|
31
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { DSToast, DSToastWithSchema } from './parts/DSToast.js';
|
|
2
|
+
export { toast } from './toast.js';
|
|
3
|
+
export { ToastType, toastTypes, ToastPosition, toastsPositions } from './constants.js';
|
|
4
|
+
export { DSToastAction, DSToastActionWithSchema } from './parts/DSToastAction.js';
|
|
5
|
+
export { DSToastActionLink, DSToastActionLinkWithSchema } from './parts/DSToastActionLink.js';
|
|
6
|
+
export { DSToastName, DSToastActionName, DSToastActionLinkName, DSToastSlots, DSToastActionSlots, DSToastActionLinkSlots, DSToastDataTestIds, DSToastActionDataTestIds, DSToastActionLinkDataTestIds, } from './DSToastDefinitions.js';
|
|
7
|
+
export { default } from './parts/DSToast.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DSToastT } from '../react-desc-prop-types.js';
|
|
2
|
+
interface CloseButtonProps {
|
|
3
|
+
closeToast: () => void;
|
|
4
|
+
}
|
|
5
|
+
export declare const CloseButton: ({ closeButtonRef }: {
|
|
6
|
+
closeButtonRef: DSToastT.Props['closeButtonRef'];
|
|
7
|
+
}) => ({ closeToast }: CloseButtonProps) => import("react/jsx-runtime.js").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { DSToastT } from '../react-desc-prop-types.js';
|
|
3
|
+
declare const DSToast: React.ComponentType<DSToastT.Props>;
|
|
4
|
+
declare const DSToastWithSchema: import("@elliemae/ds-legacy-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<DSToastT.Props>;
|
|
5
|
+
export { DSToast, DSToastWithSchema };
|
|
6
|
+
export default DSToast;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { DSToastT } from '../react-desc-prop-types.js';
|
|
3
|
+
declare const DSToastAction: React.ComponentType<DSToastT.ActionProps>;
|
|
4
|
+
declare const DSToastActionWithSchema: import("@elliemae/ds-legacy-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<DSToastT.ActionProps>;
|
|
5
|
+
export { DSToastAction, DSToastActionWithSchema };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { SvgIconT } from '@elliemae/ds-legacy-icons';
|
|
3
|
+
import type { DSToastT } from '../react-desc-prop-types.js';
|
|
4
|
+
export declare const getIconByToastType: (type: DSToastT.ToastTypes) => ((props: SvgIconT.Props) => import("react/jsx-runtime.js").JSX.Element) | ((props: SvgIconT.Props) => import("react/jsx-runtime.js").JSX.Element) | ((rest: SvgIconT.Props) => import("react/jsx-runtime.js").JSX.Element) | ((props: SvgIconT.Props) => import("react/jsx-runtime.js").JSX.Element) | (() => null);
|
|
5
|
+
export declare const getIconColorByToastType: (type: DSToastT.ToastTypes) => SvgIconT.ColorType;
|
|
6
|
+
export interface DSToastContentProps {
|
|
7
|
+
type?: DSToastT.ToastTypes;
|
|
8
|
+
messageTitle?: string;
|
|
9
|
+
messageText?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const DSToastContent: React.ComponentType<DSToastContentProps>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-legacy-props-helpers';
|
|
3
|
+
import { toastsPositions } from './constants.js';
|
|
4
|
+
import type { toastTypes } from './constants.js';
|
|
5
|
+
export declare namespace DSToastT {
|
|
6
|
+
type PropsT<D, R, O, E> = Partial<D> & R & O & Omit<GlobalAttributesT<E>, keyof D | keyof R | keyof O> & Omit<XstyledProps, keyof D | keyof R | keyof O>;
|
|
7
|
+
type InternalPropsT<D, R, O, E> = D & R & O & Omit<GlobalAttributesT<E>, keyof D | keyof R | keyof O> & Omit<XstyledProps, keyof D | keyof R | keyof O>;
|
|
8
|
+
type ToastPositions = (typeof toastsPositions)[number];
|
|
9
|
+
type ToastTypes = (typeof toastTypes)[number];
|
|
10
|
+
interface DefaultProps {
|
|
11
|
+
containerProps: Record<string, unknown>;
|
|
12
|
+
position: ToastPositions;
|
|
13
|
+
autoClose: number;
|
|
14
|
+
showProgressBar: boolean;
|
|
15
|
+
closeOnClick: boolean;
|
|
16
|
+
enableMultiContainer: boolean;
|
|
17
|
+
}
|
|
18
|
+
interface OptionalProps {
|
|
19
|
+
containerId?: string | number;
|
|
20
|
+
closeButtonRef?: React.MutableRefObject<HTMLButtonElement | null>;
|
|
21
|
+
}
|
|
22
|
+
interface RequiredProps {
|
|
23
|
+
}
|
|
24
|
+
type Props = PropsT<DefaultProps, RequiredProps, OptionalProps, HTMLDivElement>;
|
|
25
|
+
type InternalProps = InternalPropsT<DefaultProps, RequiredProps, OptionalProps, HTMLDivElement>;
|
|
26
|
+
interface ActionDefaultProps {
|
|
27
|
+
}
|
|
28
|
+
interface ActionOptionalProps {
|
|
29
|
+
onClick?: React.MouseEventHandler;
|
|
30
|
+
onKeyDown?: React.KeyboardEventHandler;
|
|
31
|
+
}
|
|
32
|
+
interface ActionRequiredProps {
|
|
33
|
+
children: React.ReactNode;
|
|
34
|
+
}
|
|
35
|
+
type ActionProps = PropsT<ActionDefaultProps, ActionRequiredProps, ActionOptionalProps, HTMLDivElement>;
|
|
36
|
+
type ActionInternalProps = InternalPropsT<ActionDefaultProps, ActionRequiredProps, ActionOptionalProps, HTMLDivElement>;
|
|
37
|
+
}
|
|
38
|
+
export declare const defaultProps: DSToastT.DefaultProps;
|
|
39
|
+
export declare const actionDefaultProps: DSToastT.ActionDefaultProps;
|
|
40
|
+
export declare const DSToastPropTypes: React.WeakValidationMap<unknown>;
|
|
41
|
+
export declare const DSToastActionLinkPropTypes: React.WeakValidationMap<unknown>;
|
|
42
|
+
export declare const DSToastActionPropsTypes: React.WeakValidationMap<unknown>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|