@semcore/notice-bubble 3.3.5 → 4.0.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
@@ -2,6 +2,24 @@
2
2
 
3
3
  CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
+ ## [4.0.0] - 2022-05-17
6
+
7
+ ### BREAK
8
+
9
+ - Updated styles according to the library redesign policy.
10
+
11
+ ## [3.3.7] - 2022-05-16
12
+
13
+ ### Changed
14
+
15
+ - Version patch update due to children dependencies update (`@semcore/icon` [2.21.0 ~> 2.24.0]).
16
+
17
+ ## [3.3.6] - 2022-04-28
18
+
19
+ ### Changed
20
+
21
+ - Version patch update due to children dependencies update (`@semcore/icon` [2.20.0 ~> 2.21.0]).
22
+
5
23
  ## [3.3.5] - 2022-04-03
6
24
 
7
25
  ### Changed
@@ -67,18 +67,18 @@ var style = (
67
67
  /*__reshadow_css_start__*/
68
68
  _core.sstyled.insert(
69
69
  /*__inner_css_start__*/
70
- ".___SInfo_1qnlw_gg_,.___SView_1qnlw_gg_,.___SWarning_1qnlw_gg_{position:relative;margin-bottom:12px;padding:12px 24px 12px 12px;width:100%;min-height:42px;border-radius:3px;overflow:hidden;box-sizing:border-box}.___SInfo_1qnlw_gg_{background:#333333}.___SWarning_1qnlw_gg_{background:#ff7f00}.___SMessage_1qnlw_gg_{font-size:12px;color:#fff;line-height:1.5}.___SDismiss_1qnlw_gg_{cursor:pointer;position:absolute;right:0;top:0;padding:8px;color:#757575}.___SDismiss_1qnlw_gg_:hover{color:#cccccc}.___SAction_1qnlw_gg_{margin-top:8px}.___SNoticeBubble_1qnlw_gg_{width:300px;position:fixed;z-index:1010;right:10px;top:10px}@media (max-width:767px){.___SNoticeBubble_1qnlw_gg_{width:calc(100% - 20px)}}"
70
+ ".___SInfo_a55f0_gg_,.___SView_a55f0_gg_,.___SWarning_a55f0_gg_{position:relative;margin-bottom:12px;padding:12px 28px 12px 12px;width:100%;min-height:44px;border-radius:6px;overflow:hidden;box-sizing:border-box}.___SInfo_a55f0_gg_{background:#191b23}.___SWarning_a55f0_gg_{background:#ff4953}.___SMessage_a55f0_gg_{font-size:14px;color:#fff;line-height:1.33}.___SDismiss_a55f0_gg_{cursor:pointer;position:absolute;right:0;top:0;padding:8px;color:#ffffff}.___SDismiss_a55f0_gg_:hover{color:#e0e1e9}.___SAction_a55f0_gg_{margin-top:8px}.___SNoticeBubble_a55f0_gg_{width:300px;position:fixed;z-index:1010;right:12px;top:12px}@media (max-width:767px){.___SNoticeBubble_a55f0_gg_{width:calc(100% - 24px)}}"
71
71
  /*__inner_css_end__*/
72
- , "1nxod8h_gg_")
72
+ , "l0oo1x_gg_")
73
73
  /*__reshadow_css_end__*/
74
74
  , {
75
- "__SInfo": "___SInfo_1qnlw_gg_",
76
- "__SView": "___SView_1qnlw_gg_",
77
- "__SWarning": "___SWarning_1qnlw_gg_",
78
- "__SMessage": "___SMessage_1qnlw_gg_",
79
- "__SDismiss": "___SDismiss_1qnlw_gg_",
80
- "__SAction": "___SAction_1qnlw_gg_",
81
- "__SNoticeBubble": "___SNoticeBubble_1qnlw_gg_"
75
+ "__SInfo": "___SInfo_a55f0_gg_",
76
+ "__SView": "___SView_a55f0_gg_",
77
+ "__SWarning": "___SWarning_a55f0_gg_",
78
+ "__SMessage": "___SMessage_a55f0_gg_",
79
+ "__SDismiss": "___SDismiss_a55f0_gg_",
80
+ "__SAction": "___SAction_a55f0_gg_",
81
+ "__SNoticeBubble": "___SNoticeBubble_a55f0_gg_"
82
82
  });
