smbls 0.15.9 → 0.15.11

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.15.9",
6
+ "version": "0.15.11",
7
7
  "repository": "https://github.com/symbo-ls/smbls",
8
8
  "main": "src/index.js",
9
9
  "files": [
package/src/Button.js CHANGED
@@ -3,13 +3,6 @@
3
3
  import { FocusableComponent } from './atoms'
4
4
  import { IconText } from '.'
5
5
 
6
- const style = {
7
- appearance: 'none',
8
- border: 'none',
9
- cursor: 'pointer',
10
- fontFamily: 'inherit'
11
- }
12
-
13
6
  export const Button = {
14
7
  extend: [FocusableComponent, IconText],
15
8
  tag: 'button',
@@ -25,8 +18,7 @@ export const Button = {
25
18
  whiteSpace: 'nowrap',
26
19
  padding: 'Z A1',
27
20
  fontFamily: 'inherit',
28
- round: 'C2',
29
- style
21
+ round: 'C2'
30
22
  },
31
23
  attr: {
32
24
  type: ({ props }) => props.type
@@ -53,7 +45,5 @@ export const CircleButton = {
53
45
 
54
46
  export const KangorooButton = {
55
47
  extend: Button,
56
- childExtend: IconText,
57
-
58
- props: { style }
48
+ childExtend: IconText
59
49
  }
package/src/Input.js CHANGED
@@ -13,7 +13,7 @@ export const Input = {
13
13
  fontSize: 'A',
14
14
  round: 'C',
15
15
  lineHeight: 1,
16
- padding: 'Z A'
16
+ padding: 'Z A',
17
17
  },
18
18
 
19
19
  attr: {
@@ -4,7 +4,7 @@ import { getSpacingBasedOnRatio, getSpacingByKey } from '@symbo.ls/scratch'
4
4
 
5
5
  export const Block = {
6
6
  class: {
7
- boxSizing: ({ props }) => props.boxSizing ? ({ display: props.boxSizing }) : {
7
+ boxSizing: ({ props }) => props.boxSizing ? ({ boxSizing: props.boxSizing }) : {
8
8
  boxSizing: 'border-box'
9
9
  },
10
10
 
@@ -6,10 +6,7 @@ const style = {
6
6
  appearance: 'none',
7
7
  border: 'none',
8
8
  cursor: 'pointer',
9
- fontFamily: 'inherit',
10
- '& > *': {
11
- pointerEvents: 'none'
12
- }
9
+ fontFamily: 'inherit'
13
10
  }
14
11
 
15
12
  export const FocusableComponent = {
@@ -10,6 +10,7 @@ const isBorderStyle = str =>
10
10
  const transformBorder = border => {
11
11
  const arr = border.split(', ')
12
12
  return arr.map(v => {
13
+ v = v.trim()
13
14
  if (isBorderStyle(v)) return v || 'solid'
14
15
  else if (v.slice(-2) === 'px' || v.slice(-2) === 'em') return v // TODO: add map spacing
15
16
  else if (getColor(v).length > 2) return getColor(v)
@@ -24,16 +25,16 @@ const transformTextStroke = stroke => ({
24
25
  }).join(' ')
25
26
  })
26
27
 
27
- const transformShadow = shadow => ({
28
- boxShadow: shadow.split(', ').map(v => {
29
- if (v !== getColor(v)) return getColor(v)
30
- if (v.includes('px')) return v
31
-
28
+ const transformShadow = shadows => shadows.split('|').map(shadow => {
29
+ return shadow.split(', ').map(v => {
30
+ v = v.trim()
31
+ if (getColor(v).length > 2) return getColor(v)
32
+ if (v.includes('px') || v.slice(-2) === 'em') return v
32
33
  const arr = v.split(' ')
33
34
  if (!arr.length) return v
34
35
  return arr.map(v => getSpacingByKey(v, 'shadow').shadow).join(' ')
35
36
  }).join(' ')
36
- })
37
+ }).join(',')
37
38
 
38
39
  const transformBackgroundImage = (backgroundImage, ctx) => ({
39
40
  backgroundImage: backgroundImage.split(', ').map(v => {
@@ -86,7 +87,9 @@ export const Theme = {
86
87
  borderBottom: transformBorder(props.borderBottom)
87
88
  }),
88
89
 
89
- boxShadow: ({ props }) => props.boxShadow ? transformShadow(props.boxShadow) : null,
90
+ boxShadow: ({ props }) => props.boxShadow && ({
91
+ boxShadow: transformShadow(props.boxShadow)
92
+ }),
90
93
 
91
94
  opacity: ({ props }) => props.opacity && ({ opacity: props.opacity }),
92
95
  visibility: ({ props }) => props.visibility && ({ visibility: props.visibility })