@semcore/widget-empty 2.5.0 → 2.6.3

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 CHANGED
@@ -2,6 +2,34 @@
2
2
 
3
3
  CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
+ ## [2.6.3] - 2022-01-18
6
+
7
+ ### Changed
8
+
9
+ - Remove don't use dependency `@semcore/icon`.
10
+
11
+ ## [2.6.2] - 2021-8-26
12
+
13
+ ### Changed
14
+
15
+ - Add 'sideEffect=false' for more optimal build via webpack
16
+
17
+ ## [2.6.1] - 2021-07-02
18
+
19
+ ### Fixed
20
+
21
+ - [TS] fixed types.
22
+
23
+ ## [2.6.0] - 2021-06-08
24
+
25
+ ### Changed
26
+
27
+ - Rewrite code from TS to JS 🧑‍💻
28
+
29
+ ### Added
30
+
31
+ - Added `tag-cloud` illustration
32
+
5
33
  ## [2.5.0] - 2021-04-26
6
34
 
7
35
  ### Changed
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/Error/index.tsx"],"names":["i18n","de","en","es","fr","it","ja","ru","zh","pt","ko","vi","Error","asProps","Children","description","getI18nText","title","descriptionText","WidgetEmpty","Component"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAEA;;AAFA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,IAAMA,IAAI,GAAG;AAAEC,EAAAA,EAAE,EAAFA,cAAF;AAAMC,EAAAA,EAAE,EAAFA,cAAN;AAAUC,EAAAA,EAAE,EAAFA,cAAV;AAAcC,EAAAA,EAAE,EAAFA,cAAd;AAAkBC,EAAAA,EAAE,EAAFA,cAAlB;AAAsBC,EAAAA,EAAE,EAAFA,cAAtB;AAA0BC,EAAAA,EAAE,EAAFA,cAA1B;AAA8BC,EAAAA,EAAE,EAAFA,cAA9B;AAAkCC,EAAAA,EAAE,EAAFA,cAAlC;AAAsCC,EAAAA,EAAE,EAAFA,cAAtC;AAA0CC,EAAAA,EAAE,EAAFA;AAA1C,CAAb;;IAOMC,K;;;;;;;;;;;;WAOJ,kBAAS;AAAA;;AAAA,0BACwC,KAAKC,OAD7C;AAAA,UACCC,QADD,iBACCA,QADD;AAAA,UACWC,WADX,iBACWA,WADX;AAAA,UACwBC,WADxB,iBACwBA,WADxB;;AAAA,yBAEyCA,WAAW,EAFpD;AAAA,UAECC,KAFD,gBAECA,KAFD;AAAA,UAEqBC,eAFrB,gBAEQH,WAFR;;AAIP,0BACE,gCAAcI,uBAAd;AAAA,gBAAiC,8BAAY,SAAZ;AAAjC,6BACE,gCAAC,uBAAD,CAAa,KAAb,QAAoBF,KAApB,CADF,eAEE,gCAAC,uBAAD,CAAa,WAAb,QAA0BF,WAAW,IAAIG,eAAzC,CAFF,eAGE,gCAAC,QAAD,OAHF,CADF;AAOD;;;EAlBiBE,e;;iCAAdR,K,iBACiB,a;iCADjBA,K,kBAEkB;AACpBZ,EAAAA,IAAI,EAAJA;AADoB,C;iCAFlBY,K,aAKa,CAAC,8BAAD,C;;eAgBJ,sBAA0EA,KAA1E,C","sourcesContent":["import React, { HTMLAttributes } from 'react';\nimport WidgetEmpty, { getIconPath, IWidgetEmptyProps } from '../WidgetEmpty';\nimport createComponent, { Component, Merge, Root } from '@semcore/core';\nimport i18nEnhance, { IWithI18nEnhanceProps } from '@semcore/utils/lib/enhances/i18nEnhance';\nimport de from './translations/de.json';\nimport en from './translations/en.json';\nimport es from './translations/es.json';\nimport fr from './translations/fr.json';\nimport it from './translations/it.json';\nimport ja from './translations/ja.json';\nimport pt from './translations/pt.json';\nimport ru from './translations/ru.json';\nimport zh from './translations/zh.json';\nimport ko from './translations/ko.json';\nimport vi from './translations/vi.json';\n\nconst i18n = { de, en, es, fr, it, ja, ru, zh, pt, ko, vi };\n\nexport interface IWidgetErrorProps extends IWidgetEmptyProps, IWithI18nEnhanceProps {\n /** Error description. If it is absent, use the local default one */\n description?: React.ReactNode;\n}\n\nclass Error extends Component<IWidgetErrorProps> {\n static displayName = 'WidgetError';\n static defaultProps = {\n i18n,\n };\n static enhance = [i18nEnhance()];\n\n render() {\n const { Children, description, getI18nText } = this.asProps;\n const { title, description: descriptionText } = getI18nText();\n\n return (\n <Root render={WidgetEmpty} icon={getIconPath('warning')}>\n <WidgetEmpty.Title>{title}</WidgetEmpty.Title>\n <WidgetEmpty.Description>{description || descriptionText}</WidgetEmpty.Description>\n <Children />\n </Root>\n );\n }\n}\n\nexport default createComponent<Merge<IWidgetEmptyProps, HTMLAttributes<HTMLDivElement>>>(Error);\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../src/Error/index.js"],"names":["i18n","de","en","es","fr","it","ja","ru","zh","pt","ko","vi","Error","asProps","Children","description","getI18nText","title","descriptionText","WidgetEmpty","Component"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAEA;;AAFA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,IAAMA,IAAI,GAAG;AAAEC,EAAAA,EAAE,EAAFA,cAAF;AAAMC,EAAAA,EAAE,EAAFA,cAAN;AAAUC,EAAAA,EAAE,EAAFA,cAAV;AAAcC,EAAAA,EAAE,EAAFA,cAAd;AAAkBC,EAAAA,EAAE,EAAFA,cAAlB;AAAsBC,EAAAA,EAAE,EAAFA,cAAtB;AAA0BC,EAAAA,EAAE,EAAFA,cAA1B;AAA8BC,EAAAA,EAAE,EAAFA,cAA9B;AAAkCC,EAAAA,EAAE,EAAFA,cAAlC;AAAsCC,EAAAA,EAAE,EAAFA,cAAtC;AAA0CC,EAAAA,EAAE,EAAFA;AAA1C,CAAb;;IAEMC,K;;;;;;;;;;;;WAOJ,kBAAS;AAAA;;AAAA,0BACwC,KAAKC,OAD7C;AAAA,UACCC,QADD,iBACCA,QADD;AAAA,UACWC,WADX,iBACWA,WADX;AAAA,UACwBC,WADxB,iBACwBA,WADxB;;AAAA,yBAEyCA,WAAW,EAFpD;AAAA,UAECC,KAFD,gBAECA,KAFD;AAAA,UAEqBC,eAFrB,gBAEQH,WAFR;;AAIP,0BACE,gCAAcI,uBAAd;AAAA,gBAAiC,8BAAY,SAAZ;AAAjC,6BACE,gCAAC,uBAAD,CAAa,KAAb,QAAoBF,KAApB,CADF,eAEE,gCAAC,uBAAD,CAAa,WAAb,QAA0BF,WAAW,IAAIG,eAAzC,CAFF,eAGE,gCAAC,QAAD,OAHF,CADF;AAOD;;;EAlBiBE,e;;iCAAdR,K,iBACiB,a;iCADjBA,K,kBAEkB;AACpBZ,EAAAA,IAAI,EAAJA;AADoB,C;iCAFlBY,K,aAKa,CAAC,8BAAD,C;;eAgBJ,sBAAgBA,KAAhB,C","sourcesContent":["import React from 'react';\nimport WidgetEmpty, { getIconPath } from '../WidgetEmpty';\nimport createComponent, { Component, Root } from '@semcore/core';\nimport i18nEnhance from '@semcore/utils/lib/enhances/i18nEnhance';\nimport de from './translations/de.json';\nimport en from './translations/en.json';\nimport es from './translations/es.json';\nimport fr from './translations/fr.json';\nimport it from './translations/it.json';\nimport ja from './translations/ja.json';\nimport pt from './translations/pt.json';\nimport ru from './translations/ru.json';\nimport zh from './translations/zh.json';\nimport ko from './translations/ko.json';\nimport vi from './translations/vi.json';\n\nconst i18n = { de, en, es, fr, it, ja, ru, zh, pt, ko, vi };\n\nclass Error extends Component {\n static displayName = 'WidgetError';\n static defaultProps = {\n i18n,\n };\n static enhance = [i18nEnhance()];\n\n render() {\n const { Children, description, getI18nText } = this.asProps;\n const { title, description: descriptionText } = getI18nText();\n\n return (\n <Root render={WidgetEmpty} icon={getIconPath('warning')}>\n <WidgetEmpty.Title>{title}</WidgetEmpty.Title>\n <WidgetEmpty.Description>{description || descriptionText}</WidgetEmpty.Description>\n <Children />\n </Root>\n );\n }\n}\n\nexport default createComponent(Error);\n"],"file":"index.js"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/NoData/index.tsx"],"names":["i18n","de","en","es","fr","it","ja","ru","zh","pt","ko","vi","NoData","asProps","Children","type","description","getI18nText","title","descriptionText","WidgetEmpty","Component"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAEA;;AAFA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,IAAMA,IAAI,GAAG;AAAEC,EAAAA,EAAE,EAAFA,cAAF;AAAMC,EAAAA,EAAE,EAAFA,cAAN;AAAUC,EAAAA,EAAE,EAAFA,cAAV;AAAcC,EAAAA,EAAE,EAAFA,cAAd;AAAkBC,EAAAA,EAAE,EAAFA,cAAlB;AAAsBC,EAAAA,EAAE,EAAFA,cAAtB;AAA0BC,EAAAA,EAAE,EAAFA,cAA1B;AAA8BC,EAAAA,EAAE,EAAFA,cAA9B;AAAkCC,EAAAA,EAAE,EAAFA,cAAlC;AAAsCC,EAAAA,EAAE,EAAFA,cAAtC;AAA0CC,EAAAA,EAAE,EAAFA;AAA1C,CAAb;;IASMC,M;;;;;;;;;;;;WAQJ,kBAAS;AAAA;;AAAA,0BAC8C,KAAKC,OADnD;AAAA,UACCC,QADD,iBACCA,QADD;AAAA,UACWC,IADX,iBACWA,IADX;AAAA,UACiBC,WADjB,iBACiBA,WADjB;AAAA,UAC8BC,WAD9B,iBAC8BA,WAD9B;;AAAA,yBAEyCA,WAAW,EAFpD;AAAA,UAECC,KAFD,gBAECA,KAFD;AAAA,UAEqBC,eAFrB,gBAEQH,WAFR;;AAIP,0BACE,gCAAcI,uBAAd;AAAA,gBAAiC,8BAAYL,IAAZ;AAAjC,6BACE,gCAAC,uBAAD,CAAa,KAAb,QAAoBG,KAApB,CADF,eAEE,gCAAC,uBAAD,CAAa,WAAb,QAA0BF,WAAW,IAAIG,eAAzC,CAFF,eAGE,gCAAC,QAAD,OAHF,CADF;AAOD;;;EAnBkBE,e;;iCAAfT,M,iBACiB,c;iCADjBA,M,aAEa,CAAC,8BAAD,C;iCAFbA,M,kBAGkB;AACpBZ,EAAAA,IAAI,EAAJA,IADoB;AAEpBe,EAAAA,IAAI,EAAE;AAFc,C;;eAmBT,sBAA0EH,MAA1E,C","sourcesContent":["import React, { HTMLAttributes } from 'react';\nimport WidgetEmpty, { getIconPath, iconNames, IWidgetEmptyProps } from '../WidgetEmpty';\nimport createComponent, { Component, Merge, Root } from '@semcore/core';\nimport i18nEnhance, { IWithI18nEnhanceProps } from '@semcore/utils/lib/enhances/i18nEnhance';\nimport de from './translations/de.json';\nimport en from './translations/en.json';\nimport es from './translations/es.json';\nimport fr from './translations/fr.json';\nimport it from './translations/it.json';\nimport ja from './translations/ja.json';\nimport pt from './translations/pt.json';\nimport ru from './translations/ru.json';\nimport zh from './translations/zh.json';\nimport ko from './translations/ko.json';\nimport vi from './translations/vi.json';\n\nconst i18n = { de, en, es, fr, it, ja, ru, zh, pt, ko, vi };\n\nexport interface IWidgetNoDataProps extends IWidgetEmptyProps, IWithI18nEnhanceProps {\n /** Error description. If it is absent, use the local default one */\n description?: React.ReactNode;\n /* Data types */\n type?: iconNames;\n}\n\nclass NoData extends Component<IWidgetNoDataProps> {\n static displayName = 'WidgetNoData';\n static enhance = [i18nEnhance()];\n static defaultProps = {\n i18n,\n type: 'other-data',\n };\n\n render() {\n const { Children, type, description, getI18nText } = this.asProps;\n const { title, description: descriptionText } = getI18nText();\n\n return (\n <Root render={WidgetEmpty} icon={getIconPath(type)}>\n <WidgetEmpty.Title>{title}</WidgetEmpty.Title>\n <WidgetEmpty.Description>{description || descriptionText}</WidgetEmpty.Description>\n <Children />\n </Root>\n );\n }\n}\n\nexport default createComponent<Merge<IWidgetEmptyProps, HTMLAttributes<HTMLDivElement>>>(NoData);\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../src/NoData/index.js"],"names":["i18n","de","en","es","fr","it","ja","ru","zh","pt","ko","vi","NoData","asProps","Children","type","description","getI18nText","title","descriptionText","WidgetEmpty","Component"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAEA;;AAFA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,IAAMA,IAAI,GAAG;AAAEC,EAAAA,EAAE,EAAFA,cAAF;AAAMC,EAAAA,EAAE,EAAFA,cAAN;AAAUC,EAAAA,EAAE,EAAFA,cAAV;AAAcC,EAAAA,EAAE,EAAFA,cAAd;AAAkBC,EAAAA,EAAE,EAAFA,cAAlB;AAAsBC,EAAAA,EAAE,EAAFA,cAAtB;AAA0BC,EAAAA,EAAE,EAAFA,cAA1B;AAA8BC,EAAAA,EAAE,EAAFA,cAA9B;AAAkCC,EAAAA,EAAE,EAAFA,cAAlC;AAAsCC,EAAAA,EAAE,EAAFA,cAAtC;AAA0CC,EAAAA,EAAE,EAAFA;AAA1C,CAAb;;IAEMC,M;;;;;;;;;;;;WAQJ,kBAAS;AAAA;;AAAA,0BAC8C,KAAKC,OADnD;AAAA,UACCC,QADD,iBACCA,QADD;AAAA,UACWC,IADX,iBACWA,IADX;AAAA,UACiBC,WADjB,iBACiBA,WADjB;AAAA,UAC8BC,WAD9B,iBAC8BA,WAD9B;;AAAA,yBAEyCA,WAAW,EAFpD;AAAA,UAECC,KAFD,gBAECA,KAFD;AAAA,UAEqBC,eAFrB,gBAEQH,WAFR;;AAIP,0BACE,gCAAcI,uBAAd;AAAA,gBAAiC,8BAAYL,IAAZ;AAAjC,6BACE,gCAAC,uBAAD,CAAa,KAAb,QAAoBG,KAApB,CADF,eAEE,gCAAC,uBAAD,CAAa,WAAb,QAA0BF,WAAW,IAAIG,eAAzC,CAFF,eAGE,gCAAC,QAAD,OAHF,CADF;AAOD;;;EAnBkBE,e;;iCAAfT,M,iBACiB,c;iCADjBA,M,aAEa,CAAC,8BAAD,C;iCAFbA,M,kBAGkB;AACpBZ,EAAAA,IAAI,EAAJA,IADoB;AAEpBe,EAAAA,IAAI,EAAE;AAFc,C;;eAmBT,sBAAgBH,MAAhB,C","sourcesContent":["import React from 'react';\nimport WidgetEmpty, { getIconPath, iconNames } from '../WidgetEmpty';\nimport createComponent, { Component, Root } from '@semcore/core';\nimport i18nEnhance from '@semcore/utils/lib/enhances/i18nEnhance';\nimport de from './translations/de.json';\nimport en from './translations/en.json';\nimport es from './translations/es.json';\nimport fr from './translations/fr.json';\nimport it from './translations/it.json';\nimport ja from './translations/ja.json';\nimport pt from './translations/pt.json';\nimport ru from './translations/ru.json';\nimport zh from './translations/zh.json';\nimport ko from './translations/ko.json';\nimport vi from './translations/vi.json';\n\nconst i18n = { de, en, es, fr, it, ja, ru, zh, pt, ko, vi };\n\nclass NoData extends Component {\n static displayName = 'WidgetNoData';\n static enhance = [i18nEnhance()];\n static defaultProps = {\n i18n,\n type: 'other-data',\n };\n\n render() {\n const { Children, type, description, getI18nText } = this.asProps;\n const { title, description: descriptionText } = getI18nText();\n\n return (\n <Root render={WidgetEmpty} icon={getIconPath(type)}>\n <WidgetEmpty.Title>{title}</WidgetEmpty.Title>\n <WidgetEmpty.Description>{description || descriptionText}</WidgetEmpty.Description>\n <Children />\n </Root>\n );\n }\n}\n\nexport default createComponent(NoData);\n"],"file":"index.js"}
@@ -44,18 +44,17 @@ var style = (
44
44
  /*__reshadow_css_start__*/
45
45
  _core.sstyled.insert(
46
46
  /*__inner_css_start__*/
47
- ".___SWidgetEmpty_1vqf8_gg_{flex-direction:column;align-items:center;margin-bottom:16px}.___SImage_1vqf8_gg_,.___SWidgetEmpty_1vqf8_gg_{justify-content:center}.___SImage_1vqf8_gg_{display:flex;align-items:flex-end;margin-bottom:12px}.___STitle_1vqf8_gg_{color:#757575;font-size:16px;line-height:1.5;font-weight:700}.___SDescription_1vqf8_gg_{text-align:center;font-size:14px;line-height:1.42;color:#757575;max-width:400px}.___STitle_1vqf8_gg_+.___SDescription_1vqf8_gg_{margin-top:4px}.___SDescription_1vqf8_gg_+.___SDescription_1vqf8_gg_{margin-top:8px}"
47
+ ".___SWidgetEmpty_1p1qt_gg_{flex-direction:column;align-items:center;margin-bottom:16px}.___SImage_1p1qt_gg_,.___SWidgetEmpty_1p1qt_gg_{justify-content:center}.___SImage_1p1qt_gg_{display:flex;align-items:flex-end;margin-bottom:12px}.___STitle_1p1qt_gg_{color:#757575;font-size:16px;line-height:1.5;font-weight:700}.___SDescription_1p1qt_gg_{text-align:center;font-size:14px;line-height:1.42;color:#757575;max-width:400px}.___STitle_1p1qt_gg_+.___SDescription_1p1qt_gg_{margin-top:4px}.___SDescription_1p1qt_gg_+.___SDescription_1p1qt_gg_{margin-top:8px}"
48
48
  /*__inner_css_end__*/
49
49
  , "1ncdu8o_gg_")
50
50
  /*__reshadow_css_end__*/
51
51
  , {
52
- "__SWidgetEmpty": "___SWidgetEmpty_1vqf8_gg_",
53
- "__SImage": "___SImage_1vqf8_gg_",
54
- "__STitle": "___STitle_1vqf8_gg_",
55
- "__SDescription": "___SDescription_1vqf8_gg_"
56
- }); // @ts-ignore
57
-
58
- var version = "2.5.0";
52
+ "__SWidgetEmpty": "___SWidgetEmpty_1p1qt_gg_",
53
+ "__SImage": "___SImage_1p1qt_gg_",
54
+ "__STitle": "___STitle_1p1qt_gg_",
55
+ "__SDescription": "___SDescription_1p1qt_gg_"
56
+ });
57
+ var version = "2.6.3";
59
58
 
