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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. package/cxx/core/UnistylesState.cpp +4 -0
  2. package/cxx/core/UnistylesState.h +1 -0
  3. package/cxx/hybridObjects/HybridStyleSheet.cpp +4 -0
  4. package/lib/commonjs/core/useTheme.js.map +1 -1
  5. package/lib/commonjs/core/useTheme.native.js.map +1 -1
  6. package/lib/module/core/useTheme.js.map +1 -1
  7. package/lib/module/core/useTheme.native.js.map +1 -1
  8. package/lib/module/web/utils/unistyle.js.map +1 -1
  9. package/lib/typescript/src/core/useBreakpoint.d.ts +1 -1
  10. package/lib/typescript/src/core/useBreakpoint.d.ts.map +1 -1
  11. package/lib/typescript/src/core/useBreakpoint.native.d.ts +1 -1
  12. package/lib/typescript/src/core/useBreakpoint.native.d.ts.map +1 -1
  13. package/lib/typescript/src/core/useTheme.d.ts +2 -40
  14. package/lib/typescript/src/core/useTheme.d.ts.map +1 -1
  15. package/lib/typescript/src/core/useTheme.native.d.ts +2 -40
  16. package/lib/typescript/src/core/useTheme.native.d.ts.map +1 -1
  17. package/lib/typescript/src/global.d.ts +2 -0
  18. package/lib/typescript/src/global.d.ts.map +1 -1
  19. package/lib/typescript/src/types/variants.d.ts +1 -1
  20. package/lib/typescript/src/types/variants.d.ts.map +1 -1
  21. package/lib/typescript/src/web/create.d.ts +10 -1220
  22. package/lib/typescript/src/web/create.d.ts.map +1 -1
  23. package/lib/typescript/src/web/index.d.ts +10 -1220
  24. package/lib/typescript/src/web/index.d.ts.map +1 -1
  25. package/lib/typescript/src/web/runtime.d.ts +4 -4
  26. package/lib/typescript/src/web/runtime.d.ts.map +1 -1
  27. package/lib/typescript/src/web/state.d.ts +1 -2
  28. package/lib/typescript/src/web/state.d.ts.map +1 -1
  29. package/lib/typescript/src/web/utils/unistyle.d.ts +1 -1
  30. package/lib/typescript/src/web/utils/unistyle.d.ts.map +1 -1
  31. package/package.json +3 -4
  32. package/src/core/useTheme.native.ts +2 -1
  33. package/src/core/useTheme.ts +2 -1
  34. package/src/global.ts +4 -1
  35. package/src/types/variants.ts +1 -1
  36. package/src/web/utils/unistyle.ts +1 -1
  37. package/lib/typescript/example/App.d.ts +0 -4
  38. package/lib/typescript/example/App.d.ts.map +0 -1
  39. package/lib/typescript/example/Typography.d.ts +0 -35
  40. package/lib/typescript/example/Typography.d.ts.map +0 -1
  41. package/lib/typescript/example/unistyles.d.ts +0 -63
  42. package/lib/typescript/example/unistyles.d.ts.map +0 -1
  43. package/lib/typescript/expo-example/App.d.ts +0 -4
  44. package/lib/typescript/expo-example/App.d.ts.map +0 -1
  45. package/lib/typescript/expo-example/app/(tabs)/_layout.d.ts +0 -3
  46. package/lib/typescript/expo-example/app/(tabs)/_layout.d.ts.map +0 -1
  47. package/lib/typescript/expo-example/app/(tabs)/explore.d.ts +0 -3
  48. package/lib/typescript/expo-example/app/(tabs)/explore.d.ts.map +0 -1
  49. package/lib/typescript/expo-example/app/(tabs)/index.d.ts +0 -3
  50. package/lib/typescript/expo-example/app/(tabs)/index.d.ts.map +0 -1
  51. package/lib/typescript/expo-example/app/+html.d.ts +0 -4
  52. package/lib/typescript/expo-example/app/+html.d.ts.map +0 -1
  53. package/lib/typescript/expo-example/app/+not-found.d.ts +0 -3
  54. package/lib/typescript/expo-example/app/+not-found.d.ts.map +0 -1
  55. package/lib/typescript/expo-example/app/_layout.d.ts +0 -3
  56. package/lib/typescript/expo-example/app/_layout.d.ts.map +0 -1
  57. package/lib/typescript/expo-example/unistyles.d.ts +0 -63
  58. package/lib/typescript/expo-example/unistyles.d.ts.map +0 -1
  59. package/plugin/__tests__/dependencies.spec.js +0 -448
  60. package/plugin/__tests__/ref.spec.js +0 -1427
  61. package/plugin/__tests__/stylesheet.spec.js +0 -507
