@plurid/plurid-ui-components-react 0.0.0-18 → 0.0.0-19

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.
@@ -2747,6 +2747,7 @@ const StyledNotification = styled__default["default"].div`
2747
2747
  color: ${props => props.theme.colorPrimary};
2748
2748
  box-shadow: ${props => props.theme.boxShadowUmbra};
2749
2749
  animation: ${translateUp} 750ms ease-in-out forwards;
2750
+ transition: opacity 400ms;
2750
2751
 
2751
2752
  a {
2752
2753
  text-decoration: none;
@@ -2775,12 +2776,16 @@ const StyledNotificationClose = styled__default["default"].div`
2775
2776
  const Notification = properties => {
2776
2777
  const {data: data, theme: theme, remove: remove, elements: elements, style: style, className: className} = properties;
2777
2778
  const {id: id, text: text, html: html, react: react, timeout: timeout, wordBreak: wordBreak} = data;
2778
- const resolvedWordBreak = wordBreak === false ? "normal" : "break-all";
2779
+ const resolvedWordBreak = wordBreak === true ? "break-all" : "normal";
2780
+ const [prepareForRemoval, setPrepareForRemoval] = React.useState(false);
2779
2781
  const notificationTimeout = React.useRef(null);
2780
2782
  React.useEffect((() => {
2781
2783
  if (timeout) {
2782
2784
  notificationTimeout.current = setTimeout((() => {
2783
- remove(id);
2785
+ setPrepareForRemoval(true);
2786
+ setTimeout((() => {
2787
+ remove(id);
2788
+ }), 400);
2784
2789
  }), timeout);
2785
2790
  }
2786
2791
  return () => {
@@ -2806,7 +2811,9 @@ const Notification = properties => {
2806
2811
  const content = resolveRender();
2807
2812
  return React__default["default"].createElement(StyledNotification, {
2808
2813
  theme: theme,
2809
- style: Object.assign({}, style),
2814
+ style: Object.assign(Object.assign({}, style), {
2815
+ opacity: prepareForRemoval ? 0 : undefined
2816
+ }),
2810
2817
  className: className
2811
2818
  }, content, React__default["default"].createElement(StyledNotificationClose, null, React__default["default"].createElement(pluridIconsReact.PluridIconDelete, {
2812
2819
  atClick: () => remove(id)