60
59
  var getIconPath = function getIconPath(name) {
61
60
  return "//static.semrush.com/ui-kit/widget-empty/".concat(version, "/").concat(name, ".svg");
@@ -87,7 +86,7 @@ var WidgetEmpty = /*#__PURE__*/function (_Component) {
87
86
  var SImage = 'div';
88
87
  return _ref4 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SWidgetEmpty, _ref4.cn("SWidgetEmpty", _objectSpread({}, (0, _core.assignProps)({}, _ref))), (0, _isNode["default"])(icon) && /*#__PURE__*/_react["default"].createElement(SImage, _ref4.cn("SImage", {}), typeof icon === 'string' ? /*#__PURE__*/_react["default"].createElement("img", _ref4.cn("img", {
89
88
  "src": icon,
90
- "alt": "widget empty icon",
89
+ "alt": 'widget empty icon',
91
90
  "width": 100,
92
91
  "height": 72
93
92
  })) : icon), /*#__PURE__*/_react["default"].createElement(Children, _ref4.cn("Children", {})));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/WidgetEmpty.tsx"],"names":["version","getIconPath","name","WidgetEmpty","SWidgetEmpty","Flex","asProps","Children","icon","styles","SImage","Component","style","Title","props","STitle","Box","Description","SDescription"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA;;AADA;;AAEA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;IAIA;;AACA,IAAMA,OAAO,UAAb;;AAiCO,IAAMC,WAAW,GAAG,SAAdA,WAAc,CAACC,IAAD;AAAA,4DACmBF,OADnB,cAC8BE,IAD9B;AAAA,CAApB;;;;IAUDC,W;;;;;;;;;;;;WAIJ,kBAAS;AAAA;AAAA;;AACP,UAAMC,YAAY,GAKMC,aALxB;AADO,0BAE4B,KAAKC,OAFjC;AAAA,UAECC,QAFD,iBAECA,QAFD;AAAA,UAEWC,IAFX,iBAEWA,IAFX;AAAA,UAEiBC,MAFjB,iBAEiBA,MAFjB;AAGP,UAAMC,MAAM,GAAG,KAAf;AAEA,qBAAO,mBAAQD,MAAR,CAAP,eACE,gCAAC,YAAD,iFACG,wBAAOD,IAAP,kBACC,gCAAC,MAAD,0BACG,OAAOA,IAAP,KAAgB,QAAhB,gBACC;AAAA,eAAUA,IAAV;AAAA,eAAoB,mBAApB;AAAA,iBAA+C,GAA/C;AAAA,kBAA4D;AAA5D,SADD,GAGCA,IAJJ,CAFJ,eAUE,gCAAC,QAAD,2BAVF,CADF;AAcD;;;EAvBuBG,e;;iCAApBR,W,iBACiB,a;iCADjBA,W,WAEWS,K;;AAwBjB,IAAMC,KAAK,GAAG,SAARA,KAAQ,CAACC,KAAD,EAAW;AAAA;AAAA;;AACvB,MAAMC,MAAM,GAE2BC,YAFvC;AADuB,MAEfP,MAFe,GAEJK,KAFI,CAEfL,MAFe;AAGvB,iBAAO,mBAAQA,MAAR,CAAP,eAAuB,gCAAC,MAAD,2EAAvB;AACD,CAJD;;AAMA,IAAMQ,WAAW,GAAG,SAAdA,WAAc,CAACH,KAAD,EAAW;AAAA;AAAA;;AAC7B,MAAMI,YAAY,GAE2BF,YAF7C;AAD6B,MAErBP,MAFqB,GAEVK,KAFU,CAErBL,MAFqB;AAG7B,iBAAO,mBAAQA,MAAR,CAAP,eAAuB,gCAAC,YAAD,iFAAvB;AACD,CAJD;;eAMe,sBAMbN,WANa,EAMA;AACbU,EAAAA,KAAK,EAALA,KADa;AAEbI,EAAAA,WAAW,EAAXA;AAFa,CANA,C","sourcesContent":["import React, { HTMLAttributes, ComponentProps } from 'react';\nimport createComponent, { Component, Merge, sstyled, Root } from '@semcore/core';\nimport { Box, Flex, IFlexProps } from '@semcore/flex-box';\nimport isNode from '@semcore/utils/lib/isNode';\n\nimport style from './style/widget-empty.shadow.css';\n\n// @ts-ignore\nconst version = preval`\n module.exports = require('../package.json').version\n`;\n\nexport type iconNames =\n | 'area-chart'\n | 'choropleth-map-chart'\n | 'combined-chart'\n | 'congrats'\n | 'deleted-page'\n | 'donut-chart'\n | 'duplicates'\n | 'funnel-chart'\n | 'good'\n | 'horizontal-bar-chart'\n | 'line-chart'\n | 'lollipop-chart'\n | 'nexttime'\n | 'nothing-found'\n | 'other-data'\n | 'pie-chart'\n | 'processing'\n | 'radar-chart'\n | 'sankey-chart'\n | 'scatter-plot-chart'\n | 'stacked-area-chart'\n | 'suggestions'\n | 'table'\n | 'text-links-etc'\n | 'venn-chart'\n | 'vertical-bar-chart'\n | 'warning';\n\nexport const getIconPath = (name: iconNames) =>\n `//static.semrush.com/ui-kit/widget-empty/${version}/${name}.svg`;\n\nexport interface IWidgetEmptyProps extends IFlexProps {\n /**\n * URL before the icon or the whole component\n */\n icon?: iconNames | React.ReactNode;\n}\n\nclass WidgetEmpty extends Component<IWidgetEmptyProps> {\n static displayName = 'WidgetEmpty';\n static style = style;\n\n render() {\n const SWidgetEmpty = Root;\n const { Children, icon, styles } = this.asProps;\n const SImage = 'div';\n\n return sstyled(styles)(\n <SWidgetEmpty render={Flex}>\n {isNode(icon) && (\n <SImage>\n {typeof icon === 'string' ? (\n <img src={icon} alt=\"widget empty icon\" width={100} height={72} />\n ) : (\n icon\n )}\n </SImage>\n )}\n <Children />\n </SWidgetEmpty>,\n );\n }\n}\n\nconst Title = (props) => {\n const STitle = Root;\n const { styles } = props;\n return sstyled(styles)(<STitle render={Box} />);\n};\n\nconst Description = (props) => {\n const SDescription = Root;\n const { styles } = props;\n return sstyled(styles)(<SDescription render={Box} />);\n};\n\nexport default createComponent<\n Merge<IWidgetEmptyProps, HTMLAttributes<HTMLDivElement>>,\n {\n Title: ComponentProps<typeof Box>;\n Description: ComponentProps<typeof Box>;\n }\n>(WidgetEmpty, {\n Title,\n Description,\n});\n"],"file":"WidgetEmpty.js"}
