ywana-core8 0.0.274 → 0.0.275

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ywana-core8",
3
- "version": "0.0.274",
3
+ "version": "0.0.275",
4
4
  "description": "ywana-core8",
5
5
  "author": "Ernesto Roldan Garcia",
6
6
  "license": "MIT",
@@ -0,0 +1,13 @@
1
+ import React, { useState } from 'react'
2
+ import { Tooltip } from './tooltip'
3
+
4
+ const TooltipTest = (prop) => {
5
+
6
+ return (
7
+ <>
8
+ <Tooltip text="role1" top="2rem" >
9
+ John Smith
10
+ </Tooltip>
11
+ </>
12
+ )
13
+ }
@@ -1,3 +1,18 @@
1
1
  .tooltip {
2
-
2
+ position: relative;
3
+ cursor: pointer;
4
+ }
5
+
6
+ .tooltip-text {
7
+ display: none;
8
+ }
9
+
10
+ .tooltip:hover .tooltip-text {
11
+ display: block;
12
+ position: absolute;
13
+ border: solid 1px var(--divider-color);
14
+ background-color: var(--text-color-light);
15
+ color: var(--paper-color);
16
+ padding: .5rem;
17
+ border-radius: 4px;
3
18
  }
@@ -6,12 +6,15 @@ import './tooltip.css'
6
6
  */
7
7
  export const Tooltip = (props) => {
8
8
 
9
- const { text = "..." } = props
9
+ const { text = "...", top = "1rem", left = "1rem" } = props
10
+
11
+ const style = { top, left }
10
12
 
11
13
  return (
12
- <ReactTooltip id="filters" effect="solid" className="tooltip">
13
- <Text use="body2">{text}</Text>
14
- </ReactTooltip>
14
+ <div className="tooltip" >
15
+ <span className="tooltip-text" style={style}>{text}</span>
16
+ {props.children}
17
+ </div>
15
18
  )
16
19
 
17
20
  }