react-native-unistyles 1.1.6 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (394) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +30 -38
  3. package/android/CMakeLists.txt +27 -0
  4. package/android/build.gradle +75 -0
  5. package/android/src/main/cxx/cpp-adapter.cpp +132 -0
  6. package/android/src/main/java/com/unistyles/UnistylesModule.kt +189 -0
  7. package/android/src/main/java/com/unistyles/UnistylesPackage.kt +18 -0
  8. package/cxx/UnistylesRuntime.cpp +318 -0
  9. package/cxx/UnistylesRuntime.h +74 -0
  10. package/ios/UnistylesHelpers.h +3 -0
  11. package/ios/UnistylesHelpers.mm +5 -0
  12. package/ios/UnistylesModule.h +16 -0
  13. package/ios/UnistylesModule.mm +138 -0
  14. package/ios/platform/Platform_iOS.h +21 -0
  15. package/ios/platform/Platform_iOS.mm +132 -0
  16. package/ios/platform/Platform_macOS.h +20 -0
  17. package/ios/platform/Platform_macOS.mm +83 -0
  18. package/lib/commonjs/common.js +60 -0
  19. package/lib/commonjs/common.js.map +1 -0
  20. package/lib/commonjs/core/UnistyleRegistry.js +94 -0
  21. package/lib/commonjs/core/UnistyleRegistry.js.map +1 -0
  22. package/lib/commonjs/core/Unistyles.js +32 -0
  23. package/lib/commonjs/core/Unistyles.js.map +1 -0
  24. package/lib/commonjs/core/UnistylesModule.js +197 -0
  25. package/lib/commonjs/core/UnistylesModule.js.map +1 -0
  26. package/lib/commonjs/core/UnistylesModule.native.js +9 -0
  27. package/lib/commonjs/core/UnistylesModule.native.js.map +1 -0
  28. package/lib/commonjs/core/UnistylesRuntime.js +140 -0
  29. package/lib/commonjs/core/UnistylesRuntime.js.map +1 -0
  30. package/lib/commonjs/core/index.js +13 -0
  31. package/lib/commonjs/core/index.js.map +1 -0
  32. package/lib/commonjs/createStyleSheet.js +14 -0
  33. package/lib/commonjs/createStyleSheet.js.map +1 -0
  34. package/lib/commonjs/global.js +2 -0
  35. package/lib/commonjs/global.js.map +1 -0
  36. package/lib/commonjs/hooks/index.js +24 -3
  37. package/lib/commonjs/hooks/index.js.map +1 -1
  38. package/lib/commonjs/hooks/useCSS.js +44 -0
  39. package/lib/commonjs/hooks/useCSS.js.map +1 -0
  40. package/lib/commonjs/hooks/useCSS.native.js +9 -0
  41. package/lib/commonjs/hooks/useCSS.native.js.map +1 -0
  42. package/lib/commonjs/hooks/useInitialTheme.js +17 -0
  43. package/lib/commonjs/hooks/useInitialTheme.js.map +1 -0
  44. package/lib/commonjs/hooks/useUnistyles.js +64 -0
  45. package/lib/commonjs/hooks/useUnistyles.js.map +1 -0
  46. package/lib/commonjs/hooks/useVariants.js +14 -0
  47. package/lib/commonjs/hooks/useVariants.js.map +1 -0
  48. package/lib/commonjs/index.js +63 -6
  49. package/lib/commonjs/index.js.map +1 -1
  50. package/lib/commonjs/normalizer/index.js +32 -0
  51. package/lib/commonjs/normalizer/index.js.map +1 -0
  52. package/lib/commonjs/normalizer/module.d.js.map +1 -0
  53. package/lib/commonjs/{utils/normalizeStyles.web.js → normalizer/normalizeStyle.js} +5 -5
  54. package/lib/commonjs/normalizer/normalizeStyle.js.map +1 -0
  55. package/lib/commonjs/{utils → normalizer}/normalizer.js +2 -3
  56. package/lib/commonjs/normalizer/normalizer.js.map +1 -0
  57. package/lib/commonjs/normalizer/normalizer.macos.js +3 -0
  58. package/lib/commonjs/normalizer/normalizer.macos.js.map +1 -0
  59. package/lib/commonjs/plugins/cssMediaQueriesPlugin.js +14 -0
  60. package/lib/commonjs/plugins/cssMediaQueriesPlugin.js.map +1 -0
  61. package/lib/commonjs/plugins/index.js +20 -0
  62. package/lib/commonjs/plugins/index.js.map +1 -0
  63. package/lib/commonjs/plugins/normalizeWebStylesPlugin.js +12 -0
  64. package/lib/commonjs/plugins/normalizeWebStylesPlugin.js.map +1 -0
  65. package/lib/commonjs/types/common.js +2 -0
  66. package/lib/{module/utils/module.d.js.map → commonjs/types/common.js.map} +1 -1
  67. package/lib/commonjs/types/index.js +11 -0
  68. package/lib/commonjs/types/index.js.map +1 -1
  69. package/lib/commonjs/types/plugin.js +6 -0
  70. package/lib/commonjs/{utils/module.d.js.map → types/plugin.js.map} +1 -1
  71. package/lib/commonjs/types/stylesheet.js +6 -0
  72. package/lib/commonjs/types/{mediaQueries.js.map → stylesheet.js.map} +1 -1
  73. package/lib/commonjs/types/unistyles.js +6 -0
  74. package/lib/{module/types/mediaQueries.js.map → commonjs/types/unistyles.js.map} +1 -1
  75. package/lib/commonjs/types/variants.js +2 -0
  76. package/lib/commonjs/types/variants.js.map +1 -0
  77. package/lib/commonjs/useStyles.js +47 -0
  78. package/lib/commonjs/useStyles.js.map +1 -0
  79. package/lib/commonjs/utils/breakpoints.js +20 -122
  80. package/lib/commonjs/utils/breakpoints.js.map +1 -1
  81. package/lib/commonjs/utils/cssMediaQuery.js +244 -0
  82. package/lib/commonjs/utils/cssMediaQuery.js.map +1 -0
  83. package/lib/commonjs/utils/generateId.js +15 -0
  84. package/lib/commonjs/utils/generateId.js.map +1 -0
  85. package/lib/commonjs/utils/hash32.js +43 -0
  86. package/lib/commonjs/utils/hash32.js.map +1 -0
  87. package/lib/commonjs/utils/index.js +22 -54
  88. package/lib/commonjs/utils/index.js.map +1 -1
  89. package/lib/commonjs/utils/mq.js +38 -0
  90. package/lib/commonjs/utils/mq.js.map +1 -0
  91. package/lib/commonjs/utils/mqParser.js +89 -0
  92. package/lib/commonjs/utils/mqParser.js.map +1 -0
  93. package/lib/commonjs/utils/styles.js +52 -72
  94. package/lib/commonjs/utils/styles.js.map +1 -1
  95. package/lib/commonjs/utils/withPlugins.js +15 -0
  96. package/lib/commonjs/utils/withPlugins.js.map +1 -0
  97. package/lib/module/common.js +53 -0
  98. package/lib/module/common.js.map +1 -0
  99. package/lib/module/core/UnistyleRegistry.js +87 -0
  100. package/lib/module/core/UnistyleRegistry.js.map +1 -0
  101. package/lib/module/core/Unistyles.js +26 -0
  102. package/lib/module/core/Unistyles.js.map +1 -0
  103. package/lib/module/core/UnistylesModule.js +190 -0
  104. package/lib/module/core/UnistylesModule.js.map +1 -0
  105. package/lib/module/core/UnistylesModule.native.js +3 -0
  106. package/lib/module/core/UnistylesModule.native.js.map +1 -0
  107. package/lib/module/core/UnistylesRuntime.js +133 -0
  108. package/lib/module/core/UnistylesRuntime.js.map +1 -0
  109. package/lib/module/core/index.js +2 -0
  110. package/lib/module/core/index.js.map +1 -0
  111. package/lib/module/createStyleSheet.js +7 -0
  112. package/lib/module/createStyleSheet.js.map +1 -0
  113. package/lib/module/global.js +2 -0
  114. package/lib/module/global.js.map +1 -0
  115. package/lib/module/hooks/index.js +4 -1
  116. package/lib/module/hooks/index.js.map +1 -1
  117. package/lib/module/hooks/useCSS.js +37 -0
  118. package/lib/module/hooks/useCSS.js.map +1 -0
  119. package/lib/module/hooks/useCSS.native.js +2 -0
  120. package/lib/module/hooks/useCSS.native.js.map +1 -0
  121. package/lib/module/hooks/useInitialTheme.js +10 -0
  122. package/lib/module/hooks/useInitialTheme.js.map +1 -0
  123. package/lib/module/hooks/useUnistyles.js +57 -0
  124. package/lib/module/hooks/useUnistyles.js.map +1 -0
  125. package/lib/module/hooks/useVariants.js +7 -0
  126. package/lib/module/hooks/useVariants.js.map +1 -0
  127. package/lib/module/index.js +30 -2
  128. package/lib/module/index.js.map +1 -1
  129. package/lib/module/normalizer/index.js +3 -0
  130. package/lib/module/normalizer/index.js.map +1 -0
  131. package/lib/module/normalizer/module.d.js.map +1 -0
  132. package/lib/module/{utils/normalizeStyles.web.js → normalizer/normalizeStyle.js} +3 -3
  133. package/lib/module/normalizer/normalizeStyle.js.map +1 -0
  134. package/lib/module/{utils → normalizer}/normalizer.js +2 -3
  135. package/lib/module/normalizer/normalizer.js.map +1 -0
  136. package/lib/module/normalizer/normalizer.macos.js +2 -0
  137. package/lib/module/normalizer/normalizer.macos.js.map +1 -0
  138. package/lib/module/plugins/cssMediaQueriesPlugin.js +7 -0
  139. package/lib/module/plugins/cssMediaQueriesPlugin.js.map +1 -0
  140. package/lib/module/plugins/index.js +3 -0
  141. package/lib/module/plugins/index.js.map +1 -0
  142. package/lib/module/plugins/normalizeWebStylesPlugin.js +6 -0
  143. package/lib/module/plugins/normalizeWebStylesPlugin.js.map +1 -0
  144. package/lib/module/types/common.js +2 -0
  145. package/lib/module/types/common.js.map +1 -0
  146. package/lib/module/types/index.js +1 -0
  147. package/lib/module/types/index.js.map +1 -1
  148. package/lib/module/types/plugin.js +2 -0
  149. package/lib/module/types/plugin.js.map +1 -0
  150. package/lib/module/types/stylesheet.js +2 -0
  151. package/lib/module/types/stylesheet.js.map +1 -0
  152. package/lib/module/types/unistyles.js +2 -0
  153. package/lib/module/types/unistyles.js.map +1 -0
  154. package/lib/module/types/variants.js +2 -0
  155. package/lib/module/types/variants.js.map +1 -0
  156. package/lib/module/useStyles.js +40 -0
  157. package/lib/module/useStyles.js.map +1 -0
  158. package/lib/module/utils/breakpoints.js +19 -120
  159. package/lib/module/utils/breakpoints.js.map +1 -1
  160. package/lib/module/utils/cssMediaQuery.js +237 -0
  161. package/lib/module/utils/cssMediaQuery.js.map +1 -0
  162. package/lib/module/utils/generateId.js +7 -0
  163. package/lib/module/utils/generateId.js.map +1 -0
  164. package/lib/module/utils/hash32.js +36 -0
  165. package/lib/module/utils/hash32.js.map +1 -0
  166. package/lib/module/utils/index.js +6 -6
  167. package/lib/module/utils/index.js.map +1 -1
  168. package/lib/module/utils/mq.js +32 -0
  169. package/lib/module/utils/mq.js.map +1 -0
  170. package/lib/module/utils/mqParser.js +78 -0
  171. package/lib/module/utils/mqParser.js.map +1 -0
  172. package/lib/module/utils/styles.js +50 -72
  173. package/lib/module/utils/styles.js.map +1 -1
  174. package/lib/module/utils/withPlugins.js +8 -0
  175. package/lib/module/utils/withPlugins.js.map +1 -0
  176. package/lib/typescript/src/common.d.ts +46 -0
  177. package/lib/typescript/src/common.d.ts.map +1 -0
  178. package/lib/typescript/src/core/UnistyleRegistry.d.ts +56 -0
  179. package/lib/typescript/src/core/UnistyleRegistry.d.ts.map +1 -0
  180. package/lib/typescript/src/core/Unistyles.d.ts +13 -0
  181. package/lib/typescript/src/core/Unistyles.d.ts.map +1 -0
  182. package/lib/typescript/src/core/UnistylesModule.d.ts +19 -0
  183. package/lib/typescript/src/core/UnistylesModule.d.ts.map +1 -0
  184. package/lib/typescript/src/core/UnistylesModule.native.d.ts +6 -0
  185. package/lib/typescript/src/core/UnistylesModule.native.d.ts.map +1 -0
  186. package/lib/typescript/src/core/UnistylesRuntime.d.ts +81 -0
  187. package/lib/typescript/src/core/UnistylesRuntime.d.ts.map +1 -0
  188. package/lib/typescript/src/core/index.d.ts +3 -0
  189. package/lib/typescript/src/core/index.d.ts.map +1 -0
  190. package/lib/typescript/src/createStyleSheet.d.ts +8 -0
  191. package/lib/typescript/src/createStyleSheet.d.ts.map +1 -0
  192. package/lib/typescript/src/global.d.ts +7 -0
  193. package/lib/typescript/src/global.d.ts.map +1 -0
  194. package/lib/typescript/src/hooks/index.d.ts +4 -1
  195. package/lib/typescript/src/hooks/index.d.ts.map +1 -1
  196. package/lib/typescript/src/hooks/useCSS.d.ts +3 -0
  197. package/lib/typescript/src/hooks/useCSS.d.ts.map +1 -0
  198. package/lib/typescript/src/hooks/useCSS.native.d.ts +3 -0
  199. package/lib/typescript/src/hooks/useCSS.native.d.ts.map +1 -0
  200. package/lib/typescript/src/hooks/useInitialTheme.d.ts +3 -0
  201. package/lib/typescript/src/hooks/useInitialTheme.d.ts.map +1 -0
  202. package/lib/typescript/src/hooks/useUnistyles.d.ts +14 -0
  203. package/lib/typescript/src/hooks/useUnistyles.d.ts.map +1 -0
  204. package/lib/typescript/src/hooks/useVariants.d.ts +3 -0
  205. package/lib/typescript/src/hooks/useVariants.d.ts.map +1 -0
  206. package/lib/typescript/src/index.d.ts +76 -2
  207. package/lib/typescript/src/index.d.ts.map +1 -1
  208. package/lib/typescript/src/normalizer/index.d.ts +3 -0
  209. package/lib/typescript/src/normalizer/index.d.ts.map +1 -0
  210. package/lib/typescript/src/normalizer/normalizeStyle.d.ts +3 -0
  211. package/lib/typescript/src/normalizer/normalizeStyle.d.ts.map +1 -0
  212. package/lib/typescript/src/normalizer/normalizer.d.ts.map +1 -0
  213. package/lib/typescript/src/normalizer/normalizer.macos.d.ts +1 -0
  214. package/lib/typescript/src/normalizer/normalizer.macos.d.ts.map +1 -0
  215. package/lib/typescript/src/plugins/cssMediaQueriesPlugin.d.ts +3 -0
  216. package/lib/typescript/src/plugins/cssMediaQueriesPlugin.d.ts.map +1 -0
  217. package/lib/typescript/src/plugins/index.d.ts +3 -0
  218. package/lib/typescript/src/plugins/index.d.ts.map +1 -0
  219. package/lib/typescript/src/plugins/normalizeWebStylesPlugin.d.ts +3 -0
  220. package/lib/typescript/src/plugins/normalizeWebStylesPlugin.d.ts.map +1 -0
  221. package/lib/typescript/src/types/breakpoints.d.ts +25 -16
  222. package/lib/typescript/src/types/breakpoints.d.ts.map +1 -1
  223. package/lib/typescript/src/types/common.d.ts +3 -0
  224. package/lib/typescript/src/types/common.d.ts.map +1 -0
  225. package/lib/typescript/src/types/core.d.ts +11 -25
  226. package/lib/typescript/src/types/core.d.ts.map +1 -1
  227. package/lib/typescript/src/types/index.d.ts +7 -2
  228. package/lib/typescript/src/types/index.d.ts.map +1 -1
  229. package/lib/typescript/src/types/plugin.d.ts +7 -0
  230. package/lib/typescript/src/types/plugin.d.ts.map +1 -0
  231. package/lib/typescript/src/types/stylesheet.d.ts +40 -0
  232. package/lib/typescript/src/types/stylesheet.d.ts.map +1 -0
  233. package/lib/typescript/src/types/unistyles.d.ts +53 -0
  234. package/lib/typescript/src/types/unistyles.d.ts.map +1 -0
  235. package/lib/typescript/src/types/variants.d.ts +14 -0
  236. package/lib/typescript/src/types/variants.d.ts.map +1 -0
  237. package/lib/typescript/src/useStyles.d.ts +16 -0
  238. package/lib/typescript/src/useStyles.d.ts.map +1 -0
  239. package/lib/typescript/src/utils/breakpoints.d.ts +2 -62
  240. package/lib/typescript/src/utils/breakpoints.d.ts.map +1 -1
  241. package/lib/typescript/src/utils/cssMediaQuery.d.ts +4 -0
  242. package/lib/typescript/src/utils/cssMediaQuery.d.ts.map +1 -0
  243. package/lib/typescript/src/utils/generateId.d.ts +2 -0
  244. package/lib/typescript/src/utils/generateId.d.ts.map +1 -0
  245. package/lib/typescript/src/utils/hash32.d.ts +2 -0
  246. package/lib/typescript/src/utils/hash32.d.ts.map +1 -0
  247. package/lib/typescript/src/utils/index.d.ts +7 -6
  248. package/lib/typescript/src/utils/index.d.ts.map +1 -1
  249. package/lib/typescript/src/utils/mq.d.ts +26 -0
  250. package/lib/typescript/src/utils/mq.d.ts.map +1 -0
  251. package/lib/typescript/src/utils/mqParser.d.ts +16 -0
  252. package/lib/typescript/src/utils/mqParser.d.ts.map +1 -0
  253. package/lib/typescript/src/utils/styles.d.ts +4 -49
  254. package/lib/typescript/src/utils/styles.d.ts.map +1 -1
  255. package/lib/typescript/src/utils/withPlugins.d.ts +3 -0
  256. package/lib/typescript/src/utils/withPlugins.d.ts.map +1 -0
  257. package/package.json +46 -25
  258. package/react-native-unistyles.podspec +22 -0
  259. package/src/__tests__/mocks.ts +24 -0
  260. package/src/common.ts +55 -0
  261. package/src/core/UnistyleRegistry.ts +108 -0
  262. package/src/core/Unistyles.ts +35 -0
  263. package/src/core/UnistylesModule.native.ts +7 -0
  264. package/src/core/UnistylesModule.ts +230 -0
  265. package/src/core/UnistylesRuntime.ts +135 -0
  266. package/src/core/index.ts +2 -0
  267. package/src/createStyleSheet.ts +8 -0
  268. package/src/global.ts +6 -0
  269. package/src/hooks/index.ts +4 -1
  270. package/src/hooks/useCSS.native.ts +3 -0
  271. package/src/hooks/useCSS.ts +51 -0
  272. package/src/hooks/useInitialTheme.ts +11 -0
  273. package/src/hooks/useUnistyles.ts +64 -0
  274. package/src/hooks/useVariants.ts +10 -0
  275. package/src/index.ts +50 -2
  276. package/src/normalizer/index.ts +2 -0
  277. package/src/{utils/normalizeStyles.web.ts → normalizer/normalizeStyle.ts} +3 -3
  278. package/src/normalizer/normalizer.macos.ts +1 -0
  279. package/src/{utils → normalizer}/normalizer.ts +5 -4
  280. package/src/plugins/cssMediaQueriesPlugin.ts +8 -0
  281. package/src/plugins/index.ts +2 -0
  282. package/src/plugins/normalizeWebStylesPlugin.ts +7 -0
  283. package/src/types/breakpoints.ts +55 -27
  284. package/src/types/common.ts +2 -0
  285. package/src/types/core.ts +11 -36
  286. package/src/types/index.ts +12 -7
  287. package/src/types/plugin.ts +7 -0
  288. package/src/types/stylesheet.ts +49 -0
  289. package/src/types/unistyles.ts +63 -0
  290. package/src/types/variants.ts +19 -0
  291. package/src/useStyles.ts +60 -0
  292. package/src/utils/breakpoints.ts +28 -124
  293. package/src/utils/cssMediaQuery.ts +268 -0
  294. package/src/utils/generateId.ts +10 -0
  295. package/src/utils/hash32.ts +53 -0
  296. package/src/utils/index.ts +7 -13
  297. package/src/utils/mq.ts +57 -0
  298. package/src/utils/mqParser.ts +99 -0
  299. package/src/utils/styles.ts +62 -102
  300. package/src/utils/withPlugins.ts +13 -0
  301. package/lib/commonjs/UnistylesTheme.js +0 -21
  302. package/lib/commonjs/UnistylesTheme.js.map +0 -1
  303. package/lib/commonjs/createUnistyles.js +0 -57
  304. package/lib/commonjs/createUnistyles.js.map +0 -1
  305. package/lib/commonjs/hooks/useDimensions.js +0 -10
  306. package/lib/commonjs/hooks/useDimensions.js.map +0 -1
  307. package/lib/commonjs/hooks/useDimensions.web.js +0 -34
  308. package/lib/commonjs/hooks/useDimensions.web.js.map +0 -1
  309. package/lib/commonjs/types/mediaQueries.js +0 -2
  310. package/lib/commonjs/utils/common.js +0 -18
  311. package/lib/commonjs/utils/common.js.map +0 -1
  312. package/lib/commonjs/utils/mediaQueries.js +0 -189
  313. package/lib/commonjs/utils/mediaQueries.js.map +0 -1
  314. package/lib/commonjs/utils/normalizeStyles.js +0 -10
  315. package/lib/commonjs/utils/normalizeStyles.js.map +0 -1
  316. package/lib/commonjs/utils/normalizeStyles.web.js.map +0 -1
  317. package/lib/commonjs/utils/normalizer.js.map +0 -1
  318. package/lib/module/UnistylesTheme.js +0 -12
  319. package/lib/module/UnistylesTheme.js.map +0 -1
  320. package/lib/module/createUnistyles.js +0 -50
  321. package/lib/module/createUnistyles.js.map +0 -1
  322. package/lib/module/hooks/useDimensions.js +0 -3
  323. package/lib/module/hooks/useDimensions.js.map +0 -1
  324. package/lib/module/hooks/useDimensions.web.js +0 -27
  325. package/lib/module/hooks/useDimensions.web.js.map +0 -1
  326. package/lib/module/types/mediaQueries.js +0 -2
  327. package/lib/module/utils/common.js +0 -10
  328. package/lib/module/utils/common.js.map +0 -1
  329. package/lib/module/utils/mediaQueries.js +0 -176
  330. package/lib/module/utils/mediaQueries.js.map +0 -1
  331. package/lib/module/utils/normalizeStyles.js +0 -3
  332. package/lib/module/utils/normalizeStyles.js.map +0 -1
  333. package/lib/module/utils/normalizeStyles.web.js.map +0 -1
  334. package/lib/module/utils/normalizer.js.map +0 -1
  335. package/lib/typescript/examples/expo/src/App.d.ts +0 -3
  336. package/lib/typescript/examples/expo/src/App.d.ts.map +0 -1
  337. package/lib/typescript/examples/expo/src/examples/Breakpoints.d.ts +0 -3
  338. package/lib/typescript/examples/expo/src/examples/Breakpoints.d.ts.map +0 -1
  339. package/lib/typescript/examples/expo/src/examples/EmptyStyles.d.ts +0 -3
  340. package/lib/typescript/examples/expo/src/examples/EmptyStyles.d.ts.map +0 -1
  341. package/lib/typescript/examples/expo/src/examples/Extreme.d.ts +0 -7
  342. package/lib/typescript/examples/expo/src/examples/Extreme.d.ts.map +0 -1
  343. package/lib/typescript/examples/expo/src/examples/MediaQueries.d.ts +0 -3
  344. package/lib/typescript/examples/expo/src/examples/MediaQueries.d.ts.map +0 -1
  345. package/lib/typescript/examples/expo/src/examples/Memoization.d.ts +0 -3
  346. package/lib/typescript/examples/expo/src/examples/Memoization.d.ts.map +0 -1
  347. package/lib/typescript/examples/expo/src/examples/Minimal.d.ts +0 -3
  348. package/lib/typescript/examples/expo/src/examples/Minimal.d.ts.map +0 -1
  349. package/lib/typescript/examples/expo/src/examples/MinimalWithCreateStyleSheet.d.ts +0 -3
  350. package/lib/typescript/examples/expo/src/examples/MinimalWithCreateStyleSheet.d.ts.map +0 -1
  351. package/lib/typescript/examples/expo/src/examples/Theme.d.ts +0 -3
  352. package/lib/typescript/examples/expo/src/examples/Theme.d.ts.map +0 -1
  353. package/lib/typescript/examples/expo/src/examples/index.d.ts +0 -8
  354. package/lib/typescript/examples/expo/src/examples/index.d.ts.map +0 -1
  355. package/lib/typescript/examples/expo/src/index.d.ts +0 -2
  356. package/lib/typescript/examples/expo/src/index.d.ts.map +0 -1
  357. package/lib/typescript/examples/expo/src/styles/breakpoints.d.ts +0 -8
  358. package/lib/typescript/examples/expo/src/styles/breakpoints.d.ts.map +0 -1
  359. package/lib/typescript/examples/expo/src/styles/index.d.ts +0 -46
  360. package/lib/typescript/examples/expo/src/styles/index.d.ts.map +0 -1
  361. package/lib/typescript/examples/expo/src/styles/theme.d.ts +0 -24
  362. package/lib/typescript/examples/expo/src/styles/theme.d.ts.map +0 -1
  363. package/lib/typescript/src/UnistylesTheme.d.ts +0 -9
  364. package/lib/typescript/src/UnistylesTheme.d.ts.map +0 -1
  365. package/lib/typescript/src/createUnistyles.d.ts +0 -10
  366. package/lib/typescript/src/createUnistyles.d.ts.map +0 -1
  367. package/lib/typescript/src/hooks/useDimensions.d.ts +0 -3
  368. package/lib/typescript/src/hooks/useDimensions.d.ts.map +0 -1
  369. package/lib/typescript/src/hooks/useDimensions.web.d.ts +0 -3
  370. package/lib/typescript/src/hooks/useDimensions.web.d.ts.map +0 -1
  371. package/lib/typescript/src/types/mediaQueries.d.ts +0 -8
  372. package/lib/typescript/src/types/mediaQueries.d.ts.map +0 -1
  373. package/lib/typescript/src/utils/common.d.ts +0 -5
  374. package/lib/typescript/src/utils/common.d.ts.map +0 -1
  375. package/lib/typescript/src/utils/mediaQueries.d.ts +0 -130
  376. package/lib/typescript/src/utils/mediaQueries.d.ts.map +0 -1
  377. package/lib/typescript/src/utils/normalizeStyles.d.ts +0 -2
  378. package/lib/typescript/src/utils/normalizeStyles.d.ts.map +0 -1
  379. package/lib/typescript/src/utils/normalizeStyles.web.d.ts +0 -5
  380. package/lib/typescript/src/utils/normalizeStyles.web.d.ts.map +0 -1
  381. package/lib/typescript/src/utils/normalizer.d.ts.map +0 -1
  382. package/src/UnistylesTheme.tsx +0 -17
  383. package/src/__tests__/createUnistyles.spec.tsx +0 -192
  384. package/src/createUnistyles.ts +0 -70
  385. package/src/hooks/useDimensions.ts +0 -4
  386. package/src/hooks/useDimensions.web.ts +0 -34
  387. package/src/types/mediaQueries.ts +0 -10
  388. package/src/utils/common.ts +0 -12
  389. package/src/utils/mediaQueries.ts +0 -201
  390. package/src/utils/normalizeStyles.ts +0 -2
  391. /package/lib/commonjs/{utils → normalizer}/module.d.js +0 -0
  392. /package/lib/module/{utils → normalizer}/module.d.js +0 -0
  393. /package/lib/typescript/src/{utils → normalizer}/normalizer.d.ts +0 -0
  394. /package/src/{utils → normalizer}/module.d.ts +0 -0
