@semcore/widget-empty 2.6.5 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -2
- package/lib/cjs/Error/index.js +1 -2
- package/lib/cjs/Error/index.js.map +1 -1
- package/lib/cjs/NoData/index.js +1 -2
- package/lib/cjs/NoData/index.js.map +1 -1
- package/lib/cjs/WidgetEmpty.js +10 -12
- package/lib/cjs/WidgetEmpty.js.map +1 -1
- package/lib/cjs/index.d.ts +71 -0
- package/lib/cjs/index.js +4 -26
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/style/widget-empty.shadow.css +2 -2
- package/lib/es6/Error/index.js +1 -2
- package/lib/es6/Error/index.js.map +1 -1
- package/lib/es6/NoData/index.js +1 -2
- package/lib/es6/NoData/index.js.map +1 -1
- package/lib/es6/WidgetEmpty.js +10 -12
- package/lib/es6/WidgetEmpty.js.map +1 -1
- package/lib/es6/index.d.ts +71 -0
- package/lib/es6/index.js +0 -2
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/style/widget-empty.shadow.css +2 -2
- package/lib/types/index.d.ts +6 -0
- package/package.json +5 -2
- package/src/Error/{index.js → index.jsx} +0 -0
- package/src/NoData/{index.js → index.jsx} +0 -0
- package/src/{WidgetEmpty.js → WidgetEmpty.jsx} +0 -0
- package/src/index.d.ts +6 -0
- package/src/index.js +0 -2
- package/src/style/widget-empty.shadow.css +2 -2
- package/svg/area-chart.svg +5 -7
- package/svg/choropleth-map-chart.svg +4 -8
- package/svg/coffee.svg +4 -0
- package/svg/combined-chart.svg +5 -7
- package/svg/congrats.svg +2 -2
- package/svg/deleted-page.svg +2 -2
- package/svg/donut-chart.svg +6 -11
- package/svg/duplicates.svg +5 -19
- package/svg/funnel-chart.svg +3 -5
- package/svg/good.svg +5 -7
- package/svg/heat-map-chart.svg +12 -0
- package/svg/horizontal-bar-chart.svg +6 -10
- package/svg/kagi-chart.svg +3 -0
- package/svg/line-chart.svg +4 -6
- package/svg/lollipop-chart.svg +10 -15
- package/svg/nexttime.svg +5 -7
- package/svg/nothing-found.svg +4 -6
- package/svg/other-data.svg +12 -5
- package/svg/pie-chart.svg +5 -9
- package/svg/processing.svg +5 -13
- package/svg/radar-chart.svg +16 -17
- package/svg/radial-tree-chart.svg +20 -0
- package/svg/sankey-chart.svg +8 -14
- package/svg/scatter-plot-chart.svg +7 -8
- package/svg/stacked-area-chart.svg +9 -13
- package/svg/suggestion.svg +7 -0
- package/svg/suggestions.svg +16 -22
- package/svg/table.svg +8 -10
- package/svg/tag-cloud.svg +2 -2
- package/svg/text-links-etc.svg +16 -22
- package/svg/under-construction.svg +6 -0
- package/svg/venn-chart.svg +10 -13
- package/svg/vertical-bar-chart.svg +5 -8
- package/svg/warning.svg +4 -7
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
|
5
|
+
## [3.0.0] - 2022-05-17
|
|
6
|
+
|
|
7
|
+
### BREAK
|
|
8
|
+
|
|
9
|
+
- Updated styles according to the library redesign policy.
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- Added `coffee`/`heat-map-chart`/`kagi-chart`/`radial-tree-chart`/`suggestion`/`under-construction` illustrations.
|
|
14
|
+
|
|
15
|
+
## [2.7.0] - 2022-04-14
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- Added `radial-tree-chart` illustration.
|
|
20
|
+
|
|
21
|
+
## [2.6.6] - 2022-03-14
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
|
|
25
|
+
- Version patch update due to children dependencies update (`@semcore/utils` [3.31.2 ~> 3.31.2], `@semcore/flex-box` [4.5.0 ~> 4.5.1]).
|
|
26
|
+
|
|
5
27
|
## [2.6.5] - 2022-02-24
|
|
6
28
|
|
|
7
29
|
### Added
|
|
@@ -12,13 +34,13 @@ CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangel
|
|
|
12
34
|
|
|
13
35
|
### Changed
|
|
14
36
|
|
|
15
|
-
-
|
|
37
|
+
- Removed unused dependencies `@semcore/link`, `@semcore/button`.
|
|
16
38
|
|
|
17
39
|
## [2.6.3] - 2022-01-18
|
|
18
40
|
|
|
19
41
|
### Changed
|
|
20
42
|
|
|
21
|
-
-
|
|
43
|
+
- Removed unused dependencies `@semcore/icon`.
|
|
22
44
|
|
|
23
45
|
## [2.6.2] - 2021-8-26
|
|
24
46
|
|
package/lib/cjs/Error/index.js
CHANGED
|
@@ -86,8 +86,7 @@ var Error = /*#__PURE__*/function (_Component) {
|
|
|
86
86
|
(0, _createClass2["default"])(Error, [{
|
|
87
87
|
key: "render",
|
|
88
88
|
value: function render() {
|
|
89
|
-
var _ref = this
|
|
90
|
-
|
|
89
|
+
var _ref = this.asProps;
|
|
91
90
|
var _this$asProps = this.asProps,
|
|
92
91
|
Children = _this$asProps.Children,
|
|
93
92
|
description = _this$asProps.description,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/Error/index.
|
|
1
|
+
{"version":3,"sources":["../../../src/Error/index.jsx"],"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;AACP,0BAA+C,KAAKC,OAApD;AAAA,UAAQC,QAAR,iBAAQA,QAAR;AAAA,UAAkBC,WAAlB,iBAAkBA,WAAlB;AAAA,UAA+BC,WAA/B,iBAA+BA,WAA/B;;AACA,yBAAgDA,WAAW,EAA3D;AAAA,UAAQC,KAAR,gBAAQA,KAAR;AAAA,UAA4BC,eAA5B,gBAAeH,WAAf;;AAEA,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"}
|
package/lib/cjs/NoData/index.js
CHANGED
|
@@ -86,8 +86,7 @@ var NoData = /*#__PURE__*/function (_Component) {
|
|
|
86
86
|
(0, _createClass2["default"])(NoData, [{
|
|
87
87
|
key: "render",
|
|
88
88
|
value: function render() {
|
|
89
|
-
var _ref = this
|
|
90
|
-
|
|
89
|
+
var _ref = this.asProps;
|
|
91
90
|
var _this$asProps = this.asProps,
|
|
92
91
|
Children = _this$asProps.Children,
|
|
93
92
|
type = _this$asProps.type,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/NoData/index.
|
|
1
|
+
{"version":3,"sources":["../../../src/NoData/index.jsx"],"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;AACP,0BAAqD,KAAKC,OAA1D;AAAA,UAAQC,QAAR,iBAAQA,QAAR;AAAA,UAAkBC,IAAlB,iBAAkBA,IAAlB;AAAA,UAAwBC,WAAxB,iBAAwBA,WAAxB;AAAA,UAAqCC,WAArC,iBAAqCA,WAArC;;AACA,yBAAgDA,WAAW,EAA3D;AAAA,UAAQC,KAAR,gBAAQA,KAAR;AAAA,UAA4BC,eAA5B,gBAAeH,WAAf;;AACA,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;;;EAlBkBE,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;;eAkBT,sBAAgBH,MAAhB,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 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 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"}
|
package/lib/cjs/WidgetEmpty.js
CHANGED
|
@@ -29,8 +29,6 @@ var _flexBox = require("@semcore/flex-box");
|
|
|
29
29
|
|
|
30
30
|
var _isNode = _interopRequireDefault(require("@semcore/utils/lib/isNode"));
|
|
31
31
|
|
|
32
|
-
var _this = void 0;
|
|
33
|
-
|
|
34
32
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
35
33
|
|
|
36
34
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -48,17 +46,17 @@ var style = (
|
|
|
48
46
|
/*__reshadow_css_start__*/
|
|
49
47
|
_core.sstyled.insert(
|
|
50
48
|
/*__inner_css_start__*/
|
|
51
|
-
".
|
|
49
|
+
".___SWidgetEmpty_lxb2f_gg_{flex-direction:column;justify-content:center;align-items:center;margin-bottom:16px}.___SImage_lxb2f_gg_{display:flex;align-items:flex-end;justify-content:center;margin-bottom:12px}.___STitle_lxb2f_gg_{color:#6c6e79}.___STitle_lxb2f_gg_{font-size:16px;line-height:1.5;font-weight:700}.___SDescription_lxb2f_gg_{text-align:center;font-size:14px;line-height:1.42;color:#6c6e79;max-width:400px}.___STitle_lxb2f_gg_+.___SDescription_lxb2f_gg_{margin-top:4px}.___SDescription_lxb2f_gg_+.___SDescription_lxb2f_gg_{margin-top:8px}"
|
|
52
50
|
/*__inner_css_end__*/
|
|
53
|
-
, "
|
|
51
|
+
, "p56ifs_gg_")
|
|
54
52
|
/*__reshadow_css_end__*/
|
|
55
53
|
, {
|
|
56
|
-
"__SWidgetEmpty": "
|
|
57
|
-
"__SImage": "
|
|
58
|
-
"__STitle": "
|
|
59
|
-
"__SDescription": "
|
|
54
|
+
"__SWidgetEmpty": "___SWidgetEmpty_lxb2f_gg_",
|
|
55
|
+
"__SImage": "___SImage_lxb2f_gg_",
|
|
56
|
+
"__STitle": "___STitle_lxb2f_gg_",
|
|
57
|
+
"__SDescription": "___SDescription_lxb2f_gg_"
|
|
60
58
|
});
|
|
61
|
-
var version = "
|
|
59
|
+
var version = "3.0.0";
|
|
62
60
|
|
|
63
61
|
var getIconPath = function getIconPath(name) {
|
|
64
62
|
return "https://static.semrush.com/ui-kit/widget-empty/".concat(version, "/").concat(name, ".svg");
|
|
@@ -79,7 +77,7 @@ var WidgetEmpty = /*#__PURE__*/function (_Component) {
|
|
|
79
77
|
(0, _createClass2["default"])(WidgetEmpty, [{
|
|
80
78
|
key: "render",
|
|
81
79
|
value: function render() {
|
|
82
|
-
var _ref = this
|
|
80
|
+
var _ref = this.asProps,
|
|
83
81
|
_ref4;
|
|
84
82
|
|
|
85
83
|
var SWidgetEmpty = _flexBox.Flex;
|
|
@@ -103,7 +101,7 @@ var WidgetEmpty = /*#__PURE__*/function (_Component) {
|
|
|
103
101
|
(0, _defineProperty2["default"])(WidgetEmpty, "style", style);
|
|
104
102
|
|
|
105
103
|
var Title = function Title(props) {
|
|
106
|
-
var _ref2 =
|
|
104
|
+
var _ref2 = arguments[0],
|
|
107
105
|
_ref5;
|
|
108
106
|
|
|
109
107
|
var STitle = _flexBox.Box;
|
|
@@ -112,7 +110,7 @@ var Title = function Title(props) {
|
|
|
112
110
|
};
|
|
113
111
|
|
|
114
112
|
var Description = function Description(props) {
|
|
115
|
-
var _ref3 =
|
|
113
|
+
var _ref3 = arguments[0],
|
|
116
114
|
_ref6;
|
|
117
115
|
|
|
118
116
|
var SDescription = _flexBox.Box;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/WidgetEmpty.
|
|
1
|
+
{"version":3,"sources":["../../src/WidgetEmpty.jsx"],"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,EAAU;AACnC,kEAAyDF,OAAzD,cAAoEE,IAApE;AACD,CAFM;;;;IAIDC,W;;;;;;;;;;;;WAIJ,kBAAS;AAAA;AAAA;;AACP,UAAMC,YAAY,GAKMC,aALxB;AACA,0BAAmC,KAAKC,OAAxC;AAAA,UAAQC,QAAR,iBAAQA,QAAR;AAAA,UAAkBC,IAAlB,iBAAkBA,IAAlB;AAAA,UAAwBC,MAAxB,iBAAwBA,MAAxB;AACA,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;AACA,MAAQP,MAAR,GAAmBK,KAAnB,CAAQL,MAAR;AACA,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;AACA,MAAQP,MAAR,GAAmBK,KAAnB,CAAQL,MAAR;AACA,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 return `https://static.semrush.com/ui-kit/widget-empty/${version}/${name}.svg`;\n};\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"}
|
|
@@ -0,0 +1,71 @@
|
|
|
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
|
+
| 'coffee'
|
|
10
|
+
| 'combined-chart'
|
|
11
|
+
| 'congrats'
|
|
12
|
+
| 'deleted-page'
|
|
13
|
+
| 'donut-chart'
|
|
14
|
+
| 'duplicates'
|
|
15
|
+
| 'funnel-chart'
|
|
16
|
+
| 'good'
|
|
17
|
+
| 'heat-map-chart'
|
|
18
|
+
| 'horizontal-bar-chart'
|
|
19
|
+
| 'kagi-chart'
|
|
20
|
+
| 'line-chart'
|
|
21
|
+
| 'lollipop-chart'
|
|
22
|
+
| 'nexttime'
|
|
23
|
+
| 'nothing-found'
|
|
24
|
+
| 'other-data'
|
|
25
|
+
| 'pie-chart'
|
|
26
|
+
| 'processing'
|
|
27
|
+
| 'radar-chart'
|
|
28
|
+
| 'radial-tree-chart'
|
|
29
|
+
| 'sankey-chart'
|
|
30
|
+
| 'scatter-plot-chart'
|
|
31
|
+
| 'stacked-area-chart'
|
|
32
|
+
| 'suggestion'
|
|
33
|
+
| 'suggestions'
|
|
34
|
+
| 'table'
|
|
35
|
+
| 'tag-cloud'
|
|
36
|
+
| 'text-links-etc'
|
|
37
|
+
| 'under-construction'
|
|
38
|
+
| 'venn-chart'
|
|
39
|
+
| 'vertical-bar-chart'
|
|
40
|
+
| 'warning';
|
|
41
|
+
|
|
42
|
+
export interface IWidgetEmptyProps extends IFlexProps {
|
|
43
|
+
/**
|
|
44
|
+
* URL before the icon or the whole component
|
|
45
|
+
*/
|
|
46
|
+
icon?: React.ReactNode;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface IWidgetErrorProps extends IWidgetEmptyProps, IWithI18nEnhanceProps {
|
|
50
|
+
/** Error description. If it is absent, use the local default one */
|
|
51
|
+
description?: React.ReactNode;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface IWidgetNoDataProps extends IWidgetEmptyProps, IWithI18nEnhanceProps {
|
|
55
|
+
/** Error description. If it is absent, use the local default one */
|
|
56
|
+
description?: React.ReactNode;
|
|
57
|
+
/* Data types */
|
|
58
|
+
type?: iconNames;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
declare const WidgetEmpty: (<T>(props: CProps<IWidgetEmptyProps> & T) => ReturnEl) & {
|
|
62
|
+
Title: <T>(props: ComponentProps<typeof Box> & T) => ReturnEl;
|
|
63
|
+
Description: <T>(props: ComponentProps<typeof Box> & T) => ReturnEl;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
declare const NoData: <T>(props: CProps<IWidgetNoDataProps> & T) => ReturnEl;
|
|
67
|
+
declare const Error: <T>(props: CProps<IWidgetErrorProps> & T) => ReturnEl;
|
|
68
|
+
declare const getIconPath: (name: string) => string;
|
|
69
|
+
|
|
70
|
+
export default WidgetEmpty;
|
|
71
|
+
export { getIconPath, NoData, Error };
|
package/lib/cjs/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
6
|
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -42,33 +44,9 @@ Object.keys(_WidgetEmpty).forEach(function (key) {
|
|
|
42
44
|
});
|
|
43
45
|
});
|
|
44
46
|
|
|
45
|
-
var _NoData =
|
|
46
|
-
|
|
47
|
-
Object.keys(_NoData).forEach(function (key) {
|
|
48
|
-
if (key === "default" || key === "__esModule") return;
|
|
49
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
50
|
-
if (key in exports && exports[key] === _NoData[key]) return;
|
|
51
|
-
Object.defineProperty(exports, key, {
|
|
52
|
-
enumerable: true,
|
|
53
|
-
get: function get() {
|
|
54
|
-
return _NoData[key];
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
});
|
|
47
|
+
var _NoData = _interopRequireDefault(require("./NoData"));
|
|
58
48
|
|
|
59
|
-
var _Error =
|
|
60
|
-
|
|
61
|
-
Object.keys(_Error).forEach(function (key) {
|
|
62
|
-
if (key === "default" || key === "__esModule") return;
|
|
63
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
64
|
-
if (key in exports && exports[key] === _Error[key]) return;
|
|
65
|
-
Object.defineProperty(exports, key, {
|
|
66
|
-
enumerable: true,
|
|
67
|
-
get: function get() {
|
|
68
|
-
return _Error[key];
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
});
|
|
49
|
+
var _Error = _interopRequireDefault(require("./Error"));
|
|
72
50
|
|
|
73
51
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
74
52
|
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAEA;;AAEA","sourcesContent":["export { default } from './WidgetEmpty';\nexport * from './WidgetEmpty';\n\nexport { default as NoData } from './NoData';\n\nexport { default as Error } from './Error';\n"],"file":"index.js"}
|
|
@@ -15,7 +15,7 @@ SImage {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
STitle {
|
|
18
|
-
color: var(--
|
|
18
|
+
color: var(--gray-500);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
STitle {
|
|
@@ -28,7 +28,7 @@ SDescription {
|
|
|
28
28
|
text-align: center;
|
|
29
29
|
font-size: var(--fs-200);
|
|
30
30
|
line-height: var(--lh-200);
|
|
31
|
-
color: var(--
|
|
31
|
+
color: var(--gray-500);
|
|
32
32
|
max-width: 400px;
|
|
33
33
|
}
|
|
34
34
|
|
package/lib/es6/Error/index.js
CHANGED
|
@@ -53,8 +53,7 @@ var Error = /*#__PURE__*/function (_Component) {
|
|
|
53
53
|
_createClass(Error, [{
|
|
54
54
|
key: "render",
|
|
55
55
|
value: function render() {
|
|
56
|
-
var _ref = this
|
|
57
|
-
|
|
56
|
+
var _ref = this.asProps;
|
|
58
57
|
var _this$asProps = this.asProps,
|
|
59
58
|
Children = _this$asProps.Children,
|
|
60
59
|
description = _this$asProps.description,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/Error/index.
|
|
1
|
+
{"version":3,"sources":["../../../src/Error/index.jsx"],"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;AACP,0BAA+C,KAAKC,OAApD;AAAA,UAAQC,QAAR,iBAAQA,QAAR;AAAA,UAAkBC,WAAlB,iBAAkBA,WAAlB;AAAA,UAA+BC,WAA/B,iBAA+BA,WAA/B;;AACA,yBAAgDA,WAAW,EAA3D;AAAA,UAAQC,KAAR,gBAAQA,KAAR;AAAA,UAA4BC,eAA5B,gBAAeH,WAAf;;AAEA,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"}
|
package/lib/es6/NoData/index.js
CHANGED
|
@@ -53,8 +53,7 @@ var NoData = /*#__PURE__*/function (_Component) {
|
|
|
53
53
|
_createClass(NoData, [{
|
|
54
54
|
key: "render",
|
|
55
55
|
value: function render() {
|
|
56
|
-
var _ref = this
|
|
57
|
-
|
|
56
|
+
var _ref = this.asProps;
|
|
58
57
|
var _this$asProps = this.asProps,
|
|
59
58
|
Children = _this$asProps.Children,
|
|
60
59
|
type = _this$asProps.type,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/NoData/index.
|
|
1
|
+
{"version":3,"sources":["../../../src/NoData/index.jsx"],"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,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,M;;;;;;;;;;;;;WAQJ,kBAAS;AAAA;AACP,0BAAqD,KAAKC,OAA1D;AAAA,UAAQC,QAAR,iBAAQA,QAAR;AAAA,UAAkBC,IAAlB,iBAAkBA,IAAlB;AAAA,UAAwBC,WAAxB,iBAAwBA,WAAxB;AAAA,UAAqCC,WAArC,iBAAqCA,WAArC;;AACA,yBAAgDA,WAAW,EAA3D;AAAA,UAAQC,KAAR,gBAAQA,KAAR;AAAA,UAA4BC,eAA5B,gBAAeH,WAAf;;AACA,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;;;;EAlBkBtB,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;;AAkBxB,eAAenB,eAAe,CAACgB,MAAD,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 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 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"}
|
package/lib/es6/WidgetEmpty.js
CHANGED
|
@@ -9,8 +9,6 @@ import { assignProps as _assignProps3 } from "@semcore/core";
|
|
|
9
9
|
import { assignProps as _assignProps2 } from "@semcore/core";
|
|
10
10
|
import { assignProps as _assignProps } from "@semcore/core";
|
|
11
11
|
|
|
12
|
-
var _this = this;
|
|
13
|
-
|
|
14
12
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
15
13
|
|
|
16
14
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -29,17 +27,17 @@ var style = (
|
|
|
29
27
|
/*__reshadow_css_start__*/
|
|
30
28
|
_sstyled.insert(
|
|
31
29
|
/*__inner_css_start__*/
|
|
32
|
-
".
|
|
30
|
+
".___SWidgetEmpty_lxb2f_gg_{flex-direction:column;justify-content:center;align-items:center;margin-bottom:16px}.___SImage_lxb2f_gg_{display:flex;align-items:flex-end;justify-content:center;margin-bottom:12px}.___STitle_lxb2f_gg_{color:#6c6e79}.___STitle_lxb2f_gg_{font-size:16px;line-height:1.5;font-weight:700}.___SDescription_lxb2f_gg_{text-align:center;font-size:14px;line-height:1.42;color:#6c6e79;max-width:400px}.___STitle_lxb2f_gg_+.___SDescription_lxb2f_gg_{margin-top:4px}.___SDescription_lxb2f_gg_+.___SDescription_lxb2f_gg_{margin-top:8px}"
|
|
33
31
|
/*__inner_css_end__*/
|
|
34
|
-
, "
|
|
32
|
+
, "p56ifs_gg_")
|
|
35
33
|
/*__reshadow_css_end__*/
|
|
36
34
|
, {
|
|
37
|
-
"__SWidgetEmpty": "
|
|
38
|
-
"__SImage": "
|
|
39
|
-
"__STitle": "
|
|
40
|
-
"__SDescription": "
|
|
35
|
+
"__SWidgetEmpty": "___SWidgetEmpty_lxb2f_gg_",
|
|
36
|
+
"__SImage": "___SImage_lxb2f_gg_",
|
|
37
|
+
"__STitle": "___STitle_lxb2f_gg_",
|
|
38
|
+
"__SDescription": "___SDescription_lxb2f_gg_"
|
|
41
39
|
});
|
|
42
|
-
var version = "
|
|
40
|
+
var version = "3.0.0";
|
|
43
41
|
export var getIconPath = function getIconPath(name) {
|
|
44
42
|
return "https://static.semrush.com/ui-kit/widget-empty/".concat(version, "/").concat(name, ".svg");
|
|
45
43
|
};
|
|
@@ -58,7 +56,7 @@ var WidgetEmpty = /*#__PURE__*/function (_Component) {
|
|
|
58
56
|
_createClass(WidgetEmpty, [{
|
|
59
57
|
key: "render",
|
|
60
58
|
value: function render() {
|
|
61
|
-
var _ref = this
|
|
59
|
+
var _ref = this.asProps,
|
|
62
60
|
_ref4;
|
|
63
61
|
|
|
64
62
|
var SWidgetEmpty = Flex;
|
|
@@ -84,7 +82,7 @@ _defineProperty(WidgetEmpty, "displayName", 'WidgetEmpty');
|
|
|
84
82
|
_defineProperty(WidgetEmpty, "style", style);
|
|
85
83
|
|
|
86
84
|
var Title = function Title(props) {
|
|
87
|
-
var _ref2 =
|
|
85
|
+
var _ref2 = arguments[0],
|
|
88
86
|
_ref5;
|
|
89
87
|
|
|
90
88
|
var STitle = Box;
|
|
@@ -93,7 +91,7 @@ var Title = function Title(props) {
|
|
|
93
91
|
};
|
|
94
92
|
|
|
95
93
|
var Description = function Description(props) {
|
|
96
|
-
var _ref3 =
|
|
94
|
+
var _ref3 = arguments[0],
|
|
97
95
|
_ref6;
|
|
98
96
|
|
|
99
97
|
var SDescription = Box;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/WidgetEmpty.
|
|
1
|
+
{"version":3,"sources":["../../src/WidgetEmpty.jsx"],"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,EAAU;AACnC,kEAAyDF,OAAzD,cAAoEE,IAApE;AACD,CAFM;;IAIDC,W;;;;;;;;;;;;;WAIJ,kBAAS;AAAA;AAAA;;AACP,UAAMC,YAAY,GAKMN,IALxB;AACA,0BAAmC,KAAKO,OAAxC;AAAA,UAAQC,QAAR,iBAAQA,QAAR;AAAA,UAAkBC,IAAlB,iBAAkBA,IAAlB;AAAA,UAAwBC,MAAxB,iBAAwBA,MAAxB;AACA,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;AACA,MAAQW,MAAR,GAAmBI,KAAnB,CAAQJ,MAAR;AACA,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;AACA,MAAQW,MAAR,GAAmBI,KAAnB,CAAQJ,MAAR;AACA,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 return `https://static.semrush.com/ui-kit/widget-empty/${version}/${name}.svg`;\n};\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"}
|
|
@@ -0,0 +1,71 @@
|
|
|
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
|
+
| 'coffee'
|
|
10
|
+
| 'combined-chart'
|
|
11
|
+
| 'congrats'
|
|
12
|
+
| 'deleted-page'
|
|
13
|
+
| 'donut-chart'
|
|
14
|
+
| 'duplicates'
|
|
15
|
+
| 'funnel-chart'
|
|
16
|
+
| 'good'
|
|
17
|
+
| 'heat-map-chart'
|
|
18
|
+
| 'horizontal-bar-chart'
|
|
19
|
+
| 'kagi-chart'
|
|
20
|
+
| 'line-chart'
|
|
21
|
+
| 'lollipop-chart'
|
|
22
|
+
| 'nexttime'
|
|
23
|
+
| 'nothing-found'
|
|
24
|
+
| 'other-data'
|
|
25
|
+
| 'pie-chart'
|
|
26
|
+
| 'processing'
|
|
27
|
+
| 'radar-chart'
|
|
28
|
+
| 'radial-tree-chart'
|
|
29
|
+
| 'sankey-chart'
|
|
30
|
+
| 'scatter-plot-chart'
|
|
31
|
+
| 'stacked-area-chart'
|
|
32
|
+
| 'suggestion'
|
|
33
|
+
| 'suggestions'
|
|
34
|
+
| 'table'
|
|
35
|
+
| 'tag-cloud'
|
|
36
|
+
| 'text-links-etc'
|
|
37
|
+
| 'under-construction'
|
|
38
|
+
| 'venn-chart'
|
|
39
|
+
| 'vertical-bar-chart'
|
|
40
|
+
| 'warning';
|
|
41
|
+
|
|
42
|
+
export interface IWidgetEmptyProps extends IFlexProps {
|
|
43
|
+
/**
|
|
44
|
+
* URL before the icon or the whole component
|
|
45
|
+
*/
|
|
46
|
+
icon?: React.ReactNode;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface IWidgetErrorProps extends IWidgetEmptyProps, IWithI18nEnhanceProps {
|
|
50
|
+
/** Error description. If it is absent, use the local default one */
|
|
51
|
+
description?: React.ReactNode;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface IWidgetNoDataProps extends IWidgetEmptyProps, IWithI18nEnhanceProps {
|
|
55
|
+
/** Error description. If it is absent, use the local default one */
|
|
56
|
+
description?: React.ReactNode;
|
|
57
|
+
/* Data types */
|
|
58
|
+
type?: iconNames;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
declare const WidgetEmpty: (<T>(props: CProps<IWidgetEmptyProps> & T) => ReturnEl) & {
|
|
62
|
+
Title: <T>(props: ComponentProps<typeof Box> & T) => ReturnEl;
|
|
63
|
+
Description: <T>(props: ComponentProps<typeof Box> & T) => ReturnEl;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
declare const NoData: <T>(props: CProps<IWidgetNoDataProps> & T) => ReturnEl;
|
|
67
|
+
declare const Error: <T>(props: CProps<IWidgetErrorProps> & T) => ReturnEl;
|
|
68
|
+
declare const getIconPath: (name: string) => string;
|
|
69
|
+
|
|
70
|
+
export default WidgetEmpty;
|
|
71
|
+
export { getIconPath, NoData, Error };
|
package/lib/es6/index.js
CHANGED
package/lib/es6/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;AAEA,SAASD,OAAO,IAAIE,KAApB,QAAiC,SAAjC","sourcesContent":["export { default } from './WidgetEmpty';\nexport * from './WidgetEmpty';\n\nexport { default as NoData } from './NoData';\n\nexport { default as Error } from './Error';\n"],"file":"index.js"}
|
|
@@ -15,7 +15,7 @@ SImage {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
STitle {
|
|
18
|
-
color: var(--
|
|
18
|
+
color: var(--gray-500);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
STitle {
|
|
@@ -28,7 +28,7 @@ SDescription {
|
|
|
28
28
|
text-align: center;
|
|
29
29
|
font-size: var(--fs-200);
|
|
30
30
|
line-height: var(--lh-200);
|
|
31
|
-
color: var(--
|
|
31
|
+
color: var(--gray-500);
|
|
32
32
|
max-width: 400px;
|
|
33
33
|
}
|
|
34
34
|
|
package/lib/types/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { IWithI18nEnhanceProps } from '@semcore/utils/lib/enhances/i18nEnhance';
|
|
|
6
6
|
export type iconNames =
|
|
7
7
|
| 'area-chart'
|
|
8
8
|
| 'choropleth-map-chart'
|
|
9
|
+
| 'coffee'
|
|
9
10
|
| 'combined-chart'
|
|
10
11
|
| 'congrats'
|
|
11
12
|
| 'deleted-page'
|
|
@@ -13,7 +14,9 @@ export type iconNames =
|
|
|
13
14
|
| 'duplicates'
|
|
14
15
|
| 'funnel-chart'
|
|
15
16
|
| 'good'
|
|
17
|
+
| 'heat-map-chart'
|
|
16
18
|
| 'horizontal-bar-chart'
|
|
19
|
+
| 'kagi-chart'
|
|
17
20
|
| 'line-chart'
|
|
18
21
|
| 'lollipop-chart'
|
|
19
22
|
| 'nexttime'
|
|
@@ -22,13 +25,16 @@ export type iconNames =
|
|
|
22
25
|
| 'pie-chart'
|
|
23
26
|
| 'processing'
|
|
24
27
|
| 'radar-chart'
|
|
28
|
+
| 'radial-tree-chart'
|
|
25
29
|
| 'sankey-chart'
|
|
26
30
|
| 'scatter-plot-chart'
|
|
27
31
|
| 'stacked-area-chart'
|
|
32
|
+
| 'suggestion'
|
|
28
33
|
| 'suggestions'
|
|
29
34
|
| 'table'
|
|
30
35
|
| 'tag-cloud'
|
|
31
36
|
| 'text-links-etc'
|
|
37
|
+
| 'under-construction'
|
|
32
38
|
| 'venn-chart'
|
|
33
39
|
| 'vertical-bar-chart'
|
|
34
40
|
| 'warning';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/widget-empty",
|
|
3
3
|
"description": "SEMRush WidgetEmpty Component",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "3.0.0",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"scripts": {
|
|
12
12
|
"build": "build --source=js",
|
|
13
13
|
"test": "jest",
|
|
14
|
-
"
|
|
14
|
+
"upload-static": "gcs-upload svg/*.svg"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@semcore/utils": "^3.27",
|
|
@@ -28,5 +28,8 @@
|
|
|
28
28
|
"type": "git",
|
|
29
29
|
"url": "https://github.com/semrush/intergalactic.git",
|
|
30
30
|
"directory": "semcore/widget-empty"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@semcore/jest-preset-ui": "1.0.0"
|
|
31
34
|
}
|
|
32
35
|
}
|
|
File without changes
|