83
83
  var animationNotice = (
84
84
  /*__reshadow_css_start__*/
@@ -0,0 +1,83 @@
1
+ import { IPortalProps } from '@semcore/portal';
2
+ import { CProps, ReturnEl } from '@semcore/core';
3
+ import { IBoxProps } from '@semcore/flex-box';
4
+
5
+ export interface INoticeBubbleContainerProps extends IBoxProps, IPortalProps {
6
+ /** Manager copy */
7
+ manager?: INoticeBubbleManager;
8
+ }
9
+
10
+ export interface INoticeBubbleInfoProps extends INoticeBubbleProps {
11
+ readonly type?: 'info';
12
+ /** Notice display duration
13
+ * @default 5000
14
+ */
15
+ duration?: number;
16
+ }
17
+
18
+ export interface INoticeBubbleWarningProps extends INoticeBubbleProps {
19
+ readonly type?: 'warning';
20
+ /**
21
+ * Notice display duration
22
+ * @default 0
23
+ */
24
+ duration?: number;
25
+ }
26
+
27
+ export interface INoticeBubbleProps extends IBoxProps {
28
+ /**
29
+ * Manager instance
30
+ * @default NoticeBubbleManager()
31
+ */
32
+ manager?: INoticeBubbleManager;
33
+ /**
34
+ * Notice visibility
35
+ */
36
+ visible?: boolean;
37
+ /** Adds controls (buttons, etc.) */
38
+ action?: React.ReactNode;
39
+
40
+ /** Triggered when the notice is closed */
41
+ onClose?: (e?: React.SyntheticEvent) => void;
42
+ }
43
+
44
+ export interface INoticeBubbleManager {
45
+ /**
46
+ * Adding a notice.
47
+ * Takes the props properties of NoticeBubble.
48
+ * Returns an object with the uid and the update, remove functions.
49
+ * */
50
+ add: (
51
+ props: object,
52
+ ) => {
53
+ uid: string;
54
+ update: (props: object) => boolean;
55
+ remove: () => boolean;
56
+ };
57
+ /**
58
+ * Updates the notice by uid.
59
+ * Takes the uid-unique identifier and the props-properties of NoticeBubble.
60
+ * Returns a successful or unsuccessful update.
61
+ * */
62
+ update: (uid: string, props: object) => boolean;
63
+ /**
64
+ * Deletes the notice by uid.
65
+ * Takes an uid-unique identifier.
66
+ * Returns a successful or unsuccessful deletion.
67
+ * */
68
+ remove: (uid: string) => boolean;
69
+ }
70
+
71
+ declare const NoticeBubble: <T>(props: INoticeBubbleInfoProps & T) => ReturnEl;
72
+ declare const NoticeBubbleWarning: <T>(props: INoticeBubbleWarningProps & T) => ReturnEl;
73
+ declare const NoticeBubbleContainer: (<T>(
74
+ props: CProps<INoticeBubbleContainerProps & T>,
75
+ ) => ReturnEl) & {
76
+ Info: typeof NoticeBubble;
77
+ Warning: typeof NoticeBubbleWarning;
78
+ };
79
+
80
+ declare const manager: INoticeBubbleManager;
81
+
82
+ export { NoticeBubbleContainer, NoticeBubble, NoticeBubbleWarning };
83
+ export default manager;
@@ -5,24 +5,24 @@ SWarning,
5
5
  SView {
6
6
  position: relative;
7
7
  margin-bottom: 12px;
8
- padding: 12px 24px 12px 12px;
8
+ padding: 12px 28px 12px 12px;
9
9
  width: 100%;
10
- min-height: 42px;
11
- border-radius: 3px;
10
+ min-height: 44px;
11
+ border-radius: var(--rounded-m);
12
12
  overflow: hidden;
13
13
  box-sizing: border-box;
14
14
  }
15
15
 
16
16
  SInfo {
17
- background: var(--gray20);
17
+ background: var(--gray-800);
18
18
  }
19
19
 
20
20
  SWarning {
21
- background: var(--orange);
21
+ background: var(--red-400);
22
22
  }
23
23
 
24
24
  SMessage {
25
- font-size: var(--fs-100);
25
+ font-size: var(--fs-200);
26
26
  color: #fff;
27
27
  line-height: var(--lh-100);
28
28
  }
@@ -33,10 +33,10 @@ SDismiss {
33
33
  right: 0;
34
34
  top: 0;
35
35
  padding: 8px;
36
- color: var(--gray60);
36
+ color: var(--white);
37
37
 
38
38
  &:hover {
39
- color: var(--gray80);
39
+ color: var(--gray-100);
40
40
  }
41
41
  }
42
42
 
@@ -48,10 +48,10 @@ SNoticeBubble {
48
48
  width: 300px;
49
49
  position: fixed;
50
50
  z-index: 1010;
51
- right: 10px;
52
- top: 10px;
51
+ right: 12px;
52
+ top: 12px;
53
53
 
54
54
  @media (max-width: 767px) {
55
- width: calc(100% - 20px);
55
+ width: calc(100% - 24px);
56
56
  }
57
57
  }
@@ -36,18 +36,18 @@ var style = (
36
36
  /*__reshadow_css_start__*/
37
37
  _sstyled.insert(
38
38
  /*__inner_css_start__*/
39
- ".___SInfo_1qnlw_gg_,.___SView_1qnlw_gg_,.___SWarning_1qnlw_gg_{position:relative;margin-bottom:12px;padding:12px 24px 12px 12px;width:100%;min-height:42px;border-radius:3px;overflow:hidden;box-sizing:border-box}.___SInfo_1qnlw_gg_{background:#333333}.___SWarning_1qnlw_gg_{background:#ff7f00}.___SMessage_1qnlw_gg_{font-size:12px;color:#fff;line-height:1.5}.___SDismiss_1qnlw_gg_{cursor:pointer;position:absolute;right:0;top:0;padding:8px;color:#757575}.___SDismiss_1qnlw_gg_:hover{color:#cccccc}.___SAction_1qnlw_gg_{margin-top:8px}.___SNoticeBubble_1qnlw_gg_{width:300px;position:fixed;z-index:1010;right:10px;top:10px}@media (max-width:767px){.___SNoticeBubble_1qnlw_gg_{width:calc(100% - 20px)}}"
39
+ ".___SInfo_a55f0_gg_,.___SView_a55f0_gg_,.___SWarning_a55f0_gg_{position:relative;margin-bottom:12px;padding:12px 28px 12px 12px;width:100%;min-height:44px;border-radius:6px;overflow:hidden;box-sizing:border-box}.___SInfo_a55f0_gg_{background:#191b23}.___SWarning_a55f0_gg_{background:#ff4953}.___SMessage_a55f0_gg_{font-size:14px;color:#fff;line-height:1.33}.___SDismiss_a55f0_gg_{cursor:pointer;position:absolute;right:0;top:0;padding:8px;color:#ffffff}.___SDismiss_a55f0_gg_:hover{color:#e0e1e9}.___SAction_a55f0_gg_{margin-top:8px}.___SNoticeBubble_a55f0_gg_{width:300px;position:fixed;z-index:1010;right:12px;top:12px}@media (max-width:767px){.___SNoticeBubble_a55f0_gg_{width:calc(100% - 24px)}}"
40
40
  /*__inner_css_end__*/
41
- , "1nxod8h_gg_")
41
+ , "l0oo1x_gg_")
42
42
  /*__reshadow_css_end__*/
43
43
  , {
44
- "__SInfo": "___SInfo_1qnlw_gg_",
45
- "__SView": "___SView_1qnlw_gg_",
46
- "__SWarning": "___SWarning_1qnlw_gg_",
47
- "__SMessage": "___SMessage_1qnlw_gg_",
48
- "__SDismiss": "___SDismiss_1qnlw_gg_",
49
- "__SAction": "___SAction_1qnlw_gg_",
50
- "__SNoticeBubble": "___SNoticeBubble_1qnlw_gg_"
44
+ "__SInfo": "___SInfo_a55f0_gg_",
45
+ "__SView": "___SView_a55f0_gg_",
46
+ "__SWarning": "___SWarning_a55f0_gg_",
47
+ "__SMessage": "___SMessage_a55f0_gg_",
48
+ "__SDismiss": "___SDismiss_a55f0_gg_",
49
+ "__SAction": "___SAction_a55f0_gg_",
50
+ "__SNoticeBubble": "___SNoticeBubble_a55f0_gg_"
51
51
  });
