react-native-unistyles 1.1.1 → 2.0.0-alpha.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (157) hide show
  1. package/ios/UnistylesModule.h +10 -0
  2. package/ios/UnistylesModule.mm +108 -0
  3. package/ios/UnistylesRuntime.h +30 -0
  4. package/ios/UnistylesRuntime.mm +191 -0
  5. package/lib/commonjs/UnistyleRegistry.js +37 -0
  6. package/lib/commonjs/UnistyleRegistry.js.map +1 -0
  7. package/lib/commonjs/Unistyles.js +36 -0
  8. package/lib/commonjs/Unistyles.js.map +1 -0
  9. package/lib/commonjs/UnistylesEngine.js +22 -0
  10. package/lib/commonjs/UnistylesEngine.js.map +1 -0
  11. package/lib/commonjs/UnistylesModule.js +9 -0
  12. package/lib/commonjs/UnistylesModule.js.map +1 -0
  13. package/lib/commonjs/UnistylesRuntime.js +52 -0
  14. package/lib/commonjs/UnistylesRuntime.js.map +1 -0
  15. package/lib/commonjs/createStyleSheet.js +14 -0
  16. package/lib/commonjs/createStyleSheet.js.map +1 -0
  17. package/lib/commonjs/global.js +2 -0
  18. package/lib/commonjs/global.js.map +1 -0
  19. package/lib/commonjs/index.js +33 -6
  20. package/lib/commonjs/index.js.map +1 -1
  21. package/lib/commonjs/types/cxx.js +23 -0
  22. package/lib/commonjs/types/cxx.js.map +1 -0
  23. package/lib/commonjs/types/index.js +11 -0
  24. package/lib/commonjs/types/index.js.map +1 -1
  25. package/lib/commonjs/useInitialTheme.js +13 -0
  26. package/lib/commonjs/useInitialTheme.js.map +1 -0
  27. package/lib/commonjs/useStyles.js +48 -0
  28. package/lib/commonjs/useStyles.js.map +1 -0
  29. package/lib/commonjs/useUnistyles.js +59 -0
  30. package/lib/commonjs/useUnistyles.js.map +1 -0
  31. package/lib/commonjs/utils/breakpoints.js +4 -2
  32. package/lib/commonjs/utils/breakpoints.js.map +1 -1
  33. package/lib/commonjs/utils/styles.js +6 -6
  34. package/lib/commonjs/utils/styles.js.map +1 -1
  35. package/lib/module/UnistyleRegistry.js +30 -0
  36. package/lib/module/UnistyleRegistry.js.map +1 -0
  37. package/lib/module/Unistyles.js +30 -0
  38. package/lib/module/Unistyles.js.map +1 -0
  39. package/lib/module/UnistylesEngine.js +15 -0
  40. package/lib/module/UnistylesEngine.js.map +1 -0
  41. package/lib/module/UnistylesModule.js +3 -0
  42. package/lib/module/UnistylesModule.js.map +1 -0
  43. package/lib/module/UnistylesRuntime.js +45 -0
  44. package/lib/module/UnistylesRuntime.js.map +1 -0
  45. package/lib/module/createStyleSheet.js +7 -0
  46. package/lib/module/createStyleSheet.js.map +1 -0
  47. package/lib/module/global.js +2 -0
  48. package/lib/module/global.js.map +1 -0
  49. package/lib/module/index.js +18 -2
  50. package/lib/module/index.js.map +1 -1
  51. package/lib/module/types/cxx.js +17 -0
  52. package/lib/module/types/cxx.js.map +1 -0
  53. package/lib/module/types/index.js +1 -0
  54. package/lib/module/types/index.js.map +1 -1
  55. package/lib/module/useInitialTheme.js +6 -0
  56. package/lib/module/useInitialTheme.js.map +1 -0
  57. package/lib/module/useStyles.js +42 -0
  58. package/lib/module/useStyles.js.map +1 -0
  59. package/lib/module/useUnistyles.js +52 -0
  60. package/lib/module/useUnistyles.js.map +1 -0
  61. package/lib/module/utils/breakpoints.js +4 -3
  62. package/lib/module/utils/breakpoints.js.map +1 -1
  63. package/lib/module/utils/styles.js +6 -7
  64. package/lib/module/utils/styles.js.map +1 -1
  65. package/lib/typescript/examples/expo/src/App.d.ts.map +1 -1
  66. package/lib/typescript/examples/expo/src/examples/Cxx.d.ts +3 -0
  67. package/lib/typescript/examples/expo/src/examples/Cxx.d.ts.map +1 -0
  68. package/lib/typescript/examples/expo/src/examples/index.d.ts +1 -7
  69. package/lib/typescript/examples/expo/src/examples/index.d.ts.map +1 -1
  70. package/lib/typescript/examples/expo/src/styles/index.d.ts +15 -45
  71. package/lib/typescript/examples/expo/src/styles/index.d.ts.map +1 -1
  72. package/lib/typescript/examples/expo/src/styles/theme.d.ts +17 -1
  73. package/lib/typescript/examples/expo/src/styles/theme.d.ts.map +1 -1
  74. package/lib/typescript/src/UnistyleRegistry.d.ts +15 -0
  75. package/lib/typescript/src/UnistyleRegistry.d.ts.map +1 -0
  76. package/lib/typescript/src/Unistyles.d.ts +16 -0
  77. package/lib/typescript/src/Unistyles.d.ts.map +1 -0
  78. package/lib/typescript/src/UnistylesEngine.d.ts +8 -0
  79. package/lib/typescript/src/UnistylesEngine.d.ts.map +1 -0
  80. package/lib/typescript/src/UnistylesModule.d.ts +6 -0
  81. package/lib/typescript/src/UnistylesModule.d.ts.map +1 -0
  82. package/lib/typescript/src/UnistylesRuntime.d.ts +56 -0
  83. package/lib/typescript/src/UnistylesRuntime.d.ts.map +1 -0
  84. package/lib/typescript/src/createStyleSheet.d.ts +6 -0
  85. package/lib/typescript/src/createStyleSheet.d.ts.map +1 -0
  86. package/lib/typescript/src/global.d.ts +5 -0
  87. package/lib/typescript/src/global.d.ts.map +1 -0
  88. package/lib/typescript/src/index.d.ts +14 -2
  89. package/lib/typescript/src/index.d.ts.map +1 -1
  90. package/lib/typescript/src/types/breakpoints.d.ts +6 -7
  91. package/lib/typescript/src/types/breakpoints.d.ts.map +1 -1
  92. package/lib/typescript/src/types/core.d.ts +4 -4
  93. package/lib/typescript/src/types/core.d.ts.map +1 -1
  94. package/lib/typescript/src/types/cxx.d.ts +50 -0
  95. package/lib/typescript/src/types/cxx.d.ts.map +1 -0
  96. package/lib/typescript/src/types/index.d.ts +3 -1
  97. package/lib/typescript/src/types/index.d.ts.map +1 -1
  98. package/lib/typescript/src/useInitialTheme.d.ts +3 -0
  99. package/lib/typescript/src/useInitialTheme.d.ts.map +1 -0
  100. package/lib/typescript/src/useStyles.d.ts +46 -0
  101. package/lib/typescript/src/useStyles.d.ts.map +1 -0
  102. package/lib/typescript/src/useUnistyles.d.ts +45 -0
  103. package/lib/typescript/src/useUnistyles.d.ts.map +1 -0
  104. package/lib/typescript/src/utils/breakpoints.d.ts +5 -4
  105. package/lib/typescript/src/utils/breakpoints.d.ts.map +1 -1
  106. package/lib/typescript/src/utils/styles.d.ts +4 -3
  107. package/lib/typescript/src/utils/styles.d.ts.map +1 -1
  108. package/package.json +11 -8
  109. package/react-native-unistyles.podspec +21 -0
  110. package/src/UnistyleRegistry.ts +39 -0
  111. package/src/Unistyles.ts +41 -0
  112. package/src/UnistylesEngine.ts +15 -0
  113. package/src/UnistylesModule.ts +7 -0
  114. package/src/UnistylesRuntime.ts +58 -0
  115. package/src/createStyleSheet.ts +12 -0
  116. package/src/global.ts +2 -0
  117. package/src/index.ts +30 -2
  118. package/src/types/breakpoints.ts +9 -11
  119. package/src/types/core.ts +6 -6
  120. package/src/types/cxx.ts +61 -0
  121. package/src/types/index.ts +3 -3
  122. package/src/useInitialTheme.ts +7 -0
  123. package/src/useStyles.ts +49 -0
  124. package/src/useUnistyles.ts +67 -0
  125. package/src/utils/breakpoints.ts +16 -14
  126. package/src/utils/styles.ts +16 -18
  127. package/lib/commonjs/UnistylesTheme.js +0 -21
  128. package/lib/commonjs/UnistylesTheme.js.map +0 -1
  129. package/lib/commonjs/createUnistyles.js +0 -57
  130. package/lib/commonjs/createUnistyles.js.map +0 -1
  131. package/lib/module/UnistylesTheme.js +0 -12
  132. package/lib/module/UnistylesTheme.js.map +0 -1
  133. package/lib/module/createUnistyles.js +0 -50
  134. package/lib/module/createUnistyles.js.map +0 -1
  135. package/lib/typescript/examples/expo/src/examples/Breakpoints.d.ts +0 -3
  136. package/lib/typescript/examples/expo/src/examples/Breakpoints.d.ts.map +0 -1
  137. package/lib/typescript/examples/expo/src/examples/EmptyStyles.d.ts +0 -3
  138. package/lib/typescript/examples/expo/src/examples/EmptyStyles.d.ts.map +0 -1
  139. package/lib/typescript/examples/expo/src/examples/Extreme.d.ts +0 -7
  140. package/lib/typescript/examples/expo/src/examples/Extreme.d.ts.map +0 -1
  141. package/lib/typescript/examples/expo/src/examples/MediaQueries.d.ts +0 -3
  142. package/lib/typescript/examples/expo/src/examples/MediaQueries.d.ts.map +0 -1
  143. package/lib/typescript/examples/expo/src/examples/Memoization.d.ts +0 -3
  144. package/lib/typescript/examples/expo/src/examples/Memoization.d.ts.map +0 -1
  145. package/lib/typescript/examples/expo/src/examples/Minimal.d.ts +0 -3
  146. package/lib/typescript/examples/expo/src/examples/Minimal.d.ts.map +0 -1
  147. package/lib/typescript/examples/expo/src/examples/MinimalWithCreateStyleSheet.d.ts +0 -3
  148. package/lib/typescript/examples/expo/src/examples/MinimalWithCreateStyleSheet.d.ts.map +0 -1
  149. package/lib/typescript/examples/expo/src/examples/Theme.d.ts +0 -3
  150. package/lib/typescript/examples/expo/src/examples/Theme.d.ts.map +0 -1
  151. package/lib/typescript/src/UnistylesTheme.d.ts +0 -9
  152. package/lib/typescript/src/UnistylesTheme.d.ts.map +0 -1
  153. package/lib/typescript/src/createUnistyles.d.ts +0 -10
  154. package/lib/typescript/src/createUnistyles.d.ts.map +0 -1
  155. package/src/UnistylesTheme.tsx +0 -17
  156. package/src/__tests__/createUnistyles.spec.tsx +0 -192
  157. package/src/createUnistyles.ts +0 -70
