smbls 0.15.27 → 0.15.29
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/{Range/index.js → Range.js} +33 -7
- package/src/atoms/Animation.js +2 -2
- package/src/atoms/Interaction.js +4 -1
- package/src/atoms/Media.js +2 -1
- package/src/atoms/Text.js +2 -1
- package/src/Range/style.js +0 -19
package/package.json
CHANGED
|
@@ -1,12 +1,38 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import style from './style'
|
|
4
3
|
import { opacify } from '@symbo.ls/scratch'
|
|
5
4
|
import { isFunction } from '@domql/utils'
|
|
6
5
|
|
|
7
|
-
import { SquareButton } from '
|
|
6
|
+
import { SquareButton } from '.'
|
|
7
|
+
|
|
8
|
+
const props = {
|
|
9
|
+
appearance: 'none',
|
|
10
|
+
width: '100%',
|
|
11
|
+
height: '2px',
|
|
12
|
+
outline: 'none',
|
|
13
|
+
flex: 1,
|
|
14
|
+
|
|
15
|
+
style: {
|
|
16
|
+
appearance: 'none'
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
'::-webkit-slider-thumb': {
|
|
20
|
+
boxSizing: 'content-box',
|
|
21
|
+
width: '8px',
|
|
22
|
+
height: '8px',
|
|
23
|
+
borderWidth: '2px',
|
|
24
|
+
borderStyle: 'solid',
|
|
25
|
+
borderRadius: '100%',
|
|
26
|
+
opacity: '.8',
|
|
27
|
+
|
|
28
|
+
style: {
|
|
29
|
+
appearance: 'none'
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
'::-webkit-slider-runnable-track': {
|
|
34
|
+
},
|
|
8
35
|
|
|
9
|
-
const theme = {
|
|
10
36
|
'@dark': {
|
|
11
37
|
background: 'white 0.2',
|
|
12
38
|
|
|
@@ -27,6 +53,7 @@ const theme = {
|
|
|
27
53
|
}
|
|
28
54
|
}
|
|
29
55
|
},
|
|
56
|
+
|
|
30
57
|
'@light': {
|
|
31
58
|
background: 'gray9',
|
|
32
59
|
|
|
@@ -50,8 +77,7 @@ const theme = {
|
|
|
50
77
|
}
|
|
51
78
|
|
|
52
79
|
export const Range = {
|
|
53
|
-
|
|
54
|
-
props: theme,
|
|
80
|
+
props,
|
|
55
81
|
|
|
56
82
|
tag: 'input',
|
|
57
83
|
attr: { type: 'range' }
|
|
@@ -59,8 +85,8 @@ export const Range = {
|
|
|
59
85
|
|
|
60
86
|
const listenProp = (el, prop, def) => {
|
|
61
87
|
const val = el.props && el.props[prop]
|
|
62
|
-
const r = (isFunction(val) ? val(el, el.state) : val
|
|
63
|
-
return r
|
|
88
|
+
const r = (isFunction(val) ? val(el, el.state) : val !== undefined ? val : def !== undefined ? def : 50)
|
|
89
|
+
return r + ''
|
|
64
90
|
}
|
|
65
91
|
|
|
66
92
|
export const RangeWithButtons = {
|
package/src/atoms/Animation.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { getTimingByKey, getTimingFunction } from '@symbo.ls/scratch'
|
|
4
4
|
import { isObject } from '@domql/utils'
|
|
5
5
|
import { convertPropsToClass } from './Media' // eslint-disable-line no-unused-vars
|
|
6
|
-
import
|
|
7
|
-
const { keyframes } =
|
|
6
|
+
import { emotion } from '@symbo.ls/create-emotion'
|
|
7
|
+
const { keyframes } = emotion
|
|
8
8
|
|
|
9
9
|
const applyAnimationProps = (animation, element) => {
|
|
10
10
|
if (isObject(animation)) return { animationName: keyframes(animation) }
|
package/src/atoms/Interaction.js
CHANGED
package/src/atoms/Media.js
CHANGED
|
@@ -45,7 +45,8 @@ const convertPropsToClass = (props, result, element) => {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
const applyMediaProps = (key, props, result, element) => {
|
|
48
|
-
|
|
48
|
+
if (!element.context.SYSTEM || !element.context.SYSTEM.MEDIA) { return }
|
|
49
|
+
const { MEDIA } = element.context.SYSTEM
|
|
49
50
|
const mediaName = MEDIA[key.slice(1)]
|
|
50
51
|
const generatedClass = convertPropsToClass(props, result, element)
|
|
51
52
|
|
package/src/atoms/Text.js
CHANGED
|
@@ -12,10 +12,11 @@ export const Text = {
|
|
|
12
12
|
textDecoration: ({ props }) => props.textDecoration && ({ textDecoration: props.textDecoration }),
|
|
13
13
|
textTransform: ({ props }) => props.textTransform && ({ textTransform: props.textTransform }),
|
|
14
14
|
whiteSpace: ({ props }) => props.whiteSpace && ({ whiteSpace: props.whiteSpace }),
|
|
15
|
+
letterSpacing: ({ props }) => props.letterSpacing && ({ letterSpacing: props.letterSpacing }),
|
|
15
16
|
textAlign: ({ props }) => props.textAlign && ({ textAlign: props.textAlign }),
|
|
16
17
|
fontWeight: ({ props }) => props.fontWeight && ({
|
|
17
18
|
fontWeight: props.fontWeight,
|
|
18
|
-
fontVariationSettings: '"
|
|
19
|
+
fontVariationSettings: '"wght" ' + props.fontWeight
|
|
19
20
|
})
|
|
20
21
|
}
|
|
21
22
|
}
|
package/src/Range/style.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
appearance: 'none',
|
|
5
|
-
width: '100%',
|
|
6
|
-
height: '2px',
|
|
7
|
-
outline: 'none',
|
|
8
|
-
flex: 1,
|
|
9
|
-
'&::-webkit-slider-thumb': {
|
|
10
|
-
boxSizing: 'content-box',
|
|
11
|
-
appearance: 'none',
|
|
12
|
-
width: '8px',
|
|
13
|
-
height: '8px',
|
|
14
|
-
borderWidth: '2px',
|
|
15
|
-
borderStyle: 'solid',
|
|
16
|
-
borderRadius: '100%',
|
|
17
|
-
opacity: '.8'
|
|
18
|
-
}
|
|
19
|
-
}
|