smbls 0.9.4 → 0.9.7
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/Button.js +1 -0
- package/src/Flex.js +1 -1
- package/src/Media.js +3 -0
- package/src/Transition.js +16 -10
package/package.json
CHANGED
package/src/Button.js
CHANGED
package/src/Flex.js
CHANGED
|
@@ -12,7 +12,7 @@ export const Flex = {
|
|
|
12
12
|
flow: ({ props }) => props.flow && ({ flexFlow: props.flow }),
|
|
13
13
|
flexDirection: ({ props }) => props.flexDirection && ({ flexDirection: props.flexDirection }),
|
|
14
14
|
alignItems: ({ props }) => props.alignItems && ({ alignItems: props.alignItems }),
|
|
15
|
-
wrap: ({ props }) => props.wrap && ({
|
|
15
|
+
wrap: ({ props }) => props.wrap && ({ flexWrap: props.wrap }),
|
|
16
16
|
alignContent: ({ props }) => props.alignContent && ({ alignContent: props.alignContent }),
|
|
17
17
|
justifyContent: ({ props }) => props.justifyContent && ({ justifyContent: props.justifyContent }),
|
|
18
18
|
gap: ({ props }) => props.gap && mapBasedOnRatio(props, 'gap'),
|
package/src/Media.js
CHANGED
package/src/Transition.js
CHANGED
|
@@ -2,25 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
import { mapTiming } from '@symbo.ls/scratch'
|
|
4
4
|
|
|
5
|
-
const diffTransition =
|
|
5
|
+
const diffTransition = transition => {
|
|
6
6
|
const arr = transition.split(' ')
|
|
7
7
|
|
|
8
|
-
if (!arr.length) return
|
|
8
|
+
if (!arr.length) return transition
|
|
9
9
|
|
|
10
|
+
return arr.map(v => {
|
|
11
|
+
if (v.length < 3 || v.includes('ms')) {
|
|
12
|
+
const mapWithSequence = mapTiming(v)
|
|
13
|
+
return mapWithSequence.duration
|
|
14
|
+
}
|
|
15
|
+
return v
|
|
16
|
+
}).join(' ')
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const splitTransition = transition => {
|
|
20
|
+
const arr = transition.split(',')
|
|
21
|
+
if (!arr.length) return
|
|
10
22
|
return {
|
|
11
|
-
transition: arr.map(
|
|
12
|
-
if (v.length < 3 || v.includes('ms')) {
|
|
13
|
-
const mapWithSequence = mapTiming(v)
|
|
14
|
-
return mapWithSequence.duration
|
|
15
|
-
}
|
|
16
|
-
return v
|
|
17
|
-
}).join(' ')
|
|
23
|
+
transition: arr.map(diffTransition).join(',')
|
|
18
24
|
}
|
|
19
25
|
}
|
|
20
26
|
|
|
21
27
|
export const Transition = {
|
|
22
28
|
class: {
|
|
23
|
-
transition: ({ props }) => props.transition &&
|
|
29
|
+
transition: ({ props }) => props.transition && splitTransition(props.transition),
|
|
24
30
|
transitionProperty: ({ props }) => props.transitionProperty && ({
|
|
25
31
|
transitionProperty: props.transitionProperty,
|
|
26
32
|
willChange: props.transitionProperty
|