1
+ {"version":3,"sources":["../../src/WidgetEmpty.js"],"names":["version","getIconPath","name","WidgetEmpty","SWidgetEmpty","Flex","asProps","Children","icon","styles","SImage","Component","style","Title","props","STitle","Box","Description","SDescription"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA;;AADA;;AAEA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAMA,OAAO,UAAb;;AAIO,IAAMC,WAAW,GAAG,SAAdA,WAAc,CAACC,IAAD;AAAA,4DACmBF,OADnB,cAC8BE,IAD9B;AAAA,CAApB;;;;IAGDC,W;;;;;;;;;;;;WAIJ,kBAAS;AAAA;AAAA;;AACP,UAAMC,YAAY,GAKMC,aALxB;AADO,0BAE4B,KAAKC,OAFjC;AAAA,UAECC,QAFD,iBAECA,QAFD;AAAA,UAEWC,IAFX,iBAEWA,IAFX;AAAA,UAEiBC,MAFjB,iBAEiBA,MAFjB;AAGP,UAAMC,MAAM,GAAG,KAAf;AAEA,qBAAO,mBAAQD,MAAR,CAAP,eACE,gCAAC,YAAD,iFACG,wBAAOD,IAAP,kBACC,gCAAC,MAAD,0BACG,OAAOA,IAAP,KAAgB,QAAhB,gBACC;AAAA,eAAUA,IAAV;AAAA,eAAoB,mBAApB;AAAA,iBAA+C,GAA/C;AAAA,kBAA4D;AAA5D,SADD,GAGCA,IAJJ,CAFJ,eAUE,gCAAC,QAAD,2BAVF,CADF;AAcD;;;EAvBuBG,e;;iCAApBR,W,iBACiB,a;iCADjBA,W,WAEWS,K;;AAwBjB,IAAMC,KAAK,GAAG,SAARA,KAAQ,CAACC,KAAD,EAAW;AAAA;AAAA;;AACvB,MAAMC,MAAM,GAE2BC,YAFvC;AADuB,MAEfP,MAFe,GAEJK,KAFI,CAEfL,MAFe;AAGvB,iBAAO,mBAAQA,MAAR,CAAP,eAAuB,gCAAC,MAAD,2EAAvB;AACD,CAJD;;AAMA,IAAMQ,WAAW,GAAG,SAAdA,WAAc,CAACH,KAAD,EAAW;AAAA;AAAA;;AAC7B,MAAMI,YAAY,GAE2BF,YAF7C;AAD6B,MAErBP,MAFqB,GAEVK,KAFU,CAErBL,MAFqB;AAG7B,iBAAO,mBAAQA,MAAR,CAAP,eAAuB,gCAAC,YAAD,iFAAvB;AACD,CAJD;;eAMe,sBAAgBN,WAAhB,EAA6B;AAC1CU,EAAAA,KAAK,EAALA,KAD0C;AAE1CI,EAAAA,WAAW,EAAXA;AAF0C,CAA7B,C","sourcesContent":["import React from 'react';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Box, Flex } from '@semcore/flex-box';\nimport isNode from '@semcore/utils/lib/isNode';\n\nimport style from './style/widget-empty.shadow.css';\n\nconst version = preval`\n module.exports = require('../package.json').version\n`;\n\nexport const getIconPath = (name) =>\n `//static.semrush.com/ui-kit/widget-empty/${version}/${name}.svg`;\n\nclass WidgetEmpty extends Component {\n static displayName = 'WidgetEmpty';\n static style = style;\n\n render() {\n const SWidgetEmpty = Root;\n const { Children, icon, styles } = this.asProps;\n const SImage = 'div';\n\n return sstyled(styles)(\n <SWidgetEmpty render={Flex}>\n {isNode(icon) && (\n <SImage>\n {typeof icon === 'string' ? (\n <img src={icon} alt='widget empty icon' width={100} height={72} />\n ) : (\n icon\n )}\n </SImage>\n )}\n <Children />\n </SWidgetEmpty>,\n );\n }\n}\n\nconst Title = (props) => {\n const STitle = Root;\n const { styles } = props;\n return sstyled(styles)(<STitle render={Box} />);\n};\n\nconst Description = (props) => {\n const SDescription = Root;\n const { styles } = props;\n return sstyled(styles)(<SDescription render={Box} />);\n};\n\nexport default createComponent(WidgetEmpty, {\n Title,\n Description,\n});\n"],"file":"WidgetEmpty.js"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAEA;;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAEA;;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export { default } from './WidgetEmpty';\nexport * from './WidgetEmpty';\n\nexport { default as NoData } from './NoData';\nexport * from './NoData';\n\nexport { default as Error } from './Error';\nexport * from './Error';\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../src/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAEA;;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAEA;;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export { default } from './WidgetEmpty';\nexport * from './WidgetEmpty';\n\nexport { default as NoData } from './NoData';\nexport * from './NoData';\n\nexport { default as Error } from './Error';\nexport * from './Error';\n"],"file":"index.js"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/Error/index.tsx"],"names":["React","WidgetEmpty","getIconPath","createComponent","Component","Root","i18nEnhance","de","en","es","fr","it","ja","pt","ru","zh","ko","vi","i18n","Error","asProps","Children","description","getI18nText","title","descriptionText"],"mappings":";;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAsC,OAAtC;AACA,OAAOC,WAAP,IAAsBC,WAAtB,QAA4D,gBAA5D;AACA,OAAOC,eAAP,IAA0BC,SAA1B,EAA4CC,IAA5C,QAAwD,eAAxD;AACA,OAAOC,WAAP,MAAmD,yCAAnD;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AAEA,IAAMC,IAAI,GAAG;AAAEX,EAAAA,EAAE,EAAFA,EAAF;AAAMC,EAAAA,EAAE,EAAFA,EAAN;AAAUC,EAAAA,EAAE,EAAFA,EAAV;AAAcC,EAAAA,EAAE,EAAFA,EAAd;AAAkBC,EAAAA,EAAE,EAAFA,EAAlB;AAAsBC,EAAAA,EAAE,EAAFA,EAAtB;AAA0BE,EAAAA,EAAE,EAAFA,EAA1B;AAA8BC,EAAAA,EAAE,EAAFA,EAA9B;AAAkCF,EAAAA,EAAE,EAAFA,EAAlC;AAAsCG,EAAAA,EAAE,EAAFA,EAAtC;AAA0CC,EAAAA,EAAE,EAAFA;AAA1C,CAAb;;IAOME,K;;;;;;;;;;;;;WAOJ,kBAAS;AAAA;;AAAA,0BACwC,KAAKC,OAD7C;AAAA,UACCC,QADD,iBACCA,QADD;AAAA,UACWC,WADX,iBACWA,WADX;AAAA,UACwBC,WADxB,iBACwBA,WADxB;;AAAA,yBAEyCA,WAAW,EAFpD;AAAA,UAECC,KAFD,gBAECA,KAFD;AAAA,UAEqBC,eAFrB,gBAEQH,WAFR;;AAIP,0BACE,oBAAcrB,WAAd;AAAA,gBAAiCC,WAAW,CAAC,SAAD;AAA5C,6BACE,oBAAC,WAAD,CAAa,KAAb,QAAoBsB,KAApB,CADF,eAEE,oBAAC,WAAD,CAAa,WAAb,QAA0BF,WAAW,IAAIG,eAAzC,CAFF,eAGE,oBAAC,QAAD,OAHF,CADF;AAOD;;;;EAlBiBrB,S;;gBAAde,K,iBACiB,a;;gBADjBA,K,kBAEkB;AACpBD,EAAAA,IAAI,EAAJA;AADoB,C;;gBAFlBC,K,aAKa,CAACb,WAAW,EAAZ,C;;AAgBnB,eAAeH,eAAe,CAA2DgB,KAA3D,CAA9B","sourcesContent":["import React, { HTMLAttributes } from 'react';\nimport WidgetEmpty, { getIconPath, IWidgetEmptyProps } from '../WidgetEmpty';\nimport createComponent, { Component, Merge, Root } from '@semcore/core';\nimport i18nEnhance, { IWithI18nEnhanceProps } from '@semcore/utils/lib/enhances/i18nEnhance';\nimport de from './translations/de.json';\nimport en from './translations/en.json';\nimport es from './translations/es.json';\nimport fr from './translations/fr.json';\nimport it from './translations/it.json';\nimport ja from './translations/ja.json';\nimport pt from './translations/pt.json';\nimport ru from './translations/ru.json';\nimport zh from './translations/zh.json';\nimport ko from './translations/ko.json';\nimport vi from './translations/vi.json';\n\nconst i18n = { de, en, es, fr, it, ja, ru, zh, pt, ko, vi };\n\nexport interface IWidgetErrorProps extends IWidgetEmptyProps, IWithI18nEnhanceProps {\n /** Error description. If it is absent, use the local default one */\n description?: React.ReactNode;\n}\n\nclass Error extends Component<IWidgetErrorProps> {\n static displayName = 'WidgetError';\n static defaultProps = {\n i18n,\n };\n static enhance = [i18nEnhance()];\n\n render() {\n const { Children, description, getI18nText } = this.asProps;\n const { title, description: descriptionText } = getI18nText();\n\n return (\n <Root render={WidgetEmpty} icon={getIconPath('warning')}>\n <WidgetEmpty.Title>{title}</WidgetEmpty.Title>\n <WidgetEmpty.Description>{description || descriptionText}</WidgetEmpty.Description>\n <Children />\n </Root>\n );\n }\n}\n\nexport default createComponent<Merge<IWidgetEmptyProps, HTMLAttributes<HTMLDivElement>>>(Error);\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../src/Error/index.js"],"names":["React","WidgetEmpty","getIconPath","createComponent","Component","Root","i18nEnhance","de","en","es","fr","it","ja","pt","ru","zh","ko","vi","i18n","Error","asProps","Children","description","getI18nText","title","descriptionText"],"mappings":";;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,WAAP,IAAsBC,WAAtB,QAAyC,gBAAzC;AACA,OAAOC,eAAP,IAA0BC,SAA1B,EAAqCC,IAArC,QAAiD,eAAjD;AACA,OAAOC,WAAP,MAAwB,yCAAxB;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AAEA,IAAMC,IAAI,GAAG;AAAEX,EAAAA,EAAE,EAAFA,EAAF;AAAMC,EAAAA,EAAE,EAAFA,EAAN;AAAUC,EAAAA,EAAE,EAAFA,EAAV;AAAcC,EAAAA,EAAE,EAAFA,EAAd;AAAkBC,EAAAA,EAAE,EAAFA,EAAlB;AAAsBC,EAAAA,EAAE,EAAFA,EAAtB;AAA0BE,EAAAA,EAAE,EAAFA,EAA1B;AAA8BC,EAAAA,EAAE,EAAFA,EAA9B;AAAkCF,EAAAA,EAAE,EAAFA,EAAlC;AAAsCG,EAAAA,EAAE,EAAFA,EAAtC;AAA0CC,EAAAA,EAAE,EAAFA;AAA1C,CAAb;;IAEME,K;;;;;;;;;;;;;WAOJ,kBAAS;AAAA;;AAAA,0BACwC,KAAKC,OAD7C;AAAA,UACCC,QADD,iBACCA,QADD;AAAA,UACWC,WADX,iBACWA,WADX;AAAA,UACwBC,WADxB,iBACwBA,WADxB;;AAAA,yBAEyCA,WAAW,EAFpD;AAAA,UAECC,KAFD,gBAECA,KAFD;AAAA,UAEqBC,eAFrB,gBAEQH,WAFR;;AAIP,0BACE,oBAAcrB,WAAd;AAAA,gBAAiCC,WAAW,CAAC,SAAD;AAA5C,6BACE,oBAAC,WAAD,CAAa,KAAb,QAAoBsB,KAApB,CADF,eAEE,oBAAC,WAAD,CAAa,WAAb,QAA0BF,WAAW,IAAIG,eAAzC,CAFF,eAGE,oBAAC,QAAD,OAHF,CADF;AAOD;;;;EAlBiBrB,S;;gBAAde,K,iBACiB,a;;gBADjBA,K,kBAEkB;AACpBD,EAAAA,IAAI,EAAJA;AADoB,C;;gBAFlBC,K,aAKa,CAACb,WAAW,EAAZ,C;;AAgBnB,eAAeH,eAAe,CAACgB,KAAD,CAA9B","sourcesContent":["import React from 'react';\nimport WidgetEmpty, { getIconPath } from '../WidgetEmpty';\nimport createComponent, { Component, Root } from '@semcore/core';\nimport i18nEnhance from '@semcore/utils/lib/enhances/i18nEnhance';\nimport de from './translations/de.json';\nimport en from './translations/en.json';\nimport es from './translations/es.json';\nimport fr from './translations/fr.json';\nimport it from './translations/it.json';\nimport ja from './translations/ja.json';\nimport pt from './translations/pt.json';\nimport ru from './translations/ru.json';\nimport zh from './translations/zh.json';\nimport ko from './translations/ko.json';\nimport vi from './translations/vi.json';\n\nconst i18n = { de, en, es, fr, it, ja, ru, zh, pt, ko, vi };\n\nclass Error extends Component {\n static displayName = 'WidgetError';\n static defaultProps = {\n i18n,\n };\n static enhance = [i18nEnhance()];\n\n render() {\n const { Children, description, getI18nText } = this.asProps;\n const { title, description: descriptionText } = getI18nText();\n\n return (\n <Root render={WidgetEmpty} icon={getIconPath('warning')}>\n <WidgetEmpty.Title>{title}</WidgetEmpty.Title>\n <WidgetEmpty.Description>{description || descriptionText}</WidgetEmpty.Description>\n <Children />\n </Root>\n );\n }\n}\n\nexport default createComponent(Error);\n"],"file":"index.js"}
@@ -11,7 +11,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
11
11
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
12
12
 
