@semcore/notice 5.34.3 → 5.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/lib/cjs/Notice.js +21 -16
  3. package/lib/cjs/Notice.js.map +1 -1
  4. package/lib/cjs/index.d.js.map +1 -1
  5. package/lib/cjs/style/notice.shadow.css +17 -0
  6. package/lib/cjs/translations/de.json +1 -0
  7. package/lib/cjs/translations/en.json +1 -0
  8. package/lib/cjs/translations/es.json +1 -0
  9. package/lib/cjs/translations/fr.json +1 -0
  10. package/lib/cjs/translations/it.json +1 -0
  11. package/lib/cjs/translations/ja.json +1 -0
  12. package/lib/cjs/translations/ko.json +1 -0
  13. package/lib/cjs/translations/nl.json +1 -0
  14. package/lib/cjs/translations/pl.json +1 -0
  15. package/lib/cjs/translations/pt.json +1 -0
  16. package/lib/cjs/translations/sv.json +1 -0
  17. package/lib/cjs/translations/tr.json +1 -0
  18. package/lib/cjs/translations/vi.json +1 -0
  19. package/lib/cjs/translations/zh.json +1 -0
  20. package/lib/es6/Notice.js +21 -16
  21. package/lib/es6/Notice.js.map +1 -1
  22. package/lib/es6/index.d.js.map +1 -1
  23. package/lib/es6/style/notice.shadow.css +17 -0
  24. package/lib/es6/translations/de.json +1 -0
  25. package/lib/es6/translations/en.json +1 -0
  26. package/lib/es6/translations/es.json +1 -0
  27. package/lib/es6/translations/fr.json +1 -0
  28. package/lib/es6/translations/it.json +1 -0
  29. package/lib/es6/translations/ja.json +1 -0
  30. package/lib/es6/translations/ko.json +1 -0
  31. package/lib/es6/translations/nl.json +1 -0
  32. package/lib/es6/translations/pl.json +1 -0
  33. package/lib/es6/translations/pt.json +1 -0
  34. package/lib/es6/translations/sv.json +1 -0
  35. package/lib/es6/translations/tr.json +1 -0
  36. package/lib/es6/translations/vi.json +1 -0
  37. package/lib/es6/translations/zh.json +1 -0
  38. package/lib/types/index.d.ts +1 -1
  39. package/package.json +6 -6
package/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
+ ## [5.35.0] - 2024-06-19
6
+
7
+ ### Changed
8
+
9
+ - Notice with `warning` and `danger` themes now has aria-label "Critical Notification" (other teams has "Notification" as before).
10
+
11
+ ### Added
12
+
13
+ - `muted` theme support.
14
+
5
15
  ## [5.34.3] - 2024-06-13
6
16
 
7
17
  ### Fixed
