smbls 0.9.3 → 0.9.4

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.3",
6
+ "version": "0.9.4",
7
7
  "repository": "https://github.com/symbo-ls/smbls",
8
8
  "main": "src/index.js",
9
9
  "files": [
package/src/Box.js CHANGED
@@ -4,7 +4,7 @@ import { Shape, Position, Theme, Block, Text, Overflow, Transition, Transform, R
4
4
 
5
5
  const PropsCSS = {
6
6
  class: {
7
- propsCSS: ({ props }) => props && props.css
7
+ style: ({ props }) => props && props.style
8
8
  }
9
9
  }
10
10
 
package/src/Button.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { IconText } from '.'
4
4
 
5
- const css = {
5
+ const style = {
6
6
  appearance: 'none',
7
7
  border: 'none',
8
8
  outline: 0,
@@ -14,13 +14,17 @@ export const Button = {
14
14
  proto: IconText,
15
15
  tag: 'button',
16
16
  props: {
17
+ fontSize: 'A',
17
18
  type: 'button',
18
19
  display: 'inline-flex',
19
20
  alignItems: 'center',
20
21
  justifyContent: 'center',
21
22
  textDecoration: 'none',
23
+ lineHeight: '1',
24
+ whiteSpace: 'nowrap',
25
+ padding: 'Z A1',
22
26
  round: 'C2',
23
- css
27
+ style
24
28
  },
25
29
  attr: {
26
30
  type: ({ props }) => props.type
@@ -36,7 +40,7 @@ export const SquareButton = {
36
40
  aspectRatio: '1 / 1',
37
41
  justifyContent: 'center',
38
42
  round: 'Z',
39
- css: { boxSizing: 'content-box' }
43
+ style: { boxSizing: 'content-box' }
40
44
  }
41
45
  }
42
46
 
@@ -47,7 +51,7 @@ export const CircleButton = {
47
51
 
48
52
  export const KangorooButton = {
49
53
  tag: 'button',
50
- props: { css },
54
+ props: { style },
51
55
 
52
56
  iconText: { proto: IconText },
53
57
  child: { proto: IconText }
package/src/Field.js CHANGED
@@ -15,7 +15,7 @@ export const Field = {
15
15
  position: 'relative',
16
16
  width: '16em',
17
17
 
18
- css: {
18
+ style: {
19
19
  appearance: 'none',
20
20
  outline: 0,
21
21
  border: 'none',
package/src/Icon.js CHANGED
@@ -20,7 +20,7 @@ export const Icon = {
20
20
  height: 'A',
21
21
  display: 'inline-block',
22
22
  src: iconFromLibrary,
23
- css: { fill: 'currentColor' }
23
+ style: { fill: 'currentColor' }
24
24
  }
25
25
  },
26
26
  attr: { viewBox: '0 0 24 24' }
package/src/SVG.js CHANGED
@@ -6,7 +6,7 @@ const useSVGSymbol = file => `<use xlink:href="${file}" />`
6
6
  export const SVG = {
7
7
  tag: 'svg',
8
8
  props: {
9
- css: { '*': { fill: 'currentColor' } }
9
+ style: { '*': { fill: 'currentColor' } }
10
10
  },
11
11
  attr: {
12
12
  xmlns: 'http://www.w3.org/2000/svg',
package/src/Select.js CHANGED
@@ -5,7 +5,7 @@ export const Select = {
5
5
 
6
6
  props: {
7
7
  fontSize: 'A',
8
- css: {
8
+ style: {
9
9
  border: 'none',
10
10
  boxSizing: 'border-box',
11
11
  cursor: 'pointer'
@@ -17,13 +17,13 @@ export const SHAPES = {
17
17
  bubble: {},
18
18
 
19
19
  tooltip: ({ props }) => ({
20
- position: 'relative',
20
+ position: props.position || 'relative',
21
21
  '&:before': {
22
22
  content: '""',
23
23
  display: 'block',
24
24
  width: '0px',
25
25
  height: '0px',
26
- border: `6px solid ${getColor(props.background) || (props.theme && getTheme(props.theme).backgroundColor)}`,
26
+ border: `6px solid ${getColor(props.background) || (props.theme && getTheme(props.theme).background)}`,
27
27
  position: 'absolute',
28
28
  borderRadius: '2px'
29
29
  }
package/src/Text.js CHANGED
@@ -14,6 +14,7 @@ export const Text = {
14
14
  // lineHeight: ({ props }) => props.lineHeight && mapBasedOnRatio(props, 'lineHeight', null, ''),
15
15
  textDecoration: ({ props }) => props.textDecoration && ({ textDecoration: props.textDecoration }),
16
16
  textTransform: ({ props }) => props.textTransform && ({ textTransform: props.textTransform }),
17
+ whiteSpace: ({ props }) => props.whiteSpace && ({ whiteSpace: props.whiteSpace }),
17
18
  textAlign: ({ props }) => props.textAlign && ({ textAlign: props.textAlign }),
18
19
  fontWeight: ({ props }) => props.fontWeight && ({ fontWeight: props.fontWeight })
19
20
  }
package/src/Transition.js CHANGED
@@ -1,8 +1,26 @@
1
1
  'use strict'
2
2
 
3
+ import { mapTiming } from '@symbo.ls/scratch'
4
+
5
+ const diffTransition = (transition, key = 'transition') => {
6
+ const arr = transition.split(' ')
7
+
8
+ if (!arr.length) return { transition: props.transition }
9
+
10
+ return {
11
+ transition: arr.map(v => {
12
+ if (v.length < 3 || v.includes('ms')) {
13
+ const mapWithSequence = mapTiming(v)
14
+ return mapWithSequence.duration
15
+ }
16
+ return v
17
+ }).join(' ')
18
+ }
19
+ }
20
+
3
21
  export const Transition = {
4
22
  class: {
5
- transition: ({ props }) => props.transition && ({ transition: props.transition }),
23
+ transition: ({ props }) => props.transition && diffTransition(props.transition),
6
24
  transitionProperty: ({ props }) => props.transitionProperty && ({
7
25
  transitionProperty: props.transitionProperty,
8
26
  willChange: props.transitionProperty