@semcore/notice-bubble 16.1.1 → 16.1.2-prerelease.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +1 -31
- package/lib/cjs/NoticeBubble.js +67 -78
- package/lib/cjs/NoticeBubble.js.map +1 -1
- package/lib/cjs/NoticeBubbleManager.js +5 -8
- package/lib/cjs/NoticeBubbleManager.js.map +1 -1
- package/lib/cjs/index.d.js.map +1 -1
- package/lib/cjs/index.js +2 -3
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js +4 -5
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/cjs/utils.js +3 -5
- package/lib/cjs/utils.js.map +1 -1
- package/lib/es6/NoticeBubble.js +65 -74
- package/lib/es6/NoticeBubble.js.map +1 -1
- package/lib/es6/NoticeBubbleManager.js +2 -3
- package/lib/es6/NoticeBubbleManager.js.map +1 -1
- package/lib/es6/index.d.js.map +1 -1
- package/lib/es6/index.js +1 -1
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/translations/__intergalactic-dynamic-locales.js +2 -2
- package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/utils.js +1 -2
- package/lib/es6/utils.js.map +1 -1
- package/lib/esm/NoticeBubble.mjs +82 -90
- package/lib/esm/NoticeBubbleManager.mjs +2 -3
- package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +2 -2
- package/lib/esm/utils.mjs +1 -2
- package/lib/types/index.d.ts +4 -4
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
|
5
|
+
## [16.1.2] - 2025-06-13
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Version patch update due to children dependencies update (`@semcore/icon` [16.2.0 ~> 16.2.1], `@semcore/flex-box` [16.0.1 ~> 16.0.2], `@semcore/animation` [16.0.1 ~> 16.0.2], `@semcore/button` [16.0.1 ~> 16.0.2], `@semcore/base-components` [16.0.1 ~> 16.0.2]).
|
|
10
|
+
|
|
5
11
|
## [16.1.1] - 2025-05-30
|
|
6
12
|
|
|
7
13
|
### Changed
|
package/README.md
CHANGED
|
@@ -13,39 +13,11 @@
|
|
|
13
13
|
## Install
|
|
14
14
|
|
|
15
15
|
```sh
|
|
16
|
-
npm install
|
|
16
|
+
npm install @semcore/notice-bubble
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
## Usage
|
|
20
20
|
|
|
21
|
-
```jsx
|
|
22
|
-
import NoticeBubbleManager, {
|
|
23
|
-
NoticeBubbleContainer,
|
|
24
|
-
NoticeBubble,
|
|
25
|
-
NoticeBubbleWarning,
|
|
26
|
-
} from 'intergalactic/notice-bubble';
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
<details>
|
|
30
|
-
<summary>Alternative installation and use</summary>
|
|
31
|
-
|
|
32
|
-
**We do not recommend this usage path due to possible dependency and update issues.**
|
|
33
|
-
|
|
34
|
-
### Install
|
|
35
|
-
|
|
36
|
-
You can only install one package from the design system
|
|
37
|
-
|
|
38
|
-
```sh
|
|
39
|
-
npm install @semcore/notice-bubble @semcore/core
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
`@semcore/core` - _is the basic package by which we create our components, and it contains all of the common logic
|
|
43
|
-
of the components that is discussed below. There should only be one version of the package in the project._
|
|
44
|
-
|
|
45
|
-
### Usage
|
|
46
|
-
|
|
47
|
-
You can use the package the same way but without `/ui/` in the import path.
|
|
48
|
-
|
|
49
21
|
```jsx
|
|
50
22
|
import NoticeBubbleManager, {
|
|
51
23
|
NoticeBubbleContainer,
|
|
@@ -54,8 +26,6 @@ import NoticeBubbleManager, {
|
|
|
54
26
|
} from '@semcore/notice-bubble';
|
|
55
27
|
```
|
|
56
28
|
|
|
57
|
-
</details>
|
|
58
|
-
|
|
59
29
|
## 👤 Author
|
|
60
30
|
|
|
61
31
|
[UI-kit team](https://github.com/semrush/intergalactic/blob/master/MAINTAINERS) and [others ❤️](https://github.com/semrush/intergalactic/graphs/contributors)
|
package/lib/cjs/NoticeBubble.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
@@ -9,51 +9,53 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
11
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
|
-
var
|
|
12
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
|
+
var _isNativeReflectConstruct2 = _interopRequireDefault(require("@babel/runtime/helpers/isNativeReflectConstruct"));
|
|
14
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
13
15
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
14
|
-
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
15
16
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
17
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
17
18
|
var _core = require("@semcore/core");
|
|
18
|
-
var _react = _interopRequireDefault(require("react"));
|
|
19
|
-
var _portal = _interopRequireDefault(require("@semcore/portal"));
|
|
20
|
-
var _NoticeBubbleManager = _interopRequireDefault(require("./NoticeBubbleManager"));
|
|
21
19
|
var _animation = require("@semcore/animation");
|
|
22
|
-
var
|
|
23
|
-
var _fire = _interopRequireDefault(require("@semcore/core/lib/utils/fire"));
|
|
24
|
-
var _isNode = _interopRequireDefault(require("@semcore/core/lib/utils/isNode"));
|
|
20
|
+
var _button = _interopRequireDefault(require("@semcore/button"));
|
|
25
21
|
var _assignProps2 = require("@semcore/core/lib/utils/assignProps");
|
|
26
|
-
var _m = _interopRequireDefault(require("@semcore/icon/Close/m"));
|
|
27
|
-
var _utils = require("./utils");
|
|
28
|
-
var _intergalacticDynamicLocales = require("./translations/__intergalactic-dynamic-locales");
|
|
29
22
|
var _i18nEnhance = _interopRequireDefault(require("@semcore/core/lib/utils/enhances/i18nEnhance"));
|
|
30
|
-
var
|
|
23
|
+
var _fire = _interopRequireDefault(require("@semcore/core/lib/utils/fire"));
|
|
24
|
+
var _getFocusableIn = require("@semcore/core/lib/utils/focus-lock/getFocusableIn");
|
|
25
|
+
var _isNode = _interopRequireDefault(require("@semcore/core/lib/utils/isNode"));
|
|
26
|
+
var _ref5 = require("@semcore/core/lib/utils/ref");
|
|
31
27
|
var _ThemeProvider = require("@semcore/core/lib/utils/ThemeProvider");
|
|
32
|
-
var _button = _interopRequireDefault(require("@semcore/button"));
|
|
33
28
|
var _useFocusLock = require("@semcore/core/lib/utils/use/useFocusLock");
|
|
29
|
+
var _useCssVariable = require("@semcore/core/lib/utils/useCssVariable");
|
|
34
30
|
var _zIndexStacking = require("@semcore/core/lib/utils/zIndexStacking");
|
|
35
|
-
var
|
|
36
|
-
var
|
|
31
|
+
var _flexBox = require("@semcore/flex-box");
|
|
32
|
+
var _m = _interopRequireDefault(require("@semcore/icon/Close/m"));
|
|
33
|
+
var _portal = _interopRequireDefault(require("@semcore/portal"));
|
|
34
|
+
var _react = _interopRequireDefault(require("react"));
|
|
35
|
+
var _NoticeBubbleManager = _interopRequireDefault(require("./NoticeBubbleManager"));
|
|
36
|
+
var _intergalacticDynamicLocales = require("./translations/__intergalactic-dynamic-locales");
|
|
37
|
+
var _utils = require("./utils");
|
|
37
38
|
var _excluded = ["focusLock"],
|
|
38
39
|
_excluded2 = ["forwardRef", "styles", "onMouseEnter", "onMouseLeave", "getI18nText", "icon", "children", "action", "type"];
|
|
40
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, (0, _isNativeReflectConstruct2["default"])() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
39
41
|
/*!__reshadow-styles__:"./style/notice-bubble.shadow.css"*/
|
|
40
|
-
var style = (
|
|
42
|
+
var style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/"@keyframes enter_1ve9q{0%{transform:translate(100%,0);max-height:0;overflow:hidden}to{transform:translate(0,0);max-height:100vh;overflow:hidden}}@keyframes exit_1ve9q{0%{max-height:100vh;overflow:hidden;opacity:1}to{max-height:0;overflow:hidden;opacity:0}}.___SBubble_1ve9q_gg_,.___SView_1ve9q_gg_{position:relative;margin-bottom:var(--intergalactic-spacing-3x, 12px);padding:var(--intergalactic-spacing-3x, 12px);padding-right:calc(var(--intergalactic-spacing-8x, 32px) + var(--intergalactic-spacing-1x, 4px));width:100%;border-radius:var(--intergalactic-popper-rounded, 6px);overflow:hidden;box-sizing:border-box;color:var(--intergalactic-text-primary-invert, #ffffff);gap:var(--intergalactic-spacing-2x, 8px)}.___SBubble_1ve9q_gg_._type_info_1ve9q_gg_,.___SView_1ve9q_gg_._type_info_1ve9q_gg_{background:var(--intergalactic-bg-primary-invert, #191b23)}.___SBubble_1ve9q_gg_._type_warning_1ve9q_gg_,.___SView_1ve9q_gg_._type_warning_1ve9q_gg_{background:var(--intergalactic-bg-primary-critical, #ff4953)}.___SContent_1ve9q_gg_{flex-direction:column;gap:var(--intergalactic-spacing-2x, 8px);flex:1}.___SMessage_1ve9q_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SDismiss_1ve9q_gg_{cursor:pointer;position:absolute;right:0;top:0;margin-top:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-2x, 8px);margin-bottom:var(--intergalactic-spacing-2x, 8px);flex-shrink:0;border:0;background:0 0}.___SDismiss_1ve9q_gg_.__use_1ve9q_gg_{padding:0 1px}.___SIcon_1ve9q_gg_{justify-content:center;align-items:center;height:var(--intergalactic-spacing-5x, 20px)}.___SNoticeBubble_1ve9q_gg_{width:300px;position:fixed;right:var(--intergalactic-spacing-3x, 12px);top:var(--intergalactic-spacing-3x, 12px)}@media (max-width:767px){.___SNoticeBubble_1ve9q_gg_{width:calc(100% - var(--intergalactic-spacing-6x, 24px))}}.___SNoticeBubble_1ve9q_gg_.__disablePortal_1ve9q_gg_{position:sticky;margin-left:auto;height:0}.___SMessage_1ve9q_gg_ a{color:var(--intergalactic-text-link-invert, #8ecdff)}.___SNoticeAriaLiveWrapper_1ve9q_gg_{display:contents}", /*__inner_css_end__*/"1ve9q_gg_"),
|
|
41
43
|
/*__reshadow_css_end__*/
|
|
42
44
|
{
|
|
43
|
-
"__SContent": "
|
|
44
|
-
"__SMessage": "
|
|
45
|
-
"__SDismiss": "
|
|
46
|
-
"_use": "
|
|
47
|
-
"__SIcon": "
|
|
48
|
-
"__SNoticeBubble": "
|
|
49
|
-
"_disablePortal": "
|
|
50
|
-
"__SNoticeAriaLiveWrapper": "
|
|
51
|
-
"@enter": "
|
|
52
|
-
"@exit": "
|
|
53
|
-
"__SBubble": "
|
|
54
|
-
"__SView": "
|
|
55
|
-
"_type_info": "
|
|
56
|
-
"_type_warning": "
|
|
45
|
+
"__SContent": "___SContent_1ve9q_gg_",
|
|
46
|
+
"__SMessage": "___SMessage_1ve9q_gg_",
|
|
47
|
+
"__SDismiss": "___SDismiss_1ve9q_gg_",
|
|
48
|
+
"_use": "__use_1ve9q_gg_",
|
|
49
|
+
"__SIcon": "___SIcon_1ve9q_gg_",
|
|
50
|
+
"__SNoticeBubble": "___SNoticeBubble_1ve9q_gg_",
|
|
51
|
+
"_disablePortal": "__disablePortal_1ve9q_gg_",
|
|
52
|
+
"__SNoticeAriaLiveWrapper": "___SNoticeAriaLiveWrapper_1ve9q_gg_",
|
|
53
|
+
"@enter": "enter_1ve9q",
|
|
54
|
+
"@exit": "exit_1ve9q",
|
|
55
|
+
"__SBubble": "___SBubble_1ve9q_gg_",
|
|
56
|
+
"__SView": "___SView_1ve9q_gg_",
|
|
57
|
+
"_type_info": "_type_info_1ve9q_gg_",
|
|
58
|
+
"_type_warning": "_type_warning_1ve9q_gg_"
|
|
57
59
|
});
|
|
58
60
|
var Notices = function Notices(props) {
|
|
59
61
|
var styles = props.styles,
|
|
@@ -64,7 +66,7 @@ var Notices = function Notices(props) {
|
|
|
64
66
|
var ref = _react["default"].useRef();
|
|
65
67
|
var durationStr = (0, _useCssVariable.useCssVariable)('--intergalactic-duration-popper', '200', ref);
|
|
66
68
|
var duration = _react["default"].useMemo(function () {
|
|
67
|
-
return parseInt(durationStr, 10);
|
|
69
|
+
return Number.parseInt(durationStr, 10);
|
|
68
70
|
}, [durationStr]);
|
|
69
71
|
return data.map(function (notice) {
|
|
70
72
|
var _ref2, _notice$visible;
|
|
@@ -82,26 +84,24 @@ var Notices = function Notices(props) {
|
|
|
82
84
|
});
|
|
83
85
|
};
|
|
84
86
|
var NoticeBubbleContainerRoot = /*#__PURE__*/function (_Component) {
|
|
85
|
-
(0, _inherits2["default"])(NoticeBubbleContainerRoot, _Component);
|
|
86
|
-
var _super = (0, _createSuper2["default"])(NoticeBubbleContainerRoot);
|
|
87
87
|
function NoticeBubbleContainerRoot() {
|
|
88
88
|
var _this;
|
|
89
89
|
(0, _classCallCheck2["default"])(this, NoticeBubbleContainerRoot);
|
|
90
90
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
91
91
|
args[_key] = arguments[_key];
|
|
92
92
|
}
|
|
93
|
-
_this =
|
|
94
|
-
(0, _defineProperty2["default"])(
|
|
95
|
-
(0, _defineProperty2["default"])(
|
|
93
|
+
_this = _callSuper(this, NoticeBubbleContainerRoot, [].concat(args));
|
|
94
|
+
(0, _defineProperty2["default"])(_this, "_unsubscribe", null);
|
|
95
|
+
(0, _defineProperty2["default"])(_this, "state", {
|
|
96
96
|
notices: [],
|
|
97
97
|
warnings: []
|
|
98
98
|
});
|
|
99
|
-
(0, _defineProperty2["default"])(
|
|
99
|
+
(0, _defineProperty2["default"])(_this, "componentWillUnmount", function () {
|
|
100
100
|
if (_this._unsubscribe) {
|
|
101
101
|
_this._unsubscribe();
|
|
102
102
|
}
|
|
103
103
|
});
|
|
104
|
-
(0, _defineProperty2["default"])(
|
|
104
|
+
(0, _defineProperty2["default"])(_this, "handleChange", function (notices) {
|
|
105
105
|
var info = notices.filter(function (notice) {
|
|
106
106
|
return notice.type === 'info';
|
|
107
107
|
});
|
|
@@ -115,7 +115,8 @@ var NoticeBubbleContainerRoot = /*#__PURE__*/function (_Component) {
|
|
|
115
115
|
});
|
|
116
116
|
return _this;
|
|
117
117
|
}
|
|
118
|
-
(0,
|
|
118
|
+
(0, _inherits2["default"])(NoticeBubbleContainerRoot, _Component);
|
|
119
|
+
return (0, _createClass2["default"])(NoticeBubbleContainerRoot, [{
|
|
119
120
|
key: "componentDidMount",
|
|
120
121
|
value: function componentDidMount() {
|
|
121
122
|
this._unsubscribe = this.asProps.manager.addListener(this.handleChange);
|
|
@@ -162,7 +163,6 @@ var NoticeBubbleContainerRoot = /*#__PURE__*/function (_Component) {
|
|
|
162
163
|
}))))));
|
|
163
164
|
}
|
|
164
165
|
}]);
|
|
165
|
-
return NoticeBubbleContainerRoot;
|
|
166
166
|
}(_core.Component);
|
|
167
167
|
(0, _defineProperty2["default"])(NoticeBubbleContainerRoot, "displayName", 'NoticeBubbleContainer');
|
|
168
168
|
(0, _defineProperty2["default"])(NoticeBubbleContainerRoot, "style", style);
|
|
@@ -183,37 +183,35 @@ var FocusLock = /*#__PURE__*/_react["default"].forwardRef(function (props, outer
|
|
|
183
183
|
}, other));
|
|
184
184
|
});
|
|
185
185
|
var ViewInfo = /*#__PURE__*/function (_Component2) {
|
|
186
|
-
(0, _inherits2["default"])(ViewInfo, _Component2);
|
|
187
|
-
var _super2 = (0, _createSuper2["default"])(ViewInfo);
|
|
188
186
|
function ViewInfo() {
|
|
189
187
|
var _this2;
|
|
190
188
|
(0, _classCallCheck2["default"])(this, ViewInfo);
|
|
191
189
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
192
190
|
args[_key2] = arguments[_key2];
|
|
193
191
|
}
|
|
194
|
-
_this2 =
|
|
195
|
-
(0, _defineProperty2["default"])(
|
|
196
|
-
(0, _defineProperty2["default"])(
|
|
197
|
-
(0, _defineProperty2["default"])(
|
|
198
|
-
(0, _defineProperty2["default"])(
|
|
192
|
+
_this2 = _callSuper(this, ViewInfo, [].concat(args));
|
|
193
|
+
(0, _defineProperty2["default"])(_this2, "timer", null);
|
|
194
|
+
(0, _defineProperty2["default"])(_this2, "ref", /*#__PURE__*/_react["default"].createRef());
|
|
195
|
+
(0, _defineProperty2["default"])(_this2, "closeButtonRef", /*#__PURE__*/_react["default"].createRef());
|
|
196
|
+
(0, _defineProperty2["default"])(_this2, "handleClose", function (e) {
|
|
199
197
|
// because it might be called not only from the close icon click
|
|
200
|
-
(0, _fire["default"])(
|
|
198
|
+
(0, _fire["default"])(_this2, 'onClose', e);
|
|
201
199
|
_this2.clearTimer();
|
|
202
200
|
});
|
|
203
|
-
(0, _defineProperty2["default"])(
|
|
201
|
+
(0, _defineProperty2["default"])(_this2, "handleKeydown", function (e) {
|
|
204
202
|
if (e.key === 'Escape') {
|
|
205
203
|
_this2.handleClose(e);
|
|
206
204
|
}
|
|
207
205
|
});
|
|
208
|
-
(0, _defineProperty2["default"])(
|
|
206
|
+
(0, _defineProperty2["default"])(_this2, "handleMouseEnter", function () {
|
|
209
207
|
if (!_this2.timer) return;
|
|
210
208
|
_this2.timer.pause();
|
|
211
209
|
});
|
|
212
|
-
(0, _defineProperty2["default"])(
|
|
210
|
+
(0, _defineProperty2["default"])(_this2, "handleMouseLeave", function () {
|
|
213
211
|
if (!_this2.timer) return;
|
|
214
212
|
_this2.timer.resume();
|
|
215
213
|
});
|
|
216
|
-
(0, _defineProperty2["default"])(
|
|
214
|
+
(0, _defineProperty2["default"])(_this2, "handleBodyMouseMove", function (event) {
|
|
217
215
|
var _this2$timer;
|
|
218
216
|
if (!((_this2$timer = _this2.timer) !== null && _this2$timer !== void 0 && _this2$timer.paused)) return;
|
|
219
217
|
var rect = _this2.ref.current.getBoundingClientRect();
|
|
@@ -223,7 +221,8 @@ var ViewInfo = /*#__PURE__*/function (_Component2) {
|
|
|
223
221
|
});
|
|
224
222
|
return _this2;
|
|
225
223
|
}
|
|
226
|
-
(0,
|
|
224
|
+
(0, _inherits2["default"])(ViewInfo, _Component2);
|
|
225
|
+
return (0, _createClass2["default"])(ViewInfo, [{
|
|
227
226
|
key: "componentDidMount",
|
|
228
227
|
value: function componentDidMount() {
|
|
229
228
|
var _this3 = this;
|
|
@@ -285,9 +284,7 @@ var ViewInfo = /*#__PURE__*/function (_Component2) {
|
|
|
285
284
|
"onMouseLeave": (0, _assignProps2.callAllEventHandlers)(onMouseLeave, this.handleMouseLeave),
|
|
286
285
|
"onKeyDown": this.handleKeydown,
|
|
287
286
|
"role": type === 'warning' ? 'alert' : this.props.role
|
|
288
|
-
})), /*#__PURE__*/_react["default"].createElement(SDismiss
|
|
289
|
-
// biome-ignore lint/a11y/useValidAriaValues:
|
|
290
|
-
, _ref4.cn("SDismiss", {
|
|
287
|
+
})), /*#__PURE__*/_react["default"].createElement(SDismiss, _ref4.cn("SDismiss", {
|
|
291
288
|
"aria-haspopup": undefined,
|
|
292
289
|
"type": 'button',
|
|
293
290
|
"use": 'tertiary',
|
|
@@ -304,15 +301,13 @@ var ViewInfo = /*#__PURE__*/function (_Component2) {
|
|
|
304
301
|
})), (0, _isNode["default"])(icon) ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(SIcon, _ref4.cn("SIcon", {}), icon), /*#__PURE__*/_react["default"].createElement(SContent, _ref4.cn("SContent", {}), /*#__PURE__*/_react["default"].createElement(SMessage, _ref4.cn("SMessage", {}), children), (0, _isNode["default"])(actionNode) ? /*#__PURE__*/_react["default"].createElement(SAction, _ref4.cn("SAction", {}), actionNode) : null)) : /*#__PURE__*/_react["default"].createElement(SContent, _ref4.cn("SContent", {}), /*#__PURE__*/_react["default"].createElement(SMessage, _ref4.cn("SMessage", {}), children), (0, _isNode["default"])(actionNode) ? /*#__PURE__*/_react["default"].createElement(SAction, _ref4.cn("SAction", {}), actionNode) : null));
|
|
305
302
|
}
|
|
306
303
|
}]);
|
|
307
|
-
return ViewInfo;
|
|
308
304
|
}(_core.Component);
|
|
309
|
-
var ViewWarning = /*#__PURE__*/function (
|
|
310
|
-
(0, _inherits2["default"])(ViewWarning, _ViewInfo);
|
|
311
|
-
var _super3 = (0, _createSuper2["default"])(ViewWarning);
|
|
305
|
+
var ViewWarning = /*#__PURE__*/function (_ViewInfo2) {
|
|
312
306
|
function ViewWarning() {
|
|
313
307
|
(0, _classCallCheck2["default"])(this, ViewWarning);
|
|
314
|
-
return
|
|
308
|
+
return _callSuper(this, ViewWarning, arguments);
|
|
315
309
|
}
|
|
310
|
+
(0, _inherits2["default"])(ViewWarning, _ViewInfo2);
|
|
316
311
|
return (0, _createClass2["default"])(ViewWarning);
|
|
317
312
|
}(ViewInfo);
|
|
318
313
|
(0, _defineProperty2["default"])(ViewWarning, "defaultProps", {
|
|
@@ -320,19 +315,18 @@ var ViewWarning = /*#__PURE__*/function (_ViewInfo) {
|
|
|
320
315
|
duration: 0
|
|
321
316
|
});
|
|
322
317
|
var NoticeBubbleView = /*#__PURE__*/function (_Component3) {
|
|
323
|
-
(0, _inherits2["default"])(NoticeBubbleView, _Component3);
|
|
324
|
-
var _super4 = (0, _createSuper2["default"])(NoticeBubbleView);
|
|
325
318
|
function NoticeBubbleView() {
|
|
326
319
|
var _this4;
|
|
327
320
|
(0, _classCallCheck2["default"])(this, NoticeBubbleView);
|
|
328
321
|
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
329
322
|
args[_key3] = arguments[_key3];
|
|
330
323
|
}
|
|
331
|
-
_this4 =
|
|
332
|
-
(0, _defineProperty2["default"])(
|
|
324
|
+
_this4 = _callSuper(this, NoticeBubbleView, [].concat(args));
|
|
325
|
+
(0, _defineProperty2["default"])(_this4, "_notice", null);
|
|
333
326
|
return _this4;
|
|
334
327
|
}
|
|
335
|
-
(0,
|
|
328
|
+
(0, _inherits2["default"])(NoticeBubbleView, _Component3);
|
|
329
|
+
return (0, _createClass2["default"])(NoticeBubbleView, [{
|
|
336
330
|
key: "componentDidMount",
|
|
337
331
|
value: function componentDidMount() {
|
|
338
332
|
this._notice = this.asProps.manager.add(this.asProps);
|
|
@@ -357,20 +351,18 @@ var NoticeBubbleView = /*#__PURE__*/function (_Component3) {
|
|
|
357
351
|
return null;
|
|
358
352
|
}
|
|
359
353
|
}]);
|
|
360
|
-
return NoticeBubbleView;
|
|
361
354
|
}(_core.Component);
|
|
362
355
|
(0, _defineProperty2["default"])(NoticeBubbleView, "defaultProps", {
|
|
363
356
|
duration: 5000,
|
|
364
357
|
type: 'info',
|
|
365
358
|
manager: _NoticeBubbleManager["default"]
|
|
366
359
|
});
|
|
367
|
-
var NoticeBubbleWarningView = /*#__PURE__*/function (
|
|
368
|
-
(0, _inherits2["default"])(NoticeBubbleWarningView, _NoticeBubbleView);
|
|
369
|
-
var _super5 = (0, _createSuper2["default"])(NoticeBubbleWarningView);
|
|
360
|
+
var NoticeBubbleWarningView = /*#__PURE__*/function (_NoticeBubbleView2) {
|
|
370
361
|
function NoticeBubbleWarningView() {
|
|
371
362
|
(0, _classCallCheck2["default"])(this, NoticeBubbleWarningView);
|
|
372
|
-
return
|
|
363
|
+
return _callSuper(this, NoticeBubbleWarningView, arguments);
|
|
373
364
|
}
|
|
365
|
+
(0, _inherits2["default"])(NoticeBubbleWarningView, _NoticeBubbleView2);
|
|
374
366
|
return (0, _createClass2["default"])(NoticeBubbleWarningView);
|
|
375
367
|
}(NoticeBubbleView);
|
|
376
368
|
(0, _defineProperty2["default"])(NoticeBubbleWarningView, "defaultProps", {
|
|
@@ -382,10 +374,7 @@ var NoticeBubbleContainer = (0, _core.createComponent)(NoticeBubbleContainerRoot
|
|
|
382
374
|
Info: NoticeBubbleView,
|
|
383
375
|
Warning: NoticeBubbleWarningView
|
|
384
376
|
});
|
|
385
|
-
var NoticeBubble = NoticeBubbleContainer.Info;
|
|
386
|
-
exports.
|
|
387
|
-
var
|
|
388
|
-
exports.NoticeBubbleWarning = NoticeBubbleWarning;
|
|
389
|
-
var _default = NoticeBubbleContainer;
|
|
390
|
-
exports["default"] = _default;
|
|
377
|
+
var NoticeBubble = exports.NoticeBubble = NoticeBubbleContainer.Info;
|
|
378
|
+
var NoticeBubbleWarning = exports.NoticeBubbleWarning = NoticeBubbleContainer.Warning;
|
|
379
|
+
var _default = exports["default"] = NoticeBubbleContainer;
|
|
391
380
|
//# sourceMappingURL=NoticeBubble.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoticeBubble.js","names":["_core","require","_react","_interopRequireDefault","_portal","_NoticeBubbleManager","_animation","_flexBox","_fire","_isNode","_assignProps2","_m","_utils","_intergalacticDynamicLocales","_i18nEnhance","_useCssVariable","_ThemeProvider","_button","_useFocusLock","_zIndexStacking","_ref5","_getFocusableIn","_excluded","_excluded2","style","sstyled","insert","Notices","props","styles","_props$data","data","_props$tag","tag","SView","ViewInfo","ref","React","useRef","durationStr","useCssVariable","duration","useMemo","parseInt","map","notice","_ref2","_notice$visible","createElement","Animation","cn","uid","initialAnimation","visible","_objectSpread2","getI18nText","NoticeBubbleContainerRoot","_Component","_inherits2","_super","_createSuper2","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty2","_assertThisInitialized2","notices","warnings","_unsubscribe","info","filter","type","warning","setState","_createClass2","key","value","componentDidMount","asProps","manager","addListener","handleChange","render","_ref","_ref3","SNoticeBubble","Box","SNoticeAriaLiveWrapper","_this$asProps","Children","disablePortal","parentZIndexStacking","_this$state","state","ZIndexStackingContextProvider","assignProps","ViewWarning","Component","i18nEnhance","localizedMessages","contextThemeEnhance","zIndexStackingEnhance","i18n","locale","FocusLock","forwardRef","outerRef","focusLock","other","_objectWithoutProperties2","innerRef","useFocusLock","useForkRef","Flex","_extends2","_Component2","_super2","_this2","_len2","_key2","createRef","e","fire","clearTimer","handleClose","timer","pause","resume","event","_this2$timer","paused","rect","current","getBoundingClientRect","mouseInRect","clientX","left","right","clientY","top","bottom","_this3","Timer","document","body","addEventListener","handleBodyMouseMove","noticeElement","focusableNodes","getFocusableIn","node","closeButtonRef","setTimeout","setFocus","componentWillUnmount","removeEventListener","clear","_ref4","SBubble","SDismiss","Button","SContent","SMessage","SAction","SIcon","_this$props","onMouseEnter","onMouseLeave","icon","children","actionNode","action","forkRef","callAllEventHandlers","handleMouseEnter","handleMouseLeave","handleKeydown","role","undefined","Addon","CloseIcon","color","isNode","Fragment","_ViewInfo","_super3","NoticeBubbleView","_Component3","_super4","_this4","_len3","_key3","_notice","add","remove","componentDidUpdate","update","NoticeBubbleWarningView","_NoticeBubbleView","_super5","NoticeBubbleContainer","createComponent","Info","Warning","NoticeBubble","exports","NoticeBubbleWarning","_default"],"sources":["../../src/NoticeBubble.jsx"],"sourcesContent":["import React from 'react';\nimport Portal from '@semcore/portal';\nimport manager from './NoticeBubbleManager';\nimport { createComponent, Component, sstyled, Root } from '@semcore/core';\nimport { Animation } from '@semcore/animation';\nimport { Flex, Box } from '@semcore/flex-box';\nimport fire from '@semcore/core/lib/utils/fire';\nimport isNode from '@semcore/core/lib/utils/isNode';\nimport { callAllEventHandlers } from '@semcore/core/lib/utils/assignProps';\nimport CloseIcon from '@semcore/icon/Close/m';\nimport { Timer } from './utils';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport { useCssVariable } from '@semcore/core/lib/utils/useCssVariable';\nimport { contextThemeEnhance } from '@semcore/core/lib/utils/ThemeProvider';\nimport Button from '@semcore/button';\nimport { useFocusLock } from '@semcore/core/lib/utils/use/useFocusLock';\nimport {\n ZIndexStackingContextProvider,\n zIndexStackingEnhance,\n} from '@semcore/core/lib/utils/zIndexStacking';\n\nimport style from './style/notice-bubble.shadow.css';\nimport { forkRef, useForkRef } from '@semcore/core/lib/utils/ref';\nimport { getFocusableIn } from '@semcore/core/lib/utils/focus-lock/getFocusableIn';\nimport { setFocus } from '@semcore/core/lib/utils/use/useFocusLock';\n\nconst Notices = (props) => {\n const { styles, data = [], tag: SView = ViewInfo } = props;\n const ref = React.useRef();\n const durationStr = useCssVariable('--intergalactic-duration-popper', '200', ref);\n const duration = React.useMemo(() => parseInt(durationStr, 10), [durationStr]);\n\n return data.map((notice) => {\n return sstyled(styles)(\n <Animation\n key={notice.uid}\n initialAnimation={notice.initialAnimation}\n visible={notice.visible ?? true}\n duration={duration}\n keyframes={[styles['@enter'], styles['@exit']]}\n ref={ref}\n >\n <SView {...notice} styles={notice.styles || styles} getI18nText={props.getI18nText} />\n </Animation>,\n );\n });\n};\n\nclass NoticeBubbleContainerRoot extends Component {\n static displayName = 'NoticeBubbleContainer';\n static style = style;\n static enhance = [\n i18nEnhance(localizedMessages),\n contextThemeEnhance(),\n zIndexStackingEnhance('z-index-notice-bubble'),\n ];\n static defaultProps = {\n manager,\n i18n: localizedMessages,\n locale: 'en',\n };\n\n _unsubscribe = null;\n\n state = {\n notices: [],\n warnings: [],\n };\n\n componentDidMount() {\n this._unsubscribe = this.asProps.manager.addListener(this.handleChange);\n }\n\n componentWillUnmount = () => {\n if (this._unsubscribe) {\n this._unsubscribe();\n }\n };\n\n handleChange = (notices) => {\n const info = notices.filter((notice) => notice.type === 'info');\n const warning = notices.filter((notice) => notice.type === 'warning');\n\n this.setState({ notices: info, warnings: warning });\n };\n\n render() {\n const SNoticeBubble = Root;\n const SNoticeAriaLiveWrapper = 'div';\n const { Children, styles, disablePortal, getI18nText, ref, parentZIndexStacking } =\n this.asProps;\n const { notices, warnings } = this.state;\n\n return sstyled(styles)(\n <ZIndexStackingContextProvider designToken='z-index-notice-bubble'>\n <Portal disablePortal={disablePortal}>\n <SNoticeBubble\n render={Box}\n ref={ref}\n tag='section'\n role='region'\n aria-label={getI18nText('notification')}\n zIndex={parentZIndexStacking}\n >\n <Children />\n <Notices styles={styles} data={warnings} tag={ViewWarning} getI18nText={getI18nText} />\n <SNoticeAriaLiveWrapper aria-live='polite'>\n <Notices styles={styles} data={notices} tag={ViewInfo} getI18nText={getI18nText} />\n </SNoticeAriaLiveWrapper>\n </SNoticeBubble>\n </Portal>\n </ZIndexStackingContextProvider>,\n );\n }\n}\n\nconst FocusLock = React.forwardRef((props, outerRef) => {\n const { focusLock, ...other } = props;\n const innerRef = React.useRef();\n useFocusLock(innerRef, false, 'auto', !focusLock, true);\n const ref = useForkRef(outerRef, innerRef);\n\n return <Flex ref={ref} {...other} />;\n});\n\nclass ViewInfo extends Component {\n timer = null;\n ref = React.createRef();\n closeButtonRef = React.createRef();\n\n componentDidMount() {\n const { duration } = this.props;\n if (duration) {\n this.timer = new Timer(this.handleClose, duration);\n document.body.addEventListener('mousemove', this.handleBodyMouseMove);\n }\n\n const noticeElement = this.ref.current;\n\n if (noticeElement) {\n const focusableNodes = getFocusableIn(noticeElement).filter(\n (node) => node !== this.closeButtonRef.current,\n );\n\n if (focusableNodes.length > 0) {\n setTimeout(() => setFocus(noticeElement), 0);\n }\n }\n }\n\n componentWillUnmount() {\n this.clearTimer();\n document.body.removeEventListener('mousemove', this.handleBodyMouseMove);\n }\n\n clearTimer() {\n if (this.timer) {\n this.timer.clear();\n this.timer = null;\n }\n }\n\n handleClose = (e) => {\n // because it might be called not only from the close icon click\n fire(this, 'onClose', e);\n this.clearTimer();\n };\n\n handleKeydown = (e) => {\n if (e.key === 'Escape') {\n this.handleClose(e);\n }\n };\n\n handleMouseEnter = () => {\n if (!this.timer) return;\n this.timer.pause();\n };\n\n handleMouseLeave = () => {\n if (!this.timer) return;\n this.timer.resume();\n };\n\n handleBodyMouseMove = (event) => {\n if (!this.timer?.paused) return;\n const rect = this.ref.current.getBoundingClientRect();\n const mouseInRect =\n event.clientX >= rect.left &&\n event.clientX <= rect.right &&\n event.clientY >= rect.top &&\n event.clientY <= rect.bottom;\n if (mouseInRect) return;\n this.timer.resume();\n };\n\n render() {\n const SBubble = FocusLock;\n const SDismiss = Button;\n const SContent = Flex;\n const SMessage = 'div';\n const SAction = 'div';\n const SIcon = Flex;\n const {\n forwardRef,\n styles,\n onMouseEnter,\n onMouseLeave,\n getI18nText,\n icon,\n children,\n action: actionNode,\n type,\n ...other\n } = this.props;\n\n return sstyled(styles)(\n <SBubble\n {...other}\n ref={forkRef(forwardRef, this.ref)}\n onMouseEnter={callAllEventHandlers(onMouseEnter, this.handleMouseEnter)}\n onMouseLeave={callAllEventHandlers(onMouseLeave, this.handleMouseLeave)}\n onKeyDown={this.handleKeydown}\n role={type === 'warning' ? 'alert' : this.props.role}\n >\n <SDismiss\n // biome-ignore lint/a11y/useValidAriaValues:\n aria-haspopup={undefined}\n type='button'\n use='tertiary'\n size='m'\n theme='invert'\n onClick={this.handleClose}\n aria-label={getI18nText('close')}\n active={false}\n title={getI18nText('close')}\n ref={this.closeButtonRef}\n >\n <Button.Addon tag={CloseIcon} color='icon-primary-invert' />\n </SDismiss>\n\n {isNode(icon) ? (\n <>\n <SIcon>{icon}</SIcon>\n <SContent>\n <SMessage>{children}</SMessage>\n {isNode(actionNode) ? <SAction>{actionNode}</SAction> : null}\n </SContent>\n </>\n ) : (\n <SContent>\n <SMessage>{children}</SMessage>\n {isNode(actionNode) ? <SAction>{actionNode}</SAction> : null}\n </SContent>\n )}\n </SBubble>,\n );\n }\n}\n\nclass ViewWarning extends ViewInfo {\n static defaultProps = {\n type: 'warning',\n duration: 0,\n };\n}\n\nclass NoticeBubbleView extends Component {\n static defaultProps = {\n duration: 5000,\n type: 'info',\n manager,\n };\n\n _notice = null;\n\n componentDidMount() {\n this._notice = this.asProps.manager.add(this.asProps);\n }\n\n componentWillUnmount() {\n if (this._notice) {\n this._notice.remove();\n }\n }\n\n componentDidUpdate() {\n if (this._notice) {\n this._notice.update(this.asProps);\n }\n }\n\n render() {\n return null;\n }\n}\n\nclass NoticeBubbleWarningView extends NoticeBubbleView {\n static defaultProps = {\n duration: 5000,\n type: 'warning',\n manager,\n };\n}\n\nconst NoticeBubbleContainer = createComponent(NoticeBubbleContainerRoot, {\n Info: NoticeBubbleView,\n Warning: NoticeBubbleWarningView,\n});\n\nconst NoticeBubble = NoticeBubbleContainer.Info;\nconst NoticeBubbleWarning = NoticeBubbleContainer.Warning;\n\nexport { NoticeBubble, NoticeBubbleWarning };\n\nexport default NoticeBubbleContainer;\n"],"mappings":";;;;;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAHA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,oBAAA,GAAAF,sBAAA,CAAAF,OAAA;AAEA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,OAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,aAAA,GAAAT,OAAA;AACA,IAAAU,EAAA,GAAAR,sBAAA,CAAAF,OAAA;AACA,IAAAW,MAAA,G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AAA,IAAAjC,gBAAA,aAAlC0H,gBAAgB,kBACE;EACpBzJ,QAAQ,EAAE,IAAI;EACdsC,IAAI,EAAE,MAAM;EACZQ,OAAO,EAAPA;AACF,CAAC;AAAA,IAyBGsH,uBAAuB,0BAAAC,iBAAA;EAAA,IAAApJ,UAAA,aAAAmJ,uBAAA,EAAAC,iBAAA;EAAA,IAAAC,OAAA,OAAAnJ,aAAA,aAAAiJ,uBAAA;EAAA,SAAAA,wBAAA;IAAA,IAAA/I,gBAAA,mBAAA+I,uBAAA;IAAA,OAAAE,OAAA,CAAAzI,KAAA,OAAAN,SAAA;EAAA;EAAA,WAAAkB,aAAA,aAAA2H,uBAAA;AAAA,EAASX,gBAAgB;AAAA,IAAA1H,gBAAA,aAAhDqI,uBAAuB,kBACL;EACpBpK,QAAQ,EAAE,IAAI;EACdsC,IAAI,EAAE,SAAS;EACfQ,OAAO,EAAPA;AACF,CAAC;AAGH,IAAMyH,qBAAqB,GAAG,IAAAC,qBAAe,EAACzJ,yBAAyB,EAAE;EACvE0J,IAAI,EAAEhB,gBAAgB;EACtBiB,OAAO,EAAEN;AACX,CAAC,CAAC;AAEF,IAAMO,YAAY,GAAGJ,qBAAqB,CAACE,IAAI;AAACG,OAAA,CAAAD,YAAA,GAAAA,YAAA;AAChD,IAAME,mBAAmB,GAAGN,qBAAqB,CAACG,OAAO;AAACE,OAAA,CAAAC,mBAAA,GAAAA,mBAAA;AAAA,IAAAC,QAAA,GAI3CP,qBAAqB;AAAAK,OAAA,cAAAE,QAAA"}
|
|
1
|
+
{"version":3,"file":"NoticeBubble.js","names":["_core","require","_animation","_button","_interopRequireDefault","_assignProps2","_i18nEnhance","_fire","_getFocusableIn","_isNode","_ref5","_ThemeProvider","_useFocusLock","_useCssVariable","_zIndexStacking","_flexBox","_m","_portal","_react","_NoticeBubbleManager","_intergalacticDynamicLocales","_utils","_excluded","_excluded2","_callSuper","t","o","e","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct2","Reflect","construct","constructor","apply","style","sstyled","insert","Notices","props","styles","_props$data","data","_props$tag","tag","SView","ViewInfo","ref","React","useRef","durationStr","useCssVariable","duration","useMemo","Number","parseInt","map","notice","_ref2","_notice$visible","createElement","Animation","cn","uid","initialAnimation","visible","_objectSpread2","getI18nText","NoticeBubbleContainerRoot","_Component","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","concat","_defineProperty2","notices","warnings","_unsubscribe","info","filter","type","warning","setState","_inherits2","_createClass2","key","value","componentDidMount","asProps","manager","addListener","handleChange","render","_ref","_ref3","SNoticeBubble","Box","SNoticeAriaLiveWrapper","_this$asProps","Children","disablePortal","parentZIndexStacking","_this$state","state","ZIndexStackingContextProvider","assignProps","ViewWarning","Component","i18nEnhance","localizedMessages","contextThemeEnhance","zIndexStackingEnhance","i18n","locale","FocusLock","forwardRef","outerRef","focusLock","other","_objectWithoutProperties2","innerRef","useFocusLock","useForkRef","Flex","_extends2","_Component2","_this2","_len2","_key2","createRef","fire","clearTimer","handleClose","timer","pause","resume","event","_this2$timer","paused","rect","current","getBoundingClientRect","mouseInRect","clientX","left","right","clientY","top","bottom","_this3","Timer","document","body","addEventListener","handleBodyMouseMove","noticeElement","focusableNodes","getFocusableIn","node","closeButtonRef","setTimeout","setFocus","componentWillUnmount","removeEventListener","clear","_ref4","SBubble","SDismiss","Button","SContent","SMessage","SAction","SIcon","_this$props","onMouseEnter","onMouseLeave","icon","children","actionNode","action","forkRef","callAllEventHandlers","handleMouseEnter","handleMouseLeave","handleKeydown","role","undefined","Addon","CloseIcon","color","isNode","Fragment","_ViewInfo2","NoticeBubbleView","_Component3","_this4","_len3","_key3","_notice","add","remove","componentDidUpdate","update","NoticeBubbleWarningView","_NoticeBubbleView2","NoticeBubbleContainer","createComponent","Info","Warning","NoticeBubble","exports","NoticeBubbleWarning","_default"],"sources":["../../src/NoticeBubble.jsx"],"sourcesContent":["import { Animation } from '@semcore/animation';\nimport Button from '@semcore/button';\nimport { createComponent, Component, sstyled, Root } from '@semcore/core';\nimport { callAllEventHandlers } from '@semcore/core/lib/utils/assignProps';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport fire from '@semcore/core/lib/utils/fire';\nimport { getFocusableIn } from '@semcore/core/lib/utils/focus-lock/getFocusableIn';\nimport isNode from '@semcore/core/lib/utils/isNode';\nimport { forkRef, useForkRef } from '@semcore/core/lib/utils/ref';\nimport { contextThemeEnhance } from '@semcore/core/lib/utils/ThemeProvider';\nimport { useFocusLock, setFocus } from '@semcore/core/lib/utils/use/useFocusLock';\nimport { useCssVariable } from '@semcore/core/lib/utils/useCssVariable';\nimport {\n ZIndexStackingContextProvider,\n zIndexStackingEnhance,\n} from '@semcore/core/lib/utils/zIndexStacking';\nimport { Flex, Box } from '@semcore/flex-box';\nimport CloseIcon from '@semcore/icon/Close/m';\nimport Portal from '@semcore/portal';\nimport React from 'react';\n\nimport manager from './NoticeBubbleManager';\nimport style from './style/notice-bubble.shadow.css';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\nimport { Timer } from './utils';\n\nconst Notices = (props) => {\n const { styles, data = [], tag: SView = ViewInfo } = props;\n const ref = React.useRef();\n const durationStr = useCssVariable('--intergalactic-duration-popper', '200', ref);\n const duration = React.useMemo(() => Number.parseInt(durationStr, 10), [durationStr]);\n\n return data.map((notice) => {\n return sstyled(styles)(\n <Animation\n key={notice.uid}\n initialAnimation={notice.initialAnimation}\n visible={notice.visible ?? true}\n duration={duration}\n keyframes={[styles['@enter'], styles['@exit']]}\n ref={ref}\n >\n <SView {...notice} styles={notice.styles || styles} getI18nText={props.getI18nText} />\n </Animation>,\n );\n });\n};\n\nclass NoticeBubbleContainerRoot extends Component {\n static displayName = 'NoticeBubbleContainer';\n static style = style;\n static enhance = [\n i18nEnhance(localizedMessages),\n contextThemeEnhance(),\n zIndexStackingEnhance('z-index-notice-bubble'),\n ];\n\n static defaultProps = {\n manager,\n i18n: localizedMessages,\n locale: 'en',\n };\n\n _unsubscribe = null;\n\n state = {\n notices: [],\n warnings: [],\n };\n\n componentDidMount() {\n this._unsubscribe = this.asProps.manager.addListener(this.handleChange);\n }\n\n componentWillUnmount = () => {\n if (this._unsubscribe) {\n this._unsubscribe();\n }\n };\n\n handleChange = (notices) => {\n const info = notices.filter((notice) => notice.type === 'info');\n const warning = notices.filter((notice) => notice.type === 'warning');\n\n this.setState({ notices: info, warnings: warning });\n };\n\n render() {\n const SNoticeBubble = Root;\n const SNoticeAriaLiveWrapper = 'div';\n const { Children, styles, disablePortal, getI18nText, ref, parentZIndexStacking } =\n this.asProps;\n const { notices, warnings } = this.state;\n\n return sstyled(styles)(\n <ZIndexStackingContextProvider designToken='z-index-notice-bubble'>\n <Portal disablePortal={disablePortal}>\n <SNoticeBubble\n render={Box}\n ref={ref}\n tag='section'\n role='region'\n aria-label={getI18nText('notification')}\n zIndex={parentZIndexStacking}\n >\n <Children />\n <Notices styles={styles} data={warnings} tag={ViewWarning} getI18nText={getI18nText} />\n <SNoticeAriaLiveWrapper aria-live='polite'>\n <Notices styles={styles} data={notices} tag={ViewInfo} getI18nText={getI18nText} />\n </SNoticeAriaLiveWrapper>\n </SNoticeBubble>\n </Portal>\n </ZIndexStackingContextProvider>,\n );\n }\n}\n\nconst FocusLock = React.forwardRef((props, outerRef) => {\n const { focusLock, ...other } = props;\n const innerRef = React.useRef();\n useFocusLock(innerRef, false, 'auto', !focusLock, true);\n const ref = useForkRef(outerRef, innerRef);\n\n return <Flex ref={ref} {...other} />;\n});\n\nclass ViewInfo extends Component {\n timer = null;\n ref = React.createRef();\n closeButtonRef = React.createRef();\n\n componentDidMount() {\n const { duration } = this.props;\n if (duration) {\n this.timer = new Timer(this.handleClose, duration);\n document.body.addEventListener('mousemove', this.handleBodyMouseMove);\n }\n\n const noticeElement = this.ref.current;\n\n if (noticeElement) {\n const focusableNodes = getFocusableIn(noticeElement).filter(\n (node) => node !== this.closeButtonRef.current,\n );\n\n if (focusableNodes.length > 0) {\n setTimeout(() => setFocus(noticeElement), 0);\n }\n }\n }\n\n componentWillUnmount() {\n this.clearTimer();\n document.body.removeEventListener('mousemove', this.handleBodyMouseMove);\n }\n\n clearTimer() {\n if (this.timer) {\n this.timer.clear();\n this.timer = null;\n }\n }\n\n handleClose = (e) => {\n // because it might be called not only from the close icon click\n fire(this, 'onClose', e);\n this.clearTimer();\n };\n\n handleKeydown = (e) => {\n if (e.key === 'Escape') {\n this.handleClose(e);\n }\n };\n\n handleMouseEnter = () => {\n if (!this.timer) return;\n this.timer.pause();\n };\n\n handleMouseLeave = () => {\n if (!this.timer) return;\n this.timer.resume();\n };\n\n handleBodyMouseMove = (event) => {\n if (!this.timer?.paused) return;\n const rect = this.ref.current.getBoundingClientRect();\n const mouseInRect =\n event.clientX >= rect.left &&\n event.clientX <= rect.right &&\n event.clientY >= rect.top &&\n event.clientY <= rect.bottom;\n if (mouseInRect) return;\n this.timer.resume();\n };\n\n render() {\n const SBubble = FocusLock;\n const SDismiss = Button;\n const SContent = Flex;\n const SMessage = 'div';\n const SAction = 'div';\n const SIcon = Flex;\n const {\n forwardRef,\n styles,\n onMouseEnter,\n onMouseLeave,\n getI18nText,\n icon,\n children,\n action: actionNode,\n type,\n ...other\n } = this.props;\n\n return sstyled(styles)(\n <SBubble\n {...other}\n ref={forkRef(forwardRef, this.ref)}\n onMouseEnter={callAllEventHandlers(onMouseEnter, this.handleMouseEnter)}\n onMouseLeave={callAllEventHandlers(onMouseLeave, this.handleMouseLeave)}\n onKeyDown={this.handleKeydown}\n role={type === 'warning' ? 'alert' : this.props.role}\n >\n <SDismiss\n aria-haspopup={undefined}\n type='button'\n use='tertiary'\n size='m'\n theme='invert'\n onClick={this.handleClose}\n aria-label={getI18nText('close')}\n active={false}\n title={getI18nText('close')}\n ref={this.closeButtonRef}\n >\n <Button.Addon tag={CloseIcon} color='icon-primary-invert' />\n </SDismiss>\n\n {isNode(icon)\n ? (\n <>\n <SIcon>{icon}</SIcon>\n <SContent>\n <SMessage>{children}</SMessage>\n {isNode(actionNode) ? <SAction>{actionNode}</SAction> : null}\n </SContent>\n </>\n )\n : (\n <SContent>\n <SMessage>{children}</SMessage>\n {isNode(actionNode) ? <SAction>{actionNode}</SAction> : null}\n </SContent>\n )}\n </SBubble>,\n );\n }\n}\n\nclass ViewWarning extends ViewInfo {\n static defaultProps = {\n type: 'warning',\n duration: 0,\n };\n}\n\nclass NoticeBubbleView extends Component {\n static defaultProps = {\n duration: 5000,\n type: 'info',\n manager,\n };\n\n _notice = null;\n\n componentDidMount() {\n this._notice = this.asProps.manager.add(this.asProps);\n }\n\n componentWillUnmount() {\n if (this._notice) {\n this._notice.remove();\n }\n }\n\n componentDidUpdate() {\n if (this._notice) {\n this._notice.update(this.asProps);\n }\n }\n\n render() {\n return null;\n }\n}\n\nclass NoticeBubbleWarningView extends NoticeBubbleView {\n static defaultProps = {\n duration: 5000,\n type: 'warning',\n manager,\n };\n}\n\nconst NoticeBubbleContainer = createComponent(NoticeBubbleContainerRoot, {\n Info: NoticeBubbleView,\n Warning: NoticeBubbleWarningView,\n});\n\nconst NoticeBubble = NoticeBubbleContainer.Info;\nconst NoticeBubbleWarning = NoticeBubbleContainer.Warning;\n\nexport { NoticeBubble, NoticeBubbleWarning };\n\nexport default NoticeBubbleContainer;\n"],"mappings":";;;;;;;;;;;;;;;;;AAEA,IAAAA,KAAA,GAAAC,OAAA;AAFA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,KAAA,GAAAH,sBAAA,CAAAH,OAAA;AACA,IAAAO,eAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAL,sBAAA,CAAAH,OAAA;AACA,IAAAS,KAAA,GAAAT,OAAA;AACA,IAAAU,cAAA,GAAAV,OAAA;AACA,IAAAW,aAAA,GAAAX,OAAA;AACA,IAAAY,eAAA,G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;EACdiC,IAAI,EAAE,MAAM;EACZS,OAAO,EAAPA;AACF,CAAC;AAAA,IAyBGkH,uBAAuB,0BAAAC,kBAAA;EAAA,SAAAD,wBAAA;IAAA,IAAAzI,gBAAA,mBAAAyI,uBAAA;IAAA,OAAAxL,UAAA,OAAAwL,uBAAA,EAAAvI,SAAA;EAAA;EAAA,IAAAe,UAAA,aAAAwH,uBAAA,EAAAC,kBAAA;EAAA,WAAAxH,aAAA,aAAAuH,uBAAA;AAAA,EAASV,gBAAgB;AAAA,IAAAvH,gBAAA,aAAhDiI,uBAAuB,kBACL;EACpB5J,QAAQ,EAAE,IAAI;EACdiC,IAAI,EAAE,SAAS;EACfS,OAAO,EAAPA;AACF,CAAC;AAGH,IAAMoH,qBAAqB,GAAG,IAAAC,qBAAe,EAAC/I,yBAAyB,EAAE;EACvEgJ,IAAI,EAAEd,gBAAgB;EACtBe,OAAO,EAAEL;AACX,CAAC,CAAC;AAEF,IAAMM,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAGJ,qBAAqB,CAACE,IAAI;AAC/C,IAAMI,mBAAmB,GAAAD,OAAA,CAAAC,mBAAA,GAAGN,qBAAqB,CAACG,OAAO;AAAC,IAAAI,QAAA,GAAAF,OAAA,cAI3CL,qBAAqB","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
@@ -9,12 +9,12 @@ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/obje
|
|
|
9
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
11
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
|
-
var _eventEmitter = _interopRequireDefault(require("@semcore/core/lib/utils/eventEmitter"));
|
|
13
12
|
var _assignProps = require("@semcore/core/lib/utils/assignProps");
|
|
13
|
+
var _eventEmitter = _interopRequireDefault(require("@semcore/core/lib/utils/eventEmitter"));
|
|
14
14
|
var _useFocusLock = require("@semcore/core/lib/utils/use/useFocusLock");
|
|
15
15
|
var _react = _interopRequireDefault(require("react"));
|
|
16
16
|
var EVENT_NAME = 'CHANGE';
|
|
17
|
-
var NoticeBubbleManager = /*#__PURE__*/function () {
|
|
17
|
+
var NoticeBubbleManager = exports.NoticeBubbleManager = /*#__PURE__*/function () {
|
|
18
18
|
function NoticeBubbleManager() {
|
|
19
19
|
(0, _classCallCheck2["default"])(this, NoticeBubbleManager);
|
|
20
20
|
(0, _defineProperty2["default"])(this, "items", []);
|
|
@@ -23,7 +23,7 @@ var NoticeBubbleManager = /*#__PURE__*/function () {
|
|
|
23
23
|
(0, _defineProperty2["default"])(this, "replaceTimer", 0);
|
|
24
24
|
this.emitter = new _eventEmitter["default"]();
|
|
25
25
|
}
|
|
26
|
-
(0, _createClass2["default"])(NoticeBubbleManager, [{
|
|
26
|
+
return (0, _createClass2["default"])(NoticeBubbleManager, [{
|
|
27
27
|
key: "addListener",
|
|
28
28
|
value: function addListener(fn) {
|
|
29
29
|
return this.emitter.subscribe(EVENT_NAME, fn);
|
|
@@ -120,10 +120,7 @@ var NoticeBubbleManager = /*#__PURE__*/function () {
|
|
|
120
120
|
return false;
|
|
121
121
|
}
|
|
122
122
|
}]);
|
|
123
|
-
return NoticeBubbleManager;
|
|
124
123
|
}();
|
|
125
|
-
exports.NoticeBubbleManager = NoticeBubbleManager;
|
|
126
124
|
var noticeBubbleDefaultManager = new NoticeBubbleManager();
|
|
127
|
-
var _default = noticeBubbleDefaultManager;
|
|
128
|
-
exports["default"] = _default;
|
|
125
|
+
var _default = exports["default"] = noticeBubbleDefaultManager;
|
|
129
126
|
//# sourceMappingURL=NoticeBubbleManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoticeBubbleManager.js","names":["
|
|
1
|
+
{"version":3,"file":"NoticeBubbleManager.js","names":["_assignProps","require","_eventEmitter","_interopRequireDefault","_useFocusLock","_react","EVENT_NAME","NoticeBubbleManager","exports","_classCallCheck2","_defineProperty2","emitter","EventEmitter","_createClass2","key","value","addListener","fn","subscribe","createItem","props","manager","_objectSpread2","type","onClose","callAllEventHandlers","remove","uid","emit","items","add","counter","ref","React","createRef","focus","setTimeout","setFocus","current","item","visible","initialAnimation","undefined","forwardRef","push","update","bind","index","findIndex","replaceLast","_this","replaceTimer","clearTimeout","length","_this2","find","filter","noticeBubbleDefaultManager","_default"],"sources":["../../src/NoticeBubbleManager.js"],"sourcesContent":["import { callAllEventHandlers } from '@semcore/core/lib/utils/assignProps';\nimport EventEmitter from '@semcore/core/lib/utils/eventEmitter';\nimport { setFocus } from '@semcore/core/lib/utils/use/useFocusLock';\nimport React from 'react';\n\nconst EVENT_NAME = 'CHANGE';\n\nclass NoticeBubbleManager {\n items = [];\n emitter = null;\n counter = 0;\n\n replaceTimer = 0;\n\n constructor() {\n this.emitter = new EventEmitter();\n }\n\n addListener(fn) {\n return this.emitter.subscribe(EVENT_NAME, fn);\n }\n\n createItem(props) {\n const manager = this;\n\n return {\n type: 'info',\n ...props,\n onClose: callAllEventHandlers(props.onClose, () => {\n manager.remove(props.uid);\n }),\n };\n }\n\n emit() {\n this.emitter.emit(EVENT_NAME, this.items);\n }\n\n add(props) {\n const uid = this.counter++;\n const ref = React.createRef();\n const focus = () => setTimeout(() => setFocus(ref.current), 0);\n const item = this.createItem({\n uid,\n visible: props.initialAnimation ? true : undefined,\n forwardRef: ref,\n ...props,\n });\n this.items.push(item);\n this.emit();\n return {\n uid,\n update: this.update.bind(this, uid),\n remove: this.remove.bind(this, uid),\n ref,\n // todo Brauer Ilia: remove this property, because we added logic about autofocus in Notice\n focus,\n };\n }\n\n update(uid, props) {\n const index = this.items.findIndex((item) => item.uid === uid);\n if (index !== -1) {\n this.items[index] = this.createItem({\n ...this.items[index],\n ...props,\n });\n this.emit();\n return true;\n }\n return false;\n }\n\n replaceLast(props) {\n if (this.replaceTimer) {\n clearTimeout(this.replaceTimer);\n }\n\n const item = this.items[this.items.length - 1];\n\n if (item?.visible) {\n this.remove(this.counter - 1);\n }\n\n this.replaceTimer = setTimeout(() => {\n this.add(props);\n }, 300);\n }\n\n remove(uid) {\n const item = this.items.find((item) => item.uid === uid);\n if (item) {\n item.visible = false;\n setTimeout(() => {\n this.items = this.items.filter((item) => item.uid !== uid);\n this.emit();\n }, 1000);\n this.emit();\n return true;\n }\n return false;\n }\n}\n\nconst noticeBubbleDefaultManager = new NoticeBubbleManager();\n\nexport { NoticeBubbleManager };\nexport default noticeBubbleDefaultManager;\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAF,sBAAA,CAAAF,OAAA;AAEA,IAAMK,UAAU,GAAG,QAAQ;AAAC,IAEtBC,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA;EAOvB,SAAAA,oBAAA,EAAc;IAAA,IAAAE,gBAAA,mBAAAF,mBAAA;IAAA,IAAAG,gBAAA,4BANN,EAAE;IAAA,IAAAA,gBAAA,8BACA,IAAI;IAAA,IAAAA,gBAAA,8BACJ,CAAC;IAAA,IAAAA,gBAAA,mCAEI,CAAC;IAGd,IAAI,CAACC,OAAO,GAAG,IAAIC,wBAAY,CAAC,CAAC;EACnC;EAAC,WAAAC,aAAA,aAAAN,mBAAA;IAAAO,GAAA;IAAAC,KAAA,EAED,SAAAC,WAAWA,CAACC,EAAE,EAAE;MACd,OAAO,IAAI,CAACN,OAAO,CAACO,SAAS,CAACZ,UAAU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C;IAAAN,GAAA;IAAAC,KAAA,EAED,SAAAW,MAAMA,CAACC,GAAG,EAAE;MAAA,IAAA2B,MAAA;MACV,IAAMf,IAAI,GAAG,IAAI,CAACV,KAAK,CAAC0B,IAAI,CAAC,UAAChB,IAAI;QAAA,OAAKA,IAAI,CAACZ,GAAG,KAAKA,GAAG;MAAA,EAAC;MACxD,IAAIY,IAAI,EAAE;QACRA,IAAI,CAACC,OAAO,GAAG,KAAK;QACpBJ,UAAU,CAAC,YAAM;UACfkB,MAAI,CAACzB,KAAK,GAAGyB,MAAI,CAACzB,KAAK,CAAC2B,MAAM,CAAC,UAACjB,IAAI;YAAA,OAAKA,IAAI,CAACZ,GAAG,KAAKA,GAAG;UAAA,EAAC;UAC1D2B,MAAI,CAAC1B,IAAI,CAAC,CAAC;QACb,CAAC,EAAE,IAAI,CAAC;QACR,IAAI,CAACA,IAAI,CAAC,CAAC;QACX,OAAO,IAAI;MACb;MACA,OAAO,KAAK;IACd;EAAC;AAAA;AAGH,IAAM6B,0BAA0B,GAAG,IAAIlD,mBAAmB,CAAC,CAAC;AAAC,IAAAmD,QAAA,GAAAlD,OAAA,cAG9CiD,0BAA0B","ignoreList":[]}
|
package/lib/cjs/index.d.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import type { UnknownProperties, Intergalactic } from '@semcore/core';\nimport type { BoxProps } from '@semcore/flex-box';\nimport type { PortalProps } from '@semcore/portal';\n\n/** @deprecated */\nexport interface INoticeBubbleContainerProps\n extends NoticeBubbleContainerProps,\n UnknownProperties {}\nexport type NoticeBubbleContainerProps = BoxProps &\n PortalProps & {\n /** Manager copy */\n manager?: NoticeBubbleManagerClass;\n locale?: string;\n };\n\n/** @deprecated */\nexport interface INoticeBubbleProps extends NoticeBubbleProps, UnknownProperties {}\nexport type NoticeBubbleProps = BoxProps & {\n /**\n * Notice visibility.\n */\n visible?: boolean;\n /**\n * Control under the notice children.\n * */\n action?: React.ReactNode;\n /**\n * Callback triggered by \"Close\" icon click.\n * */\n onClose?: (e?: React.SyntheticEvent) => void;\n /**\n * Notice content.\n * */\n children?: React.ReactNode;\n manager?: NoticeBubbleManager;\n icon?: React.ReactElement;\n};\n/** @deprecated */\nexport interface INoticeBubbleInfoProps extends NoticeBubbleInfoProps, UnknownProperties {}\nexport type NoticeBubbleInfoProps = NoticeBubbleProps & {\n readonly type?: 'info';\n /**\n * Notice display duration. Set to 0 to disable auto-close.\n */\n duration?: number;\n /**\n * Enables animation on first rendering.\n * @default false\n */\n initialAnimation?: boolean;\n /**\n * Use it for complex notices with important controls.\n * If enabled, browser focus will be locked in the notice\n * until it's closed. After close focus should return to the element\n * where it was placed before notice appear.\n */\n focusLock?: boolean;\n};\n\n/** @deprecated */\nexport interface INoticeBubbleWarningProps extends NoticeBubbleWarningProps, UnknownProperties {}\nexport type NoticeBubbleWarningProps = NoticeBubbleProps & {\n readonly type?: 'warning';\n /**\n * Notice display duration.\n */\n duration?: number;\n /**\n * Enables animation on first rendering.\n * @default false\n */\n initialAnimation?: boolean;\n /**\n * Use it for complex notices with important controls.\n * If enabled, browser focus will be locked in the notice\n * until it's closed. After close focus should return to the element\n * where it was placed before notice appear.\n */\n focusLock?: boolean;\n};\n\n/** @deprecated */\nexport interface INoticeBubbleManager extends NoticeBubbleManagerClass, UnknownProperties {}\nexport type NoticeBubbleManagerClass = {\n /**\n * Creates and shows a notice.\n * */\n add: (props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => {\n uid: string;\n update: (props: Partial<NoticeBubbleInfoProps> | Partial<NoticeBubbleWarningProps>) => boolean;\n remove: () => boolean;\n ref: React.RefObject<HTMLDivElement>;\n focus: () => void;\n };\n /**\n * Updates notice by uid.\n * */\n update: (\n uid: string,\n props: Partial<NoticeBubbleInfoProps> | Partial<NoticeBubbleWarningProps>,\n ) => boolean;\n /**\n * Removes notice by uid.\n * */\n remove: (uid: string) => boolean;\n /**\n * Replace last notice (if it is existing)\n */\n replaceLast: (props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => void;\n};\n\n/**\n * @deprecated use `NoticeBubbleManager` instead.\n * */\nexport declare const NoticeBubble: Intergalactic.Component<'div', NoticeBubbleInfoProps>;\n/**\n * @deprecated use `NoticeBubbleManager` instead.\n * */\nexport declare const NoticeBubbleWarning: Intergalactic.Component<'div', NoticeBubbleWarningProps>;\nexport declare const NoticeBubbleContainer: Intergalactic.Component<\n 'div',\n NoticeBubbleContainerProps\n> & {\n /**\n * @deprecated use `NoticeBubbleManager` instead.\n * */\n Info: typeof NoticeBubble;\n\n /**\n * @deprecated use `NoticeBubbleManager` instead.\n * */\n Warning: typeof NoticeBubbleWarning;\n};\nexport declare class NoticeBubbleManager implements NoticeBubbleManagerClass {\n /**\n * Creates and shows a notice.\n * */\n add(props: NoticeBubbleInfoProps | NoticeBubbleWarningProps): {\n uid: string;\n update: (props: Partial<NoticeBubbleInfoProps> | Partial<NoticeBubbleWarningProps>) => boolean;\n remove: () => boolean;\n ref: React.RefObject<HTMLDivElement>;\n focus: () => void;\n };\n /**\n * Updates notice by uid.\n * */\n update(\n uid: string,\n props: Partial<NoticeBubbleInfoProps> | Partial<NoticeBubbleWarningProps>,\n ): boolean;\n /**\n * Removes notice by uid.\n * */\n remove(uid: string): boolean;\n /**\n * Replace last notice (if it is existing)\n */\n replaceLast: (props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => void;\n}\n\nexport declare const noticeBubbleDefaultManager: NoticeBubbleManager;\n\n/**\n * @deprecated Use `import { noticeBubbleDefaultManager } from ...` instead\n */\nexport default noticeBubbleDefaultManager;\n"],"mappings":"","ignoreList":[]}
|