@synerise/ds-information-card 0.3.58 → 0.3.60

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
+ ## [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)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **card:** added testids and classname ([74b5a0a](https://github.com/Synerise/synerise-design/commit/74b5a0a56adf2f08963f6c46b93328524680d519))
12
+
13
+
14
+
15
+
16
+
17
+ ## [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)
18
+
19
+ **Note:** Version bump only for package @synerise/ds-information-card
20
+
21
+
22
+
23
+
24
+
6
25
  ## [0.3.58](https://github.com/Synerise/synerise-design/compare/@synerise/ds-information-card@0.3.57...@synerise/ds-information-card@0.3.58) (2024-02-19)
7
26
 
8
27
  **Note:** Version bump only for package @synerise/ds-information-card
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
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 = React.PropsWithChildren<{
19
+ type InitialsProps = PropsWithChildren<{
20
20
  name?: string;
21
21
  }>;
22
22
  /**
@@ -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 * as React from 'react';
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 = React.forwardRef(function (_ref, ref) {
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 _React$useState = React.useState(''),
169
- description = _React$useState[0],
170
- setDescription = _React$useState[1];
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(v) {
178
- descriptionConfig.onChange && descriptionConfig.onChange(v);
179
- setDescription(v);
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, null, /*#__PURE__*/React.createElement(S.AlertWrapper, null, extraInformation), descriptionConfig && renderDescription());
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
  }
@@ -32,6 +32,7 @@ export type InformationCardProps = {
32
32
  * description in a tooltip shown when user (note renderBadge has to be provided)
33
33
  */
34
34
  avatarTooltipText?: string;
35
+ className?: string;
35
36
  /**
36
37
  * subtitle's value to be copied when clicking on the copy button
37
38
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-information-card",
3
- "version": "0.3.58",
3
+ "version": "0.3.60",
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.3",
38
- "@synerise/ds-avatar": "^0.15.21",
39
- "@synerise/ds-badge": "^0.6.49",
40
- "@synerise/ds-button": "^0.19.0",
41
- "@synerise/ds-card": "^0.16.2",
42
- "@synerise/ds-description": "^0.3.94",
43
- "@synerise/ds-divider": "^0.6.7",
44
- "@synerise/ds-dropdown": "^0.17.96",
45
- "@synerise/ds-icon": "^0.60.0",
46
- "@synerise/ds-menu": "^0.18.12",
47
- "@synerise/ds-subtle-form": "^0.9.93",
48
- "@synerise/ds-tooltip": "^0.14.17",
37
+ "@synerise/ds-alert": "^0.8.5",
38
+ "@synerise/ds-avatar": "^0.15.23",
39
+ "@synerise/ds-badge": "^0.6.51",
40
+ "@synerise/ds-button": "^0.19.2",
41
+ "@synerise/ds-card": "^0.16.4",
42
+ "@synerise/ds-description": "^0.3.96",
43
+ "@synerise/ds-divider": "^0.6.9",
44
+ "@synerise/ds-dropdown": "^0.17.98",
45
+ "@synerise/ds-icon": "^0.60.2",
46
+ "@synerise/ds-menu": "^0.18.14",
47
+ "@synerise/ds-subtle-form": "^0.9.95",
48
+ "@synerise/ds-tooltip": "^0.14.19",
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.24.24",
58
+ "@synerise/ds-utils": "^0.24.26",
59
59
  "@testing-library/jest-dom": "5.1.1",
60
60
  "@testing-library/react": "10.0.1"
61
61
  },
62
- "gitHead": "17e3bca1d4d134a28aaa186f0e2637616ca86174"
62
+ "gitHead": "673df74b628304300c09f0d7e26279b5901cd925"
63
63
  }