@astral/ui 4.41.0 → 4.42.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.
Files changed (53) hide show
  1. package/components/DatePicker/hooks/useMaskedValue/useMaskedValue.d.ts +1 -1
  2. package/components/DatePicker/hooks/useMaskedValue/useMaskedValue.js +5 -4
  3. package/components/DateRangePicker/useLogic/useLogic.js +17 -5
  4. package/components/DateRangePicker/useLogic/utils/index.d.ts +1 -0
  5. package/components/DateRangePicker/useLogic/utils/index.js +1 -0
  6. package/components/DateRangePicker/useLogic/utils/isMaskedDateSyntacticallyComplete/index.d.ts +1 -0
  7. package/components/DateRangePicker/useLogic/utils/isMaskedDateSyntacticallyComplete/index.js +1 -0
  8. package/components/DateRangePicker/useLogic/utils/isMaskedDateSyntacticallyComplete/isMaskedDateSyntacticallyComplete.d.ts +5 -0
  9. package/components/DateRangePicker/useLogic/utils/isMaskedDateSyntacticallyComplete/isMaskedDateSyntacticallyComplete.js +17 -0
  10. package/components/Notification/Notification.js +1 -0
  11. package/components/Notification/NotificationContainer/styles.js +16 -5
  12. package/components/Notification/NotificationStackContainer/NotificationStackContainer.js +3 -3
  13. package/components/Notification/NotificationStackContainer/styles.js +261 -23
  14. package/components/Notification/NotificationStackContainer/useLogic/hooks/index.d.ts +1 -0
  15. package/components/Notification/NotificationStackContainer/useLogic/hooks/index.js +1 -0
  16. package/components/Notification/NotificationStackContainer/useLogic/hooks/useHover/useHover.d.ts +5 -1
  17. package/components/Notification/NotificationStackContainer/useLogic/hooks/useHover/useHover.js +6 -2
  18. package/components/Notification/NotificationStackContainer/useLogic/hooks/useTouchStackExpand/index.d.ts +1 -0
  19. package/components/Notification/NotificationStackContainer/useLogic/hooks/useTouchStackExpand/index.js +1 -0
  20. package/components/Notification/NotificationStackContainer/useLogic/hooks/useTouchStackExpand/useTouchStackExpand.d.ts +10 -0
  21. package/components/Notification/NotificationStackContainer/useLogic/hooks/useTouchStackExpand/useTouchStackExpand.js +54 -0
  22. package/components/Notification/NotificationStackContainer/useLogic/useLogic.d.ts +1 -1
  23. package/components/Notification/NotificationStackContainer/useLogic/useLogic.js +19 -9
  24. package/components/Notification/NotificationTemplate/styles.js +20 -0
  25. package/components/Notification/constants.d.ts +4 -0
  26. package/components/Notification/constants.js +4 -0
  27. package/node/components/DatePicker/hooks/useMaskedValue/useMaskedValue.d.ts +1 -1
  28. package/node/components/DatePicker/hooks/useMaskedValue/useMaskedValue.js +5 -4
  29. package/node/components/DateRangePicker/useLogic/useLogic.js +16 -4
  30. package/node/components/DateRangePicker/useLogic/utils/index.d.ts +1 -0
  31. package/node/components/DateRangePicker/useLogic/utils/index.js +1 -0
  32. package/node/components/DateRangePicker/useLogic/utils/isMaskedDateSyntacticallyComplete/index.d.ts +1 -0
  33. package/node/components/DateRangePicker/useLogic/utils/isMaskedDateSyntacticallyComplete/index.js +17 -0
  34. package/node/components/DateRangePicker/useLogic/utils/isMaskedDateSyntacticallyComplete/isMaskedDateSyntacticallyComplete.d.ts +5 -0
  35. package/node/components/DateRangePicker/useLogic/utils/isMaskedDateSyntacticallyComplete/isMaskedDateSyntacticallyComplete.js +21 -0
  36. package/node/components/Notification/Notification.js +1 -0
  37. package/node/components/Notification/NotificationContainer/styles.js +15 -4
  38. package/node/components/Notification/NotificationStackContainer/NotificationStackContainer.js +3 -3
  39. package/node/components/Notification/NotificationStackContainer/styles.js +260 -22
  40. package/node/components/Notification/NotificationStackContainer/useLogic/hooks/index.d.ts +1 -0
  41. package/node/components/Notification/NotificationStackContainer/useLogic/hooks/index.js +1 -0
  42. package/node/components/Notification/NotificationStackContainer/useLogic/hooks/useHover/useHover.d.ts +5 -1
  43. package/node/components/Notification/NotificationStackContainer/useLogic/hooks/useHover/useHover.js +6 -2
  44. package/node/components/Notification/NotificationStackContainer/useLogic/hooks/useTouchStackExpand/index.d.ts +1 -0
  45. package/node/components/Notification/NotificationStackContainer/useLogic/hooks/useTouchStackExpand/index.js +17 -0
  46. package/node/components/Notification/NotificationStackContainer/useLogic/hooks/useTouchStackExpand/useTouchStackExpand.d.ts +10 -0
  47. package/node/components/Notification/NotificationStackContainer/useLogic/hooks/useTouchStackExpand/useTouchStackExpand.js +58 -0
  48. package/node/components/Notification/NotificationStackContainer/useLogic/useLogic.d.ts +1 -1
  49. package/node/components/Notification/NotificationStackContainer/useLogic/useLogic.js +18 -8
  50. package/node/components/Notification/NotificationTemplate/styles.js +20 -0
  51. package/node/components/Notification/constants.d.ts +4 -0
  52. package/node/components/Notification/constants.js +5 -1
  53. package/package.json +1 -1
