@synerise/ds-toast 1.4.11 → 1.4.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.4.12](https://github.com/Synerise/synerise-design/compare/@synerise/ds-toast@1.4.11...@synerise/ds-toast@1.4.12) (2026-03-24)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-toast
9
+
6
10
  ## [1.4.11](https://github.com/Synerise/synerise-design/compare/@synerise/ds-toast@1.4.10...@synerise/ds-toast@1.4.11) (2026-03-20)
7
11
 
8
12
  ### Bug Fixes
package/dist/Toast.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { type ShowToastProps, type ToastCustomisationOptions, type ToastProps, type ToastType } from './Toast.types';
1
+ import { default as React } from 'react';
2
+ import { ShowToastProps, ToastCustomisationOptions, ToastProps, ToastType } from './Toast.types';
3
3
  export declare const Toast: {
4
4
  ({ type, message, description, expander, expandedContent, withClose, customIcon, expanded, onExpand, onCloseClick, onDismiss, button, toastId, show, ...htmlAttributes }: ToastProps): React.JSX.Element;
5
5
  success(props: ShowToastProps, options?: ToastCustomisationOptions): string;
package/dist/Toast.js CHANGED
@@ -1,100 +1,82 @@
1
- var _excluded = ["type", "message", "description", "expander", "expandedContent", "withClose", "customIcon", "expanded", "onExpand", "onCloseClick", "onDismiss", "button", "toastId", "show"];
2
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
4
- import React, { useCallback, useEffect, useMemo } from 'react';
5
- import toast from 'react-hot-toast';
6
- import { v4 as uuid } from 'uuid';
7
- import Icon, { AngleDownS, CloseM } from '@synerise/ds-icon';
8
- import * as S from './Toast.styles';
9
- import { ICONS } from './constants';
10
- export var Toast = function Toast(_ref) {
11
- var type = _ref.type,
12
- message = _ref.message,
13
- description = _ref.description,
14
- expander = _ref.expander,
15
- expandedContent = _ref.expandedContent,
16
- withClose = _ref.withClose,
17
- customIcon = _ref.customIcon,
18
- expanded = _ref.expanded,
19
- onExpand = _ref.onExpand,
20
- onCloseClick = _ref.onCloseClick,
21
- onDismiss = _ref.onDismiss,
22
- button = _ref.button,
23
- toastId = _ref.toastId,
24
- _ref$show = _ref.show,
25
- show = _ref$show === void 0 ? true : _ref$show,
26
- htmlAttributes = _objectWithoutPropertiesLoose(_ref, _excluded);
27
- var hasToastContent = button || description || expandedContent;
28
- var toastContent = hasToastContent && /*#__PURE__*/React.createElement(S.AlertContent, {
29
- hasBottomMargin: Boolean(button || description || expandedContent && expanded)
30
- }, description && /*#__PURE__*/React.createElement(S.AlertDescription, {
31
- expandedContent: !!expandedContent,
32
- button: !!button
33
- }, description), expandedContent && /*#__PURE__*/React.createElement(S.ListWrapper, {
34
- description: description,
35
- visible: expanded
36
- }, expandedContent), button);
37
- var iconComponentForType = useMemo(function () {
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { useMemo, useCallback, useEffect } from "react";
3
+ import toast from "react-hot-toast";
4
+ import { v4 } from "uuid";
5
+ import Icon, { AngleDownS, CloseM } from "@synerise/ds-icon";
6
+ import { AnimationContainer, Container, IconWrapper, WrapperSectionMessage, AlertMessage, ButtonWrapper, IconExpanderWrapper, IconCloseWrapper, AlertContent, AlertDescription, ListWrapper } from "./Toast.styles.js";
7
+ import { ICONS } from "./constants.js";
8
+ const Toast = ({
9
+ type,
10
+ message,
11
+ description,
12
+ expander,
13
+ expandedContent,
14
+ withClose,
15
+ customIcon,
16
+ expanded,
17
+ onExpand,
18
+ onCloseClick,
19
+ onDismiss,
20
+ button,
21
+ toastId,
22
+ show = true,
23
+ ...htmlAttributes
24
+ }) => {
25
+ const hasToastContent = button || description || expandedContent;
26
+ const toastContent = hasToastContent && /* @__PURE__ */ jsxs(AlertContent, { hasBottomMargin: Boolean(button || description || expandedContent && expanded), children: [
27
+ description && /* @__PURE__ */ jsx(AlertDescription, { expandedContent: !!expandedContent, button: !!button, children: description }),
28
+ expandedContent && /* @__PURE__ */ jsx(ListWrapper, { description, visible: expanded, children: expandedContent }),
29
+ button
30
+ ] });
31
+ const iconComponentForType = useMemo(() => {
38
32
  return ICONS[type];
39
33
  }, [type]);
40
- var expandContent = useCallback(function () {
34
+ const expandContent = useCallback(() => {
41
35
  onExpand && onExpand(!expanded);
42
36
  }, [onExpand, expanded]);
43
- var handleCloseClick = function handleCloseClick() {
44
- onCloseClick == null || onCloseClick();
37
+ const handleCloseClick = () => {
38
+ onCloseClick?.();
45
39
  if (toastId) {
46
40
  toast.dismiss(toastId);
47
41
  }
48
42
  };
49
- useEffect(function () {
50
- return function () {
51
- onDismiss == null || onDismiss();
43
+ useEffect(() => {
44
+ return () => {
45
+ onDismiss?.();
52
46
  };
53
47
  }, []);
54
- return /*#__PURE__*/React.createElement(S.AnimationContainer, {
55
- $show: show
56
- }, /*#__PURE__*/React.createElement(S.Container, _extends({
57
- toastType: type,
58
- "data-toastType": type
59
- }, htmlAttributes), /*#__PURE__*/React.createElement(S.IconWrapper, null, customIcon || /*#__PURE__*/React.createElement(Icon, {
60
- component: iconComponentForType
61
- })), /*#__PURE__*/React.createElement(S.WrapperSectionMessage, null, /*#__PURE__*/React.createElement(S.AlertMessage, {
62
- noToastContent: !hasToastContent,
63
- hasClose: !!withClose,
64
- hasExpander: !!expander
65
- }, message), /*#__PURE__*/React.createElement(S.ButtonWrapper, null, expander && /*#__PURE__*/React.createElement(S.IconExpanderWrapper, {
66
- onClick: expandContent,
67
- expanded: expanded
68
- }, /*#__PURE__*/React.createElement(Icon, {
69
- component: /*#__PURE__*/React.createElement(AngleDownS, null),
70
- size: 24
71
- })), withClose && /*#__PURE__*/React.createElement(S.IconCloseWrapper, {
72
- onClick: handleCloseClick
73
- }, /*#__PURE__*/React.createElement(Icon, {
74
- component: /*#__PURE__*/React.createElement(CloseM, null)
75
- }))), toastContent)));
48
+ return /* @__PURE__ */ jsx(AnimationContainer, { $show: show, children: /* @__PURE__ */ jsxs(Container, { toastType: type, "data-toastType": type, ...htmlAttributes, children: [
49
+ /* @__PURE__ */ jsx(IconWrapper, { children: customIcon || /* @__PURE__ */ jsx(Icon, { component: iconComponentForType }) }),
50
+ /* @__PURE__ */ jsxs(WrapperSectionMessage, { children: [
51
+ /* @__PURE__ */ jsx(AlertMessage, { noToastContent: !hasToastContent, hasClose: !!withClose, hasExpander: !!expander, children: message }),
52
+ /* @__PURE__ */ jsxs(ButtonWrapper, { children: [
53
+ expander && /* @__PURE__ */ jsx(IconExpanderWrapper, { onClick: expandContent, expanded, children: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(AngleDownS, {}), size: 24 }) }),
54
+ withClose && /* @__PURE__ */ jsx(IconCloseWrapper, { onClick: handleCloseClick, children: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(CloseM, {}) }) })
55
+ ] }),
56
+ toastContent
57
+ ] })
58
+ ] }) });
76
59
  };
77
- export var showToast = function showToast(type, props, options) {
78
- var toastId = props.toastId || "toast-" + uuid();
79
- return toast.custom(function (t) {
80
- return /*#__PURE__*/React.createElement(Toast, _extends({}, props, {
81
- toastId: toastId,
82
- type: type,
83
- show: t.visible
84
- }));
85
- }, _extends({}, options, {
60
+ const showToast = (type, props, options) => {
61
+ const toastId = props.toastId || `toast-${v4()}`;
62
+ return toast.custom((t) => /* @__PURE__ */ jsx(Toast, { ...props, toastId, type, show: t.visible }), {
63
+ ...options,
86
64
  id: toastId
87
- }));
65
+ });
88
66
  };
89
- Toast.success = function (props, options) {
90
- return showToast('success', props, options);
67
+ Toast.success = (props, options) => {
68
+ return showToast("success", props, options);
91
69
  };
92
- Toast.error = function (props, options) {
93
- return showToast('negative', props, options);
70
+ Toast.error = (props, options) => {
71
+ return showToast("negative", props, options);
94
72
  };
95
- Toast.info = function (props, options) {
96
- return showToast('informative', props, options);
73
+ Toast.info = (props, options) => {
74
+ return showToast("informative", props, options);
75
+ };
76
+ Toast.warning = (props, options) => {
77
+ return showToast("warning", props, options);
78
+ };
79
+ export {
80
+ Toast,
81
+ showToast
97
82
  };
98
- Toast.warning = function (props, options) {
99
- return showToast('warning', props, options);
100
- };
@@ -1,39 +1,39 @@
1
- import { type ReactNode } from 'react';
2
- import { type Keyframes } from 'styled-components';
3
- import { type ToastType } from './Toast.types';
1
+ import { ReactNode } from 'react';
2
+ import { Keyframes } from 'styled-components';
3
+ import { ToastType } from './Toast.types';
4
4
  export declare const closingAnimation: () => Keyframes;
5
- export declare const AnimationContainer: import("styled-components").StyledComponent<"div", any, {
5
+ export declare const AnimationContainer: import('styled-components').StyledComponent<"div", any, {
6
6
  $show?: boolean;
7
7
  }, never>;
8
- export declare const AlertContent: import("styled-components").StyledComponent<"div", any, {
8
+ export declare const AlertContent: import('styled-components').StyledComponent<"div", any, {
9
9
  hasBottomMargin?: boolean;
10
10
  }, never>;
11
- export declare const AllContent: import("styled-components").StyledComponent<"div", any, {}, never>;
12
- export declare const IconWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
13
- export declare const IconCloseWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
14
- export declare const IconExpanderWrapper: import("styled-components").StyledComponent<"div", any, {
11
+ export declare const AllContent: import('styled-components').StyledComponent<"div", any, {}, never>;
12
+ export declare const IconWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
13
+ export declare const IconCloseWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
14
+ export declare const IconExpanderWrapper: import('styled-components').StyledComponent<"div", any, {
15
15
  expanded?: boolean;
16
16
  }, never>;
17
- export declare const ButtonWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
18
- export declare const FirstButtonWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
19
- export declare const NumberWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
20
- export declare const ListWrapper: import("styled-components").StyledComponent<"div", any, {
17
+ export declare const ButtonWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
18
+ export declare const FirstButtonWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
19
+ export declare const NumberWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
20
+ export declare const ListWrapper: import('styled-components').StyledComponent<"div", any, {
21
21
  visible?: boolean;
22
22
  description?: ReactNode;
23
23
  }, never>;
24
- export declare const IconOrderWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
25
- export declare const OrderWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
26
- export declare const Wrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
27
- export declare const WrapperSectionMessage: import("styled-components").StyledComponent<"div", any, {}, never>;
28
- export declare const AlertMessage: import("styled-components").StyledComponent<"div", any, {
24
+ export declare const IconOrderWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
25
+ export declare const OrderWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
26
+ export declare const Wrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
27
+ export declare const WrapperSectionMessage: import('styled-components').StyledComponent<"div", any, {}, never>;
28
+ export declare const AlertMessage: import('styled-components').StyledComponent<"div", any, {
29
29
  noToastContent?: boolean;
30
30
  hasClose?: boolean;
31
31
  hasExpander?: boolean;
32
32
  }, never>;
33
- export declare const AlertDescription: import("styled-components").StyledComponent<"div", any, {
33
+ export declare const AlertDescription: import('styled-components').StyledComponent<"div", any, {
34
34
  button?: boolean;
35
35
  expandedContent?: boolean;
36
36
  }, never>;
37
- export declare const Container: import("styled-components").StyledComponent<"div", any, {
37
+ export declare const Container: import('styled-components').StyledComponent<"div", any, {
38
38
  toastType: ToastType;
39
39
  }, never>;
@@ -1,149 +1,133 @@
1
- import styled, { keyframes } from 'styled-components';
2
- import { UnorderedList } from '@synerise/ds-unordered-list/dist/Unordered-list.styles';
3
- var getIconColorForType = function getIconColorForType(_ref) {
4
- var toastType = _ref.toastType,
5
- theme = _ref.theme;
1
+ import styled, { keyframes } from "styled-components";
2
+ import { UnorderedList } from "@synerise/ds-unordered-list/dist/Unordered-list.styles";
3
+ const getIconColorForType = ({
4
+ toastType,
5
+ theme
6
+ }) => {
6
7
  switch (toastType) {
7
- case 'informative':
8
- return theme.palette['grey-600'];
9
- case 'negative':
10
- return theme.palette['red-500'];
11
- case 'warning':
12
- return theme.palette['yellow-600'];
13
- case 'success':
8
+ case "informative":
9
+ return theme.palette["grey-600"];
10
+ case "negative":
11
+ return theme.palette["red-500"];
12
+ case "warning":
13
+ return theme.palette["yellow-600"];
14
+ case "success":
14
15
  default:
15
- return theme.palette['green-600'];
16
+ return theme.palette["green-600"];
16
17
  }
17
18
  };
18
- var getBackgroundColorForType = function getBackgroundColorForType(_ref2) {
19
- var toastType = _ref2.toastType,
20
- theme = _ref2.theme;
19
+ const getBackgroundColorForType = ({
20
+ toastType,
21
+ theme
22
+ }) => {
21
23
  switch (toastType) {
22
- case 'informative':
23
- return theme.palette['grey-600'];
24
- case 'negative':
25
- return theme.palette['red-500'];
26
- case 'warning':
27
- return theme.palette['yellow-600'];
28
- case 'success':
24
+ case "informative":
25
+ return theme.palette["grey-600"];
26
+ case "negative":
27
+ return theme.palette["red-500"];
28
+ case "warning":
29
+ return theme.palette["yellow-600"];
30
+ case "success":
29
31
  default:
30
- return theme.palette['green-600'];
32
+ return theme.palette["green-600"];
31
33
  }
32
34
  };
33
- var getWidth = function getWidth(hasClose, hasExpander) {
35
+ const getWidth = (hasClose, hasExpander) => {
34
36
  if (hasClose && hasExpander) {
35
- return '72px';
37
+ return "72px";
36
38
  }
37
39
  if (hasClose || hasExpander) {
38
- return '48px';
40
+ return "48px";
39
41
  }
40
- return '24px';
42
+ return "24px";
41
43
  };
42
- var openingAnimation = function openingAnimation() {
43
- return keyframes(["0%{opacity:0;transform:translateY(60px);}100%{opacity:1;transform:translateY(0);}"]);
44
- };
45
- export var closingAnimation = function closingAnimation() {
46
- return keyframes(["0%{opacity:1;transform:translateY(0) scale(1);}100%{opacity:0;transform:translateY(-8px) scale(0.98);}"]);
47
- };
48
- export var AnimationContainer = styled.div.withConfig({
44
+ const openingAnimation = () => keyframes(["0%{opacity:0;transform:translateY(60px);}100%{opacity:1;transform:translateY(0);}"]);
45
+ const closingAnimation = () => keyframes(["0%{opacity:1;transform:translateY(0) scale(1);}100%{opacity:0;transform:translateY(-8px) scale(0.98);}"]);
46
+ const AnimationContainer = /* @__PURE__ */ styled.div.withConfig({
49
47
  displayName: "Toaststyles__AnimationContainer",
50
48
  componentId: "sc-wwaizr-0"
51
- })(["animation:", " 0.6s cubic-bezier(0.4,0,0.2,1) forwards;"], function (props) {
52
- return props.$show ? openingAnimation() : closingAnimation();
53
- });
54
- export var AlertContent = styled.div.withConfig({
49
+ })(["animation:", " 0.6s cubic-bezier(0.4,0,0.2,1) forwards;"], (props) => props.$show ? openingAnimation() : closingAnimation());
50
+ const AlertContent = /* @__PURE__ */ styled.div.withConfig({
55
51
  displayName: "Toaststyles__AlertContent",
56
52
  componentId: "sc-wwaizr-1"
57
- })(["display:flex;flex-direction:column;align-items:flex-start;justify-content:center;margin-right:24px;", " ", "{margin-bottom:8px;}"], function (props) {
58
- return props.hasBottomMargin && 'margin-bottom:16px;';
59
- }, UnorderedList);
60
- export var AllContent = styled.div.withConfig({
53
+ })(["display:flex;flex-direction:column;align-items:flex-start;justify-content:center;margin-right:24px;", " ", "{margin-bottom:8px;}"], (props) => props.hasBottomMargin && "margin-bottom:16px;", UnorderedList);
54
+ const AllContent = /* @__PURE__ */ styled.div.withConfig({
61
55
  displayName: "Toaststyles__AllContent",
62
56
  componentId: "sc-wwaizr-2"
63
57
  })(["display:flex;color:inherit;"]);
64
- export var IconWrapper = styled.div.withConfig({
58
+ const IconWrapper = /* @__PURE__ */ styled.div.withConfig({
65
59
  displayName: "Toaststyles__IconWrapper",
66
60
  componentId: "sc-wwaizr-3"
67
61
  })(["margin:12px;display:flex;"]);
68
- export var IconCloseWrapper = styled.div.withConfig({
62
+ const IconCloseWrapper = /* @__PURE__ */ styled.div.withConfig({
69
63
  displayName: "Toaststyles__IconCloseWrapper",
70
64
  componentId: "sc-wwaizr-4"
71
65
  })(["cursor:pointer;"]);
72
- export var IconExpanderWrapper = styled.div.withConfig({
66
+ const IconExpanderWrapper = /* @__PURE__ */ styled.div.withConfig({
73
67
  displayName: "Toaststyles__IconExpanderWrapper",
74
68
  componentId: "sc-wwaizr-5"
75
- })(["cursor:pointer;svg{transition:transform 0.1s linear;transform:rotateZ(", ");}"], function (props) {
76
- return props.expanded ? '180deg' : '0deg';
77
- });
78
- export var ButtonWrapper = styled.div.withConfig({
69
+ })(["cursor:pointer;svg{transition:transform 0.1s linear;transform:rotateZ(", ");}"], (props) => props.expanded ? "180deg" : "0deg");
70
+ const ButtonWrapper = /* @__PURE__ */ styled.div.withConfig({
79
71
  displayName: "Toaststyles__ButtonWrapper",
80
72
  componentId: "sc-wwaizr-6"
81
73
  })(["position:absolute;right:12px;top:12px;display:flex;"]);
82
- export var FirstButtonWrapper = styled.div.withConfig({
74
+ const FirstButtonWrapper = /* @__PURE__ */ styled.div.withConfig({
83
75
  displayName: "Toaststyles__FirstButtonWrapper",
84
76
  componentId: "sc-wwaizr-7"
85
77
  })(["margin-right:8px;"]);
86
- export var NumberWrapper = styled.div.withConfig({
78
+ const NumberWrapper = /* @__PURE__ */ styled.div.withConfig({
87
79
  displayName: "Toaststyles__NumberWrapper",
88
80
  componentId: "sc-wwaizr-8"
89
- })(["margin-left:4px;color:inherit;opacity:0.6;cursor:pointer;&:hover{background-image:linear-gradient( to right,", " 20%,rgba(255,255,255,0) 10% );background-color:transparent;background-position:bottom left;background-size:5px 1px;background-repeat:repeat-x;opacity:1;}"], function (props) {
90
- return props.theme.palette['grey-400'];
91
- });
92
- export var ListWrapper = styled.div.withConfig({
81
+ })(["margin-left:4px;color:inherit;opacity:0.6;cursor:pointer;&:hover{background-image:linear-gradient( to right,", " 20%,rgba(255,255,255,0) 10% );background-color:transparent;background-position:bottom left;background-size:5px 1px;background-repeat:repeat-x;opacity:1;}"], (props) => props.theme.palette["grey-400"]);
82
+ const ListWrapper = /* @__PURE__ */ styled.div.withConfig({
93
83
  displayName: "Toaststyles__ListWrapper",
94
84
  componentId: "sc-wwaizr-9"
95
- })(["display:flex;visibility:", ";height:", ";margin-top:", ";"], function (props) {
96
- return props.visible ? 'visible' : 'hidden';
97
- }, function (props) {
98
- return props.visible ? 'auto' : '0';
99
- }, function (props) {
100
- return !props.description && props.visible ? '10px' : '0';
101
- });
102
- export var IconOrderWrapper = styled.div.withConfig({
85
+ })(["display:flex;visibility:", ";height:", ";margin-top:", ";"], (props) => props.visible ? "visible" : "hidden", (props) => props.visible ? "auto" : "0", (props) => !props.description && props.visible ? "10px" : "0");
86
+ const IconOrderWrapper = /* @__PURE__ */ styled.div.withConfig({
103
87
  displayName: "Toaststyles__IconOrderWrapper",
104
88
  componentId: "sc-wwaizr-10"
105
- })(["visibility:hidden;margin:-4px 0;&:hover{svg{fill:", ";cursor:pointer;}}"], function (props) {
106
- return props.theme.palette['blue-600'];
107
- });
108
- export var OrderWrapper = styled.div.withConfig({
89
+ })(["visibility:hidden;margin:-4px 0;&:hover{svg{fill:", ";cursor:pointer;}}"], (props) => props.theme.palette["blue-600"]);
90
+ const OrderWrapper = /* @__PURE__ */ styled.div.withConfig({
109
91
  displayName: "Toaststyles__OrderWrapper",
110
92
  componentId: "sc-wwaizr-11"
111
93
  })(["display:flex;&:hover{", "{visibility:visible;}", "{background-color:transparent;background-position:bottom left;background-size:5px 1px;background-repeat:repeat-x;opacity:1;}}"], IconOrderWrapper, NumberWrapper);
112
- export var Wrapper = styled.div.withConfig({
94
+ const Wrapper = /* @__PURE__ */ styled.div.withConfig({
113
95
  displayName: "Toaststyles__Wrapper",
114
96
  componentId: "sc-wwaizr-12"
115
- })(["color:", ";"], function (props) {
116
- return props.theme.palette['grey-600'];
117
- });
118
- export var WrapperSectionMessage = styled.div.withConfig({
97
+ })(["color:", ";"], (props) => props.theme.palette["grey-600"]);
98
+ const WrapperSectionMessage = /* @__PURE__ */ styled.div.withConfig({
119
99
  displayName: "Toaststyles__WrapperSectionMessage",
120
100
  componentId: "sc-wwaizr-13"
121
101
  })(["position:relative;font-size:13px;min-width:0;color:inherit;"]);
122
- export var AlertMessage = styled.div.withConfig({
102
+ const AlertMessage = /* @__PURE__ */ styled.div.withConfig({
123
103
  displayName: "Toaststyles__AlertMessage",
124
104
  componentId: "sc-wwaizr-14"
125
- })(["font-size:14px;line-height:20px;padding-top:14px;", ";font-weight:500;overflow:hidden;overflow-wrap:break-word;text-overflow:ellipsis;padding-right:", ";"], function (props) {
126
- return props.noToastContent && 'padding-bottom: 14px;';
127
- }, function (props) {
128
- return getWidth(props.hasClose, props.hasExpander);
129
- });
130
- export var AlertDescription = styled.div.withConfig({
105
+ })(["font-size:14px;line-height:20px;padding-top:14px;", ";font-weight:500;overflow:hidden;overflow-wrap:break-word;text-overflow:ellipsis;padding-right:", ";"], (props) => props.noToastContent && "padding-bottom: 14px;", (props) => getWidth(props.hasClose, props.hasExpander));
106
+ const AlertDescription = /* @__PURE__ */ styled.div.withConfig({
131
107
  displayName: "Toaststyles__AlertDescription",
132
108
  componentId: "sc-wwaizr-15"
133
- })(["font-size:13px;line-height:1.39;font-weight:normal;overflow:hidden;overflow-wrap:anywhere;text-overflow:ellipsis;padding-bottom:", ";margin-top:2px;"], function (props) {
134
- return props.button || props.expandedContent ? '16px' : '0';
135
- });
136
- export var Container = styled.div.withConfig({
109
+ })(["font-size:13px;line-height:1.39;font-weight:normal;overflow:hidden;overflow-wrap:anywhere;text-overflow:ellipsis;padding-bottom:", ";margin-top:2px;"], (props) => props.button || props.expandedContent ? "16px" : "0");
110
+ const Container = /* @__PURE__ */ styled.div.withConfig({
137
111
  displayName: "Toaststyles__Container",
138
112
  componentId: "sc-wwaizr-16"
139
- })(["display:flex;flex-direction:row;max-width:500px;align-items:flex-start;justify-content:center;border-top:solid 2px ", ";background-color:", ";border-radius:4px;box-shadow:0 16px 32px 0 rgba(35,41,54,0.12);", ",", ",", "{svg{fill:", ";}}", ",", ",", ",", ":hover,", "{color:", ";}", ":hover{", "{background-image:linear-gradient( to right,", ";20%,rgba(255,255,255,0) 10% );color:", ";}}", "{svg{color:", ";fill:", ";}}"], getBackgroundColorForType, function (props) {
140
- return props.theme.palette.white;
141
- }, IconExpanderWrapper, IconOrderWrapper, IconCloseWrapper, function (props) {
142
- return props.theme.palette['grey-600'];
143
- }, OrderWrapper, AlertMessage, ListWrapper, NumberWrapper, AlertDescription, function (props) {
144
- return props.theme.palette['grey-600'];
145
- }, OrderWrapper, NumberWrapper, function (props) {
146
- return props.theme.palette['grey-600'];
147
- }, function (props) {
148
- return props.theme.palette['grey-600'];
149
- }, IconWrapper, getIconColorForType, getIconColorForType);
113
+ })(["display:flex;flex-direction:row;max-width:500px;align-items:flex-start;justify-content:center;border-top:solid 2px ", ";background-color:", ";border-radius:4px;box-shadow:0 16px 32px 0 rgba(35,41,54,0.12);", ",", ",", "{svg{fill:", ";}}", ",", ",", ",", ":hover,", "{color:", ";}", ":hover{", "{background-image:linear-gradient( to right,", ";20%,rgba(255,255,255,0) 10% );color:", ";}}", "{svg{color:", ";fill:", ";}}"], getBackgroundColorForType, (props) => props.theme.palette.white, IconExpanderWrapper, IconOrderWrapper, IconCloseWrapper, (props) => props.theme.palette["grey-600"], OrderWrapper, AlertMessage, ListWrapper, NumberWrapper, AlertDescription, (props) => props.theme.palette["grey-600"], OrderWrapper, NumberWrapper, (props) => props.theme.palette["grey-600"], (props) => props.theme.palette["grey-600"], IconWrapper, getIconColorForType, getIconColorForType);
114
+ export {
115
+ AlertContent,
116
+ AlertDescription,
117
+ AlertMessage,
118
+ AllContent,
119
+ AnimationContainer,
120
+ ButtonWrapper,
121
+ Container,
122
+ FirstButtonWrapper,
123
+ IconCloseWrapper,
124
+ IconExpanderWrapper,
125
+ IconOrderWrapper,
126
+ IconWrapper,
127
+ ListWrapper,
128
+ NumberWrapper,
129
+ OrderWrapper,
130
+ Wrapper,
131
+ WrapperSectionMessage,
132
+ closingAnimation
133
+ };
@@ -1,6 +1,6 @@
1
- import type { ReactElement, ReactNode } from 'react';
2
- import type { ToastOptions } from 'react-hot-toast';
3
- import type { WithHTMLAttributes } from '@synerise/ds-utils';
1
+ import { ReactElement, ReactNode } from 'react';
2
+ import { ToastOptions } from 'react-hot-toast';
3
+ import { WithHTMLAttributes } from '@synerise/ds-utils';
4
4
  export type ToastType = 'success' | 'warning' | 'negative' | 'informative';
5
5
  export type ToastProps = WithHTMLAttributes<HTMLDivElement, {
6
6
  type: ToastType;
@@ -1 +1 @@
1
- export {};
1
+
@@ -1,3 +1,3 @@
1
- import { type ReactNode } from 'react';
2
- import { type ToastType } from './Toast.types';
1
+ import { ReactNode } from 'react';
2
+ import { ToastType } from './Toast.types';
3
3
  export declare const ICONS: Record<ToastType, ReactNode>;
package/dist/constants.js CHANGED
@@ -1,8 +1,11 @@
1
- import React from 'react';
2
- import { Check3M, InfoFillM, WarningFillM } from '@synerise/ds-icon';
3
- export var ICONS = {
4
- success: /*#__PURE__*/React.createElement(Check3M, null),
5
- warning: /*#__PURE__*/React.createElement(WarningFillM, null),
6
- negative: /*#__PURE__*/React.createElement(WarningFillM, null),
7
- informative: /*#__PURE__*/React.createElement(InfoFillM, null)
8
- };
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { InfoFillM, WarningFillM, Check3M } from "@synerise/ds-icon";
3
+ const ICONS = {
4
+ success: /* @__PURE__ */ jsx(Check3M, {}),
5
+ warning: /* @__PURE__ */ jsx(WarningFillM, {}),
6
+ negative: /* @__PURE__ */ jsx(WarningFillM, {}),
7
+ informative: /* @__PURE__ */ jsx(InfoFillM, {})
8
+ };
9
+ export {
10
+ ICONS
11
+ };
package/dist/index.js CHANGED
@@ -1,4 +1,12 @@
1
- export * from './Toast';
2
- export { Toast as default } from './Toast';
3
- export * from './utils';
4
- export * from './constants';
1
+ import { Toast, Toast as Toast2, showToast } from "./Toast.js";
2
+ import { dismissToast } from "./utils/dismissToast.js";
3
+ import { removeToast } from "./utils/removeToast.js";
4
+ import { ICONS } from "./constants.js";
5
+ export {
6
+ ICONS,
7
+ Toast,
8
+ Toast2 as default,
9
+ dismissToast,
10
+ removeToast,
11
+ showToast
12
+ };
@@ -1,2 +1,5 @@
1
- import toast from 'react-hot-toast';
2
- export var dismissToast = toast.dismiss;
1
+ import toast from "react-hot-toast";
2
+ const dismissToast = toast.dismiss;
3
+ export {
4
+ dismissToast
5
+ };
@@ -1,2 +1,6 @@
1
- export * from './dismissToast';
2
- export * from './removeToast';
1
+ import { dismissToast } from "./dismissToast.js";
2
+ import { removeToast } from "./removeToast.js";
3
+ export {
4
+ dismissToast,
5
+ removeToast
6
+ };
@@ -1,2 +1,5 @@
1
- import toast from 'react-hot-toast';
2
- export var removeToast = toast.remove;
1
+ import toast from "react-hot-toast";
2
+ const removeToast = toast.remove;
3
+ export {
4
+ removeToast
5
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-toast",
3
- "version": "1.4.11",
3
+ "version": "1.4.12",
4
4
  "description": "Toast UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -16,10 +16,10 @@
16
16
  "access": "public"
17
17
  },
18
18
  "scripts": {
19
- "build": "pnpm run build:js && pnpm run build:css && pnpm run defs",
19
+ "build": "vite build",
20
20
  "build:css": "node ../../../scripts/style/less.js",
21
21
  "build:js": "babel --delete-dir-on-start --root-mode upward src --out-dir dist --extensions '.js,.ts,.tsx'",
22
- "build:watch": "pnpm run build:js -- --watch",
22
+ "build:watch": "vite build --watch",
23
23
  "defs": "tsc --declaration --outDir dist/ --emitDeclarationOnly",
24
24
  "pack:ci": "pnpm pack --pack-destination ../../storybook/storybook-static/static",
25
25
  "prepublish": "pnpm run build",
@@ -35,15 +35,16 @@
35
35
  ],
36
36
  "types": "dist/index.d.ts",
37
37
  "dependencies": {
38
- "@synerise/ds-icon": "^1.15.0",
39
- "@synerise/ds-unordered-list": "^1.1.39",
40
- "@synerise/ds-utils": "^1.7.0",
38
+ "@synerise/ds-icon": "^1.15.1",
39
+ "@synerise/ds-unordered-list": "^1.1.40",
40
+ "@synerise/ds-utils": "^1.7.1",
41
41
  "react-hot-toast": "^2.5.2",
42
42
  "uuid": "^8.3.2"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "@synerise/ds-core": "*",
46
- "react": ">=16.9.0 <= 18.3.1"
46
+ "react": ">=16.9.0 <= 18.3.1",
47
+ "styled-components": "^5.3.3"
47
48
  },
48
- "gitHead": "8efc031fa688c0b87c7b3915bae93546bb63bcac"
49
+ "gitHead": "e4ecca8944fc9b41c1b9d59c8bcad5e5e2013225"
49
50
  }