smbls 0.14.5 → 0.14.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/Box.js +2 -2
- package/src/Button.js +3 -33
- package/src/ButtonSet.js +1 -2
- package/src/Field.js +4 -3
- package/src/Icon.js +1 -1
- package/src/Input.js +3 -1
- package/src/Label.js +1 -1
- package/src/Link.js +1 -1
- package/src/Notification.js +14 -8
- package/src/Pills.js +19 -20
- package/src/Tooltip.js +33 -0
- package/src/{Media copy.js → __/Media copy.js } +0 -1
- package/src/{Block.js → atoms/Block.js} +0 -0
- package/src/{Direction.js → atoms/Direction.js} +0 -0
- package/src/{Flex.js → atoms/Flex.js} +0 -0
- package/src/{Grid.js → atoms/Grid.js} +0 -0
- package/src/{Img.js → atoms/Img.js} +0 -0
- package/src/{Interaction.js → atoms/Interaction.js} +0 -0
- package/src/{Media.js → atoms/Media.js} +1 -1
- package/src/{Overflow.js → atoms/Overflow.js} +0 -0
- package/src/{Position.js → atoms/Position.js} +1 -1
- package/src/{Pseudo.js → atoms/Pseudo.js} +0 -0
- package/src/{SVG.js → atoms/SVG.js} +0 -0
- package/src/{Shape → atoms/Shape}/index.js +0 -0
- package/src/{Shape → atoms/Shape}/style.js +37 -12
- package/src/{Text.js → atoms/Text.js} +0 -0
- package/src/{Theme.js → atoms/Theme.js} +0 -0
- package/src/{Timing.js → atoms/Timing.js} +0 -0
- package/src/{Transform.js → atoms/Transform.js} +0 -0
- package/src/{XYZ.js → atoms/XYZ.js} +0 -0
- package/src/atoms/index.js +19 -0
- package/src/index.js +4 -23
- package/src/styles.js +0 -1
- package/src/Tooltip/index.js +0 -13
- package/src/Tooltip/style.js +0 -12
package/package.json
CHANGED
package/src/Box.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import { Shape, Position, Theme, Block, Text, Overflow, Timing, Transform,
|
|
3
|
+
import { Shape, Position, Theme, Block, Text, Overflow, Timing, Transform, Media, Interaction, XYZ } from './atoms'
|
|
4
4
|
|
|
5
5
|
const PropsCSS = {
|
|
6
6
|
class: {
|
|
@@ -9,5 +9,5 @@ const PropsCSS = {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export const Box = {
|
|
12
|
-
extend: [Shape, Position, Theme, Block, Text, Overflow, Timing, Transform,
|
|
12
|
+
extend: [Shape, Position, Theme, Block, Text, Overflow, Timing, Transform, Media, PropsCSS, Interaction, XYZ]
|
|
13
13
|
}
|
package/src/Button.js
CHANGED
|
@@ -18,6 +18,7 @@ export const Button = {
|
|
|
18
18
|
props: {
|
|
19
19
|
fontSize: 'A',
|
|
20
20
|
type: 'button',
|
|
21
|
+
border: 'none',
|
|
21
22
|
display: 'inline-flex',
|
|
22
23
|
alignItems: 'center',
|
|
23
24
|
justifyContent: 'center',
|
|
@@ -54,38 +55,7 @@ export const CircleButton = {
|
|
|
54
55
|
|
|
55
56
|
export const KangorooButton = {
|
|
56
57
|
extend: Button,
|
|
58
|
+
childExtend: IconText,
|
|
57
59
|
|
|
58
|
-
props: {
|
|
59
|
-
theme: 'quinary',
|
|
60
|
-
round: 'Z2',
|
|
61
|
-
padding: 'X1 X1 X1 A2',
|
|
62
|
-
size: 'A',
|
|
63
|
-
gap: 'A',
|
|
64
|
-
transition: 'A defaultBezier',
|
|
65
|
-
transitionProperty: 'background, color, opacity',
|
|
66
|
-
|
|
67
|
-
label: {
|
|
68
|
-
gap: 'X1',
|
|
69
|
-
text: 'Become PRO',
|
|
70
|
-
alignItems: 'center',
|
|
71
|
-
fontWeight: 'bold',
|
|
72
|
-
icon: {
|
|
73
|
-
name: 'star',
|
|
74
|
-
color: 'yellow'
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
child: {
|
|
78
|
-
theme: 'tertiary',
|
|
79
|
-
round: 'Z',
|
|
80
|
-
size: 'Z',
|
|
81
|
-
padding: 'Z A2',
|
|
82
|
-
text: '1 month free',
|
|
83
|
-
opacity: '.85'
|
|
84
|
-
},
|
|
85
|
-
|
|
86
|
-
style
|
|
87
|
-
},
|
|
88
|
-
|
|
89
|
-
label: { extend: IconText },
|
|
90
|
-
child: { extend: IconText }
|
|
60
|
+
props: { style }
|
|
91
61
|
}
|
package/src/ButtonSet.js
CHANGED
package/src/Field.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import { IconText, Input } from '.'
|
|
3
|
+
import { IconText, Input, Focusable } from '.'
|
|
4
4
|
|
|
5
5
|
export const Field = {
|
|
6
|
-
extend: IconText,
|
|
6
|
+
extend: [IconText],
|
|
7
|
+
|
|
7
8
|
props: (el, s) => ({
|
|
8
9
|
value: s[el.key],
|
|
9
10
|
|
|
@@ -36,5 +37,5 @@ export const Field = {
|
|
|
36
37
|
}
|
|
37
38
|
}),
|
|
38
39
|
|
|
39
|
-
input: { extend: Input }
|
|
40
|
+
input: { extend: [Focusable, Input] }
|
|
40
41
|
}
|
package/src/Icon.js
CHANGED
package/src/Input.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import { Focusable } from './
|
|
3
|
+
import { Focusable } from './'
|
|
4
4
|
|
|
5
5
|
export const Input = {
|
|
6
6
|
extend: [Focusable],
|
|
7
7
|
tag: 'input',
|
|
8
8
|
|
|
9
9
|
props: {
|
|
10
|
+
border: 'none',
|
|
10
11
|
type: 'input',
|
|
12
|
+
theme: 'quaternary',
|
|
11
13
|
fontSize: 'A',
|
|
12
14
|
round: 'C',
|
|
13
15
|
lineHeight: 1,
|
package/src/Label.js
CHANGED
package/src/Link.js
CHANGED
package/src/Notification.js
CHANGED
|
@@ -6,11 +6,18 @@ export const Notification = {
|
|
|
6
6
|
extend: Flex,
|
|
7
7
|
|
|
8
8
|
props: {
|
|
9
|
+
theme: 'alert',
|
|
9
10
|
padding: 'Z1 B Z1 A1',
|
|
10
|
-
round: 'A',
|
|
11
|
+
round: 'A A A Y2',
|
|
11
12
|
gap: 'X2',
|
|
12
13
|
style: { cursor: 'pointer' },
|
|
13
14
|
|
|
15
|
+
icon: {
|
|
16
|
+
icon: {
|
|
17
|
+
name: 'info outline'
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
|
|
14
21
|
article: {
|
|
15
22
|
flow: 'column',
|
|
16
23
|
align: 'flex-start',
|
|
@@ -29,13 +36,12 @@ export const Notification = {
|
|
|
29
36
|
},
|
|
30
37
|
|
|
31
38
|
icon: {
|
|
32
|
-
extend: [IconText]
|
|
33
|
-
props: {
|
|
34
|
-
icon: {
|
|
35
|
-
name: 'info outline'
|
|
36
|
-
}
|
|
37
|
-
}
|
|
39
|
+
extend: [IconText]
|
|
38
40
|
},
|
|
39
41
|
|
|
40
|
-
article: {
|
|
42
|
+
article: {
|
|
43
|
+
extend: Flex,
|
|
44
|
+
title: {},
|
|
45
|
+
p: {}
|
|
46
|
+
}
|
|
41
47
|
}
|
package/src/Pills.js
CHANGED
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
+
import { Flex } from './'
|
|
4
|
+
|
|
3
5
|
export const Pills = {
|
|
4
|
-
|
|
6
|
+
extend: Flex,
|
|
7
|
+
props: (el, s) => ({
|
|
5
8
|
display: 'flex',
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
background: '
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
childExtend: {
|
|
19
|
-
tag: 'div',
|
|
20
|
-
props: {
|
|
21
|
-
round: 42,
|
|
22
|
-
theme: 'White'
|
|
9
|
+
gap: 'Y2',
|
|
10
|
+
|
|
11
|
+
childProps: {
|
|
12
|
+
background: 'gray6',
|
|
13
|
+
width: 'Y2',
|
|
14
|
+
height: 'Y2',
|
|
15
|
+
round: 'A',
|
|
16
|
+
|
|
17
|
+
'.active': {
|
|
18
|
+
background: 'gray9'
|
|
19
|
+
}
|
|
23
20
|
}
|
|
24
|
-
},
|
|
25
|
-
|
|
21
|
+
}),
|
|
22
|
+
childExtend: {
|
|
23
|
+
props: (el, s) => ({ active: parseInt(el.key) === s.active })
|
|
24
|
+
}
|
|
26
25
|
}
|
package/src/Tooltip.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { Button, Flex } from './'
|
|
4
|
+
|
|
5
|
+
export const Tooltip = {
|
|
6
|
+
extend: [Button, Flex],
|
|
7
|
+
props: {
|
|
8
|
+
background: 'black',
|
|
9
|
+
color: 'white',
|
|
10
|
+
flow: 'column',
|
|
11
|
+
shape: 'tooltip',
|
|
12
|
+
shapeDirection: 'top',
|
|
13
|
+
padding: 'Z1 A',
|
|
14
|
+
round: 'Y2',
|
|
15
|
+
minWidth: 'D2',
|
|
16
|
+
gap: 'X',
|
|
17
|
+
|
|
18
|
+
title: {
|
|
19
|
+
color: 'gray12',
|
|
20
|
+
text: 'And tooltip is coming'
|
|
21
|
+
},
|
|
22
|
+
p: {
|
|
23
|
+
fontSize: 'Z2',
|
|
24
|
+
margin: '0',
|
|
25
|
+
color: 'gray6',
|
|
26
|
+
text: 'and winter too',
|
|
27
|
+
fontWeight: '400'
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
title: {},
|
|
32
|
+
p: {}
|
|
33
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -10,7 +10,7 @@ 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 => getSpacingByKey(v,'k').k).join(' ') }
|
|
13
|
+
return { inset: inset.split(' ').map(v => getSpacingByKey(v, 'k').k).join(' ') }
|
|
14
14
|
},
|
|
15
15
|
|
|
16
16
|
left: ({ props }) => getSpacingByKey(props.left, 'left'),
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import { UNIT, getColor, getTheme } from '@symbo.ls/scratch'
|
|
3
|
+
import { UNIT, getColor, getTheme } from '@symbo.ls/scratch' // eslint-disable-line no-unused-vars
|
|
4
4
|
|
|
5
5
|
export const depth = {
|
|
6
6
|
4: { boxShadow: `rgba(0,0,0,.10) 0 2${UNIT.default} 4${UNIT.default}` },
|
|
@@ -11,28 +11,52 @@ export const depth = {
|
|
|
11
11
|
42: { boxShadow: `rgba(0,0,0,.10) 0 20${UNIT.default} 42${UNIT.default}` }
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
const getComputedBackgroundColor = el => {
|
|
15
|
+
const { props, node } = el
|
|
16
|
+
const propsColor = getColor(props.borderColor) || getColor(props.backgroundColor) || getColor(props.background)
|
|
17
|
+
|
|
18
|
+
if (!propsColor) {
|
|
19
|
+
const computedStyle = window.getComputedStyle(node)
|
|
20
|
+
// console.group(el.key)
|
|
21
|
+
// console.log(getColor(props.borderColor))
|
|
22
|
+
// console.log(getColor(props.backgroundColor))
|
|
23
|
+
// console.log(getColor(props.background))
|
|
24
|
+
// console.log(computedStyle.getPropertyValue('border-color'))
|
|
25
|
+
// console.log(computedStyle.getPropertyValue('background'))
|
|
26
|
+
// console.log(computedStyle.getPropertyValue('background-color'))
|
|
27
|
+
// console.log(el)
|
|
28
|
+
// console.groupEnd(el.key)
|
|
29
|
+
return computedStyle.getPropertyValue('border-color') ||
|
|
30
|
+
computedStyle.getPropertyValue('background') ||
|
|
31
|
+
computedStyle.getPropertyValue('background-color')
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return propsColor
|
|
35
|
+
}
|
|
36
|
+
|
|
14
37
|
export const SHAPES = {
|
|
15
38
|
rectangle: {},
|
|
16
39
|
circle: { borderRadius: '100%' },
|
|
17
40
|
bubble: {},
|
|
18
41
|
|
|
19
|
-
tooltip:
|
|
20
|
-
position: props.position || 'relative',
|
|
21
|
-
'
|
|
42
|
+
tooltip: el => ({
|
|
43
|
+
position: el.props.position || 'relative',
|
|
44
|
+
'&:before': {
|
|
22
45
|
content: '""',
|
|
23
46
|
display: 'block',
|
|
24
47
|
width: '0px',
|
|
25
48
|
height: '0px',
|
|
26
|
-
border:
|
|
49
|
+
border: `.35em solid`,
|
|
50
|
+
borderColor: getComputedBackgroundColor(el),
|
|
27
51
|
position: 'absolute',
|
|
28
|
-
borderRadius: '
|
|
52
|
+
borderRadius: '.15em'
|
|
29
53
|
}
|
|
30
54
|
}),
|
|
31
55
|
|
|
32
56
|
tooltipDirection: {
|
|
33
57
|
top: {
|
|
34
58
|
'&:before': {
|
|
35
|
-
top: '
|
|
59
|
+
top: '-.1em',
|
|
36
60
|
left: '50%',
|
|
37
61
|
transform: 'translate(-50%, -50%) rotate(45deg)'
|
|
38
62
|
}
|
|
@@ -40,13 +64,13 @@ export const SHAPES = {
|
|
|
40
64
|
right: {
|
|
41
65
|
'&:before': {
|
|
42
66
|
top: '50%',
|
|
43
|
-
right: '
|
|
67
|
+
right: '-.1em',
|
|
44
68
|
transform: 'translate(-50%, -50%) rotate(45deg)'
|
|
45
69
|
}
|
|
46
70
|
},
|
|
47
71
|
bottom: {
|
|
48
72
|
'&:before': {
|
|
49
|
-
bottom: '
|
|
73
|
+
bottom: '-.1em',
|
|
50
74
|
left: '50%',
|
|
51
75
|
transform: 'translate(-50%, -50%) rotate(45deg)'
|
|
52
76
|
}
|
|
@@ -54,20 +78,21 @@ export const SHAPES = {
|
|
|
54
78
|
left: {
|
|
55
79
|
'&:before': {
|
|
56
80
|
top: '50%',
|
|
57
|
-
left: '
|
|
81
|
+
left: '-.1em',
|
|
58
82
|
transform: 'translate(-50%, -50%) rotate(45deg)'
|
|
59
83
|
}
|
|
60
84
|
}
|
|
61
85
|
},
|
|
62
86
|
|
|
63
|
-
tag:
|
|
87
|
+
tag: el => ({
|
|
64
88
|
position: 'relative',
|
|
65
89
|
'&:before': {
|
|
66
90
|
content: '""',
|
|
67
91
|
display: 'block',
|
|
68
92
|
width: '0',
|
|
69
93
|
height: '0',
|
|
70
|
-
border: `16px solid
|
|
94
|
+
border: `16px solid`,
|
|
95
|
+
borderColor: getComputedBackgroundColor(el),
|
|
71
96
|
borderRadius: '6px',
|
|
72
97
|
position: 'absolute'
|
|
73
98
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
export * from './Block'
|
|
4
|
+
export * from './Direction'
|
|
5
|
+
export * from './Flex'
|
|
6
|
+
export * from './Grid'
|
|
7
|
+
export * from './Img'
|
|
8
|
+
export * from './Media'
|
|
9
|
+
export * from './Interaction'
|
|
10
|
+
export * from './Overflow'
|
|
11
|
+
export * from './Position'
|
|
12
|
+
export * from './Pseudo'
|
|
13
|
+
export * from './SVG'
|
|
14
|
+
export * from './Shape'
|
|
15
|
+
export * from './Theme'
|
|
16
|
+
export * from './Text'
|
|
17
|
+
export * from './Timing'
|
|
18
|
+
export * from './Transform'
|
|
19
|
+
export * from './XYZ'
|
package/src/index.js
CHANGED
|
@@ -1,39 +1,20 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import './styles.js'
|
|
4
|
-
|
|
5
3
|
export * from '@symbo.ls/init'
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export * from './Text'
|
|
10
|
-
export * from './Block'
|
|
11
|
-
export * from './Shape'
|
|
12
|
-
export * from './Theme'
|
|
13
|
-
export * from './Flex'
|
|
14
|
-
export * from './Grid'
|
|
15
|
-
export * from './Pseudo'
|
|
16
|
-
export * from './Direction'
|
|
17
|
-
export * from './Position'
|
|
18
|
-
export * from './Overflow'
|
|
19
|
-
export * from './Transform'
|
|
20
|
-
export * from './Timing'
|
|
21
|
-
|
|
22
|
-
export * from './Media'
|
|
23
|
-
export * from './Interaction'
|
|
24
|
-
export * from './XYZ'
|
|
25
|
-
|
|
5
|
+
// atoms
|
|
6
|
+
export * from './atoms'
|
|
26
7
|
export * from './Box'
|
|
27
8
|
|
|
28
|
-
|
|
9
|
+
// atoms
|
|
29
10
|
export * from './Icon'
|
|
30
|
-
export * from './Img'
|
|
31
11
|
export * from './Link'
|
|
32
12
|
export * from './IconText'
|
|
33
13
|
export * from './Input'
|
|
34
14
|
export * from './Field'
|
|
35
15
|
export * from './Button'
|
|
36
16
|
|
|
17
|
+
// components
|
|
37
18
|
export * from './ButtonSet'
|
|
38
19
|
export * from './User'
|
|
39
20
|
export * from './Banner'
|
package/src/styles.js
CHANGED
package/src/Tooltip/index.js
DELETED