@symbo.ls/tooltip 2.11.212 → 2.11.220

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.
Files changed (2) hide show
  1. package/index.js +13 -8
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  'use strict'
2
2
 
3
+ import { isDefined } from '@domql/utils'
3
4
  import { Flex } from '@symbo.ls/atoms'
4
5
 
5
6
  export const Tooltip = {
@@ -22,21 +23,25 @@ export const Tooltip = {
22
23
  attr: { tooltip: true },
23
24
 
24
25
  Title: {
25
- props: {
26
+ if: ({ parent, props }) => isDefined(parent.props.title) || props.text,
27
+ props: ({ parent }) => ({
28
+ width: 'fit-content',
26
29
  fontWeight: 500,
27
30
  color: 'gray12',
28
- text: 'And tooltip is coming'
29
- }
31
+ text: parent.props.title
32
+ })
30
33
  },
31
34
 
32
35
  P: {
33
- props: {
36
+ if: ({ parent, props }) => isDefined(parent.props.description) || props.text,
37
+ props: ({ parent }) => ({
38
+ width: 'fit-content',
34
39
  fontSize: 'Z2',
35
40
  margin: '0',
36
41
  color: 'gray6',
37
- text: 'and winter too',
38
- fontWeight: '400'
39
- }
42
+ fontWeight: '400',
43
+ text: parent.props.description
44
+ })
40
45
  }
41
46
  }
42
47
 
@@ -103,7 +108,7 @@ export const TooltipHidden = {
103
108
  export const TooltipParent = {
104
109
  props: ({ Tooltip, TooltipHidden }) => {
105
110
  const TooltipElem = (Tooltip || TooltipHidden)
106
- const TooltipActive = TooltipElem && TooltipElem['.active']
111
+ const TooltipActive = TooltipElem && TooltipElem.props['.active']
107
112
  return {
108
113
  position: 'relative',
109
114
  zIndex: 999,
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@symbo.ls/tooltip",
3
- "version": "2.11.212",
3
+ "version": "2.11.220",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
- "gitHead": "12914eac8527ac1df36183098bbf3dfcfaa2e027",
6
+ "gitHead": "557d47cf9535b98e5cfbe8bed505da0db847fc12",
7
7
  "dependencies": {
8
8
  "@symbo.ls/atoms": "latest"
9
9
  },