@synerise/ds-card 1.2.33 → 1.3.1
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 +10 -0
- package/README.md +7 -6
- package/dist/CardSummary/CardSummary.styles.d.ts +7 -2
- package/dist/CardSummary/CardSummary.styles.js +8 -2
- package/dist/CardSummary/CardSummary.types.d.ts +3 -1
- package/dist/CardSummary/CardSummaryItem.d.ts +1 -1
- package/dist/CardSummary/CardSummaryItem.js +9 -4
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
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.3.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-card@1.3.0...@synerise/ds-card@1.3.1) (2026-03-09)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-card
|
|
9
|
+
|
|
10
|
+
# [1.3.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-card@1.2.33...@synerise/ds-card@1.3.0) (2026-02-26)
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
- **field-set:** add onExpandClick prop ([d5689bc](https://github.com/Synerise/synerise-design/commit/d5689bce6295d3037092d75921a4a3ba4430250e))
|
|
15
|
+
|
|
6
16
|
## [1.2.33](https://github.com/Synerise/synerise-design/compare/@synerise/ds-card@1.2.32...@synerise/ds-card@1.2.33) (2026-02-23)
|
|
7
17
|
|
|
8
18
|
**Note:** Version bump only for package @synerise/ds-card
|
package/README.md
CHANGED
|
@@ -115,9 +115,10 @@ Renders a summary in a bulletted list form. Can be assigned to Card.staticConten
|
|
|
115
115
|
|
|
116
116
|
#### CardSummaryItemProps
|
|
117
117
|
|
|
118
|
-
| Property
|
|
119
|
-
|
|
|
120
|
-
| key
|
|
121
|
-
| label
|
|
122
|
-
| value
|
|
123
|
-
|
|
|
118
|
+
| Property | Description | Type | Default |
|
|
119
|
+
| ----------------------- | ------------------------------------------------------------------- | ---------------------- | ------- |
|
|
120
|
+
| key | Unique key | `React.Key` | - |
|
|
121
|
+
| label | Optional label to display | `React.ReactNode` | - |
|
|
122
|
+
| value | Mandatory value to display | `React.ReactNode` | - |
|
|
123
|
+
| summaryObjects | Optional array of react elements, renders in a toggleable container | `React.ReactElement[]` | - |
|
|
124
|
+
| summaryObjectsDirection | Direction of summary objects layout | `'row'` / `'column'` | - |
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type SummaryObjectsDirection } from './CardSummary.types';
|
|
1
2
|
export declare const CardSummaryWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
3
|
export declare const CardSummaryTitle: import("styled-components").StyledComponent<({ level, withoutMargin, children, className, ellipsis, ...antdProps }: import("@synerise/ds-typography/dist/Title.types").Props) => React.JSX.Element, any, {}, never>;
|
|
3
4
|
export declare const CardSummaryList: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -18,5 +19,9 @@ export declare const IconWrapper: import("styled-components").StyledComponent<"d
|
|
|
18
19
|
export declare const Icon: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@synerise/ds-icon").BaseIconProps & Omit<import("react").HTMLAttributes<HTMLDivElement>, keyof import("@synerise/ds-icon").BaseIconProps> & import("@synerise/ds-utils").DataAttributes & import("react").RefAttributes<HTMLDivElement>>, any, {
|
|
19
20
|
isOpen: boolean;
|
|
20
21
|
}, never>;
|
|
21
|
-
export declare const CardSummaryItemObjects: import("styled-components").StyledComponent<"div", any, {
|
|
22
|
-
|
|
22
|
+
export declare const CardSummaryItemObjects: import("styled-components").StyledComponent<"div", any, {
|
|
23
|
+
direction: SummaryObjectsDirection;
|
|
24
|
+
}, never>;
|
|
25
|
+
export declare const CardSummaryItemObject: import("styled-components").StyledComponent<"div", any, {
|
|
26
|
+
direction: SummaryObjectsDirection;
|
|
27
|
+
}, never>;
|
|
@@ -55,8 +55,14 @@ export var Icon = styled(DSIcon).withConfig({
|
|
|
55
55
|
export var CardSummaryItemObjects = styled.div.withConfig({
|
|
56
56
|
displayName: "CardSummarystyles__CardSummaryItemObjects",
|
|
57
57
|
componentId: "sc-1yj41os-12"
|
|
58
|
-
})(["--cols:4;--gap:8px;display:flex;
|
|
58
|
+
})(["--cols:4;--gap:8px;display:flex;margin:8px 0 8px 16px;", ""], function (_ref) {
|
|
59
|
+
var direction = _ref.direction;
|
|
60
|
+
return direction === 'column' ? "\n flex-direction: column;\n gap: 12px;\n " : "\n flex-wrap: wrap;\n gap: 0 var(--gap);\n ";
|
|
61
|
+
});
|
|
59
62
|
export var CardSummaryItemObject = styled.div.withConfig({
|
|
60
63
|
displayName: "CardSummarystyles__CardSummaryItemObject",
|
|
61
64
|
componentId: "sc-1yj41os-13"
|
|
62
|
-
})(["
|
|
65
|
+
})(["min-width:0;", "{margin-left:0;}", ""], Tag, function (_ref2) {
|
|
66
|
+
var direction = _ref2.direction;
|
|
67
|
+
return direction === 'row' && "\n flex-basis: calc(\n 100% / var(--cols) - var(--gap) / var(--cols) * (var(--cols) - 1)\n );\n ";
|
|
68
|
+
});
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { Key, ReactElement, ReactNode } from 'react';
|
|
2
2
|
import type { WithHTMLAttributes } from '@synerise/ds-utils';
|
|
3
|
+
export type SummaryObjectsDirection = 'row' | 'column';
|
|
3
4
|
export type CardSummaryItemProps = WithHTMLAttributes<HTMLDivElement, {
|
|
4
5
|
key: Key;
|
|
5
6
|
label?: ReactNode;
|
|
6
7
|
value: ReactNode;
|
|
7
8
|
valueButton?: ReactNode;
|
|
8
|
-
|
|
9
|
+
summaryObjects?: ReactElement[];
|
|
10
|
+
summaryObjectsDirection?: SummaryObjectsDirection;
|
|
9
11
|
}>;
|
|
10
12
|
export type CardSummaryProps = WithHTMLAttributes<HTMLDivElement, {
|
|
11
13
|
title?: ReactNode;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type CardSummaryItemProps } from './CardSummary.types';
|
|
3
|
-
export declare const CardSummaryItem: ({ label, value,
|
|
3
|
+
export declare const CardSummaryItem: ({ label, value, summaryObjects, summaryObjectsDirection, valueButton, ...rest }: CardSummaryItemProps) => React.JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["label", "value", "
|
|
1
|
+
var _excluded = ["label", "value", "summaryObjects", "summaryObjectsDirection", "valueButton"];
|
|
2
2
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
3
3
|
import React, { useState } from 'react';
|
|
4
4
|
import AnimateHeight from 'react-animate-height';
|
|
@@ -9,13 +9,15 @@ import * as S from './CardSummary.styles';
|
|
|
9
9
|
export var CardSummaryItem = function CardSummaryItem(_ref) {
|
|
10
10
|
var label = _ref.label,
|
|
11
11
|
value = _ref.value,
|
|
12
|
-
|
|
12
|
+
summaryObjects = _ref.summaryObjects,
|
|
13
|
+
_ref$summaryObjectsDi = _ref.summaryObjectsDirection,
|
|
14
|
+
summaryObjectsDirection = _ref$summaryObjectsDi === void 0 ? 'row' : _ref$summaryObjectsDi,
|
|
13
15
|
valueButton = _ref.valueButton,
|
|
14
16
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
15
17
|
var _useState = useState(false),
|
|
16
18
|
isOpen = _useState[0],
|
|
17
19
|
setIsOpen = _useState[1];
|
|
18
|
-
var withObjects = !!(
|
|
20
|
+
var withObjects = !!(summaryObjects != null && summaryObjects.length);
|
|
19
21
|
var handleClick = function handleClick() {
|
|
20
22
|
setIsOpen(!isOpen);
|
|
21
23
|
};
|
|
@@ -29,8 +31,11 @@ export var CardSummaryItem = function CardSummaryItem(_ref) {
|
|
|
29
31
|
}, label, ":"), /*#__PURE__*/React.createElement(S.CardSummaryItemValue, null, value, " ", withObjects && icon))), valueButton && /*#__PURE__*/React.createElement(S.ValueButtonWrapper, null, valueButton)), withObjects && /*#__PURE__*/React.createElement(AnimateHeight, {
|
|
30
32
|
duration: ANIMATION_DURATION,
|
|
31
33
|
height: isOpen ? 'auto' : 0
|
|
32
|
-
}, /*#__PURE__*/React.createElement(S.CardSummaryItemObjects,
|
|
34
|
+
}, /*#__PURE__*/React.createElement(S.CardSummaryItemObjects, {
|
|
35
|
+
direction: summaryObjectsDirection
|
|
36
|
+
}, summaryObjects == null ? void 0 : summaryObjects.map(function (object) {
|
|
33
37
|
return /*#__PURE__*/React.createElement(S.CardSummaryItemObject, {
|
|
38
|
+
direction: summaryObjectsDirection,
|
|
34
39
|
key: object.key || uuid()
|
|
35
40
|
}, object);
|
|
36
41
|
}))));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-card",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "Card UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
],
|
|
36
36
|
"types": "dist/index.d.ts",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@synerise/ds-avatar": "^1.3.
|
|
38
|
+
"@synerise/ds-avatar": "^1.3.3",
|
|
39
39
|
"@synerise/ds-icon": "^1.14.1",
|
|
40
|
-
"@synerise/ds-tag": "^1.4.
|
|
41
|
-
"@synerise/ds-typography": "^1.1.
|
|
40
|
+
"@synerise/ds-tag": "^1.4.16",
|
|
41
|
+
"@synerise/ds-typography": "^1.1.11",
|
|
42
42
|
"@synerise/ds-utils": "^1.6.0",
|
|
43
43
|
"react-animate-height": "^2.0.23",
|
|
44
44
|
"react-visibility-sensor": "^5.1.1",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"styled-components": "^5.3.3",
|
|
52
52
|
"vitest": "4"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "8dfafc5d7278f09d430f1e7499782d05c76b47c0"
|
|
55
55
|
}
|