@symbo.ls/atoms 2.10.168 → 2.10.187

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/Picture.js CHANGED
@@ -23,9 +23,9 @@ export const Picture = {
23
23
  }
24
24
  },
25
25
 
26
- // Img: ({ props }) => ({
27
- // width: 'inherit',
28
- // height: 'inherit',
29
- // src: props.src
30
- // })
26
+ Img: ({ props }) => ({
27
+ width: 'inherit',
28
+ height: 'inherit',
29
+ src: props.src
30
+ })
31
31
  }
package/Shape/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
 
3
- import { exec, isString } from '@domql/utils'
3
+ import { exec, isString, isFunction } from '@domql/utils'
4
4
  import { SHAPES } from './style'
5
5
  import { getSpacingBasedOnRatio, getMediaColor } from '@symbo.ls/scratch'
6
6
  import { Pseudo } from '../Pseudo'
@@ -16,10 +16,9 @@ export const Shape = {
16
16
  extend: Pseudo,
17
17
 
18
18
  class: {
19
- shape: (element) => {
20
- const { props } = element
19
+ shape: ({ props }) => {
21
20
  const { shape } = props
22
- return shape ? exec(SHAPES[shape], element) : null
21
+ return SHAPES[shape]({ props })
23
22
  },
24
23
  shapeDirection: ({ props }) => {
25
24
  const { shape, shapeDirection } = props
@@ -27,8 +26,7 @@ export const Shape = {
27
26
  const shapeDir = SHAPES[shape + 'Direction']
28
27
  return shape && shapeDir ? shapeDir[shapeDirection || 'left'] : null
29
28
  },
30
- shapeDirectionColor: el => {
31
- const { props } = el
29
+ shapeDirectionColor: ({ props }) => {
32
30
  const { background, backgroundColor } = props
33
31
  const borderColor = getMediaColor(background || backgroundColor, 'borderColor')
34
32
  return props.shapeDirection ? borderColor : null
package/Shape/style.js CHANGED
@@ -16,8 +16,8 @@ const getComputedBackgroundColor = ({ props }) => {
16
16
  return getColor(props.borderColor) || getColor(props.backgroundColor) || getColor(props.background)
17
17
  }
18
18
 
19
- const inheritTransition = (el) => {
20
- const exec = Timing.class.transition(el)
19
+ const inheritTransition = ({ props }) => {
20
+ const exec = Timing.class.transition({ props })
21
21
  return exec && exec['transition']
22
22
  }
23
23
 
@@ -29,16 +29,16 @@ export const SHAPES = {
29
29
  borderRadius: '1.15em/2.5em'
30
30
  },
31
31
 
32
- tooltip: el => ({
33
- position: el.props.position || 'relative',
32
+ tooltip: ({ props }) => ({
33
+ position: props.position || 'relative',
34
34
  '&:before': {
35
35
  content: '""',
36
36
  display: 'block',
37
37
  width: '0px',
38
38
  height: '0px',
39
39
  border: `.35em solid`,
40
- borderColor: getComputedBackgroundColor(el),
41
- transition: inheritTransition(el),
40
+ borderColor: getComputedBackgroundColor({ props }),
41
+ transition: inheritTransition({ props }),
42
42
  transitionProperty: 'border-color',
43
43
  position: 'absolute',
44
44
  borderRadius: '.15em'
@@ -76,13 +76,13 @@ export const SHAPES = {
76
76
  }
77
77
  },
78
78
 
79
- tag: el => ({
79
+ tag: ({ props }) => ({
80
80
  position: 'relative',
81
81
  '&:before': {
82
82
  content: '""',
83
83
  display: 'block',
84
- background: getComputedBackgroundColor(el),
85
- transition: inheritTransition(el),
84
+ background: getComputedBackgroundColor({ props }),
85
+ transition: inheritTransition({ props }),
86
86
  transitionProperty: 'background',
87
87
  borderRadius: '.25em',
88
88
  position: 'absolute',
@@ -137,8 +137,8 @@ export const SHAPES = {
137
137
  top: '50%',
138
138
  transformOrigin: '50% 50%',
139
139
  height: '73%',
140
- background: getComputedBackgroundColor(el),
141
- transition: inheritTransition(el),
140
+ background: getComputedBackgroundColor({ props }),
141
+ transition: inheritTransition({ props }),
142
142
  transitionProperty: 'background'
143
143
  },
144
144
  '&:before': {
@@ -162,15 +162,15 @@ export const SHAPES = {
162
162
  aspectRatio: '1/1',
163
163
  top: '50%',
164
164
  transformOrigin: '50% 50%',
165
- transition: inheritTransition(el),
165
+ transition: inheritTransition({ props }),
166
166
  transitionProperty: 'background'
167
167
 
168
168
  },
169
169
  '&:before': {
170
- background: `linear-gradient(225deg, ${getComputedBackgroundColor(el)} 25%, transparent 25%), linear-gradient(315deg, ${getComputedBackgroundColor(el)} 25%, transparent 25%)`
170
+ background: `linear-gradient(225deg, ${getComputedBackgroundColor({ props })} 25%, transparent 25%), linear-gradient(315deg, ${getComputedBackgroundColor({ props })} 25%, transparent 25%)`
171
171
  },
172
172
  '&:after': {
173
- background: getComputedBackgroundColor(el),
173
+ background: getComputedBackgroundColor({ props }),
174
174
  borderRadius: '.25em'
175
175
  }
176
176
  }),
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@symbo.ls/atoms",
3
- "version": "2.10.168",
3
+ "version": "2.10.187",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
- "gitHead": "c9937422aa846691fa6187c7a3975c313114617a",
6
+ "gitHead": "00efdf24ddc738cbc544b0df43e5ee0b90d2b9c7",
7
7
  "dependencies": {
8
8
  "@domql/utils": "latest",
9
9
  "@symbo.ls/create-emotion": "latest",