@semcore/notice-bubble 4.1.5 → 4.1.7

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,35 +2,11 @@
2
2
 
3
3
  CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
- ## [4.1.5] - 2022-09-29
5
+ ## [4.1.7] - 2022-10-06
6
6
 
7
7
  ### Changed
8
8
 
9
- - Version patch update due to children dependencies update (`@semcore/icon` [2.30.4 ~> 2.31.0]).
10
-
11
- ## [4.1.4] - 2022-09-21
12
-
13
- ### Changed
14
-
15
- - Version patch update due to children dependencies update (`@semcore/icon` [2.30.3 ~> 2.30.4]).
16
-
17
- ## [4.1.3] - 2022-09-21
18
-
19
- ### Changed
20
-
21
- - Version patch update due to children dependencies update (`@semcore/icon` [2.30.2 ~> 2.30.3]).
22
-
23
- ## [4.1.2] - 2022-08-30
24
-
25
- ### Changed
26
-
27
- - Version patch update due to children dependencies update (`@semcore/utils` [3.37.0 ~> 3.37.1], `@semcore/icon` [2.30.1 ~> 2.30.2], `@semcore/flex-box` [4.5.10 ~> 4.5.11], `@semcore/animation` [1.5.9 ~> 1.5.10]).
28
-
29
- ## [4.1.1] - 2022-08-29
30
-
31
- ### Changed
32
-
33
- - Version patch update due to children dependencies update (`@semcore/animation` [1.5.8 ~> 1.5.9]).
9
+ - Version patch update due to children dependencies update (`@semcore/icon` [2.32.2 ~> 2.33.0]).
34
10
 
35
11
  ## [4.1.0] - 2022-08-24
36
12
 
@@ -50,78 +26,6 @@ CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangel
50
26
 
51
27
  - Version patch update due to children dependencies update (`@semcore/icon` [2.30.0 ~> 2.30.1]).
52
28
 
