react-native-unistyles 1.2.0 → 2.0.0-alpha.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (253) hide show
  1. package/cxx/UnistylesRuntime.cpp +255 -0
  2. package/cxx/UnistylesRuntime.h +60 -0
  3. package/ios/UnistylesHelpers.h +4 -0
  4. package/ios/UnistylesHelpers.mm +20 -0
  5. package/ios/UnistylesModule.h +10 -0
  6. package/ios/UnistylesModule.mm +158 -0
  7. package/lib/commonjs/common.js +26 -0
  8. package/lib/commonjs/common.js.map +1 -0
  9. package/lib/commonjs/core/UnistyleRegistry.js +38 -0
  10. package/lib/commonjs/core/UnistyleRegistry.js.map +1 -0
  11. package/lib/commonjs/core/Unistyles.js +31 -0
  12. package/lib/commonjs/core/Unistyles.js.map +1 -0
  13. package/lib/commonjs/core/UnistylesModule.js +9 -0
  14. package/lib/commonjs/core/UnistylesModule.js.map +1 -0
  15. package/lib/commonjs/core/UnistylesRuntime.js +66 -0
  16. package/lib/commonjs/core/UnistylesRuntime.js.map +1 -0
  17. package/lib/commonjs/core/index.js +13 -0
  18. package/lib/commonjs/core/index.js.map +1 -0
  19. package/lib/commonjs/createStyleSheet.js +14 -0
  20. package/lib/commonjs/createStyleSheet.js.map +1 -0
  21. package/lib/commonjs/global.js +2 -0
  22. package/lib/commonjs/global.js.map +1 -0
  23. package/lib/commonjs/hooks/index.js +10 -3
  24. package/lib/commonjs/hooks/index.js.map +1 -1
  25. package/lib/commonjs/hooks/useInitialTheme.js +17 -0
  26. package/lib/commonjs/hooks/useInitialTheme.js.map +1 -0
  27. package/lib/commonjs/hooks/useUnistyles.js +54 -0
  28. package/lib/commonjs/hooks/useUnistyles.js.map +1 -0
  29. package/lib/commonjs/index.js +35 -6
  30. package/lib/commonjs/index.js.map +1 -1
  31. package/lib/commonjs/types/common.js +2 -0
  32. package/lib/commonjs/types/{mediaQueries.js.map → common.js.map} +1 -1
  33. package/lib/commonjs/types/index.js +11 -0
  34. package/lib/commonjs/types/index.js.map +1 -1
  35. package/lib/commonjs/types/mq.js +6 -0
  36. package/lib/{module/types/mediaQueries.js.map → commonjs/types/mq.js.map} +1 -1
  37. package/lib/commonjs/types/unistyles.js +6 -0
  38. package/lib/commonjs/types/unistyles.js.map +1 -0
  39. package/lib/commonjs/useStyles.js +49 -0
  40. package/lib/commonjs/useStyles.js.map +1 -0
  41. package/lib/commonjs/utils/breakpoints.js +44 -82
  42. package/lib/commonjs/utils/breakpoints.js.map +1 -1
  43. package/lib/commonjs/utils/common.js +6 -1
  44. package/lib/commonjs/utils/common.js.map +1 -1
  45. package/lib/commonjs/utils/index.js +25 -30
  46. package/lib/commonjs/utils/index.js.map +1 -1
  47. package/lib/commonjs/utils/mq.js +89 -0
  48. package/lib/commonjs/utils/mq.js.map +1 -0
  49. package/lib/commonjs/utils/mqParser.js +86 -0
  50. package/lib/commonjs/utils/mqParser.js.map +1 -0
  51. package/lib/commonjs/utils/styles.js +6 -53
  52. package/lib/commonjs/utils/styles.js.map +1 -1
  53. package/lib/commonjs/utils/variants.js +20 -0
  54. package/lib/commonjs/utils/variants.js.map +1 -0
  55. package/lib/module/common.js +22 -0
  56. package/lib/module/common.js.map +1 -0
  57. package/lib/module/core/UnistyleRegistry.js +31 -0
  58. package/lib/module/core/UnistyleRegistry.js.map +1 -0
  59. package/lib/module/core/Unistyles.js +25 -0
  60. package/lib/module/core/Unistyles.js.map +1 -0
  61. package/lib/module/core/UnistylesModule.js +3 -0
  62. package/lib/module/core/UnistylesModule.js.map +1 -0
  63. package/lib/module/core/UnistylesRuntime.js +59 -0
  64. package/lib/module/core/UnistylesRuntime.js.map +1 -0
  65. package/lib/module/core/index.js +2 -0
  66. package/lib/module/core/index.js.map +1 -0
  67. package/lib/module/createStyleSheet.js +7 -0
  68. package/lib/module/createStyleSheet.js.map +1 -0
  69. package/lib/module/global.js +2 -0
  70. package/lib/module/global.js.map +1 -0
  71. package/lib/module/hooks/index.js +2 -1
  72. package/lib/module/hooks/index.js.map +1 -1
  73. package/lib/module/hooks/useInitialTheme.js +10 -0
  74. package/lib/module/hooks/useInitialTheme.js.map +1 -0
  75. package/lib/module/hooks/useUnistyles.js +47 -0
  76. package/lib/module/hooks/useUnistyles.js.map +1 -0
  77. package/lib/module/index.js +13 -2
  78. package/lib/module/index.js.map +1 -1
  79. package/lib/module/types/common.js +2 -0
  80. package/lib/module/types/common.js.map +1 -0
  81. package/lib/module/types/index.js +1 -0
  82. package/lib/module/types/index.js.map +1 -1
  83. package/lib/module/types/mq.js +2 -0
  84. package/lib/module/types/mq.js.map +1 -0
  85. package/lib/module/types/unistyles.js +2 -0
  86. package/lib/module/types/unistyles.js.map +1 -0
  87. package/lib/module/useStyles.js +42 -0
  88. package/lib/module/useStyles.js.map +1 -0
  89. package/lib/module/utils/breakpoints.js +43 -82
  90. package/lib/module/utils/breakpoints.js.map +1 -1
  91. package/lib/module/utils/common.js +5 -0
  92. package/lib/module/utils/common.js.map +1 -1
  93. package/lib/module/utils/index.js +5 -3
  94. package/lib/module/utils/index.js.map +1 -1
  95. package/lib/module/utils/mq.js +83 -0
  96. package/lib/module/utils/mq.js.map +1 -0
  97. package/lib/module/utils/mqParser.js +79 -0
  98. package/lib/module/utils/mqParser.js.map +1 -0
  99. package/lib/module/utils/styles.js +7 -55
  100. package/lib/module/utils/styles.js.map +1 -1
  101. package/lib/module/utils/variants.js +13 -0
  102. package/lib/module/utils/variants.js.map +1 -0
  103. package/lib/typescript/src/common.d.ts +17 -0
  104. package/lib/typescript/src/common.d.ts.map +1 -0
  105. package/lib/typescript/src/core/UnistyleRegistry.d.ts +15 -0
  106. package/lib/typescript/src/core/UnistyleRegistry.d.ts.map +1 -0
  107. package/lib/typescript/src/core/Unistyles.d.ts +13 -0
  108. package/lib/typescript/src/core/Unistyles.d.ts.map +1 -0
  109. package/lib/typescript/src/core/UnistylesModule.d.ts +6 -0
  110. package/lib/typescript/src/core/UnistylesModule.d.ts.map +1 -0
  111. package/lib/typescript/src/core/UnistylesRuntime.d.ts +24 -0
  112. package/lib/typescript/src/core/UnistylesRuntime.d.ts.map +1 -0
  113. package/lib/typescript/src/core/index.d.ts +2 -0
  114. package/lib/typescript/src/core/index.d.ts.map +1 -0
  115. package/lib/typescript/src/createStyleSheet.d.ts +3 -0
  116. package/lib/typescript/src/createStyleSheet.d.ts.map +1 -0
  117. package/lib/typescript/src/global.d.ts +7 -0
  118. package/lib/typescript/src/global.d.ts.map +1 -0
  119. package/lib/typescript/src/hooks/index.d.ts +2 -1
  120. package/lib/typescript/src/hooks/index.d.ts.map +1 -1
  121. package/lib/typescript/src/hooks/useInitialTheme.d.ts +3 -0
  122. package/lib/typescript/src/hooks/useInitialTheme.d.ts.map +1 -0
  123. package/lib/typescript/src/hooks/useUnistyles.d.ts +12 -0
  124. package/lib/typescript/src/hooks/useUnistyles.d.ts.map +1 -0
  125. package/lib/typescript/src/index.d.ts +14 -2
  126. package/lib/typescript/src/index.d.ts.map +1 -1
  127. package/lib/typescript/src/types/breakpoints.d.ts +12 -13
  128. package/lib/typescript/src/types/breakpoints.d.ts.map +1 -1
  129. package/lib/typescript/src/types/common.d.ts +3 -0
  130. package/lib/typescript/src/types/common.d.ts.map +1 -0
  131. package/lib/typescript/src/types/core.d.ts +34 -18
  132. package/lib/typescript/src/types/core.d.ts.map +1 -1
  133. package/lib/typescript/src/types/index.d.ts +5 -2
  134. package/lib/typescript/src/types/index.d.ts.map +1 -1
  135. package/lib/typescript/src/types/mq.d.ts +3 -0
  136. package/lib/typescript/src/types/mq.d.ts.map +1 -0
  137. package/lib/typescript/src/types/unistyles.d.ts +37 -0
  138. package/lib/typescript/src/types/unistyles.d.ts.map +1 -0
  139. package/lib/typescript/src/useStyles.d.ts +10 -0
  140. package/lib/typescript/src/useStyles.d.ts.map +1 -0
  141. package/lib/typescript/src/utils/breakpoints.d.ts +5 -62
  142. package/lib/typescript/src/utils/breakpoints.d.ts.map +1 -1
  143. package/lib/typescript/src/utils/common.d.ts +5 -0
  144. package/lib/typescript/src/utils/common.d.ts.map +1 -1
  145. package/lib/typescript/src/utils/index.d.ts +5 -3
  146. package/lib/typescript/src/utils/index.d.ts.map +1 -1
  147. package/lib/typescript/src/utils/mq.d.ts +21 -0
  148. package/lib/typescript/src/utils/mq.d.ts.map +1 -0
  149. package/lib/typescript/src/utils/mqParser.d.ts +3 -0
  150. package/lib/typescript/src/utils/mqParser.d.ts.map +1 -0
  151. package/lib/typescript/src/utils/styles.d.ts +4 -49
  152. package/lib/typescript/src/utils/styles.d.ts.map +1 -1
  153. package/lib/typescript/src/utils/variants.d.ts +3 -0
  154. package/lib/typescript/src/utils/variants.d.ts.map +1 -0
  155. package/package.json +30 -19
  156. package/react-native-unistyles.podspec +22 -0
  157. package/src/common.ts +19 -0
  158. package/src/core/UnistyleRegistry.ts +41 -0
  159. package/src/core/Unistyles.ts +34 -0
  160. package/src/core/UnistylesModule.ts +7 -0
  161. package/src/core/UnistylesRuntime.ts +73 -0
  162. package/src/core/index.ts +1 -0
  163. package/src/createStyleSheet.ts +9 -0
  164. package/src/global.ts +5 -0
  165. package/src/hooks/index.ts +2 -1
  166. package/src/hooks/useInitialTheme.ts +11 -0
  167. package/src/hooks/useUnistyles.ts +55 -0
  168. package/src/index.ts +30 -2
  169. package/src/types/breakpoints.ts +16 -19
  170. package/src/types/common.ts +2 -0
  171. package/src/types/core.ts +42 -24
  172. package/src/types/index.ts +5 -9
  173. package/src/types/mq.ts +3 -0
  174. package/src/types/unistyles.ts +45 -0
  175. package/src/useStyles.ts +56 -0
  176. package/src/utils/breakpoints.ts +57 -88
  177. package/src/utils/common.ts +6 -0
  178. package/src/utils/index.ts +5 -10
  179. package/src/utils/mq.ts +106 -0
  180. package/src/utils/mqParser.ts +99 -0
  181. package/src/utils/styles.ts +17 -64
  182. package/src/utils/variants.ts +17 -0
  183. package/lib/commonjs/UnistylesTheme.js +0 -21
  184. package/lib/commonjs/UnistylesTheme.js.map +0 -1
  185. package/lib/commonjs/createUnistyles.js +0 -57
  186. package/lib/commonjs/createUnistyles.js.map +0 -1
  187. package/lib/commonjs/hooks/useDimensions.js +0 -10
  188. package/lib/commonjs/hooks/useDimensions.js.map +0 -1
  189. package/lib/commonjs/hooks/useDimensions.web.js +0 -34
  190. package/lib/commonjs/hooks/useDimensions.web.js.map +0 -1
  191. package/lib/commonjs/types/mediaQueries.js +0 -2
  192. package/lib/commonjs/utils/mediaQueries.js +0 -189
  193. package/lib/commonjs/utils/mediaQueries.js.map +0 -1
  194. package/lib/module/UnistylesTheme.js +0 -12
  195. package/lib/module/UnistylesTheme.js.map +0 -1
  196. package/lib/module/createUnistyles.js +0 -50
  197. package/lib/module/createUnistyles.js.map +0 -1
  198. package/lib/module/hooks/useDimensions.js +0 -3
  199. package/lib/module/hooks/useDimensions.js.map +0 -1
  200. package/lib/module/hooks/useDimensions.web.js +0 -27
  201. package/lib/module/hooks/useDimensions.web.js.map +0 -1
  202. package/lib/module/types/mediaQueries.js +0 -2
  203. package/lib/module/utils/mediaQueries.js +0 -176
  204. package/lib/module/utils/mediaQueries.js.map +0 -1
  205. package/lib/typescript/examples/expo/src/App.d.ts +0 -3
  206. package/lib/typescript/examples/expo/src/App.d.ts.map +0 -1
  207. package/lib/typescript/examples/expo/src/examples/Breakpoints.d.ts +0 -3
  208. package/lib/typescript/examples/expo/src/examples/Breakpoints.d.ts.map +0 -1
  209. package/lib/typescript/examples/expo/src/examples/EmptyStyles.d.ts +0 -3
  210. package/lib/typescript/examples/expo/src/examples/EmptyStyles.d.ts.map +0 -1
  211. package/lib/typescript/examples/expo/src/examples/Extreme.d.ts +0 -7
  212. package/lib/typescript/examples/expo/src/examples/Extreme.d.ts.map +0 -1
  213. package/lib/typescript/examples/expo/src/examples/MediaQueries.d.ts +0 -3
  214. package/lib/typescript/examples/expo/src/examples/MediaQueries.d.ts.map +0 -1
  215. package/lib/typescript/examples/expo/src/examples/Memoization.d.ts +0 -3
  216. package/lib/typescript/examples/expo/src/examples/Memoization.d.ts.map +0 -1
  217. package/lib/typescript/examples/expo/src/examples/Minimal.d.ts +0 -3
  218. package/lib/typescript/examples/expo/src/examples/Minimal.d.ts.map +0 -1
  219. package/lib/typescript/examples/expo/src/examples/MinimalWithCreateStyleSheet.d.ts +0 -3
  220. package/lib/typescript/examples/expo/src/examples/MinimalWithCreateStyleSheet.d.ts.map +0 -1
  221. package/lib/typescript/examples/expo/src/examples/PlatformColors.d.ts +0 -3
  222. package/lib/typescript/examples/expo/src/examples/PlatformColors.d.ts.map +0 -1
  223. package/lib/typescript/examples/expo/src/examples/Theme.d.ts +0 -3
  224. package/lib/typescript/examples/expo/src/examples/Theme.d.ts.map +0 -1
  225. package/lib/typescript/examples/expo/src/examples/index.d.ts +0 -9
  226. package/lib/typescript/examples/expo/src/examples/index.d.ts.map +0 -1
  227. package/lib/typescript/examples/expo/src/index.d.ts +0 -2
  228. package/lib/typescript/examples/expo/src/index.d.ts.map +0 -1
  229. package/lib/typescript/examples/expo/src/styles/breakpoints.d.ts +0 -8
  230. package/lib/typescript/examples/expo/src/styles/breakpoints.d.ts.map +0 -1
  231. package/lib/typescript/examples/expo/src/styles/index.d.ts +0 -46
  232. package/lib/typescript/examples/expo/src/styles/index.d.ts.map +0 -1
  233. package/lib/typescript/examples/expo/src/styles/theme.d.ts +0 -24
  234. package/lib/typescript/examples/expo/src/styles/theme.d.ts.map +0 -1
  235. package/lib/typescript/src/UnistylesTheme.d.ts +0 -9
  236. package/lib/typescript/src/UnistylesTheme.d.ts.map +0 -1
  237. package/lib/typescript/src/createUnistyles.d.ts +0 -10
  238. package/lib/typescript/src/createUnistyles.d.ts.map +0 -1
  239. package/lib/typescript/src/hooks/useDimensions.d.ts +0 -3
  240. package/lib/typescript/src/hooks/useDimensions.d.ts.map +0 -1
  241. package/lib/typescript/src/hooks/useDimensions.web.d.ts +0 -3
  242. package/lib/typescript/src/hooks/useDimensions.web.d.ts.map +0 -1
  243. package/lib/typescript/src/types/mediaQueries.d.ts +0 -8
  244. package/lib/typescript/src/types/mediaQueries.d.ts.map +0 -1
  245. package/lib/typescript/src/utils/mediaQueries.d.ts +0 -130
  246. package/lib/typescript/src/utils/mediaQueries.d.ts.map +0 -1
  247. package/src/UnistylesTheme.tsx +0 -17
  248. package/src/__tests__/createUnistyles.spec.tsx +0 -192
  249. package/src/createUnistyles.ts +0 -70
  250. package/src/hooks/useDimensions.ts +0 -4
  251. package/src/hooks/useDimensions.web.ts +0 -34
  252. package/src/types/mediaQueries.ts +0 -10
  253. package/src/utils/mediaQueries.ts +0 -201
