@synerise/ds-description 0.4.2 → 0.4.4
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 +16 -0
- package/dist/Description.js +4 -6
- package/dist/Description.styles.js +2 -12
- package/dist/Row/Copy.js +9 -16
- package/dist/Row/DescriptionRow.js +7 -9
- package/dist/Row/Star.js +1 -3
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
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.4.4](https://github.com/Synerise/synerise-design/compare/@synerise/ds-description@0.4.3...@synerise/ds-description@0.4.4) (2024-11-29)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-description
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.4.3](https://github.com/Synerise/synerise-design/compare/@synerise/ds-description@0.4.2...@synerise/ds-description@0.4.3) (2024-11-28)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @synerise/ds-description
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [0.4.2](https://github.com/Synerise/synerise-design/compare/@synerise/ds-description@0.4.1...@synerise/ds-description@0.4.2) (2024-11-21)
|
|
7
23
|
|
|
8
24
|
|
package/dist/Description.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import * as S from './Description.styles';
|
|
4
|
-
|
|
5
4
|
var Description = function Description(_ref) {
|
|
6
5
|
var _ref$type = _ref.type,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
type = _ref$type === void 0 ? 'table' : _ref$type,
|
|
7
|
+
children = _ref.children,
|
|
8
|
+
_ref$ratio = _ref.ratio,
|
|
9
|
+
ratio = _ref$ratio === void 0 ? '30-70' : _ref$ratio;
|
|
11
10
|
var hasSingleChild = React.useMemo(function () {
|
|
12
11
|
return !Array.isArray(children);
|
|
13
12
|
}, [children]);
|
|
@@ -21,5 +20,4 @@ var Description = function Description(_ref) {
|
|
|
21
20
|
singleRow: hasSingleChild
|
|
22
21
|
}, children);
|
|
23
22
|
};
|
|
24
|
-
|
|
25
23
|
export default Description;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
2
|
import { PrefixWrapper, RowLabel, RowValue, RowWrapper, SuffixWrapper, ValueWrapper } from './Row/DescriptionRow.styles';
|
|
3
|
-
|
|
4
3
|
var getColumnsWidth = function getColumnsWidth(ratio) {
|
|
5
4
|
if (ratio === void 0) {
|
|
6
5
|
ratio = null;
|
|
7
6
|
}
|
|
8
|
-
|
|
9
7
|
var mapRatioToWidth = {
|
|
10
8
|
'20-80': '2fr 8fr',
|
|
11
9
|
'30-70': '3fr 7fr',
|
|
@@ -18,24 +16,20 @@ var getColumnsWidth = function getColumnsWidth(ratio) {
|
|
|
18
16
|
};
|
|
19
17
|
return ratio !== null && mapRatioToWidth[ratio] ? mapRatioToWidth[ratio] : '1fr auto';
|
|
20
18
|
};
|
|
21
|
-
|
|
22
19
|
var tableStyles = function tableStyles(ratio) {
|
|
23
20
|
return css(["", "{display:grid;grid-column-gap:16px;grid-template-columns:", ";}"], RowWrapper, getColumnsWidth(ratio));
|
|
24
21
|
};
|
|
25
|
-
|
|
26
22
|
var inlineStyles = function inlineStyles() {
|
|
27
23
|
return css(["", "{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;", "{margin-right:8px;}", "{display:-webkit-box;flex:1;overflow-x:visible;}}"], RowWrapper, RowLabel, RowValue);
|
|
28
24
|
};
|
|
29
|
-
|
|
30
25
|
var dottedListStyles = function dottedListStyles(theme) {
|
|
31
26
|
return css(["", ";", "{", "{display:none;}&::before{position:relative;width:14px;height:24px;display:flex;align-items:center;justify-content:center;content:'\xB7';color:", ";margin-right:8px;}}"], inlineStyles(), RowWrapper, RowLabel, theme.palette['grey-600']);
|
|
32
27
|
};
|
|
33
|
-
|
|
34
28
|
var numberedListStyles = function numberedListStyles(theme) {
|
|
35
29
|
return css(["", ";counter-reset:count-description-rows;", "{", "{display:none;}counter-increment:count-description-rows;&::before{position:relative;height:24px;display:flex;align-items:center;justify-content:center;content:counter(count-description-rows,decimal-leading-zero) ':';color:", ";margin-right:8px;}}"], inlineStyles(), RowWrapper, RowLabel, theme.palette['grey-600']);
|
|
36
|
-
};
|
|
37
|
-
|
|
30
|
+
};
|
|
38
31
|
|
|
32
|
+
// eslint-disable-next-line import/prefer-default-export
|
|
39
33
|
export var Description = styled.div.withConfig({
|
|
40
34
|
displayName: "Descriptionstyles__Description",
|
|
41
35
|
componentId: "sc-1myairu-0"
|
|
@@ -47,22 +41,18 @@ export var Description = styled.div.withConfig({
|
|
|
47
41
|
{
|
|
48
42
|
return tableStyles(props.ratio);
|
|
49
43
|
}
|
|
50
|
-
|
|
51
44
|
case 'inline':
|
|
52
45
|
{
|
|
53
46
|
return inlineStyles();
|
|
54
47
|
}
|
|
55
|
-
|
|
56
48
|
case 'dotted-list':
|
|
57
49
|
{
|
|
58
50
|
return dottedListStyles(props.theme);
|
|
59
51
|
}
|
|
60
|
-
|
|
61
52
|
case 'numbered-list':
|
|
62
53
|
{
|
|
63
54
|
return numberedListStyles(props.theme);
|
|
64
55
|
}
|
|
65
|
-
|
|
66
56
|
default:
|
|
67
57
|
return false;
|
|
68
58
|
}
|
package/dist/Row/Copy.js
CHANGED
|
@@ -4,17 +4,14 @@ import Icon, { CopyClipboardM } from '@synerise/ds-icon';
|
|
|
4
4
|
import copy from 'copy-to-clipboard';
|
|
5
5
|
import { useIntl } from 'react-intl';
|
|
6
6
|
import * as S from './DescriptionRow.styles';
|
|
7
|
-
|
|
8
7
|
var Copy = function Copy(_ref) {
|
|
9
8
|
var copyValue = _ref.copyValue,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
texts = _ref.texts,
|
|
10
|
+
className = _ref.className,
|
|
11
|
+
onMouseEnter = _ref.onMouseEnter,
|
|
12
|
+
onMouseLeave = _ref.onMouseLeave;
|
|
15
13
|
var _useIntl = useIntl(),
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
formatMessage = _useIntl.formatMessage;
|
|
18
15
|
var textsObj = useMemo(function () {
|
|
19
16
|
return texts || {
|
|
20
17
|
copiedTooltip: formatMessage({
|
|
@@ -25,15 +22,12 @@ var Copy = function Copy(_ref) {
|
|
|
25
22
|
})
|
|
26
23
|
};
|
|
27
24
|
}, [texts, formatMessage]);
|
|
28
|
-
|
|
29
25
|
var _useState = useState(false),
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
tooltipVisible = _useState[0],
|
|
27
|
+
setTooltipVisible = _useState[1];
|
|
33
28
|
var _useState2 = useState(textsObj.copyTooltip),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
tooltipTitle = _useState2[0],
|
|
30
|
+
setTooltipTitle = _useState2[1];
|
|
37
31
|
var handleCopy = useCallback(function () {
|
|
38
32
|
if (copyValue && copy(copyValue)) {
|
|
39
33
|
setTooltipTitle(textsObj.copiedTooltip);
|
|
@@ -63,5 +57,4 @@ var Copy = function Copy(_ref) {
|
|
|
63
57
|
component: /*#__PURE__*/React.createElement(CopyClipboardM, null)
|
|
64
58
|
})));
|
|
65
59
|
};
|
|
66
|
-
|
|
67
60
|
export default Copy;
|
|
@@ -2,16 +2,15 @@ import React from 'react';
|
|
|
2
2
|
import * as S from './DescriptionRow.styles';
|
|
3
3
|
import Star from './Star';
|
|
4
4
|
import Copy from './Copy';
|
|
5
|
-
|
|
6
5
|
var DescriptionRow = function DescriptionRow(_ref) {
|
|
7
6
|
var label = _ref.label,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
labelIcon = _ref.labelIcon,
|
|
8
|
+
value = _ref.value,
|
|
9
|
+
prefixEl = _ref.prefixEl,
|
|
10
|
+
suffixEl = _ref.suffixEl,
|
|
11
|
+
copyValue = _ref.copyValue,
|
|
12
|
+
starType = _ref.starType,
|
|
13
|
+
texts = _ref.texts;
|
|
15
14
|
return /*#__PURE__*/React.createElement(S.RowWrapper, {
|
|
16
15
|
copyable: Boolean(copyValue)
|
|
17
16
|
}, label && /*#__PURE__*/React.createElement(S.RowLabel, {
|
|
@@ -33,5 +32,4 @@ var DescriptionRow = function DescriptionRow(_ref) {
|
|
|
33
32
|
texts: texts
|
|
34
33
|
})));
|
|
35
34
|
};
|
|
36
|
-
|
|
37
35
|
export default DescriptionRow;
|
package/dist/Row/Star.js
CHANGED
|
@@ -2,10 +2,9 @@ import React from 'react';
|
|
|
2
2
|
import Icon, { StarFillM, StarM } from '@synerise/ds-icon';
|
|
3
3
|
import { theme } from '@synerise/ds-core';
|
|
4
4
|
import * as S from './DescriptionRow.styles';
|
|
5
|
-
|
|
6
5
|
var Star = function Star(_ref) {
|
|
7
6
|
var starType = _ref.starType,
|
|
8
|
-
|
|
7
|
+
hasPrefixEl = _ref.hasPrefixEl;
|
|
9
8
|
return starType === 'active' ? /*#__PURE__*/React.createElement(S.StarWrapper, {
|
|
10
9
|
className: "ds-description-star",
|
|
11
10
|
hasPrefixEl: hasPrefixEl
|
|
@@ -20,5 +19,4 @@ var Star = function Star(_ref) {
|
|
|
20
19
|
color: theme.palette['grey-300']
|
|
21
20
|
}));
|
|
22
21
|
};
|
|
23
|
-
|
|
24
22
|
export default Star;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-description",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"description": "Description UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
],
|
|
35
35
|
"types": "dist/index.d.ts",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@synerise/ds-icon": "^0.
|
|
38
|
-
"@synerise/ds-tooltip": "^0.14.
|
|
37
|
+
"@synerise/ds-icon": "^0.68.0",
|
|
38
|
+
"@synerise/ds-tooltip": "^0.14.51",
|
|
39
39
|
"@synerise/ds-utils": "^0.31.2",
|
|
40
40
|
"classnames": "2.3.2"
|
|
41
41
|
},
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"react-intl": ">=3.12.0 <= 6.8",
|
|
47
47
|
"styled-components": "5.0.1"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "9ebd107163650754a5f55680d62d30812d740084"
|
|
50
50
|
}
|