52
52
  var animationNotice = (
53
53
  /*__reshadow_css_start__*/
@@ -0,0 +1,83 @@
1
+ import { IPortalProps } from '@semcore/portal';
2
+ import { CProps, ReturnEl } from '@semcore/core';
3
+ import { IBoxProps } from '@semcore/flex-box';
4
+
5
+ export interface INoticeBubbleContainerProps extends IBoxProps, IPortalProps {
6
+ /** Manager copy */
7
+ manager?: INoticeBubbleManager;
8
+ }
9
+
10
+ export interface INoticeBubbleInfoProps extends INoticeBubbleProps {
11
+ readonly type?: 'info';
12
+ /** Notice display duration
13
+ * @default 5000
14
+ */
15
+ duration?: number;
16
+ }
17
+
18
+ export interface INoticeBubbleWarningProps extends INoticeBubbleProps {
19
+ readonly type?: 'warning';
20
+ /**
21
+ * Notice display duration
22
+ * @default 0
23
+ */
24
+ duration?: number;
25
+ }
26
+
27
+ export interface INoticeBubbleProps extends IBoxProps {
28
+ /**
29
+ * Manager instance
30
+ * @default NoticeBubbleManager()
31
+ */
32
+ manager?: INoticeBubbleManager;
33
+ /**
34
+ * Notice visibility
35
+ */
36
+ visible?: boolean;
37
+ /** Adds controls (buttons, etc.) */
38
+ action?: React.ReactNode;
39
+
40
+ /** Triggered when the notice is closed */
41
+ onClose?: (e?: React.SyntheticEvent) => void;
42
+ }
43
+
44
+ export interface INoticeBubbleManager {
45
+ /**
46
+ * Adding a notice.
47
+ * Takes the props properties of NoticeBubble.
48
+ * Returns an object with the uid and the update, remove functions.
49
+ * */
50
+ add: (
51
+ props: object,
52
+ ) => {
53
+ uid: string;
54
+ update: (props: object) => boolean;
55
+ remove: () => boolean;
56
+ };
57
+ /**
58
+ * Updates the notice by uid.
59
+ * Takes the uid-unique identifier and the props-properties of NoticeBubble.
60
+ * Returns a successful or unsuccessful update.
61
+ * */
62
+ update: (uid: string, props: object) => boolean;
63
+ /**
64
+ * Deletes the notice by uid.
65
+ * Takes an uid-unique identifier.
66
+ * Returns a successful or unsuccessful deletion.
67
+ * */
68
+ remove: (uid: string) => boolean;
69
+ }
70
+
71
+ declare const NoticeBubble: <T>(props: INoticeBubbleInfoProps & T) => ReturnEl;
72
+ declare const NoticeBubbleWarning: <T>(props: INoticeBubbleWarningProps & T) => ReturnEl;
73
+ declare const NoticeBubbleContainer: (<T>(
74
+ props: CProps<INoticeBubbleContainerProps & T>,
75
+ ) => ReturnEl) & {
76
+ Info: typeof NoticeBubble;
77
+ Warning: typeof NoticeBubbleWarning;
78
+ };
79
+
80
+ declare const manager: INoticeBubbleManager;
81
+
82
+ export { NoticeBubbleContainer, NoticeBubble, NoticeBubbleWarning };
83
+ export default manager;
@@ -5,24 +5,24 @@ SWarning,
5
5
  SView {
6
6
  position: relative;
7
7
  margin-bottom: 12px;
8
- padding: 12px 24px 12px 12px;
8
+ padding: 12px 28px 12px 12px;
9
9
  width: 100%;
10
- min-height: 42px;
11
- border-radius: 3px;
10
+ min-height: 44px;
11
+ border-radius: var(--rounded-m);
12
12
  overflow: hidden;
13
13
  box-sizing: border-box;
14
14
  }
15
15
 
16
16
  SInfo {
17
- background: var(--gray20);
17
+ background: var(--gray-800);
18
18
  }
19
19
 
20
20
  SWarning {
21
- background: var(--orange);
21
+ background: var(--red-400);
22
22
  }
23
23
 
24
24
  SMessage {
25
- font-size: var(--fs-100);
25
+ font-size: var(--fs-200);
26
26
  color: #fff;
27
27
  line-height: var(--lh-100);
28
28
  }
@@ -33,10 +33,10 @@ SDismiss {
33
33
  right: 0;
34
34
  top: 0;
35
35
  padding: 8px;
36
- color: var(--gray60);
36
+ color: var(--white);
37
37
 
38
38
  &:hover {
39
- color: var(--gray80);
39
+ color: var(--gray-100);
40
40
  }
41
41
  }
42
42
 
@@ -48,10 +48,10 @@ SNoticeBubble {
48
48
  width: 300px;
49
49
  position: fixed;
50
50
  z-index: 1010;
51
- right: 10px;
52
- top: 10px;
51
+ right: 12px;
52
+ top: 12px;
53
53
 
54
54
  @media (max-width: 767px) {
55
- width: calc(100% - 20px);
55
+ width: calc(100% - 24px);
56
56
  }
57
57
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/notice-bubble",
3
3
  "description": "SEMRush NoticeBubble Component",
4
- "version": "3.3.5",
4
+ "version": "4.0.0",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -30,5 +30,8 @@
30
30
  "type": "git",
31
31
  "url": "https://github.com/semrush/intergalactic.git",
32
32
  "directory": "semcore/notice-bubble"
33
+ },
34
+ "devDependencies": {
35
+ "@semcore/jest-preset-ui": "1.0.0"
33
36
  }
34
37
  }
