@semcore/notice-bubble 4.4.1 → 4.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/CHANGELOG.md +7 -1
  2. package/lib/cjs/NoticeBubble.js +31 -19
  3. package/lib/cjs/NoticeBubble.js.map +1 -1
  4. package/lib/cjs/index.d.js.map +1 -1
  5. package/lib/cjs/translations/__intergalactic-dynamic-locales.js +46 -0
  6. package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -0
  7. package/lib/cjs/translations/de.json +3 -0
  8. package/lib/cjs/translations/en.json +3 -0
  9. package/lib/cjs/translations/es.json +3 -0
  10. package/lib/cjs/translations/fr.json +3 -0
  11. package/lib/cjs/translations/it.json +3 -0
  12. package/lib/cjs/translations/ja.json +3 -0
  13. package/lib/cjs/translations/ko.json +3 -0
  14. package/lib/cjs/translations/pt.json +3 -0
  15. package/lib/cjs/translations/tr.json +3 -0
  16. package/lib/cjs/translations/vi.json +3 -0
  17. package/lib/cjs/translations/zh.json +3 -0
  18. package/lib/es6/NoticeBubble.js +30 -19
  19. package/lib/es6/NoticeBubble.js.map +1 -1
  20. package/lib/es6/index.d.js.map +1 -1
  21. package/lib/es6/translations/__intergalactic-dynamic-locales.js +25 -0
  22. package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -0
  23. package/lib/es6/translations/de.json +3 -0
  24. package/lib/es6/translations/en.json +3 -0
  25. package/lib/es6/translations/es.json +3 -0
  26. package/lib/es6/translations/fr.json +3 -0
  27. package/lib/es6/translations/it.json +3 -0
  28. package/lib/es6/translations/ja.json +3 -0
  29. package/lib/es6/translations/ko.json +3 -0
  30. package/lib/es6/translations/pt.json +3 -0
  31. package/lib/es6/translations/tr.json +3 -0
  32. package/lib/es6/translations/vi.json +3 -0
  33. package/lib/es6/translations/zh.json +3 -0
  34. package/lib/types/index.d.ts +1 -0
  35. package/package.json +1 -1
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
+ ## [4.5.0] - 2022-12-14
6
+
7
+ ### Added
8
+
9
+ - Added internationalization of aria attributes.
10
+
5
11
  ## [4.4.1] - 2022-12-13
6
12
 
7
13
  ### Changed
@@ -18,7 +24,7 @@ CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangel
18
24
 
19
25
  ### Changed
20
26
 
21
- - Changed prop `initialAnimation` to otional.
27
+ - Changed prop `initialAnimation` to optional.
22
28
 
23
29
  ## [4.3.1] - 2022-12-06
24
30
 
@@ -47,7 +47,11 @@ var _m = _interopRequireDefault(require("@semcore/icon/Close/m"));
47
47
 
48
48
  var _utils = require("./utils");
49
49
 
50
- var _excluded = ["action", "forwardRef", "styles", "onMouseEnter", "onMouseLeave", "children"],
50
+ var _intergalacticDynamicLocales = require("./translations/__intergalactic-dynamic-locales");
51
+
52
+ var _i18nEnhance = _interopRequireDefault(require("@semcore/utils/lib/enhances/i18nEnhance"));
53
+
54
+ var _excluded = ["action", "forwardRef", "styles", "onMouseEnter", "onMouseLeave", "children", "getI18nText"],
51
55
  _excluded2 = ["action", "children", "styles", "forwardRef"];
52
56
 
53
57
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -67,20 +71,20 @@ var style = (
67
71
  /*__reshadow_css_start__*/
68
72
  _core.sstyled.insert(
69
73
  /*__inner_css_start__*/
70
- ".___SInfo_1ghap_gg_,.___SView_1ghap_gg_,.___SWarning_1ghap_gg_{position:relative;margin-bottom:var(--intergalactic-spacing-3x,12px);padding:var(--intergalactic-spacing-3x,12px) calc(var(--intergalactic-spacing-6x, 24px) + var(--intergalactic-spacing-1x, 4px)) var(--intergalactic-spacing-3x,12px) var(--intergalactic-spacing-3x,12px);width:100%;min-height:44px;border-radius:var(--intergalactic-rounded-medium,6px);overflow:hidden;box-sizing:border-box}.___SInfo_1ghap_gg_{background:var(--intergalactic-bg-primary-invert,#191b23)}.___SWarning_1ghap_gg_{background:var(--intergalactic-bg-primary-critical,#ff4953)}.___SMessage_1ghap_gg_{font-size:var(--intergalactic-fs-200,14px);color:var(--intergalactic-text-primary-invert,#fff);line-height:var(--intergalactic-lh-100,133%)}.___SDismiss_1ghap_gg_{cursor:pointer;position:absolute;right:0;top:0;padding:var(--intergalactic-spacing-2x,8px);color:var(--intergalactic-text-primary-invert,#fff)}.___SDismiss_1ghap_gg_:hover{color:var(--intergalactic-control-primary-invert-active,#e0e1e9)}.___SAction_1ghap_gg_{margin-top:var(--intergalactic-spacing-2x,8px)}.___SNoticeBubble_1ghap_gg_{width:300px;position:fixed;z-index:var(--intergalactic-z-index-notice-bubble,999);right:var(--intergalactic-spacing-3x,12px);top:var(--intergalactic-spacing-3x,12px)}@media (max-width:767px){.___SNoticeBubble_1ghap_gg_{width:calc(100% - var(--intergalactic-spacing-6x, 24px))}}@keyframes enter_1ghap{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes exit_1ghap{0%{opacity:1}to{opacity:0}}"
74
+ ".___SInfo_113l3_gg_,.___SView_113l3_gg_,.___SWarning_113l3_gg_{position:relative;margin-bottom:var(--intergalactic-spacing-3x,12px);padding:var(--intergalactic-spacing-3x,12px) calc(var(--intergalactic-spacing-6x, 24px) + var(--intergalactic-spacing-1x, 4px)) var(--intergalactic-spacing-3x,12px) var(--intergalactic-spacing-3x,12px);width:100%;min-height:44px;border-radius:var(--intergalactic-rounded-medium,6px);overflow:hidden;box-sizing:border-box}.___SInfo_113l3_gg_{background:var(--intergalactic-bg-primary-invert,#191b23)}.___SWarning_113l3_gg_{background:var(--intergalactic-bg-primary-critical,#ff4953)}.___SMessage_113l3_gg_{font-size:var(--intergalactic-fs-200,14px);color:var(--intergalactic-text-primary-invert,#fff);line-height:var(--intergalactic-lh-100,133%)}.___SDismiss_113l3_gg_{cursor:pointer;position:absolute;right:0;top:0;padding:var(--intergalactic-spacing-2x,8px);color:var(--intergalactic-text-primary-invert,#fff)}.___SDismiss_113l3_gg_:hover{color:var(--intergalactic-control-primary-invert-active,#e0e1e9)}.___SAction_113l3_gg_{margin-top:var(--intergalactic-spacing-2x,8px)}.___SNoticeBubble_113l3_gg_{width:300px;position:fixed;z-index:var(--intergalactic-z-index-notice-bubble,999);right:var(--intergalactic-spacing-3x,12px);top:var(--intergalactic-spacing-3x,12px)}@media (max-width:767px){.___SNoticeBubble_113l3_gg_{width:calc(100% - var(--intergalactic-spacing-6x, 24px))}}@keyframes enter_113l3{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes exit_113l3{0%{opacity:1}to{opacity:0}}"
71
75
  /*__inner_css_end__*/
72
- , "1ghap_gg_")
76
+ , "113l3_gg_")
73
77
  /*__reshadow_css_end__*/
74
78
  , {
75
- "__SInfo": "___SInfo_1ghap_gg_",
76
- "__SView": "___SView_1ghap_gg_",
77
- "__SWarning": "___SWarning_1ghap_gg_",
78
- "__SMessage": "___SMessage_1ghap_gg_",
79
- "__SDismiss": "___SDismiss_1ghap_gg_",
80
- "__SAction": "___SAction_1ghap_gg_",
81
- "__SNoticeBubble": "___SNoticeBubble_1ghap_gg_",
82
- "@enter": "enter_1ghap",
83
- "@exit": "exit_1ghap"
79
+ "__SInfo": "___SInfo_113l3_gg_",
80
+ "__SView": "___SView_113l3_gg_",
81
+ "__SWarning": "___SWarning_113l3_gg_",
82
+ "__SMessage": "___SMessage_113l3_gg_",
83
+ "__SDismiss": "___SDismiss_113l3_gg_",
84
+ "__SAction": "___SAction_113l3_gg_",
85
+ "__SNoticeBubble": "___SNoticeBubble_113l3_gg_",
86
+ "@enter": "enter_113l3",
87
+ "@exit": "exit_113l3"
84
88
  });
85
89
 
86
90
  var Notices = function Notices(props) {
@@ -99,7 +103,8 @@ var Notices = function Notices(props) {
99
103
  "duration": 250,
100
104
  "keyframes": [styles['@enter'], styles['@exit']]
101
105
  }), /*#__PURE__*/_react["default"].createElement(SView, _ref2.cn("SView", _objectSpread(_objectSpread({}, notice), {}, {
102
- "styles": notice.styles || styles
106
+ "styles": notice.styles || styles,
107
+ "getI18nText": props.getI18nText
103
108
  }))));