13
13
  import React from 'react';
14
- import WidgetEmpty, { getIconPath } from '../WidgetEmpty';
14
+ import WidgetEmpty, { getIconPath, iconNames } from '../WidgetEmpty';
15
15
  import createComponent, { Component, Root } from '@semcore/core';
16
16
  import i18nEnhance from '@semcore/utils/lib/enhances/i18nEnhance';
17
17
  import de from './translations/de.json';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/NoData/index.tsx"],"names":["React","WidgetEmpty","getIconPath","createComponent","Component","Root","i18nEnhance","de","en","es","fr","it","ja","pt","ru","zh","ko","vi","i18n","NoData","asProps","Children","type","description","getI18nText","title","descriptionText"],"mappings":";;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAsC,OAAtC;AACA,OAAOC,WAAP,IAAsBC,WAAtB,QAAuE,gBAAvE;AACA,OAAOC,eAAP,IAA0BC,SAA1B,EAA4CC,IAA5C,QAAwD,eAAxD;AACA,OAAOC,WAAP,MAAmD,yCAAnD;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AAEA,IAAMC,IAAI,GAAG;AAAEX,EAAAA,EAAE,EAAFA,EAAF;AAAMC,EAAAA,EAAE,EAAFA,EAAN;AAAUC,EAAAA,EAAE,EAAFA,EAAV;AAAcC,EAAAA,EAAE,EAAFA,EAAd;AAAkBC,EAAAA,EAAE,EAAFA,EAAlB;AAAsBC,EAAAA,EAAE,EAAFA,EAAtB;AAA0BE,EAAAA,EAAE,EAAFA,EAA1B;AAA8BC,EAAAA,EAAE,EAAFA,EAA9B;AAAkCF,EAAAA,EAAE,EAAFA,EAAlC;AAAsCG,EAAAA,EAAE,EAAFA,EAAtC;AAA0CC,EAAAA,EAAE,EAAFA;AAA1C,CAAb;;IASME,M;;;;;;;;;;;;;WAQJ,kBAAS;AAAA;;AAAA,0BAC8C,KAAKC,OADnD;AAAA,UACCC,QADD,iBACCA,QADD;AAAA,UACWC,IADX,iBACWA,IADX;AAAA,UACiBC,WADjB,iBACiBA,WADjB;AAAA,UAC8BC,WAD9B,iBAC8BA,WAD9B;;AAAA,yBAEyCA,WAAW,EAFpD;AAAA,UAECC,KAFD,gBAECA,KAFD;AAAA,UAEqBC,eAFrB,gBAEQH,WAFR;;AAIP,0BACE,oBAActB,WAAd;AAAA,gBAAiCC,WAAW,CAACoB,IAAD;AAA5C,6BACE,oBAAC,WAAD,CAAa,KAAb,QAAoBG,KAApB,CADF,eAEE,oBAAC,WAAD,CAAa,WAAb,QAA0BF,WAAW,IAAIG,eAAzC,CAFF,eAGE,oBAAC,QAAD,OAHF,CADF;AAOD;;;;EAnBkBtB,S;;gBAAfe,M,iBACiB,c;;gBADjBA,M,aAEa,CAACb,WAAW,EAAZ,C;;gBAFba,M,kBAGkB;AACpBD,EAAAA,IAAI,EAAJA,IADoB;AAEpBI,EAAAA,IAAI,EAAE;AAFc,C;;AAmBxB,eAAenB,eAAe,CAA2DgB,MAA3D,CAA9B","sourcesContent":["import React, { HTMLAttributes } from 'react';\nimport WidgetEmpty, { getIconPath, iconNames, IWidgetEmptyProps } from '../WidgetEmpty';\nimport createComponent, { Component, Merge, Root } from '@semcore/core';\nimport i18nEnhance, { IWithI18nEnhanceProps } from '@semcore/utils/lib/enhances/i18nEnhance';\nimport de from './translations/de.json';\nimport en from './translations/en.json';\nimport es from './translations/es.json';\nimport fr from './translations/fr.json';\nimport it from './translations/it.json';\nimport ja from './translations/ja.json';\nimport pt from './translations/pt.json';\nimport ru from './translations/ru.json';\nimport zh from './translations/zh.json';\nimport ko from './translations/ko.json';\nimport vi from './translations/vi.json';\n\nconst i18n = { de, en, es, fr, it, ja, ru, zh, pt, ko, vi };\n\nexport interface IWidgetNoDataProps extends IWidgetEmptyProps, IWithI18nEnhanceProps {\n /** Error description. If it is absent, use the local default one */\n description?: React.ReactNode;\n /* Data types */\n type?: iconNames;\n}\n\nclass NoData extends Component<IWidgetNoDataProps> {\n static displayName = 'WidgetNoData';\n static enhance = [i18nEnhance()];\n static defaultProps = {\n i18n,\n type: 'other-data',\n };\n\n render() {\n const { Children, type, description, getI18nText } = this.asProps;\n const { title, description: descriptionText } = getI18nText();\n\n return (\n <Root render={WidgetEmpty} icon={getIconPath(type)}>\n <WidgetEmpty.Title>{title}</WidgetEmpty.Title>\n <WidgetEmpty.Description>{description || descriptionText}</WidgetEmpty.Description>\n <Children />\n </Root>\n );\n }\n}\n\nexport default createComponent<Merge<IWidgetEmptyProps, HTMLAttributes<HTMLDivElement>>>(NoData);\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../src/NoData/index.js"],"names":["React","WidgetEmpty","getIconPath","iconNames","createComponent","Component","Root","i18nEnhance","de","en","es","fr","it","ja","pt","ru","zh","ko","vi","i18n","NoData","asProps","Children","type","description","getI18nText","title","descriptionText"],"mappings":";;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAmB,OAAnB;AACA,OAAOC,WAAP,IAAsBC,WAAtB,EAAmCC,SAAnC,QAAoD,gBAApD;AACA,OAAOC,eAAP,IAA0BC,SAA1B,EAAqCC,IAArC,QAAiD,eAAjD;AACA,OAAOC,WAAP,MAAwB,yCAAxB;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AAEA,IAAMC,IAAI,GAAG;AAAEX,EAAAA,EAAE,EAAFA,EAAF;AAAMC,EAAAA,EAAE,EAAFA,EAAN;AAAUC,EAAAA,EAAE,EAAFA,EAAV;AAAcC,EAAAA,EAAE,EAAFA,EAAd;AAAkBC,EAAAA,EAAE,EAAFA,EAAlB;AAAsBC,EAAAA,EAAE,EAAFA,EAAtB;AAA0BE,EAAAA,EAAE,EAAFA,EAA1B;AAA8BC,EAAAA,EAAE,EAAFA,EAA9B;AAAkCF,EAAAA,EAAE,EAAFA,EAAlC;AAAsCG,EAAAA,EAAE,EAAFA,EAAtC;AAA0CC,EAAAA,EAAE,EAAFA;AAA1C,CAAb;;IAEME,M;;;;;;;;;;;;;WAQJ,kBAAS;AAAA;;AAAA,0BAC8C,KAAKC,OADnD;AAAA,UACCC,QADD,iBACCA,QADD;AAAA,UACWC,IADX,iBACWA,IADX;AAAA,UACiBC,WADjB,iBACiBA,WADjB;AAAA,UAC8BC,WAD9B,iBAC8BA,WAD9B;;AAAA,yBAEyCA,WAAW,EAFpD;AAAA,UAECC,KAFD,gBAECA,KAFD;AAAA,UAEqBC,eAFrB,gBAEQH,WAFR;;AAIP,0BACE,oBAAcvB,WAAd;AAAA,gBAAiCC,WAAW,CAACqB,IAAD;AAA5C,6BACE,oBAAC,WAAD,CAAa,KAAb,QAAoBG,KAApB,CADF,eAEE,oBAAC,WAAD,CAAa,WAAb,QAA0BF,WAAW,IAAIG,eAAzC,CAFF,eAGE,oBAAC,QAAD,OAHF,CADF;AAOD;;;;EAnBkBtB,S;;gBAAfe,M,iBACiB,c;;gBADjBA,M,aAEa,CAACb,WAAW,EAAZ,C;;gBAFba,M,kBAGkB;AACpBD,EAAAA,IAAI,EAAJA,IADoB;AAEpBI,EAAAA,IAAI,EAAE;AAFc,C;;AAmBxB,eAAenB,eAAe,CAACgB,MAAD,CAA9B","sourcesContent":["import React from 'react';\nimport WidgetEmpty, { getIconPath, iconNames } from '../WidgetEmpty';\nimport createComponent, { Component, Root } from '@semcore/core';\nimport i18nEnhance from '@semcore/utils/lib/enhances/i18nEnhance';\nimport de from './translations/de.json';\nimport en from './translations/en.json';\nimport es from './translations/es.json';\nimport fr from './translations/fr.json';\nimport it from './translations/it.json';\nimport ja from './translations/ja.json';\nimport pt from './translations/pt.json';\nimport ru from './translations/ru.json';\nimport zh from './translations/zh.json';\nimport ko from './translations/ko.json';\nimport vi from './translations/vi.json';\n\nconst i18n = { de, en, es, fr, it, ja, ru, zh, pt, ko, vi };\n\nclass NoData extends Component {\n static displayName = 'WidgetNoData';\n static enhance = [i18nEnhance()];\n static defaultProps = {\n i18n,\n type: 'other-data',\n };\n\n render() {\n const { Children, type, description, getI18nText } = this.asProps;\n const { title, description: descriptionText } = getI18nText();\n\n return (\n <Root render={WidgetEmpty} icon={getIconPath(type)}>\n <WidgetEmpty.Title>{title}</WidgetEmpty.Title>\n <WidgetEmpty.Description>{description || descriptionText}</WidgetEmpty.Description>\n <Children />\n </Root>\n );\n }\n}\n\nexport default createComponent(NoData);\n"],"file":"index.js"}
