@elliemae/ds-toast 2.3.0-alpha.8 → 2.3.0-next.2

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.
Files changed (50) hide show
  1. package/cjs/DSToast.js +102 -0
  2. package/cjs/ToastAction.js +67 -0
  3. package/cjs/ToastPosition.js +16 -0
  4. package/cjs/ToastRender.js +42 -0
  5. package/cjs/ToastType.js +16 -0
  6. package/cjs/index.js +24 -0
  7. package/cjs/toast.js +47 -0
  8. package/esm/DSToast.js +90 -0
  9. package/esm/ToastAction.js +55 -0
  10. package/esm/ToastPosition.js +11 -0
  11. package/esm/ToastRender.js +36 -0
  12. package/esm/ToastType.js +11 -0
  13. package/esm/index.js +5 -0
  14. package/esm/toast.js +37 -0
  15. package/package.json +32 -34
  16. package/types/DSToast.d.ts +79 -0
  17. package/types/ToastAction.d.ts +52 -0
  18. package/types/ToastPosition.d.ts +9 -0
  19. package/types/ToastRender.d.ts +24 -0
  20. package/types/ToastType.d.ts +8 -0
  21. package/types/index.d.ts +6 -0
  22. package/types/toast.d.ts +38 -0
  23. package/dist/cjs/DSToast.js +0 -86
  24. package/dist/cjs/DSToast.js.map +0 -7
  25. package/dist/cjs/ToastAction.js +0 -67
  26. package/dist/cjs/ToastAction.js.map +0 -7
  27. package/dist/cjs/ToastPosition.js +0 -44
  28. package/dist/cjs/ToastPosition.js.map +0 -7
  29. package/dist/cjs/ToastRender.js +0 -66
  30. package/dist/cjs/ToastRender.js.map +0 -7
  31. package/dist/cjs/ToastType.js +0 -43
  32. package/dist/cjs/ToastType.js.map +0 -7
  33. package/dist/cjs/index.js +0 -40
  34. package/dist/cjs/index.js.map +0 -7
  35. package/dist/cjs/toast.js +0 -46
  36. package/dist/cjs/toast.js.map +0 -7
  37. package/dist/esm/DSToast.js +0 -57
  38. package/dist/esm/DSToast.js.map +0 -7
  39. package/dist/esm/ToastAction.js +0 -38
  40. package/dist/esm/ToastAction.js.map +0 -7
  41. package/dist/esm/ToastPosition.js +0 -15
  42. package/dist/esm/ToastPosition.js.map +0 -7
  43. package/dist/esm/ToastRender.js +0 -37
  44. package/dist/esm/ToastRender.js.map +0 -7
  45. package/dist/esm/ToastType.js +0 -14
  46. package/dist/esm/ToastType.js.map +0 -7
  47. package/dist/esm/index.js +0 -11
  48. package/dist/esm/index.js.map +0 -7
  49. package/dist/esm/toast.js +0 -17
  50. package/dist/esm/toast.js.map +0 -7
