@semcore/notice 5.46.0 → 16.0.0-prerelease.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -3
- package/lib/cjs/Notice.js +22 -24
- package/lib/cjs/Notice.js.map +1 -1
- package/lib/cjs/NoticeSmart.js +3 -4
- package/lib/cjs/NoticeSmart.js.map +1 -1
- package/lib/es6/Notice.js +22 -22
- package/lib/es6/Notice.js.map +1 -1
- package/lib/es6/NoticeSmart.js +2 -2
- package/lib/es6/NoticeSmart.js.map +1 -1
- package/lib/esm/Notice.mjs +167 -137
- package/lib/esm/NoticeSmart.mjs +35 -27
- package/lib/esm/index.mjs +4 -4
- package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +30 -30
- package/lib/esm/translations/de.json.mjs +11 -8
- package/lib/esm/translations/en.json.mjs +11 -8
- package/lib/esm/translations/es.json.mjs +11 -8
- package/lib/esm/translations/fr.json.mjs +11 -8
- package/lib/esm/translations/it.json.mjs +11 -8
- package/lib/esm/translations/ja.json.mjs +11 -8
- package/lib/esm/translations/ko.json.mjs +11 -8
- package/lib/esm/translations/nl.json.mjs +11 -8
- package/lib/esm/translations/pl.json.mjs +11 -8
- package/lib/esm/translations/pt.json.mjs +11 -8
- package/lib/esm/translations/sv.json.mjs +11 -8
- package/lib/esm/translations/tr.json.mjs +11 -8
- package/lib/esm/translations/vi.json.mjs +11 -8
- package/lib/esm/translations/zh.json.mjs +11 -8
- package/package.json +8 -11
package/lib/esm/Notice.mjs
CHANGED
|
@@ -1,184 +1,214 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { sstyled
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
var W = (
|
|
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 = (
|
|
23
22
|
/*__reshadow_css_start__*/
|
|
24
|
-
(
|
|
23
|
+
(sstyled.insert(
|
|
25
24
|
/*__inner_css_start__*/
|
|
26
|
-
".
|
|
27
|
-
"
|
|
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
|
+
"un6cc_gg_"
|
|
28
27
|
), {
|
|
29
|
-
__SNotice: "
|
|
30
|
-
__SContent: "
|
|
31
|
-
__SActions: "
|
|
32
|
-
__SLabel: "
|
|
33
|
-
_theme_info: "
|
|
34
|
-
_theme_danger: "
|
|
35
|
-
_theme_warning: "
|
|
36
|
-
_theme_success: "
|
|
37
|
-
_theme_muted: "
|
|
38
|
-
_theme_custom: "
|
|
39
|
-
"--color": "--
|
|
40
|
-
__SCloseIcon: "
|
|
41
|
-
"--backgroundColor": "--
|
|
42
|
-
__STitle: "
|
|
43
|
-
__SText: "
|
|
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
|
+
"--color": "--color_un6cc",
|
|
39
|
+
"__SCloseIcon": "___SCloseIcon_un6cc_gg_",
|
|
40
|
+
"--backgroundColor": "--backgroundColor_un6cc",
|
|
41
|
+
"__STitle": "___STitle_un6cc_gg_",
|
|
42
|
+
"__SText": "___SText_un6cc_gg_"
|
|
44
43
|
})
|
|
45
44
|
);
|
|
46
|
-
function
|
|
47
|
-
return !["danger", "warning", "success", "info", "muted"].includes(
|
|
45
|
+
function isCustomTheme(theme) {
|
|
46
|
+
return !["danger", "warning", "success", "info", "muted"].includes(theme);
|
|
48
47
|
}
|
|
49
|
-
var
|
|
50
|
-
|
|
51
|
-
var
|
|
52
|
-
function
|
|
53
|
-
var
|
|
54
|
-
|
|
55
|
-
for (var
|
|
56
|
-
|
|
57
|
-
|
|
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;
|
|
58
60
|
}
|
|
59
|
-
|
|
61
|
+
_createClass(RootNotice2, [{
|
|
60
62
|
key: "componentDidMount",
|
|
61
|
-
value: function() {
|
|
63
|
+
value: function componentDidMount() {
|
|
62
64
|
if (this.ref.current && process.env.NODE_ENV !== "production" && !["muted", "danger"].includes(this.props.theme)) {
|
|
63
|
-
var
|
|
64
|
-
|
|
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;
|
|
65
70
|
};
|
|
66
|
-
|
|
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);
|
|
67
72
|
}
|
|
68
73
|
}
|
|
69
74
|
}, {
|
|
70
75
|
key: "getLabelProps",
|
|
71
|
-
value: function() {
|
|
72
|
-
var
|
|
76
|
+
value: function getLabelProps() {
|
|
77
|
+
var _this$asProps = this.asProps, theme = _this$asProps.theme, resolveColor = _this$asProps.resolveColor;
|
|
73
78
|
return {
|
|
74
|
-
theme
|
|
75
|
-
resolveColor
|
|
79
|
+
theme,
|
|
80
|
+
resolveColor
|
|
76
81
|
};
|
|
77
82
|
}
|
|
78
83
|
}, {
|
|
79
84
|
key: "getCloseIconProps",
|
|
80
|
-
value: function() {
|
|
81
|
-
var
|
|
85
|
+
value: function getCloseIconProps() {
|
|
86
|
+
var getI18nText = this.asProps.getI18nText;
|
|
82
87
|
return {
|
|
83
|
-
getI18nText
|
|
88
|
+
getI18nText
|
|
84
89
|
};
|
|
85
90
|
}
|
|
86
91
|
}, {
|
|
87
92
|
key: "getCloseProps",
|
|
88
|
-
value: function() {
|
|
89
|
-
var
|
|
93
|
+
value: function getCloseProps() {
|
|
94
|
+
var getI18nText = this.asProps.getI18nText;
|
|
90
95
|
return {
|
|
91
|
-
getI18nText
|
|
96
|
+
getI18nText
|
|
92
97
|
};
|
|
93
98
|
}
|
|
94
99
|
}, {
|
|
95
100
|
key: "render",
|
|
96
|
-
value: function() {
|
|
97
|
-
var
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
var
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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
|
+
var role = theme === "muted" ? void 0 : "region";
|
|
116
|
+
return _ref9 = sstyled(styles), /* @__PURE__ */ React.createElement(SNotice, _ref9.cn("SNotice", _objectSpread({}, assignProps({
|
|
117
|
+
"visible": !hidden,
|
|
118
|
+
"use:theme": useTheme,
|
|
119
|
+
"backgroundColor": color,
|
|
120
|
+
"role": role,
|
|
121
|
+
"aria-label": ariaLabel,
|
|
122
|
+
"ref": this.ref
|
|
123
|
+
}, _ref))), /* @__PURE__ */ React.createElement(Children, _ref9.cn("Children", {})));
|
|
111
124
|
}
|
|
112
|
-
}])
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
125
|
+
}]);
|
|
126
|
+
return RootNotice2;
|
|
127
|
+
}(Component);
|
|
128
|
+
_defineProperty(RootNotice, "displayName", "Notice");
|
|
129
|
+
_defineProperty(RootNotice, "style", style);
|
|
130
|
+
_defineProperty(RootNotice, "enhance", [i18nEnhance(localizedMessages), cssVariableEnhance({
|
|
117
131
|
variable: "--intergalactic-duration-popper",
|
|
118
132
|
fallback: "200",
|
|
119
133
|
map: Number.parseInt,
|
|
120
134
|
prop: "duration"
|
|
121
|
-
}),
|
|
122
|
-
|
|
135
|
+
}), resolveColorEnhance()]);
|
|
136
|
+
_defineProperty(RootNotice, "defaultProps", {
|
|
123
137
|
theme: "info",
|
|
124
|
-
i18n:
|
|
138
|
+
i18n: localizedMessages,
|
|
125
139
|
locale: "en"
|
|
126
140
|
});
|
|
127
|
-
function
|
|
128
|
-
var
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
141
|
+
function Label(_ref17) {
|
|
142
|
+
var _ref2 = arguments[0], _ref10;
|
|
143
|
+
var styles = _ref17.styles, theme = _ref17.theme, resolveColor = _ref17.resolveColor;
|
|
144
|
+
var SLabel = Box;
|
|
145
|
+
var useTheme = isCustomTheme(theme) ? "custom" : theme;
|
|
146
|
+
var color = resolveColor(theme);
|
|
147
|
+
return _ref10 = sstyled(styles), /* @__PURE__ */ React.createElement(SLabel, _ref10.cn("SLabel", _objectSpread({}, assignProps({
|
|
148
|
+
"use:theme": useTheme,
|
|
149
|
+
"color": color
|
|
150
|
+
}, _ref2))));
|
|
133
151
|
}
|
|
134
|
-
function
|
|
135
|
-
var
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
152
|
+
function Title(_ref18) {
|
|
153
|
+
var _ref3 = arguments[0], _ref11;
|
|
154
|
+
var styles = _ref18.styles;
|
|
155
|
+
var STitle = Text;
|
|
156
|
+
return _ref11 = sstyled(styles), /* @__PURE__ */ React.createElement(STitle, _ref11.cn("STitle", _objectSpread({}, assignProps({
|
|
157
|
+
"tag": "div",
|
|
158
|
+
"size": 300,
|
|
159
|
+
"fontWeight": "bold"
|
|
160
|
+
}, _ref3))));
|
|
141
161
|
}
|
|
142
|
-
function
|
|
143
|
-
var
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
},
|
|
162
|
+
function NoticeText(_ref19) {
|
|
163
|
+
var _ref4 = arguments[0], _ref12;
|
|
164
|
+
var styles = _ref19.styles;
|
|
165
|
+
var SText = Text;
|
|
166
|
+
return _ref12 = sstyled(styles), /* @__PURE__ */ React.createElement(SText, _ref12.cn("SText", _objectSpread({}, assignProps({
|
|
167
|
+
"tag": "div"
|
|
168
|
+
}, _ref4))));
|
|
147
169
|
}
|
|
148
|
-
function
|
|
149
|
-
var
|
|
150
|
-
|
|
170
|
+
function Actions(_ref20) {
|
|
171
|
+
var _ref5 = arguments[0], _ref13;
|
|
172
|
+
var styles = _ref20.styles;
|
|
173
|
+
var SActions = Box;
|
|
174
|
+
return _ref13 = sstyled(styles), /* @__PURE__ */ React.createElement(SActions, _ref13.cn("SActions", _objectSpread({}, assignProps({}, _ref5))));
|
|
151
175
|
}
|
|
152
|
-
function
|
|
153
|
-
var
|
|
154
|
-
|
|
176
|
+
function Content(_ref21) {
|
|
177
|
+
var _ref6 = arguments[0], _ref14;
|
|
178
|
+
var styles = _ref21.styles;
|
|
179
|
+
var SContent = Box;
|
|
180
|
+
return _ref14 = sstyled(styles), /* @__PURE__ */ React.createElement(SContent, _ref14.cn("SContent", _objectSpread({}, assignProps({}, _ref6))));
|
|
155
181
|
}
|
|
156
|
-
function
|
|
157
|
-
var
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
"
|
|
162
|
-
|
|
182
|
+
function CloseIcon(_ref22) {
|
|
183
|
+
var _ref7 = arguments[0], _ref15;
|
|
184
|
+
var styles = _ref22.styles, getI18nText = _ref22.getI18nText;
|
|
185
|
+
var SCloseIcon = Box;
|
|
186
|
+
return _ref15 = sstyled(styles), /* @__PURE__ */ React.createElement(SCloseIcon, _ref15.cn("SCloseIcon", _objectSpread({}, assignProps({
|
|
187
|
+
"tag": CloseIconM,
|
|
188
|
+
"interactive": true,
|
|
189
|
+
"aria-label": getI18nText("close")
|
|
190
|
+
}, _ref7))));
|
|
163
191
|
}
|
|
164
|
-
function
|
|
165
|
-
var
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
"
|
|
171
|
-
|
|
192
|
+
function Close(_ref23) {
|
|
193
|
+
var _ref8 = arguments[0], _ref16;
|
|
194
|
+
var styles = _ref23.styles, getI18nText = _ref23.getI18nText;
|
|
195
|
+
var SCloseIcon = Button;
|
|
196
|
+
return _ref16 = sstyled(styles), /* @__PURE__ */ React.createElement(SCloseIcon, _ref16.cn("SCloseIcon", _objectSpread({}, assignProps({
|
|
197
|
+
"addonLeft": CloseIconM,
|
|
198
|
+
"use": "tertiary",
|
|
199
|
+
"theme": "muted",
|
|
200
|
+
"aria-label": getI18nText("close")
|
|
201
|
+
}, _ref8))));
|
|
172
202
|
}
|
|
173
|
-
var
|
|
174
|
-
Label
|
|
175
|
-
Title
|
|
176
|
-
Text:
|
|
177
|
-
Actions
|
|
178
|
-
Content
|
|
179
|
-
CloseIcon
|
|
180
|
-
Close
|
|
203
|
+
var Notice = createComponent(RootNotice, {
|
|
204
|
+
Label,
|
|
205
|
+
Title,
|
|
206
|
+
Text: NoticeText,
|
|
207
|
+
Actions,
|
|
208
|
+
Content,
|
|
209
|
+
CloseIcon,
|
|
210
|
+
Close
|
|
181
211
|
});
|
|
182
212
|
export {
|
|
183
|
-
|
|
213
|
+
Notice as default
|
|
184
214
|
};
|
package/lib/esm/NoticeSmart.mjs
CHANGED
|
@@ -1,35 +1,43 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
function
|
|
14
|
-
|
|
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
|
-
|
|
17
|
+
_createClass(NoticeSmart2, [{
|
|
17
18
|
key: "render",
|
|
18
|
-
value: function() {
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
}])
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
33
|
+
}]);
|
|
34
|
+
return NoticeSmart2;
|
|
35
|
+
}(Component);
|
|
36
|
+
_defineProperty(NoticeSmart, "displayName", "NoticeSmart");
|
|
37
|
+
_defineProperty(NoticeSmart, "defaultProps", {
|
|
30
38
|
theme: "info"
|
|
31
39
|
});
|
|
32
|
-
const
|
|
40
|
+
const NoticeSmart$1 = createComponent(NoticeSmart);
|
|
33
41
|
export {
|
|
34
|
-
|
|
42
|
+
NoticeSmart$1 as default
|
|
35
43
|
};
|
package/lib/esm/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { default as
|
|
1
|
+
import Notice from "./Notice.mjs";
|
|
2
|
+
import { default as default2 } from "./NoticeSmart.mjs";
|
|
3
3
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
default2 as NoticeSmart,
|
|
5
|
+
Notice as default
|
|
6
6
|
};
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
var
|
|
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
|
|
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
|
-
|
|
32
|
+
localizedMessages
|
|
33
33
|
};
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
close,
|
|
11
|
+
criticalNotification,
|
|
12
|
+
de as default,
|
|
13
|
+
notification
|
|
11
14
|
};
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
close,
|
|
11
|
+
criticalNotification,
|
|
12
|
+
en as default,
|
|
13
|
+
notification
|
|
11
14
|
};
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
close,
|
|
11
|
+
criticalNotification,
|
|
12
|
+
es as default,
|
|
13
|
+
notification
|
|
11
14
|
};
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
close,
|
|
11
|
+
criticalNotification,
|
|
12
|
+
fr as default,
|
|
13
|
+
notification
|
|
11
14
|
};
|