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 CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "UI Library built on Scratch and DOMQL",
4
4
  "private": false,
5
5
  "author": "symbo.ls",
6
- "version": "0.14.9",
6
+ "version": "0.15.1",
7
7
  "repository": "https://github.com/symbo-ls/smbls",
8
8
  "main": "src/index.js",
9
9
  "files": [
package/src/Button.js CHANGED
@@ -1,6 +1,7 @@
1
1
  'use strict'
2
2
 
3
- import { IconText, Focusable } from '.'
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: [Focusable, IconText],
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 RangeSlider = {
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 Slider = {
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: RangeSlider,
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
+ }
@@ -29,6 +29,7 @@ export const Hoverable = {
29
29
 
30
30
  export const Focusable = {
31
31
  props: {
32
+ border: 'none',
32
33
  outline: 'none',
33
34
  ':focus-visible': {
34
35
  opacity: 1,
@@ -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
- // 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)
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')
@@ -7,6 +7,7 @@ export * from './Grid'
7
7
  export * from './Img'
8
8
  export * from './Media'
9
9
  export * from './Interaction'
10
+ export * from './FocusableComponent'
10
11
  export * from './Overflow'
11
12
  export * from './Position'
12
13
  export * from './Pseudo'
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 './Slider'
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 './Select'
28
+ export * from './Range'