@@ -0,0 +1,54 @@
1
+ import { useEffect, useState } from 'react';
2
+ import { notifyClassnames } from '../../../../constants';
3
+ const isInteractiveTarget = (element) => Boolean(element.closest('button, a[href], [role="button"], input, textarea, select'));
4
+ /**
5
+ * Определяет, является ли стек уведомлений раскрытым на мобильном устройстве.
6
+ */
7
+ export const useTouchStackExpand = ({ stackContainerElement, enabled, hasOpenNotify, }) => {
8
+ const [isTouchExpanded, setTouchExpanded] = useState(false);
9
+ useEffect(() => {
10
+ if (!enabled || !hasOpenNotify) {
11
+ setTouchExpanded(false);
12
+ }
13
+ }, [enabled, hasOpenNotify]);
14
+ useEffect(() => {
15
+ if (!enabled || !hasOpenNotify || !stackContainerElement) {
16
+ return undefined;
17
+ }
18
+ const toggleStack = (event) => {
19
+ const { target } = event;
20
+ if (!(target instanceof Element) || isInteractiveTarget(target)) {
21
+ return;
22
+ }
23
+ setTouchExpanded((prev) => !prev);
24
+ };
25
+ stackContainerElement.addEventListener('pointerdown', toggleStack);
26
+ return () => {
27
+ stackContainerElement.removeEventListener('pointerdown', toggleStack);
28
+ };
29
+ }, [enabled, hasOpenNotify, stackContainerElement]);
30
+ useEffect(() => {
31
+ const collapseIfOutside = (event) => {
32
+ const { target } = event;
33
+ if (!(target instanceof Node) || !stackContainerElement) {
34
+ return;
35
+ }
36
+ const stackHost = stackContainerElement.closest(`.${notifyClassnames.stackHost}`);
37
+ const insideUi = stackHost?.parentElement ?? stackContainerElement;
38
+ if (!insideUi.contains(target)) {
39
+ setTouchExpanded(false);
40
+ }
41
+ };
42
+ document.addEventListener('pointerdown', collapseIfOutside, true);
43
+ if (!enabled ||
44
+ !hasOpenNotify ||
45
+ !isTouchExpanded ||
46
+ !stackContainerElement) {
47
+ document.removeEventListener('pointerdown', collapseIfOutside, true);
48
+ }
49
+ return () => {
50
+ document.removeEventListener('pointerdown', collapseIfOutside, true);
51
+ };
52
+ }, [enabled, hasOpenNotify, isTouchExpanded, stackContainerElement]);
53
+ return isTouchExpanded;
54
+ };
@@ -4,7 +4,7 @@ type UseLogicParams = {
4
4
  };
5
5
  export declare const useLogic: ({ containerId: externalContainerId, }: UseLogicParams) => {
6
6
  isVisibleCloseButton: boolean;
7
- isHoveredContainer: boolean;
7
+ isStackExpanded: boolean;
8
8
  isStartedClosingNotify: boolean;
9
9
  closeAll: () => void;
10
10
  };
@@ -1,9 +1,11 @@
1
1
  import { useEffect, useState } from 'react';
2
2
  import { toast } from 'react-toastify-next';
3
+ import { useViewportType } from '../../../useViewportType';
3
4
  import { NOTIFY_NO_TRANSITION_ATTR, notifyClassnames } from '../../constants';
