react-native-unistyles 3.0.0-alpha.27 → 3.0.0-alpha.29
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +7 -0
- package/android/CMakeLists.txt +12 -21
- package/cxx/core/UnistylesMountHook.cpp +0 -10
- package/cxx/core/UnistylesMountHook.h +3 -8
- package/cxx/core/UnistylesRegistry.cpp +4 -8
- package/cxx/core/UnistylesRegistry.h +1 -1
- package/cxx/core/UnistylesState.cpp +2 -10
- package/cxx/core/UnistylesState.h +1 -1
- package/cxx/hybridObjects/HybridStyleSheet.cpp +67 -34
- package/cxx/hybridObjects/HybridStyleSheet.h +9 -1
- package/cxx/hybridObjects/HybridUnistylesRuntime.cpp +15 -7
- package/cxx/hybridObjects/HybridUnistylesRuntime.h +5 -1
- package/cxx/parser/Parser.cpp +73 -5
- package/cxx/parser/Parser.h +2 -0
- package/ios/NativePlatform+ios.swift +16 -5
- package/ios/NativePlatform+keyboard.swift +83 -0
- package/ios/NativePlatformListener+ios.swift +19 -6
- package/ios/UnistylesModuleOnLoad.h +3 -1
- package/ios/UnistylesModuleOnLoad.mm +11 -1
- package/lib/commonjs/specs/NativePlatform/NativePlatform.nitro.js +1 -0
- package/lib/commonjs/specs/NativePlatform/NativePlatform.nitro.js.map +1 -1
- package/lib/commonjs/specs/ShadowRegistry/ShadowRegistry.nitro.js.map +1 -1
- package/lib/commonjs/specs/ShadowRegistry/types.js +3 -0
- package/lib/commonjs/specs/ShadowRegistry/types.js.map +1 -1
- package/lib/commonjs/specs/StatusBar/UnistylesStatusBar.nitro.js.map +1 -1
- package/lib/commonjs/specs/StyleSheet/UnistylesStyleSheet.nitro.js +2 -4
- package/lib/commonjs/specs/StyleSheet/UnistylesStyleSheet.nitro.js.map +1 -1
- package/lib/commonjs/specs/TurboUnistyles/NativeTurboUnistyles.js +1 -3
- package/lib/commonjs/specs/TurboUnistyles/NativeTurboUnistyles.js.map +2 -1
- package/lib/commonjs/specs/TurboUnistyles/index.js.map +1 -1
- package/lib/commonjs/specs/UnistylesRuntime/index.js.map +2 -1
- package/lib/commonjs/specs/index.web.js.map +2 -1
- package/lib/commonjs/specs/types.js +10 -10
- package/lib/commonjs/specs/types.js.map +1 -1
- package/lib/commonjs/types/stylesheet.js.map +1 -1
- package/lib/commonjs/web/create.js +1 -4
- package/lib/commonjs/web/create.js.map +1 -1
- package/lib/commonjs/web/registry.js +1 -4
- package/lib/commonjs/web/registry.js.map +1 -1
- package/lib/commonjs/web/runtime.js.map +1 -1
- package/lib/commonjs/web/shadowRegistry.js +1 -4
- package/lib/commonjs/web/shadowRegistry.js.map +1 -1
- package/lib/commonjs/web/state.js.map +1 -1
- package/lib/commonjs/web/utils/unistyle.js.map +1 -1
- package/lib/module/specs/NativePlatform/NativePlatform.nitro.js +1 -0
- package/lib/module/specs/NativePlatform/NativePlatform.nitro.js.map +2 -1
- package/lib/module/specs/NavigtionBar/UnistylesNavigationBar.nitro.js.map +1 -1
- package/lib/module/specs/ShadowRegistry/ShadowRegistry.nitro.js.map +1 -0
- package/lib/module/specs/ShadowRegistry/types.js +2 -0
- package/lib/module/specs/ShadowRegistry/types.js.map +1 -1
- package/lib/module/specs/StatusBar/UnistylesStatusBar.nitro.js.map +1 -0
- package/lib/module/specs/StyleSheet/UnistylesStyleSheet.nitro.js +1 -1
- package/lib/module/specs/StyleSheet/UnistylesStyleSheet.nitro.js.map +1 -0
- package/lib/module/specs/TurboUnistyles/NativeTurboUnistyles.js +2 -3
- package/lib/module/specs/UnistylesRuntime/UnistylesRuntime.nitro.js.map +1 -1
- package/lib/module/specs/index.js.map +2 -1
- package/lib/module/specs/index.web.js.map +2 -1
- package/lib/module/specs/types.js +10 -10
- package/lib/module/specs/types.js.map +1 -0
- package/lib/module/types/stylesheet.js.map +1 -1
- package/lib/module/web/create.js +2 -5
- package/lib/module/web/create.js.map +1 -1
- package/lib/module/web/registry.js +2 -5
- package/lib/module/web/registry.js.map +1 -1
- package/lib/module/web/runtime.js.map +1 -1
- package/lib/module/web/shadowRegistry.js +2 -5
- package/lib/module/web/shadowRegistry.js.map +1 -1
- package/lib/module/web/state.js.map +1 -1
- package/lib/module/web/utils/unistyle.js.map +1 -1
- package/lib/typescript/src/global.d.ts +0 -2
- package/lib/typescript/src/global.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativePlatform/NativePlatform.nitro.d.ts +4 -1
- package/lib/typescript/src/specs/NativePlatform/NativePlatform.nitro.d.ts.map +1 -1
- package/lib/typescript/src/types/breakpoints.d.ts +11 -11
- package/lib/typescript/src/types/breakpoints.d.ts.map +1 -1
- package/lib/typescript/src/types/stylesheet.d.ts +4 -2
- package/lib/typescript/src/types/stylesheet.d.ts.map +1 -1
- package/lib/typescript/src/web/create.d.ts +204 -0
- package/lib/typescript/src/web/create.d.ts.map +1 -1
- package/lib/typescript/src/web/index.d.ts +204 -0
- package/lib/typescript/src/web/index.d.ts.map +1 -1
- package/lib/typescript/src/web/registry.d.ts.map +1 -1
- package/lib/typescript/src/web/runtime.d.ts +3 -3
- package/lib/typescript/src/web/runtime.d.ts.map +1 -1
- package/lib/typescript/src/web/shadowRegistry.d.ts.map +1 -1
- package/lib/typescript/src/web/state.d.ts +1 -1
- package/lib/typescript/src/web/state.d.ts.map +1 -1
- package/lib/typescript/src/web/utils/unistyle.d.ts +2 -2
- package/lib/typescript/src/web/utils/unistyle.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JFunc_void.hpp +48 -0
- package/nitrogen/generated/android/c++/JHybridNativePlatformSpec.cpp +9 -0
- package/nitrogen/generated/android/c++/JHybridNativePlatformSpec.hpp +2 -0
- package/nitrogen/generated/android/c++/JUnistyleDependency.hpp +3 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Func_void.kt +45 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/HybridNativePlatformSpec.kt +15 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/UnistyleDependency.kt +2 -1
- package/nitrogen/generated/android/unistylesOnLoad.cpp +2 -0
- package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Bridge.hpp +29 -1
- package/nitrogen/generated/ios/c++/HybridNativePlatformSpecSwift.hpp +6 -0
- package/nitrogen/generated/ios/swift/HybridNativePlatformSpec.swift +2 -0
- package/nitrogen/generated/ios/swift/HybridNativePlatformSpecCxx.swift +27 -0
- package/nitrogen/generated/ios/swift/UnistyleDependency.swift +4 -0
- package/nitrogen/generated/shared/c++/HybridNativePlatformSpec.cpp +2 -0
- package/nitrogen/generated/shared/c++/HybridNativePlatformSpec.hpp +2 -0
- package/nitrogen/generated/shared/c++/UnistyleDependency.hpp +2 -1
- package/package.json +13 -13
- package/plugin/common.js +9 -0
- package/plugin/stylesheet.js +7 -1
- package/src/global.ts +1 -4
- package/src/specs/NativePlatform/NativePlatform.nitro.js +18 -0
- package/src/specs/NativePlatform/NativePlatform.nitro.ts +5 -2
- package/src/specs/NativePlatform/index.js +1 -0
- package/src/specs/NavigtionBar/UnistylesNavigationBar.nitro.js +1 -0
- package/src/specs/NavigtionBar/index.js +9 -0
- package/src/specs/ShadowRegistry/ShadowRegistry.nitro.js +1 -0
- package/src/specs/ShadowRegistry/index.js +26 -0
- package/src/specs/ShadowRegistry/types.js +1 -0
- package/src/specs/StatusBar/UnistylesStatusBar.nitro.js +1 -0
- package/src/specs/StatusBar/index.js +25 -0
- package/src/specs/StyleSheet/UnistylesStyleSheet.nitro.js +1 -0
- package/src/specs/StyleSheet/index.js +13 -0
- package/src/specs/TurboUnistyles/NativeTurboUnistyles.js +2 -0
- package/src/specs/TurboUnistyles/index.js +1 -0
- package/src/specs/UnistylesRuntime/UnistylesRuntime.nitro.js +1 -0
- package/src/specs/UnistylesRuntime/index.js +20 -0
- package/src/specs/index.js +8 -0
- package/src/specs/index.web.js +2 -0
- package/src/specs/types.js +17 -0
- package/src/types/breakpoints.ts +25 -13
- package/src/types/stylesheet.ts +5 -3
- package/src/web/create.ts +2 -5
- package/src/web/registry.ts +2 -5
- package/src/web/runtime.ts +1 -1
- package/src/web/shadowRegistry.ts +2 -5
- package/src/web/state.ts +3 -3
- package/src/web/utils/unistyle.ts +2 -2
@@ -0,0 +1,17 @@
|
|
1
|
+
export var ColorScheme;
|
2
|
+
(function (ColorScheme) {
|
3
|
+
ColorScheme["Light"] = "light";
|
4
|
+
ColorScheme["Dark"] = "dark";
|
5
|
+
ColorScheme["Unspecified"] = "unspecified";
|
6
|
+
})(ColorScheme || (ColorScheme = {}));
|
7
|
+
export var Orientation;
|
8
|
+
(function (Orientation) {
|
9
|
+
Orientation["Portrait"] = "portrait";
|
10
|
+
Orientation["Landscape"] = "landscape";
|
11
|
+
})(Orientation || (Orientation = {}));
|
12
|
+
export var StatusBarStyle;
|
13
|
+
(function (StatusBarStyle) {
|
14
|
+
StatusBarStyle["Default"] = "default";
|
15
|
+
StatusBarStyle["Light"] = "light";
|
16
|
+
StatusBarStyle["Dark"] = "dark";
|
17
|
+
})(StatusBarStyle || (StatusBarStyle = {}));
|
package/src/types/breakpoints.ts
CHANGED
@@ -17,45 +17,57 @@ type ExtractBreakpoints<T> = T extends object
|
|
17
17
|
}
|
18
18
|
: T
|
19
19
|
|
20
|
-
type ParseNestedObject<T> = T extends (...args: infer A) => infer R
|
21
|
-
? (...args: A) => ParseNestedObject<R>
|
20
|
+
type ParseNestedObject<T, ShouldFlatten> = T extends (...args: infer A) => infer R
|
21
|
+
? (...args: A) => ParseNestedObject<R, false>
|
22
22
|
: T extends object
|
23
23
|
? T extends { variants: infer R, compoundVariants: infer C }
|
24
|
-
|
24
|
+
// // if intersection of Base, Variants and Compound Variants is never, then flatten variants and compound variants to generic "string"
|
25
|
+
? (ParseVariants<FlattenVariants<R, false>> & FlattenCompoundVariants<C, false> & ParseNestedObject<Omit<T, 'variants' | 'compoundVariants'>, false>) extends never
|
26
|
+
? ParseVariants<FlattenVariants<R, true>> & FlattenCompoundVariants<C, true> & ParseNestedObject<Omit<T, 'variants' | 'compoundVariants'>, false>
|
27
|
+
: ParseVariants<FlattenVariants<R, false>> & FlattenCompoundVariants<C, false> & ParseNestedObject<Omit<T, 'variants' | 'compoundVariants'>, false>
|
25
28
|
: T extends { variants: infer R }
|
26
|
-
|
29
|
+
// if intersection of Base and Variants is never, then flatten variants to generic "string"
|
30
|
+
? (ParseVariants<FlattenVariants<R, false>> & ParseNestedObject<Omit<T, 'variants'>, false>) extends never
|
31
|
+
? ParseVariants<FlattenVariants<R, true>> & ParseNestedObject<Omit<T, 'variants'>, false>
|
32
|
+
: ParseVariants<FlattenVariants<R, false>> & ParseNestedObject<Omit<T, 'variants'>, false>
|
27
33
|
: T extends { compoundVariants: object }
|
28
|
-
? ParseNestedObject<Omit<T, 'compoundVariants'
|
34
|
+
? ParseNestedObject<Omit<T, 'compoundVariants'>, false>
|
29
35
|
: {
|
30
36
|
[K in keyof T as K extends '_web' ? never : K]: T[K] extends object
|
31
37
|
? T[K] extends OpaqueColorValue
|
32
38
|
? ColorValue
|
33
39
|
: ExtractBreakpoints<T[K]>
|
34
|
-
: T[K]
|
40
|
+
: T[K] extends string
|
41
|
+
? ShouldFlatten extends true
|
42
|
+
? string
|
43
|
+
: T[K]
|
44
|
+
: T[K]
|
35
45
|
}
|
36
46
|
: T
|
37
47
|
|
38
|
-
type FlattenVariants<T> = T extends object
|
48
|
+
type FlattenVariants<T, ShouldFlatten> = T extends object
|
39
49
|
? {
|
40
50
|
[K in keyof T]: T[K] extends object
|
41
51
|
? {
|
42
52
|
[key in keyof T[K]]: T[K][key] extends object
|
43
|
-
? ParseNestedObject<T[K][key]>
|
53
|
+
? ParseNestedObject<T[K][key], ShouldFlatten>
|
44
54
|
: never
|
45
55
|
}
|
46
56
|
: never
|
47
57
|
}
|
48
58
|
: never
|
49
59
|
|
50
|
-
type FlattenCompoundVariants<T> = T extends Array<infer _>
|
51
|
-
? FlattenCompoundVariants<T[number]>
|
60
|
+
type FlattenCompoundVariants<T, ShouldFlatten> = T extends Array<infer _>
|
61
|
+
? FlattenCompoundVariants<T[number], ShouldFlatten>
|
52
62
|
: T extends { styles: infer S }
|
53
|
-
? ParseNestedObject<S>
|
63
|
+
? ParseNestedObject<S, ShouldFlatten>
|
54
64
|
: never
|
55
65
|
|
56
66
|
type ParseVariants<T> = T extends object
|
57
67
|
? T[keyof T] extends object
|
58
|
-
? UnionToIntersection<ParseVariants<T[keyof T]>>
|
68
|
+
? UnionToIntersection<ParseVariants<T[keyof T]>> extends never
|
69
|
+
? ParseVariants<T[keyof T]>
|
70
|
+
: UnionToIntersection<ParseVariants<T[keyof T]>>
|
59
71
|
: T
|
60
72
|
: T
|
61
73
|
|
@@ -63,7 +75,7 @@ type UnionToIntersection<U> =
|
|
63
75
|
(U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never
|
64
76
|
|
65
77
|
type ParseStyleKeys<T> = T extends object
|
66
|
-
? { [K in keyof T]: ParseNestedObject<T[K]> }
|
78
|
+
? { [K in keyof T]: ParseNestedObject<T[K], false> }
|
67
79
|
: never
|
68
80
|
|
69
81
|
export type ReactNativeStyleSheet<T> = ParseStyleKeys<SafeReturnType<T>>
|
package/src/types/stylesheet.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { ImageStyle, TextStyle, ViewStyle } from 'react-native'
|
1
|
+
import type { BoxShadowValue, ImageStyle, TextStyle, ViewStyle, FilterFunction } from 'react-native'
|
2
2
|
import type { ShadowOffset, TransformStyles, UnistylesTheme } from './core'
|
3
3
|
import type { UnistylesBreakpoints } from '../global'
|
4
4
|
import type { UnistylesMiniRuntime } from '../specs'
|
@@ -8,7 +8,7 @@ import type { CSSProperties } from 'react'
|
|
8
8
|
import type { Pseudo } from '../web/convert/pseudo'
|
9
9
|
|
10
10
|
// these props are treated differently to nest breakpoints and media queries
|
11
|
-
type NestedKeys = 'shadowOffset' | 'transform' | 'textShadowOffset'
|
11
|
+
type NestedKeys = 'shadowOffset' | 'transform' | 'textShadowOffset' | 'boxShadow' | 'filter'
|
12
12
|
|
13
13
|
export type UnistyleView = Omit<ViewStyle, NestedKeys>
|
14
14
|
export type UnistyleText = Omit<TextStyle, NestedKeys>
|
@@ -17,7 +17,9 @@ export type UnistyleImage = Omit<ImageStyle, NestedKeys>
|
|
17
17
|
type UnistyleNestedStyles = {
|
18
18
|
shadowOffset?: ToDeepUnistyles<ShadowOffset>,
|
19
19
|
textShadowOffset?: ToDeepUnistyles<ShadowOffset>,
|
20
|
-
transform?: Array<ToDeepUnistyles<TransformStyles
|
20
|
+
transform?: Array<ToDeepUnistyles<TransformStyles>>,
|
21
|
+
boxShadow?: Array<ToDeepUnistyles<BoxShadowValue>> | string,
|
22
|
+
filter?: Array<ToDeepUnistyles<FilterFunction>> | string
|
21
23
|
}
|
22
24
|
|
23
25
|
type VariantsObject = {
|
package/src/web/create.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { ReactNativeStyleSheet } from '../types'
|
2
2
|
import type { StyleSheetWithSuperPowers, StyleSheet } from '../types/stylesheet'
|
3
|
-
import { assignSecrets, reduceObject, getStyles } from './utils'
|
3
|
+
import { assignSecrets, reduceObject, getStyles, deepMergeObjects } from './utils'
|
4
4
|
import { UnistylesRuntime } from './runtime'
|
5
5
|
import { createUseVariants, getVariants } from './variants'
|
6
6
|
|
@@ -26,10 +26,7 @@ export const create = (stylesheet: StyleSheetWithSuperPowers<StyleSheet>) => {
|
|
26
26
|
const dynamicStyle = (...args: Array<any>) => {
|
27
27
|
const result = value(...args)
|
28
28
|
const variants = Object.fromEntries(getVariants({ [key]: result } as ReactNativeStyleSheet<StyleSheet>, copyVariants()))
|
29
|
-
const resultWithVariants = {
|
30
|
-
...result,
|
31
|
-
...variants[key]
|
32
|
-
}
|
29
|
+
const resultWithVariants = deepMergeObjects(result, variants[key] ?? {})
|
33
30
|
|
34
31
|
// Add secrets to result of dynamic styles function
|
35
32
|
return addSecrets(getStyles(resultWithVariants), key, args)
|
package/src/web/registry.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import type { UnistylesTheme, UnistylesValues } from '../types'
|
2
2
|
import type { StyleSheet, StyleSheetWithSuperPowers } from '../types/stylesheet'
|
3
3
|
import { UnistylesRuntime } from './runtime'
|
4
|
-
import { extractMediaQueryValue, keyInObject, getMediaQuery, generateHash, extractUnistyleDependencies } from './utils'
|
4
|
+
import { extractMediaQueryValue, keyInObject, getMediaQuery, generateHash, extractUnistyleDependencies, deepMergeObjects } from './utils'
|
5
5
|
import { UnistylesListener } from './listener'
|
6
6
|
import { convertUnistyles } from './convert'
|
7
7
|
import type { UnistyleDependency } from '../specs/NativePlatform'
|
@@ -107,10 +107,7 @@ class UnistylesRegistryBuilder {
|
|
107
107
|
? newValue(...args)
|
108
108
|
: newValue
|
109
109
|
const { variantsResult } = Object.fromEntries(getVariants({ variantsResult: result }, variants))
|
110
|
-
const resultWithVariants = {
|
111
|
-
...result,
|
112
|
-
...variantsResult
|
113
|
-
}
|
110
|
+
const resultWithVariants = deepMergeObjects(result, variantsResult ?? {})
|
114
111
|
|
115
112
|
this.applyStyles(hash, convertUnistyles(resultWithVariants))
|
116
113
|
})
|
package/src/web/runtime.ts
CHANGED
@@ -160,7 +160,7 @@ class UnistylesRuntimeBuilder {
|
|
160
160
|
return
|
161
161
|
}
|
162
162
|
|
163
|
-
this.setTheme(schemeToTheme(UnistylesRuntime.colorScheme))
|
163
|
+
this.setTheme(schemeToTheme(UnistylesRuntime.colorScheme) as AppThemeName)
|
164
164
|
}
|
165
165
|
|
166
166
|
setRootViewBackgroundColor = (hex: string, alpha?: number) => {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { UnistylesValues } from '../types'
|
2
2
|
import { UnistylesRegistry } from './registry'
|
3
|
-
import { createDoubleMap, equal, extractSecrets, extractUnistyleDependencies, isInDocument } from './utils'
|
3
|
+
import { createDoubleMap, deepMergeObjects, equal, extractSecrets, extractUnistyleDependencies, isInDocument } from './utils'
|
4
4
|
import { getVariants } from './variants'
|
5
5
|
|
6
6
|
type Style = UnistylesValues | ((...args: Array<any>) => UnistylesValues)
|
@@ -73,10 +73,7 @@ class UnistylesShadowRegistryBuilder {
|
|
73
73
|
? style(...args)
|
74
74
|
: style
|
75
75
|
const { variantsResult } = Object.fromEntries(getVariants({ variantsResult: result }, variants))
|
76
|
-
const resultWithVariants = {
|
77
|
-
...result,
|
78
|
-
...variantsResult
|
79
|
-
}
|
76
|
+
const resultWithVariants = deepMergeObjects(result, variantsResult ?? {})
|
80
77
|
const oldResult = this.resultsMap.get(ref, __uni__key)
|
81
78
|
|
82
79
|
// If results are the same do nothing
|
package/src/web/state.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { UnistylesTheme } from '../types'
|
2
2
|
import type { UnistylesConfig } from '../specs/StyleSheet'
|
3
|
-
import type { AppBreakpoint, AppThemeName } from '../specs/types'
|
3
|
+
import type { AppBreakpoint, AppTheme, AppThemeName } from '../specs/types'
|
4
4
|
import type { UnistylesBreakpoints, UnistylesThemes } from '../global'
|
5
5
|
import { UnistylesRuntime } from './runtime'
|
6
6
|
import { isServer, schemeToTheme } from './utils'
|
@@ -39,7 +39,7 @@ class UnistylesStateBuilder {
|
|
39
39
|
|
40
40
|
private initThemes = (themes = {} as UnistylesThemes) => {
|
41
41
|
Object.entries(themes).forEach(([themeName, theme]) => {
|
42
|
-
this.themes.set(themeName, theme)
|
42
|
+
this.themes.set(themeName, theme as AppTheme)
|
43
43
|
})
|
44
44
|
}
|
45
45
|
|
@@ -61,7 +61,7 @@ class UnistylesStateBuilder {
|
|
61
61
|
|
62
62
|
// Adaptive themes
|
63
63
|
if (settings.adaptiveThemes) {
|
64
|
-
this.themeName = schemeToTheme(UnistylesRuntime.colorScheme)
|
64
|
+
this.themeName = schemeToTheme(UnistylesRuntime.colorScheme) as AppThemeName
|
65
65
|
|
66
66
|
return
|
67
67
|
}
|
@@ -1,11 +1,11 @@
|
|
1
1
|
import type { UnistyleDependency } from '../../specs/NativePlatform'
|
2
|
-
import {
|
2
|
+
import { ColorScheme, Orientation } from '../../specs/types'
|
3
3
|
import type { StyleSheet, StyleSheetWithSuperPowers, UnistylesValues } from '../../types/stylesheet'
|
4
4
|
import { isUnistylesMq, parseMq } from '../mq'
|
5
5
|
import { UnistylesState } from '../state'
|
6
6
|
import { keyInObject, reduceObject } from './common'
|
7
7
|
|
8
|
-
export const schemeToTheme = (scheme: ColorScheme):
|
8
|
+
export const schemeToTheme = (scheme: ColorScheme): string => {
|
9
9
|
switch (scheme) {
|
10
10
|
case ColorScheme.Dark:
|
11
11
|
return 'dark'
|