@platformatic/ui-components 0.6.8 → 0.6.9
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/.nvmrc +1 -1
- package/package.json +1 -1
- package/src/components/Tooltip.jsx +6 -1
- package/src/stories/Tooltip.stories.jsx +3 -2
package/.nvmrc
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
20.
|
|
1
|
+
20.15.0
|
package/package.json
CHANGED
|
@@ -5,6 +5,7 @@ import { useEffect, useRef, useState } from 'react'
|
|
|
5
5
|
import { DIRECTIONS, DIRECTION_BOTTOM, DIRECTION_LEFT, DIRECTION_RIGHT, DIRECTION_TOP } from './constants'
|
|
6
6
|
|
|
7
7
|
function Tooltip ({
|
|
8
|
+
immediateActive = true,
|
|
8
9
|
direction = DIRECTION_TOP,
|
|
9
10
|
visible = false,
|
|
10
11
|
activeDependsOnVisible = false,
|
|
@@ -16,7 +17,7 @@ function Tooltip ({
|
|
|
16
17
|
}) {
|
|
17
18
|
let timeout
|
|
18
19
|
// const [active, setActive] = useState(activeDependsOnVisible ? visible : false)
|
|
19
|
-
const [active, setActive] = useState(
|
|
20
|
+
const [active, setActive] = useState(immediateActive)
|
|
20
21
|
let componentClassName = tooltipClassName || styles.tooltipTipBaseClass
|
|
21
22
|
componentClassName += ` ${styles.tooltipTip} ` + styles[`${direction}`]
|
|
22
23
|
const fixedStyle = { top: '0px', left: '0px' }
|
|
@@ -111,6 +112,10 @@ Tooltip.propTypes = {
|
|
|
111
112
|
* visible
|
|
112
113
|
*/
|
|
113
114
|
visible: PropTypes.bool,
|
|
115
|
+
/**
|
|
116
|
+
* immediateActive
|
|
117
|
+
*/
|
|
118
|
+
immediateActive: PropTypes.bool,
|
|
114
119
|
/**
|
|
115
120
|
* activeDependsOnVisible
|
|
116
121
|
*/
|
|
@@ -90,6 +90,7 @@ export const TooltipBase = TemplateWithButton.bind({})
|
|
|
90
90
|
// More on args: https://storybook.js.org/docs/react/writing-stories/args
|
|
91
91
|
TooltipBase.args = {
|
|
92
92
|
content: <span>I'm a tooltip over a button</span>,
|
|
93
|
-
delay:
|
|
94
|
-
offset:
|
|
93
|
+
delay: 0,
|
|
94
|
+
offset: 14,
|
|
95
|
+
immediateActive: false
|
|
95
96
|
}
|