@synerise/ds-card 0.19.15 → 0.19.17
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 +19 -0
- package/dist/Card/Card.js +27 -38
- package/dist/Card/Card.styles.js +0 -4
- package/dist/CardBadge/CardBadge.js +3 -10
- package/dist/CardBadge/CardBadge.styles.js +2 -3
- package/dist/CardGroup/CardGroup.js +2 -4
- package/dist/CardGroup/CardGroup.styles.js +2 -1
- package/dist/CardSummary/CardSummary.js +4 -9
- package/dist/CardSummary/CardSummary.styles.d.ts +1 -1
- package/dist/CardSummary/CardSummary.types.d.ts +6 -5
- package/dist/CardSummary/CardSummaryItem.js +5 -11
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
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.19.17](https://github.com/Synerise/synerise-design/compare/@synerise/ds-card@0.19.16...@synerise/ds-card@0.19.17) (2024-11-28)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-card
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.19.16](https://github.com/Synerise/synerise-design/compare/@synerise/ds-card@0.19.15...@synerise/ds-card@0.19.16) (2024-11-21)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* fixed types with htmlattributes ([7e84ba3](https://github.com/Synerise/synerise-design/commit/7e84ba316db9abee7bf16a46fa6b15ea76337cf4))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [0.19.15](https://github.com/Synerise/synerise-design/compare/@synerise/ds-card@0.19.14...@synerise/ds-card@0.19.15) (2024-11-12)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @synerise/ds-card
|
package/dist/Card/Card.js
CHANGED
|
@@ -1,55 +1,47 @@
|
|
|
1
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", "titleTag", "showSideChildrenWhenHeaderHidden"];
|
|
2
|
-
|
|
3
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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
|
-
|
|
5
3
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
6
|
-
|
|
7
4
|
import React, { useState } from 'react';
|
|
8
5
|
import Icon from '@synerise/ds-icon';
|
|
9
6
|
import AnimateHeight from 'react-animate-height';
|
|
10
7
|
import VisibilitySensor from 'react-visibility-sensor';
|
|
11
8
|
import * as S from './Card.styles';
|
|
12
9
|
import { ANIMATION_DURATION } from '../constants';
|
|
13
|
-
|
|
14
10
|
var Card = function Card(_ref) {
|
|
15
11
|
var children = _ref.children,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
12
|
+
raised = _ref.raised,
|
|
13
|
+
disabled = _ref.disabled,
|
|
14
|
+
style = _ref.style,
|
|
15
|
+
className = _ref.className,
|
|
16
|
+
lively = _ref.lively,
|
|
17
|
+
withHeader = _ref.withHeader,
|
|
18
|
+
defaultHeaderBackgroundColor = _ref.defaultHeaderBackgroundColor,
|
|
19
|
+
title = _ref.title,
|
|
20
|
+
description = _ref.description,
|
|
21
|
+
compactHeader = _ref.compactHeader,
|
|
22
|
+
icon = _ref.icon,
|
|
23
|
+
avatar = _ref.avatar,
|
|
24
|
+
renderBadge = _ref.renderBadge,
|
|
25
|
+
iconColor = _ref.iconColor,
|
|
26
|
+
headerSideChildren = _ref.headerSideChildren,
|
|
27
|
+
onHeaderClick = _ref.onHeaderClick,
|
|
28
|
+
withoutPadding = _ref.withoutPadding,
|
|
29
|
+
headerBorderBottom = _ref.headerBorderBottom,
|
|
30
|
+
_ref$background = _ref.background,
|
|
31
|
+
background = _ref$background === void 0 ? 'white-shadow' : _ref$background,
|
|
32
|
+
hideContent = _ref.hideContent,
|
|
33
|
+
staticContent = _ref.staticContent,
|
|
34
|
+
titleTag = _ref.titleTag,
|
|
35
|
+
showSideChildrenWhenHeaderHidden = _ref.showSideChildrenWhenHeaderHidden,
|
|
36
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
42
37
|
var fatTitle = !description || description && compactHeader;
|
|
43
|
-
|
|
44
38
|
var _useState = useState(false),
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
39
|
+
headerActionsVisible = _useState[0],
|
|
40
|
+
setHeaderActionsVisible = _useState[1];
|
|
48
41
|
var renderTitle = function renderTitle() {
|
|
49
42
|
if (!title && !titleTag) {
|
|
50
43
|
return null;
|
|
51
44
|
}
|
|
52
|
-
|
|
53
45
|
return /*#__PURE__*/React.createElement(S.TitleWrapper, {
|
|
54
46
|
"data-testid": "card-title",
|
|
55
47
|
compact: compactHeader,
|
|
@@ -59,7 +51,6 @@ var Card = function Card(_ref) {
|
|
|
59
51
|
fat: !!fatTitle
|
|
60
52
|
}, title), titleTag && /*#__PURE__*/React.createElement(S.TitleTag, null, titleTag));
|
|
61
53
|
};
|
|
62
|
-
|
|
63
54
|
return /*#__PURE__*/React.createElement(S.Container, _extends({
|
|
64
55
|
raised: raised,
|
|
65
56
|
disabled: disabled,
|
|
@@ -69,7 +60,6 @@ var Card = function Card(_ref) {
|
|
|
69
60
|
"data-testid": "card-wrapper",
|
|
70
61
|
background: background
|
|
71
62
|
/** Necessary for passing down data-* attributes */
|
|
72
|
-
|
|
73
63
|
}, props), withHeader && /*#__PURE__*/React.createElement(S.Header, {
|
|
74
64
|
onClick: onHeaderClick,
|
|
75
65
|
headerBorderBottom: headerBorderBottom,
|
|
@@ -116,5 +106,4 @@ var Card = function Card(_ref) {
|
|
|
116
106
|
height: headerSideChildren && !headerActionsVisible ? 'auto' : 0
|
|
117
107
|
}, /*#__PURE__*/React.createElement(S.FooterContainer, null, headerSideChildren)));
|
|
118
108
|
};
|
|
119
|
-
|
|
120
109
|
export default Card;
|
package/dist/Card/Card.styles.js
CHANGED
|
@@ -6,19 +6,16 @@ var whiteBg = ['white', 'white-shadow'];
|
|
|
6
6
|
var greyBg = ['grey', 'grey-shadow'];
|
|
7
7
|
var withBoxShadow = ['white-shadow', 'grey-shadow'];
|
|
8
8
|
var withOutline = ['outline'];
|
|
9
|
-
|
|
10
9
|
var backgroundColor = function backgroundColor(props) {
|
|
11
10
|
if (whiteBg.includes(props.background)) return props.theme.palette.white;
|
|
12
11
|
if (greyBg.includes(props.background)) return props.theme.palette['grey-050'];
|
|
13
12
|
return props.theme.palette.transparent;
|
|
14
13
|
};
|
|
15
|
-
|
|
16
14
|
var boxShadow = function boxShadow(props) {
|
|
17
15
|
if (withBoxShadow.includes(props.background)) return "0 4px 12px 0 rgba(35, 41, 54, 0.04)";
|
|
18
16
|
if (withOutline.includes(props.background)) return props.theme.palette['grey-200'] + " 0px 0px 0px 1px inset";
|
|
19
17
|
return 'none';
|
|
20
18
|
};
|
|
21
|
-
|
|
22
19
|
export var HeaderSideChildren = styled.div.withConfig({
|
|
23
20
|
displayName: "Cardstyles__HeaderSideChildren",
|
|
24
21
|
componentId: "sc-18exblx-0"
|
|
@@ -90,7 +87,6 @@ export var HeaderContent = styled.div.withConfig({
|
|
|
90
87
|
if (props.hasIconOrAvatar) {
|
|
91
88
|
return '24px';
|
|
92
89
|
}
|
|
93
|
-
|
|
94
90
|
return '0';
|
|
95
91
|
}, function (props) {
|
|
96
92
|
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']);
|
|
@@ -1,26 +1,19 @@
|
|
|
1
1
|
var _excluded = ["icon", "status"];
|
|
2
|
-
|
|
3
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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
|
-
|
|
5
3
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
6
|
-
|
|
7
4
|
import React from 'react';
|
|
8
5
|
import Icon from '@synerise/ds-icon';
|
|
9
6
|
import * as S from './CardBadge.styles';
|
|
10
|
-
|
|
11
7
|
var CardBadge = function CardBadge(_ref) {
|
|
12
8
|
var icon = _ref.icon,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
_ref$status = _ref.status,
|
|
10
|
+
status = _ref$status === void 0 ? 'default' : _ref$status,
|
|
11
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
17
12
|
return /*#__PURE__*/React.createElement(S.CardBadge, _extends({
|
|
18
13
|
status: status
|
|
19
14
|
/** Necessary for passing down data-* attributes */
|
|
20
|
-
|
|
21
15
|
}, props), /*#__PURE__*/React.createElement(Icon, {
|
|
22
16
|
component: icon
|
|
23
17
|
}));
|
|
24
18
|
};
|
|
25
|
-
|
|
26
19
|
export default CardBadge;
|
|
@@ -11,12 +11,11 @@ var color = {
|
|
|
11
11
|
error: 'white',
|
|
12
12
|
"default": 'grey-400'
|
|
13
13
|
};
|
|
14
|
-
|
|
15
14
|
var boxShadow = function boxShadow(props) {
|
|
16
15
|
return props.status === 'default' ? props.theme.palette['grey-400'] + " 0px 0px 0px 1.5px inset" : 'none';
|
|
17
|
-
};
|
|
18
|
-
|
|
16
|
+
};
|
|
19
17
|
|
|
18
|
+
// eslint-disable-next-line import/prefer-default-export
|
|
20
19
|
export var CardBadge = styled.div.withConfig({
|
|
21
20
|
displayName: "CardBadgestyles__CardBadge",
|
|
22
21
|
componentId: "sc-1xcnpyh-0"
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import * as S from './CardGroup.styles';
|
|
3
|
-
|
|
4
3
|
var CardGroup = function CardGroup(_ref) {
|
|
5
4
|
var className = _ref.className,
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
children = _ref.children,
|
|
6
|
+
columns = _ref.columns;
|
|
8
7
|
return /*#__PURE__*/React.createElement(S.Container, {
|
|
9
8
|
className: className,
|
|
10
9
|
items: columns
|
|
11
10
|
}, children);
|
|
12
11
|
};
|
|
13
|
-
|
|
14
12
|
export default CardGroup;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
1
|
+
import styled from 'styled-components';
|
|
2
2
|
|
|
3
|
+
// eslint-disable-next-line import/prefer-default-export
|
|
3
4
|
export var Container = styled.div.withConfig({
|
|
4
5
|
displayName: "CardGroupstyles__Container",
|
|
5
6
|
componentId: "qyudjs-0"
|
|
@@ -1,24 +1,19 @@
|
|
|
1
1
|
var _excluded = ["title", "items"],
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
_excluded2 = ["key"];
|
|
4
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
5
|
-
|
|
6
4
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
7
|
-
|
|
8
5
|
import React from 'react';
|
|
9
6
|
import * as S from './CardSummary.styles';
|
|
10
7
|
import { CardSummaryItem } from './CardSummaryItem';
|
|
11
8
|
export var CardSummary = function CardSummary(_ref) {
|
|
12
9
|
var title = _ref.title,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
items = _ref.items,
|
|
11
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
16
12
|
return /*#__PURE__*/React.createElement(S.CardSummaryWrapper, props, title && /*#__PURE__*/React.createElement(S.CardSummaryTitle, {
|
|
17
13
|
level: 5
|
|
18
14
|
}, title), /*#__PURE__*/React.createElement(S.CardSummaryList, null, items.map(function (_ref2) {
|
|
19
15
|
var key = _ref2.key,
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
item = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
22
17
|
return /*#__PURE__*/React.createElement(CardSummaryItem, _extends({}, item, {
|
|
23
18
|
key: key
|
|
24
19
|
}));
|
|
@@ -21,7 +21,7 @@ export declare const CardSummaryItemValue: import("styled-components").StyledCom
|
|
|
21
21
|
children?: import("react").ReactNode;
|
|
22
22
|
className?: string | undefined;
|
|
23
23
|
}) => import("react").JSX.Element, any, {}, never>;
|
|
24
|
-
export declare const Icon: import("styled-components").StyledComponent<
|
|
24
|
+
export declare const Icon: import("styled-components").StyledComponent<({ name, component, className, ...rest }: import("@synerise/ds-icon").IconProps) => import("react").JSX.Element, any, {
|
|
25
25
|
isOpen: boolean;
|
|
26
26
|
}, never>;
|
|
27
27
|
export declare const CardSummaryItemObjects: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import type { ReactElement, ReactNode, Key } from 'react';
|
|
2
|
+
import type { WithHTMLAttributes } from '@synerise/ds-utils';
|
|
3
|
+
export type CardSummaryItemProps = WithHTMLAttributes<HTMLDivElement, {
|
|
3
4
|
key: Key;
|
|
4
5
|
label?: ReactNode;
|
|
5
6
|
value: ReactNode;
|
|
6
7
|
summaryRowObjects?: ReactElement[];
|
|
7
|
-
}
|
|
8
|
-
export type CardSummaryProps = {
|
|
8
|
+
}>;
|
|
9
|
+
export type CardSummaryProps = WithHTMLAttributes<HTMLDivElement, {
|
|
9
10
|
title?: ReactNode;
|
|
10
11
|
items: CardSummaryItemProps[];
|
|
11
|
-
}
|
|
12
|
+
}>;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
var _excluded = ["label", "value", "summaryRowObjects"];
|
|
2
|
-
|
|
3
2
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
4
|
-
|
|
5
3
|
import React, { useState } from 'react';
|
|
6
4
|
import { v4 as uuid } from 'uuid';
|
|
7
5
|
import { AngleDownS } from '@synerise/ds-icon';
|
|
@@ -9,20 +7,16 @@ import * as S from './CardSummary.styles';
|
|
|
9
7
|
import { ANIMATION_DURATION } from '../constants';
|
|
10
8
|
export var CardSummaryItem = function CardSummaryItem(_ref) {
|
|
11
9
|
var label = _ref.label,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
value = _ref.value,
|
|
11
|
+
summaryRowObjects = _ref.summaryRowObjects,
|
|
12
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
16
13
|
var _useState = useState(false),
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
isOpen = _useState[0],
|
|
15
|
+
setIsOpen = _useState[1];
|
|
20
16
|
var withObjects = !!(summaryRowObjects != null && summaryRowObjects.length);
|
|
21
|
-
|
|
22
17
|
var handleClick = function handleClick() {
|
|
23
18
|
setIsOpen(!isOpen);
|
|
24
19
|
};
|
|
25
|
-
|
|
26
20
|
var icon = /*#__PURE__*/React.createElement(S.Icon, {
|
|
27
21
|
isOpen: isOpen,
|
|
28
22
|
component: /*#__PURE__*/React.createElement(AngleDownS, null),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-card",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.17",
|
|
4
4
|
"description": "Card UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
],
|
|
35
35
|
"types": "dist/index.d.ts",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@synerise/ds-avatar": "^0.17.
|
|
38
|
-
"@synerise/ds-icon": "^0.
|
|
39
|
-
"@synerise/ds-tags": "^0.10.
|
|
40
|
-
"@synerise/ds-typography": "^0.16.
|
|
41
|
-
"@synerise/ds-utils": "^0.31.
|
|
37
|
+
"@synerise/ds-avatar": "^0.17.22",
|
|
38
|
+
"@synerise/ds-icon": "^0.67.1",
|
|
39
|
+
"@synerise/ds-tags": "^0.10.19",
|
|
40
|
+
"@synerise/ds-typography": "^0.16.7",
|
|
41
|
+
"@synerise/ds-utils": "^0.31.2",
|
|
42
42
|
"react-animate-height": "^2.0.23",
|
|
43
43
|
"react-visibility-sensor": "^5.1.1",
|
|
44
44
|
"uuid": "^8.3.2"
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"react": ">=16.9.0 <= 17.0.2",
|
|
50
50
|
"styled-components": "5.0.1"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "4a56ee7ef816c22341ce704154dc7aa65b7d1dcc"
|
|
53
53
|
}
|