@alfalab/core-components-notification 7.1.4 → 7.3.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.
Files changed (43) hide show
  1. package/Component.js +1 -1
  2. package/cssm/fnUtils-e793ac44.d.ts +15 -0
  3. package/cssm/index.module.css +3 -2
  4. package/cssm/shared/index.d.ts +1 -0
  5. package/cssm/shared/index.js +9 -0
  6. package/cssm/useIsMounted-e793ac44.d.ts +3 -0
  7. package/esm/Component.js +1 -1
  8. package/esm/fnUtils-e793ac44.d.ts +15 -0
  9. package/esm/index.css +12 -11
  10. package/esm/shared/index.d.ts +1 -0
  11. package/esm/shared/index.js +1 -0
  12. package/esm/useIsMounted-e793ac44.d.ts +3 -0
  13. package/fnUtils-e793ac44.d.ts +15 -0
  14. package/index.css +12 -11
  15. package/modern/Component.js +1 -1
  16. package/modern/fnUtils-e793ac44.d.ts +15 -0
  17. package/modern/index.css +12 -11
  18. package/modern/shared/index.d.ts +1 -0
  19. package/modern/shared/index.js +1 -0
  20. package/modern/useIsMounted-e793ac44.d.ts +3 -0
  21. package/moderncssm/Component.d.ts +89 -0
  22. package/moderncssm/Component.js +95 -0
  23. package/moderncssm/browser-a216f694.d.ts +6 -0
  24. package/moderncssm/fnUtils-e793ac44.d.ts +15 -0
  25. package/moderncssm/index.d.ts +1 -0
  26. package/moderncssm/index.js +1 -0
  27. package/moderncssm/index.module.css +60 -0
  28. package/moderncssm/shared/index.d.ts +1 -0
  29. package/moderncssm/shared/index.js +1 -0
  30. package/moderncssm/useCustomWebkitScrollbar-a216f694.d.ts +2 -0
  31. package/moderncssm/useIsMounted-e793ac44.d.ts +3 -0
  32. package/moderncssm/utils/getNotificationTestIds.d.ts +5 -0
  33. package/moderncssm/utils/getNotificationTestIds.js +18 -0
  34. package/moderncssm/utils/index.d.ts +4 -0
  35. package/moderncssm/utils/index.js +27 -0
  36. package/package.json +5 -5
  37. package/shared/index.d.ts +1 -0
  38. package/shared/index.js +9 -0
  39. package/shared/package.json +3 -0
  40. package/src/index.module.css +3 -3
  41. package/src/shared/index.ts +1 -0
  42. package/src/shared/package.json +3 -0
  43. package/useIsMounted-e793ac44.d.ts +3 -0
package/Component.js CHANGED
@@ -21,7 +21,7 @@ var mergeRefs__default = /*#__PURE__*/_interopDefaultCompat(mergeRefs);
21
21
  var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
22
22
  var elementClosest__default = /*#__PURE__*/_interopDefaultCompat(elementClosest);
23
23
 
24
- var styles = {"notificationComponent":"notification__notificationComponent_1ln9d","isVisible":"notification__isVisible_1ln9d","isClosing":"notification__isClosing_1ln9d","toastContent":"notification__toastContent_1ln9d","actionSection":"notification__actionSection_1ln9d"};
24
+ var styles = {"notificationComponent":"notification__notificationComponent_1b7zm","isVisible":"notification__isVisible_1b7zm","isClosing":"notification__isClosing_1b7zm","toastContent":"notification__toastContent_1b7zm","actionSection":"notification__actionSection_1b7zm"};
25
25
  require('./index.css')
26
26
 
27
27
  var notificationClassNameSelector = ".".concat(styles.notificationComponent);
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Возвращает true, если значение равно null или undefined
3
+ */
4
+ declare function isNil<T>(value: T): value is T & (null | undefined);
5
+ /**
6
+ * Выбор значения между min max границами
7
+ */
8
+ declare function clamp<T extends Date | number>(value: T, min: T, max: T): T;
9
+ declare function noop(): void;
10
+ declare const fnUtils: {
11
+ clamp: typeof clamp;
12
+ noop: typeof noop;
13
+ isNil: typeof isNil;
14
+ };
15
+ export { fnUtils };
@@ -20,6 +20,7 @@
20
20
  --gap-s-neg: -12px; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
21
21
 
22
22
  /* новые значения, используйте их */
23
+ --gap-0: 0;
23
24
  --gap-8: var(--gap-xs);
24
25
  --gap-12: var(--gap-s);
25
26
  --gap-24: var(--gap-xl);