104
109
  });
105
110
  };
@@ -161,7 +166,8 @@ var NoticeBubbleContainerRoot = /*#__PURE__*/function (_Component) {
161
166
  var _this$asProps = this.asProps,
162
167
  Children = _this$asProps.Children,
163
168
  styles = _this$asProps.styles,
164
- disablePortal = _this$asProps.disablePortal;
169
+ disablePortal = _this$asProps.disablePortal,
170
+ getI18nText = _this$asProps.getI18nText;
165
171
  var _this$state = this.state,
166
172
  notices = _this$state.notices,
167
173
  warnings = _this$state.warnings;
@@ -173,11 +179,13 @@ var NoticeBubbleContainerRoot = /*#__PURE__*/function (_Component) {
173
179
  }, _ref))), /*#__PURE__*/_react["default"].createElement(Children, _ref3.cn("Children", {})), /*#__PURE__*/_react["default"].createElement(Notices, _ref3.cn("Notices", {
174
180
  "styles": styles,
175
181
  "data": warnings,
176
- "tag": ViewWarning
182
+ "tag": ViewWarning,
183
+ "getI18nText": getI18nText
177
184
  })), /*#__PURE__*/_react["default"].createElement(Notices, _ref3.cn("Notices", {
178
185
  "styles": styles,
179
186
  "data": notices,
180
- "tag": ViewInfo
187
+ "tag": ViewInfo,
188
+ "getI18nText": getI18nText
181
189
  }))));
182
190
  }
183
191
  }]);
@@ -195,8 +203,11 @@ var NoticeBubbleContainerRoot = /*#__PURE__*/function (_Component) {
195
203
 
196
204
  (0, _defineProperty2["default"])(NoticeBubbleContainerRoot, "displayName", 'NoticeBubbleContainer');
197
205
  (0, _defineProperty2["default"])(NoticeBubbleContainerRoot, "style", style);
206
+ (0, _defineProperty2["default"])(NoticeBubbleContainerRoot, "enhance", [(0, _i18nEnhance["default"])(_intergalacticDynamicLocales.localizedMessages)]);
198
207
  (0, _defineProperty2["default"])(NoticeBubbleContainerRoot, "defaultProps", {
199
- manager: _NoticeBubbleManager["default"]
208
+ manager: _NoticeBubbleManager["default"],
209
+ i18n: _intergalacticDynamicLocales.localizedMessages,
210
+ locale: 'en'
200
211
  });
201
212
 
202
213
  var ViewInfo = /*#__PURE__*/function (_Component2) {
@@ -272,6 +283,7 @@ var ViewInfo = /*#__PURE__*/function (_Component2) {
272
283
  onMouseEnter = _this$props.onMouseEnter,
273
284
  onMouseLeave = _this$props.onMouseLeave,
274
285
  children = _this$props.children,
286
+ getI18nText = _this$props.getI18nText,
275
287
  other = (0, _objectWithoutProperties2["default"])(_this$props, _excluded);
276
288
  return _ref4 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SInfo, _ref4.cn("SInfo", _objectSpread(_objectSpread({
277
289
  "role": "alert"
@@ -280,9 +292,9 @@ var ViewInfo = /*#__PURE__*/function (_Component2) {
280
292
  "onMouseEnter": (0, _assignProps2.callAllEventHandlers)(onMouseEnter, this.handlerMouseEnter),
281
293
  "onMouseLeave": (0, _assignProps2.callAllEventHandlers)(onMouseLeave, this.handlerMouseLeave)
282
294
  })), /*#__PURE__*/_react["default"].createElement(SDismiss, _ref4.cn("SDismiss", {
283
- "title": "Close",
295
+ "title": getI18nText('close'),
284
296
  "onClick": this.handlerClose,
285
- "aria-label": "Close alert"
297
+ "aria-label": getI18nText('close')
286
298
  }), /*#__PURE__*/_react["default"].createElement(_m["default"], _ref4.cn("CloseIcon", {}))), /*#__PURE__*/_react["default"].createElement(SMessage, _ref4.cn("SMessage", {}), children), (0, _isNode["default"])(actionNode) ? /*#__PURE__*/_react["default"].createElement(SAction, _ref4.cn("SAction", {}), actionNode) : null);
287
299
  }
288
300
  }]);
