smbls 0.14.9 → 0.15.1
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/Button.js +3 -2
- package/src/{Slider → Range}/index.js +5 -5
- package/src/{Slider → Range}/style.js +0 -0
- package/src/atoms/FocusableComponent.js +31 -0
- package/src/atoms/Interaction.js +1 -0
- package/src/atoms/Shape/style.js +13 -9
- package/src/atoms/index.js +1 -0
- package/src/index.js +2 -2
package/package.json
CHANGED
package/src/Button.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { FocusableComponent } from './atoms'
|
|
4
|
+
import { IconText } from '.'
|
|
4
5
|
|
|
5
6
|
const style = {
|
|
6
7
|
appearance: 'none',
|
|
@@ -13,7 +14,7 @@ const style = {
|
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
export const Button = {
|
|
16
|
-
extend: [
|
|
17
|
+
extend: [FocusableComponent, IconText],
|
|
17
18
|
tag: 'button',
|
|
18
19
|
props: {
|
|
19
20
|
fontSize: 'A',
|
|
@@ -49,7 +49,7 @@ const theme = {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
export const
|
|
52
|
+
export const Range = {
|
|
53
53
|
style,
|
|
54
54
|
props: theme,
|
|
55
55
|
|
|
@@ -63,10 +63,10 @@ const listenProp = (el, prop, def) => {
|
|
|
63
63
|
return r
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
export const
|
|
66
|
+
export const RangeWithButtons = {
|
|
67
67
|
minus: {
|
|
68
68
|
extend: SquareButton,
|
|
69
|
-
props: { icon: 'minus' },
|
|
69
|
+
props: { theme: 'tertiary', icon: 'minus' },
|
|
70
70
|
on: {
|
|
71
71
|
click: (ev, el, s) => {
|
|
72
72
|
el.props && isFunction(el.props.click) && el.props.click(ev, el, s)
|
|
@@ -87,7 +87,7 @@ export const Slider = {
|
|
|
87
87
|
}
|
|
88
88
|
},
|
|
89
89
|
input: {
|
|
90
|
-
extend:
|
|
90
|
+
extend: Range,
|
|
91
91
|
attr: {
|
|
92
92
|
value: (el, s) => listenProp(el, 'value', 50),
|
|
93
93
|
min: (el, s) => listenProp(el, 'min', 0),
|
|
@@ -101,7 +101,7 @@ export const Slider = {
|
|
|
101
101
|
},
|
|
102
102
|
plus: {
|
|
103
103
|
extend: SquareButton,
|
|
104
|
-
props: { icon: 'plus' },
|
|
104
|
+
props: { theme: 'tertiary', icon: 'plus' },
|
|
105
105
|
on: {
|
|
106
106
|
click: (ev, el, s) => {
|
|
107
107
|
el.props && isFunction(el.props.click) && el.props.click(ev, el, s)
|
|
File without changes
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { Focusable } from '.'
|
|
4
|
+
|
|
5
|
+
const style = {
|
|
6
|
+
appearance: 'none',
|
|
7
|
+
border: 'none',
|
|
8
|
+
cursor: 'pointer',
|
|
9
|
+
fontFamily: 'inherit',
|
|
10
|
+
'& > *': {
|
|
11
|
+
pointerEvents: 'none'
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const FocusableComponent = {
|
|
16
|
+
extend: Focusable,
|
|
17
|
+
tag: 'button',
|
|
18
|
+
props: {
|
|
19
|
+
fontSize: 'A',
|
|
20
|
+
type: 'button',
|
|
21
|
+
border: 'none',
|
|
22
|
+
textDecoration: 'none',
|
|
23
|
+
lineHeight: '1',
|
|
24
|
+
whiteSpace: 'nowrap',
|
|
25
|
+
fontFamily: 'inherit',
|
|
26
|
+
style
|
|
27
|
+
},
|
|
28
|
+
attr: {
|
|
29
|
+
type: ({ props }) => props.type
|
|
30
|
+
}
|
|
31
|
+
}
|
package/src/atoms/Interaction.js
CHANGED
package/src/atoms/Shape/style.js
CHANGED
|
@@ -14,18 +14,22 @@ export const depth = {
|
|
|
14
14
|
const getComputedBackgroundColor = el => {
|
|
15
15
|
const { props, node } = el
|
|
16
16
|
const propsColor = getColor(props.borderColor) || getColor(props.backgroundColor) || getColor(props.background)
|
|
17
|
+
// const propsTheme = getTheme(props.theme)
|
|
17
18
|
|
|
18
19
|
if (!propsColor) {
|
|
19
20
|
const computedStyle = window.getComputedStyle(node)
|
|
20
|
-
//
|
|
21
|
-
//
|
|
22
|
-
//
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
//
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
//
|
|
21
|
+
// if (props.shapeDirection) {
|
|
22
|
+
// console.group(el.parent.parent.parent.key + ' - ' + el.parent.key)
|
|
23
|
+
// console.log(propsTheme)
|
|
24
|
+
// console.log(getColor(props.borderColor))
|
|
25
|
+
// console.log(getColor(props.backgroundColor))
|
|
26
|
+
// console.log(getColor(props.background))
|
|
27
|
+
// console.log(computedStyle.getPropertyValue('border-color'))
|
|
28
|
+
// console.log(computedStyle.getPropertyValue('background'))
|
|
29
|
+
// console.log(computedStyle.getPropertyValue('background-color'))
|
|
30
|
+
// console.log(el)
|
|
31
|
+
// console.groupEnd(el.parent.parent.parent.key + ' - ' + el.parent.key)
|
|
32
|
+
// }
|
|
29
33
|
return computedStyle.getPropertyValue('border-color') ||
|
|
30
34
|
computedStyle.getPropertyValue('background') ||
|
|
31
35
|
computedStyle.getPropertyValue('background-color')
|
package/src/atoms/index.js
CHANGED
package/src/index.js
CHANGED
|
@@ -18,11 +18,11 @@ export * from './Button'
|
|
|
18
18
|
export * from './ButtonSet'
|
|
19
19
|
export * from './User'
|
|
20
20
|
export * from './Banner'
|
|
21
|
-
export * from './
|
|
21
|
+
export * from './Select'
|
|
22
22
|
export * from './Notification'
|
|
23
23
|
export * from './Dropdown'
|
|
24
24
|
export * from './DatePicker'
|
|
25
25
|
export * from './Tooltip'
|
|
26
26
|
export * from './Label'
|
|
27
27
|
export * from './Pills'
|
|
28
|
-
export * from './
|
|
28
|
+
export * from './Range'
|