@synerise/ds-information-card 0.4.14 → 0.5.1
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 +24 -0
- package/README.md +10 -0
- package/dist/InformationCard.js +1 -2
- package/dist/InformationCard.styles.d.ts +1 -0
- package/dist/InformationCard.styles.js +27 -22
- package/dist/InformationCardTooltip/InformationCard.constants.d.ts +34 -0
- package/dist/InformationCardTooltip/InformationCard.constants.js +34 -0
- package/dist/InformationCardTooltip/InformationCardTooltip.d.ts +3 -0
- package/dist/InformationCardTooltip/InformationCardTooltip.js +52 -0
- package/dist/InformationCardTooltip/InformationCardTooltip.styles.d.ts +2 -0
- package/dist/InformationCardTooltip/InformationCardTooltip.styles.js +9 -0
- package/dist/InformationCardTooltip/InformationCardTooltip.types.d.ts +13 -0
- package/dist/InformationCardTooltip/InformationCardTooltip.types.js +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -1
- package/package.json +12 -12
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,30 @@
|
|
|
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.5.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-information-card@0.5.0...@synerise/ds-information-card@0.5.1) (2024-07-31)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-information-card
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [0.5.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-information-card@0.4.14...@synerise/ds-information-card@0.5.0) (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
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* **information-card:** added infocard tooltip subcomponent ([688ae57](https://github.com/Synerise/synerise-design/commit/688ae57b90460c943a814a8980efe1093cb4215d))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
6
30
|
## [0.4.14](https://github.com/Synerise/synerise-design/compare/@synerise/ds-information-card@0.4.13...@synerise/ds-information-card@0.4.14) (2024-07-15)
|
|
7
31
|
|
|
8
32
|
**Note:** Version bump only for package @synerise/ds-information-card
|
package/README.md
CHANGED
|
@@ -110,3 +110,13 @@ Displays a list of icons with value and optional tooltip
|
|
|
110
110
|
| label | Label to display | `ReactNode` | - |
|
|
111
111
|
| tooltip | Tooltip text | `ReactNode` | - |
|
|
112
112
|
| tooltipProps | Tooltip config, see ds-tooltip | `TooltipProps` | - |
|
|
113
|
+
|
|
114
|
+
### InformationCardTooltip
|
|
115
|
+
|
|
116
|
+
Displays InformationCard as a tooltip with `children` node as trigger
|
|
117
|
+
|
|
118
|
+
| Property | Description | Type | Default |
|
|
119
|
+
|----------------------|-----------------------------------------|--------------------------------------------------------------------|---------|
|
|
120
|
+
| informationCardProps | Props for rendering the InformationCard | `InformationCardProps` | - |
|
|
121
|
+
| triggerProps | Trigger props. See rc-trigger | `Partial<TriggerProps> & { ref?: React.LegacyRef<TriggerHandle> }` | - |
|
|
122
|
+
| children | trigger element | `ReactNode` | - |
|
package/dist/InformationCard.js
CHANGED
|
@@ -8,7 +8,6 @@ import React, { forwardRef, useState, useRef, useEffect } from 'react';
|
|
|
8
8
|
import { SegmentM } from '@synerise/ds-icon';
|
|
9
9
|
import Card from '@synerise/ds-card';
|
|
10
10
|
import { useResizeObserver } from '@synerise/ds-utils';
|
|
11
|
-
import Copy from '@synerise/ds-description/dist/Row/Copy';
|
|
12
11
|
import { RowWrapper } from '@synerise/ds-description/dist/Row/DescriptionRow.styles';
|
|
13
12
|
import "rc-trigger/assets/index.css";
|
|
14
13
|
import * as S from './InformationCard.styles';
|
|
@@ -61,7 +60,7 @@ var InformationCard = forwardRef(function (_ref, ref) {
|
|
|
61
60
|
alignItems: 'center',
|
|
62
61
|
textAlign: 'left'
|
|
63
62
|
}
|
|
64
|
-
}, /*#__PURE__*/React.createElement("span", null, content), /*#__PURE__*/React.createElement(
|
|
63
|
+
}, /*#__PURE__*/React.createElement("span", null, content), /*#__PURE__*/React.createElement(S.Copyable, {
|
|
65
64
|
copyValue: content,
|
|
66
65
|
texts: {
|
|
67
66
|
copyTooltip: copyTooltip != null ? copyTooltip : 'Copy to clipboard',
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const Flex: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const Copyable: import("styled-components").StyledComponent<({ copyValue, texts, className, onMouseEnter, onMouseLeave }: import("@synerise/ds-description/dist/Row/Copy.types").CopyProps) => import("react").JSX.Element, any, {}, never>;
|
|
3
4
|
export declare const Divider: import("styled-components").StyledComponent<({ marginBottom, marginTop, style, labelAbove, labelBelow, ...antdDividerProps }: import("@synerise/ds-divider").DividerProps) => import("react").JSX.Element, any, {}, never>;
|
|
4
5
|
export declare const FooterWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
6
|
export declare const ActionsMenuItems: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -4,6 +4,7 @@ function _taggedTemplateLiteralLoose(strings, raw) { if (!raw) { raw = strings.s
|
|
|
4
4
|
|
|
5
5
|
import styled, { createGlobalStyle, css } from 'styled-components';
|
|
6
6
|
import { CardStyles } from '@synerise/ds-card';
|
|
7
|
+
import { DescriptionCopyable } from '@synerise/ds-description';
|
|
7
8
|
import DSDivider from '@synerise/ds-divider';
|
|
8
9
|
import { macro } from '@synerise/ds-typography';
|
|
9
10
|
import * as S from '@synerise/ds-tooltip/dist/Tooltip.styles';
|
|
@@ -12,15 +13,19 @@ export var Flex = styled.div.withConfig({
|
|
|
12
13
|
displayName: "InformationCardstyles__Flex",
|
|
13
14
|
componentId: "zxu5qa-0"
|
|
14
15
|
})(["display:flex;"]);
|
|
16
|
+
export var Copyable = styled(DescriptionCopyable).withConfig({
|
|
17
|
+
displayName: "InformationCardstyles__Copyable",
|
|
18
|
+
componentId: "zxu5qa-1"
|
|
19
|
+
})(["display:flex;align-items:center;height:20px;"]);
|
|
15
20
|
export var Divider = styled(DSDivider).withConfig({
|
|
16
21
|
displayName: "InformationCardstyles__Divider",
|
|
17
|
-
componentId: "zxu5qa-
|
|
22
|
+
componentId: "zxu5qa-2"
|
|
18
23
|
})(["border-color:", ";margin:8px 0;"], function (props) {
|
|
19
24
|
return props.theme.palette['grey-300'];
|
|
20
25
|
});
|
|
21
26
|
export var FooterWrapper = styled(Flex).withConfig({
|
|
22
27
|
displayName: "InformationCardstyles__FooterWrapper",
|
|
23
|
-
componentId: "zxu5qa-
|
|
28
|
+
componentId: "zxu5qa-3"
|
|
24
29
|
})(["background:", ";border-top:solid 1px ", ";padding:8px;"], function (props) {
|
|
25
30
|
return props.theme.palette['grey-050'];
|
|
26
31
|
}, function (props) {
|
|
@@ -28,11 +33,11 @@ export var FooterWrapper = styled(Flex).withConfig({
|
|
|
28
33
|
});
|
|
29
34
|
export var ActionsMenuItems = styled.div.withConfig({
|
|
30
35
|
displayName: "InformationCardstyles__ActionsMenuItems",
|
|
31
|
-
componentId: "zxu5qa-
|
|
36
|
+
componentId: "zxu5qa-4"
|
|
32
37
|
})([""]);
|
|
33
38
|
export var FlexGrow = styled.div.withConfig({
|
|
34
39
|
displayName: "InformationCardstyles__FlexGrow",
|
|
35
|
-
componentId: "zxu5qa-
|
|
40
|
+
componentId: "zxu5qa-5"
|
|
36
41
|
})(["flex-grow:", ";"], function (_ref) {
|
|
37
42
|
var _ref$grow = _ref.grow,
|
|
38
43
|
grow = _ref$grow === void 0 ? 1 : _ref$grow;
|
|
@@ -40,22 +45,22 @@ export var FlexGrow = styled.div.withConfig({
|
|
|
40
45
|
});
|
|
41
46
|
export var ActionButtonContainer = styled.div.withConfig({
|
|
42
47
|
displayName: "InformationCardstyles__ActionButtonContainer",
|
|
43
|
-
componentId: "zxu5qa-
|
|
48
|
+
componentId: "zxu5qa-6"
|
|
44
49
|
})([""]);
|
|
45
50
|
export var InfoCardSlidesWrapper = styled.div.withConfig({
|
|
46
51
|
displayName: "InformationCardstyles__InfoCardSlidesWrapper",
|
|
47
|
-
componentId: "zxu5qa-
|
|
52
|
+
componentId: "zxu5qa-7"
|
|
48
53
|
})([""]);
|
|
49
54
|
export var InfoCardSlide = styled.div.withConfig({
|
|
50
55
|
displayName: "InformationCardstyles__InfoCardSlide",
|
|
51
|
-
componentId: "zxu5qa-
|
|
56
|
+
componentId: "zxu5qa-8"
|
|
52
57
|
})(["", ""], function (props) {
|
|
53
58
|
return props.height && "max-height: " + props.height + "px;";
|
|
54
59
|
});
|
|
55
60
|
export var InfoCardWrapper = styled.div.withConfig({
|
|
56
61
|
displayName: "InformationCardstyles__InfoCardWrapper",
|
|
57
|
-
componentId: "zxu5qa-
|
|
58
|
-
})(["margin-left:", ";width:", "px;overflow:hidden;", "{width:", "px;display:flex;transition:left 0.3s;position:relative;left:", ";}", "{width:", "px;height:min-content;}overflow-wrap:anywhere;background-color:white;border-radius:3px;box-shadow:", ";", "{font-weight:400;", "}", "{padding-top:0;display:flex;flex-direction:column;gap:8px;}", "{padding:16px 16px 1px 16px;margin-bottom:16px;}", "{align-self:center;margin-left:10px;margin-right:10px;}", "{margin:0;}", "{margin:0;
|
|
62
|
+
componentId: "zxu5qa-9"
|
|
63
|
+
})(["margin-left:", ";width:", "px;overflow:hidden;", "{width:", "px;display:flex;transition:left 0.3s;position:relative;left:", ";}", "{width:", "px;height:min-content;}overflow-wrap:anywhere;background-color:white;border-radius:3px;box-shadow:", ";", "{font-weight:400;", "}", "{padding-top:0;display:flex;flex-direction:column;gap:8px;}", "{padding:16px 16px 1px 16px;margin-bottom:16px;}", "{align-self:center;margin-left:10px;margin-right:10px;}", "{margin:0;gap:2px;}", "{margin:0;}", "", "{margin-bottom:0;font-size:14px;}.ds-button{background:transparent;}.btn-focus,.btn-focus:hover{box-shadow:unset;}"], function (props) {
|
|
59
64
|
return props.asTooltip ? '0' : '8px';
|
|
60
65
|
}, INFOCARD_WIDTH, InfoCardSlidesWrapper, function (props) {
|
|
61
66
|
return props.hasActionsMenu ? INFOCARD_WIDTH * 2 : INFOCARD_WIDTH;
|
|
@@ -65,18 +70,18 @@ export var InfoCardWrapper = styled.div.withConfig({
|
|
|
65
70
|
return props.asTooltip ? 'unset' : '0 16px 32px 0 rgba(35, 41, 54, 0.1)';
|
|
66
71
|
}, CardStyles.Card.Container, function (props) {
|
|
67
72
|
return !props.hasFooter && css(["padding-bottom:8px;margin-bottom:1px;"]);
|
|
68
|
-
}, CardStyles.Card.PaddingWrapper, CardStyles.Card.Header, CardStyles.Card.IconContainer, CardStyles.Card.HeaderContent, CardStyles.Card.TitleWrapper, CardStyles.Card.
|
|
73
|
+
}, CardStyles.Card.PaddingWrapper, CardStyles.Card.Header, CardStyles.Card.IconContainer, CardStyles.Card.HeaderContent, CardStyles.Card.TitleWrapper, CardStyles.Card.Title, CardStyles.Card.Title);
|
|
69
74
|
export var AlertWrapper = styled.div.withConfig({
|
|
70
75
|
displayName: "InformationCardstyles__AlertWrapper",
|
|
71
|
-
componentId: "zxu5qa-
|
|
76
|
+
componentId: "zxu5qa-10"
|
|
72
77
|
})(["padding-bottom:8px;:empty{display:none;}"]);
|
|
73
78
|
export var NonEditableWrapper = styled.div.withConfig({
|
|
74
79
|
displayName: "InformationCardstyles__NonEditableWrapper",
|
|
75
|
-
componentId: "zxu5qa-
|
|
80
|
+
componentId: "zxu5qa-11"
|
|
76
81
|
})(["padding-bottom:8px;:empty{display:none;}"]);
|
|
77
82
|
export var DescriptionWrapper = styled.div.withConfig({
|
|
78
83
|
displayName: "InformationCardstyles__DescriptionWrapper",
|
|
79
|
-
componentId: "zxu5qa-
|
|
84
|
+
componentId: "zxu5qa-12"
|
|
80
85
|
})(["padding:0 16px;"]);
|
|
81
86
|
/**
|
|
82
87
|
* This component can be used to style container with popovers/tooltips to disable arrow.
|
|
@@ -84,7 +89,7 @@ export var DescriptionWrapper = styled.div.withConfig({
|
|
|
84
89
|
|
|
85
90
|
export var HidePopoverArrowWrapper = styled.div.withConfig({
|
|
86
91
|
displayName: "InformationCardstyles__HidePopoverArrowWrapper",
|
|
87
|
-
componentId: "zxu5qa-
|
|
92
|
+
componentId: "zxu5qa-13"
|
|
88
93
|
})([".ant-popover-arrow-content,.ant-tooltip-arrow-content{display:none;}"]);
|
|
89
94
|
/**
|
|
90
95
|
* Should be mounted in application where.
|
|
@@ -93,36 +98,36 @@ export var HidePopoverArrowWrapper = styled.div.withConfig({
|
|
|
93
98
|
export var GlobalCSSHidePopoverArrow = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n .ant-popover-arrow-content,.ant-tooltip-arrow-content {\n display: none;\n}"])));
|
|
94
99
|
export var ExtraInfo = styled.div.withConfig({
|
|
95
100
|
displayName: "InformationCardstyles__ExtraInfo",
|
|
96
|
-
componentId: "zxu5qa-
|
|
101
|
+
componentId: "zxu5qa-14"
|
|
97
102
|
})(["margin-bottom:1px;"]);
|
|
98
103
|
export var TooltipComponentClassName = S.TooltipComponent;
|
|
99
104
|
export var InformationCardActionsWrapper = styled.div.withConfig({
|
|
100
105
|
displayName: "InformationCardstyles__InformationCardActionsWrapper",
|
|
101
|
-
componentId: "zxu5qa-
|
|
106
|
+
componentId: "zxu5qa-15"
|
|
102
107
|
})(["padding:8px;"]);
|
|
103
108
|
export var InformationCardPropertyListWrapper = styled.div.withConfig({
|
|
104
109
|
displayName: "InformationCardstyles__InformationCardPropertyListWrapper",
|
|
105
|
-
componentId: "zxu5qa-
|
|
110
|
+
componentId: "zxu5qa-16"
|
|
106
111
|
})(["display:flex;flex-direction:column;padding:0 16px 8px;"]);
|
|
107
112
|
export var InformationCardPropertyItem = styled.div.withConfig({
|
|
108
113
|
displayName: "InformationCardstyles__InformationCardPropertyItem",
|
|
109
|
-
componentId: "zxu5qa-
|
|
114
|
+
componentId: "zxu5qa-17"
|
|
110
115
|
})(["display:flex;align-items:center;height:24px;gap:8px;"]);
|
|
111
116
|
export var InformationCardPropertyItemLabel = styled.span.withConfig({
|
|
112
117
|
displayName: "InformationCardstyles__InformationCardPropertyItemLabel",
|
|
113
|
-
componentId: "zxu5qa-
|
|
118
|
+
componentId: "zxu5qa-18"
|
|
114
119
|
})(["", ""], macro.small);
|
|
115
120
|
export var InformationCardPropertyItemValue = styled.span.withConfig({
|
|
116
121
|
displayName: "InformationCardstyles__InformationCardPropertyItemValue",
|
|
117
|
-
componentId: "zxu5qa-
|
|
122
|
+
componentId: "zxu5qa-19"
|
|
118
123
|
})(["", " font-weight:500;"], macro.small);
|
|
119
124
|
export var InformationCardSummaryWrapper = styled(Flex).withConfig({
|
|
120
125
|
displayName: "InformationCardstyles__InformationCardSummaryWrapper",
|
|
121
|
-
componentId: "zxu5qa-
|
|
126
|
+
componentId: "zxu5qa-20"
|
|
122
127
|
})(["margin:0 16px;border-top:dashed 1px ", ";padding-top:16px;padding-bottom:8px;gap:4px;flex-wrap:wrap;"], function (props) {
|
|
123
128
|
return props.theme.palette['grey-300'];
|
|
124
129
|
});
|
|
125
130
|
export var InformationCardSummaryItem = styled(Flex).withConfig({
|
|
126
131
|
displayName: "InformationCardstyles__InformationCardSummaryItem",
|
|
127
|
-
componentId: "zxu5qa-
|
|
132
|
+
componentId: "zxu5qa-21"
|
|
128
133
|
})(["font-weight:500;align-items:center;gap:4px;"]);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export declare const TRIGGER_PLACEMENTS: {
|
|
2
|
+
left: {
|
|
3
|
+
points: string[];
|
|
4
|
+
offset: number[];
|
|
5
|
+
};
|
|
6
|
+
right: {
|
|
7
|
+
points: string[];
|
|
8
|
+
offset: number[];
|
|
9
|
+
};
|
|
10
|
+
top: {
|
|
11
|
+
points: string[];
|
|
12
|
+
offset: number[];
|
|
13
|
+
};
|
|
14
|
+
bottom: {
|
|
15
|
+
points: string[];
|
|
16
|
+
offset: number[];
|
|
17
|
+
};
|
|
18
|
+
topLeft: {
|
|
19
|
+
points: string[];
|
|
20
|
+
offset: number[];
|
|
21
|
+
};
|
|
22
|
+
topRight: {
|
|
23
|
+
points: string[];
|
|
24
|
+
offset: number[];
|
|
25
|
+
};
|
|
26
|
+
bottomRight: {
|
|
27
|
+
points: string[];
|
|
28
|
+
offset: number[];
|
|
29
|
+
};
|
|
30
|
+
bottomLeft: {
|
|
31
|
+
points: string[];
|
|
32
|
+
offset: number[];
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export var TRIGGER_PLACEMENTS = {
|
|
2
|
+
left: {
|
|
3
|
+
points: ['cr', 'cl'],
|
|
4
|
+
offset: [-8, 0]
|
|
5
|
+
},
|
|
6
|
+
right: {
|
|
7
|
+
points: ['cl', 'cr'],
|
|
8
|
+
offset: [0, 0]
|
|
9
|
+
},
|
|
10
|
+
top: {
|
|
11
|
+
points: ['bc', 'tc'],
|
|
12
|
+
offset: [0, -8]
|
|
13
|
+
},
|
|
14
|
+
bottom: {
|
|
15
|
+
points: ['tc', 'bc'],
|
|
16
|
+
offset: [0, 8]
|
|
17
|
+
},
|
|
18
|
+
topLeft: {
|
|
19
|
+
points: ['bl', 'tl'],
|
|
20
|
+
offset: [0, -8]
|
|
21
|
+
},
|
|
22
|
+
topRight: {
|
|
23
|
+
points: ['br', 'tr'],
|
|
24
|
+
offset: [0, -8]
|
|
25
|
+
},
|
|
26
|
+
bottomRight: {
|
|
27
|
+
points: ['tr', 'br'],
|
|
28
|
+
offset: [0, 8]
|
|
29
|
+
},
|
|
30
|
+
bottomLeft: {
|
|
31
|
+
points: ['tl', 'bl'],
|
|
32
|
+
offset: [0, 8]
|
|
33
|
+
}
|
|
34
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
var _excluded = ["triggerProps", "children", "style", "informationCardProps"];
|
|
2
|
+
|
|
3
|
+
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); }
|
|
4
|
+
|
|
5
|
+
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; }
|
|
6
|
+
|
|
7
|
+
import React, { useCallback, useMemo } from 'react';
|
|
8
|
+
import Trigger from 'rc-trigger';
|
|
9
|
+
import { useTheme } from '@synerise/ds-core';
|
|
10
|
+
import InformationCard from '../InformationCard';
|
|
11
|
+
import { TRIGGER_PLACEMENTS } from './InformationCard.constants';
|
|
12
|
+
import * as S from './InformationCardTooltip.styles';
|
|
13
|
+
export var InformationCardTooltip = function InformationCardTooltip(_ref) {
|
|
14
|
+
var _triggerProps$default;
|
|
15
|
+
|
|
16
|
+
var triggerProps = _ref.triggerProps,
|
|
17
|
+
children = _ref.children,
|
|
18
|
+
style = _ref.style,
|
|
19
|
+
informationCardProps = _ref.informationCardProps,
|
|
20
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
21
|
+
|
|
22
|
+
var dsTheme = useTheme();
|
|
23
|
+
var zIndex = parseInt(dsTheme.variables['zindex-tooltip'], 10);
|
|
24
|
+
var renderedInfocard = useMemo(function () {
|
|
25
|
+
return /*#__PURE__*/React.createElement(InformationCard, informationCardProps);
|
|
26
|
+
}, [informationCardProps]);
|
|
27
|
+
var cancelBubblingEvent = useCallback(function () {
|
|
28
|
+
return function (event) {
|
|
29
|
+
return event.stopPropagation();
|
|
30
|
+
};
|
|
31
|
+
}, []);
|
|
32
|
+
return (
|
|
33
|
+
/*#__PURE__*/
|
|
34
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
35
|
+
React.createElement(S.InformationCardTooltipWrapper, _extends({}, rest, {
|
|
36
|
+
onKeyDown: cancelBubblingEvent,
|
|
37
|
+
onClick: cancelBubblingEvent
|
|
38
|
+
}), /*#__PURE__*/React.createElement(Trigger, _extends({
|
|
39
|
+
builtinPlacements: TRIGGER_PLACEMENTS,
|
|
40
|
+
defaultPopupVisible: (_triggerProps$default = triggerProps == null ? void 0 : triggerProps.defaultPopupVisible) != null ? _triggerProps$default : false,
|
|
41
|
+
action: (triggerProps == null ? void 0 : triggerProps.action) || ['click', 'hover'],
|
|
42
|
+
popupPlacement: (triggerProps == null ? void 0 : triggerProps.popupPlacement) || 'right',
|
|
43
|
+
popup: renderedInfocard,
|
|
44
|
+
popupClassName: "ignore-click-outside ds-hide-arrow",
|
|
45
|
+
mouseEnterDelay: 0.2,
|
|
46
|
+
popupStyle: {
|
|
47
|
+
zIndex: zIndex
|
|
48
|
+
},
|
|
49
|
+
zIndex: zIndex
|
|
50
|
+
}, triggerProps), /*#__PURE__*/React.createElement(S.InformationCardTooltipTrigger, null, children)))
|
|
51
|
+
);
|
|
52
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
export var InformationCardTooltipWrapper = styled.div.withConfig({
|
|
3
|
+
displayName: "InformationCardTooltipstyles__InformationCardTooltipWrapper",
|
|
4
|
+
componentId: "sc-1q11fca-0"
|
|
5
|
+
})([""]);
|
|
6
|
+
export var InformationCardTooltipTrigger = styled.div.withConfig({
|
|
7
|
+
displayName: "InformationCardTooltipstyles__InformationCardTooltipTrigger",
|
|
8
|
+
componentId: "sc-1q11fca-1"
|
|
9
|
+
})([""]);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Component, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import type { TriggerProps } from 'rc-trigger';
|
|
3
|
+
import type { InformationCardProps } from '../InformationCard.types';
|
|
4
|
+
export type TriggerHandle = Component<TriggerProps> & {
|
|
5
|
+
getPopupDomNode: () => HTMLElement;
|
|
6
|
+
};
|
|
7
|
+
export type InformationCardTooltipProps = Omit<HTMLAttributes<HTMLDivElement>, 'onClick' | 'onKeyDown'> & {
|
|
8
|
+
informationCardProps: InformationCardProps;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
triggerProps?: Partial<TriggerProps> & {
|
|
11
|
+
ref?: React.LegacyRef<TriggerHandle>;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -3,3 +3,6 @@ export { InformationCardPropertyList } from './InformationCardPropertyList/Infor
|
|
|
3
3
|
export type { InformationCardPropertyItem, InformationCardPropertyItemTypes, InformationCardPropertyListProps, } from './InformationCardPropertyList/InformationCardPropertyList.types';
|
|
4
4
|
export { buildExtraInfo, buildIconBadge, buildInitialsBadge } from './InformationCard.utils';
|
|
5
5
|
export type { InformationCardProps } from './InformationCard.types';
|
|
6
|
+
export { InformationCardTooltip } from './InformationCardTooltip/InformationCardTooltip';
|
|
7
|
+
export { TRIGGER_PLACEMENTS } from './InformationCardTooltip/InformationCard.constants';
|
|
8
|
+
export type { InformationCardTooltipProps } from './InformationCardTooltip/InformationCardTooltip.types';
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export { default } from './InformationCard';
|
|
2
2
|
export { InformationCardPropertyList } from './InformationCardPropertyList/InformationCardPropertyList';
|
|
3
|
-
export { buildExtraInfo, buildIconBadge, buildInitialsBadge } from './InformationCard.utils';
|
|
3
|
+
export { buildExtraInfo, buildIconBadge, buildInitialsBadge } from './InformationCard.utils';
|
|
4
|
+
export { InformationCardTooltip } from './InformationCardTooltip/InformationCardTooltip';
|
|
5
|
+
export { TRIGGER_PLACEMENTS } from './InformationCardTooltip/InformationCard.constants';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-information-card",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "InformationCard UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -34,19 +34,19 @@
|
|
|
34
34
|
],
|
|
35
35
|
"types": "dist/index.d.ts",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@synerise/ds-alert": "^0.8.
|
|
38
|
-
"@synerise/ds-avatar": "^0.17.
|
|
39
|
-
"@synerise/ds-badge": "^0.8.
|
|
40
|
-
"@synerise/ds-button": "^0.21.
|
|
41
|
-
"@synerise/ds-card": "^0.18.
|
|
42
|
-
"@synerise/ds-description": "^0.3.
|
|
37
|
+
"@synerise/ds-alert": "^0.8.21",
|
|
38
|
+
"@synerise/ds-avatar": "^0.17.3",
|
|
39
|
+
"@synerise/ds-badge": "^0.8.2",
|
|
40
|
+
"@synerise/ds-button": "^0.21.4",
|
|
41
|
+
"@synerise/ds-card": "^0.18.5",
|
|
42
|
+
"@synerise/ds-description": "^0.3.111",
|
|
43
43
|
"@synerise/ds-divider": "^0.7.1",
|
|
44
|
-
"@synerise/ds-dropdown": "^0.18.
|
|
44
|
+
"@synerise/ds-dropdown": "^0.18.7",
|
|
45
45
|
"@synerise/ds-icon": "^0.64.1",
|
|
46
|
-
"@synerise/ds-menu": "^0.19.
|
|
46
|
+
"@synerise/ds-menu": "^0.19.7",
|
|
47
47
|
"@synerise/ds-scrollbar": "^0.11.4",
|
|
48
|
-
"@synerise/ds-subtle-form": "^0.9.
|
|
49
|
-
"@synerise/ds-tooltip": "^0.14.
|
|
48
|
+
"@synerise/ds-subtle-form": "^0.9.118",
|
|
49
|
+
"@synerise/ds-tooltip": "^0.14.34",
|
|
50
50
|
"@synerise/ds-typography": "^0.15.1",
|
|
51
51
|
"rc-trigger": "5.2.5",
|
|
52
52
|
"react-intl": "3.12.0"
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"react": ">=16.9.0 <= 17.0.2",
|
|
57
57
|
"styled-components": "5.0.1"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "9780605713f2ee1cb62d79a8ab027058117c4e4a"
|
|
60
60
|
}
|