@@ -1,30 +1,8 @@
1
- import { getValueForBreakpoint } from './breakpoints';
1
+ import { getValueForNestedStyle } from './breakpoints';
2
2
  import { normalizeStyles } from './normalizeStyles';
3
3
  import { isAndroid, isIOS, isWeb } from './common';
4
-
5
- /**
6
- * Proxies a function to parse its return value for custom media queries or breakpoints.
7
- *
8
- * @template B - An object type where keys represent breakpoint names and values represent breakpoint values.
9
- *
10
- * @param {Function} fn - The function to be proxified.
11
- * @param {keyof B & string} breakpoint - The breakpoint name to check against.
12
- * @param {ScreenSize} screenSize - An object representing the screen size to be checked against the media queries.
13
- * @param breakpointPairs - sorted pairs of breakpoints
14
- *
15
- * @returns {Function} Returns the proxified function
16
- *
17
- * @example
18
- *
19
- * const myFunction = () => ({ ':w[200]': 'value1', sm: 'value2' })
20
- * const screenSize = { width: 250, height: 400 }
21
- * const breakpoints = { sm: 300, md: 600 }
22
- *
23
- * const proxifiedFunction = proxifyFunction(myFunction, 'sm', screenSize, breakpoints)
24
- * proxifiedFunction() // parsed style based on screenSize and breakpoints
25
- */
26
- export const proxifyFunction = (fn, breakpoint, screenSize, breakpointPairs) => new Proxy(fn, {
27
- apply: (target, thisArg, argumentsList) => parseStyle(target.apply(thisArg, argumentsList), breakpoint, screenSize, breakpointPairs)
4
+ export const proxifyFunction = (fn, breakpoint, screenSize, variant) => new Proxy(fn, {
5
+ apply: (target, thisArg, argumentsList) => parseStyle(target.apply(thisArg, argumentsList), breakpoint, screenSize, variant)
28
6
  });
29
7
  export const isPlatformColor = value => {
30
8
  if (isIOS) {
@@ -32,50 +10,24 @@ export const isPlatformColor = value => {
32
10
  }
33
11
  return isAndroid && 'resource_paths' in value && typeof value.resource_paths === 'object';
34
12
  };
35
-
36
- /**
37
- * Parses a style object to resolve custom media queries or breakpoints based on the provided screen size and breakpoints.
38
- *
39
- * The function processes each key-value pair in the style object. If the value is a function or a valid style (not an object or a 'transform' key),
40
- * it is returned as-is. Otherwise, the function attempts to resolve the value based on the provided breakpoint, screen size, and defined breakpoints.
41
- *
42
- * @template T - The type of the style object.
43
- * @template B - An object type where keys represent breakpoint names and values represent breakpoint values.
44
- *
45
- * @param {CustomNamedStyles<T, B>} style - The style object to be parsed.
46
- * @param {keyof B & string} breakpoint - The breakpoint name to check against.
47
- * @param {ScreenSize} screenSize - An object representing the screen size to be checked against the media queries.
48
- * @param breakpointPairs - sorted pairs of breakpoints
49
- *
50
- * @returns {Record<string, string | number | Function>} Returns the parsed style object with resolved custom media queries or breakpoints.
51
- *
52
- * @example
53
- *
54
- * const style = { fontSize: { sm: '12px', md: '16px' } }
55
- * const screenSize = { width: 300, height: 400 }
56
- * const breakpoints = { xs: 0, sm: 300, md: 600 }
57
- *
58
- * const parsedStyle = parseStyle(style, 'sm', screenSize, breakpoints)
59
- * // { fontSize: '12px' }
60
- */
61
- export const parseStyle = (style, breakpoint, screenSize, breakpointPairs) => {
13
+ export const parseStyle = (style, breakpoint, screenSize, variant) => {
62
14
  const entries = Object.entries(style || {});
63
15
  const parsedStyles = Object.fromEntries(entries.map(_ref => {
64
16
  let [key, value] = _ref;
65
17
  const hasNestedProperties = key === 'shadowOffset' || key === 'textShadowOffset';
66
18
  if (hasNestedProperties) {
67
- return [key, parseStyle(value, breakpoint, screenSize, breakpointPairs)];
19
+ return [key, parseStyle(value, breakpoint, screenSize, variant)];
68
20
  }
69
21
  const isTransform = key === 'transform';
70
22
  if (isTransform && Array.isArray(value)) {
71
- return [key, value.map(value => parseStyle(value, breakpoint, screenSize, breakpointPairs))];
23
+ return [key, value.map(value => parseStyle(value, breakpoint, screenSize, variant))];
72
24
  }
73
25
  const isDynamicFunction = typeof value === 'function';
74
26
  const isValidStyle = typeof value !== 'object' || isPlatformColor(value);
75
27
  if (isDynamicFunction || isValidStyle) {
76
28
  return [key, value];
77
29
  }
78
- return [key, getValueForBreakpoint(value, breakpoint, screenSize, breakpointPairs)];
30
+ return [key, getValueForNestedStyle(value, variant)];
79
31
  }));
80
32
  return isWeb ? normalizeStyles(parsedStyles) : parsedStyles;
81
33
  };
@@ -1 +1 @@
1
- {"version":3,"names":["getValueForBreakpoint","normalizeStyles","isAndroid","isIOS","isWeb","proxifyFunction","fn","breakpoint","screenSize","breakpointPairs","Proxy","apply","target","thisArg","argumentsList","parseStyle","isPlatformColor","value","semantic","resource_paths","style","entries","Object","parsedStyles","fromEntries","map","_ref","key","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,SAAS,EAAEC,KAAK,EAAEC,KAAK,QAAQ,UAAU;;AAElD;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,OAAO,MAAMO,eAAe,GAAkBC,KAAQ,IAAc;EAChE,IAAId,KAAK,EAAE;IACP,OAAO,UAAU,IAAIc,KAAK,IAAI,OAAOA,KAAK,C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EAAE;MACnC,OAAO,CAACN,GAAG,EAAEV,KAAK,CAAC;IACvB;IAEA,OAAO,CACHU,GAAG,EACH3B,qBAAqB,CACjBiB,KAAK,EACLV,UAAU,EACVC,UAAU,EACVC,eACJ,CAAC,CACJ;EACL,CAAC,CACL,CAAC;EAEL,OAAOL,KAAK,GACNH,eAAe,CAACsB,YAAY,CAAC,GAC7BA,YAAY;AACtB,CAAC"}
1
+ {"version":3,"names":["getValueForNestedStyle","normalizeStyles","isAndroid","isIOS","isWeb","proxifyFunction","fn","breakpoint","screenSize","variant","Proxy","apply","target","thisArg","argumentsList","parseStyle","isPlatformColor","value","semantic","resource_paths","style","entries","Object","parsedStyles","fromEntries","map","_ref","key","hasNestedProperties","isTransform","Array","isArray","isDynamicFunction","isValidStyle"],"sourceRoot":"../../../src","sources":["utils/styles.ts"],"mappings":"AACA,SAASA,sBAAsB,QAAQ,eAAe;AACtD,SAASC,eAAe,QAAQ,mBAAmB;AAEnD,SAASC,SAAS,EAAEC,KAAK,EAAEC,KAAK,QAAQ,UAAU;AAElD,OAAO,MAAMC,eAAe,GAAGA,CAC3BC,EAAY,EAAEC,UAA+C,EAC7DC,UAAsB,EACtBC,OAAgB,KACL,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,OAAO;AACxF,CAAC,CAAC;AAEF,OAAO,MAAMO,eAAe,GAAkBC,KAAQ,IAAc;EAChE,IAAId,KAAK,EAAE;IACP,OAAO,UAAU,IAAIc,KAAK,IAAI,OAAOA,KAAK,CAACC,QAAQ,KAAK,QAAQ;EACpE;EAEA,OAAOhB,SAAS,IAAI,gBAAgB,IAAIe,KAAK,IAAI,OAAOA,KAAK,CAACE,cAAc,KAAK,QAAQ;AAC7F,CAAC;AAED,OAA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ForVariant = (value, variant) => {
2
+ if (!value.variants) {
3
+ return undefined;
4
+ }
5
+ if (variant && variant in value.variants) {
6
+ return variant;
7
+ }
8
+ if ('default' in value.variants) {
9
+ return 'default';
10
+ }
11
+ return undefined;
12
+ };
13
+ //# sourceMappingURL=variants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["getKeyForVariant","value","variant","variants","undefined"],"sourceRoot":"../../../src","sources":["utils/variants.ts"],"mappings":"AAEA,OAAO,MAAMA,gBAAgB,GAAGA,CAACC,KAAkB,EAAEC,OAAgB,KAAmC;EACpG,IAAI,CAACD,KAAK,CAACE,QAAQ,EAAE;IACjB,OAAOC,SAAS;EACpB;EAEA,IAAIF,OAAO,IAAIA,OAAO,IAAID,KAAK,CAACE,QAAQ,EAAE;IACtC,OAAOD,OAAO;EAClB;EAEA,IAAI,SAAS,IAAID,KAAK,CAACE,QAAQ,EAAE;IAC7B,OAAO,SAAS;EACpB;EAEA,OAAOC,SAAS;AACpB,CAAC"}
@@ -0,0 +1,17 @@
1
+ export declare enum CxxUnistylesEventTypes {
2
+ Theme = "theme",
3
+ Layout = "layout"
4
+ }
5
+ export declare enum UnistylesError {
6
+ RuntimeUnavailable = "UNISTYLES_ERROR_RUNTIME_UNAVAILABLE",
7
+ ThemeNotFound = "UNISTYLES_ERROR_THEME_NOT_FOUND",
8
+ ThemeNotRegistered = "UNISTYLES_ERROR_THEME_NOT_REGISTERED",
9
+ ThemesCannotBeEmpty = "UNISTYLES_ERROR_THEMES_CANNOT_BE_EMPTY",
10
+ BreakpointsCannotBeEmpty = "UNISTYLES_ERROR_BREAKPOINTS_CANNOT_BE_EMPTY",
11
+ BreakpointsMustStartFromZero = "UNISTYLES_ERROR_BREAKPOINTS_MUST_START_FROM_ZERO"
12
+ }
13
+ export declare enum ScreenOrientation {
14
+ Portrait = 1,
15
+ Landscape = 2
16
+ }
17
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/common.ts"],"names":[],"mappings":"AAAA,oBAAY,sBAAsB;IAC9B,KAAK,UAAU;IACf,MAAM,WAAW;CACpB;AAED,oBAAY,cAAc;IACtB,kBAAkB,wCAAwC;IAC1D,aAAa,oCAAoC;IACjD,kBAAkB,yCAAyC;IAC3D,mBAAmB,2CAA2C;IAC9D,wBAAwB,gDAAgD;IACxE,4BAA4B,qDAAqD;CACpF;AAGD,oBAAY,iBAAiB;IACzB,QAAQ,IAAI;IACZ,SAAS,IAAI;CAChB"}
@@ -0,0 +1,15 @@
1
+ import type { UnistylesBridge, UnistylesConfig } from '../types';
2
+ import type { UnistylesBreakpoints, UnistylesThemes } from '../global';
3
+ export declare class UnistyleRegistry {
4
+ private unistylesBridge;
5
+ config: UnistylesConfig;
6
+ themeNames: Array<keyof UnistylesThemes>;
7
+ themes: UnistylesThemes;
8
+ breakpoints: UnistylesBreakpoints;
9
+ sortedBreakpointPairs: Array<[keyof UnistylesBreakpoints, UnistylesBreakpoints[keyof UnistylesBreakpoints]]>;
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/core/UnistyleRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAEtE,qBAAa,gBAAgB;IAOb,OAAO,CAAC,eAAe;IAN5B,MAAM,EAAE,eAAe,CAAK;IAC5B,UAAU,EAAE,KAAK,CAAC,MAAM,eAAe,CAAC,CAAK;IAC7C,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;gBAEpG,eAAe,EAAE,eAAe;IAE7C,SAAS,WAAY,eAAe,UAS1C;IAEM,cAAc,gBAAiB,oBAAoB,UAMzD;IAEM,SAAS,WAAY,eAAe,UAQ1C;CACJ"}
@@ -0,0 +1,13 @@
1
+ import { UnistylesRuntime } from './UnistylesRuntime';
2
+ import { UnistyleRegistry } from './UnistyleRegistry';
3
+ declare class Unistyles {
4
+ private _runtime;
5
+ private _registry;
6
+ private _bridge;
7
+ constructor();
8
+ get registry(): UnistyleRegistry;
9
+ get runtime(): UnistylesRuntime;
10
+ }
11
+ export declare const unistyles: Unistyles;
12
+ export {};
13
+ //# sourceMappingURL=Unistyles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Unistyles.d.ts","sourceRoot":"","sources":["../../../../src/core/Unistyles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAIrD,cAAM,SAAS;IACX,OAAO,CAAC,QAAQ,CAAkB;IAClC,OAAO,CAAC,SAAS,CAAkB;IACnC,OAAO,CAAC,OAAO,CAAiB;;IAehC,IAAW,QAAQ,qBAElB;IAED,IAAW,OAAO,qBAEjB;CACJ;AAED,eAAO,MAAM,SAAS,WAAkB,CAAA"}
@@ -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/core/UnistylesModule.ts"],"names":[],"mappings":"AAEA,KAAK,qBAAqB,GAAG;IACzB,OAAO,IAAI,OAAO,CAAA;CACrB,CAAA;AAED,eAAO,MAAM,eAAe,uBAAoD,CAAA"}
@@ -0,0 +1,24 @@
1
+ import { ScreenOrientation } from '../common';
2
+ import type { UnistylesBridge } from '../types';
3
+ import type { UnistylesThemes } from '../global';
4
+ import type { UnistyleRegistry } from './UnistyleRegistry';
5
+ export declare class UnistylesRuntime {
6
+ private unistylesBridge;
7
+ private registry;
8
+ constructor(unistylesBridge: UnistylesBridge, registry: UnistyleRegistry);
9
+ get colorScheme(): import("../types").ColorSchemeName;
10
+ get hasAdaptiveThemes(): boolean;
11
+ get sortedBreakpoints(): [keyof import("../global").UnistylesBreakpoints, number | undefined][];
12
+ get themeName(): never;
13
+ get breakpoint(): keyof import("../global").UnistylesBreakpoints;
14
+ get screen(): {
15
+ width: number;
16
+ height: number;
17
+ };
18
+ get orientation(): ScreenOrientation;
19
+ setTheme: (name: keyof UnistylesThemes) => boolean;
20
+ getTheme: (forName: keyof UnistylesThemes) => never;
21
+ setAdaptiveThemes: (enable: boolean) => void;
22
+ private hasTheme;
23
+ }
24
+ //# sourceMappingURL=UnistylesRuntime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnistylesRuntime.d.ts","sourceRoot":"","sources":["../../../../src/core/UnistylesRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAkB,MAAM,WAAW,CAAA;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAE1D,qBAAa,gBAAgB;IACb,OAAO,CAAC,eAAe;IAAmB,OAAO,CAAC,QAAQ;gBAAlD,eAAe,EAAE,eAAe,EAAU,QAAQ,EAAE,gBAAgB;IAExF,IAAW,WAAW,uCAErB;IAED,IAAW,iBAAiB,YAE3B;IAED,IAAW,iBAAiB,2EAE3B;IAED,IAAW,SAAS,UAEnB;IAED,IAAW,UAAU,mDAEpB;IAED,IAAW,MAAM;;;MAKhB;IAED,IAAW,WAAW,sBAQrB;IAEM,QAAQ,SAAU,MAAM,eAAe,aAQ7C;IAEM,QAAQ,YAAa,MAAM,eAAe,WAUhD;IAEM,iBAAiB,WAAY,OAAO,UAE1C;IAED,OAAO,CAAC,QAAQ,CAAgE;CACnF"}
@@ -0,0 +1,2 @@
1
+ export { unistyles } from './Unistyles';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { CustomNamedStyles, UnistylesTheme } from './types';
2
+ export declare const createStyleSheet: <S, X>(styles: S | X | CustomNamedStyles<S> | ((theme: UnistylesTheme) => X | CustomNamedStyles<X>)) => S | X;
3
+ //# 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,cAAc,EAAE,MAAM,SAAS,CAAA;AAEhE,eAAO,MAAM,gBAAgB,yDAA0D,cAAc,wCAMpG,CAAA"}
@@ -0,0 +1,7 @@
1
+ export interface UnistylesThemes {
2
+ }
3
+ export interface UnistylesBreakpoints {
4
+ landscape?: number;
5
+ portrait?: number;
6
+ }
7
+ //# 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;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB"}
@@ -1,2 +1,3 @@
1
- export { useDimensions } from './useDimensions';
1
+ export { useInitialTheme } from './useInitialTheme';
2
+ export { useUnistyles } from './useUnistyles';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,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/hooks/useInitialTheme.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAEhD,eAAO,MAAM,eAAe,YAAa,MAAM,eAAe,SAM7D,CAAA"}
@@ -0,0 +1,12 @@
1
+ export declare const useUnistyles: () => {
2
+ theme: never;
3
+ layout: {
4
+ breakpoint: keyof import("..").UnistylesBreakpoints;
5
+ orientation: import("../common").ScreenOrientation;
6
+ screenSize: {
7
+ width: number;
8
+ height: number;
9
+ };
10
+ };
11
+ };
12
+ //# sourceMappingURL=useUnistyles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useUnistyles.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useUnistyles.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,YAAY;;;;;;;;;;CA8CxB,CAAA"}
@@ -1,3 +1,15 @@
1
- export { UnistylesTheme } from './UnistylesTheme';
2
- export { createUnistyles } from './createUnistyles';
1
+ import { mq } from './utils';
2
+ import { useInitialTheme } from './hooks';
3
+ import type { UnistylesThemes, UnistylesBreakpoints } from './global';
4
+ import { ScreenOrientation } from './common';
5
+ import { useStyles } from './useStyles';
6
+ import { createStyleSheet } from './createStyleSheet';
7
+ declare const UnistylesRegistry: {
8
+ addThemes: (themes: UnistylesThemes) => import("./core/UnistyleRegistry").UnistyleRegistry;
9
+ addBreakpoints: (breakpoints: UnistylesBreakpoints) => import("./core/UnistyleRegistry").UnistyleRegistry;
10
+ addConfig: (config: import("./types").UnistylesConfig) => import("./core/UnistyleRegistry").UnistyleRegistry;
11
+ };
12
+ declare const UnistylesRuntime: import("./core/UnistylesRuntime").UnistylesRuntime;
13
+ export { mq, useStyles, useInitialTheme, createStyleSheet, ScreenOrientation, UnistylesRegistry, UnistylesRuntime };
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,EAAE,EAAE,EAAE,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AACzC,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD,QAAA,MAAM,iBAAiB;;;;CAItB,CAAA;AAED,QAAA,MAAM,gBAAgB,oDAAoB,CAAA;AAE1C,OAAO,EACH,EAAE,EACF,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EACnB,CAAA;AAED,YAAY,EACR,eAAe,EACf,oBAAoB,EACvB,CAAA"}
@@ -1,20 +1,19 @@
1
1
  import type { OpaqueColorValue } from 'react-native';
2
- import type { MediaQueries } from './mediaQueries';
3
- export type Breakpoints = Record<string, number>;
4
- export type SortedBreakpointEntries<B extends Breakpoints> = [[keyof B & string, number]];
5
- export type ScreenSize = {
6
- width: number;
7
- height: number;
8
- };
9
- export type CreateStylesFactory<ST, Theme> = (theme: Theme) => ST;
2
+ import type { UnistylesBreakpoints } from '../global';
3
+ import type { MediaQuery } from './mq';
4
+ import type { VariantValue } from './core';
10
5
  type WithEmptyObject<V> = keyof V extends never ? {} : V;
11
- 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> : {
12
- [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];
6
+ 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> : {
7
+ [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];
13
8
  };
14
- 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 OpaqueColorValue ? string : T extends Record<string, infer _V> ? {
15
- [K in keyof T as K extends MediaQueries ? keyof B & string : K]: RemoveKeysWithPrefix<T[K], B>;
9
+ type FlattenObjectTypes<T> = T[keyof T];
10
+ type RemoveKeysWithPrefix<T> = T extends (...args: Array<any>) => infer R ? (...args: Parameters<T>) => RemoveKeysWithPrefix<R> : T extends object ? T extends OpaqueColorValue ? string : T extends Record<string, infer _V> ? T extends {
11
+ variants: VariantValue;
12
+ } ? RemoveKeysWithPrefix<FlattenObjectTypes<T['variants']>> : {
13
+ [K in keyof T as K extends MediaQuery ? keyof UnistylesBreakpoints & string : K]: RemoveKeysWithPrefix<T[K]>;
16
14
  } : {
17
- [K in keyof T]: RemoveKeysWithPrefix<T[K], B>;
15
+ [K in keyof T]: RemoveKeysWithPrefix<T[K]>;
18
16
  } : T;
17
+ export type ReactNativeStyleSheet<T> = ExtractBreakpoints<RemoveKeysWithPrefix<T>>;
19
18
  export {};
20
19
  //# 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,gBAAgB,EAAE,MAAM,cAAc,CAAA;AACpD,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,MAA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B,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,MAAM,CAAC,GACnE,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,oBAAoB,CAAC,CAAC,CAAC,GACnD,CAAC,SAAS,MAAM,GACZ,CAAC,SAAS,gBAAgB,GACtB,MAAM,GACN,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GAC9B,CAAC,SAAS;IAAE,QAAQ,EAAE,YAAY,CAAA;CAAE,GAChC,oBAAoB,CAAC,kBAAkB,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,GACvD;KAAG,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,UAAU,GAAG,MAAM,oBAAoB,GAAG,MAAM,GAAG,CAAC,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GACpH;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GACtD,CAAC,CAAA;AAEX,MAAM,MAAM,qBAAqB,CAAC,CAAC,IAAI,kBAAkB,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAA"}
@@ -0,0 +1,3 @@
1
+ export type Optional<T> = T | undefined;
2
+ export type Nullable<T> = T | null;
3
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/types/common.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,SAAS,CAAA;AACvC,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA"}
@@ -1,32 +1,48 @@
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
- import type { MediaQueries } from './mediaQueries';
3
+ import type { UnistylesBreakpoints, UnistylesThemes } from '../global';
4
+ import type { MediaQuery } from './mq';
5
5
  type ShadowOffset = {
6
6
  width: number;
7
7
  height: number;
8
8
  };
9
+ export type ScreenSize = {
10
+ width: number;
11
+ height: number;
12
+ };
9
13
  type TransformStyles = PerpectiveTransform & RotateTransform & RotateXTransform & RotateYTransform & RotateZTransform & ScaleTransform & ScaleXTransform & ScaleYTransform & TranslateXTransform & TranslateYTransform & SkewXTransform & SkewYTransform & MatrixTransform;
10
- type UnistyleNested<B> = {
11
- shadowOffset?: DeepUniStyle<ShadowOffset, B>;
12
- textShadowOffset?: DeepUniStyle<ShadowOffset, B>;
13
- transform?: Array<DeepUniStyle<TransformStyles, B>>;
14
+ type UnistyleNested = {
15
+ shadowOffset?: DeepUniStyle<ShadowOffset>;
16
+ textShadowOffset?: DeepUniStyle<ShadowOffset>;
17
+ transform?: Array<DeepUniStyle<TransformStyles>>;
14
18
  };
15
- type UniStyle<V, B> = {
16
- [innerKey in keyof B]?: V;
19
+ type UniStyle<V> = {
20
+ [innerKey in keyof UnistylesBreakpoints]?: V;
17
21
  } | {
18
- [innerKey in MediaQueries]?: V;
19
- } | V;
20
- type DeepUniStyle<T, B> = {
21
- [K in keyof T]?: UniStyle<T[K], B>;
22
+ [innerKey in MediaQuery]: V;
23
+ } | {
24
+ [innerKey in 'variants']?: {
25
+ [variant: string]: V;
26
+ };
27
+ };
28
+ type DeepUniStyle<T> = {
29
+ [K in keyof T]?: UniStyle<T[K]> | T[K];
22
30
  };
23
31
  type NestedTypes = 'shadowOffset' | 'transform' | 'textShadowOffset';
24
- type UnistyleView<B> = DeepUniStyle<Omit<ViewStyle, NestedTypes>, B>;
25
- type UnistyleText<B> = DeepUniStyle<Omit<TextStyle, NestedTypes>, B>;
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>;
32
+ type UnistyleView = DeepUniStyle<Omit<ViewStyle, NestedTypes>>;
33
+ type UnistyleText = DeepUniStyle<Omit<TextStyle, NestedTypes>>;
34
+ type UnistyleImage = DeepUniStyle<Omit<ImageStyle, NestedTypes>>;
35
+ export type StaticStyles = UnistyleView | UnistyleText | UnistyleImage & UnistyleNested;
36
+ export type CustomNamedStyles<T> = {
37
+ [K in keyof T]: T[K] extends (...args: infer A) => StaticStyles ? (...args: A) => StaticStyles : StaticStyles;
38
+ };
39
+ export type RNValue = number | string | undefined;
40
+ export type VariantValue = Record<string, RNValue>;
41
+ export type NestedStyle = Record<keyof UnistylesBreakpoints | MediaQuery | 'variants', RNValue> & {
42
+ variants: VariantValue;
30
43
  };
44
+ export type NestedStylePairs = Array<[keyof UnistylesBreakpoints | MediaQuery | 'variants', RNValue | VariantValue]>;
45
+ export type UnistylesTheme = UnistylesThemes[keyof UnistylesThemes];
46
+ export type CreateStylesFactory<ST, Theme> = (theme: Theme) => ST;
31
47
  export {};
32
48
  //# 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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AAS,EAAE,WAAW,CAAC,CAAC,CAAA;AAC9D,KAAK,aAAa,GAAG,YAAY,CAAC,IAAI,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC,CAAA;AAEhE,MAAM,MAAM,YAAY,GAClB,YAAY,GACZ,YAAY,GACZ,aAAa,GACb,cAAc,CAAA;AAEpB,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,GACzD,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,YAAY,GAC5B,YAAY;CACrB,CAAA;AAED,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;AACjD,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAClD,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,oBAAoB,GAAG,UAAU,GAAG,UAAU,EAAE,OAAO,CAAC,GAAG;IAC9F,QAAQ,EAAE,YAAY,CAAA;CACzB,CAAA;AACD,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,CAAC,MAAM,oBAAoB,GAAG,UAAU,GAAG,UAAU,EAAE,OAAO,GAAG,YAAY,CAAC,CAAC,CAAA;AACpH,MAAM,MAAM,cAAc,GAAG,eAAe,CAAC,MAAM,eAAe,CAAC,CAAA;AACnE,MAAM,MAAM,mBAAmB,CAAC,EAAE,EAAE,KAAK,IAAI,CAAC,KAAK,EAAE,KAAK,KAAK,EAAE,CAAA"}
@@ -1,4 +1,7 @@
1
1
  export * from './normalizer';
2
- export type { CustomNamedStyles } from './core';
3
- export type { ScreenSize, Breakpoints, CreateStylesFactory, ExtractBreakpoints, RemoveKeysWithPrefix, SortedBreakpointEntries } from './breakpoints';
2
+ export * from './unistyles';
3
+ export type { Optional, Nullable } from './common';
4
+ export type { MediaQuery } from './mq';
5
+ export type { CustomNamedStyles, NestedStylePairs, UnistylesTheme, CreateStylesFactory, ScreenSize, NestedStyle, RNValue } from './core';
6
+ export type { ReactNativeStyleSheet } from './breakpoints';
4
7
  //# 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,aAAa,CAAA;AAC3B,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAClD,YAAY,EAAE,UAAU,EAAE,MAAM,MAAM,CAAA;AACtC,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,cAAc,EAAE,mBAAmB,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AACxI,YAAY,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { MQSymbol } from '../utils';
2
+ export type MediaQuery = typeof MQSymbol;
3
+ //# sourceMappingURL=mq.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mq.d.ts","sourceRoot":"","sources":["../../../../src/types/mq.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAEnC,MAAM,MAAM,UAAU,GAAG,OAAO,QAAQ,CAAA"}
@@ -0,0 +1,37 @@
1
+ import { CxxUnistylesEventTypes, ScreenOrientation } from '../common';
2
+ import type { UnistylesThemes, UnistylesBreakpoints } from '../global';
3
+ import type { ScreenSize } from './core';
4
+ import type { Optional } from './common';
5
+ export type ColorSchemeName = Optional<'light' | 'dark'>;
6
+ export type UnistylesConfig = {
7
+ adaptiveThemes?: boolean;
8
+ };
9
+ export type UnistylesBridge = {
10
+ screenWidth: number;
11
+ screenHeight: number;
12
+ hasAdaptiveThemes: boolean;
13
+ themeName: keyof UnistylesThemes;
14
+ breakpoint: keyof UnistylesBreakpoints;
15
+ colorScheme: ColorSchemeName;
16
+ sortedBreakpointPairs: Array<[keyof UnistylesBreakpoints, UnistylesBreakpoints[keyof UnistylesBreakpoints]]>;
17
+ themes: Array<keyof UnistylesThemes>;
18
+ useBreakpoints(breakpoints: UnistylesBreakpoints): void;
19
+ useTheme(name: keyof UnistylesThemes): void;
20
+ useAdaptiveThemes(enable: boolean): void;
21
+ };
22
+ export type UnistylesThemeEvent = {
23
+ type: CxxUnistylesEventTypes.Theme;
24
+ payload: {
25
+ themeName: keyof UnistylesThemes;
26
+ };
27
+ };
28
+ export type UnistylesMobileLayoutEvent = {
29
+ type: CxxUnistylesEventTypes.Layout;
30
+ payload: {
31
+ screen: ScreenSize;
32
+ breakpoint: keyof UnistylesBreakpoints;
33
+ orientation: ScreenOrientation;
34
+ };
35
+ };
36
+ export type UnistylesEvents = UnistylesThemeEvent | UnistylesMobileLayoutEvent;
37
+ //# sourceMappingURL=unistyles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unistyles.d.ts","sourceRoot":"","sources":["../../../../src/types/unistyles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACxC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAExC,MAAM,MAAM,eAAe,GAAG,Q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{ UnistylesBreakpoints } from './global';
3
+ type ParsedStylesheet<ST extends CustomNamedStyles<ST>> = {
4
+ theme: UnistylesTheme;
5
+ breakpoint: keyof UnistylesBreakpoints;
6
+ styles: ReactNativeStyleSheet<ST>;
7
+ };
8
+ export declare const useStyles: <ST extends CustomNamedStyles<ST>>(stylesheet?: ST | CreateStylesFactory<ST, never> | undefined, variant?: string) => ParsedStylesheet<ST>;
9
+ export {};
10
+ //# sourceMappingURL=useStyles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStyles.d.ts","sourceRoot":"","sources":["../../../src/useStyles.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE5G,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAEpD,KAAK,gBAAgB,CAAC,EAAE,SAAS,iBAAiB,CAAC,EAAE,CAAC,IAAI;IACtD,KAAK,EAAE,cAAc,CAAC;IACtB,UAAU,EAAE,MAAM,oBAAoB,CAAC;IACvC,MAAM,EAAE,qBAAqB,CAAC,EAAE,CAAC,CAAA;CACpC,CAAA;AAED,eAAO,MAAM,SAAS,6GAER,MAAM,yBAwCnB,CAAA"}