@tamagui/web 3.0.0-beta.831.1 → 3.0.0-beta.889.1

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 (474) hide show
  1. package/dist/cjs/createComponent.cjs +12 -1
  2. package/dist/cjs/createComponent.native.cjs +12 -1
  3. package/dist/cjs/createComponent.native.js +12 -1
  4. package/dist/cjs/createComponent.native.js.map +1 -1
  5. package/dist/cjs/createStyledHOC.cjs +1 -1
  6. package/dist/cjs/createStyledHOC.native.cjs +1 -1
  7. package/dist/cjs/createStyledHOC.native.js +1 -1
  8. package/dist/cjs/createStyledHOC.native.js.map +1 -1
  9. package/dist/cjs/createVariable.cjs +0 -10
  10. package/dist/cjs/createVariable.native.cjs +0 -10
  11. package/dist/cjs/createVariable.native.js +0 -10
  12. package/dist/cjs/createVariable.native.js.map +1 -1
  13. package/dist/cjs/helpers/borderComponents.cjs +62 -0
  14. package/dist/cjs/helpers/borderComponents.native.cjs +82 -0
  15. package/dist/cjs/helpers/borderComponents.native.js +84 -0
  16. package/dist/cjs/helpers/borderComponents.native.js.map +1 -0
  17. package/dist/cjs/helpers/createDesignSystem.cjs +0 -2
  18. package/dist/cjs/helpers/createStyledContext.cjs +10 -18
  19. package/dist/cjs/helpers/createStyledContext.native.cjs +14 -18
  20. package/dist/cjs/helpers/createStyledContext.native.js +14 -18
  21. package/dist/cjs/helpers/createStyledContext.native.js.map +1 -1
  22. package/dist/cjs/helpers/formatDiagnostic.cjs +6 -6
  23. package/dist/cjs/helpers/formatDiagnostic.native.cjs +6 -6
  24. package/dist/cjs/helpers/formatDiagnostic.native.js +6 -6
  25. package/dist/cjs/helpers/formatDiagnostic.native.js.map +1 -1
  26. package/dist/cjs/helpers/getCSSStylesAtomic.cjs +128 -109
  27. package/dist/cjs/helpers/getCSSStylesAtomic.native.cjs +11 -3
  28. package/dist/cjs/helpers/getCSSStylesAtomic.native.js +11 -3
  29. package/dist/cjs/helpers/getCSSStylesAtomic.native.js.map +1 -1
  30. package/dist/cjs/helpers/getCSSStylesAtomicCompiled.cjs +13 -1
  31. package/dist/cjs/helpers/getCSSStylesAtomicCompiled.native.cjs +15 -1
  32. package/dist/cjs/helpers/getCSSStylesAtomicCompiled.native.js +15 -1
  33. package/dist/cjs/helpers/getCSSStylesAtomicCompiled.native.js.map +1 -1
  34. package/dist/cjs/helpers/getDynamicVal.cjs +5 -1
  35. package/dist/cjs/helpers/getDynamicVal.native.cjs +5 -1
  36. package/dist/cjs/helpers/getDynamicVal.native.js +5 -1
  37. package/dist/cjs/helpers/getDynamicVal.native.js.map +1 -1
  38. package/dist/cjs/helpers/getSplitStyles.cjs +1042 -1715
  39. package/dist/cjs/helpers/getSplitStyles.native.cjs +1081 -1887
  40. package/dist/cjs/helpers/getSplitStyles.native.js +1081 -1887
  41. package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
  42. package/dist/cjs/helpers/grammarConfig.cjs +163 -1
  43. package/dist/cjs/helpers/grammarConfig.native.cjs +186 -1
  44. package/dist/cjs/helpers/grammarConfig.native.js +186 -1
  45. package/dist/cjs/helpers/grammarConfig.native.js.map +1 -1
  46. package/dist/cjs/helpers/insertStyleRule.cjs +5 -1
  47. package/dist/cjs/helpers/insertStyleRule.native.cjs +7 -1
  48. package/dist/cjs/helpers/insertStyleRule.native.js +7 -1
  49. package/dist/cjs/helpers/insertStyleRule.native.js.map +1 -1
  50. package/dist/cjs/helpers/log.cjs +9 -8
  51. package/dist/cjs/helpers/log.native.cjs +9 -8
  52. package/dist/cjs/helpers/log.native.js +9 -8
  53. package/dist/cjs/helpers/log.native.js.map +1 -1
  54. package/dist/cjs/helpers/mergeVariants.cjs +44 -13
  55. package/dist/cjs/helpers/mergeVariants.native.cjs +79 -14
  56. package/dist/cjs/helpers/mergeVariants.native.js +79 -14
  57. package/dist/cjs/helpers/mergeVariants.native.js.map +1 -1
  58. package/dist/cjs/helpers/nativeOnlyProps.cjs +0 -1
  59. package/dist/cjs/helpers/nativeOnlyProps.native.cjs +0 -1
  60. package/dist/cjs/helpers/nativeOnlyProps.native.js +0 -1
  61. package/dist/cjs/helpers/nativeOnlyProps.native.js.map +1 -1
  62. package/dist/cjs/helpers/nativeStyleEngine.cjs +34 -14
  63. package/dist/cjs/helpers/nativeStyleEngine.native.cjs +36 -14
  64. package/dist/cjs/helpers/nativeStyleEngine.native.js +36 -14
  65. package/dist/cjs/helpers/nativeStyleEngine.native.js.map +1 -1
  66. package/dist/cjs/helpers/normalizeValueWithProperty.cjs +7 -8
  67. package/dist/cjs/helpers/normalizeValueWithProperty.native.cjs +9 -8
  68. package/dist/cjs/helpers/normalizeValueWithProperty.native.js +9 -8
  69. package/dist/cjs/helpers/normalizeValueWithProperty.native.js.map +1 -1
  70. package/dist/cjs/helpers/parseBorderShorthand.native.cjs +25 -56
  71. package/dist/cjs/helpers/parseBorderShorthand.native.js +25 -56
  72. package/dist/cjs/helpers/parseBorderShorthand.native.js.map +1 -1
  73. package/dist/cjs/helpers/parseOutlineShorthand.native.cjs +9 -49
  74. package/dist/cjs/helpers/parseOutlineShorthand.native.js +9 -49
  75. package/dist/cjs/helpers/parseOutlineShorthand.native.js.map +1 -1
  76. package/dist/cjs/helpers/resolveSafeArea.cjs +35 -100
  77. package/dist/cjs/helpers/resolveVariantStyle.cjs +57 -0
  78. package/dist/cjs/helpers/resolveVariantStyle.native.cjs +67 -0
  79. package/dist/cjs/helpers/resolveVariantStyle.native.js +69 -0
  80. package/dist/cjs/helpers/resolveVariantStyle.native.js.map +1 -0
  81. package/dist/cjs/helpers/styleStaticConfig.cjs +1 -50
  82. package/dist/cjs/helpers/styleStaticConfig.native.cjs +1 -51
  83. package/dist/cjs/helpers/styleStaticConfig.native.js +1 -51
  84. package/dist/cjs/helpers/styleStaticConfig.native.js.map +1 -1
  85. package/dist/cjs/helpers/styleStaticConfigCore.cjs +107 -0
  86. package/dist/cjs/helpers/styleStaticConfigCore.native.cjs +127 -0
  87. package/dist/cjs/helpers/styleStaticConfigCore.native.js +129 -0
  88. package/dist/cjs/helpers/styleStaticConfigCore.native.js.map +1 -0
  89. package/dist/cjs/helpers/styledDynamic.cjs +160 -0
  90. package/dist/cjs/helpers/styledDynamic.native.cjs +195 -0
  91. package/dist/cjs/helpers/styledDynamic.native.js +197 -0
  92. package/dist/cjs/helpers/styledDynamic.native.js.map +1 -0
  93. package/dist/cjs/helpers/tokenCategories.cjs +15 -38
  94. package/dist/cjs/helpers/tokenCategories.native.cjs +15 -40
  95. package/dist/cjs/helpers/tokenCategories.native.js +15 -40
  96. package/dist/cjs/helpers/tokenCategories.native.js.map +1 -1
  97. package/dist/cjs/helpers/variableValue.cjs +17 -12
  98. package/dist/cjs/helpers/variableValue.native.cjs +46 -23
  99. package/dist/cjs/helpers/variableValue.native.js +46 -23
  100. package/dist/cjs/helpers/variableValue.native.js.map +1 -1
  101. package/dist/cjs/helpers/warnOnce.cjs +5 -4
  102. package/dist/cjs/helpers/warnOnce.native.cjs +6 -4
  103. package/dist/cjs/helpers/warnOnce.native.js +6 -4
  104. package/dist/cjs/helpers/warnOnce.native.js.map +1 -1
  105. package/dist/cjs/hooks/useAnimationDriver.cjs +2 -2
  106. package/dist/cjs/hooks/useAnimationDriver.native.cjs +2 -2
  107. package/dist/cjs/hooks/useAnimationDriver.native.js +2 -2
  108. package/dist/cjs/hooks/useAnimationDriver.native.js.map +1 -1
  109. package/dist/cjs/hooks/useComponentState.cjs +41 -82
  110. package/dist/cjs/hooks/useComponentState.native.cjs +45 -84
  111. package/dist/cjs/hooks/useComponentState.native.js +45 -84
  112. package/dist/cjs/hooks/useComponentState.native.js.map +1 -1
  113. package/dist/cjs/hooks/useMedia.cjs +2 -2
  114. package/dist/cjs/hooks/useMedia.native.cjs +2 -2
  115. package/dist/cjs/hooks/useMedia.native.js +2 -2
  116. package/dist/cjs/hooks/useMedia.native.js.map +1 -1
  117. package/dist/cjs/{helpers/directStyleCSS.native.js → hooks/useStyle.cjs} +16 -8
  118. package/dist/cjs/{helpers/directStyleCSS.native.cjs → hooks/useStyle.native.cjs} +16 -4
  119. package/dist/cjs/hooks/useStyle.native.js +34 -0
  120. package/dist/cjs/hooks/useStyle.native.js.map +1 -0
  121. package/dist/cjs/hooks/useThemeState.cjs +25 -90
  122. package/dist/cjs/hooks/useThemeState.native.cjs +34 -94
  123. package/dist/cjs/hooks/useThemeState.native.js +34 -94
  124. package/dist/cjs/hooks/useThemeState.native.js.map +1 -1
  125. package/dist/cjs/index.cjs +6 -3
  126. package/dist/cjs/index.native.cjs +6 -3
  127. package/dist/cjs/index.native.js +6 -3
  128. package/dist/cjs/index.native.js.map +1 -1
  129. package/dist/cjs/static-resolve.cjs +2 -2
  130. package/dist/cjs/static-resolve.native.cjs +2 -2
  131. package/dist/cjs/static-resolve.native.js +2 -2
  132. package/dist/cjs/static-resolve.native.js.map +1 -1
  133. package/dist/cjs/style.cjs +91 -0
  134. package/dist/cjs/style.native.cjs +98 -0
  135. package/dist/cjs/style.native.js +100 -0
  136. package/dist/cjs/style.native.js.map +1 -0
  137. package/dist/cjs/styled.cjs +11 -6
  138. package/dist/cjs/styled.native.cjs +11 -6
  139. package/dist/cjs/styled.native.js +11 -6
  140. package/dist/cjs/styled.native.js.map +1 -1
  141. package/dist/cjs/types.cjs +6 -4
  142. package/dist/cjs/types.native.cjs +6 -4
  143. package/dist/cjs/types.native.js +6 -4
  144. package/dist/cjs/types.native.js.map +1 -1
  145. package/dist/cjs/views/TamaguiProvider.cjs +1 -2
  146. package/dist/cjs/views/TamaguiProvider.native.cjs +1 -2
  147. package/dist/cjs/views/TamaguiProvider.native.js +1 -2
  148. package/dist/cjs/views/TamaguiProvider.native.js.map +1 -1
  149. package/dist/cjs/views/Text.cjs +17 -12
  150. package/dist/cjs/views/Text.native.cjs +1 -0
  151. package/dist/cjs/views/Text.native.js +1 -0
  152. package/dist/cjs/views/Text.native.js.map +1 -1
  153. package/dist/cjs/views/Theme.cjs +3 -3
  154. package/dist/cjs/views/Theme.native.cjs +3 -3
  155. package/dist/cjs/views/Theme.native.js +3 -3
  156. package/dist/cjs/views/Theme.native.js.map +1 -1
  157. package/dist/cjs/views/ThemeDebug.cjs +1 -4
  158. package/dist/esm/createComponent.mjs +12 -1
  159. package/dist/esm/createComponent.mjs.map +1 -1
  160. package/dist/esm/createComponent.native.js +12 -1
  161. package/dist/esm/createComponent.native.js.map +1 -1
  162. package/dist/esm/createStyledHOC.mjs +1 -1
  163. package/dist/esm/createStyledHOC.mjs.map +1 -1
  164. package/dist/esm/createStyledHOC.native.js +1 -1
  165. package/dist/esm/createStyledHOC.native.js.map +1 -1
  166. package/dist/esm/createVariable.mjs +1 -9
  167. package/dist/esm/createVariable.mjs.map +1 -1
  168. package/dist/esm/createVariable.native.js +1 -9
  169. package/dist/esm/createVariable.native.js.map +1 -1
  170. package/dist/esm/helpers/borderComponents.mjs +37 -0
  171. package/dist/esm/helpers/borderComponents.mjs.map +1 -0
  172. package/dist/esm/helpers/borderComponents.native.js +55 -0
  173. package/dist/esm/helpers/borderComponents.native.js.map +1 -0
  174. package/dist/esm/helpers/createDesignSystem.mjs +0 -2
  175. package/dist/esm/helpers/createDesignSystem.mjs.map +1 -1
  176. package/dist/esm/helpers/createStyledContext.mjs +10 -18
  177. package/dist/esm/helpers/createStyledContext.mjs.map +1 -1
  178. package/dist/esm/helpers/createStyledContext.native.js +14 -18
  179. package/dist/esm/helpers/createStyledContext.native.js.map +1 -1
  180. package/dist/esm/helpers/formatDiagnostic.mjs +6 -6
  181. package/dist/esm/helpers/formatDiagnostic.mjs.map +1 -1
  182. package/dist/esm/helpers/formatDiagnostic.native.js +6 -6
  183. package/dist/esm/helpers/formatDiagnostic.native.js.map +1 -1
  184. package/dist/esm/helpers/getCSSStylesAtomic.mjs +126 -109
  185. package/dist/esm/helpers/getCSSStylesAtomic.mjs.map +1 -1
  186. package/dist/esm/helpers/getCSSStylesAtomic.native.js +7 -4
  187. package/dist/esm/helpers/getCSSStylesAtomic.native.js.map +1 -1
  188. package/dist/esm/helpers/getCSSStylesAtomicCompiled.mjs +8 -1
  189. package/dist/esm/helpers/getCSSStylesAtomicCompiled.mjs.map +1 -1
  190. package/dist/esm/helpers/getCSSStylesAtomicCompiled.native.js +10 -1
  191. package/dist/esm/helpers/getCSSStylesAtomicCompiled.native.js.map +1 -1
  192. package/dist/esm/helpers/getDynamicVal.mjs +5 -1
  193. package/dist/esm/helpers/getDynamicVal.mjs.map +1 -1
  194. package/dist/esm/helpers/getDynamicVal.native.js +5 -1
  195. package/dist/esm/helpers/getDynamicVal.native.js.map +1 -1
  196. package/dist/esm/helpers/getSplitStyles.mjs +1034 -1705
  197. package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
  198. package/dist/esm/helpers/getSplitStyles.native.js +1071 -1871
  199. package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
  200. package/dist/esm/helpers/grammarConfig.mjs +164 -2
  201. package/dist/esm/helpers/grammarConfig.mjs.map +1 -1
  202. package/dist/esm/helpers/grammarConfig.native.js +187 -2
  203. package/dist/esm/helpers/grammarConfig.native.js.map +1 -1
  204. package/dist/esm/helpers/insertStyleRule.mjs +5 -2
  205. package/dist/esm/helpers/insertStyleRule.mjs.map +1 -1
  206. package/dist/esm/helpers/insertStyleRule.native.js +7 -2
  207. package/dist/esm/helpers/insertStyleRule.native.js.map +1 -1
  208. package/dist/esm/helpers/log.mjs +9 -8
  209. package/dist/esm/helpers/log.mjs.map +1 -1
  210. package/dist/esm/helpers/log.native.js +9 -8
  211. package/dist/esm/helpers/log.native.js.map +1 -1
  212. package/dist/esm/helpers/mergeVariants.mjs +44 -13
  213. package/dist/esm/helpers/mergeVariants.mjs.map +1 -1
  214. package/dist/esm/helpers/mergeVariants.native.js +79 -14
  215. package/dist/esm/helpers/mergeVariants.native.js.map +1 -1
  216. package/dist/esm/helpers/nativeOnlyProps.mjs +0 -1
  217. package/dist/esm/helpers/nativeOnlyProps.mjs.map +1 -1
  218. package/dist/esm/helpers/nativeOnlyProps.native.js +0 -1
  219. package/dist/esm/helpers/nativeOnlyProps.native.js.map +1 -1
  220. package/dist/esm/helpers/nativeStyleEngine.mjs +34 -15
  221. package/dist/esm/helpers/nativeStyleEngine.mjs.map +1 -1
  222. package/dist/esm/helpers/nativeStyleEngine.native.js +36 -15
  223. package/dist/esm/helpers/nativeStyleEngine.native.js.map +1 -1
  224. package/dist/esm/helpers/normalizeValueWithProperty.mjs +7 -8
  225. package/dist/esm/helpers/normalizeValueWithProperty.mjs.map +1 -1
  226. package/dist/esm/helpers/normalizeValueWithProperty.native.js +9 -8
  227. package/dist/esm/helpers/normalizeValueWithProperty.native.js.map +1 -1
  228. package/dist/esm/helpers/parseBorderShorthand.native.js +23 -56
  229. package/dist/esm/helpers/parseBorderShorthand.native.js.map +1 -1
  230. package/dist/esm/helpers/parseOutlineShorthand.native.js +10 -49
  231. package/dist/esm/helpers/parseOutlineShorthand.native.js.map +1 -1
  232. package/dist/esm/helpers/resolveSafeArea.mjs +35 -97
  233. package/dist/esm/helpers/resolveSafeArea.mjs.map +1 -1
  234. package/dist/esm/helpers/resolveVariantStyle.mjs +38 -0
  235. package/dist/esm/helpers/resolveVariantStyle.mjs.map +1 -0
  236. package/dist/esm/helpers/resolveVariantStyle.native.js +46 -0
  237. package/dist/esm/helpers/resolveVariantStyle.native.js.map +1 -0
  238. package/dist/esm/helpers/styleStaticConfig.mjs +1 -50
  239. package/dist/esm/helpers/styleStaticConfig.mjs.map +1 -1
  240. package/dist/esm/helpers/styleStaticConfig.native.js +1 -51
  241. package/dist/esm/helpers/styleStaticConfig.native.js.map +1 -1
  242. package/dist/esm/helpers/styleStaticConfigCore.mjs +88 -0
  243. package/dist/esm/helpers/styleStaticConfigCore.mjs.map +1 -0
  244. package/dist/esm/helpers/styleStaticConfigCore.native.js +106 -0
  245. package/dist/esm/helpers/styleStaticConfigCore.native.js.map +1 -0
  246. package/dist/esm/helpers/styledDynamic.mjs +136 -0
  247. package/dist/esm/helpers/styledDynamic.mjs.map +1 -0
  248. package/dist/esm/helpers/styledDynamic.native.js +169 -0
  249. package/dist/esm/helpers/styledDynamic.native.js.map +1 -0
  250. package/dist/esm/helpers/tokenCategories.mjs +15 -36
  251. package/dist/esm/helpers/tokenCategories.mjs.map +1 -1
  252. package/dist/esm/helpers/tokenCategories.native.js +15 -38
  253. package/dist/esm/helpers/tokenCategories.native.js.map +1 -1
  254. package/dist/esm/helpers/variableValue.mjs +17 -12
  255. package/dist/esm/helpers/variableValue.mjs.map +1 -1
  256. package/dist/esm/helpers/variableValue.native.js +46 -23
  257. package/dist/esm/helpers/variableValue.native.js.map +1 -1
  258. package/dist/esm/helpers/warnOnce.mjs +5 -4
  259. package/dist/esm/helpers/warnOnce.mjs.map +1 -1
  260. package/dist/esm/helpers/warnOnce.native.js +6 -4
  261. package/dist/esm/helpers/warnOnce.native.js.map +1 -1
  262. package/dist/esm/hooks/useAnimationDriver.mjs +2 -2
  263. package/dist/esm/hooks/useAnimationDriver.mjs.map +1 -1
  264. package/dist/esm/hooks/useAnimationDriver.native.js +2 -2
  265. package/dist/esm/hooks/useAnimationDriver.native.js.map +1 -1
  266. package/dist/esm/hooks/useComponentState.mjs +41 -82
  267. package/dist/esm/hooks/useComponentState.mjs.map +1 -1
  268. package/dist/esm/hooks/useComponentState.native.js +45 -84
  269. package/dist/esm/hooks/useComponentState.native.js.map +1 -1
  270. package/dist/esm/hooks/useMedia.mjs +2 -2
  271. package/dist/esm/hooks/useMedia.mjs.map +1 -1
  272. package/dist/esm/hooks/useMedia.native.js +2 -2
  273. package/dist/esm/hooks/useMedia.native.js.map +1 -1
  274. package/dist/esm/hooks/useStyle.mjs +11 -0
  275. package/dist/esm/hooks/useStyle.mjs.map +1 -0
  276. package/dist/esm/hooks/useStyle.native.js +11 -0
  277. package/dist/esm/hooks/useStyle.native.js.map +1 -0
  278. package/dist/esm/hooks/useThemeState.mjs +25 -90
  279. package/dist/esm/hooks/useThemeState.mjs.map +1 -1
  280. package/dist/esm/hooks/useThemeState.native.js +34 -94
  281. package/dist/esm/hooks/useThemeState.native.js.map +1 -1
  282. package/dist/esm/index.js +6 -4
  283. package/dist/esm/index.mjs +6 -4
  284. package/dist/esm/index.native.js +6 -4
  285. package/dist/esm/static-resolve.mjs +3 -3
  286. package/dist/esm/static-resolve.mjs.map +1 -1
  287. package/dist/esm/static-resolve.native.js +3 -3
  288. package/dist/esm/static-resolve.native.js.map +1 -1
  289. package/dist/esm/style.mjs +58 -0
  290. package/dist/esm/style.mjs.map +1 -0
  291. package/dist/esm/style.native.js +63 -0
  292. package/dist/esm/style.native.js.map +1 -0
  293. package/dist/esm/styled.mjs +12 -6
  294. package/dist/esm/styled.mjs.map +1 -1
  295. package/dist/esm/styled.native.js +12 -6
  296. package/dist/esm/styled.native.js.map +1 -1
  297. package/dist/esm/types.mjs +3 -4
  298. package/dist/esm/types.mjs.map +1 -1
  299. package/dist/esm/types.native.js +3 -4
  300. package/dist/esm/types.native.js.map +1 -1
  301. package/dist/esm/views/TamaguiProvider.mjs +1 -2
  302. package/dist/esm/views/TamaguiProvider.mjs.map +1 -1
  303. package/dist/esm/views/TamaguiProvider.native.js +1 -2
  304. package/dist/esm/views/TamaguiProvider.native.js.map +1 -1
  305. package/dist/esm/views/Text.mjs +17 -12
  306. package/dist/esm/views/Text.mjs.map +1 -1
  307. package/dist/esm/views/Theme.mjs +3 -3
  308. package/dist/esm/views/Theme.mjs.map +1 -1
  309. package/dist/esm/views/Theme.native.js +3 -3
  310. package/dist/esm/views/Theme.native.js.map +1 -1
  311. package/dist/esm/views/ThemeDebug.mjs +1 -4
  312. package/dist/esm/views/ThemeDebug.mjs.map +1 -1
  313. package/package.json +15 -15
  314. package/src/createComponent.tsx +21 -1
  315. package/src/createStyledHOC.tsx +4 -2
  316. package/src/createVariable.ts +0 -10
  317. package/src/helpers/borderComponents.ts +62 -0
  318. package/src/helpers/createDesignSystem.ts +0 -2
  319. package/src/helpers/createStyledContext.tsx +15 -53
  320. package/src/helpers/formatDiagnostic.ts +9 -9
  321. package/src/helpers/getCSSStylesAtomic.native.ts +6 -3
  322. package/src/helpers/getCSSStylesAtomic.ts +192 -207
  323. package/src/helpers/getCSSStylesAtomicCompiled.ts +13 -1
  324. package/src/helpers/getDynamicVal.ts +4 -0
  325. package/src/helpers/getSplitStyles.tsx +2080 -3270
  326. package/src/helpers/grammarConfig.ts +218 -1
  327. package/src/helpers/insertStyleRule.tsx +4 -2
  328. package/src/helpers/log.ts +12 -11
  329. package/src/helpers/mergeVariants.ts +55 -18
  330. package/src/helpers/nativeOnlyProps.ts +0 -1
  331. package/src/helpers/nativeStyleEngine.ts +55 -14
  332. package/src/helpers/normalizeValueWithProperty.ts +10 -12
  333. package/src/helpers/parseBorderShorthand.native.ts +23 -45
  334. package/src/helpers/parseOutlineShorthand.native.ts +9 -40
  335. package/src/helpers/resolveSafeArea.ts +34 -101
  336. package/src/helpers/resolveVariantStyle.ts +77 -0
  337. package/src/helpers/styleFrontend.ts +8 -5
  338. package/src/helpers/styleStaticConfig.ts +5 -72
  339. package/src/helpers/styleStaticConfigCore.ts +110 -0
  340. package/src/helpers/styledDynamic.ts +191 -0
  341. package/src/helpers/tokenCategories.ts +40 -65
  342. package/src/helpers/variableValue.ts +20 -15
  343. package/src/helpers/warnOnce.ts +5 -4
  344. package/src/hooks/useAnimationDriver.ts +6 -2
  345. package/src/hooks/useComponentState.ts +55 -183
  346. package/src/hooks/useMedia.tsx +10 -8
  347. package/src/hooks/useStyle.ts +10 -0
  348. package/src/hooks/useThemeState.ts +51 -264
  349. package/src/index.ts +6 -6
  350. package/src/internalRuntimeTypes.ts +1 -0
  351. package/src/static-resolve.ts +7 -4
  352. package/src/style.ts +97 -0
  353. package/src/styled.tsx +39 -68
  354. package/src/types.tsx +105 -169
  355. package/src/views/TamaguiProvider.tsx +0 -2
  356. package/src/views/Text.tsx +20 -14
  357. package/src/views/Theme.tsx +13 -9
  358. package/src/views/ThemeDebug.tsx +0 -1
  359. package/types/createComponent.d.ts.map +1 -1
  360. package/types/createStyledHOC.d.ts +1 -1
  361. package/types/createStyledHOC.d.ts.map +1 -1
  362. package/types/createVariable.d.ts +0 -2
  363. package/types/createVariable.d.ts.map +1 -1
  364. package/types/helpers/borderComponents.d.ts +10 -0
  365. package/types/helpers/borderComponents.d.ts.map +1 -0
  366. package/types/helpers/createDesignSystem.d.ts.map +1 -1
  367. package/types/helpers/createStyledContext.d.ts.map +1 -1
  368. package/types/helpers/getCSSStylesAtomic.d.ts +20 -19
  369. package/types/helpers/getCSSStylesAtomic.d.ts.map +1 -1
  370. package/types/helpers/getCSSStylesAtomic.native.d.ts +5 -0
  371. package/types/helpers/getCSSStylesAtomic.native.d.ts.map +1 -1
  372. package/types/helpers/getCSSStylesAtomicCompiled.d.ts +6 -1
  373. package/types/helpers/getCSSStylesAtomicCompiled.d.ts.map +1 -1
  374. package/types/helpers/getDynamicVal.d.ts.map +1 -1
  375. package/types/helpers/getSplitStyles.d.ts +3 -5
  376. package/types/helpers/getSplitStyles.d.ts.map +1 -1
  377. package/types/helpers/grammarConfig.d.ts +25 -2
  378. package/types/helpers/grammarConfig.d.ts.map +1 -1
  379. package/types/helpers/insertStyleRule.d.ts +1 -0
  380. package/types/helpers/insertStyleRule.d.ts.map +1 -1
  381. package/types/helpers/log.d.ts.map +1 -1
  382. package/types/helpers/mergeVariants.d.ts.map +1 -1
  383. package/types/helpers/nativeOnlyProps.d.ts +0 -1
  384. package/types/helpers/nativeOnlyProps.d.ts.map +1 -1
  385. package/types/helpers/nativeStyleEngine.d.ts +6 -0
  386. package/types/helpers/nativeStyleEngine.d.ts.map +1 -1
  387. package/types/helpers/normalizeValueWithProperty.d.ts.map +1 -1
  388. package/types/helpers/parseBorderShorthand.native.d.ts +1 -0
  389. package/types/helpers/parseBorderShorthand.native.d.ts.map +1 -1
  390. package/types/helpers/parseOutlineShorthand.native.d.ts.map +1 -1
  391. package/types/helpers/resolveSafeArea.d.ts +0 -1
  392. package/types/helpers/resolveSafeArea.d.ts.map +1 -1
  393. package/types/helpers/resolveVariantStyle.d.ts +3 -0
  394. package/types/helpers/resolveVariantStyle.d.ts.map +1 -0
  395. package/types/helpers/styleFrontend.d.ts +3 -5
  396. package/types/helpers/styleFrontend.d.ts.map +1 -1
  397. package/types/helpers/styleStaticConfig.d.ts +4 -9
  398. package/types/helpers/styleStaticConfig.d.ts.map +1 -1
  399. package/types/helpers/styleStaticConfigCore.d.ts +4 -0
  400. package/types/helpers/styleStaticConfigCore.d.ts.map +1 -0
  401. package/types/helpers/styledDynamic.d.ts +18 -0
  402. package/types/helpers/styledDynamic.d.ts.map +1 -0
  403. package/types/helpers/tokenCategories.d.ts +0 -1
  404. package/types/helpers/tokenCategories.d.ts.map +1 -1
  405. package/types/helpers/variableValue.d.ts.map +1 -1
  406. package/types/helpers/warnOnce.d.ts.map +1 -1
  407. package/types/helpers/webPropsToSkip.native.d.ts +68 -68
  408. package/types/hooks/useAnimationDriver.d.ts.map +1 -1
  409. package/types/hooks/useComponentState.d.ts.map +1 -1
  410. package/types/hooks/useMedia.d.ts.map +1 -1
  411. package/types/hooks/useStyle.d.ts +4 -0
  412. package/types/hooks/useStyle.d.ts.map +1 -0
  413. package/types/hooks/useThemeState.d.ts +1 -11
  414. package/types/hooks/useThemeState.d.ts.map +1 -1
  415. package/types/index.d.ts +6 -4
  416. package/types/index.d.ts.map +1 -1
  417. package/types/internalRuntimeTypes.d.ts +1 -1
  418. package/types/internalRuntimeTypes.d.ts.map +1 -1
  419. package/types/static-resolve.d.ts.map +1 -1
  420. package/types/style.d.ts +18 -0
  421. package/types/style.d.ts.map +1 -0
  422. package/types/styled.d.ts +10 -10
  423. package/types/styled.d.ts.map +1 -1
  424. package/types/types.d.ts +74 -49
  425. package/types/types.d.ts.map +1 -1
  426. package/types/views/TamaguiProvider.d.ts +1 -1
  427. package/types/views/TamaguiProvider.d.ts.map +1 -1
  428. package/types/views/Text.d.ts.map +1 -1
  429. package/types/views/Theme.d.ts.map +1 -1
  430. package/types/views/ThemeDebug.d.ts.map +1 -1
  431. package/dist/cjs/helpers/directStyleCSS.cjs +0 -345
  432. package/dist/cjs/helpers/directStyleCSS.native.js.map +0 -1
  433. package/dist/cjs/helpers/directStyleCSSCompiled.cjs +0 -40
  434. package/dist/cjs/helpers/directStyleCSSCompiled.native.cjs +0 -46
  435. package/dist/cjs/helpers/directStyleCSSCompiled.native.js +0 -48
  436. package/dist/cjs/helpers/directStyleCSSCompiled.native.js.map +0 -1
  437. package/dist/cjs/helpers/getVariantExtras.cjs +0 -91
  438. package/dist/cjs/helpers/getVariantExtras.native.cjs +0 -94
  439. package/dist/cjs/helpers/getVariantExtras.native.js +0 -96
  440. package/dist/cjs/helpers/getVariantExtras.native.js.map +0 -1
  441. package/dist/cjs/helpers/variantResolvers.cjs +0 -87
  442. package/dist/cjs/helpers/variantResolvers.native.cjs +0 -140
  443. package/dist/cjs/helpers/variantResolvers.native.js +0 -142
  444. package/dist/cjs/helpers/variantResolvers.native.js.map +0 -1
  445. package/dist/esm/helpers/directStyleCSS.mjs +0 -317
  446. package/dist/esm/helpers/directStyleCSS.mjs.map +0 -1
  447. package/dist/esm/helpers/directStyleCSS.native.js +0 -1
  448. package/dist/esm/helpers/directStyleCSSCompiled.mjs +0 -11
  449. package/dist/esm/helpers/directStyleCSSCompiled.mjs.map +0 -1
  450. package/dist/esm/helpers/directStyleCSSCompiled.native.js +0 -15
  451. package/dist/esm/helpers/directStyleCSSCompiled.native.js.map +0 -1
  452. package/dist/esm/helpers/getVariantExtras.mjs +0 -69
  453. package/dist/esm/helpers/getVariantExtras.mjs.map +0 -1
  454. package/dist/esm/helpers/getVariantExtras.native.js +0 -70
  455. package/dist/esm/helpers/getVariantExtras.native.js.map +0 -1
  456. package/dist/esm/helpers/variantResolvers.mjs +0 -65
  457. package/dist/esm/helpers/variantResolvers.mjs.map +0 -1
  458. package/dist/esm/helpers/variantResolvers.native.js +0 -116
  459. package/dist/esm/helpers/variantResolvers.native.js.map +0 -1
  460. package/src/helpers/directStyleCSS.native.ts +0 -1
  461. package/src/helpers/directStyleCSS.ts +0 -513
  462. package/src/helpers/directStyleCSSCompiled.ts +0 -32
  463. package/src/helpers/getVariantExtras.tsx +0 -95
  464. package/src/helpers/variantResolvers.ts +0 -121
  465. package/types/helpers/directStyleCSS.d.ts +0 -28
  466. package/types/helpers/directStyleCSS.d.ts.map +0 -1
  467. package/types/helpers/directStyleCSS.native.d.ts +0 -2
  468. package/types/helpers/directStyleCSS.native.d.ts.map +0 -1
  469. package/types/helpers/directStyleCSSCompiled.d.ts +0 -10
  470. package/types/helpers/directStyleCSSCompiled.d.ts.map +0 -1
  471. package/types/helpers/getVariantExtras.d.ts +0 -4
  472. package/types/helpers/getVariantExtras.d.ts.map +0 -1
  473. package/types/helpers/variantResolvers.d.ts +0 -9
  474. package/types/helpers/variantResolvers.d.ts.map +0 -1
