react-native-unistyles 2.0.0-alpha.1 → 2.0.0-alpha.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (193) hide show
  1. package/README.md +4 -4
  2. package/ios/UnistylesModule.h +12 -0
  3. package/ios/UnistylesModule.mm +163 -0
  4. package/ios/UnistylesRuntime.h +48 -0
  5. package/ios/UnistylesRuntime.mm +228 -0
  6. package/lib/commonjs/UnistyleRegistry.js +34 -0
  7. package/lib/commonjs/UnistyleRegistry.js.map +1 -0
  8. package/lib/commonjs/Unistyles.js +36 -0
  9. package/lib/commonjs/Unistyles.js.map +1 -0
  10. package/lib/commonjs/UnistylesEngine.js +22 -0
  11. package/lib/commonjs/UnistylesEngine.js.map +1 -0
  12. package/lib/commonjs/UnistylesModule.js +9 -0
  13. package/lib/commonjs/UnistylesModule.js.map +1 -0
  14. package/lib/commonjs/UnistylesRuntime.js +63 -0
  15. package/lib/commonjs/UnistylesRuntime.js.map +1 -0
  16. package/lib/commonjs/createStyleSheet.js +14 -0
  17. package/lib/commonjs/createStyleSheet.js.map +1 -0
  18. package/lib/commonjs/global.js +2 -0
  19. package/lib/commonjs/global.js.map +1 -0
  20. package/lib/commonjs/hooks/useDimensions.web.js +3 -2
  21. package/lib/commonjs/hooks/useDimensions.web.js.map +1 -1
  22. package/lib/commonjs/index.js +33 -6
  23. package/lib/commonjs/index.js.map +1 -1
  24. package/lib/commonjs/types/cxx.js +23 -0
  25. package/lib/commonjs/types/cxx.js.map +1 -0
  26. package/lib/commonjs/types/index.js +26 -0
  27. package/lib/commonjs/types/index.js.map +1 -1
  28. package/lib/commonjs/types/normalizer.js +6 -0
  29. package/lib/commonjs/types/normalizer.js.map +1 -0
  30. package/lib/commonjs/useInitialTheme.js +13 -0
  31. package/lib/commonjs/useInitialTheme.js.map +1 -0
  32. package/lib/commonjs/useStyles.js +48 -0
  33. package/lib/commonjs/useStyles.js.map +1 -0
  34. package/lib/commonjs/useUnistyles.js +57 -0
  35. package/lib/commonjs/useUnistyles.js.map +1 -0
  36. package/lib/commonjs/utils/breakpoints.js +4 -2
  37. package/lib/commonjs/utils/breakpoints.js.map +1 -1
  38. package/lib/commonjs/utils/common.js +3 -3
  39. package/lib/commonjs/utils/common.js.map +1 -1
  40. package/lib/commonjs/utils/index.js +34 -0
  41. package/lib/commonjs/utils/index.js.map +1 -1
  42. package/lib/commonjs/utils/module.d.js +2 -0
  43. package/lib/commonjs/utils/module.d.js.map +1 -0
  44. package/lib/commonjs/utils/normalizeStyles.web.js +13 -13
  45. package/lib/commonjs/utils/normalizeStyles.web.js.map +1 -1
  46. package/lib/commonjs/utils/normalizer.js +89 -0
  47. package/lib/commonjs/utils/normalizer.js.map +1 -0
  48. package/lib/commonjs/utils/styles.js +7 -7
  49. package/lib/commonjs/utils/styles.js.map +1 -1
  50. package/lib/module/UnistyleRegistry.js +27 -0
  51. package/lib/module/UnistyleRegistry.js.map +1 -0
  52. package/lib/module/Unistyles.js +30 -0
  53. package/lib/module/Unistyles.js.map +1 -0
  54. package/lib/module/UnistylesEngine.js +15 -0
  55. package/lib/module/UnistylesEngine.js.map +1 -0
  56. package/lib/module/UnistylesModule.js +3 -0
  57. package/lib/module/UnistylesModule.js.map +1 -0
  58. package/lib/module/UnistylesRuntime.js +56 -0
  59. package/lib/module/UnistylesRuntime.js.map +1 -0
  60. package/lib/module/createStyleSheet.js +7 -0
  61. package/lib/module/createStyleSheet.js.map +1 -0
  62. package/lib/module/global.js +2 -0
  63. package/lib/module/global.js.map +1 -0
  64. package/lib/module/hooks/useDimensions.web.js +3 -2
  65. package/lib/module/hooks/useDimensions.web.js.map +1 -1
  66. package/lib/module/index.js +18 -2
  67. package/lib/module/index.js.map +1 -1
  68. package/lib/module/types/cxx.js +17 -0
  69. package/lib/module/types/cxx.js.map +1 -0
  70. package/lib/module/types/index.js +2 -1
  71. package/lib/module/types/index.js.map +1 -1
  72. package/lib/module/types/normalizer.js +2 -0
  73. package/lib/module/types/normalizer.js.map +1 -0
  74. package/lib/module/useInitialTheme.js +6 -0
  75. package/lib/module/useInitialTheme.js.map +1 -0
  76. package/lib/module/useStyles.js +42 -0
  77. package/lib/module/useStyles.js.map +1 -0
  78. package/lib/module/useUnistyles.js +50 -0
  79. package/lib/module/useUnistyles.js.map +1 -0
  80. package/lib/module/utils/breakpoints.js +4 -3
  81. package/lib/module/utils/breakpoints.js.map +1 -1
  82. package/lib/module/utils/common.js +2 -1
  83. package/lib/module/utils/common.js.map +1 -1
  84. package/lib/module/utils/index.js +2 -0
  85. package/lib/module/utils/index.js.map +1 -1
  86. package/lib/module/utils/module.d.js +2 -0
  87. package/lib/module/utils/module.d.js.map +1 -0
  88. package/lib/module/utils/normalizeStyles.web.js +13 -13
  89. package/lib/module/utils/normalizeStyles.web.js.map +1 -1
  90. package/lib/module/utils/normalizer.js +79 -0
  91. package/lib/module/utils/normalizer.js.map +1 -0
  92. package/lib/module/utils/styles.js +7 -8
  93. package/lib/module/utils/styles.js.map +1 -1
  94. package/lib/typescript/examples/expo/src/App.d.ts +3 -0
  95. package/lib/typescript/examples/expo/src/App.d.ts.map +1 -0
  96. package/lib/typescript/examples/expo/src/examples/Cxx.d.ts +3 -0
  97. package/lib/typescript/examples/expo/src/examples/Cxx.d.ts.map +1 -0
  98. package/lib/typescript/examples/expo/src/examples/index.d.ts +2 -0
  99. package/lib/typescript/examples/expo/src/examples/index.d.ts.map +1 -0
  100. package/lib/typescript/examples/expo/src/index.d.ts +2 -0
  101. package/lib/typescript/examples/expo/src/index.d.ts.map +1 -0
  102. package/lib/typescript/examples/expo/src/styles/breakpoints.d.ts +8 -0
  103. package/lib/typescript/examples/expo/src/styles/breakpoints.d.ts.map +1 -0
  104. package/lib/typescript/examples/expo/src/styles/index.d.ts +16 -0
  105. package/lib/typescript/examples/expo/src/styles/index.d.ts.map +1 -0
  106. package/lib/typescript/examples/expo/src/styles/theme.d.ts +40 -0
  107. package/lib/typescript/examples/expo/src/styles/theme.d.ts.map +1 -0
  108. package/lib/typescript/src/UnistyleRegistry.d.ts +14 -0
  109. package/lib/typescript/src/UnistyleRegistry.d.ts.map +1 -0
  110. package/lib/typescript/src/Unistyles.d.ts +16 -0
  111. package/lib/typescript/src/Unistyles.d.ts.map +1 -0
  112. package/lib/typescript/src/UnistylesEngine.d.ts +8 -0
  113. package/lib/typescript/src/UnistylesEngine.d.ts.map +1 -0
  114. package/lib/typescript/src/UnistylesModule.d.ts +6 -0
  115. package/lib/typescript/src/UnistylesModule.d.ts.map +1 -0
  116. package/lib/typescript/src/UnistylesRuntime.d.ts +60 -0
  117. package/lib/typescript/src/UnistylesRuntime.d.ts.map +1 -0
  118. package/lib/typescript/src/createStyleSheet.d.ts +6 -0
  119. package/lib/typescript/src/createStyleSheet.d.ts.map +1 -0
  120. package/lib/typescript/src/global.d.ts +5 -0
  121. package/lib/typescript/src/global.d.ts.map +1 -0
  122. package/lib/typescript/src/hooks/useDimensions.web.d.ts.map +1 -1
  123. package/lib/typescript/src/index.d.ts +14 -2
  124. package/lib/typescript/src/index.d.ts.map +1 -1
  125. package/lib/typescript/src/types/breakpoints.d.ts +6 -7
  126. package/lib/typescript/src/types/breakpoints.d.ts.map +1 -1
  127. package/lib/typescript/src/types/core.d.ts +4 -4
  128. package/lib/typescript/src/types/core.d.ts.map +1 -1
  129. package/lib/typescript/src/types/cxx.d.ts +53 -0
  130. package/lib/typescript/src/types/cxx.d.ts.map +1 -0
  131. package/lib/typescript/src/types/index.d.ts +4 -1
  132. package/lib/typescript/src/types/index.d.ts.map +1 -1
  133. package/lib/typescript/src/types/normalizer.d.ts +20 -0
  134. package/lib/typescript/src/types/normalizer.d.ts.map +1 -0
  135. package/lib/typescript/src/useInitialTheme.d.ts +3 -0
  136. package/lib/typescript/src/useInitialTheme.d.ts.map +1 -0
  137. package/lib/typescript/src/useStyles.d.ts +46 -0
  138. package/lib/typescript/src/useStyles.d.ts.map +1 -0
  139. package/lib/typescript/src/useUnistyles.d.ts +45 -0
  140. package/lib/typescript/src/useUnistyles.d.ts.map +1 -0
  141. package/lib/typescript/src/utils/breakpoints.d.ts +5 -4
  142. package/lib/typescript/src/utils/breakpoints.d.ts.map +1 -1
  143. package/lib/typescript/src/utils/common.d.ts +2 -1
  144. package/lib/typescript/src/utils/common.d.ts.map +1 -1
  145. package/lib/typescript/src/utils/index.d.ts +2 -0
  146. package/lib/typescript/src/utils/index.d.ts.map +1 -1
  147. package/lib/typescript/src/utils/normalizeStyles.web.d.ts +4 -1
  148. package/lib/typescript/src/utils/normalizeStyles.web.d.ts.map +1 -1
  149. package/lib/typescript/src/utils/normalizer.d.ts +11 -0
  150. package/lib/typescript/src/utils/normalizer.d.ts.map +1 -0
  151. package/lib/typescript/src/utils/styles.d.ts +4 -3
  152. package/lib/typescript/src/utils/styles.d.ts.map +1 -1
  153. package/package.json +13 -3
  154. package/react-native-unistyles.podspec +21 -0
  155. package/src/UnistyleRegistry.ts +35 -0
  156. package/src/Unistyles.ts +41 -0
  157. package/src/UnistylesEngine.ts +15 -0
  158. package/src/UnistylesModule.ts +7 -0
  159. package/src/UnistylesRuntime.ts +69 -0
  160. package/src/createStyleSheet.ts +12 -0
  161. package/src/global.ts +2 -0
  162. package/src/hooks/useDimensions.web.ts +3 -2
  163. package/src/index.ts +30 -2
  164. package/src/types/breakpoints.ts +9 -11
  165. package/src/types/core.ts +6 -6
  166. package/src/types/cxx.ts +65 -0
  167. package/src/types/index.ts +4 -3
  168. package/src/types/normalizer.ts +29 -0
  169. package/src/useInitialTheme.ts +7 -0
  170. package/src/useStyles.ts +49 -0
  171. package/src/useUnistyles.ts +66 -0
  172. package/src/utils/breakpoints.ts +16 -14
  173. package/src/utils/common.ts +2 -1
  174. package/src/utils/index.ts +2 -0
  175. package/src/utils/module.d.ts +3 -0
  176. package/src/utils/normalizeStyles.web.ts +21 -42
  177. package/src/utils/normalizer.ts +99 -0
  178. package/src/utils/styles.ts +17 -19
  179. package/lib/commonjs/UnistylesTheme.js +0 -21
  180. package/lib/commonjs/UnistylesTheme.js.map +0 -1
  181. package/lib/commonjs/createUnistyles.js +0 -57
  182. package/lib/commonjs/createUnistyles.js.map +0 -1
  183. package/lib/module/UnistylesTheme.js +0 -12
  184. package/lib/module/UnistylesTheme.js.map +0 -1
  185. package/lib/module/createUnistyles.js +0 -50
  186. package/lib/module/createUnistyles.js.map +0 -1
  187. package/lib/typescript/src/UnistylesTheme.d.ts +0 -9
  188. package/lib/typescript/src/UnistylesTheme.d.ts.map +0 -1
  189. package/lib/typescript/src/createUnistyles.d.ts +0 -10
  190. package/lib/typescript/src/createUnistyles.d.ts.map +0 -1
  191. package/src/UnistylesTheme.tsx +0 -17
  192. package/src/__tests__/createUnistyles.spec.tsx +0 -192
  193. package/src/createUnistyles.ts +0 -70