package/package.json CHANGED
@@ -1,42 +1,39 @@
1
1
  {
2
2
  "name": "@elliemae/ds-toast",
3
- "version": "2.3.0-alpha.8",
3
+ "version": "2.3.0-next.2",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Toast",
6
- "files": [
7
- "dist"
8
- ],
9
- "module": "./dist/esm/index.js",
10
- "main": "./dist/cjs/index.js",
11
- "types": "./dist/types/index.d.ts",
6
+ "module": "./esm/index.js",
7
+ "main": "./cjs/index.js",
8
+ "types": "./types/index.d.ts",
12
9
  "exports": {
13
10
  ".": {
14
- "import": "./dist/esm/index.js",
15
- "require": "./dist/cjs/index.js"
11
+ "import": "./esm/index.js",
12
+ "require": "./cjs/index.js"
16
13
  },
17
14
  "./ToastType": {
18
- "import": "./dist/esm/ToastType.js",
19
- "require": "./dist/cjs/ToastType.js"
15
+ "import": "./esm/ToastType.js",
16
+ "require": "./cjs/ToastType.js"
20
17
  },
21
18
  "./ToastRender": {
22
- "import": "./dist/esm/ToastRender.js",
23
- "require": "./dist/cjs/ToastRender.js"
19
+ "import": "./esm/ToastRender.js",
20
+ "require": "./cjs/ToastRender.js"
24
21
  },
25
22
  "./ToastPosition": {
26
- "import": "./dist/esm/ToastPosition.js",
27
- "require": "./dist/cjs/ToastPosition.js"
23
+ "import": "./esm/ToastPosition.js",
24
+ "require": "./cjs/ToastPosition.js"
28
25
  },
29
26
  "./ToastAction": {
30
- "import": "./dist/esm/ToastAction.js",
31
- "require": "./dist/cjs/ToastAction.js"
27
+ "import": "./esm/ToastAction.js",
28
+ "require": "./cjs/ToastAction.js"
32
29
  },
33
30
  "./toast": {
34
- "import": "./dist/esm/toast.js",
35
- "require": "./dist/cjs/toast.js"
31
+ "import": "./esm/toast.js",
32
+ "require": "./cjs/toast.js"
36
33
  },
37
34
  "./DSToast": {
38
- "import": "./dist/esm/DSToast.js",
39
- "require": "./dist/cjs/DSToast.js"
35
+ "import": "./esm/DSToast.js",
36
+ "require": "./cjs/DSToast.js"
40
37
  }
41
38
  },
42
39
  "sideEffects": [
@@ -48,15 +45,21 @@
48
45
  "url": "https://git.elliemae.io/platform-ui/dimsum.git"
49
46
  },
50
47
  "engines": {
51
- "pnpm": ">=6",
52
- "node": ">=16"
48
+ "npm": ">=7",
49
+ "node": ">=14"
53
50
  },
54
51
  "author": "ICE MT",
52
+ "scripts": {
53
+ "dev": "cross-env NODE_ENV=development && node ../../scripts/build/build.js -w",
54
+ "prebuild": "exit 0",
55
+ "predev": "exit 0",
56
+ "build": "node ../../scripts/build/build.js"
57
+ },
55
58
  "dependencies": {
56
- "@elliemae/ds-button": "2.3.0-alpha.8",
57
- "@elliemae/ds-classnames": "2.3.0-alpha.8",
58
- "@elliemae/ds-icons": "2.3.0-alpha.8",
59
- "@elliemae/ds-system": "2.3.0-alpha.8",
59
+ "@elliemae/ds-button": "2.3.0-next.2",
60
+ "@elliemae/ds-classnames": "2.3.0-next.2",
61
+ "@elliemae/ds-icons": "2.3.0-next.2",
62
+ "@elliemae/ds-system": "2.3.0-next.1",
60
63
  "prop-types": "~15.7.2",
61
64
  "react-desc": "~4.1.3",
62
65
  "react-toastify": "~6.2.0"
@@ -72,12 +75,7 @@
72
75
  },
73
76
  "publishConfig": {
74
77
  "access": "public",
75
- "typeSafety": false
76
- },
77
- "scripts": {
78
- "dev": "cross-env NODE_ENV=development && node ../../scripts/build/build.js -w",
79
- "prebuild": "exit 0",
80
- "predev": "exit 0",
81
- "build": "node ../../scripts/build/build.js"
78
+ "directory": "dist",
79
+ "generateSubmodules": true
82
80
  }
83
81
  }