4
5
  import { sleep } from '../../utils/sleep';
5
- import { useHover } from './hooks';
6
+ import { useHover, useTouchStackExpand } from './hooks';
6
7
  export const useLogic = ({ containerId: externalContainerId, }) => {
8
+ const { isMobile } = useViewportType();
7
9
  const [toasts, setToasts] = useState([]);
8
10
  const [container, setContainer] = useState();
9
11
  const [isStartedClosingNotify, setStartedClosingNotify] = useState(false);
@@ -29,7 +31,16 @@ export const useLogic = ({ containerId: externalContainerId, }) => {
29
31
  setStartedClosingNotify(false);
30
32
  }
31
33
  }, [toasts]);
32
- const { isHovered: isHoveredContainer } = useHover(container);
34
+ const hasOpenNotify = Boolean(toasts.length);
35
+ const { isHovered } = useHover(container, {
36
+ enabled: !isMobile,
37
+ });
38
+ const isTouchExpanded = useTouchStackExpand({
39
+ stackContainerElement: container ?? null,
40
+ enabled: isMobile,
41
+ hasOpenNotify,
42
+ });
43
+ const isStackExpanded = isMobile ? isTouchExpanded : isHovered;
33
44
  const handleAddToast = ({ id, containerId }) => {
34
45
  if (Object.is(containerId, externalContainerId)) {
35
46
  setToasts((currentToasts) => [...currentToasts, id]);
@@ -58,29 +69,28 @@ export const useLogic = ({ containerId: externalContainerId, }) => {
58
69
  return unsubscribe;
59
70
  }, []);
60
71
  useEffect(() => {
61
- if (!isHoveredContainer || !container) {
72
+ if (!isStackExpanded || !container) {
62
73
  return;
63
74
  }
64
75
  (async () => {
65
76
  // Ожидаем пока отработает анимация и стек с уведомлениями раскроется
66
77
  await sleep(300);
67
- const hasScroll = container?.scrollHeight > container?.clientHeight;
68
- if (hasScroll) {
78
+ const hasVerticalScroll = container.scrollHeight > container.clientHeight;
79
+ if (hasVerticalScroll) {
69
80
  container.scrollTo({
70
81
  top: container.scrollHeight,
71
82
  behavior: 'smooth',
72
83
  });
73
84
  }
74
85
  })();
75
- }, [container, isHoveredContainer]);
86
+ }, [container, isStackExpanded]);
76
87
  const closeAll = () => {
77
88
  setStartedClosingNotify(true);
78
89
  toast.dismiss({ containerId: externalContainerId });
79
90
  };
80
- const hasOpenNotify = Boolean(toasts.length);
81
91
  return {
82
- isVisibleCloseButton: hasOpenNotify,
83
- isHoveredContainer: isHoveredContainer && hasOpenNotify,
92
+ isVisibleCloseButton: hasOpenNotify && (isMobile ? isStackExpanded : true),
93
+ isStackExpanded,
84
94
  isStartedClosingNotify,
85
95
  closeAll,
86
96
  };
@@ -1,4 +1,6 @@
1
+ import { buttonClassnames } from '../../Button/constants';
1
2
  import { IconButton } from '../../IconButton';
3
+ import { svgIconClassnames } from '../../SvgIcon/constants';
2
4
  import { styled } from '../../styled';
3
5
  import { Typography } from '../../Typography';
4
6
  import { getActionsDirection } from './utils';
@@ -15,6 +17,10 @@ export const Wrapper = styled.article `
15
17
  color: ${({ theme }) => theme.palette.grey[900]};
16
18
 
17
19
  background: ${({ theme }) => theme.palette.background.default};
20
+
21
+ ${({ theme }) => theme.breakpoints.down('sm')} {
22
+ padding: ${({ theme }) => theme.spacing(2, 3)};
23
+ }
18
24
  `;
19
25
  export const Header = styled.header `
20
26
  display: flex;
@@ -22,6 +28,13 @@ export const Header = styled.header `
22
28
 
23
29
  width: 100%;
24
30
  min-height: 24px;
31
+
32
+ ${({ theme }) => theme.breakpoints.down('sm')} {
33
+ .${buttonClassnames.root} {
34
+ width: 24px;
35
+ height: 24px;
36
+ }
37
+ }
25
38
  `;
26
39
  export const Content = styled(Typography) `
27
40
  margin-top: ${({ theme }) => theme.spacing(2)};
@@ -38,6 +51,13 @@ export const IconWrapper = styled.div `
38
51
  display: flex;
39
52
 
40
53
  margin-right: ${({ theme }) => theme.spacing(2)};
54
+
55
+ ${({ theme }) => theme.breakpoints.down('sm')} {
56
+ .${svgIconClassnames.root} {
57
+ width: 24px;
58
+ height: 24px;
59
+ }
60
+ }
41
61
  `;
42
62
  export const CloseButton = styled(IconButton) `
43
63
  align-self: center;
@@ -18,9 +18,13 @@ export declare const NOTIFY_STATIC_CONTAINER_ID = "static-notify-container";
18
18
  export declare const BANNER_CONTAINER_ID = "banner-container-id";
19
19
  export declare const NOTIFY_NO_TRANSITION_ATTR = "data-no-transition";
20
20
  export declare const NOTIFY_HEIGHT = "56px";
21
+ export declare const NOTIFY_HEIGHT_MOBILE = "40px";
21
22
  export declare const notifyClassnames: {
22
23
  root: string;
23
24
  body: string;
25
+ stack: string;
26
+ /** Обёртка только над stacked ToastContainer — без :has() отделяем внешний .Toastify от статичного */
27
+ stackHost: string;
24
28
  container: string;
25
29
  animationIn: string;
26
30
  animationOut: string;
@@ -20,9 +20,13 @@ export const NOTIFY_STATIC_CONTAINER_ID = 'static-notify-container';
20
20
  export const BANNER_CONTAINER_ID = 'banner-container-id';
21
21
  export const NOTIFY_NO_TRANSITION_ATTR = 'data-no-transition';
22
22
  export const NOTIFY_HEIGHT = '56px';
23
+ export const NOTIFY_HEIGHT_MOBILE = '40px';
23
24
  export const notifyClassnames = {
24
25
  root: createUIKitClassname('notify'),
25
26
  body: createUIKitClassname('notify__body'),
27
+ stack: createUIKitClassname('notify__stack'),
28
+ /** Обёртка только над stacked ToastContainer — без :has() отделяем внешний .Toastify от статичного */
29
+ stackHost: createUIKitClassname('notify__stack-host'),
26
30
  container: createUIKitClassname('notify__container'),
27
31
  animationIn: createUIKitClassname('notify_animation-in'),
28
32
  animationOut: createUIKitClassname('notify_animation-out'),
@@ -4,7 +4,7 @@ type Params = {
4
4
  /**
5
5
  * Изменение value для DatePicker
6
6
  * */
7
- onChangeValue?: (date?: Date | null) => void;
7
+ onChangeValue?: (date?: Date | null, maskedValue?: string) => void;
8
8
  };
9
9
  type Returned = {
10
10
  /**
@@ -13,15 +13,16 @@ const useMaskedValue = ({ currentValue, mask, onChangeValue, }) => {
13
13
  setMaskedValue(value);
14
14
  // При отсутствии value указываем null, так как если задать undefined, то отобразится defaultValue при наличии
15
15
  if (!value) {
16
- onChangeValue?.(null);
16
+ onChangeValue?.(null, value);
17
17
  }
18
18
  else {
19
- onChangeValue?.((0, date_1.parseDate)(value, mask));
19
+ onChangeValue?.((0, date_1.parseDate)(value, mask), value);
20
20
  }
21
21
  };
22
22
  const handleChangeMaskedDate = (date) => {
23
- setMaskedValue((0, date_1.formatDate)(date, mask));
24
- onChangeValue?.(date);
23
+ const formatted = (0, date_1.formatDate)(date, mask);
24
+ setMaskedValue(formatted);
25
+ onChangeValue?.(date, formatted);
25
26
  };
26
27
  // здесь происходит реакция на изменение value из вне (управляемый компонент)
27
28
  (0, react_1.useEffect)(() => {
@@ -42,15 +42,27 @@ const useLogic = ({ value, minDate = DatePicker_1.DEFAULT_MIN_DATE, maxDate = Da
42
42
  selectedStartDate: selectedStartBaseDate,
43
43
  selectedEndDate: selectedEndBaseDate,
44
44
  });
45
- const handleChangeStartDate = (startDateValue) => {
46
- if (startDateValue && value?.end && startDateValue > value?.end) {
45
+ const handleChangeStartDate = (startDateValue, startMaskString) => {
46
+ const isStartComplete = startDateValue != null &&
47
+ startMaskString != null &&
48
+ (0, utils_1.isMaskedDateSyntacticallyComplete)(startMaskString, mask);
49
+ if (isStartComplete &&
50
+ value?.end &&
51
+ startDateValue &&
52
+ startDateValue > value.end) {
47
53
  onChange?.({ start: startDateValue, end: undefined });
48
54
  return;
49
55
  }
50
56
  onChange?.({ ...value, start: startDateValue });
51
57
  };
52
- const handleChangeEndDate = (endDateValue) => {
53
- if (endDateValue && value?.start && endDateValue < value?.start) {
58
+ const handleChangeEndDate = (endDateValue, endMaskString) => {
59
+ const isEndComplete = endDateValue != null &&
60
+ endMaskString != null &&
61
+ (0, utils_1.isMaskedDateSyntacticallyComplete)(endMaskString, mask);
62
+ if (isEndComplete &&
63
+ value?.start &&
64
+ endDateValue &&
65
+ endDateValue < value.start) {
54
66
  onChange?.({ start: undefined, end: endDateValue });
55
67
  return;
56
68
  }
@@ -1 +1,2 @@
1
1
  export * from './getBoundaryDate';
2
+ export * from './isMaskedDateSyntacticallyComplete';
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./getBoundaryDate"), exports);
18
+ __exportStar(require("./isMaskedDateSyntacticallyComplete"), exports);
@@ -0,0 +1 @@
1
+ export * from './isMaskedDateSyntacticallyComplete';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./isMaskedDateSyntacticallyComplete"), exports);
@@ -0,0 +1,5 @@
1
+ import { type DateMask } from '../../../../utils/date/format';
2
+ /**
3
+ * Все ли части строки по маске заполнены цифрами полностью (без промежуточных состояний IMask).
4
+ */
5
+ export declare const isMaskedDateSyntacticallyComplete: (value: string, mask: DateMask, separator?: string) => boolean;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isMaskedDateSyntacticallyComplete = void 0;
4
+ /**
5
+ * Все ли части строки по маске заполнены цифрами полностью (без промежуточных состояний IMask).
6
+ */
7
+ const isMaskedDateSyntacticallyComplete = (value, mask, separator = '.') => {
8
+ if (!value) {
9
+ return false;
10
+ }
11
+ const maskParts = mask.split(separator);
12
+ const valueParts = value.split(separator);
13
+ if (maskParts.length !== valueParts.length) {
14
+ return false;
15
+ }
16
+ return maskParts.every((maskPart, index) => {
17
+ const part = valueParts[index];
18
+ return (part.length === maskPart.length && part.length > 0 && /^\d+$/.test(part));
19
+ });
20
+ };
21
+ exports.isMaskedDateSyntacticallyComplete = isMaskedDateSyntacticallyComplete;
@@ -8,6 +8,7 @@ const utils_1 = require("./utils");
8
8
  const leave = (0, react_toastify_next_1.cssTransition)({
9
9
  enter: constants_1.notifyClassnames.animationIn,
10
10
  exit: constants_1.notifyClassnames.animationOut,
11
+ collapse: false,
11
12
  });
12
13
  exports.notify = {
13
14
  success: (title, { icon, ...options } = {}) => (0, react_toastify_next_1.toast)(({ toastProps }) => constants_2.NOTIFICATION_VARIANT.success({ ...options, icon, title }, toastProps), {
@@ -49,23 +49,28 @@ exports.Wrapper = (0, styled_1.styled)('div', {
49
49
  `}
