@synerise/ds-card 0.14.2 → 0.15.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 -0
- package/README.md +2 -1
- package/dist/Card/Card.js +5 -4
- package/dist/Card/Card.styles.d.ts +7 -11
- package/dist/Card/Card.styles.js +15 -23
- package/dist/Card/Card.types.d.ts +1 -0
- package/dist/CardBadge/CardBadge.styles.js +1 -3
- package/dist/index.d.ts +9 -0
- package/dist/index.js +9 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,30 @@
|
|
|
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
|
+
# [0.15.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-card@0.14.3...@synerise/ds-card@0.15.0) (2023-06-28)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **card:** swapped header title to ds title ([1d8e2d2](https://github.com/Synerise/synerise-design/commit/1d8e2d2f62dcb4462ddb7834ba0c43647135c914))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **card:** add support for avatar in header ([7484281](https://github.com/Synerise/synerise-design/commit/74842815f1ba2e575ad17ede1418f0557aba0c8b))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [0.14.3](https://github.com/Synerise/synerise-design/compare/@synerise/ds-card@0.14.2...@synerise/ds-card@0.14.3) (2023-04-26)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @synerise/ds-card
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
6
30
|
## [0.14.2](https://github.com/Synerise/synerise-design/compare/@synerise/ds-card@0.14.1...@synerise/ds-card@0.14.2) (2023-04-19)
|
|
7
31
|
|
|
8
32
|
**Note:** Version bump only for package @synerise/ds-card
|
package/README.md
CHANGED
|
@@ -83,8 +83,9 @@ yarn add @synerise/ds-card
|
|
|
83
83
|
| headerSideChildren | Defines if the container includes a button (in the header) | React.ReactNode | - |
|
|
84
84
|
| staticContent | Defines content that's visible even if hideContent is `true` | React.ReactNode | - |
|
|
85
85
|
| hideContent | Defines the initial visibility of the content | boolean | `false` |
|
|
86
|
-
| icon | Icon of CardBadge
|
|
86
|
+
| icon | Icon of CardBadge, if defined then avatar prop gets ignored | React.ReactNode | - |
|
|
87
87
|
| iconColor | Defines the color of the icon | string | - |
|
|
88
|
+
| avatar | Avatar for CardBadge | React.ReactNode | - |
|
|
88
89
|
| lively | Defines if the container casts a shadow when the cursor is hovered over | boolean | - |
|
|
89
90
|
| raised | Defines if the container casts a shadow on the background | boolean | - |
|
|
90
91
|
| style | Defines the CSS of the container | React.CSSProperties | - |
|
package/dist/Card/Card.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["children", "raised", "disabled", "style", "className", "lively", "withHeader", "defaultHeaderBackgroundColor", "title", "description", "compactHeader", "icon", "renderBadge", "iconColor", "headerSideChildren", "onHeaderClick", "withoutPadding", "headerBorderBottom", "background", "hideContent", "staticContent", "showSideChildrenWhenHeaderHidden"];
|
|
1
|
+
var _excluded = ["children", "raised", "disabled", "style", "className", "lively", "withHeader", "defaultHeaderBackgroundColor", "title", "description", "compactHeader", "icon", "avatar", "renderBadge", "iconColor", "headerSideChildren", "onHeaderClick", "withoutPadding", "headerBorderBottom", "background", "hideContent", "staticContent", "showSideChildrenWhenHeaderHidden"];
|
|
2
2
|
|
|
3
3
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
@@ -23,6 +23,7 @@ var Card = function Card(_ref) {
|
|
|
23
23
|
description = _ref.description,
|
|
24
24
|
compactHeader = _ref.compactHeader,
|
|
25
25
|
icon = _ref.icon,
|
|
26
|
+
avatar = _ref.avatar,
|
|
26
27
|
renderBadge = _ref.renderBadge,
|
|
27
28
|
iconColor = _ref.iconColor,
|
|
28
29
|
headerSideChildren = _ref.headerSideChildren,
|
|
@@ -61,11 +62,11 @@ var Card = function Card(_ref) {
|
|
|
61
62
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
62
63
|
component: icon,
|
|
63
64
|
color: iconColor
|
|
64
|
-
})) || renderBadge && renderBadge(), /*#__PURE__*/React.createElement(S.HeaderContent, {
|
|
65
|
+
})) || avatar || renderBadge && renderBadge(), /*#__PURE__*/React.createElement(S.HeaderContent, {
|
|
65
66
|
compact: compactHeader,
|
|
66
|
-
|
|
67
|
+
hasIconOrAvatar: Boolean(icon || avatar)
|
|
67
68
|
}, title && /*#__PURE__*/React.createElement(S.Title, {
|
|
68
|
-
description: description,
|
|
69
|
+
description: Boolean(description),
|
|
69
70
|
level: 4,
|
|
70
71
|
fat: !!fatTitle
|
|
71
72
|
}, title), description && /*#__PURE__*/React.createElement(S.Description, null, description)), headerSideChildren && /*#__PURE__*/React.createElement(VisibilitySensor, {
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Backgrounds } from './Card.types';
|
|
3
|
-
declare type IconContainerProps = {
|
|
4
|
-
compact?: boolean;
|
|
5
|
-
description?: React.ReactNode;
|
|
6
|
-
};
|
|
7
3
|
export declare const HeaderSideChildren: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
8
|
-
export declare const IconContainer: import("styled-components").StyledComponent<"div", any,
|
|
4
|
+
export declare const IconContainer: import("styled-components").StyledComponent<"div", any, {
|
|
5
|
+
compact?: boolean | undefined;
|
|
6
|
+
description?: React.ReactNode;
|
|
7
|
+
}, never>;
|
|
9
8
|
export declare const Container: import("styled-components").StyledComponent<"div", any, {
|
|
10
9
|
raised?: boolean | undefined;
|
|
11
10
|
disabled?: boolean | undefined;
|
|
@@ -17,16 +16,14 @@ export declare const Header: import("styled-components").StyledComponent<"div",
|
|
|
17
16
|
headerBorderBottom?: boolean | undefined;
|
|
18
17
|
defaultHeaderBackgroundColor?: boolean | undefined;
|
|
19
18
|
}, never>;
|
|
20
|
-
export declare const Title: import("styled-components").StyledComponent<React.FC<
|
|
21
|
-
level?: 1 | 2 | 3 | 4 | 5 | undefined;
|
|
22
|
-
}, "code" | "mark" | "style" | "title" | "type" | "className" | "id" | "aria-label" | "children" | "disabled" | "editable" | "copyable" | "ellipsis" | "underline" | "delete" | "keyboard" | "prefixCls" | "level">>, any, {
|
|
19
|
+
export declare const Title: import("styled-components").StyledComponent<React.FC<import("@synerise/ds-typography/dist/Title.types").Props>, any, {
|
|
23
20
|
fat: boolean;
|
|
24
|
-
description?:
|
|
21
|
+
description?: boolean | undefined;
|
|
25
22
|
}, never>;
|
|
26
23
|
export declare const Description: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
27
24
|
export declare const HeaderContent: import("styled-components").StyledComponent<"div", any, {
|
|
28
25
|
compact?: boolean | undefined;
|
|
29
|
-
|
|
26
|
+
hasIconOrAvatar: boolean;
|
|
30
27
|
}, never>;
|
|
31
28
|
export declare const ChildrenContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
32
29
|
export declare const PaddingWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
@@ -34,4 +31,3 @@ export declare const PaddingWrapper: import("styled-components").StyledComponent
|
|
|
34
31
|
withoutPadding?: boolean | undefined;
|
|
35
32
|
}, never>;
|
|
36
33
|
export declare const FooterContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
37
|
-
export {};
|
package/dist/Card/Card.styles.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
|
-
import
|
|
2
|
+
import { Title as DSTitle } from '@synerise/ds-typography';
|
|
3
3
|
var whiteBg = ['white', 'white-shadow'];
|
|
4
4
|
var greyBg = ['grey', 'grey-shadow'];
|
|
5
5
|
var withBoxShadow = ['white-shadow', 'grey-shadow'];
|
|
@@ -17,22 +17,6 @@ var boxShadow = function boxShadow(props) {
|
|
|
17
17
|
return 'none';
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
var getHeight = function getHeight(props) {
|
|
21
|
-
if (props.compact && props.description) {
|
|
22
|
-
return ' 32px';
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
if (props.compact) {
|
|
26
|
-
return ' 32px';
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
if (props.description) {
|
|
30
|
-
return '24px';
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return ' 32px';
|
|
34
|
-
};
|
|
35
|
-
|
|
36
20
|
export var HeaderSideChildren = styled.div.withConfig({
|
|
37
21
|
displayName: "Cardstyles__HeaderSideChildren",
|
|
38
22
|
componentId: "sc-18exblx-0"
|
|
@@ -41,7 +25,7 @@ export var IconContainer = styled.div.withConfig({
|
|
|
41
25
|
displayName: "Cardstyles__IconContainer",
|
|
42
26
|
componentId: "sc-18exblx-1"
|
|
43
27
|
})(["display:flex;width:24px;height:", ";align-items:center;"], function (props) {
|
|
44
|
-
return
|
|
28
|
+
return props.description && !props.compact ? '24px' : '32px';
|
|
45
29
|
});
|
|
46
30
|
export var Container = styled.div.withConfig({
|
|
47
31
|
displayName: "Cardstyles__Container",
|
|
@@ -71,10 +55,10 @@ export var Header = styled.div.withConfig({
|
|
|
71
55
|
}, function (props) {
|
|
72
56
|
return !!props.defaultHeaderBackgroundColor && css(["background-color:", ";"], props.theme.palette.white);
|
|
73
57
|
});
|
|
74
|
-
export var Title = styled(
|
|
58
|
+
export var Title = styled(DSTitle).withConfig({
|
|
75
59
|
displayName: "Cardstyles__Title",
|
|
76
60
|
componentId: "sc-18exblx-4"
|
|
77
|
-
})(["&&{display:flex;align-items:center;min-height:", ";margin:0;margin-bottom:", ";}"], function (props) {
|
|
61
|
+
})(["&&{display:flex;align-items:center;min-height:", ";margin:0;margin-bottom:", ";line-height:1.4;}"], function (props) {
|
|
78
62
|
return props.fat ? '32px' : '20px';
|
|
79
63
|
}, function (props) {
|
|
80
64
|
return props.description ? '6px' : '0';
|
|
@@ -88,10 +72,18 @@ export var Description = styled.div.withConfig({
|
|
|
88
72
|
export var HeaderContent = styled.div.withConfig({
|
|
89
73
|
displayName: "Cardstyles__HeaderContent",
|
|
90
74
|
componentId: "sc-18exblx-6"
|
|
91
|
-
})(["max-width:100%;flex:1;", ";", ""], function (props) {
|
|
92
|
-
return props.
|
|
75
|
+
})(["max-width:100%;flex:1;display:flex;flex-direction:", ";align-items:", ";margin:0 0 0 ", ";", ""], function (props) {
|
|
76
|
+
return props.compact ? 'row' : 'column';
|
|
77
|
+
}, function (props) {
|
|
78
|
+
return props.compact ? 'center' : 'flex-start';
|
|
79
|
+
}, function (props) {
|
|
80
|
+
if (props.hasIconOrAvatar) {
|
|
81
|
+
return '24px';
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return '0';
|
|
93
85
|
}, function (props) {
|
|
94
|
-
return !!props.compact && css(["
|
|
86
|
+
return !!props.compact && css(["", "{height:32px;line-height:32px;margin:0;}", "{border-left:1px solid ", ";height:32px;line-height:32px;padding:0 0 0 24px;margin:0 0 0 24px;}"], Title, Description, props.theme.palette['grey-200']);
|
|
95
87
|
});
|
|
96
88
|
export var ChildrenContainer = styled.div.withConfig({
|
|
97
89
|
displayName: "Cardstyles__ChildrenContainer",
|
|
@@ -15,6 +15,7 @@ export interface CardProps {
|
|
|
15
15
|
icon?: React.ReactNode;
|
|
16
16
|
renderBadge?: () => React.ReactNode;
|
|
17
17
|
iconColor?: string;
|
|
18
|
+
avatar?: React.ReactNode;
|
|
18
19
|
staticContent?: React.ReactNode;
|
|
19
20
|
headerSideChildren?: React.ReactNode;
|
|
20
21
|
onHeaderClick?: (e: React.SyntheticEvent) => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
import * as MainCardStyles from './Card/Card.styles';
|
|
2
|
+
import * as CardGroupStyles from './CardGroup/CardGroup.styles';
|
|
3
|
+
import * as CardBadgeStyles from './CardBadge/CardBadge.styles';
|
|
1
4
|
export { default } from './Card/Card';
|
|
2
5
|
export { default as CardGroup } from './CardGroup/CardGroup';
|
|
3
6
|
export { default as CardBadge } from './CardBadge/CardBadge';
|
|
7
|
+
export type { Backgrounds, CardProps } from './Card/Card.types';
|
|
8
|
+
export declare const CardStyles: {
|
|
9
|
+
Card: typeof MainCardStyles;
|
|
10
|
+
CardGroup: typeof CardGroupStyles;
|
|
11
|
+
CardBadge: typeof CardBadgeStyles;
|
|
12
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
import * as MainCardStyles from './Card/Card.styles';
|
|
2
|
+
import * as CardGroupStyles from './CardGroup/CardGroup.styles';
|
|
3
|
+
import * as CardBadgeStyles from './CardBadge/CardBadge.styles';
|
|
1
4
|
export { default } from './Card/Card';
|
|
2
5
|
export { default as CardGroup } from './CardGroup/CardGroup';
|
|
3
|
-
export { default as CardBadge } from './CardBadge/CardBadge';
|
|
6
|
+
export { default as CardBadge } from './CardBadge/CardBadge';
|
|
7
|
+
export var CardStyles = {
|
|
8
|
+
Card: MainCardStyles,
|
|
9
|
+
CardGroup: CardGroupStyles,
|
|
10
|
+
CardBadge: CardBadgeStyles
|
|
11
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-card",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Card UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
],
|
|
33
33
|
"types": "dist/index.d.ts",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@synerise/ds-icon": "^0.
|
|
36
|
-
"@synerise/ds-typography": "^0.12.
|
|
35
|
+
"@synerise/ds-icon": "^0.57.0",
|
|
36
|
+
"@synerise/ds-typography": "^0.12.8",
|
|
37
37
|
"@synerise/ds-utils": "^0.8.31",
|
|
38
38
|
"react-animate-height": "^2.0.23",
|
|
39
39
|
"react-visibility-sensor": "^5.1.1"
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"antd": "^4",
|
|
44
44
|
"react": ">=16.9.0 < 17.0.0"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "948b33abd56086fc73880204892f90bd6ddc0a72"
|
|
47
47
|
}
|