@synerise/ds-empty-states 1.0.35 → 1.0.37
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 +8 -0
- package/dist/EmptyStates.d.ts +2 -2
- package/dist/EmptyStates.js +31 -39
- package/dist/EmptyStates.styles.d.ts +6 -6
- package/dist/EmptyStates.styles.js +31 -39
- package/dist/EmptyStates.types.d.ts +1 -1
- package/dist/EmptyStates.types.js +30 -8
- package/dist/index.js +8 -2
- package/dist/modules.d.js +1 -1
- package/dist/modules.d.ts +0 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.0.37](https://github.com/Synerise/synerise-design/compare/@synerise/ds-empty-states@1.0.36...@synerise/ds-empty-states@1.0.37) (2026-04-01)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-empty-states
|
|
9
|
+
|
|
10
|
+
## [1.0.36](https://github.com/Synerise/synerise-design/compare/@synerise/ds-empty-states@1.0.35...@synerise/ds-empty-states@1.0.36) (2026-03-24)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @synerise/ds-empty-states
|
|
13
|
+
|
|
6
14
|
## [1.0.35](https://github.com/Synerise/synerise-design/compare/@synerise/ds-empty-states@1.0.34...@synerise/ds-empty-states@1.0.35) (2026-03-20)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @synerise/ds-empty-states
|
package/dist/EmptyStates.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { EmptyStatesProps } from './EmptyStates.types';
|
|
3
3
|
declare const EmptyStates: ({ size, label, text, button, fontSize, customIcon, className, mode, iconPosition, textAlign, }: EmptyStatesProps) => React.JSX.Element;
|
|
4
4
|
export default EmptyStates;
|
package/dist/EmptyStates.js
CHANGED
|
@@ -1,40 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
hasIcon: Boolean(customIcon),
|
|
33
|
-
"data-testid": "empty-states-header",
|
|
34
|
-
size: size,
|
|
35
|
-
fontSize: fontSize
|
|
36
|
-
}, text), label && /*#__PURE__*/React.createElement(S.TextWrapper, {
|
|
37
|
-
"data-testid": "empty-states-label"
|
|
38
|
-
}, label), button && /*#__PURE__*/React.createElement(S.ButtonWrapper, null, button)));
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import Icon from "@synerise/ds-icon";
|
|
3
|
+
import { EmptyStatesWrapper, EmptyStatesIconContainer, EmptyStatesContent, HeaderWrapper, TextWrapper, ButtonWrapper } from "./EmptyStates.styles.js";
|
|
4
|
+
import { EmptyStatesSize } from "./EmptyStates.types.js";
|
|
5
|
+
const mapSizeToPx = {
|
|
6
|
+
[EmptyStatesSize.SMALL]: 48,
|
|
7
|
+
[EmptyStatesSize.MEDIUM]: 96
|
|
8
|
+
};
|
|
9
|
+
const EmptyStates = ({
|
|
10
|
+
size = EmptyStatesSize.SMALL,
|
|
11
|
+
label,
|
|
12
|
+
text,
|
|
13
|
+
button,
|
|
14
|
+
fontSize,
|
|
15
|
+
customIcon,
|
|
16
|
+
className,
|
|
17
|
+
mode,
|
|
18
|
+
iconPosition = "top",
|
|
19
|
+
textAlign = "center"
|
|
20
|
+
}) => {
|
|
21
|
+
return /* @__PURE__ */ jsxs(EmptyStatesWrapper, { iconPosition, mode, className: `ds-empty-states ${className}`, children: [
|
|
22
|
+
customIcon && /* @__PURE__ */ jsx(EmptyStatesIconContainer, { children: /* @__PURE__ */ jsx(Icon, { "data-testid": "empty-states-custom-icon", component: customIcon, size: mapSizeToPx[size] }) }),
|
|
23
|
+
/* @__PURE__ */ jsxs(EmptyStatesContent, { textAlign, children: [
|
|
24
|
+
text && /* @__PURE__ */ jsx(HeaderWrapper, { hasIcon: Boolean(customIcon), "data-testid": "empty-states-header", size, fontSize, children: text }),
|
|
25
|
+
label && /* @__PURE__ */ jsx(TextWrapper, { "data-testid": "empty-states-label", children: label }),
|
|
26
|
+
button && /* @__PURE__ */ jsx(ButtonWrapper, { children: button })
|
|
27
|
+
] })
|
|
28
|
+
] });
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
EmptyStates as default
|
|
39
32
|
};
|
|
40
|
-
export default EmptyStates;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { EmptyStatesSize } from './EmptyStates.types';
|
|
2
|
-
export declare const EmptyStatesIconContainer: import(
|
|
3
|
-
export declare const TextWrapper: import(
|
|
4
|
-
export declare const HeaderWrapper: import(
|
|
2
|
+
export declare const EmptyStatesIconContainer: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const TextWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
4
|
+
export declare const HeaderWrapper: import('styled-components').StyledComponent<"div", any, {
|
|
5
5
|
fontSize?: EmptyStatesSize;
|
|
6
6
|
size?: EmptyStatesSize;
|
|
7
7
|
hasIcon?: boolean;
|
|
8
8
|
}, never>;
|
|
9
|
-
export declare const ButtonWrapper: import(
|
|
10
|
-
export declare const EmptyStatesWrapper: import(
|
|
9
|
+
export declare const ButtonWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
10
|
+
export declare const EmptyStatesWrapper: import('styled-components').StyledComponent<"div", any, {
|
|
11
11
|
iconPosition: "top" | "left" | "right";
|
|
12
12
|
mode?: "absolute";
|
|
13
13
|
}, never>;
|
|
14
|
-
export declare const EmptyStatesContent: import(
|
|
14
|
+
export declare const EmptyStatesContent: import('styled-components').StyledComponent<"div", any, {
|
|
15
15
|
textAlign: "left" | "right" | "center" | "justify";
|
|
16
16
|
}, never>;
|
|
@@ -1,57 +1,49 @@
|
|
|
1
|
-
import styled, { css } from
|
|
2
|
-
import { EmptyStatesSize, FontSize } from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
return iconPosition ===
|
|
1
|
+
import styled, { css } from "styled-components";
|
|
2
|
+
import { EmptyStatesSize, FontSize } from "./EmptyStates.types.js";
|
|
3
|
+
const FONT_SIZE_DEFAULT = 14;
|
|
4
|
+
const getFlexStyle = (iconPosition) => {
|
|
5
|
+
return iconPosition === "top" ? css(["flex-direction:", ";align-items:center;"], mapIconPosition[iconPosition]) : css(["flex-direction:", ";gap:16px;align-items:flex-start;"], mapIconPosition[iconPosition]);
|
|
6
6
|
};
|
|
7
|
-
|
|
8
|
-
right:
|
|
9
|
-
top:
|
|
10
|
-
left:
|
|
7
|
+
const mapIconPosition = {
|
|
8
|
+
right: "row-reverse",
|
|
9
|
+
top: "column",
|
|
10
|
+
left: "row"
|
|
11
11
|
};
|
|
12
|
-
|
|
13
|
-
right:
|
|
14
|
-
left:
|
|
15
|
-
center:
|
|
16
|
-
justify:
|
|
12
|
+
const mapTextAlign = {
|
|
13
|
+
right: "flex-end",
|
|
14
|
+
left: "flex-start",
|
|
15
|
+
center: "center",
|
|
16
|
+
justify: "center"
|
|
17
17
|
};
|
|
18
|
-
|
|
18
|
+
const EmptyStatesIconContainer = /* @__PURE__ */ styled.div.withConfig({
|
|
19
19
|
displayName: "EmptyStatesstyles__EmptyStatesIconContainer",
|
|
20
20
|
componentId: "sc-7sb4gr-0"
|
|
21
21
|
})([""]);
|
|
22
|
-
|
|
22
|
+
const TextWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
23
23
|
displayName: "EmptyStatesstyles__TextWrapper",
|
|
24
24
|
componentId: "sc-7sb4gr-1"
|
|
25
25
|
})(["display:flex;line-height:16px;max-width:440px;word-wrap:break-word;padding-bottom:8px;"]);
|
|
26
|
-
|
|
26
|
+
const HeaderWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
27
27
|
displayName: "EmptyStatesstyles__HeaderWrapper",
|
|
28
28
|
componentId: "sc-7sb4gr-2"
|
|
29
|
-
})(["display:flex;line-height:16px;margin-top:", ";color:", ";font-size:", "px;font-weight:500;padding-bottom:", ";"],
|
|
30
|
-
|
|
31
|
-
}, function (props) {
|
|
32
|
-
return props.theme.palette['grey-800'];
|
|
33
|
-
}, function (props) {
|
|
34
|
-
return props.fontSize ? FontSize[props.fontSize] : FONT_SIZE_DEFAULT;
|
|
35
|
-
}, function (props) {
|
|
36
|
-
return props.fontSize === EmptyStatesSize.SMALL ? '12px' : '18px';
|
|
37
|
-
});
|
|
38
|
-
export var ButtonWrapper = styled.div.withConfig({
|
|
29
|
+
})(["display:flex;line-height:16px;margin-top:", ";color:", ";font-size:", "px;font-weight:500;padding-bottom:", ";"], (props) => props.hasIcon && props.size === EmptyStatesSize.SMALL ? "12px" : "", (props) => props.theme.palette["grey-800"], (props) => props.fontSize ? FontSize[props.fontSize] : FONT_SIZE_DEFAULT, (props) => props.fontSize === EmptyStatesSize.SMALL ? "12px" : "18px");
|
|
30
|
+
const ButtonWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
39
31
|
displayName: "EmptyStatesstyles__ButtonWrapper",
|
|
40
32
|
componentId: "sc-7sb4gr-3"
|
|
41
33
|
})(["padding-top:12px;display:flex;"]);
|
|
42
|
-
|
|
34
|
+
const EmptyStatesWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
43
35
|
displayName: "EmptyStatesstyles__EmptyStatesWrapper",
|
|
44
36
|
componentId: "sc-7sb4gr-4"
|
|
45
|
-
})(["display:flex;", " ", ";"],
|
|
46
|
-
|
|
47
|
-
}, function (props) {
|
|
48
|
-
return props.mode === 'absolute' && css(["position:absolute;top:50%;left:50%;"]);
|
|
49
|
-
});
|
|
50
|
-
export var EmptyStatesContent = styled.div.withConfig({
|
|
37
|
+
})(["display:flex;", " ", ";"], (props) => getFlexStyle(props.iconPosition), (props) => props.mode === "absolute" && css(["position:absolute;top:50%;left:50%;"]));
|
|
38
|
+
const EmptyStatesContent = /* @__PURE__ */ styled.div.withConfig({
|
|
51
39
|
displayName: "EmptyStatesstyles__EmptyStatesContent",
|
|
52
40
|
componentId: "sc-7sb4gr-5"
|
|
53
|
-
})(["display:flex;flex-direction:column;text-align:", ";> *{justify-content:", ";}"],
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
41
|
+
})(["display:flex;flex-direction:column;text-align:", ";> *{justify-content:", ";}"], (props) => props.textAlign, (props) => mapTextAlign[props.textAlign]);
|
|
42
|
+
export {
|
|
43
|
+
ButtonWrapper,
|
|
44
|
+
EmptyStatesContent,
|
|
45
|
+
EmptyStatesIconContainer,
|
|
46
|
+
EmptyStatesWrapper,
|
|
47
|
+
HeaderWrapper,
|
|
48
|
+
TextWrapper
|
|
49
|
+
};
|
|
@@ -1,8 +1,30 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
var EmptyStatesSize = /* @__PURE__ */ ((EmptyStatesSize2) => {
|
|
2
|
+
EmptyStatesSize2["SMALL"] = "small";
|
|
3
|
+
EmptyStatesSize2["MEDIUM"] = "medium";
|
|
4
|
+
return EmptyStatesSize2;
|
|
5
|
+
})(EmptyStatesSize || {});
|
|
6
|
+
const IconSize = {
|
|
7
|
+
[
|
|
8
|
+
"small"
|
|
9
|
+
/* SMALL */
|
|
10
|
+
]: 48,
|
|
11
|
+
[
|
|
12
|
+
"medium"
|
|
13
|
+
/* MEDIUM */
|
|
14
|
+
]: 96
|
|
15
|
+
};
|
|
16
|
+
const FontSize = {
|
|
17
|
+
[
|
|
18
|
+
"small"
|
|
19
|
+
/* SMALL */
|
|
20
|
+
]: 14,
|
|
21
|
+
[
|
|
22
|
+
"medium"
|
|
23
|
+
/* MEDIUM */
|
|
24
|
+
]: 18
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
EmptyStatesSize,
|
|
28
|
+
FontSize,
|
|
29
|
+
IconSize
|
|
30
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { default as default2 } from "./EmptyStates.js";
|
|
2
|
+
import { EmptyStatesSize, FontSize, IconSize } from "./EmptyStates.types.js";
|
|
3
|
+
export {
|
|
4
|
+
EmptyStatesSize,
|
|
5
|
+
FontSize,
|
|
6
|
+
IconSize,
|
|
7
|
+
default2 as default
|
|
8
|
+
};
|
package/dist/modules.d.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "@testing-library/jest-dom";
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-empty-states",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.37",
|
|
4
4
|
"description": "EmptyStates UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
"access": "public"
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
|
19
|
-
"build": "
|
|
19
|
+
"build": "vite build",
|
|
20
20
|
"build:css": "node ../../../scripts/style/less.js",
|
|
21
21
|
"build:js": "babel --delete-dir-on-start --root-mode upward src --out-dir dist --extensions '.js,.ts,.tsx'",
|
|
22
|
-
"build:watch": "
|
|
22
|
+
"build:watch": "vite build --watch",
|
|
23
23
|
"defs": "tsc --declaration --outDir dist/ --emitDeclarationOnly",
|
|
24
24
|
"pack:ci": "pnpm pack --pack-destination ../../storybook/storybook-static/static",
|
|
25
25
|
"prepublish": "pnpm run build",
|
|
@@ -35,12 +35,12 @@
|
|
|
35
35
|
],
|
|
36
36
|
"types": "dist/index.d.ts",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@synerise/ds-icon": "^1.15.
|
|
38
|
+
"@synerise/ds-icon": "^1.15.2"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"@synerise/ds-core": "*",
|
|
42
42
|
"react": ">=16.9.0 <= 18.3.1",
|
|
43
43
|
"styled-components": "^5.3.3"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "c2384982c3533a31eb5e5e0408f8dcecb2b0f399"
|
|
46
46
|
}
|