@@ -5,24 +5,24 @@ SWarning,
5
5
  SView {
6
6
  position: relative;
7
7
  margin-bottom: 12px;
8
- padding: 12px 24px 12px 12px;
8
+ padding: 12px 28px 12px 12px;
9
9
  width: 100%;
10
- min-height: 42px;
11
- border-radius: 3px;
10
+ min-height: 44px;
11
+ border-radius: var(--rounded-m);
12
12
  overflow: hidden;
13
13
  box-sizing: border-box;
14
14
  }
15
15
 
16
16
  SInfo {
17
- background: var(--gray20);
17
+ background: var(--gray-800);
18
18
  }
19
19
 
20
20
  SWarning {
21
- background: var(--orange);
21
+ background: var(--red-400);
22
22
  }
23
23
 
24
24
  SMessage {
25
- font-size: var(--fs-100);
25
+ font-size: var(--fs-200);
26
26
  color: #fff;
27
27
  line-height: var(--lh-100);
28
28
  }
@@ -33,10 +33,10 @@ SDismiss {
33
33
  right: 0;
34
34
  top: 0;
35
35
  padding: 8px;
36
- color: var(--gray60);
36
+ color: var(--white);
37
37
 
38
38
  &:hover {
39
- color: var(--gray80);
39
+ color: var(--gray-100);
40
40
  }
41
41
  }
42
42
 
@@ -48,10 +48,10 @@ SNoticeBubble {
48
48
  width: 300px;
49
49
  position: fixed;
50
50
  z-index: 1010;
51
- right: 10px;
52
- top: 10px;
51
+ right: 12px;
52
+ top: 12px;
53
53
 
54
54
  @media (max-width: 767px) {
55
- width: calc(100% - 20px);
55
+ width: calc(100% - 24px);
56
56
  }
57
57
  }