smbls 0.15.18 → 0.15.20
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/atoms/Block.js +2 -1
- package/src/atoms/Flex.js +1 -2
- package/src/atoms/Grid.js +11 -2
- package/src/atoms/Shape/index.js +1 -1
- package/src/atoms/Shape/style.js +109 -40
package/package.json
CHANGED
package/src/atoms/Block.js
CHANGED
|
@@ -99,10 +99,11 @@ export const Block = {
|
|
|
99
99
|
gridArea: ({ props }) => props.gridArea && ({ gridArea: props.gridArea }),
|
|
100
100
|
|
|
101
101
|
flex: ({ props }) => props.flex && ({ flex: props.flex }),
|
|
102
|
+
flexDirection: ({ props }) => props.flexDirection && ({ flexDirection: props.flexDirection }),
|
|
102
103
|
alignItems: ({ props }) => props.alignItems && ({ alignItems: props.alignItems }),
|
|
103
104
|
alignContent: ({ props }) => props.alignContent && ({ alignContent: props.alignContent }),
|
|
104
105
|
justifyContent: ({ props }) => props.justifyContent && ({ justifyContent: props.justifyContent }),
|
|
105
|
-
|
|
106
|
+
justifyItems: ({ props }) => props.justifyItems && ({ justifyItems: props.justifyItems }),
|
|
106
107
|
alignSelf: ({ props }) => props.alignSelf && ({ alignSelf: props.alignSelf }),
|
|
107
108
|
order: ({ props }) => props.order && ({ order: props.order }),
|
|
108
109
|
|
package/src/atoms/Flex.js
CHANGED
package/src/atoms/Grid.js
CHANGED
|
@@ -6,11 +6,20 @@ export const Grid = {
|
|
|
6
6
|
props: { display: 'grid' },
|
|
7
7
|
|
|
8
8
|
class: {
|
|
9
|
-
columns: ({ props }) => props.columns ? ({ gridTemplateColumns: props.columns }) : null,
|
|
10
|
-
rows: ({ props }) => props.rows ? ({ gridTemplateRows: props.rows }) : null,
|
|
11
9
|
area: ({ props }) => props.area ? ({ gridArea: props.area }) : null,
|
|
12
10
|
template: ({ props }) => props.template ? ({ gridTemplate: props.template }) : null,
|
|
13
11
|
templateAreas: ({ props }) => props.templateAreas ? ({ gridTemplateAreas: props.templateAreas }) : null,
|
|
12
|
+
|
|
13
|
+
columns: ({ props }) => props.columns ? ({ gridTemplateColumns: props.columns }) : null,
|
|
14
|
+
templateColumns: ({ props }) => props.templateColumns ? ({ gridTemplateColumns: props.templateColumns }) : null,
|
|
15
|
+
autoColumns: ({ props }) => props.autoColumns ? ({ gridAutoColumns: props.autoColumns }) : null,
|
|
16
|
+
|
|
17
|
+
rows: ({ props }) => props.rows ? ({ gridTemplateRows: props.rows }) : null,
|
|
18
|
+
templateRows: ({ props }) => props.templateRows ? ({ gridTemplateRows: props.templateRows }) : null,
|
|
19
|
+
autoRows: ({ props }) => props.autoRows ? ({ gridAutoRows: props.autoRows }) : null,
|
|
20
|
+
|
|
21
|
+
autoFlow: ({ props }) => props.autoFlow ? ({ gridAutoFlow: props.autoFlow }) : null,
|
|
22
|
+
|
|
14
23
|
columnGap: ({ props }) => props.columnGap ? getSpacingBasedOnRatio(props, 'columnGap') : null,
|
|
15
24
|
rowGap: ({ props }) => props.rowGap ? getSpacingBasedOnRatio(props, 'rowGap') : null
|
|
16
25
|
}
|
package/src/atoms/Shape/index.js
CHANGED
|
@@ -25,7 +25,7 @@ export const Shape = {
|
|
|
25
25
|
const { shape, shapeDirection } = props
|
|
26
26
|
if (!shape || !shapeDirection) return
|
|
27
27
|
const shapeDir = SHAPES[shape + 'Direction']
|
|
28
|
-
return shape ? shapeDir[shapeDirection || '
|
|
28
|
+
return shape && shapeDir ? shapeDir[shapeDirection || 'left'] : null
|
|
29
29
|
},
|
|
30
30
|
shapeDirectionColor: el => {
|
|
31
31
|
const { props } = el
|
package/src/atoms/Shape/style.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
import { UNIT, getColor, getTheme } from '@symbo.ls/scratch' // eslint-disable-line no-unused-vars
|
|
4
|
+
import { Timing } from '../Timing'
|
|
4
5
|
|
|
5
6
|
export const depth = {
|
|
6
7
|
4: { boxShadow: `rgba(0,0,0,.10) 0 2${UNIT.default} 4${UNIT.default}` },
|
|
@@ -11,37 +12,22 @@ export const depth = {
|
|
|
11
12
|
42: { boxShadow: `rgba(0,0,0,.10) 0 20${UNIT.default} 42${UNIT.default}` }
|
|
12
13
|
}
|
|
13
14
|
|
|
14
|
-
const getComputedBackgroundColor =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
// const propsTheme = getTheme(props.theme)
|
|
18
|
-
|
|
19
|
-
if (!propsColor) {
|
|
20
|
-
// const computedStyle = window.getComputedStyle(node)
|
|
21
|
-
// // if (props.shapeDirection) {
|
|
22
|
-
// // console.group(el.parent.parent.parent.key + ' - ' + el.parent.key)
|
|
23
|
-
// // console.log(propsTheme)
|
|
24
|
-
// // console.log(getColor(props.borderColor))
|
|
25
|
-
// // console.log(getColor(props.backgroundColor))
|
|
26
|
-
// // console.log(getColor(props.background))
|
|
27
|
-
// // console.log(computedStyle.getPropertyValue('border-color'))
|
|
28
|
-
// // console.log(computedStyle.getPropertyValue('background'))
|
|
29
|
-
// // console.log(computedStyle.getPropertyValue('background-color'))
|
|
30
|
-
// // console.log(el)
|
|
31
|
-
// // console.groupEnd(el.parent.parent.parent.key + ' - ' + el.parent.key)
|
|
32
|
-
// // }
|
|
33
|
-
// return computedStyle.getPropertyValue('border-color') ||
|
|
34
|
-
// computedStyle.getPropertyValue('background') ||
|
|
35
|
-
// computedStyle.getPropertyValue('background-color')
|
|
36
|
-
}
|
|
15
|
+
const getComputedBackgroundColor = ({ props }) => {
|
|
16
|
+
return getColor(props.borderColor) || getColor(props.backgroundColor) || getColor(props.background)
|
|
17
|
+
}
|
|
37
18
|
|
|
38
|
-
|
|
19
|
+
const inheritTransition = (el) => {
|
|
20
|
+
const exec = Timing.class.transition(el)
|
|
21
|
+
return exec && exec['transition']
|
|
39
22
|
}
|
|
40
23
|
|
|
41
24
|
export const SHAPES = {
|
|
42
25
|
rectangle: {},
|
|
43
26
|
circle: { borderRadius: '100%' },
|
|
44
27
|
bubble: {},
|
|
28
|
+
tv: {
|
|
29
|
+
borderRadius: '1.15em/2.5em'
|
|
30
|
+
},
|
|
45
31
|
|
|
46
32
|
tooltip: el => ({
|
|
47
33
|
position: el.props.position || 'relative',
|
|
@@ -52,6 +38,8 @@ export const SHAPES = {
|
|
|
52
38
|
height: '0px',
|
|
53
39
|
border: `.35em solid`,
|
|
54
40
|
borderColor: getComputedBackgroundColor(el),
|
|
41
|
+
transition: inheritTransition(el),
|
|
42
|
+
transitionProperty: 'border-color',
|
|
55
43
|
position: 'absolute',
|
|
56
44
|
borderRadius: '.15em'
|
|
57
45
|
}
|
|
@@ -60,7 +48,7 @@ export const SHAPES = {
|
|
|
60
48
|
tooltipDirection: {
|
|
61
49
|
top: {
|
|
62
50
|
'&:before': {
|
|
63
|
-
top: '
|
|
51
|
+
top: '0',
|
|
64
52
|
left: '50%',
|
|
65
53
|
transform: 'translate(-50%, -50%) rotate(45deg)'
|
|
66
54
|
}
|
|
@@ -68,21 +56,21 @@ export const SHAPES = {
|
|
|
68
56
|
right: {
|
|
69
57
|
'&:before': {
|
|
70
58
|
top: '50%',
|
|
71
|
-
right: '
|
|
72
|
-
transform: 'translate(
|
|
59
|
+
right: '0',
|
|
60
|
+
transform: 'translate(50%, -50%) rotate(45deg)'
|
|
73
61
|
}
|
|
74
62
|
},
|
|
75
63
|
bottom: {
|
|
76
64
|
'&:before': {
|
|
77
|
-
bottom: '
|
|
65
|
+
bottom: '0',
|
|
78
66
|
left: '50%',
|
|
79
|
-
transform: 'translate(-50%,
|
|
67
|
+
transform: 'translate(-50%, 50%) rotate(45deg)'
|
|
80
68
|
}
|
|
81
69
|
},
|
|
82
70
|
left: {
|
|
83
71
|
'&:before': {
|
|
84
72
|
top: '50%',
|
|
85
|
-
left: '
|
|
73
|
+
left: '0',
|
|
86
74
|
transform: 'translate(-50%, -50%) rotate(45deg)'
|
|
87
75
|
}
|
|
88
76
|
}
|
|
@@ -93,12 +81,16 @@ export const SHAPES = {
|
|
|
93
81
|
'&:before': {
|
|
94
82
|
content: '""',
|
|
95
83
|
display: 'block',
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
84
|
+
background: getComputedBackgroundColor(el),
|
|
85
|
+
transition: inheritTransition(el),
|
|
86
|
+
transitionProperty: 'background',
|
|
87
|
+
borderRadius: '.25em',
|
|
88
|
+
position: 'absolute',
|
|
89
|
+
zIndex: '-1',
|
|
90
|
+
aspectRatio: '1/1',
|
|
91
|
+
top: '50%',
|
|
92
|
+
transformOrigin: '50% 50%',
|
|
93
|
+
height: '73%'
|
|
102
94
|
}
|
|
103
95
|
}),
|
|
104
96
|
|
|
@@ -107,28 +99,105 @@ export const SHAPES = {
|
|
|
107
99
|
'&:before': {
|
|
108
100
|
bottom: '100%',
|
|
109
101
|
left: '50%',
|
|
110
|
-
transform: 'translate(-50%,
|
|
102
|
+
transform: 'translate(-50%, 50%) rotate(45deg)'
|
|
111
103
|
}
|
|
112
104
|
},
|
|
113
105
|
right: {
|
|
114
106
|
'&:before': {
|
|
115
107
|
top: '50%',
|
|
116
108
|
left: '100%',
|
|
117
|
-
transform: 'translate(-
|
|
109
|
+
transform: 'translate(-50%, -50%) rotate(45deg)'
|
|
118
110
|
}
|
|
119
111
|
},
|
|
120
112
|
bottom: {
|
|
121
113
|
'&:before': {
|
|
122
114
|
top: '100%',
|
|
123
115
|
left: '50%',
|
|
124
|
-
transform: 'translate(-50%, -
|
|
116
|
+
transform: 'translate(-50%, -50%) rotate(45deg)'
|
|
125
117
|
}
|
|
126
118
|
},
|
|
127
119
|
left: {
|
|
128
120
|
'&:before': {
|
|
129
121
|
top: '50%',
|
|
130
122
|
right: '100%',
|
|
131
|
-
transform: 'translate(
|
|
123
|
+
transform: 'translate(50%, -50%) rotate(45deg)'
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
|
|
128
|
+
hexagon: el => ({
|
|
129
|
+
position: 'relative',
|
|
130
|
+
'&:before, &:after': {
|
|
131
|
+
content: '""',
|
|
132
|
+
display: 'block',
|
|
133
|
+
position: 'absolute',
|
|
134
|
+
zIndex: '-1',
|
|
135
|
+
borderRadius: '.25em',
|
|
136
|
+
aspectRatio: '1/1',
|
|
137
|
+
top: '50%',
|
|
138
|
+
transformOrigin: '50% 50%',
|
|
139
|
+
height: '73%',
|
|
140
|
+
background: getComputedBackgroundColor(el),
|
|
141
|
+
transition: inheritTransition(el),
|
|
142
|
+
transitionProperty: 'background'
|
|
143
|
+
},
|
|
144
|
+
'&:before': {
|
|
145
|
+
left: '0',
|
|
146
|
+
transform: 'translate3d(-50%, -50%, 1px) rotate(45deg)'
|
|
147
|
+
},
|
|
148
|
+
'&:after': {
|
|
149
|
+
left: '100%',
|
|
150
|
+
transform: 'translate3d(-50%, -50%, 1px) rotate(45deg)'
|
|
151
|
+
}
|
|
152
|
+
}),
|
|
153
|
+
|
|
154
|
+
chevron: el => ({
|
|
155
|
+
position: 'relative',
|
|
156
|
+
// overflow: 'hidden',
|
|
157
|
+
'&:before, &:after': {
|
|
158
|
+
content: '""',
|
|
159
|
+
display: 'block',
|
|
160
|
+
position: 'absolute',
|
|
161
|
+
zIndex: '-1',
|
|
162
|
+
aspectRatio: '1/1',
|
|
163
|
+
top: '50%',
|
|
164
|
+
transformOrigin: '50% 50%',
|
|
165
|
+
transition: inheritTransition(el),
|
|
166
|
+
transitionProperty: 'background'
|
|
167
|
+
|
|
168
|
+
},
|
|
169
|
+
'&:before': {
|
|
170
|
+
background: `linear-gradient(225deg, ${getComputedBackgroundColor(el)} 25%, transparent 25%), linear-gradient(315deg, ${getComputedBackgroundColor(el)} 25%, transparent 25%)`
|
|
171
|
+
},
|
|
172
|
+
'&:after': {
|
|
173
|
+
background: getComputedBackgroundColor(el),
|
|
174
|
+
borderRadius: '.25em'
|
|
175
|
+
}
|
|
176
|
+
}),
|
|
177
|
+
|
|
178
|
+
chevronDirection: {
|
|
179
|
+
left: {
|
|
180
|
+
'&:before': {
|
|
181
|
+
height: '100%',
|
|
182
|
+
left: '100%',
|
|
183
|
+
transform: 'translate3d(-1%, -50%, 1px) scale(-1, 1)'
|
|
184
|
+
},
|
|
185
|
+
'&:after': {
|
|
186
|
+
height: '73%',
|
|
187
|
+
left: '0',
|
|
188
|
+
transform: 'translate3d(-50%, -50%, 1px) rotate(45deg)'
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
right: {
|
|
192
|
+
'&:before': {
|
|
193
|
+
height: '100%',
|
|
194
|
+
left: '0',
|
|
195
|
+
transform: 'translate3d(-99%, -50%, 1px)'
|
|
196
|
+
},
|
|
197
|
+
'&:after': {
|
|
198
|
+
height: '73%',
|
|
199
|
+
left: '100%',
|
|
200
|
+
transform: 'translate3d(-50%, -50%, 1px) rotate(45deg)'
|
|
132
201
|
}
|
|
133
202
|
}
|
|
134
203
|
}
|