@synerise/ds-card 1.1.9 → 1.2.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 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
+ # [1.2.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-card@1.1.10...@synerise/ds-card@1.2.0) (2025-06-26)
7
+
8
+
9
+ ### Features
10
+
11
+ * **card:** add summary value button ([68d3d19](https://github.com/Synerise/synerise-design/commit/68d3d195bd6e83e158d1130122f230a97c419a91))
12
+
13
+
14
+
15
+
16
+
17
+ ## [1.1.10](https://github.com/Synerise/synerise-design/compare/@synerise/ds-card@1.1.9...@synerise/ds-card@1.1.10) (2025-06-24)
18
+
19
+ **Note:** Version bump only for package @synerise/ds-card
20
+
21
+
22
+
23
+
24
+
6
25
  ## [1.1.9](https://github.com/Synerise/synerise-design/compare/@synerise/ds-card@1.1.8...@synerise/ds-card@1.1.9) (2025-06-05)
7
26
 
8
27
  **Note:** Version bump only for package @synerise/ds-card
@@ -1,26 +1,20 @@
1
1
  /// <reference types="react" />
2
- import BaseAnimateHeight from 'react-animate-height';
3
- export declare const AnimateHeight: import("styled-components").StyledComponent<typeof BaseAnimateHeight, any, {
4
- isOpen: boolean;
5
- duration: number;
6
- }, never>;
7
2
  export declare const CardSummaryWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
8
3
  export declare const CardSummaryTitle: import("styled-components").StyledComponent<({ level, withoutMargin, children, className, ellipsis, ...antdProps }: import("@synerise/ds-typography/dist/Title.types").Props) => import("react").JSX.Element, any, {}, never>;
9
4
  export declare const CardSummaryList: import("styled-components").StyledComponent<"div", any, {}, never>;
10
5
  export declare const CardSummaryItemWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
6
+ export declare const ValueButtonWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
7
+ export declare const CardSummaryItemDetailsWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
11
8
  export declare const CardSummaryItemDetails: import("styled-components").StyledComponent<"div", any, {}, never>;
9
+ export declare const CardSummaryItemLabelValueWrapper: import("styled-components").StyledComponent<"span", any, {}, never>;
12
10
  export declare const CardSummaryItemLabel: import("styled-components").StyledComponent<({ size, className, children, ellipsis }: {
13
11
  size?: import("@synerise/ds-typography").TextSize | undefined;
14
12
  ellipsis?: import("@synerise/ds-typography/dist/Ellipsis").EllipsisProps | undefined;
15
13
  children?: import("react").ReactNode;
16
14
  className?: string | undefined;
17
15
  }) => import("react").JSX.Element, any, {}, never>;
18
- export declare const CardSummaryItemValue: import("styled-components").StyledComponent<({ size, className, children, ellipsis }: {
19
- size?: import("@synerise/ds-typography").TextSize | undefined;
20
- ellipsis?: import("@synerise/ds-typography/dist/Ellipsis").EllipsisProps | undefined;
21
- children?: import("react").ReactNode;
22
- className?: string | undefined;
23
- }) => import("react").JSX.Element, any, {}, never>;
16
+ export declare const CardSummaryItemValue: import("styled-components").StyledComponent<"span", any, {}, never>;
17
+ export declare const IconWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
24
18
  export declare const Icon: import("styled-components").StyledComponent<({ name, component, className, ...rest }: import("@synerise/ds-icon").IconProps) => import("react").JSX.Element, any, {
25
19
  isOpen: boolean;
26
20
  }, never>;
@@ -1,55 +1,62 @@
1
1
  import styled from 'styled-components';
2
- import BaseAnimateHeight from 'react-animate-height';
3
- import { Title, Text } from '@synerise/ds-typography';
2
+ import { Title, Text, macro } from '@synerise/ds-typography';
4
3
  import DSIcon from '@synerise/ds-icon';
5
4
  import { Tag } from '@synerise/ds-tag/dist/Tag.styles';
6
- export var AnimateHeight = styled(BaseAnimateHeight).withConfig({
7
- displayName: "CardSummarystyles__AnimateHeight",
8
- componentId: "sc-1yj41os-0"
9
- })(["margin-top:", ";transition:margin ", "ms;"], function (props) {
10
- return props.isOpen ? '0' : '-8px';
11
- }, function (props) {
12
- return props.duration;
13
- });
14
5
  export var CardSummaryWrapper = styled.div.withConfig({
15
6
  displayName: "CardSummarystyles__CardSummaryWrapper",
16
- componentId: "sc-1yj41os-1"
7
+ componentId: "sc-1yj41os-0"
17
8
  })([""]);
18
9
  export var CardSummaryTitle = styled(Title).withConfig({
19
10
  displayName: "CardSummarystyles__CardSummaryTitle",
20
- componentId: "sc-1yj41os-2"
11
+ componentId: "sc-1yj41os-1"
21
12
  })([""]);
22
13
  export var CardSummaryList = styled.div.withConfig({
23
14
  displayName: "CardSummarystyles__CardSummaryList",
24
- componentId: "sc-1yj41os-3"
25
- })(["display:flex;flex-direction:column;gap:8px;"]);
15
+ componentId: "sc-1yj41os-2"
16
+ })([""]);
26
17
  export var CardSummaryItemWrapper = styled.div.withConfig({
27
18
  displayName: "CardSummarystyles__CardSummaryItemWrapper",
19
+ componentId: "sc-1yj41os-3"
20
+ })([""]);
21
+ export var ValueButtonWrapper = styled.div.withConfig({
22
+ displayName: "CardSummarystyles__ValueButtonWrapper",
28
23
  componentId: "sc-1yj41os-4"
29
- })(["display:flex;flex-direction:column;gap:8px;"]);
24
+ })(["align-self:flex-start;"]);
25
+ export var CardSummaryItemDetailsWrapper = styled.div.withConfig({
26
+ displayName: "CardSummarystyles__CardSummaryItemDetailsWrapper",
27
+ componentId: "sc-1yj41os-5"
28
+ })(["display:flex;align-items:center;gap:12px;"]);
30
29
  export var CardSummaryItemDetails = styled.div.withConfig({
31
30
  displayName: "CardSummarystyles__CardSummaryItemDetails",
32
- componentId: "sc-1yj41os-5"
33
- })(["&:before{content:'\u2022';margin-right:8px;}display:flex;gap:4px;line-height:24px;"]);
31
+ componentId: "sc-1yj41os-6"
32
+ })(["&:before{content:'\u2022';margin-right:8px;}display:flex;gap:4px;line-height:24px;padding:4px 0;"]);
33
+ export var CardSummaryItemLabelValueWrapper = styled.span.withConfig({
34
+ displayName: "CardSummarystyles__CardSummaryItemLabelValueWrapper",
35
+ componentId: "sc-1yj41os-7"
36
+ })(["align-self:center;word-break:break-all;"]);
34
37
  export var CardSummaryItemLabel = styled(Text).withConfig({
35
38
  displayName: "CardSummarystyles__CardSummaryItemLabel",
36
- componentId: "sc-1yj41os-6"
37
- })(["line-height:24px;"]);
38
- export var CardSummaryItemValue = styled(Text).withConfig({
39
+ componentId: "sc-1yj41os-8"
40
+ })(["line-height:24px;margin-right:4px;"]);
41
+ export var CardSummaryItemValue = styled.span.withConfig({
39
42
  displayName: "CardSummarystyles__CardSummaryItemValue",
40
- componentId: "sc-1yj41os-7"
41
- })(["line-height:24px;font-weight:500;"]);
43
+ componentId: "sc-1yj41os-9"
44
+ })(["", " line-height:24px;"], macro.h200);
45
+ export var IconWrapper = styled.div.withConfig({
46
+ displayName: "CardSummarystyles__IconWrapper",
47
+ componentId: "sc-1yj41os-10"
48
+ })(["display:inline-block;height:24px;"]);
42
49
  export var Icon = styled(DSIcon).withConfig({
43
50
  displayName: "CardSummarystyles__Icon",
44
- componentId: "sc-1yj41os-8"
51
+ componentId: "sc-1yj41os-11"
45
52
  })(["transform:rotate(", "deg);"], function (props) {
46
53
  return props.isOpen ? '180' : '0';
47
54
  });