package/lib/cjs/Notice.js CHANGED
@@ -25,22 +25,23 @@ var _intergalacticDynamicLocales = require("./translations/__intergalactic-dynam
25
25
  var _i18nEnhance = _interopRequireDefault(require("@semcore/utils/lib/enhances/i18nEnhance"));
26
26
  var _useCssVariable = require("@semcore/utils/lib/useCssVariable");
27
27
  /*__reshadow-styles__:"./style/notice.shadow.css"*/
28
- var style = ( /*__reshadow_css_start__*/_index.sstyled.insert( /*__inner_css_start__*/".___SNotice_u1iwk_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_u1iwk_gg_._theme_info_u1iwk_gg_{background-color:var(--intergalactic-bg-secondary-info, #e9f7ff);border-color:var(--intergalactic-border-info, #8ecdff)}.___SNotice_u1iwk_gg_._theme_info_u1iwk_gg_ .___SCloseIcon_u1iwk_gg_{color:var(--intergalactic-icon-primary-neutral, #6c6e79)}@media (hover:hover){.___SNotice_u1iwk_gg_._theme_info_u1iwk_gg_ .___SCloseIcon_u1iwk_gg_:hover{color:var(--intergalactic-icon-primary-neutral-hover-active, #565861)}}.___SNotice_u1iwk_gg_._theme_danger_u1iwk_gg_{background-color:var(--intergalactic-bg-secondary-critical, #fff0f7);border-color:var(--intergalactic-border-critical, #ffaeb5)}.___SNotice_u1iwk_gg_._theme_danger_u1iwk_gg_ .___SCloseIcon_u1iwk_gg_{color:var(--intergalactic-icon-primary-critical, #ff4953)}@media (hover:hover){.___SNotice_u1iwk_gg_._theme_danger_u1iwk_gg_ .___SCloseIcon_u1iwk_gg_:hover{color:var(--intergalactic-icon-primary-critical-hover-active, #CC3A42)}}.___SNotice_u1iwk_gg_._theme_warning_u1iwk_gg_{background-color:var(--intergalactic-bg-secondary-warning, #fff3d9);border-color:var(--intergalactic-border-warning, #ffb26e)}.___SNotice_u1iwk_gg_._theme_warning_u1iwk_gg_ .___SCloseIcon_u1iwk_gg_{color:var(--intergalactic-icon-primary-warning, #ff642d)}@media (hover:hover){.___SNotice_u1iwk_gg_._theme_warning_u1iwk_gg_ .___SCloseIcon_u1iwk_gg_:hover{color:var(--intergalactic-icon-primary-warning-hover-active, #CC5024)}}.___SNotice_u1iwk_gg_._theme_success_u1iwk_gg_{background-color:var(--intergalactic-bg-secondary-success, #dbfee8);border-color:var(--intergalactic-border-success, #59ddaa)}.___SNotice_u1iwk_gg_._theme_success_u1iwk_gg_ .___SCloseIcon_u1iwk_gg_{color:var(--intergalactic-icon-primary-success, #009f81)}@media (hover:hover){.___SNotice_u1iwk_gg_._theme_success_u1iwk_gg_ .___SCloseIcon_u1iwk_gg_:hover{color:var(--intergalactic-icon-primary-success-hover-active, #037E68)}}.___SContent_u1iwk_gg_{flex:1 1 auto;width:100%}.___SActions_u1iwk_gg_{flex-shrink:0;margin-top:var(--intergalactic-spacing-3x, 12px)}.___SLabel_u1iwk_gg_{margin-top:var(--intergalactic-spacing-05x, 2px);margin-right:var(--intergalactic-spacing-2x, 8px);display:inline-flex}.___SLabel_u1iwk_gg_._theme_info_u1iwk_gg_{color:var(--intergalactic-icon-primary-neutral, #6c6e79)}.___SLabel_u1iwk_gg_._theme_danger_u1iwk_gg_{color:var(--intergalactic-icon-primary-critical, #ff4953)}.___SLabel_u1iwk_gg_._theme_warning_u1iwk_gg_{color:var(--intergalactic-icon-primary-warning, #ff642d)}.___SLabel_u1iwk_gg_._theme_success_u1iwk_gg_{color:var(--intergalactic-icon-primary-success, #009f81)}.___SLabel_u1iwk_gg_._theme_custom_u1iwk_gg_{color:var(--color_u1iwk)}.___SCloseIcon_u1iwk_gg_{flex-shrink:0;margin-left:var(--intergalactic-spacing-4x, 16px)}.___SNotice_u1iwk_gg_._theme_custom_u1iwk_gg_{background-color:var(--backgroundColor_u1iwk);border-color:var(--backgroundColor_u1iwk)}" /*__inner_css_end__*/, "u1iwk_gg_") /*__reshadow_css_end__*/, {
29
- "__SNotice": "___SNotice_u1iwk_gg_",
30
- "__SContent": "___SContent_u1iwk_gg_",
31
- "__SActions": "___SActions_u1iwk_gg_",
32
- "__SLabel": "___SLabel_u1iwk_gg_",
33
- "_theme_info": "_theme_info_u1iwk_gg_",
34
- "_theme_danger": "_theme_danger_u1iwk_gg_",
35
- "_theme_warning": "_theme_warning_u1iwk_gg_",
36
- "_theme_success": "_theme_success_u1iwk_gg_",
37
- "_theme_custom": "_theme_custom_u1iwk_gg_",
38
- "--color": "--color_u1iwk",
39
- "__SCloseIcon": "___SCloseIcon_u1iwk_gg_",
40
- "--backgroundColor": "--backgroundColor_u1iwk"
28
+ var style = ( /*__reshadow_css_start__*/_index.sstyled.insert( /*__inner_css_start__*/".___SNotice_1kdg2_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_1kdg2_gg_._theme_info_1kdg2_gg_{background-color:var(--intergalactic-bg-secondary-info, #e9f7ff);border-color:var(--intergalactic-border-info, #8ecdff)}.___SNotice_1kdg2_gg_._theme_info_1kdg2_gg_ .___SCloseIcon_1kdg2_gg_{color:var(--intergalactic-icon-primary-neutral, #6c6e79)}@media (hover:hover){.___SNotice_1kdg2_gg_._theme_info_1kdg2_gg_ .___SCloseIcon_1kdg2_gg_:hover{color:var(--intergalactic-icon-primary-neutral-hover-active, #565861)}}.___SNotice_1kdg2_gg_._theme_danger_1kdg2_gg_{background-color:var(--intergalactic-bg-secondary-critical, #fff0f7);border-color:var(--intergalactic-border-critical, #ffaeb5)}.___SNotice_1kdg2_gg_._theme_danger_1kdg2_gg_ .___SCloseIcon_1kdg2_gg_{color:var(--intergalactic-icon-primary-critical, #ff4953)}@media (hover:hover){.___SNotice_1kdg2_gg_._theme_danger_1kdg2_gg_ .___SCloseIcon_1kdg2_gg_:hover{color:var(--intergalactic-icon-primary-critical-hover-active, #CC3A42)}}.___SNotice_1kdg2_gg_._theme_warning_1kdg2_gg_{background-color:var(--intergalactic-bg-secondary-warning, #fff3d9);border-color:var(--intergalactic-border-warning, #ffb26e)}.___SNotice_1kdg2_gg_._theme_warning_1kdg2_gg_ .___SCloseIcon_1kdg2_gg_{color:var(--intergalactic-icon-primary-warning, #ff642d)}@media (hover:hover){.___SNotice_1kdg2_gg_._theme_warning_1kdg2_gg_ .___SCloseIcon_1kdg2_gg_:hover{color:var(--intergalactic-icon-primary-warning-hover-active, #CC5024)}}.___SNotice_1kdg2_gg_._theme_success_1kdg2_gg_{background-color:var(--intergalactic-bg-secondary-success, #dbfee8);border-color:var(--intergalactic-border-success, #59ddaa)}.___SNotice_1kdg2_gg_._theme_success_1kdg2_gg_ .___SCloseIcon_1kdg2_gg_{color:var(--intergalactic-icon-primary-success, #009f81)}@media (hover:hover){.___SNotice_1kdg2_gg_._theme_success_1kdg2_gg_ .___SCloseIcon_1kdg2_gg_:hover{color:var(--intergalactic-icon-primary-success-hover-active, #037E68)}}.___SNotice_1kdg2_gg_._theme_muted_1kdg2_gg_{background-color:var(--intergalactic-bg-secondary-neutral, #f4f5f9);border-color:var(--intergalactic-border-secondary, #e0e1e9)}.___SLabel_1kdg2_gg_._theme_info_1kdg2_gg_,.___SNotice_1kdg2_gg_._theme_muted_1kdg2_gg_ .___SCloseIcon_1kdg2_gg_{color:var(--intergalactic-icon-primary-neutral, #6c6e79)}@media (hover:hover){.___SNotice_1kdg2_gg_._theme_muted_1kdg2_gg_ .___SCloseIcon_1kdg2_gg_:hover{color:var(--intergalactic-icon-primary-neutral-hover-active, #565861)}}.___SContent_1kdg2_gg_{flex:1 1 auto;width:100%}.___SActions_1kdg2_gg_{flex-shrink:0;margin-top:var(--intergalactic-spacing-3x, 12px)}.___SLabel_1kdg2_gg_{margin-top:var(--intergalactic-spacing-05x, 2px);margin-right:var(--intergalactic-spacing-2x, 8px);display:inline-flex}.___SLabel_1kdg2_gg_._theme_danger_1kdg2_gg_{color:var(--intergalactic-icon-primary-critical, #ff4953)}.___SLabel_1kdg2_gg_._theme_warning_1kdg2_gg_{color:var(--intergalactic-icon-primary-warning, #ff642d)}.___SLabel_1kdg2_gg_._theme_success_1kdg2_gg_{color:var(--intergalactic-icon-primary-success, #009f81)}.___SLabel_1kdg2_gg_._theme_muted_1kdg2_gg_{color:var(--intergalactic-icon-primary-neutral, #6c6e79)}.___SLabel_1kdg2_gg_._theme_custom_1kdg2_gg_{color:var(--color_1kdg2)}.___SCloseIcon_1kdg2_gg_{flex-shrink:0;margin-left:var(--intergalactic-spacing-4x, 16px)}.___SNotice_1kdg2_gg_._theme_custom_1kdg2_gg_{background-color:var(--backgroundColor_1kdg2);border-color:var(--backgroundColor_1kdg2)}" /*__inner_css_end__*/, "1kdg2_gg_") /*__reshadow_css_end__*/, {
29
+ "__SNotice": "___SNotice_1kdg2_gg_",
30
+ "__SContent": "___SContent_1kdg2_gg_",
31
+ "__SActions": "___SActions_1kdg2_gg_",
32
+ "__SLabel": "___SLabel_1kdg2_gg_",
33
+ "_theme_info": "_theme_info_1kdg2_gg_",
34
+ "_theme_danger": "_theme_danger_1kdg2_gg_",
35
+ "_theme_warning": "_theme_warning_1kdg2_gg_",
36
+ "_theme_success": "_theme_success_1kdg2_gg_",
37
+ "_theme_muted": "_theme_muted_1kdg2_gg_",
38
+ "_theme_custom": "_theme_custom_1kdg2_gg_",
39
+ "--color": "--color_1kdg2",
40
+ "__SCloseIcon": "___SCloseIcon_1kdg2_gg_",
41
+ "--backgroundColor": "--backgroundColor_1kdg2"
41
42
  });
42
43
  function isCustomTheme(theme) {
43
- return !['danger', 'warning', 'success', 'info'].includes(theme);
44
+ return !['danger', 'warning', 'success', 'info', 'muted'].includes(theme);
44
45
  }
45
46
  var RootNotice = /*#__PURE__*/function (_Component) {
46
47
  (0, _inherits2["default"])(RootNotice, _Component);
@@ -85,6 +86,10 @@ var RootNotice = /*#__PURE__*/function (_Component) {
85
86
  var isAssertive = theme === 'danger' || theme === 'warning';
86
87
  var color = resolveColor(theme);
87
88
  var useTheme = isCustomTheme(theme) ? 'custom' : theme;
89
+ var ariaLive = isAssertive ? 'assertive' : 'polite';
90
+ if (theme === 'neutral') {
91
+ ariaLive = undefined;
92
+ }
88
93
  if (use === 'primary') {
89
94
  _logger["default"].warn(true, "Deprecated property-value pair \"use=primary\", use component <NoticeGlobal/> instead", RootNotice.displayName);
90
95
  return /*#__PURE__*/_react["default"].createElement(_noticeGlobal["default"], this.asProps);
@@ -94,8 +99,8 @@ var RootNotice = /*#__PURE__*/function (_Component) {
94
99
  "use:theme": useTheme,
95
100
  "backgroundColor": color,
96
101
  "role": 'region',
97
- "aria-live": isAssertive ? 'assertive' : 'polite',
98
- "aria-label": getI18nText('notification')
102
+ "aria-live": ariaLive,
103
+ "aria-label": getI18nText(isAssertive ? 'criticalNotification' : 'notification')
99
104
  }, _ref))), /*#__PURE__*/_react["default"].createElement(Children, _ref6.cn("Children", {})));
100
105
  }
101
106
  }]);
