react-native-unistyles 2.0.0-alpha.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 (193) hide show
  1. package/README.md +4 -4
  2. package/ios/UnistylesModule.h +10 -0
  3. package/ios/UnistylesModule.mm +108 -0
  4. package/ios/UnistylesRuntime.h +30 -0
  5. package/ios/UnistylesRuntime.mm +191 -0
  6. package/lib/commonjs/UnistyleRegistry.js +37 -0
  7. package/lib/commonjs/UnistyleRegistry.js.map +1 -0
  8. package/lib/commonjs/Unistyles.js +36 -0
  9. package/lib/commonjs/Unistyles.js.map +1 -0
  10. package/lib/commonjs/UnistylesEngine.js +22 -0
  11. package/lib/commonjs/UnistylesEngine.js.map +1 -0
  12. package/lib/commonjs/UnistylesModule.js +9 -0
  13. package/lib/commonjs/UnistylesModule.js.map +1 -0
  14. package/lib/commonjs/UnistylesRuntime.js +52 -0
  15. package/lib/commonjs/UnistylesRuntime.js.map +1 -0
  16. package/lib/commonjs/createStyleSheet.js +14 -0
  17. package/lib/commonjs/createStyleSheet.js.map +1 -0
  18. package/lib/commonjs/global.js +2 -0
  19. package/lib/commonjs/global.js.map +1 -0
  20. package/lib/commonjs/hooks/useDimensions.web.js +3 -2
  21. package/lib/commonjs/hooks/useDimensions.web.js.map +1 -1
  22. package/lib/commonjs/index.js +33 -6
  23. package/lib/commonjs/index.js.map +1 -1
  24. package/lib/commonjs/types/cxx.js +23 -0
  25. package/lib/commonjs/types/cxx.js.map +1 -0
  26. package/lib/commonjs/types/index.js +26 -0
  27. package/lib/commonjs/types/index.js.map +1 -1
  28. package/lib/commonjs/types/normalizer.js +6 -0
  29. package/lib/commonjs/types/normalizer.js.map +1 -0
  30. package/lib/commonjs/useInitialTheme.js +13 -0
  31. package/lib/commonjs/useInitialTheme.js.map +1 -0
  32. package/lib/commonjs/useStyles.js +48 -0
  33. package/lib/commonjs/useStyles.js.map +1 -0
  34. package/lib/commonjs/useUnistyles.js +59 -0
  35. package/lib/commonjs/useUnistyles.js.map +1 -0
  36. package/lib/commonjs/utils/breakpoints.js +4 -2
  37. package/lib/commonjs/utils/breakpoints.js.map +1 -1
  38. package/lib/commonjs/utils/common.js +3 -3
  39. package/lib/commonjs/utils/common.js.map +1 -1
  40. package/lib/commonjs/utils/index.js +34 -0
  41. package/lib/commonjs/utils/index.js.map +1 -1
  42. package/lib/commonjs/utils/module.d.js +2 -0
  43. package/lib/commonjs/utils/module.d.js.map +1 -0
  44. package/lib/commonjs/utils/normalizeStyles.web.js +13 -13
  45. package/lib/commonjs/utils/normalizeStyles.web.js.map +1 -1
  46. package/lib/commonjs/utils/normalizer.js +89 -0
  47. package/lib/commonjs/utils/normalizer.js.map +1 -0
  48. package/lib/commonjs/utils/styles.js +7 -7
  49. package/lib/commonjs/utils/styles.js.map +1 -1
  50. package/lib/module/UnistyleRegistry.js +30 -0
  51. package/lib/module/UnistyleRegistry.js.map +1 -0
  52. package/lib/module/Unistyles.js +30 -0
  53. package/lib/module/Unistyles.js.map +1 -0
  54. package/lib/module/UnistylesEngine.js +15 -0
  55. package/lib/module/UnistylesEngine.js.map +1 -0
  56. package/lib/module/UnistylesModule.js +3 -0
  57. package/lib/module/UnistylesModule.js.map +1 -0
  58. package/lib/module/UnistylesRuntime.js +45 -0
  59. package/lib/module/UnistylesRuntime.js.map +1 -0
  60. package/lib/module/createStyleSheet.js +7 -0
  61. package/lib/module/createStyleSheet.js.map +1 -0
  62. package/lib/module/global.js +2 -0
  63. package/lib/module/global.js.map +1 -0
  64. package/lib/module/hooks/useDimensions.web.js +3 -2
  65. package/lib/module/hooks/useDimensions.web.js.map +1 -1
  66. package/lib/module/index.js +18 -2
  67. package/lib/module/index.js.map +1 -1
  68. package/lib/module/types/cxx.js +17 -0
  69. package/lib/module/types/cxx.js.map +1 -0
  70. package/lib/module/types/index.js +2 -1
  71. package/lib/module/types/index.js.map +1 -1
  72. package/lib/module/types/normalizer.js +2 -0
  73. package/lib/module/types/normalizer.js.map +1 -0
  74. package/lib/module/useInitialTheme.js +6 -0
  75. package/lib/module/useInitialTheme.js.map +1 -0
  76. package/lib/module/useStyles.js +42 -0
  77. package/lib/module/useStyles.js.map +1 -0
  78. package/lib/module/useUnistyles.js +52 -0
  79. package/lib/module/useUnistyles.js.map +1 -0
  80. package/lib/module/utils/breakpoints.js +4 -3
  81. package/lib/module/utils/breakpoints.js.map +1 -1
  82. package/lib/module/utils/common.js +2 -1
  83. package/lib/module/utils/common.js.map +1 -1
  84. package/lib/module/utils/index.js +2 -0
  85. package/lib/module/utils/index.js.map +1 -1
  86. package/lib/module/utils/module.d.js +2 -0
  87. package/lib/module/utils/module.d.js.map +1 -0
  88. package/lib/module/utils/normalizeStyles.web.js +13 -13
  89. package/lib/module/utils/normalizeStyles.web.js.map +1 -1
  90. package/lib/module/utils/normalizer.js +79 -0
  91. package/lib/module/utils/normalizer.js.map +1 -0
  92. package/lib/module/utils/styles.js +7 -8
  93. package/lib/module/utils/styles.js.map +1 -1
  94. package/lib/typescript/examples/expo/src/App.d.ts +3 -0
  95. package/lib/typescript/examples/expo/src/App.d.ts.map +1 -0
  96. package/lib/typescript/examples/expo/src/examples/Cxx.d.ts +3 -0
  97. package/lib/typescript/examples/expo/src/examples/Cxx.d.ts.map +1 -0
  98. package/lib/typescript/examples/expo/src/examples/index.d.ts +2 -0
  99. package/lib/typescript/examples/expo/src/examples/index.d.ts.map +1 -0
  100. package/lib/typescript/examples/expo/src/index.d.ts +2 -0
  101. package/lib/typescript/examples/expo/src/index.d.ts.map +1 -0
  102. package/lib/typescript/examples/expo/src/styles/breakpoints.d.ts +8 -0
  103. package/lib/typescript/examples/expo/src/styles/breakpoints.d.ts.map +1 -0
  104. package/lib/typescript/examples/expo/src/styles/index.d.ts +16 -0
  105. package/lib/typescript/examples/expo/src/styles/index.d.ts.map +1 -0
  106. package/lib/typescript/examples/expo/src/styles/theme.d.ts +40 -0
  107. package/lib/typescript/examples/expo/src/styles/theme.d.ts.map +1 -0
  108. package/lib/typescript/src/UnistyleRegistry.d.ts +15 -0
  109. package/lib/typescript/src/UnistyleRegistry.d.ts.map +1 -0
  110. package/lib/typescript/src/Unistyles.d.ts +16 -0
  111. package/lib/typescript/src/Unistyles.d.ts.map +1 -0
  112. package/lib/typescript/src/UnistylesEngine.d.ts +8 -0
  113. package/lib/typescript/src/UnistylesEngine.d.ts.map +1 -0
  114. package/lib/typescript/src/UnistylesModule.d.ts +6 -0
  115. package/lib/typescript/src/UnistylesModule.d.ts.map +1 -0
  116. package/lib/typescript/src/UnistylesRuntime.d.ts +56 -0
  117. package/lib/typescript/src/UnistylesRuntime.d.ts.map +1 -0
  118. package/lib/typescript/src/createStyleSheet.d.ts +6 -0
  119. package/lib/typescript/src/createStyleSheet.d.ts.map +1 -0
  120. package/lib/typescript/src/global.d.ts +5 -0
  121. package/lib/typescript/src/global.d.ts.map +1 -0
  122. package/lib/typescript/src/hooks/useDimensions.web.d.ts.map +1 -1
  123. package/lib/typescript/src/index.d.ts +14 -2
  124. package/lib/typescript/src/index.d.ts.map +1 -1
  125. package/lib/typescript/src/types/breakpoints.d.ts +6 -7
  126. package/lib/typescript/src/types/breakpoints.d.ts.map +1 -1
  127. package/lib/typescript/src/types/core.d.ts +4 -4
  128. package/lib/typescript/src/types/core.d.ts.map +1 -1
  129. package/lib/typescript/src/types/cxx.d.ts +50 -0
  130. package/lib/typescript/src/types/cxx.d.ts.map +1 -0
  131. package/lib/typescript/src/types/index.d.ts +4 -1
  132. package/lib/typescript/src/types/index.d.ts.map +1 -1
  133. package/lib/typescript/src/types/normalizer.d.ts +20 -0
  134. package/lib/typescript/src/types/normalizer.d.ts.map +1 -0
  135. package/lib/typescript/src/useInitialTheme.d.ts +3 -0
  136. package/lib/typescript/src/useInitialTheme.d.ts.map +1 -0
  137. package/lib/typescript/src/useStyles.d.ts +46 -0
  138. package/lib/typescript/src/useStyles.d.ts.map +1 -0
  139. package/lib/typescript/src/useUnistyles.d.ts +45 -0
  140. package/lib/typescript/src/useUnistyles.d.ts.map +1 -0
  141. package/lib/typescript/src/utils/breakpoints.d.ts +5 -4
  142. package/lib/typescript/src/utils/breakpoints.d.ts.map +1 -1
  143. package/lib/typescript/src/utils/common.d.ts +2 -1
  144. package/lib/typescript/src/utils/common.d.ts.map +1 -1
  145. package/lib/typescript/src/utils/index.d.ts +2 -0
  146. package/lib/typescript/src/utils/index.d.ts.map +1 -1
  147. package/lib/typescript/src/utils/normalizeStyles.web.d.ts +4 -1
  148. package/lib/typescript/src/utils/normalizeStyles.web.d.ts.map +1 -1
  149. package/lib/typescript/src/utils/normalizer.d.ts +11 -0
  150. package/lib/typescript/src/utils/normalizer.d.ts.map +1 -0
  151. package/lib/typescript/src/utils/styles.d.ts +4 -3
  152. package/lib/typescript/src/utils/styles.d.ts.map +1 -1
  153. package/package.json +13 -3
  154. package/react-native-unistyles.podspec +21 -0
  155. package/src/UnistyleRegistry.ts +39 -0
  156. package/src/Unistyles.ts +41 -0
  157. package/src/UnistylesEngine.ts +15 -0
  158. package/src/UnistylesModule.ts +7 -0
  159. package/src/UnistylesRuntime.ts +58 -0
  160. package/src/createStyleSheet.ts +12 -0
  161. package/src/global.ts +2 -0
  162. package/src/hooks/useDimensions.web.ts +3 -2
  163. package/src/index.ts +30 -2
  164. package/src/types/breakpoints.ts +9 -11
  165. package/src/types/core.ts +6 -6
  166. package/src/types/cxx.ts +61 -0
  167. package/src/types/index.ts +4 -3
  168. package/src/types/normalizer.ts +29 -0
  169. package/src/useInitialTheme.ts +7 -0
  170. package/src/useStyles.ts +49 -0
  171. package/src/useUnistyles.ts +67 -0
  172. package/src/utils/breakpoints.ts +16 -14
  173. package/src/utils/common.ts +2 -1
  174. package/src/utils/index.ts +2 -0
  175. package/src/utils/module.d.ts +3 -0
  176. package/src/utils/normalizeStyles.web.ts +21 -42
  177. package/src/utils/normalizer.ts +99 -0
  178. package/src/utils/styles.ts +17 -19
  179. package/lib/commonjs/UnistylesTheme.js +0 -21
  180. package/lib/commonjs/UnistylesTheme.js.map +0 -1
  181. package/lib/commonjs/createUnistyles.js +0 -57
  182. package/lib/commonjs/createUnistyles.js.map +0 -1
  183. package/lib/module/UnistylesTheme.js +0 -12
  184. package/lib/module/UnistylesTheme.js.map +0 -1
  185. package/lib/module/createUnistyles.js +0 -50
  186. package/lib/module/createUnistyles.js.map +0 -1
  187. package/lib/typescript/src/UnistylesTheme.d.ts +0 -9
  188. package/lib/typescript/src/UnistylesTheme.d.ts.map +0 -1
  189. package/lib/typescript/src/createUnistyles.d.ts +0 -10
  190. package/lib/typescript/src/createUnistyles.d.ts.map +0 -1
  191. package/src/UnistylesTheme.tsx +0 -17
  192. package/src/__tests__/createUnistyles.spec.tsx +0 -192
  193. package/src/createUnistyles.ts +0 -70
