@semcore/notice 4.1.9 → 4.1.12
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 +18 -0
- package/lib/cjs/Notice.js +17 -15
- package/lib/cjs/Notice.js.map +1 -1
- package/lib/es6/Notice.js +17 -15
- package/lib/es6/Notice.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
|
5
|
+
## [4.1.12] - 2022-08-23
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Added aria-live attribute for better accessibility.
|
|
10
|
+
|
|
11
|
+
## [4.1.11] - 2022-08-18
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- Version patch update due to children dependencies update (`@semcore/icon` [2.30.0 ~> 2.30.1]).
|
|
16
|
+
|
|
17
|
+
## [4.1.10] - 2022-08-18
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- Version patch update due to children dependencies update (`@semcore/icon` [2.29.5 ~> 2.30.0]).
|
|
22
|
+
|
|
5
23
|
## [4.1.9] - 2022-08-18
|
|
6
24
|
|
|
7
25
|
### Changed
|
package/lib/cjs/Notice.js
CHANGED
|
@@ -54,23 +54,23 @@ var style = (
|
|
|
54
54
|
/*__reshadow_css_start__*/
|
|
55
55
|
_core.sstyled.insert(
|
|
56
56
|
/*__inner_css_start__*/
|
|
57
|
-
".
|
|
57
|
+
".___SNotice_1ojyi_gg_{display:flex;padding:16px;font-size:14px;line-height:1.42;box-sizing:border-box;border-style:solid;border-width:1px;border-radius:6px}.___SNotice_1ojyi_gg_._theme_info_1ojyi_gg_{background-color:#e9f7ff;border-color:#8ecdff}.___SNotice_1ojyi_gg_._theme_info_1ojyi_gg_ .___SCloseIcon_1ojyi_gg_{color:#008ff8}.___SNotice_1ojyi_gg_._theme_info_1ojyi_gg_ .___SCloseIcon_1ojyi_gg_:hover{color:#006dca}.___SNotice_1ojyi_gg_._theme_danger_1ojyi_gg_{background-color:#fff0f7;border-color:#ffaeb5}.___SNotice_1ojyi_gg_._theme_danger_1ojyi_gg_ .___SCloseIcon_1ojyi_gg_{color:#ff4953}.___SNotice_1ojyi_gg_._theme_danger_1ojyi_gg_ .___SCloseIcon_1ojyi_gg_:hover{color:#d1002f}.___SNotice_1ojyi_gg_._theme_warning_1ojyi_gg_{background-color:#fff3d9;border-color:#ffb26e}.___SNotice_1ojyi_gg_._theme_warning_1ojyi_gg_ .___SCloseIcon_1ojyi_gg_{color:#ff642d}.___SNotice_1ojyi_gg_._theme_warning_1ojyi_gg_ .___SCloseIcon_1ojyi_gg_:hover{color:#c33909}.___SNotice_1ojyi_gg_._theme_success_1ojyi_gg_{background-color:#dbfee8;border-color:#59ddaa}.___SNotice_1ojyi_gg_._theme_success_1ojyi_gg_ .___SCloseIcon_1ojyi_gg_{color:#009f81}.___SNotice_1ojyi_gg_._theme_success_1ojyi_gg_ .___SCloseIcon_1ojyi_gg_:hover{color:#007c65}.___SContent_1ojyi_gg_{flex:1 1 auto;width:100%}.___SActions_1ojyi_gg_{flex-shrink:0;margin-top:12px}.___SLabel_1ojyi_gg_{margin-top:2px;margin-right:8px;display:inline-flex}.___SLabel_1ojyi_gg_._theme_info_1ojyi_gg_{color:#8a8e9b}.___SLabel_1ojyi_gg_._theme_danger_1ojyi_gg_{color:#ff4953}.___SLabel_1ojyi_gg_._theme_warning_1ojyi_gg_{color:#ff642d}.___SLabel_1ojyi_gg_._theme_success_1ojyi_gg_{color:#009f81}.___SLabel_1ojyi_gg_._theme_custom_1ojyi_gg_{color:var(--color_1ojyi)}.___SCloseIcon_1ojyi_gg_{flex-shrink:0;margin-left:16px}.___SNotice_1ojyi_gg_._theme_custom_1ojyi_gg_{background-color:var(--backgroundColor_1ojyi);border-color:var(--backgroundColor_1ojyi)}"
|
|
58
58
|
/*__inner_css_end__*/
|
|
59
|
-
, "
|
|
59
|
+
, "1ojyi_gg_")
|
|
60
60
|
/*__reshadow_css_end__*/
|
|
61
61
|
, {
|
|
62
|
-
"__SNotice": "
|
|
63
|
-
"_theme_info": "
|
|
64
|
-
"__SCloseIcon": "
|
|
65
|
-
"_theme_danger": "
|
|
66
|
-
"_theme_warning": "
|
|
67
|
-
"_theme_success": "
|
|
68
|
-
"__SContent": "
|
|
69
|
-
"__SActions": "
|
|
70
|
-
"__SLabel": "
|
|
71
|
-
"_theme_custom": "
|
|
72
|
-
"--color": "--
|
|
73
|
-
"--backgroundColor": "--
|
|
62
|
+
"__SNotice": "___SNotice_1ojyi_gg_",
|
|
63
|
+
"_theme_info": "_theme_info_1ojyi_gg_",
|
|
64
|
+
"__SCloseIcon": "___SCloseIcon_1ojyi_gg_",
|
|
65
|
+
"_theme_danger": "_theme_danger_1ojyi_gg_",
|
|
66
|
+
"_theme_warning": "_theme_warning_1ojyi_gg_",
|
|
67
|
+
"_theme_success": "_theme_success_1ojyi_gg_",
|
|
68
|
+
"__SContent": "___SContent_1ojyi_gg_",
|
|
69
|
+
"__SActions": "___SActions_1ojyi_gg_",
|
|
70
|
+
"__SLabel": "___SLabel_1ojyi_gg_",
|
|
71
|
+
"_theme_custom": "_theme_custom_1ojyi_gg_",
|
|
72
|
+
"--color": "--color_1ojyi",
|
|
73
|
+
"--backgroundColor": "--backgroundColor_1ojyi"
|
|
74
74
|
});
|
|
75
75
|
|
|
76
76
|
function isCustomTheme(theme) {
|
|
@@ -108,6 +108,7 @@ var RootNotice = /*#__PURE__*/function (_Component) {
|
|
|
108
108
|
hidden = _this$asProps.hidden,
|
|
109
109
|
theme = _this$asProps.theme,
|
|
110
110
|
use = _this$asProps.use;
|
|
111
|
+
var isAssertive = theme === 'danger' || theme === 'warning';
|
|
111
112
|
var color = (0, _color["default"])(theme);
|
|
112
113
|
var useTheme = isCustomTheme(theme) ? 'custom' : theme;
|
|
113
114
|
|
|
@@ -121,7 +122,8 @@ var RootNotice = /*#__PURE__*/function (_Component) {
|
|
|
121
122
|
"visible": !hidden,
|
|
122
123
|
"use:theme": useTheme,
|
|
123
124
|
"backgroundColor": color,
|
|
124
|
-
"role": "
|
|
125
|
+
"role": "status",
|
|
126
|
+
"aria-live": isAssertive ? 'assertive' : 'polite'
|
|
125
127
|
}, _ref))), /*#__PURE__*/_react["default"].createElement(Children, _ref6.cn("Children", {})));
|
|
126
128
|
}
|
|
127
129
|
}]);
|
package/lib/cjs/Notice.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Notice.js","names":["isCustomTheme","theme","includes","RootNotice","asProps","SNotice","FadeInOut","Children","styles","hidden","use","color","resolveColor","useTheme","logger","warn","displayName","sstyled","Component","style","duration","Label","SLabel","Box","Actions","SActions","Content","SContent","CloseIcon","SCloseIcon","Close","createComponent"],"sources":["../../src/Notice.jsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\nimport Close from '@semcore/icon/Close/m';\nimport resolveColor from '@semcore/utils/lib/color';\nimport { FadeInOut } from '@semcore/animation';\nimport logger from '@semcore/utils/lib/logger';\nimport NoticeGlobal from '@semcore/notice-global';\n\nimport style from './style/notice.shadow.css';\n\nfunction isCustomTheme(theme) {\n return !['danger', 'warning', 'success', 'info'].includes(theme);\n}\n\nclass RootNotice extends Component {\n static displayName = 'Notice';\n static style = style;\n static defaultProps = {\n theme: 'info',\n duration: 250,\n };\n\n getLabelProps() {\n const { theme } = this.asProps;\n return {\n theme,\n };\n }\n\n render() {\n const SNotice = Root;\n const { Children, styles, hidden, theme, use } = this.asProps;\n const color = resolveColor(theme);\n const useTheme = isCustomTheme(theme) ? 'custom' : theme;\n\n if (use === 'primary') {\n logger.warn(\n true,\n `This deprecated property, you should use component <NoticeGlobal/>`,\n RootNotice.displayName,\n );\n return <NoticeGlobal {...this.asProps} />;\n }\n\n return sstyled(styles)(\n <SNotice\n render={FadeInOut}\n visible={!hidden}\n use:theme={useTheme}\n backgroundColor={color}\n role=\"
|
|
1
|
+
{"version":3,"file":"Notice.js","names":["isCustomTheme","theme","includes","RootNotice","asProps","SNotice","FadeInOut","Children","styles","hidden","use","isAssertive","color","resolveColor","useTheme","logger","warn","displayName","sstyled","Component","style","duration","Label","SLabel","Box","Actions","SActions","Content","SContent","CloseIcon","SCloseIcon","Close","createComponent"],"sources":["../../src/Notice.jsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\nimport Close from '@semcore/icon/Close/m';\nimport resolveColor from '@semcore/utils/lib/color';\nimport { FadeInOut } from '@semcore/animation';\nimport logger from '@semcore/utils/lib/logger';\nimport NoticeGlobal from '@semcore/notice-global';\n\nimport style from './style/notice.shadow.css';\n\nfunction isCustomTheme(theme) {\n return !['danger', 'warning', 'success', 'info'].includes(theme);\n}\n\nclass RootNotice extends Component {\n static displayName = 'Notice';\n static style = style;\n static defaultProps = {\n theme: 'info',\n duration: 250,\n };\n\n getLabelProps() {\n const { theme } = this.asProps;\n return {\n theme,\n };\n }\n\n render() {\n const SNotice = Root;\n const { Children, styles, hidden, theme, use } = this.asProps;\n const isAssertive = theme === 'danger' || theme === 'warning';\n const color = resolveColor(theme);\n const useTheme = isCustomTheme(theme) ? 'custom' : theme;\n\n if (use === 'primary') {\n logger.warn(\n true,\n `This deprecated property, you should use component <NoticeGlobal/>`,\n RootNotice.displayName,\n );\n return <NoticeGlobal {...this.asProps} />;\n }\n\n return sstyled(styles)(\n <SNotice\n render={FadeInOut}\n visible={!hidden}\n use:theme={useTheme}\n backgroundColor={color}\n role=\"status\"\n aria-live={isAssertive ? 'assertive' : 'polite'}\n >\n <Children />\n </SNotice>,\n );\n }\n}\n\nfunction Label({ styles, theme }) {\n const SLabel = Root;\n const useTheme = isCustomTheme(theme) ? 'custom' : theme;\n const color = resolveColor(theme);\n return sstyled(styles)(<SLabel render={Box} use:theme={useTheme} color={color} />);\n}\n\nfunction Actions({ styles }) {\n const SActions = Root;\n return sstyled(styles)(<SActions render={Box} />);\n}\n\nfunction Content({ styles }) {\n const SContent = Root;\n return sstyled(styles)(<SContent render={Box} />);\n}\n\nfunction CloseIcon({ styles }) {\n const SCloseIcon = Root;\n return sstyled(styles)(\n <SCloseIcon render={Box} tag={Close} interactive aria-label=\"Close alert\" />,\n );\n}\n\nexport default createComponent(RootNotice, {\n Label,\n Actions,\n Content,\n CloseIcon,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA;;AADA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,SAASA,aAAT,CAAuBC,KAAvB,EAA8B;EAC5B,OAAO,CAAC,CAAC,QAAD,EAAW,SAAX,EAAsB,SAAtB,EAAiC,MAAjC,EAAyCC,QAAzC,CAAkDD,KAAlD,CAAR;AACD;;IAEKE,U;;;;;;;;;;;;WAQJ,yBAAgB;MACd,IAAQF,KAAR,GAAkB,KAAKG,OAAvB,CAAQH,KAAR;MACA,OAAO;QACLA,KAAK,EAALA;MADK,CAAP;IAGD;;;WAED,kBAAS;MAAA;MAAA;;MACP,IAAMI,OAAO,GAiBDC,oBAjBZ;MACA,oBAAiD,KAAKF,OAAtD;MAAA,IAAQG,QAAR,iBAAQA,QAAR;MAAA,IAAkBC,MAAlB,iBAAkBA,MAAlB;MAAA,IAA0BC,MAA1B,iBAA0BA,MAA1B;MAAA,IAAkCR,KAAlC,iBAAkCA,KAAlC;MAAA,IAAyCS,GAAzC,iBAAyCA,GAAzC;MACA,IAAMC,WAAW,GAAGV,KAAK,KAAK,QAAV,IAAsBA,KAAK,KAAK,SAApD;MACA,IAAMW,KAAK,GAAG,IAAAC,iBAAA,EAAaZ,KAAb,CAAd;MACA,IAAMa,QAAQ,GAAGd,aA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AU,UAAVA,MAAU;EAC3B,IAAMoB,QAAQ,GAC2BJ,YADzC;EACA,eAAO,IAAAN,aAAA,EAAQV,MAAR,CAAP,eAAuB,gCAAC,QAAD,6EAAvB;AACD;;AAED,SAASqB,SAAT,SAA+B;EAAA;EAAA;;EAAA,IAAVrB,MAAU,UAAVA,MAAU;EAC7B,IAAMsB,UAAU,GAEMN,YAFtB;EACA,gBAAO,IAAAN,aAAA,EAAQV,MAAR,CAAP,eACE,gCAAC,UAAD;IAAA,OAA8BuB,aAA9B;IAAA;IAAA,cAA4D;EAA5D,YADF;AAGD;;eAEc,IAAAC,gBAAA,EAAgB7B,UAAhB,EAA4B;EACzCmB,KAAK,EAALA,KADyC;EAEzCG,OAAO,EAAPA,OAFyC;EAGzCE,OAAO,EAAPA,OAHyC;EAIzCE,SAAS,EAATA;AAJyC,CAA5B,C"}
|
package/lib/es6/Notice.js
CHANGED
|
@@ -33,23 +33,23 @@ var style = (
|
|
|
33
33
|
/*__reshadow_css_start__*/
|
|
34
34
|
_sstyled.insert(
|
|
35
35
|
/*__inner_css_start__*/
|
|
36
|
-
".
|
|
36
|
+
".___SNotice_1ojyi_gg_{display:flex;padding:16px;font-size:14px;line-height:1.42;box-sizing:border-box;border-style:solid;border-width:1px;border-radius:6px}.___SNotice_1ojyi_gg_._theme_info_1ojyi_gg_{background-color:#e9f7ff;border-color:#8ecdff}.___SNotice_1ojyi_gg_._theme_info_1ojyi_gg_ .___SCloseIcon_1ojyi_gg_{color:#008ff8}.___SNotice_1ojyi_gg_._theme_info_1ojyi_gg_ .___SCloseIcon_1ojyi_gg_:hover{color:#006dca}.___SNotice_1ojyi_gg_._theme_danger_1ojyi_gg_{background-color:#fff0f7;border-color:#ffaeb5}.___SNotice_1ojyi_gg_._theme_danger_1ojyi_gg_ .___SCloseIcon_1ojyi_gg_{color:#ff4953}.___SNotice_1ojyi_gg_._theme_danger_1ojyi_gg_ .___SCloseIcon_1ojyi_gg_:hover{color:#d1002f}.___SNotice_1ojyi_gg_._theme_warning_1ojyi_gg_{background-color:#fff3d9;border-color:#ffb26e}.___SNotice_1ojyi_gg_._theme_warning_1ojyi_gg_ .___SCloseIcon_1ojyi_gg_{color:#ff642d}.___SNotice_1ojyi_gg_._theme_warning_1ojyi_gg_ .___SCloseIcon_1ojyi_gg_:hover{color:#c33909}.___SNotice_1ojyi_gg_._theme_success_1ojyi_gg_{background-color:#dbfee8;border-color:#59ddaa}.___SNotice_1ojyi_gg_._theme_success_1ojyi_gg_ .___SCloseIcon_1ojyi_gg_{color:#009f81}.___SNotice_1ojyi_gg_._theme_success_1ojyi_gg_ .___SCloseIcon_1ojyi_gg_:hover{color:#007c65}.___SContent_1ojyi_gg_{flex:1 1 auto;width:100%}.___SActions_1ojyi_gg_{flex-shrink:0;margin-top:12px}.___SLabel_1ojyi_gg_{margin-top:2px;margin-right:8px;display:inline-flex}.___SLabel_1ojyi_gg_._theme_info_1ojyi_gg_{color:#8a8e9b}.___SLabel_1ojyi_gg_._theme_danger_1ojyi_gg_{color:#ff4953}.___SLabel_1ojyi_gg_._theme_warning_1ojyi_gg_{color:#ff642d}.___SLabel_1ojyi_gg_._theme_success_1ojyi_gg_{color:#009f81}.___SLabel_1ojyi_gg_._theme_custom_1ojyi_gg_{color:var(--color_1ojyi)}.___SCloseIcon_1ojyi_gg_{flex-shrink:0;margin-left:16px}.___SNotice_1ojyi_gg_._theme_custom_1ojyi_gg_{background-color:var(--backgroundColor_1ojyi);border-color:var(--backgroundColor_1ojyi)}"
|
|
37
37
|
/*__inner_css_end__*/
|
|
38
|
-
, "
|
|
38
|
+
, "1ojyi_gg_")
|
|
39
39
|
/*__reshadow_css_end__*/
|
|
40
40
|
, {
|
|
41
|
-
"__SNotice": "
|
|
42
|
-
"_theme_info": "
|
|
43
|
-
"__SCloseIcon": "
|
|
44
|
-
"_theme_danger": "
|
|
45
|
-
"_theme_warning": "
|
|
46
|
-
"_theme_success": "
|
|
47
|
-
"__SContent": "
|
|
48
|
-
"__SActions": "
|
|
49
|
-
"__SLabel": "
|
|
50
|
-
"_theme_custom": "
|
|
51
|
-
"--color": "--
|
|
52
|
-
"--backgroundColor": "--
|
|
41
|
+
"__SNotice": "___SNotice_1ojyi_gg_",
|
|
42
|
+
"_theme_info": "_theme_info_1ojyi_gg_",
|
|
43
|
+
"__SCloseIcon": "___SCloseIcon_1ojyi_gg_",
|
|
44
|
+
"_theme_danger": "_theme_danger_1ojyi_gg_",
|
|
45
|
+
"_theme_warning": "_theme_warning_1ojyi_gg_",
|
|
46
|
+
"_theme_success": "_theme_success_1ojyi_gg_",
|
|
47
|
+
"__SContent": "___SContent_1ojyi_gg_",
|
|
48
|
+
"__SActions": "___SActions_1ojyi_gg_",
|
|
49
|
+
"__SLabel": "___SLabel_1ojyi_gg_",
|
|
50
|
+
"_theme_custom": "_theme_custom_1ojyi_gg_",
|
|
51
|
+
"--color": "--color_1ojyi",
|
|
52
|
+
"--backgroundColor": "--backgroundColor_1ojyi"
|
|
53
53
|
});
|
|
54
54
|
|
|
55
55
|
function isCustomTheme(theme) {
|
|
@@ -88,6 +88,7 @@ var RootNotice = /*#__PURE__*/function (_Component) {
|
|
|
88
88
|
hidden = _this$asProps.hidden,
|
|
89
89
|
theme = _this$asProps.theme,
|
|
90
90
|
use = _this$asProps.use;
|
|
91
|
+
var isAssertive = theme === 'danger' || theme === 'warning';
|
|
91
92
|
var color = resolveColor(theme);
|
|
92
93
|
var useTheme = isCustomTheme(theme) ? 'custom' : theme;
|
|
93
94
|
|
|
@@ -100,7 +101,8 @@ var RootNotice = /*#__PURE__*/function (_Component) {
|
|
|
100
101
|
"visible": !hidden,
|
|
101
102
|
"use:theme": useTheme,
|
|
102
103
|
"backgroundColor": color,
|
|
103
|
-
"role": "
|
|
104
|
+
"role": "status",
|
|
105
|
+
"aria-live": isAssertive ? 'assertive' : 'polite'
|
|
104
106
|
}, _ref))), /*#__PURE__*/React.createElement(Children, _ref6.cn("Children", {})));
|
|
105
107
|
}
|
|
106
108
|
}]);
|
package/lib/es6/Notice.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Notice.js","names":["React","createComponent","Component","sstyled","Root","Box","Close","resolveColor","FadeInOut","logger","NoticeGlobal","isCustomTheme","theme","includes","RootNotice","asProps","SNotice","Children","styles","hidden","use","color","useTheme","warn","displayName","style","duration","Label","SLabel","Actions","SActions","Content","SContent","CloseIcon","SCloseIcon"],"sources":["../../src/Notice.jsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\nimport Close from '@semcore/icon/Close/m';\nimport resolveColor from '@semcore/utils/lib/color';\nimport { FadeInOut } from '@semcore/animation';\nimport logger from '@semcore/utils/lib/logger';\nimport NoticeGlobal from '@semcore/notice-global';\n\nimport style from './style/notice.shadow.css';\n\nfunction isCustomTheme(theme) {\n return !['danger', 'warning', 'success', 'info'].includes(theme);\n}\n\nclass RootNotice extends Component {\n static displayName = 'Notice';\n static style = style;\n static defaultProps = {\n theme: 'info',\n duration: 250,\n };\n\n getLabelProps() {\n const { theme } = this.asProps;\n return {\n theme,\n };\n }\n\n render() {\n const SNotice = Root;\n const { Children, styles, hidden, theme, use } = this.asProps;\n const color = resolveColor(theme);\n const useTheme = isCustomTheme(theme) ? 'custom' : theme;\n\n if (use === 'primary') {\n logger.warn(\n true,\n `This deprecated property, you should use component <NoticeGlobal/>`,\n RootNotice.displayName,\n );\n return <NoticeGlobal {...this.asProps} />;\n }\n\n return sstyled(styles)(\n <SNotice\n render={FadeInOut}\n visible={!hidden}\n use:theme={useTheme}\n backgroundColor={color}\n role=\"
|
|
1
|
+
{"version":3,"file":"Notice.js","names":["React","createComponent","Component","sstyled","Root","Box","Close","resolveColor","FadeInOut","logger","NoticeGlobal","isCustomTheme","theme","includes","RootNotice","asProps","SNotice","Children","styles","hidden","use","isAssertive","color","useTheme","warn","displayName","style","duration","Label","SLabel","Actions","SActions","Content","SContent","CloseIcon","SCloseIcon"],"sources":["../../src/Notice.jsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\nimport Close from '@semcore/icon/Close/m';\nimport resolveColor from '@semcore/utils/lib/color';\nimport { FadeInOut } from '@semcore/animation';\nimport logger from '@semcore/utils/lib/logger';\nimport NoticeGlobal from '@semcore/notice-global';\n\nimport style from './style/notice.shadow.css';\n\nfunction isCustomTheme(theme) {\n return !['danger', 'warning', 'success', 'info'].includes(theme);\n}\n\nclass RootNotice extends Component {\n static displayName = 'Notice';\n static style = style;\n static defaultProps = {\n theme: 'info',\n duration: 250,\n };\n\n getLabelProps() {\n const { theme } = this.asProps;\n return {\n theme,\n };\n }\n\n render() {\n const SNotice = Root;\n const { Children, styles, hidden, theme, use } = this.asProps;\n const isAssertive = theme === 'danger' || theme === 'warning';\n const color = resolveColor(theme);\n const useTheme = isCustomTheme(theme) ? 'custom' : theme;\n\n if (use === 'primary') {\n logger.warn(\n true,\n `This deprecated property, you should use component <NoticeGlobal/>`,\n RootNotice.displayName,\n );\n return <NoticeGlobal {...this.asProps} />;\n }\n\n return sstyled(styles)(\n <SNotice\n render={FadeInOut}\n visible={!hidden}\n use:theme={useTheme}\n backgroundColor={color}\n role=\"status\"\n aria-live={isAssertive ? 'assertive' : 'polite'}\n >\n <Children />\n </SNotice>,\n );\n }\n}\n\nfunction Label({ styles, theme }) {\n const SLabel = Root;\n const useTheme = isCustomTheme(theme) ? 'custom' : theme;\n const color = resolveColor(theme);\n return sstyled(styles)(<SLabel render={Box} use:theme={useTheme} color={color} />);\n}\n\nfunction Actions({ styles }) {\n const SActions = Root;\n return sstyled(styles)(<SActions render={Box} />);\n}\n\nfunction Content({ styles }) {\n const SContent = Root;\n return sstyled(styles)(<SContent render={Box} />);\n}\n\nfunction CloseIcon({ styles }) {\n const SCloseIcon = Root;\n return sstyled(styles)(\n <SCloseIcon render={Box} tag={Close} interactive aria-label=\"Close alert\" />,\n );\n}\n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