@@ -1,2 +1,5 @@
1
- export { useDimensions } from './useDimensions';
1
+ export { useInitialTheme } from './useInitialTheme';
2
+ export { useUnistyles } from './useUnistyles';
3
+ export { useVariants } from './useVariants';
4
+ export { useCSS } from './useCSS';
2
5
  //# 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;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { ReactNativeStyleSheet } from '../types';
2
+ export declare const useCSS: <T>(stylesheet: ReactNativeStyleSheet<T>) => void;
3
+ //# sourceMappingURL=useCSS.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCSS.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useCSS.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAGrD,eAAO,MAAM,MAAM,mDA6ClB,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { ReactNativeStyleSheet } from '../types';
2
+ export declare const useCSS: <T>(_stylesheet: ReactNativeStyleSheet<T>) => void;
3
+ //# sourceMappingURL=useCSS.native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCSS.native.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useCSS.native.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAErD,eAAO,MAAM,MAAM,gDAA+C,IAAU,CAAA"}
@@ -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,14 @@
1
+ export declare const useUnistyles: () => {
2
+ plugins: string[];
3
+ theme: never;
4
+ layout: {
5
+ breakpoint: keyof import("..").UnistylesBreakpoints;
6
+ orientation: "landscape" | "portrait";
7
+ screenSize: {
8
+ width: number;
9
+ height: number;
10
+ };
11
+ };
12
+ contentSizeCategory: import("../common").IOSContentSizeCategory | import("../common").AndroidContentSizeCategory;
13
+ };
14
+ //# 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;;;;;;;;;;;;CAuDxB,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { Optional } from '../types';
2
+ export declare const useVariants: (variantsMap?: Record<string, Optional<string>>) => Optional<Record<string, Optional<string>>>;
3
+ //# sourceMappingURL=useVariants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useVariants.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useVariants.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAExC,eAAO,MAAM,WAAW,iBAAkB,OAAO,MAAM,EAAE,SAAS,MAAM,CAAC,CAAC,+CAMzE,CAAA"}
@@ -1,3 +1,77 @@
1
- export { UnistylesTheme } from './UnistylesTheme';
2
- export { createUnistyles } from './createUnistyles';
1
+ import { mq } from './utils';
2
+ import { useInitialTheme } from './hooks';
3
+ import type { UnistylesPlugin } from './types';
4
+ import type { UnistylesThemes, UnistylesBreakpoints } from './global';
5
+ import { ScreenOrientation, AndroidContentSizeCategory, IOSContentSizeCategory } from './common';
6
+ import { useStyles } from './useStyles';
7
+ import { createStyleSheet } from './createStyleSheet';
8
+ /**
9
+ * Utility to interact with the Unistyles
10
+ * (should be called only once)
11
+ */
12
+ declare const UnistylesRegistry: {
13
+ /**
14
+ * Register themes to be used in the app
15
+ * @param themes - Key value pair of themes
16
+ */
17
+ addThemes: (themes: UnistylesThemes) => {
18
+ addBreakpoints: (breakpoints: UnistylesBreakpoints) => {
19
+ addThemes: any;
20
+ addConfig: (config: import("./types").UnistylesConfig) => {
21
+ addBreakpoints: any;
22
+ addThemes: any;
23
+ };
24
+ };
25
+ addConfig: (config: import("./types").UnistylesConfig) => {
26
+ addBreakpoints: (breakpoints: UnistylesBreakpoints) => {
27
+ addThemes: any;
28
+ addConfig: any;
29
+ };
30
+ addThemes: any;
31
+ };
32
+ };
33
+ /**
34
+ * Register breakpoints to be used in the app
35
+ * @param breakpoints - Key value pair of breakpoints
36
+ */
37
+ addBreakpoints: (breakpoints: UnistylesBreakpoints) => {
38
+ addThemes: (themes: UnistylesThemes) => {
39
+ addBreakpoints: any;
40
+ addConfig: (config: import("./types").UnistylesConfig) => {
41
+ addBreakpoints: any;
42
+ addThemes: any;
43
+ };
44
+ };
45
+ addConfig: (config: import("./types").UnistylesConfig) => {
46
+ addBreakpoints: any;
47
+ addThemes: (themes: UnistylesThemes) => {
48
+ addBreakpoints: any;
49
+ addConfig: any;
50
+ };
51
+ };
52
+ };
53
+ /**
54
+ * Register additional config to customize the Unistyles
55
+ * @param config - Key value pair of config
56
+ */
57
+ addConfig: (config: import("./types").UnistylesConfig) => {
58
+ addBreakpoints: (breakpoints: UnistylesBreakpoints) => {
59
+ addThemes: (themes: UnistylesThemes) => {
60
+ addBreakpoints: any;
61
+ addConfig: any;
62
+ };
63
+ addConfig: any;
64
+ };
65
+ addThemes: (themes: UnistylesThemes) => {
66
+ addBreakpoints: (breakpoints: UnistylesBreakpoints) => {
67
+ addThemes: any;
68
+ addConfig: any;
69
+ };
70
+ addConfig: any;
71
+ };
72
+ };
73
+ };
74
+ declare const UnistylesRuntime: import("./core").UnistylesRuntime;
75
+ export { mq, useStyles, useInitialTheme, createStyleSheet, ScreenOrientation, AndroidContentSizeCategory, IOSContentSizeCategory, UnistylesRegistry, UnistylesRuntime };
76
+ export type { UnistylesThemes, UnistylesBreakpoints, UnistylesPlugin };
3
77
  //# 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,MAAM,SAAS,CAAA;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AACrE,OAAO,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAChG,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD;;;GAGG;AACH,QAAA,MAAM,iBAAiB;IACnB;;;OAGG;;;;;;;;;;;;;;;;;IAEH;;;OAGG;;;;;;;;;;;;;;;;;IAEH;;;OAGG;;;;;;;;;;;;;;;;;CAEN,CAAA;AAED,QAAA,MAAM,gBAAgB,mCAAoB,CAAA;AAE1C,OAAO,EACH,EAAE,EACF,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,0BAA0B,EAC1B,sBAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EACnB,CAAA;AAED,YAAY,EACR,eAAe,EACf,oBAAoB,EACpB,eAAe,EAClB,CAAA"}
