smbls 0.9.5 → 0.9.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 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.9.5",
6
+ "version": "0.9.8",
7
7
  "repository": "https://github.com/symbo-ls/smbls",
8
8
  "main": "src/index.js",
9
9
  "files": [
package/src/Button.js CHANGED
@@ -7,7 +7,7 @@ const style = {
7
7
  border: 'none',
8
8
  outline: 0,
9
9
  cursor: 'pointer',
10
- fontFamily: 'default'
10
+ fontFamily: 'inherit'
11
11
  }
12
12
 
13
13
  export const Button = {
@@ -23,6 +23,7 @@ export const Button = {
23
23
  lineHeight: '1',
24
24
  whiteSpace: 'nowrap',
25
25
  padding: 'Z A1',
26
+ fontFamily: 'inherit',
26
27
  round: 'C2',
27
28
  style
28
29
  },
package/src/Flex.js CHANGED
@@ -12,7 +12,7 @@ export const Flex = {
12
12
  flow: ({ props }) => props.flow && ({ flexFlow: props.flow }),
13
13
  flexDirection: ({ props }) => props.flexDirection && ({ flexDirection: props.flexDirection }),
14
14
  alignItems: ({ props }) => props.alignItems && ({ alignItems: props.alignItems }),
15
- wrap: ({ props }) => props.wrap && ({ wrap: props.wrap }),
15
+ wrap: ({ props }) => props.wrap && ({ flexWrap: props.wrap }),
16
16
  alignContent: ({ props }) => props.alignContent && ({ alignContent: props.alignContent }),
17
17
  justifyContent: ({ props }) => props.justifyContent && ({ justifyContent: props.justifyContent }),
18
18
  gap: ({ props }) => props.gap && mapBasedOnRatio(props, 'gap'),
package/src/Theme.js CHANGED
@@ -8,7 +8,7 @@ import { depth } from './Shape/style'
8
8
  const isBorderStyle = str =>
9
9
  ['none', 'hidden', 'dotted', 'dashed', 'solid', 'double', 'groove', 'ridge', 'inset', 'outset', 'initial'].some(v => str.includes(v))
10
10
 
11
- const diffBorder = (border, key = 'border') => {
11
+ const transformBorder = (border, key = 'border') => {
12
12
  const obj = {}
13
13
  const arr = isObject(border) ? Object.values(border) : isArray(border) ? border : border.split(', ')
14
14
  arr.map(v => {
@@ -19,21 +19,23 @@ const diffBorder = (border, key = 'border') => {
19
19
  return obj
20
20
  }
21
21
 
22
- const diffStroke = stroke => {
23
- const WebkitTextStroke = stroke.split(', ').map(v => {
22
+ const transformTextStroke = stroke => ({
23
+ WebkitTextStroke: stroke.split(', ').map(v => {
24
24
  if (v.includes('px')) return v
25
25
  else if (getColor(v)) return getColor(v)
26
26
  }).join(' ')
27
- return { WebkitTextStroke }
28
- }
27
+ })
29
28
 
30
- const diffShadow = stroke => {
31
- const boxShadow = stroke.split(', ').map(v => {
29
+ const transformShadow = shadow => ({
30
+ boxShadow: shadow.split(', ').map(v => {
31
+ if (v !== getColor(v)) return getColor(v)
32
32
  if (v.includes('px')) return v
33
- else if (getColor(v)) return getColor(v)
33
+
34
+ const arr = v.split(' ')
35
+ if (!arr.length) return v
36
+ return arr.map(v => mapSpacing(v, 'shadow').shadow ).join(' ')
34
37
  }).join(' ')
35
- return { boxShadow }
36
- }
38
+ })
37
39
 
38
40
  export const Theme = {
39
41
  class: {
@@ -49,18 +51,18 @@ export const Theme = {
49
51
  color: ({ props }) => props.color ? ({ color: getColor(props.color) }) : null,
50
52
  background: ({ props }) => props.background ? ({ backgroundColor: getColor(props.background) }) : null,
51
53
 
52
- textStroke: ({ props }) => props.textStroke ? diffStroke(props.textStroke) : null,
54
+ textStroke: ({ props }) => props.textStroke ? transformTextStroke(props.textStroke) : null,
53
55
 
54
- border: ({ props }) => props.border ? diffBorder(props.border) : null,
56
+ border: ({ props }) => props.border ? transformBorder(props.border) : null,
55
57
  borderColor: ({ props }) => props.borderColor ? ({ borderColor: getColor(props.borderColor) }) : null,
56
58
  borderStyle: ({ props }) => props.borderStyle && ({ borderStyle: props.borderStyle }),
57
59
 
58
- borderLeft: ({ props }) => props.borderLeft ? diffBorder(props.borderLeft, 'borderLeft') : null,
59
- borderTop: ({ props }) => props.borderTop ? diffBorder(props.borderTop, 'borderTop') : null,
60
- borderRight: ({ props }) => props.borderRight ? diffBorder(props.borderRight, 'borderRight') : null,
61
- borderBottom: ({ props }) => props.borderBottom ? diffBorder(props.borderBottom, 'borderBottom') : null,
60
+ borderLeft: ({ props }) => props.borderLeft ? transformBorder(props.borderLeft, 'borderLeft') : null,
61
+ borderTop: ({ props }) => props.borderTop ? transformBorder(props.borderTop, 'borderTop') : null,
62
+ borderRight: ({ props }) => props.borderRight ? transformBorder(props.borderRight, 'borderRight') : null,
63
+ borderBottom: ({ props }) => props.borderBottom ? transformBorder(props.borderBottom, 'borderBottom') : null,
62
64
 
63
- shadow: ({ props }) => props.shadow ? diffShadow(props.shadow) : null,
65
+ boxShadow: ({ props }) => props.boxShadow ? transformShadow(props.boxShadow) : null,
64
66
 
65
67
  opacity: ({ props }) => props.opacity && ({ opacity: props.opacity }),
66
68
  visibility: ({ props }) => props.visibility && ({ visibility: props.visibility })
package/src/Transition.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { mapTiming } from '@symbo.ls/scratch'
4
4
 
5
- const diffTransition = transition => {
5
+ const transformTransition = transition => {
6
6
  const arr = transition.split(' ')
7
7
 
8
8
  if (!arr.length) return transition
@@ -20,7 +20,7 @@ const splitTransition = transition => {
20
20
  const arr = transition.split(',')
21
21
  if (!arr.length) return
22
22
  return {
23
- transition: arr.map(diffTransition).join(',')
23
+ transition: arr.map(transformTransition).join(',')
24
24
  }
25
25
  }
26
26