@@ -1,29 +1,34 @@
1
1
  import { stylePropsTextOnly, validStyles } from "@tamagui/helpers";
2
2
  import { createComponent } from "../createComponent.mjs";
3
+ import { styledDynamic } from "../helpers/styledDynamic.mjs";
3
4
 
4
- const ellipsisStyle = {
5
- maxWidth: "100%",
6
- overflow: "hidden",
7
- textOverflow: "ellipsis",
8
- whiteSpace: "nowrap"
9
- };
10
5
  const textStaticConfig = {
11
6
  acceptsClassName: true,
12
7
  isText: true,
13
8
  defaultProps: void 0,
14
9
  inlineProps: /* @__PURE__ */ new Set(["maxFontSizeMultiplier"]),
15
10
  variants: {
16
- numberOfLines: {
17
- 1: ellipsisStyle,
18
- number: (numberOfLines) => numberOfLines >= 1 ? {
11
+ numberOfLines: styledDynamic((numberOfLines) => {
12
+ if (numberOfLines === 1) return {
13
+ maxWidth: "100%",
14
+ overflow: "hidden",
15
+ textOverflow: "ellipsis",
16
+ whiteSpace: "nowrap"
17
+ };
18
+ return numberOfLines >= 1 ? {
19
19
  maxWidth: "100%",
20
20
  WebkitLineClamp: numberOfLines,
21
21
  WebkitBoxOrient: "vertical",
22
22
  display: "-webkit-box",
23
23
  overflow: "hidden"
24
- } : null
25
- },
26
- ellipsis: { true: ellipsisStyle }
24
+ } : null;
25
+ }),
26
+ ellipsis: { true: {
27
+ maxWidth: "100%",
28
+ overflow: "hidden",
29
+ textOverflow: "ellipsis",
30
+ whiteSpace: "nowrap"
31
+ } }
27
32
  },
28
33
  validStyles: {
29
34
  ...validStyles,
@@ -1 +1 @@
1
- {"version":3,"file":"Text.js","names":[],"sources":["esm/views/Text.js"],"sourcesContent":["import { stylePropsTextOnly, validStyles } from \"@tamagui/helpers\";\nimport { createComponent } from \"../createComponent\";\n\nconst ellipsisStyle = {\n\tmaxWidth: \"100%\",\n\toverflow: \"hidden\",\n\ttextOverflow: \"ellipsis\",\n\twhiteSpace: \"nowrap\"\n};\nconst textStaticConfig = {\n\tacceptsClassName: true,\n\tisText: true,\n\tdefaultProps: void 0,\n\tinlineProps: /* @__PURE__ */ new Set([\"maxFontSizeMultiplier\"]),\n\tvariants: {\n\t\tnumberOfLines: {\n\t\t\t1: ellipsisStyle,\n\t\t\tnumber: (numberOfLines) => numberOfLines >= 1 ? {\n\t\t\t\tmaxWidth: \"100%\",\n\t\t\t\tWebkitLineClamp: numberOfLines,\n\t\t\t\tWebkitBoxOrient: \"vertical\",\n\t\t\t\tdisplay: \"-webkit-box\",\n\t\t\t\toverflow: \"hidden\"\n\t\t\t} : null\n\t\t},\n\t\tellipsis: { true: ellipsisStyle }\n\t},\n\tvalidStyles: {\n\t\t...validStyles,\n\t\t...stylePropsTextOnly\n\t}\n};\nconst Text = createComponent({\n\t...textStaticConfig,\n\tdisplayName: \"Text\"\n});\n\nexport { Text, textStaticConfig };"],"mappings":";;;;AAGA,MAAM,gBAAgB;CACrB,UAAU;CACV,UAAU;CACV,cAAc;CACd,YAAY;AACb;AACA,MAAM,mBAAmB;CACxB,kBAAkB;CAClB,QAAQ;CACR,cAAc,KAAK;CACnB,6BAA6B,IAAI,IAAI,CAAC,uBAAuB,CAAC;CAC9D,UAAU;EACT,eAAe;GACd,GAAG;GACH,SAAS,kBAAkB,iBAAiB,IAAI;IAC/C,UAAU;IACV,iBAAiB;IACjB,iBAAiB;IACjB,SAAS;IACT,UAAU;GACX,IAAI;EACL;EACA,UAAU,EAAE,MAAM,cAAc;CACjC;CACA,aAAa;EACZ,GAAG;EACH,GAAG;CACJ;AACD;AACA,MAAM,OAAO,gBAAgB;CAC5B,GAAG;CACH,aAAa;AACd,CAAC"}
1
+ {"version":3,"file":"Text.js","names":[],"sources":["esm/views/Text.js"],"sourcesContent":["import { stylePropsTextOnly, validStyles } from \"@tamagui/helpers\";\nimport { createComponent } from \"../createComponent\";\nimport { styledDynamic } from \"../helpers/styledDynamic\";\n\nconst textStaticConfig = {\n\tacceptsClassName: true,\n\tisText: true,\n\tdefaultProps: void 0,\n\tinlineProps: /* @__PURE__ */ new Set([\"maxFontSizeMultiplier\"]),\n\tvariants: {\n\t\tnumberOfLines: styledDynamic((numberOfLines) => {\n\t\t\tif (numberOfLines === 1) return {\n\t\t\t\tmaxWidth: \"100%\",\n\t\t\t\toverflow: \"hidden\",\n\t\t\t\ttextOverflow: \"ellipsis\",\n\t\t\t\twhiteSpace: \"nowrap\"\n\t\t\t};\n\t\t\treturn numberOfLines >= 1 ? {\n\t\t\t\tmaxWidth: \"100%\",\n\t\t\t\tWebkitLineClamp: numberOfLines,\n\t\t\t\tWebkitBoxOrient: \"vertical\",\n\t\t\t\tdisplay: \"-webkit-box\",\n\t\t\t\toverflow: \"hidden\"\n\t\t\t} : null;\n\t\t}),\n\t\tellipsis: { true: {\n\t\t\tmaxWidth: \"100%\",\n\t\t\toverflow: \"hidden\",\n\t\t\ttextOverflow: \"ellipsis\",\n\t\t\twhiteSpace: \"nowrap\"\n\t\t} }\n\t},\n\tvalidStyles: {\n\t\t...validStyles,\n\t\t...stylePropsTextOnly\n\t}\n};\nconst Text = createComponent({\n\t...textStaticConfig,\n\tdisplayName: \"Text\"\n});\n\nexport { Text, textStaticConfig };"],"mappings":";;;;;AAIA,MAAM,mBAAmB;CACxB,kBAAkB;CAClB,QAAQ;CACR,cAAc,KAAK;CACnB,6BAA6B,IAAI,IAAI,CAAC,uBAAuB,CAAC;CAC9D,UAAU;EACT,eAAe,eAAe,kBAAkB;GAC/C,IAAI,kBAAkB,GAAG,OAAO;IAC/B,UAAU;IACV,UAAU;IACV,cAAc;IACd,YAAY;GACb;GACA,OAAO,iBAAiB,IAAI;IAC3B,UAAU;IACV,iBAAiB;IACjB,iBAAiB;IACjB,SAAS;IACT,UAAU;GACX,IAAI;EACL,CAAC;EACD,UAAU,EAAE,MAAM;GACjB,UAAU;GACV,UAAU;GACV,cAAc;GACd,YAAY;EACb,EAAE;CACH;CACA,aAAa;EACZ,GAAG;EACH,GAAG;CACJ;AACD;AACA,MAAM,OAAO,gBAAgB;CAC5B,GAAG;CACH,aAAa;AACd,CAAC"}
@@ -14,7 +14,7 @@ const Theme = createRefComponent(function Theme2(props, ref) {
14
14
  "use no memo";
15
15
  if (props.disable) return props.children;
16
16
  if (process.env.NODE_ENV === "development") {
17
- for (const key in props) if (!reservedThemeProps[key]) warnOnce(`theme-update:${key}`, `<Theme ${key}=...> no longer accepts inline values. Wrap the subtree in <ThemeUpdate ${key}=...> instead.`);
17
+ for (const key in props) if (!reservedThemeProps[key] && key !== "srcloc" && !key.startsWith("data-")) warnOnce(`theme-update:${key}`, `<Theme ${key}=...> no longer accepts inline values. Wrap the subtree in <ThemeUpdate ${key}=...> instead.`);
18
18
  }
19
19
  const { passThrough } = props;
20
20
  const isRoot = !!props["_isRoot"];
@@ -53,10 +53,10 @@ function getThemedChildren(themeState, children, props, isRoot = false, stateRef
53
53
  if (requiresExtraWrapper || themeState.name === "dark" || themeState.name === "light") state.hasEverThemed = "wrapped";
54
54
  if (shallow) if (!themeState.parentId) {} else {
55
55
  const parentState = getThemeState(themeState.isNew ? themeState.id : themeState.parentId);
56
- if (!parentState) throw new Error(formatDiagnostic("‼️010", "Theme", "parent theme state is missing for shallow rendering", "Keep <Theme shallow> inside its mounted parent Theme", "name,parentId", {
56
+ if (!parentState) throw new Error(process.env.NODE_ENV !== "production" ? formatDiagnostic("‼️010", "Theme", "parent theme state is missing for shallow rendering", "Keep <Theme shallow> inside its mounted parent Theme", "name,parentId", {
57
57
  name: themeState.name,
58
58
  parentId: themeState.parentId
59
- }));
59
+ }) : "❌ Error 014");
60
60
  children = Children.toArray(children).map((child) => {
61
61
  return isValidElement(child) ? passThrough ? child : cloneElement(child, void 0, /* @__PURE__ */ jsx(Theme, {
62
62
  name: parentState.name,
@@ -1 +1 @@
1
- {"version":3,"file":"Theme.js","names":[],"sources":["esm/views/Theme.js"],"sourcesContent":["import { createRefComponent } from \"@tamagui/compose-refs\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { getThemeClassNames, reservedThemeProps } from \"@tamagui/helpers\";\nimport React, { Children, cloneElement, isValidElement, useRef } from \"react\";\nimport { variableToString } from \"../createVariable\";\nimport { formatDiagnostic } from \"../helpers/formatDiagnostic\";\nimport { warnOnce } from \"../helpers/warnOnce\";\nimport { useThemeWithState } from \"../hooks/useTheme\";\nimport { ThemeStateContext, getThemeState, hasThemeUpdatingProps } from \"../hooks/useThemeState\";\nimport { ThemeDebug } from \"./ThemeDebug\";\nimport { jsx } from \"react/jsx-runtime\";\n\nconst Theme = createRefComponent(function Theme2(props, ref) {\n\t\"use no memo\";\n\tif (props.disable) return props.children;\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tfor (const key in props) if (!reservedThemeProps[key]) warnOnce(`theme-update:${key}`, `<Theme ${key}=...> no longer accepts inline values. Wrap the subtree in <ThemeUpdate ${key}=...> instead.`);\n\t}\n\tconst { passThrough } = props;\n\tconst isRoot = !!props[\"_isRoot\"];\n\tconst [_, themeState] = useThemeWithState(props, isRoot, true);\n\tuseIsomorphicLayoutEffect(() => {}, [\n\t\tthemeState.id,\n\t\tthemeState.name,\n\t\tthemeState.theme\n\t]);\n\tlet finalChildren = props[\"disable-child-theme\"] ? Children.map(props.children, (child) => passThrough || !isValidElement(child) ? child : cloneElement(child, { [\"data-disable-theme\"]: true })) : props.children;\n\tif (ref) try {\n\t\tReact.Children.only(finalChildren);\n\t\tfinalChildren = cloneElement(finalChildren, { ref });\n\t} catch {}\n\tconst stateRef = useRef({ hasEverThemed: false });\n\treturn getThemedChildren(themeState, finalChildren, props, isRoot, stateRef, passThrough);\n});\nTheme[\"avoidForwardRef\"] = true;\nfunction getThemedChildren(themeState, children, props, isRoot = false, stateRef, passThrough = false) {\n\tconst { shallow, forceClassName } = props;\n\tconst state = stateRef.current;\n\tlet shouldRenderChildrenWithTheme = state.hasEverThemed || themeState.isNew || isRoot || hasThemeUpdatingProps(props);\n\tif (process.env.NODE_ENV === \"development\" && props.debug === \"visualize\") children = /* @__PURE__ */ jsx(ThemeDebug, {\n\t\tthemeState,\n\t\tthemeProps: props,\n\t\tchildren\n\t});\n\tif (!shouldRenderChildrenWithTheme) return children;\n\tchildren = /* @__PURE__ */ jsx(ThemeStateContext.Provider, {\n\t\tvalue: themeState.id,\n\t\tchildren\n\t});\n\tconst { isInverse, name } = themeState;\n\tconst requiresExtraWrapper = isInverse || forceClassName;\n\tif (!state.hasEverThemed) state.hasEverThemed = true;\n\tif (requiresExtraWrapper || themeState.name === \"dark\" || themeState.name === \"light\") state.hasEverThemed = \"wrapped\";\n\tif (shallow) if (!themeState.parentId) {} else {\n\t\tconst parentState = getThemeState(themeState.isNew ? themeState.id : themeState.parentId);\n\t\tif (!parentState) throw new Error(formatDiagnostic(\"‼️010\", \"Theme\", \"parent theme state is missing for shallow rendering\", \"Keep <Theme shallow> inside its mounted parent Theme\", \"name,parentId\", {\n\t\t\tname: themeState.name,\n\t\t\tparentId: themeState.parentId\n\t\t}));\n\t\tchildren = Children.toArray(children).map((child) => {\n\t\t\treturn isValidElement(child) ? passThrough ? child : cloneElement(child, void 0, /* @__PURE__ */ jsx(Theme, {\n\t\t\t\tname: parentState.name,\n\t\t\t\tchildren: child.props.children\n\t\t\t})) : child;\n\t\t});\n\t}\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tif (!passThrough && props.debug) console.warn(` getThemedChildren`, {\n\t\t\trequiresExtraWrapper,\n\t\t\tforceClassName,\n\t\t\tthemeState,\n\t\t\tstate,\n\t\t\tthemeSpanProps: getThemeClassNameAndColor(themeState, props, isRoot)\n\t\t});\n\t}\n\tif (forceClassName === false) return children;\n\tif (isWeb) {\n\t\tconst baseStyle = props.contain ? inertContainedStyle : inertStyle;\n\t\tconst { className = \"\", color } = passThrough ? {} : getThemeClassNameAndColor(themeState, props, isRoot);\n\t\tconst inlineClassName = passThrough ? void 0 : props._themeUpdate?.className;\n\t\tchildren = /* @__PURE__ */ jsx(\"span\", {\n\t\t\tclassName: `${className} is_Theme${inlineClassName ? ` ${inlineClassName}` : \"\"}`,\n\t\t\tstyle: passThrough ? baseStyle : {\n\t\t\t\tcolor,\n\t\t\t\t...baseStyle\n\t\t\t},\n\t\t\tchildren\n\t\t});\n\t\tif (state.hasEverThemed === \"wrapped\") children = /* @__PURE__ */ jsx(\"span\", {\n\t\t\tclassName: requiresExtraWrapper ? `${name.startsWith(\"light\") ? \"t_light\" : name.startsWith(\"dark\") ? \"t_dark\" : \"\"} _dsp_contents` : `_dsp_contents`,\n\t\t\tchildren\n\t\t});\n\t\treturn children;\n\t}\n\treturn children;\n}\nconst inertStyle = { display: \"contents\" };\nconst inertContainedStyle = {\n\tdisplay: \"contents\",\n\tcontain: \"strict\"\n};\nconst empty = {\n\tclassName: \"\",\n\tcolor: void 0\n};\nfunction getThemeClassNameAndColor(themeState, props, isRoot = false) {\n\tif (!themeState.isNew && !props.forceClassName) return empty;\n\treturn {\n\t\tcolor: themeState?.theme && themeState.isNew ? variableToString(themeState.theme.color) : \"\",\n\t\tclassName: getThemeClassNames(themeState.name, isRoot)\n\t};\n}\n\nexport { Theme, getThemedChildren };"],"mappings":";;;;;;;;;;;;;AAYA,MAAM,QAAQ,mBAAmB,SAAS,OAAO,OAAO,KAAK;CAC5D;CACA,IAAI,MAAM,SAAS,OAAO,MAAM;CAChC,I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AK,WAAW,MAAM,IAAI,WAAW,GAAG,kBAAkB;GACtI;EACD,CAAC;EACD,OAAO;CACR;CACA,OAAO;AACR;AACA,MAAM,aAAa,EAAE,SAAS,WAAW;AACzC,MAAM,sBAAsB;CAC3B,SAAS;CACT,SAAS;AACV;AACA,MAAM,QAAQ;CACb,WAAW;CACX,OAAO,KAAK;AACb;AACA,SAAS,0BAA0B,YAAY,OAAO,SAAS,OAAO;CACrE,IAAI,CAAC,WAAW,SAAS,CAAC,MAAM,gBAAgB,OAAO;CACvD,OAAO;EACN,OAAO,YAAY,SAAS,WAAW,QAAQ,iBAAiB,WAAW,MAAM,KAAK,IAAI;EAC1F,WAAW,mBAAmB,WAAW,MAAM,MAAM;CACtD;AACD"}
1
+ {"version":3,"file":"Theme.js","names":[],"sources":["esm/views/Theme.js"],"sourcesContent":["import { createRefComponent } from \"@tamagui/compose-refs\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { getThemeClassNames, reservedThemeProps } from \"@tamagui/helpers\";\nimport React, { Children, cloneElement, isValidElement, useRef } from \"react\";\nimport { variableToString } from \"../createVariable\";\nimport { formatDiagnostic } from \"../helpers/formatDiagnostic\";\nimport { warnOnce } from \"../helpers/warnOnce\";\nimport { useThemeWithState } from \"../hooks/useTheme\";\nimport { ThemeStateContext, getThemeState, hasThemeUpdatingProps } from \"../hooks/useThemeState\";\nimport { ThemeDebug } from \"./ThemeDebug\";\nimport { jsx } from \"react/jsx-runtime\";\n\nconst Theme = createRefComponent(function Theme2(props, ref) {\n\t\"use no memo\";\n\tif (props.disable) return props.children;\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tfor (const key in props) if (!reservedThemeProps[key] && key !== \"srcloc\" && !key.startsWith(\"data-\")) warnOnce(`theme-update:${key}`, `<Theme ${key}=...> no longer accepts inline values. Wrap the subtree in <ThemeUpdate ${key}=...> instead.`);\n\t}\n\tconst { passThrough } = props;\n\tconst isRoot = !!props[\"_isRoot\"];\n\tconst [_, themeState] = useThemeWithState(props, isRoot, true);\n\tuseIsomorphicLayoutEffect(() => {}, [\n\t\tthemeState.id,\n\t\tthemeState.name,\n\t\tthemeState.theme\n\t]);\n\tlet finalChildren = props[\"disable-child-theme\"] ? Children.map(props.children, (child) => passThrough || !isValidElement(child) ? child : cloneElement(child, { [\"data-disable-theme\"]: true })) : props.children;\n\tif (ref) try {\n\t\tReact.Children.only(finalChildren);\n\t\tfinalChildren = cloneElement(finalChildren, { ref });\n\t} catch {}\n\tconst stateRef = useRef({ hasEverThemed: false });\n\treturn getThemedChildren(themeState, finalChildren, props, isRoot, stateRef, passThrough);\n});\nTheme[\"avoidForwardRef\"] = true;\nfunction getThemedChildren(themeState, children, props, isRoot = false, stateRef, passThrough = false) {\n\tconst { shallow, forceClassName } = props;\n\tconst state = stateRef.current;\n\tlet shouldRenderChildrenWithTheme = state.hasEverThemed || themeState.isNew || isRoot || hasThemeUpdatingProps(props);\n\tif (process.env.NODE_ENV === \"development\" && props.debug === \"visualize\") children = /* @__PURE__ */ jsx(ThemeDebug, {\n\t\tthemeState,\n\t\tthemeProps: props,\n\t\tchildren\n\t});\n\tif (!shouldRenderChildrenWithTheme) return children;\n\tchildren = /* @__PURE__ */ jsx(ThemeStateContext.Provider, {\n\t\tvalue: themeState.id,\n\t\tchildren\n\t});\n\tconst { isInverse, name } = themeState;\n\tconst requiresExtraWrapper = isInverse || forceClassName;\n\tif (!state.hasEverThemed) state.hasEverThemed = true;\n\tif (requiresExtraWrapper || themeState.name === \"dark\" || themeState.name === \"light\") state.hasEverThemed = \"wrapped\";\n\tif (shallow) if (!themeState.parentId) {} else {\n\t\tconst parentState = getThemeState(themeState.isNew ? themeState.id : themeState.parentId);\n\t\tif (!parentState) throw new Error(process.env.NODE_ENV !== \"production\" ? formatDiagnostic(\"‼️010\", \"Theme\", \"parent theme state is missing for shallow rendering\", \"Keep <Theme shallow> inside its mounted parent Theme\", \"name,parentId\", {\n\t\t\tname: themeState.name,\n\t\t\tparentId: themeState.parentId\n\t\t}) : \"❌ Error 014\");\n\t\tchildren = Children.toArray(children).map((child) => {\n\t\t\treturn isValidElement(child) ? passThrough ? child : cloneElement(child, void 0, /* @__PURE__ */ jsx(Theme, {\n\t\t\t\tname: parentState.name,\n\t\t\t\tchildren: child.props.children\n\t\t\t})) : child;\n\t\t});\n\t}\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tif (!passThrough && props.debug) console.warn(` getThemedChildren`, {\n\t\t\trequiresExtraWrapper,\n\t\t\tforceClassName,\n\t\t\tthemeState,\n\t\t\tstate,\n\t\t\tthemeSpanProps: getThemeClassNameAndColor(themeState, props, isRoot)\n\t\t});\n\t}\n\tif (forceClassName === false) return children;\n\tif (isWeb) {\n\t\tconst baseStyle = props.contain ? inertContainedStyle : inertStyle;\n\t\tconst { className = \"\", color } = passThrough ? {} : getThemeClassNameAndColor(themeState, props, isRoot);\n\t\tconst inlineClassName = passThrough ? void 0 : props._themeUpdate?.className;\n\t\tchildren = /* @__PURE__ */ jsx(\"span\", {\n\t\t\tclassName: `${className} is_Theme${inlineClassName ? ` ${inlineClassName}` : \"\"}`,\n\t\t\tstyle: passThrough ? baseStyle : {\n\t\t\t\tcolor,\n\t\t\t\t...baseStyle\n\t\t\t},\n\t\t\tchildren\n\t\t});\n\t\tif (state.hasEverThemed === \"wrapped\") children = /* @__PURE__ */ jsx(\"span\", {\n\t\t\tclassName: requiresExtraWrapper ? `${name.startsWith(\"light\") ? \"t_light\" : name.startsWith(\"dark\") ? \"t_dark\" : \"\"} _dsp_contents` : `_dsp_contents`,\n\t\t\tchildren\n\t\t});\n\t\treturn children;\n\t}\n\treturn children;\n}\nconst inertStyle = { display: \"contents\" };\nconst inertContainedStyle = {\n\tdisplay: \"contents\",\n\tcontain: \"strict\"\n};\nconst empty = {\n\tclassName: \"\",\n\tcolor: void 0\n};\nfunction getThemeClassNameAndColor(themeState, props, isRoot = false) {\n\tif (!themeState.isNew && !props.forceClassName) return empty;\n\treturn {\n\t\tcolor: themeState?.theme && themeState.isNew ? variableToString(themeState.theme.color) : \"\",\n\t\tclassName: getThemeClassNames(themeState.name, isRoot)\n\t};\n}\n\nexport { Theme, getThemedChildren };"],"mappings":";;;;;;;;;;;;;AAYA,MAAM,QAAQ,mBAAmB,SAAS,OAAO,OAAO,KAAK;CAC5D;CACA,IAAI,MAAM,SAAS,OAAO,MAAM;CAChC,IAAI,QAAQ,IAAI,aAAa,eAAe;EAC3C,KAAK,MAAM,OAAO,OAAO,IAAI,CAAC,mBAAmB,QAAQ,QAAQ,YAAY,CAAC,IAAI,WAAW,OAAO,GAAG,SAAS,gBAAgB,OAAO,UAAU,IAAI,0EAA0E,IAAI,eAAe;CACnP;CACA,MAAM,EAAE,gBAAgB;CACxB,MAAM,SAAS,CAAC,CAAC,MAAM;CACvB,MAAM,CAAC,GAAG,cAAc,kBAAkB,OAAO,QAAQ,IAAI;CAC7D,gCAAgC,CAAC,GAAG;EACnC,WAAW;EACX,WAAW;EACX,WAAW;CACZ,CAAC;CACD,IAAI,gBAAgB,MAAM,yBAAyB,SAAS,IAAI,MAAM,WAAW,UAAU,eAAe,CAAC,eAAe,KAAK,IAAI,QAAQ,aAAa,OAAO,GAAG,uBAAuB,KAAK,CAAC,CAAC,IAAI,MAAM;CAC1M,IAAI,KAAK,IAAI;EACZ,MAAM,SAAS,KAAK,aAAa;EACjC,gBAAgB,aAAa,eAAe,EAAE,IAAI,CAAC;CACpD,QAAQ,CAAC;CACT,MAAM,WAAW,OAAO,EAAE,eAAe,MAAM,CAAC;CAChD,OAAO,kBAAkB,YAAY,eAAe,OAAO,QAAQ,UAAU,WAAW;AACzF,CAAC;AACD,MAAM,qBAAqB;AAC3B,SAAS,kBAAkB,YAAY,UAAU,OAAO,SAAS,OAAO,UAAU,cAAc,OAAO;CACtG,MAAM,EAAE,SAAS,mBAAmB;CACpC,MAAM,QAAQ,SAAS;CACvB,IAAI,gCAAgC,MAAM,iBAAiB,WAAW,SAAS,UAAU,sBAAsB,KAAK;CACpH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MAAM;EACxG,MAAM,kBAAkB,cAAc,KAAK,IAAI,MAAM,cAAc;EACnE,WAA2B,oBAAI,QAAQ;GACtC,WAAW,GAAG,UAAU,WAAW,kBAAkB,IAAI,oBAAoB;GAC7E,OAAO,cAAc,YAAY;IAChC;IACA,GAAG;GACJ;GACA;EACD,CAAC;EACD,IAAI,MAAM,kBAAkB,WAAW,WAA2B,oBAAI,QAAQ;GAC7E,WAAW,uBAAuB,GAAG,KAAK,WAAW,OAAO,IAAI,YAAY,KAAK,WAAW,MAAM,IAAI,WAAW,GAAG,kBAAkB;GACtI;EACD,CAAC;EACD,OAAO;CACR;CACA,OAAO;AACR;AACA,MAAM,aAAa,EAAE,SAAS,WAAW;AACzC,MAAM,sBAAsB;CAC3B,SAAS;CACT,SAAS;AACV;AACA,MAAM,QAAQ;CACb,WAAW;CACX,OAAO,KAAK;AACb;AACA,SAAS,0BAA0B,YAAY,OAAO,SAAS,OAAO;CACrE,IAAI,CAAC,WAAW,SAAS,CAAC,MAAM,gBAAgB,OAAO;CACvD,OAAO;EACN,OAAO,YAAY,SAAS,WAAW,QAAQ,iBAAiB,WAAW,MAAM,KAAK,IAAI;EAC1F,WAAW,mBAAmB,WAAW,MAAM,MAAM;CACtD;AACD"}
@@ -15,7 +15,7 @@ var Theme = createRefComponent(function Theme2(props, ref) {
15
15
  "use no memo";
16
16
  if (props.disable) return props.children;
17
17
  if (process.env.NODE_ENV === "development") {
18
- for (var key in props) if (!reservedThemeProps[key]) warnOnce(`theme-update:${key}`, `<Theme ${key}=...> no longer accepts inline values. Wrap the subtree in <ThemeUpdate ${key}=...> instead.`);
18
+ for (var key in props) if (!reservedThemeProps[key] && key !== "srcloc" && !key.startsWith("data-")) warnOnce(`theme-update:${key}`, `<Theme ${key}=...> no longer accepts inline values. Wrap the subtree in <ThemeUpdate ${key}=...> instead.`);
19
19
  }
20
20
  var { passThrough } = props;
21
21
  var isRoot = !!props["_isRoot"];
@@ -62,10 +62,10 @@ function getThemedChildren(themeState, children, props) {
62
62
  if (requiresExtraWrapper || themeState.name === "dark" || themeState.name === "light") state.hasEverThemed = "wrapped";
63
63
  if (shallow) if (!themeState.parentId) {} else {
64
64
  var parentState = getThemeState(themeState.isNew ? themeState.id : themeState.parentId);
65
- if (!parentState) throw new Error(formatDiagnostic("‼️010", "Theme", "parent theme state is missing for shallow rendering", "Keep <Theme shallow> inside its mounted parent Theme", "name,parentId", {
65
+ if (!parentState) throw new Error(process.env.NODE_ENV !== "production" ? formatDiagnostic("‼️010", "Theme", "parent theme state is missing for shallow rendering", "Keep <Theme shallow> inside its mounted parent Theme", "name,parentId", {
66
66
  name: themeState.name,
67
67
  parentId: themeState.parentId
68
- }));
68
+ }) : "❌ Error 014");
69
69
  children = Children.toArray(children).map(function(child) {
70
70
  return /* @__PURE__ */ isValidElement(child) ? passThrough ? child : /* @__PURE__ */ cloneElement(child, void 0, /* @__PURE__ */ jsx(Theme, {
71
71
  name: parentState.name,
@@ -1 +1 @@
1
- {"version":3,"file":"Theme.native.js","names":[],"sources":["esm/views/Theme.native.js"],"sourcesContent":["import { jsx } from \"react/jsx-runtime\";\nimport { createRefComponent } from \"@tamagui/compose-refs\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { getThemeClassNames, reservedThemeProps } from \"@tamagui/helpers\";\nimport React, { Children, cloneElement, isValidElement, useRef } from \"react\";\nimport { variableToString } from \"../createVariable\";\nimport { formatDiagnostic } from \"../helpers/formatDiagnostic\";\nimport { removeNativeStyleScope, updateNativeStyleScope } from \"../helpers/nativeStyleEngine\";\nimport { warnOnce } from \"../helpers/warnOnce\";\nimport { useThemeWithState } from \"../hooks/useTheme\";\nimport { ThemeStateContext, getThemeState, hasThemeUpdatingProps } from \"../hooks/useThemeState\";\nimport { ThemeDebug } from \"./ThemeDebug\";\n\nvar Theme = createRefComponent(function Theme2(props, ref) {\n\t\"use no memo\";\n\tif (props.disable) return props.children;\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tfor (var key in props) if (!reservedThemeProps[key]) warnOnce(`theme-update:${key}`, `<Theme ${key}=...> no longer accepts inline values. Wrap the subtree in <ThemeUpdate ${key}=...> instead.`);\n\t}\n\tvar { passThrough } = props;\n\tvar isRoot = !!props[\"_isRoot\"];\n\tvar [_, themeState] = useThemeWithState(props, isRoot, true);\n\tuseIsomorphicLayoutEffect(function() {\n\t\tupdateNativeStyleScope(themeState.id, themeState.name, themeState.theme);\n\t\treturn function() {\n\t\t\treturn removeNativeStyleScope(themeState.id);\n\t\t};\n\t}, [\n\t\tthemeState.id,\n\t\tthemeState.name,\n\t\tthemeState.theme\n\t]);\n\tvar finalChildren = props[\"disable-child-theme\"] ? Children.map(props.children, function(child) {\n\t\treturn passThrough || !/* @__PURE__ */ isValidElement(child) ? child : /* @__PURE__ */ cloneElement(child, { [\"data-disable-theme\"]: true });\n\t}) : props.children;\n\tif (ref) try {\n\t\tReact.Children.only(finalChildren);\n\t\tfinalChildren = /* @__PURE__ */ cloneElement(finalChildren, { ref });\n\t} catch (e) {}\n\tvar stateRef = useRef({ hasEverThemed: false });\n\treturn getThemedChildren(themeState, finalChildren, props, isRoot, stateRef, passThrough);\n});\nTheme[\"avoidForwardRef\"] = true;\nfunction getThemedChildren(themeState, children, props) {\n\tvar isRoot = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false, stateRef = arguments.length > 4 ? arguments[4] : void 0, passThrough = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : false;\n\tvar { shallow, forceClassName } = props;\n\tvar state = stateRef.current;\n\tvar shouldRenderChildrenWithTheme = state.hasEverThemed || themeState.isNew || isRoot || hasThemeUpdatingProps(props);\n\tif (process.env.NODE_ENV === \"development\" && props.debug === \"visualize\") children = /* @__PURE__ */ jsx(ThemeDebug, {\n\t\tthemeState,\n\t\tthemeProps: props,\n\t\tchildren\n\t});\n\tif (!shouldRenderChildrenWithTheme) return children;\n\tchildren = /* @__PURE__ */ jsx(ThemeStateContext.Provider, {\n\t\tvalue: themeState.id,\n\t\tchildren\n\t});\n\tvar { isInverse, name } = themeState;\n\tvar requiresExtraWrapper = isInverse || forceClassName;\n\tif (!state.hasEverThemed) state.hasEverThemed = true;\n\tif (requiresExtraWrapper || themeState.name === \"dark\" || themeState.name === \"light\") state.hasEverThemed = \"wrapped\";\n\tif (shallow) if (!themeState.parentId) {} else {\n\t\tvar parentState = getThemeState(themeState.isNew ? themeState.id : themeState.parentId);\n\t\tif (!parentState) throw new Error(formatDiagnostic(\"‼️010\", \"Theme\", \"parent theme state is missing for shallow rendering\", \"Keep <Theme shallow> inside its mounted parent Theme\", \"name,parentId\", {\n\t\t\tname: themeState.name,\n\t\t\tparentId: themeState.parentId\n\t\t}));\n\t\tchildren = Children.toArray(children).map(function(child) {\n\t\t\treturn /* @__PURE__ */ isValidElement(child) ? passThrough ? child : /* @__PURE__ */ cloneElement(child, void 0, /* @__PURE__ */ jsx(Theme, {\n\t\t\t\tname: parentState.name,\n\t\t\t\tchildren: child.props.children\n\t\t\t})) : child;\n\t\t});\n\t}\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tif (!passThrough && props.debug) console.warn(` getThemedChildren`, {\n\t\t\trequiresExtraWrapper,\n\t\t\tforceClassName,\n\t\t\tthemeState,\n\t\t\tstate,\n\t\t\tthemeSpanProps: getThemeClassNameAndColor(themeState, props, isRoot)\n\t\t});\n\t}\n\tif (forceClassName === false) return children;\n\tif (isWeb) {\n\t\tvar _props__themeUpdate;\n\t\tvar baseStyle = props.contain ? inertContainedStyle : inertStyle;\n\t\tvar { className = \"\", color } = passThrough ? {} : getThemeClassNameAndColor(themeState, props, isRoot);\n\t\tvar inlineClassName = passThrough ? void 0 : (_props__themeUpdate = props._themeUpdate) === null || _props__themeUpdate === void 0 ? void 0 : _props__themeUpdate.className;\n\t\tchildren = /* @__PURE__ */ jsx(\"span\", {\n\t\t\tclassName: `${className} is_Theme${inlineClassName ? ` ${inlineClassName}` : \"\"}`,\n\t\t\tstyle: passThrough ? baseStyle : {\n\t\t\t\tcolor,\n\t\t\t\t...baseStyle\n\t\t\t},\n\t\t\tchildren\n\t\t});\n\t\tif (state.hasEverThemed === \"wrapped\") children = /* @__PURE__ */ jsx(\"span\", {\n\t\t\tclassName: requiresExtraWrapper ? `${name.startsWith(\"light\") ? \"t_light\" : name.startsWith(\"dark\") ? \"t_dark\" : \"\"} _dsp_contents` : `_dsp_contents`,\n\t\t\tchildren\n\t\t});\n\t\treturn children;\n\t}\n\treturn children;\n}\nvar inertStyle = { display: \"contents\" };\nvar inertContainedStyle = {\n\tdisplay: \"contents\",\n\tcontain: \"strict\"\n};\nvar empty = {\n\tclassName: \"\",\n\tcolor: void 0\n};\nfunction getThemeClassNameAndColor(themeState, props) {\n\tvar isRoot = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;\n\tif (!themeState.isNew && !props.forceClassName) return empty;\n\treturn {\n\t\tcolor: (themeState === null || themeState === void 0 ? void 0 : themeState.theme) && themeState.isNew ? variableToString(themeState.theme.color) : \"\",\n\t\tclassName: getThemeClassNames(themeState.name, isRoot)\n\t};\n}\n\nexport { Theme, getThemedChildren };"],"mappings":";;;;;;;;;;;;;;AAaA,IAAI,QAAQ,mBAAmB,SAAS,OAAO,OAAO,KAAK;CAC1D;CACA,IAAI,MAAM,SAAS,OAAO,MAAM;CAChC,IAAI,QAAQ,IAAI,aAAa,eAAe;EAC3C,KAAK,IAAI,OAAO,OAAO,IAAI,CAAC,mBAAmB,MAAM,SAAS,gBAAgB,OAAO,UAAU,IAAI,0EAA0E,IAAI,eAAe;CACjM;CACA,IAAI,EAAE,gBAAgB;CACtB,IAAI,SAAS,CAAC,CAAC,MAAM;CACrB,IAAI,CAAC,GAAG,cAAc,kBAAkB,OAAO,QAAQ,IAAI;CAC3D,0BAA0B,WAAW;EACpC,uBAAuB,WAAW,IAAI,WAAW,MAAM,WAAW,KAAK;EACvE,OAAO,WAAW;GACjB,OAAO,uBAAuB,WAAW,EAAE;EAC5C;CACD,GAAG;EACF,WAAW;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kBAAkB;GACtI;EACD,CAAC;EACD,OAAO;CACR;CACA,OAAO;AACR;AACA,IAAI,aAAa,EAAE,SAAS,WAAW;AACvC,IAAI,sBAAsB;CACzB,SAAS;CACT,SAAS;AACV;AACA,IAAI,QAAQ;CACX,WAAW;CACX,OAAO,KAAK;AACb;AACA,SAAS,0BAA0B,YAAY,OAAO;CACrD,IAAI,SAAS,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK;CAC9E,IAAI,CAAC,WAAW,SAAS,CAAC,MAAM,gBAAgB,OAAO;CACvD,OAAO;EACN,QAAQ,eAAe,QAAQ,eAAe,KAAK,IAAI,KAAK,IAAI,WAAW,UAAU,WAAW,QAAQ,iBAAiB,WAAW,MAAM,KAAK,IAAI;EACnJ,WAAW,mBAAmB,WAAW,MAAM,MAAM;CACtD;AACD"}
1
+ {"version":3,"file":"Theme.native.js","names":[],"sources":["esm/views/Theme.native.js"],"sourcesContent":["import { jsx } from \"react/jsx-runtime\";\nimport { createRefComponent } from \"@tamagui/compose-refs\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { getThemeClassNames, reservedThemeProps } from \"@tamagui/helpers\";\nimport React, { Children, cloneElement, isValidElement, useRef } from \"react\";\nimport { variableToString } from \"../createVariable\";\nimport { formatDiagnostic } from \"../helpers/formatDiagnostic\";\nimport { removeNativeStyleScope, updateNativeStyleScope } from \"../helpers/nativeStyleEngine\";\nimport { warnOnce } from \"../helpers/warnOnce\";\nimport { useThemeWithState } from \"../hooks/useTheme\";\nimport { ThemeStateContext, getThemeState, hasThemeUpdatingProps } from \"../hooks/useThemeState\";\nimport { ThemeDebug } from \"./ThemeDebug\";\n\nvar Theme = createRefComponent(function Theme2(props, ref) {\n\t\"use no memo\";\n\tif (props.disable) return props.children;\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tfor (var key in props) if (!reservedThemeProps[key] && key !== \"srcloc\" && !key.startsWith(\"data-\")) warnOnce(`theme-update:${key}`, `<Theme ${key}=...> no longer accepts inline values. Wrap the subtree in <ThemeUpdate ${key}=...> instead.`);\n\t}\n\tvar { passThrough } = props;\n\tvar isRoot = !!props[\"_isRoot\"];\n\tvar [_, themeState] = useThemeWithState(props, isRoot, true);\n\tuseIsomorphicLayoutEffect(function() {\n\t\tupdateNativeStyleScope(themeState.id, themeState.name, themeState.theme);\n\t\treturn function() {\n\t\t\treturn removeNativeStyleScope(themeState.id);\n\t\t};\n\t}, [\n\t\tthemeState.id,\n\t\tthemeState.name,\n\t\tthemeState.theme\n\t]);\n\tvar finalChildren = props[\"disable-child-theme\"] ? Children.map(props.children, function(child) {\n\t\treturn passThrough || !/* @__PURE__ */ isValidElement(child) ? child : /* @__PURE__ */ cloneElement(child, { [\"data-disable-theme\"]: true });\n\t}) : props.children;\n\tif (ref) try {\n\t\tReact.Children.only(finalChildren);\n\t\tfinalChildren = /* @__PURE__ */ cloneElement(finalChildren, { ref });\n\t} catch (e) {}\n\tvar stateRef = useRef({ hasEverThemed: false });\n\treturn getThemedChildren(themeState, finalChildren, props, isRoot, stateRef, passThrough);\n});\nTheme[\"avoidForwardRef\"] = true;\nfunction getThemedChildren(themeState, children, props) {\n\tvar isRoot = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false, stateRef = arguments.length > 4 ? arguments[4] : void 0, passThrough = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : false;\n\tvar { shallow, forceClassName } = props;\n\tvar state = stateRef.current;\n\tvar shouldRenderChildrenWithTheme = state.hasEverThemed || themeState.isNew || isRoot || hasThemeUpdatingProps(props);\n\tif (process.env.NODE_ENV === \"development\" && props.debug === \"visualize\") children = /* @__PURE__ */ jsx(ThemeDebug, {\n\t\tthemeState,\n\t\tthemeProps: props,\n\t\tchildren\n\t});\n\tif (!shouldRenderChildrenWithTheme) return children;\n\tchildren = /* @__PURE__ */ jsx(ThemeStateContext.Provider, {\n\t\tvalue: themeState.id,\n\t\tchildren\n\t});\n\tvar { isInverse, name } = themeState;\n\tvar requiresExtraWrapper = isInverse || forceClassName;\n\tif (!state.hasEverThemed) state.hasEverThemed = true;\n\tif (requiresExtraWrapper || themeState.name === \"dark\" || themeState.name === \"light\") state.hasEverThemed = \"wrapped\";\n\tif (shallow) if (!themeState.parentId) {} else {\n\t\tvar parentState = getThemeState(themeState.isNew ? themeState.id : themeState.parentId);\n\t\tif (!parentState) throw new Error(process.env.NODE_ENV !== \"production\" ? formatDiagnostic(\"‼️010\", \"Theme\", \"parent theme state is missing for shallow rendering\", \"Keep <Theme shallow> inside its mounted parent Theme\", \"name,parentId\", {\n\t\t\tname: themeState.name,\n\t\t\tparentId: themeState.parentId\n\t\t}) : \"❌ Error 014\");\n\t\tchildren = Children.toArray(children).map(function(child) {\n\t\t\treturn /* @__PURE__ */ isValidElement(child) ? passThrough ? child : /* @__PURE__ */ cloneElement(child, void 0, /* @__PURE__ */ jsx(Theme, {\n\t\t\t\tname: parentState.name,\n\t\t\t\tchildren: child.props.children\n\t\t\t})) : child;\n\t\t});\n\t}\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tif (!passThrough && props.debug) console.warn(` getThemedChildren`, {\n\t\t\trequiresExtraWrapper,\n\t\t\tforceClassName,\n\t\t\tthemeState,\n\t\t\tstate,\n\t\t\tthemeSpanProps: getThemeClassNameAndColor(themeState, props, isRoot)\n\t\t});\n\t}\n\tif (forceClassName === false) return children;\n\tif (isWeb) {\n\t\tvar _props__themeUpdate;\n\t\tvar baseStyle = props.contain ? inertContainedStyle : inertStyle;\n\t\tvar { className = \"\", color } = passThrough ? {} : getThemeClassNameAndColor(themeState, props, isRoot);\n\t\tvar inlineClassName = passThrough ? void 0 : (_props__themeUpdate = props._themeUpdate) === null || _props__themeUpdate === void 0 ? void 0 : _props__themeUpdate.className;\n\t\tchildren = /* @__PURE__ */ jsx(\"span\", {\n\t\t\tclassName: `${className} is_Theme${inlineClassName ? ` ${inlineClassName}` : \"\"}`,\n\t\t\tstyle: passThrough ? baseStyle : {\n\t\t\t\tcolor,\n\t\t\t\t...baseStyle\n\t\t\t},\n\t\t\tchildren\n\t\t});\n\t\tif (state.hasEverThemed === \"wrapped\") children = /* @__PURE__ */ jsx(\"span\", {\n\t\t\tclassName: requiresExtraWrapper ? `${name.startsWith(\"light\") ? \"t_light\" : name.startsWith(\"dark\") ? \"t_dark\" : \"\"} _dsp_contents` : `_dsp_contents`,\n\t\t\tchildren\n\t\t});\n\t\treturn children;\n\t}\n\treturn children;\n}\nvar inertStyle = { display: \"contents\" };\nvar inertContainedStyle = {\n\tdisplay: \"contents\",\n\tcontain: \"strict\"\n};\nvar empty = {\n\tclassName: \"\",\n\tcolor: void 0\n};\nfunction getThemeClassNameAndColor(themeState, props) {\n\tvar isRoot = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;\n\tif (!themeState.isNew && !props.forceClassName) return empty;\n\treturn {\n\t\tcolor: (themeState === null || themeState === void 0 ? void 0 : themeState.theme) && themeState.isNew ? variableToString(themeState.theme.color) : \"\",\n\t\tclassName: getThemeClassNames(themeState.name, isRoot)\n\t};\n}\n\nexport { Theme, getThemedChildren };"],"mappings":";;;;;;;;;;;;;;AAaA,IAAI,QAAQ,mBAAmB,SAAS,OAAO,OAAO,KAAK;CAC1D;CACA,IAAI,MAAM,SAAS,OAAO,MAAM;CAChC,IAAI,QAAQ,IAAI,aAAa,eAAe;EAC3C,KAAK,IAAI,OAAO,OAAO,IAAI,CAAC,mBAAmB,QAAQ,QAAQ,YAAY,CAAC,IAAI,WAAW,OAAO,GAAG,SAAS,gBAAgB,OAAO,UAAU,IAAI,0EAA0E,IAAI,eAAe;CACjP;CACA,IAAI,EAAE,gBAAgB;CACtB,IAAI,SAAS,CAAC,CAAC,MAAM;CACrB,IAAI,CAAC,GAAG,cAAc,kBAAkB,OAAO,QAAQ,IAAI;CAC3D,0BAA0B,WAAW;EACpC,uBAAuB,WAAW,IAAI,WAAW,MAAM,WAAW,KAAK;EACvE,OAAO,WAAW;GACjB,OAAO,uBAAu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AuB,GAAG,KAAK,WAAW,OAAO,IAAI,YAAY,KAAK,WAAW,MAAM,IAAI,WAAW,GAAG,kBAAkB;GACtI;EACD,CAAC;EACD,OAAO;CACR;CACA,OAAO;AACR;AACA,IAAI,aAAa,EAAE,SAAS,WAAW;AACvC,IAAI,sBAAsB;CACzB,SAAS;CACT,SAAS;AACV;AACA,IAAI,QAAQ;CACX,WAAW;CACX,OAAO,KAAK;AACb;AACA,SAAS,0BAA0B,YAAY,OAAO;CACrD,IAAI,SAAS,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK;CAC9E,IAAI,CAAC,WAAW,SAAS,CAAC,MAAM,gBAAgB,OAAO;CACvD,OAAO;EACN,QAAQ,eAAe,QAAQ,eAAe,KAAK,IAAI,KAAK,IAAI,WAAW,UAAU,WAAW,QAAQ,iBAAiB,WAAW,MAAM,KAAK,IAAI;EACnJ,WAAW,mBAAmB,WAAW,MAAM,MAAM;CACtD;AACD"}
@@ -48,10 +48,7 @@ function ThemeDebug({ themeState, themeProps, children }) {
48
48
  color1: themeState.theme.color1.val,
49
49
  parentId: themeState.parentId,
50
50
  isNew: themeState.isNew,
51
- themeProps: {
52
- name: themeProps.name,
53
- reset: themeProps.reset
54
- },
51
+ themeProps: { name: themeProps.name },
55
52
  parentState: {
56
53
  name: parentState?.name,
57
54
  isNew: parentState?.isNew
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeDebug.js","names":[],"sources":["esm/views/ThemeDebug.js"],"sourcesContent":["import { useDidFinishSSR } from \"@tamagui/use-did-finish-ssr\";\nimport { useEffect } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { getThemeState } from \"../hooks/useThemeState\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nlet node;\nfunction ThemeDebug({\n themeState,\n themeProps,\n children\n}) {\n if (process.env.NODE_ENV === \"development\") {\n const isHydrated = useDidFinishSSR();\n if (process.env.NODE_ENV === \"development\" && typeof document !== \"undefined\") {\n if (!node) {\n node = document.createElement(\"div\");\n node.style.height = \"200px\";\n node.style.overflowY = \"scroll\";\n node.style.position = \"fixed\";\n node.style.zIndex = 1e7;\n node.style.bottom = \"30px\";\n node.style.left = \"30px\";\n node.style.right = \"30px\";\n node.style.display = \"flex\";\n node.style.border = \"1px solid #888\";\n node.style.flexDirection = \"row\";\n node.style.background = \"var(--background)\";\n }\n }\n useEffect(() => {\n document.body.appendChild(node);\n }, []);\n if (themeProps[\"disable-child-theme\"] || !isHydrated) {\n return children;\n }\n const parentState = themeState.parentId ? getThemeState(themeState.parentId) : null;\n return /* @__PURE__ */ jsxs(Fragment, { children: [\n createPortal(\n /* @__PURE__ */ jsxs(\n \"code\",\n {\n style: {\n whiteSpace: \"pre\",\n maxWidth: 250,\n overflow: \"auto\",\n padding: 5\n },\n children: [\n \"<Theme \",\n themeState.id,\n \" />\\xA0\",\n JSON.stringify(\n {\n name: themeState.name,\n color1: themeState.theme.color1.val,\n parentId: themeState.parentId,\n // inverses: themeState.inverses,\n isNew: themeState.isNew,\n themeProps: {\n name: themeProps.name,\n reset: themeProps.reset\n },\n parentState: {\n name: parentState?.name,\n isNew: parentState?.isNew\n }\n },\n null,\n 2\n )\n ]\n }\n ),\n node\n ),\n /* @__PURE__ */ jsx(\"div\", { style: { color: \"red\" }, children: themeState.id }),\n children\n ] });\n }\n return children;\n}\nThemeDebug[\"displayName\"] = \"ThemeDebug\";\nexport {\n ThemeDebug\n};\n//# sourceMappingURL=ThemeDebug.js.map\n"],"mappings":";;;;;;;AAKA,IAAI;AACJ,SAAS,WAAW,EAClB,YACA,YACA,YACC;CACD,IAAI,QAAQ,IAAI,aAAa,eAAe;EAC1C,MAAM,aAAa,gBAAgB;EACnC,IAAI,QAAQ,IAAI,aAAa,iBAAiB,OAAO,aAAa,aAAa;GAC7E,IAAI,CAAC,MAAM;IACT,OAAO,SAAS,cAAc,KAAK;IACnC,KAAK,MAAM,SAAS;IACpB,KAAK,MAAM,YAAY;IACvB,KAAK,MAAM,WAAW;IACtB,KAAK,MAAM,SAAS;IACpB,KAAK,MAAM,SAAS;IACpB,KAAK,MAAM,OAAO;IAClB,KAAK,MAAM,QAAQ;IACnB,KAAK,MAAM,UAAU;IACrB,KAAK,MAAM,SAAS;IACpB,KAAK,MAAM,gBAAgB;IAC3B,KAAK,MAAM,aAAa;GAC1B;EACF;EACA,gBAAgB;GACd,SAAS,KAAK,YAAY,IAAI;EAChC,GAAG,CAAC,CAAC;EACL,IAAI,WAAW,0BAA0B,CAAC,YAAY;GACpD,OAAO;EACT;EACA,MAAM,cAAc,WAAW,WAAW,cAAc,WAAW,QAAQ,IAAI;EAC/E,OAAuB,qBAAK,UAAU,EAAE,UAAU;GAChD,aACkB,qBACd,QACA;IACE,OAAO;KACL,YAAY;KACZ,UAAU;KACV,UAAU;KACV,SAAS;IACX;IACA,UAAU;KACR;KACA,WAAW;KACX;KACA,KAAK,UACH;MACE,MAAM,WAAW;MACjB,QAAQ,WAAW,MAAM,OAAO;MAChC,UAAU,WAAW;MAErB,OAAO,WAAW;MAClB,YAAY;OACV,MAAM,WAAW;OACjB,OAAO,WAAW;MACpB;MACA,aAAa;OACX,MAAM,aAAa;OACnB,OAAO,aAAa;MACtB;KACF,GACA,MACA,CACF;IACF;GACF,CACF,GACA,IACF;GACgB,oBAAI,OAAO;IAAE,OAAO,EAAE,OAAO,MAAM;IAAG,UAAU,WAAW;GAAG,CAAC;GAC/E;EACF,EAAE,CAAC;CACL;CACA,OAAO;AACT;AACA,WAAW,iBAAiB"}
1
+ {"version":3,"file":"ThemeDebug.js","names":[],"sources":["esm/views/ThemeDebug.js"],"sourcesContent":["import { useDidFinishSSR } from \"@tamagui/use-did-finish-ssr\";\nimport { useEffect } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { getThemeState } from \"../hooks/useThemeState\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nlet node;\nfunction ThemeDebug({\n themeState,\n themeProps,\n children\n}) {\n if (process.env.NODE_ENV === \"development\") {\n const isHydrated = useDidFinishSSR();\n if (process.env.NODE_ENV === \"development\" && typeof document !== \"undefined\") {\n if (!node) {\n node = document.createElement(\"div\");\n node.style.height = \"200px\";\n node.style.overflowY = \"scroll\";\n node.style.position = \"fixed\";\n node.style.zIndex = 1e7;\n node.style.bottom = \"30px\";\n node.style.left = \"30px\";\n node.style.right = \"30px\";\n node.style.display = \"flex\";\n node.style.border = \"1px solid #888\";\n node.style.flexDirection = \"row\";\n node.style.background = \"var(--background)\";\n }\n }\n useEffect(() => {\n document.body.appendChild(node);\n }, []);\n if (themeProps[\"disable-child-theme\"] || !isHydrated) {\n return children;\n }\n const parentState = themeState.parentId ? getThemeState(themeState.parentId) : null;\n return /* @__PURE__ */ jsxs(Fragment, { children: [\n createPortal(\n /* @__PURE__ */ jsxs(\n \"code\",\n {\n style: {\n whiteSpace: \"pre\",\n maxWidth: 250,\n overflow: \"auto\",\n padding: 5\n },\n children: [\n \"<Theme \",\n themeState.id,\n \" />\\xA0\",\n JSON.stringify(\n {\n name: themeState.name,\n color1: themeState.theme.color1.val,\n parentId: themeState.parentId,\n // inverses: themeState.inverses,\n isNew: themeState.isNew,\n themeProps: {\n name: themeProps.name\n },\n parentState: {\n name: parentState?.name,\n isNew: parentState?.isNew\n }\n },\n null,\n 2\n )\n ]\n }\n ),\n node\n ),\n /* @__PURE__ */ jsx(\"div\", { style: { color: \"red\" }, children: themeState.id }),\n children\n ] });\n }\n return children;\n}\nThemeDebug[\"displayName\"] = \"ThemeDebug\";\nexport {\n ThemeDebug\n};\n//# sourceMappingURL=ThemeDebug.js.map\n"],"mappings":";;;;;;;AAKA,IAAI;AACJ,SAAS,WAAW,EAClB,YACA,YACA,YACC;CACD,IAAI,QAAQ,IAAI,aAAa,eAAe;EAC1C,MAAM,aAAa,gBAAgB;EACnC,IAAI,QAAQ,IAAI,aAAa,iBAAiB,OAAO,aAAa,aAAa;GAC7E,IAAI,CAAC,MAAM;IACT,OAAO,SAAS,cAAc,KAAK;IACnC,KAAK,MAAM,SAAS;IACpB,KAAK,MAAM,YAAY;IACvB,KAAK,MAAM,WAAW;IACtB,KAAK,MAAM,SAAS;IACpB,KAAK,MAAM,SAAS;IACpB,KAAK,MAAM,OAAO;IAClB,KAAK,MAAM,QAAQ;IACnB,KAAK,MAAM,UAAU;IACrB,KAAK,MAAM,SAAS;IACpB,KAAK,MAAM,gBAAgB;IAC3B,KAAK,MAAM,aAAa;GAC1B;EACF;EACA,gBAAgB;GACd,SAAS,KAAK,YAAY,IAAI;EAChC,GAAG,CAAC,CAAC;EACL,IAAI,WAAW,0BAA0B,CAAC,YAAY;GACpD,OAAO;EACT;EACA,MAAM,cAAc,WAAW,WAAW,cAAc,WAAW,QAAQ,IAAI;EAC/E,OAAuB,qBAAK,UAAU,EAAE,UAAU;GAChD,aACkB,qBACd,QACA;IACE,OAAO;KACL,YAAY;KACZ,UAAU;KACV,UAAU;KACV,SAAS;IACX;IACA,UAAU;KACR;KACA,WAAW;KACX;KACA,KAAK,UACH;MACE,MAAM,WAAW;MACjB,QAAQ,WAAW,MAAM,OAAO;MAChC,UAAU,WAAW;MAErB,OAAO,WAAW;MAClB,YAAY,EACV,MAAM,WAAW,KACnB;MACA,aAAa;OACX,MAAM,aAAa;OACnB,OAAO,aAAa;MACtB;KACF,GACA,MACA,CACF;IACF;GACF,CACF,GACA,IACF;GACgB,oBAAI,OAAO;IAAE,OAAO,EAAE,OAAO,MAAM;IAAG,UAAU,WAAW;GAAG,CAAC;GAC/E;EACF,EAAE,CAAC;CACL;CACA,OAAO;AACT;AACA,WAAW,iBAAiB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/web",
3
- "version": "3.0.0-beta.831.1",
3
+ "version": "3.0.0-beta.889.1",
4
4
  "license": "MIT",
5
5
  "author": {
6
6
  "name": "Nate Wienert"
@@ -100,22 +100,22 @@
100
100
  "test:web": "vitest --typecheck --run"
101
101
  },
102
102
  "dependencies": {
103
- "@tamagui/compose-refs": "3.0.0-beta.831.1",
104
- "@tamagui/constants": "3.0.0-beta.831.1",
105
- "@tamagui/dom": "3.0.0-beta.831.1",
106
- "@tamagui/helpers": "3.0.0-beta.831.1",
107
- "@tamagui/is-equal-shallow": "3.0.0-beta.831.1",
108
- "@tamagui/native": "3.0.0-beta.831.1",
109
- "@tamagui/normalize-css-color": "3.0.0-beta.831.1",
110
- "@tamagui/style-grammar": "3.0.0-beta.831.1",
111
- "@tamagui/timer": "3.0.0-beta.831.1",
112
- "@tamagui/types": "3.0.0-beta.831.1",
113
- "@tamagui/use-did-finish-ssr": "3.0.0-beta.831.1",
114
- "@tamagui/use-event": "3.0.0-beta.831.1",
115
- "@tamagui/use-force-update": "3.0.0-beta.831.1"
103
+ "@tamagui/compose-refs": "3.0.0-beta.889.1",
104
+ "@tamagui/constants": "3.0.0-beta.889.1",
105
+ "@tamagui/dom": "3.0.0-beta.889.1",
106
+ "@tamagui/helpers": "3.0.0-beta.889.1",
107
+ "@tamagui/is-equal-shallow": "3.0.0-beta.889.1",
108
+ "@tamagui/native": "3.0.0-beta.889.1",
109
+ "@tamagui/normalize-css-color": "3.0.0-beta.889.1",
110
+ "@tamagui/style-grammar": "3.0.0-beta.889.1",
111
+ "@tamagui/timer": "3.0.0-beta.889.1",
112
+ "@tamagui/types": "3.0.0-beta.889.1",
113
+ "@tamagui/use-did-finish-ssr": "3.0.0-beta.889.1",
114
+ "@tamagui/use-event": "3.0.0-beta.889.1",
115
+ "@tamagui/use-force-update": "3.0.0-beta.889.1"
116
116
  },
117
117
  "devDependencies": {
118
- "@tamagui/build": "3.0.0-beta.831.1",
118
+ "@tamagui/build": "3.0.0-beta.889.1",
119
119
  "@testing-library/react": "^16.1.0",
120
120
  "csstype": "^3.0.10",
121
121
  "react": "19.2.3",
@@ -264,7 +264,9 @@ export function createComponent<
264
264
  // a const, a config read) makes it unfoldable.
265
265
  if (process.env.TAMAGUI_RUNTIME === 'zero') {
266
266
  throw new Error(
267
- `[tamagui zero-runtime] createComponent ran in a zero-runtime graph. No Tamagui component renderer ships in this mode, so a component reference survived compilation. Fix the site or move the owning module to a declared full-runtime island.`
267
+ process.env.NODE_ENV !== 'production'
268
+ ? `[tamagui zero-runtime] createComponent ran in a zero-runtime graph. No Tamagui component renderer ships in this mode, so a component reference survived compilation. Fix the site or move the owning module to a declared full-runtime island.`
269
+ : '❌ Error 010'
268
270
  )
269
271
  }
270
272
 
@@ -2227,6 +2229,24 @@ export function createComponent<
2227
2229
 
2228
2230
  res.staticConfig = staticConfig
2229
2231
 
2232
+ // `.resolve` chains a component resolver (complete props + env -> style
2233
+ // fragment) by returning a NEW component with the resolver appended
2234
+ res.resolve = (resolver: any) => {
2235
+ const next: any = createComponent({
2236
+ ...staticConfig,
2237
+ resolvers: staticConfig.resolvers
2238
+ ? [...staticConfig.resolvers, resolver]
2239
+ : [resolver],
2240
+ })
2241
+ // carry over statics assigned after creation (styled() copies parent
2242
+ // statics onto the finished component)
2243
+ for (const key in res) {
2244
+ if (key === 'propTypes' || key in next) continue
2245
+ next[key] = (res as any)[key]
2246
+ }
2247
+ return next
2248
+ }
2249
+
2230
2250
  if (displayName) {
2231
2251
  res.displayName = displayName
2232
2252
  ;(res as any)[componentDisplayName] = displayName
@@ -35,7 +35,9 @@ export function createStyledHOC<
35
35
  : Props
36
36
  > &
37
37
  CustomProps,
38
- ref?: ReactRef<NoInfer<Ref>>
38
+ // always a ref value (null when the caller passed none), so a render
39
+ // callback may declare a required `Ref<TamaguiElement>` parameter
40
+ ref: ReactRef<NoInfer<Ref>> | null
39
41
  ) => ReactNode,
40
42
  options?: StyledHOCOptions
41
43
  ): TamaguiComponent<
@@ -70,7 +72,7 @@ export function createStyledHOC<
70
72
  let out: any = function StyledHOCComponent(props: any) {
71
73
  'use no memo'
72
74
 
73
- const { ref, ...rest } = props
75
+ const { ref = null, ...rest } = props
74
76
  if (options?.disableTheme) {
75
77
  return render(rest, ref)
76
78
  }
@@ -100,16 +100,6 @@ export function getVariableValue(v: Variable | any, group?: TokenCategories) {
100
100
  return v
101
101
  }
102
102
 
103
- export function getVariableName(v: Variable | any) {
104
- if (isVariable(v)) return v.name
105
- return v
106
- }
107
-
108
- export function getVariableVariable(v: Variable | string | undefined) {
109
- if (isVariable(v)) return v.variable
110
- return v
111
- }
112
-
113
103
  // bugfix { space: { 0.5: 10 } } was generating var(--space-0.5) (invalid CSS):
114
104
  export const createCSSVariable = (nameProp: string, includeVar = true) => {
115
105
  if (process.env.NODE_ENV === 'development') {
@@ -0,0 +1,62 @@
1
+ // the one classifier for border/outline shorthand components. every parser
2
+ // (web composite lowering, native border emission, native normalizeStyle
3
+ // expansion) routes through it so they cannot disagree on what counts as a
4
+ // width, a line style, or a color
5
+
6
+ export const lineStyles = new Set([
7
+ 'none',
8
+ 'hidden',
9
+ 'dotted',
10
+ 'dashed',
11
+ 'solid',
12
+ 'double',
13
+ 'groove',
14
+ 'ridge',
15
+ 'inset',
16
+ 'outset',
17
+ ])
18
+
19
+ // splits on whitespace outside parens and quotes, so `rgb(1, 2, 3)` and
20
+ // `calc(1px + 1px)` stay single components
21
+ export function splitComponents(value: string): string[] {
22
+ return (
23
+ value.match(
24
+ /(?:[^\s("']+|\((?:[^()]|\([^)]*\))*\)|"(?:\\.|[^"])*"|'(?:\\.|[^'])*')+/g
25
+ ) || []
26
+ )
27
+ }
28
+
29
+ export function startsValueFunction(value: string): boolean {
30
+ return /^-?[a-z][a-z0-9-]*\(/i.test(value)
31
+ }
32
+
33
+ const colorFunction =
34
+ /^(?:rgba?|hsla?|hwb|lab|lch|oklab|oklch|color|color-mix|light-dark)\(/i
35
+
36
+ export type BorderComponents = {
37
+ width?: string
38
+ style?: string
39
+ color?: string
40
+ }
41
+
42
+ export function classifyBorderComponents(raw: string, allowAuto = false) {
43
+ const out: BorderComponents = {}
44
+ for (const part of splitComponents(raw)) {
45
+ if (lineStyles.has(part) || (allowAuto && part === 'auto')) {
46
+ out.style = part
47
+ } else if (colorFunction.test(part)) {
48
+ out.color = part
49
+ } else if (
50
+ part === 'thin' ||
51
+ part === 'medium' ||
52
+ part === 'thick' ||
53
+ /^[+-]?(?:\d+\.?\d*|\.\d+)(?:%|[a-z]+)?$/.test(part) ||
54
+ startsValueFunction(part)
55
+ ) {
56
+ out.width = part
57
+ } else {
58
+ out.color = part
59
+ }
60
+ }
61
+ return out
62
+ }
@@ -243,8 +243,6 @@ const getStaticCSS = (
243
243
  @scope (.is_Text) to (.is_View) { :where(.is_Text) { white-space: inherit; word-wrap: inherit; } }
244
244
  ._dsp_contents {display:contents;}
245
245
  ._no_backdrop::backdrop {display: none;}
246
- .is_Input::selection, .is_TextArea::selection {background-color: var(--t_selectionColor);}
247
- .is_Input::placeholder, .is_TextArea::placeholder {color: var(--t_placeholderColor);}
248
246
  ${pointerEventsCSS}
249
247
  ${hideScrollBarsCSS}
250
248
  ${autoVarCSS}
@@ -6,14 +6,7 @@ import { mergeProps } from './mergeProps'
6
6
  import { objectIdentityKey } from './objectIdentityKey'
7
7
 
8
8
  type EmptyDefault = Record<PropertyKey, never>
9
-
10
- type EmptyDefaultOptions =
11
- | string
12
- | {
13
- namespace?: string
14
- keys?: never
15
- }
16
-
9
+ type EmptyDefaultOptions = string | { namespace?: string; keys?: never }
17
10
  type StyledContextKey<Props> = Extract<keyof Props, string>
18
11
 
19
12
  type OptionalStyledContextKeys<Props extends Record<string, any>> = {
@@ -64,60 +57,39 @@ type StyledContextFactory = {
64
57
  ): StyledContext<VariantProps, never>
65
58
  }
66
59
 
67
- // use const (not function declaration) to prevent esbuild from hoisting
68
- // above __esm lazy init - function declarations get hoisted before
69
- // import_react is initialized, causing undefined.default errors in SSR
70
60
  export const createStyledContext = (<VariantProps extends Record<string, any>>(
71
61
  defaultValues?: VariantProps,
72
62
  namespaceOrOptions:
73
63
  | string
74
64
  | StyledContextOptions<VariantProps, StyledContextKey<VariantProps>> = ''
75
65
  ): StyledContext<VariantProps, StyledContextKey<VariantProps>> => {
76
- // avoid react compiler - we aren't breaking its rules but it mis-interprets
77
- // how we change the context value
78
66
  'use no memo'
79
67
 
80
- // lazy initialization fixes vite ssr hmr - module-level assignments can fail
81
- // when React is undefined during __esm re-initialization order issues.
82
- // also React.createContext is optimized oddly by React compiler and our
83
- // uncommon usage confuses it, so we use dynamic access
84
- const createReactContext = React[
85
- Math.random() ? 'createContext' : 'createContext'
86
- ] as typeof React.createContext
87
- const useReactMemo = React[
88
- Math.random() ? 'useMemo' : 'useMemo'
89
- ] as typeof React.useMemo
90
- const useReactContext = React[
91
- Math.random() ? 'useContext' : 'useContext'
92
- ] as typeof React.useContext
93
-
94
68
  const namespace =
95
69
  typeof namespaceOrOptions === 'string'
96
70
  ? namespaceOrOptions
97
71
  : namespaceOrOptions.namespace || ''
72
+ const defaultKeys = isPlainObject(defaultValues)
73
+ ? (Object.keys(defaultValues) as StyledContextKey<VariantProps>[])
74
+ : undefined
98
75
  const propKeys =
99
- typeof namespaceOrOptions === 'string'
100
- ? isPlainObject(defaultValues)
101
- ? (Object.keys(defaultValues) as StyledContextKey<VariantProps>[])
102
- : undefined
103
- : namespaceOrOptions.keys ||
104
- (isPlainObject(defaultValues)
105
- ? (Object.keys(defaultValues) as StyledContextKey<VariantProps>[])
106
- : undefined)
76
+ typeof namespaceOrOptions === 'object' && namespaceOrOptions.keys
77
+ ? namespaceOrOptions.keys
78
+ : defaultKeys
107
79
 
108
- const OGContext = createReactContext<VariantProps | undefined>(defaultValues)
80
+ const OGContext = React.createContext<VariantProps | undefined>(defaultValues)
109
81
  const OGProvider = OGContext.Provider
110
82
  const Context = OGContext as any as StyledContext<
111
83
  VariantProps,
112
84
  StyledContextKey<VariantProps>
113
85
  >
114
86
  const scopedContexts = new Map<string, Context<VariantProps | undefined>>()
115
- const LastScopeInNamespace = createReactContext<string>(namespace)
87
+ const LastScopeInNamespace = React.createContext<string>(namespace)
116
88
 
117
89
  function getOrCreateScopedContext(scope: string) {
118
90
  let ScopedContext = scopedContexts.get(scope)
119
91
  if (!ScopedContext) {
120
- ScopedContext = createReactContext<VariantProps | undefined>(defaultValues)
92
+ ScopedContext = React.createContext<VariantProps | undefined>(defaultValues)
121
93
  scopedContexts.set(scope, ScopedContext)
122
94
  }
123
95
  return ScopedContext!
@@ -129,24 +101,16 @@ export const createStyledContext = (<VariantProps extends Record<string, any>>(
129
101
  const Provider = ({
130
102
  children,
131
103
  scope: scopeIn,
132
- // performance: avoid creating objects
133
104
  __disableMergeDefaultValues,
134
105
  ...values
135
106
  }: VariantProps & { children?: ReactNode; scope: string }) => {
136
107
  const scope = getNamespacedScope(scopeIn)
137
-
138
- const next = useReactMemo(() => {
139
- if (__disableMergeDefaultValues) {
140
- // we already merged and want to keep ordering
141
- return values
142
- }
108
+ const next = React.useMemo(() => {
109
+ if (__disableMergeDefaultValues) return values
143
110
  return mergeProps(defaultValues || {}, values)
144
111
  }, [objectIdentityKey(values)])
145
112
 
146
- let ScopedProvider = OGProvider
147
- if (scope) {
148
- ScopedProvider = getOrCreateScopedContext(scope).Provider
149
- }
113
+ const ScopedProvider = scope ? getOrCreateScopedContext(scope).Provider : OGProvider
150
114
  return (
151
115
  <LastScopeInNamespace.Provider value={scope}>
152
116
  <ScopedProvider value={next as VariantProps}>{children}</ScopedProvider>
@@ -154,17 +118,15 @@ export const createStyledContext = (<VariantProps extends Record<string, any>>(
154
118
  )
155
119
  }
156
120
 
157
- // use consumerComponent just to give a better error message
158
121
  const useStyledContext = (scopeIn = '') => {
159
- const lastScopeInNamespace = useReactContext(LastScopeInNamespace)
122
+ const lastScopeInNamespace = React.useContext(LastScopeInNamespace)
160
123
  const scope = namespace
161
124
  ? scopeIn
162
125
  ? getNamespacedScope(scopeIn)
163
126
  : lastScopeInNamespace
164
127
  : scopeIn
165
128
  const context = scope ? getOrCreateScopedContext(scope) : OGContext
166
- const value = useReactContext(context!) as VariantProps
167
- return value
129
+ return React.useContext(context!) as VariantProps
168
130
  }
169
131
 
170
132
  // @ts-expect-error we are overriding default provider
@@ -56,14 +56,14 @@ export function formatDiagnostic(
56
56
  prop?: string,
57
57
  received?: unknown
58
58
  ) {
59
- if (process.env.NODE_ENV === 'production') {
60
- return `${code}: ${message}`
59
+ if (process.env.NODE_ENV === 'development') {
60
+ const formattedValue = prop ? formatDiagnosticValue(received) : ''
61
+ const boundedValue =
62
+ formattedValue.length > maxDiagnosticValueLength
63
+ ? `${formattedValue.slice(0, maxDiagnosticValueLength - 1)}…`
64
+ : formattedValue
65
+ const value = prop ? ` Received ${prop}=${boundedValue}.` : ''
66
+ return `${code} ${component}: ${message}.${value} ${action}`
61
67
  }
62
- const formattedValue = prop ? formatDiagnosticValue(received) : ''
63
- const boundedValue =
64
- formattedValue.length > maxDiagnosticValueLength
65
- ? `${formattedValue.slice(0, maxDiagnosticValueLength - 1)}…`
66
- : formattedValue
67
- const value = prop ? ` Received ${prop}=${boundedValue}.` : ''
68
- return `${code} ${component}: ${message}.${value} ${action}`
68
+ return `${code}: ${message}`
69
69
  }
@@ -1,7 +1,10 @@
1
- const empty = () => {
2
- console.warn('no-op native')
3
- }
1
+ const empty = () => {}
4
2
 
3
+ export const canGenerateCSS = false
4
+ export const flushDirectStyles = empty
5
+ export const addComposition = empty
6
+ export const registerAtomicSlot = empty
7
+ export const buildAtomicSlotCSS = empty
5
8
  export const getCSSStylesAtomic = empty
6
9
  export const getCSSStyleAtomic = empty
7
10
  export const getStyleAtomic = empty