@tamagui/core 1.0.0-beta.8 → 1.0.1-beta.100

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 (559) hide show
  1. package/dist/cjs/Pressability.js +28 -0
  2. package/dist/cjs/Pressability.js.map +7 -0
  3. package/dist/cjs/Pressability.native.js +28 -0
  4. package/dist/cjs/Pressability.native.js.map +7 -0
  5. package/dist/cjs/Tamagui.js +6 -8
  6. package/dist/cjs/Tamagui.js.map +2 -2
  7. package/dist/cjs/ThemeManager.js +25 -32
  8. package/dist/cjs/ThemeManager.js.map +2 -2
  9. package/dist/cjs/conf.js +20 -15
  10. package/dist/cjs/conf.js.map +2 -2
  11. package/dist/cjs/constants/constants.js +1 -1
  12. package/dist/cjs/constants/constants.js.map +1 -1
  13. package/dist/cjs/constants/platform.js +8 -8
  14. package/dist/cjs/constants/platform.js.map +2 -2
  15. package/dist/cjs/constants/rnw.js +5 -19
  16. package/dist/cjs/constants/rnw.js.map +2 -2
  17. package/dist/cjs/constants/rnw.native.js +28 -0
  18. package/dist/cjs/constants/rnw.native.js.map +7 -0
  19. package/dist/cjs/createComponent.js +612 -295
  20. package/dist/cjs/createComponent.js.map +2 -2
  21. package/dist/cjs/createFont.js +2 -3
  22. package/dist/cjs/createFont.js.map +2 -2
  23. package/dist/cjs/createShorthands.js +0 -2
  24. package/dist/cjs/createShorthands.js.map +1 -1
  25. package/dist/cjs/createTamagui.js +147 -100
  26. package/dist/cjs/createTamagui.js.map +2 -2
  27. package/dist/cjs/createTheme.js +3 -2
  28. package/dist/cjs/createTheme.js.map +2 -2
  29. package/dist/cjs/createTokens.js +4 -21
  30. package/dist/cjs/createTokens.js.map +2 -2
  31. package/dist/cjs/createVariable.js +39 -14
  32. package/dist/cjs/createVariable.js.map +2 -2
  33. package/dist/cjs/createVariables.js +55 -0
  34. package/dist/cjs/createVariables.js.map +7 -0
  35. package/dist/cjs/helpers/areEqualSets.js +2 -3
  36. package/dist/cjs/helpers/areEqualSets.js.map +1 -1
  37. package/dist/cjs/helpers/assignNativePropsToWeb.js +187 -0
  38. package/dist/cjs/helpers/assignNativePropsToWeb.js.map +7 -0
  39. package/dist/cjs/helpers/assignNativePropsToWeb.native.js +29 -0
  40. package/dist/cjs/helpers/assignNativePropsToWeb.native.js.map +7 -0
  41. package/dist/cjs/helpers/calc.js +70 -0
  42. package/dist/cjs/helpers/calc.js.map +7 -0
  43. package/dist/cjs/helpers/createMediaStyle.js +4 -4
  44. package/dist/cjs/helpers/createMediaStyle.js.map +2 -2
  45. package/dist/cjs/helpers/createPropMapper.js +133 -113
  46. package/dist/cjs/helpers/createPropMapper.js.map +2 -2
  47. package/dist/cjs/helpers/createShallowUpdate.js +3 -4
  48. package/dist/cjs/helpers/createShallowUpdate.js.map +2 -2
  49. package/dist/cjs/helpers/createTamaguiProvider.js +16 -18
  50. package/dist/cjs/helpers/createTamaguiProvider.js.map +2 -2
  51. package/dist/cjs/helpers/cssHash.js +50 -0
  52. package/dist/cjs/helpers/cssHash.js.map +7 -0
  53. package/dist/cjs/helpers/expandStyle.js +111 -0
  54. package/dist/cjs/helpers/expandStyle.js.map +7 -0
  55. package/dist/cjs/helpers/expandStyles.js +126 -0
  56. package/dist/cjs/helpers/expandStyles.js.map +7 -0
  57. package/dist/cjs/helpers/extendStaticConfig.js +25 -17
  58. package/dist/cjs/helpers/extendStaticConfig.js.map +2 -2
  59. package/dist/cjs/helpers/fixNativeShadow.js +2 -3
  60. package/dist/cjs/helpers/fixNativeShadow.js.map +1 -1
  61. package/dist/cjs/helpers/getExpandedShorthands.js +0 -2
  62. package/dist/cjs/helpers/getExpandedShorthands.js.map +1 -1
  63. package/dist/cjs/helpers/getFont.js +61 -0
  64. package/dist/cjs/helpers/getFont.js.map +7 -0
  65. package/dist/cjs/helpers/getSize.js +17 -9
  66. package/dist/cjs/helpers/getSize.js.map +2 -2
  67. package/dist/cjs/helpers/getSplitStyles.js +268 -168
  68. package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
  69. package/dist/cjs/helpers/getStackSize.js +45 -0
  70. package/dist/cjs/helpers/getStackSize.js.map +7 -0
  71. package/dist/cjs/helpers/getStylesAtomic.js +178 -118
  72. package/dist/cjs/helpers/getStylesAtomic.js.map +2 -2
  73. package/dist/cjs/helpers/getStylesAtomic.native.js +0 -2
  74. package/dist/cjs/helpers/getStylesAtomic.native.js.map +1 -1
  75. package/dist/cjs/helpers/getTextSize.js +3 -4
  76. package/dist/cjs/helpers/getTextSize.js.map +2 -2
  77. package/dist/cjs/helpers/getVariantExtras.js +46 -0
  78. package/dist/cjs/helpers/getVariantExtras.js.map +7 -0
  79. package/dist/cjs/helpers/insertStyleRule.js +55 -37
  80. package/dist/cjs/helpers/insertStyleRule.js.map +2 -2
  81. package/dist/cjs/helpers/isObj.js +1 -2
  82. package/dist/cjs/helpers/isObj.js.map +1 -1
  83. package/dist/cjs/helpers/isTamaguiComponent.js +36 -0
  84. package/dist/cjs/helpers/isTamaguiComponent.js.map +7 -0
  85. package/dist/cjs/helpers/isTamaguiElement.js +4 -5
  86. package/dist/cjs/helpers/isTamaguiElement.js.map +2 -2
  87. package/dist/cjs/helpers/matchMedia.js +2 -3
  88. package/dist/cjs/helpers/matchMedia.js.map +1 -1
  89. package/dist/cjs/helpers/matchMedia.native.js +1 -2
  90. package/dist/cjs/helpers/matchMedia.native.js.map +1 -1
  91. package/dist/cjs/helpers/mergeProps.js +49 -0
  92. package/dist/cjs/helpers/mergeProps.js.map +7 -0
  93. package/dist/cjs/helpers/mergeTransform.js +41 -0
  94. package/dist/cjs/helpers/mergeTransform.js.map +7 -0
  95. package/dist/cjs/helpers/nativeGestureHandler.native.js +18 -0
  96. package/dist/cjs/helpers/nativeGestureHandler.native.js.map +7 -0
  97. package/dist/cjs/helpers/normalizeColor.js +76 -0
  98. package/dist/cjs/helpers/normalizeColor.js.map +7 -0
  99. package/dist/cjs/helpers/normalizeValueWithProperty.js +90 -0
  100. package/dist/cjs/helpers/normalizeValueWithProperty.js.map +7 -0
  101. package/dist/cjs/helpers/proxyThemeVariables.js +1 -3
  102. package/dist/cjs/helpers/proxyThemeVariables.js.map +1 -1
  103. package/dist/cjs/helpers/pseudoDescriptors.js +41 -0
  104. package/dist/cjs/helpers/pseudoDescriptors.js.map +7 -0
  105. package/dist/cjs/helpers/registerCSSVariable.js +40 -0
  106. package/dist/cjs/helpers/registerCSSVariable.js.map +7 -0
  107. package/dist/cjs/helpers/themeable.js +3 -5
  108. package/dist/cjs/helpers/themeable.js.map +2 -2
  109. package/dist/cjs/helpers/validate.js +39 -37
  110. package/dist/cjs/helpers/validate.js.map +2 -2
  111. package/dist/cjs/helpers/withStaticProperties.js +2 -3
  112. package/dist/cjs/helpers/withStaticProperties.js.map +1 -1
  113. package/dist/cjs/helpers/wrapThemeManagerContext.js +0 -2
  114. package/dist/cjs/helpers/wrapThemeManagerContext.js.map +2 -2
  115. package/dist/cjs/hooks/useConstant.js +0 -2
  116. package/dist/cjs/hooks/useConstant.js.map +1 -1
  117. package/dist/cjs/hooks/useFeatures.js +22 -20
  118. package/dist/cjs/hooks/useFeatures.js.map +2 -2
  119. package/dist/cjs/hooks/useId.js +5 -6
  120. package/dist/cjs/hooks/useId.js.map +2 -2
  121. package/dist/cjs/hooks/useIsMounted.js +2 -4
  122. package/dist/cjs/hooks/useIsMounted.js.map +2 -2
  123. package/dist/cjs/hooks/useIsTouchDevice.js +3 -4
  124. package/dist/cjs/hooks/useIsTouchDevice.js.map +2 -2
  125. package/dist/cjs/hooks/useMedia.js +11 -15
  126. package/dist/cjs/hooks/useMedia.js.map +1 -1
  127. package/dist/cjs/hooks/usePressable.js +2 -3
  128. package/dist/cjs/hooks/usePressable.js.map +1 -1
  129. package/dist/cjs/hooks/usePrevious.js +1 -0
  130. package/dist/cjs/hooks/usePrevious.js.map +7 -0
  131. package/dist/cjs/hooks/useTheme.js +21 -33
  132. package/dist/cjs/hooks/useTheme.js.map +2 -2
  133. package/dist/cjs/hooks/useUnmountEffect.js +0 -2
  134. package/dist/cjs/hooks/useUnmountEffect.js.map +1 -1
  135. package/dist/cjs/index.js +21 -12
  136. package/dist/cjs/index.js.map +2 -2
  137. package/dist/cjs/insertFont.js +89 -0
  138. package/dist/cjs/insertFont.js.map +7 -0
  139. package/dist/cjs/static.js +3 -1
  140. package/dist/cjs/static.js.map +2 -2
  141. package/dist/cjs/styled.js +0 -3
  142. package/dist/cjs/styled.js.map +2 -2
  143. package/dist/cjs/types-rnw.js.map +1 -1
  144. package/dist/cjs/types.js.map +1 -1
  145. package/dist/cjs/views/Slot.js +40 -26
  146. package/dist/cjs/views/Slot.js.map +2 -2
  147. package/dist/cjs/views/Text.js +11 -15
  148. package/dist/cjs/views/Text.js.map +2 -2
  149. package/dist/cjs/views/TextAncestorContext.js +4 -6
  150. package/dist/cjs/views/TextAncestorContext.js.map +2 -2
  151. package/dist/cjs/views/Theme.js +6 -9
  152. package/dist/cjs/views/Theme.js.map +2 -2
  153. package/dist/cjs/views/ThemeInverse.js +7 -5
  154. package/dist/cjs/views/ThemeInverse.js.map +2 -2
  155. package/dist/cjs/views/ThemeProvider.js +6 -6
  156. package/dist/cjs/views/ThemeProvider.js.map +2 -2
  157. package/dist/cjs/views/ThemeReset.js +3 -3
  158. package/dist/cjs/views/ThemeReset.js.map +2 -2
  159. package/dist/esm/Pressability.js +5 -0
  160. package/dist/esm/Pressability.js.map +7 -0
  161. package/dist/esm/Pressability.native.js +5 -0
  162. package/dist/esm/Pressability.native.js.map +7 -0
  163. package/dist/esm/Tamagui.js +5 -8
  164. package/dist/esm/Tamagui.js.map +2 -2
  165. package/dist/esm/ThemeManager.js +25 -33
  166. package/dist/esm/ThemeManager.js.map +2 -2
  167. package/dist/esm/conf.js +18 -15
  168. package/dist/esm/conf.js.map +2 -2
  169. package/dist/esm/constants/constants.js +24 -9
  170. package/dist/esm/constants/constants.js.map +2 -2
  171. package/dist/esm/constants/platform.js +6 -6
  172. package/dist/esm/constants/platform.js.map +2 -2
  173. package/dist/esm/constants/rnw.js +2 -20
  174. package/dist/esm/constants/rnw.js.map +2 -2
  175. package/dist/esm/constants/rnw.native.js +5 -0
  176. package/dist/esm/constants/rnw.native.js.map +7 -0
  177. package/dist/esm/createComponent.js +705 -331
  178. package/dist/esm/createComponent.js.map +2 -2
  179. package/dist/esm/createFont.js +2 -4
  180. package/dist/esm/createFont.js.map +2 -2
  181. package/dist/esm/createShorthands.js +0 -3
  182. package/dist/esm/createShorthands.js.map +1 -1
  183. package/dist/esm/createTamagui.js +172 -105
  184. package/dist/esm/createTamagui.js.map +2 -2
  185. package/dist/esm/createTheme.js +3 -3
  186. package/dist/esm/createTheme.js.map +2 -2
  187. package/dist/esm/createTokens.js +3 -20
  188. package/dist/esm/createTokens.js.map +2 -2
  189. package/dist/esm/createVariable.js +38 -14
  190. package/dist/esm/createVariable.js.map +2 -2
  191. package/dist/esm/createVariables.js +32 -0
  192. package/dist/esm/createVariables.js.map +7 -0
  193. package/dist/esm/helpers/areEqualSets.js +2 -4
  194. package/dist/esm/helpers/areEqualSets.js.map +1 -1
  195. package/dist/esm/helpers/assignNativePropsToWeb.js +164 -0
  196. package/dist/esm/helpers/assignNativePropsToWeb.js.map +7 -0
  197. package/dist/esm/helpers/assignNativePropsToWeb.native.js +6 -0
  198. package/dist/esm/helpers/assignNativePropsToWeb.native.js.map +7 -0
  199. package/dist/esm/helpers/calc.js +47 -0
  200. package/dist/esm/helpers/calc.js.map +7 -0
  201. package/dist/esm/helpers/createMediaStyle.js +4 -5
  202. package/dist/esm/helpers/createMediaStyle.js.map +2 -2
  203. package/dist/esm/helpers/createPropMapper.js +131 -114
  204. package/dist/esm/helpers/createPropMapper.js.map +2 -2
  205. package/dist/esm/helpers/createShallowUpdate.js +19 -5
  206. package/dist/esm/helpers/createShallowUpdate.js.map +2 -2
  207. package/dist/esm/helpers/createTamaguiProvider.js +46 -19
  208. package/dist/esm/helpers/createTamaguiProvider.js.map +2 -2
  209. package/dist/esm/helpers/cssHash.js +27 -0
  210. package/dist/esm/helpers/cssHash.js.map +7 -0
  211. package/dist/esm/helpers/expandStyle.js +90 -0
  212. package/dist/esm/helpers/expandStyle.js.map +7 -0
  213. package/dist/esm/helpers/expandStyles.js +103 -0
  214. package/dist/esm/helpers/expandStyles.js.map +7 -0
  215. package/dist/esm/helpers/extendStaticConfig.js +46 -40
  216. package/dist/esm/helpers/extendStaticConfig.js.map +2 -2
  217. package/dist/esm/helpers/fixNativeShadow.js +2 -4
  218. package/dist/esm/helpers/fixNativeShadow.js.map +1 -1
  219. package/dist/esm/helpers/getExpandedShorthands.js +0 -3
  220. package/dist/esm/helpers/getExpandedShorthands.js.map +1 -1
  221. package/dist/{jsx/helpers/getTextSize.js → esm/helpers/getFont.js} +12 -7
  222. package/dist/esm/helpers/getFont.js.map +7 -0
  223. package/dist/esm/helpers/getSize.js +15 -9
  224. package/dist/esm/helpers/getSize.js.map +2 -2
  225. package/dist/esm/helpers/getSplitStyles.js +282 -176
  226. package/dist/esm/helpers/getSplitStyles.js.map +2 -2
  227. package/dist/esm/helpers/getStackSize.js +22 -0
  228. package/dist/esm/helpers/getStackSize.js.map +7 -0
  229. package/dist/esm/helpers/getStylesAtomic.js +188 -110
  230. package/dist/esm/helpers/getStylesAtomic.js.map +2 -2
  231. package/dist/esm/helpers/getStylesAtomic.native.js +0 -3
  232. package/dist/esm/helpers/getStylesAtomic.native.js.map +1 -1
  233. package/dist/esm/helpers/getTextSize.js +3 -5
  234. package/dist/esm/helpers/getTextSize.js.map +2 -2
  235. package/dist/esm/helpers/getVariantExtras.js +23 -0
  236. package/dist/esm/helpers/getVariantExtras.js.map +7 -0
  237. package/dist/esm/helpers/insertStyleRule.js +55 -38
  238. package/dist/esm/helpers/insertStyleRule.js.map +2 -2
  239. package/dist/esm/helpers/isObj.js +1 -3
  240. package/dist/esm/helpers/isObj.js.map +1 -1
  241. package/dist/esm/helpers/isTamaguiComponent.js +13 -0
  242. package/dist/esm/helpers/isTamaguiComponent.js.map +7 -0
  243. package/dist/esm/helpers/isTamaguiElement.js +4 -6
  244. package/dist/esm/helpers/isTamaguiElement.js.map +2 -2
  245. package/dist/esm/helpers/matchMedia.js +2 -4
  246. package/dist/esm/helpers/matchMedia.js.map +1 -1
  247. package/dist/esm/helpers/matchMedia.native.js +1 -3
  248. package/dist/esm/helpers/matchMedia.native.js.map +1 -1
  249. package/dist/esm/helpers/mergeProps.js +26 -0
  250. package/dist/esm/helpers/mergeProps.js.map +7 -0
  251. package/dist/esm/helpers/mergeTransform.js +17 -0
  252. package/dist/esm/helpers/mergeTransform.js.map +7 -0
  253. package/dist/esm/helpers/nativeGestureHandler.native.js +2 -0
  254. package/dist/esm/helpers/nativeGestureHandler.native.js.map +7 -0
  255. package/dist/esm/helpers/normalizeColor.js +49 -0
  256. package/dist/esm/helpers/normalizeColor.js.map +7 -0
  257. package/dist/esm/helpers/normalizeValueWithProperty.js +67 -0
  258. package/dist/esm/helpers/normalizeValueWithProperty.js.map +7 -0
  259. package/dist/esm/helpers/proxyThemeVariables.js +1 -4
  260. package/dist/esm/helpers/proxyThemeVariables.js.map +1 -1
  261. package/dist/esm/helpers/pseudoDescriptors.js +18 -0
  262. package/dist/esm/helpers/pseudoDescriptors.js.map +7 -0
  263. package/dist/esm/helpers/registerCSSVariable.js +15 -0
  264. package/dist/esm/helpers/registerCSSVariable.js.map +7 -0
  265. package/dist/esm/helpers/themeable.js +34 -5
  266. package/dist/esm/helpers/themeable.js.map +2 -2
  267. package/dist/esm/helpers/validate.js +42 -19
  268. package/dist/esm/helpers/validate.js.map +2 -2
  269. package/dist/esm/helpers/withStaticProperties.js +2 -4
  270. package/dist/esm/helpers/withStaticProperties.js.map +1 -1
  271. package/dist/esm/helpers/wrapThemeManagerContext.js +0 -3
  272. package/dist/esm/helpers/wrapThemeManagerContext.js.map +2 -2
  273. package/dist/esm/hooks/useConstant.js +0 -3
  274. package/dist/esm/hooks/useConstant.js.map +1 -1
  275. package/dist/esm/hooks/useFeatures.js +59 -26
  276. package/dist/esm/hooks/useFeatures.js.map +2 -2
  277. package/dist/esm/hooks/useId.js +8 -11
  278. package/dist/esm/hooks/useId.js.map +2 -2
  279. package/dist/esm/hooks/useIsMounted.js +1 -4
  280. package/dist/esm/hooks/useIsMounted.js.map +2 -2
  281. package/dist/esm/hooks/useIsTouchDevice.js +4 -6
  282. package/dist/esm/hooks/useIsTouchDevice.js.map +2 -2
  283. package/dist/esm/hooks/useMedia.js +28 -21
  284. package/dist/esm/hooks/useMedia.js.map +1 -1
  285. package/dist/esm/hooks/usePressable.js +18 -5
  286. package/dist/esm/hooks/usePressable.js.map +1 -1
  287. package/dist/esm/hooks/usePrevious.js +1 -0
  288. package/dist/esm/hooks/usePrevious.js.map +7 -0
  289. package/dist/esm/hooks/useTheme.js +45 -41
  290. package/dist/esm/hooks/useTheme.js.map +2 -2
  291. package/dist/esm/hooks/useUnmountEffect.js +0 -3
  292. package/dist/esm/hooks/useUnmountEffect.js.map +1 -1
  293. package/dist/esm/index.js +18 -9
  294. package/dist/esm/index.js.map +2 -2
  295. package/dist/esm/insertFont.js +64 -0
  296. package/dist/esm/insertFont.js.map +7 -0
  297. package/dist/esm/static.js +3 -1
  298. package/dist/esm/static.js.map +2 -2
  299. package/dist/esm/styled.js +37 -12
  300. package/dist/esm/styled.js.map +2 -2
  301. package/dist/esm/views/Slot.js +74 -34
  302. package/dist/esm/views/Slot.js.map +2 -2
  303. package/dist/esm/views/Stack.js +21 -3
  304. package/dist/esm/views/Stack.js.map +1 -1
  305. package/dist/esm/views/Text.js +27 -19
  306. package/dist/esm/views/Text.js.map +2 -2
  307. package/dist/esm/views/TextAncestorContext.js +4 -7
  308. package/dist/esm/views/TextAncestorContext.js.map +2 -2
  309. package/dist/esm/views/Theme.js +6 -10
  310. package/dist/esm/views/Theme.js.map +2 -2
  311. package/dist/esm/views/ThemeInverse.js +8 -7
  312. package/dist/esm/views/ThemeInverse.js.map +2 -2
  313. package/dist/esm/views/ThemeProvider.js +6 -7
  314. package/dist/esm/views/ThemeProvider.js.map +2 -2
  315. package/dist/esm/views/ThemeReset.js +3 -4
  316. package/dist/esm/views/ThemeReset.js.map +2 -2
  317. package/package.json +18 -11
  318. package/reset.css +41 -0
  319. package/types/Pressability.d.ts +2 -0
  320. package/types/Pressability.native.d.ts +2 -0
  321. package/types/Tamagui.d.ts +4 -6
  322. package/types/Tamagui.d.ts.map +1 -1
  323. package/types/ThemeContext.d.ts +0 -0
  324. package/types/ThemeContext.d.ts.map +0 -0
  325. package/types/ThemeManager.d.ts +10 -7
  326. package/types/ThemeManager.d.ts.map +1 -1
  327. package/types/conf.d.ts +3 -4
  328. package/types/conf.d.ts.map +1 -1
  329. package/types/constants/constants.d.ts +1 -1
  330. package/types/constants/platform.d.ts +2 -2
  331. package/types/constants/rnw.d.ts +1 -1
  332. package/types/constants/rnw.d.ts.map +1 -1
  333. package/types/constants/rnw.native.d.ts +2 -0
  334. package/types/contexts/ButtonInsideButtonContext.d.ts +0 -0
  335. package/types/createComponent.d.ts +40 -15
  336. package/types/createComponent.d.ts.map +1 -1
  337. package/types/createFont.d.ts +0 -0
  338. package/types/createFont.d.ts.map +0 -0
  339. package/types/createShorthands.d.ts +0 -0
  340. package/types/createTamagui.d.ts +10 -2
  341. package/types/createTamagui.d.ts.map +1 -1
  342. package/types/createTheme.d.ts +1 -1
  343. package/types/createTokens.d.ts +0 -1
  344. package/types/createTokens.d.ts.map +1 -1
  345. package/types/createVariable.d.ts +16 -11
  346. package/types/createVariables.d.ts +10 -0
  347. package/types/defaultComponentState.d.ts +0 -0
  348. package/types/helpers/RNComponents.d.ts +0 -0
  349. package/types/helpers/areEqualSets.d.ts +0 -0
  350. package/types/helpers/assignNativePropsToWeb.d.ts +2 -0
  351. package/types/helpers/assignNativePropsToWeb.d.ts.map +1 -0
  352. package/types/helpers/assignNativePropsToWeb.native.d.ts +2 -0
  353. package/types/helpers/calc.d.ts +12 -0
  354. package/types/helpers/calc.d.ts.map +1 -0
  355. package/types/helpers/createMediaStyle.d.ts +1 -1
  356. package/types/helpers/createMediaStyle.d.ts.map +1 -1
  357. package/types/helpers/createPropMapper.d.ts +4 -3
  358. package/types/helpers/createPropMapper.d.ts.map +1 -1
  359. package/types/helpers/createShallowUpdate.d.ts +1 -2
  360. package/types/helpers/createTamaguiProvider.d.ts +2 -6
  361. package/types/helpers/createTamaguiProvider.d.ts.map +1 -1
  362. package/types/helpers/cssHash.d.ts +2 -0
  363. package/types/helpers/cssHash.d.ts.map +1 -0
  364. package/types/helpers/expandStyle.d.ts +2 -0
  365. package/types/helpers/expandStyle.d.ts.map +1 -0
  366. package/types/helpers/expandStyles.d.ts +7 -0
  367. package/types/helpers/expandStyles.d.ts.map +1 -0
  368. package/types/helpers/extendStaticConfig.d.ts +0 -0
  369. package/types/helpers/extendStaticConfig.d.ts.map +1 -1
  370. package/types/helpers/fixNativeShadow.d.ts +0 -0
  371. package/types/helpers/getExpandedShorthands.d.ts +0 -0
  372. package/types/helpers/getExpandedShorthands.d.ts.map +0 -0
  373. package/types/helpers/getFont.d.ts +3 -0
  374. package/types/helpers/getFont.d.ts.map +1 -0
  375. package/types/helpers/getSize.d.ts +3 -2
  376. package/types/helpers/getSize.d.ts.map +1 -1
  377. package/types/helpers/getSplitStyles.d.ts +10 -7
  378. package/types/helpers/getSplitStyles.d.ts.map +1 -1
  379. package/types/helpers/getStackSize.d.ts +8 -0
  380. package/types/helpers/getStackSize.d.ts.map +1 -0
  381. package/types/helpers/getStylesAtomic.d.ts +7 -17
  382. package/types/helpers/getStylesAtomic.d.ts.map +1 -1
  383. package/types/helpers/getStylesAtomic.native.d.ts +0 -0
  384. package/types/helpers/getVariantExtras.d.ts +7 -0
  385. package/types/helpers/getVariantExtras.d.ts.map +1 -0
  386. package/types/helpers/insertStyleRule.d.ts +1 -1
  387. package/types/helpers/isObj.d.ts +0 -0
  388. package/types/helpers/isTamaguiComponent.d.ts +5 -0
  389. package/types/helpers/isTamaguiComponent.d.ts.map +1 -0
  390. package/types/helpers/isTamaguiElement.d.ts +1 -1
  391. package/types/helpers/isTamaguiElement.d.ts.map +1 -1
  392. package/types/helpers/matchMedia.d.ts +0 -0
  393. package/types/helpers/matchMedia.native.d.ts +0 -0
  394. package/types/helpers/mergeProps.d.ts +2 -0
  395. package/types/helpers/mergeTransform.d.ts +7 -0
  396. package/types/helpers/nativeGestureHandler.native.d.ts +2 -0
  397. package/types/helpers/normalizeColor.d.ts +3 -0
  398. package/types/helpers/normalizeColor.d.ts.map +1 -0
  399. package/types/helpers/normalizeValueWithProperty.d.ts +2 -0
  400. package/types/helpers/normalizeValueWithProperty.d.ts.map +1 -0
  401. package/types/helpers/proxyThemeVariables.d.ts +0 -0
  402. package/types/helpers/pseudoDescriptors.d.ts +16 -0
  403. package/types/helpers/registerCSSVariable.d.ts +5 -0
  404. package/types/helpers/themeable.d.ts +0 -0
  405. package/types/helpers/themeable.d.ts.map +1 -1
  406. package/types/helpers/validate.d.ts +0 -0
  407. package/types/helpers/withStaticProperties.d.ts +0 -0
  408. package/types/helpers/wrapThemeManagerContext.d.ts +0 -0
  409. package/types/helpers/wrapThemeManagerContext.d.ts.map +0 -0
  410. package/types/hooks/useConstant.d.ts +0 -0
  411. package/types/hooks/useFeatures.d.ts +11 -5
  412. package/types/hooks/useFeatures.d.ts.map +1 -1
  413. package/types/hooks/useId.d.ts +0 -0
  414. package/types/hooks/useIsMounted.d.ts +0 -0
  415. package/types/hooks/useIsTouchDevice.d.ts +0 -0
  416. package/types/hooks/useMedia.d.ts +0 -0
  417. package/types/hooks/useMedia.d.ts.map +0 -0
  418. package/types/hooks/usePressable.d.ts +0 -0
  419. package/types/hooks/usePrevious.d.ts +1 -0
  420. package/types/hooks/useTheme.d.ts +15 -6
  421. package/types/hooks/useTheme.d.ts.map +1 -1
  422. package/types/hooks/useUnmountEffect.d.ts +0 -0
  423. package/types/index.d.ts +16 -6
  424. package/types/index.d.ts.map +1 -1
  425. package/types/insertFont.d.ts +6 -0
  426. package/types/insertFont.d.ts.map +1 -0
  427. package/types/static.d.ts +3 -1
  428. package/types/static.d.ts.map +1 -1
  429. package/types/styled.d.ts +2 -2
  430. package/types/styled.d.ts.map +1 -1
  431. package/types/types-rnw.d.ts +0 -0
  432. package/types/types.d.ts +71 -51
  433. package/types/types.d.ts.map +1 -1
  434. package/types/views/Slot.d.ts +1 -0
  435. package/types/views/Stack.d.ts +0 -0
  436. package/types/views/Stack.d.ts.map +0 -0
  437. package/types/views/Text.d.ts +0 -0
  438. package/types/views/Text.d.ts.map +1 -1
  439. package/types/views/TextAncestorContext.d.ts +0 -0
  440. package/types/views/TextAncestorContext.d.ts.map +1 -1
  441. package/types/views/Theme.d.ts +1 -9
  442. package/types/views/Theme.d.ts.map +1 -1
  443. package/types/views/ThemeInverse.d.ts +0 -0
  444. package/types/views/ThemeInverse.d.ts.map +1 -1
  445. package/types/views/ThemeProvider.d.ts +2 -0
  446. package/types/views/ThemeProvider.d.ts.map +1 -1
  447. package/types/views/ThemeReset.d.ts +0 -0
  448. package/types/views/ThemeReset.d.ts.map +0 -0
  449. package/dist/cjs/helpers/addStylesUsingClassname.js +0 -87
  450. package/dist/cjs/helpers/addStylesUsingClassname.js.map +0 -7
  451. package/dist/cjs/helpers/fixNativeShadow.native.js +0 -63
  452. package/dist/cjs/helpers/fixNativeShadow.native.js.map +0 -7
  453. package/dist/cjs/helpers/getButtonSize.js +0 -45
  454. package/dist/cjs/helpers/getButtonSize.js.map +0 -7
  455. package/dist/esm/helpers/addStylesUsingClassname.js +0 -64
  456. package/dist/esm/helpers/addStylesUsingClassname.js.map +0 -7
  457. package/dist/esm/helpers/fixNativeShadow.native.js +0 -41
  458. package/dist/esm/helpers/fixNativeShadow.native.js.map +0 -7
  459. package/dist/esm/helpers/getButtonSize.js +0 -24
  460. package/dist/esm/helpers/getButtonSize.js.map +0 -7
  461. package/dist/jsx/Tamagui.js +0 -41
  462. package/dist/jsx/ThemeContext.js +0 -5
  463. package/dist/jsx/ThemeManager.js +0 -186
  464. package/dist/jsx/conf.js +0 -35
  465. package/dist/jsx/constants/constants.js +0 -17
  466. package/dist/jsx/constants/platform.js +0 -25
  467. package/dist/jsx/constants/rnw.js +0 -23
  468. package/dist/jsx/contexts/ButtonInsideButtonContext.js +0 -5
  469. package/dist/jsx/createComponent.js +0 -617
  470. package/dist/jsx/createFont.js +0 -27
  471. package/dist/jsx/createShorthands.js +0 -9
  472. package/dist/jsx/createTamagui.js +0 -201
  473. package/dist/jsx/createTheme.js +0 -6
  474. package/dist/jsx/createTokens.js +0 -28
  475. package/dist/jsx/createVariable.js +0 -48
  476. package/dist/jsx/defaultComponentState.js +0 -0
  477. package/dist/jsx/helpers/RNComponents.js +0 -11
  478. package/dist/jsx/helpers/addStylesUsingClassname.js +0 -63
  479. package/dist/jsx/helpers/areEqualSets.js +0 -15
  480. package/dist/jsx/helpers/createMediaStyle.js +0 -30
  481. package/dist/jsx/helpers/createPropMapper.js +0 -237
  482. package/dist/jsx/helpers/createShallowUpdate.js +0 -18
  483. package/dist/jsx/helpers/createTamaguiProvider.js +0 -34
  484. package/dist/jsx/helpers/extendStaticConfig.js +0 -61
  485. package/dist/jsx/helpers/fixNativeShadow.js +0 -7
  486. package/dist/jsx/helpers/fixNativeShadow.native.js +0 -40
  487. package/dist/jsx/helpers/getButtonSize.js +0 -23
  488. package/dist/jsx/helpers/getExpandedShorthands.js +0 -18
  489. package/dist/jsx/helpers/getSize.js +0 -12
  490. package/dist/jsx/helpers/getSplitStyles.js +0 -302
  491. package/dist/jsx/helpers/getStylesAtomic.js +0 -130
  492. package/dist/jsx/helpers/getStylesAtomic.native.js +0 -9
  493. package/dist/jsx/helpers/insertStyleRule.js +0 -94
  494. package/dist/jsx/helpers/isObj.js +0 -6
  495. package/dist/jsx/helpers/isTamaguiElement.js +0 -10
  496. package/dist/jsx/helpers/matchMedia.js +0 -17
  497. package/dist/jsx/helpers/matchMedia.native.js +0 -8
  498. package/dist/jsx/helpers/proxyThemeVariables.js +0 -17
  499. package/dist/jsx/helpers/themeable.js +0 -24
  500. package/dist/jsx/helpers/validate.js +0 -75
  501. package/dist/jsx/helpers/withStaticProperties.js +0 -9
  502. package/dist/jsx/helpers/wrapThemeManagerContext.js +0 -10
  503. package/dist/jsx/hooks/useConstant.js +0 -14
  504. package/dist/jsx/hooks/useFeatures.js +0 -167
  505. package/dist/jsx/hooks/useId.js +0 -34
  506. package/dist/jsx/hooks/useIsMounted.js +0 -18
  507. package/dist/jsx/hooks/useIsTouchDevice.js +0 -16
  508. package/dist/jsx/hooks/useMedia.js +0 -158
  509. package/dist/jsx/hooks/usePressable.js +0 -13
  510. package/dist/jsx/hooks/useTheme.js +0 -177
  511. package/dist/jsx/hooks/useUnmountEffect.js +0 -10
  512. package/dist/jsx/index.js +0 -54
  513. package/dist/jsx/static.js +0 -16
  514. package/dist/jsx/styled.js +0 -48
  515. package/dist/jsx/types-rnw.js +0 -0
  516. package/dist/jsx/types.js +0 -0
  517. package/dist/jsx/views/Slot.js +0 -56
  518. package/dist/jsx/views/Stack.js +0 -12
  519. package/dist/jsx/views/Text.js +0 -61
  520. package/dist/jsx/views/TextAncestorContext.js +0 -15
  521. package/dist/jsx/views/Theme.js +0 -31
  522. package/dist/jsx/views/ThemeInverse.js +0 -22
  523. package/dist/jsx/views/ThemeProvider.js +0 -35
  524. package/dist/jsx/views/ThemeReset.js +0 -34
  525. package/types/constants/constants.d.ts.map +0 -1
  526. package/types/constants/platform.d.ts.map +0 -1
  527. package/types/contexts/ButtonInsideButtonContext.d.ts.map +0 -1
  528. package/types/createShorthands.d.ts.map +0 -1
  529. package/types/createTheme.d.ts.map +0 -1
  530. package/types/createVariable.d.ts.map +0 -1
  531. package/types/defaultComponentState.d.ts.map +0 -1
  532. package/types/helpers/RNComponents.d.ts.map +0 -1
  533. package/types/helpers/addStylesUsingClassname.d.ts +0 -3
  534. package/types/helpers/addStylesUsingClassname.d.ts.map +0 -1
  535. package/types/helpers/areEqualSets.d.ts.map +0 -1
  536. package/types/helpers/createShallowUpdate.d.ts.map +0 -1
  537. package/types/helpers/fixNativeShadow.d.ts.map +0 -1
  538. package/types/helpers/fixNativeShadow.native.d.ts +0 -2
  539. package/types/helpers/fixNativeShadow.native.d.ts.map +0 -1
  540. package/types/helpers/getButtonSize.d.ts +0 -8
  541. package/types/helpers/getButtonSize.d.ts.map +0 -1
  542. package/types/helpers/getStylesAtomic.native.d.ts.map +0 -1
  543. package/types/helpers/getTextSize.d.ts +0 -3
  544. package/types/helpers/getTextSize.d.ts.map +0 -1
  545. package/types/helpers/insertStyleRule.d.ts.map +0 -1
  546. package/types/helpers/isObj.d.ts.map +0 -1
  547. package/types/helpers/matchMedia.d.ts.map +0 -1
  548. package/types/helpers/matchMedia.native.d.ts.map +0 -1
  549. package/types/helpers/proxyThemeVariables.d.ts.map +0 -1
  550. package/types/helpers/validate.d.ts.map +0 -1
  551. package/types/helpers/withStaticProperties.d.ts.map +0 -1
  552. package/types/hooks/useConstant.d.ts.map +0 -1
  553. package/types/hooks/useId.d.ts.map +0 -1
  554. package/types/hooks/useIsMounted.d.ts.map +0 -1
  555. package/types/hooks/useIsTouchDevice.d.ts.map +0 -1
  556. package/types/hooks/usePressable.d.ts.map +0 -1
  557. package/types/hooks/useUnmountEffect.d.ts.map +0 -1
  558. package/types/types-rnw.d.ts.map +0 -1
  559. package/types/views/Slot.d.ts.map +0 -1
