@synerise/ds-table 0.46.42 → 0.47.0
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/Cell/AvatarLabel/AvatarLabel.d.ts +2 -3
- package/dist/Cell/AvatarLabel/AvatarLabel.js +28 -7
- package/dist/Cell/AvatarLabel/AvatarLabel.styles.d.ts +9 -2
- package/dist/Cell/AvatarLabel/AvatarLabel.styles.js +11 -6
- package/dist/Cell/AvatarLabel/AvatarLabel.types.d.ts +9 -7
- package/package.json +18 -18
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.47.0](https://github.com/synerise/synerise-design/compare/@synerise/ds-table@0.46.43...@synerise/ds-table@0.47.0) (2023-12-06)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **table:** ported avatar label solution from UL ([46dfcfe](https://github.com/synerise/synerise-design/commit/46dfcfe7a557aa45aa9b2d35a406da696428f61a))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [0.46.43](https://github.com/synerise/synerise-design/compare/@synerise/ds-table@0.46.42...@synerise/ds-table@0.46.43) (2023-11-16)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @synerise/ds-table
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [0.46.42](https://github.com/synerise/synerise-design/compare/@synerise/ds-table@0.46.41...@synerise/ds-table@0.46.42) (2023-11-09)
|
|
7
26
|
|
|
8
27
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
declare const AvatarLabel: React.FC<Props>;
|
|
1
|
+
import { AvatarLabelProps } from './AvatarLabel.types';
|
|
2
|
+
declare const AvatarLabel: ({ avatar, avatarAction, avatarLink, title, labels, icon, textSize, ellipsis, maxWidth, avatarSize, loader, }: AvatarLabelProps) => JSX.Element;
|
|
4
3
|
export default AvatarLabel;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
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); }
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
2
4
|
import { v4 as uuid } from 'uuid';
|
|
3
5
|
import * as S from './AvatarLabel.styles';
|
|
4
6
|
|
|
5
7
|
var AvatarLabel = function AvatarLabel(_ref) {
|
|
6
8
|
var avatar = _ref.avatar,
|
|
7
9
|
avatarAction = _ref.avatarAction,
|
|
10
|
+
avatarLink = _ref.avatarLink,
|
|
8
11
|
title = _ref.title,
|
|
9
12
|
labels = _ref.labels,
|
|
10
13
|
icon = _ref.icon,
|
|
@@ -14,15 +17,27 @@ var AvatarLabel = function AvatarLabel(_ref) {
|
|
|
14
17
|
maxWidth = _ref.maxWidth,
|
|
15
18
|
avatarSize = _ref.avatarSize,
|
|
16
19
|
loader = _ref.loader;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
var titleEllipsisProps = ellipsis ? {
|
|
21
|
+
ellipsis: {
|
|
22
|
+
tooltip: title
|
|
23
|
+
}
|
|
24
|
+
} : {};
|
|
25
|
+
|
|
26
|
+
var handleLinkClick = function handleLinkClick(event) {
|
|
27
|
+
if (event.metaKey || event.ctrlKey) {
|
|
28
|
+
event.stopPropagation();
|
|
29
|
+
} else if (avatarAction) {
|
|
30
|
+
event.preventDefault();
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
var cellContent = /*#__PURE__*/React.createElement(React.Fragment, null, icon && /*#__PURE__*/React.createElement(S.Icon, null, icon), /*#__PURE__*/React.createElement(S.Avatar, {
|
|
20
35
|
clickable: Boolean(avatarAction)
|
|
21
|
-
}, avatar), /*#__PURE__*/React.createElement(S.Description, null, /*#__PURE__*/React.createElement(S.Title, {
|
|
22
|
-
|
|
36
|
+
}, avatar), /*#__PURE__*/React.createElement(S.Description, null, /*#__PURE__*/React.createElement(S.Title, _extends({}, titleEllipsisProps, {
|
|
37
|
+
hasEllipsis: ellipsis,
|
|
23
38
|
maxWidth: maxWidth,
|
|
24
39
|
avatarSize: avatarSize
|
|
25
|
-
}, title), labels == null ? void 0 : labels.map(function (label) {
|
|
40
|
+
}), title), labels == null ? void 0 : labels.map(function (label) {
|
|
26
41
|
return /*#__PURE__*/React.createElement(S.Label, {
|
|
27
42
|
key: uuid(),
|
|
28
43
|
textSize: textSize,
|
|
@@ -30,6 +45,12 @@ var AvatarLabel = function AvatarLabel(_ref) {
|
|
|
30
45
|
maxWidth: maxWidth
|
|
31
46
|
}, label);
|
|
32
47
|
}), loader && /*#__PURE__*/React.createElement(S.Loader, null, loader)));
|
|
48
|
+
return /*#__PURE__*/React.createElement(S.AvatarLabel, {
|
|
49
|
+
onClick: avatarAction
|
|
50
|
+
}, avatarLink ? /*#__PURE__*/React.createElement(S.AvatarLink, {
|
|
51
|
+
href: avatarLink,
|
|
52
|
+
onClick: handleLinkClick
|
|
53
|
+
}, cellContent) : cellContent);
|
|
33
54
|
};
|
|
34
55
|
|
|
35
56
|
export default AvatarLabel;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export declare const AvatarLabel: import("styled-components").StyledComponent<"div", any, {
|
|
2
3
|
onClick?: (() => void) | undefined;
|
|
3
4
|
}, never>;
|
|
@@ -5,8 +6,14 @@ export declare const Avatar: import("styled-components").StyledComponent<"div",
|
|
|
5
6
|
clickable: boolean;
|
|
6
7
|
}, never>;
|
|
7
8
|
export declare const Description: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
8
|
-
export declare const
|
|
9
|
-
|
|
9
|
+
export declare const AvatarLink: import("styled-components").StyledComponent<"a", any, {}, never>;
|
|
10
|
+
export declare const Title: import("styled-components").StyledComponent<({ size, className, children, ellipsis }: {
|
|
11
|
+
size?: import("@synerise/ds-typography").TextSize | undefined;
|
|
12
|
+
ellipsis?: import("@synerise/ds-typography/dist/Ellipsis").EllipsisProps | undefined;
|
|
13
|
+
children?: import("react").ReactNode;
|
|
14
|
+
className?: string | undefined;
|
|
15
|
+
}) => JSX.Element, any, {
|
|
16
|
+
hasEllipsis?: boolean | undefined;
|
|
10
17
|
maxWidth: number | undefined;
|
|
11
18
|
avatarSize?: string | undefined;
|
|
12
19
|
}, never>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
|
+
import { Text } from '@synerise/ds-typography';
|
|
2
3
|
export var AvatarLabel = styled.div.withConfig({
|
|
3
4
|
displayName: "AvatarLabelstyles__AvatarLabel",
|
|
4
5
|
componentId: "sc-1485c9p-0"
|
|
@@ -15,17 +16,21 @@ export var Description = styled.div.withConfig({
|
|
|
15
16
|
displayName: "AvatarLabelstyles__Description",
|
|
16
17
|
componentId: "sc-1485c9p-2"
|
|
17
18
|
})(["display:flex;min-width:0;flex-direction:column;align-items:flex-start;justify-content:center;"]);
|
|
18
|
-
export var
|
|
19
|
-
displayName: "
|
|
19
|
+
export var AvatarLink = styled.a.withConfig({
|
|
20
|
+
displayName: "AvatarLabelstyles__AvatarLink",
|
|
20
21
|
componentId: "sc-1485c9p-3"
|
|
22
|
+
})(["display:flex;min-width:0;&:hover,&:active,&:focus{text-decoration:none;}"]);
|
|
23
|
+
export var Title = styled(Text).withConfig({
|
|
24
|
+
displayName: "AvatarLabelstyles__Title",
|
|
25
|
+
componentId: "sc-1485c9p-4"
|
|
21
26
|
})(["font-size:14px;line-height:20px;font-weight:500;color:", ";", ";"], function (props) {
|
|
22
27
|
return props.theme.palette['grey-700'];
|
|
23
28
|
}, function (props) {
|
|
24
|
-
return props.ellipsis && css(["
|
|
29
|
+
return Boolean(props.ellipsis) && css(["max-width:", ";"], props.maxWidth ? props.maxWidth + "px" : '100%');
|
|
25
30
|
});
|
|
26
31
|
export var Label = styled.span.withConfig({
|
|
27
32
|
displayName: "AvatarLabelstyles__Label",
|
|
28
|
-
componentId: "sc-1485c9p-
|
|
33
|
+
componentId: "sc-1485c9p-5"
|
|
29
34
|
})(["font-size:13px;line-height:1.38;color:", ";font-weight:400;margin-top:", ";", ";"], function (props) {
|
|
30
35
|
return props.theme.palette['grey-700'];
|
|
31
36
|
}, function (props) {
|
|
@@ -35,9 +40,9 @@ export var Label = styled.span.withConfig({
|
|
|
35
40
|
});
|
|
36
41
|
export var Icon = styled.div.withConfig({
|
|
37
42
|
displayName: "AvatarLabelstyles__Icon",
|
|
38
|
-
componentId: "sc-1485c9p-
|
|
43
|
+
componentId: "sc-1485c9p-6"
|
|
39
44
|
})(["margin-right:8px;"]);
|
|
40
45
|
export var Loader = styled.div.withConfig({
|
|
41
46
|
displayName: "AvatarLabelstyles__Loader",
|
|
42
|
-
componentId: "sc-1485c9p-
|
|
47
|
+
componentId: "sc-1485c9p-7"
|
|
43
48
|
})([""]);
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
export type
|
|
3
|
-
avatar:
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
export type AvatarLabelProps = {
|
|
3
|
+
avatar: ReactElement;
|
|
4
4
|
avatarAction?: () => void;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
avatarLink?: string;
|
|
6
|
+
title: ReactNode;
|
|
7
|
+
labels?: ReactNode[];
|
|
8
|
+
icon?: ReactElement;
|
|
8
9
|
textSize?: 'small' | 'default';
|
|
9
10
|
ellipsis?: boolean;
|
|
10
11
|
maxWidth?: number;
|
|
11
12
|
avatarSize?: string | 'large';
|
|
12
|
-
loader?:
|
|
13
|
+
loader?: ReactElement;
|
|
13
14
|
};
|
|
15
|
+
export type Props = AvatarLabelProps;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-table",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.47.0",
|
|
4
4
|
"description": "Table UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "synerise/synerise-design",
|
|
@@ -34,29 +34,29 @@
|
|
|
34
34
|
"types": "dist/index.d.ts",
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@synerise/ds-alert": "^0.7.49",
|
|
37
|
-
"@synerise/ds-badge": "^0.6.
|
|
37
|
+
"@synerise/ds-badge": "^0.6.44",
|
|
38
38
|
"@synerise/ds-button": "^0.18.7",
|
|
39
39
|
"@synerise/ds-button-group": "^0.6.35",
|
|
40
|
-
"@synerise/ds-checkbox": "^0.11.
|
|
41
|
-
"@synerise/ds-column-manager": "^0.11.
|
|
40
|
+
"@synerise/ds-checkbox": "^0.11.51",
|
|
41
|
+
"@synerise/ds-column-manager": "^0.11.19",
|
|
42
42
|
"@synerise/ds-data-format": "^0.4.4",
|
|
43
|
-
"@synerise/ds-dropdown": "^0.17.
|
|
43
|
+
"@synerise/ds-dropdown": "^0.17.89",
|
|
44
44
|
"@synerise/ds-flag": "^0.4.2",
|
|
45
45
|
"@synerise/ds-icon": "^0.58.7",
|
|
46
|
-
"@synerise/ds-input": "^0.19.
|
|
46
|
+
"@synerise/ds-input": "^0.19.10",
|
|
47
47
|
"@synerise/ds-loader": "^0.2.49",
|
|
48
|
-
"@synerise/ds-menu": "^0.18.
|
|
49
|
-
"@synerise/ds-modal": "^0.17.
|
|
48
|
+
"@synerise/ds-menu": "^0.18.6",
|
|
49
|
+
"@synerise/ds-modal": "^0.17.12",
|
|
50
50
|
"@synerise/ds-pagination": "^0.7.35",
|
|
51
|
-
"@synerise/ds-result": "^0.6.
|
|
52
|
-
"@synerise/ds-scrollbar": "^0.6.
|
|
53
|
-
"@synerise/ds-search": "^0.8.
|
|
54
|
-
"@synerise/ds-select": "^0.15.
|
|
55
|
-
"@synerise/ds-skeleton": "^0.3.
|
|
56
|
-
"@synerise/ds-status": "^0.5.
|
|
57
|
-
"@synerise/ds-tags": "^0.8.
|
|
58
|
-
"@synerise/ds-tooltip": "^0.14.
|
|
59
|
-
"@synerise/ds-typography": "^0.
|
|
51
|
+
"@synerise/ds-result": "^0.6.38",
|
|
52
|
+
"@synerise/ds-scrollbar": "^0.6.13",
|
|
53
|
+
"@synerise/ds-search": "^0.8.73",
|
|
54
|
+
"@synerise/ds-select": "^0.15.28",
|
|
55
|
+
"@synerise/ds-skeleton": "^0.3.16",
|
|
56
|
+
"@synerise/ds-status": "^0.5.93",
|
|
57
|
+
"@synerise/ds-tags": "^0.8.23",
|
|
58
|
+
"@synerise/ds-tooltip": "^0.14.11",
|
|
59
|
+
"@synerise/ds-typography": "^0.14.0",
|
|
60
60
|
"@synerise/ds-utils": "^0.24.21",
|
|
61
61
|
"@types/react-window": "^1.8.5",
|
|
62
62
|
"classnames": "2.3.2",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@testing-library/react": "10.0.1"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "b5c243a1f88351e9bc0185d35fc35ea3673dab89"
|
|
83
83
|
}
|