@@ -1,5 +1,7 @@
1
1
  export { normalizeStyles } from './normalizeStyles';
2
+ export * from './normalizer';
2
3
  export { getBreakpointFromScreenWidth, sortAndValidateBreakpoints, getValueForBreakpoint } from './breakpoints';
3
4
  export { proxifyFunction, parseStyle } from './styles';
5
+ export { isServer } from './common';
4
6
  export { extractValues, getKeyForCustomMediaQuery, isMediaQuery, isWithinTheHeight, isWithinTheWidth, isWithinTheWidthAndHeight } from './mediaQueries';
5
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["normalizeStyles","getBreakpointFromScreenWidth","sortAndValidateBreakpoints","getValueForBreakpoint","proxifyFunction","parseStyle","extractValues","getKeyForCustomMediaQuery","isMediaQuery","isWithinTheHeight","isWithinTheWidth","isWithinTheWidthAndHeight"],"sourceRoot":"../../../src","sources":["utils/index.ts"],"mappings":"AAAA,SAASA,eAAe,QAAQ,mBAAmB;AACnD,SAASC,4BAA4B,EAAEC,0BAA0B,EAAEC,qBAAqB,QAAQ,eAAe;AAC/G,SAASC,eAAe,EAAEC,UAAU,QAAQ,UAAU;AACtD,SACIC,aAAa,EACbC,yBAAyB,EACzBC,YAAY,EACZC,iBAAiB,EACjBC,gBAAgB,EAChBC,yBAAyB,QACtB,gBAAgB"}
1
+ {"version":3,"names":["normalizeStyles","getBreakpointFromScreenWidth","sortAndValidateBreakpoints","getValueForBreakpoint","proxifyFunction","parseStyle","isServer","extractValues","getKeyForCustomMediaQuery","isMediaQuery","isWithinTheHeight","isWithinTheWidth","isWithinTheWidthAndHeight"],"sourceRoot":"../../../src","sources":["utils/index.ts"],"mappings":"AAAA,SAASA,eAAe,QAAQ,mBAAmB;AACnD,cAAc,cAAc;AAC5B,SAASC,4BAA4B,EAAEC,0BAA0B,EAAEC,qBAAqB,QAAQ,eAAe;AAC/G,SAASC,eAAe,EAAEC,UAAU,QAAQ,UAAU;AACtD,SAASC,QAAQ,QAAQ,UAAU;AACnC,SACIC,aAAa,EACbC,yBAAyB,EACzBC,YAAY,EACZC,iBAAiB,EACjBC,gBAAgB,EAChBC,yBAAyB,QACtB,gBAAgB"}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=module.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["utils/module.d.ts"],"mappings":""}
@@ -1,8 +1,8 @@
1
1
  import { warn } from './common';
