@codeleap/styles 5.4.3 → 5.4.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": "5.4.3",
3
+ "version": "5.4.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": "5.4.3",
12
+ "@codeleap/config": "5.4.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": "5.4.3",
3
+ "version": "5.4.5",
4
4
  "main": "src/index.ts",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -22,14 +22,16 @@ export type Value =
22
22
  | number
23
23
  | ''
24
24
 
25
+ type Color = string // keyof IColors
26
+
25
27
  export type DynamicVariants =
26
- `color:${keyof IColors}` |
28
+ `color:${Color}` |
27
29
  `border${Capitalize<typeof borderDirection[number]>}Width:${keyof IBorderRadius}` |
28
- `border${Capitalize<typeof borderDirection[number]>}Color:${keyof IColors}` |
30
+ `border${Capitalize<typeof borderDirection[number]>}Color:${Color}` |
29
31
  `borderRadius:${keyof IBorderRadius}` |
30
32
  `border${Capitalize<typeof borderYDirection[number]>}${Capitalize<typeof borderXDirection[number]>}Radius:${keyof IBorderRadius}` |
31
33
  `cursor:${typeof cursorTypes[number]}` |
32
- `bg:${keyof IColors}` |
34
+ `bg:${Color}` |
33
35
  `br:${keyof IBorderRadius}` |
34
36
  `scale:${Value}`
35
37
 
@@ -41,7 +43,7 @@ export const createDynamicVariants = () => {
41
43
  }
42
44
 
43
45
  colorVariants.forEach(variant => {
44
- createVariant(variant, (theme, color: keyof IColors) => ({
46
+ createVariant(variant, (theme, color: Color) => ({
45
47
  [variant]: theme.baseColors[color],
46
48
  }))
47
49
  })
@@ -68,7 +70,7 @@ export const createDynamicVariants = () => {
68
70
 
69
71
  createVariant('cursor', (theme, cursor: typeof cursorTypes[number]) => ({ cursor }))
70
72
 
71
- createVariant('bg', (theme, color: keyof IColors) => ({
73
+ createVariant('bg', (theme, color: Color) => ({
72
74
  backgroundColor: theme.baseColors[color],
73
75
  }))
74
76
 
@@ -59,3 +59,5 @@ export type VariantStyleSheet = Record<string, any>
59
59
  export type StyledProp<T extends string> = StyleProp<Record<T, ICSS>>
60
60
 
61
61
  export type StyleAggregator<T extends string = any> = (theme: ITheme, style: Record< T, ICSS>) => Record< T, ICSS>
62
+
63
+ export type StyleRecord<K extends string> = Record<K, ICSS>