@@ -29,18 +29,17 @@ var style = (
29
29
  /*__reshadow_css_start__*/
30
30
  _sstyled.insert(
31
31
  /*__inner_css_start__*/
32
- ".___SWidgetEmpty_1vqf8_gg_{flex-direction:column;align-items:center;margin-bottom:16px}.___SImage_1vqf8_gg_,.___SWidgetEmpty_1vqf8_gg_{justify-content:center}.___SImage_1vqf8_gg_{display:flex;align-items:flex-end;margin-bottom:12px}.___STitle_1vqf8_gg_{color:#757575;font-size:16px;line-height:1.5;font-weight:700}.___SDescription_1vqf8_gg_{text-align:center;font-size:14px;line-height:1.42;color:#757575;max-width:400px}.___STitle_1vqf8_gg_+.___SDescription_1vqf8_gg_{margin-top:4px}.___SDescription_1vqf8_gg_+.___SDescription_1vqf8_gg_{margin-top:8px}"
32
+ ".___SWidgetEmpty_1p1qt_gg_{flex-direction:column;align-items:center;margin-bottom:16px}.___SImage_1p1qt_gg_,.___SWidgetEmpty_1p1qt_gg_{justify-content:center}.___SImage_1p1qt_gg_{display:flex;align-items:flex-end;margin-bottom:12px}.___STitle_1p1qt_gg_{color:#757575;font-size:16px;line-height:1.5;font-weight:700}.___SDescription_1p1qt_gg_{text-align:center;font-size:14px;line-height:1.42;color:#757575;max-width:400px}.___STitle_1p1qt_gg_+.___SDescription_1p1qt_gg_{margin-top:4px}.___SDescription_1p1qt_gg_+.___SDescription_1p1qt_gg_{margin-top:8px}"
33
33
  /*__inner_css_end__*/
34
34
  , "1ncdu8o_gg_")
35
35
  /*__reshadow_css_end__*/
36
36
  , {
37
- "__SWidgetEmpty": "___SWidgetEmpty_1vqf8_gg_",
38
- "__SImage": "___SImage_1vqf8_gg_",
39
- "__STitle": "___STitle_1vqf8_gg_",
40
- "__SDescription": "___SDescription_1vqf8_gg_"
41
- }); // @ts-ignore
42
-
43
- var version = "2.5.0";
37
+ "__SWidgetEmpty": "___SWidgetEmpty_1p1qt_gg_",
38
+ "__SImage": "___SImage_1p1qt_gg_",
39
+ "__STitle": "___STitle_1p1qt_gg_",
40
+ "__SDescription": "___SDescription_1p1qt_gg_"
41
+ });
42
+ var version = "2.6.3";
44
43
  export var getIconPath = function getIconPath(name) {
45
44
  return "//static.semrush.com/ui-kit/widget-empty/".concat(version, "/").concat(name, ".svg");
46
45
  };
