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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. package/cxx/common/Helpers.h +10 -0
  2. package/cxx/core/UnistylesRegistry.cpp +10 -10
  3. package/cxx/core/UnistylesState.cpp +17 -1
  4. package/cxx/core/UnistylesState.h +2 -1
  5. package/cxx/hybridObjects/HybridStyleSheet.cpp +49 -10
  6. package/cxx/hybridObjects/HybridStyleSheet.h +8 -0
  7. package/cxx/hybridObjects/HybridUnistylesRuntime.cpp +23 -3
  8. package/cxx/hybridObjects/HybridUnistylesRuntime.h +5 -0
  9. package/cxx/parser/Parser.cpp +1 -1
  10. package/ios/Equatable.swift +2 -1
  11. package/ios/NativePlatform+ios.swift +4 -1
  12. package/ios/UnistylesModuleOnLoad.h +10 -1
  13. package/lib/commonjs/core/index.js +20 -0
  14. package/lib/commonjs/core/index.js.map +1 -0
  15. package/lib/commonjs/core/useBreakpoint.js +22 -0
  16. package/lib/commonjs/core/useBreakpoint.js.map +1 -0
  17. package/lib/commonjs/core/useBreakpoint.native.js +24 -0
  18. package/lib/commonjs/core/useBreakpoint.native.js.map +1 -0
  19. package/lib/commonjs/core/useTheme.js +22 -0
  20. package/lib/commonjs/core/useTheme.js.map +1 -0
  21. package/lib/commonjs/core/useTheme.native.js +24 -0
  22. package/lib/commonjs/core/useTheme.native.js.map +1 -0
  23. package/lib/commonjs/index.js +16 -15
  24. package/lib/commonjs/index.js.map +1 -1
  25. package/lib/commonjs/specs/NativePlatform/NativePlatform.nitro.js.map +1 -1
  26. package/lib/commonjs/specs/NavigtionBar/index.js.map +1 -1
  27. package/lib/commonjs/specs/StatusBar/index.js.map +1 -1
  28. package/lib/commonjs/specs/StyleSheet/index.js +1 -0
  29. package/lib/commonjs/specs/StyleSheet/index.js.map +1 -1
  30. package/lib/commonjs/specs/UnistylesRuntime/index.js.map +1 -1
  31. package/lib/commonjs/specs/index.js +7 -0
  32. package/lib/commonjs/specs/index.js.map +1 -1
  33. package/lib/commonjs/web/runtime.js +13 -9
  34. package/lib/commonjs/web/runtime.js.map +1 -1
  35. package/lib/module/core/index.js +5 -0
  36. package/lib/module/core/index.js.map +1 -0
  37. package/lib/module/core/useBreakpoint.js +17 -0
  38. package/lib/module/core/useBreakpoint.js.map +1 -0
  39. package/lib/module/core/useBreakpoint.native.js +19 -0
  40. package/lib/module/core/useBreakpoint.native.js.map +1 -0
  41. package/lib/module/core/useTheme.js +17 -0
  42. package/lib/module/core/useTheme.js.map +1 -0
  43. package/lib/module/core/useTheme.native.js +19 -0
  44. package/lib/module/core/useTheme.native.js.map +1 -0
  45. package/lib/module/index.js +1 -13
  46. package/lib/module/index.js.map +1 -1
  47. package/lib/module/specs/NativePlatform/NativePlatform.nitro.js.map +1 -1
  48. package/lib/module/specs/NavigtionBar/index.js.map +1 -1
  49. package/lib/module/specs/StatusBar/index.js.map +1 -1
  50. package/lib/module/specs/StyleSheet/index.js +1 -0
  51. package/lib/module/specs/StyleSheet/index.js.map +1 -1
  52. package/lib/module/specs/UnistylesRuntime/index.js.map +1 -1
  53. package/lib/module/specs/index.js +2 -1
  54. package/lib/module/specs/index.js.map +1 -1
  55. package/lib/module/web/runtime.js +13 -9
  56. package/lib/module/web/runtime.js.map +1 -1
  57. package/lib/typescript/example/App.d.ts.map +1 -1
  58. package/lib/typescript/example/Typography.d.ts +28 -5
  59. package/lib/typescript/example/Typography.d.ts.map +1 -1
  60. package/lib/typescript/src/core/index.d.ts +3 -0
  61. package/lib/typescript/src/core/index.d.ts.map +1 -0
  62. package/lib/typescript/src/core/useBreakpoint.d.ts +2 -0
  63. package/lib/typescript/src/core/useBreakpoint.d.ts.map +1 -0
  64. package/lib/typescript/src/core/useBreakpoint.native.d.ts +2 -0
  65. package/lib/typescript/src/core/useBreakpoint.native.d.ts.map +1 -0
  66. package/lib/typescript/src/core/useTheme.d.ts +41 -0
  67. package/lib/typescript/src/core/useTheme.d.ts.map +1 -0
  68. package/lib/typescript/src/core/useTheme.native.d.ts +41 -0
  69. package/lib/typescript/src/core/useTheme.native.d.ts.map +1 -0
  70. package/lib/typescript/src/index.d.ts +2 -0
  71. package/lib/typescript/src/index.d.ts.map +1 -1
  72. package/lib/typescript/src/specs/NativePlatform/NativePlatform.nitro.d.ts +2 -1
  73. package/lib/typescript/src/specs/NativePlatform/NativePlatform.nitro.d.ts.map +1 -1
  74. package/lib/typescript/src/specs/NavigtionBar/index.d.ts +5 -0
  75. package/lib/typescript/src/specs/NavigtionBar/index.d.ts.map +1 -1
  76. package/lib/typescript/src/specs/StatusBar/index.d.ts +5 -0
  77. package/lib/typescript/src/specs/StatusBar/index.d.ts.map +1 -1
  78. package/lib/typescript/src/specs/StyleSheet/UnistylesStyleSheet.nitro.d.ts +2 -0
  79. package/lib/typescript/src/specs/StyleSheet/UnistylesStyleSheet.nitro.d.ts.map +1 -1
  80. package/lib/typescript/src/specs/StyleSheet/index.d.ts +2 -1
  81. package/lib/typescript/src/specs/StyleSheet/index.d.ts.map +1 -1
  82. package/lib/typescript/src/specs/UnistylesRuntime/UnistylesRuntime.nitro.d.ts +0 -1
  83. package/lib/typescript/src/specs/UnistylesRuntime/UnistylesRuntime.nitro.d.ts.map +1 -1
  84. package/lib/typescript/src/specs/UnistylesRuntime/index.d.ts +3 -1
  85. package/lib/typescript/src/specs/UnistylesRuntime/index.d.ts.map +1 -1
  86. package/lib/typescript/src/specs/index.d.ts +4 -2
  87. package/lib/typescript/src/specs/index.d.ts.map +1 -1
  88. package/lib/typescript/src/types/index.d.ts +1 -1
  89. package/lib/typescript/src/types/index.d.ts.map +1 -1
  90. package/lib/typescript/src/types/variants.d.ts +3 -0
  91. package/lib/typescript/src/types/variants.d.ts.map +1 -1
  92. package/lib/typescript/src/web/runtime.d.ts +1 -0
  93. package/lib/typescript/src/web/runtime.d.ts.map +1 -1
  94. package/nitrogen/generated/android/c++/JUnistylesNativeMiniRuntime.hpp +8 -6
  95. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/UnistylesNativeMiniRuntime.kt +2 -1
  96. package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Bridge.hpp +2 -2
  97. package/nitrogen/generated/ios/swift/UnistylesNativeMiniRuntime.swift +16 -5
  98. package/nitrogen/generated/shared/c++/HybridUnistylesStyleSheetSpec.cpp +1 -0
  99. package/nitrogen/generated/shared/c++/HybridUnistylesStyleSheetSpec.hpp +6 -3
  100. package/nitrogen/generated/shared/c++/UnistylesCxxMiniRuntime.hpp +10 -9
  101. package/nitrogen/generated/shared/c++/UnistylesNativeMiniRuntime.hpp +9 -8
  102. package/package.json +1 -1
  103. package/plugin/common.js +3 -1
  104. package/plugin/stylesheet.js +2 -1
  105. package/src/core/index.ts +2 -0
  106. package/src/core/useBreakpoint.native.ts +21 -0
  107. package/src/core/useBreakpoint.ts +18 -0
  108. package/src/core/useTheme.native.ts +21 -0
  109. package/src/core/useTheme.ts +18 -0
  110. package/src/index.ts +2 -15
  111. package/src/specs/NativePlatform/NativePlatform.nitro.ts +2 -1
  112. package/src/specs/NavigtionBar/index.ts +5 -0
  113. package/src/specs/StatusBar/index.ts +5 -0
  114. package/src/specs/StyleSheet/UnistylesStyleSheet.nitro.ts +3 -0
  115. package/src/specs/StyleSheet/index.ts +4 -1
  116. package/src/specs/UnistylesRuntime/UnistylesRuntime.nitro.ts +0 -1
  117. package/src/specs/UnistylesRuntime/index.ts +3 -1
  118. package/src/specs/index.ts +6 -2
  119. package/src/types/index.ts +1 -1
  120. package/src/types/variants.ts +6 -0
  121. package/src/web/runtime.ts +17 -12
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_reactNativeNitroModules","_StatusBar","_NavigtionBar","_common","HybridUnistylesRuntime","NitroModules","createHybridObject","statusBar","createHybridStatusBar","navigationBar","createHybridNavigationBar","_setRootViewBackgroundColor","setRootViewBackgroundColor","color","parsedColor","processColor","isIOS","setImmersiveMode","isEnabled","setHidden","attachStatusBarJSMethods","attachNavigationBarJSMethods","Runtime","exports"],"sourceRoot":"../../../../src","sources":["specs/UnistylesRuntime/index.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,wBAAA,GAAAD,OAAA;AAGA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AAEA,IAAAI,OAAA,GAAAJ,OAAA;AAgCA,MAAMK,sBAAsB,GAAGC,qCAAY,CACtCC,kBAAkB,CAA0B,kBAAkB,CAAC;AAEpEF,sBAAsB,CAACG,SAAS,GAAGH,sBAAsB,CAACI,qBAAqB,CAAC,CAAC;AACjFJ,sBAAsB,CAACK,aAAa,GAAGL,sBAAsB,CAACM,yBAAyB,CAAC,CAAC;AACzFN,sBAAsB,CAACO,2BAA2B,GAAGP,sBAAsB,CAACQ,0BAA0B;AAEtGR,sBAAsB,CAACQ,0BAA0B,GAAIC,KAAc,IAAK;EACpE,MAAMC,WAAW,GAAG,IAAAC,yBAAY,EAACF,KAAK,CAAC,IAAI,CAAC;EAE5CT,sBAAsB,CAACO,2BAA2B,CAACG,WAAqB,CAAC;AAC7E,CAAC;AAED,IAAIE,aAAK,EAAE;EACPZ,sBAAsB,CAACa,gBAAgB,GAAIC,SAAkB,IAAKd,sBAAsB,CAACG,SAAS,CAACY,SAAS,CAACD,SAAS,EAAE,MAAM,CAAC;AACnI;AAEA,IAAAE,mCAAwB,EAAChB,sBAAsB,CAACG,SAAS,CAAC;AAC1D,IAAAc,0CAA4B,EAACjB,sBAAsB,CAACK,aAAa,CAAC;AAE3D,MAAMa,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAGlB,sBAA0C","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_reactNativeNitroModules","_StatusBar","_NavigtionBar","_common","HybridUnistylesRuntime","NitroModules","createHybridObject","statusBar","createHybridStatusBar","navigationBar","createHybridNavigationBar","_setRootViewBackgroundColor","setRootViewBackgroundColor","color","parsedColor","processColor","isIOS","setImmersiveMode","isEnabled","setHidden","attachStatusBarJSMethods","attachNavigationBarJSMethods","Runtime","exports"],"sourceRoot":"../../../../src","sources":["specs/UnistylesRuntime/index.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,wBAAA,GAAAD,OAAA;AAGA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AAEA,IAAAI,OAAA,GAAAJ,OAAA;AAkCA,MAAMK,sBAAsB,GAAGC,qCAAY,CACtCC,kBAAkB,CAA0B,kBAAkB,CAAC;AAEpEF,sBAAsB,CAACG,SAAS,GAAGH,sBAAsB,CAACI,qBAAqB,CAAC,CAAC;AACjFJ,sBAAsB,CAACK,aAAa,GAAGL,sBAAsB,CAACM,yBAAyB,CAAC,CAAC;AACzFN,sBAAsB,CAACO,2BAA2B,GAAGP,sBAAsB,CAACQ,0BAA0B;AAEtGR,sBAAsB,CAACQ,0BAA0B,GAAIC,KAAc,IAAK;EACpE,MAAMC,WAAW,GAAG,IAAAC,yBAAY,EAACF,KAAK,CAAC,IAAI,CAAC;EAE5CT,sBAAsB,CAACO,2BAA2B,CAACG,WAAqB,CAAC;AAC7E,CAAC;AAED,IAAIE,aAAK,EAAE;EACPZ,sBAAsB,CAACa,gBAAgB,GAAIC,SAAkB,IAAKd,sBAAsB,CAACG,SAAS,CAACY,SAAS,CAACD,SAAS,EAAE,MAAM,CAAC;AACnI;AAEA,IAAAE,mCAAwB,EAAChB,sBAAsB,CAACG,SAAS,CAAC;AAC1D,IAAAc,0CAA4B,EAACjB,sBAAsB,CAACK,aAAa,CAAC;AAE3D,MAAMa,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAGlB,sBAA0C","ignoreList":[]}
@@ -27,6 +27,12 @@ Object.defineProperty(exports, "StyleSheet", {
27
27
  return _StyleSheet.StyleSheet;
28
28
  }
29
29
  });
