react-native-unistyles 3.0.0-alpha.25 → 3.0.0-alpha.27

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. package/cxx/core/UnistylesRegistry.cpp +10 -10
  2. package/cxx/core/UnistylesState.cpp +8 -0
  3. package/cxx/core/UnistylesState.h +1 -0
  4. package/cxx/hybridObjects/HybridStyleSheet.cpp +15 -5
  5. package/cxx/hybridObjects/HybridStyleSheet.h +5 -0
  6. package/ios/UnistylesModuleOnLoad.h +10 -1
  7. package/lib/commonjs/core/useTheme.js.map +1 -1
  8. package/lib/commonjs/core/useTheme.native.js.map +1 -1
  9. package/lib/commonjs/index.js +0 -14
  10. package/lib/commonjs/index.js.map +1 -1
  11. package/lib/commonjs/specs/StyleSheet/index.js +1 -0
  12. package/lib/commonjs/specs/StyleSheet/index.js.map +1 -1
  13. package/lib/module/core/useTheme.js.map +1 -1
  14. package/lib/module/core/useTheme.native.js.map +1 -1
  15. package/lib/module/index.js +0 -13
  16. package/lib/module/index.js.map +1 -1
  17. package/lib/module/specs/StyleSheet/index.js +1 -0
  18. package/lib/module/specs/StyleSheet/index.js.map +1 -1
  19. package/lib/module/web/utils/unistyle.js.map +1 -1
  20. package/lib/typescript/src/core/useBreakpoint.d.ts +1 -1
  21. package/lib/typescript/src/core/useBreakpoint.d.ts.map +1 -1
  22. package/lib/typescript/src/core/useBreakpoint.native.d.ts +1 -1
  23. package/lib/typescript/src/core/useBreakpoint.native.d.ts.map +1 -1
  24. package/lib/typescript/src/core/useTheme.d.ts +2 -40
  25. package/lib/typescript/src/core/useTheme.d.ts.map +1 -1
  26. package/lib/typescript/src/core/useTheme.native.d.ts +2 -40
  27. package/lib/typescript/src/core/useTheme.native.d.ts.map +1 -1
  28. package/lib/typescript/src/global.d.ts +2 -0
  29. package/lib/typescript/src/global.d.ts.map +1 -1
  30. package/lib/typescript/src/index.d.ts.map +1 -1
  31. package/lib/typescript/src/specs/StyleSheet/index.d.ts +2 -1
  32. package/lib/typescript/src/specs/StyleSheet/index.d.ts.map +1 -1
  33. package/lib/typescript/src/types/variants.d.ts +1 -1
  34. package/lib/typescript/src/types/variants.d.ts.map +1 -1
  35. package/lib/typescript/src/web/create.d.ts +10 -1220
  36. package/lib/typescript/src/web/create.d.ts.map +1 -1
  37. package/lib/typescript/src/web/index.d.ts +10 -1220
  38. package/lib/typescript/src/web/index.d.ts.map +1 -1
  39. package/lib/typescript/src/web/runtime.d.ts +4 -4
  40. package/lib/typescript/src/web/runtime.d.ts.map +1 -1
  41. package/lib/typescript/src/web/state.d.ts +1 -2
  42. package/lib/typescript/src/web/state.d.ts.map +1 -1
  43. package/lib/typescript/src/web/utils/unistyle.d.ts +1 -1
  44. package/lib/typescript/src/web/utils/unistyle.d.ts.map +1 -1
  45. package/package.json +3 -4
  46. package/src/core/useTheme.native.ts +2 -1
  47. package/src/core/useTheme.ts +2 -1
  48. package/src/global.ts +4 -1
  49. package/src/index.ts +0 -16
  50. package/src/specs/StyleSheet/index.ts +4 -1
  51. package/src/types/variants.ts +1 -1
  52. package/src/web/utils/unistyle.ts +1 -1
  53. package/lib/typescript/example/App.d.ts +0 -4
  54. package/lib/typescript/example/App.d.ts.map +0 -1
  55. package/lib/typescript/example/Typography.d.ts +0 -35
  56. package/lib/typescript/example/Typography.d.ts.map +0 -1
  57. package/lib/typescript/example/unistyles.d.ts +0 -63
  58. package/lib/typescript/example/unistyles.d.ts.map +0 -1
  59. package/lib/typescript/expo-example/App.d.ts +0 -4
  60. package/lib/typescript/expo-example/App.d.ts.map +0 -1
  61. package/lib/typescript/expo-example/app/(tabs)/_layout.d.ts +0 -3
  62. package/lib/typescript/expo-example/app/(tabs)/_layout.d.ts.map +0 -1
  63. package/lib/typescript/expo-example/app/(tabs)/explore.d.ts +0 -3
  64. package/lib/typescript/expo-example/app/(tabs)/explore.d.ts.map +0 -1
  65. package/lib/typescript/expo-example/app/(tabs)/index.d.ts +0 -3
  66. package/lib/typescript/expo-example/app/(tabs)/index.d.ts.map +0 -1
  67. package/lib/typescript/expo-example/app/+html.d.ts +0 -4
  68. package/lib/typescript/expo-example/app/+html.d.ts.map +0 -1
  69. package/lib/typescript/expo-example/app/+not-found.d.ts +0 -3
  70. package/lib/typescript/expo-example/app/+not-found.d.ts.map +0 -1
  71. package/lib/typescript/expo-example/app/_layout.d.ts +0 -3
  72. package/lib/typescript/expo-example/app/_layout.d.ts.map +0 -1
  73. package/lib/typescript/expo-example/unistyles.d.ts +0 -63
  74. package/lib/typescript/expo-example/unistyles.d.ts.map +0 -1
  75. package/plugin/__tests__/dependencies.spec.js +0 -448
  76. package/plugin/__tests__/ref.spec.js +0 -1427
  77. package/plugin/__tests__/stylesheet.spec.js +0 -507
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/web/index.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAUN,MAAM,KAAK,MAAM;yBACT,KAAK,CAAC,MAAM,CAAC;;CAErC,CAAA;AAED,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAC1D,cAAc,QAAQ,CAAA;AAGtB,eAAO,MAAM,eAAe,eAAW,CAAA"}
@@ -7,11 +7,11 @@ declare class UnistylesRuntimeBuilder {
7
7
  private getLightMedia;
8
8
  private getDarkMedia;
9
9
  get colorScheme(): ColorScheme;
10
- get themeName(): keyof import("react-native-unistyles").UnistylesThemes | undefined;
10
+ get themeName(): keyof import("..").UnistylesThemes | undefined;
11
11
  get contentSizeCategory(): WebContentSizeCategory;
12
- get breakpoint(): keyof import("react-native-unistyles").UnistylesBreakpoints | undefined;
12
+ get breakpoint(): keyof import("..").UnistylesBreakpoints | undefined;
13
13
  get orientation(): Orientation;
14
- get theme(): import("../types").UnistylesTheme;
14
+ get theme(): {};
15
15
  get pixelRatio(): number;
16
16
  get screen(): {
17
17
  width: number;
@@ -35,7 +35,7 @@ declare class UnistylesRuntimeBuilder {
35
35
  setRootViewBackgroundColor: (hex: string, alpha?: number) => void;
36
36
  setImmersiveMode: () => void;
37
37
  updateTheme: (themeName: AppThemeName, updater: (currentTheme: AppTheme) => AppTheme) => void;
38
- getTheme: (themeName?: keyof import("react-native-unistyles").UnistylesThemes | undefined) => import("../types").UnistylesTheme;
38
+ getTheme: (themeName?: keyof import("..").UnistylesThemes | undefined) => {};
39
39
  }
40
40
  export declare const UnistylesRuntime: UnistylesRuntimeBuilder;
41
41
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../src/web/runtime.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,QAAQ,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC3F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAMjD,cAAM,uBAAuB;IACzB,UAAU,wBAAuB;IACjC,SAAS,wBAAsB;IAE/B,OAAO,CAAC,aAAa;IAYrB,OAAO,CAAC,YAAY;IAYpB,IAAI,WAAW,gBASd;IAED,IAAI,SAAS,uEAEZ;IAED,IAAI,mBAAmB,2BAEtB;IAED,IAAI,UAAU,4EAEb;IAED,IAAI,WAAW,gBAMd;IAED,IAAI,KAAK,sCAER;IAED,IAAI,UAAU,WAEb;IAED,IAAI,MAAM;;;MAYT;IAED,IAAI,SAAS,WAEZ;IAED,IAAI,MAAM;;;;;;MAQT;IAED,IAAI,SAAS,oDAEZ;IAED,IAAI,GAAG,YAEN;IAED,IAAI,iBAAiB,YAEpB;IAED,IAAI,aAAa,2DAEhB;IAED,IAAI,WAAW,IAAI,oBAAoB,CAuBtC;IAED,QAAQ,cAAe,YAAY,UAQlC;IAED,iBAAiB,cAAe,OAAO,UAQtC;IAED,0BAA0B,QAAS,MAAM,UAAU,MAAM,UAMxD;IAED,gBAAgB,aAAW;IAE3B,WAAW,cAAe,YAAY,WAAW,CAAC,YAAY,EAAE,QAAQ,KAAK,QAAQ,UAQpF;IAED,QAAQ,wHAYP;CACJ;AAED,eAAO,MAAM,gBAAgB,yBAAgC,CAAA"}
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../src/web/runtime.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,QAAQ,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC3F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAMjD,cAAM,uBAAuB;IACzB,UAAU,wBAAuB;IACjC,SAAS,wBAAsB;IAE/B,OAAO,CAAC,aAAa;IAYrB,OAAO,CAAC,YAAY;IAYpB,IAAI,WAAW,gBASd;IAED,IAAI,SAAS,mDAEZ;IAED,IAAI,mBAAmB,2BAEtB;IAED,IAAI,UAAU,wDAEb;IAED,IAAI,WAAW,gBAMd;IAED,IAAI,KAAK,OAER;IAED,IAAI,UAAU,WAEb;IAED,IAAI,MAAM;;;MAYT;IAED,IAAI,SAAS,WAEZ;IAED,IAAI,MAAM;;;;;;MAQT;IAED,IAAI,SAAS,oDAEZ;IAED,IAAI,GAAG,YAEN;IAED,IAAI,iBAAiB,YAEpB;IAED,IAAI,aAAa,2DAEhB;IAED,IAAI,WAAW,IAAI,oBAAoB,CAuBtC;IAED,QAAQ,cAAe,YAAY,UAQlC;IAED,iBAAiB,cAAe,OAAO,UAQtC;IAED,0BAA0B,QAAS,MAAM,UAAU,MAAM,UAMxD;IAED,gBAAgB,aAAW;IAE3B,WAAW,cAAe,YAAY,WAAW,CAAC,YAAY,EAAE,QAAQ,KAAK,QAAQ,UAQpF;IAED,QAAQ,qEAYP;CACJ;AAED,eAAO,MAAM,gBAAgB,yBAAgC,CAAA"}
@@ -1,9 +1,8 @@
1
- import type { UnistylesTheme } from '../types';
2
1
  import type { UnistylesConfig } from '../specs/StyleSheet';
3
2
  import type { AppBreakpoint, AppThemeName } from '../specs/types';
4
3
  import type { UnistylesBreakpoints } from '../global';
5
4
  declare class UnistylesStateBuilder {
6
- themes: Map<string, UnistylesTheme>;
5
+ themes: Map<string, {}>;
7
6
  themeName?: AppThemeName;
8
7
  private matchingBreakpoints;
9
8
  get breakpoint(): AppBreakpoint | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../src/web/state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAmB,MAAM,WAAW,CAAA;AAMtE,cAAM,qBAAqB;IACvB,MAAM,8BAAoC;IAC1C,SAAS,CAAC,EAAE,YAAY,CAAA;IAExB,OAAO,CAAC,mBAAmB,CAA6B;IAExD,IAAI,UAAU,IAKkB,aAAa,GAAG,SAAS,CACxD;IAED,WAAW,CAAC,EAAE,oBAAoB,CAAA;IAElC,iBAAiB,UAAQ;IAEzB,IAAI,WAAY,eAAe,UAU9B;IAED,OAAO,CAAC,UAAU,CAIjB;IAED,OAAO,CAAC,YAAY,CAyBnB;IAED,OAAO,CAAC,eAAe,CAkBtB;CACJ;AAED,eAAO,MAAM,cAAc,uBAA8B,CAAA"}
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../src/web/state.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAmB,MAAM,WAAW,CAAA;AAMtE,cAAM,qBAAqB;IACvB,MAAM,kBAAoC;IAC1C,SAAS,CAAC,EAAE,YAAY,CAAA;IAExB,OAAO,CAAC,mBAAmB,CAA6B;IAExD,IAAI,UAAU,IAKkB,aAAa,GAAG,SAAS,CACxD;IAED,WAAW,CAAC,EAAE,oBAAoB,CAAA;IAElC,iBAAiB,UAAQ;IAEzB,IAAI,WAAY,eAAe,UAU9B;IAED,OAAO,CAAC,UAAU,CAIjB;IAED,OAAO,CAAC,YAAY,CAyBnB;IAED,OAAO,CAAC,eAAe,CAkBtB;CACJ;AAED,eAAO,MAAM,cAAc,uBAA8B,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import type { UnistyleDependency } from '../../specs/NativePlatform';
2
- import { ColorScheme, type AppThemeName } from '../../specs/types';
2
+ import { type AppThemeName, ColorScheme } from '../../specs/types';
3
3
  import type { StyleSheet, StyleSheetWithSuperPowers, UnistylesValues } from '../../types/stylesheet';
4
4
  export declare const schemeToTheme: (scheme: ColorScheme) => AppThemeName;
5
5
  export declare const hexToRGBA: (hex: string, opacity: number) => string;
@@ -1 +1 @@
1
- {"version":3,"file":"unistyle.d.ts","sourceRoot":"","sources":["../../../../../src/web/utils/unistyle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AACpE,OAAO,EAAE,WAAW,EAAe,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAC/E,OAAO,KAAK,EAAE,UAAU,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAKpG,eAAO,MAAM,aAAa,WAAY,WAAW,KAAG,YAQnD,CAAA;AAED,eAAO,MAAM,SAAS,QAAS,MAAM,WAAW,MAAM,WAM5B,CAAA;AAE1B,MAAM,MAAM,eAAe,GAAG;IAC1B,iBAAiB,EAAE,yBAAyB,CAAC,UAAU,CAAC,CAAC;IACzD,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,GAAG,CAAC,WAAW,CAAC,CAAA;IAC7B,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACpC,WAAW,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAA;CA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,WAAY,eAAe,OAUhD,CAAA;AAED,eAAO,MAAM,YAAY,YAAa,WAAW,YAAoC,CAAA;AAErF,eAAO,MAAM,sBAAsB,UAAW,MAAM,uBAUnD,CAAA;AAED,eAAO,MAAM,aAAa,UAAW,MAAM,WAmB1C,CAAA;AAED,eAAO,MAAM,2BAA2B,UAAW,GAAG,yBAIrD,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-unistyles",
3
- "version": "3.0.0-alpha.25",
3
+ "version": "3.0.0-alpha.27",
4
4
  "description": "Level up your React Native StyleSheet",
5
5
  "scripts": {
6
6
  "test": "jest",
@@ -27,7 +27,7 @@
27
27
  "web",
28
28
  "react-native.config.js",
29
29
  "Unistyles.podspec",
30
- "!lib/typescript/examples",
30
+ "!plugin/__tests__",
31
31
  "!ios/build",
32
32
  "!android/build",
33
33
  "!android/gradle",
@@ -81,8 +81,7 @@
81
81
  "react-native-nitro-modules": "0.13.0",
82
82
  "react-test-renderer": "18.3.1",
83
83
  "release-it": "17.6.0",
84
- "typescript": "5.5.4",
85
- "typestyle": "2.4.0"
84
+ "typescript": "5.6.3"
86
85
  },
87
86
  "peerDependencies": {
88
87
  "@react-native/normalize-colors": "*",
@@ -1,8 +1,9 @@
1
1
  import { useEffect, useState } from 'react'
2
2
  import { StyleSheet, UnistyleDependency, UnistylesRuntime } from '../specs'
3
3
  import type { UnistylesStyleSheet } from '../specs'
4
+ import type { UnistylesTheme } from '../types'
4
5
 
5
- export const useTheme = () => {
6
+ export const useTheme = (): UnistylesTheme => {
6
7
  const [theme, setTheme] = useState(UnistylesRuntime.getTheme())
7
8
 
8
9
  useEffect(() => {
@@ -2,8 +2,9 @@ import { useEffect, useState } from 'react'
2
2
  import { UnistylesRuntime } from '../web'
3
3
  import { UnistylesListener } from '../web/listener'
4
4
  import { UnistyleDependency } from '../specs/NativePlatform'
5
+ import type { UnistylesTheme } from '../types'
5
6
 
6
- export const useTheme = () => {
7
+ export const useTheme = (): UnistylesTheme => {
7
8
  const [theme, setTheme] = useState(UnistylesRuntime.getTheme())
8
9
 
9
10
  useEffect(() => {
package/src/global.ts CHANGED
@@ -1,4 +1,7 @@
1
- export interface UnistylesThemes {}
1
+ export interface UnistylesThemes {
2
+ light: {}
3
+ dark: {}
4
+ }
2
5
  export interface UnistylesBreakpoints {
3
6
  // these breakpoints are only available on mobile, when you didn't specify any breakpoints
4
7
  landscape?: number,
package/src/index.ts CHANGED
@@ -1,21 +1,5 @@
1
- import React from 'react'
2
-
3
1
  export * from './specs'
4
2
  export { mq } from './mq'
5
3
  export type { UnistylesThemes, UnistylesBreakpoints } from './global'
6
4
  export { useTheme, useBreakpoint } from './core'
7
5
  export type { UnistylesVariants } from './types'
8
-
9
- // TODO: export Native createUnistylesComponent
10
- // can't import it this way, it will break native build
11
- // export { createUnistylesComponent } from './web/createUnistylesComponent'
12
-
13
- // todo verify true min version
14
- const minReactVersionRequiredByUnistyles = '18.3.1'
15
-
16
- if (React.version < minReactVersionRequiredByUnistyles) {
17
- throw new Error(`
18
- You are using an outdated version of React (${React.version}).
19
- Unistyles requires at least React ${minReactVersionRequiredByUnistyles}.
20
- `)
21
- }
@@ -23,6 +23,7 @@ export interface UnistylesStyleSheet extends UnistylesStyleSheetSpec {
23
23
  flatten: typeof NativeStyleSheetType.flatten,
24
24
 
25
25
  // overridden methods
26
+ init(): void,
26
27
  create: CreateUnistylesStyleSheet,
27
28
  configure(config: UnistylesConfig): void,
28
29
  jsMethods: {
@@ -41,6 +42,8 @@ HybridUnistylesStyleSheet.jsMethods = {
41
42
  processColor
42
43
  }
43
44
 
44
- type PrivateMethods = 'jsMethods' | 'addChangeListener'
45
+ HybridUnistylesStyleSheet.init()
46
+
47
+ type PrivateMethods = 'jsMethods' | 'addChangeListener' | 'init'
45
48
 
46
49
  export const StyleSheet = HybridUnistylesStyleSheet as Omit<UnistylesStyleSheet, PrivateMethods>
@@ -20,7 +20,7 @@ type ExtractSubVariantKeys<T> = T extends object
20
20
 
21
21
  type ExtractVariant<T> = T extends { variants: infer V }
22
22
  ? { [key in keyof V]?: ExtractSubVariantKeys<V[key]> }
23
- : T
23
+ : never
24
24
 
25
25
  export type UnistylesVariants<ST> = ST extends { useVariants: infer V }
26
26
  ? V extends (variants: infer T) => void
@@ -1,5 +1,5 @@
1
1
  import type { UnistyleDependency } from '../../specs/NativePlatform'
2
- import { ColorScheme, Orientation, type AppThemeName } from '../../specs/types'
2
+ import { type AppThemeName, 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'
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import './unistyles';
3
- export declare const App: () => React.JSX.Element;
4
- //# sourceMappingURL=App.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../../example/App.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,aAAa,CAAA;AAGpB,eAAO,MAAM,GAAG,yBAef,CAAA"}
@@ -1,35 +0,0 @@
1
- import React from 'react';
2
- import type { PropsWithChildren } from 'react';
3
- import type { UnistylesVariants } from 'react-native-unistyles';
4
- interface TypographyProps extends PropsWithChildren, UnistylesVariants<typeof styles> {
5
- value: number;
6
- }
7
- export declare const Typography: React.FunctionComponent<TypographyProps>;
8
- declare const styles: {
9
- title: (value: number) => {
10
- fontWeight: "bold";
11
- } & {
12
- textAlign: "center";
13
- } & {
14
- fontSize: number;
15
- } & {
16
- fontSize: number;
17
- } & {
18
- fontSize: number;
19
- } & {
20
- color: string;
21
- } & {
22
- color: string;
23
- } & {
24
- color: string;
25
- } & {};
26
- } & {
27
- useVariants: (variants: {
28
- isBold?: boolean | "true" | undefined;
29
- isCentered?: boolean | "true" | undefined;
30
- isPrimary?: boolean | "true" | undefined;
31
- size?: "small" | "large" | undefined;
32
- }) => void;
33
- };
34
- export {};
35
- //# sourceMappingURL=Typography.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Typography.d.ts","sourceRoot":"","sources":["../../../example/Typography.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAG9C,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,wBAAwB,CAAA;AAE7D,UAAU,eAAgB,SAAQ,iBAAiB,EAAE,iBAAiB,CAAC,OAAO,MAAM,CAAC;IACjF,KAAK,EAAE,MAAM,CAAA;CAChB;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,iBAAiB,CAAC,eAAe,CAoB/D,CAAA;AAED,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;CA2CT,CAAA"}
@@ -1,63 +0,0 @@
1
- declare const lightTheme: {
2
- colors: {
3
- backgroundColor: string;
4
- typography: string;
5
- accent: string;
6
- barbie: string;
7
- oak: string;
8
- sky: string;
9
- fog: string;
10
- aloes: string;
11
- blood: string;
12
- };
13
- gap: (v: number) => number;
14
- };
15
- declare const darkTheme: {
16
- colors: {
17
- backgroundColor: string;
18
- typography: string;
19
- accent: string;
20
- barbie: string;
21
- oak: string;
22
- sky: string;
23
- fog: string;
24
- aloes: string;
25
- blood: string;
26
- };
27
- gap: (v: number) => number;
28
- };
29
- declare const premiumTheme: {
30
- colors: {
31
- backgroundColor: string;
32
- typography: string;
33
- accent: string;
34
- barbie: string;
35
- oak: string;
36
- sky: string;
37
- fog: string;
38
- aloes: string;
39
- blood: string;
40
- };
41
- gap: (v: number) => number;
42
- };
43
- declare const breakpoints: {
44
- xs: number;
45
- sm: number;
46
- md: number;
47
- lg: number;
48
- xl: number;
49
- };
50
- type AppBreakpoints = typeof breakpoints;
51
- type AppThemes = {
52
- light: typeof lightTheme;
53
- dark: typeof darkTheme;
54
- premium: typeof premiumTheme;
55
- };
56
- declare module 'react-native-unistyles' {
57
- interface UnistylesThemes extends AppThemes {
58
- }
59
- interface UnistylesBreakpoints extends AppBreakpoints {
60
- }
61
- }
62
- export {};
63
- //# sourceMappingURL=unistyles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"unistyles.d.ts","sourceRoot":"","sources":["../../../example/unistyles.ts"],"names":[],"mappings":"AAWA,QAAA,MAAM,UAAU;;;;;;;;;;;;aAOH,MAAM;CAClB,CAAA;AAED,QAAA,MAAM,SAAS;;;;;;;;;;;;aAOF,MAAM;CAClB,CAAA;AAED,QAAA,MAAM,YAAY;;;;;;;;;;;;aAOL,MAAM;CAClB,CAAA;AAED,QAAA,MAAM,WAAW;;;;;;CAMhB,CAAA;AAED,KAAK,cAAc,GAAG,OAAO,WAAW,CAAA;AACxC,KAAK,SAAS,GAAG;IACb,KAAK,EAAE,OAAO,UAAU,CAAA;IACxB,IAAI,EAAE,OAAO,SAAS,CAAA;IACtB,OAAO,EAAE,OAAO,YAAY,CAAA;CAC/B,CAAA;AAED,OAAO,QAAQ,wBAAwB,CAAC;IACpC,UAAiB,eAAgB,SAAQ,SAAS;KAAG;IAErD,UAAiB,oBAAqB,SAAQ,cAAc;KAAG;CAClE"}
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import './unistyles';
3
- export default function App(): React.JSX.Element;
4
- //# sourceMappingURL=App.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../../expo-example/App.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAGvC,OAAO,aAAa,CAAA;AAEpB,MAAM,CAAC,OAAO,UAAU,GAAG,sBAyC1B"}
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- export default function TabLayout(): React.JSX.Element;
3
- //# sourceMappingURL=_layout.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_layout.d.ts","sourceRoot":"","sources":["../../../../../expo-example/app/(tabs)/_layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,MAAM,CAAC,OAAO,UAAU,SAAS,sBAqBhC"}
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- export default function TabTwoScreen(): React.JSX.Element;
3
- //# sourceMappingURL=explore.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"explore.d.ts","sourceRoot":"","sources":["../../../../../expo-example/app/(tabs)/explore.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,MAAM,CAAC,OAAO,UAAU,YAAY,sBAQnC"}
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- export default function HomeScreen(): React.JSX.Element;
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../expo-example/app/(tabs)/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,MAAM,CAAC,OAAO,UAAU,UAAU,sBAQjC"}
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { type PropsWithChildren } from 'react';
3
- export default function Root({ children }: PropsWithChildren): React.JSX.Element;
4
- //# sourceMappingURL=+html.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"+html.d.ts","sourceRoot":"","sources":["../../../../expo-example/app/+html.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAE9C,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,EAAE,QAAQ,EAAE,EAAE,iBAAiB,qBAqB3D"}
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- export default function NotFoundScreen(): React.JSX.Element;
3
- //# sourceMappingURL=+not-found.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"+not-found.d.ts","sourceRoot":"","sources":["../../../../expo-example/app/+not-found.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,MAAM,CAAC,OAAO,UAAU,cAAc,sBAIrC"}
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- export default function RootLayout(): React.JSX.Element;
3
- //# sourceMappingURL=_layout.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_layout.d.ts","sourceRoot":"","sources":["../../../../expo-example/app/_layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,MAAM,CAAC,OAAO,UAAU,UAAU,sBAMjC"}
@@ -1,63 +0,0 @@
1
- declare const lightTheme: {
2
- colors: {
3
- backgroundColor: string;
4
- typography: string;
5
- accent: string;
6
- barbie: string;
7
- oak: string;
8
- sky: string;
9
- fog: string;
10
- aloes: string;
11
- blood: string;
12
- };
13
- gap: (v: number) => number;
14
- };
15
- declare const darkTheme: {
16
- colors: {
17
- backgroundColor: string;
18
- typography: string;
19
- accent: string;
20
- barbie: string;
21
- oak: string;
22
- sky: string;
23
- fog: string;
24
- aloes: string;
25
- blood: string;
26
- };
27
- gap: (v: number) => number;
28
- };
29
- declare const premiumTheme: {
30
- colors: {
31
- backgroundColor: string;
32
- typography: string;
33
- accent: string;
34
- barbie: string;
35
- oak: string;
36
- sky: string;
37
- fog: string;
38
- aloes: string;
39
- blood: string;
40
- };
41
- gap: (v: number) => number;
42
- };
43
- declare const breakpoints: {
44
- xs: number;
45
- sm: number;
46
- md: number;
47
- lg: number;
48
- xl: number;
49
- };
50
- type AppBreakpoints = typeof breakpoints;
51
- type AppThemes = {
52
- light: typeof lightTheme;
53
- dark: typeof darkTheme;
54
- premium: typeof premiumTheme;
55
- };
56
- declare module 'react-native-unistyles' {
57
- interface UnistylesThemes extends AppThemes {
58
- }
59
- interface UnistylesBreakpoints extends AppBreakpoints {
60
- }
61
- }
62
- export {};
63
- //# sourceMappingURL=unistyles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"unistyles.d.ts","sourceRoot":"","sources":["../../../expo-example/unistyles.ts"],"names":[],"mappings":"AAWA,QAAA,MAAM,UAAU;;;;;;;;;;;;aAOH,MAAM;CAClB,CAAA;AAED,QAAA,MAAM,SAAS;;;;;;;;;;;;aAOF,MAAM;CAClB,CAAA;AAED,QAAA,MAAM,YAAY;;;;;;;;;;;;aAOL,MAAM;CAClB,CAAA;AAED,QAAA,MAAM,WAAW;;;;;;CAMhB,CAAA;AAED,KAAK,cAAc,GAAG,OAAO,WAAW,CAAA;AACxC,KAAK,SAAS,GAAG;IACb,KAAK,EAAE,OAAO,UAAU,CAAA;IACxB,IAAI,EAAE,OAAO,SAAS,CAAA;IACtB,OAAO,EAAE,OAAO,YAAY,CAAA;CAC/B,CAAA;AAED,OAAO,QAAQ,wBAAwB,CAAC;IACpC,UAAiB,eAAgB,SAAQ,SAAS;KAAG;IAErD,UAAiB,oBAAqB,SAAQ,cAAc;KAAG;CAClE"}