@tamagui/core 1.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (333) hide show
  1. package/.ultra.cache.json +1 -0
  2. package/_/constants/constants.js +14 -0
  3. package/_/constants/constants.js.map +7 -0
  4. package/_/constants/platform.js +20 -0
  5. package/_/constants/platform.js.map +7 -0
  6. package/_/constants/pseudos.js +18 -0
  7. package/_/constants/pseudos.js.map +7 -0
  8. package/_/constants/rnw.js +22 -0
  9. package/_/constants/rnw.js.map +7 -0
  10. package/_/createComponent.js +427 -0
  11. package/_/createComponent.js.map +7 -0
  12. package/_/createShorthands.js +10 -0
  13. package/_/createShorthands.js.map +7 -0
  14. package/_/createTamagui.js +122 -0
  15. package/_/createTamagui.js.map +7 -0
  16. package/_/createTheme.js +20 -0
  17. package/_/createTheme.js.map +7 -0
  18. package/_/createTokens.js +29 -0
  19. package/_/createTokens.js.map +7 -0
  20. package/_/createVariable.js +22 -0
  21. package/_/createVariable.js.map +7 -0
  22. package/_/helpers/addStylesUsingClassname.js +32 -0
  23. package/_/helpers/addStylesUsingClassname.js.map +7 -0
  24. package/_/helpers/createMediaStyle.js +34 -0
  25. package/_/helpers/createMediaStyle.js.map +7 -0
  26. package/_/helpers/createTamaguiProvider.js +42 -0
  27. package/_/helpers/createTamaguiProvider.js.map +7 -0
  28. package/_/helpers/extendStaticConfig.js +176 -0
  29. package/_/helpers/extendStaticConfig.js.map +7 -0
  30. package/_/helpers/fixNativeShadow.js +8 -0
  31. package/_/helpers/fixNativeShadow.js.map +7 -0
  32. package/_/helpers/fixNativeShadow.native.js +30 -0
  33. package/_/helpers/fixNativeShadow.native.js.map +7 -0
  34. package/_/helpers/getSplitStyles.js +160 -0
  35. package/_/helpers/getSplitStyles.js.map +7 -0
  36. package/_/helpers/getStylesAtomic.js +84 -0
  37. package/_/helpers/getStylesAtomic.js.map +7 -0
  38. package/_/helpers/getStylesAtomic.native.js +10 -0
  39. package/_/helpers/getStylesAtomic.native.js.map +7 -0
  40. package/_/helpers/insertStyleRule.js +24 -0
  41. package/_/helpers/insertStyleRule.js.map +7 -0
  42. package/_/helpers/matchMedia.js +15 -0
  43. package/_/helpers/matchMedia.js.map +7 -0
  44. package/_/helpers/matchMedia.native.js +8 -0
  45. package/_/helpers/matchMedia.native.js.map +7 -0
  46. package/_/helpers/themeable.js +26 -0
  47. package/_/helpers/themeable.js.map +7 -0
  48. package/_/hooks/useConstant.js +15 -0
  49. package/_/hooks/useConstant.js.map +7 -0
  50. package/_/hooks/useFeatures.js +75 -0
  51. package/_/hooks/useFeatures.js.map +7 -0
  52. package/_/hooks/useForceUpdate.js +28 -0
  53. package/_/hooks/useForceUpdate.js.map +7 -0
  54. package/_/hooks/useMedia.js +173 -0
  55. package/_/hooks/useMedia.js.map +7 -0
  56. package/_/hooks/usePressable.js +14 -0
  57. package/_/hooks/usePressable.js.map +7 -0
  58. package/_/hooks/useTheme.js +94 -0
  59. package/_/hooks/useTheme.js.map +7 -0
  60. package/_/index.js +30 -0
  61. package/_/index.js.map +7 -0
  62. package/_/static/postProcessStyles.js +18 -0
  63. package/_/static/postProcessStyles.js.map +7 -0
  64. package/_/static.js +12 -0
  65. package/_/static.js.map +7 -0
  66. package/_/styled.js +21 -0
  67. package/_/styled.js.map +7 -0
  68. package/_/types.js +1 -0
  69. package/_/types.js.map +7 -0
  70. package/_/views/Animated.js +79 -0
  71. package/_/views/Animated.js.map +7 -0
  72. package/_/views/Stack.js +12 -0
  73. package/_/views/Stack.js.map +7 -0
  74. package/_/views/Text.js +60 -0
  75. package/_/views/Text.js.map +7 -0
  76. package/_/views/TextAncestorContext.js +19 -0
  77. package/_/views/TextAncestorContext.js.map +7 -0
  78. package/_/views/Theme.js +57 -0
  79. package/_/views/Theme.js.map +7 -0
  80. package/_/views/ThemeContext.js +6 -0
  81. package/_/views/ThemeContext.js.map +7 -0
  82. package/_/views/ThemeInverse.js +27 -0
  83. package/_/views/ThemeInverse.js.map +7 -0
  84. package/_/views/ThemeManagerContext.js +56 -0
  85. package/_/views/ThemeManagerContext.js.map +7 -0
  86. package/_/views/ThemeProvider.js +45 -0
  87. package/_/views/ThemeProvider.js.map +7 -0
  88. package/dist/constants/constants.js +14 -0
  89. package/dist/constants/constants.js.map +7 -0
  90. package/dist/constants/platform.js +19 -0
  91. package/dist/constants/platform.js.map +7 -0
  92. package/dist/constants/pseudos.js +18 -0
  93. package/dist/constants/pseudos.js.map +7 -0
  94. package/dist/constants/rnw.js +22 -0
  95. package/dist/constants/rnw.js.map +7 -0
  96. package/dist/constants/styleConstants.js +46 -0
  97. package/dist/constants/styleConstants.js.map +7 -0
  98. package/dist/createComponent.js +445 -0
  99. package/dist/createComponent.js.map +7 -0
  100. package/dist/createFont.js +24 -0
  101. package/dist/createFont.js.map +7 -0
  102. package/dist/createShorthands.js +10 -0
  103. package/dist/createShorthands.js.map +7 -0
  104. package/dist/createTamagui.js +159 -0
  105. package/dist/createTamagui.js.map +7 -0
  106. package/dist/createTheme.js +20 -0
  107. package/dist/createTheme.js.map +7 -0
  108. package/dist/createTokens.js +29 -0
  109. package/dist/createTokens.js.map +7 -0
  110. package/dist/createVariable.js +22 -0
  111. package/dist/createVariable.js.map +7 -0
  112. package/dist/helpers/addStylesUsingClassname.js +57 -0
  113. package/dist/helpers/addStylesUsingClassname.js.map +7 -0
  114. package/dist/helpers/createMediaStyle.js +34 -0
  115. package/dist/helpers/createMediaStyle.js.map +7 -0
  116. package/dist/helpers/createPropMapper.js +153 -0
  117. package/dist/helpers/createPropMapper.js.map +7 -0
  118. package/dist/helpers/createTamaguiProvider.js +25 -0
  119. package/dist/helpers/createTamaguiProvider.js.map +7 -0
  120. package/dist/helpers/extendStaticConfig.js +59 -0
  121. package/dist/helpers/extendStaticConfig.js.map +7 -0
  122. package/dist/helpers/fixNativeShadow.js +8 -0
  123. package/dist/helpers/fixNativeShadow.js.map +7 -0
  124. package/dist/helpers/fixNativeShadow.native.js +30 -0
  125. package/dist/helpers/fixNativeShadow.native.js.map +7 -0
  126. package/dist/helpers/getSplitStyles.js +160 -0
  127. package/dist/helpers/getSplitStyles.js.map +7 -0
  128. package/dist/helpers/getStylesAtomic.js +83 -0
  129. package/dist/helpers/getStylesAtomic.js.map +7 -0
  130. package/dist/helpers/getStylesAtomic.native.js +10 -0
  131. package/dist/helpers/getStylesAtomic.native.js.map +7 -0
  132. package/dist/helpers/insertStyleRule.js +24 -0
  133. package/dist/helpers/insertStyleRule.js.map +7 -0
  134. package/dist/helpers/isObj.js +7 -0
  135. package/dist/helpers/isObj.js.map +7 -0
  136. package/dist/helpers/matchMedia.js +15 -0
  137. package/dist/helpers/matchMedia.js.map +7 -0
  138. package/dist/helpers/matchMedia.native.js +8 -0
  139. package/dist/helpers/matchMedia.native.js.map +7 -0
  140. package/dist/helpers/pseudos.js +1 -0
  141. package/dist/helpers/pseudos.js.map +7 -0
  142. package/dist/helpers/themeable.js +26 -0
  143. package/dist/helpers/themeable.js.map +7 -0
  144. package/dist/hooks/useConstant.js +15 -0
  145. package/dist/hooks/useConstant.js.map +7 -0
  146. package/dist/hooks/useFeatures.js +75 -0
  147. package/dist/hooks/useFeatures.js.map +7 -0
  148. package/dist/hooks/useForceUpdate.js +28 -0
  149. package/dist/hooks/useForceUpdate.js.map +7 -0
  150. package/dist/hooks/useMedia.js +171 -0
  151. package/dist/hooks/useMedia.js.map +7 -0
  152. package/dist/hooks/usePressable.js +13 -0
  153. package/dist/hooks/usePressable.js.map +7 -0
  154. package/dist/hooks/useTheme.js +93 -0
  155. package/dist/hooks/useTheme.js.map +7 -0
  156. package/dist/index.cjs +2125 -0
  157. package/dist/index.cjs.map +7 -0
  158. package/dist/index.js +33 -0
  159. package/dist/index.js.map +7 -0
  160. package/dist/packages/core/src/constants/constants.d.ts +8 -0
  161. package/dist/packages/core/src/constants/constants.d.ts.map +1 -0
  162. package/dist/packages/core/src/constants/platform.d.ts +9 -0
  163. package/dist/packages/core/src/constants/platform.d.ts.map +1 -0
  164. package/dist/packages/core/src/constants/pseudos.d.ts +15 -0
  165. package/dist/packages/core/src/constants/pseudos.d.ts.map +1 -0
  166. package/dist/packages/core/src/constants/rnw.d.ts +2 -0
  167. package/dist/packages/core/src/constants/rnw.d.ts.map +1 -0
  168. package/dist/packages/core/src/createComponent.d.ts +16 -0
  169. package/dist/packages/core/src/createComponent.d.ts.map +1 -0
  170. package/dist/packages/core/src/createShorthands.d.ts +2 -0
  171. package/dist/packages/core/src/createShorthands.d.ts.map +1 -0
  172. package/dist/packages/core/src/createTamagui.d.ts +37 -0
  173. package/dist/packages/core/src/createTamagui.d.ts.map +1 -0
  174. package/dist/packages/core/src/createTheme.d.ts +5 -0
  175. package/dist/packages/core/src/createTheme.d.ts.map +1 -0
  176. package/dist/packages/core/src/createTokens.d.ts +45 -0
  177. package/dist/packages/core/src/createTokens.d.ts.map +1 -0
  178. package/dist/packages/core/src/createVariable.d.ts +14 -0
  179. package/dist/packages/core/src/createVariable.d.ts.map +1 -0
  180. package/dist/packages/core/src/helpers/addStylesUsingClassname.d.ts +2 -0
  181. package/dist/packages/core/src/helpers/addStylesUsingClassname.d.ts.map +1 -0
  182. package/dist/packages/core/src/helpers/createMediaStyle.d.ts +8 -0
  183. package/dist/packages/core/src/helpers/createMediaStyle.d.ts.map +1 -0
  184. package/dist/packages/core/src/helpers/createTamaguiProvider.d.ts +5 -0
  185. package/dist/packages/core/src/helpers/createTamaguiProvider.d.ts.map +1 -0
  186. package/dist/packages/core/src/helpers/extendStaticConfig.d.ts +5 -0
  187. package/dist/packages/core/src/helpers/extendStaticConfig.d.ts.map +1 -0
  188. package/dist/packages/core/src/helpers/fixNativeShadow.d.ts +2 -0
  189. package/dist/packages/core/src/helpers/fixNativeShadow.d.ts.map +1 -0
  190. package/dist/packages/core/src/helpers/fixNativeShadow.native.d.ts +2 -0
  191. package/dist/packages/core/src/helpers/fixNativeShadow.native.d.ts.map +1 -0
  192. package/dist/packages/core/src/helpers/getSplitStyles.d.ts +15 -0
  193. package/dist/packages/core/src/helpers/getSplitStyles.d.ts.map +1 -0
  194. package/dist/packages/core/src/helpers/getStylesAtomic.d.ts +3 -0
  195. package/dist/packages/core/src/helpers/getStylesAtomic.d.ts.map +1 -0
  196. package/dist/packages/core/src/helpers/getStylesAtomic.native.d.ts +2 -0
  197. package/dist/packages/core/src/helpers/getStylesAtomic.native.d.ts.map +1 -0
  198. package/dist/packages/core/src/helpers/insertStyleRule.d.ts +2 -0
  199. package/dist/packages/core/src/helpers/insertStyleRule.d.ts.map +1 -0
  200. package/dist/packages/core/src/helpers/matchMedia.d.ts +2 -0
  201. package/dist/packages/core/src/helpers/matchMedia.d.ts.map +1 -0
  202. package/dist/packages/core/src/helpers/matchMedia.native.d.ts +3 -0
  203. package/dist/packages/core/src/helpers/matchMedia.native.d.ts.map +1 -0
  204. package/dist/packages/core/src/helpers/themeable.d.ts +10 -0
  205. package/dist/packages/core/src/helpers/themeable.d.ts.map +1 -0
  206. package/dist/packages/core/src/hooks/useConstant.d.ts +2 -0
  207. package/dist/packages/core/src/hooks/useConstant.d.ts.map +1 -0
  208. package/dist/packages/core/src/hooks/useFeatures.d.ts +5 -0
  209. package/dist/packages/core/src/hooks/useFeatures.d.ts.map +1 -0
  210. package/dist/packages/core/src/hooks/useForceUpdate.d.ts +2 -0
  211. package/dist/packages/core/src/hooks/useForceUpdate.d.ts.map +1 -0
  212. package/dist/packages/core/src/hooks/useMedia.d.ts +16 -0
  213. package/dist/packages/core/src/hooks/useMedia.d.ts.map +1 -0
  214. package/dist/packages/core/src/hooks/usePressable.d.ts +3 -0
  215. package/dist/packages/core/src/hooks/usePressable.d.ts.map +1 -0
  216. package/dist/packages/core/src/hooks/useTheme.d.ts +18 -0
  217. package/dist/packages/core/src/hooks/useTheme.d.ts.map +1 -0
  218. package/dist/packages/core/src/index.d.ts +27 -0
  219. package/dist/packages/core/src/index.d.ts.map +1 -0
  220. package/dist/packages/core/src/static/postProcessStyles.d.ts +7 -0
  221. package/dist/packages/core/src/static/postProcessStyles.d.ts.map +1 -0
  222. package/dist/packages/core/src/static.d.ts +12 -0
  223. package/dist/packages/core/src/static.d.ts.map +1 -0
  224. package/dist/packages/core/src/styled.d.ts +16 -0
  225. package/dist/packages/core/src/styled.d.ts.map +1 -0
  226. package/dist/packages/core/src/types.d.ts +305 -0
  227. package/dist/packages/core/src/types.d.ts.map +1 -0
  228. package/dist/packages/core/src/views/Animated.d.ts +15 -0
  229. package/dist/packages/core/src/views/Animated.d.ts.map +1 -0
  230. package/dist/packages/core/src/views/Stack.d.ts +3 -0
  231. package/dist/packages/core/src/views/Stack.d.ts.map +1 -0
  232. package/dist/packages/core/src/views/Text.d.ts +3 -0
  233. package/dist/packages/core/src/views/Text.d.ts.map +1 -0
  234. package/dist/packages/core/src/views/TextAncestorContext.d.ts +3 -0
  235. package/dist/packages/core/src/views/TextAncestorContext.d.ts.map +1 -0
  236. package/dist/packages/core/src/views/Theme.d.ts +8 -0
  237. package/dist/packages/core/src/views/Theme.d.ts.map +1 -0
  238. package/dist/packages/core/src/views/ThemeContext.d.ts +18 -0
  239. package/dist/packages/core/src/views/ThemeContext.d.ts.map +1 -0
  240. package/dist/packages/core/src/views/ThemeInverse.d.ts +10 -0
  241. package/dist/packages/core/src/views/ThemeInverse.d.ts.map +1 -0
  242. package/dist/packages/core/src/views/ThemeManagerContext.d.ts +15 -0
  243. package/dist/packages/core/src/views/ThemeManagerContext.d.ts.map +1 -0
  244. package/dist/packages/core/src/views/ThemeProvider.d.ts +10 -0
  245. package/dist/packages/core/src/views/ThemeProvider.d.ts.map +1 -0
  246. package/dist/packages/helpers/src/AllRules.d.ts +3 -0
  247. package/dist/packages/helpers/src/AllRules.d.ts.map +1 -0
  248. package/dist/packages/helpers/src/concatClassName.d.ts +2 -0
  249. package/dist/packages/helpers/src/concatClassName.d.ts.map +1 -0
  250. package/dist/packages/helpers/src/index.d.ts +5 -0
  251. package/dist/packages/helpers/src/index.d.ts.map +1 -0
  252. package/dist/packages/helpers/src/types.d.ts +8 -0
  253. package/dist/packages/helpers/src/types.d.ts.map +1 -0
  254. package/dist/packages/helpers/src/validStyleProps.d.ts +475 -0
  255. package/dist/packages/helpers/src/validStyleProps.d.ts.map +1 -0
  256. package/dist/static/postProcessStyles.js +18 -0
  257. package/dist/static/postProcessStyles.js.map +7 -0
  258. package/dist/static.js +15 -0
  259. package/dist/static.js.map +7 -0
  260. package/dist/styled.js +21 -0
  261. package/dist/styled.js.map +7 -0
  262. package/dist/types.js +1 -0
  263. package/dist/types.js.map +7 -0
  264. package/dist/views/Animated.js +79 -0
  265. package/dist/views/Animated.js.map +7 -0
  266. package/dist/views/SafeAreaProvider.js +30 -0
  267. package/dist/views/SafeAreaProvider.js.map +7 -0
  268. package/dist/views/Stack.js +12 -0
  269. package/dist/views/Stack.js.map +7 -0
  270. package/dist/views/Text.js +60 -0
  271. package/dist/views/Text.js.map +7 -0
  272. package/dist/views/TextAncestorContext.js +18 -0
  273. package/dist/views/TextAncestorContext.js.map +7 -0
  274. package/dist/views/Theme.js +56 -0
  275. package/dist/views/Theme.js.map +7 -0
  276. package/dist/views/ThemeContext.js +6 -0
  277. package/dist/views/ThemeContext.js.map +7 -0
  278. package/dist/views/ThemeInverse.js +27 -0
  279. package/dist/views/ThemeInverse.js.map +7 -0
  280. package/dist/views/ThemeManagerContext.js +55 -0
  281. package/dist/views/ThemeManagerContext.js.map +7 -0
  282. package/dist/views/ThemeProvider.js +45 -0
  283. package/dist/views/ThemeProvider.js.map +7 -0
  284. package/package.json +33 -0
  285. package/src/constants/constants.ts +12 -0
  286. package/src/constants/platform.ts +15 -0
  287. package/src/constants/pseudos.ts +14 -0
  288. package/src/constants/rnw.tsx +20 -0
  289. package/src/createComponent.tsx +596 -0
  290. package/src/createFont.ts +26 -0
  291. package/src/createShorthands.ts +5 -0
  292. package/src/createTamagui.ts +207 -0
  293. package/src/createTheme.ts +19 -0
  294. package/src/createTokens.ts +83 -0
  295. package/src/createVariable.ts +22 -0
  296. package/src/helpers/addStylesUsingClassname.tsx +60 -0
  297. package/src/helpers/createMediaStyle.ts +46 -0
  298. package/src/helpers/createPropMapper.ts +184 -0
  299. package/src/helpers/createTamaguiProvider.tsx +22 -0
  300. package/src/helpers/extendStaticConfig.ts +68 -0
  301. package/src/helpers/fixNativeShadow.native.tsx +27 -0
  302. package/src/helpers/fixNativeShadow.tsx +2 -0
  303. package/src/helpers/getSplitStyles.tsx +210 -0
  304. package/src/helpers/getStylesAtomic.native.ts +3 -0
  305. package/src/helpers/getStylesAtomic.ts +103 -0
  306. package/src/helpers/insertStyleRule.tsx +18 -0
  307. package/src/helpers/isObj.ts +1 -0
  308. package/src/helpers/matchMedia.native.ts +3 -0
  309. package/src/helpers/matchMedia.ts +9 -0
  310. package/src/helpers/themeable.tsx +42 -0
  311. package/src/hooks/useConstant.tsx +10 -0
  312. package/src/hooks/useFeatures.tsx +78 -0
  313. package/src/hooks/useForceUpdate.tsx +26 -0
  314. package/src/hooks/useMedia.tsx +194 -0
  315. package/src/hooks/usePressable.tsx +9 -0
  316. package/src/hooks/useTheme.tsx +107 -0
  317. package/src/index.ts +33 -0
  318. package/src/static/postProcessStyles.tsx +20 -0
  319. package/src/static.ts +22 -0
  320. package/src/styled.ts +82 -0
  321. package/src/types.tsx +561 -0
  322. package/src/views/Animated.tsx +121 -0
  323. package/src/views/SafeAreaProvider.tsx +33 -0
  324. package/src/views/Stack.tsx +21 -0
  325. package/src/views/Text.tsx +66 -0
  326. package/src/views/TextAncestorContext.tsx +12 -0
  327. package/src/views/Theme.tsx +73 -0
  328. package/src/views/ThemeContext.tsx +5 -0
  329. package/src/views/ThemeInverse.tsx +23 -0
  330. package/src/views/ThemeManagerContext.tsx +50 -0
  331. package/src/views/ThemeProvider.tsx +52 -0
  332. package/tsconfig.json +8 -0
  333. package/types.d.ts +558 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/views/Text.tsx"],
