@symbo.ls/atoms 2.10.135 → 2.10.159

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/Animation.js CHANGED
@@ -7,7 +7,7 @@ const { keyframes } = emotion
7
7
 
8
8
  const applyAnimationProps = (animation, element) => {
9
9
  if (isObject(animation)) return { animationName: keyframes(animation) }
10
- const { ANIMATION } = element.context && element.context.system
10
+ const { ANIMATION } = element.context && element.context.designSystem
11
11
  const record = ANIMATION[animation]
12
12
  return keyframes(record)
13
13
  }
package/Media.js CHANGED
@@ -53,9 +53,9 @@ const convertPropsToClass = (props, result, element) => {
53
53
 
54
54
  const applyMediaProps = (key, props, result, element) => {
55
55
  const { context } = element
56
- if (!context.system || !context.system.MEDIA) return
56
+ if (!context.designSystem || !context.designSystem.MEDIA) return
57
57
  const globalTheme = getSystemTheme(element)
58
- const { MEDIA } = context.system
58
+ const { MEDIA } = context.designSystem
59
59
  const mediaName = MEDIA[key.slice(1)]
60
60
  const generatedClass = convertPropsToClass(props, result, element)
61
61
 
@@ -80,7 +80,7 @@ const applySelectorProps = (key, props, result, element) => {
80
80
  }
81
81
 
82
82
  const applyCaseProps = (key, props, result, element) => {
83
- const { CASES } = element.context && element.context.system
83
+ const { CASES } = element.context && element.context.designSystem
84
84
  const caseKey = key.slice(1)
85
85
  const isPropTrue = element.props[caseKey]
86
86
  if (!CASES[caseKey] && !isPropTrue) return
@@ -121,7 +121,7 @@ const beforeClassAssign = (element, s) => {
121
121
 
122
122
  export const initUpdate = element => {
123
123
  const { props, context, class: className } = element
124
- const globalTheme = context.system.globalTheme
124
+ const globalTheme = context.designSystem.globalTheme
125
125
 
126
126
  const parentProps = element.parent.props
127
127
  if (parentProps && parentProps.spacingRatio && parentProps.inheritSpacingRatio) {
package/Picture.js CHANGED
@@ -10,7 +10,7 @@ export const Picture = {
10
10
  attr: {
11
11
  media: element => {
12
12
  const { props, key, context } = element
13
- const { MEDIA } = context.system
13
+ const { MEDIA } = context.designSystem
14
14
  const globalTheme = getSystemTheme(element)
15
15
  const mediaName = (props.media || key).slice(1)
16
16
 
package/Svg.js CHANGED
@@ -13,9 +13,9 @@ export const Svg = {
13
13
  'xmlns:xlink': 'http://www.w3.org/1999/xlink'
14
14
  },
15
15
  html: ({ key, props, context, ...el }) => {
16
- const { system, packages } = context
17
- const SVG = system && system.SVG
18
- const useSvgSprite = props.spriteId || (context.system && context.system.useSvgSprite)
16
+ const { designSystem, packages } = context
17
+ const SVG = designSystem && designSystem.SVG
18
+ const useSvgSprite = props.spriteId || (context.designSystem && context.designSystem.useSvgSprite)
19
19
  const useSVGSymbol = icon => `<use xlink:href="#${icon}" />`
20
20
 
21
21
  const init = (packages && packages.init) || require('@symbo.ls/init').init
package/Theme.js CHANGED
@@ -43,17 +43,16 @@ const transformBackgroundImage = (backgroundImage, ctx, globalTheme) => ({
43
43
  backgroundImage: backgroundImage.split(', ').map(v => {
44
44
  if (v.slice(0, 2) === '--') return `var(${v})`
45
45
  if (v.includes('url') || v.includes('gradient')) return v
46
- else if (ctx.system.GRADIENT[backgroundImage]) {
46
+ else if (ctx.designSystem.GRADIENT[backgroundImage]) {
47
47
  return getMediaColor(backgroundImage, 'backgroundImage', globalTheme)
48
48
  }
49
49
  return `url(${v})`
50
50
  }).join(' ')
51
51
  })
52
52
 
53
- export const getSystemTheme = (element, state) => {
54
- const { context } = element
55
- const rootState = element.__root ? element.__root.state : element.state
56
- return rootState ? rootState.globalTheme : context.system && context.system.globalTheme
53
+ export const getSystemTheme = ({ context, state }) => {
54
+ const rootState = state && state.__root
55
+ return rootState ? rootState.globalTheme : context.designSystem && context.designSystem.globalTheme
57
56
  }
58
57
 
59
58
  export const Theme = {
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@symbo.ls/atoms",
3
- "version": "2.10.135",
3
+ "version": "2.10.159",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
- "gitHead": "babcdc69829c0cff99804ea15312b8ae564729d8",
6
+ "gitHead": "8c24c5b64a216cab5e7febeab7de3df9186f198a",
7
7
  "dependencies": {
8
8
  "@domql/utils": "latest",
9
9
  "@symbo.ls/create-emotion": "latest",