53
- ## [4.0.12] - 2022-08-18
54
-
55
- ### Changed
56
-
57
- - Version patch update due to children dependencies update (`@semcore/icon` [2.29.5 ~> 2.30.0]).
58
-
59
- ## [4.0.11] - 2022-08-18
60
-
61
- ### Changed
62
-
63
- - Version patch update due to children dependencies update (`@semcore/utils` [3.36.0 ~> 3.37.0], `@semcore/icon` [2.29.4 ~> 2.29.5], `@semcore/flex-box` [4.5.9 ~> 4.5.10], `@semcore/animation` [1.5.7 ~> 1.5.8]).
64
-
65
- ## [4.0.10] - 2022-08-11
66
-
67
- ### Changed
68
-
69
- - Version patch update due to children dependencies update (`@semcore/utils` [3.35.1 ~> 3.36.0], `@semcore/icon` [2.29.3 ~> 2.29.4], `@semcore/flex-box` [4.5.8 ~> 4.5.9], `@semcore/animation` [1.5.6 ~> 1.5.7]).
70
-
71
- ## [4.0.9] - 2022-07-25
72
-
73
- ### Changed
74
-
75
- - Version patch update due to children dependencies update (`@semcore/icon` [2.29.1 ~> 2.29.2]).
76
-
77
- ## [4.0.8] - 2022-07-22
78
-
79
- ### Changed
80
-
81
- - Version patch update due to children dependencies update (`@semcore/utils` [3.34.0 ~> 3.35.0], `@semcore/icon` [2.29.0 ~> 2.29.1], `@semcore/flex-box` [4.5.6 ~> 4.5.7], `@semcore/animation` [1.5.4 ~> 1.5.5]).
82
-
83
- ## [4.0.7] - 2022-07-21
84
-
85
- ### Changed
86
-
87
- - Version patch update due to children dependencies update (`@semcore/icon` [2.28.0 ~> 2.29.0]).
88
-
89
- ## [4.0.6] - 2022-07-07
90
-
91
- ### Changed
92
-
93
- - Version patch update due to children dependencies update (`@semcore/utils` [3.33.0 ~> 3.34.0], `@semcore/icon` [2.27.0 ~> 2.28.0], `@semcore/flex-box` [4.5.5 ~> 4.5.6], `@semcore/animation` [1.5.3 ~> 1.5.4]).
94
-
95
- ## [4.0.5] - 2022-06-02
96
-
97
- ### Changed
98
-
99
- - Version patch update due to children dependencies update (`@semcore/utils` [3.32.2 ~> 3.33.0], `@semcore/icon` [2.26.1 ~> 2.27.0], `@semcore/flex-box` [4.5.4 ~> 4.5.5], `@semcore/animation` [1.5.2 ~> 1.5.3]).
100
-
101
- ## [4.0.4] - 2022-05-31
102
-
103
- ### Changed
104
-
105
- - Version patch update due to children dependencies update (`@semcore/utils` [3.32.1 ~> 3.32.2], `@semcore/icon` [2.26.0 ~> 2.26.1], `@semcore/flex-box` [4.5.3 ~> 4.5.4], `@semcore/animation` [1.5.1 ~> 1.5.2]).
106
-
107
- ## [4.0.3] - 2022-05-23
108
-
109
- ### Changed
110
-
111
- - Version patch update due to children dependencies update (`@semcore/icon` [2.25.1 ~> 2.26.0]).
112
-
113
- ## [4.0.2] - 2022-05-19
114
-
115
- ### Changed
116
-
117
- - Version patch update due to children dependencies update (`@semcore/utils` [3.32.0 ~> 3.32.1], `@semcore/icon` [2.25.0 ~> 2.25.1], `@semcore/flex-box` [4.5.1 ~> 4.5.3], `@semcore/animation` [1.5.0 ~> 1.5.1]).
118
-
119
- ## [4.0.1] - 2022-05-18
120
-
121
- ### Changed
122
-
123
- - Version patch update due to children dependencies update (`@semcore/icon` [2.24.0 ~> 2.25.0]).
124
-
125
29
  ## [4.0.0] - 2022-05-17
126
30
 
127
31
  ### BREAK
@@ -134,36 +38,6 @@ CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangel
134
38
 
135
39
  - Version patch update due to children dependencies update (`@semcore/icon` [2.21.0 ~> 2.24.0]).
136
40
 
137
- ## [3.3.6] - 2022-04-28
138
-
139
- ### Changed
140
-
141
- - Version patch update due to children dependencies update (`@semcore/icon` [2.20.0 ~> 2.21.0]).
142
-
143
- ## [3.3.5] - 2022-04-03
144
-
145
- ### Changed
146
-
147
- - Version patch update due to children dependencies update (`@semcore/animation` [1.5.0 ~> 1.5.0]).
148
-
149
- ## [3.3.4] - 2022-03-21
150
-
151
- ### Changed
152
-
153
- - Version patch update due to children dependencies update (`@semcore/icon` [2.19.4 ~> 2.20.0]).
154
-
155
- ## [3.3.3] - 2022-03-14
156
-
157
- ### Changed
158
-
159
- - Version patch update due to children dependencies update (`@semcore/utils` [3.31.2 ~> 3.31.2], `@semcore/icon` [2.19.3 ~> 2.19.4], `@semcore/flex-box` [4.5.0 ~> 4.5.1], `@semcore/animation` [1.4.1 ~> 1.4.2]).
160
-
161
- ## [3.3.2] - 2022-03-05
162
-
163
- ### Changed
164
-
165
- - Version patch update due to children dependencies update (`@semcore/animation` [1.4.0 ~> 1.4.1]).
166
-
167
41
  ## [3.3.1] - 2022-02-24
168
42
 
