@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 CHANGED
@@ -1 +1 @@
1
- 20.14.0
1
+ 20.15.0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@platformatic/ui-components",
3
3
  "description": "Platformatic UI Components",
4
- "version": "0.6.8",
4
+ "version": "0.6.9",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
@@ -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(true)
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: 100,
94
- offset: 44
93
+ delay: 0,
94
+ offset: 14,
95
+ immediateActive: false
95
96
  }