@@ -0,0 +1,79 @@
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(arg: import("react-desc").ReactDescPossibleDefaultValues): {
18
+ deprecated: import("react-desc").PropTypesDescValidator;
19
+ };
20
+ isRequired: import("react-desc").PropTypesDescValue;
21
+ };
22
+ /** Position on the screen to show the toast */
23
+ position: {
24
+ defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
25
+ deprecated: import("react-desc").PropTypesDescValidator;
26
+ };
27
+ isRequired: import("react-desc").PropTypesDescValue;
28
+ };
29
+ /** ms to autoclose the toast */
30
+ autoClose: {
31
+ defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
32
+ deprecated: import("react-desc").PropTypesDescValidator;
33
+ };
34
+ isRequired: import("react-desc").PropTypesDescValue;
35
+ };
36
+ /** Whether to show a progress bar indicating when the toast is going to be closed */
37
+ showProgressBar: {
38
+ defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
39
+ deprecated: import("react-desc").PropTypesDescValidator;
40
+ };
41
+ isRequired: import("react-desc").PropTypesDescValue;
42
+ };
43
+ /** Close toast handler */
44
+ closeOnClick: {
45
+ defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
46
+ deprecated: import("react-desc").PropTypesDescValidator;
47
+ };
48
+ isRequired: import("react-desc").PropTypesDescValue;
49
+ };
50
+ /** Allows instantiating multiple Toast containers */
51
+ enableMultiContainer: {
52
+ defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
53
+ deprecated: import("react-desc").PropTypesDescValidator;
54
+ };
55
+ isRequired: import("react-desc").PropTypesDescValue;
56
+ };
57
+ /** unique id for multi container */
58
+ containerId: {
59
+ defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
60
+ deprecated: import("react-desc").PropTypesDescValidator;
61
+ };
62
+ isRequired: import("react-desc").PropTypesDescValue;
63
+ };
64
+ /** id for the toast */
65
+ toastId: {
66
+ defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
67
+ deprecated: import("react-desc").PropTypesDescValidator;
68
+ };
69
+ isRequired: import("react-desc").PropTypesDescValue;
70
+ };
71
+ };
72
+ };
73
+ declare const DSToastWithSchema: {
74
+ (props?: unknown): JSX.Element;
75
+ propTypes: unknown;
76
+ toTypescript: () => import("react-desc").TypescriptSchema;
77
+ };
78
+ export { DSToast, DSToastWithSchema };
79
+ export default DSToast;
@@ -0,0 +1,52 @@
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(arg: import("react-desc").ReactDescPossibleDefaultValues): {
13
+ deprecated: import("react-desc").PropTypesDescValidator;
14
+ };
15
+ isRequired: import("react-desc").PropTypesDescValue;
16
+ };
17
+ /** click handler */
18
+ onClick: {
19
+ defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
20
+ deprecated: import("react-desc").PropTypesDescValidator;
21
+ };
22
+ isRequired: import("react-desc").PropTypesDescValue;
23
+ };
24
+ /** key down handler */
25
+ onKeyDown: {
26
+ defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
27
+ deprecated: import("react-desc").PropTypesDescValidator;
28
+ };
29
+ isRequired: import("react-desc").PropTypesDescValue;
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?: unknown): JSX.Element;
44
+ propTypes: unknown;
45
+ toTypescript: () => import("react-desc").TypescriptSchema;
46
+ };
47
+ declare const DSToastActionLinkWithSchema: {
48
+ (props?: unknown): JSX.Element;
49
+ propTypes: unknown;
50
+ toTypescript: () => import("react-desc").TypescriptSchema;
51
+ };
52
+ 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,86 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
- }
18
- return target;
19
- };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
- var DSToast_exports = {};
29
- __export(DSToast_exports, {
30
- DSToast: () => DSToast,
31
- DSToastWithSchema: () => DSToastWithSchema,
32
- default: () => DSToast_default
33
- });
34
- var React = __toESM(require("react"));
35
- var import_react = __toESM(require("react"));
36
- var import_react_desc = require("react-desc");
37
- var import_react_toastify = require("react-toastify");
38
- var import_ds_icons = require("@elliemae/ds-icons");
39
- var import_ds_button = __toESM(require("@elliemae/ds-button"));
40
- var import_ToastPosition = require("./ToastPosition");
41
- const CloseButton = ({ closeToast }) => /* @__PURE__ */ import_react.default.createElement(import_ds_button.default, {
42
- buttonType: "text",
43
- className: "toast-close-button",
44
- icon: /* @__PURE__ */ import_react.default.createElement(import_ds_icons.CloseSmall, null),
45
- onClick: closeToast,
46
- size: "m"
47
- });
48
- const DSToast = ({
49
- containerProps = {},
50
- position = "bottom-left",
51
- autoClose = 5e3,
52
- showProgressBar = false,
53
- closeOnClick = false,
54
- enableMultiContainer = false,
55
- containerId = void 0,
56
- toastId = void 0
57
- }) => /* @__PURE__ */ import_react.default.createElement(import_react_toastify.ToastContainer, {
58
- ...containerProps,
59
- autoClose,
60
- className: showProgressBar && "with-progressbar" || "",
61
- closeButton: /* @__PURE__ */ import_react.default.createElement(CloseButton, null),
62
- closeOnClick,
63
- containerId,
64
- enableMultiContainer,
65
- hideProgressBar: !showProgressBar,
66
- newestOnTop: true,
67
- position,
68
- toastId,
69
- transition: import_react_toastify.Slide
70
- });
71
- const props = {
72
- containerProps: import_react_desc.PropTypes.object.description("inject props to wrapper"),
73
- position: import_react_desc.PropTypes.oneOf(import_ToastPosition.toastsPositions).description("Position on the screen to show the toast"),
74
- autoClose: import_react_desc.PropTypes.number.description("ms to autoclose the toast"),
75
- showProgressBar: import_react_desc.PropTypes.bool.description("Whether to show a progress bar indicating when the toast is going to be closed"),
76
- closeOnClick: import_react_desc.PropTypes.bool.description("Close toast handler"),
77
- enableMultiContainer: import_react_desc.PropTypes.bool.description("Allows instantiating multiple Toast containers"),
78
- containerId: import_react_desc.PropTypes.oneOfType([import_react_desc.PropTypes.string, import_react_desc.PropTypes.number]).description("unique id for multi container"),
79
- toastId: import_react_desc.PropTypes.oneOfType([import_react_desc.PropTypes.string, import_react_desc.PropTypes.number]).description("id for the toast")
80
- };
81
- DSToast.propTypes = props;
82
- const DSToastWithSchema = (0, import_react_desc.describe)(DSToast);
83
- DSToastWithSchema.propTypes = props;
84
- var DSToast_default = DSToast;
85
- module.exports = __toCommonJS(DSToast_exports);
86
- //# sourceMappingURL=DSToast.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/DSToast.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "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", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,wBAAoC;AACpC,4BAAsC;AACtC,sBAA2B;AAC3B,uBAAqB;AACrB,2BAAgC;AAEhC,MAAM,cAAc,CAAC,EAAE,iBACrB,mDAAC,0BAAD;AAAA,EAAU,YAAW;AAAA,EAAO,WAAU;AAAA,EAAqB,MAAM,mDAAC,4BAAD;AAAA,EAAgB,SAAS;AAAA,EAAY,MAAK;AAAA;AAG7G,MAAM,UAAU,CAAC;AAAA,EACf,iBAAiB;AAAA,EACjB,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,kBAAkB;AAAA,EAClB,eAAe;AAAA,EACf,uBAAuB;AAAA,EACvB,cAAc;AAAA,EACd,UAAU;AAAA,MAEV,mDAAC,sCAAD;AAAA,KACM;AAAA,EACJ;AAAA,EACA,WAAY,mBAAmB,sBAAuB;AAAA,EACtD,aAAa,mDAAC,aAAD;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA,iBAAiB,CAAC;AAAA,EAClB,aAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA,YAAY;AAAA;AAIhB,MAAM,QAAQ;AAAA,EAEZ,gBAAgB,4BAAU,OAAO,YAAY;AAAA,EAE7C,UAAU,4BAAU,MAAM,sCAAiB,YAAY;AAAA,EAEvD,WAAW,4BAAU,OAAO,YAAY;AAAA,EAExC,iBAAiB,4BAAU,KAAK,YAC9B;AAAA,EAGF,cAAc,4BAAU,KAAK,YAAY;AAAA,EAEzC,sBAAsB,4BAAU,KAAK,YAAY;AAAA,EAEjD,aAAa,4BAAU,UAAU,CAAC,4BAAU,QAAQ,4BAAU,SAAS,YAAY;AAAA,EAEnF,SAAS,4BAAU,UAAU,CAAC,4BAAU,QAAQ,4BAAU,SAAS,YAAY;AAAA;AAGjF,QAAQ,YAAY;AACpB,MAAM,oBAAoB,gCAAS;AACnC,kBAAkB,YAAY;AAG9B,IAAO,kBAAQ;",
6
- "names": []
7
- }
@@ -1,67 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
- }
18
- return target;
19
- };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
- var ToastAction_exports = {};
29
- __export(ToastAction_exports, {
30
- DSToastAction: () => DSToastAction,
31
- DSToastActionLink: () => DSToastActionLink,
32
- DSToastActionLinkWithSchema: () => DSToastActionLinkWithSchema,
33
- DSToastActionWithSchema: () => DSToastActionWithSchema
34
- });
35
- var React = __toESM(require("react"));
36
- var import_react = __toESM(require("react"));
37
- var import_react_desc = require("react-desc");
38
- var import_styled_components = __toESM(require("styled-components"));
39
- var import_ds_system = require("@elliemae/ds-system");
40
- const Link = import_styled_components.default.span`
41
- ${(0, import_ds_system.color)("brand", "600")}
42
- `;
43
- const DSToastAction = ({ children, onClick, onKeyDown }) => /* @__PURE__ */ import_react.default.createElement("div", {
44
- onKeyDown,
45
- onClick,
46
- role: onClick ? "button" : "textbox"
47
- }, children);
48
- const DSToastActionLink = ({ children }) => /* @__PURE__ */ import_react.default.createElement(Link, null, children);
49
- const actionprops = {
50
- children: import_react_desc.PropTypes.oneOfType([
51
- import_react_desc.PropTypes.string,
52
- import_react_desc.PropTypes.element
53
- ]).description("DSToastActionLink component or text string"),
54
- onClick: import_react_desc.PropTypes.func.description("click handler"),
55
- onKeyDown: import_react_desc.PropTypes.func.description("key down handler")
56
- };
57
- const linkprops = {
58
- children: import_react_desc.PropTypes.string.isRequired.description("link text")
59
- };
60
- DSToastAction.propTypes = actionprops;
61
- DSToastActionLink.propTypes = linkprops;
62
- const DSToastActionWithSchema = (0, import_react_desc.describe)(DSToastAction);
63
- const DSToastActionLinkWithSchema = (0, import_react_desc.describe)(DSToastActionLink);
64
- DSToastActionLinkWithSchema.propTypes = linkprops;
65
- DSToastActionWithSchema.propTypes = actionprops;
66
- module.exports = __toCommonJS(ToastAction_exports);
67
- //# sourceMappingURL=ToastAction.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/ToastAction.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "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", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,wBAAoC;AACpC,+BAAmB;AACnB,uBAAsB;AAEtB,MAAM,OAAO,iCAAO;AAAA,IAChB,4BAAM,SAAS;AAAA;AAGnB,MAAM,gBAAgB,CAAC,EAAE,UAAU,SAAS,gBAE1C,mDAAC,OAAD;AAAA,EACE;AAAA,EACA;AAAA,EACA,MAAM,UAAU,WAAW;AAAA,GAE1B;AAKL,MAAM,oBAAoB,CAAC,EAAE,eAAe,mDAAC,MAAD,MAAO;AAEnD,MAAM,cAAc;AAAA,EAElB,UAAU,4BAAU,UAAU;AAAA,IAC5B,4BAAU;AAAA,IACV,4BAAU;AAAA,KACT,YAAY;AAAA,EAEf,SAAS,4BAAU,KAAK,YAAY;AAAA,EAEpC,WAAW,4BAAU,KAAK,YAAY;AAAA;AAGxC,MAAM,YAAY;AAAA,EAEhB,UAAU,4BAAU,OAAO,WAAW,YAAY;AAAA;AAGpD,cAAc,YAAY;AAC1B,kBAAkB,YAAY;AAC9B,MAAM,0BAA0B,gCAAS;AACzC,MAAM,8BAA8B,gCAAS;AAC7C,4BAA4B,YAAY;AACxC,wBAAwB,YAAY;",
6
- "names": []
7
- }
@@ -1,44 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
- }
18
- return target;
19
- };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
- var ToastPosition_exports = {};
29
- __export(ToastPosition_exports, {
30
- ToastPosition: () => ToastPosition,
31
- toastsPositions: () => toastsPositions
32
- });
33
- var React = __toESM(require("react"));
34
- const ToastPosition = {
35
- TOP_RIGHT: "top-right",
36
- TOP_CENTER: "top-center",
37
- TOP_LEFT: "top-left",
38
- BOTTOM_RIGHT: "bottom-right",
39
- BOTTOM_CENTER: "bottom-center",
40
- BOTTOM_LEFT: "bottom-left"
41
- };
42
- const toastsPositions = Object.values(ToastPosition);
43
- module.exports = __toCommonJS(ToastPosition_exports);
44
- //# sourceMappingURL=ToastPosition.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/ToastPosition.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "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", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,gBAAgB;AAAA,EAC3B,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,cAAc;AAAA,EACd,eAAe;AAAA,EACf,aAAa;AAAA;AAGR,MAAM,kBAAkB,OAAO,OAAO;",
6
- "names": []
7
- }
@@ -1,66 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
- }
18
- return target;
19
- };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
- var ToastRender_exports = {};
29
- __export(ToastRender_exports, {
30
- default: () => ToastRender_default
31
- });
32
- var React = __toESM(require("react"));
33
- var import_react = __toESM(require("react"));
34
- var import_prop_types = __toESM(require("prop-types"));
35
- var import_ds_classnames = require("@elliemae/ds-classnames");
36
- var import_ds_icons = require("@elliemae/ds-icons");
37
- var import_ToastType = require("./ToastType");
38
- const blockName = "toast-content";
39
- const Container = (0, import_ds_classnames.aggregatedClasses)("div")(blockName);
40
- const IconContainer = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "icon-container");
41
- const MessageContent = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "message-content");
42
- const MessageHeader = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "message-header");
43
- const MessageText = (0, import_ds_classnames.aggregatedClasses)("span")(blockName, "message-text");
44
- const getIconByToastType = (type) => ({
45
- [import_ToastType.ToastType.SUCCESS]: import_ds_icons.CheckmarkCircleFill,
46
- [import_ToastType.ToastType.WARNING]: import_ds_icons.WarningCircleFill,
47
- [import_ToastType.ToastType.INFO]: import_ds_icons.InfoCircleFill,
48
- [import_ToastType.ToastType.ERROR]: import_ds_icons.WarningCircleFill,
49
- [import_ToastType.ToastType.DEFAULT]: "div"
50
- })[type];
51
- const ToastRender = ({ type = import_ToastType.ToastType.DEFAULT, messageTitle = "", messageText = "" }) => {
52
- const IconMessage = (0, import_ds_classnames.aggregatedClasses)(getIconByToastType(type))(blockName, "icon-message");
53
- return /* @__PURE__ */ import_react.default.createElement(Container, {
54
- "data-testid": "ds-toast-render"
55
- }, /* @__PURE__ */ import_react.default.createElement(IconContainer, null, /* @__PURE__ */ import_react.default.createElement(IconMessage, {
56
- size: "m"
57
- })), /* @__PURE__ */ import_react.default.createElement(MessageContent, null, /* @__PURE__ */ import_react.default.createElement(MessageHeader, null, messageTitle), /* @__PURE__ */ import_react.default.createElement(MessageText, null, messageText)));
58
- };
59
- ToastRender.propTypes = {
60
- messageTitle: import_prop_types.default.string.isRequired,
61
- messageText: import_prop_types.default.oneOfType([import_prop_types.default.string, import_prop_types.default.element]),
62
- type: import_prop_types.default.oneOf(import_ToastType.toastTypes).isRequired
63
- };
64
- var ToastRender_default = ToastRender;
65
- module.exports = __toCommonJS(ToastRender_exports);
66
- //# sourceMappingURL=ToastRender.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/ToastRender.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "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", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,wBAAsB;AACtB,2BAAkC;AAClC,sBAAuE;AACvE,uBAAsC;AAEtC,MAAM,YAAY;AAClB,MAAM,YAAY,4CAAkB,OAAO;AAC3C,MAAM,gBAAgB,4CAAkB,OAAO,WAAW;AAC1D,MAAM,iBAAiB,4CAAkB,OAAO,WAAW;AAC3D,MAAM,gBAAgB,4CAAkB,OAAO,WAAW;AAC1D,MAAM,cAAc,4CAAkB,QAAQ,WAAW;AAEzD,MAAM,qBAAqB,CAAC,SACzB;AAAA,GACE,2BAAU,UAAU;AAAA,GACpB,2BAAU,UAAU;AAAA,GACpB,2BAAU,OAAO;AAAA,GACjB,2BAAU,QAAQ;AAAA,GAClB,2BAAU,UAAU;AAAA,GACrB;AAEJ,MAAM,cAAc,CAAC,EAAE,OAAO,2BAAU,SAAS,eAAe,IAAI,cAAc,SAAS;AACzF,QAAM,cAAc,4CAAkB,mBAAmB,OAAO,WAAW;AAC3E,SACE,mDAAC,WAAD;AAAA,IAAW,eAAY;AAAA,KACrB,mDAAC,eAAD,MACE,mDAAC,aAAD;AAAA,IAAa,MAAK;AAAA,OAEpB,mDAAC,gBAAD,MACE,mDAAC,eAAD,MAAgB,eAChB,mDAAC,aAAD,MAAc;AAAA;AAMtB,YAAY,YAAY;AAAA,EAItB,cAAc,0BAAU,OAAO;AAAA,EAI/B,aAAa,0BAAU,UAAU,CAAC,0BAAU,QAAQ,0BAAU;AAAA,EAI9D,MAAM,0BAAU,MAAM,6BAAY;AAAA;AAGpC,IAAO,sBAAQ;",
6
- "names": []
7
- }