@synerise/ds-card 1.3.1 → 1.3.3
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/README.md +7 -7
- package/dist/Card/Card.d.ts +2 -2
- package/dist/Card/Card.js +67 -101
- package/dist/Card/Card.styles.d.ts +14 -14
- package/dist/Card/Card.styles.js +51 -79
- package/dist/Card/Card.types.d.ts +2 -2
- package/dist/Card/Card.types.js +1 -1
- package/dist/CardBadge/CardBadge.d.ts +2 -2
- package/dist/CardBadge/CardBadge.js +10 -17
- package/dist/CardBadge/CardBadge.styles.d.ts +2 -2
- package/dist/CardBadge/CardBadge.styles.js +20 -23
- package/dist/CardBadge/CardBadge.types.d.ts +1 -1
- package/dist/CardBadge/CardBadge.types.js +1 -1
- package/dist/CardGroup/CardGroup.d.ts +2 -2
- package/dist/CardGroup/CardGroup.js +11 -13
- package/dist/CardGroup/CardGroup.styles.d.ts +1 -1
- package/dist/CardGroup/CardGroup.styles.js +6 -7
- package/dist/CardGroup/CardGroup.types.d.ts +2 -2
- package/dist/CardGroup/CardGroup.types.js +1 -1
- package/dist/CardSummary/CardSummary.d.ts +2 -2
- package/dist/CardSummary/CardSummary.js +20 -21
- package/dist/CardSummary/CardSummary.styles.d.ts +19 -19
- package/dist/CardSummary/CardSummary.styles.js +52 -30
- package/dist/CardSummary/CardSummary.types.d.ts +2 -2
- package/dist/CardSummary/CardSummary.types.js +1 -1
- package/dist/CardSummary/CardSummaryItem.d.ts +2 -2
- package/dist/CardSummary/CardSummaryItem.js +40 -40
- package/dist/constants.js +4 -1
- package/dist/index.js +19 -12
- package/dist/modules.d.js +1 -1
- package/dist/modules.d.ts +0 -0
- package/package.json +11 -11
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.3.3](https://github.com/Synerise/synerise-design/compare/@synerise/ds-card@1.3.2...@synerise/ds-card@1.3.3) (2026-03-24)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-card
|
|
9
|
+
|
|
10
|
+
## [1.3.2](https://github.com/Synerise/synerise-design/compare/@synerise/ds-card@1.3.1...@synerise/ds-card@1.3.2) (2026-03-20)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @synerise/ds-card
|
|
13
|
+
|
|
6
14
|
## [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
15
|
|
|
8
16
|
**Note:** Version bump only for package @synerise/ds-card
|
package/README.md
CHANGED
|
@@ -72,9 +72,9 @@ yarn add @synerise/ds-card
|
|
|
72
72
|
|
|
73
73
|
| Property | Description | Type | Default |
|
|
74
74
|
| -------------------------------- | --------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ------- |
|
|
75
|
-
| background | Background of Card container | `white` / `white-shadow` / `grey` / `grey-shadow` / `outline` | `white` |
|
|
75
|
+
| background | Background of Card container | `white` / `white-shadow` / `grey` / `grey-shadow` / `outline` | `white-shadow` |
|
|
76
76
|
| children | Defines if the button casts a shadow when the cursor is hovered over | React.ReactNode | - |
|
|
77
|
-
| renderBadge | Custom slot content for badge icon | React.ReactNode
|
|
77
|
+
| renderBadge | Custom slot content for badge icon | `() => React.ReactNode` | - |
|
|
78
78
|
| className | Defines the class name of the container | string | - |
|
|
79
79
|
| compactHeader | Set as `true`, displays the description next to the header. Set as `false`, displays the description below the header | boolean | - |
|
|
80
80
|
| description | Defines the content of the card description (in the header) | React.ReactNode | string |
|
|
@@ -89,8 +89,7 @@ yarn add @synerise/ds-card
|
|
|
89
89
|
| lively | Defines if the container casts a shadow when the cursor is hovered over | boolean | - |
|
|
90
90
|
| raised | Defines if the container casts a shadow on the background | boolean | - |
|
|
91
91
|
| style | Defines the CSS of the container | React.CSSProperties | - |
|
|
92
|
-
|
|
|
93
|
-
| title | Defines the title of the card (in the header) | string | - |
|
|
92
|
+
| title | Defines the title of the card (in the header) | React.ReactNode | - |
|
|
94
93
|
| titleTag | an optional status tag next to title | ReactElement | - |
|
|
95
94
|
| withHeader | Defines if the header is shown | boolean | - |
|
|
96
95
|
| withoutPadding | Reset padding of ContentContainer | boolean | `false` |
|
|
@@ -101,8 +100,8 @@ yarn add @synerise/ds-card
|
|
|
101
100
|
|
|
102
101
|
| Property | Description | Type | Default |
|
|
103
102
|
| -------- | ----------------------------------- | ------------------------------------------- | --------- |
|
|
104
|
-
|
|
|
105
|
-
|
|
|
103
|
+
| icon | Icon rendered in badge | React.ReactNode | - |
|
|
104
|
+
| status | Defines the color of badge and icon | `success` / `checked` / `error` / `warning` / `default` | `default` |
|
|
106
105
|
|
|
107
106
|
#### CardSummary
|
|
108
107
|
|
|
@@ -120,5 +119,6 @@ Renders a summary in a bulletted list form. Can be assigned to Card.staticConten
|
|
|
120
119
|
| key | Unique key | `React.Key` | - |
|
|
121
120
|
| label | Optional label to display | `React.ReactNode` | - |
|
|
122
121
|
| value | Mandatory value to display | `React.ReactNode` | - |
|
|
122
|
+
| valueButton | Optional action button placed to the right of the value | `React.ReactNode` | - |
|
|
123
123
|
| summaryObjects | Optional array of react elements, renders in a toggleable container | `React.ReactElement[]` | - |
|
|
124
|
-
| summaryObjectsDirection | Direction of summary objects layout | `'row'` / `'column'` |
|
|
124
|
+
| summaryObjectsDirection | Direction of summary objects layout | `'row'` / `'column'` | `'row'` |
|
package/dist/Card/Card.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CardProps } from './Card.types';
|
|
3
3
|
declare const Card: ({ children, raised, disabled, className, lively, withHeader, defaultHeaderBackgroundColor, title, description, compactHeader, icon, avatar, renderBadge, iconColor, headerSideChildren, onHeaderClick, withoutPadding, headerBorderBottom, background, hideContent, staticContent, titleTag, showSideChildrenWhenHeaderHidden, ...htmlAttributes }: CardProps) => React.JSX.Element;
|
|
4
4
|
export default Card;
|
package/dist/Card/Card.js
CHANGED
|
@@ -1,107 +1,73 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
var _useState = useState(false),
|
|
38
|
-
headerActionsVisible = _useState[0],
|
|
39
|
-
setHeaderActionsVisible = _useState[1];
|
|
40
|
-
var renderTitle = function renderTitle() {
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import AnimateHeight from "react-animate-height";
|
|
4
|
+
import VisibilitySensor from "react-visibility-sensor";
|
|
5
|
+
import Icon from "@synerise/ds-icon";
|
|
6
|
+
import { ANIMATION_DURATION } from "../constants.js";
|
|
7
|
+
import { Container, Header, IconContainer, HeaderContent, Description, HeaderSideChildren, ChildrenContainer, PaddingWrapper, FooterContainer, TitleWrapper, Title, TitleTag } from "./Card.styles.js";
|
|
8
|
+
const Card = ({
|
|
9
|
+
children,
|
|
10
|
+
raised,
|
|
11
|
+
disabled,
|
|
12
|
+
className,
|
|
13
|
+
lively,
|
|
14
|
+
withHeader,
|
|
15
|
+
defaultHeaderBackgroundColor,
|
|
16
|
+
title,
|
|
17
|
+
description,
|
|
18
|
+
compactHeader,
|
|
19
|
+
icon,
|
|
20
|
+
avatar,
|
|
21
|
+
renderBadge,
|
|
22
|
+
iconColor,
|
|
23
|
+
headerSideChildren,
|
|
24
|
+
onHeaderClick,
|
|
25
|
+
withoutPadding,
|
|
26
|
+
headerBorderBottom,
|
|
27
|
+
background = "white-shadow",
|
|
28
|
+
hideContent,
|
|
29
|
+
staticContent,
|
|
30
|
+
titleTag,
|
|
31
|
+
showSideChildrenWhenHeaderHidden,
|
|
32
|
+
...htmlAttributes
|
|
33
|
+
}) => {
|
|
34
|
+
const fatTitle = !description || description && compactHeader;
|
|
35
|
+
const [headerActionsVisible, setHeaderActionsVisible] = useState(false);
|
|
36
|
+
const renderTitle = () => {
|
|
41
37
|
if (!title && !titleTag) {
|
|
42
38
|
return null;
|
|
43
39
|
}
|
|
44
|
-
return
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}, title && /*#__PURE__*/React.createElement(S.Title, {
|
|
49
|
-
level: 4,
|
|
50
|
-
fat: !!fatTitle
|
|
51
|
-
}, title), titleTag && /*#__PURE__*/React.createElement(S.TitleTag, null, titleTag));
|
|
40
|
+
return /* @__PURE__ */ jsxs(TitleWrapper, { "data-testid": "card-title", compact: compactHeader, description: Boolean(description), children: [
|
|
41
|
+
title && /* @__PURE__ */ jsx(Title, { level: 4, fat: !!fatTitle, children: title }),
|
|
42
|
+
titleTag && /* @__PURE__ */ jsx(TitleTag, { children: titleTag })
|
|
43
|
+
] });
|
|
52
44
|
};
|
|
53
|
-
return
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}, description)), headerSideChildren && /*#__PURE__*/React.createElement(VisibilitySensor, {
|
|
77
|
-
partialVisibility: true,
|
|
78
|
-
onChange: setHeaderActionsVisible
|
|
79
|
-
}, /*#__PURE__*/React.createElement(S.HeaderSideChildren, {
|
|
80
|
-
onClick: function onClick(event) {
|
|
81
|
-
return event.stopPropagation();
|
|
45
|
+
return /* @__PURE__ */ jsxs(
|
|
46
|
+
Container,
|
|
47
|
+
{
|
|
48
|
+
raised,
|
|
49
|
+
disabled,
|
|
50
|
+
className: `ds-card ${className || ""}`,
|
|
51
|
+
lively,
|
|
52
|
+
"data-testid": "card-wrapper",
|
|
53
|
+
background,
|
|
54
|
+
...htmlAttributes,
|
|
55
|
+
children: [
|
|
56
|
+
withHeader && /* @__PURE__ */ jsxs(Header, { onClick: onHeaderClick, headerBorderBottom, defaultHeaderBackgroundColor, children: [
|
|
57
|
+
icon && /* @__PURE__ */ jsx(IconContainer, { description, compact: compactHeader, children: /* @__PURE__ */ jsx(Icon, { component: icon, color: iconColor }) }) || avatar || renderBadge && renderBadge(),
|
|
58
|
+
/* @__PURE__ */ jsxs(HeaderContent, { compact: compactHeader, hasIconOrAvatar: Boolean(icon || avatar), children: [
|
|
59
|
+
renderTitle(),
|
|
60
|
+
description && /* @__PURE__ */ jsx(Description, { "data-testid": "card-description", children: description })
|
|
61
|
+
] }),
|
|
62
|
+
headerSideChildren && /* @__PURE__ */ jsx(VisibilitySensor, { partialVisibility: true, onChange: setHeaderActionsVisible, children: /* @__PURE__ */ jsx(HeaderSideChildren, { onClick: (event) => event.stopPropagation(), children: headerSideChildren }) })
|
|
63
|
+
] }),
|
|
64
|
+
staticContent && /* @__PURE__ */ jsx(AnimateHeight, { className: "static-content-card-animation", duration: ANIMATION_DURATION, height: hideContent ? "auto" : 0, children: /* @__PURE__ */ jsx(ChildrenContainer, { "data-testid": "card-static-content", children: /* @__PURE__ */ jsx(PaddingWrapper, { withoutPadding, withHeader, children: staticContent }) }) }),
|
|
65
|
+
/* @__PURE__ */ jsx(AnimateHeight, { className: "card-animation", duration: ANIMATION_DURATION, height: hideContent ? 0 : "auto", children: /* @__PURE__ */ jsx(ChildrenContainer, { "data-testid": "card-content", children: /* @__PURE__ */ jsx(PaddingWrapper, { withoutPadding, withHeader, children }) }) }),
|
|
66
|
+
showSideChildrenWhenHeaderHidden && /* @__PURE__ */ jsx(AnimateHeight, { className: "card-animation-footer", duration: 0, height: headerSideChildren && !headerActionsVisible ? "auto" : 0, children: /* @__PURE__ */ jsx(FooterContainer, { children: headerSideChildren }) })
|
|
67
|
+
]
|
|
82
68
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}, /*#__PURE__*/React.createElement(S.ChildrenContainer, {
|
|
88
|
-
"data-testid": "card-static-content"
|
|
89
|
-
}, /*#__PURE__*/React.createElement(S.PaddingWrapper, {
|
|
90
|
-
withoutPadding: withoutPadding,
|
|
91
|
-
withHeader: withHeader
|
|
92
|
-
}, staticContent))), /*#__PURE__*/React.createElement(AnimateHeight, {
|
|
93
|
-
className: "card-animation",
|
|
94
|
-
duration: ANIMATION_DURATION,
|
|
95
|
-
height: hideContent ? 0 : 'auto'
|
|
96
|
-
}, /*#__PURE__*/React.createElement(S.ChildrenContainer, {
|
|
97
|
-
"data-testid": "card-content"
|
|
98
|
-
}, /*#__PURE__*/React.createElement(S.PaddingWrapper, {
|
|
99
|
-
withoutPadding: withoutPadding,
|
|
100
|
-
withHeader: withHeader
|
|
101
|
-
}, children))), showSideChildrenWhenHeaderHidden && /*#__PURE__*/React.createElement(AnimateHeight, {
|
|
102
|
-
className: "card-animation-footer",
|
|
103
|
-
duration: 0,
|
|
104
|
-
height: headerSideChildren && !headerActionsVisible ? 'auto' : 0
|
|
105
|
-
}, /*#__PURE__*/React.createElement(S.FooterContainer, null, headerSideChildren)));
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
export {
|
|
72
|
+
Card as default
|
|
106
73
|
};
|
|
107
|
-
export default Card;
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
export declare const HeaderSideChildren: import(
|
|
4
|
-
export declare const IconContainer: import(
|
|
1
|
+
import { MouseEventHandler, ReactNode } from 'react';
|
|
2
|
+
import { Backgrounds } from './Card.types';
|
|
3
|
+
export declare const HeaderSideChildren: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
4
|
+
export declare const IconContainer: import('styled-components').StyledComponent<"div", any, {
|
|
5
5
|
compact?: boolean;
|
|
6
6
|
description?: ReactNode;
|
|
7
7
|
}, never>;
|
|
8
|
-
export declare const Container: import(
|
|
8
|
+
export declare const Container: import('styled-components').StyledComponent<"div", any, {
|
|
9
9
|
raised?: boolean;
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
lively?: boolean;
|
|
12
12
|
background: Backgrounds;
|
|
13
13
|
}, never>;
|
|
14
|
-
export declare const Header: import(
|
|
14
|
+
export declare const Header: import('styled-components').StyledComponent<"div", any, {
|
|
15
15
|
onClick?: MouseEventHandler;
|
|
16
16
|
headerBorderBottom?: boolean;
|
|
17
17
|
defaultHeaderBackgroundColor?: boolean;
|
|
18
18
|
}, never>;
|
|
19
|
-
export declare const Title: import(
|
|
19
|
+
export declare const Title: import('styled-components').StyledComponent<({ level, withoutMargin, children, className, ellipsis, ...antdProps }: import('@synerise/ds-typography/dist/Title.types').Props) => React.JSX.Element, any, {
|
|
20
20
|
fat: boolean;
|
|
21
21
|
}, never>;
|
|
22
|
-
export declare const TitleWrapper: import(
|
|
22
|
+
export declare const TitleWrapper: import('styled-components').StyledComponent<"div", any, {
|
|
23
23
|
compact?: boolean;
|
|
24
24
|
description?: boolean;
|
|
25
25
|
}, never>;
|
|
26
|
-
export declare const TitleTag: import(
|
|
27
|
-
export declare const Description: import(
|
|
28
|
-
export declare const HeaderContent: import(
|
|
26
|
+
export declare const TitleTag: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
27
|
+
export declare const Description: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
28
|
+
export declare const HeaderContent: import('styled-components').StyledComponent<"div", any, {
|
|
29
29
|
compact?: boolean;
|
|
30
30
|
hasIconOrAvatar: boolean;
|
|
31
31
|
}, never>;
|
|
32
|
-
export declare const ChildrenContainer: import(
|
|
33
|
-
export declare const PaddingWrapper: import(
|
|
32
|
+
export declare const ChildrenContainer: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
33
|
+
export declare const PaddingWrapper: import('styled-components').StyledComponent<"div", any, {
|
|
34
34
|
withHeader?: boolean;
|
|
35
35
|
withoutPadding?: boolean;
|
|
36
36
|
}, never>;
|
|
37
|
-
export declare const FooterContainer: import(
|
|
37
|
+
export declare const FooterContainer: import('styled-components').StyledComponent<"div", any, {}, never>;
|
package/dist/Card/Card.styles.js
CHANGED
|
@@ -1,120 +1,92 @@
|
|
|
1
|
-
import styled, { css } from
|
|
2
|
-
import { Title as
|
|
3
|
-
import { CardSummaryWrapper } from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import styled, { css } from "styled-components";
|
|
2
|
+
import { Title as Title$1 } from "@synerise/ds-typography";
|
|
3
|
+
import { CardSummaryWrapper } from "../CardSummary/CardSummary.styles.js";
|
|
4
|
+
const whiteBg = ["white", "white-shadow"];
|
|
5
|
+
const greyBg = ["grey", "grey-shadow"];
|
|
6
|
+
const withBoxShadow = ["white-shadow", "grey-shadow"];
|
|
7
|
+
const withOutline = ["outline"];
|
|
8
|
+
const backgroundColor = (props) => {
|
|
9
9
|
if (whiteBg.includes(props.background)) {
|
|
10
10
|
return props.theme.palette.white;
|
|
11
11
|
}
|
|
12
12
|
if (greyBg.includes(props.background)) {
|
|
13
|
-
return props.theme.palette[
|
|
13
|
+
return props.theme.palette["grey-050"];
|
|
14
14
|
}
|
|
15
15
|
return props.theme.palette.transparent;
|
|
16
16
|
};
|
|
17
|
-
|
|
17
|
+
const boxShadow = (props) => {
|
|
18
18
|
if (withBoxShadow.includes(props.background)) {
|
|
19
|
-
return
|
|
19
|
+
return `0 4px 12px 0 rgba(35, 41, 54, 0.04)`;
|
|
20
20
|
}
|
|
21
21
|
if (withOutline.includes(props.background)) {
|
|
22
|
-
return props.theme.palette[
|
|
22
|
+
return `${props.theme.palette["grey-200"]} 0px 0px 0px 1px inset`;
|
|
23
23
|
}
|
|
24
|
-
return
|
|
24
|
+
return "none";
|
|
25
25
|
};
|
|
26
|
-
|
|
26
|
+
const HeaderSideChildren = /* @__PURE__ */ styled.div.withConfig({
|
|
27
27
|
displayName: "Cardstyles__HeaderSideChildren",
|
|
28
28
|
componentId: "sc-18exblx-0"
|
|
29
29
|
})(["position:relative;padding-left:24px;"]);
|
|
30
|
-
|
|
30
|
+
const IconContainer = /* @__PURE__ */ styled.div.withConfig({
|
|
31
31
|
displayName: "Cardstyles__IconContainer",
|
|
32
32
|
componentId: "sc-18exblx-1"
|
|
33
|
-
})(["display:flex;width:24px;height:", ";align-items:center;"],
|
|
34
|
-
|
|
35
|
-
});
|
|
36
|
-
export var Container = styled.div.withConfig({
|
|
33
|
+
})(["display:flex;width:24px;height:", ";align-items:center;"], (props) => props.description && !props.compact ? "24px" : "32px");
|
|
34
|
+
const Container = /* @__PURE__ */ styled.div.withConfig({
|
|
37
35
|
displayName: "Cardstyles__Container",
|
|
38
36
|
componentId: "sc-18exblx-2"
|
|
39
|
-
})(["background-color:", ";box-shadow:", ";border-radius:", ";display:flex;flex-flow:column;width:100%;.card-animation{> *{transition:opacity 0.3s ease;opacity:0;}&.rah-static--height-auto{> *{opacity:1;}}}", " ", ";", ""],
|
|
40
|
-
|
|
41
|
-
}, function (props) {
|
|
42
|
-
return props.background ? boxShadow(props) : 'none';
|
|
43
|
-
}, function (props) {
|
|
44
|
-
return props.theme.variable('@border-radius-base');
|
|
45
|
-
}, function (props) {
|
|
46
|
-
return !!props.raised && css(["box-shadow:", ";"], props.theme.variable('@box-shadow-active'));
|
|
47
|
-
}, function (props) {
|
|
48
|
-
return !!props.disabled && css(["pointer-events:none;opacity:0.4;", "{opacity:0.16;}", "{opacity:0.4;}"], HeaderSideChildren, IconContainer);
|
|
49
|
-
}, function (props) {
|
|
50
|
-
return !!props.lively && css(["&:hover{box-shadow:", ";}"], props.theme.variable('@box-shadow-active'));
|
|
51
|
-
});
|
|
52
|
-
export var Header = styled.div.withConfig({
|
|
37
|
+
})(["background-color:", ";box-shadow:", ";border-radius:", ";display:flex;flex-flow:column;width:100%;.card-animation{> *{transition:opacity 0.3s ease;opacity:0;}&.rah-static--height-auto{> *{opacity:1;}}}", " ", ";", ""], (props) => props.background ? backgroundColor(props) : props.theme.palette.transparent, (props) => props.background ? boxShadow(props) : "none", (props) => props.theme.variable("@border-radius-base"), (props) => !!props.raised && css(["box-shadow:", ";"], props.theme.variable("@box-shadow-active")), (props) => !!props.disabled && css(["pointer-events:none;opacity:0.4;", "{opacity:0.16;}", "{opacity:0.4;}"], HeaderSideChildren, IconContainer), (props) => !!props.lively && css(["&:hover{box-shadow:", ";}"], props.theme.variable("@box-shadow-active")));
|
|
38
|
+
const Header = /* @__PURE__ */ styled.div.withConfig({
|
|
53
39
|
displayName: "Cardstyles__Header",
|
|
54
40
|
componentId: "sc-18exblx-3"
|
|
55
|
-
})(["padding:24px 24px 24px 24px;display:flex;flex-direction:row;flex-wrap:nowrap;align-items:flex-start;position:relative;&:after{position:absolute;bottom:0;left:24px;right:24px;height:1px;content:'';display:", ";background-color:", ";}&:hover{", "}", ""],
|
|
56
|
-
|
|
57
|
-
}, function (props) {
|
|
58
|
-
return props.theme.palette['grey-100'];
|
|
59
|
-
}, function (props) {
|
|
60
|
-
return !!props.onClick && "cursor:pointer;";
|
|
61
|
-
}, function (props) {
|
|
62
|
-
return !!props.defaultHeaderBackgroundColor && css(["background-color:", ";"], props.theme.palette.white);
|
|
63
|
-
});
|
|
64
|
-
export var Title = styled(DSTitle).withConfig({
|
|
41
|
+
})(["padding:24px 24px 24px 24px;display:flex;flex-direction:row;flex-wrap:nowrap;align-items:flex-start;position:relative;&:after{position:absolute;bottom:0;left:24px;right:24px;height:1px;content:'';display:", ";background-color:", ";}&:hover{", "}", ""], (props) => props.headerBorderBottom ? "block" : "none", (props) => props.theme.palette["grey-100"], (props) => !!props.onClick && `cursor:pointer;`, (props) => !!props.defaultHeaderBackgroundColor && css(["background-color:", ";"], props.theme.palette.white));
|
|
42
|
+
const Title = /* @__PURE__ */ styled(Title$1).withConfig({
|
|
65
43
|
displayName: "Cardstyles__Title",
|
|
66
44
|
componentId: "sc-18exblx-4"
|
|
67
|
-
})(["&&{display:flex;align-items:center;min-height:", ";margin:0;line-height:1.4;}"],
|
|
68
|
-
|
|
69
|
-
});
|
|
70
|
-
export var TitleWrapper = styled.div.withConfig({
|
|
45
|
+
})(["&&{display:flex;align-items:center;min-height:", ";margin:0;line-height:1.4;}"], (props) => props.fat ? "32px" : "20px");
|
|
46
|
+
const TitleWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
71
47
|
displayName: "Cardstyles__TitleWrapper",
|
|
72
48
|
componentId: "sc-18exblx-5"
|
|
73
|
-
})(["display:flex;flex-direction:row;gap:4px;align-items:center;margin-bottom:", ";"],
|
|
74
|
-
|
|
75
|
-
});
|
|
76
|
-
export var TitleTag = styled.div.withConfig({
|
|
49
|
+
})(["display:flex;flex-direction:row;gap:4px;align-items:center;margin-bottom:", ";"], (props) => props.description && !props.compact ? "6px" : "0");
|
|
50
|
+
const TitleTag = /* @__PURE__ */ styled.div.withConfig({
|
|
77
51
|
displayName: "Cardstyles__TitleTag",
|
|
78
52
|
componentId: "sc-18exblx-6"
|
|
79
53
|
})([""]);
|
|
80
|
-
|
|
54
|
+
const Description = /* @__PURE__ */ styled.div.withConfig({
|
|
81
55
|
displayName: "Cardstyles__Description",
|
|
82
56
|
componentId: "sc-18exblx-7"
|
|
83
|
-
})(["&&{color:", ";font-size:13px;line-height:1.38;margin:0;}"],
|
|
84
|
-
|
|
85
|
-
});
|
|
86
|
-
export var HeaderContent = styled.div.withConfig({
|
|
57
|
+
})(["&&{color:", ";font-size:13px;line-height:1.38;margin:0;}"], (props) => props.theme.palette["grey-600"]);
|
|
58
|
+
const HeaderContent = /* @__PURE__ */ styled.div.withConfig({
|
|
87
59
|
displayName: "Cardstyles__HeaderContent",
|
|
88
60
|
componentId: "sc-18exblx-8"
|
|
89
|
-
})(["max-width:100%;flex:1;display:flex;flex-direction:", ";align-items:", ";margin:0 0 0 ", ";", ""],
|
|
90
|
-
return props.compact ? 'row' : 'column';
|
|
91
|
-
}, function (props) {
|
|
92
|
-
return props.compact ? 'center' : 'flex-start';
|
|
93
|
-
}, function (props) {
|
|
61
|
+
})(["max-width:100%;flex:1;display:flex;flex-direction:", ";align-items:", ";margin:0 0 0 ", ";", ""], (props) => props.compact ? "row" : "column", (props) => props.compact ? "center" : "flex-start", (props) => {
|
|
94
62
|
if (props.hasIconOrAvatar) {
|
|
95
|
-
return
|
|
63
|
+
return "24px";
|
|
96
64
|
}
|
|
97
|
-
return
|
|
98
|
-
},
|
|
99
|
-
|
|
100
|
-
});
|
|
101
|
-
export var ChildrenContainer = styled.div.withConfig({
|
|
65
|
+
return "0";
|
|
66
|
+
}, (props) => !!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"]));
|
|
67
|
+
const ChildrenContainer = /* @__PURE__ */ styled.div.withConfig({
|
|
102
68
|
displayName: "Cardstyles__ChildrenContainer",
|
|
103
69
|
componentId: "sc-18exblx-9"
|
|
104
70
|
})([""]);
|
|
105
|
-
|
|
71
|
+
const PaddingWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
106
72
|
displayName: "Cardstyles__PaddingWrapper",
|
|
107
73
|
componentId: "sc-18exblx-10"
|
|
108
|
-
})(["padding:", ";", " ", "{margin:0 48px;}"],
|
|
109
|
-
|
|
110
|
-
}, function (props) {
|
|
111
|
-
return !!props.withHeader && "padding-top: 0;";
|
|
112
|
-
}, CardSummaryWrapper);
|
|
113
|
-
export var FooterContainer = styled.div.withConfig({
|
|
74
|
+
})(["padding:", ";", " ", "{margin:0 48px;}"], (props) => props.withoutPadding ? "0" : `24px`, (props) => !!props.withHeader && `padding-top: 0;`, CardSummaryWrapper);
|
|
75
|
+
const FooterContainer = /* @__PURE__ */ styled.div.withConfig({
|
|
114
76
|
displayName: "Cardstyles__FooterContainer",
|
|
115
77
|
componentId: "sc-18exblx-11"
|
|
116
|
-
})(["padding:24px;display:flex;align-items:center;justify-content:flex-end;background:", ";border-top:solid 1px ", ";"],
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
78
|
+
})(["padding:24px;display:flex;align-items:center;justify-content:flex-end;background:", ";border-top:solid 1px ", ";"], (props) => props.theme.palette.white, (props) => props.theme.palette["grey-100"]);
|
|
79
|
+
export {
|
|
80
|
+
ChildrenContainer,
|
|
81
|
+
Container,
|
|
82
|
+
Description,
|
|
83
|
+
FooterContainer,
|
|
84
|
+
Header,
|
|
85
|
+
HeaderContent,
|
|
86
|
+
HeaderSideChildren,
|
|
87
|
+
IconContainer,
|
|
88
|
+
PaddingWrapper,
|
|
89
|
+
Title,
|
|
90
|
+
TitleTag,
|
|
91
|
+
TitleWrapper
|
|
92
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { CSSProperties, ReactNode, SyntheticEvent } from 'react';
|
|
2
|
+
import { WithHTMLAttributes } from '@synerise/ds-utils';
|
|
3
3
|
export type Backgrounds = 'white' | 'white-shadow' | 'grey' | 'grey-shadow' | 'outline';
|
|
4
4
|
export type CardProps = WithHTMLAttributes<HTMLDivElement, {
|
|
5
5
|
raised?: boolean;
|
package/dist/Card/Card.types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CardBadgeProps } from './CardBadge.types';
|
|
3
3
|
declare const CardBadge: ({ icon, status, ...props }: CardBadgeProps) => React.JSX.Element;
|
|
4
4
|
export default CardBadge;
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
12
|
-
return /*#__PURE__*/React.createElement(S.CardBadge, _extends({
|
|
13
|
-
status: status
|
|
14
|
-
}, props), /*#__PURE__*/React.createElement(Icon, {
|
|
15
|
-
component: icon
|
|
16
|
-
}));
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import Icon from "@synerise/ds-icon";
|
|
3
|
+
import { CardBadge as CardBadge$1 } from "./CardBadge.styles.js";
|
|
4
|
+
const CardBadge = ({
|
|
5
|
+
icon,
|
|
6
|
+
status = "default",
|
|
7
|
+
...props
|
|
8
|
+
}) => /* @__PURE__ */ jsx(CardBadge$1, { status, ...props, children: /* @__PURE__ */ jsx(Icon, { component: icon }) });
|
|
9
|
+
export {
|
|
10
|
+
CardBadge as default
|
|
17
11
|
};
|
|
18
|
-
export default CardBadge;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const CardBadge: import(
|
|
1
|
+
import { BadgeStatus } from './CardBadge.types';
|
|
2
|
+
export declare const CardBadge: import('styled-components').StyledComponent<"div", any, {
|
|
3
3
|
status: BadgeStatus;
|
|
4
4
|
}, never>;
|
|
@@ -1,28 +1,25 @@
|
|
|
1
|
-
import styled from
|
|
2
|
-
|
|
3
|
-
success:
|
|
4
|
-
warning:
|
|
5
|
-
error:
|
|
6
|
-
|
|
7
|
-
checked:
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
const background = {
|
|
3
|
+
success: "green-600",
|
|
4
|
+
warning: "yellow-600",
|
|
5
|
+
error: "red-600",
|
|
6
|
+
default: "transparent",
|
|
7
|
+
checked: "transparent"
|
|
8
8
|
};
|
|
9
|
-
|
|
10
|
-
success:
|
|
11
|
-
warning:
|
|
12
|
-
error:
|
|
13
|
-
|
|
14
|
-
checked:
|
|
9
|
+
const color = {
|
|
10
|
+
success: "white",
|
|
11
|
+
warning: "white",
|
|
12
|
+
error: "white",
|
|
13
|
+
default: "grey-400",
|
|
14
|
+
checked: "grey-400"
|
|
15
15
|
};
|
|
16
|
-
|
|
17
|
-
return props.status ===
|
|
16
|
+
const boxShadow = (props) => {
|
|
17
|
+
return props.status === "default" ? `${props.theme.palette["grey-400"]} 0px 0px 0px 1.5px inset` : "none";
|
|
18
18
|
};
|
|
19
|
-
|
|
19
|
+
const CardBadge = /* @__PURE__ */ styled.div.withConfig({
|
|
20
20
|
displayName: "CardBadgestyles__CardBadge",
|
|
21
21
|
componentId: "sc-1xcnpyh-0"
|
|
22
|
-
})(["width:24px;height:24px;display:flex;align-items:center;justify-content:center;background-color:", ";box-shadow:", ";border-radius:50%;&&& svg{color:", ";}"],
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}, function (props) {
|
|
27
|
-
return props.theme.palette[color[props.status]];
|
|
28
|
-
});
|
|
22
|
+
})(["width:24px;height:24px;display:flex;align-items:center;justify-content:center;background-color:", ";box-shadow:", ";border-radius:50%;&&& svg{color:", ";}"], (props) => props.theme.palette[background[props.status]], (props) => boxShadow(props), (props) => props.theme.palette[color[props.status]]);
|
|
23
|
+
export {
|
|
24
|
+
CardBadge
|
|
25
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CardGroupProps } from './CardGroup.types';
|
|
3
3
|
declare const CardGroup: ({ children, columns, ...htmlAttributes }: CardGroupProps) => React.JSX.Element;
|
|
4
4
|
export default CardGroup;
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}, htmlAttributes), children);
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Container } from "./CardGroup.styles.js";
|
|
3
|
+
const CardGroup = ({
|
|
4
|
+
children,
|
|
5
|
+
columns,
|
|
6
|
+
...htmlAttributes
|
|
7
|
+
}) => {
|
|
8
|
+
return /* @__PURE__ */ jsx(Container, { items: columns, ...htmlAttributes, children });
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
CardGroup as default
|
|
13
12
|
};
|
|
14
|
-
export default CardGroup;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import styled from
|
|
2
|
-
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
const Container = /* @__PURE__ */ styled.div.withConfig({
|
|
3
3
|
displayName: "CardGroupstyles__Container",
|
|
4
4
|
componentId: "sc-qyudjs-0"
|
|
5
|
-
})(["display:grid;grid-column-gap:24px;grid-row-gap:24px;grid-template-columns:", ";width:100%;"],
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
});
|
|
5
|
+
})(["display:grid;grid-column-gap:24px;grid-row-gap:24px;grid-template-columns:", ";width:100%;"], (props) => [...new Array(props.items)].map(() => "1fr").join(" "));
|
|
6
|
+
export {
|
|
7
|
+
Container
|
|
8
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { WithHTMLAttributes } from '@synerise/ds-utils';
|
|
3
3
|
export type CardGroupProps = WithHTMLAttributes<HTMLDivElement, {
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
columns: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CardSummaryProps } from './CardSummary.types';
|
|
3
3
|
export declare const CardSummary: ({ title, items, ...props }: CardSummaryProps) => React.JSX.Element;
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createElement } from "react";
|
|
3
|
+
import { CardSummaryWrapper, CardSummaryTitle, CardSummaryList } from "./CardSummary.styles.js";
|
|
4
|
+
import { CardSummaryItem } from "./CardSummaryItem.js";
|
|
5
|
+
const CardSummary = ({
|
|
6
|
+
title,
|
|
7
|
+
items,
|
|
8
|
+
...props
|
|
9
|
+
}) => {
|
|
10
|
+
return /* @__PURE__ */ jsxs(CardSummaryWrapper, { ...props, children: [
|
|
11
|
+
title && /* @__PURE__ */ jsx(CardSummaryTitle, { level: 5, children: title }),
|
|
12
|
+
/* @__PURE__ */ jsx(CardSummaryList, { children: items.map(({
|
|
13
|
+
key,
|
|
14
|
+
...item
|
|
15
|
+
}) => /* @__PURE__ */ createElement(CardSummaryItem, { ...item, key })) })
|
|
16
|
+
] });
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
CardSummary
|
|
20
|
+
};
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const CardSummaryWrapper: import(
|
|
3
|
-
export declare const CardSummaryTitle: import(
|
|
4
|
-
export declare const CardSummaryList: import(
|
|
5
|
-
export declare const CardSummaryItemWrapper: import(
|
|
6
|
-
export declare const ValueButtonWrapper: import(
|
|
7
|
-
export declare const CardSummaryItemDetailsWrapper: import(
|
|
8
|
-
export declare const CardSummaryItemDetails: import(
|
|
9
|
-
export declare const CardSummaryItemLabelValueWrapper: import(
|
|
10
|
-
export declare const CardSummaryItemLabel: import(
|
|
11
|
-
size?: import(
|
|
12
|
-
ellipsis?: import(
|
|
13
|
-
children?: import(
|
|
1
|
+
import { SummaryObjectsDirection } from './CardSummary.types';
|
|
2
|
+
export declare const CardSummaryWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
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>;
|
|
4
|
+
export declare const CardSummaryList: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
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>;
|
|
8
|
+
export declare const CardSummaryItemDetails: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
9
|
+
export declare const CardSummaryItemLabelValueWrapper: import('styled-components').StyledComponent<"span", any, {}, never>;
|
|
10
|
+
export declare const CardSummaryItemLabel: import('styled-components').StyledComponent<({ size, className, children, ellipsis, style, }: {
|
|
11
|
+
size?: import('@synerise/ds-typography').TextSize;
|
|
12
|
+
ellipsis?: import('@synerise/ds-typography/dist/Ellipsis').EllipsisProps;
|
|
13
|
+
children?: import('react').ReactNode;
|
|
14
14
|
className?: string;
|
|
15
|
-
style?: import(
|
|
15
|
+
style?: import('react').CSSProperties;
|
|
16
16
|
}) => React.JSX.Element, any, {}, never>;
|
|
17
|
-
export declare const CardSummaryItemValue: import(
|
|
18
|
-
export declare const IconWrapper: import(
|
|
19
|
-
export declare const Icon: import(
|
|
17
|
+
export declare const CardSummaryItemValue: import('styled-components').StyledComponent<"span", any, {}, never>;
|
|
18
|
+
export declare const IconWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
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, {
|
|
20
20
|
isOpen: boolean;
|
|
21
21
|
}, never>;
|
|
22
|
-
export declare const CardSummaryItemObjects: import(
|
|
22
|
+
export declare const CardSummaryItemObjects: import('styled-components').StyledComponent<"div", any, {
|
|
23
23
|
direction: SummaryObjectsDirection;
|
|
24
24
|
}, never>;
|
|
25
|
-
export declare const CardSummaryItemObject: import(
|
|
25
|
+
export declare const CardSummaryItemObject: import('styled-components').StyledComponent<"div", any, {
|
|
26
26
|
direction: SummaryObjectsDirection;
|
|
27
27
|
}, never>;
|
|
@@ -1,68 +1,90 @@
|
|
|
1
|
-
import styled from
|
|
2
|
-
import
|
|
3
|
-
import { Tag } from
|
|
4
|
-
import { Text, Title
|
|
5
|
-
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import Icon$1 from "@synerise/ds-icon";
|
|
3
|
+
import { Tag } from "@synerise/ds-tag/dist/Tag.styles";
|
|
4
|
+
import { macro, Text, Title } from "@synerise/ds-typography";
|
|
5
|
+
const CardSummaryWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
6
6
|
displayName: "CardSummarystyles__CardSummaryWrapper",
|
|
7
7
|
componentId: "sc-1yj41os-0"
|
|
8
8
|
})([""]);
|
|
9
|
-
|
|
9
|
+
const CardSummaryTitle = /* @__PURE__ */ styled(Title).withConfig({
|
|
10
10
|
displayName: "CardSummarystyles__CardSummaryTitle",
|
|
11
11
|
componentId: "sc-1yj41os-1"
|
|
12
12
|
})([""]);
|
|
13
|
-
|
|
13
|
+
const CardSummaryList = /* @__PURE__ */ styled.div.withConfig({
|
|
14
14
|
displayName: "CardSummarystyles__CardSummaryList",
|
|
15
15
|
componentId: "sc-1yj41os-2"
|
|
16
16
|
})([""]);
|
|
17
|
-
|
|
17
|
+
const CardSummaryItemWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
18
18
|
displayName: "CardSummarystyles__CardSummaryItemWrapper",
|
|
19
19
|
componentId: "sc-1yj41os-3"
|
|
20
20
|
})([""]);
|
|
21
|
-
|
|
21
|
+
const ValueButtonWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
22
22
|
displayName: "CardSummarystyles__ValueButtonWrapper",
|
|
23
23
|
componentId: "sc-1yj41os-4"
|
|
24
24
|
})(["align-self:flex-start;"]);
|
|
25
|
-
|
|
25
|
+
const CardSummaryItemDetailsWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
26
26
|
displayName: "CardSummarystyles__CardSummaryItemDetailsWrapper",
|
|
27
27
|
componentId: "sc-1yj41os-5"
|
|
28
28
|
})(["display:flex;align-items:center;gap:12px;min-height:32px;"]);
|
|
29
|
-
|
|
29
|
+
const CardSummaryItemDetails = /* @__PURE__ */ styled.div.withConfig({
|
|
30
30
|
displayName: "CardSummarystyles__CardSummaryItemDetails",
|
|
31
31
|
componentId: "sc-1yj41os-6"
|
|
32
|
-
})(["&:before{content:'
|
|
33
|
-
|
|
32
|
+
})(["&:before{content:'•';}display:flex;gap:12px;align-items:center;"]);
|
|
33
|
+
const CardSummaryItemLabelValueWrapper = /* @__PURE__ */ styled.span.withConfig({
|
|
34
34
|
displayName: "CardSummarystyles__CardSummaryItemLabelValueWrapper",
|
|
35
35
|
componentId: "sc-1yj41os-7"
|
|
36
36
|
})(["align-self:center;word-break:break-all;display:flex;align-items:center;"]);
|
|
37
|
-
|
|
37
|
+
const CardSummaryItemLabel = /* @__PURE__ */ styled(Text).withConfig({
|
|
38
38
|
displayName: "CardSummarystyles__CardSummaryItemLabel",
|
|
39
39
|
componentId: "sc-1yj41os-8"
|
|
40
40
|
})(["line-height:24px;margin-right:4px;"]);
|
|
41
|
-
|
|
41
|
+
const CardSummaryItemValue = /* @__PURE__ */ styled.span.withConfig({
|
|
42
42
|
displayName: "CardSummarystyles__CardSummaryItemValue",
|
|
43
43
|
componentId: "sc-1yj41os-9"
|
|
44
44
|
})(["", " display:flex;align-items:center;gap:4px;"], macro.h200);
|
|
45
|
-
|
|
45
|
+
const IconWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
46
46
|
displayName: "CardSummarystyles__IconWrapper",
|
|
47
47
|
componentId: "sc-1yj41os-10"
|
|
48
48
|
})([""]);
|
|
49
|
-
|
|
49
|
+
const Icon = /* @__PURE__ */ styled(Icon$1).withConfig({
|
|
50
50
|
displayName: "CardSummarystyles__Icon",
|
|
51
51
|
componentId: "sc-1yj41os-11"
|
|
52
|
-
})(["transform:rotate(", "deg);"],
|
|
53
|
-
|
|
54
|
-
});
|
|
55
|
-
export var CardSummaryItemObjects = styled.div.withConfig({
|
|
52
|
+
})(["transform:rotate(", "deg);"], (props) => props.isOpen ? "180" : "0");
|
|
53
|
+
const CardSummaryItemObjects = /* @__PURE__ */ styled.div.withConfig({
|
|
56
54
|
displayName: "CardSummarystyles__CardSummaryItemObjects",
|
|
57
55
|
componentId: "sc-1yj41os-12"
|
|
58
|
-
})(["--cols:4;--gap:8px;display:flex;margin:8px 0 8px 16px;", ""],
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
56
|
+
})(["--cols:4;--gap:8px;display:flex;margin:8px 0 8px 16px;", ""], ({
|
|
57
|
+
direction
|
|
58
|
+
}) => direction === "column" ? `
|
|
59
|
+
flex-direction: column;
|
|
60
|
+
gap: 12px;
|
|
61
|
+
` : `
|
|
62
|
+
flex-wrap: wrap;
|
|
63
|
+
gap: 0 var(--gap);
|
|
64
|
+
`);
|
|
65
|
+
const CardSummaryItemObject = /* @__PURE__ */ styled.div.withConfig({
|
|
63
66
|
displayName: "CardSummarystyles__CardSummaryItemObject",
|
|
64
67
|
componentId: "sc-1yj41os-13"
|
|
65
|
-
})(["min-width:0;", "{margin-left:0;}", ""], Tag,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
68
|
+
})(["min-width:0;", "{margin-left:0;}", ""], Tag, ({
|
|
69
|
+
direction
|
|
70
|
+
}) => direction === "row" && `
|
|
71
|
+
flex-basis: calc(
|
|
72
|
+
100% / var(--cols) - var(--gap) / var(--cols) * (var(--cols) - 1)
|
|
73
|
+
);
|
|
74
|
+
`);
|
|
75
|
+
export {
|
|
76
|
+
CardSummaryItemDetails,
|
|
77
|
+
CardSummaryItemDetailsWrapper,
|
|
78
|
+
CardSummaryItemLabel,
|
|
79
|
+
CardSummaryItemLabelValueWrapper,
|
|
80
|
+
CardSummaryItemObject,
|
|
81
|
+
CardSummaryItemObjects,
|
|
82
|
+
CardSummaryItemValue,
|
|
83
|
+
CardSummaryItemWrapper,
|
|
84
|
+
CardSummaryList,
|
|
85
|
+
CardSummaryTitle,
|
|
86
|
+
CardSummaryWrapper,
|
|
87
|
+
Icon,
|
|
88
|
+
IconWrapper,
|
|
89
|
+
ValueButtonWrapper
|
|
90
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { Key, ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { WithHTMLAttributes } from '@synerise/ds-utils';
|
|
3
3
|
export type SummaryObjectsDirection = 'row' | 'column';
|
|
4
4
|
export type CardSummaryItemProps = WithHTMLAttributes<HTMLDivElement, {
|
|
5
5
|
key: Key;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CardSummaryItemProps } from './CardSummary.types';
|
|
3
3
|
export declare const CardSummaryItem: ({ label, value, summaryObjects, summaryObjectsDirection, valueButton, ...rest }: CardSummaryItemProps) => React.JSX.Element;
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
setIsOpen = _useState[1];
|
|
20
|
-
var withObjects = !!(summaryObjects != null && summaryObjects.length);
|
|
21
|
-
var handleClick = function handleClick() {
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import AnimateHeight from "react-animate-height";
|
|
4
|
+
import { v4 } from "uuid";
|
|
5
|
+
import { AngleDownS } from "@synerise/ds-icon";
|
|
6
|
+
import { ANIMATION_DURATION } from "../constants.js";
|
|
7
|
+
import { CardSummaryItemWrapper, CardSummaryItemDetailsWrapper, CardSummaryItemDetails, CardSummaryItemLabelValueWrapper, CardSummaryItemLabel, CardSummaryItemValue, ValueButtonWrapper, CardSummaryItemObjects, CardSummaryItemObject, IconWrapper, Icon } from "./CardSummary.styles.js";
|
|
8
|
+
const CardSummaryItem = ({
|
|
9
|
+
label,
|
|
10
|
+
value,
|
|
11
|
+
summaryObjects,
|
|
12
|
+
summaryObjectsDirection = "row",
|
|
13
|
+
valueButton,
|
|
14
|
+
...rest
|
|
15
|
+
}) => {
|
|
16
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
17
|
+
const withObjects = !!summaryObjects?.length;
|
|
18
|
+
const handleClick = () => {
|
|
22
19
|
setIsOpen(!isOpen);
|
|
23
20
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}, object)
|
|
41
|
-
})
|
|
42
|
-
};
|
|
21
|
+
const icon = /* @__PURE__ */ jsx(IconWrapper, { children: /* @__PURE__ */ jsx(Icon, { isOpen, component: /* @__PURE__ */ jsx(AngleDownS, {}), onClick: handleClick }) });
|
|
22
|
+
return /* @__PURE__ */ jsxs(CardSummaryItemWrapper, { ...rest, children: [
|
|
23
|
+
/* @__PURE__ */ jsxs(CardSummaryItemDetailsWrapper, { children: [
|
|
24
|
+
/* @__PURE__ */ jsx(CardSummaryItemDetails, { children: /* @__PURE__ */ jsxs(CardSummaryItemLabelValueWrapper, { children: [
|
|
25
|
+
label && /* @__PURE__ */ jsxs(CardSummaryItemLabel, { size: "small", children: [
|
|
26
|
+
label,
|
|
27
|
+
":"
|
|
28
|
+
] }),
|
|
29
|
+
/* @__PURE__ */ jsxs(CardSummaryItemValue, { children: [
|
|
30
|
+
value,
|
|
31
|
+
" ",
|
|
32
|
+
withObjects && icon
|
|
33
|
+
] })
|
|
34
|
+
] }) }),
|
|
35
|
+
valueButton && /* @__PURE__ */ jsx(ValueButtonWrapper, { children: valueButton })
|
|
36
|
+
] }),
|
|
37
|
+
withObjects && /* @__PURE__ */ jsx(AnimateHeight, { duration: ANIMATION_DURATION, height: isOpen ? "auto" : 0, children: /* @__PURE__ */ jsx(CardSummaryItemObjects, { direction: summaryObjectsDirection, children: summaryObjects?.map((object) => /* @__PURE__ */ jsx(CardSummaryItemObject, { direction: summaryObjectsDirection, children: object }, object.key || v4())) }) })
|
|
38
|
+
] });
|
|
39
|
+
};
|
|
40
|
+
export {
|
|
41
|
+
CardSummaryItem
|
|
42
|
+
};
|
package/dist/constants.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Card:
|
|
10
|
-
CardGroup:
|
|
11
|
-
CardBadge:
|
|
12
|
-
};
|
|
1
|
+
import * as Card_Card_styles from "./Card/Card.styles.js";
|
|
2
|
+
import * as CardBadge_CardBadge_styles from "./CardBadge/CardBadge.styles.js";
|
|
3
|
+
import * as CardGroup_CardGroup_styles from "./CardGroup/CardGroup.styles.js";
|
|
4
|
+
import { default as default2 } from "./Card/Card.js";
|
|
5
|
+
import { default as default3 } from "./CardGroup/CardGroup.js";
|
|
6
|
+
import { default as default4 } from "./CardBadge/CardBadge.js";
|
|
7
|
+
import { CardSummary } from "./CardSummary/CardSummary.js";
|
|
8
|
+
const CardStyles = {
|
|
9
|
+
Card: Card_Card_styles,
|
|
10
|
+
CardGroup: CardGroup_CardGroup_styles,
|
|
11
|
+
CardBadge: CardBadge_CardBadge_styles
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
default4 as CardBadge,
|
|
15
|
+
default3 as CardGroup,
|
|
16
|
+
CardStyles,
|
|
17
|
+
CardSummary,
|
|
18
|
+
default2 as default
|
|
19
|
+
};
|
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-card",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"description": "Card UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -16,15 +16,15 @@
|
|
|
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",
|
|
26
|
-
"test": "vitest",
|
|
27
|
-
"test:watch": "
|
|
26
|
+
"test": "vitest run",
|
|
27
|
+
"test:watch": "vitest",
|
|
28
28
|
"types": "tsc --noEmit",
|
|
29
29
|
"check:circular-dependencies": "madge --circular --extensions ts,tsx,js,jsx --ts-config tsconfig.json src/ --exclude '/dist/'",
|
|
30
30
|
"upgrade:ds": "ncu -f \"@synerise/ds-*\" -u"
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
],
|
|
36
36
|
"types": "dist/index.d.ts",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@synerise/ds-avatar": "^1.3.
|
|
39
|
-
"@synerise/ds-icon": "^1.
|
|
40
|
-
"@synerise/ds-tag": "^1.4.
|
|
41
|
-
"@synerise/ds-typography": "^1.1.
|
|
42
|
-
"@synerise/ds-utils": "^1.
|
|
38
|
+
"@synerise/ds-avatar": "^1.3.5",
|
|
39
|
+
"@synerise/ds-icon": "^1.15.1",
|
|
40
|
+
"@synerise/ds-tag": "^1.4.18",
|
|
41
|
+
"@synerise/ds-typography": "^1.1.13",
|
|
42
|
+
"@synerise/ds-utils": "^1.7.1",
|
|
43
43
|
"react-animate-height": "^2.0.23",
|
|
44
44
|
"react-visibility-sensor": "^5.1.1",
|
|
45
45
|
"uuid": "^8.3.2"
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"styled-components": "^5.3.3",
|
|
52
52
|
"vitest": "4"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "e4ecca8944fc9b41c1b9d59c8bcad5e5e2013225"
|
|
55
55
|
}
|