@symbo.ls/atoms 2.10.175 → 2.10.188
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/Shape/index.js +4 -6
- package/Shape/style.js +14 -14
- package/package.json +2 -2
package/Shape/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import { exec, isString } from '@domql/utils'
|
|
3
|
+
import { exec, isString, isFunction } from '@domql/utils'
|
|
4
4
|
import { SHAPES } from './style'
|
|
5
5
|
import { getSpacingBasedOnRatio, getMediaColor } from '@symbo.ls/scratch'
|
|
6
6
|
import { Pseudo } from '../Pseudo'
|
|
@@ -16,10 +16,9 @@ export const Shape = {
|
|
|
16
16
|
extend: Pseudo,
|
|
17
17
|
|
|
18
18
|
class: {
|
|
19
|
-
shape: (
|
|
20
|
-
const { props } = element
|
|
19
|
+
shape: ({ props }) => {
|
|
21
20
|
const { shape } = props
|
|
22
|
-
return
|
|
21
|
+
return SHAPES[shape]({ props })
|
|
23
22
|
},
|
|
24
23
|
shapeDirection: ({ props }) => {
|
|
25
24
|
const { shape, shapeDirection } = props
|
|
@@ -27,8 +26,7 @@ export const Shape = {
|
|
|
27
26
|
const shapeDir = SHAPES[shape + 'Direction']
|
|
28
27
|
return shape && shapeDir ? shapeDir[shapeDirection || 'left'] : null
|
|
29
28
|
},
|
|
30
|
-
shapeDirectionColor:
|
|
31
|
-
const { props } = el
|
|
29
|
+
shapeDirectionColor: ({ props }) => {
|
|
32
30
|
const { background, backgroundColor } = props
|
|
33
31
|
const borderColor = getMediaColor(background || backgroundColor, 'borderColor')
|
|
34
32
|
return props.shapeDirection ? borderColor : null
|
package/Shape/style.js
CHANGED
|
@@ -16,8 +16,8 @@ const getComputedBackgroundColor = ({ props }) => {
|
|
|
16
16
|
return getColor(props.borderColor) || getColor(props.backgroundColor) || getColor(props.background)
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
const inheritTransition = (
|
|
20
|
-
const exec = Timing.class.transition(
|
|
19
|
+
const inheritTransition = ({ props }) => {
|
|
20
|
+
const exec = Timing.class.transition({ props })
|
|
21
21
|
return exec && exec['transition']
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -29,16 +29,16 @@ export const SHAPES = {
|
|
|
29
29
|
borderRadius: '1.15em/2.5em'
|
|
30
30
|
},
|
|
31
31
|
|
|
32
|
-
tooltip:
|
|
33
|
-
position:
|
|
32
|
+
tooltip: ({ props }) => ({
|
|
33
|
+
position: props.position || 'relative',
|
|
34
34
|
'&:before': {
|
|
35
35
|
content: '""',
|
|
36
36
|
display: 'block',
|
|
37
37
|
width: '0px',
|
|
38
38
|
height: '0px',
|
|
39
39
|
border: `.35em solid`,
|
|
40
|
-
borderColor: getComputedBackgroundColor(
|
|
41
|
-
transition: inheritTransition(
|
|
40
|
+
borderColor: getComputedBackgroundColor({ props }),
|
|
41
|
+
transition: inheritTransition({ props }),
|
|
42
42
|
transitionProperty: 'border-color',
|
|
43
43
|
position: 'absolute',
|
|
44
44
|
borderRadius: '.15em'
|
|
@@ -76,13 +76,13 @@ export const SHAPES = {
|
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
78
|
|
|
79
|
-
tag:
|
|
79
|
+
tag: ({ props }) => ({
|
|
80
80
|
position: 'relative',
|
|
81
81
|
'&:before': {
|
|
82
82
|
content: '""',
|
|
83
83
|
display: 'block',
|
|
84
|
-
background: getComputedBackgroundColor(
|
|
85
|
-
transition: inheritTransition(
|
|
84
|
+
background: getComputedBackgroundColor({ props }),
|
|
85
|
+
transition: inheritTransition({ props }),
|
|
86
86
|
transitionProperty: 'background',
|
|
87
87
|
borderRadius: '.25em',
|
|
88
88
|
position: 'absolute',
|
|
@@ -137,8 +137,8 @@ export const SHAPES = {
|
|
|
137
137
|
top: '50%',
|
|
138
138
|
transformOrigin: '50% 50%',
|
|
139
139
|
height: '73%',
|
|
140
|
-
background: getComputedBackgroundColor(
|
|
141
|
-
transition: inheritTransition(
|
|
140
|
+
background: getComputedBackgroundColor({ props }),
|
|
141
|
+
transition: inheritTransition({ props }),
|
|
142
142
|
transitionProperty: 'background'
|
|
143
143
|
},
|
|
144
144
|
'&:before': {
|
|
@@ -162,15 +162,15 @@ export const SHAPES = {
|
|
|
162
162
|
aspectRatio: '1/1',
|
|
163
163
|
top: '50%',
|
|
164
164
|
transformOrigin: '50% 50%',
|
|
165
|
-
transition: inheritTransition(
|
|
165
|
+
transition: inheritTransition({ props }),
|
|
166
166
|
transitionProperty: 'background'
|
|
167
167
|
|
|
168
168
|
},
|
|
169
169
|
'&:before': {
|
|
170
|
-
background: `linear-gradient(225deg, ${getComputedBackgroundColor(
|
|
170
|
+
background: `linear-gradient(225deg, ${getComputedBackgroundColor({ props })} 25%, transparent 25%), linear-gradient(315deg, ${getComputedBackgroundColor({ props })} 25%, transparent 25%)`
|
|
171
171
|
},
|
|
172
172
|
'&:after': {
|
|
173
|
-
background: getComputedBackgroundColor(
|
|
173
|
+
background: getComputedBackgroundColor({ props }),
|
|
174
174
|
borderRadius: '.25em'
|
|
175
175
|
}
|
|
176
176
|
}),
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbo.ls/atoms",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.188",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"gitHead": "
|
|
6
|
+
"gitHead": "101a03940d79cdd43dfcfb78c2086f4d13a0142d",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@domql/utils": "latest",
|
|
9
9
|
"@symbo.ls/create-emotion": "latest",
|