2
- const preprocessor = require('react-native-web/src/exports/StyleSheet/preprocess.js');
3
- const normalizeBoxShadow = styles => {
2
+ import { preprocessor } from './normalizer';
3
+ const normalizeBoxShadow = style => {
4
4
  const requiredBoxShadowProperties = ['shadowColor', 'shadowOffset', 'shadowOpacity', 'shadowRadius'];
5
- if (!requiredBoxShadowProperties.every(prop => prop in styles)) {
5
+ if (!requiredBoxShadowProperties.every(prop => prop in style)) {
6
6
  warn(`can't apply box shadow as you miss at least one of these properties: ${requiredBoxShadowProperties.join(', ')}`);
7
7
  return {
8
8
  shadowColor: undefined,
@@ -12,16 +12,16 @@ const normalizeBoxShadow = styles => {
12
12
  };
13
13
  }
14
14
  return {
15
- boxShadow: preprocessor.createBoxShadowValue(styles),
15
+ boxShadow: preprocessor.createBoxShadowValue(style),
16
16
  shadowColor: undefined,
17
17
  shadowOffset: undefined,
18
18
  shadowOpacity: undefined,
19
19
  shadowRadius: undefined
20
20
  };
21
21
  };
22
- const normalizeTextShadow = styles => {
22
+ const normalizeTextShadow = style => {
23
23
  const requiredTextShadowProperties = ['textShadowColor', 'textShadowOffset', 'textShadowRadius'];
24
- if (!requiredTextShadowProperties.every(prop => prop in styles)) {
24
+ if (!requiredTextShadowProperties.every(prop => prop in style)) {
25
25
  warn(`can't apply text shadow as you miss at least one of these properties: ${requiredTextShadowProperties.join(', ')}`);
26
26
  return {
27
27
  textShadowColor: undefined,
@@ -30,20 +30,20 @@ const normalizeTextShadow = styles => {
30
30
  };
31
31
  }
32
32
  return {
33
- textShadow: preprocessor.createTextShadowValue(styles),
33
+ textShadow: preprocessor.createTextShadowValue(style),
34
34
  textShadowColor: undefined,
35
35
  textShadowOffset: undefined,
36
36
  textShadowRadius: undefined
37
37
  };
38
38
  };
39
- export const normalizeStyles = styles => {
40
- const normalizedTransform = 'transform' in styles && Array.isArray(styles.transform) ? {
41
- transform: preprocessor.createTransformValue(styles.transform)
39
+ export const normalizeStyles = style => {
40
+ const normalizedTransform = 'transform' in style && Array.isArray(style.transform) ? {
41
+ transform: preprocessor.createTransformValue(style.transform)
42
42
  } : {};
43
- const normalizedBoxShadow = 'shadowColor' in styles || 'shadowOffset' in styles || 'shadowOpacity' in styles || 'shadowRadius' in styles ? normalizeBoxShadow(styles) : {};
44
- const normalizedTextShadow = 'textShadowColor' in styles || 'textShadowOffset' in styles || 'textShadowRadius' in styles ? normalizeTextShadow(styles) : {};
43
+ const normalizedBoxShadow = 'shadowColor' in style || 'shadowOffset' in style || 'shadowOpacity' in style || 'shadowRadius' in style ? normalizeBoxShadow(style) : {};
44
+ const normalizedTextShadow = 'textShadowColor' in style || 'textShadowOffset' in style || 'textShadowRadius' in style ? normalizeTextShadow(style) : {};
45
45
  return {
46
- ...styles,
46
+ ...style,
47
47
  ...normalizedTransform,
48
48
  ...normalizedBoxShadow,
49
49
  ...normalizedTextShadow
@@ -1 +1 @@
1
- {"version":3,"names":["warn","preprocessor","require","normalizeBoxShadow","styles","requiredBoxShadowProperties","every","prop","join","shadowColor","undefined","shadowOffset","shadowOpacity","shadowRadius","boxShadow","createBoxShadowValue","normalizeTextShadow","requiredTextShadowProperties","textShadowColor","textShadowOffset","textShadowRadius","textShadow","createTextShadowValue","normalizeStyles","normalizedTransform","Array","isArray","transform","createTransformValue","normalizedBoxShadow","normalizedTextShadow"],"sourceRoot":"../../../src","sources":["utils/normalizeStyles.web.ts"],"mappings":"AAAA,SAASA,IAAI,QAAQ,UAAU;AAE/B,MAAMC,YAA0B,GAAGC,OAAO,CAAC,uDAAuD,CAAC;AAuBnG,MAAMC,kBAAkB,GAAkBC,MAAS,IAA0B;EACzE,MAAMC,2BAA2B,GAAG,CAChC,aAAa,EACb,cAAc,EACd,eAAe,EACf,cAAc,CACjB;EAED,IAAI,CAACA,2BAA2B,CAACC,KAAK,CAACC,IAAI,IAAIA,IAAI,IAAIH,MAAM,CAAC,EAAE;IAC5DJ,IAAI,CAAE,wEAAuEK,2BAA2B,CAACG,IAAI,CAAC,IAAI,CAAE,EAAC,CAAC;IAEtH,OAAO;MACHC,WAAW,EAAEC,SAAS;MACtBC,YAAY,EAAED,SAAS;MACvBE,aAAa,EAAEF,SAAS;MACxBG,YAAY,EAAEH;IAClB,CAAC;EACL;EAEA,OAAO;IACHI,SAAS,EAAEb,YAAY,CAACc,oBAAoB,CAACX,MAAM,CAAC;IACpDK,WAAW,EAAEC,SAAS;IACtBC,YAAY,EAAED,SAAS;IACvBE,aAAa,EAAEF,SAAS;IACxBG,YAAY,EAAEH;EAClB,CAAC;AACL,CAAC;AAED,MAAMM,mBAAmB,GAAkBZ,MAAS,IAA2B;EAC3E,MAAMa,4BAA4B,GAAG,CACjC,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,CACrB;EAED,IAAI,CAACA,4BAA4B,CAACX,KAAK,CAACC,IAAI,IAAIA,IAAI,IAAIH,MAAM,CAAC,EAAE;IAC7DJ,IAAI,CAAE,yEAAwEiB,4BAA4B,CAACT,IAAI,CAAC,IAAI,CAAE,EAAC,CAAC;IAExH,OAAO;MACHU,eAAe,EAAER,SAAS;MAC1BS,gBAAgB,EAAET,SAAS;MAC3BU,gBAAgB,EAAEV;IACtB,CAAC;EACL;EAEA,OAAO;IACHW,UAAU,EAAEpB,YAAY,CAACqB,qBAAqB,CAAClB,MAAM,CAAC;IACtDc,eAAe,EAAER,SAAS;IAC1BS,gBAAgB,EAAET,SAAS;IAC3BU,gBAAgB,EAAEV;EACtB,CAAC;AACL,CAAC;AAED,OAAO,MAAMa,eAAe,GAAkBnB,MAAS,IAAQ;EAC3D,MAAMoB,mBAAmB,GAAI,WAAW,IAAIpB,MAAM,IAAIqB,KAAK,CAACC,OAAO,CAACtB,MAAM,CAACuB,SAAS,CAAC,GAC/E;IAAEA,SAAS,EAAE1B,YAAY,CAAC2B,oBAAoB,CAACxB,MAAM,CAACuB,SAAS;EAAE,CAAC,GAClE,CAAC,CAAC;EAER,MAAME,mBAAmB,GACrB,aAAa,IAAIzB,MAAM,IACvB,cAAc,IAAIA,MAAM,IACxB,eAAe,IAAIA,MAAM,IACzB,cAAc,IAAIA,MAAM,GACxBD,kBAAkB,CAACC,MAAM,CAAC,GAAG,CAAC,CAAC;EAEnC,MAAM0B,oBAAoB,GACtB,iBAAiB,IAAI1B,MAAM,IAC3B,kBAAkB,IAAIA,MAAM,IAC5B,kBAAkB,IAAIA,MAAM,GAC5BY,mBAAmB,CAACZ,MAAM,CAAC,GAAG,CAAC,CAAC;EAEpC,OAAO;IACH,GAAGA,MAAM;IACT,GAAGoB,mBAAmB;IACtB,GAAGK,mBAAmB;IACtB,GAAGC;EACP,CAAC;AACL,CAAC"}
1
+ {"version":3,"names":["warn","preprocessor","normalizeBoxShadow","style","requiredBoxShadowProperties","every","prop","join","shadowColor","undefined","shadowOffset","shadowOpacity","shadowRadius","boxShadow","createBoxShadowValue","normalizeTextShadow","requiredTextShadowProperties","textShadowColor","textShadowOffset","textShadowRadius","textShadow","createTextShadowValue","normalizeStyles","normalizedTransform","Array","isArray","transform","createTransformValue","normalizedBoxShadow","normalizedTextShadow"],"sourceRoot":"../../../src","sources":["utils/normalizeStyles.web.ts"],"mappings":"AAAA,SAASA,IAAI,QAAQ,UAAU;AAC/B,SAASC,YAAY,QAAQ,cAAc;AAG3C,MAAMC,kBAAkB,GAAyBC,KAAQ,IAA0B;EAC/E,MAAMC,2BAA2B,GAAG,CAChC,aAAa,EACb,cAAc,EACd,eAAe,EACf,cAAc,CACjB;EAED,IAAI,CAACA,2BAA2B,CAACC,KAAK,CAACC,IAAI,IAAIA,IAAI,IAAIH,KAAK,CAAC,EAAE;IAC3DH,IAAI,CAAE,wEAAuEI,2BAA2B,CAACG,IAAI,CAAC,IAAI,CAAE,EAAC,CAAC;IAEtH,OAAO;MACHC,WAAW,EAAEC,SAAS;MACtBC,YAAY,EAAED,SAAS;MACvBE,aAAa,EAAEF,SAAS;MACxBG,YAAY,EAAEH;IAClB,CAAC;EACL;EAEA,OAAO;IACHI,SAAS,EAAEZ,YAAY,CAACa,oBAAoB,CAACX,KAAK,CAAC;IACnDK,WAAW,EAAEC,SAAS;IACtBC,YAAY,EAAED,SAAS;IACvBE,aAAa,EAAEF,SAAS;IACxBG,YAAY,EAAEH;EAClB,CAAC;AACL,CAAC;AAED,MAAMM,mBAAmB,GAA0BZ,KAAQ,IAA2B;EAClF,MAAMa,4BAA4B,GAAG,CACjC,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,CACrB;EAED,IAAI,CAACA,4BAA4B,CAACX,KAAK,CAACC,IAAI,IAAIA,IAAI,IAAIH,KAAK,CAAC,EAAE;IAC5DH,IAAI,CAAE,yEAAwEgB,4BAA4B,CAACT,IAAI,CAAC,IAAI,CAAE,EAAC,CAAC;IAExH,OAAO;MACHU,eAAe,EAAER,SAAS;MAC1BS,gBAAgB,EAAET,SAAS;MAC3BU,gBAAgB,EAAEV;IACtB,CAAC;EACL;EAEA,OAAO;IACHW,UAAU,EAAEnB,YAAY,CAACoB,qBAAqB,CAAClB,KAAK,CAAC;IACrDc,eAAe,EAAER,SAAS;IAC1BS,gBAAgB,EAAET,SAAS;IAC3BU,gBAAgB,EAAEV;EACtB,CAAC;AACL,CAAC;AAED,OAAO,MAAMa,eAAe,GAAkEnB,KAAQ,IAAQ;EAC1G,MAAMoB,mBAAmB,GAAI,WAAW,IAAIpB,KAAK,IAAIqB,KAAK,CAACC,OAAO,CAACtB,KAAK,CAACuB,SAAS,CAAC,GAC7E;IAAEA,SAAS,EAAEzB,YAAY,CAAC0B,oBAAoB,CAACxB,KAAK,CAACuB,SAAS;EAAE,CAAC,GACjE,CAAC,CAAC;EAER,MAAME,mBAAmB,GACrB,aAAa,IAAIzB,KAAK,IACtB,cAAc,IAAIA,KAAK,IACvB,eAAe,IAAIA,KAAK,IACxB,cAAc,IAAIA,KAAK,GACvBD,kBAAkB,CAACC,KAAkB,CAAC,GAAG,CAAC,CAAC;EAE/C,MAAM0B,oBAAoB,GACtB,iBAAiB,IAAI1B,KAAK,IAC1B,kBAAkB,IAAIA,KAAK,IAC3B,kBAAkB,IAAIA,KAAK,GAC3BY,mBAAmB,CAACZ,KAAmB,CAAC,GAAG,CAAC,CAAC;EAEjD,OAAO;IACH,GAAGA,KAAK;IACR,GAAGoB,mBAAmB;IACtB,GAAGK,mBAAmB;IACtB,GAAGC;EACP,CAAC;AACL,CAAC"}
@@ -0,0 +1,79 @@
1
+ // based on react-native-web normalizer
2
+ // https://github.com/necolas/react-native-web
3
+ import normalizeColors from '@react-native/normalize-colors';
4
+ export const normalizeColor = function (color) {
5
+ let opacity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
6
+ // If the opacity is 1 there's no need to normalize the color
7
+ if (opacity === 1) {
8
+ return color;
9
+ }
10
+ const integer = normalizeColors(color);
11
+
12
+ // If the colour is an unknown format, the return value is null
13
+ if (integer === null) {
14
+ return color;
15
+ }
16
+ const hex = integer.toString(16).padStart(8, '0');
17
+ if (hex.length === 8) {
18
+ const [r = 0, g = 0, b = 0, a = 1] = hex.split(/(?=(?:..)*$)/).map(x => parseInt(x, 16)).filter(num => !isNaN(num));
19
+ return `rgba(${r},${g},${b},${a / 255 * opacity})`;
20
+ }
21
+ return color;
22
+ };
23
+ export const normalizeNumericValue = value => value ? `${value}px` : value;
24
+ const normalizeTransform = (key, value) => {
25
+ if (key.includes('scale')) {
26
+ return value;
27
+ }
28
+ if (typeof value === 'number') {
29
+ return normalizeNumericValue(value);
30
+ }
31
+ return value;
32
+ };
33
+ const createTextShadowValue = style => {
34
+ // at this point every prop is present
35
+ const {
36
+ textShadowColor,
37
+ textShadowOffset,
38
+ textShadowRadius
39
+ } = style;
40
+ const offsetX = normalizeNumericValue(textShadowOffset.width);
41
+ const offsetY = normalizeNumericValue(textShadowOffset.height);
42
+ const radius = normalizeNumericValue(textShadowRadius);
43
+ const color = normalizeColor(textShadowColor);
44
+ return `${offsetX} ${offsetY} ${radius} ${color}`;
45
+ };
46
+ const createBoxShadowValue = style => {
47
+ // at this point every prop is present
48
+ const {
49
+ shadowColor,
50
+ shadowOffset,
51
+ shadowOpacity,
52
+ shadowRadius
53
+ } = style;
54
+ const offsetX = normalizeNumericValue(shadowOffset.width);
55
+ const offsetY = normalizeNumericValue(shadowOffset.height);
56
+ const radius = normalizeNumericValue(shadowRadius);
57
+ const color = normalizeColor(shadowColor, shadowOpacity);
58
+ return `${offsetX} ${offsetY} ${radius} ${color}`;
59
+ };
60
+ const createTransformValue = transforms => transforms.map(transform => {
61
+ const [key] = Object.keys(transform);
62
+ if (!key) {
63
+ return undefined;
64
+ }
65
+ const value = transform[key];
66
+ switch (key) {
67
+ case 'matrix':
68
+ case 'matrix3d':
69
+ return `${key}(${value.join(',')})`;
70
+ default:
71
+ return `${key}(${normalizeTransform(key, value)})`;
72
+ }
73
+ }).filter(Boolean).join(' ');
74
+ export const preprocessor = {
75
+ createTextShadowValue,
76
+ createBoxShadowValue,
77
+ createTransformValue
78
+ };
79
+ //# sourceMappingURL=normalizer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["normalizeColors","normalizeColor","color","opacity","arguments","length","undefined","integer","hex","toString","padStart","r","g","b","a","split","map","x","parseInt","filter","num","isNaN","normalizeNumericValue","value","normalizeTransform","key","includes","createTextShadowValue","style","textShadowColor","textShadowOffset","textShadowRadius","offsetX","width","offsetY","height","radius","createBoxShadowValue","shadowColor","shadowOffset","shadowOpacity","shadowRadius","createTransformValue","transforms","transform","Object","keys","join","Boolean","preprocessor"],"sourceRoot":"../../../src","sources":["utils/normalizer.ts"],"mappings":"AAAA;AACA;AACA,OAAOA,eAAe,MAAM,gCAAgC;AAS5D,OAAO,MAAMC,cAAc,GAAG,SAAAA,CAACC,KAAa,EAA0B;EAAA,IAAxBC,OAAe,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC;EAC7D;EACA,IAAID,OAAO,KAAK,CAAC,EAAE;IACf,OAAOD,KAAK;EAChB;EAEA,MAAMK,OAAO,GAAGP,eAAe,CAACE,KAAK,CAAkB;;EAEvD;EACA,IAAIK,OAAO,KAAK,IAAI,EAAE;IAClB,OAAOL,KAAK;EAChB;EAEA,MAAMM,GAAG,GAAGD,OAAO,CAACE,QAAQ,CAAC,EAAE,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;EAEjD,IAAIF,GAAG,CAACH,MAAM,KAAK,CAAC,EAAE;IAClB,MAAM,CAACM,CAAC,GAAG,CAAC,EAAEC,CAAC,GAAG,CAAC,EAAEC,CAAC,GAAG,CAAC,EAAEC,CAAC,GAAG,CAAC,CAAC,GAAGN,GAAG,CACnCO,KAAK,CAAC,cAAc,CAAC,CACrBC,GAAG,CAACC,CAAC,IAAIC,QAAQ,CAACD,CAAC,EAAE,EAAE,CAAC,CAAC,CACzBE,MAAM,CAACC,GAAG,IAAI,CAACC,KAAK,CAACD,GAAG,CAAC,CAAC;IAE/B,OAAQ,QAAOT,CAAE,IAAGC,CAAE,IAAGC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EAClD,MAAMvC,KAAK,GAAGD,cAAc,CAACqC,WAAW,EAAYE,aAAuB,CAAC;EAE5E,OAAQ,GAAER,OAAQ,IAAGE,OAAQ,IAAGE,MAAO,IAAGlC,KAAM,EAAC;AACrD,CAAC;AAED,MAAMwC,oBAAoB,GAAIC,UAAsB,IAAKA,UAAU,CAC9D3B,GAAG,CAAC4B,SAAS,IAAI;EACd,MAAM,CAACnB,GAAG,CAAC,GAAGoB,MAAM,CAACC,IAAI,CAACF,SAAS,CAAC;EAEpC,IAAI,CAACnB,GAAG,EAAE;IACN,OAAOnB,SAAS;EACpB;EAEA,MAAMiB,KAAK,GAAGqB,SAAS,CAACnB,GAAG,CAA2B;EAEtD,QAAOA,GAAG;IACN,KAAK,QAAQ;IACb,KAAK,UAAU;MACX,OAAQ,GAAEA,GAAI,IAAIF,KAAK,CAAmBwB,IAAI,CAAC,GAAG,CAAE,GAAE;IAC1D;MACI,OAAQ,GAAEtB,GAAI,IAAGD,kBAAkB,CAACC,GAAG,EAAEF,KAAK,CAAE,GAAE;EAC1D;AACJ,CAAC,CAAC,CACDJ,MAAM,CAAC6B,OAAO,CAAC,CACfD,IAAI,CAAC,GAAG,CAAC;AAEd,OAAO,MAAME,YAA0B,GAAG;EACtCtB,qBAAqB;EACrBU,oBAAoB;EACpBK;AACJ,CAAC"}
@@ -1,7 +1,6 @@
1
1
  import { getValueForBreakpoint } from './breakpoints';
2
2
  import { normalizeStyles } from './normalizeStyles';
3
3
  import { isWeb } from './common';
4
-
5
4
  /**
6
5
  * Proxies a function to parse its return value for custom media queries or breakpoints.
7
6
  *
@@ -23,8 +22,8 @@ import { isWeb } from './common';
23
22
  * const proxifiedFunction = proxifyFunction(myFunction, 'sm', screenSize, breakpoints)
24
23
  * proxifiedFunction() // parsed style based on screenSize and breakpoints
25
24
  */
26
- export const proxifyFunction = (fn, breakpoint, screenSize, breakpointPairs) => new Proxy(fn, {
27
- apply: (target, thisArg, argumentsList) => parseStyle(target.apply(thisArg, argumentsList), breakpoint, screenSize, breakpointPairs)
25
+ export const proxifyFunction = (fn, breakpoint, screenSize) => new Proxy(fn, {
26
+ apply: (target, thisArg, argumentsList) => parseStyle(target.apply(thisArg, argumentsList), breakpoint, screenSize)
28
27
  });
29
28
 
30
29
  /**
@@ -52,25 +51,25 @@ export const proxifyFunction = (fn, breakpoint, screenSize, breakpointPairs) =>
52
51
  * const parsedStyle = parseStyle(style, 'sm', screenSize, breakpoints)
53
52
  * // { fontSize: '12px' }
54
53
  */
55
- export const parseStyle = (style, breakpoint, screenSize, breakpointPairs) => {
54
+ export const parseStyle = (style, breakpoint, screenSize) => {
56
55
  const entries = Object.entries(style);
57
56
  const parsedStyles = Object.fromEntries(entries.map(_ref => {
58
57
  let [key, value] = _ref;
59
58
  const hasNestedProperties = key === 'shadowOffset' || key === 'textShadowOffset';
60
59
  if (hasNestedProperties) {
61
- return [key, parseStyle(value, breakpoint, screenSize, breakpointPairs)];
60
+ return [key, parseStyle(value, breakpoint, screenSize)];
62
61
  }
63
62
  const isTransform = key === 'transform';
64
63
  if (isTransform && Array.isArray(value)) {
65
- return [key, value.map(value => parseStyle(value, breakpoint, screenSize, breakpointPairs))];
64
+ return [key, value.map(value => parseStyle(value, breakpoint, screenSize))];
66
65
  }
67
66
  const isDynamicFunction = typeof value === 'function';
68
67
  const isValidStyle = typeof value !== 'object';
69
68
  if (isDynamicFunction || isValidStyle) {
70
69
  return [key, value];
71
70
  }
72
- return [key, getValueForBreakpoint(value, breakpoint, screenSize, breakpointPairs)];
71
+ return [key, getValueForBreakpoint(value, breakpoint, screenSize)];
73
72
  }));
74
- return isWeb() ? normalizeStyles(parsedStyles) : parsedStyles;
73
+ return isWeb ? normalizeStyles(parsedStyles) : parsedStyles;
75
74
  };
76
75
  //# sourceMappingURL=styles.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["getValueForBreakpoint","normalizeStyles","isWeb","proxifyFunction","fn","breakpoint","screenSize","breakpointPairs","Proxy","apply","target","thisArg","argumentsList","parseStyle","style","entries","Object","parsedStyles","fromEntries","map","_ref","key","value","hasNestedProperties","isTransform","Array","isArray","isDynamicFunction","isValidStyle"],"sourceRoot":"../../../src","sources":["utils/styles.ts"],"mappings":"AACA,SAASA,qBAAqB,QAAQ,eAAe;AACrD,SAASC,eAAe,QAAQ,mBAAmB;AACnD,SAASC,KAAK,QAAQ,UAAU;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,eAAe,GAAGA,CAC3BC,EAAY,EAAEC,UAA4B,EAC1CC,UAAsB,EACtBC,eAA2C,KAChC,IAAIC,KAAK,CAACJ,EAAE,EAAE;EACzBK,KAAK,EAAEA,CAACC,MAAM,EAAEC,OAAO,EAAEC,aAAa,KAClCC,UAAU,CAACH,MAAM,CAACD,KAAK,CAACE,OAAO,EAAEC,aAAa,CAAC,EAAEP,UAAU,EAAEC,UAAU,EAAEC,eAAe;AAChG,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMM,UAAU,GAAGA,CACtBC,KAA8B,EAC9BT,UAA4B,EAC5BC,UAAsB,EACtBC,eAA2C,KACvC;EACJ,MAAMQ,OAAO,GAAGC,MAAM,CAACD,OAAO,CAACD,KAAK,CAGnC;EAED,MAAMG,YAAY,GAAGD,MAAM,CACtBE,WAAW,CAACH,OAAO,CACfI,GAAG,CAACC,IAAA,IAAkB;IAAA,IAAjB,CAACC,GAAG,EAAEC,KAAK,CAAC,GAAAF,IAAA;IACd,MAAMG,mBAAmB,GAAGF,GAAG,KAAK,cAAc,IAAIA,GAAG,KAAK,kBAAkB;IAEhF,IAAIE,mBAAmB,EAAE;MACrB,OAAO,CACHF,GAAG,EACHR,UAAU,CAACS,KAAK,EAA6BjB,UAAU,EAAEC,UAAU,EAAEC,eAAe,CAAC,CACxF;IACL;IAEA,MAAMiB,WAAW,GAAGH,GAAG,KAAK,WAAW;IAEvC,IAAIG,WAAW,IAAIC,KAAK,CAACC,OAAO,CAACJ,KAAK,CAAC,EAAE;MACrC,OAAO,CACHD,GAAG,EACHC,KAAK,CAACH,GAAG,CAACG,KAAK,IAAIT,UAAU,CAACS,KAAK,EAAEjB,UAAU,EAAEC,UAAU,EAAEC,eAAe,CAAC,CAAC,CACjF;IACL;IAEA,MAAMoB,iBAAiB,GAAG,OAAOL,KAAK,KAAK,UAAU;IACrD,MAAMM,YAAY,GAAG,OAAON,KAAK,KAAK,QAAQ;IAE9C,IAAIK,iBAAiB,IAAIC,YAAY,EAAE;MACnC,OAAO,CAACP,GAAG,EAAEC,KAAK,CAAC;IACvB;IAEA,OAAO,CACHD,GAAG,EACHrB,qBAAqB,CACjBsB,KAAK,EACLjB,UAAU,EACVC,UAAU,EACVC,eACJ,CAAC,CACJ;EACL,CAAC,CACL,CAAC;EAEL,OAAOL,KAAK,CAAC,CAAC,GACRD,eAAe,CAACgB,YAAY,CAAC,GAC7BA,YAAY;AACtB,CAAC"}
1
+ {"version":3,"names":["getValueForBreakpoint","normalizeStyles","isWeb","proxifyFunction","fn","breakpoint","screenSize","Proxy","apply","target","thisArg","argumentsList","parseStyle","style","entries","Object","parsedStyles","fromEntries","map","_ref","key","value","hasNestedProperties","isTransform","Array","isArray","isDynamicFunction","isValidStyle"],"sourceRoot":"../../../src","sources":["utils/styles.ts"],"mappings":"AACA,SAASA,qBAAqB,QAAQ,eAAe;AACrD,SAASC,eAAe,QAAQ,mBAAmB;AACnD,SAASC,KAAK,QAAQ,UAAU;AAGhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,eAAe,GAAGA,CAC3BC,EAAY,EAAEC,UAA+C,EAC7DC,U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,OAAO,CAACP,GAAG,EAAEC,KAAK,CAAC;IACvB;IAEA,OAAO,CACHD,GAAG,EACHpB,qBAAqB,CACjBqB,KAAK,EACLhB,UAAU,EACVC,UACJ,CAAC,CACJ;EACL,CAAC,CACL,CAAC;EAEL,OAAOJ,KAAK,GACND,eAAe,CAACe,YAAY,CAAC,GAC7BA,YAAY;AACtB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const App: React.FunctionComponent;
3
+ //# sourceMappingURL=App.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../../../../examples/expo/src/App.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAgBzB,eAAO,MAAM,GAAG,EAAE,KAAK,CAAC,iBAMvB,CAAA"}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const Cxx: () => React.JSX.Element;
3
+ //# sourceMappingURL=Cxx.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Cxx.d.ts","sourceRoot":"","sources":["../../../../../../examples/expo/src/examples/Cxx.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,eAAO,MAAM,GAAG,yBA8Ef,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { Cxx } from './Cxx';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../examples/expo/src/examples/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../examples/expo/src/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ export declare const breakpoints: {
2
+ xs: number;
3
+ sm: number;
4
+ md: number;
5
+ lg: number;
6
+ xl: number;
7
+ };
8
+ //# sourceMappingURL=breakpoints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"breakpoints.d.ts","sourceRoot":"","sources":["../../../../../../examples/expo/src/styles/breakpoints.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW;;;;;;CAMvB,CAAA"}
@@ -0,0 +1,16 @@
1
+ import { breakpoints } from './breakpoints';
2
+ import { lightTheme, darkTheme, premiumTheme } from './theme';
3
+ type AppBreakpoints = typeof breakpoints;
4
+ type AppThemes = {
5
+ light: typeof lightTheme;
6
+ dark: typeof darkTheme;
7
+ premium: typeof premiumTheme;
8
+ };
9
+ declare module 'react-native-unistyles' {
10
+ interface UnistylesThemes extends AppThemes {
11
+ }
12
+ interface UnistylesBreakpoints extends AppBreakpoints {
13
+ }
14
+ }
15
+ export { lightTheme, darkTheme, premiumTheme, breakpoints };
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../examples/expo/src/styles/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAE7D,KAAK,cAAc,GAAG,OAAO,WAAW,CAAA;AACxC,KAAK,SAAS,GAAG;IACb,KAAK,EAAE,OAAO,UAAU,CAAA;IACxB,IAAI,EAAE,OAAO,SAAS,CAAA;IACtB,OAAO,EAAE,OAAO,YAAY,CAAA;CAC/B,CAAA;AAED,OAAO,QAAQ,wBAAwB,CAAC;IACpC,UAAiB,eAAgB,SAAQ,SAAS;KAAG;IAErD,UAAiB,oBAAqB,SAAQ,cAAc;KAAG;CAClE;AAED,OAAO,EACH,UAAU,EACV,SAAS,EACT,YAAY,EACZ,WAAW,EACd,CAAA"}
@@ -0,0 +1,40 @@
1
+ export declare const lightTheme: {
2
+ colors: {
3
+ backgroundColor: string;
4
+ typography: string;
5
+ accent: string;
6
+ barbie: string;
7
+ oak: string;
8
+ sky: string;
9
+ fog: string;
10
+ aloes: string;
11
+ blood: string;
12
+ };
13
+ };
14
+ export declare const darkTheme: {
15
+ colors: {
16
+ backgroundColor: string;
17
+ typography: string;
18
+ accent: string;
19
+ barbie: string;
20
+ oak: string;
21
+ sky: string;
22
+ fog: string;
23
+ aloes: string;
24
+ blood: string;
25
+ };
26
+ };
27
+ export declare const premiumTheme: {
28
+ colors: {
29
+ backgroundColor: string;
30
+ typography: string;
31
+ accent: string;
32
+ barbie: string;
33
+ oak: string;
34
+ sky: string;
35
+ fog: string;
36
+ aloes: string;
37
+ blood: string;
38
+ };
39
+ };
40
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../../../examples/expo/src/styles/theme.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,UAAU;;;;;;;;;;;;CAQtB,CAAA;AAED,eAAO,MAAM,SAAS;;;;;;;;;;;;CAQrB,CAAA;AAED,eAAO,MAAM,YAAY;;;;;;;;;;;;CAQxB,CAAA"}
@@ -0,0 +1,14 @@
1
+ import type { UnistylesBridge, UnistylesConfig } from './types';
2
+ import type { UnistylesThemes, UnistylesBreakpoints } from './global';
3
+ export declare class UnistyleRegistry {
4
+ private unistylesBridge;
5
+ config: UnistylesConfig;
6
+ themes: UnistylesThemes;
7
+ breakpoints: UnistylesBreakpoints;
8
+ sortedBreakpointPairs: Array<[keyof UnistylesBreakpoints, UnistylesBreakpoints[keyof UnistylesBreakpoints]]>;
9
+ constructor(unistylesBridge: UnistylesBridge);
10
+ addThemes: (themes: UnistylesThemes) => this;
11
+ addBreakpoints: (breakpoints: UnistylesBreakpoints) => this;
12
+ addConfig: (config: UnistylesConfig) => this;
13
+ }
14
+ //# sourceMappingURL=UnistyleRegistry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnistyleRegistry.d.ts","sourceRoot":"","sources":["../../../src/UnistyleRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAErE,qBAAa,gBAAgB;IAMb,OAAO,CAAC,eAAe;IAL5B,MAAM,EAAE,eAAe,CAAK;IAC5B,MAAM,EAAE,eAAe,CAAwB;IAC/C,WAAW,EAAE,oBAAoB,CAA6B;IAC9D,qBAAqB,EAAE,KAAK,CAAC,CAAC,MAAM,oBAAoB,EAAE,oBAAoB,CAAC,MAAM,oBAAoB,CAAC,CAAC,CAAC,CAAK;gBAEpG,eAAe,EAAE,eAAe;IAE7C,SAAS,WAAY,eAAe,UAK1C;IAEM,cAAc,gBAAiB,oBAAoB,UAKzD;IAEM,SAAS,WAAY,eAAe,UAQ1C;CACJ"}
@@ -0,0 +1,16 @@
1
+ import { UnistylesRuntime } from './UnistylesRuntime';
2
+ import { UnistylesEngine } from './UnistylesEngine';
3
+ import { UnistyleRegistry } from './UnistyleRegistry';
4
+ declare class Unistyles {
5
+ private _runtime;
6
+ private _engine;
7
+ private _registry;
8
+ private _bridge;
9
+ constructor();
10
+ get registry(): UnistyleRegistry;
11
+ get runtime(): UnistylesRuntime;
12
+ get engine(): UnistylesEngine;
13
+ }
14
+ export declare const unistyles: Unistyles;
15
+ export {};
16
+ //# sourceMappingURL=Unistyles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Unistyles.d.ts","sourceRoot":"","sources":["../../../src/Unistyles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAIrD,cAAM,SAAS;IACX,OAAO,CAAC,QAAQ,CAAkB;IAClC,OAAO,CAAC,OAAO,CAAiB;IAChC,OAAO,CAAC,SAAS,CAAkB;IACnC,OAAO,CAAC,OAAO,CAAiB;;IAgBhC,IAAW,QAAQ,qBAElB;IAED,IAAW,OAAO,qBAEjB;IAED,IAAW,MAAM,oBAEhB;CACJ;AAED,eAAO,MAAM,SAAS,WAAkB,CAAA"}
@@ -0,0 +1,8 @@
1
+ import type { UnistyleRegistry } from './UnistyleRegistry';
2
+ import type { UnistylesRuntime } from './UnistylesRuntime';
3
+ export declare class UnistylesEngine {
4
+ private registry;
5
+ private runtime;
6
+ constructor(registry: UnistyleRegistry, runtime: UnistylesRuntime);
7
+ }
8
+ //# sourceMappingURL=UnistylesEngine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnistylesEngine.d.ts","sourceRoot":"","sources":["../../../src/UnistylesEngine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAG1D,qBAAa,eAAe;IAEZ,OAAO,CAAC,QAAQ;IAAoB,OAAO,CAAC,OAAO;gBAA3C,QAAQ,EAAE,gBAAgB,EAAU,OAAO,EAAE,gBAAgB;CAQpF"}
@@ -0,0 +1,6 @@
1
+ type UnistylesNativeModule = {
2
+ install(): boolean;
3
+ };
4
+ export declare const UnistylesModule: UnistylesNativeModule;
5
+ export {};
6
+ //# sourceMappingURL=UnistylesModule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnistylesModule.d.ts","sourceRoot":"","sources":["../../../src/UnistylesModule.ts"],"names":[],"mappings":"AAEA,KAAK,qBAAqB,GAAG;IACzB,OAAO,IAAI,OAAO,CAAA;CACrB,CAAA;AAED,eAAO,MAAM,eAAe,uBAAoD,CAAA"}
@@ -0,0 +1,60 @@
1
+ import type { UnistylesBridge } from './types';
2
+ import type { UnistyleRegistry } from './UnistyleRegistry';
3
+ import { ScreenOrientation } from './types';
4
+ import type { UnistylesThemes } from './global';
5
+ export declare class UnistylesRuntime {
6
+ private unistylesBridge;
7
+ private registry;
8
+ constructor(unistylesBridge: UnistylesBridge, registry: UnistyleRegistry);
9
+ get colorScheme(): import("./types").ColorSchemeName;
10
+ get hasAdaptiveThemes(): boolean;
11
+ get sortedBreakpoints(): [keyof import("./global").UnistylesBreakpoints, number][];
12
+ get themeName(): keyof UnistylesThemes;
13
+ get breakpoint(): keyof import("./global").UnistylesBreakpoints;
14
+ get screen(): {
15
+ width: number;
16
+ height: number;
17
+ };
18
+ get orientation(): ScreenOrientation;
19
+ setTheme: (name: keyof UnistylesThemes) => boolean;
20
+ getTheme: (forName: keyof UnistylesThemes) => {
21
+ colors: {
22
+ backgroundColor: string;
23
+ typography: string;
24
+ accent: string;
25
+ barbie: string;
26
+ oak: string;
27
+ sky: string;
28
+ fog: string;
29
+ aloes: string;
30
+ blood: string;
31
+ };
32
+ } | {
33
+ colors: {
34
+ backgroundColor: string;
35
+ typography: string;
36
+ accent: string;
37
+ barbie: string;
38
+ oak: string;
39
+ sky: string;
40
+ fog: string;
41
+ aloes: string;
42
+ blood: string;
43
+ };
44
+ } | {
45
+ colors: {
46
+ backgroundColor: string;
47
+ typography: string;
48
+ accent: string;
49
+ barbie: string;
50
+ oak: string;
51
+ sky: string;
52
+ fog: string;
53
+ aloes: string;
54
+ blood: string;
55
+ };
56
+ };
57
+ setAdaptiveThemes: (enable: boolean) => void;
58
+ private hasTheme;
59
+ }
60
+ //# sourceMappingURL=UnistylesRuntime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnistylesRuntime.d.ts","sourceRoot":"","sources":["../../../src/UnistylesRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,EAAE,iBAAiB,EAAkB,MAAM,SAAS,CAAA;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,qBAAa,gBAAgB;IACb,OAAO,CAAC,eAAe;IAAmB,OAAO,CAAC,QAAQ;gBAAlD,eAAe,EAAE,eAAe,EAAU,QAAQ,EAAE,gBAAgB;IAExF,IAAW,WAAW,sCAErB;IAED,IAAW,iBAAiB,YAE3B;IAED,IAAW,iBAAiB,8DAE3B;IAED,IAAW,SAAS,0BAEnB;IAED,IAAW,UAAU,kDAEpB;IAED,IAAW,MAAM;;;MAKhB;IAED,IAAW,WAAW,sBAQrB;IAEM,QAAQ,SAAU,MAAM,eAAe,aAQ7C;IAEM,QAAQ,YAAa,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAMhD;IAEM,iBAAiB,WAAY,OAAO,UAE1C;IAED,OAAO,CAAC,QAAQ,CAAgE;CACnF"}
@@ -0,0 +1,6 @@
1
+ import type { CustomNamedStyles } from './types';
2
+ import type { UnistylesThemes } from './global';
3
+ type T = UnistylesThemes[keyof UnistylesThemes];
4
+ export declare const createStyleSheet: <S extends CustomNamedStyles<S>, X>(styles: S | X | CustomNamedStyles<S> | ((theme: T) => X | CustomNamedStyles<X>)) => S | X;
5
+ export {};
6
+ //# sourceMappingURL=createStyleSheet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createStyleSheet.d.ts","sourceRoot":"","sources":["../../../src/createStyleSheet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,KAAK,CAAC,GAAG,eAAe,CAAC,MAAM,eAAe,CAAC,CAAA;AAE/C,eAAO,MAAM,gBAAgB,sFAAuF,CAAC,wCAMpH,CAAA"}
@@ -0,0 +1,5 @@
1
+ export interface UnistylesThemes {
2
+ }
3
+ export interface UnistylesBreakpoints {
4
+ }
5
+ //# sourceMappingURL=global.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../../../src/global.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;CAAG;AACnC,MAAM,WAAW,oBAAoB;CAAG"}
@@ -1 +1 @@
1
- {"version":3,"file":"useDimensions.web.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useDimensions.web.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAE1C,eAAO,MAAM,aAAa,QAAO,UA0BhC,CAAA"}
1
+ {"version":3,"file":"useDimensions.web.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useDimensions.web.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAG1C,eAAO,MAAM,aAAa,QAAO,UA0BhC,CAAA"}
@@ -1,3 +1,15 @@
1
- export { UnistylesTheme } from './UnistylesTheme';
2
- export { createUnistyles } from './createUnistyles';
1
+ import type { UnistylesThemes, UnistylesBreakpoints } from './global';
2
+ import { ScreenOrientation } from './types';
3
+ export { useInitialTheme } from './useInitialTheme';
4
+ export { useStyles } from './useStyles';
5
+ export { createStyleSheet } from './createStyleSheet';
6
+ declare const UnistylesRuntime: import("./UnistylesRuntime").UnistylesRuntime;
7
+ declare const UnistylesRegistry: {
8
+ addThemes: (themes: UnistylesThemes) => import("./UnistyleRegistry").UnistyleRegistry;
9
+ addBreakpoints: (breakpoints: UnistylesBreakpoints) => import("./UnistyleRegistry").UnistyleRegistry;
10
+ addConfig: (config: import("./types").UnistylesConfig) => import("./UnistyleRegistry").UnistyleRegistry;
11
+ };
12
+ export { UnistylesRuntime, UnistylesRegistry };
13
+ export { ScreenOrientation };
14
+ export type { UnistylesThemes, UnistylesBreakpoints };
3
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAE3C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAEnD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAGrD,QAAA,MAAM,gBAAgB,+CAAoB,CAAA;AAC1C,QAAA,MAAM,iBAAiB;;;;CAItB,CAAA;AAED,OAAO,EACH,gBAAgB,EAChB,iBAAiB,EACpB,CAAA;AAED,OAAO,EACH,iBAAiB,EACpB,CAAA;AAED,YAAY,EACR,eAAe,EACf,oBAAoB,EACvB,CAAA"}
@@ -1,19 +1,18 @@
1
+ import type { UnistylesBreakpoints } from '../global';
1
2
  import type { MediaQueries } from './mediaQueries';
2
- export type Breakpoints = Record<string, number>;
3
- export type SortedBreakpointEntries<B extends Breakpoints> = [[keyof B & string, number]];
4
3
  export type ScreenSize = {
5
4
  width: number;
6
5
  height: number;
7
6
  };
8
7
  export type CreateStylesFactory<ST, Theme> = (theme: Theme) => ST;
9
8
  type WithEmptyObject<V> = keyof V extends never ? {} : V;
10
- export type ExtractBreakpoints<T, B extends Breakpoints> = T extends Partial<Record<keyof B & string, infer V>> ? WithEmptyObject<V> : T extends (...args: infer A) => infer R ? (...args: A) => ExtractBreakpoints<R, B> : {
11
- [K in keyof T]: T[K] extends (...args: infer A) => infer R ? (...args: A) => ExtractBreakpoints<R, B> : T[K] extends object ? ExtractBreakpoints<T[K], B> : T[K];
9
+ export type ExtractBreakpoints<T> = T extends Partial<Record<keyof UnistylesBreakpoints & string, infer V>> ? WithEmptyObject<V> : T extends (...args: infer A) => infer R ? (...args: A) => ExtractBreakpoints<R> : {
10
+ [K in keyof T]: T[K] extends (...args: infer A) => infer R ? (...args: A) => ExtractBreakpoints<R> : T[K] extends object ? ExtractBreakpoints<T[K]> : T[K];
12
11
  };
13
- export type RemoveKeysWithPrefix<T, B extends Breakpoints> = T extends (...args: Array<any>) => infer R ? (...args: Parameters<T>) => RemoveKeysWithPrefix<R, B> : T extends object ? T extends Record<string, infer _V> ? {
14
- [K in keyof T as K extends MediaQueries ? keyof B & string : K]: RemoveKeysWithPrefix<T[K], B>;
12
+ export type RemoveKeysWithPrefix<T> = T extends (...args: Array<any>) => infer R ? (...args: Parameters<T>) => RemoveKeysWithPrefix<R> : T extends object ? T extends Record<string, infer _V> ? {
13
+ [K in keyof T as K extends MediaQueries ? keyof UnistylesBreakpoints & string : K]: RemoveKeysWithPrefix<T[K]>;
15
14
  } : {
16
- [K in keyof T]: RemoveKeysWithPrefix<T[K], B>;
15
+ [K in keyof T]: RemoveKeysWithPrefix<T[K]>;
17
16
  } : T;
18
17
  export {};
19
18
  //# sourceMappingURL=breakpoints.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"breakpoints.d.ts","sourceRoot":"","sources":["../../../../src/types/breakpoints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAElD,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAChD,MAAM,MAAM,uBAAuB,CAAC,CAAC,SAAS,WAAW,IAAI,CAAC,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;AAEzF,MAAM,MAAM,UAAU,GAAG;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAA;CACjB,CAAA;A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K,kBAAkB,CAAC,CAAC,CAAC,GACrC,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GACf,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACxB,CAAC,CAAC,CAAC,CAAC;CACjB,CAAA;AAET,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,MAAM,CAAC,GAC1E,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,oBAAoB,CAAC,CAAC,CAAC,GACnD,CAAC,SAAS,MAAM,GACZ,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GAC9B;KAAG,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,YAAY,GAAG,MAAM,oBAAoB,GAAG,MAAM,GAAG,CAAC,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GAClH;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GAClD,CAAC,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import type { MatrixTransform, PerpectiveTransform, RotateTransform, RotateXTransform, RotateYTransform, RotateZTransform, ScaleTransform, ScaleXTransform, ScaleYTransform, SkewXTransform, SkewYTransform, TranslateXTransform, TranslateYTransform } from 'react-native/Libraries/StyleSheet/StyleSheetTypes';
2
2
  import type { ImageStyle, TextStyle, ViewStyle } from 'react-native';
3
- import type { Breakpoints } from './breakpoints';
4
3
  import type { MediaQueries } from './mediaQueries';
4
+ import type { UnistylesBreakpoints } from '../global';
5
5
  type ShadowOffset = {
6
6
  width: number;
7
7
  height: number;
@@ -24,9 +24,9 @@ type NestedTypes = 'shadowOffset' | 'transform' | 'textShadowOffset';
24
24
  type UnistyleView<B> = DeepUniStyle<Omit<ViewStyle, NestedTypes>, B>;
25
25
  type UnistyleText<B> = DeepUniStyle<Omit<TextStyle, NestedTypes>, B>;
26
26
  type UnistyleImage<B> = DeepUniStyle<Omit<ImageStyle, NestedTypes>, B>;
27
- export type StaticStyles<B extends Breakpoints> = UnistyleView<B> | UnistyleText<B> | UnistyleImage<B> & UnistyleNested<B>;
28
- export type CustomNamedStyles<T, B extends Breakpoints> = {
29
- [K in keyof T]: T[K] extends (...args: infer A) => StaticStyles<B> ? (...args: A) => StaticStyles<B> : StaticStyles<B>;
27
+ export type StaticStyles<B> = UnistyleView<B> | UnistyleText<B> | UnistyleImage<B> & UnistyleNested<B>;
28
+ export type CustomNamedStyles<T> = {
29
+ [K in keyof T]: T[K] extends (...args: infer A) => StaticStyles<UnistylesBreakpoints> ? (...args: A) => StaticStyles<UnistylesBreakpoints> : StaticStyles<UnistylesBreakpoints>;
30
30
  };
31
31
  export {};
32
32
  //# sourceMappingURL=core.d.ts.map