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

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 (61) hide show
  1. package/cxx/core/UnistylesState.cpp +4 -0
  2. package/cxx/core/UnistylesState.h +1 -0
  3. package/cxx/hybridObjects/HybridStyleSheet.cpp +4 -0
  4. package/lib/commonjs/core/useTheme.js.map +1 -1
  5. package/lib/commonjs/core/useTheme.native.js.map +1 -1
  6. package/lib/module/core/useTheme.js.map +1 -1
  7. package/lib/module/core/useTheme.native.js.map +1 -1
  8. package/lib/module/web/utils/unistyle.js.map +1 -1
  9. package/lib/typescript/src/core/useBreakpoint.d.ts +1 -1
  10. package/lib/typescript/src/core/useBreakpoint.d.ts.map +1 -1
  11. package/lib/typescript/src/core/useBreakpoint.native.d.ts +1 -1
  12. package/lib/typescript/src/core/useBreakpoint.native.d.ts.map +1 -1
  13. package/lib/typescript/src/core/useTheme.d.ts +2 -40
  14. package/lib/typescript/src/core/useTheme.d.ts.map +1 -1
  15. package/lib/typescript/src/core/useTheme.native.d.ts +2 -40
  16. package/lib/typescript/src/core/useTheme.native.d.ts.map +1 -1
  17. package/lib/typescript/src/global.d.ts +2 -0
  18. package/lib/typescript/src/global.d.ts.map +1 -1
  19. package/lib/typescript/src/types/variants.d.ts +1 -1
  20. package/lib/typescript/src/types/variants.d.ts.map +1 -1
  21. package/lib/typescript/src/web/create.d.ts +10 -1220
  22. package/lib/typescript/src/web/create.d.ts.map +1 -1
  23. package/lib/typescript/src/web/index.d.ts +10 -1220
  24. package/lib/typescript/src/web/index.d.ts.map +1 -1
  25. package/lib/typescript/src/web/runtime.d.ts +4 -4
  26. package/lib/typescript/src/web/runtime.d.ts.map +1 -1
  27. package/lib/typescript/src/web/state.d.ts +1 -2
  28. package/lib/typescript/src/web/state.d.ts.map +1 -1
  29. package/lib/typescript/src/web/utils/unistyle.d.ts +1 -1
  30. package/lib/typescript/src/web/utils/unistyle.d.ts.map +1 -1
  31. package/package.json +3 -4
  32. package/src/core/useTheme.native.ts +2 -1
  33. package/src/core/useTheme.ts +2 -1
  34. package/src/global.ts +4 -1
  35. package/src/types/variants.ts +1 -1
  36. package/src/web/utils/unistyle.ts +1 -1
  37. package/lib/typescript/example/App.d.ts +0 -4
  38. package/lib/typescript/example/App.d.ts.map +0 -1
  39. package/lib/typescript/example/Typography.d.ts +0 -35
  40. package/lib/typescript/example/Typography.d.ts.map +0 -1
  41. package/lib/typescript/example/unistyles.d.ts +0 -63
  42. package/lib/typescript/example/unistyles.d.ts.map +0 -1
  43. package/lib/typescript/expo-example/App.d.ts +0 -4
  44. package/lib/typescript/expo-example/App.d.ts.map +0 -1
  45. package/lib/typescript/expo-example/app/(tabs)/_layout.d.ts +0 -3
  46. package/lib/typescript/expo-example/app/(tabs)/_layout.d.ts.map +0 -1
  47. package/lib/typescript/expo-example/app/(tabs)/explore.d.ts +0 -3
  48. package/lib/typescript/expo-example/app/(tabs)/explore.d.ts.map +0 -1
  49. package/lib/typescript/expo-example/app/(tabs)/index.d.ts +0 -3
  50. package/lib/typescript/expo-example/app/(tabs)/index.d.ts.map +0 -1
  51. package/lib/typescript/expo-example/app/+html.d.ts +0 -4
  52. package/lib/typescript/expo-example/app/+html.d.ts.map +0 -1
  53. package/lib/typescript/expo-example/app/+not-found.d.ts +0 -3
  54. package/lib/typescript/expo-example/app/+not-found.d.ts.map +0 -1
  55. package/lib/typescript/expo-example/app/_layout.d.ts +0 -3
  56. package/lib/typescript/expo-example/app/_layout.d.ts.map +0 -1
  57. package/lib/typescript/expo-example/unistyles.d.ts +0 -63
  58. package/lib/typescript/expo-example/unistyles.d.ts.map +0 -1
  59. package/plugin/__tests__/dependencies.spec.js +0 -448
  60. package/plugin/__tests__/ref.spec.js +0 -1427
  61. package/plugin/__tests__/stylesheet.spec.js +0 -507
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/web/index.ts"],"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AAW,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,wBA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DAEb;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;CAC3B,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,CAAC,UAAU,CAAC,WAAW,eAAe,MAKnE,CAAA;AAED,eAAO,MAAM,cAAc,WAAY,GAAG,sBAUzC,CAAA;AAED,eAAO,MAAM,SAAS,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"}
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,KAAK,YAAY,EAAE,WAAW,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;CAC3B,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,CAAC,UAAU,CAAC,WAAW,eAAe,MAKnE,CAAA;AAED,eAAO,MAAM,cAAc,WAAY,GAAG,sBAUzC,CAAA;AAED,eAAO,MAAM,SAAS,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.26",
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,
@@ -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"}