smbls 0.14.0 → 0.14.1
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 +1 -1
- package/src/Shape/index.js +10 -2
- package/src/Shape/style.js +3 -3
package/package.json
CHANGED
package/src/Shape/index.js
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import { exec, isString } from '@domql/utils'
|
|
4
4
|
import { SHAPES } from './style'
|
|
5
|
-
import { getSpacingBasedOnRatio } from '@symbo.ls/scratch'
|
|
5
|
+
import { getSpacingBasedOnRatio, getMediaColor } from '@symbo.ls/scratch'
|
|
6
|
+
import { Pseudo } from '../Pseudo'
|
|
6
7
|
|
|
7
8
|
const transformBorderRadius = (radius, props, propertyName) => {
|
|
8
9
|
if (!isString(radius)) return
|
|
@@ -12,6 +13,8 @@ const transformBorderRadius = (radius, props, propertyName) => {
|
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
export const Shape = {
|
|
16
|
+
extend: Pseudo,
|
|
17
|
+
|
|
15
18
|
class: {
|
|
16
19
|
shape: (element) => {
|
|
17
20
|
const { props } = element
|
|
@@ -24,7 +27,12 @@ export const Shape = {
|
|
|
24
27
|
const shapeDir = SHAPES[shape + 'Direction']
|
|
25
28
|
return shape ? shapeDir[shapeDirection || 'top'] : null
|
|
26
29
|
},
|
|
27
|
-
shapeDirectionColor:
|
|
30
|
+
shapeDirectionColor: el => {
|
|
31
|
+
const { props } = el
|
|
32
|
+
const { background, backgroundColor } = props
|
|
33
|
+
const borderColor = getMediaColor(background || backgroundColor, 'borderColor')
|
|
34
|
+
return props.shapeDirection ? borderColor : null
|
|
35
|
+
},
|
|
28
36
|
|
|
29
37
|
round: ({ props, key, ...el }) => transformBorderRadius(props.round || props.borderRadius, props, 'round'),
|
|
30
38
|
borderRadius: ({ props, key, ...el }) => transformBorderRadius(props.borderRadius || props.round, props, 'borderRadius')
|
package/src/Shape/style.js
CHANGED
|
@@ -18,14 +18,14 @@ export const SHAPES = {
|
|
|
18
18
|
|
|
19
19
|
tooltip: ({ props }) => ({
|
|
20
20
|
position: props.position || 'relative',
|
|
21
|
-
'
|
|
21
|
+
':before': {
|
|
22
22
|
content: '""',
|
|
23
23
|
display: 'block',
|
|
24
24
|
width: '0px',
|
|
25
25
|
height: '0px',
|
|
26
|
-
border: `6px solid
|
|
26
|
+
border: `6px, solid`,
|
|
27
27
|
position: 'absolute',
|
|
28
|
-
borderRadius: '
|
|
28
|
+
borderRadius: 'X2'
|
|
29
29
|
}
|
|
30
30
|
}),
|
|
31
31
|
|