@ultraviolet/ui 1.34.0 → 1.35.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/index.d.ts
CHANGED
|
@@ -3103,6 +3103,11 @@ type ToastContainerProps = {
|
|
|
3103
3103
|
*/
|
|
3104
3104
|
position?: ToastOptions['position'];
|
|
3105
3105
|
'data-testid'?: string;
|
|
3106
|
+
className?: string;
|
|
3107
|
+
/**
|
|
3108
|
+
* Delay before the toast is automatically closed, if not set the default value is 6000ms
|
|
3109
|
+
*/
|
|
3110
|
+
autoClose?: number;
|
|
3106
3111
|
};
|
|
3107
3112
|
/**
|
|
3108
3113
|
* Display short information about an event that happen in the interface in a floating alert.
|
|
@@ -3112,7 +3117,7 @@ type ToastContainerProps = {
|
|
|
3112
3117
|
* Toaster is separated in two parts, first the `ToastContainer` which is where the div of the toast will be rendered,
|
|
3113
3118
|
* and second the `toast()` function which is used to display the toast.
|
|
3114
3119
|
*/
|
|
3115
|
-
declare const ToastContainer: ({ newestOnTop, limit, position, "data-testid": dataTestId, }: ToastContainerProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
3120
|
+
declare const ToastContainer: ({ newestOnTop, limit, position, "data-testid": dataTestId, className, autoClose, }: ToastContainerProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
3116
3121
|
|
|
3117
3122
|
/**
|
|
3118
3123
|
* Toggle component is used to toggle between two states (on/off, true/false, etc.).
|
|
@@ -12,7 +12,7 @@ const PREFIX = '.Toastify';
|
|
|
12
12
|
const AUTOCLOSE_DELAY = 6000; // Delay to close the toast in ms
|
|
13
13
|
|
|
14
14
|
const styles = {
|
|
15
|
-
toast: theme => /*#__PURE__*/css("border-radius:", theme.radii.default, ";min-height:52px;
|
|
15
|
+
toast: theme => /*#__PURE__*/css("border-radius:", theme.radii.default, ";min-height:52px;padding:", theme.space['2'], ";text-size:", theme.typography.bodySmallStrong.fontSize, ";", PREFIX, "__toast-container{width:344px;}", PREFIX, "__toast-body{margin:0;}&", PREFIX, "__toast--success{background-color:", theme.colors.neutral.backgroundStronger, ";color:", theme.colors.neutral.textStronger, ";}&", PREFIX, "__toast--info{background-color:", theme.colors.info.backgroundStrong, ";color:", theme.colors.neutral.textStronger, ";}&", PREFIX, "__toast--error{background-color:", theme.colors.danger.backgroundStrong, ";color:", theme.colors.neutral.textStronger, ";}&", PREFIX, "__toast--warning{background-color:", theme.colors.warning.backgroundStrong, ";color:", theme.colors.warning.textStrong, ";}")
|
|
16
16
|
};
|
|
17
17
|
const StyledButton = /*#__PURE__*/_styled(Button, {
|
|
18
18
|
target: "e1eb63990"
|
|
@@ -95,7 +95,9 @@ const ToastContainer = ({
|
|
|
95
95
|
newestOnTop,
|
|
96
96
|
limit,
|
|
97
97
|
position = 'top-right',
|
|
98
|
-
'data-testid': dataTestId
|
|
98
|
+
'data-testid': dataTestId,
|
|
99
|
+
className,
|
|
100
|
+
autoClose
|
|
99
101
|
}) => {
|
|
100
102
|
const theme = useTheme();
|
|
101
103
|
return jsxs(Fragment, {
|
|
@@ -107,14 +109,14 @@ const ToastContainer = ({
|
|
|
107
109
|
}) => jsx(ToastContainer$1, {
|
|
108
110
|
"data-testid": dataTestId,
|
|
109
111
|
toastClassName: localCss(styles.toast(theme)),
|
|
110
|
-
autoClose: AUTOCLOSE_DELAY,
|
|
112
|
+
autoClose: autoClose ?? AUTOCLOSE_DELAY,
|
|
111
113
|
icon: false,
|
|
112
114
|
newestOnTop: newestOnTop,
|
|
113
115
|
limit: limit,
|
|
114
116
|
position: position,
|
|
115
|
-
css: /*#__PURE__*/css("top:100px;right:calc(0% + ", theme.space['2'], ");"),
|
|
116
117
|
stacked: true,
|
|
117
|
-
hideProgressBar: true
|
|
118
|
+
hideProgressBar: true,
|
|
119
|
+
className: className
|
|
118
120
|
})
|
|
119
121
|
})]
|
|
120
122
|
});
|