@semcore/notice-bubble 16.0.0-prerelease.6 → 16.0.0-prerelease.9

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.
@@ -1,295 +1,364 @@
1
- import X from "@babel/runtime/helpers/esm/extends";
2
- import z from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- import v from "@babel/runtime/helpers/esm/classCallCheck";
4
- import h from "@babel/runtime/helpers/esm/createClass";
5
- import g from "@babel/runtime/helpers/esm/assertThisInitialized";
6
- import x from "@babel/runtime/helpers/esm/inherits";
7
- import b from "@babel/runtime/helpers/esm/createSuper";
8
- import s from "@babel/runtime/helpers/esm/defineProperty";
9
- import d from "@babel/runtime/helpers/esm/objectSpread2";
10
- import { sstyled as M, createComponent as Y, assignProps as H, Component as P } from "@semcore/core";
11
- import n from "react";
12
- import q from "@semcore/portal";
13
- import L from "./NoticeBubbleManager.mjs";
14
- import { Animation as G } from "@semcore/animation";
15
- import { Box as J, Flex as k } from "@semcore/flex-box";
16
- import O from "@semcore/core/lib/utils/fire";
17
- import N from "@semcore/core/lib/utils/isNode";
18
- import { callAllEventHandlers as A } from "@semcore/core/lib/utils/assignProps";
19
- import Q from "@semcore/icon/Close/m";
20
- import { Timer as ee } from "./utils.mjs";
21
- import { localizedMessages as F } from "./translations/__intergalactic-dynamic-locales.mjs";
22
- import te from "@semcore/core/lib/utils/enhances/i18nEnhance";
23
- import { useCssVariable as ie } from "@semcore/core/lib/utils/useCssVariable";
24
- import { contextThemeEnhance as ne } from "@semcore/core/lib/utils/ThemeProvider";
25
- import D from "@semcore/button";
26
- import { setFocus as re, useFocusLock as ae } from "@semcore/core/lib/utils/use/useFocusLock";
27
- import { zIndexStackingEnhance as oe, ZIndexStackingContextProvider as ce } from "@semcore/core/lib/utils/zIndexStacking";
28
- import { forkRef as se, useForkRef as le } from "@semcore/core/lib/utils/ref";
29
- import { getFocusableIn as _e } from "@semcore/core/lib/utils/focus-lock/getFocusableIn";
30
- var ue = ["focusLock"], ge = ["forwardRef", "styles", "onMouseEnter", "onMouseLeave", "getI18nText", "icon", "children", "action", "type"], me = (
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
4
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
5
+ import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
6
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
7
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
8
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
9
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
10
+ import { sstyled, createComponent, assignProps, Component } from "@semcore/core";
11
+ import React from "react";
12
+ import Portal from "@semcore/portal";
13
+ import noticeBubbleDefaultManager from "./NoticeBubbleManager.mjs";
14
+ import { Animation } from "@semcore/animation";
15
+ import { Box, Flex } from "@semcore/flex-box";
16
+ import fire from "@semcore/core/lib/utils/fire";
17
+ import isNode from "@semcore/core/lib/utils/isNode";
18
+ import { callAllEventHandlers } from "@semcore/core/lib/utils/assignProps";
19
+ import CloseIcon from "@semcore/icon/Close/m";
20
+ import { Timer } from "./utils.mjs";
21
+ import { localizedMessages } from "./translations/__intergalactic-dynamic-locales.mjs";
22
+ import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
23
+ import { useCssVariable } from "@semcore/core/lib/utils/useCssVariable";
24
+ import { contextThemeEnhance } from "@semcore/core/lib/utils/ThemeProvider";
25
+ import Button from "@semcore/button";
26
+ import { setFocus, useFocusLock } from "@semcore/core/lib/utils/use/useFocusLock";
27
+ import { zIndexStackingEnhance, ZIndexStackingContextProvider } from "@semcore/core/lib/utils/zIndexStacking";
28
+ import { forkRef, useForkRef } from "@semcore/core/lib/utils/ref";
29
+ import { getFocusableIn } from "@semcore/core/lib/utils/focus-lock/getFocusableIn";
30
+ var _excluded = ["focusLock"], _excluded2 = ["forwardRef", "styles", "onMouseEnter", "onMouseLeave", "getI18nText", "icon", "children", "action", "type"];
31
+ var style = (
31
32
  /*__reshadow_css_start__*/
32
- (M.insert(
33
+ (sstyled.insert(
33
34
  /*__inner_css_start__*/
34
35
  "@keyframes enter_1i85x{0%{transform:translate(100%,0);max-height:0;overflow:hidden}to{transform:translate(0,0);max-height:100vh;overflow:hidden}}@keyframes exit_1i85x{0%{max-height:100vh;overflow:hidden;opacity:1}to{max-height:0;overflow:hidden;opacity:0}}.___SBubble_1i85x_gg_,.___SView_1i85x_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_1i85x_gg_._type_info_1i85x_gg_,.___SView_1i85x_gg_._type_info_1i85x_gg_{background:var(--intergalactic-bg-primary-invert, #191b23)}.___SBubble_1i85x_gg_._type_warning_1i85x_gg_,.___SView_1i85x_gg_._type_warning_1i85x_gg_{background:var(--intergalactic-bg-primary-critical, #ff4953)}.___SContent_1i85x_gg_{flex-direction:column;gap:var(--intergalactic-spacing-2x, 8px);flex:1}.___SMessage_1i85x_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SDismiss_1i85x_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_1i85x_gg_.__use_1i85x_gg_{padding:0 1px}.___SIcon_1i85x_gg_{justify-content:center;align-items:center;height:var(--intergalactic-spacing-5x, 20px)}.___SNoticeBubble_1i85x_gg_{width:300px;position:fixed;right:var(--intergalactic-spacing-3x, 12px);top:var(--intergalactic-spacing-3x, 12px)}@media (max-width:767px){.___SNoticeBubble_1i85x_gg_{width:calc(100% - var(--intergalactic-spacing-6x, 24px))}}.___SNoticeBubble_1i85x_gg_.__disablePortal_1i85x_gg_{position:sticky;margin-left:auto;height:0}.___SMessage_1i85x_gg_ a{color:var(--intergalactic-text-link-invert, #8ecdff)}.___SNoticeAriaLiveWrapper_1i85x_gg_{display:contents}",
35
36
  "1i85x_gg_"
36
37
  ), {
37
- __SContent: "___SContent_1i85x_gg_",
38
- __SMessage: "___SMessage_1i85x_gg_",
39
- __SDismiss: "___SDismiss_1i85x_gg_",
40
- _use: "__use_1i85x_gg_",
41
- __SIcon: "___SIcon_1i85x_gg_",
42
- __SNoticeBubble: "___SNoticeBubble_1i85x_gg_",
43
- _disablePortal: "__disablePortal_1i85x_gg_",
44
- __SNoticeAriaLiveWrapper: "___SNoticeAriaLiveWrapper_1i85x_gg_",
38
+ "__SContent": "___SContent_1i85x_gg_",
39
+ "__SMessage": "___SMessage_1i85x_gg_",
40
+ "__SDismiss": "___SDismiss_1i85x_gg_",
41
+ "_use": "__use_1i85x_gg_",
42
+ "__SIcon": "___SIcon_1i85x_gg_",
43
+ "__SNoticeBubble": "___SNoticeBubble_1i85x_gg_",
44
+ "_disablePortal": "__disablePortal_1i85x_gg_",
45
+ "__SNoticeAriaLiveWrapper": "___SNoticeAriaLiveWrapper_1i85x_gg_",
45
46
  "@enter": "enter_1i85x",
46
47
  "@exit": "exit_1i85x",
47
- __SBubble: "___SBubble_1i85x_gg_",
48
- __SView: "___SView_1i85x_gg_",
49
- _type_info: "_type_info_1i85x_gg_",
50
- _type_warning: "_type_warning_1i85x_gg_"
48
+ "__SBubble": "___SBubble_1i85x_gg_",
49
+ "__SView": "___SView_1i85x_gg_",
50
+ "_type_info": "_type_info_1i85x_gg_",
51
+ "_type_warning": "_type_warning_1i85x_gg_"
51
52
  })
52
- ), V = function(l) {
53
- var t = l.styles, e = l.data, i = e === void 0 ? [] : e, r = l.tag, a = r === void 0 ? R : r, o = n.useRef(), c = ie("--intergalactic-duration-popper", "200", o), p = n.useMemo(function() {
54
- return parseInt(c, 10);
55
- }, [c]);
56
- return i.map(function(_) {
57
- var u, f;
58
- return u = M(t), /* @__PURE__ */ n.createElement(G, u.cn("Animation", {
59
- key: _.uid,
60
- initialAnimation: _.initialAnimation,
61
- visible: (f = _.visible) !== null && f !== void 0 ? f : !0,
62
- duration: p,
63
- keyframes: [t["@enter"], t["@exit"]],
64
- ref: o
65
- }), /* @__PURE__ */ n.createElement(a, u.cn("SView", d(d({}, _), {}, {
66
- styles: _.styles || t,
67
- getI18nText: l.getI18nText
53
+ );
54
+ var Notices = function Notices2(props) {
55
+ var styles = props.styles, _props$data = props.data, data = _props$data === void 0 ? [] : _props$data, _props$tag = props.tag, SView = _props$tag === void 0 ? ViewInfo : _props$tag;
56
+ var ref = React.useRef();
57
+ var durationStr = useCssVariable("--intergalactic-duration-popper", "200", ref);
58
+ var duration = React.useMemo(function() {
59
+ return parseInt(durationStr, 10);
60
+ }, [durationStr]);
61
+ return data.map(function(notice) {
62
+ var _ref2, _notice$visible;
63
+ return _ref2 = sstyled(styles), /* @__PURE__ */ React.createElement(Animation, _ref2.cn("Animation", {
64
+ "key": notice.uid,
65
+ "initialAnimation": notice.initialAnimation,
66
+ "visible": (_notice$visible = notice.visible) !== null && _notice$visible !== void 0 ? _notice$visible : true,
67
+ "duration": duration,
68
+ "keyframes": [styles["@enter"], styles["@exit"]],
69
+ "ref": ref
70
+ }), /* @__PURE__ */ React.createElement(SView, _ref2.cn("SView", _objectSpread(_objectSpread({}, notice), {}, {
71
+ "styles": notice.styles || styles,
72
+ "getI18nText": props.getI18nText
68
73
  }))));
69
74
  });
70
- }, y = /* @__PURE__ */ function(m) {
71
- x(t, m);
72
- var l = b(t);
73
- function t() {
74
- var e;
75
- v(this, t);
76
- for (var i = arguments.length, r = new Array(i), a = 0; a < i; a++)
77
- r[a] = arguments[a];
78
- return e = l.call.apply(l, [this].concat(r)), s(g(e), "_unsubscribe", null), s(g(e), "state", {
75
+ };
76
+ var NoticeBubbleContainerRoot = /* @__PURE__ */ function(_Component) {
77
+ _inherits(NoticeBubbleContainerRoot2, _Component);
78
+ var _super = _createSuper(NoticeBubbleContainerRoot2);
79
+ function NoticeBubbleContainerRoot2() {
80
+ var _this;
81
+ _classCallCheck(this, NoticeBubbleContainerRoot2);
82
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
83
+ args[_key] = arguments[_key];
84
+ }
85
+ _this = _super.call.apply(_super, [this].concat(args));
86
+ _defineProperty(_assertThisInitialized(_this), "_unsubscribe", null);
87
+ _defineProperty(_assertThisInitialized(_this), "state", {
79
88
  notices: [],
80
89
  warnings: []
81
- }), s(g(e), "componentWillUnmount", function() {
82
- e._unsubscribe && e._unsubscribe();
83
- }), s(g(e), "handleChange", function(o) {
84
- var c = o.filter(function(_) {
85
- return _.type === "info";
86
- }), p = o.filter(function(_) {
87
- return _.type === "warning";
90
+ });
91
+ _defineProperty(_assertThisInitialized(_this), "componentWillUnmount", function() {
92
+ if (_this._unsubscribe) {
93
+ _this._unsubscribe();
94
+ }
95
+ });
96
+ _defineProperty(_assertThisInitialized(_this), "handleChange", function(notices) {
97
+ var info = notices.filter(function(notice) {
98
+ return notice.type === "info";
88
99
  });
89
- e.setState({
90
- notices: c,
91
- warnings: p
100
+ var warning = notices.filter(function(notice) {
101
+ return notice.type === "warning";
92
102
  });
93
- }), e;
103
+ _this.setState({
104
+ notices: info,
105
+ warnings: warning
106
+ });
107
+ });
108
+ return _this;
94
109
  }
95
- return h(t, [{
110
+ _createClass(NoticeBubbleContainerRoot2, [{
96
111
  key: "componentDidMount",
97
- value: function() {
112
+ value: function componentDidMount() {
98
113
  this._unsubscribe = this.asProps.manager.addListener(this.handleChange);
99
114
  }
100
115
  }, {
101
116
  key: "render",
102
- value: function() {
103
- var i = this.asProps, r, a = J, o = "div", c = this.asProps, p = c.Children, _ = c.styles, u = c.disablePortal, f = c.getI18nText, C = c.ref, I = c.parentZIndexStacking, S = this.state, w = S.notices, E = S.warnings;
104
- return r = M(_), /* @__PURE__ */ n.createElement(ce, r.cn("ZIndexStackingContextProvider", {
105
- designToken: "z-index-notice-bubble"
106
- }), /* @__PURE__ */ n.createElement(q, r.cn("Portal", {
107
- disablePortal: u
108
- }), /* @__PURE__ */ n.createElement(a, r.cn("SNoticeBubble", d({}, H({
109
- ref: C,
110
- tag: "section",
111
- role: "region",
112
- "aria-label": f("notification"),
113
- zIndex: I
114
- }, i))), /* @__PURE__ */ n.createElement(p, r.cn("Children", {})), /* @__PURE__ */ n.createElement(V, r.cn("Notices", {
115
- styles: _,
116
- data: E,
117
- tag: U,
118
- getI18nText: f
119
- })), /* @__PURE__ */ n.createElement(o, r.cn("SNoticeAriaLiveWrapper", {
117
+ value: function render() {
118
+ var _ref = this.asProps, _ref3;
119
+ var SNoticeBubble = Box;
120
+ var SNoticeAriaLiveWrapper = "div";
121
+ var _this$asProps = this.asProps, Children = _this$asProps.Children, styles = _this$asProps.styles, disablePortal = _this$asProps.disablePortal, getI18nText = _this$asProps.getI18nText, ref = _this$asProps.ref, parentZIndexStacking = _this$asProps.parentZIndexStacking;
122
+ var _this$state = this.state, notices = _this$state.notices, warnings = _this$state.warnings;
123
+ return _ref3 = sstyled(styles), /* @__PURE__ */ React.createElement(ZIndexStackingContextProvider, _ref3.cn("ZIndexStackingContextProvider", {
124
+ "designToken": "z-index-notice-bubble"
125
+ }), /* @__PURE__ */ React.createElement(Portal, _ref3.cn("Portal", {
126
+ "disablePortal": disablePortal
127
+ }), /* @__PURE__ */ React.createElement(SNoticeBubble, _ref3.cn("SNoticeBubble", _objectSpread({}, assignProps({
128
+ "ref": ref,
129
+ "tag": "section",
130
+ "role": "region",
131
+ "aria-label": getI18nText("notification"),
132
+ "zIndex": parentZIndexStacking
133
+ }, _ref))), /* @__PURE__ */ React.createElement(Children, _ref3.cn("Children", {})), /* @__PURE__ */ React.createElement(Notices, _ref3.cn("Notices", {
134
+ "styles": styles,
135
+ "data": warnings,
136
+ "tag": ViewWarning,
137
+ "getI18nText": getI18nText
138
+ })), /* @__PURE__ */ React.createElement(SNoticeAriaLiveWrapper, _ref3.cn("SNoticeAriaLiveWrapper", {
120
139
  "aria-live": "polite"
121
- }), /* @__PURE__ */ n.createElement(V, r.cn("Notices", {
122
- styles: _,
123
- data: w,
124
- tag: R,
125
- getI18nText: f
140
+ }), /* @__PURE__ */ React.createElement(Notices, _ref3.cn("Notices", {
141
+ "styles": styles,
142
+ "data": notices,
143
+ "tag": ViewInfo,
144
+ "getI18nText": getI18nText
126
145
  }))))));
127
146
  }
128
- }]), t;
129
- }(P);
130
- s(y, "displayName", "NoticeBubbleContainer");
131
- s(y, "style", me);
132
- s(y, "enhance", [te(F), ne(), oe("z-index-notice-bubble")]);
133
- s(y, "defaultProps", {
134
- manager: L,
135
- i18n: F,
147
+ }]);
148
+ return NoticeBubbleContainerRoot2;
149
+ }(Component);
150
+ _defineProperty(NoticeBubbleContainerRoot, "displayName", "NoticeBubbleContainer");
151
+ _defineProperty(NoticeBubbleContainerRoot, "style", style);
152
+ _defineProperty(NoticeBubbleContainerRoot, "enhance", [i18nEnhance(localizedMessages), contextThemeEnhance(), zIndexStackingEnhance("z-index-notice-bubble")]);
153
+ _defineProperty(NoticeBubbleContainerRoot, "defaultProps", {
154
+ manager: noticeBubbleDefaultManager,
155
+ i18n: localizedMessages,
136
156
  locale: "en"
137
157
  });
138
- var pe = /* @__PURE__ */ n.forwardRef(function(m, l) {
139
- var t = m.focusLock, e = z(m, ue), i = n.useRef();
140
- ae(i, !1, "auto", !t, !0);
141
- var r = le(l, i);
142
- return /* @__PURE__ */ n.createElement(k, X({
143
- ref: r
144
- }, e));
145
- }), R = /* @__PURE__ */ function(m) {
146
- x(t, m);
147
- var l = b(t);
148
- function t() {
149
- var e;
150
- v(this, t);
151
- for (var i = arguments.length, r = new Array(i), a = 0; a < i; a++)
152
- r[a] = arguments[a];
153
- return e = l.call.apply(l, [this].concat(r)), s(g(e), "timer", null), s(g(e), "ref", /* @__PURE__ */ n.createRef()), s(g(e), "closeButtonRef", /* @__PURE__ */ n.createRef()), s(g(e), "handleClose", function(o) {
154
- O(g(e), "onClose", o), e.clearTimer();
155
- }), s(g(e), "handleKeydown", function(o) {
156
- o.key === "Escape" && e.handleClose(o);
157
- }), s(g(e), "handleMouseEnter", function() {
158
- e.timer && e.timer.pause();
159
- }), s(g(e), "handleMouseLeave", function() {
160
- e.timer && e.timer.resume();
161
- }), s(g(e), "handleBodyMouseMove", function(o) {
162
- var c;
163
- if ((c = e.timer) !== null && c !== void 0 && c.paused) {
164
- var p = e.ref.current.getBoundingClientRect(), _ = o.clientX >= p.left && o.clientX <= p.right && o.clientY >= p.top && o.clientY <= p.bottom;
165
- _ || e.timer.resume();
158
+ var FocusLock = /* @__PURE__ */ React.forwardRef(function(props, outerRef) {
159
+ var focusLock = props.focusLock, other = _objectWithoutProperties(props, _excluded);
160
+ var innerRef = React.useRef();
161
+ useFocusLock(innerRef, false, "auto", !focusLock, true);
162
+ var ref = useForkRef(outerRef, innerRef);
163
+ return /* @__PURE__ */ React.createElement(Flex, _extends({
164
+ ref
165
+ }, other));
166
+ });
167
+ var ViewInfo = /* @__PURE__ */ function(_Component2) {
168
+ _inherits(ViewInfo2, _Component2);
169
+ var _super2 = _createSuper(ViewInfo2);
170
+ function ViewInfo2() {
171
+ var _this2;
172
+ _classCallCheck(this, ViewInfo2);
173
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
174
+ args[_key2] = arguments[_key2];
175
+ }
176
+ _this2 = _super2.call.apply(_super2, [this].concat(args));
177
+ _defineProperty(_assertThisInitialized(_this2), "timer", null);
178
+ _defineProperty(_assertThisInitialized(_this2), "ref", /* @__PURE__ */ React.createRef());
179
+ _defineProperty(_assertThisInitialized(_this2), "closeButtonRef", /* @__PURE__ */ React.createRef());
180
+ _defineProperty(_assertThisInitialized(_this2), "handleClose", function(e) {
181
+ fire(_assertThisInitialized(_this2), "onClose", e);
182
+ _this2.clearTimer();
183
+ });
184
+ _defineProperty(_assertThisInitialized(_this2), "handleKeydown", function(e) {
185
+ if (e.key === "Escape") {
186
+ _this2.handleClose(e);
166
187
  }
167
- }), e;
188
+ });
189
+ _defineProperty(_assertThisInitialized(_this2), "handleMouseEnter", function() {
190
+ if (!_this2.timer) return;
191
+ _this2.timer.pause();
192
+ });
193
+ _defineProperty(_assertThisInitialized(_this2), "handleMouseLeave", function() {
194
+ if (!_this2.timer) return;
195
+ _this2.timer.resume();
196
+ });
197
+ _defineProperty(_assertThisInitialized(_this2), "handleBodyMouseMove", function(event) {
198
+ var _this2$timer;
199
+ if (!((_this2$timer = _this2.timer) !== null && _this2$timer !== void 0 && _this2$timer.paused)) return;
200
+ var rect = _this2.ref.current.getBoundingClientRect();
201
+ var mouseInRect = event.clientX >= rect.left && event.clientX <= rect.right && event.clientY >= rect.top && event.clientY <= rect.bottom;
202
+ if (mouseInRect) return;
203
+ _this2.timer.resume();
204
+ });
205
+ return _this2;
168
206
  }
169
- return h(t, [{
207
+ _createClass(ViewInfo2, [{
170
208
  key: "componentDidMount",
171
- value: function() {
172
- var i = this, r = this.props.duration;
173
- r && (this.timer = new ee(this.handleClose, r), document.body.addEventListener("mousemove", this.handleBodyMouseMove));
174
- var a = this.ref.current;
175
- if (a) {
176
- var o = _e(a).filter(function(c) {
177
- return c !== i.closeButtonRef.current;
209
+ value: function componentDidMount() {
210
+ var _this3 = this;
211
+ var duration = this.props.duration;
212
+ if (duration) {
213
+ this.timer = new Timer(this.handleClose, duration);
214
+ document.body.addEventListener("mousemove", this.handleBodyMouseMove);
215
+ }
216
+ var noticeElement = this.ref.current;
217
+ if (noticeElement) {
218
+ var focusableNodes = getFocusableIn(noticeElement).filter(function(node) {
219
+ return node !== _this3.closeButtonRef.current;
178
220
  });
179
- o.length > 0 && setTimeout(function() {
180
- return re(a);
181
- }, 0);
221
+ if (focusableNodes.length > 0) {
222
+ setTimeout(function() {
223
+ return setFocus(noticeElement);
224
+ }, 0);
225
+ }
182
226
  }
183
227
  }
184
228
  }, {
185
229
  key: "componentWillUnmount",
186
- value: function() {
187
- this.clearTimer(), document.body.removeEventListener("mousemove", this.handleBodyMouseMove);
230
+ value: function componentWillUnmount() {
231
+ this.clearTimer();
232
+ document.body.removeEventListener("mousemove", this.handleBodyMouseMove);
188
233
  }
189
234
  }, {
190
235
  key: "clearTimer",
191
- value: function() {
192
- this.timer && (this.timer.clear(), this.timer = null);
236
+ value: function clearTimer() {
237
+ if (this.timer) {
238
+ this.timer.clear();
239
+ this.timer = null;
240
+ }
193
241
  }
194
242
  }, {
195
243
  key: "render",
196
- value: function() {
197
- var i, r = pe, a = D, o = k, c = "div", p = "div", _ = k, u = this.props, f = u.forwardRef, C = u.styles, I = u.onMouseEnter, S = u.onMouseLeave, w = u.getI18nText, E = u.icon, W = u.children, B = u.action, j = u.type, K = z(u, ge);
198
- return i = M(C), /* @__PURE__ */ n.createElement(r, i.cn("SBubble", d(d({}, K), {}, {
199
- ref: se(f, this.ref),
200
- onMouseEnter: A(I, this.handleMouseEnter),
201
- onMouseLeave: A(S, this.handleMouseLeave),
202
- onKeyDown: this.handleKeydown,
203
- role: j === "warning" ? "alert" : this.props.role
204
- })), /* @__PURE__ */ n.createElement(
205
- a,
206
- i.cn("SDismiss", {
244
+ value: function render() {
245
+ var _ref4;
246
+ var SBubble = FocusLock;
247
+ var SDismiss = Button;
248
+ var SContent = Flex;
249
+ var SMessage = "div";
250
+ var SAction = "div";
251
+ var SIcon = Flex;
252
+ var _this$props = this.props, forwardRef = _this$props.forwardRef, styles = _this$props.styles, onMouseEnter = _this$props.onMouseEnter, onMouseLeave = _this$props.onMouseLeave, getI18nText = _this$props.getI18nText, icon = _this$props.icon, children = _this$props.children, actionNode = _this$props.action, type = _this$props.type, other = _objectWithoutProperties(_this$props, _excluded2);
253
+ return _ref4 = sstyled(styles), /* @__PURE__ */ React.createElement(SBubble, _ref4.cn("SBubble", _objectSpread(_objectSpread({}, other), {}, {
254
+ "ref": forkRef(forwardRef, this.ref),
255
+ "onMouseEnter": callAllEventHandlers(onMouseEnter, this.handleMouseEnter),
256
+ "onMouseLeave": callAllEventHandlers(onMouseLeave, this.handleMouseLeave),
257
+ "onKeyDown": this.handleKeydown,
258
+ "role": type === "warning" ? "alert" : this.props.role
259
+ })), /* @__PURE__ */ React.createElement(
260
+ SDismiss,
261
+ _ref4.cn("SDismiss", {
207
262
  "aria-haspopup": void 0,
208
- type: "button",
209
- use: "tertiary",
210
- size: "m",
211
- theme: "invert",
212
- onClick: this.handleClose,
213
- "aria-label": w("close"),
214
- active: !1,
215
- title: w("close"),
216
- ref: this.closeButtonRef
263
+ "type": "button",
264
+ "use": "tertiary",
265
+ "size": "m",
266
+ "theme": "invert",
267
+ "onClick": this.handleClose,
268
+ "aria-label": getI18nText("close"),
269
+ "active": false,
270
+ "title": getI18nText("close"),
271
+ "ref": this.closeButtonRef
217
272
  }),
218
- /* @__PURE__ */ n.createElement(D.Addon, {
219
- tag: Q,
273
+ /* @__PURE__ */ React.createElement(Button.Addon, {
274
+ tag: CloseIcon,
220
275
  color: "icon-primary-invert"
221
276
  })
222
- ), N(E) ? /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(_, i.cn("SIcon", {}), E), /* @__PURE__ */ n.createElement(o, i.cn("SContent", {}), /* @__PURE__ */ n.createElement(c, i.cn("SMessage", {}), W), N(B) ? /* @__PURE__ */ n.createElement(p, i.cn("SAction", {}), B) : null)) : /* @__PURE__ */ n.createElement(o, i.cn("SContent", {}), /* @__PURE__ */ n.createElement(c, i.cn("SMessage", {}), W), N(B) ? /* @__PURE__ */ n.createElement(p, i.cn("SAction", {}), B) : null));
277
+ ), isNode(icon) ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(SIcon, _ref4.cn("SIcon", {}), icon), /* @__PURE__ */ React.createElement(SContent, _ref4.cn("SContent", {}), /* @__PURE__ */ React.createElement(SMessage, _ref4.cn("SMessage", {}), children), isNode(actionNode) ? /* @__PURE__ */ React.createElement(SAction, _ref4.cn("SAction", {}), actionNode) : null)) : /* @__PURE__ */ React.createElement(SContent, _ref4.cn("SContent", {}), /* @__PURE__ */ React.createElement(SMessage, _ref4.cn("SMessage", {}), children), isNode(actionNode) ? /* @__PURE__ */ React.createElement(SAction, _ref4.cn("SAction", {}), actionNode) : null));
223
278
  }
224
- }]), t;
225
- }(P), U = /* @__PURE__ */ function(m) {
226
- x(t, m);
227
- var l = b(t);
228
- function t() {
229
- return v(this, t), l.apply(this, arguments);
279
+ }]);
280
+ return ViewInfo2;
281
+ }(Component);
282
+ var ViewWarning = /* @__PURE__ */ function(_ViewInfo) {
283
+ _inherits(ViewWarning2, _ViewInfo);
284
+ var _super3 = _createSuper(ViewWarning2);
285
+ function ViewWarning2() {
286
+ _classCallCheck(this, ViewWarning2);
287
+ return _super3.apply(this, arguments);
230
288
  }
231
- return h(t);
232
- }(R);
233
- s(U, "defaultProps", {
289
+ return _createClass(ViewWarning2);
290
+ }(ViewInfo);
291
+ _defineProperty(ViewWarning, "defaultProps", {
234
292
  type: "warning",
235
293
  duration: 0
236
294
  });
237
- var T = /* @__PURE__ */ function(m) {
238
- x(t, m);
239
- var l = b(t);
240
- function t() {
241
- var e;
242
- v(this, t);
243
- for (var i = arguments.length, r = new Array(i), a = 0; a < i; a++)
244
- r[a] = arguments[a];
245
- return e = l.call.apply(l, [this].concat(r)), s(g(e), "_notice", null), e;
295
+ var NoticeBubbleView = /* @__PURE__ */ function(_Component3) {
296
+ _inherits(NoticeBubbleView2, _Component3);
297
+ var _super4 = _createSuper(NoticeBubbleView2);
298
+ function NoticeBubbleView2() {
299
+ var _this4;
300
+ _classCallCheck(this, NoticeBubbleView2);
301
+ for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
302
+ args[_key3] = arguments[_key3];
303
+ }
304
+ _this4 = _super4.call.apply(_super4, [this].concat(args));
305
+ _defineProperty(_assertThisInitialized(_this4), "_notice", null);
306
+ return _this4;
246
307
  }
247
- return h(t, [{
308
+ _createClass(NoticeBubbleView2, [{
248
309
  key: "componentDidMount",
249
- value: function() {
310
+ value: function componentDidMount() {
250
311
  this._notice = this.asProps.manager.add(this.asProps);
251
312
  }
252
313
  }, {
253
314
  key: "componentWillUnmount",
254
- value: function() {
255
- this._notice && this._notice.remove();
315
+ value: function componentWillUnmount() {
316
+ if (this._notice) {
317
+ this._notice.remove();
318
+ }
256
319
  }
257
320
  }, {
258
321
  key: "componentDidUpdate",
259
- value: function() {
260
- this._notice && this._notice.update(this.asProps);
322
+ value: function componentDidUpdate() {
323
+ if (this._notice) {
324
+ this._notice.update(this.asProps);
325
+ }
261
326
  }
262
327
  }, {
263
328
  key: "render",
264
- value: function() {
329
+ value: function render() {
265
330
  return null;
266
331
  }
267
- }]), t;
268
- }(P);
269
- s(T, "defaultProps", {
332
+ }]);
333
+ return NoticeBubbleView2;
334
+ }(Component);
335
+ _defineProperty(NoticeBubbleView, "defaultProps", {
270
336
  duration: 5e3,
271
337
  type: "info",
272
- manager: L
338
+ manager: noticeBubbleDefaultManager
273
339
  });
274
- var $ = /* @__PURE__ */ function(m) {
275
- x(t, m);
276
- var l = b(t);
277
- function t() {
278
- return v(this, t), l.apply(this, arguments);
340
+ var NoticeBubbleWarningView = /* @__PURE__ */ function(_NoticeBubbleView) {
341
+ _inherits(NoticeBubbleWarningView2, _NoticeBubbleView);
342
+ var _super5 = _createSuper(NoticeBubbleWarningView2);
343
+ function NoticeBubbleWarningView2() {
344
+ _classCallCheck(this, NoticeBubbleWarningView2);
345
+ return _super5.apply(this, arguments);
279
346
  }
280
- return h(t);
281
- }(T);
282
- s($, "defaultProps", {
347
+ return _createClass(NoticeBubbleWarningView2);
348
+ }(NoticeBubbleView);
349
+ _defineProperty(NoticeBubbleWarningView, "defaultProps", {
283
350
  duration: 5e3,
284
351
  type: "warning",
285
- manager: L
352
+ manager: noticeBubbleDefaultManager
353
+ });
354
+ var NoticeBubbleContainer = createComponent(NoticeBubbleContainerRoot, {
355
+ Info: NoticeBubbleView,
356
+ Warning: NoticeBubbleWarningView
286
357
  });
287
- var Z = Y(y, {
288
- Info: T,
289
- Warning: $
290
- }), je = Z.Info, Ke = Z.Warning;
358
+ var NoticeBubble = NoticeBubbleContainer.Info;
359
+ var NoticeBubbleWarning = NoticeBubbleContainer.Warning;
291
360
  export {
292
- je as NoticeBubble,
293
- Ke as NoticeBubbleWarning,
294
- Z as default
361
+ NoticeBubble,
362
+ NoticeBubbleWarning,
363
+ NoticeBubbleContainer as default
295
364
  };
@@ -1,91 +1,122 @@
1
- import s from "@babel/runtime/helpers/esm/objectSpread2";
2
- import f from "@babel/runtime/helpers/esm/classCallCheck";
3
- import c from "@babel/runtime/helpers/esm/createClass";
4
- import u from "@babel/runtime/helpers/esm/defineProperty";
5
- import l from "@semcore/core/lib/utils/eventEmitter";
6
- import { callAllEventHandlers as h } from "@semcore/core/lib/utils/assignProps";
7
- import { setFocus as d } from "@semcore/core/lib/utils/use/useFocusLock";
8
- import v from "react";
9
- var m = "CHANGE", p = /* @__PURE__ */ function() {
10
- function a() {
11
- f(this, a), u(this, "items", []), u(this, "emitter", null), u(this, "counter", 0), u(this, "replaceTimer", 0), this.emitter = new l();
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
4
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
5
+ import EventEmitter from "@semcore/core/lib/utils/eventEmitter";
6
+ import { callAllEventHandlers } from "@semcore/core/lib/utils/assignProps";
7
+ import { setFocus } from "@semcore/core/lib/utils/use/useFocusLock";
8
+ import React from "react";
9
+ var EVENT_NAME = "CHANGE";
10
+ var NoticeBubbleManager = /* @__PURE__ */ function() {
11
+ function NoticeBubbleManager2() {
12
+ _classCallCheck(this, NoticeBubbleManager2);
13
+ _defineProperty(this, "items", []);
14
+ _defineProperty(this, "emitter", null);
15
+ _defineProperty(this, "counter", 0);
16
+ _defineProperty(this, "replaceTimer", 0);
17
+ this.emitter = new EventEmitter();
12
18
  }
13
- return c(a, [{
19
+ _createClass(NoticeBubbleManager2, [{
14
20
  key: "addListener",
15
- value: function(e) {
16
- return this.emitter.subscribe(m, e);
21
+ value: function addListener(fn) {
22
+ return this.emitter.subscribe(EVENT_NAME, fn);
17
23
  }
18
24
  }, {
19
25
  key: "createItem",
20
- value: function(e) {
21
- var t = this;
22
- return s(s({
26
+ value: function createItem(props) {
27
+ var manager = this;
28
+ return _objectSpread(_objectSpread({
23
29
  type: "info"
24
- }, e), {}, {
25
- onClose: h(e.onClose, function() {
26
- t.remove(e.uid);
30
+ }, props), {}, {
31
+ onClose: callAllEventHandlers(props.onClose, function() {
32
+ manager.remove(props.uid);
27
33
  })
28
34
  });
29
35
  }
30
36
  }, {
31
37
  key: "emit",
32
- value: function() {
33
- this.emitter.emit(m, this.items);
38
+ value: function emit() {
39
+ this.emitter.emit(EVENT_NAME, this.items);
34
40
  }
35
41
  }, {
36
42
  key: "add",
37
- value: function(e) {
38
- var t = this.counter++, i = /* @__PURE__ */ v.createRef(), r = function() {
43
+ value: function add(props) {
44
+ var uid = this.counter++;
45
+ var ref = /* @__PURE__ */ React.createRef();
46
+ var focus = function focus2() {
39
47
  return setTimeout(function() {
40
- return d(i.current);
48
+ return setFocus(ref.current);
41
49
  }, 0);
42
- }, o = this.createItem(s({
43
- uid: t,
44
- visible: e.initialAnimation ? !0 : void 0,
45
- forwardRef: i
46
- }, e));
47
- return this.items.push(o), this.emit(), {
48
- uid: t,
49
- update: this.update.bind(this, t),
50
- remove: this.remove.bind(this, t),
51
- ref: i,
50
+ };
51
+ var item = this.createItem(_objectSpread({
52
+ uid,
53
+ visible: props.initialAnimation ? true : void 0,
54
+ forwardRef: ref
55
+ }, props));
56
+ this.items.push(item);
57
+ this.emit();
58
+ return {
59
+ uid,
60
+ update: this.update.bind(this, uid),
61
+ remove: this.remove.bind(this, uid),
62
+ ref,
52
63
  // todo Brauer Ilia: remove this property, because we added logic about autofocus in Notice
53
- focus: r
64
+ focus
54
65
  };
55
66
  }
56
67
  }, {
57
68
  key: "update",
58
- value: function(e, t) {
59
- var i = this.items.findIndex(function(r) {
60
- return r.uid === e;
69
+ value: function update(uid, props) {
70
+ var index = this.items.findIndex(function(item) {
71
+ return item.uid === uid;
61
72
  });
62
- return i !== -1 ? (this.items[i] = this.createItem(s(s({}, this.items[i]), t)), this.emit(), !0) : !1;
73
+ if (index !== -1) {
74
+ this.items[index] = this.createItem(_objectSpread(_objectSpread({}, this.items[index]), props));
75
+ this.emit();
76
+ return true;
77
+ }
78
+ return false;
63
79
  }
64
80
  }, {
65
81
  key: "replaceLast",
66
- value: function(e) {
67
- var t = this;
68
- this.replaceTimer && clearTimeout(this.replaceTimer);
69
- var i = this.items[this.items.length - 1];
70
- i != null && i.visible && this.remove(this.counter - 1), this.replaceTimer = setTimeout(function() {
71
- t.add(e);
82
+ value: function replaceLast(props) {
83
+ var _this = this;
84
+ if (this.replaceTimer) {
85
+ clearTimeout(this.replaceTimer);
86
+ }
87
+ var item = this.items[this.items.length - 1];
88
+ if (item !== null && item !== void 0 && item.visible) {
89
+ this.remove(this.counter - 1);
90
+ }
91
+ this.replaceTimer = setTimeout(function() {
92
+ _this.add(props);
72
93
  }, 300);
73
94
  }
74
95
  }, {
75
96
  key: "remove",
76
- value: function(e) {
77
- var t = this, i = this.items.find(function(r) {
78
- return r.uid === e;
97
+ value: function remove(uid) {
98
+ var _this2 = this;
99
+ var item = this.items.find(function(item2) {
100
+ return item2.uid === uid;
79
101
  });
80
- return i ? (i.visible = !1, setTimeout(function() {
81
- t.items = t.items.filter(function(r) {
82
- return r.uid !== e;
83
- }), t.emit();
84
- }, 1e3), this.emit(), !0) : !1;
102
+ if (item) {
103
+ item.visible = false;
104
+ setTimeout(function() {
105
+ _this2.items = _this2.items.filter(function(item2) {
106
+ return item2.uid !== uid;
107
+ });
108
+ _this2.emit();
109
+ }, 1e3);
110
+ this.emit();
111
+ return true;
112
+ }
113
+ return false;
85
114
  }
86
- }]), a;
87
- }(), N = new p();
115
+ }]);
116
+ return NoticeBubbleManager2;
117
+ }();
118
+ var noticeBubbleDefaultManager = new NoticeBubbleManager();
88
119
  export {
89
- p as NoticeBubbleManager,
90
- N as default
120
+ NoticeBubbleManager,
121
+ noticeBubbleDefaultManager as default
91
122
  };
package/lib/esm/index.mjs CHANGED
@@ -1,11 +1,11 @@
1
- import { NoticeBubble as r, default as b, NoticeBubbleWarning as i } from "./NoticeBubble.mjs";
2
- import o from "./NoticeBubbleManager.mjs";
3
- import { NoticeBubbleManager as u } from "./NoticeBubbleManager.mjs";
1
+ import { NoticeBubble, default as default2, NoticeBubbleWarning } from "./NoticeBubble.mjs";
2
+ import noticeBubbleDefaultManager from "./NoticeBubbleManager.mjs";
3
+ import { NoticeBubbleManager } from "./NoticeBubbleManager.mjs";
4
4
  export {
5
- r as NoticeBubble,
6
- b as NoticeBubbleContainer,
7
- u as NoticeBubbleManager,
8
- i as NoticeBubbleWarning,
9
- o as default,
10
- o as noticeBubbleDefaultManager
5
+ NoticeBubble,
6
+ default2 as NoticeBubbleContainer,
7
+ NoticeBubbleManager,
8
+ NoticeBubbleWarning,
9
+ noticeBubbleDefaultManager as default,
10
+ noticeBubbleDefaultManager
11
11
  };
@@ -1,33 +1,33 @@
1
- import r from "./de.json.mjs";
2
- import o from "./en.json.mjs";
3
- import m from "./es.json.mjs";
4
- import t from "./fr.json.mjs";
5
- import i from "./it.json.mjs";
6
- import p from "./ja.json.mjs";
7
- import f from "./ko.json.mjs";
8
- import e from "./nl.json.mjs";
9
- import s from "./pt.json.mjs";
10
- import a from "./tr.json.mjs";
11
- import l from "./vi.json.mjs";
12
- import v from "./zh.json.mjs";
13
- import d from "./pl.json.mjs";
14
- import n from "./sv.json.mjs";
15
- var B = {
16
- de: r,
17
- en: o,
18
- es: m,
19
- fr: t,
20
- it: i,
21
- ja: p,
22
- ko: f,
23
- nl: e,
24
- pt: s,
25
- tr: a,
26
- vi: l,
27
- zh: v,
28
- pl: d,
29
- sv: n
1
+ import de from "./de.json.mjs";
2
+ import en from "./en.json.mjs";
3
+ import es from "./es.json.mjs";
4
+ import fr from "./fr.json.mjs";
5
+ import it from "./it.json.mjs";
6
+ import ja from "./ja.json.mjs";
7
+ import ko from "./ko.json.mjs";
8
+ import nl from "./nl.json.mjs";
9
+ import pt from "./pt.json.mjs";
10
+ import tr from "./tr.json.mjs";
11
+ import vi from "./vi.json.mjs";
12
+ import zh from "./zh.json.mjs";
13
+ import pl from "./pl.json.mjs";
14
+ import sv from "./sv.json.mjs";
15
+ var localizedMessages = {
16
+ de,
17
+ en,
18
+ es,
19
+ fr,
20
+ it,
21
+ ja,
22
+ ko,
23
+ nl,
24
+ pt,
25
+ tr,
26
+ vi,
27
+ zh,
28
+ pl,
29
+ sv
30
30
  };
31
31
  export {
32
- B as localizedMessages
32
+ localizedMessages
33
33
  };
@@ -1,9 +1,11 @@
1
- const n = "Schließen", c = "Benachrichtigungen", o = {
2
- close: n,
3
- notification: c
1
+ const close = "Schließen";
2
+ const notification = "Benachrichtigungen";
3
+ const de = {
4
+ close,
5
+ notification
4
6
  };
5
7
  export {
6
- n as close,
7
- o as default,
8
- c as notification
8
+ close,
9
+ de as default,
10
+ notification
9
11
  };
@@ -1,9 +1,11 @@
1
- const o = "Close", t = "Notifications", i = {
2
- close: o,
3
- notification: t
1
+ const close = "Close";
2
+ const notification = "Notifications";
3
+ const en = {
4
+ close,
5
+ notification
4
6
  };
5
7
  export {
6
- o as close,
7
- i as default,
8
- t as notification
8
+ close,
9
+ en as default,
10
+ notification
9
11
  };
@@ -1,9 +1,11 @@
1
- const o = "Cerrar", t = "Notificaciones", c = {
2
- close: o,
3
- notification: t
1
+ const close = "Cerrar";
2
+ const notification = "Notificaciones";
3
+ const es = {
4
+ close,
5
+ notification
4
6
  };
5
7
  export {
6
- o as close,
7
- c as default,
8
- t as notification
8
+ close,
9
+ es as default,
10
+ notification
9
11
  };
@@ -1,9 +1,11 @@
1
- const o = "Fermer", t = "Notifications", i = {
2
- close: o,
3
- notification: t
1
+ const close = "Fermer";
2
+ const notification = "Notifications";
3
+ const fr = {
4
+ close,
5
+ notification
4
6
  };
5
7
  export {
6
- o as close,
7
- i as default,
8
- t as notification
8
+ close,
9
+ fr as default,
10
+ notification
9
11
  };
@@ -1,9 +1,11 @@
1
- const i = "Chiudi", o = "Notifiche", t = {
2
- close: i,
3
- notification: o
1
+ const close = "Chiudi";
2
+ const notification = "Notifiche";
3
+ const it = {
4
+ close,
5
+ notification
4
6
  };
5
7
  export {
6
- i as close,
7
- t as default,
8
- o as notification
8
+ close,
9
+ it as default,
10
+ notification
9
11
  };
@@ -1,9 +1,11 @@
1
- const o = "閉じる", t = "通知", c = {
2
- close: o,
3
- notification: t
1
+ const close = "閉じる";
2
+ const notification = "通知";
3
+ const ja = {
4
+ close,
5
+ notification
4
6
  };
5
7
  export {
6
- o as close,
7
- c as default,
8
- t as notification
8
+ close,
9
+ ja as default,
10
+ notification
9
11
  };
@@ -1,9 +1,11 @@
1
- const o = "닫기", t = "알림", c = {
2
- close: o,
3
- notification: t
1
+ const close = "닫기";
2
+ const notification = "알림";
3
+ const ko = {
4
+ close,
5
+ notification
4
6
  };
5
7
  export {
6
- o as close,
7
- c as default,
8
- t as notification
8
+ close,
9
+ ko as default,
10
+ notification
9
11
  };
@@ -1,9 +1,11 @@
1
- const n = "Sluiten", o = "Meldingen", t = {
2
- close: n,
3
- notification: o
1
+ const close = "Sluiten";
2
+ const notification = "Meldingen";
3
+ const nl = {
4
+ close,
5
+ notification
4
6
  };
5
7
  export {
6
- n as close,
7
- t as default,
8
- o as notification
8
+ close,
9
+ nl as default,
10
+ notification
9
11
  };
@@ -1,9 +1,11 @@
1
- const o = "Zamknij", i = "Powiadomienia", n = {
2
- close: o,
3
- notification: i
1
+ const close = "Zamknij";
2
+ const notification = "Powiadomienia";
3
+ const pl = {
4
+ close,
5
+ notification
4
6
  };
5
7
  export {
6
- o as close,
7
- n as default,
8
- i as notification
8
+ close,
9
+ pl as default,
10
+ notification
9
11
  };
@@ -1,9 +1,11 @@
1
- const o = "Fechar", t = "Notificações", c = {
2
- close: o,
3
- notification: t
1
+ const close = "Fechar";
2
+ const notification = "Notificações";
3
+ const pt = {
4
+ close,
5
+ notification
4
6
  };
5
7
  export {
6
- o as close,
7
- c as default,
8
- t as notification
8
+ close,
9
+ pt as default,
10
+ notification
9
11
  };
@@ -1,9 +1,11 @@
1
- const o = "Stäng", t = "Aviseringar", n = {
2
- close: o,
3
- notification: t
1
+ const close = "Stäng";
2
+ const notification = "Aviseringar";
3
+ const sv = {
4
+ close,
5
+ notification
4
6
  };
5
7
  export {
6
- o as close,
7
- n as default,
8
- t as notification
8
+ close,
9
+ sv as default,
10
+ notification
9
11
  };
@@ -1,9 +1,11 @@
1
- const t = "Kapat", o = "Bildirimler", i = {
2
- close: t,
3
- notification: o
1
+ const close = "Kapat";
2
+ const notification = "Bildirimler";
3
+ const tr = {
4
+ close,
5
+ notification
4
6
  };
5
7
  export {
6
- t as close,
7
- i as default,
8
- o as notification
8
+ close,
9
+ tr as default,
10
+ notification
9
11
  };
@@ -1,9 +1,11 @@
1
- const o = "Đóng", n = "Thông báo", t = {
2
- close: o,
3
- notification: n
1
+ const close = "Đóng";
2
+ const notification = "Thông báo";
3
+ const vi = {
4
+ close,
5
+ notification
4
6
  };
5
7
  export {
6
- o as close,
7
- t as default,
8
- n as notification
8
+ close,
9
+ vi as default,
10
+ notification
9
11
  };
@@ -1,9 +1,11 @@
1
- const o = "关闭", t = "通知", c = {
2
- close: o,
3
- notification: t
1
+ const close = "关闭";
2
+ const notification = "通知";
3
+ const zh = {
4
+ close,
5
+ notification
4
6
  };
5
7
  export {
6
- o as close,
7
- c as default,
8
- t as notification
8
+ close,
9
+ zh as default,
10
+ notification
9
11
  };
package/lib/esm/utils.mjs CHANGED
@@ -1,31 +1,43 @@
1
- import s from "@babel/runtime/helpers/esm/classCallCheck";
2
- import a from "@babel/runtime/helpers/esm/createClass";
3
- var n = /* @__PURE__ */ function() {
4
- function t(e, i) {
5
- s(this, t), this.callback = e, this.delay = i, this.remaining = i, this.paused = !1, this.resume();
1
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
3
+ var Timer = /* @__PURE__ */ function() {
4
+ function Timer2(callback, delay) {
5
+ _classCallCheck(this, Timer2);
6
+ this.callback = callback;
7
+ this.delay = delay;
8
+ this.remaining = delay;
9
+ this.paused = false;
10
+ this.resume();
6
11
  }
7
- return a(t, [{
12
+ _createClass(Timer2, [{
8
13
  key: "pause",
9
- value: function() {
10
- clearTimeout(this.timerId), this.remaining -= Date.now() - this.start, this.paused = !0;
14
+ value: function pause() {
15
+ clearTimeout(this.timerId);
16
+ this.remaining -= Date.now() - this.start;
17
+ this.paused = true;
11
18
  }
12
19
  }, {
13
20
  key: "resume",
14
- value: function() {
15
- this.start = Date.now(), this.paused = !1, clearTimeout(this.timerId), this.timerId = setTimeout(this.callback, this.remaining);
21
+ value: function resume() {
22
+ this.start = Date.now();
23
+ this.paused = false;
24
+ clearTimeout(this.timerId);
25
+ this.timerId = setTimeout(this.callback, this.remaining);
16
26
  }
17
27
  }, {
18
28
  key: "reset",
19
- value: function() {
20
- this.remaining = this.delay, this.resume();
29
+ value: function reset() {
30
+ this.remaining = this.delay;
31
+ this.resume();
21
32
  }
22
33
  }, {
23
34
  key: "clear",
24
- value: function() {
35
+ value: function clear() {
25
36
  clearTimeout(this.timerId);
26
37
  }
27
- }]), t;
38
+ }]);
39
+ return Timer2;
28
40
  }();
29
41
  export {
30
- n as Timer
42
+ Timer
31
43
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/notice-bubble",
3
3
  "description": "Semrush NoticeBubble Component",
4
- "version": "16.0.0-prerelease.6",
4
+ "version": "16.0.0-prerelease.9",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -14,14 +14,14 @@
14
14
  "types": "./lib/types/index.d.ts"
15
15
  },
16
16
  "dependencies": {
17
- "@semcore/icon": "16.0.0-prerelease.6",
18
- "@semcore/portal": "16.0.0-prerelease.6",
19
- "@semcore/flex-box": "16.0.0-prerelease.6",
20
- "@semcore/animation": "16.0.0-prerelease.6",
21
- "@semcore/button": "16.0.0-prerelease.6"
17
+ "@semcore/icon": "16.0.0-prerelease.9",
18
+ "@semcore/portal": "16.0.0-prerelease.9",
19
+ "@semcore/flex-box": "16.0.0-prerelease.9",
20
+ "@semcore/animation": "16.0.0-prerelease.9",
21
+ "@semcore/button": "16.0.0-prerelease.9"
22
22
  },
23
23
  "peerDependencies": {
24
- "@semcore/base-components": "^16.0.0-prerelease.6"
24
+ "@semcore/base-components": "^16.0.0-prerelease.9"
25
25
  },
26
26
  "repository": {
27
27
  "type": "git",