smbls 0.9.15 → 0.11.0
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/README.md +1 -1
- package/package.json +1 -1
- package/src/Banner/index.js +3 -3
- package/src/Block.js +31 -29
- package/src/Box.js +1 -1
- package/src/Button.js +5 -5
- package/src/ButtonSet.js +2 -2
- package/src/DatePicker/index.js +6 -6
- package/src/Dropdown/index.js +4 -4
- package/src/Field.js +2 -2
- package/src/Grid.js +3 -3
- package/src/GridLayouts/index.js +1 -1
- package/src/Icon.js +1 -1
- package/src/IconText.js +2 -2
- package/src/Label.js +1 -1
- package/src/Notification.js +3 -5
- package/src/Pills.js +1 -1
- package/src/Position.js +6 -6
- package/src/Select.js +1 -1
- package/src/Sidebar.js +3 -3
- package/src/Slider/index.js +3 -3
- package/src/Text.js +4 -4
- package/src/Theme.js +4 -4
- package/src/Tooltip/index.js +1 -1
- package/src/Transition.js +2 -2
- package/src/User/index.js +2 -2
package/README.md
CHANGED
package/package.json
CHANGED
package/src/Banner/index.js
CHANGED
|
@@ -7,17 +7,17 @@ import { UserBundle } from '../User'
|
|
|
7
7
|
import { styleParentMode } from './style'
|
|
8
8
|
|
|
9
9
|
export const ParentMode = {
|
|
10
|
-
|
|
10
|
+
extend: Shape,
|
|
11
11
|
round: 10,
|
|
12
12
|
theme: 'purple',
|
|
13
13
|
style: styleParentMode,
|
|
14
14
|
icon: {
|
|
15
|
-
|
|
15
|
+
extend: Icon,
|
|
16
16
|
props: { icon: 'checkMedium' }
|
|
17
17
|
},
|
|
18
18
|
h2: 'Welcome to parent Mode',
|
|
19
19
|
description: {
|
|
20
|
-
|
|
20
|
+
extend: UserBundle,
|
|
21
21
|
users: { ...[{}, {}, {}] },
|
|
22
22
|
span: 'You’ll now be able to chat with tutor privately. No other participants will see the messages.'
|
|
23
23
|
}
|
package/src/Block.js
CHANGED
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import { SPACING,
|
|
3
|
+
import { SPACING, getSpacingByKey } from '@symbo.ls/scratch'
|
|
4
4
|
|
|
5
|
-
export const
|
|
5
|
+
export const getSpacingBasedOnRatio = (props, prop, unit) => {
|
|
6
6
|
const { spacingRatio } = props
|
|
7
7
|
const val = props[prop]
|
|
8
|
-
// TODO: move this to
|
|
8
|
+
// TODO: move this to getSpacingByKey
|
|
9
9
|
if (spacingRatio) {
|
|
10
|
-
|
|
10
|
+
let params = SPACING[spacingRatio]
|
|
11
11
|
|
|
12
12
|
if (!params) {
|
|
13
|
-
SPACING[spacingRatio] = {
|
|
13
|
+
params = SPACING[spacingRatio] = {
|
|
14
14
|
base: SPACING.base,
|
|
15
|
-
type:
|
|
15
|
+
type: SPACING.type,
|
|
16
16
|
ratio: spacingRatio,
|
|
17
|
-
range:
|
|
18
|
-
subSequence:
|
|
17
|
+
range: SPACING.range,
|
|
18
|
+
subSequence: SPACING.subSequence,
|
|
19
19
|
sequence: {},
|
|
20
|
-
scales: {}
|
|
20
|
+
scales: {},
|
|
21
|
+
vars: {}
|
|
21
22
|
}
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
return
|
|
25
|
+
return getSpacingByKey(val, prop, params, unit)
|
|
25
26
|
}
|
|
26
|
-
return
|
|
27
|
+
return getSpacingByKey(val, prop, null, unit)
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
export const Block = {
|
|
@@ -36,47 +37,47 @@ export const Block = {
|
|
|
36
37
|
|
|
37
38
|
hide: ({ props }) => props.hide && ({ display: 'none' }),
|
|
38
39
|
|
|
39
|
-
width: ({ props }) => props.width &&
|
|
40
|
-
height: ({ props }) => props.height &&
|
|
40
|
+
width: ({ props }) => props.width && getSpacingBasedOnRatio(props, 'width'),
|
|
41
|
+
height: ({ props }) => props.height && getSpacingBasedOnRatio(props, 'height'),
|
|
41
42
|
boxSize: ({ props }) => {
|
|
42
43
|
if (typeof props.boxSize !== 'string') return
|
|
43
44
|
const [height, width] = props.boxSize.split(' ')
|
|
44
45
|
return {
|
|
45
|
-
...
|
|
46
|
-
...
|
|
46
|
+
...getSpacingByKey(height, 'height'),
|
|
47
|
+
...getSpacingByKey(width || height, 'width')
|
|
47
48
|
}
|
|
48
49
|
},
|
|
49
50
|
|
|
50
|
-
maxWidth: ({ props }) => props.maxWidth &&
|
|
51
|
-
minWidth: ({ props }) => props.minWidth &&
|
|
51
|
+
maxWidth: ({ props }) => props.maxWidth && getSpacingBasedOnRatio(props, 'maxWidth'),
|
|
52
|
+
minWidth: ({ props }) => props.minWidth && getSpacingBasedOnRatio(props, 'minWidth'),
|
|
52
53
|
widthRange: ({ props }) => {
|
|
53
54
|
if (typeof props.widthRange !== 'string') return
|
|
54
55
|
const [minWidth, maxWidth] = props.widthRange.split(' ')
|
|
55
56
|
return {
|
|
56
|
-
...
|
|
57
|
-
...
|
|
57
|
+
...getSpacingByKey(minWidth, 'minWidth'),
|
|
58
|
+
...getSpacingByKey(maxWidth, 'maxWidth')
|
|
58
59
|
}
|
|
59
60
|
},
|
|
60
61
|
|
|
61
|
-
maxHeight: ({ props }) => props.maxHeight &&
|
|
62
|
-
minHeight: ({ props }) => props.minHeight &&
|
|
62
|
+
maxHeight: ({ props }) => props.maxHeight && getSpacingBasedOnRatio(props, 'maxHeight'),
|
|
63
|
+
minHeight: ({ props }) => props.minHeight && getSpacingBasedOnRatio(props, 'minHeight'),
|
|
63
64
|
heightRange: ({ props }) => {
|
|
64
65
|
if (typeof props.heightRange !== 'string') return
|
|
65
66
|
const [minHeight, maxHeight] = props.heightRange.split(' ')
|
|
66
67
|
return {
|
|
67
|
-
...
|
|
68
|
-
...
|
|
68
|
+
...getSpacingByKey(minHeight, 'minHeight'),
|
|
69
|
+
...getSpacingByKey(maxHeight || minHeight, 'maxHeight')
|
|
69
70
|
}
|
|
70
71
|
},
|
|
71
72
|
|
|
72
73
|
aspectRatio: ({ props }) => props.aspectRatio && ({ aspectRatio: props.aspectRatio }),
|
|
73
74
|
|
|
74
|
-
borderWidth: ({ props }) => props.borderWidth ?
|
|
75
|
+
borderWidth: ({ props }) => props.borderWidth ? getSpacingBasedOnRatio(props, 'borderWidth') : null,
|
|
75
76
|
|
|
76
|
-
padding: ({ props }) => props.padding ?
|
|
77
|
-
margin: ({ props }) => props.margin ?
|
|
77
|
+
padding: ({ props }) => props.padding ? getSpacingBasedOnRatio(props, 'padding') : null,
|
|
78
|
+
margin: ({ props }) => props.margin ? getSpacingBasedOnRatio(props, 'margin') : null,
|
|
78
79
|
|
|
79
|
-
gap: ({ props }) => props.gap ?
|
|
80
|
+
gap: ({ props }) => props.gap ? getSpacingBasedOnRatio(props, 'gap') : null,
|
|
80
81
|
gridArea: ({ props }) => props.gridArea && ({ gridArea: props.gridArea }),
|
|
81
82
|
|
|
82
83
|
flex: ({ props }) => props.flex && ({ flex: props.flex }),
|
|
@@ -84,6 +85,7 @@ export const Block = {
|
|
|
84
85
|
alignContent: ({ props }) => props.alignContent && ({ alignContent: props.alignContent }),
|
|
85
86
|
justifyContent: ({ props }) => props.justifyContent && ({ justifyContent: props.justifyContent }),
|
|
86
87
|
flexDirection: ({ props }) => props.flexDirection && ({ flexDirection: props.flexDirection }),
|
|
88
|
+
alignSelf: ({ props }) => props.alignSelf && ({ alignSelf: props.alignSelf }),
|
|
87
89
|
|
|
88
90
|
flexWrap: ({ props }) => props.flexWrap && ({
|
|
89
91
|
display: 'flex',
|
|
@@ -110,8 +112,8 @@ export const Block = {
|
|
|
110
112
|
if (typeof props.heightRange !== 'string') return
|
|
111
113
|
const [minHeight, maxHeight] = props.heightRange.split(' ')
|
|
112
114
|
return {
|
|
113
|
-
...
|
|
114
|
-
...
|
|
115
|
+
...getSpacingByKey(minHeight, 'minHeight'),
|
|
116
|
+
...getSpacingByKey(maxHeight || minHeight, 'maxHeight')
|
|
115
117
|
}
|
|
116
118
|
}
|
|
117
119
|
}
|
package/src/Box.js
CHANGED
|
@@ -9,5 +9,5 @@ const PropsCSS = {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export const Box = {
|
|
12
|
-
|
|
12
|
+
extend: [Shape, Position, Theme, Block, Text, Overflow, Transition, Transform, Responsive, PropsCSS, Interaction]
|
|
13
13
|
}
|
package/src/Button.js
CHANGED
|
@@ -11,7 +11,7 @@ const style = {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export const Button = {
|
|
14
|
-
|
|
14
|
+
extend: IconText,
|
|
15
15
|
tag: 'button',
|
|
16
16
|
props: {
|
|
17
17
|
fontSize: 'A',
|
|
@@ -33,7 +33,7 @@ export const Button = {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
export const SquareButton = {
|
|
36
|
-
|
|
36
|
+
extend: Button,
|
|
37
37
|
props: {
|
|
38
38
|
fontSize: 'A',
|
|
39
39
|
width: 'A',
|
|
@@ -46,7 +46,7 @@ export const SquareButton = {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
export const CircleButton = {
|
|
49
|
-
|
|
49
|
+
extend: SquareButton,
|
|
50
50
|
props: { round: 'C' }
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -54,6 +54,6 @@ export const KangorooButton = {
|
|
|
54
54
|
tag: 'button',
|
|
55
55
|
props: { style },
|
|
56
56
|
|
|
57
|
-
iconText: {
|
|
58
|
-
child: {
|
|
57
|
+
iconText: { extend: IconText },
|
|
58
|
+
child: { extend: IconText }
|
|
59
59
|
}
|
package/src/ButtonSet.js
CHANGED
package/src/DatePicker/index.js
CHANGED
|
@@ -15,7 +15,7 @@ export const DatePicker = {
|
|
|
15
15
|
},
|
|
16
16
|
|
|
17
17
|
aside: {
|
|
18
|
-
|
|
18
|
+
childExtend: { tag: 'button' },
|
|
19
19
|
...[
|
|
20
20
|
{ text: '2020' },
|
|
21
21
|
{ text: '2021' },
|
|
@@ -32,11 +32,11 @@ export const DatePicker = {
|
|
|
32
32
|
main: {
|
|
33
33
|
header: {
|
|
34
34
|
icon: {
|
|
35
|
-
|
|
35
|
+
extend: Icon,
|
|
36
36
|
props: { icon: 'arrowMediumLeft' }
|
|
37
37
|
},
|
|
38
38
|
month: {
|
|
39
|
-
|
|
39
|
+
childExtend: { tag: 'span' },
|
|
40
40
|
...[
|
|
41
41
|
{ text: 'january' },
|
|
42
42
|
{ text: 'february' },
|
|
@@ -53,14 +53,14 @@ export const DatePicker = {
|
|
|
53
53
|
]
|
|
54
54
|
},
|
|
55
55
|
icon2: {
|
|
56
|
-
|
|
56
|
+
extend: Icon,
|
|
57
57
|
props: { icon: 'arrowMediumRight' }
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
60
|
days: {
|
|
61
61
|
tag: 'section',
|
|
62
62
|
header: {
|
|
63
|
-
|
|
63
|
+
childExtend: { tag: 'span' },
|
|
64
64
|
...[
|
|
65
65
|
{ text: 'Mo' },
|
|
66
66
|
{ text: 'Tu' },
|
|
@@ -72,7 +72,7 @@ export const DatePicker = {
|
|
|
72
72
|
]
|
|
73
73
|
},
|
|
74
74
|
content: {
|
|
75
|
-
|
|
75
|
+
childExtend: { tag: 'button' },
|
|
76
76
|
...[
|
|
77
77
|
{ text: '1' },
|
|
78
78
|
{ text: '2' },
|
package/src/Dropdown/index.js
CHANGED
|
@@ -6,15 +6,15 @@ export const DropdownList = {
|
|
|
6
6
|
style: styleDropDown,
|
|
7
7
|
tag: 'ul',
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
extend: Shape,
|
|
10
10
|
|
|
11
11
|
state: {
|
|
12
12
|
active: 0
|
|
13
13
|
},
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
childExtend: {
|
|
16
16
|
tag: 'li',
|
|
17
|
-
|
|
17
|
+
extend: [Shape],
|
|
18
18
|
|
|
19
19
|
style: styleRow,
|
|
20
20
|
props: (el, s) => ({
|
|
@@ -24,7 +24,7 @@ export const DropdownList = {
|
|
|
24
24
|
}),
|
|
25
25
|
|
|
26
26
|
span: {
|
|
27
|
-
|
|
27
|
+
extend: [IconText],
|
|
28
28
|
props: {
|
|
29
29
|
icon: 'checkmark',
|
|
30
30
|
text: ''
|
package/src/Field.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { IconText, Input } from '.'
|
|
4
4
|
|
|
5
5
|
export const Field = {
|
|
6
|
-
|
|
6
|
+
extend: IconText,
|
|
7
7
|
props: (el, s) => ({
|
|
8
8
|
value: s[el.key],
|
|
9
9
|
|
|
@@ -36,5 +36,5 @@ export const Field = {
|
|
|
36
36
|
}
|
|
37
37
|
}),
|
|
38
38
|
|
|
39
|
-
input: {
|
|
39
|
+
input: { extend: Input }
|
|
40
40
|
}
|
package/src/Grid.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { getSpacingBasedOnRatio } from './Block'
|
|
4
4
|
|
|
5
5
|
export const Grid = {
|
|
6
6
|
props: { display: 'grid' },
|
|
@@ -11,7 +11,7 @@ export const Grid = {
|
|
|
11
11
|
area: ({ props }) => props.area ? ({ gridArea: props.area }) : null,
|
|
12
12
|
template: ({ props }) => props.template ? ({ gridTemplate: props.template }) : null,
|
|
13
13
|
templateAreas: ({ props }) => props.templateAreas ? ({ gridTemplateAreas: props.templateAreas }) : null,
|
|
14
|
-
columnGap: ({ props }) => props.columnGap ?
|
|
15
|
-
rowGap: ({ props }) => props.rowGap ?
|
|
14
|
+
columnGap: ({ props }) => props.columnGap ? getSpacingBasedOnRatio(props, 'columnGap') : null,
|
|
15
|
+
rowGap: ({ props }) => props.rowGap ? getSpacingBasedOnRatio(props, 'rowGap') : null
|
|
16
16
|
}
|
|
17
17
|
}
|
package/src/GridLayouts/index.js
CHANGED
package/src/Icon.js
CHANGED
package/src/IconText.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { Flex, Icon } from '.'
|
|
4
4
|
|
|
5
5
|
export const IconText = {
|
|
6
|
-
|
|
6
|
+
extend: Flex,
|
|
7
7
|
|
|
8
8
|
props: {
|
|
9
9
|
align: 'center center',
|
|
@@ -11,7 +11,7 @@ export const IconText = {
|
|
|
11
11
|
},
|
|
12
12
|
|
|
13
13
|
icon: {
|
|
14
|
-
|
|
14
|
+
extend: Icon,
|
|
15
15
|
if: ({ parent }) => parent.props.icon,
|
|
16
16
|
props: 'match'
|
|
17
17
|
},
|
package/src/Label.js
CHANGED
package/src/Notification.js
CHANGED
|
@@ -4,9 +4,9 @@ import { Shape, Block, IconText, Direction, Flex, Text } from '.'
|
|
|
4
4
|
|
|
5
5
|
export const Notification = {
|
|
6
6
|
style: { cursor: 'pointer' },
|
|
7
|
-
|
|
7
|
+
extend: [Shape, Block, Direction, Flex],
|
|
8
8
|
icon: {
|
|
9
|
-
|
|
9
|
+
extend: [IconText],
|
|
10
10
|
props: {
|
|
11
11
|
icon: 'info'
|
|
12
12
|
},
|
|
@@ -16,17 +16,15 @@ export const Notification = {
|
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
article: {
|
|
19
|
-
|
|
19
|
+
extend: [Flex],
|
|
20
20
|
style: {
|
|
21
21
|
flexDirection: 'column',
|
|
22
22
|
alignItems: 'flex-start'
|
|
23
23
|
},
|
|
24
24
|
caption: {
|
|
25
|
-
proto: Text,
|
|
26
25
|
text: 'Notification'
|
|
27
26
|
},
|
|
28
27
|
p: {
|
|
29
|
-
proto: Text,
|
|
30
28
|
props: {
|
|
31
29
|
fontSize: 'Z',
|
|
32
30
|
text: 'is not always a distraction'
|
package/src/Pills.js
CHANGED
package/src/Position.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { getSpacingByKey } from '@symbo.ls/scratch'
|
|
4
4
|
|
|
5
5
|
export const Position = {
|
|
6
6
|
props: {},
|
|
@@ -10,12 +10,12 @@ export const Position = {
|
|
|
10
10
|
inset: ({ props }) => {
|
|
11
11
|
const { inset } = props
|
|
12
12
|
if (typeof inset !== 'string') return
|
|
13
|
-
return { inset: inset.split(' ').map(v =>
|
|
13
|
+
return { inset: inset.split(' ').map(v => getSpacingByKey(v,'k').k).join(' ') }
|
|
14
14
|
},
|
|
15
15
|
|
|
16
|
-
left: ({ props }) =>
|
|
17
|
-
top: ({ props }) =>
|
|
18
|
-
right: ({ props }) =>
|
|
19
|
-
bottom: ({ props }) =>
|
|
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')
|
|
20
20
|
}
|
|
21
21
|
}
|
package/src/Select.js
CHANGED
package/src/Sidebar.js
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
import { Icon, Link } from '.'
|
|
4
4
|
|
|
5
5
|
const MenuItem = {
|
|
6
|
-
|
|
6
|
+
extend: Link,
|
|
7
7
|
props: { icon: '' },
|
|
8
8
|
glyph: {
|
|
9
|
-
|
|
9
|
+
extend: Icon,
|
|
10
10
|
name: ({ props }) => props.icon
|
|
11
11
|
}
|
|
12
12
|
}
|
|
@@ -17,7 +17,7 @@ export const Sidebar = {
|
|
|
17
17
|
style: {
|
|
18
18
|
a: { cursor: 'pointer' }
|
|
19
19
|
},
|
|
20
|
-
|
|
20
|
+
childExtend: MenuItem,
|
|
21
21
|
...[{}]
|
|
22
22
|
}
|
|
23
23
|
}
|
package/src/Slider/index.js
CHANGED
|
@@ -65,7 +65,7 @@ const listenProp = (el, prop, def) => {
|
|
|
65
65
|
|
|
66
66
|
export const Slider = {
|
|
67
67
|
minus: {
|
|
68
|
-
|
|
68
|
+
extend: SquareButton,
|
|
69
69
|
props: { icon: 'minus' },
|
|
70
70
|
on: {
|
|
71
71
|
click: (ev, el, s) => {
|
|
@@ -87,7 +87,7 @@ export const Slider = {
|
|
|
87
87
|
}
|
|
88
88
|
},
|
|
89
89
|
input: {
|
|
90
|
-
|
|
90
|
+
extend: RangeSlider,
|
|
91
91
|
attr: {
|
|
92
92
|
value: (el, s) => listenProp(el, 'value', 50),
|
|
93
93
|
min: (el, s) => listenProp(el, 'min', 0),
|
|
@@ -100,7 +100,7 @@ export const Slider = {
|
|
|
100
100
|
}
|
|
101
101
|
},
|
|
102
102
|
plus: {
|
|
103
|
-
|
|
103
|
+
extend: SquareButton,
|
|
104
104
|
props: { icon: 'plus' },
|
|
105
105
|
on: {
|
|
106
106
|
click: (ev, el, s) => {
|
package/src/Text.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { getFontSizeByKey, getFontFamily } from '@symbo.ls/scratch'
|
|
4
4
|
|
|
5
5
|
export const Text = {
|
|
6
6
|
props: {},
|
|
@@ -8,10 +8,10 @@ export const Text = {
|
|
|
8
8
|
text: ({ props }) => props.text,
|
|
9
9
|
|
|
10
10
|
class: {
|
|
11
|
-
fontSize: ({ props }) => props.fontSize ?
|
|
12
|
-
fontFamily: ({ props }) => props.fontFamily && ({ fontFamily: getFontFamily(
|
|
11
|
+
fontSize: ({ props }) => props.fontSize ? getFontSizeByKey(props.fontSize) : null,
|
|
12
|
+
fontFamily: ({ props }) => props.fontFamily && ({ fontFamily: getFontFamily(props.fontFamily) || props.fontFamily }),
|
|
13
13
|
lineHeight: ({ props }) => props.lineHeight && ({ lineHeight: props.lineHeight }),
|
|
14
|
-
// lineHeight: ({ props }) => props.lineHeight &&
|
|
14
|
+
// lineHeight: ({ props }) => props.lineHeight && getSpacingBasedOnRatio(props, 'lineHeight', null, ''),
|
|
15
15
|
textDecoration: ({ props }) => props.textDecoration && ({ textDecoration: props.textDecoration }),
|
|
16
16
|
textTransform: ({ props }) => props.textTransform && ({ textTransform: props.textTransform }),
|
|
17
17
|
whiteSpace: ({ props }) => props.whiteSpace && ({ whiteSpace: props.whiteSpace }),
|
package/src/Theme.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
import { isArray, isObject } from '@domql/utils'
|
|
4
|
-
import {
|
|
4
|
+
import { getSpacingByKey, getTheme, getColor } from '@symbo.ls/scratch'
|
|
5
5
|
|
|
6
6
|
import { depth } from './Shape/style'
|
|
7
7
|
|
|
@@ -33,15 +33,15 @@ const transformShadow = shadow => ({
|
|
|
33
33
|
|
|
34
34
|
const arr = v.split(' ')
|
|
35
35
|
if (!arr.length) return v
|
|
36
|
-
return arr.map(v =>
|
|
36
|
+
return arr.map(v => getSpacingByKey(v, 'shadow').shadow).join(' ')
|
|
37
37
|
}).join(' ')
|
|
38
38
|
})
|
|
39
39
|
|
|
40
40
|
export const Theme = {
|
|
41
41
|
class: {
|
|
42
42
|
depth: ({ props }) => depth[props.depth],
|
|
43
|
-
round: ({ props, key, ...el }) => props.round ? (
|
|
44
|
-
borderRadius: ({ props, key, ...el }) => props.borderRadius ? (
|
|
43
|
+
round: ({ props, key, ...el }) => props.round ? (getSpacingByKey(props.round, 'borderRadius') || ({ borderRadius: props.round })) : null,
|
|
44
|
+
borderRadius: ({ props, key, ...el }) => props.borderRadius ? (getSpacingByKey(props.borderRadius, 'borderRadius') || ({ borderRadius: props.borderRadius })) : null,
|
|
45
45
|
|
|
46
46
|
theme: ({ props, key }) => {
|
|
47
47
|
if (!props.theme) return
|
package/src/Tooltip/index.js
CHANGED
package/src/Transition.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { getTimingByKey } from '@symbo.ls/scratch'
|
|
4
4
|
|
|
5
5
|
const transformTransition = transition => {
|
|
6
6
|
const arr = transition.split(' ')
|
|
@@ -9,7 +9,7 @@ const transformTransition = transition => {
|
|
|
9
9
|
|
|
10
10
|
return arr.map(v => {
|
|
11
11
|
if (v.length < 3 || v.includes('ms')) {
|
|
12
|
-
const mapWithSequence =
|
|
12
|
+
const mapWithSequence = getTimingByKey(v)
|
|
13
13
|
return mapWithSequence.duration
|
|
14
14
|
}
|
|
15
15
|
return v
|
package/src/User/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { Shape, Block } from '..'
|
|
|
4
4
|
import { styleUser, styleUserBundle } from './style'
|
|
5
5
|
|
|
6
6
|
export const User = {
|
|
7
|
-
|
|
7
|
+
extend: [Shape, Block],
|
|
8
8
|
props: { boxSize: 'B B' },
|
|
9
9
|
style: styleUser,
|
|
10
10
|
tag: 'img',
|
|
@@ -16,7 +16,7 @@ export const User = {
|
|
|
16
16
|
export const UserBundle = {
|
|
17
17
|
style: styleUserBundle,
|
|
18
18
|
users: {
|
|
19
|
-
|
|
19
|
+
childExtend: User,
|
|
20
20
|
...[{}]
|
|
21
21
|
},
|
|
22
22
|
span: 'join classroom'
|