@synerise/ds-information-card 0.3.59 → 0.3.61
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/InformationCard.d.ts +2 -2
- package/dist/InformationCard.js +16 -11
- package/dist/InformationCard.types.d.ts +1 -0
- package/package.json +15 -15
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.3.61](https://github.com/Synerise/synerise-design/compare/@synerise/ds-information-card@0.3.60...@synerise/ds-information-card@0.3.61) (2024-03-05)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-information-card
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.3.60](https://github.com/Synerise/synerise-design/compare/@synerise/ds-information-card@0.3.59...@synerise/ds-information-card@0.3.60) (2024-02-21)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **card:** added testids and classname ([74b5a0a](https://github.com/Synerise/synerise-design/commit/74b5a0a56adf2f08963f6c46b93328524680d519))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [0.3.59](https://github.com/Synerise/synerise-design/compare/@synerise/ds-information-card@0.3.58...@synerise/ds-information-card@0.3.59) (2024-02-19)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @synerise/ds-information-card
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
2
|
import { InlineAlertType } from '@synerise/ds-alert/dist/InlineAlert/InlineAlert.types';
|
|
3
3
|
import { InformationCardProps, BadgeData } from './InformationCard.types';
|
|
4
4
|
import 'rc-trigger/assets/index.less';
|
|
@@ -16,7 +16,7 @@ export declare function buildExtraInfo(message: string, level?: InlineAlertType)
|
|
|
16
16
|
* Helper for returning initials. Handles cases such as John Smith, J. Smith, JS.
|
|
17
17
|
*/
|
|
18
18
|
export declare function getInitials(name: string): string;
|
|
19
|
-
type InitialsProps =
|
|
19
|
+
type InitialsProps = PropsWithChildren<{
|
|
20
20
|
name?: string;
|
|
21
21
|
}>;
|
|
22
22
|
/**
|
package/dist/InformationCard.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var _excluded = ["actionButton", "actionButtonTooltipText", "actionButtonCallback", "asTooltip", "avatarTooltipText", "copyTooltip", "copiedTooltip", "renderFooter", "renderBadge", "subtitle", "title", "notice", "footerText", "icon", "iconColor", "descriptionConfig"];
|
|
1
|
+
var _excluded = ["actionButton", "actionButtonTooltipText", "actionButtonCallback", "asTooltip", "avatarTooltipText", "copyTooltip", "copiedTooltip", "renderFooter", "renderBadge", "subtitle", "title", "notice", "footerText", "icon", "iconColor", "descriptionConfig", "className"];
|
|
2
2
|
|
|
3
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; }
|
|
4
4
|
|
|
5
5
|
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); }
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import React, { forwardRef, useState } from 'react';
|
|
8
8
|
import { Text } from '@synerise/ds-typography';
|
|
9
9
|
import Button from '@synerise/ds-button';
|
|
10
10
|
import Divider from '@synerise/ds-divider';
|
|
@@ -41,7 +41,7 @@ export function buildIconBadge(data) {
|
|
|
41
41
|
})
|
|
42
42
|
}));
|
|
43
43
|
}
|
|
44
|
-
var InformationCard =
|
|
44
|
+
var InformationCard = forwardRef(function (_ref, ref) {
|
|
45
45
|
var actionButton = _ref.actionButton,
|
|
46
46
|
actionButtonTooltipText = _ref.actionButtonTooltipText,
|
|
47
47
|
actionButtonCallback = _ref.actionButtonCallback,
|
|
@@ -59,6 +59,7 @@ var InformationCard = React.forwardRef(function (_ref, ref) {
|
|
|
59
59
|
iconElement = _ref$icon === void 0 ? /*#__PURE__*/React.createElement(SegmentM, null) : _ref$icon,
|
|
60
60
|
iconColor = _ref.iconColor,
|
|
61
61
|
descriptionConfig = _ref.descriptionConfig,
|
|
62
|
+
className = _ref.className,
|
|
62
63
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
63
64
|
|
|
64
65
|
var copyableSlot = function copyableSlot(content) {
|
|
@@ -80,9 +81,10 @@ var InformationCard = React.forwardRef(function (_ref, ref) {
|
|
|
80
81
|
};
|
|
81
82
|
|
|
82
83
|
return /*#__PURE__*/React.createElement(S.InfoCardWrapper, {
|
|
84
|
+
"data-testid": "information-card",
|
|
83
85
|
ref: ref,
|
|
84
86
|
"aria-label": "information card",
|
|
85
|
-
className: "ds-info-card",
|
|
87
|
+
className: "ds-info-card " + className,
|
|
86
88
|
asTooltip: asTooltip
|
|
87
89
|
}, /*#__PURE__*/React.createElement(Card, {
|
|
88
90
|
background: "white" // @ts-ignore
|
|
@@ -165,18 +167,18 @@ function DescriptionField(_ref3) {
|
|
|
165
167
|
|
|
166
168
|
// note: if popover containing this information card will have
|
|
167
169
|
// `destroyTooltipOnHide` (or `keepParent`) set to false, then description state hook will be getting reset
|
|
168
|
-
var
|
|
169
|
-
description =
|
|
170
|
-
setDescription =
|
|
170
|
+
var _useState = useState(''),
|
|
171
|
+
description = _useState[0],
|
|
172
|
+
setDescription = _useState[1];
|
|
171
173
|
|
|
172
174
|
var renderDescription = function renderDescription() {
|
|
173
175
|
if (descriptionConfig) {
|
|
174
176
|
return typeof descriptionConfig === 'string' ? /*#__PURE__*/React.createElement(S.NonEditableWrapper, null, descriptionConfig) : /*#__PURE__*/React.createElement(SubtleForm.TextArea, _extends({
|
|
175
177
|
minRows: 1,
|
|
176
178
|
value: description,
|
|
177
|
-
onChange: function onChange(
|
|
178
|
-
descriptionConfig.onChange && descriptionConfig.onChange(
|
|
179
|
-
setDescription(
|
|
179
|
+
onChange: function onChange(value) {
|
|
180
|
+
descriptionConfig.onChange && descriptionConfig.onChange(value);
|
|
181
|
+
setDescription(value);
|
|
180
182
|
},
|
|
181
183
|
placeholder: "placeholder",
|
|
182
184
|
suffixTooltip: "Edit"
|
|
@@ -193,7 +195,9 @@ function DescriptionField(_ref3) {
|
|
|
193
195
|
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
194
196
|
};
|
|
195
197
|
|
|
196
|
-
return /*#__PURE__*/React.createElement(S.DescriptionWrapper,
|
|
198
|
+
return /*#__PURE__*/React.createElement(S.DescriptionWrapper, {
|
|
199
|
+
"data-testid": "information-card-description"
|
|
200
|
+
}, /*#__PURE__*/React.createElement(S.AlertWrapper, null, extraInformation), descriptionConfig && renderDescription());
|
|
197
201
|
}
|
|
198
202
|
/**
|
|
199
203
|
* Tooltip helper for action button in footer
|
|
@@ -225,6 +229,7 @@ function Footer(_ref4) {
|
|
|
225
229
|
marginBottom: 0,
|
|
226
230
|
dashed: true
|
|
227
231
|
}), /*#__PURE__*/React.createElement(S.Flex, {
|
|
232
|
+
"data-testid": "information-card-footer",
|
|
228
233
|
style: {
|
|
229
234
|
alignItems: 'center'
|
|
230
235
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-information-card",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.61",
|
|
4
4
|
"description": "InformationCard UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -34,18 +34,18 @@
|
|
|
34
34
|
],
|
|
35
35
|
"types": "dist/index.d.ts",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@synerise/ds-alert": "^0.8.
|
|
38
|
-
"@synerise/ds-avatar": "^0.15.
|
|
39
|
-
"@synerise/ds-badge": "^0.6.
|
|
40
|
-
"@synerise/ds-button": "^0.19.
|
|
41
|
-
"@synerise/ds-card": "^0.16.
|
|
42
|
-
"@synerise/ds-description": "^0.3.
|
|
43
|
-
"@synerise/ds-divider": "^0.6.
|
|
44
|
-
"@synerise/ds-dropdown": "^0.17.
|
|
45
|
-
"@synerise/ds-icon": "^0.60.
|
|
46
|
-
"@synerise/ds-menu": "^0.18.
|
|
47
|
-
"@synerise/ds-subtle-form": "^0.9.
|
|
48
|
-
"@synerise/ds-tooltip": "^0.14.
|
|
37
|
+
"@synerise/ds-alert": "^0.8.6",
|
|
38
|
+
"@synerise/ds-avatar": "^0.15.24",
|
|
39
|
+
"@synerise/ds-badge": "^0.6.52",
|
|
40
|
+
"@synerise/ds-button": "^0.19.3",
|
|
41
|
+
"@synerise/ds-card": "^0.16.5",
|
|
42
|
+
"@synerise/ds-description": "^0.3.97",
|
|
43
|
+
"@synerise/ds-divider": "^0.6.10",
|
|
44
|
+
"@synerise/ds-dropdown": "^0.17.99",
|
|
45
|
+
"@synerise/ds-icon": "^0.60.3",
|
|
46
|
+
"@synerise/ds-menu": "^0.18.15",
|
|
47
|
+
"@synerise/ds-subtle-form": "^0.9.96",
|
|
48
|
+
"@synerise/ds-tooltip": "^0.14.20",
|
|
49
49
|
"@synerise/ds-typography": "^0.14.3",
|
|
50
50
|
"rc-trigger": "5.2.5"
|
|
51
51
|
},
|
|
@@ -55,9 +55,9 @@
|
|
|
55
55
|
"styled-components": "5.0.1"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@synerise/ds-utils": "^0.
|
|
58
|
+
"@synerise/ds-utils": "^0.25.0",
|
|
59
59
|
"@testing-library/jest-dom": "5.1.1",
|
|
60
60
|
"@testing-library/react": "10.0.1"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "6b8da853a2bb4e993d89e9b0b3041216f0c9c976"
|
|
63
63
|
}
|