@symbo.ls/atoms 2.11.160 → 2.11.162
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/Animation.js +14 -12
- package/Block.js +49 -46
- package/Grid.js +4 -2
- package/Picture.js +3 -2
- package/Position.js +8 -6
- package/Shape/index.js +8 -6
- package/Text.js +2 -0
- package/Theme.js +1 -0
- package/Timing.js +14 -8
- package/package.json +2 -2
package/Animation.js
CHANGED
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
import { getTimingByKey, getTimingFunction } from '@symbo.ls/scratch'
|
|
4
4
|
import { isObject } from '@domql/utils'
|
|
5
5
|
import { emotion } from '@symbo.ls/emotion'
|
|
6
|
-
const { keyframes } = emotion
|
|
7
6
|
|
|
8
7
|
const applyAnimationProps = (animation, element) => {
|
|
8
|
+
const { emotion: ctxEmotion } = element.context
|
|
9
|
+
const { keyframes } = ctxEmotion || emotion
|
|
9
10
|
if (isObject(animation)) return { animationName: keyframes(animation) }
|
|
10
11
|
const { ANIMATION } = element.context && element.context.designSystem
|
|
11
12
|
const record = ANIMATION[animation]
|
|
@@ -13,28 +14,29 @@ const applyAnimationProps = (animation, element) => {
|
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
export const Animation = {
|
|
17
|
+
deps: { isObject, getTimingByKey, getTimingFunction, applyAnimationProps },
|
|
16
18
|
class: {
|
|
17
19
|
animation: (el) => el.props.animation && {
|
|
18
|
-
animationName: applyAnimationProps(el.props.animation, el),
|
|
19
|
-
animationDuration: getTimingByKey(el.props.animationDuration || 'A').timing,
|
|
20
|
-
animationDelay: getTimingByKey(el.props.animationDelay || '0s').timing,
|
|
21
|
-
animationTimingFunction: getTimingFunction(el.props.animationTimingFunction || 'ease'),
|
|
20
|
+
animationName: el.deps.applyAnimationProps(el.props.animation, el),
|
|
21
|
+
animationDuration: el.deps.getTimingByKey(el.props.animationDuration || 'A').timing,
|
|
22
|
+
animationDelay: el.deps.getTimingByKey(el.props.animationDelay || '0s').timing,
|
|
23
|
+
animationTimingFunction: el.deps.getTimingFunction(el.props.animationTimingFunction || 'ease'),
|
|
22
24
|
animationFillMode: el.props.animationFillMode || 'both',
|
|
23
25
|
animationPlayState: el.props.animationPlayState,
|
|
24
26
|
animationDirection: el.props.animationDirection
|
|
25
27
|
},
|
|
26
28
|
animationName: (el) => el.props.animationName && {
|
|
27
|
-
animationName: applyAnimationProps(el.props.animationName, el)
|
|
29
|
+
animationName: el.deps.applyAnimationProps(el.props.animationName, el)
|
|
28
30
|
},
|
|
29
31
|
|
|
30
|
-
animationDuration: ({ props }) => props.animationDuration && ({
|
|
31
|
-
animationDuration: getTimingByKey(props.animationDuration).timing
|
|
32
|
+
animationDuration: ({ props, deps }) => props.animationDuration && ({
|
|
33
|
+
animationDuration: deps.getTimingByKey(props.animationDuration).timing
|
|
32
34
|
}),
|
|
33
|
-
animationDelay: ({ props }) => props.animationDelay && ({
|
|
34
|
-
animationDelay: getTimingByKey(props.animationDelay).timing
|
|
35
|
+
animationDelay: ({ props, deps }) => props.animationDelay && ({
|
|
36
|
+
animationDelay: deps.getTimingByKey(props.animationDelay).timing
|
|
35
37
|
}),
|
|
36
|
-
animationTimingFunction: ({ props }) => props.animationTimingFunction && ({
|
|
37
|
-
animationTimingFunction: getTimingFunction(props.animationTimingFunction)
|
|
38
|
+
animationTimingFunction: ({ props, deps }) => props.animationTimingFunction && ({
|
|
39
|
+
animationTimingFunction: deps.getTimingFunction(props.animationTimingFunction)
|
|
38
40
|
}),
|
|
39
41
|
animationFillMode: ({ props }) => props.animationFillMode && ({
|
|
40
42
|
animationFillMode: props.animationFillMode
|
package/Block.js
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
import { getSpacingBasedOnRatio, getSpacingByKey, transfromGap } from '@symbo.ls/scratch'
|
|
4
4
|
|
|
5
5
|
export const Block = {
|
|
6
|
+
deps: { getSpacingBasedOnRatio, getSpacingByKey, transfromGap },
|
|
7
|
+
|
|
6
8
|
class: {
|
|
7
9
|
boxSizing: ({ props }) => props.boxSizing
|
|
8
10
|
? ({ boxSizing: props.boxSizing })
|
|
@@ -14,36 +16,36 @@ export const Block = {
|
|
|
14
16
|
|
|
15
17
|
hide: ({ props }) => props.hide && ({ display: 'none !important' }),
|
|
16
18
|
|
|
17
|
-
width: ({ props }) => props.width && getSpacingBasedOnRatio(props, 'width'),
|
|
18
|
-
height: ({ props }) => props.height && getSpacingBasedOnRatio(props, 'height'),
|
|
19
|
-
boxSize: ({ props }) => {
|
|
19
|
+
width: ({ props, deps }) => props.width && deps.getSpacingBasedOnRatio(props, 'width'),
|
|
20
|
+
height: ({ props, deps }) => props.height && deps.getSpacingBasedOnRatio(props, 'height'),
|
|
21
|
+
boxSize: ({ props, deps }) => {
|
|
20
22
|
if (typeof props.boxSize !== 'string') return
|
|
21
23
|
const [height, width] = props.boxSize.split(' ')
|
|
22
24
|
return {
|
|
23
|
-
...getSpacingByKey(height, 'height'),
|
|
24
|
-
...getSpacingByKey(width || height, 'width')
|
|
25
|
+
...deps.getSpacingByKey(height, 'height'),
|
|
26
|
+
...deps.getSpacingByKey(width || height, 'width')
|
|
25
27
|
}
|
|
26
28
|
},
|
|
27
29
|
|
|
28
|
-
maxWidth: ({ props }) => props.maxWidth && getSpacingBasedOnRatio(props, 'maxWidth'),
|
|
29
|
-
minWidth: ({ props }) => props.minWidth && getSpacingBasedOnRatio(props, 'minWidth'),
|
|
30
|
-
widthRange: ({ props }) => {
|
|
30
|
+
maxWidth: ({ props, deps }) => props.maxWidth && deps.getSpacingBasedOnRatio(props, 'maxWidth'),
|
|
31
|
+
minWidth: ({ props, deps }) => props.minWidth && deps.getSpacingBasedOnRatio(props, 'minWidth'),
|
|
32
|
+
widthRange: ({ props, deps }) => {
|
|
31
33
|
if (typeof props.widthRange !== 'string') return
|
|
32
34
|
const [minWidth, maxWidth] = props.widthRange.split(' ')
|
|
33
35
|
return {
|
|
34
|
-
...getSpacingByKey(minWidth, 'minWidth'),
|
|
35
|
-
...getSpacingByKey(maxWidth || minWidth, 'maxWidth')
|
|
36
|
+
...deps.getSpacingByKey(minWidth, 'minWidth'),
|
|
37
|
+
...deps.getSpacingByKey(maxWidth || minWidth, 'maxWidth')
|
|
36
38
|
}
|
|
37
39
|
},
|
|
38
40
|
|
|
39
|
-
maxHeight: ({ props }) => props.maxHeight && getSpacingBasedOnRatio(props, 'maxHeight'),
|
|
40
|
-
minHeight: ({ props }) => props.minHeight && getSpacingBasedOnRatio(props, 'minHeight'),
|
|
41
|
-
heightRange: ({ props }) => {
|
|
41
|
+
maxHeight: ({ props, deps }) => props.maxHeight && deps.getSpacingBasedOnRatio(props, 'maxHeight'),
|
|
42
|
+
minHeight: ({ props, deps }) => props.minHeight && deps.getSpacingBasedOnRatio(props, 'minHeight'),
|
|
43
|
+
heightRange: ({ props, deps }) => {
|
|
42
44
|
if (typeof props.heightRange !== 'string') return
|
|
43
45
|
const [minHeight, maxHeight] = props.heightRange.split(' ')
|
|
44
46
|
return {
|
|
45
|
-
...getSpacingByKey(minHeight, 'minHeight'),
|
|
46
|
-
...getSpacingByKey(maxHeight || minHeight, 'maxHeight')
|
|
47
|
+
...deps.getSpacingByKey(minHeight, 'minHeight'),
|
|
48
|
+
...deps.getSpacingByKey(maxHeight || minHeight, 'maxHeight')
|
|
47
49
|
}
|
|
48
50
|
},
|
|
49
51
|
|
|
@@ -51,58 +53,58 @@ export const Block = {
|
|
|
51
53
|
|
|
52
54
|
aspectRatio: ({ props }) => props.aspectRatio && ({ aspectRatio: props.aspectRatio }),
|
|
53
55
|
|
|
54
|
-
borderWidth: ({ props }) => props.borderWidth ? getSpacingBasedOnRatio(props, 'borderWidth') : null,
|
|
56
|
+
borderWidth: ({ props, deps }) => props.borderWidth ? deps.getSpacingBasedOnRatio(props, 'borderWidth') : null,
|
|
55
57
|
|
|
56
|
-
padding: ({ props }) => props.padding ? getSpacingBasedOnRatio(props, 'padding') : null,
|
|
57
|
-
paddingInline: ({ props }) => {
|
|
58
|
+
padding: ({ props, deps }) => props.padding ? deps.getSpacingBasedOnRatio(props, 'padding') : null,
|
|
59
|
+
paddingInline: ({ props, deps }) => {
|
|
58
60
|
if (typeof props.paddingInline !== 'string') return
|
|
59
61
|
const [paddingInlineStart, paddingInlineEnd] = props.paddingInline.split(' ')
|
|
60
62
|
return {
|
|
61
|
-
...getSpacingByKey(paddingInlineStart, 'paddingInlineStart'),
|
|
62
|
-
...getSpacingByKey(paddingInlineEnd || paddingInlineStart, 'paddingInlineEnd')
|
|
63
|
+
...deps.getSpacingByKey(paddingInlineStart, 'paddingInlineStart'),
|
|
64
|
+
...deps.getSpacingByKey(paddingInlineEnd || paddingInlineStart, 'paddingInlineEnd')
|
|
63
65
|
}
|
|
64
66
|
},
|
|
65
|
-
paddingBlock: ({ props }) => {
|
|
67
|
+
paddingBlock: ({ props, deps }) => {
|
|
66
68
|
if (typeof props.paddingBlock !== 'string') return
|
|
67
69
|
const [paddingBlockStart, paddingBlockEnd] = props.paddingBlock.split(' ')
|
|
68
70
|
return {
|
|
69
|
-
...getSpacingByKey(paddingBlockStart, 'paddingBlockStart'),
|
|
70
|
-
...getSpacingByKey(paddingBlockEnd || paddingBlockStart, 'paddingBlockEnd')
|
|
71
|
+
...deps.getSpacingByKey(paddingBlockStart, 'paddingBlockStart'),
|
|
72
|
+
...deps.getSpacingByKey(paddingBlockEnd || paddingBlockStart, 'paddingBlockEnd')
|
|
71
73
|
}
|
|
72
74
|
},
|
|
73
|
-
paddingInlineStart: ({ props }) => props.paddingInlineStart ? getSpacingBasedOnRatio(props, 'paddingInlineStart') : null,
|
|
74
|
-
paddingInlineEnd: ({ props }) => props.paddingInlineEnd ? getSpacingBasedOnRatio(props, 'paddingInlineEnd') : null,
|
|
75
|
-
paddingBlockStart: ({ props }) => props.paddingBlockStart ? getSpacingBasedOnRatio(props, 'paddingBlockStart') : null,
|
|
76
|
-
paddingBlockEnd: ({ props }) => props.paddingBlockEnd ? getSpacingBasedOnRatio(props, 'paddingBlockEnd') : null,
|
|
75
|
+
paddingInlineStart: ({ props, deps }) => props.paddingInlineStart ? deps.getSpacingBasedOnRatio(props, 'paddingInlineStart') : null,
|
|
76
|
+
paddingInlineEnd: ({ props, deps }) => props.paddingInlineEnd ? deps.getSpacingBasedOnRatio(props, 'paddingInlineEnd') : null,
|
|
77
|
+
paddingBlockStart: ({ props, deps }) => props.paddingBlockStart ? deps.getSpacingBasedOnRatio(props, 'paddingBlockStart') : null,
|
|
78
|
+
paddingBlockEnd: ({ props, deps }) => props.paddingBlockEnd ? deps.getSpacingBasedOnRatio(props, 'paddingBlockEnd') : null,
|
|
77
79
|
|
|
78
|
-
margin: ({ props }) => props.margin ? getSpacingBasedOnRatio(props, 'margin') : null,
|
|
79
|
-
marginInline: ({ props }) => {
|
|
80
|
+
margin: ({ props, deps }) => props.margin ? deps.getSpacingBasedOnRatio(props, 'margin') : null,
|
|
81
|
+
marginInline: ({ props, deps }) => {
|
|
80
82
|
if (typeof props.marginInline !== 'string') return
|
|
81
83
|
const [marginInlineStart, marginInlineEnd] = props.marginInline.split(' ')
|
|
82
84
|
return {
|
|
83
|
-
...getSpacingByKey(marginInlineStart, 'marginInlineStart'),
|
|
84
|
-
...getSpacingByKey(marginInlineEnd || marginInlineStart, 'marginInlineEnd')
|
|
85
|
+
...deps.getSpacingByKey(marginInlineStart, 'marginInlineStart'),
|
|
86
|
+
...deps.getSpacingByKey(marginInlineEnd || marginInlineStart, 'marginInlineEnd')
|
|
85
87
|
}
|
|
86
88
|
},
|
|
87
|
-
marginBlock: ({ props }) => {
|
|
89
|
+
marginBlock: ({ props, deps }) => {
|
|
88
90
|
if (typeof props.marginBlock !== 'string') return
|
|
89
91
|
const [marginBlockStart, marginBlockEnd] = props.marginBlock.split(' ')
|
|
90
92
|
return {
|
|
91
|
-
...getSpacingByKey(marginBlockStart, 'marginBlockStart'),
|
|
92
|
-
...getSpacingByKey(marginBlockEnd || marginBlockStart, 'marginBlockEnd')
|
|
93
|
+
...deps.getSpacingByKey(marginBlockStart, 'marginBlockStart'),
|
|
94
|
+
...deps.getSpacingByKey(marginBlockEnd || marginBlockStart, 'marginBlockEnd')
|
|
93
95
|
}
|
|
94
96
|
},
|
|
95
|
-
marginInlineStart: ({ props }) => props.marginInlineStart ? getSpacingBasedOnRatio(props, 'marginInlineStart') : null,
|
|
96
|
-
marginInlineEnd: ({ props }) => props.marginInlineEnd ? getSpacingBasedOnRatio(props, 'marginInlineEnd') : null,
|
|
97
|
-
marginBlockStart: ({ props }) => props.marginBlockStart ? getSpacingBasedOnRatio(props, 'marginBlockStart') : null,
|
|
98
|
-
marginBlockEnd: ({ props }) => props.marginBlockEnd ? getSpacingBasedOnRatio(props, 'marginBlockEnd') : null,
|
|
97
|
+
marginInlineStart: ({ props, deps }) => props.marginInlineStart ? deps.getSpacingBasedOnRatio(props, 'marginInlineStart') : null,
|
|
98
|
+
marginInlineEnd: ({ props, deps }) => props.marginInlineEnd ? deps.getSpacingBasedOnRatio(props, 'marginInlineEnd') : null,
|
|
99
|
+
marginBlockStart: ({ props, deps }) => props.marginBlockStart ? deps.getSpacingBasedOnRatio(props, 'marginBlockStart') : null,
|
|
100
|
+
marginBlockEnd: ({ props, deps }) => props.marginBlockEnd ? deps.getSpacingBasedOnRatio(props, 'marginBlockEnd') : null,
|
|
99
101
|
|
|
100
102
|
gap: ({ props }) => props.gap
|
|
101
103
|
? ({
|
|
102
104
|
gap: transfromGap(props.gap)
|
|
103
105
|
})
|
|
104
106
|
: null,
|
|
105
|
-
gridArea: ({ props }) => props.gridArea && ({ gridArea: props.gridArea }),
|
|
107
|
+
gridArea: ({ props, deps }) => props.gridArea && ({ gridArea: props.gridArea }),
|
|
106
108
|
|
|
107
109
|
flex: ({ props }) => props.flex && ({ flex: props.flex }),
|
|
108
110
|
flexDirection: ({ props }) => props.flexDirection && ({ flexDirection: props.flexDirection }),
|
|
@@ -140,17 +142,17 @@ export const Block = {
|
|
|
140
142
|
gridRow: ({ props }) => props.gridRow && ({ gridRow: props.gridRow }),
|
|
141
143
|
gridRowStart: ({ props }) => props.gridRowStart ? ({ gridRowStart: props.gridRowStart }) : null,
|
|
142
144
|
|
|
143
|
-
size: ({ props }) => {
|
|
145
|
+
size: ({ props, deps }) => {
|
|
144
146
|
if (typeof props.heightRange !== 'string') return
|
|
145
147
|
const [minHeight, maxHeight] = props.heightRange.split(' ')
|
|
146
148
|
return {
|
|
147
|
-
...getSpacingByKey(minHeight, 'minHeight'),
|
|
148
|
-
...getSpacingByKey(maxHeight || minHeight, 'maxHeight')
|
|
149
|
+
...deps.getSpacingByKey(minHeight, 'minHeight'),
|
|
150
|
+
...deps.getSpacingByKey(maxHeight || minHeight, 'maxHeight')
|
|
149
151
|
}
|
|
150
152
|
},
|
|
151
153
|
|
|
152
154
|
columns: ({ props }) => props.columns && ({ columns: props.columns }),
|
|
153
|
-
columnGap: ({ props }) => props.columnGap ? getSpacingBasedOnRatio(props, 'columnGap') : null,
|
|
155
|
+
columnGap: ({ props, deps }) => props.columnGap ? deps.getSpacingBasedOnRatio(props, 'columnGap') : null,
|
|
154
156
|
columnSpan: ({ props }) => props.columnSpan && ({ columns: props.columnSpan }),
|
|
155
157
|
columnFill: ({ props }) => props.columnFill && ({ columns: props.columnFill }),
|
|
156
158
|
columnCount: ({ props }) => props.columnCount && ({ columns: props.columnCount })
|
|
@@ -170,16 +172,17 @@ export const Ul = {
|
|
|
170
172
|
// export const Article = { tag: 'article' }
|
|
171
173
|
|
|
172
174
|
export const Gutter = {
|
|
175
|
+
deps: { getSpacingByKey },
|
|
173
176
|
props: {
|
|
174
177
|
size: 'C1'
|
|
175
178
|
},
|
|
176
179
|
class: {
|
|
177
|
-
size: ({ props }) => {
|
|
180
|
+
size: ({ props, deps }) => {
|
|
178
181
|
if (typeof props.size !== 'string') return
|
|
179
182
|
const [height, width] = props.size.split(' ')
|
|
180
183
|
return {
|
|
181
|
-
...getSpacingByKey(height, 'height'),
|
|
182
|
-
...getSpacingByKey(width || height, 'width')
|
|
184
|
+
...deps.getSpacingByKey(height, 'height'),
|
|
185
|
+
...deps.getSpacingByKey(width || height, 'width')
|
|
183
186
|
}
|
|
184
187
|
}
|
|
185
188
|
}
|
package/Grid.js
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
import { getSpacingBasedOnRatio } from '@symbo.ls/scratch'
|
|
4
4
|
|
|
5
5
|
export const Grid = {
|
|
6
|
+
deps: { getSpacingBasedOnRatio },
|
|
7
|
+
|
|
6
8
|
props: { display: 'grid' },
|
|
7
9
|
|
|
8
10
|
class: {
|
|
@@ -24,7 +26,7 @@ export const Grid = {
|
|
|
24
26
|
|
|
25
27
|
autoFlow: ({ props }) => props.autoFlow ? ({ gridAutoFlow: props.autoFlow }) : null,
|
|
26
28
|
|
|
27
|
-
columnGap: ({ props }) => props.columnGap ? getSpacingBasedOnRatio(props, 'columnGap') : null,
|
|
28
|
-
rowGap: ({ props }) => props.rowGap ? getSpacingBasedOnRatio(props, 'rowGap') : null
|
|
29
|
+
columnGap: ({ props, deps }) => props.columnGap ? deps.getSpacingBasedOnRatio(props, 'columnGap') : null,
|
|
30
|
+
rowGap: ({ props, deps }) => props.rowGap ? deps.getSpacingBasedOnRatio(props, 'rowGap') : null
|
|
29
31
|
}
|
|
30
32
|
}
|
package/Picture.js
CHANGED
|
@@ -3,15 +3,16 @@
|
|
|
3
3
|
import { getSystemTheme } from './Theme'
|
|
4
4
|
|
|
5
5
|
export const Picture = {
|
|
6
|
+
deps: { getSystemTheme },
|
|
6
7
|
tag: 'picture',
|
|
7
8
|
|
|
8
9
|
childExtend: {
|
|
9
10
|
tag: 'source',
|
|
10
11
|
attr: {
|
|
11
12
|
media: (element) => {
|
|
12
|
-
const { props, key, context } = element
|
|
13
|
+
const { props, key, context, deps } = element
|
|
13
14
|
const { MEDIA } = context.designSystem
|
|
14
|
-
const globalTheme = getSystemTheme(element)
|
|
15
|
+
const globalTheme = deps.getSystemTheme(element)
|
|
15
16
|
const mediaName = (props.media || key).slice(1)
|
|
16
17
|
|
|
17
18
|
if (mediaName === globalTheme) return '(min-width: 0px)'
|
package/Position.js
CHANGED
|
@@ -3,19 +3,21 @@
|
|
|
3
3
|
import { getSpacingByKey } from '@symbo.ls/scratch'
|
|
4
4
|
|
|
5
5
|
export const Position = {
|
|
6
|
+
deps: { getSpacingByKey },
|
|
7
|
+
|
|
6
8
|
props: {},
|
|
7
9
|
|
|
8
10
|
class: {
|
|
9
11
|
position: ({ props }) => props.position && ({ position: props.position }),
|
|
10
|
-
inset: ({ props }) => {
|
|
12
|
+
inset: ({ props, deps }) => {
|
|
11
13
|
const { inset } = props
|
|
12
14
|
if (typeof inset !== 'string') return
|
|
13
|
-
return { inset: inset.split(' ').map(v => getSpacingByKey(v, 'k').k).join(' ') }
|
|
15
|
+
return { inset: inset.split(' ').map(v => deps.getSpacingByKey(v, 'k').k).join(' ') }
|
|
14
16
|
},
|
|
15
17
|
|
|
16
|
-
left: ({ props }) => getSpacingByKey(props.left, 'left'),
|
|
17
|
-
top: ({ props }) => getSpacingByKey(props.top, 'top'),
|
|
18
|
-
right: ({ props }) => getSpacingByKey(props.right, 'right'),
|
|
19
|
-
bottom: ({ props }) => getSpacingByKey(props.bottom, 'bottom')
|
|
18
|
+
left: ({ props, deps }) => deps.getSpacingByKey(props.left, 'left'),
|
|
19
|
+
top: ({ props, deps }) => deps.getSpacingByKey(props.top, 'top'),
|
|
20
|
+
right: ({ props, deps }) => deps.getSpacingByKey(props.right, 'right'),
|
|
21
|
+
bottom: ({ props, deps }) => deps.getSpacingByKey(props.bottom, 'bottom')
|
|
20
22
|
}
|
|
21
23
|
}
|
package/Shape/index.js
CHANGED
|
@@ -15,10 +15,12 @@ const transformBorderRadius = (radius, props, propertyName) => {
|
|
|
15
15
|
export const Shape = {
|
|
16
16
|
extend: Pseudo,
|
|
17
17
|
|
|
18
|
+
deps: { exec, getSpacingBasedOnRatio, getMediaColor, transformBorderRadius },
|
|
19
|
+
|
|
18
20
|
class: {
|
|
19
|
-
shape: ({ props }) => {
|
|
21
|
+
shape: ({ props, deps }) => {
|
|
20
22
|
const { shape } = props
|
|
21
|
-
return exec(SHAPES[shape], ({ props }))
|
|
23
|
+
return deps.exec(SHAPES[shape], ({ props }))
|
|
22
24
|
},
|
|
23
25
|
shapeDirection: ({ props }) => {
|
|
24
26
|
const { shape, shapeDirection } = props
|
|
@@ -26,16 +28,16 @@ export const Shape = {
|
|
|
26
28
|
const shapeDir = SHAPES[shape + 'Direction']
|
|
27
29
|
return shape && shapeDir ? shapeDir[shapeDirection || 'left'] : null
|
|
28
30
|
},
|
|
29
|
-
shapeDirectionColor: ({ props }) => {
|
|
31
|
+
shapeDirectionColor: ({ props, deps }) => {
|
|
30
32
|
const { background, backgroundColor } = props
|
|
31
33
|
const borderColor = {
|
|
32
|
-
borderColor: getMediaColor(background || backgroundColor)
|
|
34
|
+
borderColor: deps.getMediaColor(background || backgroundColor)
|
|
33
35
|
}
|
|
34
36
|
return props.shapeDirection ? borderColor : null
|
|
35
37
|
},
|
|
36
38
|
|
|
37
|
-
round: ({ props, key, ...el }) => transformBorderRadius(props.round || props.borderRadius, props, 'round'),
|
|
38
|
-
borderRadius: ({ props, key, ...el }) => transformBorderRadius(props.borderRadius || props.round, props, 'borderRadius')
|
|
39
|
+
round: ({ props, key, deps, ...el }) => deps.transformBorderRadius(props.round || props.borderRadius, props, 'round'),
|
|
40
|
+
borderRadius: ({ props, key, deps, ...el }) => deps.transformBorderRadius(props.borderRadius || props.round, props, 'borderRadius')
|
|
39
41
|
}
|
|
40
42
|
}
|
|
41
43
|
|
package/Text.js
CHANGED
|
@@ -4,10 +4,12 @@ import { getFontSizeByKey, getFontFamily } from '@symbo.ls/scratch'
|
|
|
4
4
|
|
|
5
5
|
export const Text = {
|
|
6
6
|
deps: { getFontSizeByKey, getFontFamily },
|
|
7
|
+
|
|
7
8
|
text: ({ key, props, state, deps }) => {
|
|
8
9
|
if (props.text === true) return (state && state[key]) || (props && props[key])
|
|
9
10
|
return props.text
|
|
10
11
|
},
|
|
12
|
+
|
|
11
13
|
class: {
|
|
12
14
|
fontSize: (el) => {
|
|
13
15
|
const { props, deps } = el
|
package/Theme.js
CHANGED
package/Timing.js
CHANGED
|
@@ -7,21 +7,27 @@ import {
|
|
|
7
7
|
} from '@symbo.ls/scratch'
|
|
8
8
|
|
|
9
9
|
export const Timing = {
|
|
10
|
+
deps: {
|
|
11
|
+
getTimingFunction,
|
|
12
|
+
splitTransition,
|
|
13
|
+
transformDuration
|
|
14
|
+
},
|
|
15
|
+
|
|
10
16
|
class: {
|
|
11
|
-
transition: ({ props }) => props.transition && ({
|
|
12
|
-
transition: splitTransition(props.transition)
|
|
17
|
+
transition: ({ props, deps }) => props.transition && ({
|
|
18
|
+
transition: deps.splitTransition(props.transition)
|
|
13
19
|
}),
|
|
14
20
|
willChange: ({ props }) => props.willChange && ({
|
|
15
21
|
willChange: props.willChange
|
|
16
22
|
}),
|
|
17
|
-
transitionDuration: ({ props }) => props.transitionDuration && ({
|
|
18
|
-
transitionDuration: transformDuration(props.transitionDuration)
|
|
23
|
+
transitionDuration: ({ props, deps }) => props.transitionDuration && ({
|
|
24
|
+
transitionDuration: deps.transformDuration(props.transitionDuration)
|
|
19
25
|
}),
|
|
20
|
-
transitionDelay: ({ props }) => props.transitionDelay && ({
|
|
21
|
-
transitionDelay: transformDuration(props.transitionDelay)
|
|
26
|
+
transitionDelay: ({ props, deps }) => props.transitionDelay && ({
|
|
27
|
+
transitionDelay: deps.transformDuration(props.transitionDelay)
|
|
22
28
|
}),
|
|
23
|
-
transitionTimingFunction: ({ props }) => props.transitionTimingFunction && ({
|
|
24
|
-
transitionTimingFunction: getTimingFunction(props.transitionTimingFunction)
|
|
29
|
+
transitionTimingFunction: ({ props, deps }) => props.transitionTimingFunction && ({
|
|
30
|
+
transitionTimingFunction: deps.getTimingFunction(props.transitionTimingFunction)
|
|
25
31
|
}),
|
|
26
32
|
transitionProperty: ({ props }) => props.transitionProperty && ({
|
|
27
33
|
transitionProperty: props.transitionProperty,
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbo.ls/atoms",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.162",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"gitHead": "
|
|
6
|
+
"gitHead": "fe3359a1d6c14d38f45f5e5db10ef2056947a228",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@domql/state": "latest",
|
|
9
9
|
"@domql/utils": "latest",
|