@@ -70,7 +69,7 @@ var WidgetEmpty = /*#__PURE__*/function (_Component) {
70
69
  var SImage = 'div';
71
70
  return _ref4 = sstyled(styles), /*#__PURE__*/React.createElement(SWidgetEmpty, _ref4.cn("SWidgetEmpty", _objectSpread({}, _assignProps({}, _ref))), isNode(icon) && /*#__PURE__*/React.createElement(SImage, _ref4.cn("SImage", {}), typeof icon === 'string' ? /*#__PURE__*/React.createElement("img", _ref4.cn("img", {
72
71
  "src": icon,
73
- "alt": "widget empty icon",
72
+ "alt": 'widget empty icon',
74
73
  "width": 100,
75
74
  "height": 72
76
75
  })) : icon), /*#__PURE__*/React.createElement(Children, _ref4.cn("Children", {})));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/WidgetEmpty.tsx"],"names":["React","createComponent","Component","sstyled","Root","Box","Flex","isNode","version","getIconPath","name","WidgetEmpty","SWidgetEmpty","asProps","Children","icon","styles","SImage","style","Title","props","STitle","Description","SDescription"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAsD,OAAtD;AACA,OAAOC,eAAP,IAA0BC,SAA1B,EAA4CC,OAA5C,EAAqDC,IAArD,QAAiE,eAAjE;AACA,SAASC,GAAT,EAAcC,IAAd,QAAsC,mBAAtC;AACA,OAAOC,MAAP,MAAmB,2BAAnB;;;;;;;;;;;;;;;;IAIA;;AACA,IAAMC,OAAO,UAAb;AAiCA,OAAO,IAAMC,WAAW,GAAG,SAAdA,WAAc,CAACC,IAAD;AAAA,4DACmBF,OADnB,cAC8BE,IAD9B;AAAA,CAApB;;IAUDC,W;;;;;;;;;;;;;WAIJ,kBAAS;AAAA;AAAA;;AACP,UAAMC,YAAY,GAKMN,IALxB;AADO,0BAE4B,KAAKO,OAFjC;AAAA,UAECC,QAFD,iBAECA,QAFD;AAAA,UAEWC,IAFX,iBAEWA,IAFX;AAAA,UAEiBC,MAFjB,iBAEiBA,MAFjB;AAGP,UAAMC,MAAM,GAAG,KAAf;AAEA,qBAAOd,OAAO,CAACa,MAAD,CAAd,eACE,oBAAC,YAAD,uEACGT,MAAM,CAACQ,IAAD,CAAN,iBACC,oBAAC,MAAD,0BACG,OAAOA,IAAP,KAAgB,QAAhB,gBACC;AAAA,eAAUA,IAAV;AAAA,eAAoB,mBAApB;AAAA,iBAA+C,GAA/C;AAAA,kBAA4D;AAA5D,SADD,GAGCA,IAJJ,CAFJ,eAUE,oBAAC,QAAD,2BAVF,CADF;AAcD;;;;EAvBuBb,S;;gBAApBS,W,iBACiB,a;;gBADjBA,W,WAEWO,K;;AAwBjB,IAAMC,KAAK,GAAG,SAARA,KAAQ,CAACC,KAAD,EAAW;AAAA;AAAA;;AACvB,MAAMC,MAAM,GAE2BhB,GAFvC;AADuB,MAEfW,MAFe,GAEJI,KAFI,CAEfJ,MAFe;AAGvB,iBAAOb,OAAO,CAACa,MAAD,CAAd,eAAuB,oBAAC,MAAD,kEAAvB;AACD,CAJD;;AAMA,IAAMM,WAAW,GAAG,SAAdA,WAAc,CAACF,KAAD,EAAW;AAAA;AAAA;;AAC7B,MAAMG,YAAY,GAE2BlB,GAF7C;AAD6B,MAErBW,MAFqB,GAEVI,KAFU,CAErBJ,MAFqB;AAG7B,iBAAOb,OAAO,CAACa,MAAD,CAAd,eAAuB,oBAAC,YAAD,wEAAvB;AACD,CAJD;;AAMA,eAAef,eAAe,CAM5BU,WAN4B,EAMf;AACbQ,EAAAA,KAAK,EAALA,KADa;AAEbG,EAAAA,WAAW,EAAXA;AAFa,CANe,CAA9B","sourcesContent":["import React, { HTMLAttributes, ComponentProps } from 'react';\nimport createComponent, { Component, Merge, sstyled, Root } from '@semcore/core';\nimport { Box, Flex, IFlexProps } from '@semcore/flex-box';\nimport isNode from '@semcore/utils/lib/isNode';\n\nimport style from './style/widget-empty.shadow.css';\n\n// @ts-ignore\nconst version = preval`\n module.exports = require('../package.json').version\n`;\n\nexport type iconNames =\n | 'area-chart'\n | 'choropleth-map-chart'\n | 'combined-chart'\n | 'congrats'\n | 'deleted-page'\n | 'donut-chart'\n | 'duplicates'\n | 'funnel-chart'\n | 'good'\n | 'horizontal-bar-chart'\n | 'line-chart'\n | 'lollipop-chart'\n | 'nexttime'\n | 'nothing-found'\n | 'other-data'\n | 'pie-chart'\n | 'processing'\n | 'radar-chart'\n | 'sankey-chart'\n | 'scatter-plot-chart'\n | 'stacked-area-chart'\n | 'suggestions'\n | 'table'\n | 'text-links-etc'\n | 'venn-chart'\n | 'vertical-bar-chart'\n | 'warning';\n\nexport const getIconPath = (name: iconNames) =>\n `//static.semrush.com/ui-kit/widget-empty/${version}/${name}.svg`;\n\nexport interface IWidgetEmptyProps extends IFlexProps {\n /**\n * URL before the icon or the whole component\n */\n icon?: iconNames | React.ReactNode;\n}\n\nclass WidgetEmpty extends Component<IWidgetEmptyProps> {\n static displayName = 'WidgetEmpty';\n static style = style;\n\n render() {\n const SWidgetEmpty = Root;\n const { Children, icon, styles } = this.asProps;\n const SImage = 'div';\n\n return sstyled(styles)(\n <SWidgetEmpty render={Flex}>\n {isNode(icon) && (\n <SImage>\n {typeof icon === 'string' ? (\n <img src={icon} alt=\"widget empty icon\" width={100} height={72} />\n ) : (\n icon\n )}\n </SImage>\n )}\n <Children />\n </SWidgetEmpty>,\n );\n }\n}\n\nconst Title = (props) => {\n const STitle = Root;\n const { styles } = props;\n return sstyled(styles)(<STitle render={Box} />);\n};\n\nconst Description = (props) => {\n const SDescription = Root;\n const { styles } = props;\n return sstyled(styles)(<SDescription render={Box} />);\n};\n\nexport default createComponent<\n Merge<IWidgetEmptyProps, HTMLAttributes<HTMLDivElement>>,\n {\n Title: ComponentProps<typeof Box>;\n Description: ComponentProps<typeof Box>;\n }\n>(WidgetEmpty, {\n Title,\n Description,\n});\n"],"file":"WidgetEmpty.js"}
