@domql/emotion 2.5.84 → 2.5.134

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/index.js +7 -3
  2. package/package.json +3 -4
package/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict'
2
2
 
3
3
  // import DOM from '../../src'
4
- import { isObjectLike, exec, isObject, isEqualDeep, isProduction } from '@domql/utils'
4
+ import { isObjectLike, isString, isNumber, isBoolean, exec, isObject, isEqualDeep, isProduction } from '@domql/utils'
5
5
  import { applyClassListOnNode } from '@domql/classlist'
6
6
  import createEmotion from '@emotion/css/create-instance'
7
7
 
@@ -38,11 +38,15 @@ export const transformEmotionClass = (emotion) => {
38
38
  const isEqual = isEqualDeep(__class[key], prop)
39
39
  if (!isEqual) {
40
40
  if (!isProduction() && isObject(prop)) prop.label = key || element.key
41
- const CSSed = emotion.css(prop)
41
+ let className
42
+ if (isString(prop) || isNumber(prop)) className = prop
43
+ else if (isBoolean(prop)) className = element.key
44
+ else className = emotion.css(prop)
42
45
  __class[key] = prop
43
- __classNames[key] = CSSed
46
+ __classNames[key] = className
44
47
  }
45
48
  }
49
+
46
50
  applyClassListOnNode(__classNames, element, element.node)
47
51
  // return element.class
48
52
  }
package/package.json CHANGED
@@ -1,16 +1,15 @@
1
1
  {
2
2
  "name": "@domql/emotion",
3
- "version": "2.5.84",
3
+ "version": "2.5.134",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {
7
7
  "@domql/classlist": "latest",
8
- "@domql/env": "latest",
9
- "@domql/utils": "latest"
8
+ "@domql/utils": "^2.5.134"
10
9
  },
11
10
  "peerDependencies": {
12
11
  "@emotion/css": "*"
13
12
  },
14
- "gitHead": "4bd66069a10c9126fca5f29ca9c1f99e8b957228",
13
+ "gitHead": "20e65426dc742448bd6dc85211dea3a48ed74ae0",
15
14
  "source": "index.js"
16
15
  }