@@ -0,0 +1,64 @@
1
+ import { setConfigFont } from "./conf";
2
+ import { createFont } from "./createFont";
3
+ import { createVariables } from "./createVariables";
4
+ import { registerCSSVariable } from "./helpers/registerCSSVariable";
5
+ function insertFont(name, fontIn) {
6
+ const font = createFont(fontIn);
7
+ const tokened = createVariables(font, name);
8
+ const parsed = parseFont(tokened);
9
+ if (process.env.TAMAGUI_TARGET === "web" && typeof document !== "undefined") {
10
+ const css = registerFontVariables(parsed, true);
11
+ const style = document.createElement("style");
12
+ style.innerText = `:root {${css}}`;
13
+ style.setAttribute("data-tamagui-font", name);
14
+ document.head.appendChild(style);
15
+ }
16
+ setConfigFont(name, tokened, parsed);
17
+ return parsed;
18
+ }
19
+ function parseFont(definition) {
20
+ const parsed = {};
21
+ for (const attrKey in definition) {
22
+ const attr = definition[attrKey];
23
+ if (attrKey === "family") {
24
+ parsed[attrKey] = attr;
25
+ continue;
26
+ }
27
+ parsed[attrKey] = {};
28
+ for (const key in attr) {
29
+ let val = attr[key];
30
+ if (val.val[0] === "$") {
31
+ val = val.val;
32
+ }
33
+ parsed[attrKey][`$${key}`] = val;
34
+ }
35
+ }
36
+ return parsed;
37
+ }
38
+ function registerFontVariables(parsedFont, collect = false) {
39
+ let vals = "";
40
+ for (const fkey in parsedFont) {
41
+ if (fkey === "family") {
42
+ const val = registerCSSVariable(parsedFont[fkey]);
43
+ if (collect)
44
+ vals += val + ";";
45
+ } else {
46
+ for (const fskey in parsedFont[fkey]) {
47
+ const fval = parsedFont[fkey][fskey];
48
+ if (typeof fval === "string") {
49
+ } else {
50
+ const val = registerCSSVariable(parsedFont[fkey][fskey]);
51
+ if (collect)
52
+ vals += val + ";";
53
+ }
54
+ }
55
+ }
56
+ }
57
+ return vals;
58
+ }
59
+ export {
60
+ insertFont,
61
+ parseFont,
62
+ registerFontVariables
63
+ };
64
+ //# sourceMappingURL=insertFont.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/insertFont.ts"],
4
+ "sourcesContent": ["\nimport { setConfigFont } from './conf'\nimport { createFont } from './createFont'\nimport { Variable } from './createVariable'\nimport { DeepVariableObject, createVariables } from './createVariables'\nimport { registerCSSVariable } from './helpers/registerCSSVariable'\nimport { GenericFont } from './types'\n\nexport function insertFont<A extends GenericFont>(name: string, fontIn: A): DeepVariableObject<A> {\n const font = createFont(fontIn)\n const tokened = createVariables(font, name) as GenericFont\n const parsed = parseFont(tokened) as DeepVariableObject<A>\n if (process.env.TAMAGUI_TARGET === 'web' && typeof document !== 'undefined') {\n const css = registerFontVariables(parsed, true)\n const style = document.createElement('style')\n style.innerText = `:root {${css}}`\n style.setAttribute('data-tamagui-font', name)\n document.head.appendChild(style)\n }\n setConfigFont(name, tokened, parsed)\n return parsed\n}\n\nexport function parseFont<A extends GenericFont>(definition: A): DeepVariableObject<A> {\n const parsed: any = {}\n for (const attrKey in definition) {\n const attr = definition[attrKey]\n if (attrKey === 'family') {\n parsed[attrKey] = attr\n continue\n }\n parsed[attrKey] = {}\n for (const key in attr) {\n let val = attr[key] as any as Variable\n // is a theme reference\n if (val.val[0] === '$') {\n val = val.val\n }\n parsed[attrKey][`$${key}`] = val\n }\n }\n return parsed\n}\n\nexport function registerFontVariables(parsedFont: any, collect = false) {\n let vals = ''\n for (const fkey in parsedFont) {\n if (fkey === 'family') {\n const val = registerCSSVariable(parsedFont[fkey])\n if (collect) vals += val + ';'\n } else {\n for (const fskey in parsedFont[fkey]) {\n const fval = parsedFont[fkey][fskey]\n if (typeof fval === 'string') {\n // no need to add its a theme reference like \"$borderColor\"\n } else {\n const val = registerCSSVariable(parsedFont[fkey][fskey])\n if (collect) vals += val + ';'\n }\n }\n }\n }\n return vals\n}\n"],
5
+ "mappings": "AACA;AACA;AAEA;AACA;AAGO,oBAA2C,MAAc,QAAkC;AAChG,QAAM,OAAO,WAAW,MAAM;AAC9B,QAAM,UAAU,gBAAgB,MAAM,IAAI;AAC1C,QAAM,SAAS,UAAU,OAAO;AAChC,MAAI,QAAQ,IAAI,mBAAmB,SAAS,OAAO,aAAa,aAAa;AAC3E,UAAM,MAAM,sBAAsB,QAAQ,IAAI;AAC9C,UAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,UAAM,YAAY,UAAU;AAC5B,UAAM,aAAa,qBAAqB,IAAI;AAC5C,aAAS,KAAK,YAAY,KAAK;AAAA,EACjC;AACA,gBAAc,MAAM,SAAS,MAAM;AACnC,SAAO;AACT;AAEO,mBAA0C,YAAsC;AACrF,QAAM,SAAc,CAAC;AACrB,aAAW,WAAW,YAAY;AAChC,UAAM,OAAO,WAAW;AACxB,QAAI,YAAY,UAAU;AACxB,aAAO,WAAW;AAClB;AAAA,IACF;AACA,WAAO,WAAW,CAAC;AACnB,eAAW,OAAO,MAAM;AACtB,UAAI,MAAM,KAAK;AAEf,UAAI,IAAI,IAAI,OAAO,KAAK;AACtB,cAAM,IAAI;AAAA,MACZ;AACA,aAAO,SAAS,IAAI,SAAS;AAAA,IAC/B;AAAA,EACF;AACA,SAAO;AACT;AAEO,+BAA+B,YAAiB,UAAU,OAAO;AACtE,MAAI,OAAO;AACX,aAAW,QAAQ,YAAY;AAC7B,QAAI,SAAS,UAAU;AACrB,YAAM,MAAM,oBAAoB,WAAW,KAAK;AAChD,UAAI;AAAS,gBAAQ,MAAM;AAAA,IAC7B,OAAO;AACL,iBAAW,SAAS,WAAW,OAAO;AACpC,cAAM,OAAO,WAAW,MAAM;AAC9B,YAAI,OAAO,SAAS,UAAU;AAAA,QAE9B,OAAO;AACL,gBAAM,MAAM,oBAAoB,WAAW,MAAM,MAAM;AACvD,cAAI;AAAS,oBAAQ,MAAM;AAAA,QAC7B;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;",
6
+ "names": []
7
+ }
@@ -9,9 +9,11 @@ export * from "./hooks/useMedia";
9
9
  export * from "./hooks/useTheme";
