ywana-core8 0.0.754 → 0.0.755

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.754",
3
+ "version": "0.0.755",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
package/src/html/chip.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import React from 'react'
2
- import { Icon } from './icon';
2
+ import { Icon } from './icon'
3
3
  import { Text } from './text'
4
+ import { Tooltip} from './tooltip'
4
5
  import './chip.css'
5
6
 
6
7
  /**
@@ -8,7 +9,7 @@ import './chip.css'
8
9
  */
9
10
  export const Chip = (props) => {
10
11
 
11
- const { id, icon, label, action, outlined, selected, onSelect } = props
12
+ const { id, icon, label, tooltip, action, outlined, selected, onSelect } = props
12
13
 
13
14
  function select(event) {
14
15
  event.stopPropagation();
@@ -18,7 +19,15 @@ export const Chip = (props) => {
18
19
 
19
20
  let style = outlined ? "outlined" : "normal"
20
21
  if (selected) style = `${style} selected`
21
- return (
22
+ return tooltip ? (
23
+ <Tooltip {...tooltip}>
24
+ <div className={`chip ${style}`} onClick={select}>
25
+ {icon ? <Icon icon={icon} size="small" /> : null}
26
+ <main><Text>{label}</Text></main>
27
+ {action ? <span className="meta">{action}</span> : null}
28
+ </div>
29
+ </Tooltip>
30
+ ) : (
22
31
  <div className={`chip ${style}`} onClick={select}>
23
32
  {icon ? <Icon icon={icon} size="small" /> : null}
24
33
  <main><Text>{label}</Text></main>