@@ -0,0 +1,3 @@
1
+ export { normalizeStyle } from './normalizeStyle';
2
+ export { preprocessor, normalizeNumericValue, normalizeColor } from './normalizer';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/normalizer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { RNStyle } from '../types';
2
+ export declare const normalizeStyle: <T extends RNStyle>(style: T) => T;
3
+ //# sourceMappingURL=normalizeStyle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalizeStyle.d.ts","sourceRoot":"","sources":["../../../../src/normalizer/normalizeStyle.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAoE,OAAO,EAAE,MAAM,UAAU,CAAA;AAuDzG,eAAO,MAAM,cAAc,oCAwB1B,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalizer.d.ts","sourceRoot":"","sources":["../../../../src/normalizer/normalizer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAY,MAAM,UAAU,CAAA;AAE3E,KAAK,YAAY,GAAG;IAChB,qBAAqB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAAC;IACjD,oBAAoB,CAAC,KAAK,EAAE,QAAQ,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC;IACzD,oBAAoB,CAAC,UAAU,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC;CAClE,CAAA;AAED,eAAO,MAAM,cAAc,UAAW,MAAM,YAAW,MAAM,WAyB5D,CAAA;AAED,eAAO,MAAM,qBAAqB,UAAW,MAAM,oBAAiC,CAAA;AAyDpF,eAAO,MAAM,YAAY,EAAE,YAI1B,CAAA"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=normalizer.macos.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalizer.macos.d.ts","sourceRoot":"","sources":["../../../../src/normalizer/normalizer.macos.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import type { UnistylesPlugin } from '../types';
2
+ export declare const cssMediaQueriesPlugin: UnistylesPlugin;
3
+ //# sourceMappingURL=cssMediaQueriesPlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cssMediaQueriesPlugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/cssMediaQueriesPlugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,eAAO,MAAM,qBAAqB,EAAE,eAGnC,CAAA"}
@@ -0,0 +1,3 @@
1
+ export { normalizeWebStylesPlugin } from './normalizeWebStylesPlugin';
2
+ export { cssMediaQueriesPlugin } from './cssMediaQueriesPlugin';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { UnistylesPlugin } from '../types';
2
+ export declare const normalizeWebStylesPlugin: UnistylesPlugin;
3
+ //# sourceMappingURL=normalizeWebStylesPlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalizeWebStylesPlugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/normalizeWebStylesPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAG/C,eAAO,MAAM,wBAAwB,EAAE,eAGtC,CAAA"}
@@ -1,19 +1,28 @@
1
- import type { MediaQueries } from './mediaQueries';
2
- export type Breakpoints = Record<string, number>;
3
- export type SortedBreakpointEntries<B extends Breakpoints> = [[keyof B & string, number]];
4
- export type ScreenSize = {
5
- width: number;
6
- height: number;
7
- };
8
- export type CreateStylesFactory<ST, Theme> = (theme: Theme) => ST;
9
- 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];
12
- };
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>;
15
- } : {
16
- [K in keyof T]: RemoveKeysWithPrefix<T[K], B>;
1
+ import type { ColorValue, OpaqueColorValue } from 'react-native';
2
+ import type { UnistylesTheme } from '../types';
3
+ import type { BreakpointsOrMediaQueries, ToDeepUnistyles } from './stylesheet';
4
+ import type { TransformStyles } from './core';
5
+ type ExtractTransformArray<T> = T extends object ? {
6
+ [K in keyof T]: ExtractBreakpoints<T[K]>;
7
+ } : never;
8
+ type ExtractBreakpoints<T> = T extends object ? keyof T extends BreakpointsOrMediaQueries ? T[keyof T] : T extends Array<ToDeepUnistyles<TransformStyles>> ? Array<ExtractTransformArray<T[number]>> : {
9
+ [K in keyof T]: ExtractBreakpoints<T[K]>;
17
10
  } : T;
11
+ type ParseNestedObject<T> = T extends (...args: infer A) => infer R ? (...args: A) => ParseNestedObject<R> : T extends object ? T extends {
12
+ variants: infer R;
13
+ } ? ParseVariants<FlattenVariants<R>> & ParseNestedObject<Omit<T, 'variants'>> : {
14
+ [K in keyof T]: T[K] extends object ? T[K] extends OpaqueColorValue ? ColorValue : ExtractBreakpoints<T[K]> : T[K];
15
+ } : T;
16
+ type FlattenVariants<T> = T extends object ? {
17
+ [K in keyof T]: T[K] extends object ? {
18
+ [key in keyof T[K]]: T[K][key] extends object ? ParseNestedObject<T[K][key]> : never;
19
+ } : never;
20
+ } : never;
21
+ type ParseVariants<T> = T extends object ? T[keyof T] extends object ? UnionToIntersection<ParseVariants<T[keyof T]>> : T : T;
22
+ type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
23
+ type ParseStyleKeys<T> = T extends object ? {
24
+ [K in keyof T]: ParseNestedObject<T[K]>;
25
+ } : never;
26
+ export type ReactNativeStyleSheet<T> = T extends (theme: UnistylesTheme) => infer R ? ParseStyleKeys<R> : ParseStyleKeys<T>;
18
27
  export {};
19
28
  //# 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,GAAG,IAAI,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC,GACnC,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,kBAAkB,CAAC,CAAC,EA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@@
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,18 @@
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';
5
- type ShadowOffset = {
3
+ import type { UnistylesBreakpoints, UnistylesThemes } from '../global';
4
+ export type ShadowOffset = {
6
5
  width: number;
7
6
  height: number;
8
7
  };
9
- 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
- };
15
- type UniStyle<V, B> = {
16
- [innerKey in keyof B]?: V;
17
- } | {
18
- [innerKey in MediaQueries]?: V;
19
- } | V;
20
- type DeepUniStyle<T, B> = {
21
- [K in keyof T]?: UniStyle<T[K], B>;
22
- };
23
- 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>;
8
+ export type TransformStyles = PerpectiveTransform & RotateTransform & RotateXTransform & RotateYTransform & RotateZTransform & ScaleTransform & ScaleXTransform & ScaleYTransform & TranslateXTransform & TranslateYTransform & SkewXTransform & SkewYTransform & MatrixTransform;
9
+ export type ScreenSize = {
10
+ width: number;
11
+ height: number;
30
12
  };
31
- export {};
13
+ export type RNStyle = ViewStyle & TextStyle & ImageStyle;
14
+ export type RNValue = ViewStyle[keyof ViewStyle] | TextStyle[keyof TextStyle] | ImageStyle[keyof ImageStyle];
15
+ export type NestedStyle = Record<keyof UnistylesBreakpoints | symbol, RNValue>;
16
+ export type NestedStylePairs = Array<[keyof UnistylesBreakpoints | symbol, RNValue]>;
17
+ export type UnistylesTheme = UnistylesThemes[keyof UnistylesThemes];
32
18
  //# 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;I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e,CAAA;AAErB,MAAM,MAAM,UAAU,GAAG;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAA;AACxD,MAAM,MAAM,OAAO,GAAG,SAAS,CAAC,MAAM,SAAS,CAAC,GAAG,SAAS,CAAC,MAAM,SAAS,CAAC,GAAG,UAAU,CAAC,MAAM,UAAU,CAAC,CAAA;AAC5G,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,EAAE,OAAO,CAAC,CAAA;AAC9E,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,CAAC,MAAM,oBAAoB,GAAG,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;AACpF,MAAM,MAAM,cAAc,GAAG,eAAe,CAAC,MAAM,eAAe,CAAC,CAAA"}
@@ -1,4 +1,9 @@
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 { NestedStylePairs, UnistylesTheme, ScreenSize, NestedStyle, RNValue, RNStyle } from './core';
5
+ export type { StyleSheetWithSuperPowers, StyleSheet, AllAvailableKeys } from './stylesheet';
6
+ export type { ReactNativeStyleSheet } from './breakpoints';
7
+ export type { ExtractVariantNames } from './variants';
8
+ export type { UnistylesPlugin } from './plugin';
4
9
  //# 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,EACR,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,WAAW,EACX,OAAO,EACP,OAAO,EACV,MAAM,QAAQ,CAAA;AACf,YAAY,EAAE,yBAAyB,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC3F,YAAY,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAC1D,YAAY,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AACrD,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA"}
@@ -0,0 +1,7 @@
1
+ import type { RNStyle } from './core';
2
+ import type { UnistylesRuntime } from '../core';
3
+ export type UnistylesPlugin = {
4
+ name: string;
5
+ onParsedStyle?: (styleKey: string, style: RNStyle, runtime: UnistylesRuntime) => RNStyle;
6
+ };
7
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/types/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AACrC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE/C,MAAM,MAAM,eAAe,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAA;CAC3F,CAAA"}
@@ -0,0 +1,40 @@
1
+ import type { ImageStyle, TextStyle, ViewStyle } from 'react-native';
2
+ import type { ShadowOffset, TransformStyles, UnistylesTheme } from './core';
3
+ import type { UnistylesBreakpoints } from '../global';
4
+ type NestedKeys = 'shadowOffset' | 'transform' | 'textShadowOffset';
5
+ type UnistyleView = Omit<ViewStyle, NestedKeys>;
6
+ type UnistyleText = Omit<TextStyle, NestedKeys>;
7
+ type UnistyleImage = Omit<ImageStyle, NestedKeys>;
8
+ type UnistyleNestedStyles = {
9
+ shadowOffset?: ToDeepUnistyles<ShadowOffset>;
10
+ textShadowOffset?: ToDeepUnistyles<ShadowOffset>;
11
+ transform?: Array<ToDeepUnistyles<TransformStyles>>;
12
+ };
13
+ type Variants = {
14
+ variants?: {
15
+ [variantName: string]: {
16
+ [variant: string]: Omit<UnistylesValues, 'variants'>;
17
+ };
18
+ };
19
+ };
20
+ export type ToDeepUnistyles<T> = {
21
+ [K in keyof T]?: T[K] | {
22
+ [key in BreakpointsOrMediaQueries]?: T[K];
23
+ };
24
+ };
25
+ type AllAvailableStyles = UnistyleView & UnistyleText & UnistyleImage & UnistyleNestedStyles;
26
+ export type AllAvailableKeys = keyof (UnistyleView & UnistyleText & UnistyleImage);
27
+ export type BreakpointsOrMediaQueries = keyof UnistylesBreakpoints | symbol;
28
+ export type UnistylesValues = {
29
+ [propName in AllAvailableKeys]?: AllAvailableStyles[propName] | {
30
+ [key in BreakpointsOrMediaQueries]?: AllAvailableStyles[propName];
31
+ };
32
+ } & Variants & {
33
+ [propName in NestedKeys]?: UnistyleNestedStyles[propName];
34
+ };
35
+ export type StyleSheet = {
36
+ [styleName: string]: UnistylesValues | ((...args: any) => UnistylesValues);
37
+ };
38
+ export type StyleSheetWithSuperPowers = ((theme: UnistylesTheme) => StyleSheet) | StyleSheet;
39
+ export {};
40
+ //# sourceMappingURL=stylesheet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stylesheet.d.ts","sourceRoot":"","sources":["../../../../src/types/stylesheet.ts"],"names":[],"mappings":"AAAA,OAAO,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,YAAY,GAAG,aAAa,CAAC,CAAA;AAClF,MAAM,MAAM,yBAAyB,GAAG,MAAM,oBAAoB,GAAG,MAAM,CAAA;AAE3E,MAAM,MAAM,eAAe,GAAG;KACzB,QAAQ,IAAI,gBAAgB,CAAC,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC,GAAG;SAC3D,GAAG,IAAI,yBAAyB,CAAC,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC;KACpE;CACJ,GAAG,QAAQ,GAAG;KACV,QAAQ,IAAI,UAAU,CAAC,CAAC,EAAE,oBAAoB,CAAC,QAAQ,CAAC;CAC5D,CAAA;AAED,MAAM,MAAM,UAAU,GAAG;IACrB,CAAC,SAAS,EAAE,MAAM,GAAG,eAAe,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,eAAe,CAAC,CAAA;CAC7E,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,EAAE,cAAc,KAAK,UAAU,CAAC,GAAG,UAAU,CAAA"}
@@ -0,0 +1,53 @@
1
+ import { UnistylesEventType, ScreenOrientation, IOSContentSizeCategory, AndroidContentSizeCategory } from '../common';
2
+ import type { UnistylesThemes, UnistylesBreakpoints } from '../global';
3
+ import type { ScreenSize } from './core';
4
+ import type { UnistylesPlugin } from './plugin';
5
+ export type ColorSchemeName = 'light' | 'dark' | 'unspecified';
6
+ export type UnistylesConfig = {
7
+ adaptiveThemes?: boolean;
8
+ initialTheme?: keyof UnistylesThemes;
9
+ plugins?: Array<UnistylesPlugin>;
10
+ experimentalCSSMediaQueries?: boolean;
11
+ };
12
+ export type UnistylesBridge = {
13
+ screenWidth: number;
14
+ screenHeight: number;
15
+ enabledPlugins: Array<string>;
16
+ hasAdaptiveThemes: boolean;
17
+ themeName: keyof UnistylesThemes;
18
+ breakpoint: keyof UnistylesBreakpoints;
19
+ colorScheme: ColorSchemeName;
20
+ contentSizeCategory: IOSContentSizeCategory | AndroidContentSizeCategory;
21
+ sortedBreakpointPairs: Array<[keyof UnistylesBreakpoints, UnistylesBreakpoints[keyof UnistylesBreakpoints]]>;
22
+ themes: Array<keyof UnistylesThemes>;
23
+ useBreakpoints(breakpoints: UnistylesBreakpoints): void;
24
+ useTheme(name: keyof UnistylesThemes): void;
25
+ useAdaptiveThemes(enable: boolean): void;
26
+ addPlugin(pluginName: string, notify: boolean): void;
27
+ removePlugin(pluginName: string): void;
28
+ };
29
+ export type UnistylesThemeEvent = {
30
+ type: UnistylesEventType.Theme;
31
+ payload: {
32
+ themeName: keyof UnistylesThemes;
33
+ };
34
+ };
35
+ export type UnistylesMobileLayoutEvent = {
36
+ type: UnistylesEventType.Layout;
37
+ payload: {
38
+ screen: ScreenSize;
39
+ breakpoint: keyof UnistylesBreakpoints;
40
+ orientation: typeof ScreenOrientation[keyof typeof ScreenOrientation];
41
+ };
42
+ };
43
+ export type UnistylesPluginEvent = {
44
+ type: UnistylesEventType.Plugin;
45
+ };
46
+ export type UnistylesDynamicTypeSizeEvent = {
47
+ type: UnistylesEventType.DynamicTypeSize;
48
+ payload: {
49
+ contentSizeCategory: IOSContentSizeCategory | AndroidContentSizeCategory;
50
+ };
51
+ };
52
+ export type UnistylesEvents = UnistylesThemeEvent | UnistylesMobileLayoutEvent | UnistylesPluginEvent | UnistylesDynamicTypeSizeEvent;
53
+ //# 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,kBAAkB,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAA;AACrH,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACxC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,MAA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ACJ,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG;IACrC,IAAI,EAAE,kBAAkB,CAAC,MAAM,CAAC;IAChC,OAAO,EAAE;QACL,MAAM,EAAE,UAAU,CAAC;QACnB,UAAU,EAAE,MAAM,oBAAoB,CAAC;QACvC,WAAW,EAAE,OAAO,iBAAiB,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAA;KACxE,CAAA;CACJ,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IAC/B,IAAI,EAAE,kBAAkB,CAAC,MAAM,CAAA;CAClC,CAAA;AAED,MAAM,MAAM,6BAA6B,GAAG;IACxC,IAAI,EAAE,kBAAkB,CAAC,eAAe,CAAC;IACzC,OAAO,EAAE;QACL,mBAAmB,EAAE,sBAAsB,GAAG,0BAA0B,CAAA;KAC3E,CAAA;CACJ,CAAA;AAED,MAAM,MAAM,eAAe,GAAG,mBAAmB,GAAG,0BAA0B,GAAG,oBAAoB,GAAG,6BAA6B,CAAA"}
@@ -0,0 +1,14 @@
1
+ export type ExtractVariantNames<T> = T extends (...args: any) => infer R ? ExtractVariantKeys<R> : ExtractVariantKeys<T>;
2
+ type ExtractVariantKeys<T> = T extends object ? ExtractVariant<T[keyof T]> : never;
3
+ type ExtractSubVariantKeys<T> = T extends object ? keyof Omit<T, 'default'> | undefined : never;
4
+ type ExtractVariant<T> = T extends (...args: any) => infer R ? R extends {
5
+ variants: infer V;
6
+ } ? {
7
+ [key in keyof V]?: ExtractSubVariantKeys<V[key]>;
8
+ } : never : T extends {
9
+ variants: infer V;
10
+ } ? {
11
+ [key in keyof V]?: ExtractSubVariantKeys<V[key]>;
12
+ } : never;
13
+ export {};
14
+ //# sourceMappingURL=variants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"variants.d.ts","sourceRoot":"","sources":["../../../../src/types/variants.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,MAAM,CAAC,GAClE,kBAAkB,CAAC,CAAC,CAAC,GACrB,kBAAkB,CAAC,CAAC,CAAC,CAAA;AAE3B,KAAK,kBAAkB,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GACvC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAC1B,KAAK,CAAA;AAEX,KAAK,qBAAqB,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAC1C,MAAM,IAAI,CAAC,CAAC,EAAE,SAAS,CAAC,GAAG,SAAS,GACpC,KAAK,CAAA;AAEX,KAAK,cAAc,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,MAAM,CAAC,GACtD,CAAC,SAAS;IAAE,QAAQ,EAAE,MAAM,CAAC,CAAA;CAAE,GAC3B;KAAG,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;CAAE,GACpD,KAAK,GACT,CAAC,SAAS;IAAE,QAAQ,EAAE,MAAM,CAAC,CAAA;CAAE,GAC3B;KAAG,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;CAAE,GACpD,KAAK,CAAA"}
@@ -0,0 +1,16 @@
1
+ import type { UnistylesBreakpoints } from './global';
2
+ import type { ExtractVariantNames, ReactNativeStyleSheet, StyleSheetWithSuperPowers, UnistylesTheme } from './types';
3
+ type ParsedStylesheet<ST extends StyleSheetWithSuperPowers> = {
4
+ theme: UnistylesTheme;
5
+ breakpoint: keyof UnistylesBreakpoints;
6
+ styles: ReactNativeStyleSheet<ST>;
7
+ };
8
+ /**
9
+ * Hook that enables all the features of Unistyles
10
+ * @param stylesheet - The stylesheet with superpowers to be used
11
+ * @param variantsMap - The map of variants to be used
12
+ * @returns - The theme, current breakpoint and RN compatible styles
13
+ */
14
+ export declare const useStyles: <ST extends StyleSheetWithSuperPowers>(stylesheet?: ST | undefined, variantsMap?: ExtractVariantNames<ST> | undefined) => ParsedStylesheet<ST>;
15
+ export {};
16
+ //# sourceMappingURL=useStyles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStyles.d.ts","sourceRoot":"","sources":["../../../src/useStyles.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AACpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAIpH,KAAK,gBAAgB,CAAC,EAAE,SAAS,yBAAyB,IAAI;IAC1D,KAAK,EAAE,cAAc,CAAC;IACtB,UAAU,EAAE,MAAM,oBAAoB,CAAC;IACvC,MAAM,EAAE,qBAAqB,CAAC,EAAE,CAAC,CAAA;CACpC,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,SAAS,gJAsCrB,CAAA"}
@@ -1,63 +1,3 @@
1
- import type { Breakpoints, ScreenSize, SortedBreakpointEntries } from '../types';
2
- /**
3
- * Sorts the breakpoints object based on its numeric values in ascending order and validates them.
4
- *
5
- * This function takes an object where keys represent breakpoint names and values are numeric.
6
- * It returns a new object with the same keys but sorted based on their corresponding numeric values.
7
- * Additionally, it validates that:
8
- * 1. The first breakpoint starts with a value of 0.
9
- * 2. No duplicate breakpoint values exist.
10
- *
11
- * If the validation fails, appropriate error messages are logged to the console.
12
- *
13
- * @template B - An object type where keys are strings and values are numbers.
14
- * @param {B} breakpoints - The breakpoints object to be sorted and validated.
15
- * @returns {B} A new object with sorted and validated breakpoints.
16
- *
17
- * @example
18
- * const input = { md: 768, lg: 1024, sm: 0 }
19
- * sortAndValidateBreakpoints(input) // returns { sm: 0, md: 768, lg: 1024 }
20
- */
21
- export declare const sortAndValidateBreakpoints: <B extends Breakpoints>(breakpoints: B) => B;
22
- /**
23
- * Determines the appropriate breakpoint key for a given screen width based on provided breakpoints.
24
- *
25
- * This function takes a screen width and an object of breakpoints. It returns the key of the breakpoint
26
- * that the screen width falls into. The breakpoints are assumed to be sorted in ascending order.
27
- *
28
- * @template B - An object type where keys are strings and values are numbers representing screen widths.
29
- * @param {number} width - The screen width to determine the breakpoint for.
30
- * @param breakpointEntries - sorted pairs of breakpoints
31
- * @returns {keyof B & string} The key of the breakpoint that the screen width falls into.
32
- *
33
- * @example
34
- * const breakpoints = { sm: 0, md: 768, lg: 1024 }
35
- * getBreakpointFromScreenWidth(800, breakpoints) // returns 'md'
36
- */
37
- export declare const getBreakpointFromScreenWidth: <B extends Breakpoints>(width: number, breakpointEntries: SortedBreakpointEntries<B>) => keyof B & string;
38
- /**
39
- * Retrieves the value associated with a given breakpoint or custom media query based on the provided screen size.
40
- *
41
- * The function first checks for custom media queries. If a matching custom media query is found, its associated value is returned.
42
- * If no custom media query matches, the function then checks for a direct breakpoint match.
43
- * If there's no direct breakpoint match, the function simulates CSS cascading to find the closest matching breakpoint.
44
- *
45
- * @template B - An object type where keys represent breakpoint names and values represent breakpoint values.
46
- *
47
- * @param {Record<keyof B & string, string | number>} value - An object containing values associated with breakpoints or custom media queries.
48
- * @param {keyof B & string} breakpoint - The breakpoint name to check against.
49
- * @param {ScreenSize} screenSize - An object representing the screen size to be checked against the media queries.
50
- * @param breakpointPairs - sorted pairs of breakpoints
51
- *
52
- * @returns {string | number | undefined} Returns the value associated with the matching breakpoint or custom media query, or `undefined` if no match is found.
53
- *
54
- * @example
55
- *
56
- * const values = { ':w[200]': 'value1', sm: 'value2', md: 'value3' }
57
- * const screenSize = { width: 250, height: 400 }
58
- * const breakpoints = { sm: 300, md: 600, lg: 900 }
59
- *
60
- * getValueForBreakpoint(values, 'sm', screenSize, breakpoints); // 'value1'
61
- */
62
- export declare const getValueForBreakpoint: <B extends Breakpoints>(value: Record<keyof B & string, string | number | undefined>, breakpoint: keyof B & string, screenSize: ScreenSize, breakpointPairs: SortedBreakpointEntries<B>) => string | number | undefined;
1
+ import type { Optional, RNValue } from '../types';
2
+ export declare const getValueForBreakpoint: (value: Record<string, RNValue>) => Optional<RNValue>;
63
3
  //# sourceMappingURL=breakpoints.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"breakpoints.d.ts","sourceRoot":"","sources":["../../../../src/utils/breakpoints.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;AAGhF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,0BAA0B,8CAuBtC,CAAA;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,4BAA4B,iCAAkC,MAAM,oEAchF,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,qBAAqB,kIAGlB,UAAU,kDAEvB,MAAM,GAAG,MAAM,GAAG,SA+BpB,CAAA"}
1
+ {"version":3,"file":"breakpoints.d.ts","sourceRoot":"","sources":["../../../../src/utils/breakpoints.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAKjD,eAAO,MAAM,qBAAqB,UAAW,OAAO,MAAM,EAAE,OAAO,CAAC,KAAG,SAAS,OAAO,CAqCtF,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { RNStyle } from '../types';
2
+ import type { UnistylesRuntime } from '../core';
3
+ export declare const createMediaQueryForStyles: (styles: RNStyle, runtime: UnistylesRuntime) => RNStyle;
4
+ //# sourceMappingURL=cssMediaQuery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cssMediaQuery.d.ts","sourceRoot":"","sources":["../../../../src/utils/cssMediaQuery.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAW,MAAM,UAAU,CAAA;AAEhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE/C,eAAO,MAAM,yBAAyB,WAAY,OAAO,WAAW,gBAAgB,KAAG,OA8BtF,CAAA"}