@elliemae/ds-toast 3.29.2-rc.0 → 3.30.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/DSToastDefinitions.js +8 -0
- package/dist/cjs/DSToastDefinitions.js.map +2 -2
- package/dist/cjs/index.js +3 -0
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/parts/DSToastContent.js +10 -2
- package/dist/cjs/parts/DSToastContent.js.map +2 -2
- package/dist/cjs/react-desc-prop-types.js +11 -0
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/toast.js +16 -5
- package/dist/cjs/toast.js.map +2 -2
- package/dist/cjs/typescript-testing/typescript-toast-valid.js +107 -0
- package/dist/cjs/typescript-testing/typescript-toast-valid.js.map +7 -0
- package/dist/esm/DSToastDefinitions.js +8 -0
- package/dist/esm/DSToastDefinitions.js.map +2 -2
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/parts/DSToastContent.js +10 -2
- package/dist/esm/parts/DSToastContent.js.map +2 -2
- package/dist/esm/react-desc-prop-types.js +12 -1
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/esm/toast.js +16 -5
- package/dist/esm/toast.js.map +2 -2
- package/dist/esm/typescript-testing/typescript-toast-valid.js +84 -0
- package/dist/esm/typescript-testing/typescript-toast-valid.js.map +7 -0
- package/dist/types/DSToastDefinitions.d.ts +5 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/parts/DSToastActionLink.d.ts +12 -0
- package/dist/types/parts/DSToastContent.d.ts +5 -2
- package/dist/types/parts/styled.d.ts +12 -0
- package/dist/types/react-desc-prop-types.d.ts +2 -2
- package/dist/types/toast.d.ts +1 -1
- package/dist/types/typescript-testing/typescript-toast-valid.d.ts +1 -0
- package/package.json +7 -7
|
@@ -34,6 +34,9 @@ __export(DSToastDefinitions_exports, {
|
|
|
34
34
|
DSToastActionLinkSlots: () => DSToastActionLinkSlots,
|
|
35
35
|
DSToastActionName: () => DSToastActionName,
|
|
36
36
|
DSToastActionSlots: () => DSToastActionSlots,
|
|
37
|
+
DSToastContentDataTestIds: () => DSToastContentDataTestIds,
|
|
38
|
+
DSToastContentName: () => DSToastContentName,
|
|
39
|
+
DSToastContentSlots: () => DSToastContentSlots,
|
|
37
40
|
DSToastDataTestIds: () => DSToastDataTestIds,
|
|
38
41
|
DSToastName: () => DSToastName,
|
|
39
42
|
DSToastSlots: () => DSToastSlots
|
|
@@ -44,6 +47,7 @@ var import_ds_system = require("@elliemae/ds-system");
|
|
|
44
47
|
const DSToastName = "DSToast";
|
|
45
48
|
const DSToastActionLinkName = "DSToastActionLink";
|
|
46
49
|
const DSToastActionName = "DSToastAction";
|
|
50
|
+
const DSToastContentName = "DSToastContent";
|
|
47
51
|
const DSToastSlots = {
|
|
48
52
|
ROOT: "root",
|
|
49
53
|
CLOSE_BUTTON: "close-button",
|
|
@@ -59,10 +63,14 @@ const DSToastActionSlots = {
|
|
|
59
63
|
const DSToastActionLinkSlots = {
|
|
60
64
|
ROOT: "root"
|
|
61
65
|
};
|
|
66
|
+
const DSToastContentSlots = {
|
|
67
|
+
ROOT: "root"
|
|
68
|
+
};
|
|
62
69
|
const DSToastDataTestIds = {
|
|
63
70
|
...(0, import_ds_system.slotObjectToDataTestIds)(DSToastName, DSToastSlots),
|
|
64
71
|
CONTAINER: "ds-toast-render"
|
|
65
72
|
};
|
|
66
73
|
const DSToastActionDataTestIds = (0, import_ds_system.slotObjectToDataTestIds)(DSToastActionName, DSToastActionSlots);
|
|
67
74
|
const DSToastActionLinkDataTestIds = (0, import_ds_system.slotObjectToDataTestIds)(DSToastActionLinkName, DSToastActionLinkSlots);
|
|
75
|
+
const DSToastContentDataTestIds = (0, import_ds_system.slotObjectToDataTestIds)(DSToastContentName, DSToastContentSlots);
|
|
68
76
|
//# sourceMappingURL=DSToastDefinitions.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSToastDefinitions.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSToastName = 'DSToast';\n\nexport const DSToastActionLinkName = 'DSToastActionLink';\n\nexport const DSToastActionName = 'DSToastAction';\n\nexport const DSToastSlots = {\n ROOT: 'root',\n CLOSE_BUTTON: 'close-button',\n CONTAINER: 'container',\n ICON_CONTAINER: 'icon-container',\n MESSAGE_CONTENT: 'message-content',\n MESSAGE_HEADER: 'message-header',\n MESSAGE_TEXT: 'message-text',\n};\n\nexport const DSToastActionSlots = {\n ROOT: 'root',\n};\n\nexport const DSToastActionLinkSlots = {\n ROOT: 'root',\n};\n\nexport const DSToastDataTestIds = {\n ...slotObjectToDataTestIds(DSToastName, DSToastSlots),\n CONTAINER: 'ds-toast-render',\n};\n\nexport const DSToastActionDataTestIds = slotObjectToDataTestIds(DSToastActionName, DSToastActionSlots);\n\nexport const DSToastActionLinkDataTestIds = slotObjectToDataTestIds(DSToastActionLinkName, DSToastActionLinkSlots);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAwC;AAEjC,MAAM,cAAc;AAEpB,MAAM,wBAAwB;AAE9B,MAAM,oBAAoB;AAE1B,MAAM,eAAe;AAAA,EAC1B,MAAM;AAAA,EACN,cAAc;AAAA,EACd,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,cAAc;AAChB;AAEO,MAAM,qBAAqB;AAAA,EAChC,MAAM;AACR;AAEO,MAAM,yBAAyB;AAAA,EACpC,MAAM;AACR;AAEO,MAAM,qBAAqB;AAAA,EAChC,OAAG,0CAAwB,aAAa,YAAY;AAAA,EACpD,WAAW;AACb;AAEO,MAAM,+BAA2B,0CAAwB,mBAAmB,kBAAkB;AAE9F,MAAM,mCAA+B,0CAAwB,uBAAuB,sBAAsB;",
|
|
4
|
+
"sourcesContent": ["import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSToastName = 'DSToast';\n\nexport const DSToastActionLinkName = 'DSToastActionLink';\n\nexport const DSToastActionName = 'DSToastAction';\n\nexport const DSToastContentName = 'DSToastContent';\n\nexport const DSToastSlots = {\n ROOT: 'root',\n CLOSE_BUTTON: 'close-button',\n CONTAINER: 'container',\n ICON_CONTAINER: 'icon-container',\n MESSAGE_CONTENT: 'message-content',\n MESSAGE_HEADER: 'message-header',\n MESSAGE_TEXT: 'message-text',\n};\n\nexport const DSToastActionSlots = {\n ROOT: 'root',\n};\n\nexport const DSToastActionLinkSlots = {\n ROOT: 'root',\n};\n\nexport const DSToastContentSlots = {\n ROOT: 'root',\n};\n\nexport const DSToastDataTestIds = {\n ...slotObjectToDataTestIds(DSToastName, DSToastSlots),\n CONTAINER: 'ds-toast-render',\n};\n\nexport const DSToastActionDataTestIds = slotObjectToDataTestIds(DSToastActionName, DSToastActionSlots);\n\nexport const DSToastActionLinkDataTestIds = slotObjectToDataTestIds(DSToastActionLinkName, DSToastActionLinkSlots);\n\nexport const DSToastContentDataTestIds = slotObjectToDataTestIds(DSToastContentName, DSToastContentSlots);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAwC;AAEjC,MAAM,cAAc;AAEpB,MAAM,wBAAwB;AAE9B,MAAM,oBAAoB;AAE1B,MAAM,qBAAqB;AAE3B,MAAM,eAAe;AAAA,EAC1B,MAAM;AAAA,EACN,cAAc;AAAA,EACd,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,cAAc;AAChB;AAEO,MAAM,qBAAqB;AAAA,EAChC,MAAM;AACR;AAEO,MAAM,yBAAyB;AAAA,EACpC,MAAM;AACR;AAEO,MAAM,sBAAsB;AAAA,EACjC,MAAM;AACR;AAEO,MAAM,qBAAqB;AAAA,EAChC,OAAG,0CAAwB,aAAa,YAAY;AAAA,EACpD,WAAW;AACb;AAEO,MAAM,+BAA2B,0CAAwB,mBAAmB,kBAAkB;AAE9F,MAAM,mCAA+B,0CAAwB,uBAAuB,sBAAsB;AAE1G,MAAM,gCAA4B,0CAAwB,oBAAoB,mBAAmB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -39,6 +39,8 @@ __export(src_exports, {
|
|
|
39
39
|
DSToastActionName: () => import_DSToastDefinitions.DSToastActionName,
|
|
40
40
|
DSToastActionSlots: () => import_DSToastDefinitions.DSToastActionSlots,
|
|
41
41
|
DSToastActionWithSchema: () => import_DSToastAction.DSToastActionWithSchema,
|
|
42
|
+
DSToastContent: () => import_DSToastContent.DSToastContent,
|
|
43
|
+
DSToastContentWithSchema: () => import_DSToastContent.DSToastContentWithSchema,
|
|
42
44
|
DSToastDataTestIds: () => import_DSToastDefinitions.DSToastDataTestIds,
|
|
43
45
|
DSToastName: () => import_DSToastDefinitions.DSToastName,
|
|
44
46
|
DSToastSlots: () => import_DSToastDefinitions.DSToastSlots,
|
|
@@ -57,6 +59,7 @@ var import_toast = require("./toast.js");
|
|
|
57
59
|
var import_constants = require("./constants.js");
|
|
58
60
|
var import_DSToastAction = require("./parts/DSToastAction.js");
|
|
59
61
|
var import_DSToastActionLink = require("./parts/DSToastActionLink.js");
|
|
62
|
+
var import_DSToastContent = require("./parts/DSToastContent.js");
|
|
60
63
|
var import_DSToastDefinitions = require("./DSToastDefinitions.js");
|
|
61
64
|
var import_DSToast2 = __toESM(require("./parts/DSToast.js"));
|
|
62
65
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export { DSToast, DSToastWithSchema } from './parts/DSToast.js';\nexport { toast } from './toast.js';\nexport { ToastType, toastTypes, ToastPosition, toastsPositions } from './constants.js';\nexport { DSToastAction, DSToastActionWithSchema } from './parts/DSToastAction.js';\nexport { DSToastActionLink, DSToastActionLinkWithSchema } from './parts/DSToastActionLink.js';\nexport {\n DSToastName,\n DSToastActionName,\n DSToastActionLinkName,\n DSToastSlots,\n DSToastActionSlots,\n DSToastActionLinkSlots,\n DSToastDataTestIds,\n DSToastActionDataTestIds,\n DSToastActionLinkDataTestIds,\n} from './DSToastDefinitions.js';\nimport type {} from '@xstyled/system';\nexport { default } from './parts/DSToast.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,qBAA2C;AAC3C,mBAAsB;AACtB,uBAAsE;AACtE,2BAAuD;AACvD,+BAA+D;AAC/D,gCAUO;
|
|
4
|
+
"sourcesContent": ["export { DSToast, DSToastWithSchema } from './parts/DSToast.js';\nexport { toast } from './toast.js';\nexport { ToastType, toastTypes, ToastPosition, toastsPositions } from './constants.js';\nexport { DSToastAction, DSToastActionWithSchema } from './parts/DSToastAction.js';\nexport { DSToastActionLink, DSToastActionLinkWithSchema } from './parts/DSToastActionLink.js';\nexport { DSToastContent, DSToastContentWithSchema } from './parts/DSToastContent.js';\nexport {\n DSToastName,\n DSToastActionName,\n DSToastActionLinkName,\n DSToastSlots,\n DSToastActionSlots,\n DSToastActionLinkSlots,\n DSToastDataTestIds,\n DSToastActionDataTestIds,\n DSToastActionLinkDataTestIds,\n} from './DSToastDefinitions.js';\nimport type {} from '@xstyled/system';\nimport type {} from '@xstyled/util';\nexport { default } from './parts/DSToast.js';\nexport type { DSToastT } from './react-desc-prop-types.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,qBAA2C;AAC3C,mBAAsB;AACtB,uBAAsE;AACtE,2BAAuD;AACvD,+BAA+D;AAC/D,4BAAyD;AACzD,gCAUO;AAGP,IAAAA,kBAAwB;",
|
|
6
6
|
"names": ["import_DSToast"]
|
|
7
7
|
}
|
|
@@ -29,20 +29,25 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
var DSToastContent_exports = {};
|
|
30
30
|
__export(DSToastContent_exports, {
|
|
31
31
|
DSToastContent: () => DSToastContent,
|
|
32
|
+
DSToastContentWithSchema: () => DSToastContentWithSchema,
|
|
32
33
|
getIconByToastType: () => getIconByToastType,
|
|
33
34
|
getIconColorByToastType: () => getIconColorByToastType
|
|
34
35
|
});
|
|
35
36
|
module.exports = __toCommonJS(DSToastContent_exports);
|
|
36
37
|
var React = __toESM(require("react"));
|
|
37
38
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
39
|
+
var import_react_desc_prop_types = require("../react-desc-prop-types.js");
|
|
40
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
38
41
|
var import_styled = require("./styled.js");
|
|
39
42
|
var import_constants = require("../constants.js");
|
|
43
|
+
var import_DSToastDefinitions = require("../DSToastDefinitions.js");
|
|
40
44
|
const getIconByToastType = (type) => import_constants.TYPE_TO_ICON[type];
|
|
41
45
|
const getIconColorByToastType = (type) => import_constants.TYPE_TO_ICON_COLOR[type];
|
|
42
46
|
const DSToastContent = ({
|
|
43
47
|
type = import_constants.ToastType.DEFAULT,
|
|
44
48
|
messageTitle = "",
|
|
45
|
-
messageText = ""
|
|
49
|
+
messageText = "",
|
|
50
|
+
messageComponent
|
|
46
51
|
}) => {
|
|
47
52
|
const IconMessage = getIconByToastType(type);
|
|
48
53
|
const iconColor = getIconColorByToastType(type);
|
|
@@ -50,8 +55,11 @@ const DSToastContent = ({
|
|
|
50
55
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledIconContainer, { className: "em-ds-toast-content__icon-container", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IconMessage, { size: "m", className: "em-ds-toast-content__icon-message", color: iconColor }) }),
|
|
51
56
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.StyledMessageContent, { className: "em-ds-toast-content__message-content", children: [
|
|
52
57
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledMessageHeader, { className: "em-ds-toast-content__message-header", children: messageTitle }),
|
|
53
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledMessageText, { className: "em-ds-toast-content__message-text", children: messageText })
|
|
58
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledMessageText, { className: "em-ds-toast-content__message-text", children: messageComponent ? messageComponent : messageText })
|
|
54
59
|
] })
|
|
55
60
|
] });
|
|
56
61
|
};
|
|
62
|
+
DSToastContent.displayName = import_DSToastDefinitions.DSToastContentName;
|
|
63
|
+
const DSToastContentWithSchema = (0, import_ds_props_helpers.describe)(DSToastContent);
|
|
64
|
+
DSToastContentWithSchema.propTypes = import_react_desc_prop_types.DSToastContentPropTypes;
|
|
57
65
|
//# sourceMappingURL=DSToastContent.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/parts/DSToastContent.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport type { SvgIconT } from '@elliemae/ds-icons';\nimport type
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport type { SvgIconT } from '@elliemae/ds-icons';\nimport { DSToastContentPropTypes, type DSToastT } from '../react-desc-prop-types.js';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport {\n StyledContainer,\n StyledIconContainer,\n StyledMessageContent,\n StyledMessageHeader,\n StyledMessageText,\n} from './styled.js';\nimport { ToastType, TYPE_TO_ICON, TYPE_TO_ICON_COLOR } from '../constants.js';\nimport { DSToastContentName } from '../DSToastDefinitions.js';\n\nexport const getIconByToastType = (type: DSToastT.ToastTypes) => TYPE_TO_ICON[type];\nexport const getIconColorByToastType = (type: DSToastT.ToastTypes): SvgIconT.ColorType =>\n TYPE_TO_ICON_COLOR[type] as SvgIconT.ColorType;\n\nexport interface DSToastContentProps {\n type?: DSToastT.ToastTypes;\n messageTitle?: string;\n messageText?: string;\n messageComponent?: React.ReactNode;\n}\n\nconst DSToastContent: React.ComponentType<DSToastContentProps> = ({\n type = ToastType.DEFAULT,\n messageTitle = '',\n messageText = '',\n messageComponent,\n}) => {\n const IconMessage = getIconByToastType(type);\n const iconColor = getIconColorByToastType(type);\n\n return (\n <StyledContainer data-testid=\"ds-toast-render\" className=\"em-ds-toast-content\">\n <StyledIconContainer className=\"em-ds-toast-content__icon-container\">\n <IconMessage size=\"m\" className=\"em-ds-toast-content__icon-message\" color={iconColor} />\n </StyledIconContainer>\n <StyledMessageContent className=\"em-ds-toast-content__message-content\">\n <StyledMessageHeader className=\"em-ds-toast-content__message-header\">{messageTitle}</StyledMessageHeader>\n <StyledMessageText className=\"em-ds-toast-content__message-text\">\n {messageComponent ? messageComponent : messageText}\n </StyledMessageText>\n </StyledMessageContent>\n </StyledContainer>\n );\n};\n\nDSToastContent.displayName = DSToastContentName;\nconst DSToastContentWithSchema = describe(DSToastContent);\nDSToastContentWithSchema.propTypes = DSToastContentPropTypes;\n\nexport { DSToastContent, DSToastContentWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADqCf;AAnCR,mCAAuD;AACvD,8BAAyB;AACzB,oBAMO;AACP,uBAA4D;AAC5D,gCAAmC;AAE5B,MAAM,qBAAqB,CAAC,SAA8B,8BAAa,IAAI;AAC3E,MAAM,0BAA0B,CAAC,SACtC,oCAAmB,IAAI;AASzB,MAAM,iBAA2D,CAAC;AAAA,EAChE,OAAO,2BAAU;AAAA,EACjB,eAAe;AAAA,EACf,cAAc;AAAA,EACd;AACF,MAAM;AACJ,QAAM,cAAc,mBAAmB,IAAI;AAC3C,QAAM,YAAY,wBAAwB,IAAI;AAE9C,SACE,6CAAC,iCAAgB,eAAY,mBAAkB,WAAU,uBACvD;AAAA,gDAAC,qCAAoB,WAAU,uCAC7B,sDAAC,eAAY,MAAK,KAAI,WAAU,qCAAoC,OAAO,WAAW,GACxF;AAAA,IACA,6CAAC,sCAAqB,WAAU,wCAC9B;AAAA,kDAAC,qCAAoB,WAAU,uCAAuC,wBAAa;AAAA,MACnF,4CAAC,mCAAkB,WAAU,qCAC1B,6BAAmB,mBAAmB,aACzC;AAAA,OACF;AAAA,KACF;AAEJ;AAEA,eAAe,cAAc;AAC7B,MAAM,+BAA2B,kCAAS,cAAc;AACxD,yBAAyB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -30,6 +30,7 @@ var react_desc_prop_types_exports = {};
|
|
|
30
30
|
__export(react_desc_prop_types_exports, {
|
|
31
31
|
DSToastActionLinkPropTypes: () => DSToastActionLinkPropTypes,
|
|
32
32
|
DSToastActionPropsTypes: () => DSToastActionPropsTypes,
|
|
33
|
+
DSToastContentPropTypes: () => DSToastContentPropTypes,
|
|
33
34
|
DSToastPropTypes: () => DSToastPropTypes,
|
|
34
35
|
actionDefaultProps: () => actionDefaultProps,
|
|
35
36
|
defaultProps: () => defaultProps
|
|
@@ -75,4 +76,14 @@ const DSToastActionPropsTypes = {
|
|
|
75
76
|
/** key down handler */
|
|
76
77
|
onKeyDown: import_ds_props_helpers.PropTypes.func.description("key down handler")
|
|
77
78
|
};
|
|
79
|
+
const DSToastContentPropTypes = {
|
|
80
|
+
/** Type of toast */
|
|
81
|
+
type: import_ds_props_helpers.PropTypes.oneOf(import_constants.toastTypes).description("Type of toast").defaultValue("default"),
|
|
82
|
+
/** Toast message title */
|
|
83
|
+
messageTitle: import_ds_props_helpers.PropTypes.string.description("Toast message title").defaultValue(""),
|
|
84
|
+
/** Toast message text */
|
|
85
|
+
messageText: import_ds_props_helpers.PropTypes.string.description("Toast message text").defaultValue(""),
|
|
86
|
+
/** Toast message component */
|
|
87
|
+
messageComponent: import_ds_props_helpers.PropTypes.node.description("Toast message component")
|
|
88
|
+
};
|
|
78
89
|
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/react-desc-prop-types.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type React from 'react';\nimport type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-props-helpers';\nimport { PropTypes } from '@elliemae/ds-props-helpers';\nimport type { WeakValidationMap } from 'react';\nimport { toastsPositions
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,8BAA0B;AAE1B,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type React from 'react';\nimport type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-props-helpers';\nimport { PropTypes } from '@elliemae/ds-props-helpers';\nimport type { WeakValidationMap } from 'react';\nimport { toastsPositions, toastTypes } from './constants.js';\n\nexport declare namespace DSToastT {\n type PropsT<D, R, O, E> = Partial<D> &\n R &\n O &\n Omit<GlobalAttributesT<E>, keyof D | keyof R | keyof O> &\n Omit<XstyledProps, keyof D | keyof R | keyof O>;\n\n type InternalPropsT<D, R, O, E> = D &\n R &\n O &\n Omit<GlobalAttributesT<E>, keyof D | keyof R | keyof O> &\n Omit<XstyledProps, keyof D | keyof R | keyof O>;\n\n export type ToastPositions = (typeof toastsPositions)[number];\n\n export type ToastTypes = (typeof toastTypes)[number];\n\n export interface DefaultProps {\n containerProps: Record<string, unknown>;\n position: ToastPositions;\n autoClose: number;\n showProgressBar: boolean;\n closeOnClick: boolean;\n enableMultiContainer: boolean;\n }\n\n export interface OptionalProps {\n containerId?: string | number;\n closeButtonRef?: React.MutableRefObject<HTMLButtonElement | null>;\n }\n\n export interface RequiredProps {}\n\n export type Props = PropsT<DefaultProps, RequiredProps, OptionalProps, HTMLDivElement>;\n\n export type InternalProps = InternalPropsT<DefaultProps, RequiredProps, OptionalProps, HTMLDivElement>;\n\n export interface ActionDefaultProps {}\n\n export interface ActionOptionalProps {\n onClick?: React.MouseEventHandler;\n onKeyDown?: React.KeyboardEventHandler;\n }\n\n export interface ActionRequiredProps {\n children: React.ReactNode;\n }\n\n export type ActionProps = PropsT<ActionDefaultProps, ActionRequiredProps, ActionOptionalProps, HTMLDivElement>;\n\n export type ActionInternalProps = InternalPropsT<\n ActionDefaultProps,\n ActionRequiredProps,\n ActionOptionalProps,\n HTMLDivElement\n >;\n}\n\nexport const defaultProps: DSToastT.DefaultProps = {\n containerProps: {},\n position: 'bottom-left',\n autoClose: 5000,\n showProgressBar: false,\n closeOnClick: false,\n enableMultiContainer: false,\n};\n\nexport const actionDefaultProps: DSToastT.ActionDefaultProps = {};\n\n// =============================================================================\n// PropTypes\n// =============================================================================\nexport const DSToastPropTypes = {\n /** inject props to wrapper */\n containerProps: PropTypes.object.description('inject props to wrapper').defaultValue({}),\n /** Position on the screen to show the toast */\n position: PropTypes.oneOf(toastsPositions as unknown as string[])\n .description('Position on the screen to show the toast')\n .defaultValue('bottom-left'),\n /** ms to autoclose the toast */\n autoClose: PropTypes.oneOfType([PropTypes.number, PropTypes.oneOf([false])])\n .description(\"ms to autoclose the toast, false if you don't want to automatically close\")\n .defaultValue(5000),\n /** Whether to show a progress bar indicating when the toast is going to be closed */\n showProgressBar: PropTypes.bool\n .description('Whether to show a progress bar indicating when the toast is going to be closed')\n .defaultValue(false),\n /** Close toast handler */\n closeOnClick: PropTypes.bool.description('Close toast handler').defaultValue(false),\n /** Allows instantiating multiple Toast containers */\n enableMultiContainer: PropTypes.bool\n .description('Allows instantiating multiple Toast containers')\n .defaultValue(false),\n /** unique id for multi container */\n containerId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('unique id for multi container'),\n} as WeakValidationMap<unknown>;\n\nexport const DSToastActionLinkPropTypes = {\n /** link text */\n children: PropTypes.node.isRequired.description('link text'),\n} as React.WeakValidationMap<unknown>;\n\nexport const DSToastActionPropsTypes = {\n /** DSToastActionLink component or text string */\n children: PropTypes.node.description('DSToastActionLink component or text string'),\n /** click handler */\n onClick: PropTypes.func.description('click handler'),\n /** key down handler */\n onKeyDown: PropTypes.func.description('key down handler'),\n} as React.WeakValidationMap<unknown>;\n\nexport const DSToastContentPropTypes = {\n /** Type of toast */\n type: PropTypes.oneOf(toastTypes as unknown as string[])\n .description('Type of toast')\n .defaultValue('default'),\n /** Toast message title */\n messageTitle: PropTypes.string.description('Toast message title').defaultValue(''),\n /** Toast message text */\n messageText: PropTypes.string.description('Toast message text').defaultValue(''),\n /** Toast message component */\n messageComponent: PropTypes.node.description('Toast message component'),\n} as React.WeakValidationMap<unknown>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,8BAA0B;AAE1B,uBAA4C;AA4DrC,MAAM,eAAsC;AAAA,EACjD,gBAAgB,CAAC;AAAA,EACjB,UAAU;AAAA,EACV,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,sBAAsB;AACxB;AAEO,MAAM,qBAAkD,CAAC;AAKzD,MAAM,mBAAmB;AAAA;AAAA,EAE9B,gBAAgB,kCAAU,OAAO,YAAY,yBAAyB,EAAE,aAAa,CAAC,CAAC;AAAA;AAAA,EAEvF,UAAU,kCAAU,MAAM,gCAAsC,EAC7D,YAAY,0CAA0C,EACtD,aAAa,aAAa;AAAA;AAAA,EAE7B,WAAW,kCAAU,UAAU,CAAC,kCAAU,QAAQ,kCAAU,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EACxE,YAAY,2EAA2E,EACvF,aAAa,GAAI;AAAA;AAAA,EAEpB,iBAAiB,kCAAU,KACxB,YAAY,gFAAgF,EAC5F,aAAa,KAAK;AAAA;AAAA,EAErB,cAAc,kCAAU,KAAK,YAAY,qBAAqB,EAAE,aAAa,KAAK;AAAA;AAAA,EAElF,sBAAsB,kCAAU,KAC7B,YAAY,gDAAgD,EAC5D,aAAa,KAAK;AAAA;AAAA,EAErB,aAAa,kCAAU,UAAU,CAAC,kCAAU,QAAQ,kCAAU,MAAM,CAAC,EAAE,YAAY,+BAA+B;AACpH;AAEO,MAAM,6BAA6B;AAAA;AAAA,EAExC,UAAU,kCAAU,KAAK,WAAW,YAAY,WAAW;AAC7D;AAEO,MAAM,0BAA0B;AAAA;AAAA,EAErC,UAAU,kCAAU,KAAK,YAAY,4CAA4C;AAAA;AAAA,EAEjF,SAAS,kCAAU,KAAK,YAAY,eAAe;AAAA;AAAA,EAEnD,WAAW,kCAAU,KAAK,YAAY,kBAAkB;AAC1D;AAEO,MAAM,0BAA0B;AAAA;AAAA,EAErC,MAAM,kCAAU,MAAM,2BAAiC,EACpD,YAAY,eAAe,EAC3B,aAAa,SAAS;AAAA;AAAA,EAEzB,cAAc,kCAAU,OAAO,YAAY,qBAAqB,EAAE,aAAa,EAAE;AAAA;AAAA,EAEjF,aAAa,kCAAU,OAAO,YAAY,oBAAoB,EAAE,aAAa,EAAE;AAAA;AAAA,EAE/E,kBAAkB,kCAAU,KAAK,YAAY,yBAAyB;AACxE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/toast.js
CHANGED
|
@@ -36,11 +36,22 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
36
36
|
var import_react_toastify = require("react-toastify");
|
|
37
37
|
var import_DSToastContent = require("./parts/DSToastContent.js");
|
|
38
38
|
const toast = Object.assign(
|
|
39
|
-
({ type, messageTitle, messageText, ...rest }, options) => (0, import_react_toastify.toast)(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
({ type, messageTitle, messageText, messageComponent, ...rest }, options) => (0, import_react_toastify.toast)(
|
|
40
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
41
|
+
import_DSToastContent.DSToastContent,
|
|
42
|
+
{
|
|
43
|
+
messageText,
|
|
44
|
+
messageComponent,
|
|
45
|
+
messageTitle,
|
|
46
|
+
type
|
|
47
|
+
}
|
|
48
|
+
),
|
|
49
|
+
{
|
|
50
|
+
...rest,
|
|
51
|
+
...options,
|
|
52
|
+
type
|
|
53
|
+
}
|
|
54
|
+
),
|
|
44
55
|
{ ...import_react_toastify.toast, isActive: (id) => import_react_toastify.toast.isActive(id) }
|
|
45
56
|
);
|
|
46
57
|
//# sourceMappingURL=toast.js.map
|
package/dist/cjs/toast.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/toast.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport type { ToastOptions } from 'react-toastify';\nimport { toast as toastifyToast } from 'react-toastify';\nimport type { DSToastContentProps } from './parts/DSToastContent.js';\nimport { DSToastContent } from './parts/DSToastContent.js';\n\nconst toast = Object.assign(\n ({ type, messageTitle, messageText, ...rest }: DSToastContentProps, options: ToastOptions) =>\n toastifyToast(<DSToastContent
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport type { ToastOptions } from 'react-toastify';\nimport { toast as toastifyToast } from 'react-toastify';\nimport type { DSToastContentProps } from './parts/DSToastContent.js';\nimport { DSToastContent } from './parts/DSToastContent.js';\n\nconst toast = Object.assign(\n ({ type, messageTitle, messageText, messageComponent, ...rest }: DSToastContentProps, options: ToastOptions) =>\n toastifyToast(\n <DSToastContent\n messageText={messageText}\n messageComponent={messageComponent}\n messageTitle={messageTitle}\n type={type}\n />,\n {\n ...rest,\n ...options,\n type,\n },\n ),\n { ...toastifyToast, isActive: (id: string | number) => toastifyToast.isActive(id) },\n);\n\nexport { toast };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADSjB;AAPN,4BAAuC;AAEvC,4BAA+B;AAE/B,MAAM,QAAQ,OAAO;AAAA,EACnB,CAAC,EAAE,MAAM,cAAc,aAAa,kBAAkB,GAAG,KAAK,GAAwB,gBACpF,sBAAAA;AAAA,IACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,GAAG;AAAA,MACH;AAAA,IACF;AAAA,EACF;AAAA,EACF,EAAE,GAAG,sBAAAA,OAAe,UAAU,CAAC,OAAwB,sBAAAA,MAAc,SAAS,EAAE,EAAE;AACpF;",
|
|
6
6
|
"names": ["toastifyToast"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var React = __toESM(require("react"));
|
|
25
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
+
var import_react = require("react");
|
|
27
|
+
var import__ = require("../index.js");
|
|
28
|
+
const closeButtonRef = (0, import_react.createRef)();
|
|
29
|
+
const testRequiredProps = {};
|
|
30
|
+
const testOptionalProps = {
|
|
31
|
+
containerId: "",
|
|
32
|
+
closeButtonRef
|
|
33
|
+
};
|
|
34
|
+
const testPartialDefaults = {
|
|
35
|
+
containerProps: { "data-testid": "ds-toast-1" },
|
|
36
|
+
position: "top-center",
|
|
37
|
+
showProgressBar: false
|
|
38
|
+
};
|
|
39
|
+
const testProps = {
|
|
40
|
+
...testRequiredProps,
|
|
41
|
+
...testOptionalProps,
|
|
42
|
+
...testPartialDefaults
|
|
43
|
+
};
|
|
44
|
+
const testPropsAsSyntax = {
|
|
45
|
+
...testRequiredProps,
|
|
46
|
+
...testOptionalProps,
|
|
47
|
+
...testPartialDefaults
|
|
48
|
+
};
|
|
49
|
+
const testCompleteDefaults = {
|
|
50
|
+
containerProps: { "data-testid": "ds-toast-1" },
|
|
51
|
+
position: "top-center",
|
|
52
|
+
autoClose: 2e3,
|
|
53
|
+
showProgressBar: true,
|
|
54
|
+
closeOnClick: true,
|
|
55
|
+
enableMultiContainer: false
|
|
56
|
+
};
|
|
57
|
+
const testInternalProps = {
|
|
58
|
+
...testRequiredProps,
|
|
59
|
+
...testOptionalProps,
|
|
60
|
+
...testCompleteDefaults
|
|
61
|
+
};
|
|
62
|
+
const testInternalPropsAsSyntax = {
|
|
63
|
+
...testRequiredProps,
|
|
64
|
+
...testOptionalProps,
|
|
65
|
+
...testCompleteDefaults
|
|
66
|
+
};
|
|
67
|
+
const testExplicitDefinition = {
|
|
68
|
+
containerProps: { "data-testid": "ds-toast-1" },
|
|
69
|
+
position: "top-left",
|
|
70
|
+
autoClose: 5e3,
|
|
71
|
+
showProgressBar: true,
|
|
72
|
+
closeOnClick: false,
|
|
73
|
+
enableMultiContainer: false
|
|
74
|
+
};
|
|
75
|
+
const testInferedTypeCompatibility = {
|
|
76
|
+
containerProps: { "data-testid": "ds-toast-1" },
|
|
77
|
+
position: "top-left",
|
|
78
|
+
autoClose: 5e3,
|
|
79
|
+
showProgressBar: true,
|
|
80
|
+
closeOnClick: false,
|
|
81
|
+
enableMultiContainer: false
|
|
82
|
+
};
|
|
83
|
+
const testDefinitionAsConst = {
|
|
84
|
+
containerProps: { "data-testid": "ds-toast-1" },
|
|
85
|
+
position: "top-left",
|
|
86
|
+
autoClose: 5e3,
|
|
87
|
+
showProgressBar: true,
|
|
88
|
+
closeOnClick: false,
|
|
89
|
+
enableMultiContainer: false
|
|
90
|
+
};
|
|
91
|
+
const ExampleUsageComponent = () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
92
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSToast, { ...testExplicitDefinition }),
|
|
93
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSToast, { ...testInferedTypeCompatibility }),
|
|
94
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSToast, { ...testDefinitionAsConst }),
|
|
95
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
96
|
+
import__.DSToast,
|
|
97
|
+
{
|
|
98
|
+
containerProps: { "data-testid": "ds-toast-1" },
|
|
99
|
+
position: "top-left",
|
|
100
|
+
autoClose: 5e3,
|
|
101
|
+
showProgressBar: true,
|
|
102
|
+
closeOnClick: false,
|
|
103
|
+
enableMultiContainer: false
|
|
104
|
+
}
|
|
105
|
+
)
|
|
106
|
+
] });
|
|
107
|
+
//# sourceMappingURL=typescript-toast-valid.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/typescript-toast-valid.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport { createRef } from 'react';\nimport { DSToast } from '../index.js';\nimport type { DSToastT } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = DSToastT.Props;\ntype ComponentPropsInternals = DSToastT.InternalProps;\ntype ComponentPropsDefaultProps = DSToastT.DefaultProps;\ntype ComponentPropsOptionalProps = DSToastT.OptionalProps;\ntype ComponentPropsRequiredProps = DSToastT.RequiredProps;\n\nconst closeButtonRef = createRef<HTMLButtonElement>();\n\nconst testRequiredProps: ComponentPropsRequiredProps = {};\n\nconst testOptionalProps: ComponentPropsOptionalProps = {\n containerId: '',\n closeButtonRef: closeButtonRef,\n};\n\n// difference Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\nconst testPartialDefaults: Partial<ComponentPropsDefaultProps> = {\n containerProps: { 'data-testid': 'ds-toast-1' },\n position: 'top-center',\n showProgressBar: false,\n};\n\nconst testProps: ComponentPropsForApp = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n};\n\nconst testPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {\n containerProps: { 'data-testid': 'ds-toast-1' },\n position: 'top-center',\n autoClose: 2000,\n showProgressBar: true,\n closeOnClick: true,\n enableMultiContainer: false,\n};\n\nconst testInternalProps: ComponentPropsInternals = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n};\n\nconst testInternalPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n} as ComponentPropsInternals;\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\nconst testExplicitDefinition: ComponentPropsForApp = {\n containerProps: { 'data-testid': 'ds-toast-1' },\n position: 'top-left',\n autoClose: 5000,\n showProgressBar: true,\n closeOnClick: false,\n enableMultiContainer: false,\n};\n\n// using the \"as\" syntax, if there is an error, it will be marking the whole object as wrong because it is not compatible with the type\nconst testInferedTypeCompatibility = {\n containerProps: { 'data-testid': 'ds-toast-1' },\n position: 'top-left',\n autoClose: 5000,\n showProgressBar: true,\n closeOnClick: false,\n enableMultiContainer: false,\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n containerProps: { 'data-testid': 'ds-toast-1' },\n position: 'top-left',\n autoClose: 5000,\n showProgressBar: true,\n closeOnClick: false,\n enableMultiContainer: false,\n} as const;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <DSToast {...testExplicitDefinition} />\n <DSToast {...testInferedTypeCompatibility} />\n <DSToast {...testDefinitionAsConst} />\n {/* works with inline values */}\n <DSToast\n containerProps={{ 'data-testid': 'ds-toast-1' }}\n position=\"top-left\"\n autoClose={5000}\n showProgressBar={true}\n closeOnClick={false}\n enableMultiContainer={false}\n />\n </>\n);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;AC6FrB;AA5FF,mBAA0B;AAC1B,eAAwB;AAUxB,MAAM,qBAAiB,wBAA6B;AAEpD,MAAM,oBAAiD,CAAC;AAExD,MAAM,oBAAiD;AAAA,EACrD,aAAa;AAAA,EACb;AACF;AAIA,MAAM,sBAA2D;AAAA,EAC/D,gBAAgB,EAAE,eAAe,aAAa;AAAA,EAC9C,UAAU;AAAA,EACV,iBAAiB;AACnB;AAEA,MAAM,YAAkC;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,oBAAoB;AAAA,EACxB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,uBAA6D;AAAA,EACjE,gBAAgB,EAAE,eAAe,aAAa;AAAA,EAC9C,UAAU;AAAA,EACV,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,sBAAsB;AACxB;AAEA,MAAM,oBAA6C;AAAA,EACjD,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,4BAA4B;AAAA,EAChC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,yBAA+C;AAAA,EACnD,gBAAgB,EAAE,eAAe,aAAa;AAAA,EAC9C,UAAU;AAAA,EACV,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,sBAAsB;AACxB;AAGA,MAAM,+BAA+B;AAAA,EACnC,gBAAgB,EAAE,eAAe,aAAa;AAAA,EAC9C,UAAU;AAAA,EACV,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,sBAAsB;AACxB;AAEA,MAAM,wBAAwB;AAAA,EAC5B,gBAAgB,EAAE,eAAe,aAAa;AAAA,EAC9C,UAAU;AAAA,EACV,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,sBAAsB;AACxB;AAEA,MAAM,wBAAwB,MAC5B,4EAEE;AAAA,8CAAC,oBAAS,GAAG,wBAAwB;AAAA,EACrC,4CAAC,oBAAS,GAAG,8BAA8B;AAAA,EAC3C,4CAAC,oBAAS,GAAG,uBAAuB;AAAA,EAEpC;AAAA,IAAC;AAAA;AAAA,MACC,gBAAgB,EAAE,eAAe,aAAa;AAAA,MAC9C,UAAS;AAAA,MACT,WAAW;AAAA,MACX,iBAAiB;AAAA,MACjB,cAAc;AAAA,MACd,sBAAsB;AAAA;AAAA,EACxB;AAAA,GACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -3,6 +3,7 @@ import { slotObjectToDataTestIds } from "@elliemae/ds-system";
|
|
|
3
3
|
const DSToastName = "DSToast";
|
|
4
4
|
const DSToastActionLinkName = "DSToastActionLink";
|
|
5
5
|
const DSToastActionName = "DSToastAction";
|
|
6
|
+
const DSToastContentName = "DSToastContent";
|
|
6
7
|
const DSToastSlots = {
|
|
7
8
|
ROOT: "root",
|
|
8
9
|
CLOSE_BUTTON: "close-button",
|
|
@@ -18,12 +19,16 @@ const DSToastActionSlots = {
|
|
|
18
19
|
const DSToastActionLinkSlots = {
|
|
19
20
|
ROOT: "root"
|
|
20
21
|
};
|
|
22
|
+
const DSToastContentSlots = {
|
|
23
|
+
ROOT: "root"
|
|
24
|
+
};
|
|
21
25
|
const DSToastDataTestIds = {
|
|
22
26
|
...slotObjectToDataTestIds(DSToastName, DSToastSlots),
|
|
23
27
|
CONTAINER: "ds-toast-render"
|
|
24
28
|
};
|
|
25
29
|
const DSToastActionDataTestIds = slotObjectToDataTestIds(DSToastActionName, DSToastActionSlots);
|
|
26
30
|
const DSToastActionLinkDataTestIds = slotObjectToDataTestIds(DSToastActionLinkName, DSToastActionLinkSlots);
|
|
31
|
+
const DSToastContentDataTestIds = slotObjectToDataTestIds(DSToastContentName, DSToastContentSlots);
|
|
27
32
|
export {
|
|
28
33
|
DSToastActionDataTestIds,
|
|
29
34
|
DSToastActionLinkDataTestIds,
|
|
@@ -31,6 +36,9 @@ export {
|
|
|
31
36
|
DSToastActionLinkSlots,
|
|
32
37
|
DSToastActionName,
|
|
33
38
|
DSToastActionSlots,
|
|
39
|
+
DSToastContentDataTestIds,
|
|
40
|
+
DSToastContentName,
|
|
41
|
+
DSToastContentSlots,
|
|
34
42
|
DSToastDataTestIds,
|
|
35
43
|
DSToastName,
|
|
36
44
|
DSToastSlots
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSToastDefinitions.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSToastName = 'DSToast';\n\nexport const DSToastActionLinkName = 'DSToastActionLink';\n\nexport const DSToastActionName = 'DSToastAction';\n\nexport const DSToastSlots = {\n ROOT: 'root',\n CLOSE_BUTTON: 'close-button',\n CONTAINER: 'container',\n ICON_CONTAINER: 'icon-container',\n MESSAGE_CONTENT: 'message-content',\n MESSAGE_HEADER: 'message-header',\n MESSAGE_TEXT: 'message-text',\n};\n\nexport const DSToastActionSlots = {\n ROOT: 'root',\n};\n\nexport const DSToastActionLinkSlots = {\n ROOT: 'root',\n};\n\nexport const DSToastDataTestIds = {\n ...slotObjectToDataTestIds(DSToastName, DSToastSlots),\n CONTAINER: 'ds-toast-render',\n};\n\nexport const DSToastActionDataTestIds = slotObjectToDataTestIds(DSToastActionName, DSToastActionSlots);\n\nexport const DSToastActionLinkDataTestIds = slotObjectToDataTestIds(DSToastActionLinkName, DSToastActionLinkSlots);\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AAEjC,MAAM,cAAc;AAEpB,MAAM,wBAAwB;AAE9B,MAAM,oBAAoB;AAE1B,MAAM,eAAe;AAAA,EAC1B,MAAM;AAAA,EACN,cAAc;AAAA,EACd,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,cAAc;AAChB;AAEO,MAAM,qBAAqB;AAAA,EAChC,MAAM;AACR;AAEO,MAAM,yBAAyB;AAAA,EACpC,MAAM;AACR;AAEO,MAAM,qBAAqB;AAAA,EAChC,GAAG,wBAAwB,aAAa,YAAY;AAAA,EACpD,WAAW;AACb;AAEO,MAAM,2BAA2B,wBAAwB,mBAAmB,kBAAkB;AAE9F,MAAM,+BAA+B,wBAAwB,uBAAuB,sBAAsB;",
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSToastName = 'DSToast';\n\nexport const DSToastActionLinkName = 'DSToastActionLink';\n\nexport const DSToastActionName = 'DSToastAction';\n\nexport const DSToastContentName = 'DSToastContent';\n\nexport const DSToastSlots = {\n ROOT: 'root',\n CLOSE_BUTTON: 'close-button',\n CONTAINER: 'container',\n ICON_CONTAINER: 'icon-container',\n MESSAGE_CONTENT: 'message-content',\n MESSAGE_HEADER: 'message-header',\n MESSAGE_TEXT: 'message-text',\n};\n\nexport const DSToastActionSlots = {\n ROOT: 'root',\n};\n\nexport const DSToastActionLinkSlots = {\n ROOT: 'root',\n};\n\nexport const DSToastContentSlots = {\n ROOT: 'root',\n};\n\nexport const DSToastDataTestIds = {\n ...slotObjectToDataTestIds(DSToastName, DSToastSlots),\n CONTAINER: 'ds-toast-render',\n};\n\nexport const DSToastActionDataTestIds = slotObjectToDataTestIds(DSToastActionName, DSToastActionSlots);\n\nexport const DSToastActionLinkDataTestIds = slotObjectToDataTestIds(DSToastActionLinkName, DSToastActionLinkSlots);\n\nexport const DSToastContentDataTestIds = slotObjectToDataTestIds(DSToastContentName, DSToastContentSlots);\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AAEjC,MAAM,cAAc;AAEpB,MAAM,wBAAwB;AAE9B,MAAM,oBAAoB;AAE1B,MAAM,qBAAqB;AAE3B,MAAM,eAAe;AAAA,EAC1B,MAAM;AAAA,EACN,cAAc;AAAA,EACd,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,cAAc;AAChB;AAEO,MAAM,qBAAqB;AAAA,EAChC,MAAM;AACR;AAEO,MAAM,yBAAyB;AAAA,EACpC,MAAM;AACR;AAEO,MAAM,sBAAsB;AAAA,EACjC,MAAM;AACR;AAEO,MAAM,qBAAqB;AAAA,EAChC,GAAG,wBAAwB,aAAa,YAAY;AAAA,EACpD,WAAW;AACb;AAEO,MAAM,2BAA2B,wBAAwB,mBAAmB,kBAAkB;AAE9F,MAAM,+BAA+B,wBAAwB,uBAAuB,sBAAsB;AAE1G,MAAM,4BAA4B,wBAAwB,oBAAoB,mBAAmB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import { toast } from "./toast.js";
|
|
|
4
4
|
import { ToastType, toastTypes, ToastPosition, toastsPositions } from "./constants.js";
|
|
5
5
|
import { DSToastAction, DSToastActionWithSchema } from "./parts/DSToastAction.js";
|
|
6
6
|
import { DSToastActionLink, DSToastActionLinkWithSchema } from "./parts/DSToastActionLink.js";
|
|
7
|
+
import { DSToastContent, DSToastContentWithSchema } from "./parts/DSToastContent.js";
|
|
7
8
|
import {
|
|
8
9
|
DSToastName,
|
|
9
10
|
DSToastActionName,
|
|
@@ -28,6 +29,8 @@ export {
|
|
|
28
29
|
DSToastActionName,
|
|
29
30
|
DSToastActionSlots,
|
|
30
31
|
DSToastActionWithSchema,
|
|
32
|
+
DSToastContent,
|
|
33
|
+
DSToastContentWithSchema,
|
|
31
34
|
DSToastDataTestIds,
|
|
32
35
|
DSToastName,
|
|
33
36
|
DSToastSlots,
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { DSToast, DSToastWithSchema } from './parts/DSToast.js';\nexport { toast } from './toast.js';\nexport { ToastType, toastTypes, ToastPosition, toastsPositions } from './constants.js';\nexport { DSToastAction, DSToastActionWithSchema } from './parts/DSToastAction.js';\nexport { DSToastActionLink, DSToastActionLinkWithSchema } from './parts/DSToastActionLink.js';\nexport {\n DSToastName,\n DSToastActionName,\n DSToastActionLinkName,\n DSToastSlots,\n DSToastActionSlots,\n DSToastActionLinkSlots,\n DSToastDataTestIds,\n DSToastActionDataTestIds,\n DSToastActionLinkDataTestIds,\n} from './DSToastDefinitions.js';\nimport type {} from '@xstyled/system';\nexport { default } from './parts/DSToast.js';\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,SAAS,yBAAyB;AAC3C,SAAS,aAAa;AACtB,SAAS,WAAW,YAAY,eAAe,uBAAuB;AACtE,SAAS,eAAe,+BAA+B;AACvD,SAAS,mBAAmB,mCAAmC;AAC/D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { DSToast, DSToastWithSchema } from './parts/DSToast.js';\nexport { toast } from './toast.js';\nexport { ToastType, toastTypes, ToastPosition, toastsPositions } from './constants.js';\nexport { DSToastAction, DSToastActionWithSchema } from './parts/DSToastAction.js';\nexport { DSToastActionLink, DSToastActionLinkWithSchema } from './parts/DSToastActionLink.js';\nexport { DSToastContent, DSToastContentWithSchema } from './parts/DSToastContent.js';\nexport {\n DSToastName,\n DSToastActionName,\n DSToastActionLinkName,\n DSToastSlots,\n DSToastActionSlots,\n DSToastActionLinkSlots,\n DSToastDataTestIds,\n DSToastActionDataTestIds,\n DSToastActionLinkDataTestIds,\n} from './DSToastDefinitions.js';\nimport type {} from '@xstyled/system';\nimport type {} from '@xstyled/util';\nexport { default } from './parts/DSToast.js';\nexport type { DSToastT } from './react-desc-prop-types.js';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,SAAS,yBAAyB;AAC3C,SAAS,aAAa;AACtB,SAAS,WAAW,YAAY,eAAe,uBAAuB;AACtE,SAAS,eAAe,+BAA+B;AACvD,SAAS,mBAAmB,mCAAmC;AAC/D,SAAS,gBAAgB,gCAAgC;AACzD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,SAAS,WAAAA,gBAAe;",
|
|
6
6
|
"names": ["default"]
|
|
7
7
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { DSToastContentPropTypes } from "../react-desc-prop-types.js";
|
|
4
|
+
import { describe } from "@elliemae/ds-props-helpers";
|
|
3
5
|
import {
|
|
4
6
|
StyledContainer,
|
|
5
7
|
StyledIconContainer,
|
|
@@ -8,12 +10,14 @@ import {
|
|
|
8
10
|
StyledMessageText
|
|
9
11
|
} from "./styled.js";
|
|
10
12
|
import { ToastType, TYPE_TO_ICON, TYPE_TO_ICON_COLOR } from "../constants.js";
|
|
13
|
+
import { DSToastContentName } from "../DSToastDefinitions.js";
|
|
11
14
|
const getIconByToastType = (type) => TYPE_TO_ICON[type];
|
|
12
15
|
const getIconColorByToastType = (type) => TYPE_TO_ICON_COLOR[type];
|
|
13
16
|
const DSToastContent = ({
|
|
14
17
|
type = ToastType.DEFAULT,
|
|
15
18
|
messageTitle = "",
|
|
16
|
-
messageText = ""
|
|
19
|
+
messageText = "",
|
|
20
|
+
messageComponent
|
|
17
21
|
}) => {
|
|
18
22
|
const IconMessage = getIconByToastType(type);
|
|
19
23
|
const iconColor = getIconColorByToastType(type);
|
|
@@ -21,12 +25,16 @@ const DSToastContent = ({
|
|
|
21
25
|
/* @__PURE__ */ jsx(StyledIconContainer, { className: "em-ds-toast-content__icon-container", children: /* @__PURE__ */ jsx(IconMessage, { size: "m", className: "em-ds-toast-content__icon-message", color: iconColor }) }),
|
|
22
26
|
/* @__PURE__ */ jsxs(StyledMessageContent, { className: "em-ds-toast-content__message-content", children: [
|
|
23
27
|
/* @__PURE__ */ jsx(StyledMessageHeader, { className: "em-ds-toast-content__message-header", children: messageTitle }),
|
|
24
|
-
/* @__PURE__ */ jsx(StyledMessageText, { className: "em-ds-toast-content__message-text", children: messageText })
|
|
28
|
+
/* @__PURE__ */ jsx(StyledMessageText, { className: "em-ds-toast-content__message-text", children: messageComponent ? messageComponent : messageText })
|
|
25
29
|
] })
|
|
26
30
|
] });
|
|
27
31
|
};
|
|
32
|
+
DSToastContent.displayName = DSToastContentName;
|
|
33
|
+
const DSToastContentWithSchema = describe(DSToastContent);
|
|
34
|
+
DSToastContentWithSchema.propTypes = DSToastContentPropTypes;
|
|
28
35
|
export {
|
|
29
36
|
DSToastContent,
|
|
37
|
+
DSToastContentWithSchema,
|
|
30
38
|
getIconByToastType,
|
|
31
39
|
getIconColorByToastType
|
|
32
40
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/DSToastContent.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport type { SvgIconT } from '@elliemae/ds-icons';\nimport type
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport type { SvgIconT } from '@elliemae/ds-icons';\nimport { DSToastContentPropTypes, type DSToastT } from '../react-desc-prop-types.js';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport {\n StyledContainer,\n StyledIconContainer,\n StyledMessageContent,\n StyledMessageHeader,\n StyledMessageText,\n} from './styled.js';\nimport { ToastType, TYPE_TO_ICON, TYPE_TO_ICON_COLOR } from '../constants.js';\nimport { DSToastContentName } from '../DSToastDefinitions.js';\n\nexport const getIconByToastType = (type: DSToastT.ToastTypes) => TYPE_TO_ICON[type];\nexport const getIconColorByToastType = (type: DSToastT.ToastTypes): SvgIconT.ColorType =>\n TYPE_TO_ICON_COLOR[type] as SvgIconT.ColorType;\n\nexport interface DSToastContentProps {\n type?: DSToastT.ToastTypes;\n messageTitle?: string;\n messageText?: string;\n messageComponent?: React.ReactNode;\n}\n\nconst DSToastContent: React.ComponentType<DSToastContentProps> = ({\n type = ToastType.DEFAULT,\n messageTitle = '',\n messageText = '',\n messageComponent,\n}) => {\n const IconMessage = getIconByToastType(type);\n const iconColor = getIconColorByToastType(type);\n\n return (\n <StyledContainer data-testid=\"ds-toast-render\" className=\"em-ds-toast-content\">\n <StyledIconContainer className=\"em-ds-toast-content__icon-container\">\n <IconMessage size=\"m\" className=\"em-ds-toast-content__icon-message\" color={iconColor} />\n </StyledIconContainer>\n <StyledMessageContent className=\"em-ds-toast-content__message-content\">\n <StyledMessageHeader className=\"em-ds-toast-content__message-header\">{messageTitle}</StyledMessageHeader>\n <StyledMessageText className=\"em-ds-toast-content__message-text\">\n {messageComponent ? messageComponent : messageText}\n </StyledMessageText>\n </StyledMessageContent>\n </StyledContainer>\n );\n};\n\nDSToastContent.displayName = DSToastContentName;\nconst DSToastContentWithSchema = describe(DSToastContent);\nDSToastContentWithSchema.propTypes = DSToastContentPropTypes;\n\nexport { DSToastContent, DSToastContentWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACqCf,cAEF,YAFE;AAnCR,SAAS,+BAA8C;AACvD,SAAS,gBAAgB;AACzB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,WAAW,cAAc,0BAA0B;AAC5D,SAAS,0BAA0B;AAE5B,MAAM,qBAAqB,CAAC,SAA8B,aAAa,IAAI;AAC3E,MAAM,0BAA0B,CAAC,SACtC,mBAAmB,IAAI;AASzB,MAAM,iBAA2D,CAAC;AAAA,EAChE,OAAO,UAAU;AAAA,EACjB,eAAe;AAAA,EACf,cAAc;AAAA,EACd;AACF,MAAM;AACJ,QAAM,cAAc,mBAAmB,IAAI;AAC3C,QAAM,YAAY,wBAAwB,IAAI;AAE9C,SACE,qBAAC,mBAAgB,eAAY,mBAAkB,WAAU,uBACvD;AAAA,wBAAC,uBAAoB,WAAU,uCAC7B,8BAAC,eAAY,MAAK,KAAI,WAAU,qCAAoC,OAAO,WAAW,GACxF;AAAA,IACA,qBAAC,wBAAqB,WAAU,wCAC9B;AAAA,0BAAC,uBAAoB,WAAU,uCAAuC,wBAAa;AAAA,MACnF,oBAAC,qBAAkB,WAAU,qCAC1B,6BAAmB,mBAAmB,aACzC;AAAA,OACF;AAAA,KACF;AAEJ;AAEA,eAAe,cAAc;AAC7B,MAAM,2BAA2B,SAAS,cAAc;AACxD,yBAAyB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { PropTypes } from "@elliemae/ds-props-helpers";
|
|
3
|
-
import { toastsPositions } from "./constants.js";
|
|
3
|
+
import { toastsPositions, toastTypes } from "./constants.js";
|
|
4
4
|
const defaultProps = {
|
|
5
5
|
containerProps: {},
|
|
6
6
|
position: "bottom-left",
|
|
@@ -38,9 +38,20 @@ const DSToastActionPropsTypes = {
|
|
|
38
38
|
/** key down handler */
|
|
39
39
|
onKeyDown: PropTypes.func.description("key down handler")
|
|
40
40
|
};
|
|
41
|
+
const DSToastContentPropTypes = {
|
|
42
|
+
/** Type of toast */
|
|
43
|
+
type: PropTypes.oneOf(toastTypes).description("Type of toast").defaultValue("default"),
|
|
44
|
+
/** Toast message title */
|
|
45
|
+
messageTitle: PropTypes.string.description("Toast message title").defaultValue(""),
|
|
46
|
+
/** Toast message text */
|
|
47
|
+
messageText: PropTypes.string.description("Toast message text").defaultValue(""),
|
|
48
|
+
/** Toast message component */
|
|
49
|
+
messageComponent: PropTypes.node.description("Toast message component")
|
|
50
|
+
};
|
|
41
51
|
export {
|
|
42
52
|
DSToastActionLinkPropTypes,
|
|
43
53
|
DSToastActionPropsTypes,
|
|
54
|
+
DSToastContentPropTypes,
|
|
44
55
|
DSToastPropTypes,
|
|
45
56
|
actionDefaultProps,
|
|
46
57
|
defaultProps
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type React from 'react';\nimport type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-props-helpers';\nimport { PropTypes } from '@elliemae/ds-props-helpers';\nimport type { WeakValidationMap } from 'react';\nimport { toastsPositions
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,iBAAiB;AAE1B,SAAS,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type React from 'react';\nimport type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-props-helpers';\nimport { PropTypes } from '@elliemae/ds-props-helpers';\nimport type { WeakValidationMap } from 'react';\nimport { toastsPositions, toastTypes } from './constants.js';\n\nexport declare namespace DSToastT {\n type PropsT<D, R, O, E> = Partial<D> &\n R &\n O &\n Omit<GlobalAttributesT<E>, keyof D | keyof R | keyof O> &\n Omit<XstyledProps, keyof D | keyof R | keyof O>;\n\n type InternalPropsT<D, R, O, E> = D &\n R &\n O &\n Omit<GlobalAttributesT<E>, keyof D | keyof R | keyof O> &\n Omit<XstyledProps, keyof D | keyof R | keyof O>;\n\n export type ToastPositions = (typeof toastsPositions)[number];\n\n export type ToastTypes = (typeof toastTypes)[number];\n\n export interface DefaultProps {\n containerProps: Record<string, unknown>;\n position: ToastPositions;\n autoClose: number;\n showProgressBar: boolean;\n closeOnClick: boolean;\n enableMultiContainer: boolean;\n }\n\n export interface OptionalProps {\n containerId?: string | number;\n closeButtonRef?: React.MutableRefObject<HTMLButtonElement | null>;\n }\n\n export interface RequiredProps {}\n\n export type Props = PropsT<DefaultProps, RequiredProps, OptionalProps, HTMLDivElement>;\n\n export type InternalProps = InternalPropsT<DefaultProps, RequiredProps, OptionalProps, HTMLDivElement>;\n\n export interface ActionDefaultProps {}\n\n export interface ActionOptionalProps {\n onClick?: React.MouseEventHandler;\n onKeyDown?: React.KeyboardEventHandler;\n }\n\n export interface ActionRequiredProps {\n children: React.ReactNode;\n }\n\n export type ActionProps = PropsT<ActionDefaultProps, ActionRequiredProps, ActionOptionalProps, HTMLDivElement>;\n\n export type ActionInternalProps = InternalPropsT<\n ActionDefaultProps,\n ActionRequiredProps,\n ActionOptionalProps,\n HTMLDivElement\n >;\n}\n\nexport const defaultProps: DSToastT.DefaultProps = {\n containerProps: {},\n position: 'bottom-left',\n autoClose: 5000,\n showProgressBar: false,\n closeOnClick: false,\n enableMultiContainer: false,\n};\n\nexport const actionDefaultProps: DSToastT.ActionDefaultProps = {};\n\n// =============================================================================\n// PropTypes\n// =============================================================================\nexport const DSToastPropTypes = {\n /** inject props to wrapper */\n containerProps: PropTypes.object.description('inject props to wrapper').defaultValue({}),\n /** Position on the screen to show the toast */\n position: PropTypes.oneOf(toastsPositions as unknown as string[])\n .description('Position on the screen to show the toast')\n .defaultValue('bottom-left'),\n /** ms to autoclose the toast */\n autoClose: PropTypes.oneOfType([PropTypes.number, PropTypes.oneOf([false])])\n .description(\"ms to autoclose the toast, false if you don't want to automatically close\")\n .defaultValue(5000),\n /** Whether to show a progress bar indicating when the toast is going to be closed */\n showProgressBar: PropTypes.bool\n .description('Whether to show a progress bar indicating when the toast is going to be closed')\n .defaultValue(false),\n /** Close toast handler */\n closeOnClick: PropTypes.bool.description('Close toast handler').defaultValue(false),\n /** Allows instantiating multiple Toast containers */\n enableMultiContainer: PropTypes.bool\n .description('Allows instantiating multiple Toast containers')\n .defaultValue(false),\n /** unique id for multi container */\n containerId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('unique id for multi container'),\n} as WeakValidationMap<unknown>;\n\nexport const DSToastActionLinkPropTypes = {\n /** link text */\n children: PropTypes.node.isRequired.description('link text'),\n} as React.WeakValidationMap<unknown>;\n\nexport const DSToastActionPropsTypes = {\n /** DSToastActionLink component or text string */\n children: PropTypes.node.description('DSToastActionLink component or text string'),\n /** click handler */\n onClick: PropTypes.func.description('click handler'),\n /** key down handler */\n onKeyDown: PropTypes.func.description('key down handler'),\n} as React.WeakValidationMap<unknown>;\n\nexport const DSToastContentPropTypes = {\n /** Type of toast */\n type: PropTypes.oneOf(toastTypes as unknown as string[])\n .description('Type of toast')\n .defaultValue('default'),\n /** Toast message title */\n messageTitle: PropTypes.string.description('Toast message title').defaultValue(''),\n /** Toast message text */\n messageText: PropTypes.string.description('Toast message text').defaultValue(''),\n /** Toast message component */\n messageComponent: PropTypes.node.description('Toast message component'),\n} as React.WeakValidationMap<unknown>;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,iBAAiB;AAE1B,SAAS,iBAAiB,kBAAkB;AA4DrC,MAAM,eAAsC;AAAA,EACjD,gBAAgB,CAAC;AAAA,EACjB,UAAU;AAAA,EACV,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,sBAAsB;AACxB;AAEO,MAAM,qBAAkD,CAAC;AAKzD,MAAM,mBAAmB;AAAA;AAAA,EAE9B,gBAAgB,UAAU,OAAO,YAAY,yBAAyB,EAAE,aAAa,CAAC,CAAC;AAAA;AAAA,EAEvF,UAAU,UAAU,MAAM,eAAsC,EAC7D,YAAY,0CAA0C,EACtD,aAAa,aAAa;AAAA;AAAA,EAE7B,WAAW,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EACxE,YAAY,2EAA2E,EACvF,aAAa,GAAI;AAAA;AAAA,EAEpB,iBAAiB,UAAU,KACxB,YAAY,gFAAgF,EAC5F,aAAa,KAAK;AAAA;AAAA,EAErB,cAAc,UAAU,KAAK,YAAY,qBAAqB,EAAE,aAAa,KAAK;AAAA;AAAA,EAElF,sBAAsB,UAAU,KAC7B,YAAY,gDAAgD,EAC5D,aAAa,KAAK;AAAA;AAAA,EAErB,aAAa,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,EAAE,YAAY,+BAA+B;AACpH;AAEO,MAAM,6BAA6B;AAAA;AAAA,EAExC,UAAU,UAAU,KAAK,WAAW,YAAY,WAAW;AAC7D;AAEO,MAAM,0BAA0B;AAAA;AAAA,EAErC,UAAU,UAAU,KAAK,YAAY,4CAA4C;AAAA;AAAA,EAEjF,SAAS,UAAU,KAAK,YAAY,eAAe;AAAA;AAAA,EAEnD,WAAW,UAAU,KAAK,YAAY,kBAAkB;AAC1D;AAEO,MAAM,0BAA0B;AAAA;AAAA,EAErC,MAAM,UAAU,MAAM,UAAiC,EACpD,YAAY,eAAe,EAC3B,aAAa,SAAS;AAAA;AAAA,EAEzB,cAAc,UAAU,OAAO,YAAY,qBAAqB,EAAE,aAAa,EAAE;AAAA;AAAA,EAEjF,aAAa,UAAU,OAAO,YAAY,oBAAoB,EAAE,aAAa,EAAE;AAAA;AAAA,EAE/E,kBAAkB,UAAU,KAAK,YAAY,yBAAyB;AACxE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/toast.js
CHANGED
|
@@ -3,11 +3,22 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { toast as toastifyToast } from "react-toastify";
|
|
4
4
|
import { DSToastContent } from "./parts/DSToastContent.js";
|
|
5
5
|
const toast = Object.assign(
|
|
6
|
-
({ type, messageTitle, messageText, ...rest }, options) => toastifyToast(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
({ type, messageTitle, messageText, messageComponent, ...rest }, options) => toastifyToast(
|
|
7
|
+
/* @__PURE__ */ jsx(
|
|
8
|
+
DSToastContent,
|
|
9
|
+
{
|
|
10
|
+
messageText,
|
|
11
|
+
messageComponent,
|
|
12
|
+
messageTitle,
|
|
13
|
+
type
|
|
14
|
+
}
|
|
15
|
+
),
|
|
16
|
+
{
|
|
17
|
+
...rest,
|
|
18
|
+
...options,
|
|
19
|
+
type
|
|
20
|
+
}
|
|
21
|
+
),
|
|
11
22
|
{ ...toastifyToast, isActive: (id) => toastifyToast.isActive(id) }
|
|
12
23
|
);
|
|
13
24
|
export {
|
package/dist/esm/toast.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/toast.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport type { ToastOptions } from 'react-toastify';\nimport { toast as toastifyToast } from 'react-toastify';\nimport type { DSToastContentProps } from './parts/DSToastContent.js';\nimport { DSToastContent } from './parts/DSToastContent.js';\n\nconst toast = Object.assign(\n ({ type, messageTitle, messageText, ...rest }: DSToastContentProps, options: ToastOptions) =>\n toastifyToast(<DSToastContent
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport type { ToastOptions } from 'react-toastify';\nimport { toast as toastifyToast } from 'react-toastify';\nimport type { DSToastContentProps } from './parts/DSToastContent.js';\nimport { DSToastContent } from './parts/DSToastContent.js';\n\nconst toast = Object.assign(\n ({ type, messageTitle, messageText, messageComponent, ...rest }: DSToastContentProps, options: ToastOptions) =>\n toastifyToast(\n <DSToastContent\n messageText={messageText}\n messageComponent={messageComponent}\n messageTitle={messageTitle}\n type={type}\n />,\n {\n ...rest,\n ...options,\n type,\n },\n ),\n { ...toastifyToast, isActive: (id: string | number) => toastifyToast.isActive(id) },\n);\n\nexport { toast };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACSjB;AAPN,SAAS,SAAS,qBAAqB;AAEvC,SAAS,sBAAsB;AAE/B,MAAM,QAAQ,OAAO;AAAA,EACnB,CAAC,EAAE,MAAM,cAAc,aAAa,kBAAkB,GAAG,KAAK,GAAwB,YACpF;AAAA,IACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,GAAG;AAAA,MACH;AAAA,IACF;AAAA,EACF;AAAA,EACF,EAAE,GAAG,eAAe,UAAU,CAAC,OAAwB,cAAc,SAAS,EAAE,EAAE;AACpF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { createRef } from "react";
|
|
4
|
+
import { DSToast } from "../index.js";
|
|
5
|
+
const closeButtonRef = createRef();
|
|
6
|
+
const testRequiredProps = {};
|
|
7
|
+
const testOptionalProps = {
|
|
8
|
+
containerId: "",
|
|
9
|
+
closeButtonRef
|
|
10
|
+
};
|
|
11
|
+
const testPartialDefaults = {
|
|
12
|
+
containerProps: { "data-testid": "ds-toast-1" },
|
|
13
|
+
position: "top-center",
|
|
14
|
+
showProgressBar: false
|
|
15
|
+
};
|
|
16
|
+
const testProps = {
|
|
17
|
+
...testRequiredProps,
|
|
18
|
+
...testOptionalProps,
|
|
19
|
+
...testPartialDefaults
|
|
20
|
+
};
|
|
21
|
+
const testPropsAsSyntax = {
|
|
22
|
+
...testRequiredProps,
|
|
23
|
+
...testOptionalProps,
|
|
24
|
+
...testPartialDefaults
|
|
25
|
+
};
|
|
26
|
+
const testCompleteDefaults = {
|
|
27
|
+
containerProps: { "data-testid": "ds-toast-1" },
|
|
28
|
+
position: "top-center",
|
|
29
|
+
autoClose: 2e3,
|
|
30
|
+
showProgressBar: true,
|
|
31
|
+
closeOnClick: true,
|
|
32
|
+
enableMultiContainer: false
|
|
33
|
+
};
|
|
34
|
+
const testInternalProps = {
|
|
35
|
+
...testRequiredProps,
|
|
36
|
+
...testOptionalProps,
|
|
37
|
+
...testCompleteDefaults
|
|
38
|
+
};
|
|
39
|
+
const testInternalPropsAsSyntax = {
|
|
40
|
+
...testRequiredProps,
|
|
41
|
+
...testOptionalProps,
|
|
42
|
+
...testCompleteDefaults
|
|
43
|
+
};
|
|
44
|
+
const testExplicitDefinition = {
|
|
45
|
+
containerProps: { "data-testid": "ds-toast-1" },
|
|
46
|
+
position: "top-left",
|
|
47
|
+
autoClose: 5e3,
|
|
48
|
+
showProgressBar: true,
|
|
49
|
+
closeOnClick: false,
|
|
50
|
+
enableMultiContainer: false
|
|
51
|
+
};
|
|
52
|
+
const testInferedTypeCompatibility = {
|
|
53
|
+
containerProps: { "data-testid": "ds-toast-1" },
|
|
54
|
+
position: "top-left",
|
|
55
|
+
autoClose: 5e3,
|
|
56
|
+
showProgressBar: true,
|
|
57
|
+
closeOnClick: false,
|
|
58
|
+
enableMultiContainer: false
|
|
59
|
+
};
|
|
60
|
+
const testDefinitionAsConst = {
|
|
61
|
+
containerProps: { "data-testid": "ds-toast-1" },
|
|
62
|
+
position: "top-left",
|
|
63
|
+
autoClose: 5e3,
|
|
64
|
+
showProgressBar: true,
|
|
65
|
+
closeOnClick: false,
|
|
66
|
+
enableMultiContainer: false
|
|
67
|
+
};
|
|
68
|
+
const ExampleUsageComponent = () => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
69
|
+
/* @__PURE__ */ jsx(DSToast, { ...testExplicitDefinition }),
|
|
70
|
+
/* @__PURE__ */ jsx(DSToast, { ...testInferedTypeCompatibility }),
|
|
71
|
+
/* @__PURE__ */ jsx(DSToast, { ...testDefinitionAsConst }),
|
|
72
|
+
/* @__PURE__ */ jsx(
|
|
73
|
+
DSToast,
|
|
74
|
+
{
|
|
75
|
+
containerProps: { "data-testid": "ds-toast-1" },
|
|
76
|
+
position: "top-left",
|
|
77
|
+
autoClose: 5e3,
|
|
78
|
+
showProgressBar: true,
|
|
79
|
+
closeOnClick: false,
|
|
80
|
+
enableMultiContainer: false
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
] });
|
|
84
|
+
//# sourceMappingURL=typescript-toast-valid.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/typescript-toast-valid.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport { createRef } from 'react';\nimport { DSToast } from '../index.js';\nimport type { DSToastT } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = DSToastT.Props;\ntype ComponentPropsInternals = DSToastT.InternalProps;\ntype ComponentPropsDefaultProps = DSToastT.DefaultProps;\ntype ComponentPropsOptionalProps = DSToastT.OptionalProps;\ntype ComponentPropsRequiredProps = DSToastT.RequiredProps;\n\nconst closeButtonRef = createRef<HTMLButtonElement>();\n\nconst testRequiredProps: ComponentPropsRequiredProps = {};\n\nconst testOptionalProps: ComponentPropsOptionalProps = {\n containerId: '',\n closeButtonRef: closeButtonRef,\n};\n\n// difference Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\nconst testPartialDefaults: Partial<ComponentPropsDefaultProps> = {\n containerProps: { 'data-testid': 'ds-toast-1' },\n position: 'top-center',\n showProgressBar: false,\n};\n\nconst testProps: ComponentPropsForApp = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n};\n\nconst testPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {\n containerProps: { 'data-testid': 'ds-toast-1' },\n position: 'top-center',\n autoClose: 2000,\n showProgressBar: true,\n closeOnClick: true,\n enableMultiContainer: false,\n};\n\nconst testInternalProps: ComponentPropsInternals = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n};\n\nconst testInternalPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n} as ComponentPropsInternals;\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\nconst testExplicitDefinition: ComponentPropsForApp = {\n containerProps: { 'data-testid': 'ds-toast-1' },\n position: 'top-left',\n autoClose: 5000,\n showProgressBar: true,\n closeOnClick: false,\n enableMultiContainer: false,\n};\n\n// using the \"as\" syntax, if there is an error, it will be marking the whole object as wrong because it is not compatible with the type\nconst testInferedTypeCompatibility = {\n containerProps: { 'data-testid': 'ds-toast-1' },\n position: 'top-left',\n autoClose: 5000,\n showProgressBar: true,\n closeOnClick: false,\n enableMultiContainer: false,\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n containerProps: { 'data-testid': 'ds-toast-1' },\n position: 'top-left',\n autoClose: 5000,\n showProgressBar: true,\n closeOnClick: false,\n enableMultiContainer: false,\n} as const;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <DSToast {...testExplicitDefinition} />\n <DSToast {...testInferedTypeCompatibility} />\n <DSToast {...testDefinitionAsConst} />\n {/* works with inline values */}\n <DSToast\n containerProps={{ 'data-testid': 'ds-toast-1' }}\n position=\"top-left\"\n autoClose={5000}\n showProgressBar={true}\n closeOnClick={false}\n enableMultiContainer={false}\n />\n </>\n);\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC6FrB,mBAEE,KAFF;AA5FF,SAAS,iBAAiB;AAC1B,SAAS,eAAe;AAUxB,MAAM,iBAAiB,UAA6B;AAEpD,MAAM,oBAAiD,CAAC;AAExD,MAAM,oBAAiD;AAAA,EACrD,aAAa;AAAA,EACb;AACF;AAIA,MAAM,sBAA2D;AAAA,EAC/D,gBAAgB,EAAE,eAAe,aAAa;AAAA,EAC9C,UAAU;AAAA,EACV,iBAAiB;AACnB;AAEA,MAAM,YAAkC;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,oBAAoB;AAAA,EACxB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,uBAA6D;AAAA,EACjE,gBAAgB,EAAE,eAAe,aAAa;AAAA,EAC9C,UAAU;AAAA,EACV,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,sBAAsB;AACxB;AAEA,MAAM,oBAA6C;AAAA,EACjD,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,4BAA4B;AAAA,EAChC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,yBAA+C;AAAA,EACnD,gBAAgB,EAAE,eAAe,aAAa;AAAA,EAC9C,UAAU;AAAA,EACV,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,sBAAsB;AACxB;AAGA,MAAM,+BAA+B;AAAA,EACnC,gBAAgB,EAAE,eAAe,aAAa;AAAA,EAC9C,UAAU;AAAA,EACV,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,sBAAsB;AACxB;AAEA,MAAM,wBAAwB;AAAA,EAC5B,gBAAgB,EAAE,eAAe,aAAa;AAAA,EAC9C,UAAU;AAAA,EACV,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,sBAAsB;AACxB;AAEA,MAAM,wBAAwB,MAC5B,iCAEE;AAAA,sBAAC,WAAS,GAAG,wBAAwB;AAAA,EACrC,oBAAC,WAAS,GAAG,8BAA8B;AAAA,EAC3C,oBAAC,WAAS,GAAG,uBAAuB;AAAA,EAEpC;AAAA,IAAC;AAAA;AAAA,MACC,gBAAgB,EAAE,eAAe,aAAa;AAAA,MAC9C,UAAS;AAAA,MACT,WAAW;AAAA,MACX,iBAAiB;AAAA,MACjB,cAAc;AAAA,MACd,sBAAsB;AAAA;AAAA,EACxB;AAAA,GACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const DSToastName = "DSToast";
|
|
2
2
|
export declare const DSToastActionLinkName = "DSToastActionLink";
|
|
3
3
|
export declare const DSToastActionName = "DSToastAction";
|
|
4
|
+
export declare const DSToastContentName = "DSToastContent";
|
|
4
5
|
export declare const DSToastSlots: {
|
|
5
6
|
ROOT: string;
|
|
6
7
|
CLOSE_BUTTON: string;
|
|
@@ -16,8 +17,12 @@ export declare const DSToastActionSlots: {
|
|
|
16
17
|
export declare const DSToastActionLinkSlots: {
|
|
17
18
|
ROOT: string;
|
|
18
19
|
};
|
|
20
|
+
export declare const DSToastContentSlots: {
|
|
21
|
+
ROOT: string;
|
|
22
|
+
};
|
|
19
23
|
export declare const DSToastDataTestIds: {
|
|
20
24
|
CONTAINER: string;
|
|
21
25
|
};
|
|
22
26
|
export declare const DSToastActionDataTestIds: Record<string, string>;
|
|
23
27
|
export declare const DSToastActionLinkDataTestIds: Record<string, string>;
|
|
28
|
+
export declare const DSToastContentDataTestIds: Record<string, string>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,5 +3,7 @@ export { toast } from './toast.js';
|
|
|
3
3
|
export { ToastType, toastTypes, ToastPosition, toastsPositions } from './constants.js';
|
|
4
4
|
export { DSToastAction, DSToastActionWithSchema } from './parts/DSToastAction.js';
|
|
5
5
|
export { DSToastActionLink, DSToastActionLinkWithSchema } from './parts/DSToastActionLink.js';
|
|
6
|
+
export { DSToastContent, DSToastContentWithSchema } from './parts/DSToastContent.js';
|
|
6
7
|
export { DSToastName, DSToastActionName, DSToastActionLinkName, DSToastSlots, DSToastActionSlots, DSToastActionLinkSlots, DSToastDataTestIds, DSToastActionDataTestIds, DSToastActionLinkDataTestIds, } from './DSToastDefinitions.js';
|
|
7
8
|
export { default } from './parts/DSToast.js';
|
|
9
|
+
export type { DSToastT } from './react-desc-prop-types.js';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const DSToastActionLink: import("styled-components").StyledComponent<"span", import("@elliemae/ds-system").Theme, import("@xstyled/util").Props<import("@xstyled/system").Theme> & import("@xstyled/system").TypographyProps<import("@xstyled/system").Theme> & import("@elliemae/ds-system").BackgroundProps & import("@elliemae/ds-system").SpaceProps & import("@xstyled/system").BoxShadowProps<import("@xstyled/system").Theme> & import("@xstyled/system").FlexboxesProps<import("@xstyled/system").Theme> & import("@xstyled/system").LayoutProps<import("@xstyled/system").Theme> & import("@elliemae/ds-system").ColorProps & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"span">, never>;
|
|
3
|
+
export declare const DSToastActionLinkWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<{
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
[x: number]: any;
|
|
6
|
+
[x: symbol]: any;
|
|
7
|
+
} & {
|
|
8
|
+
theme?: import("@elliemae/ds-system").Theme | undefined;
|
|
9
|
+
} & {
|
|
10
|
+
as?: string | import("react").ComponentType<any> | undefined;
|
|
11
|
+
forwardedAs?: string | import("react").ComponentType<any> | undefined;
|
|
12
|
+
}>;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { SvgIconT } from '@elliemae/ds-icons';
|
|
3
|
-
import type
|
|
3
|
+
import { type DSToastT } from '../react-desc-prop-types.js';
|
|
4
4
|
export declare const getIconByToastType: (type: DSToastT.ToastTypes) => ((props: SvgIconT.Props) => import("react/jsx-runtime.js").JSX.Element) | ((props: SvgIconT.Props) => import("react/jsx-runtime.js").JSX.Element) | ((rest: SvgIconT.Props) => import("react/jsx-runtime.js").JSX.Element) | ((props: SvgIconT.Props) => import("react/jsx-runtime.js").JSX.Element) | (() => null);
|
|
5
5
|
export declare const getIconColorByToastType: (type: DSToastT.ToastTypes) => SvgIconT.ColorType;
|
|
6
6
|
export interface DSToastContentProps {
|
|
7
7
|
type?: DSToastT.ToastTypes;
|
|
8
8
|
messageTitle?: string;
|
|
9
9
|
messageText?: string;
|
|
10
|
+
messageComponent?: React.ReactNode;
|
|
10
11
|
}
|
|
11
|
-
|
|
12
|
+
declare const DSToastContent: React.ComponentType<DSToastContentProps>;
|
|
13
|
+
declare const DSToastContentWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<DSToastContentProps>;
|
|
14
|
+
export { DSToastContent, DSToastContentWithSchema };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledLink: import("styled-components").StyledComponent<"span", import("@elliemae/ds-system").Theme, import("@xstyled/util").Props<import("@xstyled/system").Theme> & import("@xstyled/system").TypographyProps<import("@xstyled/system").Theme> & import("@elliemae/ds-system").BackgroundProps & import("@elliemae/ds-system").SpaceProps & import("@xstyled/system").BoxShadowProps<import("@xstyled/system").Theme> & import("@xstyled/system").FlexboxesProps<import("@xstyled/system").Theme> & import("@xstyled/system").LayoutProps<import("@xstyled/system").Theme> & import("@elliemae/ds-system").ColorProps & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"span">, never>;
|
|
3
|
+
export declare const StyledContainer: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
|
|
4
|
+
export declare const StyledIconContainer: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
|
|
5
|
+
export declare const StyledMessageContent: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
|
|
6
|
+
export declare const StyledMessageHeader: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
|
|
7
|
+
export declare const StyledMessageText: import("styled-components").StyledComponent<"span", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"span">, never>;
|
|
8
|
+
export declare const StyledAction: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, import("@xstyled/util").Props<import("@xstyled/system").Theme> & import("@xstyled/system").TypographyProps<import("@xstyled/system").Theme> & import("@elliemae/ds-system").BackgroundProps & import("@elliemae/ds-system").SpaceProps & import("@xstyled/system").BoxShadowProps<import("@xstyled/system").Theme> & import("@xstyled/system").FlexboxesProps<import("@xstyled/system").Theme> & import("@xstyled/system").LayoutProps<import("@xstyled/system").Theme> & import("@elliemae/ds-system").ColorProps & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
|
|
9
|
+
export declare const StyledButton: import("styled-components").StyledComponent<import("react").ComponentType<import("@elliemae/ds-button-v2").DSButtonV2T.Props>, import("@elliemae/ds-system").Theme, {
|
|
10
|
+
theme: import("@elliemae/ds-system").Theme;
|
|
11
|
+
} & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<import("react").ComponentType<import("@elliemae/ds-button-v2").DSButtonV2T.Props>>, never>;
|
|
12
|
+
export declare const ToastifyWrapper: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, import("@xstyled/util").Props<import("@xstyled/system").Theme> & import("@xstyled/system").TypographyProps<import("@xstyled/system").Theme> & import("@elliemae/ds-system").BackgroundProps & import("@elliemae/ds-system").SpaceProps & import("@xstyled/system").BoxShadowProps<import("@xstyled/system").Theme> & import("@xstyled/system").FlexboxesProps<import("@xstyled/system").Theme> & import("@xstyled/system").LayoutProps<import("@xstyled/system").Theme> & import("@elliemae/ds-system").ColorProps & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-props-helpers';
|
|
3
|
-
import { toastsPositions } from './constants.js';
|
|
4
|
-
import type { toastTypes } from './constants.js';
|
|
3
|
+
import { toastsPositions, toastTypes } from './constants.js';
|
|
5
4
|
export declare namespace DSToastT {
|
|
6
5
|
type PropsT<D, R, O, E> = Partial<D> & R & O & Omit<GlobalAttributesT<E>, keyof D | keyof R | keyof O> & Omit<XstyledProps, keyof D | keyof R | keyof O>;
|
|
7
6
|
type InternalPropsT<D, R, O, E> = D & R & O & Omit<GlobalAttributesT<E>, keyof D | keyof R | keyof O> & Omit<XstyledProps, keyof D | keyof R | keyof O>;
|
|
@@ -40,3 +39,4 @@ export declare const actionDefaultProps: DSToastT.ActionDefaultProps;
|
|
|
40
39
|
export declare const DSToastPropTypes: React.WeakValidationMap<unknown>;
|
|
41
40
|
export declare const DSToastActionLinkPropTypes: React.WeakValidationMap<unknown>;
|
|
42
41
|
export declare const DSToastActionPropsTypes: React.WeakValidationMap<unknown>;
|
|
42
|
+
export declare const DSToastContentPropTypes: React.WeakValidationMap<unknown>;
|
package/dist/types/toast.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ToastOptions } from 'react-toastify';
|
|
3
3
|
import type { DSToastContentProps } from './parts/DSToastContent.js';
|
|
4
|
-
declare const toast: (({ type, messageTitle, messageText, ...rest }: DSToastContentProps, options: ToastOptions) => React.ReactText) & {
|
|
4
|
+
declare const toast: (({ type, messageTitle, messageText, messageComponent, ...rest }: DSToastContentProps, options: ToastOptions) => React.ReactText) & {
|
|
5
5
|
isActive: (id: string | number) => boolean;
|
|
6
6
|
success(content: import("react-toastify").ToastContent, options?: ToastOptions | undefined): React.ReactText;
|
|
7
7
|
info(content: import("react-toastify").ToastContent, options?: ToastOptions | undefined): React.ReactText;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-toast",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.30.0-next.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Toast",
|
|
6
6
|
"files": [
|
|
@@ -62,15 +62,15 @@
|
|
|
62
62
|
"@xstyled/system": "~3.7.3",
|
|
63
63
|
"@xstyled/util": "3.7.0",
|
|
64
64
|
"react-toastify": "~6.2.0",
|
|
65
|
-
"@elliemae/ds-
|
|
66
|
-
"@elliemae/ds-
|
|
67
|
-
"@elliemae/ds-icons": "3.
|
|
68
|
-
"@elliemae/ds-
|
|
65
|
+
"@elliemae/ds-props-helpers": "3.30.0-next.0",
|
|
66
|
+
"@elliemae/ds-system": "3.30.0-next.0",
|
|
67
|
+
"@elliemae/ds-icons": "3.30.0-next.0",
|
|
68
|
+
"@elliemae/ds-button-v2": "3.30.0-next.0"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@elliemae/pui-cli": "~9.0.0-next.31",
|
|
72
72
|
"styled-components": "~5.3.9",
|
|
73
|
-
"@elliemae/ds-monorepo-devops": "3.
|
|
73
|
+
"@elliemae/ds-monorepo-devops": "3.30.0-next.0"
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
76
|
"lodash": "^4.17.21",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
},
|
|
81
81
|
"publishConfig": {
|
|
82
82
|
"access": "public",
|
|
83
|
-
"typeSafety":
|
|
83
|
+
"typeSafety": true
|
|
84
84
|
},
|
|
85
85
|
"scripts": {
|
|
86
86
|
"dev": "cross-env NODE_ENV=development node ../../../scripts/build/build.mjs --watch",
|