@@ -1 +1 @@
1
- {"version":3,"file":"NoticeBubble.js","names":["Notices","props","styles","data","tag","SView","ViewInfo","map","notice","sstyled","uid","initialAnimation","visible","undefined","NoticeBubbleContainerRoot","notices","warnings","_unsubscribe","info","filter","type","warning","setState","manager","counter","addListener","handleChange","SNoticeBubble","Box","asProps","Children","disablePortal","state","ViewWarning","Component","style","e","fire","clearTimer","timer","pause","resume","duration","Timer","handlerClose","clear","SInfo","SMessage","SAction","SDismiss","actionNode","action","forwardRef","onMouseEnter","onMouseLeave","children","other","callAllEventHandlers","handlerMouseEnter","handlerMouseLeave","isNode","SWarning","NoticeBubbleView","_notice","add","remove","update","NoticeBubbleWarningView","NoticeBubbleContainer","createComponent","Info","Warning","NoticeBubble","NoticeBubbleWarning"],"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 { Box } from '@semcore/flex-box';\nimport fire from '@semcore/utils/lib/fire';\nimport isNode from '@semcore/utils/lib/isNode';\nimport { callAllEventHandlers } from '@semcore/utils/lib/assignProps';\nimport CloseIcon from '@semcore/icon/Close/m';\nimport { Timer } from './utils';\n\nimport style from './style/notice-bubble.shadow.css';\n\nconst Notices = (props) => {\n const { styles, data = [], tag: SView = ViewInfo } = props;\n\n return data.map((notice) => {\n return sstyled(styles)(\n <Animation\n key={notice.uid}\n initialAnimation={notice.initialAnimation}\n visible={notice.visible === undefined ? true : notice.visible}\n duration={250}\n keyframes={[styles['@enter'], styles['@exit']]}\n >\n <SView {...notice} styles={notice.styles || styles} />\n </Animation>,\n );\n });\n};\n\n/**\n * ```js\n * import { NoticeBubble } from \"@semcore/notice-bubble\"\n * ```\n *\n * Container is a portal (React.Portal) in the body, inserted once into any part of the application\n * and subscribes to manager updates(NoticeBubbleManager)\n * */\n\nclass NoticeBubbleContainerRoot extends Component {\n static displayName = 'NoticeBubbleContainer';\n static style = style;\n static defaultProps = {\n manager,\n };\n\n _unsubscribe = null;\n\n state = {\n notices: [],\n warnings: [],\n };\n\n constructor(props) {\n super(props);\n props.manager.counter = 0;\n this._unsubscribe = props.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 { Children, styles, disablePortal } = this.asProps;\n const { notices, warnings } = this.state;\n\n return sstyled(styles)(\n <Portal disablePortal={disablePortal}>\n <SNoticeBubble render={Box} role=\"alert\" aria-live=\"assertive\">\n <Children />\n <Notices styles={styles} data={warnings} tag={ViewWarning} />\n <Notices styles={styles} data={notices} tag={ViewInfo} />\n </SNoticeBubble>\n </Portal>,\n );\n }\n}\n/**\n * ```js\n * import { NoticeBubble } from \"@semcore/notice-bubble\"\n * <NoticeBubble.Info/>\n * ```\n *\n * View component, the appearance of the notice\n * */\nclass ViewInfo extends Component {\n timer = null;\n\n componentDidMount() {\n const { duration } = this.props;\n if (duration) {\n this.timer = new Timer(this.handlerClose, duration);\n }\n }\n\n componentWillUnmount() {\n this.clearTimer();\n }\n\n clearTimer() {\n if (this.timer) {\n this.timer.clear();\n this.timer = null;\n }\n }\n\n handlerClose = (e) => {\n // because call not only click\n fire(this, 'onClose', e);\n this.clearTimer();\n };\n\n handlerMouseEnter = () => {\n if (this.timer) {\n this.timer.pause();\n }\n };\n\n handlerMouseLeave = () => {\n if (this.timer) {\n this.timer.resume();\n }\n };\n\n render() {\n const SInfo = Box;\n const SMessage = 'div';\n const SAction = 'div';\n const SDismiss = 'div';\n const {\n action: actionNode,\n forwardRef,\n styles,\n onMouseEnter,\n onMouseLeave,\n children,\n ...other\n } = this.props;\n\n return sstyled(styles)(\n <SInfo\n role=\"alert\"\n {...other}\n ref={forwardRef}\n onMouseEnter={callAllEventHandlers(onMouseEnter, this.handlerMouseEnter)}\n onMouseLeave={callAllEventHandlers(onMouseLeave, this.handlerMouseLeave)}\n >\n <SDismiss title=\"Close\" onClick={this.handlerClose} aria-label=\"Close alert\">\n <CloseIcon />\n </SDismiss>\n <SMessage>{children}</SMessage>\n {isNode(actionNode) ? <SAction>{actionNode}</SAction> : null}\n </SInfo>,\n );\n }\n}\n\nclass ViewWarning extends ViewInfo {\n static defaultProps = {\n type: 'warning',\n duration: 0,\n };\n\n render() {\n const SWarning = Box;\n const SMessage = 'div';\n const SAction = 'div';\n const { action: actionNode, children, styles, forwardRef, ...other } = this.props;\n\n return sstyled(styles)(\n <SWarning ref={forwardRef} role=\"alert\" {...other}>\n <SMessage>{children}</SMessage>\n {isNode(actionNode) ? <SAction>{actionNode}</SAction> : null}\n </SWarning>,\n );\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;;AAHA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAMA,OAAO,GAAG,SAAVA,OAAU,CAACC,KAAD,EAAW;EACzB,IAAQC,MAAR,GAAqDD,KAArD,CAAQC,MAAR;EAAA,kBAAqDD,KAArD,CAAgB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B,KAAKA,OAAL,CAAaG,MAAb,CAAoB,KAAKrC,OAAzB;MACD;IACF;;;WAED,kBAAS;MACP,OAAO,IAAP;IACD;;;EA3B4BK,e;;iCAAzB4B,gB,kBACkB;EACpBpB,QAAQ,EAAE,IADU;EAEpBtB,IAAI,EAAE,MAFc;EAGpBG,OAAO,EAAPA;AAHoB,C;;IA6BlB4C,uB;;;;;;;;;;;EAAgCL,gB;;iCAAhCK,uB,kBACkB;EACpBzB,QAAQ,EAAE,IADU;EAEpBtB,IAAI,EAAE,SAFc;EAGpBG,OAAO,EAAPA;AAHoB,C;AAOxB,IAAM6C,qBAAqB,GAAG,IAAAC,gBAAA,EAAgBvD,yBAAhB,EAA2C;EACvEwD,IAAI,EAAER,gBADiE;EAEvES,OAAO,EAAEJ;AAF8D,CAA3C,CAA9B;AAKA,IAAMK,YAAY,GAAGJ,qBAAqB,CAACE,IAA3C;;AACA,IAAMG,mBAAmB,GAAGL,qBAAqB,CAACG,OAAlD;;eAIeH,qB"}
1
+ {"version":3,"file":"NoticeBubble.js","names":["Notices","props","styles","data","tag","SView","ViewInfo","map","notice","sstyled","uid","initialAnimation","visible","undefined","getI18nText","NoticeBubbleContainerRoot","notices","warnings","_unsubscribe","info","filter","type","warning","setState","manager","counter","addListener","handleChange","SNoticeBubble","Box","asProps","Children","disablePortal","state","ViewWarning","Component","style","i18nEnhance","localizedMessages","i18n","locale","e","fire","clearTimer","timer","pause","resume","duration","Timer","handlerClose","clear","SInfo","SMessage","SAction","SDismiss","actionNode","action","forwardRef","onMouseEnter","onMouseLeave","children","other","callAllEventHandlers","handlerMouseEnter","handlerMouseLeave","isNode","SWarning","NoticeBubbleView","_notice","add","remove","update","NoticeBubbleWarningView","NoticeBubbleContainer","createComponent","Info","Warning","NoticeBubble","NoticeBubbleWarning"],"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 { Box } from '@semcore/flex-box';\nimport fire from '@semcore/utils/lib/fire';\nimport isNode from '@semcore/utils/lib/isNode';\nimport { callAllEventHandlers } from '@semcore/utils/lib/assignProps';\nimport CloseIcon from '@semcore/icon/Close/m';\nimport { Timer } from './utils';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\nimport i18nEnhance from '@semcore/utils/lib/enhances/i18nEnhance';\n\nimport style from './style/notice-bubble.shadow.css';\n\nconst Notices = (props) => {\n const { styles, data = [], tag: SView = ViewInfo } = props;\n\n return data.map((notice) => {\n return sstyled(styles)(\n <Animation\n key={notice.uid}\n initialAnimation={notice.initialAnimation}\n visible={notice.visible === undefined ? true : notice.visible}\n duration={250}\n keyframes={[styles['@enter'], styles['@exit']]}\n >\n <SView {...notice} styles={notice.styles || styles} getI18nText={props.getI18nText} />\n </Animation>,\n );\n });\n};\n\n/**\n * ```js\n * import { NoticeBubble } from \"@semcore/notice-bubble\"\n * ```\n *\n * Container is a portal (React.Portal) in the body, inserted once into any part of the application\n * and subscribes to manager updates(NoticeBubbleManager)\n * */\n\nclass NoticeBubbleContainerRoot extends Component {\n static displayName = 'NoticeBubbleContainer';\n static style = style;\n static enhance = [i18nEnhance(localizedMessages)];\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 constructor(props) {\n super(props);\n props.manager.counter = 0;\n this._unsubscribe = props.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 { Children, styles, disablePortal, getI18nText } = this.asProps;\n const { notices, warnings } = this.state;\n\n return sstyled(styles)(\n <Portal disablePortal={disablePortal}>\n <SNoticeBubble render={Box} role=\"alert\" aria-live=\"assertive\">\n <Children />\n <Notices styles={styles} data={warnings} tag={ViewWarning} getI18nText={getI18nText} />\n <Notices styles={styles} data={notices} tag={ViewInfo} getI18nText={getI18nText} />\n </SNoticeBubble>\n </Portal>,\n );\n }\n}\n/**\n * ```js\n * import { NoticeBubble } from \"@semcore/notice-bubble\"\n * <NoticeBubble.Info/>\n * ```\n *\n * View component, the appearance of the notice\n * */\nclass ViewInfo extends Component {\n timer = null;\n\n componentDidMount() {\n const { duration } = this.props;\n if (duration) {\n this.timer = new Timer(this.handlerClose, duration);\n }\n }\n\n componentWillUnmount() {\n this.clearTimer();\n }\n\n clearTimer() {\n if (this.timer) {\n this.timer.clear();\n this.timer = null;\n }\n }\n\n handlerClose = (e) => {\n // because call not only click\n fire(this, 'onClose', e);\n this.clearTimer();\n };\n\n handlerMouseEnter = () => {\n if (this.timer) {\n this.timer.pause();\n }\n };\n\n handlerMouseLeave = () => {\n if (this.timer) {\n this.timer.resume();\n }\n };\n\n render() {\n const SInfo = Box;\n const SMessage = 'div';\n const SAction = 'div';\n const SDismiss = 'div';\n const {\n action: actionNode,\n forwardRef,\n styles,\n onMouseEnter,\n onMouseLeave,\n children,\n getI18nText,\n ...other\n } = this.props;\n\n return sstyled(styles)(\n <SInfo\n role=\"alert\"\n {...other}\n ref={forwardRef}\n onMouseEnter={callAllEventHandlers(onMouseEnter, this.handlerMouseEnter)}\n onMouseLeave={callAllEventHandlers(onMouseLeave, this.handlerMouseLeave)}\n >\n <SDismiss\n title={getI18nText('close')}\n onClick={this.handlerClose}\n aria-label={getI18nText('close')}\n >\n <CloseIcon />\n </SDismiss>\n <SMessage>{children}</SMessage>\n {isNode(actionNode) ? <SAction>{actionNode}</SAction> : null}\n </SInfo>,\n );\n }\n}\n\nclass ViewWarning extends ViewInfo {\n static defaultProps = {\n type: 'warning',\n duration: 0,\n };\n\n render() {\n const SWarning = Box;\n const SMessage = 'div';\n const SAction = 'div';\n const { action: actionNode, children, styles, forwardRef, ...other } = this.props;\n\n return sstyled(styles)(\n <SWarning ref={forwardRef} role=\"alert\" {...other}>\n <SMessage>{children}</SMessage>\n {isNode(actionNode) ? <SAction>{actionNode}</SAction> : null}\n </SWarning>,\n );\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;;AAHA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAMA,OAAO,GAAG,SAAVA,OAAU,CAACC,KAAD,EAAW;EACzB,IAAQC,MAAR,GAAqDD,KAArD,CAAQC,MAAR;EAAA,kBAAqDD,KAArD,CAAgBE,IAAhB;EAAA,IAAgBA,IAAhB,4BAAuB,EAAvB;EAAA,iBAAqDF,KAArD,CAA2BG,GAA3B;EAAA,IAAgCC,KAAhC,2BAAwCC,QAAxC;EAEA,OAAOH,IAAI,CAACI,GAAL,CAAS,UAACC,MAAD,EAAY;IAAA;;IAC1B,eAAO,IAAAC,a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,OAAT,EAAkB;QAChB,KAAKA,OAAL,CAAaE,MAAb;MACD;IACF;;;WAED,8BAAqB;MACnB,IAAI,KAAKF,OAAT,EAAkB;QAChB,KAAKA,OAAL,CAAaG,MAAb,CAAoB,KAAKzC,OAAzB;MACD;IACF;;;WAED,kBAAS;MACP,OAAO,IAAP;IACD;;;EA3B4BK,e;;iCAAzBgC,gB,kBACkB;EACpBpB,QAAQ,EAAE,IADU;EAEpB1B,IAAI,EAAE,MAFc;EAGpBG,OAAO,EAAPA;AAHoB,C;;IA6BlBgD,uB;;;;;;;;;;;EAAgCL,gB;;iCAAhCK,uB,kBACkB;EACpBzB,QAAQ,EAAE,IADU;EAEpB1B,IAAI,EAAE,SAFc;EAGpBG,OAAO,EAAPA;AAHoB,C;AAOxB,IAAMiD,qBAAqB,GAAG,IAAAC,gBAAA,EAAgB3D,yBAAhB,EAA2C;EACvE4D,IAAI,EAAER,gBADiE;EAEvES,OAAO,EAAEJ;AAF8D,CAA3C,CAA9B;AAKA,IAAMK,YAAY,GAAGJ,qBAAqB,CAACE,IAA3C;;AACA,IAAMG,mBAAmB,GAAGL,qBAAqB,CAACG,OAAlD;;eAIeH,qB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import { IPortalProps } from '@semcore/portal';\nimport { CProps, ReturnEl } from '@semcore/core';\nimport { IBoxProps } from '@semcore/flex-box';\n\nexport interface INoticeBubbleContainerProps extends IBoxProps, IPortalProps {\n /** Manager copy */\n manager?: INoticeBubbleManager;\n}\n\nexport interface INoticeBubbleInfoProps extends INoticeBubbleProps {\n readonly type?: 'info';\n /** Notice display duration\n * @default 5000\n */\n duration?: number;\n /** Enables animation on first rendering\n * @default false\n */\n initialAnimation?: boolean;\n}\n\nexport interface INoticeBubbleWarningProps extends INoticeBubbleProps {\n readonly type?: 'warning';\n /**\n * Notice display duration\n * @default 0\n */\n duration?: number;\n /** Enables animation on first rendering\n * @default false\n */\n initialAnimation?: boolean;\n}\n\nexport interface INoticeBubbleProps extends IBoxProps {\n /**\n * Manager instance\n * @default NoticeBubbleManager()\n */\n manager?: INoticeBubbleManager;\n /**\n * Notice visibility\n */\n visible?: boolean;\n /** Adds controls (buttons, etc.) */\n action?: React.ReactNode;\n\n /** Triggered when the notice is closed */\n onClose?: (e?: React.SyntheticEvent) => void;\n}\n\nexport interface INoticeBubbleManager {\n /**\n * Adding a notice.\n * Takes the props properties of NoticeBubble.\n * Returns an object with the uid and the update, remove functions.\n * */\n add: (props: object) => {\n uid: string;\n update: (props: object) => boolean;\n remove: () => boolean;\n };\n /**\n * Updates the notice by uid.\n * Takes the uid-unique identifier and the props-properties of NoticeBubble.\n * Returns a successful or unsuccessful update.\n * */\n update: (uid: string, props: object) => boolean;\n /**\n * Deletes the notice by uid.\n * Takes an uid-unique identifier.\n * Returns a successful or unsuccessful deletion.\n * */\n remove: (uid: string) => boolean;\n}\n\ndeclare const NoticeBubble: <T>(props: INoticeBubbleInfoProps & T) => ReturnEl;\ndeclare const NoticeBubbleWarning: <T>(props: INoticeBubbleWarningProps & T) => ReturnEl;\ndeclare const NoticeBubbleContainer: (<T>(\n props: CProps<INoticeBubbleContainerProps & T>,\n) => ReturnEl) & {\n Info: typeof NoticeBubble;\n Warning: typeof NoticeBubbleWarning;\n};\ndeclare const NoticeBubbleManager: INoticeBubbleManager;\n\nexport { NoticeBubbleContainer, NoticeBubble, NoticeBubbleWarning, NoticeBubbleManager };\nexport default NoticeBubbleManager;\n"],"mappings":""}
1
+ {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import { IPortalProps } from '@semcore/portal';\nimport { CProps, ReturnEl } from '@semcore/core';\nimport { IBoxProps } from '@semcore/flex-box';\n\nexport interface INoticeBubbleContainerProps extends IBoxProps, IPortalProps {\n /** Manager copy */\n manager?: INoticeBubbleManager;\n locale?: string;\n}\n\nexport interface INoticeBubbleInfoProps extends INoticeBubbleProps {\n readonly type?: 'info';\n /** Notice display duration\n * @default 5000\n */\n duration?: number;\n /** Enables animation on first rendering\n * @default false\n */\n initialAnimation?: boolean;\n}\n\nexport interface INoticeBubbleWarningProps extends INoticeBubbleProps {\n readonly type?: 'warning';\n /**\n * Notice display duration\n * @default 0\n */\n duration?: number;\n /** Enables animation on first rendering\n * @default false\n */\n initialAnimation?: boolean;\n}\n\nexport interface INoticeBubbleProps extends IBoxProps {\n /**\n * Manager instance\n * @default NoticeBubbleManager()\n */\n manager?: INoticeBubbleManager;\n /**\n * Notice visibility\n */\n visible?: boolean;\n /** Adds controls (buttons, etc.) */\n action?: React.ReactNode;\n\n /** Triggered when the notice is closed */\n onClose?: (e?: React.SyntheticEvent) => void;\n}\n\nexport interface INoticeBubbleManager {\n /**\n * Adding a notice.\n * Takes the props properties of NoticeBubble.\n * Returns an object with the uid and the update, remove functions.\n * */\n add: (props: object) => {\n uid: string;\n update: (props: object) => boolean;\n remove: () => boolean;\n };\n /**\n * Updates the notice by uid.\n * Takes the uid-unique identifier and the props-properties of NoticeBubble.\n * Returns a successful or unsuccessful update.\n * */\n update: (uid: string, props: object) => boolean;\n /**\n * Deletes the notice by uid.\n * Takes an uid-unique identifier.\n * Returns a successful or unsuccessful deletion.\n * */\n remove: (uid: string) => boolean;\n}\n\ndeclare const NoticeBubble: <T>(props: INoticeBubbleInfoProps & T) => ReturnEl;\ndeclare const NoticeBubbleWarning: <T>(props: INoticeBubbleWarningProps & T) => ReturnEl;\ndeclare const NoticeBubbleContainer: (<T>(\n props: CProps<INoticeBubbleContainerProps & T>,\n) => ReturnEl) & {\n Info: typeof NoticeBubble;\n Warning: typeof NoticeBubbleWarning;\n};\ndeclare const NoticeBubbleManager: INoticeBubbleManager;\n\nexport { NoticeBubbleContainer, NoticeBubble, NoticeBubbleWarning, NoticeBubbleManager };\nexport default NoticeBubbleManager;\n"],"mappings":""}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.localizedMessages = void 0;
9
+
10
+ var _de = _interopRequireDefault(require("./de.json"));
11
+
12
+ var _en = _interopRequireDefault(require("./en.json"));
13
+
14
+ var _es = _interopRequireDefault(require("./es.json"));
15
+
16
+ var _fr = _interopRequireDefault(require("./fr.json"));
17
+
18
+ var _it = _interopRequireDefault(require("./it.json"));
19
+
20
+ var _ja = _interopRequireDefault(require("./ja.json"));
21
+
22
+ var _ko = _interopRequireDefault(require("./ko.json"));
23
+
24
+ var _pt = _interopRequireDefault(require("./pt.json"));
25
+
26
+ var _tr = _interopRequireDefault(require("./tr.json"));
27
+
28
+ var _vi = _interopRequireDefault(require("./vi.json"));
29
+
30
+ var _zh = _interopRequireDefault(require("./zh.json"));
31
+
32
+ var localizedMessages = {
33
+ de: _de["default"],
34
+ en: _en["default"],
35
+ es: _es["default"],
36
+ fr: _fr["default"],
37
+ it: _it["default"],
38
+ ja: _ja["default"],
39
+ ko: _ko["default"],
40
+ pt: _pt["default"],
41
+ tr: _tr["default"],
42
+ vi: _vi["default"],
43
+ zh: _zh["default"]
44
+ };
45
+ exports.localizedMessages = localizedMessages;
46
+ //# sourceMappingURL=__intergalactic-dynamic-locales.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"__intergalactic-dynamic-locales.js","names":["localizedMessages","de","en","es","fr","it","ja","ko","pt","tr","vi","zh"],"sources":["../../../src/translations/__intergalactic-dynamic-locales.ts"],"sourcesContent":["import de from './de.json';\nimport en from './en.json';\nimport es from './es.json';\nimport fr from './fr.json';\nimport it from './it.json';\nimport ja from './ja.json';\nimport ko from './ko.json';\nimport pt from './pt.json';\nimport tr from './tr.json';\nimport vi from './vi.json';\nimport zh from './zh.json';\n\nexport const localizedMessages = {\n de,\n en,\n es,\n fr,\n it,\n ja,\n ko,\n pt,\n tr,\n vi,\n zh,\n};\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEO,IAAMA,iBAAiB,GAAG;EAC/BC,EAAE,EAAFA,cAD+B;EAE/BC,EAAE,EAAFA,cAF+B;EAG/BC,EAAE,EAAFA,cAH+B;EAI/BC,EAAE,EAAFA,cAJ+B;EAK/BC,EAAE,EAAFA,cAL+B;EAM/BC,EAAE,EAAFA,cAN+B;EAO/BC,EAAE,EAAFA,cAP+B;EAQ/BC,EAAE,EAAFA,cAR+B;EAS/BC,EAAE,EAAFA,cAT+B;EAU/BC,EAAE,EAAFA,cAV+B;EAW/BC,EAAE,EAAFA;AAX+B,CAA1B"}
@@ -0,0 +1,3 @@
1
+ {
2
+ "close": "Schließen"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "close": "Close"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "close": "Cerrar"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "close": "Fermer"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "close": "Chiudi"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "close": "閉じる"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "close": "닫기"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "close": "Fechar"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "close": "Kapat"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "close": "Đóng"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "close": "关闭"
3
+ }
@@ -8,7 +8,7 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
8
8
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
9
  import { sstyled as _sstyled } from "@semcore/core";
10
10
  import { assignProps as _assignProps } from "@semcore/core";
11
- var _excluded = ["action", "forwardRef", "styles", "onMouseEnter", "onMouseLeave", "children"],
11
+ var _excluded = ["action", "forwardRef", "styles", "onMouseEnter", "onMouseLeave", "children", "getI18nText"],
12
12
  _excluded2 = ["action", "children", "styles", "forwardRef"];
13
13
 
14
14
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
@@ -30,26 +30,28 @@ import isNode from '@semcore/utils/lib/isNode';
30
30
  import { callAllEventHandlers } from '@semcore/utils/lib/assignProps';
31
31
  import CloseIcon from '@semcore/icon/Close/m';
32
32
  import { Timer } from './utils';
33
+ import { localizedMessages } from './translations/__intergalactic-dynamic-locales';
34
+ import i18nEnhance from '@semcore/utils/lib/enhances/i18nEnhance';
33
35
 
34
36
  /*__reshadow-styles__:"./style/notice-bubble.shadow.css"*/
35
37
  var style = (
36
38
  /*__reshadow_css_start__*/
37
39
  _sstyled.insert(
38
40
  /*__inner_css_start__*/
39
- ".___SInfo_1ghap_gg_,.___SView_1ghap_gg_,.___SWarning_1ghap_gg_{position:relative;margin-bottom:var(--intergalactic-spacing-3x,12px);padding:var(--intergalactic-spacing-3x,12px) calc(var(--intergalactic-spacing-6x, 24px) + var(--intergalactic-spacing-1x, 4px)) var(--intergalactic-spacing-3x,12px) var(--intergalactic-spacing-3x,12px);width:100%;min-height:44px;border-radius:var(--intergalactic-rounded-medium,6px);overflow:hidden;box-sizing:border-box}.___SInfo_1ghap_gg_{background:var(--intergalactic-bg-primary-invert,#191b23)}.___SWarning_1ghap_gg_{background:var(--intergalactic-bg-primary-critical,#ff4953)}.___SMessage_1ghap_gg_{font-size:var(--intergalactic-fs-200,14px);color:var(--intergalactic-text-primary-invert,#fff);line-height:var(--intergalactic-lh-100,133%)}.___SDismiss_1ghap_gg_{cursor:pointer;position:absolute;right:0;top:0;padding:var(--intergalactic-spacing-2x,8px);color:var(--intergalactic-text-primary-invert,#fff)}.___SDismiss_1ghap_gg_:hover{color:var(--intergalactic-control-primary-invert-active,#e0e1e9)}.___SAction_1ghap_gg_{margin-top:var(--intergalactic-spacing-2x,8px)}.___SNoticeBubble_1ghap_gg_{width:300px;position:fixed;z-index:var(--intergalactic-z-index-notice-bubble,999);right:var(--intergalactic-spacing-3x,12px);top:var(--intergalactic-spacing-3x,12px)}@media (max-width:767px){.___SNoticeBubble_1ghap_gg_{width:calc(100% - var(--intergalactic-spacing-6x, 24px))}}@keyframes enter_1ghap{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes exit_1ghap{0%{opacity:1}to{opacity:0}}"
41
+ ".___SInfo_113l3_gg_,.___SView_113l3_gg_,.___SWarning_113l3_gg_{position:relative;margin-bottom:var(--intergalactic-spacing-3x,12px);padding:var(--intergalactic-spacing-3x,12px) calc(var(--intergalactic-spacing-6x, 24px) + var(--intergalactic-spacing-1x, 4px)) var(--intergalactic-spacing-3x,12px) var(--intergalactic-spacing-3x,12px);width:100%;min-height:44px;border-radius:var(--intergalactic-rounded-medium,6px);overflow:hidden;box-sizing:border-box}.___SInfo_113l3_gg_{background:var(--intergalactic-bg-primary-invert,#191b23)}.___SWarning_113l3_gg_{background:var(--intergalactic-bg-primary-critical,#ff4953)}.___SMessage_113l3_gg_{font-size:var(--intergalactic-fs-200,14px);color:var(--intergalactic-text-primary-invert,#fff);line-height:var(--intergalactic-lh-100,133%)}.___SDismiss_113l3_gg_{cursor:pointer;position:absolute;right:0;top:0;padding:var(--intergalactic-spacing-2x,8px);color:var(--intergalactic-text-primary-invert,#fff)}.___SDismiss_113l3_gg_:hover{color:var(--intergalactic-control-primary-invert-active,#e0e1e9)}.___SAction_113l3_gg_{margin-top:var(--intergalactic-spacing-2x,8px)}.___SNoticeBubble_113l3_gg_{width:300px;position:fixed;z-index:var(--intergalactic-z-index-notice-bubble,999);right:var(--intergalactic-spacing-3x,12px);top:var(--intergalactic-spacing-3x,12px)}@media (max-width:767px){.___SNoticeBubble_113l3_gg_{width:calc(100% - var(--intergalactic-spacing-6x, 24px))}}@keyframes enter_113l3{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes exit_113l3{0%{opacity:1}to{opacity:0}}"
40
42
  /*__inner_css_end__*/
41
- , "1ghap_gg_")
43
+ , "113l3_gg_")
42
44
  /*__reshadow_css_end__*/
43
45
  , {
44
- "__SInfo": "___SInfo_1ghap_gg_",
45
- "__SView": "___SView_1ghap_gg_",
46
- "__SWarning": "___SWarning_1ghap_gg_",
47
- "__SMessage": "___SMessage_1ghap_gg_",
48
- "__SDismiss": "___SDismiss_1ghap_gg_",
49
- "__SAction": "___SAction_1ghap_gg_",
50
- "__SNoticeBubble": "___SNoticeBubble_1ghap_gg_",
51
- "@enter": "enter_1ghap",
52
- "@exit": "exit_1ghap"
46
+ "__SInfo": "___SInfo_113l3_gg_",
47
+ "__SView": "___SView_113l3_gg_",
48
+ "__SWarning": "___SWarning_113l3_gg_",
49
+ "__SMessage": "___SMessage_113l3_gg_",
50
+ "__SDismiss": "___SDismiss_113l3_gg_",
51
+ "__SAction": "___SAction_113l3_gg_",
52
+ "__SNoticeBubble": "___SNoticeBubble_113l3_gg_",
53
+ "@enter": "enter_113l3",
54
+ "@exit": "exit_113l3"
53
55
  });
