react-native-unistyles 2.9.2 → 2.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. package/README.md +7 -0
  2. package/android/CMakeLists.txt +12 -3
  3. package/android/src/main/java/com/unistyles/Platform.kt +6 -0
  4. package/ios/platform/Platform_iOS.mm +9 -9
  5. package/lib/commonjs/core/UnistylesRuntime.js +12 -0
  6. package/lib/commonjs/core/UnistylesRuntime.js.map +1 -1
  7. package/lib/commonjs/core/mocks/UnistylesMockedRuntime.js +6 -0
  8. package/lib/commonjs/core/mocks/UnistylesMockedRuntime.js.map +1 -1
  9. package/lib/commonjs/utils/styles.js +4 -0
  10. package/lib/commonjs/utils/styles.js.map +1 -1
  11. package/lib/module/core/UnistylesRuntime.js +12 -0
  12. package/lib/module/core/UnistylesRuntime.js.map +1 -1
  13. package/lib/module/core/mocks/UnistylesMockedRuntime.js +6 -0
  14. package/lib/module/core/mocks/UnistylesMockedRuntime.js.map +1 -1
  15. package/lib/module/utils/styles.js +4 -0
  16. package/lib/module/utils/styles.js.map +1 -1
  17. package/lib/typescript/src/core/UnistylesModule.native.d.ts.map +1 -1
  18. package/lib/typescript/src/core/UnistylesModule.windows.d.ts.map +1 -1
  19. package/lib/typescript/src/core/UnistylesRuntime.d.ts +11 -5
  20. package/lib/typescript/src/core/UnistylesRuntime.d.ts.map +1 -1
  21. package/lib/typescript/src/core/mocks/UnistylesMockedRuntime.d.ts +4 -3
  22. package/lib/typescript/src/core/mocks/UnistylesMockedRuntime.d.ts.map +1 -1
  23. package/lib/typescript/src/createStyleSheet.d.ts.map +1 -1
  24. package/lib/typescript/src/hooks/useCSS.d.ts.map +1 -1
  25. package/lib/typescript/src/hooks/useCSS.native.d.ts.map +1 -1
  26. package/lib/typescript/src/hooks/useVariants.d.ts.map +1 -1
  27. package/lib/typescript/src/index.d.ts +3 -12
  28. package/lib/typescript/src/index.d.ts.map +1 -1
  29. package/lib/typescript/src/normalizer/normalizeStyle.d.ts.map +1 -1
  30. package/lib/typescript/src/types/breakpoints.d.ts +6 -6
  31. package/lib/typescript/src/types/breakpoints.d.ts.map +1 -1
  32. package/lib/typescript/src/types/normalizer.d.ts +1 -1
  33. package/lib/typescript/src/types/normalizer.d.ts.map +1 -1
  34. package/lib/typescript/src/types/stylesheet.d.ts +4 -2
  35. package/lib/typescript/src/types/stylesheet.d.ts.map +1 -1
  36. package/lib/typescript/src/useStyles.d.ts +1 -1
  37. package/lib/typescript/src/useStyles.d.ts.map +1 -1
  38. package/lib/typescript/src/utils/breakpoints.d.ts.map +1 -1
  39. package/lib/typescript/src/utils/mqParser.d.ts.map +1 -1
  40. package/lib/typescript/src/utils/styles.d.ts.map +1 -1
  41. package/package.json +3 -3
  42. package/src/core/UnistylesRuntime.ts +13 -0
  43. package/src/core/mocks/UnistylesMockedRuntime.ts +8 -0
  44. package/src/types/breakpoints.ts +14 -7
  45. package/src/types/normalizer.ts +1 -1
  46. package/src/types/stylesheet.ts +5 -3
  47. package/src/utils/styles.ts +8 -0
package/README.md CHANGED
@@ -28,6 +28,7 @@ Install CocoaPods dependencies / generate native folders with Expo:
28
28
 
29
29
  ```shell
30
30
  pod install
31
+ or
31
32
  npx expo prebuild
32
33
  ```
33
34
 
@@ -68,6 +69,12 @@ npx expo prebuild
68
69
  <a href="https://github.com/mwarger">
69
70
  <img src="https://avatars.githubusercontent.com/u/686823?v=4" height="70px" width="70px" alt="mwarger" />
70
71
  </a>
72
+ <a href="https://github.com/biw">
73
+ <img src="https://avatars.githubusercontent.com/u/6139501?v=4" height="70px" width="70px" alt="biw" />
74
+ </a>
75
+ <a href="https://github.com/happyfloat">
76
+ <img src="https://avatars.githubusercontent.com/u/186333704?s=200&v=4" height="70px" width="70px" alt="happyfloat" />
77
+ </a>
71
78
 
72
79
  ## Past sponsors
73
80
 