169
43
  ### Added
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright ©, 2022, Semrush Inc. (written by Roman Lysov, Sergey Kobets, Mikhail Karachev, Julia Mnizhek, Elena Krasnopolskaia, Mikhail Sereniti).
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -67,20 +67,20 @@ var style = (
67
67
  /*__reshadow_css_start__*/
68
68
  _core.sstyled.insert(
69
69
  /*__inner_css_start__*/
70
- ".___SInfo_1dowu_gg_,.___SView_1dowu_gg_,.___SWarning_1dowu_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_1dowu_gg_{background:#191b23}.___SWarning_1dowu_gg_{background:#ff4953}.___SMessage_1dowu_gg_{font-size:14px;color:#fff;line-height:1.33}.___SDismiss_1dowu_gg_{cursor:pointer;position:absolute;right:0;top:0;padding:8px;color:#ffffff}.___SDismiss_1dowu_gg_:hover{color:#e0e1e9}.___SAction_1dowu_gg_{margin-top:8px}.___SNoticeBubble_1dowu_gg_{width:300px;position:fixed;z-index:1010;right:12px;top:12px}@media (max-width:767px){.___SNoticeBubble_1dowu_gg_{width:calc(100% - 24px)}}@-webkit-keyframes enter_1dowu{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes enter_1dowu{0%{transform:translate(100%)}to{transform:translate(0)}}@-webkit-keyframes exit_1dowu{0%{opacity:1}to{opacity:0}}@keyframes exit_1dowu{0%{opacity:1}to{opacity:0}}"
70
+ ":root {\n\n /* DEPRECATED START\n Deprecated variables should never be used in\n components styles but preserved for backward\n compatibility if they used in projects\n like `<Badge bg=\"red\">alpha</Badge>`\n */\n /* DEPRECATED END */\n}\n\n.___SInfo_1aroa_gg_,\n.___SWarning_1aroa_gg_,\n.___SView_1aroa_gg_ {\n position: relative;\n margin-bottom: 12px;\n padding: 12px 28px 12px 12px;\n width: 100%;\n min-height: 44px;\n border-radius: 6px;\n overflow: hidden;\n box-sizing: border-box;\n}\n\n.___SInfo_1aroa_gg_ {\n background: #191b23;\n}\n\n.___SWarning_1aroa_gg_ {\n background: #ff4953;\n}\n\n.___SMessage_1aroa_gg_ {\n font-size: 14px;\n color: #fff;\n line-height: 1.33;\n}\n\n.___SDismiss_1aroa_gg_ {\n cursor: pointer;\n position: absolute;\n right: 0;\n top: 0;\n padding: 8px;\n color: #ffffff\n}\n\n.___SDismiss_1aroa_gg_:hover {\n color: #e0e1e9;\n }\n\n.___SAction_1aroa_gg_ {\n margin-top: 8px;\n}\n\n.___SNoticeBubble_1aroa_gg_ {\n width: 300px;\n position: fixed;\n z-index: 1010;\n right: 12px;\n top: 12px\n}\n\n@media (max-width: 767px) {\n\n.___SNoticeBubble_1aroa_gg_ {\n width: calc(100% - 24px)\n}\n }\n\n@keyframes enter_1aroa {\n from {\n transform: translate(100%, 0);\n }\n to {\n transform: translate(0, 0);\n }\n}\n\n@keyframes exit_1aroa {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n}\n"
71
71
  /*__inner_css_end__*/
72
- , "1dowu_gg_")
72
+ , "1aroa_gg_")
73
73
  /*__reshadow_css_end__*/