48
55
  export var CardSummaryItemObjects = styled.div.withConfig({
49
56
  displayName: "CardSummarystyles__CardSummaryItemObjects",
50
- componentId: "sc-1yj41os-9"
51
- })(["display:flex;gap:8px;margin-left:16px;"]);
57
+ componentId: "sc-1yj41os-12"
58
+ })(["display:flex;gap:8px;margin-left:16px;margin-top:8px;"]);
52
59
  export var CardSummaryItemObject = styled.div.withConfig({
53
60
  displayName: "CardSummarystyles__CardSummaryItemObject",
54
- componentId: "sc-1yj41os-10"
61
+ componentId: "sc-1yj41os-13"
55
62
  })(["flex-basis:25%;min-width:0;", "{margin-left:0;}"], Tag);
@@ -4,6 +4,7 @@ export type CardSummaryItemProps = WithHTMLAttributes<HTMLDivElement, {
4
4
  key: Key;
5
5
  label?: ReactNode;
6
6
  value: ReactNode;
7
+ valueButton?: ReactNode;
7
8
  summaryRowObjects?: ReactElement[];
8
9
  }>;
9
10
  export type CardSummaryProps = WithHTMLAttributes<HTMLDivElement, {
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import { CardSummaryItemProps } from './CardSummary.types';
3
- export declare const CardSummaryItem: ({ label, value, summaryRowObjects, ...rest }: CardSummaryItemProps) => React.JSX.Element;
3
+ export declare const CardSummaryItem: ({ label, value, summaryRowObjects, valueButton, ...rest }: CardSummaryItemProps) => React.JSX.Element;
@@ -1,7 +1,8 @@
1
- var _excluded = ["label", "value", "summaryRowObjects"];
1
+ var _excluded = ["label", "value", "summaryRowObjects", "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 { v4 as uuid } from 'uuid';
5
+ import AnimateHeight from 'react-animate-height';
5
6
  import { AngleDownS } from '@synerise/ds-icon';
6
7
  import * as S from './CardSummary.styles';
7
8
  import { ANIMATION_DURATION } from '../constants';
@@ -9,6 +10,7 @@ export var CardSummaryItem = function CardSummaryItem(_ref) {
9
10
  var label = _ref.label,
10
11
  value = _ref.value,
11
12
  summaryRowObjects = _ref.summaryRowObjects,
13
+ valueButton = _ref.valueButton,
12
14
  rest = _objectWithoutPropertiesLoose(_ref, _excluded);
13
15
  var _useState = useState(false),
14
16
  isOpen = _useState[0],
@@ -17,19 +19,16 @@ export var CardSummaryItem = function CardSummaryItem(_ref) {
17
19
  var handleClick = function handleClick() {
18
20
  setIsOpen(!isOpen);
19
21
  };
20
- var icon = /*#__PURE__*/React.createElement(S.Icon, {
22
+ var icon = /*#__PURE__*/React.createElement(S.IconWrapper, null, /*#__PURE__*/React.createElement(S.Icon, {
21
23
  isOpen: isOpen,
22
24
  component: /*#__PURE__*/React.createElement(AngleDownS, null),
23
25
  onClick: handleClick
24
- });
25
- return /*#__PURE__*/React.createElement(S.CardSummaryItemWrapper, rest, /*#__PURE__*/React.createElement(S.CardSummaryItemDetails, null, label && /*#__PURE__*/React.createElement(S.CardSummaryItemLabel, {
26
+ }));
27
+ return /*#__PURE__*/React.createElement(S.CardSummaryItemWrapper, rest, /*#__PURE__*/React.createElement(S.CardSummaryItemDetailsWrapper, null, /*#__PURE__*/React.createElement(S.CardSummaryItemDetails, null, /*#__PURE__*/React.createElement(S.CardSummaryItemLabelValueWrapper, null, label && /*#__PURE__*/React.createElement(S.CardSummaryItemLabel, {
26
28
  size: "small"
27
- }, label, ":"), /*#__PURE__*/React.createElement(S.CardSummaryItemValue, {
28
- size: "small"
29
- }, value, " ", withObjects && icon)), withObjects && /*#__PURE__*/React.createElement(S.AnimateHeight, {
29
+ }, label, ":"), /*#__PURE__*/React.createElement(S.CardSummaryItemValue, null, value, " ", withObjects && icon))), valueButton && /*#__PURE__*/React.createElement(S.ValueButtonWrapper, null, valueButton)), withObjects && /*#__PURE__*/React.createElement(AnimateHeight, {
30
30
  duration: ANIMATION_DURATION,
31
- height: isOpen ? 'auto' : 0,
32
- isOpen: isOpen
31
+ height: isOpen ? 'auto' : 0
33
32
  }, /*#__PURE__*/React.createElement(S.CardSummaryItemObjects, null, summaryRowObjects == null ? void 0 : summaryRowObjects.map(function (object) {
34
33
  return /*#__PURE__*/React.createElement(S.CardSummaryItemObject, {
35
34
  key: object.key || uuid()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-card",
3
- "version": "1.1.9",
3
+ "version": "1.2.0",
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": "^1.0.10",
38
- "@synerise/ds-icon": "^1.5.2",
39
- "@synerise/ds-tag": "^1.1.9",
40
- "@synerise/ds-typography": "^1.0.10",
41
- "@synerise/ds-utils": "^1.2.0",
37
+ "@synerise/ds-avatar": "^1.0.12",
38
+ "@synerise/ds-icon": "^1.5.3",
39
+ "@synerise/ds-tag": "^1.1.11",
40
+ "@synerise/ds-typography": "^1.0.12",
41
+ "@synerise/ds-utils": "^1.3.0",
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 <= 18.3.1",
50
50
  "styled-components": "^5.3.3"
51
51
  },
52
- "gitHead": "93bc81d59d20bc8f3bc80c5d56ae7f7c0838380d"
52
+ "gitHead": "11fe1d29b2ac23e70c3d5e6ce8ae20201a619a34"
53
53
  }