@@ -26,10 +26,19 @@ set_target_properties(unistyles PROPERTIES
26
26
  find_package(ReactAndroid REQUIRED CONFIG)
27
27
  find_package(fbjni REQUIRED CONFIG)
28
28
 
29
+ # REACTNATIVE_MERGED_SO doesnt work as of RN 0.76.0-rc.3
30
+ if (ReactAndroid_VERSION_MINOR GREATER_EQUAL 76)
31
+ target_link_libraries(unistyles ReactAndroid::reactnative)
32
+ else()
33
+ target_link_libraries(unistyles
34
+ ReactAndroid::turbomodulejsijni
35
+ ReactAndroid::react_nativemodule_core
36
+ android
37
+ fbjni::fbjni
38
+ )
39
+ endif()
40
+
29
41
  target_link_libraries(unistyles
30
42
  ReactAndroid::jsi
31
- ReactAndroid::turbomodulejsijni
32
- ReactAndroid::react_nativemodule_core
33
- android
34
43
  fbjni::fbjni
35
44
  )
@@ -145,6 +145,12 @@ class Platform(private val reactApplicationContext: ReactApplicationContext) {
145
145
  }
146
146
 
147
147
  val insets = insetsCompat.getInsets(WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout())
148
+ val bottomIME = insetsCompat.getInsets(WindowInsetsCompat.Type.ime()).bottom
149
+
150
+ // fix for keyboard controller, that triggers WindowInsetsListener
151
+ if(!hasAnimatedInsets && bottomIME != 0) {
152
+ return
153
+ }
148
154
 
149
155
  if (!hasAnimatedInsets) {
150
156
  this.insets = Insets(statusBarTopInset, insets.bottom, insets.left, insets.right)
@@ -173,17 +173,17 @@
173
173
  }
174
174
 
175
175
  - (void)setRootViewBackgroundColor:(std::string)color alpha:(float)alpha {
176
- UIViewController *presentedViewController = RCTPresentedViewController();
177
- NSString *colorString = [NSString stringWithUTF8String:color.c_str()];
178
- UIColor *backgroundColor = colorFromHexString(colorString, alpha);
179
-
180
- if (backgroundColor == nil) {
181
- NSLog(@"🦄 Unistyles: Couldn't set rootView to %@ color", colorString);
176
+ dispatch_async(dispatch_get_main_queue(), ^{
177
+ UIViewController *presentedViewController = RCTPresentedViewController();
178
+ NSString *colorString = [NSString stringWithUTF8String:color.c_str()];
179
+ UIColor *backgroundColor = colorFromHexString(colorString, alpha);
182
180
 
183
- return;
184
- }
181
+ if (backgroundColor == nil) {
182
+ NSLog(@"🦄 Unistyles: Couldn't set rootView to %@ color", colorString);
185
183
 
186
- dispatch_async(dispatch_get_main_queue(), ^{
184
+ return;
185
+ }
186
+
187
187
  presentedViewController.view.backgroundColor = backgroundColor;
188
188
  });
189
189
  }
@@ -198,6 +198,18 @@ class UnistylesRuntime {
198
198
  return nearestPixel / pixelRatio;
199
199
  }
200
200
 
201
+ /**
202
+ * Get theme by name
203
+ * @param themeName - The name of the theme to get or current theme if not specified
204
+ * @returns - The theme
205
+ */
206
+ getTheme(themeName) {
207
+ if (!themeName) {
208
+ return this.unistylesRegistry.getTheme(this.themeName);
209
+ }
210
+ return this.unistylesRegistry.getTheme(themeName);
211
+ }
212
+
201
213
  /**
202
214
  * Get the immersive mode (both status bar and navigation bar hidden (Android))
203
215
  * @param isEnabled
@@ -1 +1 @@
1
- {"version":3,"names":["_common","require","_parseColor","UnistylesRuntime","constructor","unistylesBridge","unistylesRegistry","miniRuntime","contentSizeCategory","breakpoint","screen","insets","statusBar","width","height","navigationBar","orientation","pixelRatio","fontScale","hairlineWidth","rtl","colorScheme","hasAdaptiveThemes","themeName","breakpoints","enabledPlugins","screenWidth","screenHeight","setColor","color","alpha","parsedColor","parsedAlpha","parseColor","setHidden","hidden","ScreenOrientation","Landscape","Portrait","parseFloat","toFixed","nearestPixel","Math","trunc","setImmersiveMode","isEnabled","setRootViewBackgroundColor","setTheme","name","hasTheme","useTheme","Error","UnistylesError","ThemeNotRegistered","updateTheme","updater","getTheme","setAdaptiveThemes","enable","useAdaptiveThemes","addPlugin","plugin","removePlugin","exports"],"sourceRoot":"../../../src","sources":["core/UnistylesRuntime.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAIA,IAAAC,WAAA,GAAAD,OAAA;AAEA;AACA;AACA;AACO,MAAME,gBAAgB,CAAC;EAC1BC,WAAWA,CAASC,eAAgC,EAAUC,iBAAmC,EAAE;IAAA,KAA/ED,eAAgC,GAAhCA,eAAgC;IAAA,KAAUC,iBAAmC,GAAnCA,iBAAmC;EAAG;;EAEp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AI,CAACvD,iBAAiB,CAACwD,YAAY,CAACD,MAAM,CAAC;EAC/C,CAAC;AACL;AAACE,OAAA,CAAA5D,gBAAA,GAAAA,gBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_common","require","_parseColor","UnistylesRuntime","constructor","unistylesBridge","unistylesRegistry","miniRuntime","contentSizeCategory","breakpoint","screen","insets","statusBar","width","height","navigationBar","orientation","pixelRatio","fontScale","hairlineWidth","rtl","colorScheme","hasAdaptiveThemes","themeName","breakpoints","enabledPlugins","screenWidth","screenHeight","setColor","color","alpha","parsedColor","parsedAlpha","parseColor","setHidden","hidden","ScreenOrientation","Landscape","Portrait","parseFloat","toFixed","nearestPixel","Math","trunc","getTheme","setImmersiveMode","isEnabled","setRootViewBackgroundColor","setTheme","name","hasTheme","useTheme","Error","UnistylesError","ThemeNotRegistered","updateTheme","updater","setAdaptiveThemes","enable","useAdaptiveThemes","addPlugin","plugin","removePlugin","exports"],"sourceRoot":"../../../src","sources":["core/UnistylesRuntime.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAIA,IAAAC,WAAA,GAAAD,OAAA;AAEA;AACA;AACA;AACO,MAAME,gBAAgB,CAAC;EAC1BC,WAAWA,CAASC,eAAgC,EAAUC,iBAAmC,EAAE;IAAA,KAA/ED,eAAgC,GAAhCA,eAAgC;IAAA,KAAUC,iBAAmC,GAAnCA,iBAAmC;EAAG;;EAEpG;AACJ;AACA;AACA;EACI,IAAWC,WAAWA,CAAA,EAAG;IACrB,OAAO;MACHC,mBAAmB,EAAE,IAAI,CAACA,mBAAmB;MAC7CC,UAAU,EAAE,IAAI,CAACA,UAAU;MAC3BC,MAAM,EAAE,IAAI,CAACA,MAAM;MACnBC,MAAM,EAAE,IAAI,CAACA,MAAM;MACnBC,SAAS,EAAE;QACPC,KAAK,EAAE,IAAI,CAACD,SAAS,CAACC,KAAK;QAC3BC,MAAM,EAAE,IAAI,CAACF,SAAS,CAACE;MAC3B,CAAC;MACDC,aA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BAAA,GAAAA,gBAAA","ignoreList":[]}
@@ -104,6 +104,12 @@ class UnistylesMockedRuntime {
104
104
  get orientation() {
105
105
  return _common.ScreenOrientation.Portrait;
106
106
  }
107
+ getTheme = themeName => {
108
+ if (!themeName) {
109
+ return this.unistylesRegistry.getTheme(this.themeName);
110
+ }
111
+ return this.unistylesRegistry.getTheme(themeName);
112
+ };
107
113
  setTheme = name => true;
108
114
  updateTheme = (name, theme) => {};
109
115
  setAdaptiveThemes = enabled => {};
@@ -1 +1 @@
1
- {"version":3,"names":["_common","require","UnistylesMockedRuntime","constructor","unistylesBridge","unistylesRegistry","miniRuntime","contentSizeCategory","breakpoint","screen","insets","statusBar","width","height","navigationBar","orientation","pixelRatio","fontScale","hairlineWidth","rtl","colorScheme","hasAdaptiveThemes","themeName","themeNames","length","at","undefined","sortedBreakpointPairs","firstBreakpoint","breakpoints","enabledPlugins","plugins","top","right","bottom","left","setColor","setHidden","ScreenOrientation","Portrait","setTheme","name","updateTheme","theme","setAdaptiveThemes","enabled","addPlugin","plugin","removePlugin","setRootViewBackgroundColor","color","setImmersiveMode","isEnabled","exports"],"sourceRoot":"../../../../src","sources":["core/mocks/UnistylesMockedRuntime.ts"],"mappings":";;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AADA;;AAOO,MAAMC,sBAAsB,CAAC;EAGhCC,WAAWA,CAASC,eAAgC,EAAUC,iBAAmC,EAAE;IAAA,KAA/ED,eAAgC,GAAhCA,eAAgC;IAAA,KAAUC,iBAAmC,GAAnCA,iBAAmC;IAC7F,IAAI,CAACA,iBAAiB,GAAGA,iBAAuD;EACpF;EAEA,IAAWC,WAAWA,CAAA,EAAG;IACrB,OAAO;MACHC,mBAAmB,EAAE,IAAI,CAACA,mBAAmB;MAC7CC,UAAU,EAAE,IAAI,CAACA,UAAU;MAC3BC,MAAM,EAAE,IAAI,CAACA,MAAM;MACnBC,MAAM,EAAE,IAAI,CAACA,MAAM;MACnBC,SAAS,EAAE;QACPC,KAAK,EA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CE,0BAA0B,GAAIC,KAAsB,IAAK,CAAC,CAAC;EAC3DC,gBAAgB,GAAIC,SAAkB,IAAK,CAAC,CAAC;AACxD;AAACC,OAAA,CAAAnD,sBAAA,GAAAA,sBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_common","require","UnistylesMockedRuntime","constructor","unistylesBridge","unistylesRegistry","miniRuntime","contentSizeCategory","breakpoint","screen","insets","statusBar","width","height","navigationBar","orientation","pixelRatio","fontScale","hairlineWidth","rtl","colorScheme","hasAdaptiveThemes","themeName","themeNames","length","at","undefined","sortedBreakpointPairs","firstBreakpoint","breakpoints","enabledPlugins","plugins","top","right","bottom","left","setColor","setHidden","ScreenOrientation","Portrait","getTheme","setTheme","name","updateTheme","theme","setAdaptiveThemes","enabled","addPlugin","plugin","removePlugin","setRootViewBackgroundColor","color","setImmersiveMode","isEnabled","exports"],"sourceRoot":"../../../../src","sources":["core/mocks/UnistylesMockedRuntime.ts"],"mappings":";;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AADA;;AAOO,MAAMC,sBAAsB,CAAC;EAGhCC,WAAWA,CAASC,eAAgC,EAAUC,iBAAmC,EAAE;IAAA,KAA/ED,eAAgC,GAAhCA,eAAgC;IAAA,KAAUC,iBAAmC,GAAnCA,iBAAmC;IAC7F,IAAI,CAACA,iBAAiB,GAAGA,iBAAuD;EACpF;EAEA,IAAWC,WAAWA,CAAA,EAAG;IACrB,OAAO;MACHC,mBAAmB,EAAE,IAAI,CAACA,mBAAmB;MAC7CC,UAAU,EAAE,IAAI,CAACA,UAAU;MAC3BC,MAAM,EAAE,IAAI,CAACA,MAAM;MACnBC,MAAM,EAAE,IAAI,CAACA,MAAM;MACnBC,SAAS,EAAE;QACPC,KAAK,EAAE,IAAI,CAACD,SAAS,CAACC,KAAK;QAC3BC,MAAM,EAAE,IAAI,CAACF,SAAS,CAACE;MAC3B,CAAC;MACDC,aAAa,EAAE;QACXF,KAAK,EAAE,IAAI,CAACE,aAAa,CAACF,KAAK;Q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AAuB,IAAK,CAAC,CAAC;EAC3CC,YAAY,GAAID,MAAuB,IAAK,CAAC,CAAC;EAC9CE,0BAA0B,GAAIC,KAAsB,IAAK,CAAC,CAAC;EAC3DC,gBAAgB,GAAIC,SAAkB,IAAK,CAAC,CAAC;AACxD;AAACC,OAAA,CAAApD,sBAAA,GAAAA,sBAAA","ignoreList":[]}
@@ -36,6 +36,10 @@ const parseStyle = (style, variant = {}, parseMediaQueries = true) => Object.ent
36
36
  });
37
37
  return acc;
38
38
  }
39
+ if ((key === 'boxShadow' || key === 'filter') && Array.isArray(value)) {
40
+ acc[key] = value.map(value => parseStyle(value, variant, false)).filter(value => Object.keys(value).length === 1);
41
+ return acc;
42
+ }
39
43
  if (key === 'fontVariant' && Array.isArray(value)) {
40
44
  acc[key] = value;
41
45
  return acc;
@@ -1 +1 @@
1
- {"version":3,"names":["_breakpoints","require","_common","_withPlugins","proxifyFunction","key","fn","variant","Proxy","apply","target","thisArg","argumentsList","withPlugins","parseStyle","exports","isPlatformColor","value","isIOS","semantic","isAndroid","resource_paths","style","parseMediaQueries","Object","entries","reduce","acc","Array","isArray","map","filter","values","at","undefined","keys","toString","default","getValueForBreakpoint"],"sourceRoot":"../../../src","sources":["utils/styles.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAEO,MAAMG,eAAe,GAAGA,CAC3BC,GAAW,EACXC,EAAY,EACZC,OAA0C,KAC/B,IAAIC,KAAK,CAACF,EAAE,EAAE;EACzBG,KAAK,EAAEA,CAACC,MAAM,EAAEC,OAAO,EAAEC,aAAa,KAAK,IAAAC,wBAAW,EAACR,GAAG,EAAES,UAAU,CAACJ,MAAM,CAACD,KAAK,CAACE,OAAO,EAAEC,aAAa,CAAC,EAAEL,OAAO,CAAC;AACzH,CAAC,CAAC;AAAAQ,OAAA,CAAAX,eAAA,GAAAA,eAAA;AAEK,MAAMY,e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C/CU,GAAG,CAACtB,GAAG,CAAC,GAAGY,KAAK;IAEhB,OAAOU,GAAG;EACd;;EAEA;EACA,IAAI,OAAOV,KAAK,KAAK,QAAQ,IAAID,eAAe,CAACC,KAAK,CAAC,EAAE;IACrDU,GAAG,CAACtB,GAAG,CAAY,GAAGY,KAAK;IAE3B,OAAOU,GAAG;EACd;EAEA,IAAItB,GAAG,KAAK,UAAU,EAAE;IACpB,OAAO;MACH,GAAGsB,GAAG;MACN,GAAIH,MAAM,CACLW,IAAI,CAAClB,KAAK,CAAC,CACXS,MAAM,CAAC,CAACC,GAAG,EAAEtB,GAAG,MAAM;QACnB,GAAGsB,GAAG;QACN;QACA,GAAGb,UAAU,CAAEG,KAAK,CAAEZ,GAAG,CAAC,CAACE,OAAO,CAACF,GAAG,CAAyB,EAAE+B,QAAQ,CAAC,CAAC,IAAI,SAAS,CAAC,IAAKnB,KAAK,CAAEZ,GAAG,CAAC,CAACgC,OAAO,IAAI,CAAC,CAAC;MAC3H,CAAC,CAAC,EAAE,CAAC,CAAC;IACd,CAAC;EACL;;EAEA;EACA,IAAI,CAACd,iBAAiB,EAAE;IACpB,OAAO;MACH,GAAGI,GAAG;MACN,CAACtB,GAAG,GAAGY;IACX,CAAC;EACL;EAEA,OAAO;IACH,GAAGU,GAAG;IACN,CAACtB,GAAG,GAAG,IAAAiC,kCAAqB,EAACrB,KAAgC;EACjE,CAAC;AACL,CAAC,EAAE,CAAC,CAAM,CAAC;AAAAF,OAAA,CAAAD,UAAA,GAAAA,UAAA","ignoreList":[]}
1
+ {"version":3,"names":["_breakpoints","require","_common","_withPlugins","proxifyFunction","key","fn","variant","Proxy","apply","target","thisArg","argumentsList","withPlugins","parseStyle","exports","isPlatformColor","value","isIOS","semantic","isAndroid","resource_paths","style","parseMediaQueries","Object","entries","reduce","acc","Array","isArray","map","filter","values","at","undefined","keys","length","toString","default","getValueForBreakpoint"],"sourceRoot":"../../../src","sources":["utils/styles.ts"],"mappings":";;;;;;AACA,IAAA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QACA,GAAGb,UAAU,CAAEG,KAAK,CAAEZ,GAAG,CAAC,CAACE,OAAO,CAACF,GAAG,CAAyB,EAAEgC,QAAQ,CAAC,CAAC,IAAI,SAAS,CAAC,IAAKpB,KAAK,CAAEZ,GAAG,CAAC,CAACiC,OAAO,IAAI,CAAC,CAAC;MAC3H,CAAC,CAAC,EAAE,CAAC,CAAC;IACd,CAAC;EACL;;EAEA;EACA,IAAI,CAACf,iBAAiB,EAAE;IACpB,OAAO;MACH,GAAGI,GAAG;MACN,CAACtB,GAAG,GAAGY;IACX,CAAC;EACL;EAEA,OAAO;IACH,GAAGU,GAAG;IACN,CAACtB,GAAG,GAAG,IAAAkC,kCAAqB,EAACtB,KAAgC;EACjE,CAAC;AACL,CAAC,EAAE,CAAC,CAAM,CAAC;AAAAF,OAAA,CAAAD,UAAA,GAAAA,UAAA","ignoreList":[]}
@@ -193,6 +193,18 @@ export class UnistylesRuntime {
193
193
  return nearestPixel / pixelRatio;
194
194
  }
195
195
 
196
+ /**
197
+ * Get theme by name
198
+ * @param themeName - The name of the theme to get or current theme if not specified
199
+ * @returns - The theme
200
+ */
201
+ getTheme(themeName) {
202
+ if (!themeName) {
203
+ return this.unistylesRegistry.getTheme(this.themeName);
204
+ }
205
+ return this.unistylesRegistry.getTheme(themeName);
206
+ }
207
+
196
208
  /**
197
209
  * Get the immersive mode (both status bar and navigation bar hidden (Android))
198
210
  * @param isEnabled
@@ -1 +1 @@
1
- {"version":3,"names":["ScreenOrientation","UnistylesError","parseColor","UnistylesRuntime","constructor","unistylesBridge","unistylesRegistry","miniRuntime","contentSizeCategory","breakpoint","screen","insets","statusBar","width","height","navigationBar","orientation","pixelRatio","fontScale","hairlineWidth","rtl","colorScheme","hasAdaptiveThemes","themeName","breakpoints","enabledPlugins","screenWidth","screenHeight","setColor","color","alpha","parsedColor","parsedAlpha","setHidden","hidden","Landscape","Portrait","parseFloat","toFixed","nearestPixel","Math","trunc","setImmersiveMode","isEnabled","setRootViewBackgroundColor","setTheme","name","hasTheme","useTheme","Error","ThemeNotRegistered","updateTheme","updater","getTheme","setAdaptiveThemes","enable","useAdaptiveThemes","addPlugin","plugin","removePlugin"],"sourceRoot":"../../../src","sources":["core/UnistylesRuntime.ts"],"mappings":"AAAA,SAASA,iBAAiB,EAAEC,cAAc,QAAQ,WAAW;AAI7D,SAASC,UAAU,QAAQ,qBAAqB;;AAEhD;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,CAAC;EAC1BC,WAAWA,CAASC,eAAgC,EAAUC,iBAAmC,EAAE;IAAA,KAA/ED,eAAgC,GAAhCA,eAAgC;IAAA,KAAUC,iBAAmC,GAAnCA,iBAAmC;EAAG;;EAEpG;AACJ;AACA;AACA;EACI,IAAWC,WAAWA,CAAA,EAAG;IACrB,OAAO;MACHC,mBAAmB,EAAE,IAAI,CAACA,mBAAmB;MAC7CC,UAAU,EAAE,IAAI,CAACA,UAAU;MAC3BC,MAAM,EAAE,IAAI,CAACA,MAAM;MACnBC,MAAM,EAAE,IAAI,CAACA,MAAM;MACnBC,SAAS,EAAE;QACPC,KAAK,EAAE,IAAI,CAACD,SAAS,CAACC,KAAK;QAC3BC,MAAM,EAAE,IAAI,CAACF,SAAS,CAACE;MAC3B,CAAC;MACDC,aAAa,EAAE;QACXF,KAAK,EAAE,IAAI,CAACE,aAAa,CAACF,KAAK;QAC/BC,MAAM,EAAE,IAAI,CAACC,aAAa,CAACD;MAC/B,CAAC;MACDE,WAAW,EAAE,IAAI,CAACA,WAAW;MAC7BC,UAAU,EAAE,IAAI,CAACA,UAAU;MAC3BC,SAAS,EAAE,IAAI,CAACA,SAAS;MACzBC,aAAa,EAAE,IAAI,CAACA,aAAa;MACjCC,GAAG,EAAE,IAAI,CAACA;IACd,CAAC;EACL;;EAEA;AACJ;AACA;AACA;EACI,IAAWC,WAAWA,CAAA,EAAG;IACrB,OAAO,IAAI,CAAChB,eAAe,CAACgB,WAAW;EAC3C;;EAEA;AACJ;AACA;AACA;EACI,IAAWD,GAA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AAC,IAAI,CAAC9C,iBAAiB,CAAC+C,QAAQ,CAACP,IAAI,CAAC,CAAC,CAAC;EAC5F,CAAC;;EAED;AACJ;AACA;AACA;EACWQ,iBAAiB,GAAIC,MAAe,IAAK;IAC5C,IAAI,CAAClD,eAAe,CAACmD,iBAAiB,CAACD,MAAM,CAAC;EAClD,CAAC;;EAED;AACJ;AACA;AACA;AACA;EACWE,SAAS,GAAIC,MAAuB,IAAK;IAC5C,IAAI,CAACpD,iBAAiB,CAACmD,SAAS,CAACC,MAAM,CAAC;EAC5C,CAAC;;EAED;AACJ;AACA;AACA;AACA;EACWC,YAAY,GAAID,MAAuB,IAAK;IAC/C,IAAI,CAACpD,iBAAiB,CAACqD,YAAY,CAACD,MAAM,CAAC;EAC/C,CAAC;AACL","ignoreList":[]}
1
+ {"version":3,"names":["ScreenOrientation","UnistylesError","parseColor","UnistylesRuntime","constructor","unistylesBridge","unistylesRegistry","miniRuntime","contentSizeCategory","breakpoint","screen","insets","statusBar","width","height","navigationBar","orientation","pixelRatio","fontScale","hairlineWidth","rtl","colorScheme","hasAdaptiveThemes","themeName","breakpoints","enabledPlugins","screenWidth","screenHeight","setColor","color","alpha","parsedColor","parsedAlpha","setHidden","hidden","Landscape","Portrait","parseFloat","toFixed","nearestPixel","Math","trunc","getTheme","setImmersiveMode","isEnabled","setRootViewBackgroundColor","setTheme","name","hasTheme","useTheme","Error","ThemeNotRegistered","updateTheme","updater","setAdaptiveThemes","enable","useAdaptiveThemes","addPlugin","plugin","removePlugin"],"sourceRoot":"../../../src","sources":["core/UnistylesRuntime.ts"],"mappings":"AAAA,SAASA,iBAAiB,EAAEC,cAAc,QAAQ,WAAW;AAI7D,SAASC,UAAU,QAAQ,qBAAqB;;AAEhD;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,CAAC;EAC1BC,WAAWA,CAASC,eAAgC,EAAUC,iBAAmC,EAAE;IAAA,KAA/ED,eAAgC,GAAhCA,eAAgC;IAAA,KAAUC,iBAAmC,GA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IAC5C,IAAI,CAAClD,eAAe,CAACmD,iBAAiB,CAACD,MAAM,CAAC;EAClD,CAAC;;EAED;AACJ;AACA;AACA;AACA;EACWE,SAAS,GAAIC,MAAuB,IAAK;IAC5C,IAAI,CAACpD,iBAAiB,CAACmD,SAAS,CAACC,MAAM,CAAC;EAC5C,CAAC;;EAED;AACJ;AACA;AACA;AACA;EACWC,YAAY,GAAID,MAAuB,IAAK;IAC/C,IAAI,CAACpD,iBAAiB,CAACqD,YAAY,CAACD,MAAM,CAAC;EAC/C,CAAC;AACL","ignoreList":[]}
@@ -97,6 +97,12 @@ export class UnistylesMockedRuntime {
97
97
  get orientation() {
98
98
  return ScreenOrientation.Portrait;
99
99
  }
100
+ getTheme = themeName => {
101
+ if (!themeName) {
102
+ return this.unistylesRegistry.getTheme(this.themeName);
103
+ }
104
+ return this.unistylesRegistry.getTheme(themeName);
105
+ };
100
106
  setTheme = name => true;
101
107
  updateTheme = (name, theme) => {};
102
108
  setAdaptiveThemes = enabled => {};
@@ -1 +1 @@
1
- {"version":3,"names":["ScreenOrientation","UnistylesMockedRuntime","constructor","unistylesBridge","unistylesRegistry","miniRuntime","contentSizeCategory","breakpoint","screen","insets","statusBar","width","height","navigationBar","orientation","pixelRatio","fontScale","hairlineWidth","rtl","colorScheme","hasAdaptiveThemes","themeName","themeNames","length","at","undefined","sortedBreakpointPairs","firstBreakpoint","breakpoints","enabledPlugins","plugins","top","right","bottom","left","setColor","setHidden","Portrait","setTheme","name","updateTheme","theme","setAdaptiveThemes","enabled","addPlugin","plugin","removePlugin","setRootViewBackgroundColor","color","setImmersiveMode","isEnabled"],"sourceRoot":"../../../../src","sources":["core/mocks/UnistylesMockedRuntime.ts"],"mappings":"AAAA;AACA,SAASA,iBAAiB,QAAQ,cAAc;AAMhD,OAAO,MAAMC,sBAAsB,CAAC;EAGhCC,WAAWA,CAASC,eAAgC,EAAUC,iBAAmC,EAAE;IAAA,KAA/ED,eAAgC,GAAhCA,eAAgC;IAAA,KAAU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WA,CAAA,EAAG;IACrB,OAAOd,iBAAiB,CAACqC,QAAQ;EACrC;EAEOC,QAAQ,GAAIC,IAA2B,IAAK,IAAI;EAChDC,WAAW,GAAGA,CAACD,IAA2B,EAAEE,KAA6C,KAAK,CAAC,CAAC;EAChGC,iBAAiB,GAAIC,OAAgB,IAAK,CAAC,CAAC;EAC5CC,SAAS,GAAIC,MAAuB,IAAK,CAAC,CAAC;EAC3CC,YAAY,GAAID,MAAuB,IAAK,CAAC,CAAC;EAC9CE,0BAA0B,GAAIC,KAAsB,IAAK,CAAC,CAAC;EAC3DC,gBAAgB,GAAIC,SAAkB,IAAK,CAAC,CAAC;AACxD","ignoreList":[]}
1
+ {"version":3,"names":["ScreenOrientation","UnistylesMockedRuntime","constructor","unistylesBridge","unistylesRegistry","miniRuntime","contentSizeCategory","breakpoint","screen","insets","statusBar","width","height","navigationBar","orientation","pixelRatio","fontScale","hairlineWidth","rtl","colorScheme","hasAdaptiveThemes","themeName","themeNames","length","at","undefined","sortedBreakpointPairs","firstBreakpoint","breakpoints","enabledPlugins","plugins","top","right","bottom","left","setColor","setHidden","Portrait","getTheme","setTheme","name","updateTheme","theme","setAdaptiveThemes","enabled","addPlugin","plugin","removePlugin","setRootViewBackgroundColor","color","setImmersiveMode","isEnabled"],"sourceRoot":"../../../../src","sources":["core/mocks/UnistylesMockedRuntime.ts"],"mappings":"AAAA;AACA,SAASA,iBAAiB,QAAQ,cAAc;AAMhD,OAAO,MAAMC,sBAAsB,CAAC;EAGhCC,WAAWA,CAASC,eAAgC,EAAUC,iBAAmC,EAAE;IAAA,KAA/ED,eAAgC,GAAhCA,eAAgC;IAAA,KAAUC,iBAAmC,GAAnCA,iBAAmC;IAC7F,IAAI,CAACA,iBAAiB,GAAGA,iBAAuD;EACpF;EAEA,IAAWC,WAAWA,CAAA,EAAG;IACrB,OAAO;MACHC,mBAAmB,EAAE,IAAI,CAACA,mBAAmB;MAC7CC,UAAU,EAAE,IAAI,CAACA,UAAU;MAC3BC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D;IAEA,OAAO,IAAI,CAACjB,iBAAiB,CAACkC,QAAQ,CAACjB,SAAS,CAAC;EACrD,CAAC;EAEMkB,QAAQ,GAAIC,IAA2B,IAAK,IAAI;EAChDC,WAAW,GAAGA,CAACD,IAA2B,EAAEE,KAA6C,KAAK,CAAC,CAAC;EAChGC,iBAAiB,GAAIC,OAAgB,IAAK,CAAC,CAAC;EAC5CC,SAAS,GAAIC,MAAuB,IAAK,CAAC,CAAC;EAC3CC,YAAY,GAAID,MAAuB,IAAK,CAAC,CAAC;EAC9CE,0BAA0B,GAAIC,KAAsB,IAAK,CAAC,CAAC;EAC3DC,gBAAgB,GAAIC,SAAkB,IAAK,CAAC,CAAC;AACxD","ignoreList":[]}
@@ -28,6 +28,10 @@ export const parseStyle = (style, variant = {}, parseMediaQueries = true) => Obj
28
28
  });
29
29
  return acc;
30
30
  }
31
+ if ((key === 'boxShadow' || key === 'filter') && Array.isArray(value)) {
32
+ acc[key] = value.map(value => parseStyle(value, variant, false)).filter(value => Object.keys(value).length === 1);
33
+ return acc;
34
+ }
31
35
  if (key === 'fontVariant' && Array.isArray(value)) {
32
36
  acc[key] = value;
33
37
  return acc;
@@ -1 +1 @@
1
- {"version":3,"names":["getValueForBreakpoint","isAndroid","isIOS","withPlugins","proxifyFunction","key","fn","variant","Proxy","apply","target","thisArg","argumentsList","parseStyle","isPlatformColor","value","semantic","resource_paths","style","parseMediaQueries","Object","entries","reduce","acc","Array","isArray","map","filter","values","at","undefined","keys","toString","default"],"sourceRoot":"../../../src","sources":["utils/styles.ts"],"mappings":"AACA,SAASA,qBAAqB,QAAQ,eAAe;AACrD,SAASC,SAAS,EAAEC,KAAK,QAAQ,WAAW;AAC5C,SAASC,WAAW,QAAQ,eAAe;AAE3C,OAAO,MAAMC,eAAe,GAAGA,CAC3BC,GAAW,EACXC,EAAY,EACZC,OAA0C,KAC/B,IAAIC,KAAK,CAACF,EAAE,EAAE;EACzBG,KAAK,EAAEA,CAACC,MAAM,EAAEC,OAA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AI;IACf,CAAC,CAAC;IAEN,OAAOP,GAAG;EACd;EAEA,IAAIlB,GAAG,KAAK,aAAa,IAAImB,KAAK,CAACC,OAAO,CAACV,KAAK,CAAC,EAAE;IAC/CQ,GAAG,CAAClB,GAAG,CAAC,GAAGU,KAAK;IAEhB,OAAOQ,GAAG;EACd;;EAEA;EACA,IAAI,OAAOR,KAAK,KAAK,QAAQ,IAAID,eAAe,CAACC,KAAK,CAAC,EAAE;IACrDQ,GAAG,CAAClB,GAAG,CAAY,GAAGU,KAAK;IAE3B,OAAOQ,GAAG;EACd;EAEA,IAAIlB,GAAG,KAAK,UAAU,EAAE;IACpB,OAAO;MACH,GAAGkB,GAAG;MACN,GAAIH,MAAM,CACLW,IAAI,CAAChB,KAAK,CAAC,CACXO,MAAM,CAAC,CAACC,GAAG,EAAElB,GAAG,MAAM;QACnB,GAAGkB,GAAG;QACN;QACA,GAAGV,UAAU,CAAEE,KAAK,CAAEV,GAAG,CAAC,CAACE,OAAO,CAACF,GAAG,CAAyB,EAAE2B,QAAQ,CAAC,CAAC,IAAI,SAAS,CAAC,IAAKjB,KAAK,CAAEV,GAAG,CAAC,CAAC4B,OAAO,IAAI,CAAC,CAAC;MAC3H,CAAC,CAAC,EAAE,CAAC,CAAC;IACd,CAAC;EACL;;EAEA;EACA,IAAI,CAACd,iBAAiB,EAAE;IACpB,OAAO;MACH,GAAGI,GAAG;MACN,CAAClB,GAAG,GAAGU;IACX,CAAC;EACL;EAEA,OAAO;IACH,GAAGQ,GAAG;IACN,CAAClB,GAAG,GAAGL,qBAAqB,CAACe,KAAgC;EACjE,CAAC;AACL,CAAC,EAAE,CAAC,CAAM,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["getValueForBreakpoint","isAndroid","isIOS","withPlugins","proxifyFunction","key","fn","variant","Proxy","apply","target","thisArg","argumentsList","parseStyle","isPlatformColor","value","semantic","resource_paths","style","parseMediaQueries","Object","entries","reduce","acc","Array","isArray","map","filter","values","at","undefined","keys","length","toString","default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QACA,GAAGV,UAAU,CAAEE,KAAK,CAAEV,GAAG,CAAC,CAACE,OAAO,CAACF,GAAG,CAAyB,EAAE4B,QAAQ,CAAC,CAAC,IAAI,SAAS,CAAC,IAAKlB,KAAK,CAAEV,GAAG,CAAC,CAAC6B,OAAO,IAAI,CAAC,CAAC;MAC3H,CAAC,CAAC,EAAE,CAAC,CAAC;IACd,CAAC;EACL;;EAEA;EACA,IAAI,CAACf,iBAAiB,EAAE;IACpB,OAAO;MACH,GAAGI,GAAG;MACN,CAAClB,GAAG,GAAGU;IACX,CAAC;EACL;EAEA,OAAO;IACH,GAAGQ,GAAG;IACN,CAAClB,GAAG,GAAGL,qBAAqB,CAACe,KAAgC;EACjE,CAAC;AACL,CAAC,EAAE,CAAC,CAAM,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"UnistylesModule.native.d.ts","sourceRoot":"","sources":["../../../../src/core/UnistylesModule.native.ts"],"names":[],"mappings":"AAEA,KAAK,qBAAqB,GAAG;IACzB,OAAO,IAAI,OAAO,CAAA;CACrB,CAAA;AAED,eAAO,MAAM,eAAe,uBAAoD,CAAA"}
1
+ {"version":3,"file":"UnistylesModule.native.d.ts","sourceRoot":"","sources":["../../../../src/core/UnistylesModule.native.ts"],"names":[],"mappings":"AAEA,KAAK,qBAAqB,GAAG;IACzB,OAAO,IAAI,OAAO,CAAA;CACrB,CAAA;AAED,eAAO,MAAM,eAAe,EAA+B,qBAAqB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"UnistylesModule.windows.d.ts","sourceRoot":"","sources":["../../../../src/core/UnistylesModule.windows.ts"],"names":[],"mappings":"AAEA,KAAK,qBAAqB,GAAG;IACzB,OAAO,IAAI,OAAO,CAAA;CACrB,CAAA;AAID,eAAO,MAAM,eAAe,uBAAuG,CAAA"}
1
+ {"version":3,"file":"UnistylesModule.windows.d.ts","sourceRoot":"","sources":["../../../../src/core/UnistylesModule.windows.ts"],"names":[],"mappings":"AAEA,KAAK,qBAAqB,GAAG;IACzB,OAAO,IAAI,OAAO,CAAA;CACrB,CAAA;AAID,eAAO,MAAM,eAAe,EAAkF,qBAAqB,CAAA"}
@@ -13,8 +13,8 @@ export declare class UnistylesRuntime {
13
13
  * @returns - The mini runtime
14
14
  */
15
15
  get miniRuntime(): {
16
- contentSizeCategory: import("../common").IOSContentSizeCategory | import("../common").AndroidContentSizeCategory;
17
- breakpoint: keyof import("../global").UnistylesBreakpoints;
16
+ contentSizeCategory: import("..").IOSContentSizeCategory | import("..").AndroidContentSizeCategory;
17
+ breakpoint: keyof import("..").UnistylesBreakpoints;
18
18
  screen: {
19
19
  width: number;
20
20
  height: number;
@@ -58,17 +58,17 @@ export declare class UnistylesRuntime {
58
58
  * Get the current content size category
59
59
  * @returns - The current content size category
60
60
  */
61
- get contentSizeCategory(): import("../common").IOSContentSizeCategory | import("../common").AndroidContentSizeCategory;
61
+ get contentSizeCategory(): import("..").IOSContentSizeCategory | import("..").AndroidContentSizeCategory;
62
62
  /**
63
63
  * Get the current breakpoint based on device size
64
64
  * @returns - The current breakpoint
65
65
  */
66
- get breakpoint(): keyof import("../global").UnistylesBreakpoints;
66
+ get breakpoint(): keyof import("..").UnistylesBreakpoints;
67
67
  /**
68
68
  * Get registered breakpoints with UnitylesRegistry
69
69
  * @returns - The registered breakpoints
70
70
  */
71
- get breakpoints(): import("../global").UnistylesBreakpoints;
71
+ get breakpoints(): import("..").UnistylesBreakpoints;
72
72
  /**
73
73
  * Get the names of currently enabled plugins
74
74
  * @deprecated - Plugins will be removed in the next major release
@@ -128,6 +128,12 @@ export declare class UnistylesRuntime {
128
128
  * @returns - The thinnest width of the platform
129
129
  */
130
130
  get hairlineWidth(): number;
131
+ /**
132
+ * Get theme by name
133
+ * @param themeName - The name of the theme to get or current theme if not specified
134
+ * @returns - The theme
135
+ */
136
+ getTheme(themeName?: keyof UnistylesThemes): never;
131
137
  /**
132
138
  * Get the immersive mode (both status bar and navigation bar hidden (Android))
133
139
  * @param isEnabled
@@ -1 +1 @@
1
- {"version":3,"file":"UnistylesRuntime.d.ts","sourceRoot":"","sources":["../../../../src/core/UnistylesRuntime.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAG1D;;GAEG;AACH,qBAAa,gBAAgB;IACb,OAAO,CAAC,eAAe;IAAmB,OAAO,CAAC,iBAAiB;gBAA3D,eAAe,EAAE,eAAe,EAAU,iBAAiB,EAAE,gBAAgB;IAEjG;;;OAGG;IACH,IAAW,WAAW;;;;;;;;;;;;;;;;;;;;;MAoBrB;IAED;;;OAGG;IACH,IAAW,WAAW,uCAErB;IAED;;;OAGG;IACH,IAAW,GAAG,YAEb;IAED;;;OAGG;IACH,IAAW,iBAAiB,YAE3B;IAED;;;OAGG;IACH,IAAW,SAAS,UAEnB;IAED;;;OAGG;IACH,IAAW,mBAAmB,gGAE7B;IAED;;;OAGG;IACH,IAAW,UAAU,mDAEpB;IAED;;;OAGG;IACH,IAAW,WAAW,6CAErB;IAED;;;;OAIG;IACH,IAAW,cAAc,aAExB;IAED;;;OAGG;IACH,IAAW,MAAM;;;MAKhB;IAED;;;OAGG;IACH,IAAW,MAAM,oCAEhB;IAED;;;OAGG;IACH,IAAW,SAAS;;;2BAIO,KAAK,UAAU,MAAM;4BAKpB,OAAO;MAElC;IAED;;;OAGG;IACH,IAAW,aAAa;;;2BAIG,KAAK,UAAU,MAAM;4BAKpB,OAAO;MAElC;IAED;;;OAGG;IACH,IAAW,WAAW,6BAQrB;IAED;;;OAGG;IACH,IAAW,UAAU,WAEpB;IAED;;;OAGG;IACH,IAAW,SAAS,WAEnB;IAED;;;OAGG;IACH,IAAW,aAAa,WAKvB;IAED;;;OAGG;IACI,gBAAgB,CAAC,SAAS,EAAE,OAAO;IAI1C;;;;OAIG;IACI,0BAA0B,WAAY,KAAK,UAAU,MAAM,UAIjE;IAED;;;;OAIG;IACI,QAAQ,SAAU,MAAM,eAAe,sBAY7C;IAED;;;;;OAKG;IACI,WAAW,SAAU,MAAM,eAAe,mBAAmB,eAAe,CAAC,MAAM,eAAe,CAAC,KAAK,eAAe,CAAC,MAAM,eAAe,CAAC,UAEpJ;IAED;;;OAGG;IACI,iBAAiB,WAAY,OAAO,UAE1C;IAED;;;;OAIG;IACI,SAAS,WAAY,eAAe,UAE1C;IAED;;;;OAIG;IACI,YAAY,WAAY,eAAe,UAE7C;CACJ"}
1
+ {"version":3,"file":"UnistylesRuntime.d.ts","sourceRoot":"","sources":["../../../../src/core/UnistylesRuntime.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAG1D;;GAEG;AACH,qBAAa,gBAAgB;IACb,OAAO,CAAC,eAAe;IAAmB,OAAO,CAAC,iBAAiB;gBAA3D,eAAe,EAAE,eAAe,EAAU,iBAAiB,EAAE,gBAAgB;IAEjG;;;OAGG;IACH,IAAW,WAAW;;;;;;;;;;;;;;;;;;;;;MAoBrB;IAED;;;OAGG;IACH,IAAW,WAAW,uCAErB;IAED;;;OAGG;IACH,IAAW,GAAG,YAEb;IAED;;;OAGG;IACH,IAAW,iBAAiB,YAE3B;IAED;;;OAGG;IACH,IAAW,SAAS,UAEnB;IAED;;;OAGG;IACH,IAAW,mBAAmB,kFAE7B;IAED;;;OAGG;IACH,IAAW,UAAU,4CAEpB;IAED;;;OAGG;IACH,IAAW,WAAW,sCAErB;IAED;;;;OAIG;IACH,IAAW,cAAc,aAExB;IAED;;;OAGG;IACH,IAAW,MAAM;;;MAKhB;IAED;;;OAGG;IACH,IAAW,MAAM,oCAEhB;IAED;;;OAGG;IACH,IAAW,SAAS;;;2BAIO,KAAK,UAAU,MAAM;4BAKpB,OAAO;MAElC;IAED;;;OAGG;IACH,IAAW,aAAa;;;2BAIG,KAAK,UAAU,MAAM;4BAKpB,OAAO;MAElC;IAED;;;OAGG;IACH,IAAW,WAAW,6BAQrB;IAED;;;OAGG;IACH,IAAW,UAAU,WAEpB;IAED;;;OAGG;IACH,IAAW,SAAS,WAEnB;IAED;;;OAGG;IACH,IAAW,aAAa,WAKvB;IAED;;;;OAIG;IACI,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,eAAe;IAQjD;;;OAGG;IACI,gBAAgB,CAAC,SAAS,EAAE,OAAO;IAI1C;;;;OAIG;IACI,0BAA0B,WAAY,KAAK,UAAU,MAAM,UAIjE;IAED;;;;OAIG;IACI,QAAQ,SAAU,MAAM,eAAe,sBAY7C;IAED;;;;;OAKG;IACI,WAAW,SAAU,MAAM,eAAe,WAAW,CAAC,KAAK,EAAE,eAAe,CAAC,MAAM,eAAe,CAAC,KAAK,eAAe,CAAC,MAAM,eAAe,CAAC,UAEpJ;IAED;;;OAGG;IACI,iBAAiB,WAAY,OAAO,UAE1C;IAED;;;;OAIG;IACI,SAAS,WAAY,eAAe,UAE1C;IAED;;;;OAIG;IACI,YAAY,WAAY,eAAe,UAE7C;CACJ"}
@@ -8,7 +8,7 @@ export declare class UnistylesMockedRuntime {
8
8
  constructor(unistylesBridge: UnistylesBridge, unistylesRegistry: UnistyleRegistry);
9
9
  get miniRuntime(): {
10
10
  contentSizeCategory: string;
11
- breakpoint: number | keyof import("../../global").UnistylesBreakpoints | undefined;
11
+ breakpoint: number | keyof import("../..").UnistylesBreakpoints | undefined;
12
12
  screen: {
13
13
  width: number;
14
14
  height: number;
@@ -37,9 +37,9 @@ export declare class UnistylesMockedRuntime {
37
37
  get hasAdaptiveThemes(): boolean;
38
38
  get themeName(): undefined;
39
39
  get contentSizeCategory(): string;
40
- get breakpoint(): number | keyof import("../../global").UnistylesBreakpoints | undefined;
40
+ get breakpoint(): number | keyof import("../..").UnistylesBreakpoints | undefined;
41
41
  get rtl(): boolean;
42
- get breakpoints(): import("../../global").UnistylesBreakpoints;
42
+ get breakpoints(): import("../..").UnistylesBreakpoints;
43
43
  get enabledPlugins(): UnistylesPlugin[];
44
44
  get screen(): {
45
45
  width: number;
@@ -67,6 +67,7 @@ export declare class UnistylesMockedRuntime {
67
67
  setHidden: () => void;
68
68
  };
69
69
  get orientation(): "portrait";
70
+ getTheme: (themeName?: keyof UnistylesThemes) => never;
70
71
  setTheme: (name: keyof UnistylesThemes) => boolean;
71
72
  updateTheme: (name: keyof UnistylesThemes, theme: UnistylesThemes[keyof UnistylesThemes]) => void;
72
73
  setAdaptiveThemes: (enabled: boolean) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"UnistylesMockedRuntime.d.ts","sourceRoot":"","sources":["../../../../../src/core/mocks/UnistylesMockedRuntime.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAEnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAE3D,qBAAa,sBAAsB;IAGnB,OAAO,CAAC,eAAe;IAAmB,OAAO,CAAC,iBAAiB;IAF/E,OAAO,CAAC,iBAAiB,CAAyB;gBAE9B,eAAe,EAAE,eAAe,EAAU,iBAAiB,EAAE,gBAAgB;IAIjG,IAAW,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;MAoBrB;IAED,IAAW,WAAW,WAErB;IAED,IAAW,iBAAiB,YAE3B;IAED,IAAW,SAAS,cAInB;IAED,IAAW,mBAAmB,WAE7B;IAED,IAAW,UAAU,2EAUpB;IAED,IAAW,GAAG,YAEb;IAED,IAAW,WAAW,gDAErB;IAED,IAAW,cAAc,sBAExB;IAED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MAKhB;IAED,IAAW,MAAM;;;;;MAOhB;IAED,IAAW,UAAU,WAEpB;IAED,IAAW,aAAa,WAEvB;IAED,IAAW,SAAS,WAEnB;IAED,IAAW,SAAS;;;;;MAOnB;IAED,IAAW,aAAa;;;;;MAOvB;IAED,IAAW,WAAW,eAErB;IAEM,QAAQ,eAAgB,MAAM,eAAe,WAMnD;IAEM,QAAQ,SAAU,MAAM,eAAe,aAAS;IAChD,WAAW,SAAU,MAAM,eAAe,SAAS,eAAe,CAAC,MAAM,eAAe,CAAC,UAAO;IAChG,iBAAiB,YAAa,OAAO,UAAO;IAC5C,SAAS,WAAY,eAAe,UAAO;IAC3C,YAAY,WAAY,eAAe,UAAO;IAC9C,0BAA0B,WAAY,KAAK,GAAG,MAAM,UAAO;IAC3D,gBAAgB,cAAe,OAAO,UAAO;CACvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"createStyleSheet.d.ts","sourceRoot":"","sources":["../../../src/createStyleSheet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAA;AAExD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,2DAAwE,CAAA"}
1
+ {"version":3,"file":"createStyleSheet.d.ts","sourceRoot":"","sources":["../../../src/createStyleSheet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAA;AAExD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAI,CAAC,SAAS,yBAAyB,cAAc,CAAC,KAAG,CAAe,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"useCSS.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useCSS.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAGrD,eAAO,MAAM,MAAM,mDA6ClB,CAAA"}
1
+ {"version":3,"file":"useCSS.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useCSS.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAGrD,eAAO,MAAM,MAAM,GAAI,CAAC,cAAc,qBAAqB,CAAC,CAAC,CAAC,SA6C7D,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"useCSS.native.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useCSS.native.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAErD,eAAO,MAAM,MAAM,gDAA+C,IAAU,CAAA"}
1
+ {"version":3,"file":"useCSS.native.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useCSS.native.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAErD,eAAO,MAAM,MAAM,GAAI,CAAC,eAAe,qBAAqB,CAAC,CAAC,CAAC,KAAG,IAAU,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"useVariants.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useVariants.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAExC,eAAO,MAAM,WAAW,iBAAkB,OAAO,MAAM,EAAE,SAAS,MAAM,CAAC,CAAC,+CAMzE,CAAA"}
1
+ {"version":3,"file":"useVariants.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useVariants.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAExC,eAAO,MAAM,WAAW,iBAAkB,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,+CAMzE,CAAA"}
@@ -23,10 +23,7 @@ declare const UnistylesRegistry: {
23
23
  };
24
24
  };
25
25
  addConfig: (config: import("./types").UnistylesConfig) => {
26
- addBreakpoints: (breakpoints: UnistylesBreakpoints) => {
27
- addThemes: any;
28
- addConfig: any;
29
- };
26
+ addBreakpoints: any;
30
27
  addThemes: any;
31
28
  };
32
29
  };
@@ -44,10 +41,7 @@ declare const UnistylesRegistry: {
44
41
  };
45
42
  addConfig: (config: import("./types").UnistylesConfig) => {
46
43
  addBreakpoints: any;
47
- addThemes: (themes: UnistylesThemes) => {
48
- addBreakpoints: any;
49
- addConfig: any;
50
- };
44
+ addThemes: any;
51
45
  };
52
46
  };
53
47
  /**
@@ -63,10 +57,7 @@ declare const UnistylesRegistry: {
63
57
  addConfig: any;
64
58
  };
65
59
  addThemes: (themes: UnistylesThemes) => {
66
- addBreakpoints: (breakpoints: UnistylesBreakpoints) => {
67
- addThemes: any;
68
- addConfig: any;
69
- };
60
+ addBreakpoints: any;
70
61
  addConfig: any;
71
62
  };
72
63
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AACzC,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAC/I,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AACrE,OAAO,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAChG,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD;;;GAGG;AACH,QAAA,MAAM,iBAAiB;IACnB;;;OAGG;;;;;;;;;;;;;;;;;IAEH;;;OAGG;;;;;;;;;;;;;;;;;IAEH;;;OAGG;;;;;;;;;;;;;;;;;CAEN,CAAA;AAED,QAAA,MAAM,gBAAgB,mCAAoB,CAAA;AAE1C,OAAO,E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AAY,EACZ,aAAa,EACb,mBAAmB,IAAI,iBAAiB,EAC3C,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"normalizeStyle.d.ts","sourceRoot":"","sources":["../../../../src/normalizer/normalizeStyle.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAoE,OAAO,EAAE,MAAM,UAAU,CAAA;AAuDzG,eAAO,MAAM,cAAc,oCAwB1B,CAAA"}
1
+ {"version":3,"file":"normalizeStyle.d.ts","sourceRoot":"","sources":["../../../../src/normalizer/normalizeStyle.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAoE,OAAO,EAAE,MAAM,UAAU,CAAA;AAuDzG,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,OAAO,SAAS,CAAC,KAAG,CAwB5D,CAAA"}
@@ -9,20 +9,20 @@ type ExtractTransformArray<T> = T extends object ? {
9
9
  type ExtractBreakpoints<T> = T extends object ? keyof T extends BreakpointsOrMediaQueries ? T[keyof T] : T extends Array<ToDeepUnistyles<TransformStyles>> ? Array<ExtractTransformArray<T[number]>> : {
10
10
  [K in keyof T]: ExtractBreakpoints<T[K]>;
11
11
  } : T;
12
- type ParseNestedObject<T> = T extends (...args: infer A) => infer R ? (...args: A) => ParseNestedObject<R> : T extends object ? T extends {
12
+ type ParseNestedObject<T, ShouldFlatten> = T extends (...args: infer A) => infer R ? (...args: A) => ParseNestedObject<R, false> : T extends object ? T extends {
13
13
  variants: infer R;
14
- } ? ParseVariants<FlattenVariants<R>> & ParseNestedObject<Omit<T, 'variants'>> : {
15
- [K in keyof T]: T[K] extends object ? T[K] extends OpaqueColorValue ? ColorValue : ExtractBreakpoints<T[K]> : T[K];
14
+ } ? (ParseVariants<FlattenVariants<R, false>> & ParseNestedObject<Omit<T, 'variants'>, false>) extends never ? ParseVariants<FlattenVariants<R, true>> & ParseNestedObject<Omit<T, 'variants'>, false> : ParseVariants<FlattenVariants<R, false>> & ParseNestedObject<Omit<T, 'variants'>, false> : {
15
+ [K in keyof T]: T[K] extends object ? T[K] extends OpaqueColorValue ? ColorValue : ExtractBreakpoints<T[K]> : T[K] extends string ? ShouldFlatten extends true ? string : T[K] : T[K];
16
16
  } : T;
17
- type FlattenVariants<T> = T extends object ? {
17
+ type FlattenVariants<T, ShouldFlatten> = T extends object ? {
18
18
  [K in keyof T]: T[K] extends object ? {
19
- [key in keyof T[K]]: T[K][key] extends object ? ParseNestedObject<T[K][key]> : never;
19
+ [key in keyof T[K]]: T[K][key] extends object ? ParseNestedObject<T[K][key], ShouldFlatten> : never;
20
20
  } : never;
21
21
  } : never;
22
22
  type ParseVariants<T> = T extends object ? T[keyof T] extends object ? UnionToIntersection<ParseVariants<T[keyof T]>> : T : T;
23
23
  type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
24
24
  type ParseStyleKeys<T> = T extends object ? {
25
- [K in keyof T]: ParseNestedObject<T[K]>;
25
+ [K in keyof T]: ParseNestedObject<T[K], false>;
26
26
  } : never;
27
27
  export type ReactNativeStyleSheet<T> = T extends (theme: UnistylesTheme, runtime: UnistylesMiniRuntime) => infer R ? ParseStyleKeys<R> : ParseStyleKeys<T>;
28
28
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"breakpoints.d.ts","sourceRoot":"","sources":["../../../../src/types/breakpoints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,KAAK,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAEnD,KAAK,qBAAqB,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAC1C;KAAG,CAAC,IAAI,MAAM,CAAC,G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,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;AAEvF,KAAK,cAAc,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GACnC;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC;CAAE,GAClD,KAAK,CAAA;AAEX,MAAM,MAAM,qBAAqB,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,oBAAoB,KAAK,MAAM,CAAC,GAC5G,cAAc,CAAC,CAAC,CAAC,GACjB,cAAc,CAAC,CAAC,CAAC,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import type { ShadowStyleIOS, TextStyle, TransformsStyle } from 'react-native';
2
- type TransformArrayElement<T> = T extends Array<infer U> ? U : never;
2
+ type TransformArrayElement<T> = T extends ReadonlyArray<infer U> ? U : never;
3
3
  type BoxShadow = Required<ShadowStyleIOS>;
4
4
  type TextShadow = Required<Pick<TextStyle, 'textShadowColor' | 'textShadowOffset' | 'textShadowRadius'>>;
5
5
  type Transforms = Array<TransformArrayElement<TransformsStyle['transform']>>;
@@ -1 +1 @@
1
- {"version":3,"file":"normalizer.d.ts","sourceRoot":"","sources":["../../../../src/types/normalizer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAE9E,KAAK,qBAAqB,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;AACpE,KAAK,SAAS,GAAG,QAAQ,CAAC,cAAc,CAAC,CAAA;AACzC,KAAK,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,iBAAiB,GAAG,kBAAkB,GAAG,kBAAkB,CAAC,CAAC,CAAA;AACxG,KAAK,UAAU,GAAG,KAAK,CAAC,qBAA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AA;AAED,KAAK,oBAAoB,GAAG;IACxB,eAAe,EAAE,SAAS,CAAA;IAC1B,gBAAgB,EAAE,SAAS,CAAA;IAC3B,gBAAgB,EAAE,SAAS,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,YAAY,EACR,SAAS,EACT,UAAU,EACV,UAAU,EACV,mBAAmB,EACnB,oBAAoB,EACvB,CAAA"}
@@ -1,8 +1,8 @@
1
- import type { ImageStyle, TextStyle, ViewStyle } from 'react-native';
1
+ import type { BoxShadowValue, FilterFunction, ImageStyle, TextStyle, ViewStyle } from 'react-native';
2
2
  import type { ShadowOffset, TransformStyles, UnistylesTheme } from './core';
3
3
  import type { UnistylesBreakpoints } from '../global';
4
4
  import type { UnistylesMiniRuntime } from '../core';
5
- type NestedKeys = 'shadowOffset' | 'transform' | 'textShadowOffset';
5
+ type NestedKeys = 'shadowOffset' | 'transform' | 'textShadowOffset' | 'boxShadow' | 'filter';
6
6
  export type UnistyleView = Omit<ViewStyle, NestedKeys>;
7
7
  export type UnistyleText = Omit<TextStyle, NestedKeys>;
8
8
  export type UnistyleImage = Omit<ImageStyle, NestedKeys>;
@@ -10,6 +10,8 @@ type UnistyleNestedStyles = {
10
10
  shadowOffset?: ToDeepUnistyles<ShadowOffset>;
11
11
  textShadowOffset?: ToDeepUnistyles<ShadowOffset>;
12
12
  transform?: Array<ToDeepUnistyles<TransformStyles>>;
13
+ boxShadow?: Array<ToDeepUnistyles<BoxShadowValue>> | string;
14
+ filter?: Array<ToDeepUnistyles<FilterFunction>> | string;
13
15
  };
14
16
  type Variants = {
15
17
  variants?: {
@@ -1 +1 @@
1
- {"version":3,"file":"stylesheet.d.ts","sourceRoot":"","sources":["../../../../src/types/stylesheet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,cAA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I,yBAAyB,CAAC,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC;KACpE;CACJ,GAAG,QAAQ,GAAG;KACV,QAAQ,IAAI,UAAU,CAAC,CAAC,EAAE,oBAAoB,CAAC,QAAQ,CAAC;CAC5D,CAAA;AAED,MAAM,MAAM,UAAU,GAAG;IACrB,CAAC,SAAS,EAAE,MAAM,GAAG,eAAe,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,eAAe,CAAC,CAAA;CAC7E,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,oBAAoB,KAAK,UAAU,CAAC,GAAG,UAAU,CAAA"}
@@ -11,6 +11,6 @@ type ParsedStylesheet<ST extends StyleSheetWithSuperPowers> = {
11
11
  * @param variantsMap - The map of variants to be used
12
12
  * @returns - The theme, current breakpoint and RN compatible styles
13
13
  */
14
- export declare const useStyles: <ST extends StyleSheetWithSuperPowers>(stylesheet?: ST | undefined, variantsMap?: ExtractVariantNames<ST> | undefined) => ParsedStylesheet<ST>;
14
+ export declare const useStyles: <ST extends StyleSheetWithSuperPowers>(stylesheet?: ST, variantsMap?: ExtractVariantNames<typeof stylesheet>) => ParsedStylesheet<ST>;
15
15
  export {};
16
16
  //# sourceMappingURL=useStyles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useStyles.d.ts","sourceRoot":"","sources":["../../../src/useStyles.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AACpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAIpH,KAAK,gBAAgB,CAAC,EAAE,SAAS,yBAAyB,IAAI;IAC1D,KAAK,EAAE,cAAc,CAAC;IACtB,UAAU,EAAE,MAAM,oBAAoB,CAAC;IACvC,MAAM,EAAE,qBAAqB,CAAC,EAAE,CAAC,CAAA;CACpC,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,SAAS,gJAsCrB,CAAA"}
1
+ {"version":3,"file":"useStyles.d.ts","sourceRoot":"","sources":["../../../src/useStyles.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AACpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAIpH,KAAK,gBAAgB,CAAC,EAAE,SAAS,yBAAyB,IAAI;IAC1D,KAAK,EAAE,cAAc,CAAC;IACtB,UAAU,EAAE,MAAM,oBAAoB,CAAC;IACvC,MAAM,EAAE,qBAAqB,CAAC,EAAE,CAAC,CAAA;CACpC,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,SAAS,GAAI,EAAE,SAAS,yBAAyB,eAC7C,EAAE,gBACD,mBAAmB,CAAC,OAAO,UAAU,CAAC,KACrD,gBAAgB,CAAC,EAAE,CAmCrB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"breakpoints.d.ts","sourceRoot":"","sources":["../../../../src/utils/breakpoints.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAKjD,eAAO,MAAM,qBAAqB,UAAW,OAAO,MAAM,EAAE,OAAO,CAAC,KAAG,SAAS,OAAO,CAqCtF,CAAA"}
1
+ {"version":3,"file":"breakpoints.d.ts","sourceRoot":"","sources":["../../../../src/utils/breakpoints.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAKjD,eAAO,MAAM,qBAAqB,UAAW,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,QAAQ,CAAC,OAAO,CAqCtF,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"mqParser.d.ts","sourceRoot":"","sources":["../../../../src/utils/mqParser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAM7D,KAAK,iBAAiB,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAA;CACb,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC5B,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,MAAM,CAAC,EAAE,iBAAiB,CAAA;CAC7B,CAAA;AAED,eAAO,MAAM,OAAO,OAAQ,MAAM,KAAG,iBAcpC,CAAA;AAED,eAAO,MAAM,aAAa,OAAQ,MAAM,YAAgC,CAAA;AAExE,eAAO,MAAM,SAAS,aAAc,iBAAiB,YAgBpD,CAAA;AAED,eAAO,MAAM,yBAAyB,aAAc,iBAAiB,cAAc,UAAU,KAAG,OAgB/F,CAAA;AAcD,eAAO,MAAM,4BAA4B,iBAAkB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,cAAc,UAAU,KAAG,SAAS,MAAM,CAgB5H,CAAA"}
1
+ {"version":3,"file":"mqParser.d.ts","sourceRoot":"","sources":["../../../../src/utils/mqParser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAM7D,KAAK,iBAAiB,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAA;CACb,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC5B,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,MAAM,CAAC,EAAE,iBAAiB,CAAA;CAC7B,CAAA;AAED,eAAO,MAAM,OAAO,OAAQ,MAAM,KAAG,iBAcpC,CAAA;AAED,eAAO,MAAM,aAAa,OAAQ,MAAM,YAAgC,CAAA;AAExE,eAAO,MAAM,SAAS,aAAc,iBAAiB,YAgBpD,CAAA;AAED,eAAO,MAAM,yBAAyB,aAAc,iBAAiB,cAAc,UAAU,KAAG,OAgB/F,CAAA;AAcD,eAAO,MAAM,4BAA4B,iBAAkB,KAAK,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,cAAc,UAAU,KAAG,QAAQ,CAAC,MAAM,CAgB5H,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/utils/styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAW,MAAM,UAAU,CAAA;AAK1D,eAAO,MAAM,eAAe,QACnB,MAAM,MACP,QAAQ,YACF,OAAO,MAAM,EAAE,SAAS,MAAM,CAAC,CAAC,KAC3C,QAED,CAAA;AAEF,eAAO,MAAM,eAAe,8BAA6B,OAMxD,CAAA;AAED,eAAO,MAAM,UAAU,0CAEV,OAAO,MAAM,EAAE,SAAS,MAAM,CAAC,CAAC,mCAkE9B,CAAA"}
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/utils/styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAW,MAAM,UAAU,CAAA;AAK1D,eAAO,MAAM,eAAe,QACnB,MAAM,MACP,QAAQ,YACF,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,KAC3C,QAED,CAAA;AAEF,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS,EAAE,SAAS,CAAC,KAAG,OAMxD,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,OAAO,SACjC,CAAC,YACC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,kCAE1C,CAwEY,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-unistyles",
3
- "version": "2.9.2",
3
+ "version": "2.11.0",
4
4
  "description": "Level up your React Native StyleSheet",
5
5
  "scripts": {
6
6
  "test": "jest",
@@ -86,12 +86,12 @@
86
86
  "jest": "29.7.0",
87
87
  "metro-react-native-babel-preset": "0.77.0",
88
88
  "react": "18.3.1",
89
- "react-native": "0.74.2",
89
+ "react-native": "0.76.0",
90
90
  "react-native-builder-bob": "0.23.2",
91
91
  "react-native-web": "0.19.12",
92
92
  "react-test-renderer": "18.3.1",
93
93
  "release-it": "17.4.0",
94
- "typescript": "5.3.3"
94
+ "typescript": "5.6.3"
95
95
  },
96
96
  "peerDependencies": {
97
97
  "@react-native/normalize-colors": "*",
@@ -195,6 +195,19 @@ export class UnistylesRuntime {
195
195
  return nearestPixel / pixelRatio
196
196
  }
197
197
 
198
+ /**
199
+ * Get theme by name
200
+ * @param themeName - The name of the theme to get or current theme if not specified
201
+ * @returns - The theme
202
+ */
203
+ public getTheme(themeName?: keyof UnistylesThemes) {
204
+ if (!themeName) {
205
+ return this.unistylesRegistry.getTheme(this.themeName)
206
+ }
207
+
208
+ return this.unistylesRegistry.getTheme(themeName)
209
+ }
210
+
198
211
  /**
199
212
  * Get the immersive mode (both status bar and navigation bar hidden (Android))
200
213
  * @param isEnabled
@@ -126,6 +126,14 @@ export class UnistylesMockedRuntime {
126
126
  return ScreenOrientation.Portrait
127
127
  }
128
128
 
129
+ public getTheme = (themeName?: keyof UnistylesThemes) => {
130
+ if (!themeName) {
131
+ return this.unistylesRegistry.getTheme(this.themeName)
132
+ }
133
+
134
+ return this.unistylesRegistry.getTheme(themeName)
135
+ }
136
+
129
137
  public setTheme = (name: keyof UnistylesThemes) => true
130
138
  public updateTheme = (name: keyof UnistylesThemes, theme: UnistylesThemes[keyof UnistylesThemes]) => {}
131
139
  public setAdaptiveThemes = (enabled: boolean) => {}
@@ -18,26 +18,33 @@ type ExtractBreakpoints<T> = T extends object
18
18
  }
19
19
  : T
20
20
 
21
- type ParseNestedObject<T> = T extends (...args: infer A) => infer R
22
- ? (...args: A) => ParseNestedObject<R>
21
+ type ParseNestedObject<T, ShouldFlatten> = T extends (...args: infer A) => infer R
22
+ ? (...args: A) => ParseNestedObject<R, false>
23
23
  : T extends object
24
24
  ? T extends { variants: infer R }
25
- ? ParseVariants<FlattenVariants<R>> & ParseNestedObject<Omit<T, 'variants'>>
25
+ // if intersection of Base and Variants is never, then flatten variants to generic "string"
26
+ ? (ParseVariants<FlattenVariants<R, false>> & ParseNestedObject<Omit<T, 'variants'>, false>) extends never
27
+ ? ParseVariants<FlattenVariants<R, true>> & ParseNestedObject<Omit<T, 'variants'>, false>
28
+ : ParseVariants<FlattenVariants<R, false>> & ParseNestedObject<Omit<T, 'variants'>, false>
26
29
  : {
27
30
  [K in keyof T]: T[K] extends object
28
31
  ? T[K] extends OpaqueColorValue
29
32
  ? ColorValue
30
33
  : ExtractBreakpoints<T[K]>
31
- : T[K]
34
+ : T[K] extends string
35
+ ? ShouldFlatten extends true
36
+ ? string
37
+ : T[K]
38
+ : T[K]
32
39
  }
33
40
  : T
34
41
 
35
- type FlattenVariants<T> = T extends object
42
+ type FlattenVariants<T, ShouldFlatten> = T extends object
36
43
  ? {
37
44
  [K in keyof T]: T[K] extends object
38
45
  ? {
39
46
  [key in keyof T[K]]: T[K][key] extends object
40
- ? ParseNestedObject<T[K][key]>
47
+ ? ParseNestedObject<T[K][key], ShouldFlatten>
41
48
  : never
42
49
  }
43
50
  : never
@@ -54,7 +61,7 @@ type UnionToIntersection<U> =
54
61
  (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never
55
62
 
56
63
  type ParseStyleKeys<T> = T extends object
57
- ? { [K in keyof T]: ParseNestedObject<T[K]> }
64
+ ? { [K in keyof T]: ParseNestedObject<T[K], false> }
58
65
  : never
59
66
 
60
67
  export type ReactNativeStyleSheet<T> = T extends (theme: UnistylesTheme, runtime: UnistylesMiniRuntime) => infer R
@@ -1,6 +1,6 @@
1
1
  import type { ShadowStyleIOS, TextStyle, TransformsStyle } from 'react-native'
2
2
 
3
- type TransformArrayElement<T> = T extends Array<infer U> ? U : never
3
+ type TransformArrayElement<T> = T extends ReadonlyArray<infer U> ? U : never
4
4
  type BoxShadow = Required<ShadowStyleIOS>
5
5
  type TextShadow = Required<Pick<TextStyle, 'textShadowColor' | 'textShadowOffset' | 'textShadowRadius'>>
6
6
  type Transforms = Array<TransformArrayElement<TransformsStyle['transform']>>
@@ -1,10 +1,10 @@
1
- import type { ImageStyle, TextStyle, ViewStyle } from 'react-native'
1
+ import type { BoxShadowValue, FilterFunction, ImageStyle, TextStyle, ViewStyle } from 'react-native'
2
2
  import type { ShadowOffset, TransformStyles, UnistylesTheme } from './core'
3
3
  import type { UnistylesBreakpoints } from '../global'
4
4
  import type { UnistylesMiniRuntime } from '../core'
5
5
 
6
6
  // these props are treated differently to nest breakpoints and media queries
7
- type NestedKeys = 'shadowOffset' | 'transform' | 'textShadowOffset'
7
+ type NestedKeys = 'shadowOffset' | 'transform' | 'textShadowOffset' | 'boxShadow' | 'filter'
8
8
 
9
9
  export type UnistyleView = Omit<ViewStyle, NestedKeys>
10
10
  export type UnistyleText = Omit<TextStyle, NestedKeys>
@@ -13,7 +13,9 @@ export type UnistyleImage = Omit<ImageStyle, NestedKeys>
13
13
  type UnistyleNestedStyles = {
14
14
  shadowOffset?: ToDeepUnistyles<ShadowOffset>,
15
15
  textShadowOffset?: ToDeepUnistyles<ShadowOffset>,
16
- transform?: Array<ToDeepUnistyles<TransformStyles>>
16
+ transform?: Array<ToDeepUnistyles<TransformStyles>>,
17
+ boxShadow?: Array<ToDeepUnistyles<BoxShadowValue>> | string,
18
+ filter?: Array<ToDeepUnistyles<FilterFunction>> | string
17
19
  }
18
20
 
19
21
  type Variants = {
@@ -49,6 +49,14 @@ export const parseStyle = <T extends RNStyle>(
49
49
  return acc
50
50
  }
51
51
 
52
+ if ((key === 'boxShadow' || key === 'filter') && Array.isArray(value)) {
53
+ acc[key] = value
54
+ .map(value => parseStyle(value, variant, false))
55
+ .filter(value => Object.keys(value).length === 1)
56
+
57
+ return acc
58
+ }
59
+
52
60
  if (key === 'fontVariant' && Array.isArray(value)) {
53
61
  acc[key] = value
54
62