30
+ Object.defineProperty(exports, "UnistyleDependency", {
31
+ enumerable: true,
32
+ get: function () {
33
+ return _NativePlatform.UnistyleDependency;
34
+ }
35
+ });
30
36
  Object.defineProperty(exports, "UnistylesRuntime", {
31
37
  enumerable: true,
32
38
  get: function () {
@@ -44,4 +50,5 @@ var _UnistylesRuntime = require("./UnistylesRuntime");
44
50
  var _StyleSheet = require("./StyleSheet");
45
51
  var _ShadowRegistry = require("./ShadowRegistry");
46
52
  var _types = require("./types");
53
+ var _NativePlatform = require("./NativePlatform");
47
54
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["require","_UnistylesRuntime","_StyleSheet","_ShadowRegistry","_types"],"sourceRoot":"../../../src","sources":["specs/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAAA,OAAA;AAEA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AAEA,IAAAI,MAAA,GAAAJ,OAAA","ignoreList":[]}
1
+ {"version":3,"names":["require","_UnistylesRuntime","_StyleSheet","_ShadowRegistry","_types","_NativePlatform"],"sourceRoot":"../../../src","sources":["specs/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAAA,OAAA;AAEA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAEA,IAAAG,eAAA,GAAAH,OAAA;AAEA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,eAAA,GAAAL,OAAA","ignoreList":[]}
@@ -58,14 +58,7 @@ class UnistylesRuntimeBuilder {
58
58
  return screen.orientation.type.includes('portrait') ? _types.Orientation.Portrait : _types.Orientation.Landscape;
59
59
  }
60
60
  get theme() {
61
- if (!this.themeName) {
62
- throw new Error('🦄 No theme selected!');
63
- }
64
- const theme = _state.UnistylesState.themes.get(this.themeName);
65
- if (!theme) {
66
- throw new Error(`🦄 Theme "${this.themeName}" is not registered!`);
67
- }
68
- return theme;
61
+ return this.getTheme(this.themeName);
69
62
  }
70
63
  get pixelRatio() {
71
64
  return (0, _utils.isServer)() ? 1 : window.devicePixelRatio;
@@ -112,7 +105,8 @@ class UnistylesRuntimeBuilder {
112
105
  themeName: this.themeName,
113
106
  contentSizeCategory: this.contentSizeCategory,
114
107
  breakpoint: this.breakpoint,
115
- orientation: this.orientation,
108
+ isLandscape: this.orientation === _types.Orientation.Landscape,
109
+ isPortrait: this.orientation === _types.Orientation.Portrait,
116
110
  pixelRatio: this.pixelRatio,
117
111
  screen: this.screen,
118
112
  fontScale: this.fontScale,
@@ -158,6 +152,16 @@ class UnistylesRuntimeBuilder {
158
152
  }
159
153
  _state.UnistylesState.themes.set(themeName, updater(oldTheme));
160
154
  };
155
+ getTheme = (themeName = this.themeName) => {
156
+ if (!themeName) {
157
+ throw new Error('🦄 No theme selected!');
158
+ }
159
+ const theme = _state.UnistylesState.themes.get(themeName);
160
+ if (!theme) {
161
+ throw new Error(`🦄 Theme "${this.themeName}" is not registered!`);
162
+ }
163
+ return theme;
164
+ };
161
165
  }
162
166
  const UnistylesRuntime = exports.UnistylesRuntime = new UnistylesRuntimeBuilder();
163
167
  //# sourceMappingURL=runtime.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_NativePlatform","require","_types","_types2","_listener","_mock","_state","_utils","UnistylesRuntimeBuilder","lightMedia","getLightMedia","darkMedia","getDarkMedia","isServer","window","matchMedia","colorScheme","matches","ColorScheme","Light","Dark","Unspecified","themeName","UnistylesState","contentSizeCategory","WebContentSizeCategory","breakpoint","orientation","Orientation","Portrait","screen","type","includes","Landscape","theme","Error","themes","get","pixelRatio","devicePixelRatio","width","height","innerWidth","innerHeight","fontScale","insets","top","bottom","left","right","ime","statusBar","StatusBar","rtl","document","documentElement","dir","hasAdaptiveThemes","navigationBar","NavigationBar","miniRuntime","setTheme","UnistylesRuntime","UnistylesListener","emitChange","UnistyleDependency","Theme","ThemeName","setAdaptiveThemes","isEnabled","schemeToTheme","setRootViewBackgroundColor","hex","alpha","style","backgroundColor","hexToRGBA","setIm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B,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_NativePlatform","require","_types","_types2","_listener","_mock","_state","_utils","UnistylesRuntimeBuilder","lightMedia","getLightMedia","darkMedia","getDarkMedia","isServer","window","matchMedia","colorScheme","matches","ColorScheme","Light","Dark","Unspecified","themeName","UnistylesState","contentSizeCategory","WebContentSizeCategory","breakpoint","orientation","Orientation","Portrait","screen","type","includes","Landscape","theme","getTheme","pixelRatio","devicePixelRatio","width","height","innerWidth","innerHeight","fontScale","insets","top","bottom","left","right","ime","statusBar","StatusBar","rtl","document","documentElement","dir","hasAdaptiveThemes","navigationBar","NavigationBar","miniRuntime","isLandscape","isPortrait","setTheme","UnistylesRuntime","UnistylesListener","emitChange","UnistyleDependency","Theme","ThemeName","setAdaptiveThemes","isEnabled","schemeToTheme","setRootViewBackgroundColor","hex","alpha","style","backgroundColor","hexToRGBA","setImmersiveMode","updateTheme","updater","oldTheme","themes","get","Error","set","exports"],"sourceRoot":"../../../src","sources":["web/runtime.ts"],"mappings":";;;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAEA,MAAMO,uBAAuB,CAAC;EAC1BC,UAAU,GAAG,IAAI,CAACC,aAAa,CAAC,CAAC;EACjCC,SAAS,GAAG,IAAI,CAACC,YAAY,CAAC,CAAC;EAEvBF,aAAaA,CAAA,EAA0B;IAC3C,IAAI,IAAAG,eAAQ,EAAC,CAAC,EAAE;MACZ,OAAO,IAAI;IACf;IAEA,IAAI,CAAC,IAAI,CAACJ,UAAU,EAAE;MAClB,IAAI,CAACA,UAAU,GAAGK,MAAM,CAACC,UAAU,CAAC,+BAA+B,CAAC;IACxE;IAEA,OAAO,IAAI,CAACN,UA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W,GAAGA,CAACxD,SAAuB,EAAEyD,OAA6C,KAAK;IACtF,MAAMC,QAAQ,GAAGzD,qBAAc,CAAC0D,MAAM,CAACC,GAAG,CAAC5D,SAAS,CAAC;IAErD,IAAI,CAAC0D,QAAQ,EAAE;MACX,MAAM,IAAIG,KAAK,CAAC,aAAa7D,SAAS,sBAAsB,CAAC;IACjE;IAEAC,qBAAc,CAAC0D,MAAM,CAACG,GAAG,CAAC9D,SAAS,EAAEyD,OAAO,CAACC,QAAQ,CAAC,CAAC;EAC3D,CAAC;EAED7C,QAAQ,GAAGA,CAACb,SAAS,GAAG,IAAI,CAACA,SAAS,KAAK;IACvC,IAAI,CAACA,SAAS,EAAE;MACZ,MAAM,IAAI6D,KAAK,CAAC,uBAAuB,CAAC;IAC5C;IAEA,MAAMjD,KAAK,GAAGX,qBAAc,CAAC0D,MAAM,CAACC,GAAG,CAAC5D,SAAS,CAAC;IAElD,IAAI,CAACY,KAAK,EAAE;MACR,MAAM,IAAIiD,KAAK,CAAC,aAAa,IAAI,CAAC7D,SAAS,sBAAsB,CAAC;IACtE;IAEA,OAAOY,KAAK;EAChB,CAAC;AACL;AAEO,MAAM4B,gBAAgB,GAAAuB,OAAA,CAAAvB,gBAAA,GAAG,IAAItD,uBAAuB,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ export { useBreakpoint } from './useBreakpoint';
4
+ export { useTheme } from './useTheme';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useBreakpoint","useTheme"],"sourceRoot":"../../../src","sources":["core/index.ts"],"mappings":";;AAAA,SAASA,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,QAAQ,QAAQ,YAAY","ignoreList":[]}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ import { useEffect, useState } from 'react';
4
+ import { UnistylesRuntime } from '../web';
5
+ import { UnistylesListener } from '../web/listener';
6
+ import { UnistyleDependency } from '../specs/NativePlatform';
7
+ export const useBreakpoint = () => {
8
+ const [breakpoint, setBreakpoint] = useState(UnistylesRuntime.breakpoint);
9
+ useEffect(() => {
10
+ const removeChangeListener = UnistylesListener.addListeners([UnistyleDependency.Breakpoints], () => setBreakpoint(UnistylesRuntime.breakpoint));
11
+ return () => {
12
+ removeChangeListener();
13
+ };
14
+ }, []);
15
+ return breakpoint;
16
+ };
17
+ //# sourceMappingURL=useBreakpoint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useEffect","useState","UnistylesRuntime","UnistylesListener","UnistyleDependency","useBreakpoint","breakpoint","setBreakpoint","removeChangeListener","addListeners","Breakpoints"],"sourceRoot":"../../../src","sources":["core/useBreakpoint.ts"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC3C,SAASC,gBAAgB,QAAQ,QAAQ;AACzC,SAASC,iBAAiB,QAAQ,iBAAiB;AACnD,SAASC,kBAAkB,QAAQ,yBAAyB;AAE5D,OAAO,MAAMC,aAAa,GAAGA,CAAA,KAAM;EAC/B,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAGN,QAAQ,CAACC,gBAAgB,CAACI,UAAU,CAAC;EAEzEN,SAAS,CAAC,MAAM;IACZ,MAAMQ,oBAAoB,GAAGL,iBAAiB,CAACM,YAAY,CAAC,CAACL,kBAAkB,CAACM,WAAW,CAAC,EAAE,MAAMH,aAAa,CAACL,gBAAgB,CAACI,UAAU,CAAC,CAAC;IAE/I,OAAO,MAAM;MACTE,oBAAoB,CAAC,CAAC;IAC1B,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOF,UAAU;AACrB,CAAC","ignoreList":[]}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ import { useEffect, useState } from 'react';
4
+ import { StyleSheet, UnistyleDependency, UnistylesRuntime } from '../specs';
5
+ export const useBreakpoint = () => {
6
+ const [breakpoint, setBreakpoint] = useState(UnistylesRuntime.breakpoint);
7
+ useEffect(() => {
8
+ const removeChangeListener = StyleSheet.addChangeListener(dependencies => {
9
+ if (dependencies.includes(UnistyleDependency.Breakpoints)) {
10
+ setBreakpoint(UnistylesRuntime.breakpoint);
11
+ }
12
+ });
13
+ return () => {
14
+ removeChangeListener();
15
+ };
16
+ }, []);
17
+ return breakpoint;
18
+ };
19
+ //# sourceMappingURL=useBreakpoint.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useEffect","useState","StyleSheet","UnistyleDependency","UnistylesRuntime","useBreakpoint","breakpoint","setBreakpoint","removeChangeListener","addChangeListener","dependencies","includes","Breakpoints"],"sourceRoot":"../../../src","sources":["core/useBreakpoint.native.ts"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC3C,SAASC,UAAU,EAAEC,kBAAkB,EAAEC,gBAAgB,QAAQ,UAAU;AAG3E,OAAO,MAAMC,aAAa,GAAGA,CAAA,KAAM;EAC/B,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAGN,QAAQ,CAACG,gBAAgB,CAACE,UAAU,CAAC;EAEzEN,SAAS,CAAC,MAAM;IACZ,MAAMQ,oBAAoB,GAAIN,UAAU,CAAyBO,iBAAiB,CAACC,YAAY,IAAI;MAC/F,IAAIA,YAAY,CAACC,QAAQ,CAACR,kBAAkB,CAACS,WAAW,CAAC,EAAE;QACvDL,aAAa,CAACH,gBAAgB,CAACE,UAAU,CAAC;MAC9C;IACJ,CAAC,CAAC;IAEF,OAAO,MAAM;MACTE,oBAAoB,CAAC,CAAC;IAC1B,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOF,UAAU;AACrB,CAAC","ignoreList":[]}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ import { useEffect, useState } from 'react';
4
+ import { UnistylesRuntime } from '../web';
5
+ import { UnistylesListener } from '../web/listener';
6
+ import { UnistyleDependency } from '../specs/NativePlatform';
7
+ export const useTheme = () => {
8
+ const [theme, setTheme] = useState(UnistylesRuntime.getTheme());
9
+ useEffect(() => {
10
+ const removeChangeListener = UnistylesListener.addListeners([UnistyleDependency.Theme], () => setTheme(UnistylesRuntime.getTheme()));
11
+ return () => {
12
+ removeChangeListener();
13
+ };
14
+ }, []);
15
+ return theme;
16
+ };
17
+ //# sourceMappingURL=useTheme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useEffect","useState","UnistylesRuntime","UnistylesListener","UnistyleDependency","useTheme","theme","setTheme","getTheme","removeChangeListener","addListeners","Theme"],"sourceRoot":"../../../src","sources":["core/useTheme.ts"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC3C,SAASC,gBAAgB,QAAQ,QAAQ;AACzC,SAASC,iBAAiB,QAAQ,iBAAiB;AACnD,SAASC,kBAAkB,QAAQ,yBAAyB;AAE5D,OAAO,MAAMC,QAAQ,GAAGA,CAAA,KAAM;EAC1B,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGN,QAAQ,CAACC,gBAAgB,CAACM,QAAQ,CAAC,CAAC,CAAC;EAE/DR,SAAS,CAAC,MAAM;IACZ,MAAMS,oBAAoB,GAAGN,iBAAiB,CAACO,YAAY,CAAC,CAACN,kBAAkB,CAACO,KAAK,CAAC,EAAE,MAAMJ,QAAQ,CAACL,gBAAgB,CAACM,QAAQ,CAAC,CAAC,CAAC,CAAC;IAEpI,OAAO,MAAM;MACTC,oBAAoB,CAAC,CAAC;IAC1B,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOH,KAAK;AAChB,CAAC","ignoreList":[]}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ import { useEffect, useState } from 'react';
4
+ import { StyleSheet, UnistyleDependency, UnistylesRuntime } from '../specs';
5
+ export const useTheme = () => {
6
+ const [theme, setTheme] = useState(UnistylesRuntime.getTheme());
7
+ useEffect(() => {
8
+ const removeChangeListener = StyleSheet.addChangeListener(dependencies => {
9
+ if (dependencies.includes(UnistyleDependency.Theme)) {
10
+ setTheme(UnistylesRuntime.getTheme());
11
+ }
12
+ });
13
+ return () => {
14
+ removeChangeListener();
15
+ };
16
+ }, []);
17
+ return theme;
18
+ };
19
+ //# sourceMappingURL=useTheme.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useEffect","useState","StyleSheet","UnistyleDependency","UnistylesRuntime","useTheme","theme","setTheme","getTheme","removeChangeListener","addChangeListener","dependencies","includes","Theme"],"sourceRoot":"../../../src","sources":["core/useTheme.native.ts"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC3C,SAASC,UAAU,EAAEC,kBAAkB,EAAEC,gBAAgB,QAAQ,UAAU;AAG3E,OAAO,MAAMC,QAAQ,GAAGA,CAAA,KAAM;EAC1B,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGN,QAAQ,CAACG,gBAAgB,CAACI,QAAQ,CAAC,CAAC,CAAC;EAE/DR,SAAS,CAAC,MAAM;IACZ,MAAMS,oBAAoB,GAAIP,UAAU,CAAyBQ,iBAAiB,CAACC,YAAY,IAAI;MAC/F,IAAIA,YAAY,CAACC,QAAQ,CAACT,kBAAkB,CAACU,KAAK,CAAC,EAAE;QACjDN,QAAQ,CAACH,gBAAgB,CAACI,QAAQ,CAAC,CAAC,CAAC;MACzC;IACJ,CAAC,CAAC;IAEF,OAAO,MAAM;MACTC,oBAAoB,CAAC,CAAC;IAC1B,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOH,KAAK;AAChB,CAAC","ignoreList":[]}
@@ -1,18 +1,6 @@
1
1
  "use strict";
2
2
 
3
- import React from 'react';
4
3
  export * from './specs';
5
4
  export { mq } from './mq';
6
- // TODO: export Native createUnistylesComponent
7
- // can't import it this way, it will break native build
8
- // export { createUnistylesComponent } from './web/createUnistylesComponent'
9
-
10
- // todo verify true min version
11
- const minReactVersionRequiredByUnistyles = '18.3.1';
12
- if (React.version < minReactVersionRequiredByUnistyles) {
13
- throw new Error(`
14
- You are using an outdated version of React (${React.version}).
15
- Unistyles requires at least React ${minReactVersionRequiredByUnistyles}.
16
- `);
17
- }
5
+ export { useTheme, useBreakpoint } from './core';
18
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","mq","minReactVersionRequiredByUnistyles","version","Error"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,cAAc,SAAS;AACvB,SAASC,EAAE,QAAQ,MAAM;AAEzB;AACA;AACA;;AAEA;AACA,MAAMC,kCAAkC,GAAG,QAAQ;AAEnD,IAAIF,KAAK,CAACG,OAAO,GAAGD,kCAAkC,EAAE;EACpD,MAAM,IAAIE,KAAK,CAAC;AACpB,sDAAsDJ,KAAK,CAACG,OAAO;AACnE,4CAA4CD,kCAAkC;AAC9E,KAAK,CAAC;AACN","ignoreList":[]}
1
+ {"version":3,"names":["mq","useTheme","useBreakpoint"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,cAAc,SAAS;AACvB,SAASA,EAAE,QAAQ,MAAM;AAEzB,SAASC,QAAQ,EAAEC,aAAa,QAAQ,QAAQ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["UnistyleDependency"],"sourceRoot":"../../../../src","sources":["specs/NativePlatform/NativePlatform.nitro.ts"],"mappings":";;AAMA,WAAYA,kBAAkB,0BAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAA,OAAlBA,kBAAkB;AAAA;;AA8B9B;AACA","ignoreList":[]}
1
+ {"version":3,"names":["UnistyleDependency"],"sourceRoot":"../../../../src","sources":["specs/NativePlatform/NativePlatform.nitro.ts"],"mappings":";;AAMA,WAAYA,kBAAkB,0BAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAA,OAAlBA,kBAAkB;AAAA;;AA+B9B;AACA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["processColor","attachNavigationBarJSMethods","hybridObject","privateHybrid","_setBackgroundColor","setBackgroundColor","color","parsedColor"],"sourceRoot":"../../../../src","sources":["specs/NavigtionBar/index.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,cAAc;AAS3C,OAAO,MAAMC,4BAA4B,GAAIC,YAAoC,IAAK;EAClF,MAAMC,aAAa,GAAGD,YAA6C;EAEnEC,aAAa,CAACC,mBAAmB,GAAGF,YAAY,CAACG,kBAAkB;EACnEH,YAAY,CAACG,kBAAkB,GAAIC,KAAc,IAAK;IAClD,MAAMC,WAAW,GAAGP,YAAY,CAACM,KAAK,CAAC,IAAI,CAAC;IAE5CH,aAAa,CAACC,mBAAmB,CAACG,WAAqB,CAAC;EAC5D,CAAC;AACL,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["processColor","attachNavigationBarJSMethods","hybridObject","privateHybrid","_setBackgroundColor","setBackgroundColor","color","parsedColor"],"sourceRoot":"../../../../src","sources":["specs/NavigtionBar/index.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,cAAc;AAc3C,OAAO,MAAMC,4BAA4B,GAAIC,YAAoC,IAAK;EAClF,MAAMC,aAAa,GAAGD,YAA6C;EAEnEC,aAAa,CAACC,mBAAmB,GAAGF,YAAY,CAACG,kBAAkB;EACnEH,YAAY,CAACG,kBAAkB,GAAIC,KAAc,IAAK;IAClD,MAAMC,WAAW,GAAGP,YAAY,CAACM,KAAK,CAAC,IAAI,CAAC;IAE5CH,aAAa,CAACC,mBAAmB,CAACG,WAAqB,CAAC;EAC5D,CAAC;AACL,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["processColor","StatusBar","NativeStatusBar","StatusBarStyle","attachStatusBarJSMethods","hybridObject","setStyle","style","animated","Light","setBarStyle","Dark","Default","privateHybrid","_setHidden","setHidden","isHidden","animation","_setBackgroundColor","setBackgroundColor","color","parsedColor"],"sourceRoot":"../../../../src","sources":["specs/StatusBar/index.ts"],"mappings":";;AAAA,SAASA,YAAY,EAAEC,SAAS,IAAIC,eAAe,QAAQ,cAAc;AAEzE,SAAqBC,cAAc,QAAQ,UAAU;AAYrD,OAAO,MAAMC,wBAAwB,GAAIC,YAAgC,IAAK;EAC1EA,YAAY,CAACC,QAAQ,GAAG,CAACC,KAAqB,EAAEC,QAAkB,KAAK;IACnE,QAAQD,KAAK;MACT,KAAKJ,cAAc,CAACM,KAAK;QACrB,OAAOP,eAAe,CAACQ,WAAW,CAAC,eAAe,EAAEF,QAAQ,CAAC;MACjE,KAAKL,cAAc,CAACQ,IAAI;QACpB,OAAOT,eAAe,CAACQ,WAAW,CAAC,cAAc,EAAEF,QAAQ,CAAC;MAChE,KAAKL,cAAc,CAACS,OAAO;QACvB,OAAOV,eAAe,CAACQ,WAAW,CAAC,SAAS,EAAEF,QAAQ,CAAC;IAC/D;EACJ,CAAC;EAED,MAAMK,aAAa,GAAGR,YAAyC;EAE/DQ,aAAa,CAACC,UAAU,GAAGT,YAAY,CAACU,SAAS;EACjDV,YAAY,CAACU,SAAS,GAAG,CAACC,QAAiB,EAAEC,SAAoC,KAAK;IAClFf,eAAe,CAACa,SAAS,CAACC,QAAQ,EAAEC,SAAS,CAAC;IAC9CJ,aAAa,CAACC,UAAU,CAACE,QAAQ,CAAC;EACtC,CAAC;EAEDH,aAAa,CAACK,mBAAmB,GAAGb,YAAY,CAACc,kBAAkB;EACnEd,YAAY,CAACc,kBAAkB,GAAIC,KAAc,IAAK;IAClD,MAAMC,WAAW,GAAGrB,YAAY,CAACoB,KAAK,CAAC,IAAI,CAAC;IAE5CP,aAAa,CAACK,mBAAmB,CAACG,WAAqB,CAAC;EAC5D,CAAC;AACL,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["processColor","StatusBar","NativeStatusBar","StatusBarStyle","attachStatusBarJSMethods","hybridObject","setStyle","style","animated","Light","setBarStyle","Dark","Default","privateHybrid","_setHidden","setHidden","isHidden","animation","_setBackgroundColor","setBackgroundColor","color","parsedColor"],"sourceRoot":"../../../../src","sources":["specs/StatusBar/index.ts"],"mappings":";;AAAA,SAASA,YAAY,EAAEC,SAAS,IAAIC,eAAe,QAAQ,cAAc;AAEzE,SAAqBC,cAAc,QAAQ,UAAU;AAiBrD,OAAO,MAAMC,wBAAwB,GAAIC,YAAgC,IAAK;EAC1EA,YAAY,CAACC,QAAQ,GAAG,CAACC,KAAqB,EAAEC,QAAkB,KAAK;IACnE,QAAQD,KAAK;MACT,KAAKJ,cAAc,CAACM,KAAK;QACrB,OAAOP,eAAe,CAACQ,WAAW,CAAC,eAAe,EAAEF,QAAQ,CAAC;MACjE,KAAKL,cAAc,CAACQ,IAAI;QACpB,OAAOT,eAAe,CAACQ,WAAW,CAAC,cAAc,EAAEF,QAAQ,CAAC;MAChE,KAAKL,cAAc,CAACS,OAAO;QACvB,OAAOV,eAAe,CAACQ,WAAW,CAAC,SAAS,EAAEF,QAAQ,CAAC;IAC/D;EACJ,CAAC;EAED,MAAMK,aAAa,GAAGR,YAAyC;EAE/DQ,aAAa,CAACC,UAAU,GAAGT,YAAY,CAACU,SAAS;EACjDV,YAAY,CAACU,SAAS,GAAG,CAACC,QAAiB,EAAEC,SAAoC,KAAK;IAClFf,eAAe,CAACa,SAAS,CAACC,QAAQ,EAAEC,SAAS,CAAC;IAC9CJ,aAAa,CAACC,UAAU,CAACE,QAAQ,CAAC;EACtC,CAAC;EAEDH,aAAa,CAACK,mBAAmB,GAAGb,YAAY,CAACc,kBAAkB;EACnEd,YAAY,CAACc,kBAAkB,GAAIC,KAAc,IAAK;IAClD,MAAMC,WAAW,GAAGrB,YAAY,CAACoB,KAAK,CAAC,IAAI,CAAC;IAE5CP,aAAa,CAACK,mBAAmB,CAACG,WAAqB,CAAC;EAC5D,CAAC;AACL,CAAC","ignoreList":[]}
@@ -10,5 +10,6 @@ HybridUnistylesStyleSheet.compose = NativeStyleSheet.compose;
10
10
  HybridUnistylesStyleSheet.jsMethods = {
11
11
  processColor
12
12
  };
13
+ HybridUnistylesStyleSheet.init();
13
14
  export const StyleSheet = HybridUnistylesStyleSheet;
14
15
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["NitroModules","processColor","StyleSheet","NativeStyleSheet","HybridUnistylesStyleSheet","createHybridObject","absoluteFillObject","absoluteFill","flatten","compose","jsMethods"],"sourceRoot":"../../../../src","sources":["specs/StyleSheet/index.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;AACzD,SAASC,YAAY,EAAEC,UAAU,IAAIC,gBAAgB,QAAQ,cAAc;AA+B3E,MAAMC,yBAAyB,GAAGJ,YAAY,CACzCK,kBAAkB,CAAsB,qBAAqB,CAAC;AAEnED,yBAAyB,CAACE,kBAAkB,GAAGH,gBAAgB,CAACG,kBAAkB;AAClFF,yBAAyB,CAACG,YAAY,GAAGJ,gBAAgB,CAACI,YAAY;AACtEH,yBAAyB,CAACI,OAAO,GAAGL,gBAAgB,CAACK,OAAO;AAC5DJ,yBAAyB,CAACK,OAAO,GAAGN,gBAAgB,CAACM,OAAO;AAC5DL,yBAAyB,CAACM,SAAS,GAAG;EAClCT;AACJ,CAAC;AAID,OAAO,MAAMC,UAAU,GAAGE,yBAAsE","ignoreList":[]}
1
+ {"version":3,"names":["NitroModules","processColor","StyleSheet","NativeStyleSheet","HybridUnistylesStyleSheet","createHybridObject","absoluteFillObject","absoluteFill","flatten","compose","jsMethods","init"],"sourceRoot":"../../../../src","sources":["specs/StyleSheet/index.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;AACzD,SAASC,YAAY,EAAEC,UAAU,IAAIC,gBAAgB,QAAQ,cAAc;AAgC3E,MAAMC,yBAAyB,GAAGJ,YAAY,CACzCK,kBAAkB,CAAsB,qBAAqB,CAAC;AAEnED,yBAAyB,CAACE,kBAAkB,GAAGH,gBAAgB,CAACG,kBAAkB;AAClFF,yBAAyB,CAACG,YAAY,GAAGJ,gBAAgB,CAACI,YAAY;AACtEH,yBAAyB,CAACI,OAAO,GAAGL,gBAAgB,CAACK,OAAO;AAC5DJ,yBAAyB,CAACK,OAAO,GAAGN,gBAAgB,CAACM,OAAO;AAC5DL,yBAAyB,CAACM,SAAS,GAAG;EAClCT;AACJ,CAAC;AAEDG,yBAAyB,CAACO,IAAI,CAAC,CAAC;AAIhC,OAAO,MAAMT,UAAU,GAAGE,yBAAsE","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["processColor","NitroModules","attachStatusBarJSMethods","attachNavigationBarJSMethods","isIOS","HybridUnistylesRuntime","createHybridObject","statusBar","createHybridStatusBar","navigationBar","createHybridNavigationBar","_setRootViewBackgroundColor","setRootViewBackgroundColor","color","parsedColor","setImmersiveMode","isEnabled","setHidden","Runtime"],"sourceRoot":"../../../../src","sources":["specs/UnistylesRuntime/index.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,cAAc;AAC3C,SAASC,YAAY,QAAQ,4BAA4B;AAGzD,SAASC,wBAAwB,QAAiC,cAAc;AAChF,SAASC,4BAA4B,QAAqC,iBAAiB;AAE3F,SAASC,KAAK,QAAQ,cAAc;AAgCpC,MAAMC,sBAAsB,GAAGJ,YAAY,CACtCK,kBAAkB,CAA0B,kBAAkB,CAAC;AAEpED,sBAAsB,CAACE,SAAS,GAAGF,sBAAsB,CAACG,qBAAqB,CAAC,CAAC;AACjFH,sBAAsB,CAACI,aAAa,GAAGJ,sBAAsB,CAACK,yBAAyB,CAAC,CAAC;AACzFL,sBAAsB,CAACM,2BAA2B,GAAGN,sBAAsB,CAACO,0BAA0B;AAEtGP,sBAAsB,CAACO,0BAA0B,GAAIC,KAAc,IAAK;EACpE,MAAMC,WAAW,GAAGd,YAAY,CAACa,KAAK,CAAC,IAAI,CAAC;EAE5CR,sBAAsB,CAACM,2BAA2B,CAACG,WAAqB,CAAC;AAC7E,CAAC;AAED,IAAIV,KAAK,EAAE;EACPC,sBAAsB,CAACU,gBAAgB,GAAIC,SAAkB,IAAKX,sBAAsB,CAACE,SAAS,CAACU,SAAS,CAACD,SAAS,EAAE,MAAM,CAAC;AACnI;AAEAd,wBAAwB,CAACG,sBAAsB,CAACE,SAAS,CAAC;AAC1DJ,4BAA4B,CAACE,sBAAsB,CAACI,aAAa,CAAC;AAElE,OAAO,MAAMS,OAAO,GAAGb,sBAA0C","ignoreList":[]}
1
+ {"version":3,"names":["processColor","NitroModules","attachStatusBarJSMethods","attachNavigationBarJSMethods","isIOS","HybridUnistylesRuntime","createHybridObject","statusBar","createHybridStatusBar","navigationBar","createHybridNavigationBar","_setRootViewBackgroundColor","setRootViewBackgroundColor","color","parsedColor","setImmersiveMode","isEnabled","setHidden","Runtime"],"sourceRoot":"../../../../src","sources":["specs/UnistylesRuntime/index.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,cAAc;AAC3C,SAASC,YAAY,QAAQ,4BAA4B;AAGzD,SAASC,wBAAwB,QAAiC,cAAc;AAChF,SAASC,4BAA4B,QAAqC,iBAAiB;AAE3F,SAASC,KAAK,QAAQ,cAAc;AAkCpC,MAAMC,sBAAsB,GAAGJ,YAAY,CACtCK,kBAAkB,CAA0B,kBAAkB,CAAC;AAEpED,sBAAsB,CAACE,SAAS,GAAGF,sBAAsB,CAACG,qBAAqB,CAAC,CAAC;AACjFH,sBAAsB,CAACI,aAAa,GAAGJ,sBAAsB,CAACK,yBAAyB,CAAC,CAAC;AACzFL,sBAAsB,CAACM,2BAA2B,GAAGN,sBAAsB,CAACO,0BAA0B;AAEtGP,sBAAsB,CAACO,0BAA0B,GAAIC,KAAc,IAAK;EACpE,MAAMC,WAAW,GAAGd,YAAY,CAACa,KAAK,CAAC,IAAI,CAAC;EAE5CR,sBAAsB,CAACM,2BAA2B,CAACG,WAAqB,CAAC;AAC7E,CAAC;AAED,IAAIV,KAAK,EAAE;EACPC,sBAAsB,CAACU,gBAAgB,GAAIC,SAAkB,IAAKX,sBAAsB,CAACE,SAAS,CAACU,SAAS,CAACD,SAAS,EAAE,MAAM,CAAC;AACnI;AAEAd,wBAAwB,CAACG,sBAAsB,CAACE,SAAS,CAAC;AAC1DJ,4BAA4B,CAACE,sBAAsB,CAACI,aAAa,CAAC;AAElE,OAAO,MAAMS,OAAO,GAAGb,sBAA0C","ignoreList":[]}
@@ -5,6 +5,7 @@ import { Runtime } from './UnistylesRuntime';
5
5
  import { StyleSheet } from './StyleSheet';
6
6
  import { UnistylesShadowRegistry } from './ShadowRegistry';
7
7
  import { StatusBarStyle, ColorScheme, Orientation } from './types';
8
- export { StatusBarStyle, ColorScheme, Orientation };
8
+ import { UnistyleDependency } from './NativePlatform';
9
+ export { StatusBarStyle, ColorScheme, Orientation, UnistyleDependency };
9
10
  export { UnistylesShadowRegistry, Runtime as UnistylesRuntime, StyleSheet };
10
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Runtime","StyleSheet","UnistylesShadowRegistry","StatusBarStyle","ColorScheme","Orientation","UnistylesRuntime"],"sourceRoot":"../../../src","sources":["specs/index.ts"],"mappings":";;AAAA,OAAO,kBAAkB;AAEzB,SAASA,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,uBAAuB,QAAQ,kBAAkB;AAE1D,SAASC,cAAc,EAAEC,WAAW,EAAEC,WAAW,QAAQ,SAAS;AAElE,SACIF,cAAc,EACdC,WAAW,EACXC,WAAW;AAGf,SACIH,uBAAuB,EACvBF,OAAO,IAAIM,gBAAgB,EAC3BL,UAAU","ignoreList":[]}
1
+ {"version":3,"names":["Runtime","StyleSheet","UnistylesShadowRegistry","StatusBarStyle","ColorScheme","Orientation","UnistyleDependency","UnistylesRuntime"],"sourceRoot":"../../../src","sources":["specs/index.ts"],"mappings":";;AAAA,OAAO,kBAAkB;AAEzB,SAASA,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,UAAU,QAAQ,cAAc;AAEzC,SAASC,uBAAuB,QAAQ,kBAAkB;AAE1D,SAASC,cAAc,EAAEC,WAAW,EAAEC,WAAW,QAAQ,SAAS;AAClE,SAASC,kBAAkB,QAAQ,kBAAkB;AAErD,SACIH,cAAc,EACdC,WAAW,EACXC,WAAW,EACXC,kBAAkB;AAGtB,SACIJ,uBAAuB,EACvBF,OAAO,IAAIO,gBAAgB,EAC3BN,UAAU","ignoreList":[]}
@@ -54,14 +54,7 @@ class UnistylesRuntimeBuilder {
54
54
  return screen.orientation.type.includes('portrait') ? Orientation.Portrait : Orientation.Landscape;
55
55
  }
56
56
  get theme() {
57
- if (!this.themeName) {
58
- throw new Error('🦄 No theme selected!');
59
- }
60
- const theme = UnistylesState.themes.get(this.themeName);
61
- if (!theme) {
62
- throw new Error(`🦄 Theme "${this.themeName}" is not registered!`);
63
- }
64
- return theme;
57
+ return this.getTheme(this.themeName);
65
58
  }
66
59
  get pixelRatio() {
67
60
  return isServer() ? 1 : window.devicePixelRatio;
@@ -108,7 +101,8 @@ class UnistylesRuntimeBuilder {
108
101
  themeName: this.themeName,
109
102
  contentSizeCategory: this.contentSizeCategory,
110
103
  breakpoint: this.breakpoint,
111
- orientation: this.orientation,
104
+ isLandscape: this.orientation === Orientation.Landscape,
105
+ isPortrait: this.orientation === Orientation.Portrait,
112
106
  pixelRatio: this.pixelRatio,
113
107
  screen: this.screen,
114
108
  fontScale: this.fontScale,
@@ -154,6 +148,16 @@ class UnistylesRuntimeBuilder {
154
148
  }
155
149
  UnistylesState.themes.set(themeName, updater(oldTheme));
156
150
  };
151
+ getTheme = (themeName = this.themeName) => {
152
+ if (!themeName) {
153
+ throw new Error('🦄 No theme selected!');
154
+ }
155
+ const theme = UnistylesState.themes.get(themeName);
156
+ if (!theme) {
157
+ throw new Error(`🦄 Theme "${this.themeName}" is not registered!`);
158
+ }
159
+ return theme;
160
+ };
157
161
  }
158
162
  export const UnistylesRuntime = new UnistylesRuntimeBuilder();
159
163
  //# sourceMappingURL=runtime.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["UnistyleDependency","ColorScheme","Orientation","WebContentSizeCategory","UnistylesListener","NavigationBar","StatusBar","UnistylesState","hexToRGBA","isServer","schemeToTheme","UnistylesRuntimeBuilder","lightMedia","getLightMedia","darkMedia","getDarkMedia","window","matchMedia","colorScheme","matches","Light","Dark","Unspecified","themeName","contentSizeCategory","breakpoint","orientation","Portrait","screen","type","includes","Landscape","theme","Error","themes","get","pixelRatio","devicePixelRatio","width","height","innerWidth","innerHeight","fontScale","insets","top","bottom","left","right","ime","statusBar","rtl","document","documentElement","dir","hasAdaptiveThemes","navigationBar","miniRuntime","setTheme","UnistylesRuntime","emitChange","Theme","ThemeName","setAdaptiveThemes","isEnabled","setRootViewBackgroundColor","hex","alpha","style","backgroundColor","setImmersiveMode","updateTheme","updater","oldTheme","set"],"sourceRoot":"../../../src","sources":["web/runtime.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,yBAAyB;AAC5D,SAASC,WAAW,EAAEC,WAAW,QAA0C,gBAAgB;AAE3F,SAASC,sBAAsB,QAAQ,UAAU;AACjD,SAASC,iBAAiB,QAAQ,YAAY;AAC9C,SAASC,aAAa,EAAEC,SAAS,QAAQ,QAAQ;AACjD,SAASC,cAAc,QAAQ,SAAS;AACxC,SAASC,SAAS,EAAEC,QAAQ,EAAEC,aAAa,QAAQ,SAAS;AAE5D,MAAMC,uBAAuB,CAAC;EAC1BC,UAAU,GAAG,IAAI,CAACC,aAAa,CAAC,CAAC;EACjCC,SAAS,GAAG,IAAI,CAACC,YAAY,CAAC,CAAC;EAEvBF,aAAaA,CAAA,EAA0B;IAC3C,IAAIJ,QAAQ,CAAC,CAAC,EAAE;MACZ,OAAO,IAAI;IACf;IAEA,IAAI,CAAC,IAAI,CAACG,UAAU,EAAE;MAClB,IAAI,CAACA,UAAU,GAAGI,MAAM,CAACC,UAAU,CAAC,+BAA+B,CAAC;IACxE;IAEA,OAAO,IAAI,CAACL,UAAU;EAC1B;EAEQG,YAAYA,CAAA,EAA0B;IAC1C,IAAIN,QAAQ,CAAC,CAAC,EAAE;MACZ,OAAO,IAAI;IACf;IAEA,IAAI,CAAC,IAAI,CAACK,SAAS,EAAE;MACjB,IAAI,CAACA,SAAS,GAAGE,MAAM,CAACC,UAAU,CAAC,8BAA8B,CAAC;IACtE;IAEA,OAAO,IAAI,CAACH,SAAS;EACzB;EAEA,IAAII,WAAWA,CAAA,EAAG;IACd,QAAQ,IAAI;MACR,KAAK,IAAI,CAACL,aAAa,CAAC,CAAC,EAAEM,OAAO;QAC9B,OAAOlB,WAAW,CAACmB,KAAK;MAC5B,KAAK,IAAI,CAACL,YAAY,CAAC,CAAC,EAAEI,OAAO;QAC7B,OAAOlB,WAAW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OAAO,MAAMd,gBAAgB,GAAG,IAAI/C,uBAAuB,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["UnistyleDependency","ColorScheme","Orientation","WebContentSizeCategory","UnistylesListener","NavigationBar","StatusBar","UnistylesState","hexToRGBA","isServer","schemeToTheme","UnistylesRuntimeBuilder","lightMedia","getLightMedia","darkMedia","getDarkMedia","window","matchMedia","colorScheme","matches","Light","Dark","Unspecified","themeName","contentSizeCategory","breakpoint","orientation","Portrait","screen","type","includes","Landscape","theme","getTheme","pixelRatio","devicePixelRatio","width","height","innerWidth","innerHeight","fontScale","insets","top","bottom","left","right","ime","statusBar","rtl","document","documentElement","dir","hasAdaptiveThemes","navigationBar","miniRuntime","isLandscape","isPortrait","setTheme","UnistylesRuntime","emitChange","Theme","ThemeName","setAdaptiveThemes","isEnabled","setRootViewBackgroundColor","hex","alpha","style","backgroundColor","setImmersiveMode","updateTheme","updater","oldTheme","themes","get","Error","set"],"sourceRoot":"../../../src","sources":["web/runtime.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,yBAAyB;AAC5D,SAASC,WAAW,EAAEC,WAAW,QAA0C,gBAAgB;AAE3F,SAASC,sBAAsB,QAAQ,UAAU;AACjD,SAASC,iBAAiB,QAAQ,YAAY;AAC9C,SAASC,aAAa,EAAEC,SAAS,QAAQ,QAAQ;AACjD,SAASC,cAAc,QAAQ,SAAS;AACxC,SAASC,SAAS,EAAEC,QAAQ,EAAEC,aAAa,QAAQ,SAAS;AAE5D,MAAMC,uBAAuB,CAAC;EAC1BC,UAAU,GAAG,IAAI,CAACC,aAAa,CAAC,CAAC;EACjCC,SAAS,GAAG,IAAI,CAACC,YAAY,CAAC,CAAC;EAEvBF,aAAaA,CAAA,EAA0B;IAC3C,IAAIJ,QAAQ,CAAC,CAAC,EAAE;MACZ,OAAO,IAAI;IACf;IAEA,IAAI,CAAC,IAAI,CAACG,UAAU,EAAE;MAClB,IAAI,CAACA,UAAU,GAAGI,MAAM,CAACC,U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,CAAA,KAAM,CAAC,CAAC;EAE3BC,WAAW,GAAGA,CAAC/C,SAAuB,EAAEgD,OAA6C,KAAK;IACtF,MAAMC,QAAQ,GAAGjE,cAAc,CAACkE,MAAM,CAACC,GAAG,CAACnD,SAAS,CAAC;IAErD,IAAI,CAACiD,QAAQ,EAAE;MACX,MAAM,IAAIG,KAAK,CAAC,aAAapD,SAAS,sBAAsB,CAAC;IACjE;IAEAhB,cAAc,CAACkE,MAAM,CAACG,GAAG,CAACrD,SAAS,EAAEgD,OAAO,CAACC,QAAQ,CAAC,CAAC;EAC3D,CAAC;EAEDvC,QAAQ,GAAGA,CAACV,SAAS,GAAG,IAAI,CAACA,SAAS,KAAK;IACvC,IAAI,CAACA,SAAS,EAAE;MACZ,MAAM,IAAIoD,KAAK,CAAC,uBAAuB,CAAC;IAC5C;IAEA,MAAM3C,KAAK,GAAGzB,cAAc,CAACkE,MAAM,CAACC,GAAG,CAACnD,SAAS,CAAC;IAElD,IAAI,CAACS,KAAK,EAAE;MACR,MAAM,IAAI2C,KAAK,CAAC,aAAa,IAAI,CAACpD,SAAS,sBAAsB,CAAC;IACtE;IAEA,OAAOS,KAAK;EAChB,CAAC;AACL;AAEA,OAAO,MAAM0B,gBAAgB,GAAG,IAAI/C,uBAAuB,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
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,yBAgBf,CAAA"}
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,12 +1,35 @@
1
1
  import React from 'react';
2
2
  import type { PropsWithChildren } from 'react';
3
- interface TypographyProps extends PropsWithChildren {
3
+ import type { UnistylesVariants } from 'react-native-unistyles';
4
+ interface TypographyProps extends PropsWithChildren, UnistylesVariants<typeof styles> {
4
5
  value: number;
5
- isBold?: boolean;
6
- isCentered?: boolean;
7
- isPrimary?: boolean;
8
- size?: 'large' | 'small';
9
6
  }
10
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
+ };
11
34
  export {};
12
35
  //# sourceMappingURL=Typography.d.ts.map
@@ -1 +1 @@
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;AAI9C,UAAU,eAAgB,SAAQ,iBAAiB;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;CAC5B;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,iBAAiB,CAAC,eAAe,CAoB/D,CAAA"}
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"}
@@ -0,0 +1,3 @@
1
+ export { useBreakpoint } from './useBreakpoint';
2
+ export { useTheme } from './useTheme';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const useBreakpoint: () => "portrait" | "landscape" | "xs" | "sm" | "md" | "lg" | "xl" | undefined;
2
+ //# sourceMappingURL=useBreakpoint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useBreakpoint.d.ts","sourceRoot":"","sources":["../../../../src/core/useBreakpoint.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,aAAa,+EAYzB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const useBreakpoint: () => "portrait" | "landscape" | "xs" | "sm" | "md" | "lg" | "xl" | undefined;
2
+ //# sourceMappingURL=useBreakpoint.native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useBreakpoint.native.d.ts","sourceRoot":"","sources":["../../../../src/core/useBreakpoint.native.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa,+EAgBzB,CAAA"}
@@ -0,0 +1,41 @@
1
+ export declare const useTheme: () => {
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
+ colors: {
16
+ backgroundColor: string;
17
+ typography: string;
18
+ accent: string;
19
+ barbie: string;
20
+ oak: string;
21
+ sky: string;
22
+ fog: string;
23
+ aloes: string;
24
+ blood: string;
25
+ };
26
+ gap: (v: number) => number;
27
+ } | {
28
+ colors: {
29
+ backgroundColor: string;
30
+ typography: string;
31
+ accent: string;
32
+ barbie: string;
33
+ oak: string;
34
+ sky: string;
35
+ fog: string;
36
+ aloes: string;
37
+ blood: string;
38
+ };
39
+ gap: (v: number) => number;
40
+ };
41
+ //# sourceMappingURL=useTheme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../../../src/core/useTheme.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAYpB,CAAA"}
@@ -0,0 +1,41 @@
1
+ export declare const useTheme: () => {
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
+ colors: {
16
+ backgroundColor: string;
17
+ typography: string;
18
+ accent: string;
19
+ barbie: string;
20
+ oak: string;
21
+ sky: string;
22
+ fog: string;
23
+ aloes: string;
24
+ blood: string;
25
+ };
26
+ gap: (v: number) => number;
27
+ } | {
28
+ colors: {
29
+ backgroundColor: string;
30
+ typography: string;
31
+ accent: string;
32
+ barbie: string;
33
+ oak: string;
34
+ sky: string;
35
+ fog: string;
36
+ aloes: string;
37
+ blood: string;
38
+ };
39
+ gap: (v: number) => number;
40
+ };
41
+ //# sourceMappingURL=useTheme.native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTheme.native.d.ts","sourceRoot":"","sources":["../../../../src/core/useTheme.native.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgBpB,CAAA"}
@@ -1,4 +1,6 @@
1
1
  export * from './specs';
2
2
  export { mq } from './mq';
3
3
  export type { UnistylesThemes, UnistylesBreakpoints } from './global';
4
+ export { useTheme, useBreakpoint } from './core';
5
+ export type { UnistylesVariants } from './types';
4
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,SAAS,CAAA;AACvB,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAA;AACzB,YAAY,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAA;AACzB,YAAY,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AACrE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AAChD,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA"}
@@ -28,7 +28,8 @@ export interface UnistylesNativeMiniRuntime {
28
28
  readonly rtl: boolean;
29
29
  readonly statusBar: Dimensions;
30
30
  readonly navigationBar: Dimensions;
31
- readonly orientation: Orientation;
31
+ readonly isPortrait: boolean;
32
+ readonly isLandscape: boolean;
32
33
  }
33
34
  export interface NativePlatform extends HybridObject<{
34
35
  ios: 'swift';
@@ -1 +1 @@
1
- {"version":3,"file":"NativePlat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tD,sBAAsB,CAAC,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;IACjD,kBAAkB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;IAC5C,2BAA2B,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAClD,gBAAgB,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI,CAAC;IAG3C,cAAc,IAAI,0BAA0B,CAAC;IAC7C,wBAAwB,CAAC,QAAQ,EAAE,CAAC,YAAY,EAAE,KAAK,CAAC,kBAAkB,CAAC,KAAK,IAAI,GAAG,IAAI,CAAA;CAC9F"}
@@ -1,6 +1,11 @@
1
1
  import type { UnistylesNavigationBar as UnistylesNavigationBarSpec } from './UnistylesNavigationBar.nitro';
2
2
  import type { Color } from '../types';
3
3
  interface PrivateUnistylesNavigationBar extends Omit<UnistylesNavigationBarSpec, 'setBackgroundColor'> {
4
+ /**
5
+ * Apps targeting Android SDK 35
6
+ * This API is deprecated but continues to affect 3-button navigation
7
+ * @deprecated
8
+ */
4
9
  setBackgroundColor(color?: string): void;
5
10
  _setBackgroundColor(color?: Color): void;
6
11
  }