@codeleap/styles 4.3.3 → 4.3.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codeleap/styles",
3
- "version": "4.3.3",
3
+ "version": "4.3.5",
4
4
  "main": "src/index.ts",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -9,7 +9,7 @@
9
9
  "directory": "packages/styles"
10
10
  },
11
11
  "devDependencies": {
12
- "@codeleap/config": "4.3.3",
12
+ "@codeleap/config": "4.3.5",
13
13
  "ts-node-dev": "1.1.8"
14
14
  },
15
15
  "scripts": {
package/package.json.bak CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codeleap/styles",
3
- "version": "4.3.3",
3
+ "version": "4.3.5",
4
4
  "main": "src/index.ts",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -1,5 +1,4 @@
1
- import { IColors, ICSS } from '../types'
2
- import { StyleConstants } from './constants'
1
+ import { AppTheme, IColors, ICSS, Theme } from '../types'
3
2
  import { borderDirection } from './dynamicVariants'
4
3
  import { themeStore } from './themeStore'
5
4
  import { capitalize } from './utils'
@@ -22,22 +21,18 @@ export const borderCreator: BorderCreator = (args) => {
22
21
  directions = ['left', 'top', 'bottom', 'right'],
23
22
  } = args
24
23
 
25
- const theme = themeStore.getState().current
24
+ const theme = themeStore.getState().current as AppTheme<Theme>
26
25
 
27
- // @ts-expect-error
28
26
  const color = theme?.colors?.[colorKey] ?? colorKey
29
27
 
30
- const borderStyles: ICSS = {}
28
+ let borderStyles: ICSS = {}
31
29
 
32
30
  for (const direction of directions) {
33
31
  const property = `border${capitalize(direction)}`
34
32
 
35
33
  borderStyles[`${property}Color`] = color
36
34
  borderStyles[`${property}Width`] = width
37
-
38
- if (StyleConstants.IS_BROWSER) {
39
- borderStyles[`${property}Style`] = style
40
- }
35
+ if (theme?.isBrowser) borderStyles[`${property}Style`] = style
41
36
  }
42
37
 
43
38
  return borderStyles
@@ -50,6 +50,7 @@ export type Theme = {
50
50
  typography: AnyMap
51
51
  icons: AnyMap
52
52
  values?: AnyMap
53
+ isBrowser?: boolean
53
54
  }
54
55
 
55
56
  export type DefaultColorSchemeName = 'default'