smbls 0.9.3 → 0.9.6
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/Box.js +1 -1
- package/src/Button.js +10 -5
- package/src/Field.js +1 -1
- package/src/Flex.js +1 -1
- package/src/Icon.js +1 -1
- package/src/SVG.js +1 -1
- package/src/Select.js +1 -1
- package/src/Shape/style.js +2 -2
- package/src/Text.js +1 -0
- package/src/Transition.js +25 -1
package/package.json
CHANGED
package/src/Box.js
CHANGED
package/src/Button.js
CHANGED
|
@@ -2,25 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
import { IconText } from '.'
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const style = {
|
|
6
6
|
appearance: 'none',
|
|
7
7
|
border: 'none',
|
|
8
8
|
outline: 0,
|
|
9
9
|
cursor: 'pointer',
|
|
10
|
-
fontFamily: '
|
|
10
|
+
fontFamily: 'default'
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export const Button = {
|
|
14
14
|
proto: IconText,
|
|
15
15
|
tag: 'button',
|
|
16
16
|
props: {
|
|
17
|
+
fontSize: 'A',
|
|
17
18
|
type: 'button',
|
|
18
19
|
display: 'inline-flex',
|
|
19
20
|
alignItems: 'center',
|
|
20
21
|
justifyContent: 'center',
|
|
21
22
|
textDecoration: 'none',
|
|
23
|
+
lineHeight: '1',
|
|
24
|
+
whiteSpace: 'nowrap',
|
|
25
|
+
padding: 'Z A1',
|
|
26
|
+
fontFamily: 'inherit',
|
|
22
27
|
round: 'C2',
|
|
23
|
-
|
|
28
|
+
style
|
|
24
29
|
},
|
|
25
30
|
attr: {
|
|
26
31
|
type: ({ props }) => props.type
|
|
@@ -36,7 +41,7 @@ export const SquareButton = {
|
|
|
36
41
|
aspectRatio: '1 / 1',
|
|
37
42
|
justifyContent: 'center',
|
|
38
43
|
round: 'Z',
|
|
39
|
-
|
|
44
|
+
style: { boxSizing: 'content-box' }
|
|
40
45
|
}
|
|
41
46
|
}
|
|
42
47
|
|
|
@@ -47,7 +52,7 @@ export const CircleButton = {
|
|
|
47
52
|
|
|
48
53
|
export const KangorooButton = {
|
|
49
54
|
tag: 'button',
|
|
50
|
-
props: {
|
|
55
|
+
props: { style },
|
|
51
56
|
|
|
52
57
|
iconText: { proto: IconText },
|
|
53
58
|
child: { proto: IconText }
|
package/src/Field.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/Icon.js
CHANGED
package/src/SVG.js
CHANGED
package/src/Select.js
CHANGED
package/src/Shape/style.js
CHANGED
|
@@ -17,13 +17,13 @@ export const SHAPES = {
|
|
|
17
17
|
bubble: {},
|
|
18
18
|
|
|
19
19
|
tooltip: ({ props }) => ({
|
|
20
|
-
position: 'relative',
|
|
20
|
+
position: props.position || 'relative',
|
|
21
21
|
'&:before': {
|
|
22
22
|
content: '""',
|
|
23
23
|
display: 'block',
|
|
24
24
|
width: '0px',
|
|
25
25
|
height: '0px',
|
|
26
|
-
border: `6px solid ${getColor(props.background) || (props.theme && getTheme(props.theme).
|
|
26
|
+
border: `6px solid ${getColor(props.background) || (props.theme && getTheme(props.theme).background)}`,
|
|
27
27
|
position: 'absolute',
|
|
28
28
|
borderRadius: '2px'
|
|
29
29
|
}
|
package/src/Text.js
CHANGED
|
@@ -14,6 +14,7 @@ export const Text = {
|
|
|
14
14
|
// lineHeight: ({ props }) => props.lineHeight && mapBasedOnRatio(props, 'lineHeight', null, ''),
|
|
15
15
|
textDecoration: ({ props }) => props.textDecoration && ({ textDecoration: props.textDecoration }),
|
|
16
16
|
textTransform: ({ props }) => props.textTransform && ({ textTransform: props.textTransform }),
|
|
17
|
+
whiteSpace: ({ props }) => props.whiteSpace && ({ whiteSpace: props.whiteSpace }),
|
|
17
18
|
textAlign: ({ props }) => props.textAlign && ({ textAlign: props.textAlign }),
|
|
18
19
|
fontWeight: ({ props }) => props.fontWeight && ({ fontWeight: props.fontWeight })
|
|
19
20
|
}
|
package/src/Transition.js
CHANGED
|
@@ -1,8 +1,32 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
+
import { mapTiming } from '@symbo.ls/scratch'
|
|
4
|
+
|
|
5
|
+
const diffTransition = transition => {
|
|
6
|
+
const arr = transition.split(' ')
|
|
7
|
+
|
|
8
|
+
if (!arr.length) return transition
|
|
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
|
|
22
|
+
return {
|
|
23
|
+
transition: arr.map(diffTransition).join(',')
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
3
27
|
export const Transition = {
|
|
4
28
|
class: {
|
|
5
|
-
transition: ({ props }) => props.transition && (
|
|
29
|
+
transition: ({ props }) => props.transition && splitTransition(props.transition),
|
|
6
30
|
transitionProperty: ({ props }) => props.transitionProperty && ({
|
|
7
31
|
transitionProperty: props.transitionProperty,
|
|
8
32
|
willChange: props.transitionProperty
|