@elliemae/ds-toast 1.60.0 → 2.0.0-alpha.12

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,54 +1,36 @@
1
- import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
2
- import React from 'react';
3
- import PropTypes from 'prop-types';
1
+ import _jsx from '@babel/runtime/helpers/esm/jsx';
2
+ import 'react';
4
3
  import { aggregatedClasses } from '@elliemae/ds-classnames';
5
4
  import { CheckmarkCircleFill, WarningCircleFill, InfoCircleFill } from '@elliemae/ds-icons';
6
- import { toastTypes, ToastType } from './ToastType.js';
7
-
8
- var blockName = 'toast-content';
9
- var Container = aggregatedClasses('div')(blockName);
10
- var IconContainer = aggregatedClasses('div')(blockName, 'icon-container');
11
- var MessageContent = aggregatedClasses('div')(blockName, 'message-content');
12
- var MessageHeader = aggregatedClasses('div')(blockName, 'message-header');
13
- var MessageText = aggregatedClasses('span')(blockName, 'message-text');
14
-
15
- var getIconByToastType = function getIconByToastType(type) {
16
- var _ToastType$SUCCESS$To;
17
-
18
- return (_ToastType$SUCCESS$To = {}, _defineProperty(_ToastType$SUCCESS$To, ToastType.SUCCESS, CheckmarkCircleFill), _defineProperty(_ToastType$SUCCESS$To, ToastType.WARNING, WarningCircleFill), _defineProperty(_ToastType$SUCCESS$To, ToastType.INFO, InfoCircleFill), _defineProperty(_ToastType$SUCCESS$To, ToastType.ERROR, WarningCircleFill), _defineProperty(_ToastType$SUCCESS$To, ToastType.DEFAULT, 'div'), _ToastType$SUCCESS$To)[type];
19
- };
20
-
21
- var ToastRender = function ToastRender(_ref) {
22
- var _ref$type = _ref.type,
23
- type = _ref$type === void 0 ? ToastType.DEFAULT : _ref$type,
24
- _ref$messageTitle = _ref.messageTitle,
25
- messageTitle = _ref$messageTitle === void 0 ? '' : _ref$messageTitle,
26
- _ref$messageText = _ref.messageText,
27
- messageText = _ref$messageText === void 0 ? '' : _ref$messageText;
28
- var IconMessage = aggregatedClasses(getIconByToastType(type))(blockName, 'icon-message');
29
- return /*#__PURE__*/React.createElement(Container, {
5
+ import { ToastType } from './ToastType.js';
6
+
7
+ const blockName = 'toast-content';
8
+ const Container = aggregatedClasses('div')(blockName);
9
+ const IconContainer = aggregatedClasses('div')(blockName, 'icon-container');
10
+ const MessageContent = aggregatedClasses('div')(blockName, 'message-content');
11
+ const MessageHeader = aggregatedClasses('div')(blockName, 'message-header');
12
+ const MessageText = aggregatedClasses('span')(blockName, 'message-text');
13
+
14
+ const getIconByToastType = type => ({
15
+ [ToastType.SUCCESS]: CheckmarkCircleFill,
16
+ [ToastType.WARNING]: WarningCircleFill,
17
+ [ToastType.INFO]: InfoCircleFill,
18
+ [ToastType.ERROR]: WarningCircleFill,
19
+ [ToastType.DEFAULT]: 'div'
20
+ })[type];
21
+
22
+ const ToastRender = _ref => {
23
+ let {
24
+ type = ToastType.DEFAULT,
25
+ messageTitle = '',
26
+ messageText = ''
27
+ } = _ref;
28
+ const IconMessage = aggregatedClasses(getIconByToastType(type))(blockName, 'icon-message');
29
+ return /*#__PURE__*/_jsx(Container, {
30
30
  "data-testid": "ds-toast-render"
31
- }, /*#__PURE__*/React.createElement(IconContainer, null, /*#__PURE__*/React.createElement(IconMessage, {
31
+ }, void 0, /*#__PURE__*/_jsx(IconContainer, {}, void 0, /*#__PURE__*/_jsx(IconMessage, {
32
32
  size: "m"
33
- })), /*#__PURE__*/React.createElement(MessageContent, null, /*#__PURE__*/React.createElement(MessageHeader, null, messageTitle), /*#__PURE__*/React.createElement(MessageText, null, messageText)));
34
- };
35
-
36
- ToastRender.propTypes = {
37
- /**
38
- * Toast title
39
- */
40
- messageTitle: PropTypes.string.isRequired,
41
-
42
- /**
43
- * Toast body, either a string or Action with ActionLink component
44
- */
45
- messageText: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
46
-
47
- /**
48
- * Toast type
49
- */
50
- type: PropTypes.oneOf(toastTypes).isRequired
33
+ })), /*#__PURE__*/_jsx(MessageContent, {}, void 0, /*#__PURE__*/_jsx(MessageHeader, {}, void 0, messageTitle), /*#__PURE__*/_jsx(MessageText, {}, void 0, messageText)));
51
34
  };
52
35
 
53
36
  export { ToastRender as default };
54
- //# sourceMappingURL=ToastRender.js.map
package/esm/ToastType.js CHANGED
@@ -1,4 +1,4 @@
1
- var ToastType = {
1
+ const ToastType = {
2
2
  INFO: 'info',
3
3
  SUCCESS: 'success',
4
4
  WARNING: 'warning',
@@ -6,7 +6,6 @@ var ToastType = {
6
6
  // TODO remove from types, it's not in spec
7
7
  DEFAULT: 'default'
8
8
  };
9
- var toastTypes = Object.values(ToastType);
9
+ const toastTypes = Object.values(ToastType);
10
10
 
11
11
  export { ToastType, toastTypes };
12
- //# sourceMappingURL=ToastType.js.map
package/esm/index.js CHANGED
@@ -3,17 +3,3 @@ export { toast } from './toast.js';
3
3
  export { ToastType, toastTypes } from './ToastType.js';
4
4
  export { ToastPosition, toastsPositions } from './ToastPosition.js';
5
5
  export { DSToastAction, DSToastActionLink, DSToastActionLinkWithSchema, DSToastActionWithSchema } from './ToastAction.js';
6
- import '@babel/runtime/helpers/esm/extends';
7
- import 'react';
8
- import 'react-desc';
9
- import 'react-toastify';
10
- import '@elliemae/ds-icons';
11
- import '@elliemae/ds-button';
12
- import '@babel/runtime/helpers/esm/defineProperty';
13
- import '@babel/runtime/helpers/esm/objectWithoutProperties';
14
- import './ToastRender.js';
15
- import 'prop-types';
16
- import '@elliemae/ds-classnames';
17
- import 'styled-components';
18
- import '@elliemae/ds-system';
19
- //# sourceMappingURL=index.js.map
package/esm/toast.js CHANGED
@@ -1,36 +1,37 @@
1
+ import 'core-js/modules/esnext.async-iterator.filter.js';
2
+ import 'core-js/modules/esnext.iterator.constructor.js';
3
+ import 'core-js/modules/esnext.iterator.filter.js';
4
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
5
+ import 'core-js/modules/esnext.iterator.for-each.js';
1
6
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
7
+ import _jsx from '@babel/runtime/helpers/esm/jsx';
2
8
  import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
3
- import React from 'react';
9
+ import 'react';
4
10
  import { toast as toast$1 } from 'react-toastify';
5
11
  import ToastRender from './ToastRender.js';
6
- import 'prop-types';
7
- import '@elliemae/ds-classnames';
8
- import '@elliemae/ds-icons';
9
- import './ToastType.js';
10
12
 
11
- var _excluded = ["type", "messageTitle", "messageText"];
13
+ const _excluded = ["type", "messageTitle", "messageText"];
12
14
 
13
15
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
14
16
 
15
17
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
16
- var toast = Object.assign(function (_ref, options) {
17
- var type = _ref.type,
18
- messageTitle = _ref.messageTitle,
19
- messageText = _ref.messageText,
18
+ const toast = Object.assign((_ref, options) => {
19
+ let {
20
+ type,
21
+ messageTitle,
22
+ messageText
23
+ } = _ref,
20
24
  rest = _objectWithoutProperties(_ref, _excluded);
21
25
 
22
- return toast$1( /*#__PURE__*/React.createElement(ToastRender, {
26
+ return toast$1( /*#__PURE__*/_jsx(ToastRender, {
23
27
  messageText: messageText,
24
28
  messageTitle: messageTitle,
25
29
  type: type
26
30
  }), _objectSpread(_objectSpread(_objectSpread({}, rest), options), {}, {
27
- type: type
31
+ type
28
32
  }));
29
33
  }, _objectSpread(_objectSpread({}, toast$1), {}, {
30
- isActive: function isActive(id) {
31
- return toast$1.isActive(id);
32
- }
34
+ isActive: id => toast$1.isActive(id)
33
35
  }));
34
36
 
35
37
  export { toast };
36
- //# sourceMappingURL=toast.js.map
package/package.json CHANGED
@@ -1,14 +1,54 @@
1
1
  {
2
2
  "name": "@elliemae/ds-toast",
3
- "version": "1.60.0",
3
+ "version": "2.0.0-alpha.12",
4
4
  "license": "MIT",
5
- "description": "Ellie Mae - Dim Sum - Toast",
6
- "module": "esm/index.js",
7
- "main": "cjs/index.js",
5
+ "description": "ICE MT - Dimsum - Toast",
6
+ "module": "./esm/index.js",
7
+ "main": "./cjs/index.js",
8
+ "types": "./types/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./esm/index.js",
12
+ "require": "./cjs/index.js"
13
+ },
14
+ "./ToastType": {
15
+ "import": "./esm/ToastType.js",
16
+ "require": "./cjs/ToastType.js"
17
+ },
18
+ "./ToastRender": {
19
+ "import": "./esm/ToastRender.js",
20
+ "require": "./cjs/ToastRender.js"
21
+ },
22
+ "./ToastPosition": {
23
+ "import": "./esm/ToastPosition.js",
24
+ "require": "./cjs/ToastPosition.js"
25
+ },
26
+ "./ToastAction": {
27
+ "import": "./esm/ToastAction.js",
28
+ "require": "./cjs/ToastAction.js"
29
+ },
30
+ "./toast": {
31
+ "import": "./esm/toast.js",
32
+ "require": "./cjs/toast.js"
33
+ },
34
+ "./DSToast": {
35
+ "import": "./esm/DSToast.js",
36
+ "require": "./cjs/DSToast.js"
37
+ }
38
+ },
8
39
  "sideEffects": [
9
40
  "*.css",
10
41
  "*.scss"
11
42
  ],
43
+ "repository": {
44
+ "type": "git",
45
+ "url": "https://git.elliemae.io/platform-ui/dimsum.git"
46
+ },
47
+ "engines": {
48
+ "npm": ">=7",
49
+ "node": ">=14"
50
+ },
51
+ "author": "ICE MT",
12
52
  "scripts": {
13
53
  "dev": "cross-env NODE_ENV=development && node ../../scripts/build/build.js -w",
14
54
  "prebuild": "exit 0",
@@ -16,25 +56,26 @@
16
56
  "build": "node ../../scripts/build/build.js"
17
57
  },
18
58
  "dependencies": {
19
- "@elliemae/ds-button": "1.60.0",
20
- "@elliemae/ds-classnames": "1.60.0",
21
- "@elliemae/ds-icons": "1.60.0",
22
- "@elliemae/ds-system": "1.60.0",
59
+ "@elliemae/ds-button": "2.0.0-alpha.12",
60
+ "@elliemae/ds-classnames": "2.0.0-alpha.12",
61
+ "@elliemae/ds-icons": "2.0.0-alpha.12",
62
+ "@elliemae/ds-system": "2.0.0-alpha.12",
23
63
  "prop-types": "~15.7.2",
24
- "react-desc": "^4.1.2",
64
+ "react-desc": "~4.1.3",
25
65
  "react-toastify": "~6.2.0"
26
66
  },
27
67
  "devDependencies": {
28
- "styled-components": "~5.3.0"
68
+ "styled-components": "~5.3.3"
29
69
  },
30
70
  "peerDependencies": {
31
- "lodash": "^4.17.20",
32
- "react": "^17.0.1",
33
- "react-dom": "^17.0.1",
34
- "styled-components": "^5.3.0"
71
+ "lodash": "^4.17.21",
72
+ "react": "^17.0.2",
73
+ "react-dom": "^17.0.2",
74
+ "styled-components": "^5.3.3"
35
75
  },
36
76
  "publishConfig": {
37
77
  "access": "public",
38
- "directory": "dist"
78
+ "directory": "dist",
79
+ "generateSubmodules": true
39
80
  }
40
81
  }
@@ -0,0 +1,88 @@
1
+ /// <reference path="../../../../shared/typings/react-desc.d.ts" />
2
+ /// <reference types="react" />
3
+ declare const DSToast: {
4
+ ({ containerProps, position, autoClose, showProgressBar, closeOnClick, enableMultiContainer, containerId, toastId, }: {
5
+ containerProps?: {} | undefined;
6
+ position?: string | undefined;
7
+ autoClose?: number | undefined;
8
+ showProgressBar?: boolean | undefined;
9
+ closeOnClick?: boolean | undefined;
10
+ enableMultiContainer?: boolean | undefined;
11
+ containerId?: undefined;
12
+ toastId?: undefined;
13
+ }): JSX.Element;
14
+ propTypes: {
15
+ /** inject props to wrapper */
16
+ containerProps: {
17
+ defaultValue<T = unknown>(arg: T): {
18
+ deprecated: import("react-desc").PropTypesDescValidator;
19
+ };
20
+ isRequired: import("react-desc").PropTypesDescValidator;
21
+ };
22
+ /** Position on the screen to show the toast */
23
+ position: {
24
+ defaultValue<T = unknown>(arg: T): {
25
+ deprecated: import("react-desc").PropTypesDescValidator;
26
+ };
27
+ isRequired: import("react-desc").PropTypesDescValidator;
28
+ };
29
+ /** ms to autoclose the toast */
30
+ autoClose: {
31
+ defaultValue<T = unknown>(arg: T): {
32
+ deprecated: import("react-desc").PropTypesDescValidator;
33
+ };
34
+ isRequired: import("react-desc").PropTypesDescValidator;
35
+ };
36
+ /** Whether to show a progress bar indicating when the toast is going to be closed */
37
+ showProgressBar: {
38
+ defaultValue<T = unknown>(arg: T): {
39
+ deprecated: import("react-desc").PropTypesDescValidator;
40
+ };
41
+ isRequired: import("react-desc").PropTypesDescValidator;
42
+ };
43
+ /** Close toast handler */
44
+ closeOnClick: {
45
+ defaultValue<T = unknown>(arg: T): {
46
+ deprecated: import("react-desc").PropTypesDescValidator;
47
+ };
48
+ isRequired: import("react-desc").PropTypesDescValidator;
49
+ };
50
+ /** Allows instantiating multiple Toast containers */
51
+ enableMultiContainer: {
52
+ defaultValue<T = unknown>(arg: T): {
53
+ deprecated: import("react-desc").PropTypesDescValidator;
54
+ };
55
+ isRequired: import("react-desc").PropTypesDescValidator;
56
+ };
57
+ /** unique id for multi container */
58
+ containerId: {
59
+ defaultValue<T = unknown>(arg: T): {
60
+ deprecated: import("react-desc").PropTypesDescValidator;
61
+ };
62
+ isRequired: import("react-desc").PropTypesDescValidator;
63
+ };
64
+ /** id for the toast */
65
+ toastId: {
66
+ defaultValue<T = unknown>(arg: T): {
67
+ deprecated: import("react-desc").PropTypesDescValidator;
68
+ };
69
+ isRequired: import("react-desc").PropTypesDescValidator;
70
+ };
71
+ };
72
+ };
73
+ declare const DSToastWithSchema: {
74
+ (props?: {
75
+ containerProps?: {} | undefined;
76
+ position?: string | undefined;
77
+ autoClose?: number | undefined;
78
+ showProgressBar?: boolean | undefined;
79
+ closeOnClick?: boolean | undefined;
80
+ enableMultiContainer?: boolean | undefined;
81
+ containerId?: undefined;
82
+ toastId?: undefined;
83
+ } | undefined): JSX.Element;
84
+ propTypes: unknown;
85
+ toTypescript: () => import("react-desc").TypescriptSchema;
86
+ };
87
+ export { DSToast, DSToastWithSchema };
88
+ export default DSToast;
@@ -0,0 +1,58 @@
1
+ /// <reference path="../../../../shared/typings/react-desc.d.ts" />
2
+ /// <reference types="react" />
3
+ declare const DSToastAction: {
4
+ ({ children, onClick, onKeyDown }: {
5
+ children: any;
6
+ onClick: any;
7
+ onKeyDown: any;
8
+ }): JSX.Element;
9
+ propTypes: {
10
+ /** DSToastActionLink component or text string */
11
+ children: {
12
+ defaultValue<T = unknown>(arg: T): {
13
+ deprecated: import("react-desc").PropTypesDescValidator;
14
+ };
15
+ isRequired: import("react-desc").PropTypesDescValidator;
16
+ };
17
+ /** click handler */
18
+ onClick: {
19
+ defaultValue<T = unknown>(arg: T): {
20
+ deprecated: import("react-desc").PropTypesDescValidator;
21
+ };
22
+ isRequired: import("react-desc").PropTypesDescValidator;
23
+ };
24
+ /** key down handler */
25
+ onKeyDown: {
26
+ defaultValue<T = unknown>(arg: T): {
27
+ deprecated: import("react-desc").PropTypesDescValidator;
28
+ };
29
+ isRequired: import("react-desc").PropTypesDescValidator;
30
+ };
31
+ };
32
+ };
33
+ declare const DSToastActionLink: {
34
+ ({ children }: {
35
+ children: any;
36
+ }): JSX.Element;
37
+ propTypes: {
38
+ /** link text */
39
+ children: any;
40
+ };
41
+ };
42
+ declare const DSToastActionWithSchema: {
43
+ (props?: {
44
+ children: any;
45
+ onClick: any;
46
+ onKeyDown: any;
47
+ } | undefined): JSX.Element;
48
+ propTypes: unknown;
49
+ toTypescript: () => import("react-desc").TypescriptSchema;
50
+ };
51
+ declare const DSToastActionLinkWithSchema: {
52
+ (props?: {
53
+ children: any;
54
+ } | undefined): JSX.Element;
55
+ propTypes: unknown;
56
+ toTypescript: () => import("react-desc").TypescriptSchema;
57
+ };
58
+ export { DSToastAction, DSToastActionLink, DSToastActionWithSchema, DSToastActionLinkWithSchema, };
@@ -0,0 +1,9 @@
1
+ export declare const ToastPosition: {
2
+ TOP_RIGHT: string;
3
+ TOP_CENTER: string;
4
+ TOP_LEFT: string;
5
+ BOTTOM_RIGHT: string;
6
+ BOTTOM_CENTER: string;
7
+ BOTTOM_LEFT: string;
8
+ };
9
+ export declare const toastsPositions: string[];
@@ -0,0 +1,24 @@
1
+ /// <reference types="react" />
2
+ import PropTypes from 'prop-types';
3
+ declare const ToastRender: {
4
+ ({ type, messageTitle, messageText }: {
5
+ type?: string | undefined;
6
+ messageTitle?: string | undefined;
7
+ messageText?: string | undefined;
8
+ }): JSX.Element;
9
+ propTypes: {
10
+ /**
11
+ * Toast title
12
+ */
13
+ messageTitle: PropTypes.Validator<string>;
14
+ /**
15
+ * Toast body, either a string or Action with ActionLink component
16
+ */
17
+ messageText: PropTypes.Requireable<string | PropTypes.ReactElementLike>;
18
+ /**
19
+ * Toast type
20
+ */
21
+ type: PropTypes.Validator<string>;
22
+ };
23
+ };
24
+ export default ToastRender;
@@ -0,0 +1,8 @@
1
+ export declare const ToastType: {
2
+ INFO: string;
3
+ SUCCESS: string;
4
+ WARNING: string;
5
+ ERROR: string;
6
+ DEFAULT: string;
7
+ };
8
+ export declare const toastTypes: string[];
@@ -0,0 +1,6 @@
1
+ export * from './DSToast';
2
+ export * from './toast';
3
+ export * from './ToastType';
4
+ export * from './ToastPosition';
5
+ export * from './ToastAction';
6
+ export { default } from './DSToast';
@@ -0,0 +1,38 @@
1
+ import React from 'react';
2
+ declare const toast: (({ type, messageTitle, messageText, ...rest }: {
3
+ [x: string]: any;
4
+ type: any;
5
+ messageTitle: any;
6
+ messageText: any;
7
+ }, options: any) => React.ReactText) & {
8
+ isActive: (id: any) => boolean;
9
+ success(content: import("react-toastify").ToastContent, options?: import("react-toastify").ToastOptions | undefined): React.ReactText;
10
+ info(content: import("react-toastify").ToastContent, options?: import("react-toastify").ToastOptions | undefined): React.ReactText;
11
+ error(content: import("react-toastify").ToastContent, options?: import("react-toastify").ToastOptions | undefined): React.ReactText;
12
+ warning(content: import("react-toastify").ToastContent, options?: import("react-toastify").ToastOptions | undefined): React.ReactText;
13
+ dark(content: import("react-toastify").ToastContent, options?: import("react-toastify").ToastOptions | undefined): React.ReactText;
14
+ warn: (content: import("react-toastify").ToastContent, options?: import("react-toastify").ToastOptions | undefined) => React.ReactText;
15
+ dismiss(id?: string | number | undefined): false | void;
16
+ clearWaitingQueue(params?: import("react-toastify").ClearWaitingQueueParams | undefined): false | void;
17
+ update(toastId: import("react-toastify").Id, options?: import("react-toastify").UpdateOptions | undefined): void;
18
+ done(id: import("react-toastify").Id): void;
19
+ onChange(callback: import("react-toastify/dist/core").OnChangeCallback): () => void;
20
+ configure(config?: import("react-toastify").ToastContainerProps | undefined): void;
21
+ POSITION: {
22
+ TOP_LEFT: import("react-toastify").ToastPosition;
23
+ TOP_RIGHT: import("react-toastify").ToastPosition;
24
+ TOP_CENTER: import("react-toastify").ToastPosition;
25
+ BOTTOM_LEFT: import("react-toastify").ToastPosition;
26
+ BOTTOM_RIGHT: import("react-toastify").ToastPosition;
27
+ BOTTOM_CENTER: import("react-toastify").ToastPosition;
28
+ };
29
+ TYPE: {
30
+ INFO: import("react-toastify").TypeOptions;
31
+ SUCCESS: import("react-toastify").TypeOptions;
32
+ WARNING: import("react-toastify").TypeOptions;
33
+ ERROR: import("react-toastify").TypeOptions;
34
+ DEFAULT: import("react-toastify").TypeOptions;
35
+ DARK: import("react-toastify").TypeOptions;
36
+ };
37
+ };
38
+ export { toast };
@@ -1,10 +0,0 @@
1
- {
2
- "name": "@elliemae/ds-toast/DSToast",
3
- "sideEffects": [
4
- "*.css",
5
- "*.scss"
6
- ],
7
- "private": true,
8
- "main": "../cjs/DSToast.js",
9
- "module": "../esm/DSToast.js"
10
- }
@@ -1,10 +0,0 @@
1
- {
2
- "name": "@elliemae/ds-toast/ToastAction",
3
- "sideEffects": [
4
- "*.css",
5
- "*.scss"
6
- ],
7
- "private": true,
8
- "main": "../cjs/ToastAction.js",
9
- "module": "../esm/ToastAction.js"
10
- }
@@ -1,10 +0,0 @@
1
- {
2
- "name": "@elliemae/ds-toast/ToastPosition",
3
- "sideEffects": [
4
- "*.css",
5
- "*.scss"
6
- ],
7
- "private": true,
8
- "main": "../cjs/ToastPosition.js",
9
- "module": "../esm/ToastPosition.js"
10
- }
@@ -1,10 +0,0 @@
1
- {
2
- "name": "@elliemae/ds-toast/ToastRender",
3
- "sideEffects": [
4
- "*.css",
5
- "*.scss"
6
- ],
7
- "private": true,
8
- "main": "../cjs/ToastRender.js",
9
- "module": "../esm/ToastRender.js"
10
- }
@@ -1,10 +0,0 @@
1
- {
2
- "name": "@elliemae/ds-toast/ToastType",
3
- "sideEffects": [
4
- "*.css",
5
- "*.scss"
6
- ],
7
- "private": true,
8
- "main": "../cjs/ToastType.js",
9
- "module": "../esm/ToastType.js"
10
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"DSToast.js","sources":["../../src/DSToast.tsx"],"sourcesContent":["import React from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport { ToastContainer, Slide } from 'react-toastify';\nimport { CloseSmall } from '@elliemae/ds-icons';\nimport DSButton from '@elliemae/ds-button';\nimport { toastsPositions } from './ToastPosition';\n\nconst CloseButton = ({ closeToast }) => (\n <DSButton buttonType=\"text\" className=\"toast-close-button\" icon={<CloseSmall />} onClick={closeToast} size=\"m\" />\n);\n\nconst DSToast = ({\n containerProps = {},\n position = 'bottom-left',\n autoClose = 5000, // can be false or a number in milliseconds\n showProgressBar = false,\n closeOnClick = false,\n enableMultiContainer = false,\n containerId = undefined,\n toastId = undefined,\n}) => (\n <ToastContainer\n {...containerProps}\n autoClose={autoClose}\n className={(showProgressBar && 'with-progressbar') || ''}\n closeButton={<CloseButton />}\n closeOnClick={closeOnClick}\n containerId={containerId}\n enableMultiContainer={enableMultiContainer}\n hideProgressBar={!showProgressBar}\n newestOnTop\n position={position}\n toastId={toastId}\n transition={Slide}\n />\n);\n\nconst props = {\n /** inject props to wrapper */\n containerProps: PropTypes.object.description('inject props to wrapper'),\n /** Position on the screen to show the toast */\n position: PropTypes.oneOf(toastsPositions).description('Position on the screen to show the toast'),\n /** ms to autoclose the toast */\n autoClose: PropTypes.number.description('ms to autoclose the toast'),\n /** Whether to show a progress bar indicating when the toast is going to be closed */\n showProgressBar: PropTypes.bool.description(\n 'Whether to show a progress bar indicating when the toast is going to be closed',\n ),\n /** Close toast handler */\n closeOnClick: PropTypes.bool.description('Close toast handler'),\n /** Allows instantiating multiple Toast containers */\n enableMultiContainer: PropTypes.bool.description('Allows instantiating multiple Toast containers'),\n /** unique id for multi container */\n containerId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('unique id for multi container'),\n /** id for the toast */\n toastId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('id for the toast'),\n};\n\nDSToast.propTypes = props;\nconst DSToastWithSchema = describe(DSToast);\nDSToastWithSchema.propTypes = props;\n\nexport { DSToast, DSToastWithSchema };\nexport default DSToast;\n"],"names":["CloseButton","closeToast","React","DSButton","CloseSmall","DSToast","containerProps","position","autoClose","showProgressBar","closeOnClick","enableMultiContainer","containerId","undefined","toastId","ToastContainer","Slide","props","PropTypes","object","description","oneOf","toastsPositions","number","bool","oneOfType","string","propTypes","DSToastWithSchema","describe"],"mappings":";;;;;;;;;;;;;;;;;;AAOA,IAAMA,WAAW,GAAG,SAAdA,WAAc;AAAA,MAAGC,UAAH,QAAGA,UAAH;AAAA,sBAClBC,wCAACC,4BAAD;AAAU,IAAA,UAAU,EAAC,MAArB;AAA4B,IAAA,SAAS,EAAC,oBAAtC;AAA2D,IAAA,IAAI,eAAED,wCAACE,kBAAD,OAAjE;AAAiF,IAAA,OAAO,EAAEH,UAA1F;AAAsG,IAAA,IAAI,EAAC;AAA3G,IADkB;AAAA,CAApB;;IAIMI,OAAO,GAAG,SAAVA,OAAU;AAAA,mCACdC,c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CARL;;AAWZ;AACAV,EAAAA,YAAY,EAAEQ,mBAAS,CAACM,IAAV,CAAeJ,WAAf,CAA2B,qBAA3B,CAZF;;AAaZ;AACAT,EAAAA,oBAAoB,EAAEO,mBAAS,CAACM,IAAV,CAAeJ,WAAf,CAA2B,gDAA3B,CAdV;;AAeZ;AACAR,EAAAA,WAAW,EAAEM,mBAAS,CAACO,SAAV,CAAoB,CAACP,mBAAS,CAACQ,MAAX,EAAmBR,mBAAS,CAACK,MAA7B,CAApB,EAA0DH,WAA1D,CAAsE,+BAAtE,CAhBD;;AAiBZ;AACAN,EAAAA,OAAO,EAAEI,mBAAS,CAACO,SAAV,CAAoB,CAACP,mBAAS,CAACQ,MAAX,EAAmBR,mBAAS,CAACK,MAA7B,CAApB,EAA0DH,WAA1D,CAAsE,kBAAtE;AAlBG,CAAd;AAqBAf,OAAO,CAACsB,SAAR,GAAoBV,KAApB;IACMW,iBAAiB,GAAGC,kBAAQ,CAACxB,OAAD;AAClCuB,iBAAiB,CAACD,SAAlB,GAA8BV,KAA9B;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ToastAction.js","sources":["../../src/ToastAction.tsx"],"sourcesContent":["import React from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport styled from 'styled-components';\nimport { color } from '@elliemae/ds-system';\n\nconst Link = styled.span`\n ${color('brand', '600')}\n`;\n\nconst DSToastAction = ({ children, onClick, onKeyDown }) => (\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions\n <div\n onKeyDown={onKeyDown}\n onClick={onClick}\n role={onClick ? 'button' : 'textbox'}\n >\n {children}\n </div>\n);\n\n// eslint-disable-next-line jsx-a11y/anchor-is-valid\nconst DSToastActionLink = ({ children }) => <Link>{children}</Link>;\n\nconst actionprops = {\n /** DSToastActionLink component or text string */\n children: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.element,\n ]).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};\n\nconst linkprops = {\n /** link text */\n children: PropTypes.string.isRequired.description('link text'),\n};\n\nDSToastAction.propTypes = actionprops;\nDSToastActionLink.propTypes = linkprops;\nconst DSToastActionWithSchema = describe(DSToastAction);\nconst DSToastActionLinkWithSchema = describe(DSToastActionLink);\nDSToastActionLinkWithSchema.propTypes = linkprops;\nDSToastActionWithSchema.propTypes = actionprops;\n\nexport {\n DSToastAction,\n DSToastActionLink,\n DSToastActionWithSchema,\n DSToastActionLinkWithSchema,\n};\n"],"names":["Link","styled","span","color","DSToastAction","children","onClick","onKeyDown","DSToastActionLink","React","actionprops","PropTypes","oneOfType","string","element","description","func","linkprops","isRequired","propTypes","DSToastActionWithSchema","describe","DSToastActionLinkWithSchema"],"mappings":";;;;;;;;;;;;;;AAKA,IAAMA,IAAI,gBAAGC,0BAAM,CAACC,IAAV;AAAA;AAAA,aACNC,cAAK,CAAC,OAAD,EAAU,KAAV,CADC,CAAV;;IAIMC,aAAa,GAAG,SAAhBA,aAAgB;AAAA,MAAGC,QAAH,QAAGA,QAAH;AAAA,MAAaC,OAAb,QAAaA,OAAb;AAAA,MAAsBC,SAAtB,QAAsBA,SAAtB;AAAA;AAAA;AACpB;AACA;AACE,MAAA,SAAS,EAAEA,SADb;AAEE,MAAA,OAAO,EAAED,OAFX;AAGE,MAAA,IAAI,EAAEA,OAAO,GAAG,QAAH,GAAc;AAH7B,OAKGD,QALH;AAFoB;AAAA;;;IAYhBG,iBAAiB,GAAG,SAApBA,iBAAoB;AAAA,MAAGH,QAAH,SAAGA,QAAH;AAAA,sBAAkBI,wCAAC,IAAD,QAAOJ,QAAP,CAAlB;AAAA;;AAE1B,IAAMK,WAAW,GAAG;AAClB;AACAL,EAAAA,QAAQ,EAAEM,mBAAS,CAACC,SAAV,CAAoB,CAC5BD,mBAAS,CAACE,MADkB,EAE5BF,mBAAS,CAACG,OAFkB,CAApB,EAGPC,WAHO,CAGK,4CAHL,CAFQ;;AAMlB;AACAT,EAAAA,OAAO,EAAEK,mBAAS,CAACK,IAAV,CAAeD,WAAf,CAA2B,eAA3B,CAPS;;AAQlB;AACAR,EAAAA,SAAS,EAAEI,mBAAS,CAACK,IAAV,CAAeD,WAAf,CAA2B,kBAA3B;AATO,CAApB;AAYA,IAAME,SAAS,GAAG;AAChB;AACAZ,EAAAA,QAAQ,EAAEM,mBAAS,CAACE,MAAV,CAAiBK,UAAjB,CAA4BH,WAA5B,CAAwC,WAAxC;AAFM,CAAlB;AAKAX,aAAa,CAACe,SAAd,GAA0BT,WAA1B;AACAF,iBAAiB,CAACW,SAAlB,GAA8BF,SAA9B;IACMG,uBAAuB,GAAGC,kBAAQ,CAACjB,aAAD;IAClCkB,2BAA2B,GAAGD,kBAAQ,CAACb,iBAAD;AAC5Cc,2BAA2B,CAACH,SAA5B,GAAwCF,SAAxC;AACAG,uBAAuB,CAACD,SAAxB,GAAoCT,WAApC;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ToastPosition.js","sources":["../../src/ToastPosition.tsx"],"sourcesContent":["export const ToastPosition = {\n TOP_RIGHT: 'top-right',\n TOP_CENTER: 'top-center',\n TOP_LEFT: 'top-left',\n BOTTOM_RIGHT: 'bottom-right',\n BOTTOM_CENTER: 'bottom-center',\n BOTTOM_LEFT: 'bottom-left',\n};\n\nexport const toastsPositions = Object.values(ToastPosition);\n"],"names":["ToastPosition","TOP_RIGHT","TOP_CENTER","TOP_LEFT","BOTTOM_RIGHT","BOTTOM_CENTER","BOTTOM_LEFT","toastsPositions","Object","values"],"mappings":";;;;IAAaA,aAAa,GAAG;AAC3BC,EAAAA,SAAS,EAAE,WADgB;AAE3BC,EAAAA,UAAU,EAAE,YAFe;AAG3BC,EAAAA,QAAQ,EAAE,UAHiB;AAI3BC,EAAAA,YAAY,EAAE,cAJa;AAK3BC,EAAAA,aAAa,EAAE,eALY;AAM3BC,EAAAA,WAAW,EAAE;AANc;IAShBC,eAAe,GAAGC,MAAM,CAACC,MAAP,CAAcT,aAAd;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ToastRender.js","sources":["../../src/ToastRender.tsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { CheckmarkCircleFill, WarningCircleFill, InfoCircleFill } from '@elliemae/ds-icons';\nimport { ToastType, toastTypes } from './ToastType';\n\nconst blockName = 'toast-content';\nconst Container = aggregatedClasses('div')(blockName);\nconst IconContainer = aggregatedClasses('div')(blockName, 'icon-container');\nconst MessageContent = aggregatedClasses('div')(blockName, 'message-content');\nconst MessageHeader = aggregatedClasses('div')(blockName, 'message-header');\nconst MessageText = aggregatedClasses('span')(blockName, 'message-text');\n\nconst getIconByToastType = (type) =>\n ({\n [ToastType.SUCCESS]: CheckmarkCircleFill,\n [ToastType.WARNING]: WarningCircleFill,\n [ToastType.INFO]: InfoCircleFill,\n [ToastType.ERROR]: WarningCircleFill,\n [ToastType.DEFAULT]: 'div',\n }[type]);\n\nconst ToastRender = ({ type = ToastType.DEFAULT, messageTitle = '', messageText = '' }) => {\n const IconMessage = aggregatedClasses(getIconByToastType(type))(blockName, 'icon-message');\n return (\n <Container data-testid=\"ds-toast-render\">\n <IconContainer>\n <IconMessage size=\"m\" />\n </IconContainer>\n <MessageContent>\n <MessageHeader>{messageTitle}</MessageHeader>\n <MessageText>{messageText}</MessageText>\n </MessageContent>\n </Container>\n );\n};\n\nToastRender.propTypes = {\n /**\n * Toast title\n */\n messageTitle: PropTypes.string.isRequired,\n /**\n * Toast body, either a string or Action with ActionLink component\n */\n messageText: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),\n /**\n * Toast type\n */\n type: PropTypes.oneOf(toastTypes).isRequired,\n};\n\nexport default ToastRender;\n"],"names":["blockName","Container","aggregatedClasses","IconContainer","MessageContent","MessageHeader","MessageText","getIconByToastType","type","ToastType","SUCCESS","CheckmarkCircleFill","WARNING","WarningCircleFill","INFO","InfoCircleFill","ERROR","DEFAULT","ToastRender","messageTitle","messageText","IconMessage","React","propTypes","PropTypes","string","isRequired","oneOfType","element","oneOf","toastTypes"],"mappings":";;;;;;;;;;;;;;;AAMA,IAAMA,SAAS,GAAG,eAAlB;AACA,IAAMC,SAAS,GAAGC,8BAAiB,CAAC,KAAD,CAAjB,CAAyBF,SAAzB,CAAlB;AACA,IAAMG,aAAa,GAAGD,8BAAiB,CAAC,KAAD,CAAjB,CAAyBF,SAAzB,EAAoC,gBAApC,CAAtB;AACA,IAAMI,cAAc,GAAGF,8BAAiB,CAAC,KAAD,CAAjB,CAAyBF,SAAzB,EAAoC,iBAApC,CAAvB;AACA,IAAMK,aAAa,GAAGH,8BAAiB,CAAC,KAAD,CAAjB,CAAyBF,SAAzB,EAAoC,gBAApC,CAAtB;AACA,IAAMM,WAAW,GAAGJ,8BAAiB,CAAC,MAAD,CAAjB,CAA0BF,SAA1B,EAAqC,cAArC,CAApB;;AAEA,IAAMO,kBAAkB,GAAG,SAArBA,kBAAqB,CAACC,IAAD;AAAA;;AAAA,SACxB,wFACEC,mBAAS,CAACC,OADZ,EACsBC,2BADtB,8DAEEF,mBAAS,CAACG,OAFZ,EAEsBC,yBAFtB,8DAGEJ,mBAAS,CAACK,IAHZ,EAGmBC,sBAHnB,8DAIEN,mBAAS,CAACO,KAJZ,EAIoBH,yBAJpB,8DAKEJ,mBAAS,CAACQ,OALZ,EAKsB,KALtB,0BAMCT,IAND,CADwB;AAAA,CAA3B;;IASMU,WAAW,GAAG,SAAdA,WAAc,OAAuE;AAAA,uBAApEV,IAAoE;AAAA,MAApEA,IAAoE,0BAA7DC,mBAAS,CAACQ,OAAmD;AAAA,+BAA1CE,YAA0C;AAAA,MAA1CA,YAA0C,kCAA3B,EAA2B;AAAA,8BAAvBC,WAAuB;AAAA,MAAvBA,WAAuB,iCAAT,EAAS;AACzF,MAAMC,WAAW,GAAGnB,8BAAiB,CAACK,kBAAkB,CAACC,IAAD,CAAnB,CAAjB,CAA4CR,SAA5C,EAAuD,cAAvD,CAApB;AACA,sBACEsB,wCAAC,SAAD;AAAW,mBAAY;AAAvB,kBACEA,wCAAC,aAAD,qBACEA,wCAAC,WAAD;AAAa,IAAA,IAAI,EAAC;AAAlB,IADF,CADF,eAIEA,wCAAC,cAAD,qBACEA,wCAAC,aAAD,QAAgBH,YAAhB,CADF,eAEEG,wCAAC,WAAD,QAAcF,WAAd,CAFF,CAJF,CADF;AAWD;;AAEDF,WAAW,CAACK,SAAZ,GAAwB;AACtB;AACF;AACA;AACEJ,EAAAA,YAAY,EAAEK,6BAAS,CAACC,MAAV,CAAiBC,UAJT;;AAKtB;AACF;AACA;AACEN,EAAAA,WAAW,EAAEI,6BAAS,CAACG,SAAV,CAAoB,CAACH,6BAAS,CAACC,MAAX,EAAmBD,6BAAS,CAACI,OAA7B,CAApB,CARS;;AAStB;AACF;AACA;AACEpB,EAAAA,IAAI,EAAEgB,6BAAS,CAACK,KAAV,CAAgBC,oBAAhB,EAA4BJ;AAZZ,CAAxB;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ToastType.js","sources":["../../src/ToastType.tsx"],"sourcesContent":["export const ToastType = {\n INFO: 'info',\n SUCCESS: 'success',\n WARNING: 'warning',\n ERROR: 'error',\n // TODO remove from types, it's not in spec\n DEFAULT: 'default',\n};\n\nexport const toastTypes = Object.values(ToastType);\n"],"names":["ToastType","INFO","SUCCESS","WARNING","ERROR","DEFAULT","toastTypes","Object","values"],"mappings":";;;;IAAaA,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,MADiB;AAEvBC,EAAAA,OAAO,EAAE,SAFc;AAGvBC,EAAAA,OAAO,EAAE,SAHc;AAIvBC,EAAAA,KAAK,EAAE,OAJgB;AAKvB;AACAC,EAAAA,OAAO,EAAE;AANc;IASZC,UAAU,GAAGC,MAAM,CAACC,MAAP,CAAcR,SAAd;;;;;"}
package/cjs/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/cjs/toast.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"toast.js","sources":["../../src/toast.tsx"],"sourcesContent":["import React from 'react';\nimport { toast as toastifyToast } from 'react-toastify';\nimport ToastRender from './ToastRender';\n\nconst toast = Object.assign(\n ({ type, messageTitle, messageText, ...rest }, options) =>\n toastifyToast(\n <ToastRender\n messageText={messageText}\n messageTitle={messageTitle}\n type={type}\n />,\n {\n ...rest,\n ...options,\n type,\n },\n ),\n { ...toastifyToast, isActive: (id) => toastifyToast.isActive(id) },\n);\nexport { toast };\n"],"names":["toast","Object","assign","options","type","messageTitle","messageText","rest","toastifyToast","React","isActive","id"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;IAIMA,KAAK,GAAGC,MAAM,CAACC,MAAP,CACZ,gBAA+CC,OAA/C;AAAA,MAAGC,IAAH,QAAGA,IAAH;AAAA,MAASC,YAAT,QAASA,YAAT;AAAA,MAAuBC,WAAvB,QAAuBA,WAAvB;AAAA,MAAuCC,IAAvC;;AAAA,SACEC,mBAAa,eACXC,wCAAC,WAAD;AACE,IAAA,WAAW,EAAEH,WADf;AAEE,IAAA,YAAY,EAAED,YAFhB;AAGE,IAAA,IAAI,EAAED;AAHR,IADW,gDAONG,IAPM,GAQNJ,OARM;AASTC,IAAAA,IAAI,EAAJA;AATS,KADf;AAAA,CADY,kCAcPI,mBAdO;AAcQE,EAAAA,QAAQ,EAAE,kBAACC,EAAD;AAAA,WAAQH,mBAAa,CAACE,QAAd,CAAuBC,EAAvB,CAAR;AAAA;AAdlB;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"DSToast.js","sources":["../../src/DSToast.tsx"],"sourcesContent":["import React from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport { ToastContainer, Slide } from 'react-toastify';\nimport { CloseSmall } from '@elliemae/ds-icons';\nimport DSButton from '@elliemae/ds-button';\nimport { toastsPositions } from './ToastPosition';\n\nconst CloseButton = ({ closeToast }) => (\n <DSButton buttonType=\"text\" className=\"toast-close-button\" icon={<CloseSmall />} onClick={closeToast} size=\"m\" />\n);\n\nconst DSToast = ({\n containerProps = {},\n position = 'bottom-left',\n autoClose = 5000, // can be false or a number in milliseconds\n showProgressBar = false,\n closeOnClick = false,\n enableMultiContainer = false,\n containerId = undefined,\n toastId = undefined,\n}) => (\n <ToastContainer\n {...containerProps}\n autoClose={autoClose}\n className={(showProgressBar && 'with-progressbar') || ''}\n closeButton={<CloseButton />}\n closeOnClick={closeOnClick}\n containerId={containerId}\n enableMultiContainer={enableMultiContainer}\n hideProgressBar={!showProgressBar}\n newestOnTop\n position={position}\n toastId={toastId}\n transition={Slide}\n />\n);\n\nconst props = {\n /** inject props to wrapper */\n containerProps: PropTypes.object.description('inject props to wrapper'),\n /** Position on the screen to show the toast */\n position: PropTypes.oneOf(toastsPositions).description('Position on the screen to show the toast'),\n /** ms to autoclose the toast */\n autoClose: PropTypes.number.description('ms to autoclose the toast'),\n /** Whether to show a progress bar indicating when the toast is going to be closed */\n showProgressBar: PropTypes.bool.description(\n 'Whether to show a progress bar indicating when the toast is going to be closed',\n ),\n /** Close toast handler */\n closeOnClick: PropTypes.bool.description('Close toast handler'),\n /** Allows instantiating multiple Toast containers */\n enableMultiContainer: PropTypes.bool.description('Allows instantiating multiple Toast containers'),\n /** unique id for multi container */\n containerId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('unique id for multi container'),\n /** id for the toast */\n toastId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('id for the toast'),\n};\n\nDSToast.propTypes = props;\nconst DSToastWithSchema = describe(DSToast);\nDSToastWithSchema.propTypes = props;\n\nexport { DSToast, DSToastWithSchema };\nexport default DSToast;\n"],"names":["CloseButton","closeToast","DSToast","containerProps","position","autoClose","showProgressBar","closeOnClick","enableMultiContainer","containerId","undefined","toastId","Slide","props","PropTypes","object","description","oneOf","toastsPositions","number","bool","oneO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