@semcore/notice 4.3.0 → 4.4.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.
- package/CHANGELOG.md +12 -0
- package/lib/cjs/Notice.js +34 -18
- package/lib/cjs/Notice.js.map +1 -1
- package/lib/cjs/index.d.js.map +1 -1
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js +46 -0
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -0
- package/lib/cjs/translations/de.json +3 -0
- package/lib/cjs/translations/en.json +3 -0
- package/lib/cjs/translations/es.json +3 -0
- package/lib/cjs/translations/fr.json +3 -0
- package/lib/cjs/translations/it.json +3 -0
- package/lib/cjs/translations/ja.json +3 -0
- package/lib/cjs/translations/ko.json +3 -0
- package/lib/cjs/translations/pt.json +3 -0
- package/lib/cjs/translations/tr.json +3 -0
- package/lib/cjs/translations/vi.json +3 -0
- package/lib/cjs/translations/zh.json +3 -0
- package/lib/es6/Notice.js +33 -18
- package/lib/es6/Notice.js.map +1 -1
- package/lib/es6/index.d.js.map +1 -1
- package/lib/es6/translations/__intergalactic-dynamic-locales.js +25 -0
- package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -0
- package/lib/es6/translations/de.json +3 -0
- package/lib/es6/translations/en.json +3 -0
- package/lib/es6/translations/es.json +3 -0
- package/lib/es6/translations/fr.json +3 -0
- package/lib/es6/translations/it.json +3 -0
- package/lib/es6/translations/ja.json +3 -0
- package/lib/es6/translations/ko.json +3 -0
- package/lib/es6/translations/pt.json +3 -0
- package/lib/es6/translations/tr.json +3 -0
- package/lib/es6/translations/vi.json +3 -0
- package/lib/es6/translations/zh.json +3 -0
- package/lib/types/index.d.ts +1 -0
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
|
5
|
+
## [4.4.0] - 2022-12-14
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Added internationalization of aria attributes.
|
|
10
|
+
|
|
11
|
+
## [4.3.1] - 2022-12-13
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- Added `react-dom` to peer dependencies.
|
|
16
|
+
|
|
5
17
|
## [4.3.0] - 2022-12-12
|
|
6
18
|
|
|
7
19
|
### Added
|
package/lib/cjs/Notice.js
CHANGED
|
@@ -37,6 +37,10 @@ var _logger = _interopRequireDefault(require("@semcore/utils/lib/logger"));
|
|
|
37
37
|
|
|
38
38
|
var _noticeGlobal = _interopRequireDefault(require("@semcore/notice-global"));
|
|
39
39
|
|
|
40
|
+
var _intergalacticDynamicLocales = require("./translations/__intergalactic-dynamic-locales");
|
|
41
|
+
|
|
42
|
+
var _i18nEnhance = _interopRequireDefault(require("@semcore/utils/lib/enhances/i18nEnhance"));
|
|
43
|
+
|
|
40
44
|
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); }
|
|
41
45
|
|
|
42
46
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -54,23 +58,23 @@ var style = (
|
|
|
54
58
|
/*__reshadow_css_start__*/
|
|
55
59
|
_core.sstyled.insert(
|
|
56
60
|
/*__inner_css_start__*/
|
|
57
|
-
".
|
|
61
|
+
".___SNotice_19x76_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-rounded-medium,6px)}.___SNotice_19x76_gg_._theme_info_19x76_gg_{background-color:var(--intergalactic-bg-secondary-info,#e9f7ff);border-color:var(--intergalactic-border-info,#8ecdff)}.___SNotice_19x76_gg_._theme_info_19x76_gg_ .___SCloseIcon_19x76_gg_{color:var(--intergalactic-icon-primary-neutral,#6c6e79)}.___SNotice_19x76_gg_._theme_info_19x76_gg_ .___SCloseIcon_19x76_gg_:hover{color:var(--intergalactic-icon-primary-neutral-hover-active,#484a54)}.___SNotice_19x76_gg_._theme_danger_19x76_gg_{background-color:var(--intergalactic-bg-secondary-critical,#fff0f7);border-color:var(--intergalactic-border-danger,#ffaeb5)}.___SNotice_19x76_gg_._theme_danger_19x76_gg_ .___SCloseIcon_19x76_gg_{color:var(--intergalactic-icon-primary-critical,#ff4953)}.___SNotice_19x76_gg_._theme_danger_19x76_gg_ .___SCloseIcon_19x76_gg_:hover{color:var(--intergalactic-icon-primary-critical-hover-active,#d1002f)}.___SNotice_19x76_gg_._theme_warning_19x76_gg_{background-color:var(--intergalactic-bg-secondary-warning,#fff3d9);border-color:var(--intergalactic-border-warning,#ffb26e)}.___SNotice_19x76_gg_._theme_warning_19x76_gg_ .___SCloseIcon_19x76_gg_{color:var(--intergalactic-icon-primary-warning,#ff642d)}.___SNotice_19x76_gg_._theme_warning_19x76_gg_ .___SCloseIcon_19x76_gg_:hover{color:var(--intergalactic-icon-primary-warning-hover-active,#c33909)}.___SNotice_19x76_gg_._theme_success_19x76_gg_{background-color:var(--intergalactic-bg-secondary-success,#dbfee8);border-color:var(--intergalactic-border-success,#59ddaa)}.___SNotice_19x76_gg_._theme_success_19x76_gg_ .___SCloseIcon_19x76_gg_{color:var(--intergalactic-icon-primary-success,#009f81)}.___SNotice_19x76_gg_._theme_success_19x76_gg_ .___SCloseIcon_19x76_gg_:hover{color:var(--intergalactic-icon-primary-success-hover-active,#007c65)}.___SContent_19x76_gg_{flex:1 1 auto;width:100%}.___SActions_19x76_gg_{flex-shrink:0;margin-top:var(--intergalactic-spacing-3x,12px)}.___SLabel_19x76_gg_{margin-top:var(--intergalactic-spacing-05x,2px);margin-right:var(--intergalactic-spacing-2x,8px);display:inline-flex}.___SLabel_19x76_gg_._theme_info_19x76_gg_{color:var(--intergalactic-icon-primary-neutral,#6c6e79)}.___SLabel_19x76_gg_._theme_danger_19x76_gg_{color:var(--intergalactic-icon-primary-critical,#ff4953)}.___SLabel_19x76_gg_._theme_warning_19x76_gg_{color:var(--intergalactic-icon-primary-warning,#ff642d)}.___SLabel_19x76_gg_._theme_success_19x76_gg_{color:var(--intergalactic-icon-primary-success,#009f81)}.___SLabel_19x76_gg_._theme_custom_19x76_gg_{color:var(--color_19x76)}.___SCloseIcon_19x76_gg_{flex-shrink:0;margin-left:var(--intergalactic-spacing-4x,16px)}.___SNotice_19x76_gg_._theme_custom_19x76_gg_{background-color:var(--backgroundColor_19x76);border-color:var(--backgroundColor_19x76)}"
|
|
58
62
|
/*__inner_css_end__*/
|
|
59
|
-
, "
|
|
63
|
+
, "19x76_gg_")
|
|
60
64
|
/*__reshadow_css_end__*/
|
|
61
65
|
, {
|
|
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": "--
|
|
66
|
+
"__SNotice": "___SNotice_19x76_gg_",
|
|
67
|
+
"_theme_info": "_theme_info_19x76_gg_",
|
|
68
|
+
"__SCloseIcon": "___SCloseIcon_19x76_gg_",
|
|
69
|
+
"_theme_danger": "_theme_danger_19x76_gg_",
|
|
70
|
+
"_theme_warning": "_theme_warning_19x76_gg_",
|
|
71
|
+
"_theme_success": "_theme_success_19x76_gg_",
|
|
72
|
+
"__SContent": "___SContent_19x76_gg_",
|
|
73
|
+
"__SActions": "___SActions_19x76_gg_",
|
|
74
|
+
"__SLabel": "___SLabel_19x76_gg_",
|
|
75
|
+
"_theme_custom": "_theme_custom_19x76_gg_",
|
|
76
|
+
"--color": "--color_19x76",
|
|
77
|
+
"--backgroundColor": "--backgroundColor_19x76"
|
|
74
78
|
});
|
|
75
79
|
|
|
76
80
|
function isCustomTheme(theme) {
|
|
@@ -95,6 +99,14 @@ var RootNotice = /*#__PURE__*/function (_Component) {
|
|
|
95
99
|
theme: theme
|
|
96
100
|
};
|
|
97
101
|
}
|
|
102
|
+
}, {
|
|
103
|
+
key: "getCloseIconProps",
|
|
104
|
+
value: function getCloseIconProps() {
|
|
105
|
+
var getI18nText = this.asProps.getI18nText;
|
|
106
|
+
return {
|
|
107
|
+
getI18nText: getI18nText
|
|
108
|
+
};
|
|
109
|
+
}
|
|
98
110
|
}, {
|
|
99
111
|
key: "render",
|
|
100
112
|
value: function render() {
|
|
@@ -113,7 +125,7 @@ var RootNotice = /*#__PURE__*/function (_Component) {
|
|
|
113
125
|
var useTheme = isCustomTheme(theme) ? 'custom' : theme;
|
|
114
126
|
|
|
115
127
|
if (use === 'primary') {
|
|
116
|
-
_logger["default"].warn(true, "
|
|
128
|
+
_logger["default"].warn(true, "Deprecated property-value pair \"use=primary\", use component <NoticeGlobal/> instead", RootNotice.displayName);
|
|
117
129
|
|
|
118
130
|
return /*#__PURE__*/_react["default"].createElement(_noticeGlobal["default"], this.asProps);
|
|
119
131
|
}
|
|
@@ -132,9 +144,12 @@ var RootNotice = /*#__PURE__*/function (_Component) {
|
|
|
132
144
|
|
|
133
145
|
(0, _defineProperty2["default"])(RootNotice, "displayName", 'Notice');
|
|
134
146
|
(0, _defineProperty2["default"])(RootNotice, "style", style);
|
|
147
|
+
(0, _defineProperty2["default"])(RootNotice, "enhance", [(0, _i18nEnhance["default"])(_intergalacticDynamicLocales.localizedMessages)]);
|
|
135
148
|
(0, _defineProperty2["default"])(RootNotice, "defaultProps", {
|
|
136
149
|
theme: 'info',
|
|
137
|
-
duration: 250
|
|
150
|
+
duration: 250,
|
|
151
|
+
i18n: _intergalacticDynamicLocales.localizedMessages,
|
|
152
|
+
locale: 'en'
|
|
138
153
|
});
|
|
139
154
|
|
|
140
155
|
function Label(_ref11) {
|
|
@@ -174,12 +189,13 @@ function CloseIcon(_ref14) {
|
|
|
174
189
|
var _ref5 = arguments[0],
|
|
175
190
|
_ref10;
|
|
176
191
|
|
|
177
|
-
var styles = _ref14.styles
|
|
192
|
+
var styles = _ref14.styles,
|
|
193
|
+
getI18nText = _ref14.getI18nText;
|
|
178
194
|
var SCloseIcon = _flexBox.Box;
|
|
179
195
|
return _ref10 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SCloseIcon, _ref10.cn("SCloseIcon", _objectSpread({}, (0, _core.assignProps)({
|
|
180
196
|
"tag": _m["default"],
|
|
181
197
|
"interactive": true,
|
|
182
|
-
"aria-label":
|
|
198
|
+
"aria-label": getI18nText('close')
|
|
183
199
|
}, _ref5))));
|
|
184
200
|
}
|
|
185
201
|
|
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","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
|
|
1
|
+
{"version":3,"file":"Notice.js","names":["isCustomTheme","theme","includes","RootNotice","asProps","getI18nText","SNotice","FadeInOut","Children","styles","hidden","use","isAssertive","color","resolveColor","useTheme","logger","warn","displayName","sstyled","Component","style","i18nEnhance","localizedMessages","duration","i18n","locale","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';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\nimport i18nEnhance from '@semcore/utils/lib/enhances/i18nEnhance';\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 enhance = [i18nEnhance(localizedMessages)];\n static defaultProps = {\n theme: 'info',\n duration: 250,\n i18n: localizedMessages,\n locale: 'en',\n };\n\n getLabelProps() {\n const { theme } = this.asProps;\n\n return { theme };\n }\n\n getCloseIconProps() {\n const { getI18nText } = this.asProps;\n\n return { getI18nText };\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 `Deprecated property-value pair \"use=primary\", use component <NoticeGlobal/> instead`,\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, getI18nText }) {\n const SCloseIcon = Root;\n return sstyled(styles)(\n <SCloseIcon render={Box} tag={Close} interactive aria-label={getI18nText('close')} />,\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;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,SAASA,aAAT,CAAuBC,KAAvB,EAA8B;EAC5B,OAAO,CAAC,CAAC,QAAD,EAAW,SAAX,EAAsB,SAAtB,EAAiC,MAAjC,EAAyCC,QAAz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AW,CAAC,OAAD;EAAxE,YADF;AAGD;;eAEc,IAAAgC,gBAAA,EAAgBlC,UAAhB,EAA4B;EACzCwB,KAAK,EAALA,KADyC;EAEzCG,OAAO,EAAPA,OAFyC;EAGzCE,OAAO,EAAPA,OAHyC;EAIzCE,SAAS,EAATA;AAJyC,CAA5B,C"}
|
package/lib/cjs/index.d.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import { CProps, PropGetterFn, ReturnEl } from '@semcore/core';\nimport { Box, IBoxProps } from '@semcore/flex-box';\nimport { IIconProps } from '@semcore/icon';\n\nexport type NoticeTheme = 'danger' | 'warning' | 'success' | 'info' | string;\nexport type NoticeUse = 'primary' | 'secondary';\n\nexport interface INoticeProps extends IBoxProps {\n /** Property for managing visibility of Notice */\n hidden?: boolean;\n /** Notice type\n * @deprecated since version ^4.1.0\n */\n use?: NoticeUse;\n /**\n * Notice theme\n * @default info\n */\n theme?: NoticeTheme;\n /** Duration of animation, ms\n * @default 250\n */\n duration?: number;\n}\n\nexport interface INoticeLabelProps extends IBoxProps {\n theme?: NoticeTheme;\n}\n\nexport interface INoticeContext {\n getLabelProps: PropGetterFn;\n}\n\nexport interface INoticeSmartProps extends INoticeProps {\n /**\n * A custom element for additional information\n */\n label?: React.ReactNode;\n /**\n * Custom action element\n */\n actions?: React.ReactNode;\n /**\n * Adds a Close icon\n */\n closable?: boolean;\n /**\n * Callback on a click on the close button\n */\n onClose?: (event: React.SyntheticEvent) => void;\n}\n\ndeclare const Notice: (<T>(props: CProps<INoticeProps & T, INoticeContext>) => ReturnEl) & {\n Label: <T>(props: INoticeLabelProps & T) => ReturnEl;\n Actions: typeof Box;\n Content: typeof Box;\n CloseIcon: <T>(props: IIconProps & T) => ReturnEl;\n};\n\ndeclare const NoticeSmart: <T>(props: CProps<INoticeSmartProps & T>) => ReturnEl;\n\nexport { NoticeSmart };\nexport default Notice;\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import { CProps, PropGetterFn, ReturnEl } from '@semcore/core';\nimport { Box, IBoxProps } from '@semcore/flex-box';\nimport { IIconProps } from '@semcore/icon';\n\nexport type NoticeTheme = 'danger' | 'warning' | 'success' | 'info' | string;\nexport type NoticeUse = 'primary' | 'secondary';\n\nexport interface INoticeProps extends IBoxProps {\n /** Property for managing visibility of Notice */\n hidden?: boolean;\n /** Notice type\n * @deprecated since version ^4.1.0\n */\n use?: NoticeUse;\n /**\n * Notice theme\n * @default info\n */\n theme?: NoticeTheme;\n /** Duration of animation, ms\n * @default 250\n */\n duration?: number;\n locale?: string;\n}\n\nexport interface INoticeLabelProps extends IBoxProps {\n theme?: NoticeTheme;\n}\n\nexport interface INoticeContext {\n getLabelProps: PropGetterFn;\n}\n\nexport interface INoticeSmartProps extends INoticeProps {\n /**\n * A custom element for additional information\n */\n label?: React.ReactNode;\n /**\n * Custom action element\n */\n actions?: React.ReactNode;\n /**\n * Adds a Close icon\n */\n closable?: boolean;\n /**\n * Callback on a click on the close button\n */\n onClose?: (event: React.SyntheticEvent) => void;\n}\n\ndeclare const Notice: (<T>(props: CProps<INoticeProps & T, INoticeContext>) => ReturnEl) & {\n Label: <T>(props: INoticeLabelProps & T) => ReturnEl;\n Actions: typeof Box;\n Content: typeof Box;\n CloseIcon: <T>(props: IIconProps & T) => ReturnEl;\n};\n\ndeclare const NoticeSmart: <T>(props: CProps<INoticeSmartProps & T>) => ReturnEl;\n\nexport { NoticeSmart };\nexport default Notice;\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"}
|
package/lib/es6/Notice.js
CHANGED
|
@@ -27,29 +27,31 @@ import resolveColor from '@semcore/utils/lib/color';
|
|
|
27
27
|
import { FadeInOut } from '@semcore/animation';
|
|
28
28
|
import logger from '@semcore/utils/lib/logger';
|
|
29
29
|
import NoticeGlobal from '@semcore/notice-global';
|
|
30
|
+
import { localizedMessages } from './translations/__intergalactic-dynamic-locales';
|
|
31
|
+
import i18nEnhance from '@semcore/utils/lib/enhances/i18nEnhance';
|
|
30
32
|
|
|
31
33
|
/*__reshadow-styles__:"./style/notice.shadow.css"*/
|
|
32
34
|
var style = (
|
|
33
35
|
/*__reshadow_css_start__*/
|
|
34
36
|
_sstyled.insert(
|
|
35
37
|
/*__inner_css_start__*/
|
|
36
|
-
".
|
|
38
|
+
".___SNotice_19x76_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-rounded-medium,6px)}.___SNotice_19x76_gg_._theme_info_19x76_gg_{background-color:var(--intergalactic-bg-secondary-info,#e9f7ff);border-color:var(--intergalactic-border-info,#8ecdff)}.___SNotice_19x76_gg_._theme_info_19x76_gg_ .___SCloseIcon_19x76_gg_{color:var(--intergalactic-icon-primary-neutral,#6c6e79)}.___SNotice_19x76_gg_._theme_info_19x76_gg_ .___SCloseIcon_19x76_gg_:hover{color:var(--intergalactic-icon-primary-neutral-hover-active,#484a54)}.___SNotice_19x76_gg_._theme_danger_19x76_gg_{background-color:var(--intergalactic-bg-secondary-critical,#fff0f7);border-color:var(--intergalactic-border-danger,#ffaeb5)}.___SNotice_19x76_gg_._theme_danger_19x76_gg_ .___SCloseIcon_19x76_gg_{color:var(--intergalactic-icon-primary-critical,#ff4953)}.___SNotice_19x76_gg_._theme_danger_19x76_gg_ .___SCloseIcon_19x76_gg_:hover{color:var(--intergalactic-icon-primary-critical-hover-active,#d1002f)}.___SNotice_19x76_gg_._theme_warning_19x76_gg_{background-color:var(--intergalactic-bg-secondary-warning,#fff3d9);border-color:var(--intergalactic-border-warning,#ffb26e)}.___SNotice_19x76_gg_._theme_warning_19x76_gg_ .___SCloseIcon_19x76_gg_{color:var(--intergalactic-icon-primary-warning,#ff642d)}.___SNotice_19x76_gg_._theme_warning_19x76_gg_ .___SCloseIcon_19x76_gg_:hover{color:var(--intergalactic-icon-primary-warning-hover-active,#c33909)}.___SNotice_19x76_gg_._theme_success_19x76_gg_{background-color:var(--intergalactic-bg-secondary-success,#dbfee8);border-color:var(--intergalactic-border-success,#59ddaa)}.___SNotice_19x76_gg_._theme_success_19x76_gg_ .___SCloseIcon_19x76_gg_{color:var(--intergalactic-icon-primary-success,#009f81)}.___SNotice_19x76_gg_._theme_success_19x76_gg_ .___SCloseIcon_19x76_gg_:hover{color:var(--intergalactic-icon-primary-success-hover-active,#007c65)}.___SContent_19x76_gg_{flex:1 1 auto;width:100%}.___SActions_19x76_gg_{flex-shrink:0;margin-top:var(--intergalactic-spacing-3x,12px)}.___SLabel_19x76_gg_{margin-top:var(--intergalactic-spacing-05x,2px);margin-right:var(--intergalactic-spacing-2x,8px);display:inline-flex}.___SLabel_19x76_gg_._theme_info_19x76_gg_{color:var(--intergalactic-icon-primary-neutral,#6c6e79)}.___SLabel_19x76_gg_._theme_danger_19x76_gg_{color:var(--intergalactic-icon-primary-critical,#ff4953)}.___SLabel_19x76_gg_._theme_warning_19x76_gg_{color:var(--intergalactic-icon-primary-warning,#ff642d)}.___SLabel_19x76_gg_._theme_success_19x76_gg_{color:var(--intergalactic-icon-primary-success,#009f81)}.___SLabel_19x76_gg_._theme_custom_19x76_gg_{color:var(--color_19x76)}.___SCloseIcon_19x76_gg_{flex-shrink:0;margin-left:var(--intergalactic-spacing-4x,16px)}.___SNotice_19x76_gg_._theme_custom_19x76_gg_{background-color:var(--backgroundColor_19x76);border-color:var(--backgroundColor_19x76)}"
|
|
37
39
|
/*__inner_css_end__*/
|
|
38
|
-
, "
|
|
40
|
+
, "19x76_gg_")
|
|
39
41
|
/*__reshadow_css_end__*/
|
|
40
42
|
, {
|
|
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": "--
|
|
43
|
+
"__SNotice": "___SNotice_19x76_gg_",
|
|
44
|
+
"_theme_info": "_theme_info_19x76_gg_",
|
|
45
|
+
"__SCloseIcon": "___SCloseIcon_19x76_gg_",
|
|
46
|
+
"_theme_danger": "_theme_danger_19x76_gg_",
|
|
47
|
+
"_theme_warning": "_theme_warning_19x76_gg_",
|
|
48
|
+
"_theme_success": "_theme_success_19x76_gg_",
|
|
49
|
+
"__SContent": "___SContent_19x76_gg_",
|
|
50
|
+
"__SActions": "___SActions_19x76_gg_",
|
|
51
|
+
"__SLabel": "___SLabel_19x76_gg_",
|
|
52
|
+
"_theme_custom": "_theme_custom_19x76_gg_",
|
|
53
|
+
"--color": "--color_19x76",
|
|
54
|
+
"--backgroundColor": "--backgroundColor_19x76"
|
|
53
55
|
});
|
|
54
56
|
|
|
55
57
|
function isCustomTheme(theme) {
|
|
@@ -75,6 +77,14 @@ var RootNotice = /*#__PURE__*/function (_Component) {
|
|
|
75
77
|
theme: theme
|
|
76
78
|
};
|
|
77
79
|
}
|
|
80
|
+
}, {
|
|
81
|
+
key: "getCloseIconProps",
|
|
82
|
+
value: function getCloseIconProps() {
|
|
83
|
+
var getI18nText = this.asProps.getI18nText;
|
|
84
|
+
return {
|
|
85
|
+
getI18nText: getI18nText
|
|
86
|
+
};
|
|
87
|
+
}
|
|
78
88
|
}, {
|
|
79
89
|
key: "render",
|
|
80
90
|
value: function render() {
|
|
@@ -93,7 +103,7 @@ var RootNotice = /*#__PURE__*/function (_Component) {
|
|
|
93
103
|
var useTheme = isCustomTheme(theme) ? 'custom' : theme;
|
|
94
104
|
|
|
95
105
|
if (use === 'primary') {
|
|
96
|
-
logger.warn(true, "
|
|
106
|
+
logger.warn(true, "Deprecated property-value pair \"use=primary\", use component <NoticeGlobal/> instead", RootNotice.displayName);
|
|
97
107
|
return /*#__PURE__*/React.createElement(NoticeGlobal, this.asProps);
|
|
98
108
|
}
|
|
99
109
|
|
|
@@ -114,9 +124,13 @@ _defineProperty(RootNotice, "displayName", 'Notice');
|
|
|
114
124
|
|
|
115
125
|
_defineProperty(RootNotice, "style", style);
|
|
116
126
|
|
|
127
|
+
_defineProperty(RootNotice, "enhance", [i18nEnhance(localizedMessages)]);
|
|
128
|
+
|
|
117
129
|
_defineProperty(RootNotice, "defaultProps", {
|
|
118
130
|
theme: 'info',
|
|
119
|
-
duration: 250
|
|
131
|
+
duration: 250,
|
|
132
|
+
i18n: localizedMessages,
|
|
133
|
+
locale: 'en'
|
|
120
134
|
});
|
|
121
135
|
|
|
122
136
|
function Label(_ref11) {
|
|
@@ -156,12 +170,13 @@ function CloseIcon(_ref14) {
|
|
|
156
170
|
var _ref5 = arguments[0],
|
|
157
171
|
_ref10;
|
|
158
172
|
|
|
159
|
-
var styles = _ref14.styles
|
|
173
|
+
var styles = _ref14.styles,
|
|
174
|
+
getI18nText = _ref14.getI18nText;
|
|
160
175
|
var SCloseIcon = Box;
|
|
161
176
|
return _ref10 = sstyled(styles), /*#__PURE__*/React.createElement(SCloseIcon, _ref10.cn("SCloseIcon", _objectSpread({}, _assignProps5({
|
|
162
177
|
"tag": Close,
|
|
163
178
|
"interactive": true,
|
|
164
|
-
"aria-label":
|
|
179
|
+
"aria-label": getI18nText('close')
|
|
165
180
|
}, _ref5))));
|
|
166
181
|
}
|
|
167
182
|
|
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","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
|
|
1
|
+
{"version":3,"file":"Notice.js","names":["React","createComponent","Component","sstyled","Root","Box","Close","resolveColor","FadeInOut","logger","NoticeGlobal","localizedMessages","i18nEnhance","isCustomTheme","theme","includes","RootNotice","asProps","getI18nText","SNotice","Children","styles","hidden","use","isAssertive","color","useTheme","warn","displayName","style","duration","i18n","locale","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';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\nimport i18nEnhance from '@semcore/utils/lib/enhances/i18nEnhance';\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 enhance = [i18nEnhance(localizedMessages)];\n static defaultProps = {\n theme: 'info',\n duration: 250,\n i18n: localizedMessages,\n locale: 'en',\n };\n\n getLabelProps() {\n const { theme } = this.asProps;\n\n return { theme };\n }\n\n getCloseIconProps() {\n const { getI18nText } = this.asProps;\n\n return { getI18nText };\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 `Deprecated property-value pair \"use=primary\", use component <NoticeGlobal/> instead`,\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, getI18nText }) {\n const SCloseIcon = Root;\n return sstyled(styles)(\n <SCloseIcon render={Box} tag={Close} interactive aria-label={getI18nText('close')} />,\n );\n}\n\nexport default createComponent(RootNotice, {\n Label,\n Actions,\n Content,\n CloseIcon,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,eAAP,IAA0BC,SAA1B,EAAqCC,OAArC,EAA8CC,IAA9C,QAA0D,eAA1D;AACA,SAASC,GAAT,QAAoB,mBAApB;AACA,OAAOC,KAAP,MAAkB,uBAAlB;AACA,OAAOC,YAAP,MAAyB,0BAAzB;AACA,SAASC,SAAT,QAA0B,oBAA1B;AACA,OAAOC,MAAP,MAAmB,2BAAnB;AACA,OAAOC,YAAP,MAAyB,wBAAzB;AACA,SAASC,iBAAT,QAAkC,gDAAlC;AACA,OAAOC,WAAP,MAAwB,yCAAxB;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,SAASC,aAAT,CAAuBC,KAAvB,EAA8B;EAC5B,OAAO,CAAC,CAAC,QAAD,EAAW,SAAX,EAAsB,SAAtB,EAAiC,MAAjC,EAAyCC,QAAzC,CAAkDD,KAAlD,CAAR;AACD;;IAEKE,U;;;;;;;;;;;;;WAWJ,yBAAgB;MACd,IAAQF,KAAR,GAAkB,KAAKG,OAAvB,CAAQH,KAAR;MAEA,OAAO;QAAEA,KAAK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
package/lib/es6/index.d.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import { CProps, PropGetterFn, ReturnEl } from '@semcore/core';\nimport { Box, IBoxProps } from '@semcore/flex-box';\nimport { IIconProps } from '@semcore/icon';\n\nexport type NoticeTheme = 'danger' | 'warning' | 'success' | 'info' | string;\nexport type NoticeUse = 'primary' | 'secondary';\n\nexport interface INoticeProps extends IBoxProps {\n /** Property for managing visibility of Notice */\n hidden?: boolean;\n /** Notice type\n * @deprecated since version ^4.1.0\n */\n use?: NoticeUse;\n /**\n * Notice theme\n * @default info\n */\n theme?: NoticeTheme;\n /** Duration of animation, ms\n * @default 250\n */\n duration?: number;\n}\n\nexport interface INoticeLabelProps extends IBoxProps {\n theme?: NoticeTheme;\n}\n\nexport interface INoticeContext {\n getLabelProps: PropGetterFn;\n}\n\nexport interface INoticeSmartProps extends INoticeProps {\n /**\n * A custom element for additional information\n */\n label?: React.ReactNode;\n /**\n * Custom action element\n */\n actions?: React.ReactNode;\n /**\n * Adds a Close icon\n */\n closable?: boolean;\n /**\n * Callback on a click on the close button\n */\n onClose?: (event: React.SyntheticEvent) => void;\n}\n\ndeclare const Notice: (<T>(props: CProps<INoticeProps & T, INoticeContext>) => ReturnEl) & {\n Label: <T>(props: INoticeLabelProps & T) => ReturnEl;\n Actions: typeof Box;\n Content: typeof Box;\n CloseIcon: <T>(props: IIconProps & T) => ReturnEl;\n};\n\ndeclare const NoticeSmart: <T>(props: CProps<INoticeSmartProps & T>) => ReturnEl;\n\nexport { NoticeSmart };\nexport default Notice;\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import { CProps, PropGetterFn, ReturnEl } from '@semcore/core';\nimport { Box, IBoxProps } from '@semcore/flex-box';\nimport { IIconProps } from '@semcore/icon';\n\nexport type NoticeTheme = 'danger' | 'warning' | 'success' | 'info' | string;\nexport type NoticeUse = 'primary' | 'secondary';\n\nexport interface INoticeProps extends IBoxProps {\n /** Property for managing visibility of Notice */\n hidden?: boolean;\n /** Notice type\n * @deprecated since version ^4.1.0\n */\n use?: NoticeUse;\n /**\n * Notice theme\n * @default info\n */\n theme?: NoticeTheme;\n /** Duration of animation, ms\n * @default 250\n */\n duration?: number;\n locale?: string;\n}\n\nexport interface INoticeLabelProps extends IBoxProps {\n theme?: NoticeTheme;\n}\n\nexport interface INoticeContext {\n getLabelProps: PropGetterFn;\n}\n\nexport interface INoticeSmartProps extends INoticeProps {\n /**\n * A custom element for additional information\n */\n label?: React.ReactNode;\n /**\n * Custom action element\n */\n actions?: React.ReactNode;\n /**\n * Adds a Close icon\n */\n closable?: boolean;\n /**\n * Callback on a click on the close button\n */\n onClose?: (event: React.SyntheticEvent) => void;\n}\n\ndeclare const Notice: (<T>(props: CProps<INoticeProps & T, INoticeContext>) => ReturnEl) & {\n Label: <T>(props: INoticeLabelProps & T) => ReturnEl;\n Actions: typeof Box;\n Content: typeof Box;\n CloseIcon: <T>(props: IIconProps & T) => ReturnEl;\n};\n\ndeclare const NoticeSmart: <T>(props: CProps<INoticeSmartProps & T>) => ReturnEl;\n\nexport { NoticeSmart };\nexport default Notice;\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"}
|
package/lib/types/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/notice",
|
|
3
3
|
"description": "Semrush Notice Component",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.4.0",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"@semcore/core": "^1.11",
|
|
20
|
-
"react": "16.8 - 18"
|
|
20
|
+
"react": "16.8 - 18",
|
|
21
|
+
"react-dom": "16.8 - 18"
|
|
21
22
|
},
|
|
22
23
|
"jest": {
|
|
23
24
|
"preset": "@semcore/jest-preset-ui"
|