1
+ {"version":3,"sources":["../../src/WidgetEmpty.js"],"names":["React","createComponent","Component","sstyled","Root","Box","Flex","isNode","version","getIconPath","name","WidgetEmpty","SWidgetEmpty","asProps","Children","icon","styles","SImage","style","Title","props","STitle","Description","SDescription"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,eAAP,IAA0BC,SAA1B,EAAqCC,OAArC,EAA8CC,IAA9C,QAA0D,eAA1D;AACA,SAASC,GAAT,EAAcC,IAAd,QAA0B,mBAA1B;AACA,OAAOC,MAAP,MAAmB,2BAAnB;;;;;;;;;;;;;;;;;AAIA,IAAMC,OAAO,UAAb;AAIA,OAAO,IAAMC,WAAW,GAAG,SAAdA,WAAc,CAACC,IAAD;AAAA,4DACmBF,OADnB,cAC8BE,IAD9B;AAAA,CAApB;;IAGDC,W;;;;;;;;;;;;;WAIJ,kBAAS;AAAA;AAAA;;AACP,UAAMC,YAAY,GAKMN,IALxB;AADO,0BAE4B,KAAKO,OAFjC;AAAA,UAECC,QAFD,iBAECA,QAFD;AAAA,UAEWC,IAFX,iBAEWA,IAFX;AAAA,UAEiBC,MAFjB,iBAEiBA,MAFjB;AAGP,UAAMC,MAAM,GAAG,KAAf;AAEA,qBAAOd,OAAO,CAACa,MAAD,CAAd,eACE,oBAAC,YAAD,uEACGT,MAAM,CAACQ,IAAD,CAAN,iBACC,oBAAC,MAAD,0BACG,OAAOA,IAAP,KAAgB,QAAhB,gBACC;AAAA,eAAUA,IAAV;AAAA,eAAoB,mBAApB;AAAA,iBAA+C,GAA/C;AAAA,kBAA4D;AAA5D,SADD,GAGCA,IAJJ,CAFJ,eAUE,oBAAC,QAAD,2BAVF,CADF;AAcD;;;;EAvBuBb,S;;gBAApBS,W,iBACiB,a;;gBADjBA,W,WAEWO,K;;AAwBjB,IAAMC,KAAK,GAAG,SAARA,KAAQ,CAACC,KAAD,EAAW;AAAA;AAAA;;AACvB,MAAMC,MAAM,GAE2BhB,GAFvC;AADuB,MAEfW,MAFe,GAEJI,KAFI,CAEfJ,MAFe;AAGvB,iBAAOb,OAAO,CAACa,MAAD,CAAd,eAAuB,oBAAC,MAAD,kEAAvB;AACD,CAJD;;AAMA,IAAMM,WAAW,GAAG,SAAdA,WAAc,CAACF,KAAD,EAAW;AAAA;AAAA;;AAC7B,MAAMG,YAAY,GAE2BlB,GAF7C;AAD6B,MAErBW,MAFqB,GAEVI,KAFU,CAErBJ,MAFqB;AAG7B,iBAAOb,OAAO,CAACa,MAAD,CAAd,eAAuB,oBAAC,YAAD,wEAAvB;AACD,CAJD;;AAMA,eAAef,eAAe,CAACU,WAAD,EAAc;AAC1CQ,EAAAA,KAAK,EAALA,KAD0C;AAE1CG,EAAAA,WAAW,EAAXA;AAF0C,CAAd,CAA9B","sourcesContent":["import React from 'react';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Box, Flex } from '@semcore/flex-box';\nimport isNode from '@semcore/utils/lib/isNode';\n\nimport style from './style/widget-empty.shadow.css';\n\nconst version = preval`\n module.exports = require('../package.json').version\n`;\n\nexport const getIconPath = (name) =>\n `//static.semrush.com/ui-kit/widget-empty/${version}/${name}.svg`;\n\nclass WidgetEmpty extends Component {\n static displayName = 'WidgetEmpty';\n static style = style;\n\n render() {\n const SWidgetEmpty = Root;\n const { Children, icon, styles } = this.asProps;\n const SImage = 'div';\n\n return sstyled(styles)(\n <SWidgetEmpty render={Flex}>\n {isNode(icon) && (\n <SImage>\n {typeof icon === 'string' ? (\n <img src={icon} alt='widget empty icon' width={100} height={72} />\n ) : (\n icon\n )}\n </SImage>\n )}\n <Children />\n </SWidgetEmpty>,\n );\n }\n}\n\nconst Title = (props) => {\n const STitle = Root;\n const { styles } = props;\n return sstyled(styles)(<STitle render={Box} />);\n};\n\nconst Description = (props) => {\n const SDescription = Root;\n const { styles } = props;\n return sstyled(styles)(<SDescription render={Box} />);\n};\n\nexport default createComponent(WidgetEmpty, {\n Title,\n Description,\n});\n"],"file":"WidgetEmpty.js"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.tsx"],"names":["default","NoData","Error"],"mappings":"AAAA,SAASA,OAAT,QAAwB,eAAxB;AACA,cAAc,eAAd;AAEA,SAASA,OAAO,IAAIC,MAApB,QAAkC,UAAlC;AACA,cAAc,UAAd;AAEA,SAASD,OAAO,IAAIE,KAApB,QAAiC,SAAjC;AACA,cAAc,SAAd","sourcesContent":["export { default } from './WidgetEmpty';\nexport * from './WidgetEmpty';\n\nexport { default as NoData } from './NoData';\nexport * from './NoData';\n\nexport { default as Error } from './Error';\nexport * from './Error';\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../src/index.js"],"names":["default","NoData","Error"],"mappings":"AAAA,SAASA,OAAT,QAAwB,eAAxB;AACA,cAAc,eAAd;AAEA,SAASA,OAAO,IAAIC,MAApB,QAAkC,UAAlC;AACA,cAAc,UAAd;AAEA,SAASD,OAAO,IAAIE,KAApB,QAAiC,SAAjC;AACA,cAAc,SAAd","sourcesContent":["export { default } from './WidgetEmpty';\nexport * from './WidgetEmpty';\n\nexport { default as NoData } from './NoData';\nexport * from './NoData';\n\nexport { default as Error } from './Error';\nexport * from './Error';\n"],"file":"index.js"}
@@ -1,6 +1,65 @@
1
- export { default } from './WidgetEmpty';
2
- export * from './WidgetEmpty';
3
- export { default as NoData } from './NoData';
4
- export * from './NoData';
5
- export { default as Error } from './Error';
6
- export * from './Error';
1
+ import { ComponentProps } from 'react';
2
+ import { CProps, ReturnEl } from '@semcore/core';
3
+ import { Box, IFlexProps } from '@semcore/flex-box';
4
+ import { IWithI18nEnhanceProps } from '@semcore/utils/lib/enhances/i18nEnhance';
5
+
6
+ export type iconNames =
7
+ | 'area-chart'
8
+ | 'choropleth-map-chart'
9
+ | 'combined-chart'
10
+ | 'congrats'
11
+ | 'deleted-page'
12
+ | 'donut-chart'
13
+ | 'duplicates'
14
+ | 'funnel-chart'
15
+ | 'good'
16
+ | 'horizontal-bar-chart'
17
+ | 'line-chart'
18
+ | 'lollipop-chart'
19
+ | 'nexttime'
20
+ | 'nothing-found'
21
+ | 'other-data'
22
+ | 'pie-chart'
23
+ | 'processing'
24
+ | 'radar-chart'
25
+ | 'sankey-chart'
26
+ | 'scatter-plot-chart'
27
+ | 'stacked-area-chart'
28
+ | 'suggestions'
29
+ | 'table'
30
+ | 'tag-cloud'
31
+ | 'text-links-etc'
32
+ | 'venn-chart'
33
+ | 'vertical-bar-chart'
34
+ | 'warning';
35
+
36
+ export interface IWidgetEmptyProps extends IFlexProps {
37
+ /**
38
+ * URL before the icon or the whole component
39
+ */
40
+ icon?: React.ReactNode;
41
+ }
42
+
43
+ export interface IWidgetErrorProps extends IWidgetEmptyProps, IWithI18nEnhanceProps {
44
+ /** Error description. If it is absent, use the local default one */
45
+ description?: React.ReactNode;
46
+ }
47
+
48
+ export interface IWidgetNoDataProps extends IWidgetEmptyProps, IWithI18nEnhanceProps {
49
+ /** Error description. If it is absent, use the local default one */
50
+ description?: React.ReactNode;
51
+ /* Data types */
52
+ type?: iconNames;
53
+ }
54
+
55
+ declare const WidgetEmpty: (<T>(props: CProps<IWidgetEmptyProps> & T) => ReturnEl) & {
56
+ Title: <T>(props: ComponentProps<typeof Box> & T) => ReturnEl;
57
+ Description: <T>(props: ComponentProps<typeof Box> & T) => ReturnEl;
58
+ };
59
+
60
+ declare const NoData: <T>(props: CProps<IWidgetNoDataProps> & T) => ReturnEl;
61
+ declare const Error: <T>(props: CProps<IWidgetErrorProps> & T) => ReturnEl;
62
+ declare const getIconPath: (name: string) => string;
63
+
64
+ export default WidgetEmpty;
65
+ export { getIconPath, NoData, Error };
package/package.json CHANGED
@@ -1,17 +1,15 @@
1
1
  {
2
2
  "name": "@semcore/widget-empty",
3
3
  "description": "SEMRush WidgetEmpty Component",
4
- "version": "2.5.0",
4
+ "version": "2.6.3",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
8
+ "sideEffects": false,
8
9
  "author": "Roman Lysov <r.lysov@semrush.com>",
9
10
  "license": "MIT",
10
- "sideEffects": [
11
- "lib/*/WidgetEmpty.js"
12
- ],
13
11
  "scripts": {
14
- "build": "build",
12
+ "build": "build --source=js",
15
13
  "test": "jest",
16
14
  "deploy": "gcs-upload svg/*.svg"
17
15
  },
@@ -19,8 +17,7 @@
19
17
  "@semcore/utils": "^3.27",
20
18
  "@semcore/flex-box": "^4",
21
19
  "@semcore/button": "^3",
22
- "@semcore/link": "^3",
23
- "@semcore/icon": "^2"
20
+ "@semcore/link": "^3"
24
21
  },