54
56
 
55
57
  var Notices = function Notices(props) {
@@ -68,7 +70,8 @@ var Notices = function Notices(props) {
68
70
  "duration": 250,
69
71
  "keyframes": [styles['@enter'], styles['@exit']]
70
72
  }), /*#__PURE__*/React.createElement(SView, _ref2.cn("SView", _objectSpread(_objectSpread({}, notice), {}, {
71
- "styles": notice.styles || styles
73
+ "styles": notice.styles || styles,
74
+ "getI18nText": props.getI18nText
72
75
  }))));
73
76
  });
74
77
  };
@@ -136,7 +139,8 @@ var NoticeBubbleContainerRoot = /*#__PURE__*/function (_Component) {
136
139
  var _this$asProps = this.asProps,
137
140
  Children = _this$asProps.Children,
138
141
  styles = _this$asProps.styles,
139
- disablePortal = _this$asProps.disablePortal;
142
+ disablePortal = _this$asProps.disablePortal,
143
+ getI18nText = _this$asProps.getI18nText;
140
144
  var _this$state = this.state,
141
145
  notices = _this$state.notices,
142
146
  warnings = _this$state.warnings;
@@ -148,11 +152,13 @@ var NoticeBubbleContainerRoot = /*#__PURE__*/function (_Component) {
148
152
  }, _ref))), /*#__PURE__*/React.createElement(Children, _ref3.cn("Children", {})), /*#__PURE__*/React.createElement(Notices, _ref3.cn("Notices", {
149
153
  "styles": styles,
150
154
  "data": warnings,
151
- "tag": ViewWarning
155
+ "tag": ViewWarning,
156
+ "getI18nText": getI18nText
152
157
  })), /*#__PURE__*/React.createElement(Notices, _ref3.cn("Notices", {
153
158
  "styles": styles,
154
159
  "data": notices,
155
- "tag": ViewInfo
160
+ "tag": ViewInfo,
161
+ "getI18nText": getI18nText
156
162
  }))));