@@ -1 +1 @@
1
- {"version":3,"file":"Notice.js","names":["_core","_interopRequireWildcard","require","_react","_interopRequireDefault","_flexBox","_m","_resolveColorEnhance","_animation","_logger","_noticeGlobal","_intergalacticDynamicLocales","_i18nEnhance","_useCssVariable","style","_index","sstyled","insert","isCustomTheme","theme","includes","RootNotice","_Component","_inherits2","_super","_createSuper2","_classCallCheck2","apply","arguments","_createClass2","key","value","getLabelProps","_this$asProps","asProps","resolveColor","getCloseIconProps","getI18nText","render","_ref","_ref6","SNotice","FadeInOut","_this$asProps2","Children","styles","hidden","use","isAssertive","color","useTheme","logger","warn","displayName","createElement","cn","_objectSpread2","assignProps","Component","_defineProperty2","i18nEnhance","localizedMessages","cssVariableEnhance","variable","fallback","map","Number","parseInt","prop","resolveColorEnhance","i18n","locale","Label","_ref11","_ref2","arguments[0]","_ref7","SLabel","Box","Actions","_ref12","_ref3","_ref8","SActions","Content","_ref13","_ref4","_ref9","SContent","CloseIcon","_ref14","_ref5","_ref10","SCloseIcon","Close","_default","createComponent","exports"],"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 resolveColorEnhance from '@semcore/utils/lib/enhances/resolveColorEnhance';\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';\nimport { cssVariableEnhance } from '@semcore/utils/lib/useCssVariable';\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 = [\n i18nEnhance(localizedMessages),\n cssVariableEnhance({\n variable: '--intergalactic-duration-popper',\n fallback: '200',\n map: Number.parseInt,\n prop: 'duration',\n }),\n resolveColorEnhance(),\n ];\n static defaultProps = {\n theme: 'info',\n i18n: localizedMessages,\n locale: 'en',\n };\n\n getLabelProps() {\n const { theme, resolveColor } = this.asProps;\n\n return { theme, resolveColor };\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, resolveColor, getI18nText } = 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='region'\n aria-live={isAssertive ? 'assertive' : 'polite'}\n aria-label={getI18nText('notification')}\n >\n <Children />\n </SNotice>,\n );\n }\n}\n\nfunction Label({ styles, theme, resolveColor }) {\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,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AADA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,EAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,oBAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,aAAA,GAAAN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AAK;EACLO,OAAO,EAAPA,OAAO;EACPK,OAAO,EAAPA,OAAO;EACPK,SAAS,EAATA;AACF,CAAC,CAAC;AAAAQ,OAAA,cAAAF,QAAA"}
1
+ {"version":3,"file":"Notice.js","names":["_core","_interopRequireWildcard","require","_react","_interopRequireDefault","_flexBox","_m","_resolveColorEnhance","_animation","_logger","_noticeGlobal","_intergalacticDynamicLocales","_i18nEnhance","_useCssVariable","style","_index","sstyled","insert","isCustomTheme","theme","includes","RootNotice","_Component","_inherits2","_super","_createSuper2","_classCallCheck2","apply","arguments","_createClass2","key","value","getLabelProps","_this$asProps","asProps","resolveColor","getCloseIconProps","getI18nText","render","_ref","_ref6","SNotice","FadeInOut","_this$asProps2","Children","styles","hidden","use","isAssertive","color","useTheme","ariaLive","undefined","logger","warn","displayName","createElement","cn","_objectSpread2","assignProps","Component","_defineProperty2","i18nEnhance","localizedMessages","cssVariableEnhance","variable","fallback","map","Number","parseInt","prop","resolveColorEnhance","i18n","locale","Label","_ref11","_ref2","arguments[0]","_ref7","SLabel","Box","Actions","_ref12","_ref3","_ref8","SActions","Content","_ref13","_ref4","_ref9","SContent","CloseIcon","_ref14","_ref5","_ref10","SCloseIcon","Close","_default","createComponent","exports"],"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 resolveColorEnhance from '@semcore/utils/lib/enhances/resolveColorEnhance';\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';\nimport { cssVariableEnhance } from '@semcore/utils/lib/useCssVariable';\n\nimport style from './style/notice.shadow.css';\n\nfunction isCustomTheme(theme) {\n return !['danger', 'warning', 'success', 'info', 'muted'].includes(theme);\n}\n\nclass RootNotice extends Component {\n static displayName = 'Notice';\n static style = style;\n static enhance = [\n i18nEnhance(localizedMessages),\n cssVariableEnhance({\n variable: '--intergalactic-duration-popper',\n fallback: '200',\n map: Number.parseInt,\n prop: 'duration',\n }),\n resolveColorEnhance(),\n ];\n static defaultProps = {\n theme: 'info',\n i18n: localizedMessages,\n locale: 'en',\n };\n\n getLabelProps() {\n const { theme, resolveColor } = this.asProps;\n\n return { theme, resolveColor };\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, resolveColor, getI18nText } = this.asProps;\n const isAssertive = theme === 'danger' || theme === 'warning';\n const color = resolveColor(theme);\n const useTheme = isCustomTheme(theme) ? 'custom' : theme;\n\n let ariaLive = isAssertive ? 'assertive' : 'polite';\n if (theme === 'neutral') {\n ariaLive = undefined;\n }\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='region'\n aria-live={ariaLive}\n aria-label={getI18nText(isAssertive ? 'criticalNotification' : 'notification')}\n >\n <Children />\n </SNotice>,\n );\n }\n}\n\nfunction Label({ styles, theme, resolveColor }) {\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={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A,IAAgB;AAClD;AAEA,SAASG,SAASA,CAAAC,MAAA,EAA0B;EAAA,IAAAC,KAAA,GAAAhB,YAAA;IAAAiB,MAAA;EAAA,IAAvBjD,MAAM,GAAA+C,MAAA,CAAN/C,MAAM;IAAER,WAAW,GAAAuD,MAAA,CAAXvD,WAAW;EACtC,IAAM0D,UAAU,GAEMf,YAAG;EADzB,OAAAc,MAAA,GAAO,IAAA9E,aAAO,EAAC6B,MAAM,CAAC,eACpB1C,MAAA,YAAAqD,aAAA,CAACuC,UAAU,EAAAD,MAAA,CAAArC,EAAA,mBAAAC,cAAA,qBAAA1D,KAAA,CAAA2D,WAAA;IAAA,OAAmBqC,aAAK;IAAA;IAAA,cAA0B3D,WAAW,CAAC,OAAO;EAAC,GAAAwD,KAAA,IAAI;AAEzF;AAAC,IAAAI,QAAA,GAEc,IAAAC,gBAAe,EAAC7E,UAAU,EAAE;EACzCqD,KAAK,EAALA,KAAK;EACLO,OAAO,EAAPA,OAAO;EACPK,OAAO,EAAPA,OAAO;EACPK,SAAS,EAATA;AACF,CAAC,CAAC;AAAAQ,OAAA,cAAAF,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';\nimport { Box, BoxProps } from '@semcore/flex-box';\nimport { IconProps } from '@semcore/icon';\nimport { FadeInOutProps } from '@semcore/animation';\n\nexport type NoticeTheme = 'danger' | 'warning' | 'success' | 'info';\nexport type NoticeUse = 'primary' | 'secondary';\n\n/** @deprecated */\nexport interface INoticeProps extends NoticeProps, UnknownProperties {}\nexport type NoticeProps = BoxProps &\n FadeInOutProps & {\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\n/** @deprecated */\nexport interface INoticeLabelProps extends NoticeLabelProps, UnknownProperties {}\nexport type NoticeLabelProps = BoxProps & {\n theme?: NoticeTheme;\n};\n\n/** @deprecated */\nexport interface INoticeContext extends NoticeContext, UnknownProperties {}\nexport type NoticeContext = {\n getLabelProps: PropGetterFn;\n};\n\n/** @deprecated */\nexport interface INoticeSmartProps extends NoticeSmartProps, UnknownProperties {}\nexport type NoticeSmartProps = NoticeProps & {\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: Intergalactic.Component<'div', NoticeProps, NoticeContext> & {\n Label: Intergalactic.Component<'div', NoticeLabelProps>;\n Actions: typeof Box;\n Content: typeof Box;\n CloseIcon: Intergalactic.Component<'div', IconProps>;\n};\n\ndeclare const NoticeSmart: Intergalactic.Component<'div', NoticeSmartProps>;\n\nexport { NoticeSmart };\nexport default Notice;\n"],"mappings":""}
1
+ {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';\nimport { Box, BoxProps } from '@semcore/flex-box';\nimport { IconProps } from '@semcore/icon';\nimport { FadeInOutProps } from '@semcore/animation';\n\nexport type NoticeTheme = 'danger' | 'warning' | 'success' | 'info' | 'muted';\nexport type NoticeUse = 'primary' | 'secondary';\n\n/** @deprecated */\nexport interface INoticeProps extends NoticeProps, UnknownProperties {}\nexport type NoticeProps = BoxProps &\n FadeInOutProps & {\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\n/** @deprecated */\nexport interface INoticeLabelProps extends NoticeLabelProps, UnknownProperties {}\nexport type NoticeLabelProps = BoxProps & {\n theme?: NoticeTheme;\n};\n\n/** @deprecated */\nexport interface INoticeContext extends NoticeContext, UnknownProperties {}\nexport type NoticeContext = {\n getLabelProps: PropGetterFn;\n};\n\n/** @deprecated */\nexport interface INoticeSmartProps extends NoticeSmartProps, UnknownProperties {}\nexport type NoticeSmartProps = NoticeProps & {\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: Intergalactic.Component<'div', NoticeProps, NoticeContext> & {\n Label: Intergalactic.Component<'div', NoticeLabelProps>;\n Actions: typeof Box;\n Content: typeof Box;\n CloseIcon: Intergalactic.Component<'div', IconProps>;\n};\n\ndeclare const NoticeSmart: Intergalactic.Component<'div', NoticeSmartProps>;\n\nexport { NoticeSmart };\nexport default Notice;\n"],"mappings":""}
@@ -62,6 +62,19 @@ SNotice[theme='success'] {
62
62
  }
63
63
  }