@@ -25,6 +25,10 @@ std::optional<std::string>& core::UnistylesState::getCurrentThemeName() {
25
25
 
26
26
  jsi::Object core::UnistylesState::getCurrentJSTheme() {
27
27
  auto hasSomeThemes = _registeredThemeNames.size() > 0;
28
+
29
+ if (!hasSomeThemes && !this->hasUserConfig) {
30
+ helpers::assertThat(*_rt, false, "Unistyles: One of your stylesheets is trying to get the theme, but no theme has been selected yet. Did you forget to call StyleSheet.configure? If you called it, make sure you did so before any StyleSheet.create.");
31
+ }
28
32
 
29
33
  // return empty object, if user didn't register any themes
30
34
  if (!hasSomeThemes) {
@@ -17,6 +17,7 @@ struct UnistylesState {
17
17
  UnistylesState(const UnistylesState&) = delete;
18
18
  UnistylesState(const UnistylesState&&) = delete;
19
19
 
20
+ bool hasUserConfig = false;
20
21
  bool hasAdaptiveThemes();
21
22
  bool hasInitialTheme();
22
23
  bool getPrefersAdaptiveThemes();
@@ -67,6 +67,10 @@ jsi::Value HybridStyleSheet::configure(jsi::Runtime &rt, const jsi::Value &thisV
67
67
  });
68
68
 
69
69
  verifyAndSelectTheme(rt);
70
+
71
+ auto& state = core::UnistylesRegistry::get().getState(rt);
72
+
73
+ state.hasUserConfig = true;
70
74
 
71
75
  return jsi::Value::undefined();
72
76
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_react","require","_web","_listener","_NativePlatform","useTheme","theme","setTheme","useState","UnistylesRuntime","getTheme","useEffect","removeChangeListener","UnistylesListener","addListeners","UnistyleDependency","Theme","exports"],"sourceRoot":"../../../src","sources":["core/useTheme.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AAEO,MAAMI,QAAQ,GAAGA,CAAA,KAAM;EAC1B,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAG,IAAAC,eAAQ,EAACC,qBAAgB,CAACC,QAAQ,CAAC,CAAC,CAAC;EAE/D,IAAAC,gBAAS,EAAC,MAAM;IACZ,MAAMC,oBAAoB,GAAGC,2BAAiB,CAACC,YAAY,CAAC,CAACC,kCAAkB,CAACC,KAAK,CAAC,EAAE,MAAMT,QAAQ,CAACE,qBAAgB,CAACC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAEpI,OAAO,MAAM;MACTE,oBAAoB,CAAC,CAAC;IAC1B,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAEN,OAAON,KAAK;AAChB,CAAC;AAAAW,OAAA,CAAAZ,QAAA,GAAAA,QAAA","ignoreList":[]}
1
+ {"version":3,"names":["_react","require","_web","_listener","_NativePlatform","useTheme","theme","setTheme","useState","UnistylesRuntime","getTheme","useEffect","removeChangeListener","UnistylesListener","addListeners","UnistyleDependency","Theme","exports"],"sourceRoot":"../../../src","sources":["core/useTheme.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AAGO,MAAMI,QAAQ,GAAGA,CAAA,KAAsB;EAC1C,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAG,IAAAC,eAAQ,EAACC,qBAAgB,CAACC,QAAQ,CAAC,CAAC,CAAC;EAE/D,IAAAC,gBAAS,EAAC,MAAM;IACZ,MAAMC,oBAAoB,GAAGC,2BAAiB,CAACC,YAAY,CAAC,CAACC,kCAAkB,CAACC,KAAK,CAAC,EAAE,MAAMT,QAAQ,CAACE,qBAAgB,CAACC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAEpI,OAAO,MAAM;MACTE,oBAAoB,CAAC,CAAC;IAC1B,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAEN,OAAON,KAAK;AAChB,CAAC;AAAAW,OAAA,CAAAZ,QAAA,GAAAA,QAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_react","require","_specs","useTheme","theme","setTheme","useState","UnistylesRuntime","getTheme","useEffect","removeChangeListener","StyleSheet","addChangeListener","dependencies","includes","UnistyleDependency","Theme","exports"],"sourceRoot":"../../../src","sources":["core/useTheme.native.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAGO,MAAME,QAAQ,GAAGA,CAAA,KAAM;EAC1B,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAG,IAAAC,eAAQ,EAACC,uBAAgB,CAACC,QAAQ,CAAC,CAAC,CAAC;EAE/D,IAAAC,gBAAS,EAAC,MAAM;IACZ,MAAMC,oBAAoB,GAAIC,iBAAU,CAAyBC,iBAAiB,CAACC,YAAY,IAAI;MAC/F,IAAIA,YAAY,CAACC,QAAQ,CAACC,yBAAkB,CAACC,KAAK,CAAC,EAAE;QACjDX,QAAQ,CAACE,uBAAgB,CAACC,QAAQ,CAAC,CAAC,CAAC;MACzC;IACJ,CAAC,CAAC;IAEF,OAAO,MAAM;MACTE,oBAAoB,CAAC,CAAC;IAC1B,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAEN,OAAON,KAAK;AAChB,CAAC;AAAAa,OAAA,CAAAd,QAAA,GAAAA,QAAA","ignoreList":[]}
1
+ {"version":3,"names":["_react","require","_specs","useTheme","theme","setTheme","useState","UnistylesRuntime","getTheme","useEffect","removeChangeListener","StyleSheet","addChangeListener","dependencies","includes","UnistyleDependency","Theme","exports"],"sourceRoot":"../../../src","sources":["core/useTheme.native.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAIO,MAAME,QAAQ,GAAGA,CAAA,KAAsB;EAC1C,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAG,IAAAC,eAAQ,EAACC,uBAAgB,CAACC,QAAQ,CAAC,CAAC,CAAC;EAE/D,IAAAC,gBAAS,EAAC,MAAM;IACZ,MAAMC,oBAAoB,GAAIC,iBAAU,CAAyBC,iBAAiB,CAACC,YAAY,IAAI;MAC/F,IAAIA,YAAY,CAACC,QAAQ,CAACC,yBAAkB,CAACC,KAAK,CAAC,EAAE;QACjDX,QAAQ,CAACE,uBAAgB,CAACC,QAAQ,CAAC,CAAC,CAAC;MACzC;IACJ,CAAC,CAAC;IAEF,OAAO,MAAM;MACTE,oBAAoB,CAAC,CAAC;IAC1B,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAEN,OAAON,KAAK;AAChB,CAAC;AAAAa,OAAA,CAAAd,QAAA,GAAAA,QAAA","ignoreList":[]}
@@ -1 +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":[]}
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;AAG5D,OAAO,MAAMC,QAAQ,GAAGA,CAAA,KAAsB;EAC1C,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":[]}
@@ -1 +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
+ {"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;AAI3E,OAAO,MAAMC,QAAQ,GAAGA,CAAA,KAAsB;EAC1C,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 +1 @@
1
- {"version":3,"names":["ColorScheme","Orientation","isUnistylesMq","parseMq","UnistylesState","keyInObject","reduceObject","schemeToTheme","scheme","Dark","Light","hexToRGBA","hex","opacity","replace","split","map","x","parseInt","filter","num","isNaN","reduce","acc","color","concat","assignSecrets","object","secrets","Math","random","toString","slice","extractSecrets","Object","entries","key","value","startsWith","push","getStyles","values","returnValue","defineProperties","enumerable","configurable","isInDocument","element","document","body","contains","extractMediaQueryValue","query","_","px","match","undefined","Number","getMediaQuery","includes","minWidth","maxWidth","minHeight","maxHeight","Boolean","join","breakpoints","extractUnistyleDependencies","dependencies","uni__dependencies"],"sourceRoot":"../../../../src","sources":["web/utils/unistyle.ts"],"mappings":";;AACA,SAASA,WAAW,EAAEC,WAAW,QAA2B,mBAAmB;AAE/E,SAASC,aAAa,EAAEC,OAAO,QAAQ,OAAO;AAC9C,SAASC,cAAc,QAAQ,UAAU;AACzC,SAASC,WAAW,EAAEC,YAAY,QAAQ,UAAU;AAEpD,OAAO,MAAMC,aAAa,GAAIC,MAAmB,IAAmB;EAChE,QAAQA,MAAM;IACV,KAAKR,WAAW,CAACS,IAAI;MACjB,OAAO,MAAM;IACjB,KAAKT,WAAW,CAACU,KAAK;IACtB;MACI,OAAO,OAAO;EACtB;AACJ,CAAC;AAED,OAAO,MAAMC,SAAS,GAAGA,CAACC,GAAW,EAAEC,OAAe,KAAKD,GAAG,CACzDE,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAChBC,KAAK,CAAC,cAAc,CAAC,CACrBC,GAAG,CAACC,CAAC,IAAIC,QAAQ,CAACD,CAAC,EAAE,EAAE,CAAC,CAAC,CACzBE,MAAM,CAACC,GAAG,IAAI,CAACC,KAAK,CAACD,GAAG,CAAC,CAAC,CAC1BE,MAAM,CAAC,CAACC,GAAG,EAAEC,KAAK,KAAK,GAAGD,GAAG,GAAGC,KAAK,GAAG,EAAE,OAAO,CAAC,CAClDC,MAAM,CAAC,GAAGZ,OAAO,GAAG,CAAC;AAU1B,OAAO,MAAMa,aAAa,GAAGA,CAAIC,MAAS,EAAEC,OAAwB,KAAK;EACrE;EACAD,MAAM,CAAC,mBAAmBE,IAAI,CAACC,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,EAAE,CAAC,CAACC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,GAAGJ,OAAO;EAE1E,OAAOD,MAAM;AACjB,CAAC;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AC3D,OAAO,iBAAiBA,KAAK,GAAG;EACpC;EAEA,IAAIlD,aAAa,CAACkD,KAAK,CAAC,EAAE;IACtB,MAAM;MAAEQ,QAAQ;MAAEC,QAAQ;MAAEC,SAAS;MAAEC;IAAU,CAAC,GAAG5D,OAAO,CAACiD,KAAK,CAAC;IAEnE,OAAO,CACHQ,QAAQ,GAAG,eAAeA,QAAQ,KAAK,GAAGJ,SAAS,EACnDK,QAAQ,GAAG,eAAeA,QAAQ,KAAK,GAAGL,SAAS,EACnDM,SAAS,GAAG,gBAAgBA,SAAS,KAAK,GAAGN,SAAS,EACtDO,SAAS,GAAG,gBAAgBA,SAAS,KAAK,GAAGP,SAAS,CACzD,CAACrC,MAAM,CAAC6C,OAAO,CAAC,CAACC,IAAI,CAAC,OAAO,CAAC;EACnC;EAEA,MAAML,QAAQ,GAAGxD,cAAc,CAAC8D,WAAW,IAAI7D,WAAW,CAACD,cAAc,CAAC8D,WAAW,EAAEd,KAAK,CAAC,GAAGhD,cAAc,CAAC8D,WAAW,CAACd,KAAK,CAAC,GAAGI,SAAS;EAE7I,OAAO,eAAeI,QAAQ,IAAI,CAAC,KAAK;AAC5C,CAAC;AAED,OAAO,MAAMO,2BAA2B,GAAI9B,KAAU,IAAK;EACvD,MAAM+B,YAAuC,GAAG/D,WAAW,CAACgC,KAAK,EAAE,mBAAmB,CAAC,GAAGA,KAAK,CAACgC,iBAAiB,GAAG,EAAE;EAEtH,OAAOD,YAAY;AACvB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["ColorScheme","Orientation","isUnistylesMq","parseMq","UnistylesState","keyInObject","reduceObject","schemeToTheme","scheme","Dark","Light","hexToRGBA","hex","opacity","replace","split","map","x","parseInt","filter","num","isNaN","reduce","acc","color","concat","assignSecrets","object","secrets","Math","random","toString","slice","extractSecrets","Object","entries","key","value","startsWith","push","getStyles","values","returnValue","defineProperties","enumerable","configurable","isInDocument","element","document","body","contains","extractMediaQueryValue","query","_","px","match","undefined","Number","getMediaQuery","includes","minWidth","maxWidth","minHeight","maxHeight","Boolean","join","breakpoints","extractUnistyleDependencies","dependencies","uni__dependencies"],"sourceRoot":"../../../../src","sources":["web/utils/unistyle.ts"],"mappings":";;AACA,SAA4BA,WAAW,EAAEC,WAAW,QAAQ,mBAAmB;AAE/E,SAASC,aAAa,EAAEC,OAAO,QAAQ,OAAO;AAC9C,SAASC,cAAc,QAAQ,UAAU;AACzC,SAASC,WAAW,EAAEC,YAAY,QAAQ,UAAU;AAEpD,OAAO,MAAMC,aAAa,GAAIC,MAAmB,IAAmB;EAChE,QAAQA,MAAM;IACV,KAAKR,WAAW,CAACS,IAAI;MACjB,OAAO,MAAM;IACjB,KAAKT,WAAW,CAACU,KAAK;IACtB;MACI,OAAO,OAAO;EACtB;AACJ,CAAC;AAED,OAAO,MAAMC,SAAS,GAAGA,CAACC,GAAW,EAAEC,OAAe,KAAKD,GAAG,CACzDE,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAChBC,KAAK,CAAC,cAAc,CAAC,CACrBC,GAAG,CAACC,CAAC,IAAIC,QAAQ,CAACD,CAAC,EAAE,EAAE,CAAC,CAAC,CACzBE,MAAM,CAACC,GAAG,IAAI,CAACC,KAAK,CAACD,GAAG,CAAC,CAAC,CAC1BE,MAAM,CAAC,CAACC,GAAG,EAAEC,KAAK,KAAK,GAAGD,GAAG,GAAGC,KAAK,GAAG,EAAE,OAAO,CAAC,CAClDC,MAAM,CAAC,GAAGZ,OAAO,GAAG,CAAC;AAU1B,OAAO,MAAMa,aAAa,GAAGA,CAAIC,MAAS,EAAEC,OAAwB,KAAK;EACrE;EACAD,MAAM,CAAC,mBAAmBE,IAAI,CAACC,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,EAAE,CAAC,CAACC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,GAAGJ,OAAO;EAE1E,OAAOD,MAAM;AACjB,CAAC;AAED,OAAO,MAAMM,cAAc,GAAIN,MAAW,IAAK;EAC3C,MAAMC,O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,CAACkD,KAAK,CAAC,EAAE;IACtB,MAAM;MAAEQ,QAAQ;MAAEC,QAAQ;MAAEC,SAAS;MAAEC;IAAU,CAAC,GAAG5D,OAAO,CAACiD,KAAK,CAAC;IAEnE,OAAO,CACHQ,QAAQ,GAAG,eAAeA,QAAQ,KAAK,GAAGJ,SAAS,EACnDK,QAAQ,GAAG,eAAeA,QAAQ,KAAK,GAAGL,SAAS,EACnDM,SAAS,GAAG,gBAAgBA,SAAS,KAAK,GAAGN,SAAS,EACtDO,SAAS,GAAG,gBAAgBA,SAAS,KAAK,GAAGP,SAAS,CACzD,CAACrC,MAAM,CAAC6C,OAAO,CAAC,CAACC,IAAI,CAAC,OAAO,CAAC;EACnC;EAEA,MAAML,QAAQ,GAAGxD,cAAc,CAAC8D,WAAW,IAAI7D,WAAW,CAACD,cAAc,CAAC8D,WAAW,EAAEd,KAAK,CAAC,GAAGhD,cAAc,CAAC8D,WAAW,CAACd,KAAK,CAAC,GAAGI,SAAS;EAE7I,OAAO,eAAeI,QAAQ,IAAI,CAAC,KAAK;AAC5C,CAAC;AAED,OAAO,MAAMO,2BAA2B,GAAI9B,KAAU,IAAK;EACvD,MAAM+B,YAAuC,GAAG/D,WAAW,CAACgC,KAAK,EAAE,mBAAmB,CAAC,GAAGA,KAAK,CAACgC,iBAAiB,GAAG,EAAE;EAEtH,OAAOD,YAAY;AACvB,CAAC","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- export declare const useBreakpoint: () => "portrait" | "landscape" | "xs" | "sm" | "md" | "lg" | "xl" | undefined;
1
+ export declare const useBreakpoint: () => "portrait" | "landscape" | undefined;
2
2
  //# sourceMappingURL=useBreakpoint.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useBreakpoint.d.ts","sourceRoot":"","sources":["../../../../src/core/useBreakpoint.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,aAAa,+EAYzB,CAAA"}
1
+ {"version":3,"file":"useBreakpoint.d.ts","sourceRoot":"","sources":["../../../../src/core/useBreakpoint.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,aAAa,4CAYzB,CAAA"}
@@ -1,2 +1,2 @@
1
- export declare const useBreakpoint: () => "portrait" | "landscape" | "xs" | "sm" | "md" | "lg" | "xl" | undefined;
1
+ export declare const useBreakpoint: () => "portrait" | "landscape" | undefined;
2
2
  //# sourceMappingURL=useBreakpoint.native.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useBreakpoint.native.d.ts","sourceRoot":"","sources":["../../../../src/core/useBreakpoint.native.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa,+EAgBzB,CAAA"}
1
+ {"version":3,"file":"useBreakpoint.native.d.ts","sourceRoot":"","sources":["../../../../src/core/useBreakpoint.native.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa,4CAgBzB,CAAA"}
@@ -1,41 +1,3 @@
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
- };
1
+ import type { UnistylesTheme } from '../types';
2
+ export declare const useTheme: () => UnistylesTheme;
41
3
  //# sourceMappingURL=useTheme.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../../../src/core/useTheme.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAYpB,CAAA"}
1
+ {"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../../../src/core/useTheme.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAE9C,eAAO,MAAM,QAAQ,QAAO,cAY3B,CAAA"}
@@ -1,41 +1,3 @@
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
- };
1
+ import type { UnistylesTheme } from '../types';
2
+ export declare const useTheme: () => UnistylesTheme;
41
3
  //# sourceMappingURL=useTheme.native.d.ts.map
@@ -1 +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
+ {"version":3,"file":"useTheme.native.d.ts","sourceRoot":"","sources":["../../../../src/core/useTheme.native.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAE9C,eAAO,MAAM,QAAQ,QAAO,cAgB3B,CAAA"}
@@ -1,4 +1,6 @@
1
1
  export interface UnistylesThemes {
2
+ light: {};
3
+ dark: {};
2
4
  }
3
5
  export interface UnistylesBreakpoints {
4
6
  landscape?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../../../src/global.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;CAAG;AACnC,MAAM,WAAW,oBAAoB;IAEjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB"}
1
+ {"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../../../src/global.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC5B,KAAK,EAAE,EAAE,CAAA;IACT,IAAI,EAAE,EAAE,CAAA;CACX;AACD,MAAM,WAAW,oBAAoB;IAEjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB"}
@@ -7,7 +7,7 @@ type ExtractVariant<T> = T extends {
7
7
  variants: infer V;
8
8
  } ? {
9
9
  [key in keyof V]?: ExtractSubVariantKeys<V[key]>;
10
- } : T;
10
+ } : never;
11
11
  export type UnistylesVariants<ST> = ST extends {
12
12
  useVariants: infer V;
13
13
  } ? V extends (variants: infer T) => void ? T : never : never;
@@ -1 +1 @@
1
- {"version":3,"file":"variants.d.ts","sourceRoot":"","sources":["../../../../src/types/variants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAE9C,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,kBAAkB,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;AAE1E,KAAK,kBAAkB,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GACvC,cAAc,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAC1C,KAAK,CAAA;AAEX,KAAK,kBAAkB,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACpD,IAAI,GACJ,CAAC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