@elliemae/ds-toast 2.0.0-alpha.11 → 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.
- package/cjs/DSToast.js +45 -35
- package/cjs/ToastAction.js +24 -17
- package/cjs/ToastRender.js +11 -15
- package/cjs/toast.js +5 -0
- package/esm/DSToast.js +44 -33
- package/esm/ToastAction.js +24 -17
- package/esm/ToastRender.js +7 -8
- package/esm/toast.js +5 -0
- package/package.json +8 -7
- package/types/DSToast.d.ts +63 -9
- package/types/ToastAction.d.ts +35 -5
- package/types/ToastRender.d.ts +1 -1
package/cjs/DSToast.js
CHANGED
|
@@ -2,12 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
5
10
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
11
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
7
12
|
require('react');
|
|
8
13
|
var reactDesc = require('react-desc');
|
|
9
14
|
var reactToastify = require('react-toastify');
|
|
10
|
-
var
|
|
15
|
+
var dsIcons = require('@elliemae/ds-icons');
|
|
11
16
|
var DSButton = require('@elliemae/ds-button');
|
|
12
17
|
var ToastPosition = require('./ToastPosition.js');
|
|
13
18
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -16,7 +21,6 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
16
21
|
|
|
17
22
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
18
23
|
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
19
|
-
var CloseSmall__default = /*#__PURE__*/_interopDefaultLegacy(CloseSmall);
|
|
20
24
|
var DSButton__default = /*#__PURE__*/_interopDefaultLegacy(DSButton);
|
|
21
25
|
|
|
22
26
|
var _CloseSmall, _CloseButton;
|
|
@@ -25,39 +29,45 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
25
29
|
|
|
26
30
|
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__default["default"](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; }
|
|
27
31
|
|
|
28
|
-
const CloseButton =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
32
|
+
const CloseButton = _ref => {
|
|
33
|
+
let {
|
|
34
|
+
closeToast
|
|
35
|
+
} = _ref;
|
|
36
|
+
return /*#__PURE__*/_jsx__default["default"](DSButton__default["default"], {
|
|
37
|
+
buttonType: "text",
|
|
38
|
+
className: "toast-close-button",
|
|
39
|
+
icon: _CloseSmall || (_CloseSmall = /*#__PURE__*/_jsx__default["default"](dsIcons.CloseSmall, {})),
|
|
40
|
+
onClick: closeToast,
|
|
41
|
+
size: "m"
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const DSToast = _ref2 => {
|
|
46
|
+
let {
|
|
47
|
+
containerProps = {},
|
|
48
|
+
position = 'bottom-left',
|
|
49
|
+
autoClose = 5000,
|
|
50
|
+
// can be false or a number in milliseconds
|
|
51
|
+
showProgressBar = false,
|
|
52
|
+
closeOnClick = false,
|
|
53
|
+
enableMultiContainer = false,
|
|
54
|
+
containerId = undefined,
|
|
55
|
+
toastId = undefined
|
|
56
|
+
} = _ref2;
|
|
57
|
+
return /*#__PURE__*/jsxRuntime.jsx(reactToastify.ToastContainer, _objectSpread(_objectSpread({}, containerProps), {}, {
|
|
58
|
+
autoClose: autoClose,
|
|
59
|
+
className: showProgressBar && 'with-progressbar' || '',
|
|
60
|
+
closeButton: _CloseButton || (_CloseButton = /*#__PURE__*/_jsx__default["default"](CloseButton, {})),
|
|
61
|
+
closeOnClick: closeOnClick,
|
|
62
|
+
containerId: containerId,
|
|
63
|
+
enableMultiContainer: enableMultiContainer,
|
|
64
|
+
hideProgressBar: !showProgressBar,
|
|
65
|
+
newestOnTop: true,
|
|
66
|
+
position: position,
|
|
67
|
+
toastId: toastId,
|
|
68
|
+
transition: reactToastify.Slide
|
|
69
|
+
}));
|
|
70
|
+
};
|
|
61
71
|
|
|
62
72
|
const props = {
|
|
63
73
|
/** inject props to wrapper */
|
package/cjs/ToastAction.js
CHANGED
|
@@ -17,23 +17,30 @@ const Link = /*#__PURE__*/styled__default["default"].span.withConfig({
|
|
|
17
17
|
componentId: "sc-1bs5g4c-0"
|
|
18
18
|
})(["", ""], dsSystem.color('brand', '600'));
|
|
19
19
|
|
|
20
|
-
const DSToastAction =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
20
|
+
const DSToastAction = _ref => {
|
|
21
|
+
let {
|
|
22
|
+
children,
|
|
23
|
+
onClick,
|
|
24
|
+
onKeyDown
|
|
25
|
+
} = _ref;
|
|
26
|
+
return (
|
|
27
|
+
/*#__PURE__*/
|
|
28
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
29
|
+
_jsx__default["default"]("div", {
|
|
30
|
+
onKeyDown: onKeyDown,
|
|
31
|
+
onClick: onClick,
|
|
32
|
+
role: onClick ? 'button' : 'textbox'
|
|
33
|
+
}, void 0, children)
|
|
34
|
+
);
|
|
35
|
+
}; // eslint-disable-next-line jsx-a11y/anchor-is-valid
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
const DSToastActionLink = _ref2 => {
|
|
39
|
+
let {
|
|
40
|
+
children
|
|
41
|
+
} = _ref2;
|
|
42
|
+
return /*#__PURE__*/_jsx__default["default"](Link, {}, void 0, children);
|
|
43
|
+
};
|
|
37
44
|
|
|
38
45
|
const actionprops = {
|
|
39
46
|
/** DSToastActionLink component or text string */
|
package/cjs/ToastRender.js
CHANGED
|
@@ -3,17 +3,12 @@
|
|
|
3
3
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
4
4
|
require('react');
|
|
5
5
|
var dsClassnames = require('@elliemae/ds-classnames');
|
|
6
|
-
var
|
|
7
|
-
var WarningCircleFill = require('@elliemae/ds-icons/WarningCircleFill');
|
|
8
|
-
var InfoCircleFill = require('@elliemae/ds-icons/InfoCircleFill');
|
|
6
|
+
var dsIcons = require('@elliemae/ds-icons');
|
|
9
7
|
var ToastType = require('./ToastType.js');
|
|
10
8
|
|
|
11
9
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
10
|
|
|
13
11
|
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
14
|
-
var CheckmarkCircleFill__default = /*#__PURE__*/_interopDefaultLegacy(CheckmarkCircleFill);
|
|
15
|
-
var WarningCircleFill__default = /*#__PURE__*/_interopDefaultLegacy(WarningCircleFill);
|
|
16
|
-
var InfoCircleFill__default = /*#__PURE__*/_interopDefaultLegacy(InfoCircleFill);
|
|
17
12
|
|
|
18
13
|
const blockName = 'toast-content';
|
|
19
14
|
const Container = dsClassnames.aggregatedClasses('div')(blockName);
|
|
@@ -23,18 +18,19 @@ const MessageHeader = dsClassnames.aggregatedClasses('div')(blockName, 'message-
|
|
|
23
18
|
const MessageText = dsClassnames.aggregatedClasses('span')(blockName, 'message-text');
|
|
24
19
|
|
|
25
20
|
const getIconByToastType = type => ({
|
|
26
|
-
[ToastType.ToastType.SUCCESS]:
|
|
27
|
-
[ToastType.ToastType.WARNING]:
|
|
28
|
-
[ToastType.ToastType.INFO]:
|
|
29
|
-
[ToastType.ToastType.ERROR]:
|
|
21
|
+
[ToastType.ToastType.SUCCESS]: dsIcons.CheckmarkCircleFill,
|
|
22
|
+
[ToastType.ToastType.WARNING]: dsIcons.WarningCircleFill,
|
|
23
|
+
[ToastType.ToastType.INFO]: dsIcons.InfoCircleFill,
|
|
24
|
+
[ToastType.ToastType.ERROR]: dsIcons.WarningCircleFill,
|
|
30
25
|
[ToastType.ToastType.DEFAULT]: 'div'
|
|
31
26
|
})[type];
|
|
32
27
|
|
|
33
|
-
const ToastRender =
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
28
|
+
const ToastRender = _ref => {
|
|
29
|
+
let {
|
|
30
|
+
type = ToastType.ToastType.DEFAULT,
|
|
31
|
+
messageTitle = '',
|
|
32
|
+
messageText = ''
|
|
33
|
+
} = _ref;
|
|
38
34
|
const IconMessage = dsClassnames.aggregatedClasses(getIconByToastType(type))(blockName, 'icon-message');
|
|
39
35
|
return /*#__PURE__*/_jsx__default["default"](Container, {
|
|
40
36
|
"data-testid": "ds-toast-render"
|
package/cjs/toast.js
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
5
10
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
11
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
7
12
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
package/esm/DSToast.js
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
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';
|
|
2
7
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
3
8
|
import 'react';
|
|
4
9
|
import { PropTypes, describe } from 'react-desc';
|
|
5
10
|
import { ToastContainer, Slide } from 'react-toastify';
|
|
6
|
-
import CloseSmall from '@elliemae/ds-icons
|
|
11
|
+
import { CloseSmall } from '@elliemae/ds-icons';
|
|
7
12
|
import DSButton from '@elliemae/ds-button';
|
|
8
13
|
import { toastsPositions } from './ToastPosition.js';
|
|
9
14
|
import { jsx } from 'react/jsx-runtime';
|
|
@@ -14,39 +19,45 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
14
19
|
|
|
15
20
|
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
21
|
|
|
17
|
-
const CloseButton =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
const CloseButton = _ref => {
|
|
23
|
+
let {
|
|
24
|
+
closeToast
|
|
25
|
+
} = _ref;
|
|
26
|
+
return /*#__PURE__*/_jsx(DSButton, {
|
|
27
|
+
buttonType: "text",
|
|
28
|
+
className: "toast-close-button",
|
|
29
|
+
icon: _CloseSmall || (_CloseSmall = /*#__PURE__*/_jsx(CloseSmall, {})),
|
|
30
|
+
onClick: closeToast,
|
|
31
|
+
size: "m"
|
|
32
|
+
});
|
|
33
|
+
};
|
|
26
34
|
|
|
27
|
-
const DSToast =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
35
|
+
const DSToast = _ref2 => {
|
|
36
|
+
let {
|
|
37
|
+
containerProps = {},
|
|
38
|
+
position = 'bottom-left',
|
|
39
|
+
autoClose = 5000,
|
|
40
|
+
// can be false or a number in milliseconds
|
|
41
|
+
showProgressBar = false,
|
|
42
|
+
closeOnClick = false,
|
|
43
|
+
enableMultiContainer = false,
|
|
44
|
+
containerId = undefined,
|
|
45
|
+
toastId = undefined
|
|
46
|
+
} = _ref2;
|
|
47
|
+
return /*#__PURE__*/jsx(ToastContainer, _objectSpread(_objectSpread({}, containerProps), {}, {
|
|
48
|
+
autoClose: autoClose,
|
|
49
|
+
className: showProgressBar && 'with-progressbar' || '',
|
|
50
|
+
closeButton: _CloseButton || (_CloseButton = /*#__PURE__*/_jsx(CloseButton, {})),
|
|
51
|
+
closeOnClick: closeOnClick,
|
|
52
|
+
containerId: containerId,
|
|
53
|
+
enableMultiContainer: enableMultiContainer,
|
|
54
|
+
hideProgressBar: !showProgressBar,
|
|
55
|
+
newestOnTop: true,
|
|
56
|
+
position: position,
|
|
57
|
+
toastId: toastId,
|
|
58
|
+
transition: Slide
|
|
59
|
+
}));
|
|
60
|
+
};
|
|
50
61
|
|
|
51
62
|
const props = {
|
|
52
63
|
/** inject props to wrapper */
|
package/esm/ToastAction.js
CHANGED
|
@@ -8,23 +8,30 @@ const Link = /*#__PURE__*/styled.span.withConfig({
|
|
|
8
8
|
componentId: "sc-1bs5g4c-0"
|
|
9
9
|
})(["", ""], color('brand', '600'));
|
|
10
10
|
|
|
11
|
-
const DSToastAction =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
11
|
+
const DSToastAction = _ref => {
|
|
12
|
+
let {
|
|
13
|
+
children,
|
|
14
|
+
onClick,
|
|
15
|
+
onKeyDown
|
|
16
|
+
} = _ref;
|
|
17
|
+
return (
|
|
18
|
+
/*#__PURE__*/
|
|
19
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
20
|
+
_jsx("div", {
|
|
21
|
+
onKeyDown: onKeyDown,
|
|
22
|
+
onClick: onClick,
|
|
23
|
+
role: onClick ? 'button' : 'textbox'
|
|
24
|
+
}, void 0, children)
|
|
25
|
+
);
|
|
26
|
+
}; // eslint-disable-next-line jsx-a11y/anchor-is-valid
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
const DSToastActionLink = _ref2 => {
|
|
30
|
+
let {
|
|
31
|
+
children
|
|
32
|
+
} = _ref2;
|
|
33
|
+
return /*#__PURE__*/_jsx(Link, {}, void 0, children);
|
|
34
|
+
};
|
|
28
35
|
|
|
29
36
|
const actionprops = {
|
|
30
37
|
/** DSToastActionLink component or text string */
|
package/esm/ToastRender.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
2
|
import 'react';
|
|
3
3
|
import { aggregatedClasses } from '@elliemae/ds-classnames';
|
|
4
|
-
import CheckmarkCircleFill from '@elliemae/ds-icons
|
|
5
|
-
import WarningCircleFill from '@elliemae/ds-icons/WarningCircleFill';
|
|
6
|
-
import InfoCircleFill from '@elliemae/ds-icons/InfoCircleFill';
|
|
4
|
+
import { CheckmarkCircleFill, WarningCircleFill, InfoCircleFill } from '@elliemae/ds-icons';
|
|
7
5
|
import { ToastType } from './ToastType.js';
|
|
8
6
|
|
|
9
7
|
const blockName = 'toast-content';
|
|
@@ -21,11 +19,12 @@ const getIconByToastType = type => ({
|
|
|
21
19
|
[ToastType.DEFAULT]: 'div'
|
|
22
20
|
})[type];
|
|
23
21
|
|
|
24
|
-
const ToastRender =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
const ToastRender = _ref => {
|
|
23
|
+
let {
|
|
24
|
+
type = ToastType.DEFAULT,
|
|
25
|
+
messageTitle = '',
|
|
26
|
+
messageText = ''
|
|
27
|
+
} = _ref;
|
|
29
28
|
const IconMessage = aggregatedClasses(getIconByToastType(type))(blockName, 'icon-message');
|
|
30
29
|
return /*#__PURE__*/_jsx(Container, {
|
|
31
30
|
"data-testid": "ds-toast-render"
|
package/esm/toast.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
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';
|
|
2
7
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
3
8
|
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-toast",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.12",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Toast",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -56,21 +56,22 @@
|
|
|
56
56
|
"build": "node ../../scripts/build/build.js"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@elliemae/ds-button": "2.0.0-alpha.
|
|
60
|
-
"@elliemae/ds-classnames": "2.0.0-alpha.
|
|
61
|
-
"@elliemae/ds-icons": "2.0.0-alpha.
|
|
62
|
-
"@elliemae/ds-system": "2.0.0-alpha.
|
|
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",
|
|
63
63
|
"prop-types": "~15.7.2",
|
|
64
|
+
"react-desc": "~4.1.3",
|
|
64
65
|
"react-toastify": "~6.2.0"
|
|
65
66
|
},
|
|
66
67
|
"devDependencies": {
|
|
67
|
-
"styled-components": "~5.3.
|
|
68
|
+
"styled-components": "~5.3.3"
|
|
68
69
|
},
|
|
69
70
|
"peerDependencies": {
|
|
70
71
|
"lodash": "^4.17.21",
|
|
71
72
|
"react": "^17.0.2",
|
|
72
73
|
"react-dom": "^17.0.2",
|
|
73
|
-
"styled-components": "^5.3.
|
|
74
|
+
"styled-components": "^5.3.3"
|
|
74
75
|
},
|
|
75
76
|
"publishConfig": {
|
|
76
77
|
"access": "public",
|
package/types/DSToast.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference path="../../../../shared/typings/react-desc.d.ts" />
|
|
1
2
|
/// <reference types="react" />
|
|
2
3
|
declare const DSToast: {
|
|
3
4
|
({ containerProps, position, autoClose, showProgressBar, closeOnClick, enableMultiContainer, containerId, toastId, }: {
|
|
@@ -12,23 +13,76 @@ declare const DSToast: {
|
|
|
12
13
|
}): JSX.Element;
|
|
13
14
|
propTypes: {
|
|
14
15
|
/** inject props to wrapper */
|
|
15
|
-
containerProps:
|
|
16
|
+
containerProps: {
|
|
17
|
+
defaultValue<T = unknown>(arg: T): {
|
|
18
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
19
|
+
};
|
|
20
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
21
|
+
};
|
|
16
22
|
/** Position on the screen to show the toast */
|
|
17
|
-
position:
|
|
23
|
+
position: {
|
|
24
|
+
defaultValue<T = unknown>(arg: T): {
|
|
25
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
26
|
+
};
|
|
27
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
28
|
+
};
|
|
18
29
|
/** ms to autoclose the toast */
|
|
19
|
-
autoClose:
|
|
30
|
+
autoClose: {
|
|
31
|
+
defaultValue<T = unknown>(arg: T): {
|
|
32
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
33
|
+
};
|
|
34
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
35
|
+
};
|
|
20
36
|
/** Whether to show a progress bar indicating when the toast is going to be closed */
|
|
21
|
-
showProgressBar:
|
|
37
|
+
showProgressBar: {
|
|
38
|
+
defaultValue<T = unknown>(arg: T): {
|
|
39
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
40
|
+
};
|
|
41
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
42
|
+
};
|
|
22
43
|
/** Close toast handler */
|
|
23
|
-
closeOnClick:
|
|
44
|
+
closeOnClick: {
|
|
45
|
+
defaultValue<T = unknown>(arg: T): {
|
|
46
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
47
|
+
};
|
|
48
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
49
|
+
};
|
|
24
50
|
/** Allows instantiating multiple Toast containers */
|
|
25
|
-
enableMultiContainer:
|
|
51
|
+
enableMultiContainer: {
|
|
52
|
+
defaultValue<T = unknown>(arg: T): {
|
|
53
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
54
|
+
};
|
|
55
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
56
|
+
};
|
|
26
57
|
/** unique id for multi container */
|
|
27
|
-
containerId:
|
|
58
|
+
containerId: {
|
|
59
|
+
defaultValue<T = unknown>(arg: T): {
|
|
60
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
61
|
+
};
|
|
62
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
63
|
+
};
|
|
28
64
|
/** id for the toast */
|
|
29
|
-
toastId:
|
|
65
|
+
toastId: {
|
|
66
|
+
defaultValue<T = unknown>(arg: T): {
|
|
67
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
68
|
+
};
|
|
69
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
70
|
+
};
|
|
30
71
|
};
|
|
31
72
|
};
|
|
32
|
-
declare const DSToastWithSchema:
|
|
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
|
+
};
|
|
33
87
|
export { DSToast, DSToastWithSchema };
|
|
34
88
|
export default DSToast;
|
package/types/ToastAction.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference path="../../../../shared/typings/react-desc.d.ts" />
|
|
1
2
|
/// <reference types="react" />
|
|
2
3
|
declare const DSToastAction: {
|
|
3
4
|
({ children, onClick, onKeyDown }: {
|
|
@@ -7,11 +8,26 @@ declare const DSToastAction: {
|
|
|
7
8
|
}): JSX.Element;
|
|
8
9
|
propTypes: {
|
|
9
10
|
/** DSToastActionLink component or text string */
|
|
10
|
-
children:
|
|
11
|
+
children: {
|
|
12
|
+
defaultValue<T = unknown>(arg: T): {
|
|
13
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
14
|
+
};
|
|
15
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
16
|
+
};
|
|
11
17
|
/** click handler */
|
|
12
|
-
onClick:
|
|
18
|
+
onClick: {
|
|
19
|
+
defaultValue<T = unknown>(arg: T): {
|
|
20
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
21
|
+
};
|
|
22
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
23
|
+
};
|
|
13
24
|
/** key down handler */
|
|
14
|
-
onKeyDown:
|
|
25
|
+
onKeyDown: {
|
|
26
|
+
defaultValue<T = unknown>(arg: T): {
|
|
27
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
28
|
+
};
|
|
29
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
30
|
+
};
|
|
15
31
|
};
|
|
16
32
|
};
|
|
17
33
|
declare const DSToastActionLink: {
|
|
@@ -23,6 +39,20 @@ declare const DSToastActionLink: {
|
|
|
23
39
|
children: any;
|
|
24
40
|
};
|
|
25
41
|
};
|
|
26
|
-
declare const DSToastActionWithSchema:
|
|
27
|
-
|
|
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
|
+
};
|
|
28
58
|
export { DSToastAction, DSToastActionLink, DSToastActionWithSchema, DSToastActionLinkWithSchema, };
|
package/types/ToastRender.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
declare const ToastRender: {
|
|
4
|
-
({ type, messageTitle, messageText
|
|
4
|
+
({ type, messageTitle, messageText }: {
|
|
5
5
|
type?: string | undefined;
|
|
6
6
|
messageTitle?: string | undefined;
|
|
7
7
|
messageText?: string | undefined;
|