smbls 0.14.6 → 0.14.7

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.6",
6
+ "version": "0.14.7",
7
7
  "repository": "https://github.com/symbo-ls/smbls",
8
8
  "main": "src/index.js",
9
9
  "files": [
package/src/Box.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
 
3
- import { Shape, Position, Theme, Block, Text, Overflow, Timing, Transform, Responsive, Interaction, XYZ } from '.'
3
+ import { Shape, Position, Theme, Block, Text, Overflow, Timing, Transform, Media, Interaction, XYZ } from './atoms'
4
4
 
5
5
  const PropsCSS = {
6
6
  class: {
@@ -9,5 +9,5 @@ const PropsCSS = {
9
9
  }
10
10
 
11
11
  export const Box = {
12
- extend: [Shape, Position, Theme, Block, Text, Overflow, Timing, Transform, Responsive, PropsCSS, Interaction, XYZ]
12
+ extend: [Shape, Position, Theme, Block, Text, Overflow, Timing, Transform, Media, PropsCSS, Interaction, XYZ]
13
13
  }
package/src/ButtonSet.js CHANGED
@@ -1,7 +1,6 @@
1
1
  'use strict'
2
2
 
3
- import { SquareButton } from './Button'
4
- import { Flex } from './Flex'
3
+ import { SquareButton, Flex } from './'
5
4
 
6
5
  export const ButtonSet = {
7
6
  tag: 'nav',
package/src/Icon.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
 
3
- import { SVG } from '.'
3
+ import { SVG } from './atoms'
4
4
 
5
5
  import { ICONS } from '@symbo.ls/scratch'
6
6
  import { camelize } from '@symbo.ls/utils'
package/src/Link.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict'
2
2
 
3
3
  import { exec } from '@domql/utils'
4
- import { Focusable } from './Interaction'
4
+ import { Focusable } from './atoms'
5
5
 
6
6
  export const Link = {
7
7
  extend: [Focusable],
@@ -6,8 +6,9 @@ export const Notification = {
6
6
  extend: Flex,
7
7
 
8
8
  props: {
9
+ theme: 'alert',
9
10
  padding: 'Z1 B Z1 A1',
10
- round: 'A',
11
+ round: 'A A A Y2',
11
12
  gap: 'X2',
12
13
  style: { cursor: 'pointer' },
13
14
 
package/src/Pills.js CHANGED
@@ -1,26 +1,25 @@
1
1
  'use strict'
2
2
 
3
+ import { Flex } from './'
4
+
3
5
  export const Pills = {
4
- style: {
6
+ extend: Flex,
7
+ props: (el, s) => ({
5
8
  display: 'flex',
6
- div: {
7
- width: '6px',
8
- height: '6px',
9
- background: 'white'
10
- },
11
- 'div:not(:last-child)': {
12
- marginRight: '10px'
13
- },
14
- 'div:first-child': { opacity: '.5' },
15
- 'div:nth-child(2)': { opacity: '.3' },
16
- 'div:nth-child(3)': { opacity: '.3' }
17
- },
18
- childExtend: {
19
- tag: 'div',
20
- props: {
21
- round: 42,
22
- theme: 'White'
9
+ gap: 'Y2',
10
+
11
+ childProps: {
12
+ background: 'gray6',
13
+ width: 'Y2',
14
+ height: 'Y2',
15
+ round: 'A',
16
+
17
+ '.active': {
18
+ background: 'gray9'
19
+ }
23
20
  }
24
- },
25
- ...[{}, {}, {}]
21
+ }),
22
+ childExtend: {
23
+ props: (el, s) => ({ active: parseInt(el.key) === s.active })
24
+ }
26
25
  }
package/src/Tooltip.js CHANGED
@@ -10,10 +10,10 @@ export const Tooltip = {
10
10
  flow: 'column',
11
11
  shape: 'tooltip',
12
12
  shapeDirection: 'top',
13
- padding: 'Z2',
14
- round: 'X2',
13
+ padding: 'Z1 A',
14
+ round: 'Y2',
15
15
  minWidth: 'D2',
16
- gap: 'X1',
16
+ gap: 'X',
17
17
 
18
18
  title: {
19
19
  color: 'gray12',
@@ -99,7 +99,6 @@ export const initUpdate = el => {
99
99
  className.MEDIA_FORCED_BY_STATE = props.theme
100
100
  }
101
101
  }
102
- // console.groupEnd(props.theme)
103
102
  }
104
103
 
105
104
  for (const screen in props) {
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -144,6 +144,6 @@ export const initUpdate = element => {
144
144
  className.case = CLASS_NAMES.case
145
145
  }
146
146
 
147
- export const Responsive = {
147
+ export const Media = {
148
148
  on: { beforeClassAssign, initUpdate }
149
149
  }
File without changes
@@ -10,7 +10,7 @@ export const Position = {
10
10
  inset: ({ props }) => {
11
11
  const { inset } = props
12
12
  if (typeof inset !== 'string') return
13
- return { inset: inset.split(' ').map(v => getSpacingByKey(v,'k').k).join(' ') }
13
+ return { inset: inset.split(' ').map(v => getSpacingByKey(v, 'k').k).join(' ') }
14
14
  },
15
15
 
16
16
  left: ({ props }) => getSpacingByKey(props.left, 'left'),
File without changes
File without changes
File without changes
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
 
3
- import { UNIT, getColor, getTheme } from '@symbo.ls/scratch'
3
+ import { UNIT, getColor, getTheme } from '@symbo.ls/scratch' // eslint-disable-line no-unused-vars
4
4
 
5
5
  export const depth = {
6
6
  4: { boxShadow: `rgba(0,0,0,.10) 0 2${UNIT.default} 4${UNIT.default}` },
@@ -11,20 +11,43 @@ export const depth = {
11
11
  42: { boxShadow: `rgba(0,0,0,.10) 0 20${UNIT.default} 42${UNIT.default}` }
12
12
  }
13
13
 
14
+ const getComputedBackgroundColor = el => {
15
+ const { props, node } = el
16
+ const propsColor = getColor(props.borderColor) || getColor(props.backgroundColor) || getColor(props.background)
17
+
18
+ if (!propsColor) {
19
+ 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)
29
+ return computedStyle.getPropertyValue('border-color') ||
30
+ computedStyle.getPropertyValue('background') ||
31
+ computedStyle.getPropertyValue('background-color')
32
+ }
33
+
34
+ return propsColor
35
+ }
36
+
14
37
  export const SHAPES = {
15
38
  rectangle: {},
16
39
  circle: { borderRadius: '100%' },
17
40
  bubble: {},
18
41
 
19
- tooltip: ({ props }) => ({
20
- position: props.position || 'relative',
42
+ tooltip: el => ({
43
+ position: el.props.position || 'relative',
21
44
  '&:before': {
22
45
  content: '""',
23
46
  display: 'block',
24
47
  width: '0px',
25
48
  height: '0px',
26
49
  border: `.35em solid`,
27
- borderColor: getColor(props.background) || getColor(props.backgroundColor),
50
+ borderColor: getComputedBackgroundColor(el),
28
51
  position: 'absolute',
29
52
  borderRadius: '.15em'
30
53
  }
@@ -61,14 +84,15 @@ export const SHAPES = {
61
84
  }
62
85
  },
63
86
 
64
- tag: ({ props }) => ({
87
+ tag: el => ({
65
88
  position: 'relative',
66
89
  '&:before': {
67
90
  content: '""',
68
91
  display: 'block',
69
92
  width: '0',
70
93
  height: '0',
71
- border: `16px solid ${getColor(props.background) || (props.theme && getTheme(props.theme).backgroundColor)}`,
94
+ border: `16px solid`,
95
+ borderColor: getComputedBackgroundColor(el),
72
96
  borderRadius: '6px',
73
97
  position: 'absolute'
74
98
  }
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,19 @@
1
+ 'use strict'
2
+
3
+ export * from './Block'
4
+ export * from './Direction'
5
+ export * from './Flex'
6
+ export * from './Grid'
7
+ export * from './Img'
8
+ export * from './Media'
9
+ export * from './Interaction'
10
+ export * from './Overflow'
11
+ export * from './Position'
12
+ export * from './Pseudo'
13
+ export * from './SVG'
14
+ export * from './Shape'
15
+ export * from './Theme'
16
+ export * from './Text'
17
+ export * from './Timing'
18
+ export * from './Transform'
19
+ export * from './XYZ'
package/src/index.js CHANGED
@@ -1,35 +1,13 @@
1
1
  'use strict'
2
2
 
3
- import './styles.js'
4
-
5
3
  export * from '@symbo.ls/init'
6
4
 
7
- export * from './styles'
8
-
9
5
  // atoms
10
- export * from './Text'
11
- export * from './Block'
12
- export * from './Shape'
13
- export * from './Theme'
14
- export * from './Flex'
15
- export * from './Grid'
16
- export * from './Pseudo'
17
- export * from './Direction'
18
- export * from './Position'
19
- export * from './Overflow'
20
- export * from './Transform'
21
- export * from './Timing'
22
-
23
- export * from './Media'
24
- export * from './Interaction'
25
- export * from './XYZ'
26
-
6
+ export * from './atoms'
27
7
  export * from './Box'
28
8
 
29
9
  // atoms
30
- export * from './SVG'
31
10
  export * from './Icon'
32
- export * from './Img'
33
11
  export * from './Link'
34
12
  export * from './IconText'
35
13
  export * from './Input'
package/src/styles.js CHANGED
@@ -3,5 +3,4 @@
3
3
  export const clickable = {
4
4
  cursor: 'pointer',
5
5
  userSelect: 'none'
6
- //
7
6
  }