74
74
  , {
75
- "__SInfo": "___SInfo_1dowu_gg_",
76
- "__SView": "___SView_1dowu_gg_",
77
- "__SWarning": "___SWarning_1dowu_gg_",
78
- "__SMessage": "___SMessage_1dowu_gg_",
79
- "__SDismiss": "___SDismiss_1dowu_gg_",
80
- "__SAction": "___SAction_1dowu_gg_",
81
- "__SNoticeBubble": "___SNoticeBubble_1dowu_gg_",
82
- "@enter": "enter_1dowu",
83
- "@exit": "exit_1dowu"
75
+ "__SInfo": "___SInfo_1aroa_gg_",
76
+ "__SWarning": "___SWarning_1aroa_gg_",
77
+ "__SView": "___SView_1aroa_gg_",
78
+ "__SMessage": "___SMessage_1aroa_gg_",
79
+ "__SDismiss": "___SDismiss_1aroa_gg_",
80
+ "__SAction": "___SAction_1aroa_gg_",
81
+ "__SNoticeBubble": "___SNoticeBubble_1aroa_gg_",
82
+ "@enter": "enter_1aroa",
83
+ "@exit": "exit_1aroa"
84
84
  });
85
85
 
86
86
  var Notices = function Notices(props) {
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=index.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import { IPortalProps } from '@semcore/portal';\nimport { CProps, ReturnEl } from '@semcore/core';\nimport { IBoxProps } from '@semcore/flex-box';\n\nexport interface INoticeBubbleContainerProps extends IBoxProps, IPortalProps {\n /** Manager copy */\n manager?: INoticeBubbleManager;\n}\n\nexport interface INoticeBubbleInfoProps extends INoticeBubbleProps {\n readonly type?: 'info';\n /** Notice display duration\n * @default 5000\n */\n duration?: number;\n}\n\nexport interface INoticeBubbleWarningProps extends INoticeBubbleProps {\n readonly type?: 'warning';\n /**\n * Notice display duration\n * @default 0\n */\n duration?: number;\n}\n\nexport interface INoticeBubbleProps extends IBoxProps {\n /**\n * Manager instance\n * @default NoticeBubbleManager()\n */\n manager?: INoticeBubbleManager;\n /**\n * Notice visibility\n */\n visible?: boolean;\n /** Adds controls (buttons, etc.) */\n action?: React.ReactNode;\n\n /** Triggered when the notice is closed */\n onClose?: (e?: React.SyntheticEvent) => void;\n}\n\nexport interface INoticeBubbleManager {\n /**\n * Adding a notice.\n * Takes the props properties of NoticeBubble.\n * Returns an object with the uid and the update, remove functions.\n * */\n add: (\n props: object,\n ) => {\n uid: string;\n update: (props: object) => boolean;\n remove: () => boolean;\n };\n /**\n * Updates the notice by uid.\n * Takes the uid-unique identifier and the props-properties of NoticeBubble.\n * Returns a successful or unsuccessful update.\n * */\n update: (uid: string, props: object) => boolean;\n /**\n * Deletes the notice by uid.\n * Takes an uid-unique identifier.\n * Returns a successful or unsuccessful deletion.\n * */\n remove: (uid: string) => boolean;\n}\n\ndeclare const NoticeBubble: <T>(props: INoticeBubbleInfoProps & T) => ReturnEl;\ndeclare const NoticeBubbleWarning: <T>(props: INoticeBubbleWarningProps & T) => ReturnEl;\ndeclare const NoticeBubbleContainer: (<T>(\n props: CProps<INoticeBubbleContainerProps & T>,\n) => ReturnEl) & {\n Info: typeof NoticeBubble;\n Warning: typeof NoticeBubbleWarning;\n};\n\ndeclare const manager: INoticeBubbleManager;\n\nexport { NoticeBubbleContainer, NoticeBubble, NoticeBubbleWarning };\nexport default manager;\n"],"mappings":""}
@@ -36,20 +36,20 @@ var style = (
36
36
  /*__reshadow_css_start__*/
37
37
  _sstyled.insert(
38
38
  /*__inner_css_start__*/
39
- ".___SInfo_1dowu_gg_,.___SView_1dowu_gg_,.___SWarning_1dowu_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_1dowu_gg_{background:#191b23}.___SWarning_1dowu_gg_{background:#ff4953}.___SMessage_1dowu_gg_{font-size:14px;color:#fff;line-height:1.33}.___SDismiss_1dowu_gg_{cursor:pointer;position:absolute;right:0;top:0;padding:8px;color:#ffffff}.___SDismiss_1dowu_gg_:hover{color:#e0e1e9}.___SAction_1dowu_gg_{margin-top:8px}.___SNoticeBubble_1dowu_gg_{width:300px;position:fixed;z-index:1010;right:12px;top:12px}@media (max-width:767px){.___SNoticeBubble_1dowu_gg_{width:calc(100% - 24px)}}@-webkit-keyframes enter_1dowu{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes enter_1dowu{0%{transform:translate(100%)}to{transform:translate(0)}}@-webkit-keyframes exit_1dowu{0%{opacity:1}to{opacity:0}}@keyframes exit_1dowu{0%{opacity:1}to{opacity:0}}"
39
+ ":root {\n\n /* DEPRECATED START\n Deprecated variables should never be used in\n components styles but preserved for backward\n compatibility if they used in projects\n like `<Badge bg=\"red\">alpha</Badge>`\n */\n /* DEPRECATED END */\n}\n\n.___SInfo_1aroa_gg_,\n.___SWarning_1aroa_gg_,\n.___SView_1aroa_gg_ {\n position: relative;\n margin-bottom: 12px;\n padding: 12px 28px 12px 12px;\n width: 100%;\n min-height: 44px;\n border-radius: 6px;\n overflow: hidden;\n box-sizing: border-box;\n}\n\n.___SInfo_1aroa_gg_ {\n background: #191b23;\n}\n\n.___SWarning_1aroa_gg_ {\n background: #ff4953;\n}\n\n.___SMessage_1aroa_gg_ {\n font-size: 14px;\n color: #fff;\n line-height: 1.33;\n}\n\n.___SDismiss_1aroa_gg_ {\n cursor: pointer;\n position: absolute;\n right: 0;\n top: 0;\n padding: 8px;\n color: #ffffff\n}\n\n.___SDismiss_1aroa_gg_:hover {\n color: #e0e1e9;\n }\n\n.___SAction_1aroa_gg_ {\n margin-top: 8px;\n}\n\n.___SNoticeBubble_1aroa_gg_ {\n width: 300px;\n position: fixed;\n z-index: 1010;\n right: 12px;\n top: 12px\n}\n\n@media (max-width: 767px) {\n\n.___SNoticeBubble_1aroa_gg_ {\n width: calc(100% - 24px)\n}\n }\n\n@keyframes enter_1aroa {\n from {\n transform: translate(100%, 0);\n }\n to {\n transform: translate(0, 0);\n }\n}\n\n@keyframes exit_1aroa {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n}\n"
40
40
  /*__inner_css_end__*/
41
- , "1dowu_gg_")
41
+ , "1aroa_gg_")
42
42
  /*__reshadow_css_end__*/
43
43
  , {
44
- "__SInfo": "___SInfo_1dowu_gg_",
45
- "__SView": "___SView_1dowu_gg_",
46
- "__SWarning": "___SWarning_1dowu_gg_",
47
- "__SMessage": "___SMessage_1dowu_gg_",
48
- "__SDismiss": "___SDismiss_1dowu_gg_",
49
- "__SAction": "___SAction_1dowu_gg_",
50
- "__SNoticeBubble": "___SNoticeBubble_1dowu_gg_",
51
- "@enter": "enter_1dowu",
52
- "@exit": "exit_1dowu"
44
+ "__SInfo": "___SInfo_1aroa_gg_",
45
+ "__SWarning": "___SWarning_1aroa_gg_",
46
+ "__SView": "___SView_1aroa_gg_",
47
+ "__SMessage": "___SMessage_1aroa_gg_",
48
+ "__SDismiss": "___SDismiss_1aroa_gg_",
49
+ "__SAction": "___SAction_1aroa_gg_",
50
+ "__SNoticeBubble": "___SNoticeBubble_1aroa_gg_",
51
+ "@enter": "enter_1aroa",
52
+ "@exit": "exit_1aroa"
53
53
  });