25
22
  "peerDependencies": {
26
23
  "@semcore/core": "^1.11",
@@ -1,7 +1,7 @@
1
- import React, { HTMLAttributes } from 'react';
2
- import WidgetEmpty, { getIconPath, IWidgetEmptyProps } from '../WidgetEmpty';
3
- import createComponent, { Component, Merge, Root } from '@semcore/core';
4
- import i18nEnhance, { IWithI18nEnhanceProps } from '@semcore/utils/lib/enhances/i18nEnhance';
1
+ import React from 'react';
2
+ import WidgetEmpty, { getIconPath } from '../WidgetEmpty';
3
+ import createComponent, { Component, Root } from '@semcore/core';
4
+ import i18nEnhance from '@semcore/utils/lib/enhances/i18nEnhance';
5
5
  import de from './translations/de.json';
6
6
  import en from './translations/en.json';
7
7
  import es from './translations/es.json';
@@ -16,12 +16,7 @@ import vi from './translations/vi.json';
16
16
 
17
17
  const i18n = { de, en, es, fr, it, ja, ru, zh, pt, ko, vi };
18
18
 
19
- export interface IWidgetErrorProps extends IWidgetEmptyProps, IWithI18nEnhanceProps {
20
- /** Error description. If it is absent, use the local default one */
21
- description?: React.ReactNode;
22
- }
23
-
24
- class Error extends Component<IWidgetErrorProps> {
19
+ class Error extends Component {
25
20
  static displayName = 'WidgetError';
26
21
  static defaultProps = {
27
22
  i18n,
@@ -42,4 +37,4 @@ class Error extends Component<IWidgetErrorProps> {
42
37
  }
43
38
  }
44
39
 
45
- export default createComponent<Merge<IWidgetEmptyProps, HTMLAttributes<HTMLDivElement>>>(Error);
40
+ export default createComponent(Error);
@@ -1,7 +1,7 @@
1
- import React, { HTMLAttributes } from 'react';
2
- import WidgetEmpty, { getIconPath, iconNames, IWidgetEmptyProps } from '../WidgetEmpty';
3
- import createComponent, { Component, Merge, Root } from '@semcore/core';
4
- import i18nEnhance, { IWithI18nEnhanceProps } from '@semcore/utils/lib/enhances/i18nEnhance';
1
+ import React from 'react';
2
+ import WidgetEmpty, { getIconPath, iconNames } from '../WidgetEmpty';
3
+ import createComponent, { Component, Root } from '@semcore/core';
4
+ import i18nEnhance from '@semcore/utils/lib/enhances/i18nEnhance';
5
5
  import de from './translations/de.json';
6
6
  import en from './translations/en.json';
7
7
  import es from './translations/es.json';
@@ -16,14 +16,7 @@ import vi from './translations/vi.json';
16
16
 
17
17
  const i18n = { de, en, es, fr, it, ja, ru, zh, pt, ko, vi };
18
18
 
19
- export interface IWidgetNoDataProps extends IWidgetEmptyProps, IWithI18nEnhanceProps {
20
- /** Error description. If it is absent, use the local default one */
21
- description?: React.ReactNode;
22
- /* Data types */
23
- type?: iconNames;
24
- }
25
-
26
- class NoData extends Component<IWidgetNoDataProps> {
19
+ class NoData extends Component {
27
20
  static displayName = 'WidgetNoData';
28
21
  static enhance = [i18nEnhance()];
29
22
  static defaultProps = {
@@ -45,4 +38,4 @@ class NoData extends Component<IWidgetNoDataProps> {
45
38
  }
46
39
  }
47
40
 
48
- export default createComponent<Merge<IWidgetEmptyProps, HTMLAttributes<HTMLDivElement>>>(NoData);
41
+ export default createComponent(NoData);
@@ -0,0 +1,56 @@
1
+ import React from 'react';
2
+ import createComponent, { Component, sstyled, Root } from '@semcore/core';
3
+ import { Box, Flex } from '@semcore/flex-box';
4
+ import isNode from '@semcore/utils/lib/isNode';
5
+
6
+ import style from './style/widget-empty.shadow.css';
7
+
8
+ const version = preval`
9
+ module.exports = require('../package.json').version
10
+ `;
11
+
12
+ export const getIconPath = (name) =>
13
+ `//static.semrush.com/ui-kit/widget-empty/${version}/${name}.svg`;
14
+
15
+ class WidgetEmpty extends Component {
16
+ static displayName = 'WidgetEmpty';
17
+ static style = style;
18
+
19
+ render() {
20
+ const SWidgetEmpty = Root;
21
+ const { Children, icon, styles } = this.asProps;
22
+ const SImage = 'div';
23
+
24
+ return sstyled(styles)(
25
+ <SWidgetEmpty render={Flex}>
26
+ {isNode(icon) && (
27
+ <SImage>
28
+ {typeof icon === 'string' ? (
29
+ <img src={icon} alt='widget empty icon' width={100} height={72} />
30
+ ) : (
31
+ icon
32
+ )}
33
+ </SImage>
34
+ )}
35
+ <Children />
36
+ </SWidgetEmpty>,
37
+ );
38
+ }
39
+ }
40
+
41
+ const Title = (props) => {
42
+ const STitle = Root;
43
+ const { styles } = props;
44
+ return sstyled(styles)(<STitle render={Box} />);
45
+ };
46
+
47
+ const Description = (props) => {
48
+ const SDescription = Root;
49
+ const { styles } = props;
50
+ return sstyled(styles)(<SDescription render={Box} />);
51
+ };
52
+
53
+ export default createComponent(WidgetEmpty, {
54
+ Title,
55
+ Description,
56
+ });
package/src/index.d.ts ADDED
@@ -0,0 +1,65 @@
1
+ import { ComponentProps } from 'react';
2
+ import { CProps, ReturnEl } from '@semcore/core';
3
+ import { Box, IFlexProps } from '@semcore/flex-box';
4
+ import { IWithI18nEnhanceProps } from '@semcore/utils/lib/enhances/i18nEnhance';
5
+
6
+ export type iconNames =
7
+ | 'area-chart'
8
+ | 'choropleth-map-chart'
9
+ | 'combined-chart'
10
+ | 'congrats'
11
+ | 'deleted-page'
12
+ | 'donut-chart'
13
+ | 'duplicates'
14
+ | 'funnel-chart'
15
+ | 'good'
16
+ | 'horizontal-bar-chart'
17
+ | 'line-chart'
18
+ | 'lollipop-chart'
19
+ | 'nexttime'
20
+ | 'nothing-found'
21
+ | 'other-data'
22
+ | 'pie-chart'
23
+ | 'processing'
24
+ | 'radar-chart'
25
+ | 'sankey-chart'
26
+ | 'scatter-plot-chart'
27
+ | 'stacked-area-chart'
28
+ | 'suggestions'
29
+ | 'table'
30
+ | 'tag-cloud'
31
+ | 'text-links-etc'
32
+ | 'venn-chart'
33
+ | 'vertical-bar-chart'
34
+ | 'warning';
35
+
36
+ export interface IWidgetEmptyProps extends IFlexProps {
37
+ /**
38
+ * URL before the icon or the whole component
39
+ */
40
+ icon?: React.ReactNode;
41
+ }
42
+
43
+ export interface IWidgetErrorProps extends IWidgetEmptyProps, IWithI18nEnhanceProps {
44
+ /** Error description. If it is absent, use the local default one */
45
+ description?: React.ReactNode;
46
+ }
47
+
48
+ export interface IWidgetNoDataProps extends IWidgetEmptyProps, IWithI18nEnhanceProps {
49
+ /** Error description. If it is absent, use the local default one */
50
+ description?: React.ReactNode;
51
+ /* Data types */
52
+ type?: iconNames;
53
+ }
54
+
55
+ declare const WidgetEmpty: (<T>(props: CProps<IWidgetEmptyProps> & T) => ReturnEl) & {
56
+ Title: <T>(props: ComponentProps<typeof Box> & T) => ReturnEl;
57
+ Description: <T>(props: ComponentProps<typeof Box> & T) => ReturnEl;
58
+ };
59
+
60
+ declare const NoData: <T>(props: CProps<IWidgetNoDataProps> & T) => ReturnEl;
61
+ declare const Error: <T>(props: CProps<IWidgetErrorProps> & T) => ReturnEl;
62
+ declare const getIconPath: (name: string) => string;
63
+
64
+ export default WidgetEmpty;
65
+ export { getIconPath, NoData, Error };
File without changes
@@ -0,0 +1,4 @@
1
+ <svg width="100" height="72" viewBox="0 0 100 72" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M33 46h16a4 4 0 010 8H33a4 4 0 010-8zm11-29v6a4 4 0 01-8 0v-6a4 4 0 018 0z" fill="#EEF0F1"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M44 17v6a4 4 0 01-8 0v-6a4 4 0 018 0zm21 13H35a6 6 0 000 12h30a6 6 0 000-12zm-34 6a4 4 0 014-4h30a4 4 0 010 8H35a4 4 0 01-4-4zm2 10h16a4 4 0 010 8H33a4 4 0 010-8zm-2 4c0-1.1.9-2 2-2h16a2 2 0 110 4H33a2 2 0 01-2-2zm9-35a2 2 0 012 2v6a2 2 0 11-4 0v-6c0-1.1.9-2 2-2zm43 19v6a4 4 0 01-8 0v-6a4 4 0 018 0zm-4-2a2 2 0 012 2v6a2 2 0 11-4 0v-6c0-1.1.9-2 2-2zM48 23a4 4 0 014-4h25a4 4 0 010 8H52a4 4 0 01-4-4zm24.41-2H77a2 2 0 01.52.07L73.59 25H68.4l4-4zm-2.82 0H64.4l-4 4h5.18l4-4zm-12 4l4-4H56.4l-4 4h5.18zm-7.2-.8l3.2-3.2H52a2 2 0 00-1.6 3.2zm26.02.8H77a2 2 0 001.93-2.52L76.41 25zM17 40a4 4 0 018 0v16a4 4 0 01-8 0V40zm6 14.23V56a2 2 0 01-3.94.5L23 54.23zm0-2.31v-3.7l-4 2.3v3.7l4-2.3zm-4-3.7l4-2.31v-3.7l-4 2.31v3.7zm0-6.01l4-2.3a2 2 0 00-4 .09v2.21z" fill="#CBD1D3"/>
4
+ </svg>
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- import { IWidgetEmptyProps } from '../WidgetEmpty';
3
- import { Merge } from '@semcore/core';
4
- import { IWithI18nEnhanceProps } from '@semcore/utils/lib/enhances/i18nEnhance';
5
- export interface IWidgetErrorProps extends IWidgetEmptyProps, IWithI18nEnhanceProps {
6
- /** Error description. If it is absent, use the local default one */
7
- description?: React.ReactNode;
8
- }
9
- declare const _default: import("@semcore/core").ComponentType<Merge<IWidgetEmptyProps, React.HTMLAttributes<HTMLDivElement>>, {}, {}, {
10
- [key: string]: (arg: unknown) => void;
11
- }, null>;
12
- export default _default;
@@ -1,13 +0,0 @@
1
- import React from 'react';
2
- import { iconNames, IWidgetEmptyProps } from '../WidgetEmpty';
3
- import { Merge } from '@semcore/core';
4
- import { IWithI18nEnhanceProps } from '@semcore/utils/lib/enhances/i18nEnhance';
5
- export interface IWidgetNoDataProps extends IWidgetEmptyProps, IWithI18nEnhanceProps {
6
- /** Error description. If it is absent, use the local default one */
7
- description?: React.ReactNode;
8
- type?: iconNames;
9
- }
10
- declare const _default: import("@semcore/core").ComponentType<Merge<IWidgetEmptyProps, React.HTMLAttributes<HTMLDivElement>>, {}, {}, {
11
- [key: string]: (arg: unknown) => void;
12
- }, null>;
13
- export default _default;
@@ -1,18 +0,0 @@
1
- import React, { ComponentProps } from 'react';
2
- import { Merge } from '@semcore/core';
3
- import { Box, IFlexProps } from '@semcore/flex-box';
4
- export declare type iconNames = 'area-chart' | 'choropleth-map-chart' | 'combined-chart' | 'congrats' | 'deleted-page' | 'donut-chart' | 'duplicates' | 'funnel-chart' | 'good' | 'horizontal-bar-chart' | 'line-chart' | 'lollipop-chart' | 'nexttime' | 'nothing-found' | 'other-data' | 'pie-chart' | 'processing' | 'radar-chart' | 'sankey-chart' | 'scatter-plot-chart' | 'stacked-area-chart' | 'suggestions' | 'table' | 'text-links-etc' | 'venn-chart' | 'vertical-bar-chart' | 'warning';
5
- export declare const getIconPath: (name: iconNames) => string;
6
- export interface IWidgetEmptyProps extends IFlexProps {
7
- /**
8
- * URL before the icon or the whole component
9
- */
10
- icon?: iconNames | React.ReactNode;
11
- }
12
- declare const _default: import("@semcore/core").ComponentType<Merge<IWidgetEmptyProps, React.HTMLAttributes<HTMLDivElement>>, {
13
- Title: ComponentProps<typeof Box>;
14
- Description: ComponentProps<typeof Box>;
15
- }, {}, {
16
- [key: string]: (arg: unknown) => void;
17
- }, null>;
18
- export default _default;
@@ -1,99 +0,0 @@
1
- import React, { HTMLAttributes, ComponentProps } from 'react';
2
- import createComponent, { Component, Merge, sstyled, Root } from '@semcore/core';
3
- import { Box, Flex, IFlexProps } from '@semcore/flex-box';
4
- import isNode from '@semcore/utils/lib/isNode';
5
-
6
- import style from './style/widget-empty.shadow.css';
7
-
8
- // @ts-ignore
9
- const version = preval`
10
- module.exports = require('../package.json').version
11
- `;
12
-
13
- export type iconNames =
14
- | 'area-chart'
15
- | 'choropleth-map-chart'
16
- | 'combined-chart'
17
- | 'congrats'
18
- | 'deleted-page'
19
- | 'donut-chart'
20
- | 'duplicates'
21
- | 'funnel-chart'
22
- | 'good'
23
- | 'horizontal-bar-chart'
24
- | 'line-chart'
25
- | 'lollipop-chart'
26
- | 'nexttime'
27
- | 'nothing-found'
28
- | 'other-data'
29
- | 'pie-chart'
30
- | 'processing'
31
- | 'radar-chart'
32
- | 'sankey-chart'
33
- | 'scatter-plot-chart'
34
- | 'stacked-area-chart'
35
- | 'suggestions'
36
- | 'table'
37
- | 'text-links-etc'
38
- | 'venn-chart'
39
- | 'vertical-bar-chart'
40
- | 'warning';
41
-
42
- export const getIconPath = (name: iconNames) =>
43
- `//static.semrush.com/ui-kit/widget-empty/${version}/${name}.svg`;
44
-
45
- export interface IWidgetEmptyProps extends IFlexProps {
46
- /**
47
- * URL before the icon or the whole component
48
- */
49
- icon?: iconNames | React.ReactNode;
50
- }
51
-
52
- class WidgetEmpty extends Component<IWidgetEmptyProps> {
53
- static displayName = 'WidgetEmpty';
54
- static style = style;
55
-
56
- render() {
57
- const SWidgetEmpty = Root;
58
- const { Children, icon, styles } = this.asProps;
59
- const SImage = 'div';
60
-
61
- return sstyled(styles)(
62
- <SWidgetEmpty render={Flex}>
63
- {isNode(icon) && (
64
- <SImage>
65
- {typeof icon === 'string' ? (
66
- <img src={icon} alt="widget empty icon" width={100} height={72} />
67
- ) : (
68
- icon
69
- )}
70
- </SImage>
71
- )}
72
- <Children />
73
- </SWidgetEmpty>,
74
- );
75
- }
76
- }
77
-
78
- const Title = (props) => {
79
- const STitle = Root;
80
- const { styles } = props;
81
- return sstyled(styles)(<STitle render={Box} />);
82
- };
83
-
84
- const Description = (props) => {
85
- const SDescription = Root;
86
- const { styles } = props;
87
- return sstyled(styles)(<SDescription render={Box} />);
88
- };
89
-
90
- export default createComponent<
91
- Merge<IWidgetEmptyProps, HTMLAttributes<HTMLDivElement>>,
92
- {
93
- Title: ComponentProps<typeof Box>;
94
- Description: ComponentProps<typeof Box>;
95
- }
96
- >(WidgetEmpty, {
97
- Title,
98
- Description,
99
- });