@synerise/ds-tooltip 0.11.18 → 0.12.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 +20 -0
- package/README.md +6 -6
- package/dist/Tooltip.js +15 -1
- package/dist/Tooltip.styles.d.ts +3 -3
- package/dist/Tooltip.types.d.ts +1 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,26 @@
|
|
|
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.12.0](https://github.com/synerise/synerise-design/compare/@synerise/ds-tooltip@0.11.19...@synerise/ds-tooltip@0.12.0) (2023-02-14)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **tooltip:** adds customComponent prop ([46da191](https://github.com/synerise/synerise-design/commit/46da191d732325f9435352376af0c7420b1e5fdb))
|
|
12
|
+
* **tooltip:** adds renderCustomComponent property ([5caccd7](https://github.com/synerise/synerise-design/commit/5caccd7e6e952e34f910731f537225afffbf2264))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## [0.11.19](https://github.com/synerise/synerise-design/compare/@synerise/ds-tooltip@0.11.18...@synerise/ds-tooltip@0.11.19) (2023-01-12)
|
|
19
|
+
|
|
20
|
+
**Note:** Version bump only for package @synerise/ds-tooltip
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
6
26
|
## [0.11.18](https://github.com/synerise/synerise-design/compare/@synerise/ds-tooltip@0.11.17...@synerise/ds-tooltip@0.11.18) (2022-12-07)
|
|
7
27
|
|
|
8
28
|
**Note:** Version bump only for package @synerise/ds-tooltip
|
package/README.md
CHANGED
|
@@ -36,15 +36,15 @@ Tooltip UI Component
|
|
|
36
36
|
| type | type of tooltip | `default` / `icon` / `simpleLarge` / `tutorial` / `avatar` / `button` | `default` |
|
|
37
37
|
| visible | Whether the floating tooltip card is visible or not | boolean | `false` |
|
|
38
38
|
| timeToHideAfterClick | time after which tooltip disappears [ms] (value 0 inactivate this functionality) | number | 0 |
|
|
39
|
+
| render | render prop that allows to render custom component as tooltip | () => React.ReactNode | - |
|
|
39
40
|
|
|
40
41
|
### ButtonSettings
|
|
41
42
|
|
|
42
|
-
| Property
|
|
43
|
-
|
|
|
44
|
-
| buttonIcon
|
|
45
|
-
| label
|
|
46
|
-
| onClick
|
|
47
|
-
|
|
43
|
+
| Property | Description | Type | Default |
|
|
44
|
+
| ---------- | ------------------------------------------- | ------------------------ | ------- |
|
|
45
|
+
| buttonIcon | Icon of button | React.ReactNode | - |
|
|
46
|
+
| label | Label of button | React.ReactNode / string | - |
|
|
47
|
+
| onClick | Callback executed after clicking the button | () => void | - |
|
|
48
48
|
|
|
49
49
|
### Tutorial
|
|
50
50
|
|
package/dist/Tooltip.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["type", "icon", "title", "status", "description", "tutorials", "tutorialAutoplay", "tutorialAutoplaySpeed", "timeToHideAfterClick", "offset", "children", "button"];
|
|
1
|
+
var _excluded = ["type", "icon", "title", "status", "description", "tutorials", "tutorialAutoplay", "tutorialAutoplaySpeed", "timeToHideAfterClick", "offset", "children", "button", "render"];
|
|
2
2
|
|
|
3
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
4
|
|
|
@@ -43,6 +43,7 @@ var Tooltip = function Tooltip(_ref) {
|
|
|
43
43
|
offset = _ref$offset === void 0 ? 'default' : _ref$offset,
|
|
44
44
|
children = _ref.children,
|
|
45
45
|
button = _ref.button,
|
|
46
|
+
render = _ref.render,
|
|
46
47
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
47
48
|
|
|
48
49
|
var _React$useState = React.useState(false),
|
|
@@ -138,6 +139,19 @@ var Tooltip = function Tooltip(_ref) {
|
|
|
138
139
|
handleOnClickHideDelay(visible);
|
|
139
140
|
}
|
|
140
141
|
};
|
|
142
|
+
|
|
143
|
+
if (render !== undefined) {
|
|
144
|
+
return /*#__PURE__*/React.createElement(AntdTooltip, _extends({
|
|
145
|
+
overlayClassName: offsetClassName,
|
|
146
|
+
autoAdjustOverflow: false,
|
|
147
|
+
title: render(),
|
|
148
|
+
align: {
|
|
149
|
+
offset: [0, 0]
|
|
150
|
+
},
|
|
151
|
+
getPopupContainer: getPopupContainer
|
|
152
|
+
}, handleHideAfterClick, props), children);
|
|
153
|
+
}
|
|
154
|
+
|
|
141
155
|
return titleExists ? /*#__PURE__*/React.createElement(AntdTooltip, _extends({
|
|
142
156
|
overlayClassName: offsetClassName,
|
|
143
157
|
autoAdjustOverflow: false,
|
package/dist/Tooltip.styles.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import TooltipExtendedProps, { tooltipTypes } from './Tooltip.types';
|
|
2
2
|
export declare const TooltipDescription: import("styled-components").StyledComponent<"div", any, TooltipExtendedProps, never>;
|
|
3
|
-
export declare const TooltipTitle: import("styled-components").StyledComponent<"div", any, Pick<TooltipExtendedProps, "icon" | "button" | "status" | "title" | "offset" | "description" | "tutorials" | "tutorialAutoplay" | "tutorialAutoplaySpeed" | "timeToHideAfterClick"> & {
|
|
3
|
+
export declare const TooltipTitle: import("styled-components").StyledComponent<"div", any, Pick<TooltipExtendedProps, "icon" | "button" | "status" | "title" | "offset" | "render" | "description" | "tutorials" | "tutorialAutoplay" | "tutorialAutoplaySpeed" | "timeToHideAfterClick"> & {
|
|
4
4
|
tooltipType: tooltipTypes;
|
|
5
5
|
}, never>;
|
|
6
6
|
export declare const TooltipButton: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
7
7
|
export declare const TooltipContent: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
8
|
-
export declare const TooltipStatus: import("styled-components").StyledComponent<"div", any, Pick<TooltipExtendedProps, "icon" | "button" | "status" | "title" | "offset" | "description" | "tutorials" | "tutorialAutoplay" | "tutorialAutoplaySpeed" | "timeToHideAfterClick"> & {
|
|
8
|
+
export declare const TooltipStatus: import("styled-components").StyledComponent<"div", any, Pick<TooltipExtendedProps, "icon" | "button" | "status" | "title" | "offset" | "render" | "description" | "tutorials" | "tutorialAutoplay" | "tutorialAutoplaySpeed" | "timeToHideAfterClick"> & {
|
|
9
9
|
tooltipType: tooltipTypes;
|
|
10
10
|
}, never>;
|
|
11
|
-
export declare const TooltipComponent: import("styled-components").StyledComponent<"div", any, Pick<TooltipExtendedProps, "icon" | "button" | "status" | "title" | "offset" | "description" | "tutorials" | "tutorialAutoplay" | "tutorialAutoplaySpeed" | "timeToHideAfterClick"> & {
|
|
11
|
+
export declare const TooltipComponent: import("styled-components").StyledComponent<"div", any, Pick<TooltipExtendedProps, "icon" | "button" | "status" | "title" | "offset" | "render" | "description" | "tutorials" | "tutorialAutoplay" | "tutorialAutoplaySpeed" | "timeToHideAfterClick"> & {
|
|
12
12
|
tooltipType: tooltipTypes;
|
|
13
13
|
}, never>;
|
|
14
14
|
export declare const TutorialItem: import("styled-components").StyledComponent<"div", any, TooltipExtendedProps, never>;
|
package/dist/Tooltip.types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-tooltip",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "Tooltip UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "synerise/synerise-design",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
],
|
|
33
33
|
"types": "dist/index.d.ts",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@synerise/ds-button": "^0.17.
|
|
36
|
-
"@synerise/ds-icon": "^0.
|
|
35
|
+
"@synerise/ds-button": "^0.17.11",
|
|
36
|
+
"@synerise/ds-icon": "^0.53.0"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"@synerise/ds-core": "*",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@synerise/ds-utils": "^0.19.0"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "dcd2dfdd97402a7333564d0efb50898e7b97ac0b"
|
|
47
47
|
}
|