@@ -0,0 +1,79 @@
1
+ // based on react-native-web normalizer
2
+ // https://github.com/necolas/react-native-web
3
+ import normalizeColors from '@react-native/normalize-colors';
4
+ export const normalizeColor = function (color) {
5
+ let opacity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
6
+ // If the opacity is 1 there's no need to normalize the color
7
+ if (opacity === 1) {
8
+ return color;
9
+ }
10
+ const integer = normalizeColors(color);
11
+
12
+ // If the colour is an unknown format, the return value is null
13
+ if (integer === null) {
14
+ return color;
15
+ }
16
+ const hex = integer.toString(16).padStart(8, '0');
17
+ if (hex.length === 8) {
18
+ const [r = 0, g = 0, b = 0, a = 1] = hex.split(/(?=(?:..)*$)/).map(x => parseInt(x, 16)).filter(num => !isNaN(num));
19
+ return `rgba(${r},${g},${b},${a / 255 * opacity})`;
20
+ }
21
+ return color;
22
+ };
23
+ export const normalizeNumericValue = value => value ? `${value}px` : value;
24
+ const normalizeTransform = (key, value) => {
25
+ if (key.includes('scale')) {
26
+ return value;
27
+ }
28
+ if (typeof value === 'number') {
29
+ return normalizeNumericValue(value);
30
+ }
31
+ return value;
32
+ };
33
+ const createTextShadowValue = style => {
34
+ // at this point every prop is present
35
+ const {
36
+ textShadowColor,
37
+ textShadowOffset,
38
+ textShadowRadius
39
+ } = style;
40
+ const offsetX = normalizeNumericValue(textShadowOffset.width);
41
+ const offsetY = normalizeNumericValue(textShadowOffset.height);
42
+ const radius = normalizeNumericValue(textShadowRadius);
43
+ const color = normalizeColor(textShadowColor);
44
+ return `${offsetX} ${offsetY} ${radius} ${color}`;
45
+ };
46
+ const createBoxShadowValue = style => {
47
+ // at this point every prop is present
48
+ const {
49
+ shadowColor,
50
+ shadowOffset,
51
+ shadowOpacity,
52
+ shadowRadius
53
+ } = style;
54
+ const offsetX = normalizeNumericValue(shadowOffset.width);
55
+ const offsetY = normalizeNumericValue(shadowOffset.height);
56
+ const radius = normalizeNumericValue(shadowRadius);
57
+ const color = normalizeColor(shadowColor, shadowOpacity);
58
+ return `${offsetX} ${offsetY} ${radius} ${color}`;
59
+ };
60
+ const createTransformValue = transforms => transforms.map(transform => {
61
+ const [key] = Object.keys(transform);
62
+ if (!key) {
63
+ return undefined;
64
+ }
65
+ const value = transform[key];
66
+ switch (key) {
67
+ case 'matrix':
68
+ case 'matrix3d':
69
+ return `${key}(${value.join(',')})`;
70
+ default:
71
+ return `${key}(${normalizeTransform(key, value)})`;
72
+ }
73
+ }).filter(Boolean).join(' ');
74
+ export const preprocessor = {
75
+ createTextShadowValue,
76
+ createBoxShadowValue,
77
+ createTransformValue
78
+ };
79
+ //# sourceMappingURL=normalizer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["normalizeColors","normalizeColor","color","opacity","arguments","length","undefined","integer","hex","toString","padStart","r","g","b","a","split","map","x","parseInt","filter","num","isNaN","normalizeNumericValue","value","normalizeTransform","key","includes","createTextShadowValue","style","textShadowColor","textShadowOffset","textShadowRadius","offsetX","width","offsetY","height","radius","createBoxShadowValue","shadowColor","shadowOffset","shadowOpacity","shadowRadius","createTransformValue","transforms","transform","Object","keys","join","Boolean","preprocessor"],"sourceRoot":"../../../src","sources":["utils/normalizer.ts"],"mappings":"AAAA;AACA;AACA,OAAOA,eAAe,MAAM,gCAAgC;AAS5D,OAAO,MAAMC,cAAc,GAAG,SAAAA,CAACC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CAA2B;EAEtD,QAAOA,GAAG;IACN,KAAK,QAAQ;IACb,KAAK,UAAU;MACX,OAAQ,GAAEA,GAAI,IAAIF,KAAK,CAAmBwB,IAAI,CAAC,GAAG,CAAE,GAAE;IAC1D;MACI,OAAQ,GAAEtB,GAAI,IAAGD,kBAAkB,CAACC,GAAG,EAAEF,KAAK,CAAE,GAAE;EAC1D;AACJ,CAAC,CAAC,CACDJ,MAAM,CAAC6B,OAAO,CAAC,CACfD,IAAI,CAAC,GAAG,CAAC;AAEd,OAAO,MAAME,YAA0B,GAAG;EACtCtB,qBAAqB;EACrBU,oBAAoB;EACpBK;AACJ,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,25 +51,25 @@ 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
- return isWeb() ? normalizeStyles(parsedStyles) : parsedStyles;
73
+ return isWeb ? normalizeStyles(parsedStyles) : parsedStyles;
75
74
  };