@@ -60,6 +61,6 @@
60
61
  } .actionSection {
61
62
  min-width: 104px;
62
63
  min-height: 48px;
63
- padding: 0 var(--gap-8);
64
- margin: var(--gap-12-neg) 0;
64
+ padding: var(--gap-0) var(--gap-8);
65
+ margin: var(--gap-12-neg) var(--gap-0);
65
66
  }
@@ -0,0 +1 @@
1
+ export { getNotificationTestIds } from "../utils/getNotificationTestIds";
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var utils_getNotificationTestIds = require('../utils/getNotificationTestIds.js');
6
+
7
+
8
+
9
+ exports.getNotificationTestIds = utils_getNotificationTestIds.getNotificationTestIds;
@@ -0,0 +1,3 @@
1
+ import { RefObject } from 'react';
2
+ declare const useIsMounted: () => [isMountedRef: RefObject<boolean>, runIfMounted: (callback: () => void) => void];
3
+ export { useIsMounted };
package/esm/Component.js CHANGED
@@ -10,7 +10,7 @@ import { ToastPlateDesktop } from '@alfalab/core-components-toast-plate/esm/desk
10
10
  import { stackingOrder } from '@alfalab/stack-context';
11
11
  import { useClickOutside } from './utils/index.js';
12
12
 
13
- var styles = {"notificationComponent":"notification__notificationComponent_1ln9d","isVisible":"notification__isVisible_1ln9d","isClosing":"notification__isClosing_1ln9d","toastContent":"notification__toastContent_1ln9d","actionSection":"notification__actionSection_1ln9d"};
13
+ var styles = {"notificationComponent":"notification__notificationComponent_1b7zm","isVisible":"notification__isVisible_1b7zm","isClosing":"notification__isClosing_1b7zm","toastContent":"notification__toastContent_1b7zm","actionSection":"notification__actionSection_1b7zm"};
14
14
  require('./index.css')
15
15
 
16
16
  var notificationClassNameSelector = ".".concat(styles.notificationComponent);
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Возвращает true, если значение равно null или undefined
3
+ */
4
+ declare function isNil<T>(value: T): value is T & (null | undefined);
5
+ /**
6
+ * Выбор значения между min max границами
7
+ */
8
+ declare function clamp<T extends Date | number>(value: T, min: T, max: T): T;
9
+ declare function noop(): void;
10
+ declare const fnUtils: {
11
+ clamp: typeof clamp;
12
+ noop: typeof noop;
13
+ isNil: typeof isNil;
14
+ };
15
+ export { fnUtils };
package/esm/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: b6ln3 */
1
+ /* hash: 2j8g1 */
2
2
  :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
3
3
  } /* deprecated */ :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
4
4
  } :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
@@ -21,6 +21,7 @@
21
21
  --gap-s-neg: -12px; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
22
22
 
23
23
  /* новые значения, используйте их */
24
+ --gap-0: 0;
24
25
  --gap-8: var(--gap-xs);
25
26
  --gap-12: var(--gap-s);
26
27
  --gap-24: var(--gap-xl);
