@alfalab/core-components-notification 5.3.1 → 5.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,36 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [5.4.0](https://github.com/core-ds/core-components/compare/@alfalab/core-components-notification@5.3.3...@alfalab/core-components-notification@5.4.0) (2022-08-04)
7
+
8
+
9
+ ### Features
10
+
11
+ * react 18 support ([#159](https://github.com/core-ds/core-components/issues/159)) ([2e6693c](https://github.com/core-ds/core-components/commit/2e6693c62f534e333aadb7d3fff4ffd78ac84c63))
12
+
13
+
14
+
15
+
16
+
17
+ ## [5.3.3](https://github.com/core-ds/core-components/compare/@alfalab/core-components-notification@5.3.2...@alfalab/core-components-notification@5.3.3) (2022-07-18)
18
+
19
+ **Note:** Version bump only for package @alfalab/core-components-notification
20
+
21
+
22
+
23
+
24
+
25
+ ## [5.3.2](https://github.com/core-ds/core-components/compare/@alfalab/core-components-notification@5.3.1...@alfalab/core-components-notification@5.3.2) (2022-07-15)
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * bump packages version ([#153](https://github.com/core-ds/core-components/issues/153)) ([fd3e082](https://github.com/core-ds/core-components/commit/fd3e08205672129cdce04e1000c673f2cd9c10da))
31
+
32
+
33
+
34
+
35
+
6
36
  ## [5.3.1](https://github.com/core-ds/core-components/compare/@alfalab/core-components-notification@5.3.0...@alfalab/core-components-notification@5.3.1) (2022-07-14)
7
37
 
8
38
  **Note:** Version bump only for package @alfalab/core-components-notification
@@ -557,6 +587,7 @@ remove z-index, add stack component
557
587
  * Betters toasts (#521) ([628b032](https://github.com/core-ds/core-components/commit/628b032f00dc36a71563f62238bd3f559968f320)), closes [#521](https://github.com/core-ds/core-components/issues/521)
558
588
 
559
589
 
590
+
560
591
  ### BREAKING CHANGES
561
592
 
562
593
  * --notification-desktop-width var removed
package/Component.js CHANGED
@@ -58,7 +58,7 @@ function __rest(s, e) {
58
58
  return t;
59
59
  }
60
60
 
61
- var styles = {"notificationComponent":"notification__notificationComponent_1vzkb","isVisible":"notification__isVisible_1vzkb","isClosing":"notification__isClosing_1vzkb","toastContent":"notification__toastContent_1vzkb","actionSection":"notification__actionSection_1vzkb"};
61
+ var styles = {"notificationComponent":"notification__notificationComponent_10axs","isVisible":"notification__isVisible_10axs","isClosing":"notification__isClosing_10axs","toastContent":"notification__toastContent_10axs","actionSection":"notification__actionSection_10axs"};
62
62
  require('./index.css')
63
63
 
64
64
  var notificationClassNameSelector = "." + styles.notificationComponent;
@@ -110,8 +110,8 @@ var Notification = React.forwardRef(function (_a, ref) {
110
110
  var handleOutsideClick = React.useCallback(function (event) {
111
111
  var isTargetNotification = !!event.target.closest(notificationClassNameSelector);
112
112
  /*
113
- * проверка isTargetNotification нужна для предотвращения срабатывания handleOutsideClick
114
- * при клике на другие нотификации, если их несколько на странице
113
+ * проверка isTargetNotification нужна для предотвращения срабатывания handleOutsideClick
114
+ * при клике на другие нотификации, если их несколько на странице
115
115
  */
116
116
  if (onClickOutside && visible && !isTargetNotification) {
117
117
  onClickOutside(event);
package/cssm/Component.js CHANGED
@@ -7,9 +7,9 @@ var cn = require('classnames');
7
7
  var mergeRefs = require('react-merge-refs');
8
8
  var reactSwipeable = require('react-swipeable');
9
9
  var elementClosest = require('element-closest');
10
- var coreComponentsPortal = require('@alfalab/core-components-portal/dist/cssm');
11
- var coreComponentsToastPlate = require('@alfalab/core-components-toast-plate/dist/cssm');
12
- var coreComponentsStack = require('@alfalab/core-components-stack/dist/cssm');
10
+ var coreComponentsPortal = require('@alfalab/core-components-portal/cssm');
11
+ var coreComponentsToastPlate = require('@alfalab/core-components-toast-plate/cssm');
12
+ var coreComponentsStack = require('@alfalab/core-components-stack/cssm');
13
13
  var utils_index = require('./utils/index.js');
14
14
  var styles = require('./index.module.css');
15
15
 
@@ -109,8 +109,8 @@ var Notification = React.forwardRef(function (_a, ref) {
109
109
  var handleOutsideClick = React.useCallback(function (event) {
110
110
  var isTargetNotification = !!event.target.closest(notificationClassNameSelector);
111
111
  /*
112
- * проверка isTargetNotification нужна для предотвращения срабатывания handleOutsideClick
113
- * при клике на другие нотификации, если их несколько на странице
112
+ * проверка isTargetNotification нужна для предотвращения срабатывания handleOutsideClick
113
+ * при клике на другие нотификации, если их несколько на странице
114
114
  */
115
115
  if (onClickOutside && visible && !isTargetNotification) {
116
116
  onClickOutside(event);
package/cssm/index.js CHANGED
@@ -8,9 +8,9 @@ require('classnames');
8
8
  require('react-merge-refs');
9
9
  require('react-swipeable');
10
10
  require('element-closest');
11
- require('@alfalab/core-components-portal/dist/cssm');
12
- require('@alfalab/core-components-toast-plate/dist/cssm');
13
- require('@alfalab/core-components-stack/dist/cssm');
11
+ require('@alfalab/core-components-portal/cssm');
12
+ require('@alfalab/core-components-toast-plate/cssm');
13
+ require('@alfalab/core-components-stack/cssm');
14
14
  require('./utils/index.js');
15
15
  require('./index.module.css');
16
16
 
package/esm/Component.js CHANGED
@@ -3,9 +3,9 @@ import cn from 'classnames';
3
3
  import mergeRefs from 'react-merge-refs';
4
4
  import { useSwipeable } from 'react-swipeable';
5
5
  import elementClosest from 'element-closest';
6
- import { Portal } from '@alfalab/core-components-portal/dist/esm';
7
- import { ToastPlate } from '@alfalab/core-components-toast-plate/dist/esm';
8
- import { stackingOrder, Stack } from '@alfalab/core-components-stack/dist/esm';
6
+ import { Portal } from '@alfalab/core-components-portal/esm';
7
+ import { ToastPlate } from '@alfalab/core-components-toast-plate/esm';
8
+ import { stackingOrder, Stack } from '@alfalab/core-components-stack/esm';
9
9
  import { useClickOutside } from './utils/index.js';
10
10
 
11
11
  /*! *****************************************************************************
@@ -47,7 +47,7 @@ function __rest(s, e) {
47
47
  return t;
48
48
  }
49
49
 
50
- var styles = {"notificationComponent":"notification__notificationComponent_1vzkb","isVisible":"notification__isVisible_1vzkb","isClosing":"notification__isClosing_1vzkb","toastContent":"notification__toastContent_1vzkb","actionSection":"notification__actionSection_1vzkb"};
50
+ var styles = {"notificationComponent":"notification__notificationComponent_10axs","isVisible":"notification__isVisible_10axs","isClosing":"notification__isClosing_10axs","toastContent":"notification__toastContent_10axs","actionSection":"notification__actionSection_10axs"};
51
51
  require('./index.css')
52
52
 
53
53
  var notificationClassNameSelector = "." + styles.notificationComponent;
@@ -99,8 +99,8 @@ var Notification = forwardRef(function (_a, ref) {
99
99
  var handleOutsideClick = useCallback(function (event) {
100
100
  var isTargetNotification = !!event.target.closest(notificationClassNameSelector);
101
101
  /*
102
- * проверка isTargetNotification нужна для предотвращения срабатывания handleOutsideClick
103
- * при клике на другие нотификации, если их несколько на странице
102
+ * проверка isTargetNotification нужна для предотвращения срабатывания handleOutsideClick
103
+ * при клике на другие нотификации, если их несколько на странице
104
104
  */
105
105
  if (onClickOutside && visible && !isTargetNotification) {
106
106
  onClickOutside(event);
package/esm/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 50ldb */
1
+ /* hash: 1e3rs */
2
2
  :root {
3
3
 
4
4
  /* Hard */
@@ -17,7 +17,7 @@
17
17
  :root {
18
18
  --notification-desktop-content-width: 278px;
19
19
  }
20
- .notification__notificationComponent_1vzkb {
20
+ .notification__notificationComponent_10axs {
21
21
  visibility: hidden;
22
22
  position: fixed;
23
23
  right: var(--gap-s);
@@ -30,31 +30,31 @@
30
30
  transition: transform 0.4s ease-out
31
31
  }
32
32
  @media screen and (min-width: 600px) {
33
- .notification__notificationComponent_1vzkb {
33
+ .notification__notificationComponent_10axs {
34
34
  right: var(--gap-4xl);
35
35
  width: auto;
36
36
  transform: translate(calc(100% + var(--gap-4xl)), 0)
37
37
  }
38
38
  }
39
- .notification__notificationComponent_1vzkb.notification__isVisible_1vzkb {
39
+ .notification__notificationComponent_10axs.notification__isVisible_10axs {
40
40
  visibility: visible;
41
41
  transform: translate(0, 0);
42
42
  }
43
- .notification__notificationComponent_1vzkb.notification__isClosing_1vzkb {
43
+ .notification__notificationComponent_10axs.notification__isClosing_10axs {
44
44
  transition: transform 0.1s ease-out;
45
45
  transform: translate(100vw, 0)
46
46
  }
47
47
  @media screen and (min-width: 600px) {
48
- .notification__notificationComponent_1vzkb.notification__isClosing_1vzkb {
48
+ .notification__notificationComponent_10axs.notification__isClosing_10axs {
49
49
  transform: translate(calc(100% + var(--gap-4xl)), 0)
50
50
  }
51
51
  }
52
52
  @media screen and (min-width: 600px) {
53
- .notification__toastContent_1vzkb {
53
+ .notification__toastContent_10axs {
54
54
  width: var(--notification-desktop-content-width)
55
55
  }
56
56
  }
57
- .notification__actionSection_1vzkb {
57
+ .notification__actionSection_10axs {
58
58
  min-width: 104px;
59
59
  min-height: 48px;
60
60
  padding: 0 var(--gap-xs);
package/esm/index.js CHANGED
@@ -4,7 +4,7 @@ import 'classnames';
4
4
  import 'react-merge-refs';
5
5
  import 'react-swipeable';
6
6
  import 'element-closest';
7
- import '@alfalab/core-components-portal/dist/esm';
8
- import '@alfalab/core-components-toast-plate/dist/esm';
9
- import '@alfalab/core-components-stack/dist/esm';
7
+ import '@alfalab/core-components-portal/esm';
8
+ import '@alfalab/core-components-toast-plate/esm';
9
+ import '@alfalab/core-components-stack/esm';
10
10
  import './utils/index.js';
package/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 50ldb */
1
+ /* hash: 1e3rs */
2
2
  :root {
3
3
 
4
4
  /* Hard */
@@ -17,7 +17,7 @@
17
17
  :root {
18
18
  --notification-desktop-content-width: 278px;
19
19
  }
20
- .notification__notificationComponent_1vzkb {
20
+ .notification__notificationComponent_10axs {
21
21
  visibility: hidden;
22
22
  position: fixed;
23
23
  right: var(--gap-s);
@@ -30,31 +30,31 @@
30
30
  transition: transform 0.4s ease-out
31
31
  }
32
32
  @media screen and (min-width: 600px) {
33
- .notification__notificationComponent_1vzkb {
33
+ .notification__notificationComponent_10axs {
34
34
  right: var(--gap-4xl);
35
35
  width: auto;
36
36
  transform: translate(calc(100% + var(--gap-4xl)), 0)
37
37
  }
38
38
  }
39
- .notification__notificationComponent_1vzkb.notification__isVisible_1vzkb {
39
+ .notification__notificationComponent_10axs.notification__isVisible_10axs {
40
40
  visibility: visible;
41
41
  transform: translate(0, 0);
42
42
  }
43
- .notification__notificationComponent_1vzkb.notification__isClosing_1vzkb {
43
+ .notification__notificationComponent_10axs.notification__isClosing_10axs {
44
44
  transition: transform 0.1s ease-out;
45
45
  transform: translate(100vw, 0)
46
46
  }
47
47
  @media screen and (min-width: 600px) {
48
- .notification__notificationComponent_1vzkb.notification__isClosing_1vzkb {
48
+ .notification__notificationComponent_10axs.notification__isClosing_10axs {
49
49
  transform: translate(calc(100% + var(--gap-4xl)), 0)
50
50
  }
51
51
  }
52
52
  @media screen and (min-width: 600px) {
53
- .notification__toastContent_1vzkb {
53
+ .notification__toastContent_10axs {
54
54
  width: var(--notification-desktop-content-width)
55
55
  }
56
56
  }
57
- .notification__actionSection_1vzkb {
57
+ .notification__actionSection_10axs {
58
58
  min-width: 104px;
59
59
  min-height: 48px;
60
60
  padding: 0 var(--gap-xs);
@@ -3,12 +3,12 @@ import cn from 'classnames';
3
3
  import mergeRefs from 'react-merge-refs';
4
4
  import { useSwipeable } from 'react-swipeable';
5
5
  import elementClosest from 'element-closest';
6
- import { Portal } from '@alfalab/core-components-portal/dist/modern';
7
- import { ToastPlate } from '@alfalab/core-components-toast-plate/dist/modern';
8
- import { stackingOrder, Stack } from '@alfalab/core-components-stack/dist/modern';
6
+ import { Portal } from '@alfalab/core-components-portal/modern';
7
+ import { ToastPlate } from '@alfalab/core-components-toast-plate/modern';
8
+ import { stackingOrder, Stack } from '@alfalab/core-components-stack/modern';
9
9
  import { useClickOutside } from './utils/index.js';
10
10
 
11
- var styles = {"notificationComponent":"notification__notificationComponent_1vzkb","isVisible":"notification__isVisible_1vzkb","isClosing":"notification__isClosing_1vzkb","toastContent":"notification__toastContent_1vzkb","actionSection":"notification__actionSection_1vzkb"};
11
+ var styles = {"notificationComponent":"notification__notificationComponent_10axs","isVisible":"notification__isVisible_10axs","isClosing":"notification__isClosing_10axs","toastContent":"notification__toastContent_10axs","actionSection":"notification__actionSection_10axs"};
12
12
  require('./index.css')
13
13
 
14
14
  const notificationClassNameSelector = `.${styles.notificationComponent}`;
@@ -43,24 +43,24 @@ const Notification = forwardRef(({ className, actionSectionClassName, children,
43
43
  stopAutoCloseTimer();
44
44
  };
45
45
  }, [startAutoCloseTimer, stopAutoCloseTimer, visible]);
46
- const handleMouseEnter = useCallback(event => {
46
+ const handleMouseEnter = useCallback((event) => {
47
47
  stopAutoCloseTimer();
48
48
  if (onMouseEnter) {
49
49
  onMouseEnter(event);
50
50
  }
51
51
  }, [onMouseEnter, stopAutoCloseTimer]);
52
- const handleMouseLeave = useCallback(event => {
52
+ const handleMouseLeave = useCallback((event) => {
53
53
  stopAutoCloseTimer();
54
54
  startAutoCloseTimer();
55
55
  if (onMouseLeave) {
56
56
  onMouseLeave(event);
57
57
  }
58
58
  }, [onMouseLeave, startAutoCloseTimer, stopAutoCloseTimer]);
59
- const handleOutsideClick = useCallback(event => {
59
+ const handleOutsideClick = useCallback((event) => {
60
60
  const isTargetNotification = !!event.target.closest(notificationClassNameSelector);
61
61
  /*
62
- * проверка isTargetNotification нужна для предотвращения срабатывания handleOutsideClick
63
- * при клике на другие нотификации, если их несколько на странице
62
+ * проверка isTargetNotification нужна для предотвращения срабатывания handleOutsideClick
63
+ * при клике на другие нотификации, если их несколько на странице
64
64
  */
65
65
  if (onClickOutside && visible && !isTargetNotification) {
66
66
  onClickOutside(event);
package/modern/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 50ldb */
1
+ /* hash: 1e3rs */
2
2
  :root {
3
3
 
4
4
  /* Hard */
@@ -17,7 +17,7 @@
17
17
  :root {
18
18
  --notification-desktop-content-width: 278px;
19
19
  }
20
- .notification__notificationComponent_1vzkb {
20
+ .notification__notificationComponent_10axs {
21
21
  visibility: hidden;
22
22
  position: fixed;
23
23
  right: var(--gap-s);
@@ -30,31 +30,31 @@
30
30
  transition: transform 0.4s ease-out
31
31
  }
32
32
  @media screen and (min-width: 600px) {
33
- .notification__notificationComponent_1vzkb {
33
+ .notification__notificationComponent_10axs {
34
34
  right: var(--gap-4xl);
35
35
  width: auto;
36
36
  transform: translate(calc(100% + var(--gap-4xl)), 0)
37
37
  }
38
38
  }
39
- .notification__notificationComponent_1vzkb.notification__isVisible_1vzkb {
39
+ .notification__notificationComponent_10axs.notification__isVisible_10axs {
40
40
  visibility: visible;
41
41
  transform: translate(0, 0);
42
42
  }
43
- .notification__notificationComponent_1vzkb.notification__isClosing_1vzkb {
43
+ .notification__notificationComponent_10axs.notification__isClosing_10axs {
44
44
  transition: transform 0.1s ease-out;
45
45
  transform: translate(100vw, 0)
46
46
  }
47
47
  @media screen and (min-width: 600px) {
48
- .notification__notificationComponent_1vzkb.notification__isClosing_1vzkb {
48
+ .notification__notificationComponent_10axs.notification__isClosing_10axs {
49
49
  transform: translate(calc(100% + var(--gap-4xl)), 0)
50
50
  }
51
51
  }
52
52
  @media screen and (min-width: 600px) {
53
- .notification__toastContent_1vzkb {
53
+ .notification__toastContent_10axs {
54
54
  width: var(--notification-desktop-content-width)
55
55
  }
56
56
  }
57
- .notification__actionSection_1vzkb {
57
+ .notification__actionSection_10axs {
58
58
  min-width: 104px;
59
59
  min-height: 48px;
60
60
  padding: 0 var(--gap-xs);
package/modern/index.js CHANGED
@@ -3,8 +3,8 @@ import 'classnames';
3
3
  import 'react-merge-refs';
4
4
  import 'react-swipeable';
5
5
  import 'element-closest';
6
- import '@alfalab/core-components-portal/dist/modern';
7
- import '@alfalab/core-components-toast-plate/dist/modern';
8
- import '@alfalab/core-components-stack/dist/modern';
6
+ import '@alfalab/core-components-portal/modern';
7
+ import '@alfalab/core-components-toast-plate/modern';
8
+ import '@alfalab/core-components-stack/modern';
9
9
  import './utils/index.js';
10
10
  export { Notification } from './Component.js';
package/package.json CHANGED
@@ -1,26 +1,26 @@
1
1
  {
2
2
  "name": "@alfalab/core-components-notification",
3
- "version": "5.3.1",
3
+ "version": "5.4.0",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
7
7
  "main": "index.js",
8
8
  "module": "./dist/modern/index.js",
9
9
  "scripts": {
10
- "postinstall": "node ./send-stats.js > /dev/null 2>&1 || exit 0"
10
+ "postinstall": "node -e \"if (require('fs').existsSync('./send-stats.js')){require('./send-stats.js')} \""
11
11
  },
12
12
  "publishConfig": {
13
13
  "access": "public",
14
14
  "directory": "dist"
15
15
  },
16
16
  "peerDependencies": {
17
- "react": "^16.9.0 || ^17.0.1"
17
+ "react": "^16.9.0 || ^17.0.1 || ^18.0.0"
18
18
  },
19
19
  "dependencies": {
20
- "@alfalab/core-components-portal": "^2.0.4",
21
- "@alfalab/core-components-stack": "^3.0.4",
22
- "@alfalab/core-components-toast-plate": "^4.3.1",
23
- "classnames": "^2.2.6",
20
+ "@alfalab/core-components-portal": "^2.1.0",
21
+ "@alfalab/core-components-stack": "^3.1.0",
22
+ "@alfalab/core-components-toast-plate": "^4.4.0",
23
+ "classnames": "^2.3.1",
24
24
  "element-closest": "^3.0.2",
25
25
  "react-merge-refs": "^1.1.0",
26
26
  "react-swipeable": "^5.5.1"