76
75
  //# sourceMappingURL=styles.js.map
@@ -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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Q;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,CAAC,CAAC,GACRD,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,mBAAmB;AACnD,SAASC,KAAK,QAAQ,UAAU;AAGhC;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,UAA+C,EAC7DC,UAAsB,KACX,IAAIC,KAAK,CAACH,EAAE,EAAE;EACzBI,KAAK,EAAEA,CAACC,MAAM,EAAEC,OAAO,EAAEC,aAAa,KAClCC,UAAU,CAACH,MAAM,CAACD,KAAK,CAACE,OAAO,EAAEC,aAAa,CAAC,EAAEN,UAAU,EAAEC,UAAU;AAC/E,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,KAA2B,EAC3BR,UAA+C,EAC/CC,UAAsB,KAClB;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,EAA0BhB,UAAU,EAAEC,UAAU,CAAC,CACpE;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,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"}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const App: React.FunctionComponent;
3
+ //# sourceMappingURL=App.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,2 @@
1
+ export { Cxx } from './Cxx';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../examples/expo/src/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ export declare const breakpoints: {
2
+ xs: number;
3
+ sm: number;
4
+ md: number;
5
+ lg: number;
6
+ xl: number;
7
+ };
8
+ //# sourceMappingURL=breakpoints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"breakpoints.d.ts","sourceRoot":"","sources":["../../../../../../examples/expo/src/styles/breakpoints.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW;;;;;;CAMvB,CAAA"}
@@ -0,0 +1,16 @@
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 };
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,40 @@
1
+ export declare const lightTheme: {
2
+ colors: {
3
+ backgroundColor: string;
4
+ typography: string;
5
+ accent: string;
6
+ barbie: string;
7
+ oak: string;
8
+ sky: string;
9
+ fog: string;
10
+ aloes: string;
11
+ blood: string;
12
+ };
13
+ };
14
+ export declare const darkTheme: {
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
+ };
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;
38
+ };
39
+ };
40
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
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 +1 @@
1
- {"version":3,"file":"useDimensions.web.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useDimensions.web.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAE1C,eAAO,MAAM,aAAa,QAAO,UA0BhC,CAAA"}
1
+ {"version":3,"file":"useDimensions.web.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useDimensions.web.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAG1C,eAAO,MAAM,aAAa,QAAO,UA0BhC,CAAA"}
@@ -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":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAElD,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAChD,MAAM,MAAM,uBAAuB,CAAC,CAAC,SAAS,WAAW,IAAI,CAAC,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;AAEzF,MAAM,MAAM,UAAU,GAAG;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,mBAAmB,CAAC,EAAE,EAAE,KAAK,IAAI,CAAC,KAAK,EAAE,KAAK,KAAK,EAAE,CAAA;AAEjE,KAAK,eAAe,CAAC,CAAC,IAAI,MAAM,CAAC,SAAS,KAAK,GAAG,EAAE,GAAG,CAAC,CAAA;AAExD,MAAM,MAAM,kBAAkB,CAAC,CAAC,EAAE,CAAC,SAAS,WAAW,IAAI,CAAC,SAAS,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,GACzG,eAAe,CAAC,CAAC,CAAC,GAClB,CAAC,SAAS,CAAC,GAA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AC,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,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAElD,KAAK,YAAY,GAAG;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,KAAK,eAAe,GACd,mBAAmB,GACnB,eAAe,GACf,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,GAChB,cAAc,GACd,eAAe,GACf,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,cAAc,GACd,cAAc,GACd,eAAe,CAAA;AAErB,KAAK,cAAc,CAAC,CAAC,IAAI;IACrB,YAAY,CAAC,EAAE,YAAY,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;IAC7C,gBAAgB,CAAC,EAAE,YAAY,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;IACjD,SAAS,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,CAAA;CACtD,CAAA;AAED,KAAK,QAAQ,CAAC,CAAC,EAAE,CAAC,IAAI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AC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;CACrC,CAAA;AAGD,KAAK,WAAW,GAAG,cAAc,GAAG,WAAW,GAAG,kBAAkB,CAAA;AAEpE,KAAK,YAAY,CAAC,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,EAAE,CAAC,CAAC,CAAA;AACpE,KAAK,YAAY,CAAC,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,EAAE,CAAC,CAAC,CAAA;AACpE,KAAK,aAAa,CAAC,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,UAAU,EAAE,WAAW,CAAC,EAAE,CAAC,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,eA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,GAAG,qBAAqB,GAAG,2BAA2B,CAAA;AAE1G,oBAAY,cAAc;IACtB,kBAAkB,wCAAwC;IAC1D,aAAa,oCAAoC;CACpD"}
@@ -1,3 +1,6 @@
1
+ export * from './normalizer';
2
+ export * from './cxx';
1
3
  export type { CustomNamedStyles } from './core';