50
50
  }
51
51
 
52
+ .Toastify__toast-container {
53
+ ${({ theme }) => theme.breakpoints.down('sm')} {
54
+ padding: ${({ theme }) => theme.spacing(4)};
55
+ }
56
+ }
57
+
52
58
  .${constants_1.notifyClassnames.animationIn} {
53
- animation: ${leaveIn} ease-in-out 0.34s;
59
+ animation: ${leaveIn} ease-in-out ${({ theme }) => theme.transitions.duration.standard}ms;
54
60
  animation-fill-mode: both;
55
61
 
56
62
  ${({ theme }) => theme.breakpoints.down('sm')} {
57
- animation: ${leaveInMobile} ease-in-out 0.34s;
63
+ animation: ${leaveInMobile} ease-in-out ${({ theme }) => theme.transitions.duration.standard}ms;
58
64
  animation-fill-mode: both;
59
65
  }
60
66
  }
61
67
 
62
68
  .${constants_1.notifyClassnames.animationOut} {
63
- animation: ${leaveOut} ease-in-out 0.34s;
69
+ animation: ${leaveOut} ease-in-out ${({ theme }) => theme.transitions.duration.standard}ms;
64
70
  animation-fill-mode: both;
65
71
  }
66
72
 
67
73
  .${constants_1.notifyClassnames.root} {
68
- min-height: ${constants_1.NOTIFY_HEIGHT};
69
74
  margin-bottom: ${({ theme }) => theme.spacing(1)};
70
75
  padding: 0;
71
76
 
@@ -84,6 +89,12 @@ exports.Wrapper = (0, styled_1.styled)('div', {
84
89
  width: 100%;
85
90
  height: 3px;
86
91
  }
92
+ ${({ theme }) => theme.breakpoints.up('sm')} {
93
+ min-height: ${constants_1.NOTIFY_HEIGHT};
94
+ }
95
+ ${({ theme }) => theme.breakpoints.down('sm')} {
96
+ min-height: ${constants_1.NOTIFY_HEIGHT_MOBILE};
97
+ }
87
98
 
88
99
  ${({ theme }) => theme.breakpoints.down('sm')} {
89
100
  margin-bottom: ${({ theme }) => theme.spacing(3)};
@@ -11,12 +11,12 @@ if (typeof window !== 'undefined') {
11
11
  (0, inject_style_1.injectStyle)();
12
12
  }
13
13
  const NotificationStackContainer = ({ containerId = constants_1.NOTIFY_CONTAINER_ID, staticContainerId = constants_1.NOTIFY_STATIC_CONTAINER_ID, bannerContainer, closeButton, ...props }) => {
14
- const { isVisibleCloseButton, isHoveredContainer, isStartedClosingNotify, closeAll, } = (0, useLogic_1.useLogic)({
14
+ const { isVisibleCloseButton, isStackExpanded, isStartedClosingNotify, closeAll, } = (0, useLogic_1.useLogic)({
15
15
  containerId,
16
16
  });
17
17
  return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { className: (0, classNames_1.classNames)({
18
- [constants_1.notifyClassnames.container]: isHoveredContainer,
19
- }), children: [(0, jsx_runtime_1.jsx)(styles_1.Inner, { ...props, ...{ stacked: true }, containerId: containerId, pauseOnFocusLoss: true, position: constants_1.NOTIFY_POSITIONS.BOTTOM_RIGHT, newestOnTop: false, closeOnClick: false, draggable: false, rtl: false, closeButton: false, bodyClassName: `${constants_1.notifyClassnames.body}`, toastClassName: constants_1.notifyClassnames.root, progressClassName: `${constants_1.notifyClassnames.progress}` }), isVisibleCloseButton && ((0, jsx_runtime_1.jsx)(styles_1.CloseButton, { size: "small", variant: "light", color: "grey", className: (0, classNames_1.classNames)({
18
+ [constants_1.notifyClassnames.container]: isStackExpanded,
19
+ }), children: [(0, jsx_runtime_1.jsx)("div", { className: constants_1.notifyClassnames.stackHost, children: (0, jsx_runtime_1.jsx)(styles_1.Inner, { ...props, className: (0, classNames_1.classNames)(constants_1.notifyClassnames.stack, props.className), ...{ stacked: true }, containerId: containerId, pauseOnFocusLoss: true, position: constants_1.NOTIFY_POSITIONS.BOTTOM_RIGHT, newestOnTop: false, closeOnClick: false, draggable: false, rtl: false, closeButton: false, bodyClassName: `${constants_1.notifyClassnames.body}`, toastClassName: constants_1.notifyClassnames.root, progressClassName: `${constants_1.notifyClassnames.progress}` }) }), isVisibleCloseButton && ((0, jsx_runtime_1.jsx)(styles_1.CloseButton, { size: "small", variant: "light", color: "grey", className: (0, classNames_1.classNames)({
20
20
  [constants_1.notifyClassnames.closeButtonAnimationOut]: isStartedClosingNotify,
21
21
  }), onClick: closeAll, children: "\u0421\u043A\u0440\u044B\u0442\u044C \u0432\u0441\u0435" })), (0, jsx_runtime_1.jsx)(styles_1.StaticInner, { containerId: staticContainerId, position: constants_1.NOTIFY_POSITIONS.BOTTOM_RIGHT, newestOnTop: false, closeOnClick: false, draggable: false, rtl: false, closeButton: false, bodyClassName: `${constants_1.notifyClassnames.body}`, toastClassName: constants_1.notifyClassnames.root, progressClassName: `${constants_1.notifyClassnames.progress}` }), bannerContainer] }));
22
22
  };