10
10
  export * from "./helpers/isObj";
11
11
  export * from "./helpers/getStylesAtomic";
12
+ export * from "./helpers/expandStyles";
13
+ export * from "./helpers/pseudoDescriptors";
12
14
  export * from "./helpers/proxyThemeVariables";
13
15
  export * from "./helpers/getSplitStyles";
14
16
  export * from "@tamagui/helpers";
15
- export * from "./constants/rnw";
16
17
  export * from "./types";
18
+ export * from "@tamagui/rnw";
17
19
  //# sourceMappingURL=static.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/static.ts"],
4
- "sourcesContent": ["// only stuff that gets extracted or needed by tamagui-static\n\nexport * from './styled'\nexport * from './createComponent'\nexport * from './createFont'\nexport * from './createTokens'\nexport * from './createTamagui'\nexport * from './createVariable'\nexport * from './constants/constants'\n\nexport * from './hooks/useMedia'\nexport * from './hooks/useTheme'\n\nexport * from './helpers/isObj'\nexport * from './helpers/getStylesAtomic'\nexport * from './helpers/proxyThemeVariables'\nexport * from './helpers/getSplitStyles'\nexport * from '@tamagui/helpers'\n\nexport * from './constants/rnw'\n\nexport * from './types'\n"],
5
- "mappings": "AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAEA;",
4
+ "sourcesContent": ["// only stuff that gets extracted or needed by tamagui-static\n\nexport * from './styled'\nexport * from './createComponent'\nexport * from './createFont'\nexport * from './createTokens'\nexport * from './createTamagui'\nexport * from './createVariable'\nexport * from './constants/constants'\n\nexport * from './hooks/useMedia'\nexport * from './hooks/useTheme'\n\nexport * from './helpers/isObj'\nexport * from './helpers/getStylesAtomic'\nexport * from './helpers/expandStyles'\nexport * from './helpers/pseudoDescriptors'\nexport * from './helpers/proxyThemeVariables'\nexport * from './helpers/getSplitStyles'\nexport * from '@tamagui/helpers'\n\nexport * from './types'\n\n// node only rnw export\nexport * from '@tamagui/rnw'\n"],
5
+ "mappings": "AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAGA;",
6
6
  "names": []
