@semcore/widget-empty 3.1.0 → 3.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/README.md +67 -0
- package/lib/cjs/Error/index.js.map +1 -1
- package/lib/cjs/NoData/index.js.map +1 -1
- package/lib/cjs/WidgetEmpty.js +7 -7
- package/lib/cjs/WidgetEmpty.js.map +1 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/es6/Error/index.js.map +1 -1
- package/lib/es6/NoData/index.js.map +1 -1
- package/lib/es6/WidgetEmpty.js +7 -7
- package/lib/es6/WidgetEmpty.js.map +1 -1
- package/lib/es6/index.js.map +1 -1
- package/package.json +3 -3
- package/svg/area-chart.svg +12 -5
- package/svg/choropleth-map-chart.svg +14 -4
- package/svg/combined-chart.svg +22 -5
- package/svg/congrats.svg +26 -3
- package/svg/donut-chart.svg +17 -6
- package/svg/funnel-chart.svg +17 -3
- package/svg/heat-map-chart.svg +26 -11
- package/svg/horizontal-bar-chart.svg +18 -6
- package/svg/kagi-chart.svg +10 -2
- package/svg/line-chart.svg +11 -4
- package/svg/lollipop-chart.svg +13 -10
- package/svg/nothing-found.svg +20 -4
- package/svg/pie-chart.svg +15 -5
- package/svg/radar-chart.svg +17 -16
- package/svg/sankey-chart.svg +16 -8
- package/svg/scatter-plot-chart.svg +19 -7
- package/svg/stacked-area-chart.svg +16 -9
- package/svg/tag-cloud.svg +25 -3
- package/svg/venn-chart.svg +19 -10
- package/svg/vertical-bar-chart.svg +13 -5
- package/src/Error/index.jsx +0 -40
- package/src/Error/translations/de.json +0 -4
- package/src/Error/translations/en.json +0 -4
- package/src/Error/translations/es.json +0 -4
- package/src/Error/translations/fr.json +0 -4
- package/src/Error/translations/it.json +0 -4
- package/src/Error/translations/ja.json +0 -4
- package/src/Error/translations/ko.json +0 -4
- package/src/Error/translations/pt.json +0 -4
- package/src/Error/translations/ru.json +0 -4
- package/src/Error/translations/vi.json +0 -4
- package/src/Error/translations/zh.json +0 -4
- package/src/NoData/index.jsx +0 -40
- package/src/NoData/translations/de.json +0 -4
- package/src/NoData/translations/en.json +0 -4
- package/src/NoData/translations/es.json +0 -4
- package/src/NoData/translations/fr.json +0 -4
- package/src/NoData/translations/it.json +0 -4
- package/src/NoData/translations/ja.json +0 -4
- package/src/NoData/translations/ko.json +0 -4
- package/src/NoData/translations/pt.json +0 -4
- package/src/NoData/translations/ru.json +0 -4
- package/src/NoData/translations/vi.json +0 -4
- package/src/NoData/translations/zh.json +0 -4
- package/src/WidgetEmpty.jsx +0 -57
- package/src/index.d.ts +0 -71
- package/src/index.js +0 -6
- package/src/style/widget-empty.shadow.css +0 -41
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
<svg width="
|
|
2
|
-
<path d="
|
|
3
|
-
<path
|
|
4
|
-
<path d="
|
|
5
|
-
<path d="
|
|
1
|
+
<svg width="80" height="80" viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M40.58 79C62 78.73 79 60.87 79 39.4V2a1 1 0 0 0-.99-.99H53.99A1 1 0 0 0 53 2v2.7H27.99a1 1 0 0 0-.99.99v34.35H1.99a1 1 0 0 0-.99 1A39.17 39.17 0 0 0 40.58 79Z" fill="#E0E1E9"/>
|
|
3
|
+
<path d="M65.92 57.6s.1-.05.12-.08l6.5-4.32-3.14-1.7-3.13.76-8.3-31.68a5.7 5.7 0 0 0-6.68-4.15L11.7 24.5l-1.4-3.12-3.4 5.88a6.5 6.5 0 0 0-.22.37v.02a5.64 5.64 0 0 0-.46 4.25l10.44 36.64a2.59 2.59 0 0 0 3.18 1.8L65.11 58c.27-.08.52-.2.75-.35l.05-.03.01-.01Z" fill="#E0E1E9" stroke="#6C6E79" stroke-width=".7" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
+
<path d="m71.76 53.55-47.67 13a2.73 2.73 0 0 1-3.35-1.89l-11-38.59a6.03 6.03 0 0 1 4.6-7.55l42.88-8.75a6.02 6.02 0 0 1 7.02 4.38l9.45 36.07a2.73 2.73 0 0 1-1.93 3.33Z" fill="#fff"/>
|
|
5
|
+
<path d="M65.45 18.82 11.07 30.76l-1.34-4.69a6.03 6.03 0 0 1 4.6-7.55L57.2 9.77a6.02 6.02 0 0 1 7.02 4.38l1.22 4.67Z" fill="#6C6E79"/>
|
|
6
|
+
<path d="M18.4 23.42a1.87 1.87 0 0 1-1.42 2.37 2.19 2.19 0 0 1-2.53-1.53 1.87 1.87 0 0 1 1.43-2.37 2.2 2.2 0 0 1 2.51 1.54v-.01Z" fill="#fff"/>
|
|
7
|
+
<path d="M25.38 21.94c.29 1.06-.33 2.1-1.4 2.33a2.15 2.15 0 0 1-2.47-1.52 1.85 1.85 0 0 1 1.4-2.35 2.14 2.14 0 0 1 2.47 1.53Z" fill="#E0E1E9"/>
|
|
8
|
+
<path d="M11.09 30.84s.32-3.15.6-6.38l-1.37-3.09-3.42 5.88a6.5 6.5 0 0 0-.21.37v.02a5.64 5.64 0 0 0-.46 4.25l1.4 4.9 3.46-5.96v.01Z" fill="#6C6E79"/>
|
|
9
|
+
<path d="m71.76 53.55-47.67 13a2.73 2.73 0 0 1-3.35-1.89l-11-38.59a6.03 6.03 0 0 1 4.6-7.55l42.88-8.75a6.02 6.02 0 0 1 7.02 4.38l9.45 36.07a2.73 2.73 0 0 1-1.93 3.33Z" stroke="#6C6E79" stroke-width=".7" stroke-linecap="round" stroke-linejoin="round"/>
|
|
10
|
+
<path d="m34 41.8-7.06 1.71a.8.8 0 0 0-.57.99l3.34 11.92 8.5-2.22-3.27-11.84a.8.8 0 0 0-.95-.56H34Z" stroke="#6C6E79" stroke-width=".7" stroke-linecap="round" stroke-linejoin="round"/>
|
|
11
|
+
<path d="M44.22 28.76 37.4 30.3c-.45.1-.7.54-.59.99L42.8 53 51 50.87l-5.83-21.55a.78.78 0 0 0-.94-.56h-.01Z" fill="#6C6E79" stroke="#6C6E79" stroke-width=".7" stroke-linecap="round" stroke-linejoin="round"/>
|
|
12
|
+
<path d="m58.28 31.6-6.49 1.52c-.43.1-.7.54-.58.97l4.19 15.64 7.93-2.06-4.1-15.5a.79.79 0 0 0-.93-.56h-.02Z" fill="#E0E1E9" stroke="#6C6E79" stroke-width=".7" stroke-linecap="round" stroke-linejoin="round"/>
|
|
13
|
+
<path d="M23.36 61.28 70.2 48.9M27.56 48.6l4.3-6.28M35.5 44.76l-6.42 9.36M33.5 55.42l3.6-5.25" stroke="#6C6E79" stroke-width=".7" stroke-linecap="round" stroke-linejoin="round"/>
|
|
6
14
|
</svg>
|
package/src/Error/index.jsx
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
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
|
-
import de from './translations/de.json';
|
|
6
|
-
import en from './translations/en.json';
|
|
7
|
-
import es from './translations/es.json';
|
|
8
|
-
import fr from './translations/fr.json';
|
|
9
|
-
import it from './translations/it.json';
|
|
10
|
-
import ja from './translations/ja.json';
|
|
11
|
-
import pt from './translations/pt.json';
|
|
12
|
-
import ru from './translations/ru.json';
|
|
13
|
-
import zh from './translations/zh.json';
|
|
14
|
-
import ko from './translations/ko.json';
|
|
15
|
-
import vi from './translations/vi.json';
|
|
16
|
-
|
|
17
|
-
const i18n = { de, en, es, fr, it, ja, ru, zh, pt, ko, vi };
|
|
18
|
-
|
|
19
|
-
class Error extends Component {
|
|
20
|
-
static displayName = 'WidgetError';
|
|
21
|
-
static defaultProps = {
|
|
22
|
-
i18n,
|
|
23
|
-
};
|
|
24
|
-
static enhance = [i18nEnhance()];
|
|
25
|
-
|
|
26
|
-
render() {
|
|
27
|
-
const { Children, description, getI18nText } = this.asProps;
|
|
28
|
-
const { title, description: descriptionText } = getI18nText();
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<Root render={WidgetEmpty} icon={getIconPath('warning')}>
|
|
32
|
-
<WidgetEmpty.Title>{title}</WidgetEmpty.Title>
|
|
33
|
-
<WidgetEmpty.Description>{description || descriptionText}</WidgetEmpty.Description>
|
|
34
|
-
<Children />
|
|
35
|
-
</Root>
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export default createComponent(Error);
|
package/src/NoData/index.jsx
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
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
|
-
import de from './translations/de.json';
|
|
6
|
-
import en from './translations/en.json';
|
|
7
|
-
import es from './translations/es.json';
|
|
8
|
-
import fr from './translations/fr.json';
|
|
9
|
-
import it from './translations/it.json';
|
|
10
|
-
import ja from './translations/ja.json';
|
|
11
|
-
import pt from './translations/pt.json';
|
|
12
|
-
import ru from './translations/ru.json';
|
|
13
|
-
import zh from './translations/zh.json';
|
|
14
|
-
import ko from './translations/ko.json';
|
|
15
|
-
import vi from './translations/vi.json';
|
|
16
|
-
|
|
17
|
-
const i18n = { de, en, es, fr, it, ja, ru, zh, pt, ko, vi };
|
|
18
|
-
|
|
19
|
-
class NoData extends Component {
|
|
20
|
-
static displayName = 'WidgetNoData';
|
|
21
|
-
static enhance = [i18nEnhance()];
|
|
22
|
-
static defaultProps = {
|
|
23
|
-
i18n,
|
|
24
|
-
type: 'other-data',
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
render() {
|
|
28
|
-
const { Children, type, description, getI18nText } = this.asProps;
|
|
29
|
-
const { title, description: descriptionText } = getI18nText();
|
|
30
|
-
return (
|
|
31
|
-
<Root render={WidgetEmpty} icon={getIconPath(type)}>
|
|
32
|
-
<WidgetEmpty.Title>{title}</WidgetEmpty.Title>
|
|
33
|
-
<WidgetEmpty.Description>{description || descriptionText}</WidgetEmpty.Description>
|
|
34
|
-
<Children />
|
|
35
|
-
</Root>
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export default createComponent(NoData);
|
package/src/WidgetEmpty.jsx
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
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
|
-
return `https://static.semrush.com/ui-kit/widget-empty/${version}/${name}.svg`;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
class WidgetEmpty extends Component {
|
|
17
|
-
static displayName = 'WidgetEmpty';
|
|
18
|
-
static style = style;
|
|
19
|
-
|
|
20
|
-
render() {
|
|
21
|
-
const SWidgetEmpty = Root;
|
|
22
|
-
const { Children, icon, styles } = this.asProps;
|
|
23
|
-
const SImage = 'div';
|
|
24
|
-
|
|
25
|
-
return sstyled(styles)(
|
|
26
|
-
<SWidgetEmpty render={Flex}>
|
|
27
|
-
{isNode(icon) && (
|
|
28
|
-
<SImage>
|
|
29
|
-
{typeof icon === 'string' ? (
|
|
30
|
-
<img src={icon} alt="widget empty icon" width={100} height={72} />
|
|
31
|
-
) : (
|
|
32
|
-
icon
|
|
33
|
-
)}
|
|
34
|
-
</SImage>
|
|
35
|
-
)}
|
|
36
|
-
<Children />
|
|
37
|
-
</SWidgetEmpty>,
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const Title = (props) => {
|
|
43
|
-
const STitle = Root;
|
|
44
|
-
const { styles } = props;
|
|
45
|
-
return sstyled(styles)(<STitle render={Box} />);
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const Description = (props) => {
|
|
49
|
-
const SDescription = Root;
|
|
50
|
-
const { styles } = props;
|
|
51
|
-
return sstyled(styles)(<SDescription render={Box} />);
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export default createComponent(WidgetEmpty, {
|
|
55
|
-
Title,
|
|
56
|
-
Description,
|
|
57
|
-
});
|
package/src/index.d.ts
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
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 iconNamesWidgetEmpty =
|
|
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?: iconNamesWidgetEmpty;
|
|
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/src/index.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
@import '@semcore/utils/style/var.css';
|
|
2
|
-
|
|
3
|
-
SWidgetEmpty {
|
|
4
|
-
flex-direction: column;
|
|
5
|
-
justify-content: center;
|
|
6
|
-
align-items: center;
|
|
7
|
-
margin-bottom: 16px;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
SImage {
|
|
11
|
-
display: flex;
|
|
12
|
-
align-items: flex-end;
|
|
13
|
-
justify-content: center;
|
|
14
|
-
margin-bottom: 12px;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
STitle {
|
|
18
|
-
color: var(--gray-500);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
STitle {
|
|
22
|
-
font-size: var(--fs-300);
|
|
23
|
-
line-height: var(--lh-300);
|
|
24
|
-
font-weight: bold;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
SDescription {
|
|
28
|
-
text-align: center;
|
|
29
|
-
font-size: var(--fs-200);
|
|
30
|
-
line-height: var(--lh-200);
|
|
31
|
-
color: var(--gray-500);
|
|
32
|
-
max-width: 400px;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
STitle + SDescription {
|
|
36
|
-
margin-top: 4px;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
SDescription + SDescription {
|
|
40
|
-
margin-top: 8px;
|
|
41
|
-
}
|