54
54
 
55
55
  var Notices = function Notices(props) {
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import { IPortalProps } from '@semcore/portal';\nimport { CProps, ReturnEl } from '@semcore/core';\nimport { IBoxProps } from '@semcore/flex-box';\n\nexport interface INoticeBubbleContainerProps extends IBoxProps, IPortalProps {\n /** Manager copy */\n manager?: INoticeBubbleManager;\n}\n\nexport interface INoticeBubbleInfoProps extends INoticeBubbleProps {\n readonly type?: 'info';\n /** Notice display duration\n * @default 5000\n */\n duration?: number;\n}\n\nexport interface INoticeBubbleWarningProps extends INoticeBubbleProps {\n readonly type?: 'warning';\n /**\n * Notice display duration\n * @default 0\n */\n duration?: number;\n}\n\nexport interface INoticeBubbleProps extends IBoxProps {\n /**\n * Manager instance\n * @default NoticeBubbleManager()\n */\n manager?: INoticeBubbleManager;\n /**\n * Notice visibility\n */\n visible?: boolean;\n /** Adds controls (buttons, etc.) */\n action?: React.ReactNode;\n\n /** Triggered when the notice is closed */\n onClose?: (e?: React.SyntheticEvent) => void;\n}\n\nexport interface INoticeBubbleManager {\n /**\n * Adding a notice.\n * Takes the props properties of NoticeBubble.\n * Returns an object with the uid and the update, remove functions.\n * */\n add: (\n props: object,\n ) => {\n uid: string;\n update: (props: object) => boolean;\n remove: () => boolean;\n };\n /**\n * Updates the notice by uid.\n * Takes the uid-unique identifier and the props-properties of NoticeBubble.\n * Returns a successful or unsuccessful update.\n * */\n update: (uid: string, props: object) => boolean;\n /**\n * Deletes the notice by uid.\n * Takes an uid-unique identifier.\n * Returns a successful or unsuccessful deletion.\n * */\n remove: (uid: string) => boolean;\n}\n\ndeclare const NoticeBubble: <T>(props: INoticeBubbleInfoProps & T) => ReturnEl;\ndeclare const NoticeBubbleWarning: <T>(props: INoticeBubbleWarningProps & T) => ReturnEl;\ndeclare const NoticeBubbleContainer: (<T>(\n props: CProps<INoticeBubbleContainerProps & T>,\n) => ReturnEl) & {\n Info: typeof NoticeBubble;\n Warning: typeof NoticeBubbleWarning;\n};\n\ndeclare const manager: INoticeBubbleManager;\n\nexport { NoticeBubbleContainer, NoticeBubble, NoticeBubbleWarning };\nexport default manager;\n"],"mappings":""}
package/package.json CHANGED
@@ -1,17 +1,13 @@
1
1
  {
2
2
  "name": "@semcore/notice-bubble",
3
3
  "description": "Semrush NoticeBubble Component",
4
- "version": "4.1.5",
4
+ "version": "4.1.7",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
8
8
  "author": "UI-kit team <ui-kit-team@semrush.com>",
9
9
  "sideEffects": false,
10
10
  "license": "MIT",
11
- "scripts": {
12
- "build": "build --source=js",
13
- "test": "jest"
14
- },
15
11
  "dependencies": {
16
12
  "@semcore/utils": "^3.24",
17
13
  "@semcore/icon": "^2.16",
@@ -32,6 +28,11 @@
32
28
  "directory": "semcore/notice-bubble"
33
29
  },
34
30
  "devDependencies": {
31
+ "@types/react": "16.8 - 17",
35
32
  "@semcore/jest-preset-ui": "1.0.0"
33
+ },
34
+ "scripts": {
35
+ "build": "pnpm semcore-builder --source=js",
36
+ "test": "jest"
36
37
  }
37
- }
38
+ }
@@ -1,83 +0,0 @@
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;
@@ -1,83 +0,0 @@
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;