smbls 0.9.4 → 0.9.5

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 CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "UI Library built on Scratch and DOMQL",
4
4
  "private": false,
5
5
  "author": "symbo.ls",
6
- "version": "0.9.4",
6
+ "version": "0.9.5",
7
7
  "repository": "https://github.com/symbo-ls/smbls",
8
8
  "main": "src/index.js",
9
9
  "files": [
package/src/Button.js CHANGED
@@ -7,7 +7,7 @@ const style = {
7
7
  border: 'none',
8
8
  outline: 0,
9
9
  cursor: 'pointer',
10
- fontFamily: 'inherit'
10
+ fontFamily: 'default'
11
11
  }
12
12
 
13
13
  export const Button = {
package/src/Transition.js CHANGED
@@ -2,25 +2,31 @@
2
2
 
3
3
  import { mapTiming } from '@symbo.ls/scratch'
4
4
 
5
- const diffTransition = (transition, key = 'transition') => {
5
+ const diffTransition = transition => {
6
6
  const arr = transition.split(' ')
7
7
 
8
- if (!arr.length) return { transition: props.transition }
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(v => {
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 && diffTransition(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