@elliemae/ds-toast 3.36.0-next.0 → 3.36.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/config/useToast.js +10 -20
- package/dist/cjs/config/useToast.js.map +1 -1
- package/dist/cjs/parts/DSToast.js +0 -1
- package/dist/cjs/parts/DSToast.js.map +2 -2
- package/dist/cjs/parts/styled.js.map +1 -1
- package/dist/esm/config/useToast.js +10 -20
- package/dist/esm/config/useToast.js.map +1 -1
- package/dist/esm/parts/DSToast.js +0 -1
- package/dist/esm/parts/DSToast.js.map +2 -2
- package/dist/esm/parts/styled.js.map +1 -1
- package/dist/types/config/useToast.d.ts +19 -19
- package/dist/types/parts/styled.d.ts +16 -0
- package/package.json +8 -8
|
@@ -56,37 +56,27 @@ const useToast = (props) => {
|
|
|
56
56
|
const actions = [...document.querySelectorAll('.toast-action-text[role="button"]')];
|
|
57
57
|
const activeElement = document.activeElement;
|
|
58
58
|
if (closeButton === activeElement) {
|
|
59
|
-
if (actions.length === 0)
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
actions[actions.length - 1].focus();
|
|
63
|
-
else
|
|
64
|
-
actions[0].focus();
|
|
59
|
+
if (actions.length === 0) return;
|
|
60
|
+
if (event.shiftKey) actions[actions.length - 1].focus();
|
|
61
|
+
else actions[0].focus();
|
|
65
62
|
return;
|
|
66
63
|
}
|
|
67
64
|
if (container === activeElement) {
|
|
68
|
-
if (actions.length === 0 || !event.shiftKey)
|
|
69
|
-
|
|
70
|
-
else
|
|
71
|
-
actions[actions.length - 1].focus();
|
|
65
|
+
if (actions.length === 0 || !event.shiftKey) closeButton.focus();
|
|
66
|
+
else actions[actions.length - 1].focus();
|
|
72
67
|
return;
|
|
73
68
|
}
|
|
74
69
|
const index = actions.indexOf(activeElement);
|
|
75
70
|
if (event.shiftKey) {
|
|
76
|
-
if (index === 0)
|
|
77
|
-
|
|
78
|
-
else
|
|
79
|
-
actions[index - 1].focus();
|
|
71
|
+
if (index === 0) closeButton.focus();
|
|
72
|
+
else actions[index - 1].focus();
|
|
80
73
|
} else {
|
|
81
|
-
if (index === actions.length - 1)
|
|
82
|
-
|
|
83
|
-
else
|
|
84
|
-
actions[index + 1].focus();
|
|
74
|
+
if (index === actions.length - 1) closeButton.focus();
|
|
75
|
+
else actions[index + 1].focus();
|
|
85
76
|
}
|
|
86
77
|
} else if (event.key === "Escape") {
|
|
87
78
|
const closeButton = toastCloseButtonRef.current;
|
|
88
|
-
if (closeButton)
|
|
89
|
-
closeButton.click();
|
|
79
|
+
if (closeButton) closeButton.click();
|
|
90
80
|
}
|
|
91
81
|
};
|
|
92
82
|
return {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useToast.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable complexity */\nimport { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { useRef } from 'react';\nimport { omit } from 'lodash';\nimport type { DSToastT } from '../react-desc-prop-types.js';\nimport { defaultProps } from '../react-desc-prop-types.js';\nimport { mergeRefs } from '@elliemae/ds-utilities';\n\nexport const useToast = (props: DSToastT.Props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSToastT.InternalProps>(\n props,\n defaultProps as Partial<DSToastT.InternalProps>,\n );\n\n const globalAttributes = useGetGlobalAttributes(propsWithDefault);\n\n const xstyledAttributes = useGetXstyledProps(omit(propsWithDefault, 'position'));\n\n const toastifyWrapperRef = useRef<HTMLDivElement | null>(null);\n\n const toastCloseButtonRef = useRef<HTMLButtonElement | null>(null);\n\n const closeButtonRef = mergeRefs(toastCloseButtonRef, propsWithDefault.closeButtonRef);\n\n const onKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Tab') {\n event.preventDefault();\n event.stopPropagation();\n\n const container = toastifyWrapperRef.current;\n const closeButton = document.querySelector('.toast-close-button') as HTMLButtonElement;\n const actions = [...document.querySelectorAll('.toast-action-text[role=\"button\"]')] as HTMLDivElement[];\n\n const activeElement = document.activeElement;\n\n // If the close button is focused\n // 1) No actions => we keep the focus on the close button\n // 2) Shift + Tab => we focus the last action\n // 3) Tab => we focus the first action\n if (closeButton === activeElement) {\n if (actions.length === 0) return; // We keep the focus on the close button\n if (event.shiftKey) actions[actions.length - 1].focus();\n else actions[0].focus();\n return;\n }\n\n // If the container is focused\n // No actions => we focus the close button\n // 2) Shift + Tab => we focus the last action\n // 3) Tab => we focus the close button\n if (container === activeElement) {\n if (actions.length === 0 || !event.shiftKey) closeButton.focus();\n else actions[actions.length - 1].focus();\n return;\n }\n\n const index = actions.indexOf(activeElement as HTMLDivElement);\n\n // If an action is focused\n // 1) Shift + Tab => we focus the previous action (closeButton if it's the first one)\n // 2) Tab => we focus the next action (closeButton if it's the last one)\n if (event.shiftKey) {\n if (index === 0) closeButton.focus();\n else actions[index - 1].focus();\n } else {\n if (index === actions.length - 1) closeButton.focus();\n else actions[index + 1].focus();\n }\n } else if (event.key === 'Escape') {\n const closeButton = toastCloseButtonRef.current;\n if (closeButton) closeButton.click();\n }\n };\n\n return {\n propsWithDefault,\n toastifyWrapperRef,\n onKeyDown,\n globalAttributes,\n xstyledAttributes,\n closeButtonRef,\n };\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,8BAAyF;AACzF,mBAAuB;AACvB,oBAAqB;AAErB,mCAA6B;AAC7B,0BAA0B;AAEnB,MAAM,WAAW,CAAC,UAA0B;AACjD,QAAM,uBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,EACF;AAEA,QAAM,uBAAmB,gDAAuB,gBAAgB;AAEhE,QAAM,wBAAoB,gDAAmB,oBAAK,kBAAkB,UAAU,CAAC;AAE/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,SAAU,SAAQ,QAAQ,SAAS,CAAC,EAAE,MAAM;AAAA,YACjD,SAAQ,CAAC,EAAE,MAAM;AACtB;AAAA,MACF;AAMA,UAAI,cAAc,eAAe;AAC/B,YAAI,QAAQ,WAAW,KAAK,CAAC,MAAM,SAAU,aAAY,MAAM;AAAA,YAC1D,SAAQ,QAAQ,SAAS,CAAC,EAAE,MAAM;AACvC;AAAA,MACF;AAEA,YAAM,QAAQ,QAAQ,QAAQ,aAA+B;AAK7D,UAAI,MAAM,UAAU;AAClB,YAAI,UAAU,EAAG,aAAY,MAAM;AAAA,YAC9B,SAAQ,QAAQ,CAAC,EAAE,MAAM;AAAA,MAChC,OAAO;AACL,YAAI,UAAU,QAAQ,SAAS,EAAG,aAAY,MAAM;AAAA,YAC/C,SAAQ,QAAQ,CAAC,EAAE,MAAM;AAAA,MAChC;AAAA,IACF,WAAW,MAAM,QAAQ,UAAU;AACjC,YAAM,cAAc,oBAAoB;AACxC,UAAI,YAAa,aAAY,MAAM;AAAA,IACrC;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -93,7 +93,6 @@ const DSToast = (props) => {
|
|
|
93
93
|
}
|
|
94
94
|
);
|
|
95
95
|
};
|
|
96
|
-
DSToast.propTypes = import_react_desc_prop_types.DSToastPropTypes;
|
|
97
96
|
DSToast.displayName = import_DSToastDefinitions.DSToastName;
|
|
98
97
|
const DSToastWithSchema = (0, import_ds_props_helpers.describe)(DSToast);
|
|
99
98
|
DSToastWithSchema.propTypes = import_react_desc_prop_types.DSToastPropTypes;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/parts/DSToast.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { useOwnerProps } from '@elliemae/ds-utilities';\nimport { Slide } from 'react-toastify';\nimport type { DSToastT } from '../react-desc-prop-types.js';\nimport { DSToastPropTypes } from '../react-desc-prop-types.js';\nimport { DSToastName } from '../DSToastDefinitions.js';\nimport { CloseButton } from './CloseButton.js';\nimport { ToastifyWrapper, StyledToastContainer } from './styled.js';\nimport { useToast } from '../config/useToast.js';\n\nconst DSToast: React.ComponentType<DSToastT.Props> = (props) => {\n const {\n propsWithDefault,\n propsWithDefault: {\n containerProps,\n position,\n autoClose,\n showProgressBar,\n closeOnClick,\n enableMultiContainer,\n containerId,\n },\n toastifyWrapperRef,\n onKeyDown,\n globalAttributes,\n xstyledAttributes,\n closeButtonRef,\n } = useToast(props);\n\n const ownerPropsConfig = useOwnerProps(propsWithDefault);\n\n return (\n <ToastifyWrapper\n innerRef={toastifyWrapperRef}\n onKeyDown={onKeyDown}\n tabIndex={-1}\n aria-label=\"toast container\"\n role=\"alert\"\n {...globalAttributes}\n {...xstyledAttributes}\n {...ownerPropsConfig}\n >\n <StyledToastContainer\n {...containerProps}\n autoClose={autoClose}\n className={(showProgressBar && 'with-progressbar') || ''}\n closeButton={CloseButton({ closeButtonRef })}\n closeOnClick={closeOnClick}\n containerId={containerId}\n enableMultiContainer={enableMultiContainer}\n hideProgressBar={!showProgressBar}\n newestOnTop\n position={position}\n transition={Slide}\n {...ownerPropsConfig}\n />\n </ToastifyWrapper>\n );\n};\n\nDSToast.
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD2CjB;AA1CN,8BAAyB;AACzB,0BAA8B;AAC9B,4BAAsB;AAEtB,mCAAiC;AACjC,gCAA4B;AAC5B,yBAA4B;AAC5B,oBAAsD;AACtD,sBAAyB;AAEzB,MAAM,UAA+C,CAAC,UAAU;AAC9D,QAAM;AAAA,IACJ;AAAA,IACA,kBAAkB;AAAA,MAChB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,0BAAS,KAAK;AAElB,QAAM,uBAAmB,mCAAc,gBAAgB;AAEvD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,UAAU;AAAA,MACV;AAAA,MACA,UAAU;AAAA,MACV,cAAW;AAAA,MACX,MAAK;AAAA,MACJ,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MAEJ;AAAA,QAAC;AAAA;AAAA,UACE,GAAG;AAAA,UACJ;AAAA,UACA,WAAY,mBAAmB,sBAAuB;AAAA,UACtD,iBAAa,gCAAY,EAAE,eAAe,CAAC;AAAA,UAC3C;AAAA,UACA;AAAA,UACA;AAAA,UACA,iBAAiB,CAAC;AAAA,UAClB,aAAW;AAAA,UACX;AAAA,UACA,YAAY;AAAA,UACX,GAAG;AAAA;AAAA,MACN;AAAA;AAAA,EACF;AAEJ;AAEA,QAAQ,
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { useOwnerProps } from '@elliemae/ds-utilities';\nimport { Slide } from 'react-toastify';\nimport type { DSToastT } from '../react-desc-prop-types.js';\nimport { DSToastPropTypes } from '../react-desc-prop-types.js';\nimport { DSToastName } from '../DSToastDefinitions.js';\nimport { CloseButton } from './CloseButton.js';\nimport { ToastifyWrapper, StyledToastContainer } from './styled.js';\nimport { useToast } from '../config/useToast.js';\n\nconst DSToast: React.ComponentType<DSToastT.Props> = (props) => {\n const {\n propsWithDefault,\n propsWithDefault: {\n containerProps,\n position,\n autoClose,\n showProgressBar,\n closeOnClick,\n enableMultiContainer,\n containerId,\n },\n toastifyWrapperRef,\n onKeyDown,\n globalAttributes,\n xstyledAttributes,\n closeButtonRef,\n } = useToast(props);\n\n const ownerPropsConfig = useOwnerProps(propsWithDefault);\n\n return (\n <ToastifyWrapper\n innerRef={toastifyWrapperRef}\n onKeyDown={onKeyDown}\n tabIndex={-1}\n aria-label=\"toast container\"\n role=\"alert\"\n {...globalAttributes}\n {...xstyledAttributes}\n {...ownerPropsConfig}\n >\n <StyledToastContainer\n {...containerProps}\n autoClose={autoClose}\n className={(showProgressBar && 'with-progressbar') || ''}\n closeButton={CloseButton({ closeButtonRef })}\n closeOnClick={closeOnClick}\n containerId={containerId}\n enableMultiContainer={enableMultiContainer}\n hideProgressBar={!showProgressBar}\n newestOnTop\n position={position}\n transition={Slide}\n {...ownerPropsConfig}\n />\n </ToastifyWrapper>\n );\n};\n\nDSToast.displayName = DSToastName;\nconst DSToastWithSchema = describe(DSToast);\nDSToastWithSchema.propTypes = DSToastPropTypes;\n\nexport { DSToast, DSToastWithSchema };\nexport default DSToast;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD2CjB;AA1CN,8BAAyB;AACzB,0BAA8B;AAC9B,4BAAsB;AAEtB,mCAAiC;AACjC,gCAA4B;AAC5B,yBAA4B;AAC5B,oBAAsD;AACtD,sBAAyB;AAEzB,MAAM,UAA+C,CAAC,UAAU;AAC9D,QAAM;AAAA,IACJ;AAAA,IACA,kBAAkB;AAAA,MAChB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,0BAAS,KAAK;AAElB,QAAM,uBAAmB,mCAAc,gBAAgB;AAEvD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,UAAU;AAAA,MACV;AAAA,MACA,UAAU;AAAA,MACV,cAAW;AAAA,MACX,MAAK;AAAA,MACJ,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MAEJ;AAAA,QAAC;AAAA;AAAA,UACE,GAAG;AAAA,UACJ;AAAA,UACA,WAAY,mBAAmB,sBAAuB;AAAA,UACtD,iBAAa,gCAAY,EAAE,eAAe,CAAC;AAAA,UAC3C;AAAA,UACA;AAAA,UACA;AAAA,UACA,iBAAiB,CAAC;AAAA,UAClB,aAAW;AAAA,UACX;AAAA,UACA,YAAY;AAAA,UACX,GAAG;AAAA;AAAA,MACN;AAAA;AAAA,EACF;AAEJ;AAEA,QAAQ,cAAc;AACtB,MAAM,wBAAoB,kCAAS,OAAO;AAC1C,kBAAkB,YAAY;AAG9B,IAAO,kBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/parts/styled.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable max-lines */\nimport { DSButtonV2 } from '@elliemae/ds-button-v2';\nimport { ToastContainer } from 'react-toastify';\nimport { styled, th, xStyledCommonProps } from '@elliemae/ds-system';\nimport type { XstyledProps } from '@elliemae/ds-props-helpers';\nimport {\n DSToastActionLinkName,\n DSToastActionName,\n DSToastActionSlots,\n DSToastActionLinkSlots,\n DSToastName,\n DSToastSlots,\n} from '../DSToastDefinitions.js';\n\nexport const StyledToastContainer = styled(ToastContainer, { name: DSToastName, slot: DSToastSlots.TOAST_CONTAINER })``;\n\nexport const StyledLink = styled('span', {\n name: DSToastActionLinkName,\n slot: DSToastActionLinkSlots.ROOT,\n})<React.PropsWithChildren & XstyledProps>`\n color: brand-600;\n ${xStyledCommonProps}\n`;\n\nexport const StyledContainer = styled('div', { name: DSToastName, slot: DSToastSlots.CONTAINER })`\n display: flex;\n padding: ${th.space('xxs')};\n padding-right: ${th.space('s')};\n`;\n\nexport const StyledIconContainer = styled('div', { name: DSToastName, slot: DSToastSlots.ICON_CONTAINER })`\n margin-top: ${th.space('xxxs')};\n margin-right: ${th.space('xxs')};\n`;\n\nexport const StyledMessageContent = styled('div', { name: DSToastName, slot: DSToastSlots.MESSAGE_CONTENT })`\n flex: 1;\n`;\n\nexport const StyledMessageHeader = styled('div', { name: DSToastName, slot: DSToastSlots.MESSAGE_HEADER })`\n margin-top: ${th.space('xxxs')};\n margin-bottom: ${th.space('xxs')};\n color: neutral-700;\n font-weight: 600;\n font-size: 1rem;\n`;\n\nexport const StyledMessageText = styled('span', { name: DSToastName, slot: DSToastSlots.MESSAGE_TEXT })`\n color: neutral-500;\n font-size: 1rem;\n`;\n\nexport const StyledAction = styled('div', { name: DSToastActionName, slot: DSToastActionSlots.ROOT })`\n position: relative;\n &:focus {\n &:after {\n position: absolute;\n content: '';\n border: 2px solid brand-700;\n top: -1px;\n left: -1px;\n width: calc(100% + 2px);\n height: calc(100% + 2px);\n }\n }\n &:focus-visible {\n outline: none;\n }\n ${xStyledCommonProps}\n`;\n\nexport const StyledButton = styled(DSButtonV2, { name: DSToastName, slot: DSToastSlots.CLOSE_BUTTON })`\n position: absolute;\n top: 4px;\n right: 4px;\n\n fill: ${th.color('neutral-300')};\n`;\n\nexport const ToastifyWrapper = styled('div', { name: DSToastName, slot: DSToastSlots.ROOT })`\n .Toastify__toast-container {\n z-index: 9999;\n position: fixed;\n width: 300px;\n box-sizing: border-box;\n color: #fff;\n &--top-left {\n top: 1em;\n left: 1em;\n }\n &--top-center {\n top: 1em;\n left: 50%;\n margin-left: -150px;\n }\n &--top-right {\n top: 1em;\n right: 1em;\n }\n &--bottom-left {\n bottom: 1em;\n left: 1em;\n }\n &--bottom-center {\n bottom: 1em;\n left: 50%;\n margin-left: -150px;\n }\n &--bottom-right {\n bottom: 1em;\n right: 1em;\n }\n\n &:not(.with-progressbar) {\n .Toastify__toast {\n &--default {\n border-color: neutral-400;\n }\n &--info {\n border-color: brand-600;\n }\n &--success {\n border-color: success-900;\n }\n &--warning {\n border-color: warning-900;\n }\n &--error {\n border-color: danger-900;\n }\n }\n }\n\n &.with-progressbar {\n .Toastify__toast {\n &--default {\n border-color: neutral-300;\n }\n &--info {\n border-color: brand-300;\n }\n &--success {\n border-color: success-300;\n }\n &--warning {\n border-color: warning-600;\n }\n &--error {\n border-color: danger-200;\n }\n }\n }\n }\n\n .Toastify__toast {\n position: relative;\n min-height: 76px;\n box-sizing: border-box;\n border-radius: 1px;\n display: flex;\n justify-content: space-between;\n cursor: pointer;\n direction: ltr;\n background-color: neutral-000;\n border-left: 5px solid;\n box-shadow: 0 4px 10px 1px neutral-400;\n margin-bottom: ${th.space('xxs')};\n &--rtl {\n direction: rtl;\n }\n &-body {\n margin: 0;\n flex: 1;\n }\n }\n\n .Toastify__progress-bar {\n position: absolute;\n bottom: 0;\n left: -5px;\n width: 5px;\n height: 0;\n z-index: 9999;\n opacity: 0.7;\n animation: Toastify__trackProgress linear 1;\n background-color: brand-200;\n\n &--rtl {\n right: 0;\n left: initial;\n }\n &--default {\n background-color: neutral-400;\n }\n\n &--info {\n background-color: brand-400;\n }\n &--success {\n background-color: success-900;\n }\n &--warning {\n background-color: warning-900;\n }\n &--error {\n background-color: danger-900;\n }\n }\n\n @media only screen and (max-width: 480px) {\n .Toastify__toast-container {\n width: 100vw;\n padding: 0;\n left: 0;\n margin: 0;\n &--top-left,\n &--top-center,\n &--top-right {\n top: 0;\n }\n &--bottom-left,\n &--bottom-center,\n &--bottom-right {\n bottom: 0;\n }\n &--rtl {\n right: 0;\n left: initial;\n }\n }\n\n .Toastify__toast {\n margin-bottom: 0;\n }\n }\n\n @keyframes Toastify__trackProgress {\n from {\n height: 100%;\n }\n to {\n height: 0;\n }\n }\n\n @keyframes Toastify__slideInRight {\n from {\n transform: translate3d(110%, 0, 0);\n visibility: visible;\n }\n to {\n transform: translate3d(0, 0, 0);\n }\n }\n\n @keyframes Toastify__slideInLeft {\n from {\n transform: translate3d(-110%, 0, 0);\n visibility: visible;\n }\n to {\n transform: translate3d(0, 0, 0);\n }\n }\n\n @keyframes Toastify__slideInUp {\n from {\n transform: translate3d(0, 110%, 0);\n visibility: visible;\n }\n to {\n transform: translate3d(0, 0, 0);\n }\n }\n\n @keyframes Toastify__slideInDown {\n from {\n transform: translate3d(0, -110%, 0);\n visibility: visible;\n }\n to {\n transform: translate3d(0, 0, 0);\n }\n }\n\n @keyframes Toastify__slideOutRight {\n from {\n transform: translate3d(0, 0, 0);\n }\n to {\n visibility: hidden;\n transform: translate3d(110%, 0, 0);\n }\n }\n\n @keyframes Toastify__slideOutLeft {\n from {\n transform: translate3d(0, 0, 0);\n }\n to {\n visibility: hidden;\n transform: translate3d(-110%, 0, 0);\n }\n }\n\n @keyframes Toastify__slideOutDown {\n from {\n transform: translate3d(0, 0, 0);\n }\n to {\n visibility: hidden;\n transform: translate3d(0, 500px, 0);\n }\n }\n\n @keyframes Toastify__slideOutUp {\n from {\n transform: translate3d(0, 0, 0);\n }\n to {\n visibility: hidden;\n transform: translate3d(0, -500px, 0);\n }\n }\n\n .Toastify__slide-enter {\n &--top-left,\n &--bottom-left {\n animation-name: Toastify__slideInLeft;\n }\n &--top-right,\n &--bottom-right {\n animation-name: Toastify__slideInRight;\n }\n &--top-center {\n animation-name: Toastify__slideInDown;\n }\n &--bottom-center {\n animation-name: Toastify__slideInUp;\n }\n }\n\n .Toastify__slide-exit {\n &--top-left,\n &--bottom-left {\n animation-name: Toastify__slideOutLeft;\n }\n &--top-right,\n &--bottom-right {\n animation-name: Toastify__slideOutRight;\n }\n &--top-center {\n animation-name: Toastify__slideOutUp;\n }\n &--bottom-center {\n animation-name: Toastify__slideOutDown;\n }\n }\n ${xStyledCommonProps}\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,0BAA2B;AAC3B,4BAA+B;AAC/B,uBAA+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AAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAgMhC,mCAAkB;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -23,37 +23,27 @@ const useToast = (props) => {
|
|
|
23
23
|
const actions = [...document.querySelectorAll('.toast-action-text[role="button"]')];
|
|
24
24
|
const activeElement = document.activeElement;
|
|
25
25
|
if (closeButton === activeElement) {
|
|
26
|
-
if (actions.length === 0)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
actions[actions.length - 1].focus();
|
|
30
|
-
else
|
|
31
|
-
actions[0].focus();
|
|
26
|
+
if (actions.length === 0) return;
|
|
27
|
+
if (event.shiftKey) actions[actions.length - 1].focus();
|
|
28
|
+
else actions[0].focus();
|
|
32
29
|
return;
|
|
33
30
|
}
|
|
34
31
|
if (container === activeElement) {
|
|
35
|
-
if (actions.length === 0 || !event.shiftKey)
|
|
36
|
-
|
|
37
|
-
else
|
|
38
|
-
actions[actions.length - 1].focus();
|
|
32
|
+
if (actions.length === 0 || !event.shiftKey) closeButton.focus();
|
|
33
|
+
else actions[actions.length - 1].focus();
|
|
39
34
|
return;
|
|
40
35
|
}
|
|
41
36
|
const index = actions.indexOf(activeElement);
|
|
42
37
|
if (event.shiftKey) {
|
|
43
|
-
if (index === 0)
|
|
44
|
-
|
|
45
|
-
else
|
|
46
|
-
actions[index - 1].focus();
|
|
38
|
+
if (index === 0) closeButton.focus();
|
|
39
|
+
else actions[index - 1].focus();
|
|
47
40
|
} else {
|
|
48
|
-
if (index === actions.length - 1)
|
|
49
|
-
|
|
50
|
-
else
|
|
51
|
-
actions[index + 1].focus();
|
|
41
|
+
if (index === actions.length - 1) closeButton.focus();
|
|
42
|
+
else actions[index + 1].focus();
|
|
52
43
|
}
|
|
53
44
|
} else if (event.key === "Escape") {
|
|
54
45
|
const closeButton = toastCloseButtonRef.current;
|
|
55
|
-
if (closeButton)
|
|
56
|
-
closeButton.click();
|
|
46
|
+
if (closeButton) closeButton.click();
|
|
57
47
|
}
|
|
58
48
|
};
|
|
59
49
|
return {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useToast.ts"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\nimport { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { useRef } from 'react';\nimport { omit } from 'lodash';\nimport type { DSToastT } from '../react-desc-prop-types.js';\nimport { defaultProps } from '../react-desc-prop-types.js';\nimport { mergeRefs } from '@elliemae/ds-utilities';\n\nexport const useToast = (props: DSToastT.Props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSToastT.InternalProps>(\n props,\n defaultProps as Partial<DSToastT.InternalProps>,\n );\n\n const globalAttributes = useGetGlobalAttributes(propsWithDefault);\n\n const xstyledAttributes = useGetXstyledProps(omit(propsWithDefault, 'position'));\n\n const toastifyWrapperRef = useRef<HTMLDivElement | null>(null);\n\n const toastCloseButtonRef = useRef<HTMLButtonElement | null>(null);\n\n const closeButtonRef = mergeRefs(toastCloseButtonRef, propsWithDefault.closeButtonRef);\n\n const onKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Tab') {\n event.preventDefault();\n event.stopPropagation();\n\n const container = toastifyWrapperRef.current;\n const closeButton = document.querySelector('.toast-close-button') as HTMLButtonElement;\n const actions = [...document.querySelectorAll('.toast-action-text[role=\"button\"]')] as HTMLDivElement[];\n\n const activeElement = document.activeElement;\n\n // If the close button is focused\n // 1) No actions => we keep the focus on the close button\n // 2) Shift + Tab => we focus the last action\n // 3) Tab => we focus the first action\n if (closeButton === activeElement) {\n if (actions.length === 0) return; // We keep the focus on the close button\n if (event.shiftKey) actions[actions.length - 1].focus();\n else actions[0].focus();\n return;\n }\n\n // If the container is focused\n // No actions => we focus the close button\n // 2) Shift + Tab => we focus the last action\n // 3) Tab => we focus the close button\n if (container === activeElement) {\n if (actions.length === 0 || !event.shiftKey) closeButton.focus();\n else actions[actions.length - 1].focus();\n return;\n }\n\n const index = actions.indexOf(activeElement as HTMLDivElement);\n\n // If an action is focused\n // 1) Shift + Tab => we focus the previous action (closeButton if it's the first one)\n // 2) Tab => we focus the next action (closeButton if it's the last one)\n if (event.shiftKey) {\n if (index === 0) closeButton.focus();\n else actions[index - 1].focus();\n } else {\n if (index === actions.length - 1) closeButton.focus();\n else actions[index + 1].focus();\n }\n } else if (event.key === 'Escape') {\n const closeButton = toastCloseButtonRef.current;\n if (closeButton) closeButton.click();\n }\n };\n\n return {\n propsWithDefault,\n toastifyWrapperRef,\n onKeyDown,\n globalAttributes,\n xstyledAttributes,\n closeButtonRef,\n };\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,wBAAwB,oBAAoB,oCAAoC;AACzF,SAAS,cAAc;AACvB,SAAS,YAAY;AAErB,SAAS,oBAAoB;AAC7B,SAAS,iBAAiB;AAEnB,MAAM,WAAW,CAAC,UAA0B;AACjD,QAAM,mBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,EACF;AAEA,QAAM,mBAAmB,uBAAuB,gBAAgB;AAEhE,QAAM,oBAAoB,mBAAmB,KAAK,kBAAkB,UAAU,CAAC;AAE/E,QAAM,qBAAqB,OAA8B,IAAI;AAE7D,QAAM,sBAAsB,OAAiC,IAAI;AAEjE,QAAM,iBAAiB,UAAU,qBAAqB,iBAAiB,cAAc;AAErF,QAAM,YAAY,CAAC,UAA+C;AAChE,QAAI,MAAM,QAAQ,OAAO;AACvB,YAAM,eAAe;AACrB,YAAM,gBAAgB;AAEtB,YAAM,YAAY,mBAAmB;AACrC,YAAM,cAAc,SAAS,cAAc,qBAAqB;AAChE,YAAM,UAAU,CAAC,GAAG,SAAS,iBAAiB,mCAAmC,CAAC;AAElF,YAAM,gBAAgB,SAAS;AAM/B,UAAI,gBAAgB,eAAe;AACjC,YAAI,QAAQ,WAAW;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,wBAAwB,oBAAoB,oCAAoC;AACzF,SAAS,cAAc;AACvB,SAAS,YAAY;AAErB,SAAS,oBAAoB;AAC7B,SAAS,iBAAiB;AAEnB,MAAM,WAAW,CAAC,UAA0B;AACjD,QAAM,mBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,EACF;AAEA,QA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;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/DSToast.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { useOwnerProps } from '@elliemae/ds-utilities';\nimport { Slide } from 'react-toastify';\nimport type { DSToastT } from '../react-desc-prop-types.js';\nimport { DSToastPropTypes } from '../react-desc-prop-types.js';\nimport { DSToastName } from '../DSToastDefinitions.js';\nimport { CloseButton } from './CloseButton.js';\nimport { ToastifyWrapper, StyledToastContainer } from './styled.js';\nimport { useToast } from '../config/useToast.js';\n\nconst DSToast: React.ComponentType<DSToastT.Props> = (props) => {\n const {\n propsWithDefault,\n propsWithDefault: {\n containerProps,\n position,\n autoClose,\n showProgressBar,\n closeOnClick,\n enableMultiContainer,\n containerId,\n },\n toastifyWrapperRef,\n onKeyDown,\n globalAttributes,\n xstyledAttributes,\n closeButtonRef,\n } = useToast(props);\n\n const ownerPropsConfig = useOwnerProps(propsWithDefault);\n\n return (\n <ToastifyWrapper\n innerRef={toastifyWrapperRef}\n onKeyDown={onKeyDown}\n tabIndex={-1}\n aria-label=\"toast container\"\n role=\"alert\"\n {...globalAttributes}\n {...xstyledAttributes}\n {...ownerPropsConfig}\n >\n <StyledToastContainer\n {...containerProps}\n autoClose={autoClose}\n className={(showProgressBar && 'with-progressbar') || ''}\n closeButton={CloseButton({ closeButtonRef })}\n closeOnClick={closeOnClick}\n containerId={containerId}\n enableMultiContainer={enableMultiContainer}\n hideProgressBar={!showProgressBar}\n newestOnTop\n position={position}\n transition={Slide}\n {...ownerPropsConfig}\n />\n </ToastifyWrapper>\n );\n};\n\nDSToast.
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;AC2CjB;AA1CN,SAAS,gBAAgB;AACzB,SAAS,qBAAqB;AAC9B,SAAS,aAAa;AAEtB,SAAS,wBAAwB;AACjC,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAC5B,SAAS,iBAAiB,4BAA4B;AACtD,SAAS,gBAAgB;AAEzB,MAAM,UAA+C,CAAC,UAAU;AAC9D,QAAM;AAAA,IACJ;AAAA,IACA,kBAAkB;AAAA,MAChB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,SAAS,KAAK;AAElB,QAAM,mBAAmB,cAAc,gBAAgB;AAEvD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,UAAU;AAAA,MACV;AAAA,MACA,UAAU;AAAA,MACV,cAAW;AAAA,MACX,MAAK;AAAA,MACJ,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MAEJ;AAAA,QAAC;AAAA;AAAA,UACE,GAAG;AAAA,UACJ;AAAA,UACA,WAAY,mBAAmB,sBAAuB;AAAA,UACtD,aAAa,YAAY,EAAE,eAAe,CAAC;AAAA,UAC3C;AAAA,UACA;AAAA,UACA;AAAA,UACA,iBAAiB,CAAC;AAAA,UAClB,aAAW;AAAA,UACX;AAAA,UACA,YAAY;AAAA,UACX,GAAG;AAAA;AAAA,MACN;AAAA;AAAA,EACF;AAEJ;AAEA,QAAQ,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { useOwnerProps } from '@elliemae/ds-utilities';\nimport { Slide } from 'react-toastify';\nimport type { DSToastT } from '../react-desc-prop-types.js';\nimport { DSToastPropTypes } from '../react-desc-prop-types.js';\nimport { DSToastName } from '../DSToastDefinitions.js';\nimport { CloseButton } from './CloseButton.js';\nimport { ToastifyWrapper, StyledToastContainer } from './styled.js';\nimport { useToast } from '../config/useToast.js';\n\nconst DSToast: React.ComponentType<DSToastT.Props> = (props) => {\n const {\n propsWithDefault,\n propsWithDefault: {\n containerProps,\n position,\n autoClose,\n showProgressBar,\n closeOnClick,\n enableMultiContainer,\n containerId,\n },\n toastifyWrapperRef,\n onKeyDown,\n globalAttributes,\n xstyledAttributes,\n closeButtonRef,\n } = useToast(props);\n\n const ownerPropsConfig = useOwnerProps(propsWithDefault);\n\n return (\n <ToastifyWrapper\n innerRef={toastifyWrapperRef}\n onKeyDown={onKeyDown}\n tabIndex={-1}\n aria-label=\"toast container\"\n role=\"alert\"\n {...globalAttributes}\n {...xstyledAttributes}\n {...ownerPropsConfig}\n >\n <StyledToastContainer\n {...containerProps}\n autoClose={autoClose}\n className={(showProgressBar && 'with-progressbar') || ''}\n closeButton={CloseButton({ closeButtonRef })}\n closeOnClick={closeOnClick}\n containerId={containerId}\n enableMultiContainer={enableMultiContainer}\n hideProgressBar={!showProgressBar}\n newestOnTop\n position={position}\n transition={Slide}\n {...ownerPropsConfig}\n />\n </ToastifyWrapper>\n );\n};\n\nDSToast.displayName = DSToastName;\nconst DSToastWithSchema = describe(DSToast);\nDSToastWithSchema.propTypes = DSToastPropTypes;\n\nexport { DSToast, DSToastWithSchema };\nexport default DSToast;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC2CjB;AA1CN,SAAS,gBAAgB;AACzB,SAAS,qBAAqB;AAC9B,SAAS,aAAa;AAEtB,SAAS,wBAAwB;AACjC,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAC5B,SAAS,iBAAiB,4BAA4B;AACtD,SAAS,gBAAgB;AAEzB,MAAM,UAA+C,CAAC,UAAU;AAC9D,QAAM;AAAA,IACJ;AAAA,IACA,kBAAkB;AAAA,MAChB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,SAAS,KAAK;AAElB,QAAM,mBAAmB,cAAc,gBAAgB;AAEvD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,UAAU;AAAA,MACV;AAAA,MACA,UAAU;AAAA,MACV,cAAW;AAAA,MACX,MAAK;AAAA,MACJ,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MAEJ;AAAA,QAAC;AAAA;AAAA,UACE,GAAG;AAAA,UACJ;AAAA,UACA,WAAY,mBAAmB,sBAAuB;AAAA,UACtD,aAAa,YAAY,EAAE,eAAe,CAAC;AAAA,UAC3C;AAAA,UACA;AAAA,UACA;AAAA,UACA,iBAAiB,CAAC;AAAA,UAClB,aAAW;AAAA,UACX;AAAA,UACA,YAAY;AAAA,UACX,GAAG;AAAA;AAAA,MACN;AAAA;AAAA,EACF;AAEJ;AAEA,QAAQ,cAAc;AACtB,MAAM,oBAAoB,SAAS,OAAO;AAC1C,kBAAkB,YAAY;AAG9B,IAAO,kBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/styled.ts"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport { DSButtonV2 } from '@elliemae/ds-button-v2';\nimport { ToastContainer } from 'react-toastify';\nimport { styled, th, xStyledCommonProps } from '@elliemae/ds-system';\nimport type { XstyledProps } from '@elliemae/ds-props-helpers';\nimport {\n DSToastActionLinkName,\n DSToastActionName,\n DSToastActionSlots,\n DSToastActionLinkSlots,\n DSToastName,\n DSToastSlots,\n} from '../DSToastDefinitions.js';\n\nexport const StyledToastContainer = styled(ToastContainer, { name: DSToastName, slot: DSToastSlots.TOAST_CONTAINER })``;\n\nexport const StyledLink = styled('span', {\n name: DSToastActionLinkName,\n slot: DSToastActionLinkSlots.ROOT,\n})<React.PropsWithChildren & XstyledProps>`\n color: brand-600;\n ${xStyledCommonProps}\n`;\n\nexport const StyledContainer = styled('div', { name: DSToastName, slot: DSToastSlots.CONTAINER })`\n display: flex;\n padding: ${th.space('xxs')};\n padding-right: ${th.space('s')};\n`;\n\nexport const StyledIconContainer = styled('div', { name: DSToastName, slot: DSToastSlots.ICON_CONTAINER })`\n margin-top: ${th.space('xxxs')};\n margin-right: ${th.space('xxs')};\n`;\n\nexport const StyledMessageContent = styled('div', { name: DSToastName, slot: DSToastSlots.MESSAGE_CONTENT })`\n flex: 1;\n`;\n\nexport const StyledMessageHeader = styled('div', { name: DSToastName, slot: DSToastSlots.MESSAGE_HEADER })`\n margin-top: ${th.space('xxxs')};\n margin-bottom: ${th.space('xxs')};\n color: neutral-700;\n font-weight: 600;\n font-size: 1rem;\n`;\n\nexport const StyledMessageText = styled('span', { name: DSToastName, slot: DSToastSlots.MESSAGE_TEXT })`\n color: neutral-500;\n font-size: 1rem;\n`;\n\nexport const StyledAction = styled('div', { name: DSToastActionName, slot: DSToastActionSlots.ROOT })`\n position: relative;\n &:focus {\n &:after {\n position: absolute;\n content: '';\n border: 2px solid brand-700;\n top: -1px;\n left: -1px;\n width: calc(100% + 2px);\n height: calc(100% + 2px);\n }\n }\n &:focus-visible {\n outline: none;\n }\n ${xStyledCommonProps}\n`;\n\nexport const StyledButton = styled(DSButtonV2, { name: DSToastName, slot: DSToastSlots.CLOSE_BUTTON })`\n position: absolute;\n top: 4px;\n right: 4px;\n\n fill: ${th.color('neutral-300')};\n`;\n\nexport const ToastifyWrapper = styled('div', { name: DSToastName, slot: DSToastSlots.ROOT })`\n .Toastify__toast-container {\n z-index: 9999;\n position: fixed;\n width: 300px;\n box-sizing: border-box;\n color: #fff;\n &--top-left {\n top: 1em;\n left: 1em;\n }\n &--top-center {\n top: 1em;\n left: 50%;\n margin-left: -150px;\n }\n &--top-right {\n top: 1em;\n right: 1em;\n }\n &--bottom-left {\n bottom: 1em;\n left: 1em;\n }\n &--bottom-center {\n bottom: 1em;\n left: 50%;\n margin-left: -150px;\n }\n &--bottom-right {\n bottom: 1em;\n right: 1em;\n }\n\n &:not(.with-progressbar) {\n .Toastify__toast {\n &--default {\n border-color: neutral-400;\n }\n &--info {\n border-color: brand-600;\n }\n &--success {\n border-color: success-900;\n }\n &--warning {\n border-color: warning-900;\n }\n &--error {\n border-color: danger-900;\n }\n }\n }\n\n &.with-progressbar {\n .Toastify__toast {\n &--default {\n border-color: neutral-300;\n }\n &--info {\n border-color: brand-300;\n }\n &--success {\n border-color: success-300;\n }\n &--warning {\n border-color: warning-600;\n }\n &--error {\n border-color: danger-200;\n }\n }\n }\n }\n\n .Toastify__toast {\n position: relative;\n min-height: 76px;\n box-sizing: border-box;\n border-radius: 1px;\n display: flex;\n justify-content: space-between;\n cursor: pointer;\n direction: ltr;\n background-color: neutral-000;\n border-left: 5px solid;\n box-shadow: 0 4px 10px 1px neutral-400;\n margin-bottom: ${th.space('xxs')};\n &--rtl {\n direction: rtl;\n }\n &-body {\n margin: 0;\n flex: 1;\n }\n }\n\n .Toastify__progress-bar {\n position: absolute;\n bottom: 0;\n left: -5px;\n width: 5px;\n height: 0;\n z-index: 9999;\n opacity: 0.7;\n animation: Toastify__trackProgress linear 1;\n background-color: brand-200;\n\n &--rtl {\n right: 0;\n left: initial;\n }\n &--default {\n background-color: neutral-400;\n }\n\n &--info {\n background-color: brand-400;\n }\n &--success {\n background-color: success-900;\n }\n &--warning {\n background-color: warning-900;\n }\n &--error {\n background-color: danger-900;\n }\n }\n\n @media only screen and (max-width: 480px) {\n .Toastify__toast-container {\n width: 100vw;\n padding: 0;\n left: 0;\n margin: 0;\n &--top-left,\n &--top-center,\n &--top-right {\n top: 0;\n }\n &--bottom-left,\n &--bottom-center,\n &--bottom-right {\n bottom: 0;\n }\n &--rtl {\n right: 0;\n left: initial;\n }\n }\n\n .Toastify__toast {\n margin-bottom: 0;\n }\n }\n\n @keyframes Toastify__trackProgress {\n from {\n height: 100%;\n }\n to {\n height: 0;\n }\n }\n\n @keyframes Toastify__slideInRight {\n from {\n transform: translate3d(110%, 0, 0);\n visibility: visible;\n }\n to {\n transform: translate3d(0, 0, 0);\n }\n }\n\n @keyframes Toastify__slideInLeft {\n from {\n transform: translate3d(-110%, 0, 0);\n visibility: visible;\n }\n to {\n transform: translate3d(0, 0, 0);\n }\n }\n\n @keyframes Toastify__slideInUp {\n from {\n transform: translate3d(0, 110%, 0);\n visibility: visible;\n }\n to {\n transform: translate3d(0, 0, 0);\n }\n }\n\n @keyframes Toastify__slideInDown {\n from {\n transform: translate3d(0, -110%, 0);\n visibility: visible;\n }\n to {\n transform: translate3d(0, 0, 0);\n }\n }\n\n @keyframes Toastify__slideOutRight {\n from {\n transform: translate3d(0, 0, 0);\n }\n to {\n visibility: hidden;\n transform: translate3d(110%, 0, 0);\n }\n }\n\n @keyframes Toastify__slideOutLeft {\n from {\n transform: translate3d(0, 0, 0);\n }\n to {\n visibility: hidden;\n transform: translate3d(-110%, 0, 0);\n }\n }\n\n @keyframes Toastify__slideOutDown {\n from {\n transform: translate3d(0, 0, 0);\n }\n to {\n visibility: hidden;\n transform: translate3d(0, 500px, 0);\n }\n }\n\n @keyframes Toastify__slideOutUp {\n from {\n transform: translate3d(0, 0, 0);\n }\n to {\n visibility: hidden;\n transform: translate3d(0, -500px, 0);\n }\n }\n\n .Toastify__slide-enter {\n &--top-left,\n &--bottom-left {\n animation-name: Toastify__slideInLeft;\n }\n &--top-right,\n &--bottom-right {\n animation-name: Toastify__slideInRight;\n }\n &--top-center {\n animation-name: Toastify__slideInDown;\n }\n &--bottom-center {\n animation-name: Toastify__slideInUp;\n }\n }\n\n .Toastify__slide-exit {\n &--top-left,\n &--bottom-left {\n animation-name: Toastify__slideOutLeft;\n }\n &--top-right,\n &--bottom-right {\n animation-name: Toastify__slideOutRight;\n }\n &--top-center {\n animation-name: Toastify__slideOutUp;\n }\n &--bottom-center {\n animation-name: Toastify__slideOutDown;\n }\n }\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@ export declare const useToast: (props: DSToastT.Props) => {
|
|
|
5
5
|
toastifyWrapperRef: import("react").MutableRefObject<HTMLDivElement | null>;
|
|
6
6
|
onKeyDown: (event: React.KeyboardEvent<HTMLDivElement>) => void;
|
|
7
7
|
globalAttributes: Partial<Pick<object, "default" | "form" | "list" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "async" | "autoComplete" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "cite" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "data" | "dateTime" | "defer" | "disabled" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "label" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "name" | "noValidate" | "open" | "optimum" | "pattern" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "size" | "sizes" | "span" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "summary" | "target" | "type" | "useMap" | "value" | "width" | "wmode" | "wrap"> & Omit<{
|
|
8
|
-
|
|
8
|
+
default?: boolean | undefined;
|
|
9
|
+
form?: string | undefined;
|
|
10
|
+
list?: string | undefined;
|
|
9
11
|
"aria-activedescendant"?: string | undefined;
|
|
10
|
-
"aria-atomic"?: boolean | "true" | "false" | undefined;
|
|
12
|
+
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
11
13
|
"aria-autocomplete"?: "list" | "none" | "inline" | "both" | undefined;
|
|
12
14
|
"aria-braillelabel"?: string | undefined;
|
|
13
15
|
"aria-brailleroledescription"?: string | undefined;
|
|
14
|
-
"aria-busy"?: boolean | "true" | "false" | undefined;
|
|
16
|
+
"aria-busy"?: (boolean | "true" | "false") | undefined;
|
|
15
17
|
"aria-checked"?: boolean | "true" | "false" | "mixed" | undefined;
|
|
16
18
|
"aria-colcount"?: number | undefined;
|
|
17
19
|
"aria-colindex"?: number | undefined;
|
|
@@ -22,37 +24,37 @@ export declare const useToast: (props: DSToastT.Props) => {
|
|
|
22
24
|
"aria-describedby"?: string | undefined;
|
|
23
25
|
"aria-description"?: string | undefined;
|
|
24
26
|
"aria-details"?: string | undefined;
|
|
25
|
-
"aria-disabled"?: boolean | "true" | "false" | undefined;
|
|
27
|
+
"aria-disabled"?: (boolean | "true" | "false") | undefined;
|
|
26
28
|
"aria-dropeffect"?: "link" | "none" | "copy" | "execute" | "move" | "popup" | undefined;
|
|
27
29
|
"aria-errormessage"?: string | undefined;
|
|
28
|
-
"aria-expanded"?: boolean | "true" | "false" | undefined;
|
|
30
|
+
"aria-expanded"?: (boolean | "true" | "false") | undefined;
|
|
29
31
|
"aria-flowto"?: string | undefined;
|
|
30
|
-
"aria-grabbed"?: boolean | "true" | "false" | undefined;
|
|
32
|
+
"aria-grabbed"?: (boolean | "true" | "false") | undefined;
|
|
31
33
|
"aria-haspopup"?: boolean | "true" | "false" | "dialog" | "grid" | "listbox" | "menu" | "tree" | undefined;
|
|
32
|
-
"aria-hidden"?: boolean | "true" | "false" | undefined;
|
|
34
|
+
"aria-hidden"?: (boolean | "true" | "false") | undefined;
|
|
33
35
|
"aria-invalid"?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
|
|
34
36
|
"aria-keyshortcuts"?: string | undefined;
|
|
35
37
|
"aria-label"?: string | undefined;
|
|
36
38
|
"aria-labelledby"?: string | undefined;
|
|
37
39
|
"aria-level"?: number | undefined;
|
|
38
40
|
"aria-live"?: "off" | "assertive" | "polite" | undefined;
|
|
39
|
-
"aria-modal"?: boolean | "true" | "false" | undefined;
|
|
40
|
-
"aria-multiline"?: boolean | "true" | "false" | undefined;
|
|
41
|
-
"aria-multiselectable"?: boolean | "true" | "false" | undefined;
|
|
41
|
+
"aria-modal"?: (boolean | "true" | "false") | undefined;
|
|
42
|
+
"aria-multiline"?: (boolean | "true" | "false") | undefined;
|
|
43
|
+
"aria-multiselectable"?: (boolean | "true" | "false") | undefined;
|
|
42
44
|
"aria-orientation"?: "horizontal" | "vertical" | undefined;
|
|
43
45
|
"aria-owns"?: string | undefined;
|
|
44
46
|
"aria-placeholder"?: string | undefined;
|
|
45
47
|
"aria-posinset"?: number | undefined;
|
|
46
48
|
"aria-pressed"?: boolean | "true" | "false" | "mixed" | undefined;
|
|
47
|
-
"aria-readonly"?: boolean | "true" | "false" | undefined;
|
|
49
|
+
"aria-readonly"?: (boolean | "true" | "false") | undefined;
|
|
48
50
|
"aria-relevant"?: "text" | "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
|
|
49
|
-
"aria-required"?: boolean | "true" | "false" | undefined;
|
|
51
|
+
"aria-required"?: (boolean | "true" | "false") | undefined;
|
|
50
52
|
"aria-roledescription"?: string | undefined;
|
|
51
53
|
"aria-rowcount"?: number | undefined;
|
|
52
54
|
"aria-rowindex"?: number | undefined;
|
|
53
55
|
"aria-rowindextext"?: string | undefined;
|
|
54
56
|
"aria-rowspan"?: number | undefined;
|
|
55
|
-
"aria-selected"?: boolean | "true" | "false" | undefined;
|
|
57
|
+
"aria-selected"?: (boolean | "true" | "false") | undefined;
|
|
56
58
|
"aria-setsize"?: number | undefined;
|
|
57
59
|
"aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
58
60
|
"aria-valuemax"?: number | undefined;
|
|
@@ -220,8 +222,6 @@ export declare const useToast: (props: DSToastT.Props) => {
|
|
|
220
222
|
onAnimationIterationCapture?: import("react").AnimationEventHandler<Element> | undefined;
|
|
221
223
|
onTransitionEnd?: import("react").TransitionEventHandler<Element> | undefined;
|
|
222
224
|
onTransitionEndCapture?: import("react").TransitionEventHandler<Element> | undefined;
|
|
223
|
-
form?: string | undefined;
|
|
224
|
-
list?: string | undefined;
|
|
225
225
|
defaultChecked?: boolean | undefined;
|
|
226
226
|
defaultValue?: string | number | readonly string[] | undefined;
|
|
227
227
|
suppressContentEditableWarning?: boolean | undefined;
|
|
@@ -229,16 +229,16 @@ export declare const useToast: (props: DSToastT.Props) => {
|
|
|
229
229
|
accessKey?: string | undefined;
|
|
230
230
|
autoFocus?: boolean | undefined;
|
|
231
231
|
className?: string | undefined;
|
|
232
|
-
contentEditable?: boolean | "true" | "false" | "inherit" | "plaintext-only" | undefined;
|
|
232
|
+
contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
|
|
233
233
|
contextMenu?: string | undefined;
|
|
234
234
|
dir?: string | undefined;
|
|
235
|
-
draggable?: boolean | "true" | "false" | undefined;
|
|
235
|
+
draggable?: (boolean | "true" | "false") | undefined;
|
|
236
236
|
hidden?: boolean | undefined;
|
|
237
237
|
id?: string | undefined;
|
|
238
238
|
lang?: string | undefined;
|
|
239
239
|
nonce?: string | undefined;
|
|
240
240
|
slot?: string | undefined;
|
|
241
|
-
spellCheck?: boolean | "true" | "false" | undefined;
|
|
241
|
+
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
242
242
|
style?: import("react").CSSProperties | undefined;
|
|
243
243
|
tabIndex?: 0 | -1 | undefined;
|
|
244
244
|
title?: string | undefined;
|
|
@@ -294,7 +294,6 @@ export declare const useToast: (props: DSToastT.Props) => {
|
|
|
294
294
|
crossOrigin?: "" | "anonymous" | "use-credentials" | undefined;
|
|
295
295
|
data?: string | undefined;
|
|
296
296
|
dateTime?: string | undefined;
|
|
297
|
-
default?: boolean | undefined;
|
|
298
297
|
defer?: boolean | undefined;
|
|
299
298
|
disabled?: boolean | undefined;
|
|
300
299
|
download?: any;
|
|
@@ -331,6 +330,7 @@ export declare const useToast: (props: DSToastT.Props) => {
|
|
|
331
330
|
minLength?: number | undefined;
|
|
332
331
|
multiple?: boolean | undefined;
|
|
333
332
|
muted?: boolean | undefined;
|
|
333
|
+
name?: string | undefined;
|
|
334
334
|
noValidate?: boolean | undefined;
|
|
335
335
|
open?: boolean | undefined;
|
|
336
336
|
optimum?: number | undefined;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { XstyledProps } from '@elliemae/ds-props-helpers';
|
|
3
|
+
export declare const StyledToastContainer: import("styled-components").StyledComponent<import("react").FC<import("react-toastify").ToastContainerProps>, import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<import("react").FC<import("react-toastify").ToastContainerProps>>, never>;
|
|
4
|
+
export declare const StyledLink: import("styled-components").StyledComponent<"span", import("@elliemae/ds-system").Theme, {
|
|
5
|
+
children?: import("react").ReactNode;
|
|
6
|
+
} & XstyledProps & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"span">, never>;
|
|
7
|
+
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>;
|
|
8
|
+
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>;
|
|
9
|
+
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>;
|
|
10
|
+
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>;
|
|
11
|
+
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>;
|
|
12
|
+
export declare const StyledAction: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, import("@xstyled/system").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>;
|
|
13
|
+
export declare const StyledButton: import("styled-components").StyledComponent<import("react").ComponentType<import("@elliemae/ds-button-v2").DSButtonV2T.Props>, import("@elliemae/ds-system").Theme, {
|
|
14
|
+
theme: import("@elliemae/ds-system").Theme;
|
|
15
|
+
} & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<import("react").ComponentType<import("@elliemae/ds-button-v2").DSButtonV2T.Props>>, never>;
|
|
16
|
+
export declare const ToastifyWrapper: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, import("@xstyled/system").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>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-toast",
|
|
3
|
-
"version": "3.36.0-next.
|
|
3
|
+
"version": "3.36.0-next.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Toast",
|
|
6
6
|
"files": [
|
|
@@ -63,17 +63,17 @@
|
|
|
63
63
|
"@xstyled/system": "~3.7.3",
|
|
64
64
|
"@xstyled/util": "3.7.0",
|
|
65
65
|
"react-toastify": "~6.2.0",
|
|
66
|
-
"@elliemae/ds-button-v2": "3.36.0-next.
|
|
67
|
-
"@elliemae/ds-
|
|
68
|
-
"@elliemae/ds-
|
|
69
|
-
"@elliemae/ds-
|
|
70
|
-
"@elliemae/ds-
|
|
71
|
-
"@elliemae/ds-
|
|
66
|
+
"@elliemae/ds-button-v2": "3.36.0-next.1",
|
|
67
|
+
"@elliemae/ds-props-helpers": "3.36.0-next.1",
|
|
68
|
+
"@elliemae/ds-system": "3.36.0-next.1",
|
|
69
|
+
"@elliemae/ds-typescript-helpers": "3.36.0-next.1",
|
|
70
|
+
"@elliemae/ds-utilities": "3.36.0-next.1",
|
|
71
|
+
"@elliemae/ds-icons": "3.36.0-next.1"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@elliemae/pui-cli": "~9.0.0-next.31",
|
|
75
75
|
"styled-components": "~5.3.9",
|
|
76
|
-
"@elliemae/ds-monorepo-devops": "3.36.0-next.
|
|
76
|
+
"@elliemae/ds-monorepo-devops": "3.36.0-next.1"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
79
|
"lodash": "^4.17.21",
|