157
163
  }
158
164
  }]);
@@ -173,8 +179,12 @@ _defineProperty(NoticeBubbleContainerRoot, "displayName", 'NoticeBubbleContainer
173
179
 
174
180
  _defineProperty(NoticeBubbleContainerRoot, "style", style);
175
181
 
182
+ _defineProperty(NoticeBubbleContainerRoot, "enhance", [i18nEnhance(localizedMessages)]);
183
+
176
184
  _defineProperty(NoticeBubbleContainerRoot, "defaultProps", {
177
- manager: manager
185
+ manager: manager,
186
+ i18n: localizedMessages,
187
+ locale: 'en'
178
188
  });
179
189
 
180
190
  var ViewInfo = /*#__PURE__*/function (_Component2) {
@@ -256,6 +266,7 @@ var ViewInfo = /*#__PURE__*/function (_Component2) {
256
266
  onMouseEnter = _this$props.onMouseEnter,
257
267
  onMouseLeave = _this$props.onMouseLeave,
258
268
  children = _this$props.children,
269
+ getI18nText = _this$props.getI18nText,
259
270
  other = _objectWithoutProperties(_this$props, _excluded);
260
271
 
261
272
  return _ref4 = sstyled(styles), /*#__PURE__*/React.createElement(SInfo, _ref4.cn("SInfo", _objectSpread(_objectSpread({
@@ -265,9 +276,9 @@ var ViewInfo = /*#__PURE__*/function (_Component2) {
265
276
  "onMouseEnter": callAllEventHandlers(onMouseEnter, this.handlerMouseEnter),
266
277
  "onMouseLeave": callAllEventHandlers(onMouseLeave, this.handlerMouseLeave)
267
278
  })), /*#__PURE__*/React.createElement(SDismiss, _ref4.cn("SDismiss", {
268
- "title": "Close",
279
+ "title": getI18nText('close'),
269
280
  "onClick": this.handlerClose,
270
- "aria-label": "Close alert"
281
+ "aria-label": getI18nText('close')
271
282
  }), /*#__PURE__*/React.createElement(CloseIcon, _ref4.cn("CloseIcon", {}))), /*#__PURE__*/React.createElement(SMessage, _ref4.cn("SMessage", {}), children), isNode(actionNode) ? /*#__PURE__*/React.createElement(SAction, _ref4.cn("SAction", {}), actionNode) : null);
272
283
  }
273
284
  }]);
@@ -1 +1 @@
1
- {"version":3,"file":"NoticeBubble.js","names":["React","Portal","manager","createComponent","Component","sstyled","Root","Animation","Box","fire","isNode","callAllEventHandlers","CloseIcon","Timer","Notices","props","styles","data","tag","SView","ViewInfo","map","notice","uid","initialAnimation","visible","undefined","NoticeBubbleContainerRoot","notices","warnings","_unsubscribe","info","filter","type","warning","setState","counter","addListener","handleChange","SNoticeBubble","asProps","Children","disablePortal","state","ViewWarning","style","e","clearTimer","timer","pause","resume","duration","handlerClose","clear","SInfo","SMessage","SAction","SDismiss","actionNode","action","forwardRef","onMouseEnter","onMouseLeave","children","other","handlerMouseEnter","handlerMouseLeave","SWarning","NoticeBubbleView","_notice","add","remove","update","NoticeBubbleWarningView","NoticeBubbleContainer","Info","Warning","NoticeBubble","NoticeBubbleWarning"],"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 { Box } from '@semcore/flex-box';\nimport fire from '@semcore/utils/lib/fire';\nimport isNode from '@semcore/utils/lib/isNode';\nimport { callAllEventHandlers } from '@semcore/utils/lib/assignProps';\nimport CloseIcon from '@semcore/icon/Close/m';\nimport { Timer } from './utils';\n\nimport style from './style/notice-bubble.shadow.css';\n\nconst Notices = (props) => {\n const { styles, data = [], tag: SView = ViewInfo } = props;\n\n return data.map((notice) => {\n return sstyled(styles)(\n <Animation\n key={notice.uid}\n initialAnimation={notice.initialAnimation}\n visible={notice.visible === undefined ? true : notice.visible}\n duration={250}\n keyframes={[styles['@enter'], styles['@exit']]}\n >\n <SView {...notice} styles={notice.styles || styles} />\n </Animation>,\n );\n });\n};\n\n/**\n * ```js\n * import { NoticeBubble } from \"@semcore/notice-bubble\"\n * ```\n *\n * Container is a portal (React.Portal) in the body, inserted once into any part of the application\n * and subscribes to manager updates(NoticeBubbleManager)\n * */\n\nclass NoticeBubbleContainerRoot extends Component {\n static displayName = 'NoticeBubbleContainer';\n static style = style;\n static defaultProps = {\n manager,\n };\n\n _unsubscribe = null;\n\n state = {\n notices: [],\n warnings: [],\n };\n\n constructor(props) {\n super(props);\n props.manager.counter = 0;\n this._unsubscribe = props.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 { Children, styles, disablePortal } = this.asProps;\n const { notices, warnings } = this.state;\n\n return sstyled(styles)(\n <Portal disablePortal={disablePortal}>\n <SNoticeBubble render={Box} role=\"alert\" aria-live=\"assertive\">\n <Children />\n <Notices styles={styles} data={warnings} tag={ViewWarning} />\n <Notices styles={styles} data={notices} tag={ViewInfo} />\n </SNoticeBubble>\n </Portal>,\n );\n }\n}\n/**\n * ```js\n * import { NoticeBubble } from \"@semcore/notice-bubble\"\n * <NoticeBubble.Info/>\n * ```\n *\n * View component, the appearance of the notice\n * */\nclass ViewInfo extends Component {\n timer = null;\n\n componentDidMount() {\n const { duration } = this.props;\n if (duration) {\n this.timer = new Timer(this.handlerClose, duration);\n }\n }\n\n componentWillUnmount() {\n this.clearTimer();\n }\n\n clearTimer() {\n if (this.timer) {\n this.timer.clear();\n this.timer = null;\n }\n }\n\n handlerClose = (e) => {\n // because call not only click\n fire(this, 'onClose', e);\n this.clearTimer();\n };\n\n handlerMouseEnter = () => {\n if (this.timer) {\n this.timer.pause();\n }\n };\n\n handlerMouseLeave = () => {\n if (this.timer) {\n this.timer.resume();\n }\n };\n\n render() {\n const SInfo = Box;\n const SMessage = 'div';\n const SAction = 'div';\n const SDismiss = 'div';\n const {\n action: actionNode,\n forwardRef,\n styles,\n onMouseEnter,\n onMouseLeave,\n children,\n ...other\n } = this.props;\n\n return sstyled(styles)(\n <SInfo\n role=\"alert\"\n {...other}\n ref={forwardRef}\n onMouseEnter={callAllEventHandlers(onMouseEnter, this.handlerMouseEnter)}\n onMouseLeave={callAllEventHandlers(onMouseLeave, this.handlerMouseLeave)}\n >\n <SDismiss title=\"Close\" onClick={this.handlerClose} aria-label=\"Close alert\">\n <CloseIcon />\n </SDismiss>\n <SMessage>{children}</SMessage>\n {isNode(actionNode) ? <SAction>{actionNode}</SAction> : null}\n </SInfo>,\n );\n }\n}\n\nclass ViewWarning extends ViewInfo {\n static defaultProps = {\n type: 'warning',\n duration: 0,\n };\n\n render() {\n const SWarning = Box;\n const SMessage = 'div';\n const SAction = 'div';\n const { action: actionNode, children, styles, forwardRef, ...other } = this.props;\n\n return sstyled(styles)(\n <SWarning ref={forwardRef} role=\"alert\" {...other}>\n <SMessage>{children}</SMessage>\n {isNode(actionNode) ? <SAction>{actionNode}</SAction> : null}\n </SWarning>,\n );\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":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,MAAP,MAAmB,iBAAnB;AACA,OAAOC,OAAP,MAAoB,uBAApB;AACA,OAAOC,eAAP,IAA0BC,SAA1B,EAAqCC,OAArC,EAA8CC,IAA9C,QAA0D,eAA1D;AACA,SAASC,SAAT,QAA0B,oBAA1B;AACA,SAASC,GAAT,QAAoB,mBAApB;AACA,OAAOC,IAAP,MAAiB,yBAAjB;AACA,OAAOC,MAAP,MAAmB,2BAAnB;AACA,SAASC,oBAAT,QAAqC,gCAArC;AACA,OAAOC,SAAP,MAAsB,uBAAtB;AACA,SAASC,KAAT,QAAsB,SAAtB;;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAMC,OAAO,GAAG,SAAVA,OAAU,CAACC,KAAD,EAAW;EACzB,IAAQC,MAAR,GAAqDD,KAArD,CAAQC,MAAR;EAAA,kBAAqDD,KAArD,CAAgBE,IAAhB;EAAA,IAAgBA,IAAhB,4BAAuB,EAAvB;EAAA,iBAAqDF,KAArD,CAA2BG,GAA3B;EAAA,IAAgCC,KAAhC,2BAAwCC,QAAxC;EAEA,OAAOH,IAAI,CAACI,GAAL,CAAS,UAACC,MAAD,EAAY;IAAA;;IAC1B,eAAOjB,OAAO,CAACW,MAAD,CAAd,eACE,oBAAC,SAAD;MAAA,OACOM,MAAM,CAACC,GADd;MAAA,oBAEoBD,MAAM,CAACE,gBAF3B;MAAA,WAGWF,MAAM,CAACG,OAAP,KAAmBC,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,EAAPA;AAHoB,C;;AAOxB,IAAMwE,qBAAqB,GAAGvE,eAAe,CAACwB,yBAAD,EAA4B;EACvEgD,IAAI,EAAEP,gBADiE;EAEvEQ,OAAO,EAAEH;AAF8D,CAA5B,CAA7C;AAKA,IAAMI,YAAY,GAAGH,qBAAqB,CAACC,IAA3C;AACA,IAAMG,mBAAmB,GAAGJ,qBAAqB,CAACE,OAAlD;AAEA,SAASC,YAAT,EAAuBC,mBAAvB;AAEA,eAAeJ,qBAAf"}
1
+ {"version":3,"file":"NoticeBubble.js","names":["React","Portal","manager","createComponent","Component","sstyled","Root","Animation","Box","fire","isNode","callAllEventHandlers","CloseIcon","Timer","localizedMessages","i18nEnhance","Notices","props","styles","data","tag","SView","ViewInfo","map","notice","uid","initialAnimation","visible","undefined","getI18nText","NoticeBubbleContainerRoot","notices","warnings","_unsubscribe","info","filter","type","warning","setState","counter","addListener","handleChange","SNoticeBubble","asProps","Children","disablePortal","state","ViewWarning","style","i18n","locale","e","clearTimer","timer","pause","resume","duration","handlerClose","clear","SInfo","SMessage","SAction","SDismiss","actionNode","action","forwardRef","onMouseEnter","onMouseLeave","children","other","handlerMouseEnter","handlerMouseLeave","SWarning","NoticeBubbleView","_notice","add","remove","update","NoticeBubbleWarningView","NoticeBubbleContainer","Info","Warning","NoticeBubble","NoticeBubbleWarning"],"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 { Box } from '@semcore/flex-box';\nimport fire from '@semcore/utils/lib/fire';\nimport isNode from '@semcore/utils/lib/isNode';\nimport { callAllEventHandlers } from '@semcore/utils/lib/assignProps';\nimport CloseIcon from '@semcore/icon/Close/m';\nimport { Timer } from './utils';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\nimport i18nEnhance from '@semcore/utils/lib/enhances/i18nEnhance';\n\nimport style from './style/notice-bubble.shadow.css';\n\nconst Notices = (props) => {\n const { styles, data = [], tag: SView = ViewInfo } = props;\n\n return data.map((notice) => {\n return sstyled(styles)(\n <Animation\n key={notice.uid}\n initialAnimation={notice.initialAnimation}\n visible={notice.visible === undefined ? true : notice.visible}\n duration={250}\n keyframes={[styles['@enter'], styles['@exit']]}\n >\n <SView {...notice} styles={notice.styles || styles} getI18nText={props.getI18nText} />\n </Animation>,\n );\n });\n};\n\n/**\n * ```js\n * import { NoticeBubble } from \"@semcore/notice-bubble\"\n * ```\n *\n * Container is a portal (React.Portal) in the body, inserted once into any part of the application\n * and subscribes to manager updates(NoticeBubbleManager)\n * */\n\nclass NoticeBubbleContainerRoot extends Component {\n static displayName = 'NoticeBubbleContainer';\n static style = style;\n static enhance = [i18nEnhance(localizedMessages)];\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 constructor(props) {\n super(props);\n props.manager.counter = 0;\n this._unsubscribe = props.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 { Children, styles, disablePortal, getI18nText } = this.asProps;\n const { notices, warnings } = this.state;\n\n return sstyled(styles)(\n <Portal disablePortal={disablePortal}>\n <SNoticeBubble render={Box} role=\"alert\" aria-live=\"assertive\">\n <Children />\n <Notices styles={styles} data={warnings} tag={ViewWarning} getI18nText={getI18nText} />\n <Notices styles={styles} data={notices} tag={ViewInfo} getI18nText={getI18nText} />\n </SNoticeBubble>\n </Portal>,\n );\n }\n}\n/**\n * ```js\n * import { NoticeBubble } from \"@semcore/notice-bubble\"\n * <NoticeBubble.Info/>\n * ```\n *\n * View component, the appearance of the notice\n * */\nclass ViewInfo extends Component {\n timer = null;\n\n componentDidMount() {\n const { duration } = this.props;\n if (duration) {\n this.timer = new Timer(this.handlerClose, duration);\n }\n }\n\n componentWillUnmount() {\n this.clearTimer();\n }\n\n clearTimer() {\n if (this.timer) {\n this.timer.clear();\n this.timer = null;\n }\n }\n\n handlerClose = (e) => {\n // because call not only click\n fire(this, 'onClose', e);\n this.clearTimer();\n };\n\n handlerMouseEnter = () => {\n if (this.timer) {\n this.timer.pause();\n }\n };\n\n handlerMouseLeave = () => {\n if (this.timer) {\n this.timer.resume();\n }\n };\n\n render() {\n const SInfo = Box;\n const SMessage = 'div';\n const SAction = 'div';\n const SDismiss = 'div';\n const {\n action: actionNode,\n forwardRef,\n styles,\n onMouseEnter,\n onMouseLeave,\n children,\n getI18nText,\n ...other\n } = this.props;\n\n return sstyled(styles)(\n <SInfo\n role=\"alert\"\n {...other}\n ref={forwardRef}\n onMouseEnter={callAllEventHandlers(onMouseEnter, this.handlerMouseEnter)}\n onMouseLeave={callAllEventHandlers(onMouseLeave, this.handlerMouseLeave)}\n >\n <SDismiss\n title={getI18nText('close')}\n onClick={this.handlerClose}\n aria-label={getI18nText('close')}\n >\n <CloseIcon />\n </SDismiss>\n <SMessage>{children}</SMessage>\n {isNode(actionNode) ? <SAction>{actionNode}</SAction> : null}\n </SInfo>,\n );\n }\n}\n\nclass ViewWarning extends ViewInfo {\n static defaultProps = {\n type: 'warning',\n duration: 0,\n };\n\n render() {\n const SWarning = Box;\n const SMessage = 'div';\n const SAction = 'div';\n const { action: actionNode, children, styles, forwardRef, ...other } = this.props;\n\n return sstyled(styles)(\n <SWarning ref={forwardRef} role=\"alert\" {...other}>\n <SMessage>{children}</SMessage>\n {isNode(actionNode) ? <SAction>{actionNode}</SAction> : null}\n </SWarning>,\n );\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":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,MAAP,MAAmB,iBAAnB;AACA,OAAOC,OAAP,MAAoB,uBAApB;AACA,OAAOC,eAAP,IAA0BC,SAA1B,EAAqCC,OAArC,EAA8CC,IAA9C,QAA0D,eAA1D;AACA,SAASC,SAAT,QAA0B,oBAA1B;AACA,SAASC,GAAT,QAAoB,mBAApB;AACA,OAAOC,IAAP,MAAiB,yBAAjB;AACA,OAAOC,MAAP,MAAmB,2BAAnB;AACA,SAASC,oBAAT,QAAqC,gCAArC;AACA,OAAOC,SAAP,MAAsB,uBAAtB;AACA,SAASC,KAAT,QAAsB,SAAtB;AACA,SAASC,iBAAT,QAAkC,gDAAlC;AACA,OAAOC,WAAP,MAAwB,yCAAxB;;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAMC,OAAO,GAAG,SAAVA,OAAU,CAACC,KAAD,EAAW;EACzB,IAAQC,MAAR,GAAqDD,KAArD,CAAQC,MAAR;EAAA,kBAAqDD,KAArD,CAAgBE,IAAhB;EAAA,IAAgBA,IAAhB,4BAAuB,EAAvB;EAAA,iBAAqDF,KAArD,CAA2BG,GAA3B;EAAA,IAAgCC,KAAhC,2BAAwCC,QAAxC;EAE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,KAAKhC,OAA9B,CAAf;IACD;;;WAED,gCAAuB;MACrB,IAAI,KAAK+B,OAAT,EAAkB;QAChB,KAAKA,OAAL,CAAaE,MAAb;MACD;IACF;;;WAED,8BAAqB;MACnB,IAAI,KAAKF,OAAT,EAAkB;QAChB,KAAKA,OAAL,CAAaG,MAAb,CAAoB,KAAKlC,OAAzB;MACD;IACF;;;WAED,kBAAS;MACP,OAAO,IAAP;IACD;;;;EA3B4BvC,S;;gBAAzBqE,gB,kBACkB;EACpBjB,QAAQ,EAAE,IADU;EAEpBpB,IAAI,EAAE,MAFc;EAGpBlC,OAAO,EAAPA;AAHoB,C;;IA6BlB4E,uB;;;;;;;;;;;;EAAgCL,gB;;gBAAhCK,uB,kBACkB;EACpBtB,QAAQ,EAAE,IADU;EAEpBpB,IAAI,EAAE,SAFc;EAGpBlC,OAAO,EAAPA;AAHoB,C;;AAOxB,IAAM6E,qBAAqB,GAAG5E,eAAe,CAAC2B,yBAAD,EAA4B;EACvEkD,IAAI,EAAEP,gBADiE;EAEvEQ,OAAO,EAAEH;AAF8D,CAA5B,CAA7C;AAKA,IAAMI,YAAY,GAAGH,qBAAqB,CAACC,IAA3C;AACA,IAAMG,mBAAmB,GAAGJ,qBAAqB,CAACE,OAAlD;AAEA,SAASC,YAAT,EAAuBC,mBAAvB;AAEA,eAAeJ,qBAAf"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import { IPortalProps } from '@semcore/portal';\nimport { CProps, ReturnEl } from '@semcore/core';\nimport { IBoxProps } from '@semcore/flex-box';\n\nexport interface INoticeBubbleContainerProps extends IBoxProps, IPortalProps {\n /** Manager copy */\n manager?: INoticeBubbleManager;\n}\n\nexport interface INoticeBubbleInfoProps extends INoticeBubbleProps {\n readonly type?: 'info';\n /** Notice display duration\n * @default 5000\n */\n duration?: number;\n /** Enables animation on first rendering\n * @default false\n */\n initialAnimation?: boolean;\n}\n\nexport interface INoticeBubbleWarningProps extends INoticeBubbleProps {\n readonly type?: 'warning';\n /**\n * Notice display duration\n * @default 0\n */\n duration?: number;\n /** Enables animation on first rendering\n * @default false\n */\n initialAnimation?: boolean;\n}\n\nexport interface INoticeBubbleProps extends IBoxProps {\n /**\n * Manager instance\n * @default NoticeBubbleManager()\n */\n manager?: INoticeBubbleManager;\n /**\n * Notice visibility\n */\n visible?: boolean;\n /** Adds controls (buttons, etc.) */\n action?: React.ReactNode;\n\n /** Triggered when the notice is closed */\n onClose?: (e?: React.SyntheticEvent) => void;\n}\n\nexport interface INoticeBubbleManager {\n /**\n * Adding a notice.\n * Takes the props properties of NoticeBubble.\n * Returns an object with the uid and the update, remove functions.\n * */\n add: (props: object) => {\n uid: string;\n update: (props: object) => boolean;\n remove: () => boolean;\n };\n /**\n * Updates the notice by uid.\n * Takes the uid-unique identifier and the props-properties of NoticeBubble.\n * Returns a successful or unsuccessful update.\n * */\n update: (uid: string, props: object) => boolean;\n /**\n * Deletes the notice by uid.\n * Takes an uid-unique identifier.\n * Returns a successful or unsuccessful deletion.\n * */\n remove: (uid: string) => boolean;\n}\n\ndeclare const NoticeBubble: <T>(props: INoticeBubbleInfoProps & T) => ReturnEl;\ndeclare const NoticeBubbleWarning: <T>(props: INoticeBubbleWarningProps & T) => ReturnEl;\ndeclare const NoticeBubbleContainer: (<T>(\n props: CProps<INoticeBubbleContainerProps & T>,\n) => ReturnEl) & {\n Info: typeof NoticeBubble;\n Warning: typeof NoticeBubbleWarning;\n};\ndeclare const NoticeBubbleManager: INoticeBubbleManager;\n\nexport { NoticeBubbleContainer, NoticeBubble, NoticeBubbleWarning, NoticeBubbleManager };\nexport default NoticeBubbleManager;\n"],"mappings":""}
1
+ {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import { IPortalProps } from '@semcore/portal';\nimport { CProps, ReturnEl } from '@semcore/core';\nimport { IBoxProps } from '@semcore/flex-box';\n\nexport interface INoticeBubbleContainerProps extends IBoxProps, IPortalProps {\n /** Manager copy */\n manager?: INoticeBubbleManager;\n locale?: string;\n}\n\nexport interface INoticeBubbleInfoProps extends INoticeBubbleProps {\n readonly type?: 'info';\n /** Notice display duration\n * @default 5000\n */\n duration?: number;\n /** Enables animation on first rendering\n * @default false\n */\n initialAnimation?: boolean;\n}\n\nexport interface INoticeBubbleWarningProps extends INoticeBubbleProps {\n readonly type?: 'warning';\n /**\n * Notice display duration\n * @default 0\n */\n duration?: number;\n /** Enables animation on first rendering\n * @default false\n */\n initialAnimation?: boolean;\n}\n\nexport interface INoticeBubbleProps extends IBoxProps {\n /**\n * Manager instance\n * @default NoticeBubbleManager()\n */\n manager?: INoticeBubbleManager;\n /**\n * Notice visibility\n */\n visible?: boolean;\n /** Adds controls (buttons, etc.) */\n action?: React.ReactNode;\n\n /** Triggered when the notice is closed */\n onClose?: (e?: React.SyntheticEvent) => void;\n}\n\nexport interface INoticeBubbleManager {\n /**\n * Adding a notice.\n * Takes the props properties of NoticeBubble.\n * Returns an object with the uid and the update, remove functions.\n * */\n add: (props: object) => {\n uid: string;\n update: (props: object) => boolean;\n remove: () => boolean;\n };\n /**\n * Updates the notice by uid.\n * Takes the uid-unique identifier and the props-properties of NoticeBubble.\n * Returns a successful or unsuccessful update.\n * */\n update: (uid: string, props: object) => boolean;\n /**\n * Deletes the notice by uid.\n * Takes an uid-unique identifier.\n * Returns a successful or unsuccessful deletion.\n * */\n remove: (uid: string) => boolean;\n}\n\ndeclare const NoticeBubble: <T>(props: INoticeBubbleInfoProps & T) => ReturnEl;\ndeclare const NoticeBubbleWarning: <T>(props: INoticeBubbleWarningProps & T) => ReturnEl;\ndeclare const NoticeBubbleContainer: (<T>(\n props: CProps<INoticeBubbleContainerProps & T>,\n) => ReturnEl) & {\n Info: typeof NoticeBubble;\n Warning: typeof NoticeBubbleWarning;\n};\ndeclare const NoticeBubbleManager: INoticeBubbleManager;\n\nexport { NoticeBubbleContainer, NoticeBubble, NoticeBubbleWarning, NoticeBubbleManager };\nexport default NoticeBubbleManager;\n"],"mappings":""}
@@ -0,0 +1,25 @@
1
+ import de from './de.json';
2
+ import en from './en.json';
3
+ import es from './es.json';
4
+ import fr from './fr.json';
5
+ import it from './it.json';
6
+ import ja from './ja.json';
7
+ import ko from './ko.json';
8
+ import pt from './pt.json';
9
+ import tr from './tr.json';
10
+ import vi from './vi.json';
11
+ import zh from './zh.json';
12
+ export var localizedMessages = {
13
+ de: de,
14
+ en: en,
15
+ es: es,
16
+ fr: fr,
17
+ it: it,
18
+ ja: ja,
19
+ ko: ko,
20
+ pt: pt,
21
+ tr: tr,
22
+ vi: vi,
23
+ zh: zh
24
+ };
25
+ //# sourceMappingURL=__intergalactic-dynamic-locales.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"__intergalactic-dynamic-locales.js","names":["de","en","es","fr","it","ja","ko","pt","tr","vi","zh","localizedMessages"],"sources":["../../../src/translations/__intergalactic-dynamic-locales.ts"],"sourcesContent":["import de from './de.json';\nimport en from './en.json';\nimport es from './es.json';\nimport fr from './fr.json';\nimport it from './it.json';\nimport ja from './ja.json';\nimport ko from './ko.json';\nimport pt from './pt.json';\nimport tr from './tr.json';\nimport vi from './vi.json';\nimport zh from './zh.json';\n\nexport const localizedMessages = {\n de,\n en,\n es,\n fr,\n it,\n ja,\n ko,\n pt,\n tr,\n vi,\n zh,\n};\n"],"mappings":"AAAA,OAAOA,EAAP,MAAe,WAAf;AACA,OAAOC,EAAP,MAAe,WAAf;AACA,OAAOC,EAAP,MAAe,WAAf;AACA,OAAOC,EAAP,MAAe,WAAf;AACA,OAAOC,EAAP,MAAe,WAAf;AACA,OAAOC,EAAP,MAAe,WAAf;AACA,OAAOC,EAAP,MAAe,WAAf;AACA,OAAOC,EAAP,MAAe,WAAf;AACA,OAAOC,EAAP,MAAe,WAAf;AACA,OAAOC,EAAP,MAAe,WAAf;AACA,OAAOC,EAAP,MAAe,WAAf;AAEA,OAAO,IAAMC,iBAAiB,GAAG;EAC/BX,EAAE,EAAFA,EAD+B;EAE/BC,EAAE,EAAFA,EAF+B;EAG/BC,EAAE,EAAFA,EAH+B;EAI/BC,EAAE,EAAFA,EAJ+B;EAK/BC,EAAE,EAAFA,EAL+B;EAM/BC,EAAE,EAAFA,EAN+B;EAO/BC,EAAE,EAAFA,EAP+B;EAQ/BC,EAAE,EAAFA,EAR+B;EAS/BC,EAAE,EAAFA,EAT+B;EAU/BC,EAAE,EAAFA,EAV+B;EAW/BC,EAAE,EAAFA;AAX+B,CAA1B"}
@@ -0,0 +1,3 @@
1
+ {
2
+ "close": "Schließen"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "close": "Close"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "close": "Cerrar"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "close": "Fermer"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "close": "Chiudi"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "close": "閉じる"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "close": "닫기"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "close": "Fechar"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "close": "Kapat"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "close": "Đóng"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "close": "关闭"
3
+ }
@@ -5,6 +5,7 @@ import { IBoxProps } from '@semcore/flex-box';
5
5
  export interface INoticeBubbleContainerProps extends IBoxProps, IPortalProps {
6
6
  /** Manager copy */
7
7
  manager?: INoticeBubbleManager;
8
+ locale?: string;
8
9
  }
9
10
 
10
11
  export interface INoticeBubbleInfoProps extends INoticeBubbleProps {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/notice-bubble",
3
3
  "description": "Semrush NoticeBubble Component",
4
- "version": "4.4.1",
4
+ "version": "4.5.0",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",