7
7
  }
@@ -1,28 +1,55 @@
1
1
  var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
3
32
  import { Image, Text, TextInput } from "react-native";
4
33
  import { createComponent } from "./createComponent";
5
34
  import { RNComponents } from "./helpers/RNComponents";
6
35
  function styled(Component, options, staticExtractionOptions) {
7
36
  const staticConfigProps = (() => {
8
- var _a;
37
+ var _b;
9
38
  if (options) {
10
- const { variants, name, defaultVariants, ...defaultProps } = options;
39
+ const _a = options, { variants, name, defaultVariants } = _a, defaultProps = __objRest(_a, ["variants", "name", "defaultVariants"]);
11
40
  if (defaultVariants) {
12
41
  Object.assign(defaultProps, defaultVariants);
13
42
  }
14
43
  const isReactNativeWeb = "staticConfig" in Component ? Component.staticConfig.isReactNativeWeb : RNComponents.has(Component);
15
- const reactNativeWebComponent = isReactNativeWeb ? ((_a = Component["staticConfig"]) == null ? void 0 : _a.reactNativeWebComponent) || Component : null;
44
+ const reactNativeWebComponent = isReactNativeWeb ? ((_b = Component["staticConfig"]) == null ? void 0 : _b.reactNativeWebComponent) || Component : null;
16
45
  const isTamagui = !isReactNativeWeb && "staticConfig" in Component;
17
46
  const Comp = reactNativeWebComponent || Component;
18
47
  const isImage = !!(defaultProps.isImage || (!isTamagui ? Comp === Image : false));
19
48
  const isInput = !!(defaultProps.isInput || (!isTamagui ? Comp === TextInput : false));
20
49
  const isText = !!(defaultProps.isText || (!isTamagui ? isInput || Comp === Text : false));
21
- const conf = {
22
- ...staticExtractionOptions,
23
- ...!isTamagui && {
24
- Component: Comp
25
- },
50
+ const conf = __spreadProps(__spreadValues(__spreadValues({}, staticExtractionOptions), !isTamagui && {
51
+ Component: Comp
52
+ }), {
26
53
  isTamagui,
27
54
  variants,
28
55
  defaultProps,
@@ -33,8 +60,7 @@ function styled(Component, options, staticExtractionOptions) {
33
60
  isInput,
34
61
  isText,
35
62
  isImage
36
- };
37
- console.log("makeme", name, Comp, conf);
63
+ });
38
64
  return conf;
39
65
  }
40
66
  return {};
@@ -42,7 +68,6 @@ function styled(Component, options, staticExtractionOptions) {
42
68
  const component = createComponent(staticConfigProps, Component);
43
69
  return component;
44
70
  }
45
- __name(styled, "styled");
46
71
  export {
47
72
  styled
48
73
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/styled.tsx"],
4
- "sourcesContent": ["import { Image, Text, TextInput } from 'react-native'\n\nimport { createComponent } from './createComponent'\nimport { RNComponents } from './helpers/RNComponents'\nimport {\n GetProps,\n GetVariantValues,\n MediaProps,\n PseudoProps,\n StaticConfig,\n StylableComponent,\n TamaguiComponent,\n VariantDefinitions,\n VariantSpreadFunction,\n} from './types'\n\n// TODO may be able to use this in the options?: arg below directly\nexport type StyledOptions<ParentComponent extends StylableComponent> = GetProps<ParentComponent> & {\n name?: string\n variants?: VariantDefinitions<ParentComponent> | undefined\n defaultVariants?: { [key: string]: any }\n}\n\nexport function styled<\n ParentComponent extends StylableComponent,\n Variants extends VariantDefinitions<ParentComponent> | symbol =\n | VariantDefinitions<ParentComponent>\n | symbol\n>(\n Component: ParentComponent,\n // this should be Partial<GetProps<ParentComponent>> but causes excessively deep type issues\n options?: GetProps<ParentComponent> & {\n name?: string\n variants?: Variants | undefined\n // thought i had this typed, but can't get it linked\n defaultVariants?: { [key: string]: any }\n },\n staticExtractionOptions?: Partial<StaticConfig>\n) {\n const staticConfigProps = (() => {\n if (options) {\n const { variants, name, defaultVariants, ...defaultProps } = options\n if (defaultVariants) {\n Object.assign(defaultProps, defaultVariants)\n }\n const isReactNativeWeb =\n 'staticConfig' in Component\n ? Component.staticConfig.isReactNativeWeb\n : RNComponents.has(Component)\n const reactNativeWebComponent = isReactNativeWeb\n ? Component['staticConfig']?.reactNativeWebComponent || Component\n : null\n const isTamagui = !isReactNativeWeb && 'staticConfig' in Component\n const Comp = reactNativeWebComponent || (Component as any)\n const isImage = !!(defaultProps.isImage || (!isTamagui ? Comp === Image : false))\n const isInput = !!(defaultProps.isInput || (!isTamagui ? Comp === TextInput : false))\n const isText = !!(defaultProps.isText || (!isTamagui ? isInput || Comp === Text : false))\n const conf: Partial<StaticConfig> = {\n ...staticExtractionOptions,\n ...(!isTamagui && {\n Component: Comp,\n }),\n isTamagui,\n // this type gets messed up by options?: Partial<GetProps<ParentComponent>> above\n // take away the Partial<> and it's fine\n variants,\n defaultProps,\n defaultVariants,\n componentName: name,\n isReactNativeWeb,\n // for nesting multiple levels of rnw styled() need keep use the OG component\n reactNativeWebComponent,\n isInput,\n isText,\n isImage,\n }\n\n console.log('makeme', name, Comp, conf)\n\n return conf\n }\n return {}\n })()\n\n const component = createComponent(staticConfigProps, Component)\n\n // get parent props without pseudos and medias so we can rebuild both with new variants\n type ParentPropsBase = ParentComponent extends TamaguiComponent<any, any, infer P>\n ? P\n : GetProps<ParentComponent>\n type ParentVariants = ParentComponent extends TamaguiComponent<any, any, any, infer V> ? V : {}\n\n type OurVariants = Variants extends symbol\n ? {}\n : {\n [Key in keyof Variants]?: Variants[Key] extends VariantSpreadFunction<any, infer Val>\n ? Val\n : GetVariantValues<keyof Variants[Key]>\n }\n\n type VariantProps = Omit<ParentVariants, keyof OurVariants> & OurVariants\n type OurPropsBase = ParentPropsBase & VariantProps\n\n type Props = Variants extends void | symbol\n ? GetProps<ParentComponent>\n : // start with base props\n OurPropsBase &\n // add in media (+ pseudos nested)\n MediaProps<Partial<OurPropsBase>> &\n // add in pseudos\n PseudoProps<Partial<OurPropsBase>>\n\n return component as TamaguiComponent<\n Props,\n // TODO infer ref\n any,\n ParentPropsBase,\n ParentVariants & OurVariants\n >\n}\n\n// test types:\n// // variants\n// export const XStack = styled(Stack, {\n// flexDirection: 'row',\n// name: 'XStack',\n// variants: {\n// fullscreen: {\n// true: {},\n// },\n// elevation: {\n// '...size': (val) => ({}),\n// },\n// },\n// })\n// const InBetween = styled(XStack, {})\n// type INBVariants = typeof InBetween extends TamaguiComponent<any, any, any, infer Variants> ? Variants: never\n// const SwitchFrame = styled(InBetween, {\n// name: 'Switch',\n// tag: 'button',\n// borderRadius: 100,\n// borderWidth: 0,\n// variants: {\n// name: {\n// true: {\n// backgroundColor: 'aliceblue'\n// },\n// // 1: {\n\n// // },\n// // ':number': (val) => {\n// // return {}\n// // },\n// // \"...fontSize\": (val) => {\n// // return {}\n// // },\n// // \"...color\": (val) => {\n// // return {}\n// // }\n// }\n// },\n// defaultVariants: {\n// size: '$4',\n// },\n// })\n// const x = <XStack fullscreen />\n// const y = <XStack fullscreen />\n// const z = <SwitchFrame fullscreen name />\n\n// depth:\n// export const SizableText = styled(Stack, {\n// name: 'SizableText',\n// backgroundColor: 'red',\n// variants: {\n// size: {\n// '...fontSize': (val, { props }) => {\n// return {\n// backgroundColor: '',\n// }\n// },\n// },\n// },\n// })\n// export const Heading = styled(SizableText, {\n// tag: 'span',\n// name: 'Heading',\n// accessibilityRole: 'header',\n// size: '$8',\n// margin: 0,\n// })\n// export const Paragraph = styled(SizableText, {\n// tag: 'p',\n// margin: 10,\n// variants: {\n// another: {\n// true: {},\n// },\n// },\n// })\n// export const Paragraph2 = styled(Paragraph, {\n// tag: 'p',\n// variants: {\n// another: {\n// '...color': (val) => ({\n// backgroundColor: 'red',\n// }),\n// },\n// },\n// })\n// const a = <SizableText size=\"$10\" />\n// const b = <Paragraph size=\"$10\" another />\n// const c = <Paragraph2 size=\"$10\" another=\"aliceblue\" />\n// export const SizableText2 = styled(SizableText, {\n// })\n// const xx = <SizableText2 abc />\n// export const Paragraph = styled(SizableText, {\n// name: 'Paragraph',\n// })\n// export const Heading = styled(Paragraph, {\n// tag: 'span',\n// margin: 0,\n// })\n// export const H2 = styled(Heading, {\n// name: 'H2',\n// })\n// const x = <H2 color=\"red\" />\n"],
5
- "mappings": ";;AAAA;AAEA;AACA;AAoBO,gBAML,WAEA,SAMA,yBACA;AACA,QAAM,oBAAqB,OAAM;AAvCnC;AAwCI,QAAI,SAAS;AACX,YAAM,EAAE,UAAU,MAAM,oBAAoB,iBAAiB;AAC7D,UAAI,iBAAiB;AACnB,eAAO,OAAO,cAAc,eAAe;AAAA,MAC7C;AACA,YAAM,mBACJ,kBAAkB,YACd,UAAU,aAAa,mBACvB,aAAa,IAAI,SAAS;AAChC,YAAM,0BAA0B,mBAC5B,iBAAU,oBAAV,mBAA2B,4BAA2B,YACtD;AACJ,YAAM,YAAY,CAAC,oBAAoB,kBAAkB;AACzD,YAAM,OAAO,2BAA4B;AACzC,YAAM,UAAU,CAAC,CAAE,cAAa,WAAY,EAAC,YAAY,SAAS,QAAQ;AAC1E,YAAM,UAAU,CAAC,CAAE,cAAa,WAAY,EAAC,YAAY,SAAS,YAAY;AAC9E,YAAM,SAAS,CAAC,CAAE,cAAa,UAAW,EAAC,YAAY,WAAW,SAAS,OAAO;AAClF,YAAM,OAA8B;AAAA,WAC/B;AAAA,WACC,CAAC,aAAa;AAAA,UAChB,WAAW;AAAA,QACb;AAAA,QACA;AAAA,QAGA;AAAA,QACA;AAAA,QACA;AAAA,QACA,eAAe;AAAA,QACf;AAAA,QAEA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAEA,cAAQ,IAAI,UAAU,MAAM,MAAM,IAAI;AAEtC,aAAO;AAAA,IACT;AACA,WAAO,CAAC;AAAA,EACV,GAAG;AAEH,QAAM,YAAY,gBAAgB,mBAAmB,SAAS;AA4B9D,SAAO;AAOT;AAhGgB;",
4
+ "sourcesContent": ["import { Image, Text, TextInput } from 'react-native'\n\nimport { createComponent } from './createComponent'\nimport { RNComponents } from './helpers/RNComponents'\nimport {\n GetProps,\n GetStyledVariants,\n GetVariantProps,\n GetVariantValues,\n MediaProps,\n PseudoProps,\n StaticConfig,\n StylableComponent,\n TamaguiComponent,\n VariantDefinitions,\n VariantSpreadFunction,\n} from './types'\n\n// TODO may be able to use this in the options?: arg below directly\nexport type StyledOptions<ParentComponent extends StylableComponent> = GetProps<ParentComponent> & {\n name?: string\n variants?: VariantDefinitions<ParentComponent> | undefined\n defaultVariants?: { [key: string]: any }\n}\n\nexport function styled<\n ParentComponent extends StylableComponent,\n Variants extends VariantDefinitions<ParentComponent> | void = VariantDefinitions<ParentComponent> | void\n>(\n Component: ParentComponent,\n // this should be Partial<GetProps<ParentComponent>> but causes excessively deep type issues\n options?: GetProps<ParentComponent> & {\n name?: string\n variants?: Variants | undefined\n // thought i had this typed, but can't get it linked\n defaultVariants?: { [key: string]: any }\n },\n staticExtractionOptions?: Partial<StaticConfig>\n) {\n const staticConfigProps = (() => {\n if (options) {\n const { variants, name, defaultVariants, ...defaultProps } = options\n if (defaultVariants) {\n Object.assign(defaultProps, defaultVariants)\n }\n const isReactNativeWeb =\n 'staticConfig' in Component\n ? Component.staticConfig.isReactNativeWeb\n : RNComponents.has(Component)\n const reactNativeWebComponent = isReactNativeWeb\n ? Component['staticConfig']?.reactNativeWebComponent || Component\n : null\n const isTamagui = !isReactNativeWeb && 'staticConfig' in Component\n const Comp = reactNativeWebComponent || (Component as any)\n const isImage = !!(defaultProps.isImage || (!isTamagui ? Comp === Image : false))\n const isInput = !!(defaultProps.isInput || (!isTamagui ? Comp === TextInput : false))\n const isText = !!(defaultProps.isText || (!isTamagui ? isInput || Comp === Text : false))\n\n const conf: Partial<StaticConfig> = {\n ...staticExtractionOptions,\n ...(!isTamagui && {\n Component: Comp,\n }),\n isTamagui,\n // this type gets messed up by options?: Partial<GetProps<ParentComponent>> above\n // take away the Partial<> and it's fine\n variants,\n defaultProps,\n defaultVariants,\n componentName: name,\n isReactNativeWeb,\n // for nesting multiple levels of rnw styled() need keep use the OG component\n reactNativeWebComponent,\n isInput,\n isText,\n isImage,\n }\n\n return conf\n }\n return {}\n })()\n\n const component = createComponent(staticConfigProps, Component)\n\n // get parent props without pseudos and medias so we can rebuild both with new variants\n type ParentPropsBase = ParentComponent extends TamaguiComponent<any, any, infer P>\n ? P\n : GetProps<ParentComponent>\n type ParentVariants = ParentComponent extends TamaguiComponent<any, any, any, infer V> ? V : {}\n\n type OurVariants = Variants extends void\n ? {}\n : {\n [Key in keyof Variants]?: Variants[Key] extends VariantSpreadFunction<any, infer Val>\n ? Val\n : GetVariantValues<keyof Variants[Key]>\n }\n\n type VariantProps = Omit<ParentVariants, keyof OurVariants> & OurVariants\n type OurPropsBase = ParentPropsBase & VariantProps\n\n type Props = Variants extends void\n ? GetProps<ParentComponent>\n : // start with base props\n OurPropsBase &\n // add in media (+ pseudos nested)\n MediaProps<Partial<OurPropsBase>> &\n // add in pseudos\n PseudoProps<Partial<OurPropsBase>>\n\n return component as TamaguiComponent<\n Props,\n // TODO infer ref\n any,\n ParentPropsBase,\n ParentVariants & OurVariants\n >\n}\n\n// import { Stack } from './views/Stack'\n// const X = styled(Stack, {\n// variants: {\n// size: {\n// '...size': (val) => {\n// return {}\n// }\n// },\n// disabled: {\n// true: {\n// opacity: 0.5,\n// pointerEvents: 'none',\n// },\n// },\n// }\n// })\n// type variants = GetStyledVariants<typeof X>\n// const y = <X disabled size=\"$10\" />\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AACA;AAsBO,gBAIL,WAEA,SAMA,yBACA;AACA,QAAM,oBAAqB,OAAM;AAvCnC;AAwCI,QAAI,SAAS;AACX,YAA6D,cAArD,YAAU,MAAM,oBAAqC,IAAjB,yBAAiB,IAAjB,CAApC,YAAU,QAAM;AACxB,UAAI,iBAAiB;AACnB,eAAO,OAAO,cAAc,eAAe;AAAA,MAC7C;AACA,YAAM,mBACJ,kBAAkB,YACd,UAAU,aAAa,mBACvB,aAAa,IAAI,SAAS;AAChC,YAAM,0BAA0B,mBAC5B,iBAAU,oBAAV,mBAA2B,4BAA2B,YACtD;AACJ,YAAM,YAAY,CAAC,oBAAoB,kBAAkB;AACzD,YAAM,OAAO,2BAA4B;AACzC,YAAM,UAAU,CAAC,CAAE,cAAa,WAAY,EAAC,YAAY,SAAS,QAAQ;AAC1E,YAAM,UAAU,CAAC,CAAE,cAAa,WAAY,EAAC,YAAY,SAAS,YAAY;AAC9E,YAAM,SAAS,CAAC,CAAE,cAAa,UAAW,EAAC,YAAY,WAAW,SAAS,OAAO;AAElF,YAAM,OAA8B,gDAC/B,0BACC,CAAC,aAAa;AAAA,QAChB,WAAW;AAAA,MACb,IAJkC;AAAA,QAKlC;AAAA,QAGA;AAAA,QACA;AAAA,QACA;AAAA,QACA,eAAe;AAAA,QACf;AAAA,QAEA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAEA,aAAO;AAAA,IACT;AACA,WAAO,CAAC;AAAA,EACV,GAAG;AAEH,QAAM,YAAY,gBAAgB,mBAAmB,SAAS;AA4B9D,SAAO;AAOT;",
6
6
  "names": []
7
7
  }
@@ -1,63 +1,103 @@
1
1
  var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
3
32
  import { composeRefs } from "@tamagui/compose-refs";
4
33
  import * as React from "react";
34
+ import { isWeb } from "../constants/platform";
5
35
  const Slot = React.forwardRef((props, forwardedRef) => {
6
- const { children, ...slotProps } = props;
7
- if (React.Children.toArray(children).some(isSlottable)) {
8
- return /* @__PURE__ */ React.createElement(React.Fragment, null, React.Children.map(children, (child) => {
9
- return isSlottable(child) ? /* @__PURE__ */ React.createElement(SlotClone, {
10
- ...slotProps,
11
- ref: forwardedRef
12
- }, child.props.children) : child;
13
- }));
14
- }
15
- return /* @__PURE__ */ React.createElement(SlotClone, {
16
- ...slotProps,
36
+ const _a = props, { children } = _a, slotProps = __objRest(_a, ["children"]);
37
+ return /* @__PURE__ */ React.createElement(SlotClone, __spreadProps(__spreadValues({}, slotProps), {
17
38
  ref: forwardedRef
18
- }, children);
39
+ }), children);
19
40
  });
20
41
  Slot.displayName = "Slot";
21
42
  const SlotClone = React.forwardRef((props, forwardedRef) => {
22
- const { children, ...slotProps } = props;
43
+ const _a = props, { children } = _a, slotProps = __objRest(_a, ["children"]);
23
44
  if (React.isValidElement(children)) {
24
- return React.cloneElement(children, {
25
- ...mergeProps(slotProps, children.props),
45
+ const childProps = __spreadProps(__spreadValues({}, mergeProps(children, slotProps)), {
26
46
  ref: composeRefs(forwardedRef, children.ref)
27
47
  });
48
+ return React.cloneElement(children, childProps);
28
49
  }
29
50
  return React.Children.count(children) > 1 ? React.Children.only(null) : null;
30
51
  });
31
52
  SlotClone.displayName = "SlotClone";
32
- const Slottable = /* @__PURE__ */ __name(({ children }) => {
53
+ const Slottable = ({ children }) => {
33
54
  return /* @__PURE__ */ React.createElement(React.Fragment, null, children);
34
- }, "Slottable");
35
- function isSlottable(child) {
36
- return React.isValidElement(child);
37
- }
38
- __name(isSlottable, "isSlottable");
39
- function mergeProps(slotProps, childProps) {
40
- const overrideProps = { ...childProps };
41
- for (const propName in childProps) {
55
+ };
56
+ const pressMap = isWeb ? {
57
+ onPress: "onClick",
58
+ onPressOut: "onMouseUp",
59
+ onPressIn: "onMouseDown"
60
+ } : {};
61
+ function mergeProps(child, slotProps) {
62
+ const childProps = child.props;
63
+ const overrideProps = __spreadValues({}, childProps);
64
+ const isHTMLChild = typeof child.type === "string";
65
+ if (isHTMLChild) {
66
+ for (const key in pressMap) {
67
+ if (key in slotProps) {
68
+ slotProps[pressMap[key]] = slotProps[key];
69
+ delete slotProps[key];
70
+ }
71
+ }
72
+ }
73
+ for (let propName in childProps) {
42
74
  const slotPropValue = slotProps[propName];
43
75
  const childPropValue = childProps[propName];
44
- const isHandler = /^on[A-Z]/.test(propName);
76
+ if (isHTMLChild && pressMap[propName]) {
77
+ propName = pressMap[propName];
78
+ delete overrideProps[propName];
79
+ }
80
+ const isHandler = handleRegex.test(propName);
45
81
  if (isHandler) {
46
- overrideProps[propName] = (...args) => {
47
- childPropValue == null ? void 0 : childPropValue(...args);
48
- slotPropValue == null ? void 0 : slotPropValue(...args);
49
- };
82
+ overrideProps[propName] = mergeEvent(childPropValue, slotPropValue);
50
83
  } else if (propName === "style") {
51
- overrideProps[propName] = { ...slotPropValue, ...childPropValue };
84
+ overrideProps[propName] = __spreadValues(__spreadValues({}, slotPropValue), childPropValue);
52
85
  } else if (propName === "className") {
53
86
  overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
54
87
  }
55
88
  }
56
- return { ...slotProps, ...overrideProps };
89
+ return __spreadValues(__spreadValues({}, slotProps), overrideProps);
90
+ }
91
+ const handleRegex = /^on[A-Z]/;
92
+ function mergeEvent(a, b) {
93
+ return (...args) => {
94
+ a == null ? void 0 : a(...args);
95
+ b == null ? void 0 : b(...args);
96
+ };
57
97
  }
58
- __name(mergeProps, "mergeProps");
59
98
  export {
60
99
  Slot,
61
- Slottable
100
+ Slottable,
101
+ mergeEvent
62
102
  };
63
103
  //# sourceMappingURL=Slot.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/views/Slot.tsx"],
4
- "sourcesContent": ["// via radix\n\nimport { composeRefs } from '@tamagui/compose-refs'\nimport * as React from 'react'\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/\n\nexport type SlotProps = {\n children?: React.ReactNode\n}\n\nexport const Slot = React.forwardRef<HTMLElement, SlotProps>((props, forwardedRef) => {\n const { children, ...slotProps } = props\n\n if (React.Children.toArray(children).some(isSlottable)) {\n return (\n <>\n {React.Children.map(children, (child) => {\n return isSlottable(child) ? (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {child.props.children}\n </SlotClone>\n ) : (\n child\n )\n })}\n </>\n )\n }\n\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {children}\n </SlotClone>\n )\n})\n\nSlot.displayName = 'Slot'\n\n/* -------------------------------------------------------------------------------------------------\n * SlotClone\n * -----------------------------------------------------------------------------------------------*/\n\ninterface SlotCloneProps {\n children: React.ReactNode\n}\n\nconst SlotClone = React.forwardRef<any, SlotCloneProps>((props, forwardedRef) => {\n const { children, ...slotProps } = props\n\n if (React.isValidElement(children)) {\n return React.cloneElement(children, {\n ...mergeProps(slotProps, children.props),\n ref: composeRefs(forwardedRef, (children as any).ref),\n })\n }\n\n return React.Children.count(children) > 1 ? React.Children.only(null) : null\n})\n\nSlotClone.displayName = 'SlotClone'\n\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * -----------------------------------------------------------------------------------------------*/\n\nexport const Slottable = ({ children }: { children: React.ReactNode }) => {\n return <>{children}</>\n}\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype AnyProps = Record<string, any>\n\nfunction isSlottable(child: React.ReactNode): child is React.ReactElement {\n return React.isValidElement(child)\n}\n\nfunction mergeProps(slotProps: AnyProps, childProps: AnyProps) {\n // all child props should override\n const overrideProps = { ...childProps }\n\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName]\n const childPropValue = childProps[propName]\n\n const isHandler = /^on[A-Z]/.test(propName)\n // if it's a handler, modify the override by composing the base handler\n if (isHandler) {\n overrideProps[propName] = (...args: unknown[]) => {\n childPropValue?.(...args)\n slotPropValue?.(...args)\n }\n }\n // if it's `style`, we merge them\n else if (propName === 'style') {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue }\n } else if (propName === 'className') {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(' ')\n }\n }\n\n return { ...slotProps, ...overrideProps }\n}\n"],
5
- "mappings": ";;AAEA;AACA;AAUO,MAAM,OAAO,MAAM,WAAmC,CAAC,OAAO,iBAAiB;AACpF,QAAM,EAAE,aAAa,cAAc;AAEnC,MAAI,MAAM,SAAS,QAAQ,QAAQ,EAAE,KAAK,WAAW,GAAG;AACtD,WACE,0DACG,MAAM,SAAS,IAAI,UAAU,CAAC,UAAU;AACvC,aAAO,YAAY,KAAK,IACtB,oCAAC;AAAA,WAAc;AAAA,QAAW,KAAK;AAAA,SAC5B,MAAM,MAAM,QACf,IAEA;AAAA,IAEJ,CAAC,CACH;AAAA,EAEJ;AAEA,SACE,oCAAC;AAAA,OAAc;AAAA,IAAW,KAAK;AAAA,KAC5B,QACH;AAEJ,CAAC;AAED,KAAK,cAAc;AAUnB,MAAM,YAAY,MAAM,WAAgC,CAAC,OAAO,iBAAiB;AAC/E,QAAM,EAAE,aAAa,cAAc;AAEnC,MAAI,MAAM,eAAe,QAAQ,GAAG;AAClC,WAAO,MAAM,aAAa,UAAU;AAAA,SAC/B,WAAW,WAAW,SAAS,KAAK;AAAA,MACvC,KAAK,YAAY,cAAe,SAAiB,GAAG;AAAA,IACtD,CAAC;AAAA,EACH;AAEA,SAAO,MAAM,SAAS,MAAM,QAAQ,IAAI,IAAI,MAAM,SAAS,KAAK,IAAI,IAAI;AAC1E,CAAC;AAED,UAAU,cAAc;AAMjB,MAAM,YAAY,wBAAC,EAAE,eAA8C;AACxE,SAAO,0DAAG,QAAS;AACrB,GAFyB;AAQzB,qBAAqB,OAAqD;AACxE,SAAO,MAAM,eAAe,KAAK;AACnC;AAFS;AAIT,oBAAoB,WAAqB,YAAsB;AAE7D,QAAM,gBAAgB,KAAK,WAAW;AAEtC,aAAW,YAAY,YAAY;AACjC,UAAM,gBAAgB,UAAU;AAChC,UAAM,iBAAiB,WAAW;AAElC,UAAM,YAAY,WAAW,KAAK,QAAQ;AAE1C,QAAI,WAAW;AACb,oBAAc,YAAY,IAAI,SAAoB;AAChD,yDAAiB,GAAG;AACpB,uDAAgB,GAAG;AAAA,MACrB;AAAA,IACF,WAES,aAAa,SAAS;AAC7B,oBAAc,YAAY,KAAK,kBAAkB,eAAe;AAAA,IAClE,WAAW,aAAa,aAAa;AACnC,oBAAc,YAAY,CAAC,eAAe,cAAc,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,IACpF;AAAA,EACF;AAEA,SAAO,KAAK,cAAc,cAAc;AAC1C;AAzBS;",
4
+ "sourcesContent": ["// via radix\n\nimport { composeRefs } from '@tamagui/compose-refs'\nimport * as React from 'react'\n\nimport { isWeb } from '../constants/platform'\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/\n\nexport type SlotProps = {\n children?: React.ReactNode\n}\n\nexport const Slot = React.forwardRef<HTMLElement, SlotProps>((props, forwardedRef) => {\n const { children, ...slotProps } = props\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {children}\n </SlotClone>\n )\n})\n\nSlot.displayName = 'Slot'\n\n/* -------------------------------------------------------------------------------------------------\n * SlotClone\n * -----------------------------------------------------------------------------------------------*/\n\ninterface SlotCloneProps {\n children: React.ReactNode\n}\n\nconst SlotClone = React.forwardRef<any, SlotCloneProps>((props, forwardedRef) => {\n const { children, ...slotProps } = props\n\n if (React.isValidElement(children)) {\n const childProps = {\n ...mergeProps(children, slotProps),\n ref: composeRefs(forwardedRef, (children as any).ref),\n }\n return React.cloneElement(children, childProps)\n }\n\n return React.Children.count(children) > 1 ? React.Children.only(null) : null\n})\n\nSlotClone.displayName = 'SlotClone'\n\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * -----------------------------------------------------------------------------------------------*/\n\nexport const Slottable = ({ children }: { children: React.ReactNode }) => {\n return <>{children}</>\n}\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype AnyProps = Record<string, any>\n\n// function isSlottable(child: React.ReactNode): child is React.ReactElement {\n// return React.isValidElement(child)\n// }\n\nconst pressMap = isWeb\n ? {\n onPress: 'onClick',\n onPressOut: 'onMouseUp',\n onPressIn: 'onMouseDown',\n }\n : {}\n\nfunction mergeProps(child: any, slotProps: AnyProps) {\n const childProps = child.props\n\n // all child props should override\n const overrideProps = { ...childProps }\n const isHTMLChild = typeof child.type === 'string'\n\n if (isHTMLChild) {\n for (const key in pressMap) {\n if (key in slotProps) {\n slotProps[pressMap[key]] = slotProps[key]\n delete slotProps[key]\n }\n }\n }\n\n for (let propName in childProps) {\n const slotPropValue = slotProps[propName]\n const childPropValue = childProps[propName]\n\n if (isHTMLChild && pressMap[propName]) {\n propName = pressMap[propName]\n delete overrideProps[propName]\n }\n\n const isHandler = handleRegex.test(propName)\n // if it's a handler, modify the override by composing the base handler\n if (isHandler) {\n overrideProps[propName] = mergeEvent(childPropValue, slotPropValue)\n }\n // if it's `style`, we merge them\n else if (propName === 'style') {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue }\n } else if (propName === 'className') {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(' ')\n }\n }\n\n return { ...slotProps, ...overrideProps }\n}\n\nconst handleRegex = /^on[A-Z]/\n\nexport function mergeEvent(a?: Function, b?: Function) {\n return (...args: unknown[]) => {\n a?.(...args)\n b?.(...args)\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;AACA;AAEA;AAUO,MAAM,OAAO,MAAM,WAAmC,CAAC,OAAO,iBAAiB;AACpF,QAAmC,YAA3B,eAA2B,IAAd,sBAAc,IAAd,CAAb;AACR,SACE,oCAAC,4CAAc,YAAd;AAAA,IAAyB,KAAK;AAAA,MAC5B,QACH;AAEJ,CAAC;AAED,KAAK,cAAc;AAUnB,MAAM,YAAY,MAAM,WAAgC,CAAC,OAAO,iBAAiB;AAC/E,QAAmC,YAA3B,eAA2B,IAAd,sBAAc,IAAd,CAAb;AAER,MAAI,MAAM,eAAe,QAAQ,GAAG;AAClC,UAAM,aAAa,iCACd,WAAW,UAAU,SAAS,IADhB;AAAA,MAEjB,KAAK,YAAY,cAAe,SAAiB,GAAG;AAAA,IACtD;AACA,WAAO,MAAM,aAAa,UAAU,UAAU;AAAA,EAChD;AAEA,SAAO,MAAM,SAAS,MAAM,QAAQ,IAAI,IAAI,MAAM,SAAS,KAAK,IAAI,IAAI;AAC1E,CAAC;AAED,UAAU,cAAc;AAMjB,MAAM,YAAY,CAAC,EAAE,eAA8C;AACxE,SAAO,0DAAG,QAAS;AACrB;AAUA,MAAM,WAAW,QACb;AAAA,EACE,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,WAAW;AACb,IACA,CAAC;AAEL,oBAAoB,OAAY,WAAqB;AACnD,QAAM,aAAa,MAAM;AAGzB,QAAM,gBAAgB,mBAAK;AAC3B,QAAM,cAAc,OAAO,MAAM,SAAS;AAE1C,MAAI,aAAa;AACf,eAAW,OAAO,UAAU;AAC1B,UAAI,OAAO,WAAW;AACpB,kBAAU,SAAS,QAAQ,UAAU;AACrC,eAAO,UAAU;AAAA,MACnB;AAAA,IACF;AAAA,EACF;AAEA,WAAS,YAAY,YAAY;AAC/B,UAAM,gBAAgB,UAAU;AAChC,UAAM,iBAAiB,WAAW;AAElC,QAAI,eAAe,SAAS,WAAW;AACrC,iBAAW,SAAS;AACpB,aAAO,cAAc;AAAA,IACvB;AAEA,UAAM,YAAY,YAAY,KAAK,QAAQ;AAE3C,QAAI,WAAW;AACb,oBAAc,YAAY,WAAW,gBAAgB,aAAa;AAAA,IACpE,WAES,aAAa,SAAS;AAC7B,oBAAc,YAAY,kCAAK,gBAAkB;AAAA,IACnD,WAAW,aAAa,aAAa;AACnC,oBAAc,YAAY,CAAC,eAAe,cAAc,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,IACpF;AAAA,EACF;AAEA,SAAO,kCAAK,YAAc;AAC5B;AAEA,MAAM,cAAc;AAEb,oBAAoB,GAAc,GAAc;AACrD,SAAO,IAAI,SAAoB;AAC7B,2BAAI,GAAG;AACP,2BAAI,GAAG;AAAA,EACT;AACF;",
6
6
  "names": []
7
7
  }
@@ -1,11 +1,29 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
1
20
  import { stackDefaultStyles } from "../constants/constants";
2
21
  import { createComponent } from "../createComponent";
3
22
  const Stack = createComponent({
4
23
  componentName: "Stack",
5
- defaultProps: {
6
- ...stackDefaultStyles,
24
+ defaultProps: __spreadProps(__spreadValues({}, stackDefaultStyles), {
7
25
  flexDirection: "column"
8
- }
26
+ })
9
27
  });
10
28
  export {
11
29
  Stack
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/views/Stack.tsx"],
4
4
  "sourcesContent": ["import { View } from 'react-native'\n\nimport { stackDefaultStyles } from '../constants/constants'\nimport { createComponent } from '../createComponent'\nimport { StackProps, StackPropsBase } from '../types'\n\nexport const Stack = createComponent<StackProps, View, StackPropsBase>({\n componentName: 'Stack',\n defaultProps: {\n ...stackDefaultStyles,\n flexDirection: 'column',\n },\n})\n\n// test types\n// export const YStack = styled(Stack, {\n// flexDirection: 'column',\n// })\n// // test types\n// const x00 = <Stack missing={0} /> // should err\n// const x0 = <YStack missing={0} /> // should err\n// const x1 = (props: StackProps) => <YStack {...props} />\n// type ys = typeof YStack\n// type ysv = ys extends StaticComponent<any, infer V> ? V : unknown\n"],
5
- "mappings": "AAEA;AACA;AAGO,MAAM,QAAQ,gBAAkD;AAAA,EACrE,eAAe;AAAA,EACf,cAAc;AAAA,OACT;AAAA,IACH,eAAe;AAAA,EACjB;AACF,CAAC;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAEA;AACA;AAGO,MAAM,QAAQ,gBAAkD;AAAA,EACrE,eAAe;AAAA,EACf,cAAc,iCACT,qBADS;AAAA,IAEZ,eAAe;AAAA,EACjB;AACF,CAAC;",
6
6
  "names": []
7
7
  }
@@ -1,3 +1,19 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ }
15
+ return a;
16
+ };
1
17
  import { stylePropsTextOnly, validStyles } from "@tamagui/helpers";
2
18
  import { isWeb } from "../constants/platform";
3
19
  import { createComponent } from "../createComponent";
@@ -10,16 +26,18 @@ const ellipseStyle = {
10
26
  const Text = createComponent({
11
27
  componentName: "Text",
12
28
  isText: true,
13
- defaultProps: {
14
- display: isWeb ? "inline" : "flex",
29
+ defaultProps: __spreadValues({
30
+ display: "flex",
31
+ fontFamily: "System"
32
+ }, isWeb && {
33
+ display: "inline",
15
34
  boxSizing: "border-box",
16
- fontFamily: "System",
17
35
  wordWrap: "break-word"
18
- },
36
+ }),
19
37
  variants: {
20
38
  numberOfLines: {
21
- 1: ellipseStyle,
22
- ":number": (lines) => lines > 1 ? { WebkitLineClamp: 1 } : null
39
+ 1: isWeb ? ellipseStyle : { numberOfLines: 1 },
40
+ ":number": (numberOfLines) => isWeb ? numberOfLines >= 1 ? { WebkitLineClamp: numberOfLines } : null : { numberOfLines }
23
41
  },
24
42
  selectable: {
25
43
  true: {
@@ -27,7 +45,8 @@ const Text = createComponent({
27
45
  cursor: "text"
28
46
  },
29
47
  false: {
30
- userSelect: "none"
48
+ userSelect: "none",
49
+ cursor: "inherit"
31
50
  }
32
51
  },
33
52
  pressable: {
@@ -43,18 +62,7 @@ const Text = createComponent({
43
62
  }
44
63
  },
45
64
  deoptProps: new Set(isWeb ? [] : ["ellipse"]),
46
- validStyles: {
47
- ...validStyles,
48
- ...stylePropsTextOnly,
49
- ...isWeb && {
50
- userSelect: true,
51
- textOverflow: true,
52
- whiteSpace: true,
53
- wordWrap: true,
54
- selectable: true,
55
- cursor: true
56
- }
57
- }
65
+ validStyles: __spreadValues(__spreadValues({}, validStyles), stylePropsTextOnly)
58
66
  });
59
67
  export {
60
68
  Text
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/views/Text.tsx"],
4
- "sourcesContent": ["import { stylePropsTextOnly, validStyles } from '@tamagui/helpers'\nimport { Text as TextView } from 'react-native'\n\nimport { isWeb } from '../constants/platform'\nimport { createComponent } from '../createComponent'\nimport { TextProps, TextPropsBase } from '../types'\n\nconst ellipseStyle = {\n maxWidth: '100%',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n}\n\nexport const Text = createComponent<TextProps, TextView, TextPropsBase>({\n componentName: 'Text',\n isText: true,\n defaultProps: {\n display: isWeb ? '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 cursor: '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 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;AAGA;AACA;AAGA,MAAM,eAAe;AAAA,EACnB,UAAU;AAAA,EACV,UAAU;AAAA,EACV,cAAc;AAAA,EACd,YAAY;AACd;AAEO,MAAM,OAAO,gBAAoD;AAAA,EACtE,eAAe;AAAA,EACf,QAAQ;AAAA,EACR,cAAc;AAAA,IACZ,SAAS,QAAQ,WAAW;AAAA,IAC5B,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,UAAU;AAAA,EACZ;AAAA,EACA,UAAU;AAAA,IACR,eAAe;AAAA,MACb,GAAG;AAAA,MAEH,WAAW,CAAC,UAAW,QAAQ,IAAI,EAAE,iBAAiB,EAAE,IAAI;AAAA,IAC9D;AAAA,IAEA,YAAY;AAAA,MACV,MAAM;AAAA,QACJ,YAAY;AAAA,QACZ,QAAQ;AAAA,MACV;AAAA,MACA,OAAO;AAAA,QACL,YAAY;AAAA,MACd;AAAA,IACF;AAAA,IAEA,WAAW;AAAA,MACT,MAAM;AAAA,QACJ,QAAQ;AAAA,MACV;AAAA,IACF;AAAA,IAEA,SAAS;AAAA,MACP,MAAM,QACF,eACA;AAAA,QACE,eAAe;AAAA,QACf,eAAe;AAAA,MACjB;AAAA,IACN;AAAA,EACF;AAAA,EACA,YAAY,IAAI,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC;AAAA,EAC5C,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,IACV;AAAA,EACF;AACF,CAAC;",
4
+ "sourcesContent": ["import { stylePropsTextOnly, validStyles } from '@tamagui/helpers'\nimport { Text as TextView } from 'react-native'\n\nimport { isWeb } from '../constants/platform'\nimport { createComponent } from '../createComponent'\nimport { TextProps, TextPropsBase } from '../types'\n\nconst ellipseStyle = {\n maxWidth: '100%',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n}\n\nexport const Text = createComponent<TextProps, TextView, TextPropsBase>({\n componentName: 'Text',\n isText: true,\n\n defaultProps: {\n display: 'flex',\n fontFamily: 'System',\n ...(isWeb && {\n display: 'inline',\n boxSizing: 'border-box',\n wordWrap: 'break-word',\n }),\n },\n\n variants: {\n numberOfLines: {\n 1: isWeb ? ellipseStyle : { numberOfLines: 1 },\n\n ':number': (numberOfLines) =>\n isWeb\n ? numberOfLines >= 1\n ? { WebkitLineClamp: numberOfLines }\n : null\n : { numberOfLines },\n },\n\n selectable: {\n true: {\n userSelect: 'text',\n cursor: 'text',\n },\n false: {\n userSelect: 'none',\n cursor: 'inherit',\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\n deoptProps: new Set(isWeb ? [] : ['ellipse']),\n\n validStyles: {\n ...validStyles,\n ...stylePropsTextOnly,\n },\n})\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;AAAA;AAGA;AACA;AAGA,MAAM,eAAe;AAAA,EACnB,UAAU;AAAA,EACV,UAAU;AAAA,EACV,cAAc;AAAA,EACd,YAAY;AACd;AAEO,MAAM,OAAO,gBAAoD;AAAA,EACtE,eAAe;AAAA,EACf,QAAQ;AAAA,EAER,cAAc;AAAA,IACZ,SAAS;AAAA,IACT,YAAY;AAAA,KACR,SAAS;AAAA,IACX,SAAS;AAAA,IACT,WAAW;AAAA,IACX,UAAU;AAAA,EACZ;AAAA,EAGF,UAAU;AAAA,IACR,eAAe;AAAA,MACb,GAAG,QAAQ,eAAe,EAAE,eAAe,EAAE;AAAA,MAE7C,WAAW,CAAC,kBACV,QACI,iBAAiB,IACf,EAAE,iBAAiB,cAAc,IACjC,OACF,EAAE,cAAc;AAAA,IACxB;AAAA,IAEA,YAAY;AAAA,MACV,MAAM;AAAA,QACJ,YAAY;AAAA,QACZ,QAAQ;AAAA,MACV;AAAA,MACA,OAAO;AAAA,QACL,YAAY;AAAA,QACZ,QAAQ;AAAA,MACV;AAAA,IACF;AAAA,IAEA,WAAW;AAAA,MACT,MAAM;AAAA,QACJ,QAAQ;AAAA,MACV;AAAA,IACF;AAAA,IAEA,SAAS;AAAA,MACP,MAAM,QACF,eACA;AAAA,QACE,eAAe;AAAA,QACf,eAAe;AAAA,MACjB;AAAA,IACN;AAAA,EACF;AAAA,EAEA,YAAY,IAAI,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC;AAAA,EAE5C,aAAa,kCACR,cACA;AAEP,CAAC;",
6
6
  "names": []
7
7
  }
@@ -1,15 +1,12 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
- var _a, _b;
1
+ import { TextAncestorContext as RNWTextAncestorContext } from "@tamagui/rnw";
4
2
  import React, { createContext } from "react";
5
- import { rnw } from "../constants/rnw";
6
3
  const FallbackNativeContext = createContext(false);
7
- const TextAncestorContext = (_b = (_a = rnw) == null ? void 0 : _a.TextAncestorContext) != null ? _b : FallbackNativeContext;
8
- const TextAncestorProvider = /* @__PURE__ */ __name((props) => {
4
+ const TextAncestorContext = RNWTextAncestorContext ?? FallbackNativeContext;
5
+ const TextAncestorProvider = (props) => {
9
6
  return /* @__PURE__ */ React.createElement(TextAncestorContext.Provider, {
10
7
  value: false
11
8
  }, props.children);
12
- }, "TextAncestorProvider");
9
+ };
13
10
  export {
14
11
  FallbackNativeContext,
15
12
  TextAncestorContext,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/views/TextAncestorContext.tsx"],
4
- "sourcesContent": ["import React, { createContext } from 'react'\n\nimport { rnw } from '../constants/rnw'\n\nexport const FallbackNativeContext = createContext(false)\n\nexport const TextAncestorContext = rnw?.TextAncestorContext ?? FallbackNativeContext\n\nexport const TextAncestorProvider = (props) => {\n return <TextAncestorContext.Provider value={false}>{props.children}</TextAncestorContext.Provider>\n}\n"],
5
- "mappings": ";;AAAA;AAAA;AAEA;AAEO,MAAM,wBAAwB,cAAc,KAAK;AAEjD,MAAM,sBAAsB,uCAAK,wBAAL,YAA4B;AAExD,MAAM,uBAAuB,wBAAC,UAAU;AAC7C,SAAO,oCAAC,oBAAoB,UAApB;AAAA,IAA6B,OAAO;AAAA,KAAQ,MAAM,QAAS;AACrE,GAFoC;",
4
+ "sourcesContent": ["import { TextAncestorContext as RNWTextAncestorContext } from '@tamagui/rnw'\nimport React, { createContext } from 'react'\n\nexport const FallbackNativeContext = createContext(false)\n\nexport const TextAncestorContext = RNWTextAncestorContext ?? FallbackNativeContext\n\nexport const TextAncestorProvider = (props) => {\n return <TextAncestorContext.Provider value={false}>{props.children}</TextAncestorContext.Provider>\n}\n"],
5
+ "mappings": "AAAA;AACA;AAEO,MAAM,wBAAwB,cAAc,KAAK;AAEjD,MAAM,sBAAsB,0BAA0B;AAEtD,MAAM,uBAAuB,CAAC,UAAU;AAC7C,SAAO,oCAAC,oBAAoB,UAApB;AAAA,IAA6B,OAAO;AAAA,KAAQ,MAAM,QAAS;AACrE;",
6
6
  "names": []
7
7
  }
@@ -1,26 +1,22 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
1
  import React, { memo, useMemo } from "react";
4
2
  import { isWeb } from "../constants/platform";
5
3
  import { wrapThemeManagerContext } from "../helpers/wrapThemeManagerContext";
6
4
  import { useChangeThemeEffect } from "../hooks/useTheme";
7
5
  React["createElement"];
8
- const Theme = memo(/* @__PURE__ */ __name(function Theme2(props) {
6
+ const Theme = memo(function Theme2(props) {
9
7
  var _a, _b;
10
8
  const { name, theme, themeManager, themes, className } = useChangeThemeEffect(props.name, props.componentName, props);
11
- if (!themes || !name || !theme) {
9
+ const missingTheme = !themes || !name || !theme;
10
+ const contents = useMemo(() => missingTheme ? null : wrapThemeManagerContext(props.children, themeManager), [props.children, themeManager]);
11
+ if (missingTheme) {
12
12
  if (name && !theme && process.env.NODE_ENV === "development") {
13
13
  console.warn(`No theme found by name ${name}`);
14
14
  }
15
15
  return props.children;
16
16
  }
17
- const contents = useMemo(() => wrapThemeManagerContext(props.children, themeManager), [props.children, themeManager]);
18
17
  if (isWeb) {
19
18
  return /* @__PURE__ */ React.createElement("span", {
20
- className: [
21
- `tui_Theme`,
22
- ...!props.disableThemeClass ? [props.className, className].filter(Boolean) : []
23
- ].join(" "),
19
+ className: (!props.disableThemeClass ? [props.className, className].filter(Boolean) : []).join(" "),
24
20
  style: {
25
21
  display: "contents",
26
22
  color: (_b = (_a = themes[name]) == null ? void 0 : _a.color) == null ? void 0 : _b.toString()
@@ -28,7 +24,7 @@ const Theme = memo(/* @__PURE__ */ __name(function Theme2(props) {
28
24
  }, contents);
29
25
  }
30
26
  return contents;
31
- }, "Theme"));
27
+ });
32
28
  export {
33
29
  Theme
34
30
  };