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 +0,0 @@
1
- {"version":3,"names":["useContext","useMemo","StyleSheet","UnistylesContext","useDimensions","getBreakpointFromScreenWidth","proxifyFunction","parseStyle","sortAndValidateBreakpoints","createUnistyles","breakpoints","sortedBreakpoints","sortedBreakpointEntries","Object","entries","createStyleSheet","styles","useStyles","stylesheet","theme","screenSize","breakpoint","width","parsedStyles","dynamicStyleSheet","reduce","acc","_ref","key","value","style","create"],"sourceRoot":"../../src","sources":["createUnistyles.ts"],"mappings":"AAAA,SAASA,UAAU,EAAEC,OAAO,QAAQ,OAAO;AAC3C,SAASC,UAAU,QAAQ,cAAc;AASzC,SAASC,gBAAgB,QAAQ,kBAAkB;AACnD,SAASC,aAAa,QAAQ,SAAS;AACvC,SAASC,4BAA4B,EAAEC,eAAe,EAAEC,UAAU,EAAEC,0BAA0B,QAAQ,SAAS;AAE/G,OAAO,MAAMC,eAAe,GAAmCC,WAAc,IAAK;EAC9E,MAAMC,iBAAiB,GAAGH,0BAA0B,CAACE,WAAW,CAAC;EACjE,MAAME,uBAAuB,GAAGC,MAAM,CACjCC,OAAO,CAACH,iBAAiB,CAA+B;EAE7D,OAAO;IACHI,gBAAgB,EAAyCC,MAAqF,IAAY;MACtJ,IAAI,OAAOA,MAAM,KAAK,UAAU,EAAE;QAC9B,OAAOA,MAAM;MACjB;MAEA,OAAOA,MAAM;IACjB,CAAC;IACDC,SAAS,EAAwCC,UAA4C,IAAK;MAC9F,MAAMC,KAAK,GAAGnB,UAAU,CAACG,gBAAgB,CAAM;MAC/C,MAAMiB,UAAU,GAAGhB,aAAa,CAAC,CAAC;MAClC,MAAMiB,UAAU,GAAGhB,4BAA4B,CAAIe,UAAU,CAACE,KAAK,EAAEV,uBAAuB,CAAC;MAE7F,IAAI,CAACM,UAAU,EAAE;QACb,OAAO;UACHC,KAAK;UACLE,UAAU;UACVL,MAAM,EAAE,CAAC;QACb,CAAC;MACL;MAEA,MAAMO,YAAY,GAAGtB,OAAO,CAAC,MAAM,OAAOiB,UAAU,KAAK,UAAU,GAC7DA,UAAU,CAACC,KAAK,CAAC,GACjBD,UAAU,EAAE,CAACC,KAAK,EAAED,UAAU,CAAC,CAAC;MAEtC,MAAMM,iBAAiB,GAAGvB,OAAO,CAAC,MAAMY,MAAM,CACzCC,OAAO,CAACS,YAAY,CAAC,CACrBE,MAAM,CAAC,CAACC,GAAG,EAAAC,IAAA,KAAmB;QAAA,IAAjB,CAACC,GAAG,EAAEC,KAAK,CAAC,GAAAF,IAAA;QACtB,MAAMG,KAAK,GAAGD,KAAiC;QAE/C,IAAI,OAAOA,KAAK,KAAK,UAAU,EAAE;UAC7B,OAAO;YACH,GAAGH,GAAG;YACN,CAACE,GAAG,GAAGtB,eAAe,CAAIuB,KAAK,EAAER,UAAU,EAAED,UAAU,EAAER,uBAAuB;UACpF,CAAC;QACL;QAEA,OAAOV,UAAU,CAAC6B,MAAM,CAAC;UACrB,GAAGL,GAAG;UACN,CAACE,GAAG,GAAGrB,UAAU,CAAQuB,KAAK,EAAET,UAAU,EAAED,UAAU,EAAER,uBAAuB;QACnF,CAAC,CAAC;MACN,CAAC,EAAE,CAAC,CAAO,CAAC,EAAE,CAACS,UAAU,EAAED,UAAU,EAAEG,YAAY,CAAC,CAAC;MAEzD,OAAO;QACHJ,KAAK;QACLE,UAAU;QACVL,MAAM,EAAEQ;MACZ,CAAC;IACL;EACJ,CAAC;AACL,CAAC"}
@@ -1,3 +0,0 @@
1
- import { useWindowDimensions } from 'react-native';
2
- export const useDimensions = () => useWindowDimensions();
3
- //# sourceMappingURL=useDimensions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useWindowDimensions","useDimensions"],"sourceRoot":"../../../src","sources":["hooks/useDimensions.ts"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,cAAc;AAGlD,OAAO,MAAMC,aAAa,GAAGA,CAAA,KAAkBD,mBAAmB,CAAC,CAAC"}
@@ -1,27 +0,0 @@
1
- import { useEffect, useLayoutEffect, useRef, useState } from 'react';
2
- export const useDimensions = () => {
3
- const timerRef = useRef();
4
- const [screenSize, setScreenSize] = useState({});
5
- useLayoutEffect(() => {
6
- setScreenSize({
7
- width: window.innerWidth,
8
- height: window.innerHeight
9
- });
10
- }, []);
11
- useEffect(() => {
12
- const handleResize = () => {
13
- clearTimeout(timerRef.current);
14
- timerRef.current = setTimeout(() => setScreenSize({
15
- width: window.innerWidth,
16
- height: window.innerHeight
17
- }), 100);
18
- };
19
- window.addEventListener('resize', handleResize);
20
- return () => {
21
- window.removeEventListener('resize', handleResize);
22
- clearTimeout(timerRef.current);
23
- };
24
- }, []);
25
- return screenSize;
26
- };
27
- //# sourceMappingURL=useDimensions.web.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useEffect","useLayoutEffect","useRef","useState","useDimensions","timerRef","screenSize","setScreenSize","width","window","innerWidth","height","innerHeight","handleResize","clearTimeout","current","setTimeout","addEventListener","removeEventListener"],"sourceRoot":"../../../src","sources":["hooks/useDimensions.web.ts"],"mappings":"AAAA,SAASA,SAAS,EAAEC,eAAe,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAGpE,OAAO,MAAMC,aAAa,GAAGA,CAAA,KAAkB;EAC3C,MAAMC,QAAQ,GAAGH,MAAM,CAAgC,CAAC;EACxD,MAAM,CAACI,UAAU,EAAEC,aAAa,CAAC,GAAGJ,QAAQ,CAAa,CAAC,CAAe,CAAC;EAE1EF,eAAe,CAAC,MAAM;IAClBM,aAAa,CAAC;MACVC,KAAK,EAAEC,MAAM,CAACC,UAAU;MACxBC,MAAM,EAAEF,MAAM,CAACG;IACnB,CAAC,CAAC;EACN,CAAC,EAAE,EAAE,CAAC;EAENZ,SAAS,CAAC,MAAM;IACZ,MAAMa,YAAY,GAAGA,CAAA,KAAM;MACvBC,YAAY,CAACT,QAAQ,CAACU,OAAO,CAAC;MAE9BV,QAAQ,CAACU,OAAO,GAAGC,UAAU,CAAC,MAAMT,aAAa,CAAC;QAC9CC,KAAK,EAAEC,MAAM,CAACC,UAAU;QACxBC,MAAM,EAAEF,MAAM,CAACG;MACnB,CAAC,CAAC,EAAE,GAAG,CAAC;IACZ,CAAC;IAEDH,MAAM,CAACQ,gBAAgB,CAAC,QAAQ,EAAEJ,YAAY,CAAC;IAE/C,OAAO,MAAM;MACTJ,MAAM,CAACS,mBAAmB,CAAC,QAAQ,EAAEL,YAAY,CAAC;MAClDC,YAAY,CAACT,QAAQ,CAACU,OAAO,CAAC;IAClC,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOT,UAAU;AACrB,CAAC"}
@@ -1,2 +0,0 @@
1
-
2
- //# sourceMappingURL=mediaQueries.js.map
@@ -1,176 +0,0 @@
1
- /**
2
- * Extracts numeric values from a coded string.
3
- *
4
- * The function is designed to process strings that have a format like "w[100,200]" or "h[300]".
5
- * It removes characters 'w', 'h', '[', and ']' from the input string and then extracts the numbers.
6
- *
7
- * @param {string} codedValue - The input string to extract values from.
8
- * @returns {Array<number>} An array of extracted numbers. Can contain one or two numbers based on the input format.
9
- *
10
- * @example
11
- * extractValues("w[100,200]") // returns [100, 200]
12
- * extractValues("h[300]") // returns [300]
13
- * extractValues("h[,300]") // returns [0,300]
14
- * extractValues("h[100,]") // returns [100]
15
- */
16
- export const extractValues = codedValue => {
17
- const [lh, rh] = codedValue.replace(/[wh[\]]/g, '').split(',');
18
- return rh ? [Number(lh), Number(rh)] : [Number(lh)];
19
- };
20
-
21
- /**
22
- * Determines if the given screen size matches the specified breakpoint query.
23
- *
24
- * The function checks if the screen size (width and/or height) falls within the range
25
- * specified by the breakpoint query. The query can specify width (using 'w'), height (using 'h'),
26
- * or both.
27
- *
28
- * @param {string} query - The breakpoint query string. Examples: 'w[100,200]', 'h[300]', 'w[100,200]h[300,400]'.
29
- * @param {ScreenSize} screenSize - The screen size to check against the breakpoint query.
30
- * @returns {boolean} True if the screen size matches the breakpoint query, false otherwise.
31
- *
32
- * @example
33
- * const screenSize = { width: 150, height: 350 }
34
- * isWithinBreakpoint('w[100,200]', screenSize) // returns true
35
- * isWithinBreakpoint('h[400]', screenSize) // returns false
36
- */
37
- export const isWithinBreakpoint = (query, screenSize) => {
38
- if (query.includes('w') && query.includes('h')) {
39
- return isWithinTheWidthAndHeight(query, screenSize);
40
- }
41
- if (query.charAt(0) === 'w') {
42
- return isWithinTheWidth(query, screenSize.width);
43
- }
44
- if (query.charAt(0) === 'h') {
45
- return isWithinTheHeight(query, screenSize.height);
46
- }
47
- return false;
48
- };
49
-
50
- /**
51
- * Determines if the given width matches the specified width range in the query.
52
- *
53
- * The function checks if the provided width falls within the range specified by the query.
54
- * The query specifies a width range using a format like 'w[100,200]'. If only one value is provided,
55
- * it's treated as a minimum width.
56
- *
57
- * @param {string} query - The width query string. Examples: 'w[100,200]' or 'w[100]'.
58
- * @param {number} width - The width to check against the query.
59
- * @returns {boolean} True if the width matches the query range, false otherwise.
60
- *
61
- * @example
62
- * isWithinTheWidth('w[100,200]', 150) // returns true
63
- * isWithinTheWidth('w[100]', 50) // returns false
64
- * isWithinTheWidth('w[100]', 150) // returns true
65
- */
66
- export const isWithinTheWidth = (query, width) => {
67
- const [minWidth, maxWidth] = extractValues(query);
68
- if (maxWidth && width >= minWidth && width <= maxWidth) {
69
- return true;
70
- }
71
- return !maxWidth && width >= minWidth;
72
- };
73
-
74
- /**
75
- * Determines if the given height matches the specified height range in the query.
76
- *
77
- * The function checks if the provided height falls within the range specified by the query.
78
- * The query specifies a height range using a format like 'h[100,200]'. If only one value is provided,
79
- * it's treated as a minimum height.
80
- *
81
- * @param {string} query - The height query string. Examples: 'h[100,200]' or 'h[100]'.
82
- * @param {number} height - The height to check against the query.
83
- * @returns {boolean} True if the height matches the query range, false otherwise.
84
- *
85
- * @example
86
- * isWithinTheHeight('h[100,200]', 150) // returns true
87
- * isWithinTheHeight('h[100]', 50) // returns false
88
- * isWithinTheHeight('h[100]', 150) // returns true
89
- */
90
- export const isWithinTheHeight = (query, height) => {
91
- const [minHeight, maxHeight] = extractValues(query);
92
- if (maxHeight && height >= minHeight && height <= maxHeight) {
93
- return true;
94
- }
95
- return !maxHeight && height >= minHeight;
96
- };
97
-
98
- /**
99
- * Determines if the given screen size matches both the specified width and height ranges in the query.
100
- *
101
- * The function checks if the provided screen size (both width and height) falls within the ranges
102
- * specified by the query. The query can specify both width and height using a format like 'w[100,200]:h[300,400]'.
103
- *
104
- * @param {string} query - The combined width and height query string. Example: 'w[100,200]:h[300,400]'.
105
- * @param {ScreenSize} screenSize - The screen size to check against the query.
106
- * @returns {boolean} True if the screen size matches both the width and height ranges in the query, false otherwise.
107
- *
108
- * @example
109
- * const screenSize = { width: 150, height: 350 }
110
- * isWithinTheWidthAndHeight('w[100,200]:h[300,400]', screenSize) // returns true
111
- * isWithinTheWidthAndHeight('w[100,200]:h[400,500]', screenSize) // returns false
112
- */
113
- export const isWithinTheWidthAndHeight = (query, screenSize) => {
114
- const result = query.split(':').filter(Boolean).map(q => isWithinBreakpoint(q, screenSize)).filter(Boolean);
115
- return result.length === 2;
116
- };
117
-
118
- /**
119
- * Checks if the given query string is a valid custom media query.
120
- *
121
- * The valid custom media query formats include:
122
- * - :w[200]
123
- * - :w[0, 200]
124
- * - :w[, 300]
125
- * - :h[200]
126
- * - :h[0, 500]
127
- * - :h[,200]
128
- * - :w[100, 300]:h[200,500]
129
- * - :h[200,500]:w[100, 300]
130
- *
131
- * @param {string} query - The query string to be checked.
132
- * @returns {boolean} Returns `true` if the query is a valid custom media query, otherwise `false`.
133
- * @example
134
- *
135
- * isMediaQuery(':w[200]') // true
136
- * isMediaQuery(':w100]') // false
137
- */
138
- export const isMediaQuery = query => {
139
- const regex = /^(?:(:w\[\d*(?:,\s?\d+)?])?(:h\[\d*(?:,\s?\d+)?])?|(:h\[\d*(?:,\s?\d+)?])?(:w\[\d*(?:,\s?\d+)?])?)$/;
140
- return query.length > 0 && regex.test(query);
141
- };
142
-
143
- /**
144
- * Retrieves the first matching custom media query key based on the provided screen size.
145
- *
146
- * The function processes an array of media queries and returns the first query that matches
147
- * the given screen size. The media queries can be in formats like:
148
- * - w[200]
149
- * - w[0, 200]
150
- * - w[, 300]
151
- * - h[200]
152
- * - h[0, 500]
153
- * - h[,200]
154
- * - w[100, 300]:h[200,500]
155
- * - h[200,500]:w[100, 300]
156
- *
157
- * @param {Array<[string, string | number]>} mediaQueries - An array of tuples containing media query keys and associated values.
158
- * @param {ScreenSize} screenSize - An object representing the screen size to be checked against the media queries.
159
- * @returns {string | undefined} Returns the first matching media query key or `undefined` if no match is found.
160
- * @example
161
- *
162
- * const queries = [[':w[200]', 'value1'], [':h[300,500]', 'value2']]
163
- * const size = { width: 250, height: 400 }
164
- * getKeyForCustomMediaQuery(queries, size) // ':w[200]
165
- */
166
- export const getKeyForCustomMediaQuery = (mediaQueries, screenSize) => {
167
- const [matchedQuery] = mediaQueries.flatMap(_ref => {
168
- let [key] = _ref;
169
- if (key.includes('w') && key.includes('h')) {
170
- return isWithinBreakpoint(key, screenSize) ? key : undefined;
171
- }
172
- return key.split(':').filter(Boolean).map(query => isWithinBreakpoint(query, screenSize) ? key : undefined);
173
- }).filter(Boolean);
174
- return matchedQuery;
175
- };
176
- //# sourceMappingURL=mediaQueries.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["extractValues","codedValue","lh","rh","replace","split","Number","isWithinBreakpoint","query","screenSize","includes","isWithinTheWidthAndHeight","charAt","isWithinTheWidth","width","isWithinTheHeight","height","minWidth","maxWidth","minHeight","maxHeight","result","filter","Boolean","map","q","length","isMediaQuery","regex","test","getKeyForCustomMediaQuery","mediaQueries","matchedQuery","flatMap","_ref","key","undefined"],"sourceRoot":"../../../src","sources":["utils/mediaQueries.ts"],"mappings":"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"}
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- export declare const App: React.FunctionComponent;
3
- //# sourceMappingURL=App.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../../../../examples/expo/src/App.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAUvC,eAAO,MAAM,GAAG,EAAE,KAAK,CAAC,iBAgBvB,CAAA"}
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- export declare const Breakpoints: React.FunctionComponent;
3
- //# sourceMappingURL=Breakpoints.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Breakpoints.d.ts","sourceRoot":"","sources":["../../../../../../examples/expo/src/examples/Breakpoints.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,iBAiB/B,CAAA"}
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- export declare const EmptyStyles: React.FunctionComponent;
3
- //# sourceMappingURL=EmptyStyles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EmptyStyles.d.ts","sourceRoot":"","sources":["../../../../../../examples/expo/src/examples/EmptyStyles.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,iBAU/B,CAAA"}
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- type ExtremeProps = {
3
- onToggleTheme: VoidFunction;
4
- };
5
- export declare const Extreme: React.FunctionComponent<ExtremeProps>;
6
- export {};
7
- //# sourceMappingURL=Extreme.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Extreme.d.ts","sourceRoot":"","sources":["../../../../../../examples/expo/src/examples/Extreme.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,KAAK,YAAY,GAAG;IAChB,aAAa,EAAE,YAAY,CAAA;CAC9B,CAAA;AAGD,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,iBAAiB,CAAC,YAAY,CAezD,CAAA"}
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- export declare const MediaQueries: React.FunctionComponent;
3
- //# sourceMappingURL=MediaQueries.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MediaQueries.d.ts","sourceRoot":"","sources":["../../../../../../examples/expo/src/examples/MediaQueries.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,iBAahC,CAAA"}
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- export declare const Memoization: React.FunctionComponent;
3
- //# sourceMappingURL=Memoization.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Memoization.d.ts","sourceRoot":"","sources":["../../../../../../examples/expo/src/examples/Memoization.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,iBAY/B,CAAA"}
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- export declare const Minimal: React.FunctionComponent;
3
- //# sourceMappingURL=Minimal.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Minimal.d.ts","sourceRoot":"","sources":["../../../../../../examples/expo/src/examples/Minimal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,iBAU3B,CAAA"}
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- export declare const MinimalWithCreateStyleSheet: React.FunctionComponent;
3
- //# sourceMappingURL=MinimalWithCreateStyleSheet.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MinimalWithCreateStyleSheet.d.ts","sourceRoot":"","sources":["../../../../../../examples/expo/src/examples/MinimalWithCreateStyleSheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,eAAO,MAAM,2BAA2B,EAAE,KAAK,CAAC,iBAU/C,CAAA"}
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- export declare const PlatformColors: React.FunctionComponent;
3
- //# sourceMappingURL=PlatformColors.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PlatformColors.d.ts","sourceRoot":"","sources":["../../../../../../examples/expo/src/examples/PlatformColors.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,iBAUlC,CAAA"}
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- export declare const Theme: React.FunctionComponent;
3
- //# sourceMappingURL=Theme.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Theme.d.ts","sourceRoot":"","sources":["../../../../../../examples/expo/src/examples/Theme.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,iBAUzB,CAAA"}
@@ -1,9 +0,0 @@
1
- export { Minimal } from './Minimal';
2
- export { MinimalWithCreateStyleSheet } from './MinimalWithCreateStyleSheet';
3
- export { Theme } from './Theme';
4
- export { Breakpoints } from './Breakpoints';
5
- export { MediaQueries } from './MediaQueries';
6
- export { Extreme } from './Extreme';
7
- export { Memoization } from './Memoization';
8
- export { PlatformColors } from './PlatformColors';
9
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../examples/expo/src/examples/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAA;AAC3E,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../examples/expo/src/index.ts"],"names":[],"mappings":""}
@@ -1,8 +0,0 @@
1
- export declare const breakpoints: {
2
- xs: number;
3
- sm: number;
4
- md: number;
5
- lg: number;
6
- xl: number;
7
- };
8
- //# sourceMappingURL=breakpoints.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"breakpoints.d.ts","sourceRoot":"","sources":["../../../../../../examples/expo/src/styles/breakpoints.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW;;;;;;CAMvB,CAAA"}
@@ -1,46 +0,0 @@
1
- import type { AppTheme } from './theme';
2
- import { lightTheme, darkTheme } from './theme';
3
- export declare const useStyles: <ST extends import("../../../../src/types").CustomNamedStyles<ST, {
4
- xs: number;
5
- sm: number;
6
- md: number;
7
- lg: number;
8
- xl: number;
9
- }>>(stylesheet?: ST | import("../../../../src/types").CreateStylesFactory<ST, AppTheme> | undefined) => {
10
- theme: AppTheme;
11
- breakpoint: "xs" | "sm" | "md" | "lg" | "xl";
12
- styles: import("../../../../src/types").ExtractBreakpoints<import("../../../../src/types").RemoveKeysWithPrefix<ST, {
13
- xs: number;
14
- sm: number;
15
- md: number;
16
- lg: number;
17
- xl: number;
18
- }>, {
19
- xs: number;
20
- sm: number;
21
- md: number;
22
- lg: number;
23
- xl: number;
24
- }>;
25
- }, createStyleSheet: <S extends import("../../../../src/types").CustomNamedStyles<S, {
26
- xs: number;
27
- sm: number;
28
- md: number;
29
- lg: number;
30
- xl: number;
31
- }>, X>(styles: S | X | import("../../../../src/types").CustomNamedStyles<S, {
32
- xs: number;
33
- sm: number;
34
- md: number;
35
- lg: number;
36
- xl: number;
37
- }> | ((theme: AppTheme) => X | import("../../../../src/types").CustomNamedStyles<X, {
38
- xs: number;
39
- sm: number;
40
- md: number;
41
- lg: number;
42
- xl: number;
43
- }>)) => S | X;
44
- export { lightTheme, darkTheme };
45
- export type { AppTheme };
46
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../examples/expo/src/styles/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AACvC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAE/C,eAAO,MAAQ,SAAS;;;;;;;;;;;;;;;;;;;;;;GAAE,gBAAgB;;;;;;;;;;;;;;;;;;aAA+D,CAAA;AAEzG,OAAO,EACH,UAAU,EACV,SAAS,EACZ,CAAA;AAED,YAAY,EACR,QAAQ,EACX,CAAA"}
@@ -1,24 +0,0 @@
1
- export declare const lightTheme: {
2
- colors: {
3
- backgroundColor: string;
4
- typography: string;
5
- barbie: string;
6
- oak: string;
7
- sky: string;
8
- fog: string;
9
- aloes: string;
10
- };
11
- };
12
- export declare const darkTheme: {
13
- colors: {
14
- backgroundColor: string;
15
- typography: string;
16
- barbie: string;
17
- oak: string;
18
- sky: string;
19
- fog: string;
20
- aloes: string;
21
- };
22
- };
23
- export type AppTheme = typeof lightTheme | typeof darkTheme;
24
- //# sourceMappingURL=theme.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../../../examples/expo/src/styles/theme.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,UAAU;;;;;;;;;;CAOtB,CAAA;AAED,eAAO,MAAM,SAAS;;;;;;;;;;CAOrB,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG,OAAO,UAAU,GAAG,OAAO,SAAS,CAAA"}
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import type { PropsWithChildren } from 'react';
3
- interface UnistylesThemeProps extends PropsWithChildren {
4
- theme: any;
5
- }
6
- export declare const UnistylesContext: React.Context<{}>;
7
- export declare const UnistylesTheme: React.FunctionComponent<UnistylesThemeProps>;
8
- export {};
9
- //# sourceMappingURL=UnistylesTheme.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"UnistylesTheme.d.ts","sourceRoot":"","sources":["../../../src/UnistylesTheme.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAA;AAC5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAE9C,UAAU,mBAAoB,SAAQ,iBAAiB;IACnD,KAAK,EAAE,GAAG,CAAA;CACb;AAED,eAAO,MAAM,gBAAgB,mBAAoB,CAAA;AAEjD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,iBAAiB,CAAC,mBAAmB,CAOvE,CAAA"}
@@ -1,10 +0,0 @@
1
- import type { Breakpoints, CreateStylesFactory, CustomNamedStyles, ExtractBreakpoints, RemoveKeysWithPrefix } from './types';
2
- export declare const createUnistyles: <B extends Breakpoints, T = {}>(breakpoints: B) => {
3
- createStyleSheet: <S extends CustomNamedStyles<S, B>, X>(styles: S | X | CustomNamedStyles<S, B> | ((theme: T) => X | CustomNamedStyles<X, B>)) => S | X;
4
- useStyles: <ST extends CustomNamedStyles<ST, B>>(stylesheet?: ST | CreateStylesFactory<ST, T> | undefined) => {
5
- theme: T;
6
- breakpoint: keyof B & string;
7
- styles: ExtractBreakpoints<RemoveKeysWithPrefix<ST, B>, B>;
8
- };
9
- };
10
- //# sourceMappingURL=createUnistyles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createUnistyles.d.ts","sourceRoot":"","sources":["../../../src/createUnistyles.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACR,WAAW,EACX,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EAEvB,MAAM,SAAS,CAAA;AAKhB,eAAO,MAAM,eAAe;;;;;;;CAuD3B,CAAA"}
@@ -1,3 +0,0 @@
1
- import type { ScreenSize } from '../types';
2
- export declare const useDimensions: () => ScreenSize;
3
- //# sourceMappingURL=useDimensions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useDimensions.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useDimensions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAE1C,eAAO,MAAM,aAAa,QAAO,UAAmC,CAAA"}
@@ -1,3 +0,0 @@
1
- import type { ScreenSize } from '../types';
2
- export declare const useDimensions: () => ScreenSize;
3
- //# sourceMappingURL=useDimensions.web.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useDimensions.web.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useDimensions.web.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAE1C,eAAO,MAAM,aAAa,QAAO,UA8BhC,CAAA"}
@@ -1,8 +0,0 @@
1
- type Optional<TOptional extends string> = TOptional | '';
2
- type Separator = ',' | ', ';
3
- type MediaQuery = `[${Separator}${bigint}]` | `[${bigint}${Optional<`${Separator}${bigint}`>}]`;
4
- type WidthMediaQuery = `:w${MediaQuery}`;
5
- type HeightMediaQuery = `:h${MediaQuery}`;
6
- export type MediaQueries = `${WidthMediaQuery}${Optional<HeightMediaQuery>}` | `${HeightMediaQuery}${Optional<WidthMediaQuery>}`;
7
- export {};
8
- //# sourceMappingURL=mediaQueries.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mediaQueries.d.ts","sourceRoot":"","sources":["../../../../src/types/mediaQueries.ts"],"names":[],"mappings":"AAAA,KAAK,QAAQ,CAAC,SAAS,SAAS,MAAM,IAAI,SAAS,GAAG,EAAE,CAAA;AACxD,KAAK,SAAS,GAAG,GAAG,GAAG,IAAI,CAAA;AAE3B,KAAK,UAAU,GAAG,IAAI,SAAS,GAAG,MAAM,GAAG,GAAG,IAAI,MAAM,GAAG,QAAQ,CAAC,GAAG,SAAS,GAAG,MAAM,EAAE,CAAC,GAAG,CAAA;AAC/F,KAAK,eAAe,GAAG,KAAK,UAAU,EAAE,CAAA;AACxC,KAAK,gBAAgB,GAAG,KAAK,UAAU,EAAE,CAAA;AAEzC,MAAM,MAAM,YAAY,GAClB,GAAG,eAAe,GAAG,QAAQ,CAAC,gBAAgB,CAAC,EAAE,GACjD,GAAG,gBAAgB,GAAG,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAA"}