@@ -1,6 +1,6 @@
1
+ import { unistyles } from '../Unistyles';
1
2
  import { throwError } from './common';
2
3
  import { getKeyForCustomMediaQuery, isMediaQuery } from './mediaQueries';
3
-
4
4
  /**
5
5
  * Sorts the breakpoints object based on its numeric values in ascending order and validates them.
6
6
  *
@@ -90,7 +90,7 @@ export const getBreakpointFromScreenWidth = (width, breakpointEntries) => {
90
90
  *
91
91
  * getValueForBreakpoint(values, 'sm', screenSize, breakpoints); // 'value1'
92
92
  */
93
- export const getValueForBreakpoint = (value, breakpoint, screenSize, breakpointPairs) => {
93
+ export const getValueForBreakpoint = (value, breakpoint, screenSize) => {
94
94
  // the highest priority is for custom media queries
95
95
  const customMediaQueries = Object.entries(value).filter(_ref2 => {
96
96
  let [key] = _ref2;
@@ -102,7 +102,7 @@ export const getValueForBreakpoint = (value, breakpoint, screenSize, breakpointP
102
102
  }
103
103
 
104
104
  // if no custom media query, or didn't match, proceed with defined breakpoints
105
- const unifiedKey = breakpoint.toLowerCase();
105
+ const unifiedKey = breakpoint?.toLowerCase();
106
106
  const directBreakpoint = value[unifiedKey];
107
107
 
108
108
  // if there is a direct key like 'sm' or 'md', or value for this key exists but its undefined
@@ -111,6 +111,7 @@ export const getValueForBreakpoint = (value, breakpoint, screenSize, breakpointP
111
111
  }
112
112
 
113
113
  // there is no direct hit for breakpoint nor media-query, so let's simulate CSS cascading
114
+ const breakpointPairs = unistyles.runtime.sortedBreakpoints;
114
115
  const currentBreakpoint = breakpointPairs.findIndex(_ref3 => {
115
116
  let [key] = _ref3;
116
117
  return key === unifiedKey;
@@ -1 +1 @@
1
- {"version":3,"names":["throwError","getKeyForCustomMediaQuery","isMediaQuery","sortAndValidateBreakpoints","breakpoints","sortedPairs","Object","entries","sort","breakpoint1","breakpoint2","value1","value2","sortedBreakpoints","freeze","fromEntries","breakpointValues","values","firstBreakpoint","length","Set","size","getBreakpointFromScreenWidth","width","breakpointEntries","key","find","_ref","index","otherBreakpoints","value","minVal","maxVal","getValueForBreakpoint","breakpoint","screenSize","breakpointPairs","customMediaQueries","filter","_ref2","customMediaQueryKey","unifiedKey","toLowerCase","directBreakpoint","currentBreakpoint","findIndex","_ref3","availableBreakpoints","_ref4","map","_ref5","undefined"],"sourceRoot":"../../../src","sources":["utils/breakpoints.ts"],"mappings":"AAAA,SAASA,UAAU,QAAQ,UAAU;AAErC,SAASC,yBAAyB,EAAEC,YAAY,QAAQ,gBAAgB;;AAExE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,0BAA0B,GAA2BC,WAAc,IAAQ;EACpF,MAAMC,WAAW,GAAGC,MAAM,CACrBC,OAAO,CAACH,WAAW,CAAC,CACpBI,IAAI,CAAC,CAACC,WAAW,EAAEC,WAAW,KAAK;IAChC,MAAM,GAAGC,MAAM,CAAC,GAAGF,WAAW;IAC9B,MAAM,GAAGG,MAAM,CAAC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AoB,CAACA,oBAAoB,CAAC5B,MAAM,GAAG,CAAC,CAAC,CAAqB,GAChFgC,SAAS;AACnB,CAAC"}
1
+ {"version":3,"names":["unistyles","throwError","getKeyForCustomMediaQuery","isMediaQuery","sortAndValidateBreakpoints","breakpoints","sortedPairs","Object","entries","sort","breakpoint1","breakpoint2","value1","value2","sortedBreakpoints","freeze","fromEntries","breakpointValues","values","firstBreakpoint","length","Set","size","getBreakpointFromScreenWidth","width","breakpointEntries","key","find","_ref","index","otherBreakpoints","value","minVal","maxVal","getValueForBreakpoint","breakpoint","screenSize","customMediaQueries","filter","_ref2","customMediaQueryKey","unifiedKey","toLowerCase","directBreakpoint","breakpointPairs","runtime","currentBreakpoint","findIndex","_ref3","availableBreakpoints","_ref4","map","_ref5","undefined"],"sourceRoot":"../../../src","sources":["utils/breakpoints.ts"],"mappings":"AAAA,SAASA,SAAS,QAAQ,cAAc;AACxC,SAASC,UAAU,QAAQ,UAAU;AAErC,SAASC,yBAAyB,EAAEC,YAAY,QAAQ,gBAAgB;AAGxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,0BAA0B,GAAIC,WAAiC,IAA2B;EACnG,MAAMC,WAAW,GAAGC,MAAM,CACrBC,OAAO,CAACH,WAAW,CAAC,CACpBI,IAAI,CAAC,CAACC,WAAW,EAAEC,WAAW,KAAK;IAChC,MAAM,GAAGC,MAAM,CAAC,GAAGF,WAAW;IAC9B,MAAM,GAAGG,MAAM,CAAC,GAAGF,WAAW;IAE9B,OAAQC,MAAM,GAAeC,MAAiB;EAClD,CAAC,CAAC;EAEN,MAAMC,iBAAiB,GAAIP,MAAM,CAACQ,MAAM,CAACR,MAAM,CAACS,WAAW,CAACV,WAAW,CAAC,CAAyB;EACjG,MAAMW,gBAAgB,GAAGV,MAAM,CAACW,MAAM,CAACJ,iBAAiB,CAAC;EACzD,MAAM,CAACK,eAAe,CA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AC;EAAA,EAAC;EACzC,MAAMc,mBAAmB,GAAGtC,yBAAyB,CAACmC,kBAAkB,EAAED,UAAU,CAAuB;EAE3G,IAAII,mBAAmB,IAAIA,mBAAmB,IAAIT,KAAK,EAAE;IACrD,OAAOA,KAAK,CAACS,mBAAmB,CAAC;EACrC;;EAEA;EACA,MAAMC,UAAU,GAAGN,UAAU,EAAEO,WAAW,CAAC,CAAuB;EAClE,MAAMC,gBAAgB,GAAGZ,KAAK,CAACU,UAAU,CAAC;;EAE1C;EACA,IAAIE,gBAAgB,IAAKF,UAAU,IAAIV,KAAM,EAAE;IAC3C,OAAOY,gBAAgB;EAC3B;;EAEA;EACA,MAAMC,eAAe,GAAG5C,SAAS,CAAC6C,OAAO,CAAC/B,iBAAiB;EAC3D,MAAMgC,iBAAiB,GAAGF,eAAe,CACpCG,SAAS,CAACC,KAAA;IAAA,IAAC,CAACtB,GAAG,CAAC,GAAAsB,KAAA;IAAA,OAAKtB,GAAG,KAAKe,UAAU;EAAA,EAAC;EAE7C,MAAMQ,oBAAoB,GAAGL,eAAe,CACvCN,MAAM,CAAC,CAAAY,KAAA,EAAQrB,KAAK;IAAA,IAAZ,CAACH,GAAG,CAAC,GAAAwB,KAAA;IAAA,OAAYrB,KAAK,GAAGiB,iBAAiB,IAAIpB,GAAG,IAAIA,GAAG,IAAIK,KAAK;EAAA,EAAC,CAC1EoB,GAAG,CAACC,KAAA;IAAA,IAAC,CAAC1B,GAAG,CAAC,GAAA0B,KAAA;IAAA,OAAK1B,GAAG;EAAA,EAAC;EAExB,OAAOkB,eAAe,CAACxB,MAAM,GAAG,CAAC,GAC3BW,KAAK,CAACkB,oBAAoB,CAACA,oBAAoB,CAAC7B,MAAM,GAAG,CAAC,CAAC,CAAwC,GACnGiC,SAAS;AACnB,CAAC"}
@@ -1,7 +1,6 @@
1
1
  import { getValueForBreakpoint } from './breakpoints';
2
2
  import { normalizeStyles } from './normalizeStyles';
3
3
  import { isWeb } from './common';
4
-
5
4
  /**
6
5
  * Proxies a function to parse its return value for custom media queries or breakpoints.
7
6
  *
@@ -23,8 +22,8 @@ import { isWeb } from './common';
23
22
  * const proxifiedFunction = proxifyFunction(myFunction, 'sm', screenSize, breakpoints)
24
23
  * proxifiedFunction() // parsed style based on screenSize and breakpoints
25
24
  */
26
- export const proxifyFunction = (fn, breakpoint, screenSize, breakpointPairs) => new Proxy(fn, {
27
- apply: (target, thisArg, argumentsList) => parseStyle(target.apply(thisArg, argumentsList), breakpoint, screenSize, breakpointPairs)
25
+ export const proxifyFunction = (fn, breakpoint, screenSize) => new Proxy(fn, {
26
+ apply: (target, thisArg, argumentsList) => parseStyle(target.apply(thisArg, argumentsList), breakpoint, screenSize)
28
27
  });
29
28
 
30
29
  /**
@@ -52,24 +51,24 @@ export const proxifyFunction = (fn, breakpoint, screenSize, breakpointPairs) =>
52
51
  * const parsedStyle = parseStyle(style, 'sm', screenSize, breakpoints)
53
52
  * // { fontSize: '12px' }
54
53
  */
55
- export const parseStyle = (style, breakpoint, screenSize, breakpointPairs) => {
54
+ export const parseStyle = (style, breakpoint, screenSize) => {
56
55
  const entries = Object.entries(style);
57
56
  const parsedStyles = Object.fromEntries(entries.map(_ref => {
58
57
  let [key, value] = _ref;
59
58
  const hasNestedProperties = key === 'shadowOffset' || key === 'textShadowOffset';
60
59
  if (hasNestedProperties) {
61
- return [key, parseStyle(value, breakpoint, screenSize, breakpointPairs)];
60
+ return [key, parseStyle(value, breakpoint, screenSize)];
62
61
  }
63
62
  const isTransform = key === 'transform';
64
63
  if (isTransform && Array.isArray(value)) {
65
- return [key, value.map(value => parseStyle(value, breakpoint, screenSize, breakpointPairs))];
64
+ return [key, value.map(value => parseStyle(value, breakpoint, screenSize))];
66
65
  }
67
66
  const isDynamicFunction = typeof value === 'function';
68
67
  const isValidStyle = typeof value !== 'object';
69
68
  if (isDynamicFunction || isValidStyle) {
70
69
  return [key, value];
71
70
  }
72
- return [key, getValueForBreakpoint(value, breakpoint, screenSize, breakpointPairs)];
71
+ return [key, getValueForBreakpoint(value, breakpoint, screenSize)];
73
72
  }));
74
73
  return isWeb ? normalizeStyles(parsedStyles) : parsedStyles;
75
74
  };
@@ -1 +1 @@
1
- {"version":3,"names":["getValueForBreakpoint","normalizeStyles","isWeb","proxifyFunction","fn","breakpoint","screenSize","breakpointPairs","Proxy","apply","target","thisArg","argumentsList","parseStyle","style","entries","Object","parsedStyles","fromEntries","map","_ref","key","value","hasNestedProperties","isTransform","Array","isArray","isDynamicFunction","isValidStyle"],"sourceRoot":"../../../src","sources":["utils/styles.ts"],"mappings":"AACA,SAASA,qBAAqB,QAAQ,eAAe;AACrD,SAASC,eAAe,QAAQ,mBAAmB;AACnD,SAASC,KAAK,QAAQ,UAAU;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,eAAe,GAAGA,CAC3BC,EAAY,EAAEC,UAA4B,EAC1CC,UAAsB,EACtBC,eAA2C,KAChC,IAAIC,KAAK,CAACJ,EAAE,EAAE;EACzBK,KAAK,EAAEA,CAACC,MAAM,EAAEC,OAAO,EAAEC,aAAa,KAClCC,UAAU,CAACH,MAAM,CAACD,KAAK,CAACE,OAAO,EAAEC,aAAa,CAAC,EAAEP,UAAU,EAAEC,UAAU,EAAEC,eAAe;AAChG,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMM,UAAU,GAAGA,CACtBC,KAA8B,EAC9BT,UAA4B,EAC5BC,UAAsB,EACtBC,eAA2C,KACvC;EACJ,MAAMQ,OAAO,GAAGC,MAAM,CAACD,OAAO,CAACD,KAAK,CAGnC;EAED,MAAMG,YAAY,GAAGD,MAAM,CACtBE,WAAW,CAACH,OAAO,CACfI,GAAG,CAACC,IAAA,IAAkB;IAAA,IAAjB,CAACC,GAAG,EAAEC,KAAK,CAAC,GAAAF,IAAA;IACd,MAAMG,mBAAmB,GAAGF,GAAG,KAAK,cAAc,IAAIA,GAAG,KAAK,kBAAkB;IAEhF,IAAIE,mBAAmB,EAAE;MACrB,OAAO,CACHF,GAAG,EACHR,UAAU,CAACS,KAAK,EAA6BjB,UAAU,EAAEC,UAAU,EAAEC,eAAe,CAAC,CACxF;IACL;IAEA,MAAMiB,WAAW,GAAGH,GAAG,KAAK,WAAW;IAEvC,IAAIG,WAAW,IAAIC,KAAK,CAACC,OAAO,CAACJ,KAAK,CAAC,EAAE;MACrC,OAAO,CACHD,GAAG,EACHC,KAAK,CAACH,GAAG,CAACG,KAAK,IAAIT,UAAU,CAACS,KAAK,EAAEjB,UAAU,EAAEC,UAAU,EAAEC,eAAe,CAAC,CAAC,CACjF;IACL;IAEA,MAAMoB,iBAAiB,GAAG,OAAOL,KAAK,KAAK,UAAU;IACrD,MAAMM,YAAY,GAAG,OAAON,KAAK,KAAK,QAAQ;IAE9C,IAAIK,iBAAiB,IAAIC,YAAY,EAAE;MACnC,OAAO,CAACP,GAAG,EAAEC,KAAK,CAAC;IACvB;IAEA,OAAO,CACHD,GAAG,EACHrB,qBAAqB,CACjBsB,KAAK,EACLjB,UAAU,EACVC,UAAU,EACVC,eACJ,CAAC,CACJ;EACL,CAAC,CACL,CAAC;EAEL,OAAOL,KAAK,GACND,eAAe,CAACgB,YAAY,CAAC,GAC7BA,YAAY;AACtB,CAAC"}
1
+ {"version":3,"names":["getValueForBreakpoint","normalizeStyles","isWeb","proxifyFunction","fn","breakpoint","screenSize","Proxy","apply","target","thisArg","argumentsList","parseStyle","style","entries","Object","parsedStyles","fromEntries","map","_ref","key","value","hasNestedProperties","isTransform","Array","isArray","isDynamicFunction","isValidStyle"],"sourceRoot":"../../../src","sources":["utils/styles.ts"],"mappings":"AACA,SAASA,qBAAqB,QAAQ,eAAe;AACrD,SAASC,eAAe,QAAQ,mBAA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KAAK,EAAEhB,UAAU,EAAEC,UAAU,CAAC,CAAC,CAChE;IACL;IAEA,MAAMoB,iBAAiB,GAAG,OAAOL,KAAK,KAAK,UAAU;IACrD,MAAMM,YAAY,GAAG,OAAON,KAAK,KAAK,QAAQ;IAE9C,IAAIK,iBAAiB,IAAIC,YAAY,EAAE;MACnC,OAAO,CAACP,GAAG,EAAEC,KAAK,CAAC;IACvB;IAEA,OAAO,CACHD,GAAG,EACHpB,qBAAqB,CACjBqB,KAAK,EACLhB,UAAU,EACVC,UACJ,CAAC,CACJ;EACL,CAAC,CACL,CAAC;EAEL,OAAOJ,KAAK,GACND,eAAe,CAACe,YAAY,CAAC,GAC7BA,YAAY;AACtB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../../../../examples/expo/src/App.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAUvC,eAAO,MAAM,GAAG,EAAE,KAAK,CAAC,iBAgBvB,CAAA"}
1
+ {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../../../../examples/expo/src/App.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAgBzB,eAAO,MAAM,GAAG,EAAE,KAAK,CAAC,iBAMvB,CAAA"}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const Cxx: () => React.JSX.Element;
3
+ //# sourceMappingURL=Cxx.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Cxx.d.ts","sourceRoot":"","sources":["../../../../../../examples/expo/src/examples/Cxx.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,eAAO,MAAM,GAAG,yBA+Cf,CAAA"}
@@ -1,8 +1,2 @@
1
- export { Minimal } from './Minimal';
2
- export { MinimalWithCreateStyleSheet } from './MinimalWithCreateStyleSheet';
3
- export { Theme } from './Theme';
4
- export { Breakpoints } from './Breakpoints';
5
- export { MediaQueries } from './MediaQueries';
6
- export { Extreme } from './Extreme';
7
- export { Memoization } from './Memoization';
1
+ export { Cxx } from './Cxx';
8
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../examples/expo/src/examples/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAA;AAC3E,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../examples/expo/src/examples/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA"}
@@ -1,46 +1,16 @@
1
- import type { AppTheme } from './theme';
2
- import { lightTheme, darkTheme } from './theme';
3
- export declare const useStyles: <ST extends import("../../../../src/types").CustomNamedStyles<ST, {
4
- xs: number;
5
- sm: number;
6
- md: number;
7
- lg: number;
8
- xl: number;
9
- }>>(stylesheet?: ST | import("../../../../src/types").CreateStylesFactory<ST, AppTheme> | undefined) => {
10
- theme: AppTheme;
11
- breakpoint: "xs" | "sm" | "md" | "lg" | "xl";
12
- styles: import("../../../../src/types").ExtractBreakpoints<import("../../../../src/types").RemoveKeysWithPrefix<ST, {
13
- xs: number;
14
- sm: number;
15
- md: number;
16
- lg: number;
17
- xl: number;
18
- }>, {
19
- xs: number;
20
- sm: number;
21
- md: number;
22
- lg: number;
23
- xl: number;
24
- }>;
25
- }, createStyleSheet: <S extends import("../../../../src/types").CustomNamedStyles<S, {
26
- xs: number;
27
- sm: number;
28
- md: number;
29
- lg: number;
30
- xl: number;
31
- }>, X>(styles: S | X | import("../../../../src/types").CustomNamedStyles<S, {
32
- xs: number;
33
- sm: number;
34
- md: number;
35
- lg: number;
36
- xl: number;
37
- }> | ((theme: AppTheme) => X | import("../../../../src/types").CustomNamedStyles<X, {
38
- xs: number;
39
- sm: number;
40
- md: number;
41
- lg: number;
42
- xl: number;
43
- }>)) => S | X;
44
- export { lightTheme, darkTheme };
45
- export type { AppTheme };
1
+ import { breakpoints } from './breakpoints';
2
+ import { lightTheme, darkTheme, premiumTheme } from './theme';
3
+ type AppBreakpoints = typeof breakpoints;
4
+ type AppThemes = {
5
+ light: typeof lightTheme;
6
+ dark: typeof darkTheme;
7
+ premium: typeof premiumTheme;
8
+ };
9
+ declare module 'react-native-unistyles' {
10
+ interface UnistylesThemes extends AppThemes {
11
+ }
12
+ interface UnistylesBreakpoints extends AppBreakpoints {
13
+ }
14
+ }
15
+ export { lightTheme, darkTheme, premiumTheme, breakpoints };
46
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../examples/expo/src/styles/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AACvC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAE/C,eAAO,MAAQ,SAAS;;;;;;;;;;;;;;;;;;;;;;GAAE,gBAAgB;;;;;;;;;;;;;;;;;;aAA+D,CAAA;AAEzG,OAAO,EACH,UAAU,EACV,SAAS,EACZ,CAAA;AAED,YAAY,EACR,QAAQ,EACX,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../examples/expo/src/styles/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAE7D,KAAK,cAAc,GAAG,OAAO,WAAW,CAAA;AACxC,KAAK,SAAS,GAAG;IACb,KAAK,EAAE,OAAO,UAAU,CAAA;IACxB,IAAI,EAAE,OAAO,SAAS,CAAA;IACtB,OAAO,EAAE,OAAO,YAAY,CAAA;CAC/B,CAAA;AAED,OAAO,QAAQ,wBAAwB,CAAC;IACpC,UAAiB,eAAgB,SAAQ,SAAS;KAAG;IAErD,UAAiB,oBAAqB,SAAQ,cAAc;KAAG;CAClE;AAED,OAAO,EACH,UAAU,EACV,SAAS,EACT,YAAY,EACZ,WAAW,EACd,CAAA"}
@@ -2,23 +2,39 @@ export declare const lightTheme: {
2
2
  colors: {
3
3
  backgroundColor: string;
4
4
  typography: string;
5
+ accent: string;
5
6
  barbie: string;
6
7
  oak: string;
7
8
  sky: string;
8
9
  fog: string;
9
10
  aloes: string;
11
+ blood: string;
10
12
  };
11
13
  };
12
14
  export declare const darkTheme: {
13
15
  colors: {
14
16
  backgroundColor: string;
15
17
  typography: string;
18
+ accent: string;
16
19
  barbie: string;
17
20
  oak: string;
18
21
  sky: string;
19
22
  fog: string;
20
23
  aloes: string;
24
+ blood: string;
25
+ };
26
+ };
27
+ export declare const premiumTheme: {
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;
21
38
  };
22
39
  };
23
- export type AppTheme = typeof lightTheme | typeof darkTheme;
24
40
  //# sourceMappingURL=theme.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../../../examples/expo/src/styles/theme.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,UAAU;;;;;;;;;;CAOtB,CAAA;AAED,eAAO,MAAM,SAAS;;;;;;;;;;CAOrB,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG,OAAO,UAAU,GAAG,OAAO,SAAS,CAAA"}
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../../../examples/expo/src/styles/theme.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,UAAU;;;;;;;;;;;;CAQtB,CAAA;AAED,eAAO,MAAM,SAAS;;;;;;;;;;;;CAQrB,CAAA;AAED,eAAO,MAAM,YAAY;;;;;;;;;;;;CAQxB,CAAA"}
@@ -0,0 +1,15 @@
1
+ import type { UnistylesBridge, UnistylesConfig } from './types';
2
+ import type { UnistylesThemes, UnistylesBreakpoints } from './global';
3
+ export declare class UnistyleRegistry {
4
+ private unistylesBridge;
5
+ isClosed: boolean;
6
+ themes: UnistylesThemes;
7
+ breakpoints: UnistylesBreakpoints;
8
+ sortedBreakpointPairs: Array<[keyof UnistylesBreakpoints, UnistylesBreakpoints[keyof UnistylesBreakpoints]]>;
9
+ config: UnistylesConfig;
10
+ constructor(unistylesBridge: UnistylesBridge);
11
+ addThemes: (themes: UnistylesThemes) => this;
12
+ addBreakpoints: (breakpoints: UnistylesBreakpoints) => this;
13
+ addConfig: (config: UnistylesConfig) => this;
14
+ }
15
+ //# sourceMappingURL=UnistyleRegistry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnistyleRegistry.d.ts","sourceRoot":"","sources":["../../../src/UnistyleRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAErE,qBAAa,gBAAgB;IAOb,OAAO,CAAC,eAAe;IAN5B,QAAQ,UAAQ;IAChB,MAAM,EAAE,eAAe,CAAwB;IAC/C,WAAW,EAAE,oBAAoB,CAA6B;IAC9D,qBAAqB,EAAE,KAAK,CAAC,CAAC,MAAM,oBAAoB,EAAE,oBAAoB,CAAC,MAAM,oBAAoB,CAAC,CAAC,CAAC,CAAK;IACjH,MAAM,EAAE,eAAe,CAAK;gBAEf,eAAe,EAAE,eAAe;IAE7C,SAAS,WAAY,eAAe,UAI1C;IAEM,cAAc,gBAAiB,oBAAoB,UAKzD;IAEM,SAAS,WAAY,eAAe,UAY1C;CACJ"}
@@ -0,0 +1,16 @@
1
+ import { UnistylesRuntime } from './UnistylesRuntime';
2
+ import { UnistylesEngine } from './UnistylesEngine';
3
+ import { UnistyleRegistry } from './UnistyleRegistry';
4
+ declare class Unistyles {
5
+ private _runtime;
6
+ private _engine;
7
+ private _registry;
8
+ private _bridge;
9
+ constructor();
10
+ get registry(): UnistyleRegistry;
11
+ get runtime(): UnistylesRuntime;
12
+ get engine(): UnistylesEngine;
13
+ }
14
+ export declare const unistyles: Unistyles;
15
+ export {};
16
+ //# sourceMappingURL=Unistyles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Unistyles.d.ts","sourceRoot":"","sources":["../../../src/Unistyles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAIrD,cAAM,SAAS;IACX,OAAO,CAAC,QAAQ,CAAkB;IAClC,OAAO,CAAC,OAAO,CAAiB;IAChC,OAAO,CAAC,SAAS,CAAkB;IACnC,OAAO,CAAC,OAAO,CAAiB;;IAgBhC,IAAW,QAAQ,qBAElB;IAED,IAAW,OAAO,qBAEjB;IAED,IAAW,MAAM,oBAEhB;CACJ;AAED,eAAO,MAAM,SAAS,WAAkB,CAAA"}
@@ -0,0 +1,8 @@
1
+ import type { UnistyleRegistry } from './UnistyleRegistry';
2
+ import type { UnistylesRuntime } from './UnistylesRuntime';
3
+ export declare class UnistylesEngine {
4
+ private registry;
5
+ private runtime;
6
+ constructor(registry: UnistyleRegistry, runtime: UnistylesRuntime);
7
+ }
8
+ //# sourceMappingURL=UnistylesEngine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnistylesEngine.d.ts","sourceRoot":"","sources":["../../../src/UnistylesEngine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAG1D,qBAAa,eAAe;IAEZ,OAAO,CAAC,QAAQ;IAAoB,OAAO,CAAC,OAAO;gBAA3C,QAAQ,EAAE,gBAAgB,EAAU,OAAO,EAAE,gBAAgB;CAQpF"}
@@ -0,0 +1,6 @@
1
+ type UnistylesNativeModule = {
2
+ install(): boolean;
3
+ };
4
+ export declare const UnistylesModule: UnistylesNativeModule;
5
+ export {};
6
+ //# sourceMappingURL=UnistylesModule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnistylesModule.d.ts","sourceRoot":"","sources":["../../../src/UnistylesModule.ts"],"names":[],"mappings":"AAEA,KAAK,qBAAqB,GAAG;IACzB,OAAO,IAAI,OAAO,CAAA;CACrB,CAAA;AAED,eAAO,MAAM,eAAe,uBAAoD,CAAA"}
@@ -0,0 +1,56 @@
1
+ import type { UnistylesBridge } from './types';
2
+ import type { UnistyleRegistry } from './UnistyleRegistry';
3
+ import { UnistylesColorScheme } from './types';
4
+ import type { UnistylesThemes } from './global';
5
+ export declare class UnistylesRuntime {
6
+ private unistylesBridge;
7
+ private registry;
8
+ constructor(unistylesBridge: UnistylesBridge, registry: UnistyleRegistry);
9
+ get colorScheme(): UnistylesColorScheme;
10
+ get breakpoints(): import("./global").UnistylesBreakpoints;
11
+ get sortedBreakpoints(): [keyof import("./global").UnistylesBreakpoints, number][];
12
+ get config(): import("./types").UnistylesConfig;
13
+ get theme(): keyof UnistylesThemes;
14
+ get currentBreakpoint(): keyof import("./global").UnistylesBreakpoints;
15
+ setColorScheme: (scheme: UnistylesColorScheme) => void;
16
+ setTheme: (name: keyof UnistylesThemes) => boolean;
17
+ hasTheme: (name: keyof UnistylesThemes) => boolean;
18
+ getTheme: (forName: keyof UnistylesThemes) => {
19
+ colors: {
20
+ backgroundColor: string;
21
+ typography: string;
22
+ accent: string;
23
+ barbie: string;
24
+ oak: string;
25
+ sky: string;
26
+ fog: string;
27
+ aloes: string;
28
+ blood: string;
29
+ };
30
+ } | {
31
+ colors: {
32
+ backgroundColor: string;
33
+ typography: string;
34
+ accent: string;
35
+ barbie: string;
36
+ oak: string;
37
+ sky: string;
38
+ fog: string;
39
+ aloes: string;
40
+ blood: string;
41
+ };
42
+ } | {
43
+ colors: {
44
+ backgroundColor: string;
45
+ typography: string;
46
+ accent: string;
47
+ barbie: string;
48
+ oak: string;
49
+ sky: string;
50
+ fog: string;
51
+ aloes: string;
52
+ blood: string;
53
+ };
54
+ };
55
+ }
56
+ //# sourceMappingURL=UnistylesRuntime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnistylesRuntime.d.ts","sourceRoot":"","sources":["../../../src/UnistylesRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,EAAE,oBAAoB,EAAkB,MAAM,SAAS,CAAA;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,qBAAa,gBAAgB;IACb,OAAO,CAAC,eAAe;IAAmB,OAAO,CAAC,QAAQ;gBAAlD,eAAe,EAAE,eAAe,EAAU,QAAQ,EAAE,gBAAgB;IAExF,IAAW,WAAW,yBAErB;IAED,IAAW,WAAW,4CAErB;IAED,IAAW,iBAAiB,8DAE3B;IAED,IAAW,MAAM,sCAEhB;IAED,IAAW,KAAK,0BAEf;IAED,IAAW,iBAAiB,kDAE3B;IAEM,cAAc,WAAY,oBAAoB,UAIpD;IAEM,QAAQ,SAAU,MAAM,eAAe,aAQ7C;IAEM,QAAQ,SAAU,MAAM,eAAe,aAAiC;IAExE,QAAQ,YAAa,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAMhD;CACJ"}
@@ -0,0 +1,6 @@
1
+ import type { CustomNamedStyles } from './types';
2
+ import type { UnistylesThemes } from './global';
3
+ type T = UnistylesThemes[keyof UnistylesThemes];
4
+ export declare const createStyleSheet: <S extends CustomNamedStyles<S>, X>(styles: S | X | CustomNamedStyles<S> | ((theme: T) => X | CustomNamedStyles<X>)) => S | X;
5
+ export {};
6
+ //# sourceMappingURL=createStyleSheet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createStyleSheet.d.ts","sourceRoot":"","sources":["../../../src/createStyleSheet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,KAAK,CAAC,GAAG,eAAe,CAAC,MAAM,eAAe,CAAC,CAAA;AAE/C,eAAO,MAAM,gBAAgB,sFAAuF,CAAC,wCAMpH,CAAA"}
@@ -0,0 +1,5 @@
1
+ export interface UnistylesThemes {
2
+ }
3
+ export interface UnistylesBreakpoints {
4
+ }
5
+ //# sourceMappingURL=global.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../../../src/global.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;CAAG;AACnC,MAAM,WAAW,oBAAoB;CAAG"}
@@ -1,3 +1,15 @@
1
- export { UnistylesTheme } from './UnistylesTheme';
2
- export { createUnistyles } from './createUnistyles';
1
+ import type { UnistylesThemes, UnistylesBreakpoints } from './global';
2
+ import { UnistylesColorScheme } from './types';
3
+ export { useInitialTheme } from './useInitialTheme';
4
+ export { useStyles } from './useStyles';
5
+ export { createStyleSheet } from './createStyleSheet';
6
+ declare const UnistylesRuntime: import("./UnistylesRuntime").UnistylesRuntime;
7
+ declare const UnistylesRegistry: {
8
+ addThemes: (themes: UnistylesThemes) => import("./UnistyleRegistry").UnistyleRegistry;
9
+ addBreakpoints: (breakpoints: UnistylesBreakpoints) => import("./UnistyleRegistry").UnistyleRegistry;
10
+ addConfig: (config: import("./types").UnistylesConfig) => import("./UnistyleRegistry").UnistyleRegistry;
11
+ };
12
+ export { UnistylesRuntime, UnistylesRegistry };
13
+ export { UnistylesColorScheme };
14
+ export type { UnistylesThemes, UnistylesBreakpoints };
3
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAE9C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAEnD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAGrD,QAAA,MAAM,gBAAgB,+CAAoB,CAAA;AAC1C,QAAA,MAAM,iBAAiB;;;;CAItB,CAAA;AAED,OAAO,EACH,gBAAgB,EAChB,iBAAiB,EACpB,CAAA;AAED,OAAO,EACH,oBAAoB,EACvB,CAAA;AAED,YAAY,EACR,eAAe,EACf,oBAAoB,EACvB,CAAA"}
@@ -1,19 +1,18 @@
1
+ import type { UnistylesBreakpoints } from '../global';
1
2
  import type { MediaQueries } from './mediaQueries';
2
- export type Breakpoints = Record<string, number>;
3
- export type SortedBreakpointEntries<B extends Breakpoints> = [[keyof B & string, number]];
4
3
  export type ScreenSize = {
5
4
  width: number;
6
5
  height: number;
7
6
  };
8
7
  export type CreateStylesFactory<ST, Theme> = (theme: Theme) => ST;
9
8
  type WithEmptyObject<V> = keyof V extends never ? {} : V;
10
- export type ExtractBreakpoints<T, B extends Breakpoints> = T extends Partial<Record<keyof B & string, infer V>> ? WithEmptyObject<V> : T extends (...args: infer A) => infer R ? (...args: A) => ExtractBreakpoints<R, B> : {
11
- [K in keyof T]: T[K] extends (...args: infer A) => infer R ? (...args: A) => ExtractBreakpoints<R, B> : T[K] extends object ? ExtractBreakpoints<T[K], B> : T[K];
9
+ export type ExtractBreakpoints<T> = T extends Partial<Record<keyof UnistylesBreakpoints & string, infer V>> ? WithEmptyObject<V> : T extends (...args: infer A) => infer R ? (...args: A) => ExtractBreakpoints<R> : {
10
+ [K in keyof T]: T[K] extends (...args: infer A) => infer R ? (...args: A) => ExtractBreakpoints<R> : T[K] extends object ? ExtractBreakpoints<T[K]> : T[K];
12
11
  };
13
- export type RemoveKeysWithPrefix<T, B extends Breakpoints> = T extends (...args: Array<any>) => infer R ? (...args: Parameters<T>) => RemoveKeysWithPrefix<R, B> : T extends object ? T extends Record<string, infer _V> ? {
14
- [K in keyof T as K extends MediaQueries ? keyof B & string : K]: RemoveKeysWithPrefix<T[K], B>;
12
+ export type RemoveKeysWithPrefix<T> = T extends (...args: Array<any>) => infer R ? (...args: Parameters<T>) => RemoveKeysWithPrefix<R> : T extends object ? T extends Record<string, infer _V> ? {
13
+ [K in keyof T as K extends MediaQueries ? keyof UnistylesBreakpoints & string : K]: RemoveKeysWithPrefix<T[K]>;
15
14
  } : {
16
- [K in keyof T]: RemoveKeysWithPrefix<T[K], B>;
15
+ [K in keyof T]: RemoveKeysWithPrefix<T[K]>;
17
16
  } : T;
18
17
  export {};
19
18
  //# sourceMappingURL=breakpoints.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"breakpoints.d.ts","sourceRoot":"","sources":["../../../../src/types/breakpoints.ts"],"names":[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AE,MAAM,CAAC,CAAC,CAAC,GACrG,eAAe,CAAC,CAAC,CAAC,GAClB,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC,GACnC,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,kBAAkB,CAAC,CAAC,CAAC,GACrC;KACG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC,GACpD,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,kBAAkB,CAAC,CAAC,CAAC,GACrC,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GACf,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACxB,CAAC,CAAC,CAAC,CAAC;CACjB,CAAA;AAET,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,MAAM,CAAC,GAC1E,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,oBAAoB,CAAC,CAAC,CAAC,GACnD,CAAC,SAAS,MAAM,GACZ,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GAC9B;KAAG,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,YAAY,GAAG,MAAM,oBAAoB,GAAG,MAAM,GAAG,CAAC,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GAClH;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GAClD,CAAC,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import type { MatrixTransform, PerpectiveTransform, RotateTransform, RotateXTransform, RotateYTransform, RotateZTransform, ScaleTransform, ScaleXTransform, ScaleYTransform, SkewXTransform, SkewYTransform, TranslateXTransform, TranslateYTransform } from 'react-native/Libraries/StyleSheet/StyleSheetTypes';
2
2
  import type { ImageStyle, TextStyle, ViewStyle } from 'react-native';
3
- import type { Breakpoints } from './breakpoints';
4
3
  import type { MediaQueries } from './mediaQueries';
4
+ import type { UnistylesBreakpoints } from '../global';
5
5
  type ShadowOffset = {
6
6
  width: number;
7
7
  height: number;
@@ -24,9 +24,9 @@ type NestedTypes = 'shadowOffset' | 'transform' | 'textShadowOffset';
24
24
  type UnistyleView<B> = DeepUniStyle<Omit<ViewStyle, NestedTypes>, B>;
25
25
  type UnistyleText<B> = DeepUniStyle<Omit<TextStyle, NestedTypes>, B>;
26
26
  type UnistyleImage<B> = DeepUniStyle<Omit<ImageStyle, NestedTypes>, B>;
27
- export type StaticStyles<B extends Breakpoints> = UnistyleView<B> | UnistyleText<B> | UnistyleImage<B> & UnistyleNested<B>;
28
- export type CustomNamedStyles<T, B extends Breakpoints> = {
29
- [K in keyof T]: T[K] extends (...args: infer A) => StaticStyles<B> ? (...args: A) => StaticStyles<B> : StaticStyles<B>;
27
+ export type StaticStyles<B> = UnistyleView<B> | UnistyleText<B> | UnistyleImage<B> & UnistyleNested<B>;
28
+ export type CustomNamedStyles<T> = {
29
+ [K in keyof T]: T[K] extends (...args: infer A) => StaticStyles<UnistylesBreakpoints> ? (...args: A) => StaticStyles<UnistylesBreakpoints> : StaticStyles<UnistylesBreakpoints>;
30
30
  };
31
31
  export {};
32
32
  //# sourceMappingURL=core.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../src/types/core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,eAAe,EACf,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,eAAe,EACf,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACtB,MAAM,mDAAmD,CAAA;AAC1D,OAAO,KAAK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,CAAC,CAAA;AAEtE,MAAM,MAAM,YAAY,CAAC,CAAC,IACpB,YAAY,CAAC,CAAC,CAAC,GACf,YAAY,CAAC,CAAC,CAAC,GACf,aAAa,CAAC,CAAC,CAAC,GAChB,cAAc,CAAC,CAAC,CAAC,CAAA;AAEvB,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI;KAC9B,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,KAAK,YAAY,CAAC,oBAAoB,CAAC,GAC/E,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,YAAY,CAAC,oBAAoB,CAAC,GAClD,YAAY,CAAC,oBAAoB,CAAC;CAC3C,CAAA"}
@@ -0,0 +1,50 @@
1
+ import type { UnistylesThemes, UnistylesBreakpoints } from '../global';
2
+ export type Nullable<T> = T | null;
3
+ export declare enum UnistylesColorScheme {
4
+ System = "system",
5
+ Manual = "manual"
6
+ }
7
+ export type UnistylesConfig = {
8
+ colorScheme?: UnistylesColorScheme;
9
+ featureFlags?: Array<string>;
10
+ };
11
+ export type UnistylesBridge = {
12
+ theme: keyof UnistylesThemes;
13
+ breakpoint: keyof UnistylesBreakpoints;
14
+ colorScheme: UnistylesColorScheme;
15
+ sortedBreakpointPairs: Array<[keyof UnistylesBreakpoints, UnistylesBreakpoints[keyof UnistylesBreakpoints]]>;
16
+ useBreakpoints(breakpoints: UnistylesBreakpoints): void;
17
+ useTheme(name: keyof UnistylesThemes): void;
18
+ useColorScheme(scheme: UnistylesColorScheme): void;
19
+ useFeatureFlags(flags: Array<string>): void;
20
+ };
21
+ export declare enum CxxUnistylesEventTypes {
22
+ Theme = "theme",
23
+ Size = "size",
24
+ Breakpoint = "breakpoint"
25
+ }
26
+ export type CxxUnistylesThemeEvent = {
27
+ type: CxxUnistylesEventTypes.Theme;
28
+ payload: {
29
+ currentTheme: keyof UnistylesThemes;
30
+ };
31
+ };
32
+ export type CxxUnistylesSizeEvent = {
33
+ type: CxxUnistylesEventTypes.Size;
34
+ payload: {
35
+ width: number;
36
+ height: number;
37
+ };
38
+ };
39
+ export type CxxUnistylesBreakpointEvent = {
40
+ type: CxxUnistylesEventTypes.Breakpoint;
41
+ payload: {
42
+ currentBreakpoint: keyof UnistylesBreakpoints;
43
+ };
44
+ };
45
+ export type UnistylesEvents = CxxUnistylesThemeEvent | CxxUnistylesSizeEvent | CxxUnistylesBreakpointEvent;
46
+ export declare enum UnistylesError {
47
+ RuntimeUnavailable = "UNISTYLES_ERROR_RUNTIME_UNAVAILABLE",
48
+ ThemeNotFound = "UNISTYLES_ERROR_THEME_NOT_FOUND"
49
+ }
50
+ //# sourceMappingURL=cxx.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cxx.d.ts","sourceRoot":"","sources":["../../../../src/types/cxx.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;AAEtE,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;AAClC,oBAAY,oBAAoB;IAC5B,MAAM,WAAW;IACjB,MAAM,WAAW;CACpB;AAED,MAAM,MAAM,eAAe,GAAG;IAC1B,WAAW,CAAC,EAAE,oBAAoB,CAAC;IACnC,YAAY,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CAC/B,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAE1B,KAAK,EAAE,MAAM,eAAe,CAAA;IAC5B,UAAU,EAAE,MAAM,oBAAoB,CAAC;IACvC,WAAW,EAAE,oBAAoB,CAAC;IAClC,qBAAqB,EAAE,KAAK,CAAC,CAAC,MAAM,oBAAoB,EAAE,oBAAoB,CAAC,MAAM,oBAAoB,CAAC,CAAC,CAAC,CAAA;IAG5G,cAAc,CAAC,WAAW,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACxD,QAAQ,CAAC,IAAI,EAAE,MAAM,eAAe,GAAG,IAAI,CAAC;IAC5C,cAAc,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACnD,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAA;CAC9C,CAAA;AAED,oBAAY,sBAAsB;IAC9B,KAAK,UAAU;IACf,IAAI,SAAS;IACb,UAAU,eAAe;CAC5B;AAED,MAAM,MAAM,sBAAsB,GAAG;IACjC,IAAI,EAAE,sBAAsB,CAAC,KAAK,CAAC;IACnC,OAAO,EAAE;QACL,YAAY,EAAE,MAAM,eAAe,CAAA;KACtC,CAAA;CACJ,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAChC,IAAI,EAAE,sBAAsB,CAAC,IAAI,CAAC;IAClC,OAAO,EAAE;QACL,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAA;KACjB,CAAA;CACJ,CAAA;AAED,MAAM,MAAM,2BAA2B,GAAG;IACtC,IAAI,EAAE,sBAAsB,CAAC,UAAU,CAAC;IACxC,OAAO,EAAE;QACL,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;KAChD,CAAA;CACJ,CAAA;AAED,MAAM,MAAM,eAAe,GAAG,sBAAsB,GAAG,qBAAqB,GAAG,2BAA2B,CAAA;AAE1G,oBAAY,cAAc;IACtB,kBAAkB,wCAAwC;IAC1D,aAAa,oCAAoC;CACpD"}
@@ -1,4 +1,6 @@
1
1
  export * from './normalizer';
2
+ export * from './cxx';
2
3
  export type { CustomNamedStyles } from './core';
3
- export type { ScreenSize, Breakpoints, CreateStylesFactory, ExtractBreakpoints, RemoveKeysWithPrefix, SortedBreakpointEntries } from './breakpoints';
4
+ export type { MediaQueries } from './mediaQueries';
5
+ export type { ScreenSize, CreateStylesFactory, ExtractBreakpoints, RemoveKeysWithPrefix } from './breakpoints';
4
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,YAAY,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAA;AAC/C,YAAY,EACR,UAAU,EACV,WAAW,EACX,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EAC1B,MAAM,eAAe,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,OAAO,CAAA;AACrB,YAAY,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAA;AAC/C,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAClD,YAAY,EACR,UAAU,EACV,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACvB,MAAM,eAAe,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { UnistylesThemes } from './global';
2
+ export declare const useInitialTheme: (forName: keyof UnistylesThemes) => void;
3
+ //# sourceMappingURL=useInitialTheme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useInitialTheme.d.ts","sourceRoot":"","sources":["../../../src/useInitialTheme.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,eAAO,MAAM,eAAe,YAAa,MAAM,eAAe,SAE7D,CAAA"}