@semcore/notice 16.0.0-prerelease.6 → 16.0.0-prerelease.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,181 +1,213 @@
1
- import l from "@babel/runtime/helpers/esm/objectSpread2";
2
- import E from "@babel/runtime/helpers/esm/classCallCheck";
3
- import L from "@babel/runtime/helpers/esm/createClass";
4
- import A from "@babel/runtime/helpers/esm/assertThisInitialized";
5
- import z from "@babel/runtime/helpers/esm/inherits";
6
- import D from "@babel/runtime/helpers/esm/createSuper";
7
- import m from "@babel/runtime/helpers/esm/defineProperty";
8
- import { sstyled as g, createComponent as M, assignProps as s, Component as R } from "@semcore/core";
9
- import a from "react";
10
- import { Box as v } from "@semcore/flex-box";
11
- import B from "@semcore/button";
12
- import b from "@semcore/icon/Close/m";
13
- import G from "@semcore/core/lib/utils/enhances/resolveColorEnhance";
14
- import { FadeInOut as O } from "@semcore/animation";
15
- import d from "@semcore/core/lib/utils/logger";
16
- import V from "@semcore/notice-global";
17
- import { localizedMessages as S } from "./translations/__intergalactic-dynamic-locales.mjs";
18
- import $ from "@semcore/core/lib/utils/enhances/i18nEnhance";
19
- import { cssVariableEnhance as j } from "@semcore/core/lib/utils/useCssVariable";
20
- import { Text as y } from "@semcore/typography";
21
- var q = (
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 _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
5
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
6
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
7
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
8
+ import { sstyled, createComponent, assignProps, Component } from "@semcore/core";
9
+ import React from "react";
10
+ import { Box } from "@semcore/flex-box";
11
+ import Button from "@semcore/button";
12
+ import CloseIconM from "@semcore/icon/Close/m";
13
+ import resolveColorEnhance from "@semcore/core/lib/utils/enhances/resolveColorEnhance";
14
+ import { FadeInOut } from "@semcore/animation";
15
+ import logger from "@semcore/core/lib/utils/logger";
16
+ import NoticeGlobal from "@semcore/notice-global";
17
+ import { localizedMessages } from "./translations/__intergalactic-dynamic-locales.mjs";
18
+ import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
19
+ import { cssVariableEnhance } from "@semcore/core/lib/utils/useCssVariable";
20
+ import { Text } from "@semcore/typography";
21
+ var style = (
22
22
  /*__reshadow_css_start__*/
23
- (g.insert(
23
+ (sstyled.insert(
24
24
  /*__inner_css_start__*/
25
25
  ".___SNotice_un6cc_gg_{display:flex;padding:var(--intergalactic-spacing-4x, 16px);font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%);box-sizing:border-box;border-style:solid;border-width:1px;border-radius:var(--intergalactic-surface-rounded, 6px);color:var(--intergalactic-text-primary, #191b23)}.___SNotice_un6cc_gg_._theme_info_un6cc_gg_{background-color:var(--intergalactic-bg-secondary-info, #e9f7ff);border-color:var(--intergalactic-border-info, #8ecdff)}.___SNotice_un6cc_gg_._theme_info_un6cc_gg_ .___SCloseIcon_un6cc_gg_{color:var(--intergalactic-icon-primary-neutral, #6c6e79)}@media (hover:hover){.___SNotice_un6cc_gg_._theme_info_un6cc_gg_ .___SCloseIcon_un6cc_gg_:hover{color:var(--intergalactic-icon-primary-neutral-hover-active, #565861)}}.___SNotice_un6cc_gg_._theme_danger_un6cc_gg_{background-color:var(--intergalactic-bg-secondary-critical, #fff0f7);border-color:var(--intergalactic-border-critical, #ffaeb5)}.___SNotice_un6cc_gg_._theme_danger_un6cc_gg_ .___SCloseIcon_un6cc_gg_{color:var(--intergalactic-icon-primary-critical, #ff4953)}@media (hover:hover){.___SNotice_un6cc_gg_._theme_danger_un6cc_gg_ .___SCloseIcon_un6cc_gg_:hover{color:var(--intergalactic-icon-primary-critical-hover-active, #CC3A42)}}.___SNotice_un6cc_gg_._theme_warning_un6cc_gg_{background-color:var(--intergalactic-bg-secondary-warning, #fff3d9);border-color:var(--intergalactic-border-warning, #ffb26e)}.___SNotice_un6cc_gg_._theme_warning_un6cc_gg_ .___SCloseIcon_un6cc_gg_{color:var(--intergalactic-icon-primary-warning, #ff642d)}@media (hover:hover){.___SNotice_un6cc_gg_._theme_warning_un6cc_gg_ .___SCloseIcon_un6cc_gg_:hover{color:var(--intergalactic-icon-primary-warning-hover-active, #CC5024)}}.___SNotice_un6cc_gg_._theme_success_un6cc_gg_{background-color:var(--intergalactic-bg-secondary-success, #dbfee8);border-color:var(--intergalactic-border-success, #59ddaa)}.___SNotice_un6cc_gg_._theme_success_un6cc_gg_ .___SCloseIcon_un6cc_gg_{color:var(--intergalactic-icon-primary-success, #009f81)}@media (hover:hover){.___SNotice_un6cc_gg_._theme_success_un6cc_gg_ .___SCloseIcon_un6cc_gg_:hover{color:var(--intergalactic-icon-primary-success-hover-active, #037E68)}}.___SNotice_un6cc_gg_._theme_muted_un6cc_gg_{background-color:var(--intergalactic-bg-secondary-neutral, #f4f5f9);border-color:var(--intergalactic-border-secondary, #e0e1e9)}.___SLabel_un6cc_gg_._theme_info_un6cc_gg_,.___SNotice_un6cc_gg_._theme_muted_un6cc_gg_ .___SCloseIcon_un6cc_gg_{color:var(--intergalactic-icon-primary-neutral, #6c6e79)}@media (hover:hover){.___SNotice_un6cc_gg_._theme_muted_un6cc_gg_ .___SCloseIcon_un6cc_gg_:hover{color:var(--intergalactic-icon-primary-neutral-hover-active, #565861)}}.___SContent_un6cc_gg_{flex:1 1 auto;width:100%}.___SActions_un6cc_gg_{flex-shrink:0;margin-top:var(--intergalactic-spacing-3x, 12px)}.___SLabel_un6cc_gg_{min-height:var(--intergalactic-form-control-m, 28px);height:-moz-fit-content;height:fit-content;margin-right:var(--intergalactic-spacing-2x, 8px);display:inline-flex;align-items:center}.___SLabel_un6cc_gg_._theme_danger_un6cc_gg_{color:var(--intergalactic-icon-primary-critical, #ff4953)}.___SLabel_un6cc_gg_._theme_warning_un6cc_gg_{color:var(--intergalactic-icon-primary-warning, #ff642d)}.___SLabel_un6cc_gg_._theme_success_un6cc_gg_{color:var(--intergalactic-icon-primary-success, #009f81)}.___SLabel_un6cc_gg_._theme_muted_un6cc_gg_{color:var(--intergalactic-icon-primary-neutral, #6c6e79)}.___SLabel_un6cc_gg_._theme_custom_un6cc_gg_{color:var(--color_un6cc)}.___SCloseIcon_un6cc_gg_{flex-shrink:0;margin-left:var(--intergalactic-spacing-4x, 16px)}.___SNotice_un6cc_gg_._theme_custom_un6cc_gg_{background-color:var(--backgroundColor_un6cc);border-color:var(--backgroundColor_un6cc)}.___STitle_un6cc_gg_{margin-top:var(--intergalactic-spacing-05x, 2px);margin-bottom:var(--intergalactic-spacing-05x, 2px)}.___SText_un6cc_gg_{margin-top:var(--intergalactic-spacing-1x, 4px);margin-bottom:var(--intergalactic-spacing-1x, 4px)}",
26
26
  "un6cc_gg_"
27
27
  ), {
28
- __SNotice: "___SNotice_un6cc_gg_",
29
- __SContent: "___SContent_un6cc_gg_",
30
- __SActions: "___SActions_un6cc_gg_",
31
- __SLabel: "___SLabel_un6cc_gg_",
32
- _theme_info: "_theme_info_un6cc_gg_",
33
- _theme_danger: "_theme_danger_un6cc_gg_",
34
- _theme_warning: "_theme_warning_un6cc_gg_",
35
- _theme_success: "_theme_success_un6cc_gg_",
36
- _theme_muted: "_theme_muted_un6cc_gg_",
37
- _theme_custom: "_theme_custom_un6cc_gg_",
28
+ "__SNotice": "___SNotice_un6cc_gg_",
29
+ "__SContent": "___SContent_un6cc_gg_",
30
+ "__SActions": "___SActions_un6cc_gg_",
31
+ "__SLabel": "___SLabel_un6cc_gg_",
32
+ "_theme_info": "_theme_info_un6cc_gg_",
33
+ "_theme_danger": "_theme_danger_un6cc_gg_",
34
+ "_theme_warning": "_theme_warning_un6cc_gg_",
35
+ "_theme_success": "_theme_success_un6cc_gg_",
36
+ "_theme_muted": "_theme_muted_un6cc_gg_",
37
+ "_theme_custom": "_theme_custom_un6cc_gg_",
38
38
  "--color": "--color_un6cc",
39
- __SCloseIcon: "___SCloseIcon_un6cc_gg_",
39
+ "__SCloseIcon": "___SCloseIcon_un6cc_gg_",
40
40
  "--backgroundColor": "--backgroundColor_un6cc",
41
- __STitle: "___STitle_un6cc_gg_",
42
- __SText: "___SText_un6cc_gg_"
41
+ "__STitle": "___STitle_un6cc_gg_",
42
+ "__SText": "___SText_un6cc_gg_"
43
43
  })
44
44
  );
45
- function C(_) {
46
- return !["danger", "warning", "success", "info", "muted"].includes(_);
45
+ function isCustomTheme(theme) {
46
+ return !["danger", "warning", "success", "info", "muted"].includes(theme);
47
47
  }
48
- var f = /* @__PURE__ */ function(_) {
49
- z(r, _);
50
- var t = D(r);
51
- function r() {
52
- var c;
53
- E(this, r);
54
- for (var e = arguments.length, n = new Array(e), o = 0; o < e; o++)
55
- n[o] = arguments[o];
56
- return c = t.call.apply(t, [this].concat(n)), m(A(c), "ref", /* @__PURE__ */ a.createRef()), c;
48
+ var RootNotice = /* @__PURE__ */ function(_Component) {
49
+ _inherits(RootNotice2, _Component);
50
+ var _super = _createSuper(RootNotice2);
51
+ function RootNotice2() {
52
+ var _this;
53
+ _classCallCheck(this, RootNotice2);
54
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
55
+ args[_key] = arguments[_key];
56
+ }
57
+ _this = _super.call.apply(_super, [this].concat(args));
58
+ _defineProperty(_assertThisInitialized(_this), "ref", /* @__PURE__ */ React.createRef());
59
+ return _this;
57
60
  }
58
- return L(r, [{
61
+ _createClass(RootNotice2, [{
59
62
  key: "componentDidMount",
60
- value: function() {
63
+ value: function componentDidMount() {
61
64
  if (this.ref.current && process.env.NODE_ENV !== "production" && !["muted", "danger"].includes(this.props.theme)) {
62
- var e = function(o) {
63
- return !!(o.hasAttribute("aria-label") || o.hasAttribute("aria-labelledby") || o.hasAttribute("title"));
65
+ var hasTitle = function hasTitle2(node) {
66
+ if (node.hasAttribute("aria-label")) return true;
67
+ if (node.hasAttribute("aria-labelledby")) return true;
68
+ if (node.hasAttribute("title")) return true;
69
+ return false;
64
70
  };
65
- d.warn(!e(this.ref.current), "Provide unique 'title' or 'aria-label' or 'aria-labelledby' to help identify the type and importance of notification", this.props["data-ui-name"] || r.displayName);
71
+ logger.warn(!hasTitle(this.ref.current), "Provide unique 'title' or 'aria-label' or 'aria-labelledby' to help identify the type and importance of notification", this.props["data-ui-name"] || RootNotice2.displayName);
66
72
  }
67
73
  }
68
74
  }, {
69
75
  key: "getLabelProps",
70
- value: function() {
71
- var e = this.asProps, n = e.theme, o = e.resolveColor;
76
+ value: function getLabelProps() {
77
+ var _this$asProps = this.asProps, theme = _this$asProps.theme, resolveColor = _this$asProps.resolveColor;
72
78
  return {
73
- theme: n,
74
- resolveColor: o
79
+ theme,
80
+ resolveColor
75
81
  };
76
82
  }
77
83
  }, {
78
84
  key: "getCloseIconProps",
79
- value: function() {
80
- var e = this.asProps.getI18nText;
85
+ value: function getCloseIconProps() {
86
+ var getI18nText = this.asProps.getI18nText;
81
87
  return {
82
- getI18nText: e
88
+ getI18nText
83
89
  };
84
90
  }
85
91
  }, {
86
92
  key: "getCloseProps",
87
- value: function() {
88
- var e = this.asProps.getI18nText;
93
+ value: function getCloseProps() {
94
+ var getI18nText = this.asProps.getI18nText;
89
95
  return {
90
- getI18nText: e
96
+ getI18nText
91
97
  };
92
98
  }
93
99
  }, {
94
100
  key: "render",
95
- value: function() {
96
- var e = this.asProps, n, o = O, i = this.asProps, h = i.Children, x = i.styles, N = i.hidden, u = i.theme, I = i.use, T = i.resolveColor, P = i.getI18nText, k = T(u), w = C(u) ? "custom" : u;
97
- if (I === "primary")
98
- return d.warn(!0, 'Deprecated property-value pair "use=primary", use component <NoticeGlobal/> instead', r.displayName), /* @__PURE__ */ a.createElement(V, this.asProps);
99
- var p = P(u === "danger" ? "criticalNotification" : "notification");
100
- return u === "muted" && (p = void 0), n = g(x), /* @__PURE__ */ a.createElement(o, n.cn("SNotice", l({}, s({
101
- visible: !N,
102
- "use:theme": w,
103
- backgroundColor: k,
104
- role: "region",
105
- "aria-label": p,
106
- ref: this.ref
107
- }, e))), /* @__PURE__ */ a.createElement(h, n.cn("Children", {})));
101
+ value: function render() {
102
+ var _ref = this.asProps, _ref9;
103
+ var SNotice = FadeInOut;
104
+ var _this$asProps2 = this.asProps, Children = _this$asProps2.Children, styles = _this$asProps2.styles, hidden = _this$asProps2.hidden, theme = _this$asProps2.theme, use = _this$asProps2.use, resolveColor = _this$asProps2.resolveColor, getI18nText = _this$asProps2.getI18nText;
105
+ var color = resolveColor(theme);
106
+ var useTheme = isCustomTheme(theme) ? "custom" : theme;
107
+ if (use === "primary") {
108
+ logger.warn(true, 'Deprecated property-value pair "use=primary", use component <NoticeGlobal/> instead', RootNotice2.displayName);
109
+ return /* @__PURE__ */ React.createElement(NoticeGlobal, this.asProps);
110
+ }
111
+ var ariaLabel = getI18nText(theme === "danger" ? "criticalNotification" : "notification");
112
+ if (theme === "muted") {
113
+ ariaLabel = void 0;
114
+ }
115
+ return _ref9 = sstyled(styles), /* @__PURE__ */ React.createElement(SNotice, _ref9.cn("SNotice", _objectSpread({}, assignProps({
116
+ "visible": !hidden,
117
+ "use:theme": useTheme,
118
+ "backgroundColor": color,
119
+ "role": "region",
120
+ "aria-label": ariaLabel,
121
+ "ref": this.ref
122
+ }, _ref))), /* @__PURE__ */ React.createElement(Children, _ref9.cn("Children", {})));
108
123
  }
109
- }]), r;
110
- }(R);
111
- m(f, "displayName", "Notice");
112
- m(f, "style", q);
113
- m(f, "enhance", [$(S), j({
124
+ }]);
125
+ return RootNotice2;
126
+ }(Component);
127
+ _defineProperty(RootNotice, "displayName", "Notice");
128
+ _defineProperty(RootNotice, "style", style);
129
+ _defineProperty(RootNotice, "enhance", [i18nEnhance(localizedMessages), cssVariableEnhance({
114
130
  variable: "--intergalactic-duration-popper",
115
131
  fallback: "200",
116
132
  map: Number.parseInt,
117
133
  prop: "duration"
118
- }), G()]);
119
- m(f, "defaultProps", {
134
+ }), resolveColorEnhance()]);
135
+ _defineProperty(RootNotice, "defaultProps", {
120
136
  theme: "info",
121
- i18n: S,
137
+ i18n: localizedMessages,
122
138
  locale: "en"
123
139
  });
124
- function F(_) {
125
- var t = arguments[0], r, c = _.styles, e = _.theme, n = _.resolveColor, o = v, i = C(e) ? "custom" : e, h = n(e);
126
- return r = g(c), /* @__PURE__ */ a.createElement(o, r.cn("SLabel", l({}, s({
127
- "use:theme": i,
128
- color: h
129
- }, t))));
140
+ function Label(_ref17) {
141
+ var _ref2 = arguments[0], _ref10;
142
+ var styles = _ref17.styles, theme = _ref17.theme, resolveColor = _ref17.resolveColor;
143
+ var SLabel = Box;
144
+ var useTheme = isCustomTheme(theme) ? "custom" : theme;
145
+ var color = resolveColor(theme);
146
+ return _ref10 = sstyled(styles), /* @__PURE__ */ React.createElement(SLabel, _ref10.cn("SLabel", _objectSpread({}, assignProps({
147
+ "use:theme": useTheme,
148
+ "color": color
149
+ }, _ref2))));
130
150
  }
131
- function W(_) {
132
- var t = arguments[0], r, c = _.styles, e = y;
133
- return r = g(c), /* @__PURE__ */ a.createElement(e, r.cn("STitle", l({}, s({
134
- tag: "div",
135
- size: 300,
136
- fontWeight: "bold"
137
- }, t))));
151
+ function Title(_ref18) {
152
+ var _ref3 = arguments[0], _ref11;
153
+ var styles = _ref18.styles;
154
+ var STitle = Text;
155
+ return _ref11 = sstyled(styles), /* @__PURE__ */ React.createElement(STitle, _ref11.cn("STitle", _objectSpread({}, assignProps({
156
+ "tag": "div",
157
+ "size": 300,
158
+ "fontWeight": "bold"
159
+ }, _ref3))));
138
160
  }
139
- function H(_) {
140
- var t = arguments[0], r, c = _.styles, e = y;
141
- return r = g(c), /* @__PURE__ */ a.createElement(e, r.cn("SText", l({}, s({
142
- tag: "div"
143
- }, t))));
161
+ function NoticeText(_ref19) {
162
+ var _ref4 = arguments[0], _ref12;
163
+ var styles = _ref19.styles;
164
+ var SText = Text;
165
+ return _ref12 = sstyled(styles), /* @__PURE__ */ React.createElement(SText, _ref12.cn("SText", _objectSpread({}, assignProps({
166
+ "tag": "div"
167
+ }, _ref4))));
144
168
  }
145
- function J(_) {
146
- var t = arguments[0], r, c = _.styles, e = v;
147
- return r = g(c), /* @__PURE__ */ a.createElement(e, r.cn("SActions", l({}, s({}, t))));
169
+ function Actions(_ref20) {
170
+ var _ref5 = arguments[0], _ref13;
171
+ var styles = _ref20.styles;
172
+ var SActions = Box;
173
+ return _ref13 = sstyled(styles), /* @__PURE__ */ React.createElement(SActions, _ref13.cn("SActions", _objectSpread({}, assignProps({}, _ref5))));
148
174
  }
149
- function K(_) {
150
- var t = arguments[0], r, c = _.styles, e = v;
151
- return r = g(c), /* @__PURE__ */ a.createElement(e, r.cn("SContent", l({}, s({}, t))));
175
+ function Content(_ref21) {
176
+ var _ref6 = arguments[0], _ref14;
177
+ var styles = _ref21.styles;
178
+ var SContent = Box;
179
+ return _ref14 = sstyled(styles), /* @__PURE__ */ React.createElement(SContent, _ref14.cn("SContent", _objectSpread({}, assignProps({}, _ref6))));
152
180
  }
153
- function Q(_) {
154
- var t = arguments[0], r, c = _.styles, e = _.getI18nText, n = v;
155
- return r = g(c), /* @__PURE__ */ a.createElement(n, r.cn("SCloseIcon", l({}, s({
156
- tag: b,
157
- interactive: !0,
158
- "aria-label": e("close")
159
- }, t))));
181
+ function CloseIcon(_ref22) {
182
+ var _ref7 = arguments[0], _ref15;
183
+ var styles = _ref22.styles, getI18nText = _ref22.getI18nText;
184
+ var SCloseIcon = Box;
185
+ return _ref15 = sstyled(styles), /* @__PURE__ */ React.createElement(SCloseIcon, _ref15.cn("SCloseIcon", _objectSpread({}, assignProps({
186
+ "tag": CloseIconM,
187
+ "interactive": true,
188
+ "aria-label": getI18nText("close")
189
+ }, _ref7))));
160
190
  }
161
- function U(_) {
162
- var t = arguments[0], r, c = _.styles, e = _.getI18nText, n = B;
163
- return r = g(c), /* @__PURE__ */ a.createElement(n, r.cn("SCloseIcon", l({}, s({
164
- addonLeft: b,
165
- use: "tertiary",
166
- theme: "muted",
167
- "aria-label": e("close")
168
- }, t))));
191
+ function Close(_ref23) {
192
+ var _ref8 = arguments[0], _ref16;
193
+ var styles = _ref23.styles, getI18nText = _ref23.getI18nText;
194
+ var SCloseIcon = Button;
195
+ return _ref16 = sstyled(styles), /* @__PURE__ */ React.createElement(SCloseIcon, _ref16.cn("SCloseIcon", _objectSpread({}, assignProps({
196
+ "addonLeft": CloseIconM,
197
+ "use": "tertiary",
198
+ "theme": "muted",
199
+ "aria-label": getI18nText("close")
200
+ }, _ref8))));
169
201
  }
170
- var pe = M(f, {
171
- Label: F,
172
- Title: W,
173
- Text: H,
174
- Actions: J,
175
- Content: K,
176
- CloseIcon: Q,
177
- Close: U
202
+ var Notice = createComponent(RootNotice, {
203
+ Label,
204
+ Title,
205
+ Text: NoticeText,
206
+ Actions,
207
+ Content,
208
+ CloseIcon,
209
+ Close
178
210
  });
179
211
  export {
180
- pe as default
212
+ Notice as default
181
213
  };
@@ -1,35 +1,43 @@
1
- import _ from "@babel/runtime/helpers/esm/classCallCheck";
2
- import N from "@babel/runtime/helpers/esm/createClass";
3
- import v from "@babel/runtime/helpers/esm/inherits";
4
- import P from "@babel/runtime/helpers/esm/createSuper";
5
- import u from "@babel/runtime/helpers/esm/defineProperty";
6
- import { createComponent as S, assignProps as b, Component as y } from "@semcore/core";
7
- import e from "react";
8
- import l from "@semcore/core/lib/utils/isNode";
9
- import t from "./Notice.mjs";
10
- var m = /* @__PURE__ */ function(f) {
11
- v(o, f);
12
- var C = P(o);
13
- function o() {
14
- return _(this, o), C.apply(this, arguments);
1
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
3
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
4
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
6
+ import { createComponent, assignProps, Component } from "@semcore/core";
7
+ import React from "react";
8
+ import isNode from "@semcore/core/lib/utils/isNode";
9
+ import Notice from "./Notice.mjs";
10
+ var NoticeSmart = /* @__PURE__ */ function(_Component) {
11
+ _inherits(NoticeSmart2, _Component);
12
+ var _super = _createSuper(NoticeSmart2);
13
+ function NoticeSmart2() {
14
+ _classCallCheck(this, NoticeSmart2);
15
+ return _super.apply(this, arguments);
15
16
  }
16
- return N(o, [{
17
+ _createClass(NoticeSmart2, [{
17
18
  key: "render",
18
- value: function() {
19
- var d = this.asProps, h = t, r = this.asProps, n = r.Children, a = r.label, i = r.title, s = r.actions, c = r.closable, E = r.onClose, p = /* @__PURE__ */ e.createElement(n, null);
20
- return typeof n.origin == "string" && (p = l(i) || l(a) || c ? /* @__PURE__ */ e.createElement(t.Text, null, /* @__PURE__ */ e.createElement(n, null)) : /* @__PURE__ */ e.createElement(n, null)), /* @__PURE__ */ e.createElement(h, b({
21
- __excludeProps: ["title"]
22
- }, d), l(a) && /* @__PURE__ */ e.createElement(t.Label, null, a), /* @__PURE__ */ e.createElement(t.Content, null, l(i) && /* @__PURE__ */ e.createElement(t.Title, null, i), p, l(s) && /* @__PURE__ */ e.createElement(t.Actions, null, s)), c && /* @__PURE__ */ e.createElement(t.Close, {
23
- onClick: E
19
+ value: function render() {
20
+ var _ref = this.asProps;
21
+ var SNoticeSmart = Notice;
22
+ var _this$asProps = this.asProps, Children = _this$asProps.Children, label = _this$asProps.label, title = _this$asProps.title, actions = _this$asProps.actions, closable = _this$asProps.closable, onClose = _this$asProps.onClose;
23
+ var textContent = /* @__PURE__ */ React.createElement(Children, null);
24
+ if (typeof Children.origin === "string") {
25
+ textContent = isNode(title) || isNode(label) || closable ? /* @__PURE__ */ React.createElement(Notice.Text, null, /* @__PURE__ */ React.createElement(Children, null)) : /* @__PURE__ */ React.createElement(Children, null);
26
+ }
27
+ return /* @__PURE__ */ React.createElement(SNoticeSmart, assignProps({
28
+ "__excludeProps": ["title"]
29
+ }, _ref), isNode(label) && /* @__PURE__ */ React.createElement(Notice.Label, null, label), /* @__PURE__ */ React.createElement(Notice.Content, null, isNode(title) && /* @__PURE__ */ React.createElement(Notice.Title, null, title), textContent, isNode(actions) && /* @__PURE__ */ React.createElement(Notice.Actions, null, actions)), closable && /* @__PURE__ */ React.createElement(Notice.Close, {
30
+ onClick: onClose
24
31
  }));
25
32
  }
26
- }]), o;
27
- }(y);
28
- u(m, "displayName", "NoticeSmart");
29
- u(m, "defaultProps", {
33
+ }]);
34
+ return NoticeSmart2;
35
+ }(Component);
36
+ _defineProperty(NoticeSmart, "displayName", "NoticeSmart");
37
+ _defineProperty(NoticeSmart, "defaultProps", {
30
38
  theme: "info"
31
39
  });
32
- const w = S(m);
40
+ const NoticeSmart$1 = createComponent(NoticeSmart);
33
41
  export {
34
- w as default
42
+ NoticeSmart$1 as default
35
43
  };
package/lib/esm/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import o from "./Notice.mjs";
2
- import { default as a } from "./NoticeSmart.mjs";
1
+ import Notice from "./Notice.mjs";
2
+ import { default as default2 } from "./NoticeSmart.mjs";
3
3
  export {
4
- a as NoticeSmart,
5
- o as default
4
+ default2 as NoticeSmart,
5
+ Notice as default
6
6
  };
@@ -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,11 +1,14 @@
1
- const i = "Benachrichtigung", c = "Kritische Benachrichtigung", t = "Benachrichtigung schließen", n = {
2
- notification: i,
3
- criticalNotification: c,
4
- close: t
1
+ const notification = "Benachrichtigung";
2
+ const criticalNotification = "Kritische Benachrichtigung";
3
+ const close = "Benachrichtigung schließen";
4
+ const de = {
5
+ notification,
6
+ criticalNotification,
7
+ close
5
8
  };
6
9
  export {
7
- t as close,
8
- c as criticalNotification,
9
- n as default,
10
- i as notification
10
+ close,
11
+ criticalNotification,
12
+ de as default,
13
+ notification
11
14
  };
@@ -1,11 +1,14 @@
1
- const i = "Notification", t = "Critical notification", o = "Close notification", c = {
2
- notification: i,
3
- criticalNotification: t,
4
- close: o
1
+ const notification = "Notification";
2
+ const criticalNotification = "Critical notification";
3
+ const close = "Close notification";
4
+ const en = {
5
+ notification,
6
+ criticalNotification,
7
+ close
5
8
  };
6
9
  export {
7
- o as close,
8
- t as criticalNotification,
9
- c as default,
10
- i as notification
10
+ close,
11
+ criticalNotification,
12
+ en as default,
13
+ notification
11
14
  };
@@ -1,11 +1,14 @@
1
- const i = "Notificación", c = "Notificación crítica", t = "Cerrar notificación", o = {
2
- notification: i,
3
- criticalNotification: c,
4
- close: t
1
+ const notification = "Notificación";
2
+ const criticalNotification = "Notificación crítica";
3
+ const close = "Cerrar notificación";
4
+ const es = {
5
+ notification,
6
+ criticalNotification,
7
+ close
5
8
  };
6
9
  export {
7
- t as close,
8
- c as criticalNotification,
9
- o as default,
10
- i as notification
10
+ close,
11
+ criticalNotification,
12
+ es as default,
13
+ notification
11
14
  };
@@ -1,11 +1,14 @@
1
- const i = "Notification", t = "Notification critique", o = "Fermer la notification", c = {
2
- notification: i,
3
- criticalNotification: t,
4
- close: o
1
+ const notification = "Notification";
2
+ const criticalNotification = "Notification critique";
3
+ const close = "Fermer la notification";
4
+ const fr = {
5
+ notification,
6
+ criticalNotification,
7
+ close
5
8
  };
6
9
  export {
7
- o as close,
8
- t as criticalNotification,
9
- c as default,
10
- i as notification
10
+ close,
11
+ criticalNotification,
12
+ fr as default,
13
+ notification
11
14
  };
@@ -1,11 +1,14 @@
1
- const i = "Notifica", t = "Notifica critica", c = "Chiudi la notifica", o = {
2
- notification: i,
3
- criticalNotification: t,
4
- close: c
1
+ const notification = "Notifica";
2
+ const criticalNotification = "Notifica critica";
3
+ const close = "Chiudi la notifica";
4
+ const it = {
5
+ notification,
6
+ criticalNotification,
7
+ close
5
8
  };
6
9
  export {
7
- c as close,
8
- t as criticalNotification,
9
- o as default,
10
- i as notification
10
+ close,
11
+ criticalNotification,
12
+ it as default,
13
+ notification
11
14
  };
@@ -1,11 +1,14 @@
1
- const i = "通知", t = "重要な通知", o = "通知を閉じる", c = {
2
- notification: i,
3
- criticalNotification: t,
4
- close: o
1
+ const notification = "通知";
2
+ const criticalNotification = "重要な通知";
3
+ const close = "通知を閉じる";
4
+ const ja = {
5
+ notification,
6
+ criticalNotification,
7
+ close
5
8
  };
6
9
  export {
7
- o as close,
8
- t as criticalNotification,
9
- c as default,
10
- i as notification
10
+ close,
11
+ criticalNotification,
12
+ ja as default,
13
+ notification
11
14
  };
@@ -1,11 +1,14 @@
1
- const i = "알림", o = "중요 알림", t = "알림 닫기", c = {
2
- notification: i,
3
- criticalNotification: o,
4
- close: t
1
+ const notification = "알림";
2
+ const criticalNotification = "중요 알림";
3
+ const close = "알림 닫기";
4
+ const ko = {
5
+ notification,
6
+ criticalNotification,
7
+ close
5
8
  };
6
9
  export {
7
- t as close,
8
- o as criticalNotification,
9
- c as default,
10
- i as notification
10
+ close,
11
+ criticalNotification,
12
+ ko as default,
13
+ notification
11
14
  };
@@ -1,11 +1,14 @@
1
- const i = "Melding", n = "Belangrijke melding", t = "Kennisgeving sluiten", o = {
2
- notification: i,
3
- criticalNotification: n,
4
- close: t
1
+ const notification = "Melding";
2
+ const criticalNotification = "Belangrijke melding";
3
+ const close = "Kennisgeving sluiten";
4
+ const nl = {
5
+ notification,
6
+ criticalNotification,
7
+ close
5
8
  };
6
9
  export {
7
- t as close,
8
- n as criticalNotification,
9
- o as default,
10
- i as notification
10
+ close,
11
+ criticalNotification,
12
+ nl as default,
13
+ notification
11
14
  };
@@ -1,11 +1,14 @@
1
- const i = "Powiadomienie", o = "Powiadomienie krytyczne", t = "Zamknij powiadomienie", c = {
2
- notification: i,
3
- criticalNotification: o,
4
- close: t
1
+ const notification = "Powiadomienie";
2
+ const criticalNotification = "Powiadomienie krytyczne";
3
+ const close = "Zamknij powiadomienie";
4
+ const pl = {
5
+ notification,
6
+ criticalNotification,
7
+ close
5
8
  };
6
9
  export {
7
- t as close,
8
- o as criticalNotification,
9
- c as default,
10
- i as notification
10
+ close,
11
+ criticalNotification,
12
+ pl as default,
13
+ notification
11
14
  };
@@ -1,11 +1,14 @@
1
- const i = "Notificação", o = "Notificação urgente", t = "Fechar notificação", c = {
2
- notification: i,
3
- criticalNotification: o,
4
- close: t
1
+ const notification = "Notificação";
2
+ const criticalNotification = "Notificação urgente";
3
+ const close = "Fechar notificação";
4
+ const pt = {
5
+ notification,
6
+ criticalNotification,
7
+ close
5
8
  };
6
9
  export {
7
- t as close,
8
- o as criticalNotification,
9
- c as default,
10
- i as notification
10
+ close,
11
+ criticalNotification,
12
+ pt as default,
13
+ notification
11
14
  };
@@ -1,11 +1,14 @@
1
- const i = "Avisering", t = "Kritisk avisering", o = "Stäng meddelande", c = {
2
- notification: i,
3
- criticalNotification: t,
4
- close: o
1
+ const notification = "Avisering";
2
+ const criticalNotification = "Kritisk avisering";
3
+ const close = "Stäng meddelande";
4
+ const sv = {
5
+ notification,
6
+ criticalNotification,
7
+ close
5
8
  };
6
9
  export {
7
- o as close,
8
- t as criticalNotification,
9
- c as default,
10
- i as notification
10
+ close,
11
+ criticalNotification,
12
+ sv as default,
13
+ notification
11
14
  };
@@ -1,11 +1,14 @@
1
- const i = "Bildirim", t = "Kritik bildirim", o = "Bildirimi kapat", c = {
2
- notification: i,
3
- criticalNotification: t,
4
- close: o
1
+ const notification = "Bildirim";
2
+ const criticalNotification = "Kritik bildirim";
3
+ const close = "Bildirimi kapat";
4
+ const tr = {
5
+ notification,
6
+ criticalNotification,
7
+ close
5
8
  };
6
9
  export {
7
- o as close,
8
- t as criticalNotification,
9
- c as default,
10
- i as notification
10
+ close,
11
+ criticalNotification,
12
+ tr as default,
13
+ notification
11
14
  };
@@ -1,11 +1,14 @@
1
- const o = "Thông báo", t = "Thông báo quan trọng", i = "Đóng thông báo", n = {
2
- notification: o,
3
- criticalNotification: t,
4
- close: i
1
+ const notification = "Thông báo";
2
+ const criticalNotification = "Thông báo quan trọng";
3
+ const close = "Đóng thông báo";
4
+ const vi = {
5
+ notification,
6
+ criticalNotification,
7
+ close
5
8
  };
6
9
  export {
7
- i as close,
8
- t as criticalNotification,
9
- n as default,
10
- o as notification
10
+ close,
11
+ criticalNotification,
12
+ vi as default,
13
+ notification
11
14
  };
@@ -1,11 +1,14 @@
1
- const i = "通知", t = "重要通知", o = "关闭通知", c = {
2
- notification: i,
3
- criticalNotification: t,
4
- close: o
1
+ const notification = "通知";
2
+ const criticalNotification = "重要通知";
3
+ const close = "关闭通知";
4
+ const zh = {
5
+ notification,
6
+ criticalNotification,
7
+ close
5
8
  };
6
9
  export {
7
- o as close,
8
- t as criticalNotification,
9
- c as default,
10
- i as notification
10
+ close,
11
+ criticalNotification,
12
+ zh as default,
13
+ notification
11
14
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/notice",
3
3
  "description": "Semrush Notice Component",
4
- "version": "16.0.0-prerelease.6",
4
+ "version": "16.0.0-prerelease.7",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -14,15 +14,15 @@
14
14
  "types": "./lib/types/index.d.ts"
15
15
  },
16
16
  "dependencies": {
17
- "@semcore/button": "16.0.0-prerelease.6",
18
- "@semcore/icon": "16.0.0-prerelease.6",
19
- "@semcore/notice-global": "16.0.0-prerelease.6",
20
- "@semcore/animation": "16.0.0-prerelease.6",
21
- "@semcore/flex-box": "16.0.0-prerelease.6",
22
- "@semcore/typography": "16.0.0-prerelease.6"
17
+ "@semcore/button": "16.0.0-prerelease.7",
18
+ "@semcore/icon": "16.0.0-prerelease.7",
19
+ "@semcore/notice-global": "16.0.0-prerelease.7",
20
+ "@semcore/animation": "16.0.0-prerelease.7",
21
+ "@semcore/flex-box": "16.0.0-prerelease.7",
22
+ "@semcore/typography": "16.0.0-prerelease.7"
23
23
  },
24
24
  "peerDependencies": {
25
- "@semcore/base-components": "^16.0.0-prerelease.6"
25
+ "@semcore/base-components": "^16.0.0-prerelease.7"
26
26
  },
27
27
  "repository": {
28
28
  "type": "git",