2
- 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';
3
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAAA,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,20 @@
1
+ import type { ShadowStyleIOS, TextStyle, TransformsStyle } from 'react-native';
2
+ type TransformArrayElement<T> = T extends Array<infer U> ? U : never;
3
+ type BoxShadow = Required<ShadowStyleIOS>;
4
+ type TextShadow = Required<Pick<TextStyle, 'textShadowColor' | 'textShadowOffset' | 'textShadowRadius'>>;
5
+ type Transforms = Array<TransformArrayElement<TransformsStyle['transform']>>;
6
+ type NormalizedBoxShadow = {
7
+ shadowColor: undefined;
8
+ shadowOffset: undefined;
9
+ shadowOpacity: undefined;
10
+ shadowRadius: undefined;
11
+ boxShadow?: string;
12
+ };
13
+ type NormalizedTextShadow = {
14
+ textShadowColor: undefined;
15
+ textShadowOffset: undefined;
16
+ textShadowRadius: undefined;
17
+ textShadow?: string;
18
+ };
19
+ export type { BoxShadow, TextShadow, Transforms, NormalizedBoxShadow, NormalizedTextShadow };
20
+ //# sourceMappingURL=normalizer.d.ts.map
@@ -0,0 +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,qBAAqB,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC,CAAC,CAAA;AAE5E,KAAK,mBAAmB,GAAG;IACvB,WAAW,EAAE,SAAS,CAAC;IACvB,YAAY,EAAE,SAAS,CAAC;IACxB,aAAa,EAAE,SAAS,CAAC;IACzB,YAAY,EAAE,SAAS,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;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"}