@symbo.ls/tooltip 2.11.488 → 2.11.491

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 +53 -55
  2. package/package.json +3 -3
package/index.js CHANGED
@@ -44,65 +44,63 @@ export const Tooltip = {
44
44
  export const TooltipHidden = {
45
45
  extend: 'Tooltip',
46
46
 
47
- props: {
47
+ props: ({ props }) => ({
48
48
  position: 'absolute',
49
49
  pointerEvents: 'none',
50
50
  opacity: '0',
51
51
  visibility: 'hidden',
52
52
  transition: 'C defaultBezier opacity, C defaultBezier visibility, B defaultBezier transform',
53
53
 
54
- isTop: ({ props }) => !props.shapeDirection || props.shapeDirection === 'top',
55
- '.isTop': {
56
- top: '112%',
57
- left: '50%',
58
- transform: 'translate3d(-50%,10%,0)',
59
-
60
- '.active': {
61
- transform: 'translate3d(-50%,0,0)',
62
- opacity: 1,
63
- visibility: 'visible'
64
- }
65
- },
66
-
67
- isRight: ({ props }) => props.shapeDirection === 'right',
68
- '.isRight': {
69
- transform: 'translate3d(10%,-50%,0)',
70
- left: '112%',
71
- top: '50%',
72
-
73
- '.active': {
74
- transform: 'translate3d(0%,-50%,0)',
75
- opacity: 1,
76
- visibility: 'visible'
77
- }
78
- },
79
-
80
- isBottom: ({ props }) => props.shapeDirection === 'bottom',
81
- '.isBottom': {
82
- transform: 'translate3d(-50%,-10%,0)',
83
- bottom: '112%',
84
- left: '50%',
85
-
86
- '.active': {
87
- transform: 'translate3d(-50%,0,0)',
88
- opacity: 1,
89
- visibility: 'visible'
90
- }
91
- },
92
-
93
- isLeft: ({ props }) => props.shapeDirection === 'left',
94
- '.isLeft': {
95
- transform: 'translate3d(10%,-50%,0)',
96
- right: '112%',
97
- top: '50%',
98
-
99
- '.active': {
100
- transform: 'translate3d(0%,-50%,0)',
101
- opacity: 1,
102
- visibility: 'visible'
103
- }
104
- }
105
- }
54
+ ...(!props.shapeDirection || props.shapeDirection === 'top'
55
+ ? {
56
+ top: '112%',
57
+ left: '50%',
58
+ transform: 'translate3d(-50%,10%,0)',
59
+
60
+ '.isActive': {
61
+ transform: 'translate3d(-50%,0,0)',
62
+ opacity: 1,
63
+ visibility: 'visible'
64
+ }
65
+ }
66
+ : props.shapeDirection === 'right'
67
+ ? {
68
+ transform: 'translate3d(10%,-50%,0)',
69
+ left: '112%',
70
+ top: '50%',
71
+
72
+ '.isActive': {
73
+ transform: 'translate3d(0%,-50%,0)',
74
+ opacity: 1,
75
+ visibility: 'visible'
76
+ }
77
+ }
78
+ : ({ props }) => props.shapeDirection === 'bottom'
79
+ ? {
80
+ transform: 'translate3d(-50%,-10%,0)',
81
+ bottom: '112%',
82
+ left: '50%',
83
+
84
+ '.isActive': {
85
+ transform: 'translate3d(-50%,0,0)',
86
+ opacity: 1,
87
+ visibility: 'visible'
88
+ }
89
+ }
90
+ : props.shapeDirection === 'left'
91
+ ? {
92
+ transform: 'translate3d(10%,-50%,0)',
93
+ right: '112%',
94
+ top: '50%',
95
+
96
+ '.isActive': {
97
+ transform: 'translate3d(0%,-50%,0)',
98
+ opacity: 1,
99
+ visibility: 'visible'
100
+ }
101
+ }
102
+ : {})
103
+ })
106
104
  }
107
105
 
108
106
  export const TooltipParent = {
@@ -110,14 +108,14 @@ export const TooltipParent = {
110
108
  const { Tooltip, TooltipHidden } = el
111
109
  const TooltipElem = (Tooltip || TooltipHidden)
112
110
  if (!TooltipElem) return
113
- const TooltipActive = TooltipElem && TooltipElem.props && TooltipElem.props['.active']
111
+ const TooltipActive = TooltipElem && TooltipElem.props && TooltipElem.props['.isActive']
114
112
  return {
115
113
  position: 'relative',
116
114
  zIndex: 999,
117
115
  ':hover, &:focus-visible': {
118
116
  zIndex: 1000,
119
117
  '& [tooltip]': TooltipActive || {
120
- transform: 'translate3d(-50%,0,0)',
118
+ transform: 'translate3d(-50%, 0, 0)',
121
119
  opacity: 1,
122
120
  visibility: 'visible'
123
121
  }
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@symbo.ls/tooltip",
3
- "version": "2.11.488",
3
+ "version": "2.11.491",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
- "gitHead": "d84f52f7f995d7c2d04002baa9dc263a67cca0d5",
6
+ "gitHead": "ddd06b2b342480b2e20c02df04f9856d4ddf7060",
7
7
  "dependencies": {
8
- "@symbo.ls/atoms": "^2.11.480"
8
+ "@symbo.ls/atoms": "^2.11.491"
9
9
  },
10
10
  "source": "src/index.js"
11
11
  }