smbls 0.14.6 → 0.14.8
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/ButtonSet.js +1 -2
- package/src/Icon.js +1 -1
- package/src/Link.js +1 -2
- package/src/Notification.js +2 -1
- package/src/Pills.js +19 -20
- package/src/Tooltip.js +3 -3
- 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 +30 -6
- 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 +1 -23
- package/src/styles.js +0 -1
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/ButtonSet.js
CHANGED
package/src/Icon.js
CHANGED
package/src/Link.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
import { exec } from '@domql/utils'
|
|
4
|
-
import { Focusable } from './
|
|
4
|
+
import { Focusable } from './atoms'
|
|
5
5
|
|
|
6
6
|
export const Link = {
|
|
7
7
|
extend: [Focusable],
|
|
@@ -11,7 +11,6 @@ export const Link = {
|
|
|
11
11
|
fontWeight: 'bold',
|
|
12
12
|
textDecoration: 'none',
|
|
13
13
|
color: 'currentColor'
|
|
14
|
-
// style: { '&::-webkit-any-link': { color: 'currentColor' } }
|
|
15
14
|
},
|
|
16
15
|
attr: {
|
|
17
16
|
href: element => exec(element.props.href, element) || exec(element.props, element).href,
|
package/src/Notification.js
CHANGED
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
CHANGED
|
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,20 +11,43 @@ 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',
|
|
42
|
+
tooltip: el => ({
|
|
43
|
+
position: el.props.position || 'relative',
|
|
21
44
|
'&:before': {
|
|
22
45
|
content: '""',
|
|
23
46
|
display: 'block',
|
|
24
47
|
width: '0px',
|
|
25
48
|
height: '0px',
|
|
26
49
|
border: `.35em solid`,
|
|
27
|
-
borderColor:
|
|
50
|
+
borderColor: getComputedBackgroundColor(el),
|
|
28
51
|
position: 'absolute',
|
|
29
52
|
borderRadius: '.15em'
|
|
30
53
|
}
|
|
@@ -61,14 +84,15 @@ export const SHAPES = {
|
|
|
61
84
|
}
|
|
62
85
|
},
|
|
63
86
|
|
|
64
|
-
tag:
|
|
87
|
+
tag: el => ({
|
|
65
88
|
position: 'relative',
|
|
66
89
|
'&:before': {
|
|
67
90
|
content: '""',
|
|
68
91
|
display: 'block',
|
|
69
92
|
width: '0',
|
|
70
93
|
height: '0',
|
|
71
|
-
border: `16px solid
|
|
94
|
+
border: `16px solid`,
|
|
95
|
+
borderColor: getComputedBackgroundColor(el),
|
|
72
96
|
borderRadius: '6px',
|
|
73
97
|
position: 'absolute'
|
|
74
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,35 +1,13 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import './styles.js'
|
|
4
|
-
|
|
5
3
|
export * from '@symbo.ls/init'
|
|
6
4
|
|
|
7
|
-
export * from './styles'
|
|
8
|
-
|
|
9
5
|
// atoms
|
|
10
|
-
export * from './
|
|
11
|
-
export * from './Block'
|
|
12
|
-
export * from './Shape'
|
|
13
|
-
export * from './Theme'
|
|
14
|
-
export * from './Flex'
|
|
15
|
-
export * from './Grid'
|
|
16
|
-
export * from './Pseudo'
|
|
17
|
-
export * from './Direction'
|
|
18
|
-
export * from './Position'
|
|
19
|
-
export * from './Overflow'
|
|
20
|
-
export * from './Transform'
|
|
21
|
-
export * from './Timing'
|
|
22
|
-
|
|
23
|
-
export * from './Media'
|
|
24
|
-
export * from './Interaction'
|
|
25
|
-
export * from './XYZ'
|
|
26
|
-
|
|
6
|
+
export * from './atoms'
|
|
27
7
|
export * from './Box'
|
|
28
8
|
|
|
29
9
|
// atoms
|
|
30
|
-
export * from './SVG'
|
|
31
10
|
export * from './Icon'
|
|
32
|
-
export * from './Img'
|
|
33
11
|
export * from './Link'
|
|
34
12
|
export * from './IconText'
|
|
35
13
|
export * from './Input'
|