@synerise/ds-description 0.3.110 → 0.3.112

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.112](https://github.com/Synerise/synerise-design/compare/@synerise/ds-description@0.3.111...@synerise/ds-description@0.3.112) (2024-08-19)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-description
9
+
10
+
11
+
12
+
13
+
14
+ ## [0.3.111](https://github.com/Synerise/synerise-design/compare/@synerise/ds-description@0.3.110...@synerise/ds-description@0.3.111) (2024-07-26)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **information-card:** change title and subtitle overflow ([82761e5](https://github.com/Synerise/synerise-design/commit/82761e5802dfefbc28b932b9250e825c4c96028e))
20
+
21
+
22
+
23
+
24
+
6
25
  ## [0.3.110](https://github.com/Synerise/synerise-design/compare/@synerise/ds-description@0.3.109...@synerise/ds-description@0.3.110) (2024-07-15)
7
26
 
8
27
  **Note:** Version bump only for package @synerise/ds-description
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  import { CopyProps } from './Copy.types';
3
- declare const Copy: React.FC<CopyProps>;
3
+ declare const Copy: ({ copyValue, texts, className, onMouseEnter, onMouseLeave }: CopyProps) => React.JSX.Element;
4
4
  export default Copy;
package/dist/Row/Copy.js CHANGED
@@ -1,18 +1,21 @@
1
+ import React, { useState, useMemo, useCallback } from 'react';
1
2
  import Tooltip from '@synerise/ds-tooltip/dist/Tooltip';
2
3
  import Icon, { CopyClipboardM } from '@synerise/ds-icon';
3
- import * as React from 'react';
4
4
  import * as copy from 'copy-to-clipboard';
5
5
  import { useIntl } from 'react-intl';
6
6
  import * as S from './DescriptionRow.styles';
7
7
 
8
8
  var Copy = function Copy(_ref) {
9
9
  var copyValue = _ref.copyValue,
10
- texts = _ref.texts;
10
+ texts = _ref.texts,
11
+ className = _ref.className,
12
+ onMouseEnter = _ref.onMouseEnter,
13
+ onMouseLeave = _ref.onMouseLeave;
11
14
 
12
15
  var _useIntl = useIntl(),
13
16
  formatMessage = _useIntl.formatMessage;
14
17
 
15
- var textsObj = React.useMemo(function () {
18
+ var textsObj = useMemo(function () {
16
19
  return texts || {
17
20
  copiedTooltip: formatMessage({
18
21
  id: 'DS.DESCRIPTION.COPIED'
@@ -23,34 +26,36 @@ var Copy = function Copy(_ref) {
23
26
  };
24
27
  }, [texts, formatMessage]);
25
28
 
26
- var _React$useState = React.useState(false),
27
- tooltipVisible = _React$useState[0],
28
- setTooltipVisible = _React$useState[1];
29
+ var _useState = useState(false),
30
+ tooltipVisible = _useState[0],
31
+ setTooltipVisible = _useState[1];
29
32
 
30
- var _React$useState2 = React.useState(textsObj.copyTooltip),
31
- tooltipTitle = _React$useState2[0],
32
- setTooltipTitle = _React$useState2[1];
33
+ var _useState2 = useState(textsObj.copyTooltip),
34
+ tooltipTitle = _useState2[0],
35
+ setTooltipTitle = _useState2[1];
33
36
 
34
- var handleCopy = React.useCallback(function () {
37
+ var handleCopy = useCallback(function () {
35
38
  if (copyValue && copy(copyValue)) {
36
39
  setTooltipTitle(textsObj.copiedTooltip);
37
40
  setTooltipVisible(true);
38
41
  }
39
42
  }, [copyValue, setTooltipTitle, textsObj.copiedTooltip]);
40
- var handleMouseEnter = React.useCallback(function (e) {
41
- e.stopPropagation();
43
+ var handleMouseEnter = useCallback(function (event) {
44
+ event.stopPropagation();
42
45
  setTooltipTitle(textsObj.copyTooltip);
43
46
  setTooltipVisible(true);
44
- }, [setTooltipVisible, textsObj]);
45
- var handleMouseLeave = React.useCallback(function (e) {
46
- e.stopPropagation();
47
+ onMouseEnter && onMouseEnter(event);
48
+ }, [setTooltipVisible, textsObj, onMouseEnter]);
49
+ var handleMouseLeave = useCallback(function (event) {
50
+ event.stopPropagation();
47
51
  setTooltipVisible(false);
48
- }, [setTooltipVisible]);
52
+ onMouseLeave && onMouseLeave(event);
53
+ }, [setTooltipVisible, onMouseLeave]);
49
54
  return /*#__PURE__*/React.createElement(Tooltip, {
50
55
  title: tooltipTitle,
51
56
  visible: tooltipVisible
52
57
  }, /*#__PURE__*/React.createElement(S.Copyable, {
53
- className: "ds-description-copy",
58
+ className: "ds-description-copy " + className,
54
59
  onClick: handleCopy,
55
60
  onMouseEnter: handleMouseEnter,
56
61
  onMouseLeave: handleMouseLeave
@@ -1,5 +1,6 @@
1
+ import { HTMLAttributes } from 'react';
1
2
  import { RowTexts } from './DescriptionRow.types';
2
- export interface CopyProps {
3
+ export type CopyProps = {
3
4
  copyValue: string;
4
5
  texts?: RowTexts;
5
- }
6
+ } & HTMLAttributes<HTMLDivElement>;
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export { default } from './Description';
2
2
  export { default as DescriptionRow } from './Row/DescriptionRow';
3
+ export { default as DescriptionCopyable } from './Row/Copy';
package/dist/index.js CHANGED
@@ -1,2 +1,3 @@
1
1
  export { default } from './Description';
2
- export { default as DescriptionRow } from './Row/DescriptionRow';
2
+ export { default as DescriptionRow } from './Row/DescriptionRow';
3
+ export { default as DescriptionCopyable } from './Row/Copy';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-description",
3
- "version": "0.3.110",
3
+ "version": "0.3.112",
4
4
  "description": "Description UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -33,8 +33,8 @@
33
33
  ],
34
34
  "types": "dist/index.d.ts",
35
35
  "dependencies": {
36
- "@synerise/ds-icon": "^0.64.1",
37
- "@synerise/ds-tooltip": "^0.14.33",
36
+ "@synerise/ds-icon": "^0.65.0",
37
+ "@synerise/ds-tooltip": "^0.14.35",
38
38
  "classnames": "2.3.2",
39
39
  "react-intl": "3.12.0"
40
40
  },
@@ -44,5 +44,5 @@
44
44
  "react": ">=16.9.0 <= 17.0.2",
45
45
  "styled-components": "5.0.1"
46
46
  },
47
- "gitHead": "6f4996380356c1e5cb9a9d8b553069ad9cea7c27"
47
+ "gitHead": "2e6de17b64023536c24be8fcb67b1e53e8bffa3d"
48
48
  }