@symbo.ls/atoms 2.10.257 → 2.10.259

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/Block.js CHANGED
@@ -4,9 +4,11 @@ import { getSpacingBasedOnRatio, getSpacingByKey, transfromGap } from '@symbo.ls
4
4
 
5
5
  export const Block = {
6
6
  class: {
7
- boxSizing: ({ props }) => props.boxSizing ? ({ boxSizing: props.boxSizing }) : {
8
- boxSizing: 'border-box'
9
- },
7
+ boxSizing: ({ props }) => props.boxSizing
8
+ ? ({ boxSizing: props.boxSizing })
9
+ : {
10
+ boxSizing: 'border-box'
11
+ },
10
12
 
11
13
  display: ({ props }) => props.display && ({ display: props.display }),
12
14
 
@@ -95,9 +97,11 @@ export const Block = {
95
97
  marginBlockStart: ({ props }) => props.marginBlockStart ? getSpacingBasedOnRatio(props, 'marginBlockStart') : null,
96
98
  marginBlockEnd: ({ props }) => props.marginBlockEnd ? getSpacingBasedOnRatio(props, 'marginBlockEnd') : null,
97
99
 
98
- gap: ({ props }) => props.gap ? ({
99
- gap: transfromGap(props.gap)
100
- }) : null,
100
+ gap: ({ props }) => props.gap
101
+ ? ({
102
+ gap: transfromGap(props.gap)
103
+ })
104
+ : null,
101
105
  gridArea: ({ props }) => props.gridArea && ({ gridArea: props.gridArea }),
102
106
 
103
107
  flex: ({ props }) => props.flex && ({ flex: props.flex }),
@@ -122,15 +126,17 @@ export const Block = {
122
126
  const [alignItems, justifyContent] = props.flexAlign.split(' ')
123
127
  return {
124
128
  display: 'flex',
125
- alignItems: alignItems,
126
- justifyContent: justifyContent
129
+ alignItems,
130
+ justifyContent
127
131
  }
128
132
  },
129
133
 
130
134
  gridColumn: ({ props }) => props.gridColumn && ({ gridColumn: props.gridColumn }),
131
- gridColumnStart: ({ props }) => props.columnStart ? ({
132
- gridColumnStart: props.columnStart
133
- }) : null,
135
+ gridColumnStart: ({ props }) => props.columnStart
136
+ ? ({
137
+ gridColumnStart: props.columnStart
138
+ })
139
+ : null,
134
140
  gridRow: ({ props }) => props.gridRow && ({ gridRow: props.gridRow }),
135
141
  gridRowStart: ({ props }) => props.rowStart ? ({ gridRowStart: props.rowStart }) : null,
136
142
 
@@ -152,8 +158,8 @@ export const Block = {
152
158
  }
153
159
 
154
160
  export const Span = { tag: 'span' }
155
- export const List = {
156
- tag: 'ul' ,
161
+ export const List = {
162
+ tag: 'ul',
157
163
  childExtend: { tag: 'li' }
158
164
  }
159
165
  // export const Article = { tag: 'article' }
package/Collection.js CHANGED
@@ -13,9 +13,11 @@ export const Collection = {
13
13
  for (const obj in param) { data.push(param[obj]) }
14
14
  }
15
15
 
16
- data = data.map(item => !isObjectLike(item) ? {
17
- props: { value: item }
18
- } : item)
16
+ data = data.map(item => !isObjectLike(item)
17
+ ? {
18
+ props: { value: item }
19
+ }
20
+ : item)
19
21
 
20
22
  if (data.length) {
21
23
  const t = setTimeout(() => {
package/Shape/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
 
3
- import { exec, isString, isFunction } from '@domql/utils'
3
+ import { exec, isString } from '@domql/utils'
4
4
  import { SHAPES } from './style'
5
5
  import { getSpacingBasedOnRatio, getMediaColor } from '@symbo.ls/scratch'
6
6
  import { Pseudo } from '../Pseudo'
package/Shape/style.js CHANGED
@@ -13,15 +13,15 @@ export const depth = {
13
13
  }
14
14
 
15
15
  const getComputedBackgroundColor = ({ props }) => {
16
- return getColor(props.shapeDirectionColor) ||
17
- getColor(props.borderColor) ||
18
- getColor(props.backgroundColor) ||
16
+ return getColor(props.shapeDirectionColor) ||
17
+ getColor(props.borderColor) ||
18
+ getColor(props.backgroundColor) ||
19
19
  getColor(props.background)
20
20
  }
21
21
 
22
22
  const inheritTransition = ({ props }) => {
23
23
  const exec = Timing.class.transition({ props })
24
- return exec && exec['transition']
24
+ return exec && exec.transition
25
25
  }
26
26
 
27
27
  export const SHAPES = {
@@ -39,7 +39,7 @@ export const SHAPES = {
39
39
  display: 'block',
40
40
  width: '0px',
41
41
  height: '0px',
42
- border: `.35em solid`,
42
+ border: '.35em solid',
43
43
  borderColor: getComputedBackgroundColor({ props }),
44
44
  transition: inheritTransition({ props }),
45
45
  transitionProperty: 'border-color',
@@ -128,7 +128,7 @@ export const SHAPES = {
128
128
  }
129
129
  },
130
130
 
131
- hexagon: el => ({
131
+ hexagon: ({ props }) => ({
132
132
  position: 'relative',
133
133
  '&:before, &:after': {
134
134
  content: '""',
@@ -154,7 +154,7 @@ export const SHAPES = {
154
154
  }
155
155
  }),
156
156
 
157
- chevron: el => ({
157
+ chevron: ({ props }) => ({
158
158
  position: 'relative',
159
159
  // overflow: 'hidden',
160
160
  '&:before, &:after': {
package/Theme.js CHANGED
@@ -4,7 +4,9 @@ import {
4
4
  getMediaTheme,
5
5
  getMediaColor,
6
6
  transformTextStroke,
7
- transformShadow
7
+ transformShadow,
8
+ transformBorder,
9
+ transformBackgroundImage
8
10
  } from '@symbo.ls/scratch'
9
11
 
10
12
  import { depth } from './Shape/style'
@@ -60,16 +62,22 @@ export const Theme = {
60
62
  backgroundSize: transformBackgroundImage(props.backgroundImage, globalTheme)
61
63
  })
62
64
  },
63
- backgroundSize: ({ props }) => props.backgroundSize ? ({
64
- backgroundSize: props.backgroundSize
65
- }) : null,
66
- backgroundPosition: ({ props }) => props.backgroundPosition ? ({
67
- backgroundPosition: props.backgroundPosition
68
- }) : null,
69
-
70
- textStroke: ({ props }) => props.textStroke ? ({
71
- WebkitTextStroke: transformTextStroke(props.textStroke)
72
- }) : null,
65
+ backgroundSize: ({ props }) => props.backgroundSize
66
+ ? ({
67
+ backgroundSize: props.backgroundSize
68
+ })
69
+ : null,
70
+ backgroundPosition: ({ props }) => props.backgroundPosition
71
+ ? ({
72
+ backgroundPosition: props.backgroundPosition
73
+ })
74
+ : null,
75
+
76
+ textStroke: ({ props }) => props.textStroke
77
+ ? ({
78
+ WebkitTextStroke: transformTextStroke(props.textStroke)
79
+ })
80
+ : null,
73
81
 
74
82
  outline: ({ props }) => props.outline && ({
75
83
  outline: transformBorder(props.outline)
package/Timing.js CHANGED
@@ -1,34 +1,10 @@
1
1
  'use strict'
2
2
 
3
- import { isString } from '@domql/utils'
4
- import { getTimingByKey, getTimingFunction } from '@symbo.ls/scratch'
5
-
6
- export const transformTransition = transition => {
7
- const arr = transition.split(' ')
8
-
9
- if (!arr.length) return transition
10
-
11
- return arr.map(v => {
12
- if (v.slice(0, 2) === '--') return `var(${v})`
13
- if (v.length < 3 || v.includes('ms')) {
14
- const mapWithSequence = getTimingByKey(v)
15
- return mapWithSequence.timing || v
16
- }
17
- if (getTimingFunction(v)) return getTimingFunction(v)
18
- return v
19
- }).join(' ')
20
- }
21
-
22
- export const transformDuration = (duration, props, propertyName) => {
23
- if (!isString(duration)) return
24
- return duration.split(',').map(v => getTimingByKey(v).timing || v).join(',')
25
- }
26
-
27
- export const splitTransition = transition => {
28
- const arr = transition.split(',')
29
- if (!arr.length) return
30
- return arr.map(transformTransition).join(',')
31
- }
3
+ import {
4
+ getTimingFunction,
5
+ splitTransition,
6
+ transformDuration
7
+ } from '@symbo.ls/scratch'
32
8
 
33
9
  export const Timing = {
34
10
  class: {
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@symbo.ls/atoms",
3
- "version": "2.10.257",
3
+ "version": "2.10.259",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
- "gitHead": "3c16c123fa0b6cf00a16e2178bbbfd1049d4c0cc",
6
+ "gitHead": "c454826279438617c85a5f8d8e7b3a6938d94dea",
7
7
  "dependencies": {
8
8
  "@domql/utils": "latest",
9
9
  "@symbo.ls/create-emotion": "latest",