64
64
 
65
+ SNotice[theme='muted'] {
66
+ background-color: var(--intergalactic-bg-secondary-neutral, #f4f5f9);
67
+ border-color: var(--intergalactic-border-secondary, #e0e1e9);
68
+
69
+ & SCloseIcon {
70
+ color: var(--intergalactic-icon-primary-neutral, #6c6e79);
71
+
72
+ &:hover {
73
+ color: var(--intergalactic-icon-primary-neutral-hover-active, #565861);
74
+ }
75
+ }
76
+ }
77
+
65
78
  SContent {
66
79
  flex: 1 1 auto;
67
80
  width: 100%;
@@ -94,6 +107,10 @@ SLabel[theme='success'] {
94
107
  color: var(--intergalactic-icon-primary-success, #009f81);
95
108
  }
96
109
 
110
+ SLabel[theme='muted'] {
111
+ color: var(--intergalactic-icon-primary-neutral, #6c6e79);
112
+ }
113
+
97
114
  SLabel[theme='custom'] {
98
115
  color: var(--color);
99
116
  }
@@ -1,4 +1,5 @@
1
1
  {
2
2
  "notification": "Benachrichtigung",
3
+ "criticalNotification": "Kritische Benachrichtigung",
3
4
  "close": "Benachrichtigung schließen"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
2
  "notification": "Notification",
3
+ "criticalNotification": "Critical notification",
3
4
  "close": "Close notification"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
2
  "notification": "Notificación",
3
+ "criticalNotification": "Notificación crítica",
3
4
  "close": "Cerrar notificación"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
2
  "notification": "Notification",
3
+ "criticalNotification": "Notification critique",
3
4
  "close": "Fermer la notification"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
2
  "notification": "Notifica",
3
+ "criticalNotification": "Notifica critica",
3
4
  "close": "Chiudi la notifica"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
2
  "notification": "通知",
3
+ "criticalNotification": "重要な通知",
3
4
  "close": "通知を閉じる"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
2
  "notification": "알림",
3
+ "criticalNotification": "중요 알림",
3
4
  "close": "알림 닫기"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
2
  "notification": "Melding",
3
+ "criticalNotification": "Belangrijke melding",
3
4
  "close": "Kennisgeving sluiten"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
2
  "notification": "Powiadomienie",
3
+ "criticalNotification": "Powiadomienie krytyczne",
3
4
  "close": "Zamknij powiadomienie"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
2
  "notification": "Notificação",
3
+ "criticalNotification": "Notificação urgente",
3
4
  "close": "Fechar notificação"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
2
  "notification": "Avisering",
3
+ "criticalNotification": "Kritisk avisering",
3
4
  "close": "Stäng meddelande"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
2
  "notification": "Bildirim",
3
+ "criticalNotification": "Kritik bildirim",
3
4
  "close": "Bildirimi kapat"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
2
  "notification": "Thông báo",
3
+ "criticalNotification": "Thông báo quan trọng",
3
4
  "close": "Đóng thông báo"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
2
  "notification": "通知",
3
+ "criticalNotification": "重要通知",
3
4
  "close": "关闭通知"
4
5
  }
package/lib/es6/Notice.js CHANGED
@@ -22,22 +22,23 @@ import { localizedMessages } from './translations/__intergalactic-dynamic-locale
22
22
  import i18nEnhance from '@semcore/utils/lib/enhances/i18nEnhance';
23
23
  import { cssVariableEnhance } from '@semcore/utils/lib/useCssVariable';
24
24
  /*__reshadow-styles__:"./style/notice.shadow.css"*/
25
- var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SNotice_u1iwk_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_u1iwk_gg_._theme_info_u1iwk_gg_{background-color:var(--intergalactic-bg-secondary-info, #e9f7ff);border-color:var(--intergalactic-border-info, #8ecdff)}.___SNotice_u1iwk_gg_._theme_info_u1iwk_gg_ .___SCloseIcon_u1iwk_gg_{color:var(--intergalactic-icon-primary-neutral, #6c6e79)}@media (hover:hover){.___SNotice_u1iwk_gg_._theme_info_u1iwk_gg_ .___SCloseIcon_u1iwk_gg_:hover{color:var(--intergalactic-icon-primary-neutral-hover-active, #565861)}}.___SNotice_u1iwk_gg_._theme_danger_u1iwk_gg_{background-color:var(--intergalactic-bg-secondary-critical, #fff0f7);border-color:var(--intergalactic-border-critical, #ffaeb5)}.___SNotice_u1iwk_gg_._theme_danger_u1iwk_gg_ .___SCloseIcon_u1iwk_gg_{color:var(--intergalactic-icon-primary-critical, #ff4953)}@media (hover:hover){.___SNotice_u1iwk_gg_._theme_danger_u1iwk_gg_ .___SCloseIcon_u1iwk_gg_:hover{color:var(--intergalactic-icon-primary-critical-hover-active, #CC3A42)}}.___SNotice_u1iwk_gg_._theme_warning_u1iwk_gg_{background-color:var(--intergalactic-bg-secondary-warning, #fff3d9);border-color:var(--intergalactic-border-warning, #ffb26e)}.___SNotice_u1iwk_gg_._theme_warning_u1iwk_gg_ .___SCloseIcon_u1iwk_gg_{color:var(--intergalactic-icon-primary-warning, #ff642d)}@media (hover:hover){.___SNotice_u1iwk_gg_._theme_warning_u1iwk_gg_ .___SCloseIcon_u1iwk_gg_:hover{color:var(--intergalactic-icon-primary-warning-hover-active, #CC5024)}}.___SNotice_u1iwk_gg_._theme_success_u1iwk_gg_{background-color:var(--intergalactic-bg-secondary-success, #dbfee8);border-color:var(--intergalactic-border-success, #59ddaa)}.___SNotice_u1iwk_gg_._theme_success_u1iwk_gg_ .___SCloseIcon_u1iwk_gg_{color:var(--intergalactic-icon-primary-success, #009f81)}@media (hover:hover){.___SNotice_u1iwk_gg_._theme_success_u1iwk_gg_ .___SCloseIcon_u1iwk_gg_:hover{color:var(--intergalactic-icon-primary-success-hover-active, #037E68)}}.___SContent_u1iwk_gg_{flex:1 1 auto;width:100%}.___SActions_u1iwk_gg_{flex-shrink:0;margin-top:var(--intergalactic-spacing-3x, 12px)}.___SLabel_u1iwk_gg_{margin-top:var(--intergalactic-spacing-05x, 2px);margin-right:var(--intergalactic-spacing-2x, 8px);display:inline-flex}.___SLabel_u1iwk_gg_._theme_info_u1iwk_gg_{color:var(--intergalactic-icon-primary-neutral, #6c6e79)}.___SLabel_u1iwk_gg_._theme_danger_u1iwk_gg_{color:var(--intergalactic-icon-primary-critical, #ff4953)}.___SLabel_u1iwk_gg_._theme_warning_u1iwk_gg_{color:var(--intergalactic-icon-primary-warning, #ff642d)}.___SLabel_u1iwk_gg_._theme_success_u1iwk_gg_{color:var(--intergalactic-icon-primary-success, #009f81)}.___SLabel_u1iwk_gg_._theme_custom_u1iwk_gg_{color:var(--color_u1iwk)}.___SCloseIcon_u1iwk_gg_{flex-shrink:0;margin-left:var(--intergalactic-spacing-4x, 16px)}.___SNotice_u1iwk_gg_._theme_custom_u1iwk_gg_{background-color:var(--backgroundColor_u1iwk);border-color:var(--backgroundColor_u1iwk)}" /*__inner_css_end__*/, "u1iwk_gg_") /*__reshadow_css_end__*/, {
26
- "__SNotice": "___SNotice_u1iwk_gg_",
27
- "__SContent": "___SContent_u1iwk_gg_",
28
- "__SActions": "___SActions_u1iwk_gg_",
29
- "__SLabel": "___SLabel_u1iwk_gg_",
30
- "_theme_info": "_theme_info_u1iwk_gg_",
31
- "_theme_danger": "_theme_danger_u1iwk_gg_",
32
- "_theme_warning": "_theme_warning_u1iwk_gg_",
33
- "_theme_success": "_theme_success_u1iwk_gg_",
34
- "_theme_custom": "_theme_custom_u1iwk_gg_",
35
- "--color": "--color_u1iwk",
36
- "__SCloseIcon": "___SCloseIcon_u1iwk_gg_",
37
- "--backgroundColor": "--backgroundColor_u1iwk"
25
+ var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SNotice_1kdg2_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_1kdg2_gg_._theme_info_1kdg2_gg_{background-color:var(--intergalactic-bg-secondary-info, #e9f7ff);border-color:var(--intergalactic-border-info, #8ecdff)}.___SNotice_1kdg2_gg_._theme_info_1kdg2_gg_ .___SCloseIcon_1kdg2_gg_{color:var(--intergalactic-icon-primary-neutral, #6c6e79)}@media (hover:hover){.___SNotice_1kdg2_gg_._theme_info_1kdg2_gg_ .___SCloseIcon_1kdg2_gg_:hover{color:var(--intergalactic-icon-primary-neutral-hover-active, #565861)}}.___SNotice_1kdg2_gg_._theme_danger_1kdg2_gg_{background-color:var(--intergalactic-bg-secondary-critical, #fff0f7);border-color:var(--intergalactic-border-critical, #ffaeb5)}.___SNotice_1kdg2_gg_._theme_danger_1kdg2_gg_ .___SCloseIcon_1kdg2_gg_{color:var(--intergalactic-icon-primary-critical, #ff4953)}@media (hover:hover){.___SNotice_1kdg2_gg_._theme_danger_1kdg2_gg_ .___SCloseIcon_1kdg2_gg_:hover{color:var(--intergalactic-icon-primary-critical-hover-active, #CC3A42)}}.___SNotice_1kdg2_gg_._theme_warning_1kdg2_gg_{background-color:var(--intergalactic-bg-secondary-warning, #fff3d9);border-color:var(--intergalactic-border-warning, #ffb26e)}.___SNotice_1kdg2_gg_._theme_warning_1kdg2_gg_ .___SCloseIcon_1kdg2_gg_{color:var(--intergalactic-icon-primary-warning, #ff642d)}@media (hover:hover){.___SNotice_1kdg2_gg_._theme_warning_1kdg2_gg_ .___SCloseIcon_1kdg2_gg_:hover{color:var(--intergalactic-icon-primary-warning-hover-active, #CC5024)}}.___SNotice_1kdg2_gg_._theme_success_1kdg2_gg_{background-color:var(--intergalactic-bg-secondary-success, #dbfee8);border-color:var(--intergalactic-border-success, #59ddaa)}.___SNotice_1kdg2_gg_._theme_success_1kdg2_gg_ .___SCloseIcon_1kdg2_gg_{color:var(--intergalactic-icon-primary-success, #009f81)}@media (hover:hover){.___SNotice_1kdg2_gg_._theme_success_1kdg2_gg_ .___SCloseIcon_1kdg2_gg_:hover{color:var(--intergalactic-icon-primary-success-hover-active, #037E68)}}.___SNotice_1kdg2_gg_._theme_muted_1kdg2_gg_{background-color:var(--intergalactic-bg-secondary-neutral, #f4f5f9);border-color:var(--intergalactic-border-secondary, #e0e1e9)}.___SLabel_1kdg2_gg_._theme_info_1kdg2_gg_,.___SNotice_1kdg2_gg_._theme_muted_1kdg2_gg_ .___SCloseIcon_1kdg2_gg_{color:var(--intergalactic-icon-primary-neutral, #6c6e79)}@media (hover:hover){.___SNotice_1kdg2_gg_._theme_muted_1kdg2_gg_ .___SCloseIcon_1kdg2_gg_:hover{color:var(--intergalactic-icon-primary-neutral-hover-active, #565861)}}.___SContent_1kdg2_gg_{flex:1 1 auto;width:100%}.___SActions_1kdg2_gg_{flex-shrink:0;margin-top:var(--intergalactic-spacing-3x, 12px)}.___SLabel_1kdg2_gg_{margin-top:var(--intergalactic-spacing-05x, 2px);margin-right:var(--intergalactic-spacing-2x, 8px);display:inline-flex}.___SLabel_1kdg2_gg_._theme_danger_1kdg2_gg_{color:var(--intergalactic-icon-primary-critical, #ff4953)}.___SLabel_1kdg2_gg_._theme_warning_1kdg2_gg_{color:var(--intergalactic-icon-primary-warning, #ff642d)}.___SLabel_1kdg2_gg_._theme_success_1kdg2_gg_{color:var(--intergalactic-icon-primary-success, #009f81)}.___SLabel_1kdg2_gg_._theme_muted_1kdg2_gg_{color:var(--intergalactic-icon-primary-neutral, #6c6e79)}.___SLabel_1kdg2_gg_._theme_custom_1kdg2_gg_{color:var(--color_1kdg2)}.___SCloseIcon_1kdg2_gg_{flex-shrink:0;margin-left:var(--intergalactic-spacing-4x, 16px)}.___SNotice_1kdg2_gg_._theme_custom_1kdg2_gg_{background-color:var(--backgroundColor_1kdg2);border-color:var(--backgroundColor_1kdg2)}" /*__inner_css_end__*/, "1kdg2_gg_") /*__reshadow_css_end__*/, {
26
+ "__SNotice": "___SNotice_1kdg2_gg_",
27
+ "__SContent": "___SContent_1kdg2_gg_",
28
+ "__SActions": "___SActions_1kdg2_gg_",
29
+ "__SLabel": "___SLabel_1kdg2_gg_",
30
+ "_theme_info": "_theme_info_1kdg2_gg_",
31
+ "_theme_danger": "_theme_danger_1kdg2_gg_",
32
+ "_theme_warning": "_theme_warning_1kdg2_gg_",
33
+ "_theme_success": "_theme_success_1kdg2_gg_",
34
+ "_theme_muted": "_theme_muted_1kdg2_gg_",
35
+ "_theme_custom": "_theme_custom_1kdg2_gg_",
36
+ "--color": "--color_1kdg2",
37
+ "__SCloseIcon": "___SCloseIcon_1kdg2_gg_",
38
+ "--backgroundColor": "--backgroundColor_1kdg2"
38
39
  });
39
40
  function isCustomTheme(theme) {
40
- return !['danger', 'warning', 'success', 'info'].includes(theme);
41
+ return !['danger', 'warning', 'success', 'info', 'muted'].includes(theme);
41
42
  }
42
43
  var RootNotice = /*#__PURE__*/function (_Component) {
43
44
  _inherits(RootNotice, _Component);
@@ -82,6 +83,10 @@ var RootNotice = /*#__PURE__*/function (_Component) {
82
83
  var isAssertive = theme === 'danger' || theme === 'warning';
83
84
  var color = resolveColor(theme);
84
85
  var useTheme = isCustomTheme(theme) ? 'custom' : theme;
86
+ var ariaLive = isAssertive ? 'assertive' : 'polite';
87
+ if (theme === 'neutral') {
88
+ ariaLive = undefined;
89
+ }
85
90
  if (use === 'primary') {
86
91
  logger.warn(true, "Deprecated property-value pair \"use=primary\", use component <NoticeGlobal/> instead", RootNotice.displayName);
87
92
  return /*#__PURE__*/React.createElement(NoticeGlobal, this.asProps);
@@ -91,8 +96,8 @@ var RootNotice = /*#__PURE__*/function (_Component) {
91
96
  "use:theme": useTheme,
92
97
  "backgroundColor": color,
93
98
  "role": 'region',
94
- "aria-live": isAssertive ? 'assertive' : 'polite',
95
- "aria-label": getI18nText('notification')
99
+ "aria-live": ariaLive,
100
+ "aria-label": getI18nText(isAssertive ? 'criticalNotification' : 'notification')
96
101
  }, _ref))), /*#__PURE__*/React.createElement(Children, _ref6.cn("Children", {})));
97
102
  }
98
103
  }]);
@@ -1 +1 @@
1
- {"version":3,"file":"Notice.js","names":["React","createComponent","Component","sstyled","Root","Box","Close","resolveColorEnhance","FadeInOut","logger","NoticeGlobal","localizedMessages","i18nEnhance","cssVariableEnhance","style","_sstyled","insert","isCustomTheme","theme","includes","RootNotice","_Component","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","_createClass","key","value","getLabelProps","_this$asProps","asProps","resolveColor","getCloseIconProps","getI18nText","render","_ref","_ref6","SNotice","_this$asProps2","Children","styles","hidden","use","isAssertive","color","useTheme","warn","displayName","createElement","cn","_objectSpread","_assignProps","_defineProperty","variable","fallback","map","Number","parseInt","prop","i18n","locale","Label","_ref11","_ref2","arguments[0]","_ref7","SLabel","_assignProps2","Actions","_ref12","_ref3","_ref8","SActions","_assignProps3","Content","_ref13","_ref4","_ref9","SContent","_assignProps4","CloseIcon","_ref14","_ref5","_ref10","SCloseIcon","_assignProps5"],"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 resolveColorEnhance from '@semcore/utils/lib/enhances/resolveColorEnhance';\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';\nimport { cssVariableEnhance } from '@semcore/utils/lib/useCssVariable';\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 = [\n i18nEnhance(localizedMessages),\n cssVariableEnhance({\n variable: '--intergalactic-duration-popper',\n fallback: '200',\n map: Number.parseInt,\n prop: 'duration',\n }),\n resolveColorEnhance(),\n ];\n static defaultProps = {\n theme: 'info',\n i18n: localizedMessages,\n locale: 'en',\n };\n\n getLabelProps() {\n const { theme, resolveColor } = this.asProps;\n\n return { theme, resolveColor };\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, resolveColor, getI18nText } = 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='region'\n aria-live={isAssertive ? 'assertive' : 'polite'}\n aria-label={getI18nText('notification')}\n >\n <Children />\n </SNotice>,\n );\n }\n}\n\nfunction Label({ styles, theme, resolveColor }) {\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,KAAK,MAAM,OAAO;AACzB,OAAOC,eAAe,IAAIC,SAAS,EAAEC,OAAO,EAAEC,IAAI,QAAQ,eAAe;AACzE,SAASC,GAAG,QAAQ,mBAAmB;AACvC,OAAOC,KAAK,MAAM,uBAAuB;AACzC,OAAOC,mBAAmB,MAAM,iDAAiD;AACjF,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,OAAOC,MAAM,MAAM,2BAA2B;AAC9C,OAAOC,YAAY,MAAM,wBAAwB;AACjD,SAASC,iBAAiB,QAAQ,gDAAgD;AAClF,OAAOC,WAAW,MAAM,yCAAyC;AACjE,SAASC,kBAAkB,QAAQ,mCAAmC;AAAC;AAAA,IAAAC,KAAA,+BAAAC,QAAA,CAAAC,MAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;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AAmC,MAAA,CAANnC,MAAM;EACvB,IAAMsC,QAAQ,GAC2B5E,GAAG;EAA5C,OAAA2E,KAAA,GAAO7E,OAAO,CAACwC,MAAM,CAAC,eAAC3C,KAAA,CAAAmD,aAAA,CAAC8B,QAAQ,EAAAD,KAAA,CAAA5B,EAAA,aAAAC,aAAA,KAAA6B,aAAA,KAAAH,KAAA,IAAgB;AAClD;AAEA,SAASI,SAASA,CAAAC,MAAA,EAA0B;EAAA,IAAAC,KAAA,GAAAlB,YAAA;IAAAmB,MAAA;EAAA,IAAvB3C,MAAM,GAAAyC,MAAA,CAANzC,MAAM;IAAEP,WAAW,GAAAgD,MAAA,CAAXhD,WAAW;EACtC,IAAMmD,UAAU,GAEMlF,GAAG;EADzB,OAAAiF,MAAA,GAAOnF,OAAO,CAACwC,MAAM,CAAC,eACpB3C,KAAA,CAAAmD,aAAA,CAACoC,UAAU,EAAAD,MAAA,CAAAlC,EAAA,eAAAC,aAAA,KAAAmC,aAAA;IAAA,OAAmBlF,KAAK;IAAA;IAAA,cAA0B8B,WAAW,CAAC,OAAO;EAAC,GAAAiD,KAAA,IAAI;AAEzF;AAEA,eAAepF,eAAe,CAACmB,UAAU,EAAE;EACzC4C,KAAK,EAALA,KAAK;EACLO,OAAO,EAAPA,OAAO;EACPM,OAAO,EAAPA,OAAO;EACPM,SAAS,EAATA;AACF,CAAC,CAAC"}
1
+ {"version":3,"file":"Notice.js","names":["React","createComponent","Component","sstyled","Root","Box","Close","resolveColorEnhance","FadeInOut","logger","NoticeGlobal","localizedMessages","i18nEnhance","cssVariableEnhance","style","_sstyled","insert","isCustomTheme","theme","includes","RootNotice","_Component","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","_createClass","key","value","getLabelProps","_this$asProps","asProps","resolveColor","getCloseIconProps","getI18nText","render","_ref","_ref6","SNotice","_this$asProps2","Children","styles","hidden","use","isAssertive","color","useTheme","ariaLive","undefined","warn","displayName","createElement","cn","_objectSpread","_assignProps","_defineProperty","variable","fallback","map","Number","parseInt","prop","i18n","locale","Label","_ref11","_ref2","arguments[0]","_ref7","SLabel","_assignProps2","Actions","_ref12","_ref3","_ref8","SActions","_assignProps3","Content","_ref13","_ref4","_ref9","SContent","_assignProps4","CloseIcon","_ref14","_ref5","_ref10","SCloseIcon","_assignProps5"],"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 resolveColorEnhance from '@semcore/utils/lib/enhances/resolveColorEnhance';\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';\nimport { cssVariableEnhance } from '@semcore/utils/lib/useCssVariable';\n\nimport style from './style/notice.shadow.css';\n\nfunction isCustomTheme(theme) {\n return !['danger', 'warning', 'success', 'info', 'muted'].includes(theme);\n}\n\nclass RootNotice extends Component {\n static displayName = 'Notice';\n static style = style;\n static enhance = [\n i18nEnhance(localizedMessages),\n cssVariableEnhance({\n variable: '--intergalactic-duration-popper',\n fallback: '200',\n map: Number.parseInt,\n prop: 'duration',\n }),\n resolveColorEnhance(),\n ];\n static defaultProps = {\n theme: 'info',\n i18n: localizedMessages,\n locale: 'en',\n };\n\n getLabelProps() {\n const { theme, resolveColor } = this.asProps;\n\n return { theme, resolveColor };\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, resolveColor, getI18nText } = this.asProps;\n const isAssertive = theme === 'danger' || theme === 'warning';\n const color = resolveColor(theme);\n const useTheme = isCustomTheme(theme) ? 'custom' : theme;\n\n let ariaLive = isAssertive ? 'assertive' : 'polite';\n if (theme === 'neutral') {\n ariaLive = undefined;\n }\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='region'\n aria-live={ariaLive}\n aria-label={getI18nText(isAssertive ? 'criticalNotification' : 'notification')}\n >\n <Children />\n </SNotice>,\n );\n }\n}\n\nfunction Label({ styles, theme, resolveColor }) {\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,KAAK,MAAM,OAAO;AACzB,OAAOC,eAAe,IAAIC,SAAS,EAAEC,OAAO,EAAEC,IAAI,QAAQ,eAAe;AACzE,SAASC,GAAG,QAAQ,mBAAmB;AACvC,OAAOC,KAAK,MAAM,uBAAuB;AACzC,OAAOC,mBAAmB,MAAM,iDAAiD;AACjF,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,OAAOC,MAAM,MAAM,2BAA2B;AAC9C,OAAOC,YAAY,MAAM,wBAAwB;AACjD,SAASC,iBAAiB,QAAQ,gDAAgD;AAClF,OAAOC,WAAW,MAAM,yCAAyC;AACjE,SAASC,kBAAkB,QAAQ,mCAAmC;AAAC;AAAA,IAAAC,KAAA,+BAAAC,QAAA,CAAAC,MAAA;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AA,CAAAqD,aAAA,CAACwB,QAAQ,EAAAD,KAAA,CAAAtB,EAAA,aAAAC,aAAA,KAAAuB,aAAA,KAAAH,KAAA,IAAgB;AAClD;AAEA,SAASI,OAAOA,CAAAC,MAAA,EAAa;EAAA,IAAAC,KAAA,GAAAZ,YAAA;IAAAa,KAAA;EAAA,IAAVvC,MAAM,GAAAqC,MAAA,CAANrC,MAAM;EACvB,IAAMwC,QAAQ,GAC2B9E,GAAG;EAA5C,OAAA6E,KAAA,GAAO/E,OAAO,CAACwC,MAAM,CAAC,eAAC3C,KAAA,CAAAqD,aAAA,CAAC8B,QAAQ,EAAAD,KAAA,CAAA5B,EAAA,aAAAC,aAAA,KAAA6B,aAAA,KAAAH,KAAA,IAAgB;AAClD;AAEA,SAASI,SAASA,CAAAC,MAAA,EAA0B;EAAA,IAAAC,KAAA,GAAAlB,YAAA;IAAAmB,MAAA;EAAA,IAAvB7C,MAAM,GAAA2C,MAAA,CAAN3C,MAAM;IAAEP,WAAW,GAAAkD,MAAA,CAAXlD,WAAW;EACtC,IAAMqD,UAAU,GAEMpF,GAAG;EADzB,OAAAmF,MAAA,GAAOrF,OAAO,CAACwC,MAAM,CAAC,eACpB3C,KAAA,CAAAqD,aAAA,CAACoC,UAAU,EAAAD,MAAA,CAAAlC,EAAA,eAAAC,aAAA,KAAAmC,aAAA;IAAA,OAAmBpF,KAAK;IAAA;IAAA,cAA0B8B,WAAW,CAAC,OAAO;EAAC,GAAAmD,KAAA,IAAI;AAEzF;AAEA,eAAetF,eAAe,CAACmB,UAAU,EAAE;EACzC8C,KAAK,EAALA,KAAK;EACLO,OAAO,EAAPA,OAAO;EACPM,OAAO,EAAPA,OAAO;EACPM,SAAS,EAATA;AACF,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';\nimport { Box, BoxProps } from '@semcore/flex-box';\nimport { IconProps } from '@semcore/icon';\nimport { FadeInOutProps } from '@semcore/animation';\n\nexport type NoticeTheme = 'danger' | 'warning' | 'success' | 'info';\nexport type NoticeUse = 'primary' | 'secondary';\n\n/** @deprecated */\nexport interface INoticeProps extends NoticeProps, UnknownProperties {}\nexport type NoticeProps = BoxProps &\n FadeInOutProps & {\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\n/** @deprecated */\nexport interface INoticeLabelProps extends NoticeLabelProps, UnknownProperties {}\nexport type NoticeLabelProps = BoxProps & {\n theme?: NoticeTheme;\n};\n\n/** @deprecated */\nexport interface INoticeContext extends NoticeContext, UnknownProperties {}\nexport type NoticeContext = {\n getLabelProps: PropGetterFn;\n};\n\n/** @deprecated */\nexport interface INoticeSmartProps extends NoticeSmartProps, UnknownProperties {}\nexport type NoticeSmartProps = NoticeProps & {\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: Intergalactic.Component<'div', NoticeProps, NoticeContext> & {\n Label: Intergalactic.Component<'div', NoticeLabelProps>;\n Actions: typeof Box;\n Content: typeof Box;\n CloseIcon: Intergalactic.Component<'div', IconProps>;\n};\n\ndeclare const NoticeSmart: Intergalactic.Component<'div', NoticeSmartProps>;\n\nexport { NoticeSmart };\nexport default Notice;\n"],"mappings":""}
1
+ {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';\nimport { Box, BoxProps } from '@semcore/flex-box';\nimport { IconProps } from '@semcore/icon';\nimport { FadeInOutProps } from '@semcore/animation';\n\nexport type NoticeTheme = 'danger' | 'warning' | 'success' | 'info' | 'muted';\nexport type NoticeUse = 'primary' | 'secondary';\n\n/** @deprecated */\nexport interface INoticeProps extends NoticeProps, UnknownProperties {}\nexport type NoticeProps = BoxProps &\n FadeInOutProps & {\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\n/** @deprecated */\nexport interface INoticeLabelProps extends NoticeLabelProps, UnknownProperties {}\nexport type NoticeLabelProps = BoxProps & {\n theme?: NoticeTheme;\n};\n\n/** @deprecated */\nexport interface INoticeContext extends NoticeContext, UnknownProperties {}\nexport type NoticeContext = {\n getLabelProps: PropGetterFn;\n};\n\n/** @deprecated */\nexport interface INoticeSmartProps extends NoticeSmartProps, UnknownProperties {}\nexport type NoticeSmartProps = NoticeProps & {\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: Intergalactic.Component<'div', NoticeProps, NoticeContext> & {\n Label: Intergalactic.Component<'div', NoticeLabelProps>;\n Actions: typeof Box;\n Content: typeof Box;\n CloseIcon: Intergalactic.Component<'div', IconProps>;\n};\n\ndeclare const NoticeSmart: Intergalactic.Component<'div', NoticeSmartProps>;\n\nexport { NoticeSmart };\nexport default Notice;\n"],"mappings":""}
@@ -62,6 +62,19 @@ SNotice[theme='success'] {
62
62
  }
63
63
  }
64
64
 
65
+ SNotice[theme='muted'] {
66
+ background-color: var(--intergalactic-bg-secondary-neutral, #f4f5f9);
67
+ border-color: var(--intergalactic-border-secondary, #e0e1e9);
68
+
69
+ & SCloseIcon {
70
+ color: var(--intergalactic-icon-primary-neutral, #6c6e79);
71
+
72
+ &:hover {
73
+ color: var(--intergalactic-icon-primary-neutral-hover-active, #565861);
74
+ }
75
+ }
76
+ }
77
+
65
78
  SContent {
66
79
  flex: 1 1 auto;
67
80
  width: 100%;
@@ -94,6 +107,10 @@ SLabel[theme='success'] {
94
107
  color: var(--intergalactic-icon-primary-success, #009f81);
95
108
  }
96
109
 
110
+ SLabel[theme='muted'] {
111
+ color: var(--intergalactic-icon-primary-neutral, #6c6e79);
112
+ }
113
+
97
114
  SLabel[theme='custom'] {
98
115
  color: var(--color);
99
116
  }
@@ -1,4 +1,5 @@
1
1
  {
2
2
  "notification": "Benachrichtigung",
3
+ "criticalNotification": "Kritische Benachrichtigung",
3
4
  "close": "Benachrichtigung schließen"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
2
  "notification": "Notification",
3
+ "criticalNotification": "Critical notification",
3
4
  "close": "Close notification"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
2
  "notification": "Notificación",
3
+ "criticalNotification": "Notificación crítica",
3
4
  "close": "Cerrar notificación"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
2
  "notification": "Notification",
3
+ "criticalNotification": "Notification critique",
3
4
  "close": "Fermer la notification"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
2
  "notification": "Notifica",
3
+ "criticalNotification": "Notifica critica",
3
4
  "close": "Chiudi la notifica"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
2
  "notification": "通知",
3
+ "criticalNotification": "重要な通知",
3
4
  "close": "通知を閉じる"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
2
  "notification": "알림",
3
+ "criticalNotification": "중요 알림",
3
4
  "close": "알림 닫기"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
2
  "notification": "Melding",
3
+ "criticalNotification": "Belangrijke melding",
3
4
  "close": "Kennisgeving sluiten"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
2
  "notification": "Powiadomienie",
3
+ "criticalNotification": "Powiadomienie krytyczne",
3
4
  "close": "Zamknij powiadomienie"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
2
  "notification": "Notificação",
3
+ "criticalNotification": "Notificação urgente",
3
4
  "close": "Fechar notificação"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
2
  "notification": "Avisering",
3
+ "criticalNotification": "Kritisk avisering",
3
4
  "close": "Stäng meddelande"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
2
  "notification": "Bildirim",
3
+ "criticalNotification": "Kritik bildirim",
3
4
  "close": "Bildirimi kapat"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
2
  "notification": "Thông báo",
3
+ "criticalNotification": "Thông báo quan trọng",
3
4
  "close": "Đóng thông báo"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
2
  "notification": "通知",
3
+ "criticalNotification": "重要通知",
3
4
  "close": "关闭通知"
4
5
  }
@@ -3,7 +3,7 @@ import { Box, BoxProps } from '@semcore/flex-box';
3
3
  import { IconProps } from '@semcore/icon';
4
4
  import { FadeInOutProps } from '@semcore/animation';
5
5
 
6
- export type NoticeTheme = 'danger' | 'warning' | 'success' | 'info';
6
+ export type NoticeTheme = 'danger' | 'warning' | 'success' | 'info' | 'muted';
7
7
  export type NoticeUse = 'primary' | 'secondary';
8
8
 
9
9
  /** @deprecated */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/notice",
3
3
  "description": "Semrush Notice Component",
4
- "version": "5.34.3",
4
+ "version": "5.35.0",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -9,11 +9,11 @@
9
9
  "author": "UI-kit team <ui-kit-team@semrush.com>",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
- "@semcore/animation": "2.28.0",
13
- "@semcore/utils": "4.29.0",
14
- "@semcore/flex-box": "5.28.0",
15
- "@semcore/icon": "4.38.0",
16
- "@semcore/notice-global": "2.44.3"
12
+ "@semcore/animation": "2.29.0",
13
+ "@semcore/utils": "4.30.0",
14
+ "@semcore/flex-box": "5.29.0",
15
+ "@semcore/icon": "4.39.1",
16
+ "@semcore/notice-global": "2.45.0"
17
17
  },
18
18
  "peerDependencies": {
19
19
  "@semcore/core": "^2.17.5",