@@ -30,7 +31,7 @@
30
31
  } :root {
31
32
  } :root {
32
33
  --notification-desktop-content-width: 278px;
33
- } .notification__notificationComponent_1ln9d {
34
+ } .notification__notificationComponent_1b7zm {
34
35
  visibility: hidden;
35
36
  right: var(--gap-12);
36
37
  transform: translate(0, -500px);
@@ -39,28 +40,28 @@
39
40
  -webkit-user-select: none;
40
41
  user-select: none;
41
42
  transition: transform 0.4s ease-out
42
- } @media screen and (min-width: 600px) { .notification__notificationComponent_1ln9d {
43
+ } @media screen and (min-width: 600px) { .notification__notificationComponent_1b7zm {
43
44
  right: var(--gap-48);
44
45
  width: auto;
45
46
  transform: translate(calc(100% + var(--gap-48)), 0)
46
47
  }
47
- } .notification__notificationComponent_1ln9d.notification__isVisible_1ln9d {
48
+ } .notification__notificationComponent_1b7zm.notification__isVisible_1b7zm {
48
49
  visibility: visible;
49
50
  transform: translate(0, 0);
50
- } .notification__notificationComponent_1ln9d.notification__isClosing_1ln9d {
51
+ } .notification__notificationComponent_1b7zm.notification__isClosing_1b7zm {
51
52
  transition: transform 0.1s ease-out;
52
53
  transform: translate(100vw, 0)
53
- } @media screen and (min-width: 600px) { .notification__notificationComponent_1ln9d.notification__isClosing_1ln9d {
54
+ } @media screen and (min-width: 600px) { .notification__notificationComponent_1b7zm.notification__isClosing_1b7zm {
54
55
  transform: translate(calc(100% + var(--gap-48)), 0)
55
56
  }
56
- } .notification__notificationComponent_1ln9d.notification__notificationComponent_1ln9d {
57
+ } .notification__notificationComponent_1b7zm.notification__notificationComponent_1b7zm {
57
58
  position: fixed;
58
- } @media screen and (min-width: 600px) { .notification__toastContent_1ln9d {
59
+ } @media screen and (min-width: 600px) { .notification__toastContent_1b7zm {
59
60
  width: var(--notification-desktop-content-width)
60
61
  }
61
- } .notification__actionSection_1ln9d {
62
+ } .notification__actionSection_1b7zm {
62
63
  min-width: 104px;
63
64
  min-height: 48px;
64
- padding: 0 var(--gap-8);
65
- margin: var(--gap-12-neg) 0;
65
+ padding: var(--gap-0) var(--gap-8);
66
+ margin: var(--gap-12-neg) var(--gap-0);
66
67
  }
@@ -0,0 +1 @@
1
+ export { getNotificationTestIds } from "../utils/getNotificationTestIds";
@@ -0,0 +1 @@
1
+ export { getNotificationTestIds } from '../utils/getNotificationTestIds.js';
@@ -0,0 +1,3 @@
1
+ import { RefObject } from 'react';
2
+ declare const useIsMounted: () => [isMountedRef: RefObject<boolean>, runIfMounted: (callback: () => void) => void];
3
+ export { useIsMounted };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Возвращает true, если значение равно null или undefined
3
+ */
4
+ declare function isNil<T>(value: T): value is T & (null | undefined);
5
+ /**
6
+ * Выбор значения между min max границами
7
+ */
8
+ declare function clamp<T extends Date | number>(value: T, min: T, max: T): T;
9
+ declare function noop(): void;
10
+ declare const fnUtils: {
11
+ clamp: typeof clamp;
12
+ noop: typeof noop;
13
+ isNil: typeof isNil;
14
+ };
15
+ export { fnUtils };
package/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: b6ln3 */
1
+ /* hash: 2j8g1 */
2
2
  :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
3
3
  } /* deprecated */ :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
4
4
  } :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
@@ -21,6 +21,7 @@
21
21
  --gap-s-neg: -12px; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
22
22
 
23
23
  /* новые значения, используйте их */
24
+ --gap-0: 0;
24
25
  --gap-8: var(--gap-xs);
25
26
  --gap-12: var(--gap-s);
26
27
  --gap-24: var(--gap-xl);
@@ -30,7 +31,7 @@
30
31
  } :root {
31
32
  } :root {
32
33
  --notification-desktop-content-width: 278px;
33
- } .notification__notificationComponent_1ln9d {
34
+ } .notification__notificationComponent_1b7zm {
34
35
  visibility: hidden;
35
36
  right: var(--gap-12);
36
37
  transform: translate(0, -500px);
@@ -39,28 +40,28 @@
39
40
  -webkit-user-select: none;
40
41
  user-select: none;
41
42
  transition: transform 0.4s ease-out
42
- } @media screen and (min-width: 600px) { .notification__notificationComponent_1ln9d {
43
+ } @media screen and (min-width: 600px) { .notification__notificationComponent_1b7zm {
43
44
  right: var(--gap-48);
44
45
  width: auto;
45
46
  transform: translate(calc(100% + var(--gap-48)), 0)
46
47
  }
47
- } .notification__notificationComponent_1ln9d.notification__isVisible_1ln9d {
48
+ } .notification__notificationComponent_1b7zm.notification__isVisible_1b7zm {
48
49
  visibility: visible;
49
50
  transform: translate(0, 0);
50
- } .notification__notificationComponent_1ln9d.notification__isClosing_1ln9d {
51
+ } .notification__notificationComponent_1b7zm.notification__isClosing_1b7zm {
51
52
  transition: transform 0.1s ease-out;
52
53
  transform: translate(100vw, 0)
53
- } @media screen and (min-width: 600px) { .notification__notificationComponent_1ln9d.notification__isClosing_1ln9d {
54
+ } @media screen and (min-width: 600px) { .notification__notificationComponent_1b7zm.notification__isClosing_1b7zm {
54
55
  transform: translate(calc(100% + var(--gap-48)), 0)
55
56
  }
56
- } .notification__notificationComponent_1ln9d.notification__notificationComponent_1ln9d {
57
+ } .notification__notificationComponent_1b7zm.notification__notificationComponent_1b7zm {
57
58
  position: fixed;
58
- } @media screen and (min-width: 600px) { .notification__toastContent_1ln9d {
59
+ } @media screen and (min-width: 600px) { .notification__toastContent_1b7zm {
59
60
  width: var(--notification-desktop-content-width)
60
61
  }
61
- } .notification__actionSection_1ln9d {
62
+ } .notification__actionSection_1b7zm {
62
63
  min-width: 104px;
63
64
  min-height: 48px;
64
- padding: 0 var(--gap-8);
65
- margin: var(--gap-12-neg) 0;
65
+ padding: var(--gap-0) var(--gap-8);
66
+ margin: var(--gap-12-neg) var(--gap-0);
66
67
  }
@@ -9,7 +9,7 @@ import { ToastPlateDesktop } from '@alfalab/core-components-toast-plate/modern/d
9
9
  import { stackingOrder } from '@alfalab/stack-context';
10
10
  import { useClickOutside } from './utils/index.js';
11
11
 
12
- const styles = {"notificationComponent":"notification__notificationComponent_1ln9d","isVisible":"notification__isVisible_1ln9d","isClosing":"notification__isClosing_1ln9d","toastContent":"notification__toastContent_1ln9d","actionSection":"notification__actionSection_1ln9d"};
12
+ const styles = {"notificationComponent":"notification__notificationComponent_1b7zm","isVisible":"notification__isVisible_1b7zm","isClosing":"notification__isClosing_1b7zm","toastContent":"notification__toastContent_1b7zm","actionSection":"notification__actionSection_1b7zm"};
13
13
  require('./index.css')
14
14
 
15
15
  const notificationClassNameSelector = `.${styles.notificationComponent}`;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Возвращает true, если значение равно null или undefined
3
+ */
4
+ declare function isNil<T>(value: T): value is T & (null | undefined);
5
+ /**
6
+ * Выбор значения между min max границами
7
+ */
8
+ declare function clamp<T extends Date | number>(value: T, min: T, max: T): T;
9
+ declare function noop(): void;
10
+ declare const fnUtils: {
11
+ clamp: typeof clamp;
12
+ noop: typeof noop;
13
+ isNil: typeof isNil;
14
+ };
15
+ export { fnUtils };
package/modern/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: b6ln3 */
1
+ /* hash: 2j8g1 */
2
2
  :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
3
3
  } /* deprecated */ :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
4
4
  } :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
@@ -21,6 +21,7 @@
21
21
  --gap-s-neg: -12px; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
22
22
 
23
23
  /* новые значения, используйте их */
24
+ --gap-0: 0;
24
25
  --gap-8: var(--gap-xs);
25
26
  --gap-12: var(--gap-s);
26
27
  --gap-24: var(--gap-xl);
@@ -30,7 +31,7 @@
30
31
  } :root {
31
32
  } :root {
32
33
  --notification-desktop-content-width: 278px;
33
- } .notification__notificationComponent_1ln9d {
34
+ } .notification__notificationComponent_1b7zm {
34
35
  visibility: hidden;
35
36
  right: var(--gap-12);
36
37
  transform: translate(0, -500px);
@@ -39,28 +40,28 @@
39
40
  -webkit-user-select: none;
40
41
  user-select: none;
41
42
  transition: transform 0.4s ease-out
42
- } @media screen and (min-width: 600px) { .notification__notificationComponent_1ln9d {
43
+ } @media screen and (min-width: 600px) { .notification__notificationComponent_1b7zm {
43
44
  right: var(--gap-48);
44
45
  width: auto;
45
46
  transform: translate(calc(100% + var(--gap-48)), 0)
46
47
  }
47
- } .notification__notificationComponent_1ln9d.notification__isVisible_1ln9d {
48
+ } .notification__notificationComponent_1b7zm.notification__isVisible_1b7zm {
48
49
  visibility: visible;
49
50
  transform: translate(0, 0);
50
- } .notification__notificationComponent_1ln9d.notification__isClosing_1ln9d {
51
+ } .notification__notificationComponent_1b7zm.notification__isClosing_1b7zm {
51
52
  transition: transform 0.1s ease-out;
52
53
  transform: translate(100vw, 0)
53
- } @media screen and (min-width: 600px) { .notification__notificationComponent_1ln9d.notification__isClosing_1ln9d {
54
+ } @media screen and (min-width: 600px) { .notification__notificationComponent_1b7zm.notification__isClosing_1b7zm {
54
55
  transform: translate(calc(100% + var(--gap-48)), 0)
55
56
  }
56
- } .notification__notificationComponent_1ln9d.notification__notificationComponent_1ln9d {
57
+ } .notification__notificationComponent_1b7zm.notification__notificationComponent_1b7zm {
57
58
  position: fixed;
58
- } @media screen and (min-width: 600px) { .notification__toastContent_1ln9d {
59
+ } @media screen and (min-width: 600px) { .notification__toastContent_1b7zm {
59
60
  width: var(--notification-desktop-content-width)
60
61
  }
61
- } .notification__actionSection_1ln9d {
62
+ } .notification__actionSection_1b7zm {
62
63
  min-width: 104px;
63
64
  min-height: 48px;
64
- padding: 0 var(--gap-8);
65
- margin: var(--gap-12-neg) 0;
65
+ padding: var(--gap-0) var(--gap-8);
66
+ margin: var(--gap-12-neg) var(--gap-0);
66
67
  }
@@ -0,0 +1 @@
1
+ export { getNotificationTestIds } from "../utils/getNotificationTestIds";
@@ -0,0 +1 @@
1
+ export { getNotificationTestIds } from '../utils/getNotificationTestIds.js';
@@ -0,0 +1,3 @@
1
+ import { RefObject } from 'react';
2
+ declare const useIsMounted: () => [isMountedRef: RefObject<boolean>, runIfMounted: (callback: () => void) => void];
3
+ export { useIsMounted };
@@ -0,0 +1,89 @@
1
+ /// <reference types="react" />
2
+ import React from 'react';
3
+ import { MouseEvent } from "react";
4
+ import { ToastPlateDesktopProps } from "@alfalab/core-components-toast-plate/desktop";
5
+ type NotificationProps = ToastPlateDesktopProps & {
6
+ /**
7
+ * Управление видимостью компонента
8
+ */
9
+ visible?: boolean;
10
+ /**
11
+ * Отступ от верхнего края
12
+ */
13
+ offset?: number;
14
+ /**
15
+ * Время до закрытия компонента
16
+ */
17
+ autoCloseDelay?: number | null;
18
+ /**
19
+ * Использовать портал
20
+ */
21
+ usePortal?: boolean;
22
+ /**
23
+ * z-index компонента
24
+ */
25
+ zIndex?: number;
26
+ /**
27
+ * Позиционирование компонента от верхнего или нижнего края экрана
28
+ */
29
+ position?: 'top' | 'bottom';
30
+ /**
31
+ * Обработчик события истечения времени до закрытия компонента
32
+ */
33
+ onCloseTimeout?: () => void;
34
+ /**
35
+ * Обработчик события наведения курсора на компонент
36
+ */
37
+ onMouseEnter?: (event?: MouseEvent<HTMLDivElement>) => void;
38
+ /**
39
+ * Обработчик события снятия курсора с компонента
40
+ */
41
+ onMouseLeave?: (event?: MouseEvent<HTMLDivElement>) => void;
42
+ /**
43
+ * Обработчик клика вне компонента
44
+ */
45
+ onClickOutside?: (event?: MouseEvent<any>) => void;
46
+ };
47
+ declare const Notification: React.ForwardRefExoticComponent<ToastPlateDesktopProps & {
48
+ /**
49
+ * Управление видимостью компонента
50
+ */
51
+ visible?: boolean | undefined;
52
+ /**
53
+ * Отступ от верхнего края
54
+ */
55
+ offset?: number | undefined;
56
+ /**
57
+ * Время до закрытия компонента
58
+ */
59
+ autoCloseDelay?: number | null | undefined;
60
+ /**
61
+ * Использовать портал
62
+ */
63
+ usePortal?: boolean | undefined;
64
+ /**
65
+ * z-index компонента
66
+ */
67
+ zIndex?: number | undefined;
68
+ /**
69
+ * Позиционирование компонента от верхнего или нижнего края экрана
70
+ */
71
+ position?: "top" | "bottom" | undefined;
72
+ /**
73
+ * Обработчик события истечения времени до закрытия компонента
74
+ */
75
+ onCloseTimeout?: (() => void) | undefined;
76
+ /**
77
+ * Обработчик события наведения курсора на компонент
78
+ */
79
+ onMouseEnter?: ((event?: MouseEvent<HTMLDivElement>) => void) | undefined;
80
+ /**
81
+ * Обработчик события снятия курсора с компонента
82
+ */
83
+ onMouseLeave?: ((event?: MouseEvent<HTMLDivElement>) => void) | undefined;
84
+ /**
85
+ * Обработчик клика вне компонента
86
+ */
87
+ onClickOutside?: ((event?: MouseEvent<any>) => void) | undefined;
88
+ } & React.RefAttributes<HTMLDivElement>>;
89
+ export { NotificationProps, Notification };
@@ -0,0 +1,95 @@
1
+ import React, { forwardRef, useRef, useState, useCallback, useEffect, Fragment } from 'react';
2
+ import mergeRefs from 'react-merge-refs';
3
+ import { useSwipeable } from 'react-swipeable';
4
+ import cn from 'classnames';
5
+ import elementClosest from 'element-closest';
6
+ import { Portal } from '@alfalab/core-components-portal/moderncssm';
7
+ import { Stack } from '@alfalab/core-components-stack/moderncssm';
8
+ import { ToastPlateDesktop } from '@alfalab/core-components-toast-plate/moderncssm/desktop';
9
+ import { stackingOrder } from '@alfalab/stack-context';
10
+ import { useClickOutside } from './utils/index.js';
11
+ import styles from './index.module.css';
12
+
13
+ const notificationClassNameSelector = `.${styles.notificationComponent}`;
14
+ const Notification = forwardRef(({ className, actionSectionClassName, children, visible, offset = 108, hasCloser = true, autoCloseDelay = 5000, usePortal = true, zIndex = stackingOrder.TOAST, style, position = 'top', onClose, onCloseTimeout, onMouseEnter, onMouseLeave, onClickOutside, ...restProps }, ref) => {
15
+ const notificationRef = useRef(null);
16
+ const autoCloseTimeoutRef = useRef(0);
17
+ const closeTimeoutRef = useRef(0);
18
+ const [isClosing, setIsClosing] = useState(false);
19
+ const startAutoCloseTimer = useCallback(() => {
20
+ if (autoCloseDelay !== null) {
21
+ autoCloseTimeoutRef.current = window.setTimeout(() => {
22
+ if (onCloseTimeout) {
23
+ onCloseTimeout();
24
+ }
25
+ }, autoCloseDelay);
26
+ }
27
+ }, [autoCloseDelay, onCloseTimeout]);
28
+ const stopAutoCloseTimer = useCallback(() => {
29
+ clearTimeout(autoCloseTimeoutRef.current);
30
+ }, []);
31
+ useEffect(() => () => {
32
+ clearTimeout(closeTimeoutRef.current);
33
+ }, []);
34
+ useEffect(() => {
35
+ elementClosest(window);
36
+ }, []);
37
+ useEffect(() => {
38
+ if (visible) {
39
+ startAutoCloseTimer();
40
+ }
41
+ return () => {
42
+ stopAutoCloseTimer();
43
+ };
44
+ }, [startAutoCloseTimer, stopAutoCloseTimer, visible]);
45
+ const handleMouseEnter = useCallback((event) => {
46
+ stopAutoCloseTimer();
47
+ if (onMouseEnter) {
48
+ onMouseEnter(event);
49
+ }
50
+ }, [onMouseEnter, stopAutoCloseTimer]);
51
+ const handleMouseLeave = useCallback((event) => {
52
+ stopAutoCloseTimer();
53
+ startAutoCloseTimer();
54
+ if (onMouseLeave) {
55
+ onMouseLeave(event);
56
+ }
57
+ }, [onMouseLeave, startAutoCloseTimer, stopAutoCloseTimer]);
58
+ const handleOutsideClick = useCallback((event) => {
59
+ const isTargetNotification = !!event.target.closest(notificationClassNameSelector);
60
+ /*
61
+ * проверка isTargetNotification нужна для предотвращения срабатывания handleOutsideClick
62
+ * при клике на другие нотификации, если их несколько на странице
63
+ */
64
+ if (onClickOutside && visible && !isTargetNotification) {
65
+ onClickOutside(event);
66
+ }
67
+ }, [onClickOutside, visible]);
68
+ useClickOutside(notificationRef, handleOutsideClick);
69
+ const swipeableHandlers = useSwipeable({
70
+ onSwiped: ({ dir }) => {
71
+ if (onClose && ['Left', 'Right', 'Up'].includes(dir)) {
72
+ setIsClosing(true);
73
+ closeTimeoutRef.current = window.setTimeout(() => {
74
+ setIsClosing(false);
75
+ onClose();
76
+ }, 100);
77
+ }
78
+ },
79
+ delta: 100,
80
+ });
81
+ const Wrapper = usePortal ? Portal : Fragment;
82
+ return (React.createElement(Stack, { value: zIndex }, (computedZIndex) => (React.createElement(Wrapper, null,
83
+ React.createElement("div", { ...swipeableHandlers },
84
+ React.createElement(ToastPlateDesktop, { className: cn(styles.notificationComponent, {
85
+ [styles.isVisible]: visible,
86
+ [styles.isClosing]: isClosing,
87
+ }, className), contentClassName: styles.toastContent, actionSectionClassName: cn(actionSectionClassName, styles.actionSection), style: {
88
+ [position]: offset,
89
+ zIndex: computedZIndex,
90
+ ...style,
91
+ }, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, ref: mergeRefs([ref, notificationRef]), role: visible ? 'alert' : undefined, hasCloser: hasCloser, onClose: onClose, ...restProps }, children))))));
92
+ });
93
+ Notification.displayName = 'Notification';
94
+
95
+ export { Notification };
@@ -0,0 +1,6 @@
1
+ declare function isWebkitBased(): boolean;
2
+ declare const browser: {
3
+ getScrollbarSize: () => number;
4
+ isWebkitBased: typeof isWebkitBased;
5
+ };
6
+ export { browser };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Возвращает true, если значение равно null или undefined
3
+ */
4
+ declare function isNil<T>(value: T): value is T & (null | undefined);
5
+ /**
6
+ * Выбор значения между min max границами
7
+ */
8
+ declare function clamp<T extends Date | number>(value: T, min: T, max: T): T;
9
+ declare function noop(): void;
10
+ declare const fnUtils: {
11
+ clamp: typeof clamp;
12
+ noop: typeof noop;
13
+ isNil: typeof isNil;
14
+ };
15
+ export { fnUtils };
@@ -0,0 +1 @@
1
+ export * from "./Component";
@@ -0,0 +1 @@
1
+ export { Notification } from './Component.js';
@@ -0,0 +1,60 @@
1
+ /* */
2
+
3
+ :root {
4
+ --notification-desktop-content-width: 278px;
5
+ }
6
+
7
+ .notificationComponent {
8
+ visibility: hidden;
9
+ right: var(--gap-12);
10
+ transform: translate(0, -500px);
11
+ width: calc(100% - var(--gap-24));
12
+ max-width: calc(100vw - var(--gap-24));
13
+ -webkit-user-select: none;
14
+ user-select: none;
15
+ transition: transform 0.4s ease-out
16
+ }
17
+
18
+ @media screen and (min-width: 600px) {
19
+
20
+ .notificationComponent {
21
+ right: var(--gap-48);
22
+ width: auto;
23
+ transform: translate(calc(100% + var(--gap-48)), 0)
24
+ }
25
+ }
26
+
27
+ .notificationComponent.isVisible {
28
+ visibility: visible;
29
+ transform: translate(0, 0);
30
+ }
31
+
32
+ .notificationComponent.isClosing {
33
+ transition: transform 0.1s ease-out;
34
+ transform: translate(100vw, 0)
35
+ }
36
+
37
+ @media screen and (min-width: 600px) {
38
+
39
+ .notificationComponent.isClosing {
40
+ transform: translate(calc(100% + var(--gap-48)), 0)
41
+ }
42
+ }
43
+
44
+ .notificationComponent.notificationComponent {
45
+ position: fixed;
46
+ }
47
+
48
+ @media screen and (min-width: 600px) {
49
+
50
+ .toastContent {
51
+ width: var(--notification-desktop-content-width)
52
+ }
53
+ }
54
+
55
+ .actionSection {
56
+ min-width: 104px;
57
+ min-height: 48px;
58
+ padding: var(--gap-0) var(--gap-8);
59
+ margin: var(--gap-12-neg) var(--gap-0);
60
+ }
@@ -0,0 +1 @@
1
+ export { getNotificationTestIds } from "../utils/getNotificationTestIds";
@@ -0,0 +1 @@
1
+ export { getNotificationTestIds } from '../utils/getNotificationTestIds.js';
@@ -0,0 +1,2 @@
1
+ declare function useCustomWebkitScrollbar(): boolean;
2
+ export { useCustomWebkitScrollbar };
@@ -0,0 +1,3 @@
1
+ import { RefObject } from 'react';
2
+ declare const useIsMounted: () => [isMountedRef: RefObject<boolean>, runIfMounted: (callback: () => void) => void];
3
+ export { useIsMounted };
@@ -0,0 +1,5 @@
1
+ declare function getNotificationTestIds(dataTestId: string): {
2
+ badge: string;
3
+ component: string;
4
+ };
5
+ export { getNotificationTestIds };
@@ -0,0 +1,18 @@
1
+ import { createContext } from 'react';
2
+ import '@alfalab/hooks';
3
+
4
+ function getDataTestId(dataTestId, element) {
5
+ const elementPart = element ? `-${element.toLowerCase()}` : '';
6
+ return dataTestId ? `${dataTestId}${elementPart}` : undefined;
7
+ }
8
+
9
+ createContext(() => null);
10
+
11
+ function getNotificationTestIds(dataTestId) {
12
+ return {
13
+ badge: getDataTestId(dataTestId, 'badge'),
14
+ component: getDataTestId(dataTestId, 'component'),
15
+ };
16
+ }
17
+
18
+ export { getNotificationTestIds };
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import React from 'react';
3
+ declare function useClickOutside(ref: React.RefObject<HTMLElement>, cb: (e: React.MouseEvent | React.TouchEvent) => void): void;
4
+ export { useClickOutside };
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+
3
+ /*
4
+ * Дублирую хук из @alfalab/hooks, так как не подходят названия событий
5
+ * https://github.com/core-ds/utils/blob/develop/packages/hooks/src/useClickOutside/hook.ts
6
+ * issue завел, когда изменения будут реализованы, отсюда можно будет удалить
7
+ * https://github.com/core-ds/utils/issues/35
8
+ */
9
+ function useClickOutside(ref, cb) {
10
+ React.useEffect(() => {
11
+ // eslint-disable-next-line
12
+ const handler = (event) => {
13
+ if (!ref.current || ref.current.contains(event.target)) {
14
+ return;
15
+ }
16
+ cb(event);
17
+ };
18
+ document.addEventListener('click', handler);
19
+ document.addEventListener('touchend', handler);
20
+ return () => {
21
+ document.removeEventListener('click', handler);
22
+ document.removeEventListener('touchend', handler);
23
+ };
24
+ }, [ref, cb]);
25
+ }
26
+
27
+ export { useClickOutside };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfalab/core-components-notification",
3
- "version": "7.1.4",
3
+ "version": "7.3.0",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -14,15 +14,15 @@
14
14
  "react": "^16.9.0 || ^17.0.1 || ^18.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@alfalab/core-components-portal": "^3.3.1",
17
+ "@alfalab/core-components-portal": "^3.3.2",
18
18
  "@alfalab/core-components-stack": "^5.0.0",
19
- "@alfalab/core-components-toast-plate": "^7.1.3",
19
+ "@alfalab/core-components-toast-plate": "^7.2.1",
20
20
  "classnames": "^2.3.1",
21
21
  "element-closest": "^3.0.2",
22
22
  "react-merge-refs": "^1.1.0",
23
23
  "react-swipeable": "^7.0.0",
24
24
  "tslib": "^2.4.0"
25
25
  },
26
- "themesVersion": "13.0.2",
27
- "varsVersion": "9.11.1"
26
+ "themesVersion": "13.2.0",
27
+ "varsVersion": "9.13.0"
28
28
  }
@@ -0,0 +1 @@
1
+ export { getNotificationTestIds } from "../utils/getNotificationTestIds";
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var utils_getNotificationTestIds = require('../utils/getNotificationTestIds.js');
6
+
7
+
8
+
9
+ exports.getNotificationTestIds = utils_getNotificationTestIds.getNotificationTestIds;
@@ -0,0 +1,3 @@
1
+ {
2
+ "module": "../esm/shared/index.js"
3
+ }
@@ -1,4 +1,4 @@
1
- @import '@alfalab/core-components-themes/src/default.css';
1
+ @import '@alfalab/core-components-vars/src/index.css';
2
2
 
3
3
  :root {
4
4
  --notification-desktop-content-width: 278px;
@@ -47,6 +47,6 @@
47
47
  .actionSection {
48
48
  min-width: 104px;
49
49
  min-height: 48px;
50
- padding: 0 var(--gap-8);
51
- margin: var(--gap-12-neg) 0;
50
+ padding: var(--gap-0) var(--gap-8);
51
+ margin: var(--gap-12-neg) var(--gap-0);
52
52
  }
@@ -0,0 +1 @@
1
+ export { getNotificationTestIds } from '../utils/getNotificationTestIds';
@@ -0,0 +1,3 @@
1
+ {
2
+ "module": "../esm/shared/index.js"
3
+ }
@@ -0,0 +1,3 @@
1
+ import { RefObject } from 'react';
2
+ declare const useIsMounted: () => [isMountedRef: RefObject<boolean>, runIfMounted: (callback: () => void) => void];
3
+ export { useIsMounted };