4
+ "sourcesContent": ["import { isWeb } from '../constants/platform'\nimport { createComponent } from '../createComponent'\nimport { stylePropsTextOnly, validStyles } from '../static'\nimport { TextProps } from '../types'\n\nconst ellipseStyle = {\n maxWidth: '100%',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n}\n\nexport const Text = createComponent<TextProps>({\n isText: true,\n defaultProps: {\n display: isWeb ? 'inline' : 'inline-flex',\n boxSizing: 'border-box',\n fontFamily: 'System',\n wordWrap: 'break-word',\n },\n variants: {\n numberOfLines: {\n 1: ellipseStyle,\n // TODO imply fn, test 1, could do types `>1` `<2`\n '[number]': (lines) => (lines > 1 ? { WebkitLineClamp: 1 } : null),\n },\n\n selectable: {\n true: {\n userSelect: 'text',\n },\n false: {\n userSelect: 'none',\n },\n },\n\n pressable: {\n true: {\n cursor: 'pointer',\n },\n },\n\n ellipse: {\n true: isWeb\n ? ellipseStyle\n : {\n numberOfLines: 1,\n lineBreakMode: 'clip',\n },\n },\n },\n // TODO document\n deoptProps: new Set(isWeb ? [] : ['ellipse']),\n validStyles: {\n ...validStyles,\n ...stylePropsTextOnly,\n ...(isWeb && {\n userSelect: true,\n textOverflow: true,\n whiteSpace: true,\n wordWrap: true,\n selectable: true,\n cursor: true,\n }),\n },\n})\n"],
5
+ "mappings": "AAAA;AACA;AACA;AAGA,MAAM,eAAe;AAAA,EACnB,UAAU;AAAA,EACV,UAAU;AAAA,EACV,cAAc;AAAA,EACd,YAAY;AAAA;AAGP,MAAM,OAAO,gBAA2B;AAAA,EAC7C,QAAQ;AAAA,EACR,cAAc;AAAA,IACZ,SAAS,QAAQ,WAAW;AAAA,IAC5B,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,UAAU;AAAA;AAAA,EAEZ,UAAU;AAAA,IACR,eAAe;AAAA,MACb,GAAG;AAAA,MAEH,YAAY,CAAC,UAAW,QAAQ,IAAI,EAAE,iBAAiB,MAAM;AAAA;AAAA,IAG/D,YAAY;AAAA,MACV,MAAM;AAAA,QACJ,YAAY;AAAA;AAAA,MAEd,OAAO;AAAA,QACL,YAAY;AAAA;AAAA;AAAA,IAIhB,WAAW;AAAA,MACT,MAAM;AAAA,QACJ,QAAQ;AAAA;AAAA;AAAA,IAIZ,SAAS;AAAA,MACP,MAAM,QACF,eACA;AAAA,QACE,eAAe;AAAA,QACf,eAAe;AAAA;AAAA;AAAA;AAAA,EAKzB,YAAY,IAAI,IAAI,QAAQ,KAAK,CAAC;AAAA,EAClC,aAAa;AAAA,OACR;AAAA,OACA;AAAA,OACC,SAAS;AAAA,MACX,YAAY;AAAA,MACZ,cAAc;AAAA,MACd,YAAY;AAAA,MACZ,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,QAAQ;AAAA;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,19 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+ var _a;
4
+ import React from "react";
5
+ import { rnw } from "../constants/rnw";
6
+ const TextAncestorContext = (_a = rnw) == null ? void 0 : _a.TextAncestorContext;
7
+ const TextAncestorProvider = /* @__PURE__ */ __name((props) => {
8
+ if (TextAncestorContext) {
9
+ return /* @__PURE__ */ React.createElement(TextAncestorContext.Provider, {
10
+ value: false
11
+ }, props.children);
12
+ }
13
+ return props.children;
14
+ }, "TextAncestorProvider");
15
+ export {
16
+ TextAncestorContext,
17
+ TextAncestorProvider
18
+ };
19
+ //# sourceMappingURL=TextAncestorContext.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/views/TextAncestorContext.tsx"],
4
+ "sourcesContent": ["import React from 'react'\n\nimport { rnw } from '../constants/rnw'\n\nexport const TextAncestorContext = rnw?.TextAncestorContext\n\nexport const TextAncestorProvider = (props) => {\n if (TextAncestorContext) {\n return <TextAncestorContext.Provider value={false}>{props.children}</TextAncestorContext.Provider>\n }\n return props.children\n}\n"],
5
+ "mappings": ";;AAAA;AAAA;AAEA;AAEO,MAAM,sBAAsB,iCAAK;AAEjC,MAAM,uBAAuB,wBAAC,UAAU;AAC7C,MAAI,qBAAqB;AACvB,WAAO,oCAAC,oBAAoB,UAArB;AAAA,MAA8B,OAAO;AAAA,OAAQ,MAAM;AAAA;AAE5D,SAAO,MAAM;AAAA,GAJqB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,57 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+ import React, { useContext, useState } from "react";
4
+ import { isWeb, useIsomorphicLayoutEffect } from "../constants/platform";
5
+ import { getThemeParentClassName } from "../createTamagui";
6
+ import { useConstant } from "../hooks/useConstant";
7
+ import { ThemeContext } from "./ThemeContext";
8
+ import { ThemeManager, ThemeManagerContext } from "./ThemeManagerContext";
9
+ const Theme = /* @__PURE__ */ __name((props) => {
10
+ var _a, _b;
11
+ const parent = useContext(ThemeManagerContext);
12
+ const themes = useContext(ThemeContext);
13
+ const [parentName, setParentName] = useState(parent.name || "light");
14
+ if (!themes) {
15
+ console.warn("no themes???", props);
16
+ return props.children;
17
+ }
18
+ const name = props.name;
19
+ const theme = themes[name] || themes[`${name}-${parentName}`];
20
+ const themeManager = useConstant(() => {
21
+ const manager = new ThemeManager();
22
+ if (name) {
23
+ manager.setActiveTheme(name, themes[name]);
24
+ }
25
+ return manager;
26
+ });
27
+ useIsomorphicLayoutEffect(() => {
28
+ themeManager.setActiveTheme(name, theme);
29
+ return parent.onChangeTheme((next) => {
30
+ if (next) {
31
+ themeManager.setActiveTheme(next, themes[next]);
32
+ setParentName(next);
33
+ }
34
+ });
35
+ }, [themes, name]);
36
+ if (!name) {
37
+ return props.children;
38
+ }
39
+ const contents = themeManager ? /* @__PURE__ */ React.createElement(ThemeManagerContext.Provider, {
40
+ value: themeManager
41
+ }, props.children) : props.children;
42
+ if (isWeb) {
43
+ if (props.disableThemeClass) {
44
+ return contents;
45
+ }
46
+ const color = (_b = (_a = themes[name]) == null ? void 0 : _a["color"]) == null ? void 0 : _b["variable"];
47
+ return /* @__PURE__ */ React.createElement("div", {
48
+ className: getThemeParentClassName(name),
49
+ style: { display: "contents", color }
50
+ }, contents);
51
+ }
52
+ return contents;
53
+ }, "Theme");
54
+ export {
55
+ Theme
56
+ };
57
+ //# sourceMappingURL=Theme.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/views/Theme.tsx"],
4
+ "sourcesContent": ["import React, { useContext, useState } from 'react'\n\nimport { isWeb, useIsomorphicLayoutEffect } from '../constants/platform'\nimport { getThemeParentClassName } from '../createTamagui'\nimport { useConstant } from '../hooks/useConstant'\nimport { ThemeName, Themes } from '../types'\nimport { ThemeContext } from './ThemeContext'\nimport { ThemeManager, ThemeManagerContext } from './ThemeManagerContext'\n\nexport type ThemeProps = {\n disableThemeClass?: boolean\n name: ThemeName | null\n children?: any\n}\n\nexport const Theme = (props: ThemeProps) => {\n const parent = useContext(ThemeManagerContext)\n const themes = useContext(ThemeContext)\n const [parentName, setParentName] = useState(parent.name || 'light')\n if (!themes) {\n console.warn('no themes???', props)\n return props.children\n }\n const name = props.name as string\n const theme = themes[name] || themes[`${name}-${parentName}`]\n const themeManager = useConstant<ThemeManager>(() => {\n const manager = new ThemeManager()\n if (name) {\n manager.setActiveTheme(name, themes[name])\n }\n return manager\n })\n\n useIsomorphicLayoutEffect(() => {\n themeManager.setActiveTheme(name, theme)\n return parent.onChangeTheme((next) => {\n if (next) {\n themeManager.setActiveTheme(next, themes[next])\n setParentName(next)\n }\n })\n }, [themes, name])\n\n if (!name) {\n return props.children\n }\n\n const contents = themeManager ? (\n <ThemeManagerContext.Provider value={themeManager}>\n {props.children}\n </ThemeManagerContext.Provider>\n ) : (\n props.children\n )\n\n if (isWeb) {\n if (props.disableThemeClass) {\n return contents\n }\n const color = themes[name]?.['color']?.['variable']\n return (\n <div\n className={getThemeParentClassName(name)}\n // in order to provide currentColor, set color by default\n style={{ display: 'contents', color }}\n >\n {contents}\n </div>\n )\n }\n\n return contents\n}\n"],
5
+ "mappings": ";;AAAA;AAEA;AACA;AACA;AAEA;AACA;AAQO,MAAM,QAAQ,wBAAC,UAAsB;AAf5C;AAgBE,QAAM,SAAS,WAAW;AAC1B,QAAM,SAAS,WAAW;AAC1B,QAAM,CAAC,YAAY,iBAAiB,SAAS,OAAO,QAAQ;AAC5D,MAAI,CAAC,QAAQ;AACX,YAAQ,KAAK,gBAAgB;AAC7B,WAAO,MAAM;AAAA;AAEf,QAAM,OAAO,MAAM;AACnB,QAAM,QAAQ,OAAO,SAAS,OAAO,GAAG,QAAQ;AAChD,QAAM,eAAe,YAA0B,MAAM;AACnD,UAAM,UAAU,IAAI;AACpB,QAAI,MAAM;AACR,cAAQ,eAAe,MAAM,OAAO;AAAA;AAEtC,WAAO;AAAA;AAGT,4BAA0B,MAAM;AAC9B,iBAAa,eAAe,MAAM;AAClC,WAAO,OAAO,cAAc,CAAC,SAAS;AACpC,UAAI,MAAM;AACR,qBAAa,eAAe,MAAM,OAAO;AACzC,sBAAc;AAAA;AAAA;AAAA,KAGjB,CAAC,QAAQ;AAEZ,MAAI,CAAC,MAAM;AACT,WAAO,MAAM;AAAA;AAGf,QAAM,WAAW,eACf,oCAAC,oBAAoB,UAArB;AAAA,IAA8B,OAAO;AAAA,KAClC,MAAM,YAGT,MAAM;AAGR,MAAI,OAAO;AACT,QAAI,MAAM,mBAAmB;AAC3B,aAAO;AAAA;AAET,UAAM,QAAQ,mBAAO,UAAP,mBAAe,aAAf,mBAA0B;AACxC,WACE,oCAAC,OAAD;AAAA,MACE,WAAW,wBAAwB;AAAA,MAEnC,OAAO,EAAE,SAAS,YAAY;AAAA,OAE7B;AAAA;AAKP,SAAO;AAAA,GAxDY;",
6
+ "names": []
7
+ }
@@ -0,0 +1,6 @@
1
+ import { createContext } from "react";
2
+ const ThemeContext = createContext(null);
3
+ export {
4
+ ThemeContext
5
+ };
6
+ //# sourceMappingURL=ThemeContext.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/views/ThemeContext.tsx"],
4
+ "sourcesContent": ["import { createContext } from 'react'\n\nimport { Themes } from '../types'\n\nexport const ThemeContext = createContext<Themes>(null as any)\n"],
5
+ "mappings": "AAAA;AAIO,MAAM,eAAe,cAAsB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,27 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+ import React from "react";
4
+ import { useDefaultThemeName, useThemeName } from "../hooks/useTheme";
5
+ import { Theme } from "./Theme";
6
+ let inversions = {
7
+ light: "dark",
8
+ dark: "light"
9
+ };
10
+ function setThemeInversions(next) {
11
+ inversions = next;
12
+ }
13
+ __name(setThemeInversions, "setThemeInversions");
14
+ const ThemeInverse = /* @__PURE__ */ __name((props) => {
15
+ const themeName = useThemeName();
16
+ const defaultTheme = useDefaultThemeName();
17
+ const name = inversions[themeName] || inversions[defaultTheme] || null;
18
+ console.log("todo fixme invert", { themeName, defaultTheme, next: name });
19
+ return /* @__PURE__ */ React.createElement(Theme, {
20
+ name
21
+ }, props.children);
22
+ }, "ThemeInverse");
23
+ export {
24
+ ThemeInverse,
25
+ setThemeInversions
26
+ };
27
+ //# sourceMappingURL=ThemeInverse.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/views/ThemeInverse.tsx"],
4
+ "sourcesContent": ["import React from 'react'\n\nimport { useDefaultThemeName, useThemeName } from '../hooks/useTheme'\nimport { Theme } from './Theme'\n\ntype StringRecord = { [key: string]: string }\n\nlet inversions: StringRecord = {\n light: 'dark',\n dark: 'light',\n}\n\nexport function setThemeInversions(next: StringRecord) {\n inversions = next\n}\n\nexport const ThemeInverse = (props: { children: any }) => {\n const themeName = useThemeName()\n const defaultTheme = useDefaultThemeName()\n const name = inversions[themeName] || inversions[defaultTheme] || null\n console.log('todo fixme invert', { themeName, defaultTheme, next: name })\n return <Theme name={name}>{props.children}</Theme>\n}\n"],
5
+ "mappings": ";;AAAA;AAEA;AACA;AAIA,IAAI,aAA2B;AAAA,EAC7B,OAAO;AAAA,EACP,MAAM;AAAA;AAGD,4BAA4B,MAAoB;AACrD,eAAa;AAAA;AADC;AAIT,MAAM,eAAe,wBAAC,UAA6B;AACxD,QAAM,YAAY;AAClB,QAAM,eAAe;AACrB,QAAM,OAAO,WAAW,cAAc,WAAW,iBAAiB;AAClE,UAAQ,IAAI,qBAAqB,EAAE,WAAW,cAAc,MAAM;AAClE,SAAO,oCAAC,OAAD;AAAA,IAAO;AAAA,KAAa,MAAM;AAAA,GALP;",
6
+ "names": []
7
+ }
@@ -0,0 +1,56 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+ import { createContext } from "react";
4
+ class ThemeManager {
5
+ constructor() {
6
+ this.name = "light";
7
+ this.keys = new Map();
8
+ this.listeners = new Map();
9
+ this.callbacks = new Set();
10
+ this.theme = null;
11
+ }
12
+ setActiveTheme(name, theme) {
13
+ if (name === this.name)
14
+ return;
15
+ this.name = name;
16
+ this.theme = theme;
17
+ this.update();
18
+ }
19
+ track(uuid, keys) {
20
+ if (!this.name)
21
+ return;
22
+ this.keys.set(uuid, keys);
23
+ }
24
+ update() {
25
+ var _a;
26
+ if (!this.name) {
27
+ this.keys.clear();
28
+ }
29
+ for (const [uuid, keys] of this.keys.entries()) {
30
+ if (keys.size) {
31
+ (_a = this.listeners.get(uuid)) == null ? void 0 : _a();
32
+ }
33
+ }
34
+ this.callbacks.forEach((cb) => cb(this.name));
35
+ }
36
+ onChangeTheme(cb) {
37
+ this.callbacks.add(cb);
38
+ return () => {
39
+ this.callbacks.delete(cb);
40
+ };
41
+ }
42
+ onUpdate(uuid, cb) {
43
+ this.listeners.set(uuid, cb);
44
+ return () => {
45
+ this.listeners.delete(uuid);
46
+ this.keys.delete(uuid);
47
+ };
48
+ }
49
+ }
50
+ __name(ThemeManager, "ThemeManager");
51
+ const ThemeManagerContext = createContext(new ThemeManager());
52
+ export {
53
+ ThemeManager,
54
+ ThemeManagerContext
55
+ };
56
+ //# sourceMappingURL=ThemeManagerContext.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/views/ThemeManagerContext.tsx"],
4
+ "sourcesContent": ["import { createContext } from 'react'\n\nexport class ThemeManager {\n name: string | null = 'light'\n keys = new Map<any, Set<string>>()\n listeners = new Map<any, Function>()\n callbacks = new Set<Function>()\n theme = null\n\n setActiveTheme(name: string | null, theme?: any) {\n if (name === this.name) return\n this.name = name\n this.theme = theme\n this.update()\n }\n\n track(uuid: any, keys: Set<string>) {\n if (!this.name) return\n this.keys.set(uuid, keys)\n }\n\n update() {\n if (!this.name) {\n this.keys.clear()\n }\n for (const [uuid, keys] of this.keys.entries()) {\n if (keys.size) {\n this.listeners.get(uuid)?.()\n }\n }\n this.callbacks.forEach((cb) => cb(this.name))\n }\n\n onChangeTheme(cb: (name: string | null) => void) {\n this.callbacks.add(cb)\n return () => {\n this.callbacks.delete(cb)\n }\n }\n\n onUpdate(uuid: any, cb: Function) {\n this.listeners.set(uuid, cb)\n return () => {\n this.listeners.delete(uuid)\n this.keys.delete(uuid)\n }\n }\n}\n\nexport const ThemeManagerContext = createContext<ThemeManager>(new ThemeManager())\n"],
5
+ "mappings": ";;AAAA;AAEO,mBAAmB;AAAA,EAAnB,cAFP;AAGE,gBAAsB;AACtB,gBAAO,IAAI;AACX,qBAAY,IAAI;AAChB,qBAAY,IAAI;AAChB,iBAAQ;AAAA;AAAA,EAER,eAAe,MAAqB,OAAa;AAC/C,QAAI,SAAS,KAAK;AAAM;AACxB,SAAK,OAAO;AACZ,SAAK,QAAQ;AACb,SAAK;AAAA;AAAA,EAGP,MAAM,MAAW,MAAmB;AAClC,QAAI,CAAC,KAAK;AAAM;AAChB,SAAK,KAAK,IAAI,MAAM;AAAA;AAAA,EAGtB,SAAS;AArBX;AAsBI,QAAI,CAAC,KAAK,MAAM;AACd,WAAK,KAAK;AAAA;AAEZ,eAAW,CAAC,MAAM,SAAS,KAAK,KAAK,WAAW;AAC9C,UAAI,KAAK,MAAM;AACb,mBAAK,UAAU,IAAI,UAAnB;AAAA;AAAA;AAGJ,SAAK,UAAU,QAAQ,CAAC,OAAO,GAAG,KAAK;AAAA;AAAA,EAGzC,cAAc,IAAmC;AAC/C,SAAK,UAAU,IAAI;AACnB,WAAO,MAAM;AACX,WAAK,UAAU,OAAO;AAAA;AAAA;AAAA,EAI1B,SAAS,MAAW,IAAc;AAChC,SAAK,UAAU,IAAI,MAAM;AACzB,WAAO,MAAM;AACX,WAAK,UAAU,OAAO;AACtB,WAAK,KAAK,OAAO;AAAA;AAAA;AAAA;AA1ChB;AA+CA,MAAM,sBAAsB,cAA4B,IAAI;",
6
+ "names": []
7
+ }
@@ -0,0 +1,45 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+ import React, { useMemo } from "react";
4
+ import { useIsomorphicLayoutEffect } from "../constants/platform";
5
+ import { getHasConfigured, getThemeParentClassName } from "../createTamagui";
6
+ import { Theme } from "./Theme";
7
+ import { ThemeContext } from "./ThemeContext";
8
+ const GET_DEFAULT_THEME = "___TGUI";
9
+ const ThemeProvider = /* @__PURE__ */ __name((props) => {
10
+ if (!getHasConfigured()) {
11
+ throw new Error(`Missing configureThemes() call, add to your root file`);
12
+ }
13
+ useIsomorphicLayoutEffect(() => {
14
+ if (props.disableRootThemeClass) {
15
+ return;
16
+ }
17
+ if (typeof document !== "undefined") {
18
+ const cns = getThemeParentClassName(`${props.defaultTheme}`).split(" ");
19
+ cns.forEach((cn) => document.body.classList.add(cn));
20
+ return () => {
21
+ cns.forEach((cn) => document.body.classList.remove(cn));
22
+ };
23
+ }
24
+ }, []);
25
+ const themeContext = useMemo(() => {
26
+ return new Proxy(props.themes, {
27
+ get(target, key) {
28
+ if (key === GET_DEFAULT_THEME)
29
+ return props.defaultTheme;
30
+ return Reflect.get(target, key);
31
+ }
32
+ });
33
+ }, [props.themes]);
34
+ return /* @__PURE__ */ React.createElement(ThemeContext.Provider, {
35
+ value: themeContext
36
+ }, /* @__PURE__ */ React.createElement(Theme, {
37
+ name: props.defaultTheme,
38
+ disableThemeClass: props.disableRootThemeClass
39
+ }, props.children));
40
+ }, "ThemeProvider");
41
+ export {
42
+ GET_DEFAULT_THEME,
43
+ ThemeProvider
44
+ };
45
+ //# sourceMappingURL=ThemeProvider.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/views/ThemeProvider.tsx"],
4
+ "sourcesContent": ["import React, { useMemo } from 'react'\n\nimport { useIsomorphicLayoutEffect } from '../constants/platform'\nimport { getHasConfigured, getThemeParentClassName } from '../createTamagui'\nimport { Theme } from './Theme'\nimport { ThemeContext } from './ThemeContext'\n\nexport type ThemeProviderProps = {\n themes: any\n defaultTheme: string\n disableRootThemeClass?: boolean\n children?: any\n}\n\nexport const GET_DEFAULT_THEME = '___TGUI'\n\nexport const ThemeProvider = (props: ThemeProviderProps) => {\n if (!getHasConfigured()) {\n throw new Error(`Missing configureThemes() call, add to your root file`)\n }\n\n // ensure theme is attached to root body node as well to work with modals by default\n useIsomorphicLayoutEffect(() => {\n if (props.disableRootThemeClass) {\n return\n }\n if (typeof document !== 'undefined') {\n const cns = getThemeParentClassName(`${props.defaultTheme}`).split(' ')\n cns.forEach((cn) => document.body.classList.add(cn))\n return () => {\n cns.forEach((cn) => document.body.classList.remove(cn))\n }\n }\n }, [])\n\n const themeContext = useMemo(() => {\n return new Proxy(props.themes, {\n get(target, key) {\n if (key === GET_DEFAULT_THEME) return props.defaultTheme\n return Reflect.get(target, key)\n },\n })\n }, [props.themes])\n\n return (\n <ThemeContext.Provider value={themeContext}>\n <Theme name={props.defaultTheme} disableThemeClass={props.disableRootThemeClass}>\n {props.children}\n </Theme>\n </ThemeContext.Provider>\n )\n}\n"],
5
+ "mappings": ";;AAAA;AAEA;AACA;AACA;AACA;AASO,MAAM,oBAAoB;AAE1B,MAAM,gBAAgB,wBAAC,UAA8B;AAC1D,MAAI,CAAC,oBAAoB;AACvB,UAAM,IAAI,MAAM;AAAA;AAIlB,4BAA0B,MAAM;AAC9B,QAAI,MAAM,uBAAuB;AAC/B;AAAA;AAEF,QAAI,OAAO,aAAa,aAAa;AACnC,YAAM,MAAM,wBAAwB,GAAG,MAAM,gBAAgB,MAAM;AACnE,UAAI,QAAQ,CAAC,OAAO,SAAS,KAAK,UAAU,IAAI;AAChD,aAAO,MAAM;AACX,YAAI,QAAQ,CAAC,OAAO,SAAS,KAAK,UAAU,OAAO;AAAA;AAAA;AAAA,KAGtD;AAEH,QAAM,eAAe,QAAQ,MAAM;AACjC,WAAO,IAAI,MAAM,MAAM,QAAQ;AAAA,MAC7B,IAAI,QAAQ,KAAK;AACf,YAAI,QAAQ;AAAmB,iBAAO,MAAM;AAC5C,eAAO,QAAQ,IAAI,QAAQ;AAAA;AAAA;AAAA,KAG9B,CAAC,MAAM;AAEV,SACE,oCAAC,aAAa,UAAd;AAAA,IAAuB,OAAO;AAAA,KAC5B,oCAAC,OAAD;AAAA,IAAO,MAAM,MAAM;AAAA,IAAc,mBAAmB,MAAM;AAAA,KACvD,MAAM;AAAA,GA/Bc;",
6
+ "names": []
7
+ }
@@ -0,0 +1,14 @@
1
+ import { isWeb } from "./platform";
2
+ const stackDefaultStyles = {
3
+ alignItems: "stretch",
4
+ flexShrink: 0,
5
+ ...isWeb && {
6
+ display: "flex",
7
+ flexBasis: "auto",
8
+ boxSizing: "border-box"
9
+ }
10
+ };
11
+ export {
12
+ stackDefaultStyles
13
+ };
14
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/constants/constants.ts"],
4
+ "sourcesContent": ["import { isWeb } from './platform'\n\nexport const stackDefaultStyles = {\n alignItems: 'stretch',\n flexShrink: 0,\n // more accurately match react-native defaults on web\n ...(isWeb && {\n display: 'flex',\n flexBasis: 'auto',\n boxSizing: 'border-box',\n }),\n}\n"],
5
+ "mappings": "AAAA;AAEO,MAAM,qBAAqB;AAAA,EAChC,YAAY;AAAA,EACZ,YAAY;AAAA,KAER,SAAS;AAAA,IACX,SAAS;AAAA,IACT,WAAW;AAAA,IACX,WAAW;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,19 @@
1
+ import { useEffect, useLayoutEffect } from "react";
2
+ import { Platform } from "react-native";
3
+ const isWeb = process.env.TAMAGUI_TARGET !== "web" ? false : Platform?.OS === "web";
4
+ const isSSR = isWeb && typeof window === "undefined";
5
+ const useIsomorphicLayoutEffect = isSSR ? useEffect : useLayoutEffect;
6
+ const isChrome = typeof navigator !== "undefined" && /Chrome/.test(navigator.userAgent || "");
7
+ const supportsTouchWeb = typeof window !== "undefined" && "ontouchstart" in window;
8
+ const isTouchDevice = !isWeb || supportsTouchWeb;
9
+ const isWebIOS = isWeb && typeof navigator !== "undefined" && (/iPad|iPhone|iPod/.test(navigator.platform) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1) && !window["MSStream"];
10
+ export {
11
+ isChrome,
12
+ isSSR,
13
+ isTouchDevice,
14
+ isWeb,
15
+ isWebIOS,
16
+ supportsTouchWeb,
17
+ useIsomorphicLayoutEffect
18
+ };
19
+ //# sourceMappingURL=platform.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/constants/platform.ts"],
4
+ "sourcesContent": ["import { useEffect, useLayoutEffect } from 'react'\nimport { Platform } from 'react-native'\n\nexport const isWeb = process.env.TAMAGUI_TARGET !== 'web' ? false : Platform?.OS === 'web'\nexport const isSSR = isWeb && typeof window === 'undefined'\nexport const useIsomorphicLayoutEffect = isSSR ? useEffect : useLayoutEffect\nexport const isChrome = typeof navigator !== 'undefined' && /Chrome/.test(navigator.userAgent || '')\nexport const supportsTouchWeb = typeof window !== 'undefined' && 'ontouchstart' in window\nexport const isTouchDevice = !isWeb || supportsTouchWeb\nexport const isWebIOS =\n isWeb &&\n typeof navigator !== 'undefined' &&\n (/iPad|iPhone|iPod/.test(navigator.platform) ||\n (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) &&\n !window['MSStream']\n"],
5
+ "mappings": "AAAA;AACA;AAEO,MAAM,QAAQ,QAAQ,IAAI,mBAAmB,QAAQ,QAAQ,UAAU,OAAO;AAC9E,MAAM,QAAQ,SAAS,OAAO,WAAW;AACzC,MAAM,4BAA4B,QAAQ,YAAY;AACtD,MAAM,WAAW,OAAO,cAAc,eAAe,SAAS,KAAK,UAAU,aAAa;AAC1F,MAAM,mBAAmB,OAAO,WAAW,eAAe,kBAAkB;AAC5E,MAAM,gBAAgB,CAAC,SAAS;AAChC,MAAM,WACX,SACA,OAAO,cAAc,eACpB,oBAAmB,KAAK,UAAU,aAChC,UAAU,aAAa,cAAc,UAAU,iBAAiB,MACnE,CAAC,OAAO;",
6
+ "names": []
7
+ }
@@ -0,0 +1,18 @@
1
+ const pseudos = {
2
+ focusStyle: {
3
+ name: "focus",
4
+ priority: 3
5
+ },
6
+ pressStyle: {
7
+ name: "active",
8
+ priority: 2
9
+ },
10
+ hoverStyle: {
11
+ name: "hover",
12
+ priority: 1
13
+ }
14
+ };
15
+ export {
16
+ pseudos
17
+ };
18
+ //# sourceMappingURL=pseudos.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/constants/pseudos.ts"],
4
+ "sourcesContent": ["export const pseudos = {\n focusStyle: {\n name: 'focus',\n priority: 3,\n },\n pressStyle: {\n name: 'active',\n priority: 2,\n },\n hoverStyle: {\n name: 'hover',\n priority: 1,\n },\n}\n"],
5
+ "mappings": "AAAO,MAAM,UAAU;AAAA,EACrB,YAAY;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA;AAAA,EAEZ,YAAY;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA;AAAA,EAEZ,YAAY;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,22 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+ const interopRequire = /* @__PURE__ */ __name((src) => "default" in src ? src.default : src, "interopRequire");
4
+ const rnw = {};
5
+ if (process.env.IS_STATIC === "is_static") {
6
+ const createCompileableStyle = require("react-native-web/dist/cjs/exports/StyleSheet/createCompileableStyle");
7
+ const createReactDOMStyle = require("react-native-web/dist/cjs/exports/StyleSheet/createReactDOMStyle");
8
+ const i18Style = require("react-native-web/dist/cjs/exports/StyleSheet/i18nStyle");
9
+ const atomic = require("react-native-web/dist/cjs/exports/StyleSheet/compile").atomic;
10
+ Object.assign(rnw, {
11
+ createCompileableStyle,
12
+ createReactDOMStyle,
13
+ i18Style,
14
+ atomic
15
+ });
16
+ } else if (process.env.TAMAGUI_TARGET === "web") {
17
+ Object.assign(rnw, interopRequire(require("react-native-web").TamaguiExports));
18
+ }
19
+ export {
20
+ rnw
21
+ };
22
+ //# sourceMappingURL=rnw.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/constants/rnw.tsx"],
4
+ "sourcesContent": ["const interopRequire = (src: any) => ('default' in src ? src.default : src)\n\nexport const rnw: Record<string, any> = {}\n\n// in static mode, require them directly since we can't import react-native-web at all (it has flow stuff in it)\nif (process.env.IS_STATIC === 'is_static') {\n const createCompileableStyle = require('react-native-web/dist/cjs/exports/StyleSheet/createCompileableStyle')\n const createReactDOMStyle = require('react-native-web/dist/cjs/exports/StyleSheet/createReactDOMStyle')\n const i18Style = require('react-native-web/dist/cjs/exports/StyleSheet/i18nStyle')\n const atomic = require('react-native-web/dist/cjs/exports/StyleSheet/compile').atomic\n Object.assign(rnw, {\n createCompileableStyle,\n createReactDOMStyle,\n i18Style,\n atomic,\n })\n} else if (process.env.TAMAGUI_TARGET === 'web') {\n // when targeting web (client) import it like so\n Object.assign(rnw, interopRequire(require('react-native-web').TamaguiExports))\n}\n"],
5
+ "mappings": ";;AAAA,MAAM,iBAAiB,wBAAC,QAAc,aAAa,MAAM,IAAI,UAAU,KAAhD;AAEhB,MAAM,MAA2B;AAGxC,IAAI,QAAQ,IAAI,cAAc,aAAa;AACzC,QAAM,yBAAyB,QAAQ;AACvC,QAAM,sBAAsB,QAAQ;AACpC,QAAM,WAAW,QAAQ;AACzB,QAAM,SAAS,QAAQ,wDAAwD;AAC/E,SAAO,OAAO,KAAK;AAAA,IACjB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA,WAEO,QAAQ,IAAI,mBAAmB,OAAO;AAE/C,SAAO,OAAO,KAAK,eAAe,QAAQ,oBAAoB;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,46 @@
1
+ import { StyleSheet } from "react-native";
2
+ import { isWeb } from "./platform";
3
+ import { rnw } from "./rnw";
4
+ const disabledStyle = {
5
+ pointerEvents: "none",
6
+ userSelect: "none"
7
+ };
8
+ const cssTextStyles = {
9
+ textHasAncestor: {
10
+ color: "inherit",
11
+ font: "inherit",
12
+ whiteSpace: "inherit"
13
+ },
14
+ textMultiLine: {
15
+ display: "-webkit-box",
16
+ maxWidth: "100%",
17
+ overflow: "hidden",
18
+ textOverflow: "ellipsis",
19
+ WebkitBoxOrient: "vertical"
20
+ }
21
+ };
22
+ const cssText = isWeb ? rnw?.css.create(cssTextStyles) : {};
23
+ const viewStyles = StyleSheet.create({
24
+ inline: isWeb ? {
25
+ display: "inline-flex"
26
+ } : {}
27
+ });
28
+ const textStyles = isWeb ? StyleSheet.create({
29
+ notSelectable: {
30
+ userSelect: "none"
31
+ },
32
+ selectable: {
33
+ userSelect: "text"
34
+ },
35
+ pressable: {
36
+ cursor: "pointer"
37
+ }
38
+ }) : {};
39
+ export {
40
+ cssText,
41
+ cssTextStyles,
42
+ disabledStyle,
43
+ textStyles,
44
+ viewStyles
45
+ };
46
+ //# sourceMappingURL=styleConstants.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/constants/styleConstants.tsx"],
4
+ "sourcesContent": ["import { StyleSheet } from 'react-native'\n\nimport { isWeb } from './platform'\nimport { rnw } from './rnw'\n\nexport const disabledStyle = {\n pointerEvents: 'none',\n userSelect: 'none',\n} as const\n\nexport const cssTextStyles = {\n textHasAncestor: {\n color: 'inherit',\n font: 'inherit',\n whiteSpace: 'inherit',\n },\n textMultiLine: {\n display: '-webkit-box',\n maxWidth: '100%',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n WebkitBoxOrient: 'vertical',\n },\n}\n\nexport const cssText = isWeb ? rnw?.css.create(cssTextStyles) : {}\n\nexport const viewStyles = StyleSheet.create({\n inline: isWeb\n ? {\n display: 'inline-flex' as any,\n }\n : {},\n})\n\nexport const textStyles = isWeb\n ? StyleSheet.create({\n notSelectable: {\n // @ts-ignore\n userSelect: 'none',\n },\n selectable: {\n // @ts-ignore\n userSelect: 'text',\n },\n pressable: {\n // @ts-ignore\n cursor: 'pointer',\n },\n })\n : {}\n"],
5
+ "mappings": "AAAA;AAEA;AACA;AAEO,MAAM,gBAAgB;AAAA,EAC3B,eAAe;AAAA,EACf,YAAY;AAAA;AAGP,MAAM,gBAAgB;AAAA,EAC3B,iBAAiB;AAAA,IACf,OAAO;AAAA,IACP,MAAM;AAAA,IACN,YAAY;AAAA;AAAA,EAEd,eAAe;AAAA,IACb,SAAS;AAAA,IACT,UAAU;AAAA,IACV,UAAU;AAAA,IACV,cAAc;AAAA,IACd,iBAAiB;AAAA;AAAA;AAId,MAAM,UAAU,QAAQ,KAAK,IAAI,OAAO,iBAAiB;AAEzD,MAAM,aAAa,WAAW,OAAO;AAAA,EAC1C,QAAQ,QACJ;AAAA,IACE,SAAS;AAAA,MAEX;AAAA;AAGC,MAAM,aAAa,QACtB,WAAW,OAAO;AAAA,EAChB,eAAe;AAAA,IAEb,YAAY;AAAA;AAAA,EAEd,YAAY;AAAA,IAEV,YAAY;AAAA;AAAA,EAEd,WAAW;AAAA,IAET,QAAQ;AAAA;AAAA,KAGZ;",
6
+ "names": []
7
+ }