@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,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var DSToastContent_exports = {};
|
|
30
|
+
__export(DSToastContent_exports, {
|
|
31
|
+
DSToastContent: () => DSToastContent,
|
|
32
|
+
getIconByToastType: () => getIconByToastType,
|
|
33
|
+
getIconColorByToastType: () => getIconColorByToastType
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(DSToastContent_exports);
|
|
36
|
+
var React = __toESM(require("react"));
|
|
37
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
38
|
+
var import_styled = require("./styled.js");
|
|
39
|
+
var import_constants = require("../constants.js");
|
|
40
|
+
const getIconByToastType = (type) => import_constants.TYPE_TO_ICON[type];
|
|
41
|
+
const getIconColorByToastType = (type) => import_constants.TYPE_TO_ICON_COLOR[type];
|
|
42
|
+
const DSToastContent = ({
|
|
43
|
+
type = import_constants.ToastType.DEFAULT,
|
|
44
|
+
messageTitle = "",
|
|
45
|
+
messageText = ""
|
|
46
|
+
}) => {
|
|
47
|
+
const IconMessage = getIconByToastType(type);
|
|
48
|
+
const iconColor = getIconColorByToastType(type);
|
|
49
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.StyledContainer, { "data-testid": "ds-toast-render", className: "em-ds-toast-content", children: [
|
|
50
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledIconContainer, { className: "em-ds-toast-content__icon-container", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IconMessage, { size: "m", className: "em-ds-toast-content__icon-message", color: iconColor }) }),
|
|
51
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.StyledMessageContent, { className: "em-ds-toast-content__message-content", children: [
|
|
52
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledMessageHeader, { className: "em-ds-toast-content__message-header", children: messageTitle }),
|
|
53
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledMessageText, { className: "em-ds-toast-content__message-text", children: messageText })
|
|
54
|
+
] })
|
|
55
|
+
] });
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=DSToastContent.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/parts/DSToastContent.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport type { SvgIconT } from '@elliemae/ds-legacy-icons';\nimport type { DSToastT } from '../react-desc-prop-types.js';\nimport {\n StyledContainer,\n StyledIconContainer,\n StyledMessageContent,\n StyledMessageHeader,\n StyledMessageText,\n} from './styled.js';\nimport { ToastType, TYPE_TO_ICON, TYPE_TO_ICON_COLOR } from '../constants.js';\n\nexport const getIconByToastType = (type: DSToastT.ToastTypes) => TYPE_TO_ICON[type];\nexport const getIconColorByToastType = (type: DSToastT.ToastTypes): SvgIconT.ColorType =>\n TYPE_TO_ICON_COLOR[type] as SvgIconT.ColorType;\n\nexport interface DSToastContentProps {\n type?: DSToastT.ToastTypes;\n messageTitle?: string;\n messageText?: string;\n}\n\nexport const DSToastContent: React.ComponentType<DSToastContentProps> = ({\n type = ToastType.DEFAULT,\n messageTitle = '',\n messageText = '',\n}) => {\n const IconMessage = getIconByToastType(type);\n const iconColor = getIconColorByToastType(type);\n\n return (\n <StyledContainer data-testid=\"ds-toast-render\" className=\"em-ds-toast-content\">\n <StyledIconContainer className=\"em-ds-toast-content__icon-container\">\n <IconMessage size=\"m\" className=\"em-ds-toast-content__icon-message\" color={iconColor} />\n </StyledIconContainer>\n <StyledMessageContent className=\"em-ds-toast-content__message-content\">\n <StyledMessageHeader className=\"em-ds-toast-content__message-header\">{messageTitle}</StyledMessageHeader>\n <StyledMessageText className=\"em-ds-toast-content__message-text\">{messageText}</StyledMessageText>\n </StyledMessageContent>\n </StyledContainer>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADiCf;AA9BR,oBAMO;AACP,uBAA4D;AAErD,MAAM,qBAAqB,CAAC,SAA8B,8BAAa,IAAI;AAC3E,MAAM,0BAA0B,CAAC,SACtC,oCAAmB,IAAI;AAQlB,MAAM,iBAA2D,CAAC;AAAA,EACvE,OAAO,2BAAU;AAAA,EACjB,eAAe;AAAA,EACf,cAAc;AAChB,MAAM;AACJ,QAAM,cAAc,mBAAmB,IAAI;AAC3C,QAAM,YAAY,wBAAwB,IAAI;AAE9C,SACE,6CAAC,iCAAgB,eAAY,mBAAkB,WAAU,uBACvD;AAAA,gDAAC,qCAAoB,WAAU,uCAC7B,sDAAC,eAAY,MAAK,KAAI,WAAU,qCAAoC,OAAO,WAAW,GACxF;AAAA,IACA,6CAAC,sCAAqB,WAAU,wCAC9B;AAAA,kDAAC,qCAAoB,WAAU,uCAAuC,wBAAa;AAAA,MACnF,4CAAC,mCAAkB,WAAU,qCAAqC,uBAAY;AAAA,OAChF;AAAA,KACF;AAEJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var styled_exports = {};
|
|
30
|
+
__export(styled_exports, {
|
|
31
|
+
StyledAction: () => StyledAction,
|
|
32
|
+
StyledButton: () => StyledButton,
|
|
33
|
+
StyledContainer: () => StyledContainer,
|
|
34
|
+
StyledIconContainer: () => StyledIconContainer,
|
|
35
|
+
StyledLink: () => StyledLink,
|
|
36
|
+
StyledMessageContent: () => StyledMessageContent,
|
|
37
|
+
StyledMessageHeader: () => StyledMessageHeader,
|
|
38
|
+
StyledMessageText: () => StyledMessageText,
|
|
39
|
+
ToastifyWrapper: () => ToastifyWrapper
|
|
40
|
+
});
|
|
41
|
+
module.exports = __toCommonJS(styled_exports);
|
|
42
|
+
var React = __toESM(require("react"));
|
|
43
|
+
var import_ds_legacy_button_v2 = require("@elliemae/ds-legacy-button-v2");
|
|
44
|
+
var import_ds_legacy_system = require("@elliemae/ds-legacy-system");
|
|
45
|
+
var import_DSToastDefinitions = require("../DSToastDefinitions.js");
|
|
46
|
+
const StyledLink = (0, import_ds_legacy_system.styled)("span", { name: import_DSToastDefinitions.DSToastActionLinkName, slot: import_DSToastDefinitions.DSToastActionLinkSlots.ROOT })`
|
|
47
|
+
color: brand-600;
|
|
48
|
+
${import_ds_legacy_system.xStyledCommonProps}
|
|
49
|
+
`;
|
|
50
|
+
const StyledContainer = (0, import_ds_legacy_system.styled)("div", { name: import_DSToastDefinitions.DSToastName, slot: import_DSToastDefinitions.DSToastSlots.CONTAINER })`
|
|
51
|
+
display: flex;
|
|
52
|
+
padding: ${import_ds_legacy_system.th.space("xxs")};
|
|
53
|
+
padding-right: ${import_ds_legacy_system.th.space("s")};
|
|
54
|
+
`;
|
|
55
|
+
const StyledIconContainer = (0, import_ds_legacy_system.styled)("div", { name: import_DSToastDefinitions.DSToastName, slot: import_DSToastDefinitions.DSToastSlots.ICON_CONTAINER })`
|
|
56
|
+
margin-top: ${import_ds_legacy_system.th.space("xxxs")};
|
|
57
|
+
margin-right: ${import_ds_legacy_system.th.space("xxs")};
|
|
58
|
+
`;
|
|
59
|
+
const StyledMessageContent = (0, import_ds_legacy_system.styled)("div", { name: import_DSToastDefinitions.DSToastName, slot: import_DSToastDefinitions.DSToastSlots.MESSAGE_CONTENT })`
|
|
60
|
+
flex: 1;
|
|
61
|
+
`;
|
|
62
|
+
const StyledMessageHeader = (0, import_ds_legacy_system.styled)("div", { name: import_DSToastDefinitions.DSToastName, slot: import_DSToastDefinitions.DSToastSlots.MESSAGE_HEADER })`
|
|
63
|
+
margin-top: ${import_ds_legacy_system.th.space("xxxs")};
|
|
64
|
+
margin-bottom: ${import_ds_legacy_system.th.space("xxs")};
|
|
65
|
+
color: neutral-700;
|
|
66
|
+
font-weight: 600;
|
|
67
|
+
font-size: 1rem;
|
|
68
|
+
`;
|
|
69
|
+
const StyledMessageText = (0, import_ds_legacy_system.styled)("span", { name: import_DSToastDefinitions.DSToastName, slot: import_DSToastDefinitions.DSToastSlots.MESSAGE_TEXT })`
|
|
70
|
+
color: neutral-500;
|
|
71
|
+
font-size: 1rem;
|
|
72
|
+
`;
|
|
73
|
+
const StyledAction = (0, import_ds_legacy_system.styled)("div", { name: import_DSToastDefinitions.DSToastActionName, slot: import_DSToastDefinitions.DSToastActionSlots.ROOT })`
|
|
74
|
+
position: relative;
|
|
75
|
+
&:focus {
|
|
76
|
+
&:after {
|
|
77
|
+
position: absolute;
|
|
78
|
+
content: '';
|
|
79
|
+
border: 2px solid brand-700;
|
|
80
|
+
top: -1px;
|
|
81
|
+
left: -1px;
|
|
82
|
+
width: calc(100% + 2px);
|
|
83
|
+
height: calc(100% + 2px);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
&:focus-visible {
|
|
87
|
+
outline: none;
|
|
88
|
+
}
|
|
89
|
+
${import_ds_legacy_system.xStyledCommonProps}
|
|
90
|
+
`;
|
|
91
|
+
const StyledButton = (0, import_ds_legacy_system.styled)(import_ds_legacy_button_v2.DSButtonV2, { name: import_DSToastDefinitions.DSToastName, slot: import_DSToastDefinitions.DSToastSlots.CLOSE_BUTTON })`
|
|
92
|
+
position: absolute;
|
|
93
|
+
top: 4px;
|
|
94
|
+
right: 4px;
|
|
95
|
+
|
|
96
|
+
fill: ${import_ds_legacy_system.th.color("neutral-300")};
|
|
97
|
+
`;
|
|
98
|
+
const ToastifyWrapper = (0, import_ds_legacy_system.styled)("div", { name: import_DSToastDefinitions.DSToastName, slot: import_DSToastDefinitions.DSToastSlots.ROOT })`
|
|
99
|
+
.Toastify__toast-container {
|
|
100
|
+
z-index: 9999;
|
|
101
|
+
position: fixed;
|
|
102
|
+
width: 300px;
|
|
103
|
+
box-sizing: border-box;
|
|
104
|
+
color: #fff;
|
|
105
|
+
&--top-left {
|
|
106
|
+
top: 1em;
|
|
107
|
+
left: 1em;
|
|
108
|
+
}
|
|
109
|
+
&--top-center {
|
|
110
|
+
top: 1em;
|
|
111
|
+
left: 50%;
|
|
112
|
+
margin-left: -150px;
|
|
113
|
+
}
|
|
114
|
+
&--top-right {
|
|
115
|
+
top: 1em;
|
|
116
|
+
right: 1em;
|
|
117
|
+
}
|
|
118
|
+
&--bottom-left {
|
|
119
|
+
bottom: 1em;
|
|
120
|
+
left: 1em;
|
|
121
|
+
}
|
|
122
|
+
&--bottom-center {
|
|
123
|
+
bottom: 1em;
|
|
124
|
+
left: 50%;
|
|
125
|
+
margin-left: -150px;
|
|
126
|
+
}
|
|
127
|
+
&--bottom-right {
|
|
128
|
+
bottom: 1em;
|
|
129
|
+
right: 1em;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&:not(.with-progressbar) {
|
|
133
|
+
.Toastify__toast {
|
|
134
|
+
&--default {
|
|
135
|
+
border-color: neutral-400;
|
|
136
|
+
}
|
|
137
|
+
&--info {
|
|
138
|
+
border-color: brand-400;
|
|
139
|
+
}
|
|
140
|
+
&--success {
|
|
141
|
+
border-color: success-900;
|
|
142
|
+
}
|
|
143
|
+
&--warning {
|
|
144
|
+
border-color: warning-900;
|
|
145
|
+
}
|
|
146
|
+
&--error {
|
|
147
|
+
border-color: danger-900;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
&.with-progressbar {
|
|
153
|
+
.Toastify__toast {
|
|
154
|
+
&--default {
|
|
155
|
+
border-color: neutral-300;
|
|
156
|
+
}
|
|
157
|
+
&--info {
|
|
158
|
+
border-color: brand-300;
|
|
159
|
+
}
|
|
160
|
+
&--success {
|
|
161
|
+
border-color: success-300;
|
|
162
|
+
}
|
|
163
|
+
&--warning {
|
|
164
|
+
border-color: warning-600;
|
|
165
|
+
}
|
|
166
|
+
&--error {
|
|
167
|
+
border-color: danger-200;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.Toastify__toast {
|
|
174
|
+
position: relative;
|
|
175
|
+
min-height: 76px;
|
|
176
|
+
box-sizing: border-box;
|
|
177
|
+
border-radius: 1px;
|
|
178
|
+
display: flex;
|
|
179
|
+
justify-content: space-between;
|
|
180
|
+
cursor: pointer;
|
|
181
|
+
direction: ltr;
|
|
182
|
+
background-color: neutral-000;
|
|
183
|
+
border-left: 5px solid;
|
|
184
|
+
box-shadow: 0 4px 10px 1px neutral-400;
|
|
185
|
+
margin-bottom: ${import_ds_legacy_system.th.space("xxs")};
|
|
186
|
+
&--rtl {
|
|
187
|
+
direction: rtl;
|
|
188
|
+
}
|
|
189
|
+
&-body {
|
|
190
|
+
margin: 0;
|
|
191
|
+
flex: 1;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.Toastify__progress-bar {
|
|
196
|
+
position: absolute;
|
|
197
|
+
bottom: 0;
|
|
198
|
+
left: -5px;
|
|
199
|
+
width: 5px;
|
|
200
|
+
height: 0;
|
|
201
|
+
z-index: 9999;
|
|
202
|
+
opacity: 0.7;
|
|
203
|
+
animation: Toastify__trackProgress linear 1;
|
|
204
|
+
background-color: brand-200;
|
|
205
|
+
|
|
206
|
+
&--rtl {
|
|
207
|
+
right: 0;
|
|
208
|
+
left: initial;
|
|
209
|
+
}
|
|
210
|
+
&--default {
|
|
211
|
+
background-color: neutral-400;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
&--info {
|
|
215
|
+
background-color: brand-400;
|
|
216
|
+
}
|
|
217
|
+
&--success {
|
|
218
|
+
background-color: success-900;
|
|
219
|
+
}
|
|
220
|
+
&--warning {
|
|
221
|
+
background-color: warning-900;
|
|
222
|
+
}
|
|
223
|
+
&--error {
|
|
224
|
+
background-color: danger-900;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
@media only screen and (max-width: 480px) {
|
|
229
|
+
.Toastify__toast-container {
|
|
230
|
+
width: 100vw;
|
|
231
|
+
padding: 0;
|
|
232
|
+
left: 0;
|
|
233
|
+
margin: 0;
|
|
234
|
+
&--top-left,
|
|
235
|
+
&--top-center,
|
|
236
|
+
&--top-right {
|
|
237
|
+
top: 0;
|
|
238
|
+
}
|
|
239
|
+
&--bottom-left,
|
|
240
|
+
&--bottom-center,
|
|
241
|
+
&--bottom-right {
|
|
242
|
+
bottom: 0;
|
|
243
|
+
}
|
|
244
|
+
&--rtl {
|
|
245
|
+
right: 0;
|
|
246
|
+
left: initial;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.Toastify__toast {
|
|
251
|
+
margin-bottom: 0;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
@keyframes Toastify__trackProgress {
|
|
256
|
+
from {
|
|
257
|
+
height: 100%;
|
|
258
|
+
}
|
|
259
|
+
to {
|
|
260
|
+
height: 0;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
@keyframes Toastify__slideInRight {
|
|
265
|
+
from {
|
|
266
|
+
transform: translate3d(110%, 0, 0);
|
|
267
|
+
visibility: visible;
|
|
268
|
+
}
|
|
269
|
+
to {
|
|
270
|
+
transform: translate3d(0, 0, 0);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
@keyframes Toastify__slideInLeft {
|
|
275
|
+
from {
|
|
276
|
+
transform: translate3d(-110%, 0, 0);
|
|
277
|
+
visibility: visible;
|
|
278
|
+
}
|
|
279
|
+
to {
|
|
280
|
+
transform: translate3d(0, 0, 0);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
@keyframes Toastify__slideInUp {
|
|
285
|
+
from {
|
|
286
|
+
transform: translate3d(0, 110%, 0);
|
|
287
|
+
visibility: visible;
|
|
288
|
+
}
|
|
289
|
+
to {
|
|
290
|
+
transform: translate3d(0, 0, 0);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
@keyframes Toastify__slideInDown {
|
|
295
|
+
from {
|
|
296
|
+
transform: translate3d(0, -110%, 0);
|
|
297
|
+
visibility: visible;
|
|
298
|
+
}
|
|
299
|
+
to {
|
|
300
|
+
transform: translate3d(0, 0, 0);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
@keyframes Toastify__slideOutRight {
|
|
305
|
+
from {
|
|
306
|
+
transform: translate3d(0, 0, 0);
|
|
307
|
+
}
|
|
308
|
+
to {
|
|
309
|
+
visibility: hidden;
|
|
310
|
+
transform: translate3d(110%, 0, 0);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
@keyframes Toastify__slideOutLeft {
|
|
315
|
+
from {
|
|
316
|
+
transform: translate3d(0, 0, 0);
|
|
317
|
+
}
|
|
318
|
+
to {
|
|
319
|
+
visibility: hidden;
|
|
320
|
+
transform: translate3d(-110%, 0, 0);
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
@keyframes Toastify__slideOutDown {
|
|
325
|
+
from {
|
|
326
|
+
transform: translate3d(0, 0, 0);
|
|
327
|
+
}
|
|
328
|
+
to {
|
|
329
|
+
visibility: hidden;
|
|
330
|
+
transform: translate3d(0, 500px, 0);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
@keyframes Toastify__slideOutUp {
|
|
335
|
+
from {
|
|
336
|
+
transform: translate3d(0, 0, 0);
|
|
337
|
+
}
|
|
338
|
+
to {
|
|
339
|
+
visibility: hidden;
|
|
340
|
+
transform: translate3d(0, -500px, 0);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
.Toastify__slide-enter {
|
|
345
|
+
&--top-left,
|
|
346
|
+
&--bottom-left {
|
|
347
|
+
animation-name: Toastify__slideInLeft;
|
|
348
|
+
}
|
|
349
|
+
&--top-right,
|
|
350
|
+
&--bottom-right {
|
|
351
|
+
animation-name: Toastify__slideInRight;
|
|
352
|
+
}
|
|
353
|
+
&--top-center {
|
|
354
|
+
animation-name: Toastify__slideInDown;
|
|
355
|
+
}
|
|
356
|
+
&--bottom-center {
|
|
357
|
+
animation-name: Toastify__slideInUp;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.Toastify__slide-exit {
|
|
362
|
+
&--top-left,
|
|
363
|
+
&--bottom-left {
|
|
364
|
+
animation-name: Toastify__slideOutLeft;
|
|
365
|
+
}
|
|
366
|
+
&--top-right,
|
|
367
|
+
&--bottom-right {
|
|
368
|
+
animation-name: Toastify__slideOutRight;
|
|
369
|
+
}
|
|
370
|
+
&--top-center {
|
|
371
|
+
animation-name: Toastify__slideOutUp;
|
|
372
|
+
}
|
|
373
|
+
&--bottom-center {
|
|
374
|
+
animation-name: Toastify__slideOutDown;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
${import_ds_legacy_system.xStyledCommonProps}
|
|
378
|
+
`;
|
|
379
|
+
//# sourceMappingURL=styled.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/parts/styled.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* 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", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,iCAA2B;AAC3B,8BAA+C;AAC/C,gCAOO;AAEA,MAAM,iBAAa,gCAAO,QAAQ,EAAE,MAAM,iDAAuB,MAAM,iDAAuB,KAAK,CAAC;AAAA;AAAA,IAEvG;AAAA;AAGG,MAAM,sBAAkB,gCAAO,OAAO,EAAE,MAAM,uCAAa,MAAM,uCAAa,UAAU,CAAC;AAAA;AAAA,aAEnF,2BAAG,MAAM,KAAK;AAAA,mBACR,2BAAG,MAAM,GAAG;AAAA;AAGxB,MAAM,0BAAsB,gCAAO,OAAO,EAAE,MAAM,uCAAa,MAAM,uCAAa,eAAe,CAAC;AAAA,gBACzF,2BAAG,MAAM,MAAM;AAAA,kBACb,2BAAG,MAAM,KAAK;AAAA;AAGzB,MAAM,2BAAuB,gCAAO,OAAO,EAAE,MAAM,uCAAa,MAAM,uCAAa,gBAAgB,CAAC;AAAA;AAAA;AAIpG,MAAM,0BAAsB,gCAAO,OAAO,EAAE,MAAM,uCAAa,MAAM,uCAAa,eAAe,CAAC;AAAA,gBACzF,2BAAG,MAAM,MAAM;AAAA,mBACZ,2BAAG,MAAM,KAAK;AAAA;AAAA;AAAA;AAAA;AAM1B,MAAM,wBAAoB,gCAAO,QAAQ,EAAE,MAAM,uCAAa,MAAM,uCAAa,aAAa,CAAC;AAAA;AAAA;AAAA;AAK/F,MAAM,mBAAe,gCAAO,OAAO,EAAE,MAAM,6CAAmB,MAAM,6CAAmB,KAAK,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAgBhG;AAAA;AAGG,MAAM,mBAAe,gCAAO,uCAAY,EAAE,MAAM,uCAAa,MAAM,uCAAa,aAAa,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,UAK3F,2BAAG,MAAM,aAAa;AAAA;AAGzB,MAAM,sBAAkB,gCAAO,OAAO,EAAE,MAAM,uCAAa,MAAM,uCAAa,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,2BAAG,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,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var react_desc_prop_types_exports = {};
|
|
30
|
+
__export(react_desc_prop_types_exports, {
|
|
31
|
+
DSToastActionLinkPropTypes: () => DSToastActionLinkPropTypes,
|
|
32
|
+
DSToastActionPropsTypes: () => DSToastActionPropsTypes,
|
|
33
|
+
DSToastPropTypes: () => DSToastPropTypes,
|
|
34
|
+
actionDefaultProps: () => actionDefaultProps,
|
|
35
|
+
defaultProps: () => defaultProps
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(react_desc_prop_types_exports);
|
|
38
|
+
var React = __toESM(require("react"));
|
|
39
|
+
var import_ds_legacy_props_helpers = require("@elliemae/ds-legacy-props-helpers");
|
|
40
|
+
var import_constants = require("./constants.js");
|
|
41
|
+
const defaultProps = {
|
|
42
|
+
containerProps: {},
|
|
43
|
+
position: "bottom-left",
|
|
44
|
+
autoClose: 5e3,
|
|
45
|
+
showProgressBar: false,
|
|
46
|
+
closeOnClick: false,
|
|
47
|
+
enableMultiContainer: false
|
|
48
|
+
};
|
|
49
|
+
const actionDefaultProps = {};
|
|
50
|
+
const DSToastPropTypes = {
|
|
51
|
+
/** inject props to wrapper */
|
|
52
|
+
containerProps: import_ds_legacy_props_helpers.PropTypes.object.description("inject props to wrapper").defaultValue({}),
|
|
53
|
+
/** Position on the screen to show the toast */
|
|
54
|
+
position: import_ds_legacy_props_helpers.PropTypes.oneOf(import_constants.toastsPositions).description("Position on the screen to show the toast").defaultValue("bottom-left"),
|
|
55
|
+
/** ms to autoclose the toast */
|
|
56
|
+
autoClose: import_ds_legacy_props_helpers.PropTypes.oneOfType([import_ds_legacy_props_helpers.PropTypes.number, import_ds_legacy_props_helpers.PropTypes.oneOf([false])]).description("ms to autoclose the toast, false if you don't want to automatically close").defaultValue(5e3),
|
|
57
|
+
/** Whether to show a progress bar indicating when the toast is going to be closed */
|
|
58
|
+
showProgressBar: import_ds_legacy_props_helpers.PropTypes.bool.description("Whether to show a progress bar indicating when the toast is going to be closed").defaultValue(false),
|
|
59
|
+
/** Close toast handler */
|
|
60
|
+
closeOnClick: import_ds_legacy_props_helpers.PropTypes.bool.description("Close toast handler").defaultValue(false),
|
|
61
|
+
/** Allows instantiating multiple Toast containers */
|
|
62
|
+
enableMultiContainer: import_ds_legacy_props_helpers.PropTypes.bool.description("Allows instantiating multiple Toast containers").defaultValue(false),
|
|
63
|
+
/** unique id for multi container */
|
|
64
|
+
containerId: import_ds_legacy_props_helpers.PropTypes.oneOfType([import_ds_legacy_props_helpers.PropTypes.string, import_ds_legacy_props_helpers.PropTypes.number]).description("unique id for multi container")
|
|
65
|
+
};
|
|
66
|
+
const DSToastActionLinkPropTypes = {
|
|
67
|
+
/** link text */
|
|
68
|
+
children: import_ds_legacy_props_helpers.PropTypes.node.isRequired.description("link text")
|
|
69
|
+
};
|
|
70
|
+
const DSToastActionPropsTypes = {
|
|
71
|
+
/** DSToastActionLink component or text string */
|
|
72
|
+
children: import_ds_legacy_props_helpers.PropTypes.node.description("DSToastActionLink component or text string"),
|
|
73
|
+
/** click handler */
|
|
74
|
+
onClick: import_ds_legacy_props_helpers.PropTypes.func.description("click handler"),
|
|
75
|
+
/** key down handler */
|
|
76
|
+
onKeyDown: import_ds_legacy_props_helpers.PropTypes.func.description("key down handler")
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/react-desc-prop-types.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* 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", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,qCAA0B;AAE1B,uBAAgC;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,yCAAU,OAAO,YAAY,yBAAyB,EAAE,aAAa,CAAC,CAAC;AAAA;AAAA,EAEvF,UAAU,yCAAU,MAAM,gCAAsC,EAC7D,YAAY,0CAA0C,EACtD,aAAa,aAAa;AAAA;AAAA,EAE7B,WAAW,yCAAU,UAAU,CAAC,yCAAU,QAAQ,yCAAU,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EACxE,YAAY,2EAA2E,EACvF,aAAa,GAAI;AAAA;AAAA,EAEpB,iBAAiB,yCAAU,KACxB,YAAY,gFAAgF,EAC5F,aAAa,KAAK;AAAA;AAAA,EAErB,cAAc,yCAAU,KAAK,YAAY,qBAAqB,EAAE,aAAa,KAAK;AAAA;AAAA,EAElF,sBAAsB,yCAAU,KAC7B,YAAY,gDAAgD,EAC5D,aAAa,KAAK;AAAA;AAAA,EAErB,aAAa,yCAAU,UAAU,CAAC,yCAAU,QAAQ,yCAAU,MAAM,CAAC,EAAE,YAAY,+BAA+B;AACpH;AAEO,MAAM,6BAA6B;AAAA;AAAA,EAExC,UAAU,yCAAU,KAAK,WAAW,YAAY,WAAW;AAC7D;AAEO,MAAM,0BAA0B;AAAA;AAAA,EAErC,UAAU,yCAAU,KAAK,YAAY,4CAA4C;AAAA;AAAA,EAEjF,SAAS,yCAAU,KAAK,YAAY,eAAe;AAAA;AAAA,EAEnD,WAAW,yCAAU,KAAK,YAAY,kBAAkB;AAC1D;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var toast_exports = {};
|
|
30
|
+
__export(toast_exports, {
|
|
31
|
+
toast: () => toast
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(toast_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_react_toastify = require("react-toastify");
|
|
37
|
+
var import_DSToastContent = require("./parts/DSToastContent.js");
|
|
38
|
+
const toast = Object.assign(
|
|
39
|
+
({ type, messageTitle, messageText, ...rest }, options) => (0, import_react_toastify.toast)(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DSToastContent.DSToastContent, { messageText, messageTitle, type }), {
|
|
40
|
+
...rest,
|
|
41
|
+
...options,
|
|
42
|
+
type
|
|
43
|
+
}),
|
|
44
|
+
{ ...import_react_toastify.toast, isActive: (id) => import_react_toastify.toast.isActive(id) }
|
|
45
|
+
);
|
|
46
|
+
//# sourceMappingURL=toast.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/toast.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["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", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADQL;AANlB,4BAAuC;AAEvC,4BAA+B;AAE/B,MAAM,QAAQ,OAAO;AAAA,EACnB,CAAC,EAAE,MAAM,cAAc,aAAa,GAAG,KAAK,GAAwB,gBAClE,sBAAAA,OAAc,4CAAC,wCAAe,aAA0B,cAA4B,MAAY,GAAI;AAAA,IAClG,GAAG;AAAA,IACH,GAAG;AAAA,IACH;AAAA,EACF,CAAC;AAAA,EACH,EAAE,GAAG,sBAAAA,OAAe,UAAU,CAAC,OAAwB,sBAAAA,MAAc,SAAS,EAAE,EAAE;AACpF;",
|
|
6
|
+
"names": ["toastifyToast"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { slotObjectToDataTestIds } from "@elliemae/ds-legacy-system";
|
|
3
|
+
const DSToastName = "DSToast";
|
|
4
|
+
const DSToastActionLinkName = "DSToastActionLink";
|
|
5
|
+
const DSToastActionName = "DSToastAction";
|
|
6
|
+
const DSToastSlots = {
|
|
7
|
+
ROOT: "root",
|
|
8
|
+
CLOSE_BUTTON: "close-button",
|
|
9
|
+
CONTAINER: "container",
|
|
10
|
+
ICON_CONTAINER: "icon-container",
|
|
11
|
+
MESSAGE_CONTENT: "message-content",
|
|
12
|
+
MESSAGE_HEADER: "message-header",
|
|
13
|
+
MESSAGE_TEXT: "message-text"
|
|
14
|
+
};
|
|
15
|
+
const DSToastActionSlots = {
|
|
16
|
+
ROOT: "root"
|
|
17
|
+
};
|
|
18
|
+
const DSToastActionLinkSlots = {
|
|
19
|
+
ROOT: "root"
|
|
20
|
+
};
|
|
21
|
+
const DSToastDataTestIds = {
|
|
22
|
+
...slotObjectToDataTestIds(DSToastName, DSToastSlots),
|
|
23
|
+
CONTAINER: "ds-toast-render"
|
|
24
|
+
};
|
|
25
|
+
const DSToastActionDataTestIds = slotObjectToDataTestIds(DSToastActionName, DSToastActionSlots);
|
|
26
|
+
const DSToastActionLinkDataTestIds = slotObjectToDataTestIds(DSToastActionLinkName, DSToastActionLinkSlots);
|
|
27
|
+
export {
|
|
28
|
+
DSToastActionDataTestIds,
|
|
29
|
+
DSToastActionLinkDataTestIds,
|
|
30
|
+
DSToastActionLinkName,
|
|
31
|
+
DSToastActionLinkSlots,
|
|
32
|
+
DSToastActionName,
|
|
33
|
+
DSToastActionSlots,
|
|
34
|
+
DSToastDataTestIds,
|
|
35
|
+
DSToastName,
|
|
36
|
+
DSToastSlots
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=DSToastDefinitions.js.map
|