@symbo.ls/atoms 2.11.9 → 2.11.19

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.
Files changed (2) hide show
  1. package/Media.js +11 -3
  2. package/package.json +2 -2
package/Media.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
 
3
- import { merge, isArray } from '@domql/utils'
3
+ import { merge, isArray, overwriteShallow } from '@domql/utils'
4
4
  import { getSystemTheme } from './Theme'
5
5
 
6
6
  export const keySetters = {
@@ -89,7 +89,7 @@ const applyCaseProps = (key, props, result, element) => {
89
89
 
90
90
  const applyConditionalCaseProps = (key, props, result, element) => {
91
91
  const caseKey = key.slice(1)
92
- const isPropTrue = element.props[caseKey] || element.state[caseKey] === true
92
+ const isPropTrue = element.props[caseKey] || element.state[caseKey]
93
93
  if (!isPropTrue) return // remove classname if not here
94
94
  return merge(result, convertPropsToClass(props, result, element))
95
95
  }
@@ -116,11 +116,12 @@ const beforeClassAssign = (element, s) => {
116
116
  if (setter) setter(key, props[key], CLASS_NAMES, element)
117
117
  }
118
118
 
119
- merge(className, CLASS_NAMES)
119
+ overwriteShallow(className, CLASS_NAMES)
120
120
  }
121
121
 
122
122
  const initUpdate = (changes, element) => {
123
123
  const { props, context, class: className } = element
124
+ if (!context) return
124
125
  const globalTheme = context.designSystem.globalTheme
125
126
 
126
127
  const parentProps = element.parent.props
@@ -164,5 +165,12 @@ const initUpdate = (changes, element) => {
164
165
  }
165
166
 
166
167
  export const Media = {
168
+ class: {
169
+ case: (el, s) => {
170
+ return {
171
+ //
172
+ }
173
+ }
174
+ },
167
175
  on: { beforeClassAssign, initUpdate }
168
176
  }
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@symbo.ls/atoms",
3
- "version": "2.11.9",
3
+ "version": "2.11.19",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
- "gitHead": "4b3675a0ee95441998a2c3d064d67bff82cc8b8d",
6
+ "gitHead": "733340b09ba0357fa3f5b4f5aeae60ff70f4b04e",
7
7
  "dependencies": {
8
8
  "@domql/state": "latest",
9
9
  "@domql/utils": "latest",