@tamagui/web 3.0.0-beta.807.1 → 3.0.0-beta.881.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 (587) hide show
  1. package/dist/cjs/config.cjs +1 -1
  2. package/dist/cjs/config.native.cjs +1 -1
  3. package/dist/cjs/config.native.js +1 -1
  4. package/dist/cjs/config.native.js.map +1 -1
  5. package/dist/cjs/createComponent.cjs +40 -19
  6. package/dist/cjs/createComponent.native.cjs +42 -21
  7. package/dist/cjs/createComponent.native.js +42 -21
  8. package/dist/cjs/createComponent.native.js.map +1 -1
  9. package/dist/cjs/createStyledHOC.cjs +54 -4
  10. package/dist/cjs/createStyledHOC.native.cjs +55 -4
  11. package/dist/cjs/createStyledHOC.native.js +55 -4
  12. package/dist/cjs/createStyledHOC.native.js.map +1 -1
  13. package/dist/cjs/createTokens.cjs +1 -1
  14. package/dist/cjs/createTokens.native.cjs +1 -1
  15. package/dist/cjs/createTokens.native.js +1 -1
  16. package/dist/cjs/createTokens.native.js.map +1 -1
  17. package/dist/cjs/createVariable.cjs +0 -10
  18. package/dist/cjs/createVariable.native.cjs +0 -10
  19. package/dist/cjs/createVariable.native.js +0 -10
  20. package/dist/cjs/createVariable.native.js.map +1 -1
  21. package/dist/cjs/dom/html.cjs +147 -99
  22. package/dist/cjs/dom/htmlRuntime.native.cjs +6 -2
  23. package/dist/cjs/dom/htmlRuntime.native.js +6 -2
  24. package/dist/cjs/dom/htmlRuntime.native.js.map +1 -1
  25. package/dist/cjs/dom/primitives.native.cjs +16 -13
  26. package/dist/cjs/dom/primitives.native.js +16 -13
  27. package/dist/cjs/dom/primitives.native.js.map +1 -1
  28. package/dist/cjs/helpers/borderComponents.cjs +62 -0
  29. package/dist/cjs/helpers/borderComponents.native.cjs +82 -0
  30. package/dist/cjs/helpers/borderComponents.native.js +84 -0
  31. package/dist/cjs/helpers/borderComponents.native.js.map +1 -0
  32. package/dist/cjs/helpers/componentDisplayName.cjs +1 -11
  33. package/dist/cjs/helpers/componentDisplayName.native.cjs +1 -11
  34. package/dist/cjs/helpers/componentDisplayName.native.js +1 -11
  35. package/dist/cjs/helpers/componentDisplayName.native.js.map +1 -1
  36. package/dist/cjs/helpers/createDesignSystem.cjs +0 -2
  37. package/dist/cjs/helpers/createStyledContext.cjs +10 -18
  38. package/dist/cjs/helpers/createStyledContext.native.cjs +14 -18
  39. package/dist/cjs/helpers/createStyledContext.native.js +14 -18
  40. package/dist/cjs/helpers/createStyledContext.native.js.map +1 -1
  41. package/dist/cjs/helpers/formatDiagnostic.cjs +8 -10
  42. package/dist/cjs/helpers/formatDiagnostic.native.cjs +8 -10
  43. package/dist/cjs/helpers/formatDiagnostic.native.js +8 -10
  44. package/dist/cjs/helpers/formatDiagnostic.native.js.map +1 -1
  45. package/dist/cjs/helpers/getCSSStylesAtomic.cjs +133 -114
  46. package/dist/cjs/helpers/getCSSStylesAtomic.native.cjs +11 -3
  47. package/dist/cjs/helpers/getCSSStylesAtomic.native.js +11 -3
  48. package/dist/cjs/helpers/getCSSStylesAtomic.native.js.map +1 -1
  49. package/dist/cjs/helpers/getCSSStylesAtomicCompiled.cjs +13 -1
  50. package/dist/cjs/helpers/getCSSStylesAtomicCompiled.native.cjs +15 -1
  51. package/dist/cjs/helpers/getCSSStylesAtomicCompiled.native.js +15 -1
  52. package/dist/cjs/helpers/getCSSStylesAtomicCompiled.native.js.map +1 -1
  53. package/dist/cjs/helpers/getDynamicVal.cjs +5 -1
  54. package/dist/cjs/helpers/getDynamicVal.native.cjs +5 -1
  55. package/dist/cjs/helpers/getDynamicVal.native.js +5 -1
  56. package/dist/cjs/helpers/getDynamicVal.native.js.map +1 -1
  57. package/dist/cjs/helpers/getSplitStyles.cjs +1063 -2168
  58. package/dist/cjs/helpers/getSplitStyles.native.cjs +1115 -2515
  59. package/dist/cjs/helpers/getSplitStyles.native.js +1115 -2515
  60. package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
  61. package/dist/cjs/helpers/grammarConfig.cjs +163 -1
  62. package/dist/cjs/helpers/grammarConfig.native.cjs +186 -1
  63. package/dist/cjs/helpers/grammarConfig.native.js +186 -1
  64. package/dist/cjs/helpers/grammarConfig.native.js.map +1 -1
  65. package/dist/cjs/helpers/insertStyleRule.cjs +5 -1
  66. package/dist/cjs/helpers/insertStyleRule.native.cjs +7 -1
  67. package/dist/cjs/helpers/insertStyleRule.native.js +7 -1
  68. package/dist/cjs/helpers/insertStyleRule.native.js.map +1 -1
  69. package/dist/cjs/helpers/log.cjs +9 -8
  70. package/dist/cjs/helpers/log.native.cjs +9 -8
  71. package/dist/cjs/helpers/log.native.js +9 -8
  72. package/dist/cjs/helpers/log.native.js.map +1 -1
  73. package/dist/cjs/helpers/mergeVariants.cjs +44 -13
  74. package/dist/cjs/helpers/mergeVariants.native.cjs +79 -14
  75. package/dist/cjs/helpers/mergeVariants.native.js +79 -14
  76. package/dist/cjs/helpers/mergeVariants.native.js.map +1 -1
  77. package/dist/cjs/helpers/nativeOnlyProps.cjs +0 -1
  78. package/dist/cjs/helpers/nativeOnlyProps.native.cjs +0 -1
  79. package/dist/cjs/helpers/nativeOnlyProps.native.js +0 -1
  80. package/dist/cjs/helpers/nativeOnlyProps.native.js.map +1 -1
  81. package/dist/cjs/helpers/nativeStyleEngine.cjs +34 -14
  82. package/dist/cjs/helpers/nativeStyleEngine.native.cjs +36 -14
  83. package/dist/cjs/helpers/nativeStyleEngine.native.js +36 -14
  84. package/dist/cjs/helpers/nativeStyleEngine.native.js.map +1 -1
  85. package/dist/cjs/helpers/normalizeValueWithProperty.cjs +7 -8
  86. package/dist/cjs/helpers/normalizeValueWithProperty.native.cjs +9 -8
  87. package/dist/cjs/helpers/normalizeValueWithProperty.native.js +9 -8
  88. package/dist/cjs/helpers/normalizeValueWithProperty.native.js.map +1 -1
  89. package/dist/cjs/helpers/parseBorderShorthand.native.cjs +25 -56
  90. package/dist/cjs/helpers/parseBorderShorthand.native.js +25 -56
  91. package/dist/cjs/helpers/parseBorderShorthand.native.js.map +1 -1
  92. package/dist/cjs/helpers/parseOutlineShorthand.native.cjs +9 -49
  93. package/dist/cjs/helpers/parseOutlineShorthand.native.js +9 -49
  94. package/dist/cjs/helpers/parseOutlineShorthand.native.js.map +1 -1
  95. package/dist/cjs/helpers/resolveSafeArea.cjs +35 -100
  96. package/dist/cjs/helpers/resolveVariantStyle.cjs +57 -0
  97. package/dist/cjs/helpers/resolveVariantStyle.native.cjs +67 -0
  98. package/dist/cjs/helpers/resolveVariantStyle.native.js +69 -0
  99. package/dist/cjs/helpers/resolveVariantStyle.native.js.map +1 -0
  100. package/dist/cjs/helpers/splitStyleProps.cjs +46 -0
  101. package/dist/cjs/helpers/splitStyleProps.native.cjs +49 -0
  102. package/dist/cjs/helpers/splitStyleProps.native.js +51 -0
  103. package/dist/cjs/helpers/splitStyleProps.native.js.map +1 -0
  104. package/dist/cjs/helpers/{getDefaultProps.native.cjs → styleStaticConfig.cjs} +7 -8
  105. package/dist/cjs/helpers/{getDefaultProps.native.js → styleStaticConfig.native.cjs} +7 -8
  106. package/dist/cjs/helpers/styleStaticConfig.native.js +31 -0
  107. package/dist/cjs/helpers/styleStaticConfig.native.js.map +1 -0
  108. package/dist/cjs/helpers/styleStaticConfigCore.cjs +107 -0
  109. package/dist/cjs/helpers/styleStaticConfigCore.native.cjs +127 -0
  110. package/dist/cjs/helpers/styleStaticConfigCore.native.js +129 -0
  111. package/dist/cjs/helpers/styleStaticConfigCore.native.js.map +1 -0
  112. package/dist/cjs/helpers/styledDynamic.cjs +160 -0
  113. package/dist/cjs/helpers/styledDynamic.native.cjs +195 -0
  114. package/dist/cjs/helpers/styledDynamic.native.js +197 -0
  115. package/dist/cjs/helpers/styledDynamic.native.js.map +1 -0
  116. package/dist/cjs/helpers/tokenCategories.cjs +12 -74
  117. package/dist/cjs/helpers/tokenCategories.native.cjs +12 -76
  118. package/dist/cjs/helpers/tokenCategories.native.js +12 -76
  119. package/dist/cjs/helpers/tokenCategories.native.js.map +1 -1
  120. package/dist/cjs/helpers/variableValue.cjs +17 -12
  121. package/dist/cjs/helpers/variableValue.native.cjs +46 -23
  122. package/dist/cjs/helpers/variableValue.native.js +46 -23
  123. package/dist/cjs/helpers/variableValue.native.js.map +1 -1
  124. package/dist/cjs/helpers/warnOnce.cjs +5 -4
  125. package/dist/cjs/helpers/warnOnce.native.cjs +6 -4
  126. package/dist/cjs/helpers/warnOnce.native.js +6 -4
  127. package/dist/cjs/helpers/warnOnce.native.js.map +1 -1
  128. package/dist/cjs/hooks/useAnimationDriver.cjs +2 -2
  129. package/dist/cjs/hooks/useAnimationDriver.native.cjs +2 -2
  130. package/dist/cjs/hooks/useAnimationDriver.native.js +2 -2
  131. package/dist/cjs/hooks/useAnimationDriver.native.js.map +1 -1
  132. package/dist/cjs/hooks/useComponentState.cjs +41 -82
  133. package/dist/cjs/hooks/useComponentState.native.cjs +45 -84
  134. package/dist/cjs/hooks/useComponentState.native.js +45 -84
  135. package/dist/cjs/hooks/useComponentState.native.js.map +1 -1
  136. package/dist/cjs/hooks/useMedia.cjs +2 -2
  137. package/dist/cjs/hooks/useMedia.native.cjs +2 -2
  138. package/dist/cjs/hooks/useMedia.native.js +2 -2
  139. package/dist/cjs/hooks/useMedia.native.js.map +1 -1
  140. package/dist/cjs/hooks/useSplitStyles.cjs +2 -2
  141. package/dist/cjs/hooks/useSplitStyles.native.cjs +2 -2
  142. package/dist/cjs/hooks/useSplitStyles.native.js +2 -2
  143. package/dist/cjs/hooks/useSplitStyles.native.js.map +1 -1
  144. package/dist/cjs/{helpers/getDefaultProps.cjs → hooks/useStyle.cjs} +10 -4
  145. package/dist/cjs/{helpers/directStyleCSS.native.js → hooks/useStyle.native.cjs} +16 -6
  146. package/dist/cjs/hooks/useStyle.native.js +34 -0
  147. package/dist/cjs/hooks/useStyle.native.js.map +1 -0
  148. package/dist/cjs/hooks/useThemeState.cjs +25 -90
  149. package/dist/cjs/hooks/useThemeState.native.cjs +34 -94
  150. package/dist/cjs/hooks/useThemeState.native.js +34 -94
  151. package/dist/cjs/hooks/useThemeState.native.js.map +1 -1
  152. package/dist/cjs/index.cjs +9 -12
  153. package/dist/cjs/index.native.cjs +9 -12
  154. package/dist/cjs/index.native.js +9 -12
  155. package/dist/cjs/index.native.js.map +1 -1
  156. package/dist/cjs/internal-runtime.cjs +8 -7
  157. package/dist/cjs/internal-runtime.native.cjs +8 -7
  158. package/dist/cjs/internal-runtime.native.js +8 -7
  159. package/dist/cjs/internal-runtime.native.js.map +1 -1
  160. package/dist/cjs/static-resolve.cjs +8 -7
  161. package/dist/cjs/static-resolve.native.cjs +8 -7
  162. package/dist/cjs/static-resolve.native.js +8 -7
  163. package/dist/cjs/static-resolve.native.js.map +1 -1
  164. package/dist/cjs/style.cjs +91 -0
  165. package/dist/cjs/style.native.cjs +98 -0
  166. package/dist/cjs/style.native.js +100 -0
  167. package/dist/cjs/style.native.js.map +1 -0
  168. package/dist/cjs/styled.cjs +15 -62
  169. package/dist/cjs/styled.native.cjs +15 -64
  170. package/dist/cjs/styled.native.js +15 -64
  171. package/dist/cjs/styled.native.js.map +1 -1
  172. package/dist/cjs/types.cjs +4 -22
  173. package/dist/cjs/types.native.cjs +4 -22
  174. package/dist/cjs/types.native.js +4 -22
  175. package/dist/cjs/types.native.js.map +1 -1
  176. package/dist/cjs/views/TamaguiProvider.cjs +1 -2
  177. package/dist/cjs/views/TamaguiProvider.native.cjs +1 -2
  178. package/dist/cjs/views/TamaguiProvider.native.js +1 -2
  179. package/dist/cjs/views/TamaguiProvider.native.js.map +1 -1
  180. package/dist/cjs/views/Text.cjs +21 -14
  181. package/dist/cjs/views/Text.native.cjs +5 -2
  182. package/dist/cjs/views/Text.native.js +5 -2
  183. package/dist/cjs/views/Text.native.js.map +1 -1
  184. package/dist/cjs/views/Theme.cjs +2 -2
  185. package/dist/cjs/views/Theme.native.cjs +2 -2
  186. package/dist/cjs/views/Theme.native.js +2 -2
  187. package/dist/cjs/views/Theme.native.js.map +1 -1
  188. package/dist/cjs/views/ThemeDebug.cjs +1 -4
  189. package/dist/cjs/views/View.cjs +4 -2
  190. package/dist/cjs/views/View.native.cjs +4 -2
  191. package/dist/cjs/views/View.native.js +4 -2
  192. package/dist/cjs/views/View.native.js.map +1 -1
  193. package/dist/esm/config.mjs +1 -1
  194. package/dist/esm/config.mjs.map +1 -1
  195. package/dist/esm/config.native.js +1 -1
  196. package/dist/esm/config.native.js.map +1 -1
  197. package/dist/esm/createComponent.mjs +41 -20
  198. package/dist/esm/createComponent.mjs.map +1 -1
  199. package/dist/esm/createComponent.native.js +43 -22
  200. package/dist/esm/createComponent.native.js.map +1 -1
  201. package/dist/esm/createStyledHOC.mjs +55 -5
  202. package/dist/esm/createStyledHOC.mjs.map +1 -1
  203. package/dist/esm/createStyledHOC.native.js +56 -5
  204. package/dist/esm/createStyledHOC.native.js.map +1 -1
  205. package/dist/esm/createTokens.mjs +1 -1
  206. package/dist/esm/createTokens.mjs.map +1 -1
  207. package/dist/esm/createTokens.native.js +1 -1
  208. package/dist/esm/createTokens.native.js.map +1 -1
  209. package/dist/esm/createVariable.mjs +1 -9
  210. package/dist/esm/createVariable.mjs.map +1 -1
  211. package/dist/esm/createVariable.native.js +1 -9
  212. package/dist/esm/createVariable.native.js.map +1 -1
  213. package/dist/esm/dom/html.mjs +147 -99
  214. package/dist/esm/dom/html.mjs.map +1 -1
  215. package/dist/esm/dom/htmlRuntime.native.js +7 -3
  216. package/dist/esm/dom/htmlRuntime.native.js.map +1 -1
  217. package/dist/esm/dom/primitives.native.js +16 -13
  218. package/dist/esm/dom/primitives.native.js.map +1 -1
  219. package/dist/esm/helpers/borderComponents.mjs +37 -0
  220. package/dist/esm/helpers/borderComponents.mjs.map +1 -0
  221. package/dist/esm/helpers/borderComponents.native.js +55 -0
  222. package/dist/esm/helpers/borderComponents.native.js.map +1 -0
  223. package/dist/esm/helpers/componentDisplayName.mjs +1 -8
  224. package/dist/esm/helpers/componentDisplayName.mjs.map +1 -1
  225. package/dist/esm/helpers/componentDisplayName.native.js +1 -8
  226. package/dist/esm/helpers/componentDisplayName.native.js.map +1 -1
  227. package/dist/esm/helpers/createDesignSystem.mjs +0 -2
  228. package/dist/esm/helpers/createDesignSystem.mjs.map +1 -1
  229. package/dist/esm/helpers/createStyledContext.mjs +10 -18
  230. package/dist/esm/helpers/createStyledContext.mjs.map +1 -1
  231. package/dist/esm/helpers/createStyledContext.native.js +14 -18
  232. package/dist/esm/helpers/createStyledContext.native.js.map +1 -1
  233. package/dist/esm/helpers/formatDiagnostic.mjs +8 -10
  234. package/dist/esm/helpers/formatDiagnostic.mjs.map +1 -1
  235. package/dist/esm/helpers/formatDiagnostic.native.js +8 -10
  236. package/dist/esm/helpers/formatDiagnostic.native.js.map +1 -1
  237. package/dist/esm/helpers/getCSSStylesAtomic.mjs +131 -114
  238. package/dist/esm/helpers/getCSSStylesAtomic.mjs.map +1 -1
  239. package/dist/esm/helpers/getCSSStylesAtomic.native.js +7 -4
  240. package/dist/esm/helpers/getCSSStylesAtomic.native.js.map +1 -1
  241. package/dist/esm/helpers/getCSSStylesAtomicCompiled.mjs +8 -1
  242. package/dist/esm/helpers/getCSSStylesAtomicCompiled.mjs.map +1 -1
  243. package/dist/esm/helpers/getCSSStylesAtomicCompiled.native.js +10 -1
  244. package/dist/esm/helpers/getCSSStylesAtomicCompiled.native.js.map +1 -1
  245. package/dist/esm/helpers/getDynamicVal.mjs +5 -1
  246. package/dist/esm/helpers/getDynamicVal.mjs.map +1 -1
  247. package/dist/esm/helpers/getDynamicVal.native.js +5 -1
  248. package/dist/esm/helpers/getDynamicVal.native.js.map +1 -1
  249. package/dist/esm/helpers/getSplitStyles.mjs +1052 -2151
  250. package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
  251. package/dist/esm/helpers/getSplitStyles.native.js +1090 -2481
  252. package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
  253. package/dist/esm/helpers/grammarConfig.mjs +164 -2
  254. package/dist/esm/helpers/grammarConfig.mjs.map +1 -1
  255. package/dist/esm/helpers/grammarConfig.native.js +187 -2
  256. package/dist/esm/helpers/grammarConfig.native.js.map +1 -1
  257. package/dist/esm/helpers/insertStyleRule.mjs +5 -2
  258. package/dist/esm/helpers/insertStyleRule.mjs.map +1 -1
  259. package/dist/esm/helpers/insertStyleRule.native.js +7 -2
  260. package/dist/esm/helpers/insertStyleRule.native.js.map +1 -1
  261. package/dist/esm/helpers/log.mjs +9 -8
  262. package/dist/esm/helpers/log.mjs.map +1 -1
  263. package/dist/esm/helpers/log.native.js +9 -8
  264. package/dist/esm/helpers/log.native.js.map +1 -1
  265. package/dist/esm/helpers/mergeVariants.mjs +44 -13
  266. package/dist/esm/helpers/mergeVariants.mjs.map +1 -1
  267. package/dist/esm/helpers/mergeVariants.native.js +79 -14
  268. package/dist/esm/helpers/mergeVariants.native.js.map +1 -1
  269. package/dist/esm/helpers/nativeOnlyProps.mjs +0 -1
  270. package/dist/esm/helpers/nativeOnlyProps.mjs.map +1 -1
  271. package/dist/esm/helpers/nativeOnlyProps.native.js +0 -1
  272. package/dist/esm/helpers/nativeOnlyProps.native.js.map +1 -1
  273. package/dist/esm/helpers/nativeStyleEngine.mjs +34 -15
  274. package/dist/esm/helpers/nativeStyleEngine.mjs.map +1 -1
  275. package/dist/esm/helpers/nativeStyleEngine.native.js +36 -15
  276. package/dist/esm/helpers/nativeStyleEngine.native.js.map +1 -1
  277. package/dist/esm/helpers/normalizeValueWithProperty.mjs +7 -8
  278. package/dist/esm/helpers/normalizeValueWithProperty.mjs.map +1 -1
  279. package/dist/esm/helpers/normalizeValueWithProperty.native.js +9 -8
  280. package/dist/esm/helpers/normalizeValueWithProperty.native.js.map +1 -1
  281. package/dist/esm/helpers/parseBorderShorthand.native.js +23 -56
  282. package/dist/esm/helpers/parseBorderShorthand.native.js.map +1 -1
  283. package/dist/esm/helpers/parseOutlineShorthand.native.js +10 -49
  284. package/dist/esm/helpers/parseOutlineShorthand.native.js.map +1 -1
  285. package/dist/esm/helpers/resolveSafeArea.mjs +35 -97
  286. package/dist/esm/helpers/resolveSafeArea.mjs.map +1 -1
  287. package/dist/esm/helpers/resolveVariantStyle.mjs +38 -0
  288. package/dist/esm/helpers/resolveVariantStyle.mjs.map +1 -0
  289. package/dist/esm/helpers/resolveVariantStyle.native.js +46 -0
  290. package/dist/esm/helpers/resolveVariantStyle.native.js.map +1 -0
  291. package/dist/esm/helpers/splitStyleProps.mjs +27 -0
  292. package/dist/esm/helpers/splitStyleProps.mjs.map +1 -0
  293. package/dist/esm/helpers/splitStyleProps.native.js +28 -0
  294. package/dist/esm/helpers/splitStyleProps.native.js.map +1 -0
  295. package/dist/esm/helpers/styleStaticConfig.mjs +8 -0
  296. package/dist/esm/helpers/styleStaticConfig.mjs.map +1 -0
  297. package/dist/esm/helpers/styleStaticConfig.native.js +8 -0
  298. package/dist/esm/helpers/styleStaticConfig.native.js.map +1 -0
  299. package/dist/esm/helpers/styleStaticConfigCore.mjs +88 -0
  300. package/dist/esm/helpers/styleStaticConfigCore.mjs.map +1 -0
  301. package/dist/esm/helpers/styleStaticConfigCore.native.js +106 -0
  302. package/dist/esm/helpers/styleStaticConfigCore.native.js.map +1 -0
  303. package/dist/esm/helpers/styledDynamic.mjs +136 -0
  304. package/dist/esm/helpers/styledDynamic.mjs.map +1 -0
  305. package/dist/esm/helpers/styledDynamic.native.js +169 -0
  306. package/dist/esm/helpers/styledDynamic.native.js.map +1 -0
  307. package/dist/esm/helpers/tokenCategories.mjs +12 -72
  308. package/dist/esm/helpers/tokenCategories.mjs.map +1 -1
  309. package/dist/esm/helpers/tokenCategories.native.js +12 -74
  310. package/dist/esm/helpers/tokenCategories.native.js.map +1 -1
  311. package/dist/esm/helpers/variableValue.mjs +17 -12
  312. package/dist/esm/helpers/variableValue.mjs.map +1 -1
  313. package/dist/esm/helpers/variableValue.native.js +46 -23
  314. package/dist/esm/helpers/variableValue.native.js.map +1 -1
  315. package/dist/esm/helpers/warnOnce.mjs +5 -4
  316. package/dist/esm/helpers/warnOnce.mjs.map +1 -1
  317. package/dist/esm/helpers/warnOnce.native.js +6 -4
  318. package/dist/esm/helpers/warnOnce.native.js.map +1 -1
  319. package/dist/esm/hooks/useAnimationDriver.mjs +2 -2
  320. package/dist/esm/hooks/useAnimationDriver.mjs.map +1 -1
  321. package/dist/esm/hooks/useAnimationDriver.native.js +2 -2
  322. package/dist/esm/hooks/useAnimationDriver.native.js.map +1 -1
  323. package/dist/esm/hooks/useComponentState.mjs +41 -82
  324. package/dist/esm/hooks/useComponentState.mjs.map +1 -1
  325. package/dist/esm/hooks/useComponentState.native.js +45 -84
  326. package/dist/esm/hooks/useComponentState.native.js.map +1 -1
  327. package/dist/esm/hooks/useMedia.mjs +2 -2
  328. package/dist/esm/hooks/useMedia.mjs.map +1 -1
  329. package/dist/esm/hooks/useMedia.native.js +2 -2
  330. package/dist/esm/hooks/useMedia.native.js.map +1 -1
  331. package/dist/esm/hooks/useSplitStyles.mjs +2 -2
  332. package/dist/esm/hooks/useSplitStyles.mjs.map +1 -1
  333. package/dist/esm/hooks/useSplitStyles.native.js +2 -2
  334. package/dist/esm/hooks/useSplitStyles.native.js.map +1 -1
  335. package/dist/esm/hooks/useStyle.mjs +11 -0
  336. package/dist/esm/hooks/useStyle.mjs.map +1 -0
  337. package/dist/esm/hooks/useStyle.native.js +11 -0
  338. package/dist/esm/hooks/useStyle.native.js.map +1 -0
  339. package/dist/esm/hooks/useThemeState.mjs +25 -90
  340. package/dist/esm/hooks/useThemeState.mjs.map +1 -1
  341. package/dist/esm/hooks/useThemeState.native.js +34 -94
  342. package/dist/esm/hooks/useThemeState.native.js.map +1 -1
  343. package/dist/esm/index.js +8 -8
  344. package/dist/esm/index.mjs +8 -8
  345. package/dist/esm/index.native.js +8 -8
  346. package/dist/esm/internal-runtime.mjs +8 -7
  347. package/dist/esm/internal-runtime.mjs.map +1 -1
  348. package/dist/esm/internal-runtime.native.js +8 -7
  349. package/dist/esm/internal-runtime.native.js.map +1 -1
  350. package/dist/esm/static-resolve.mjs +11 -9
  351. package/dist/esm/static-resolve.mjs.map +1 -1
  352. package/dist/esm/static-resolve.native.js +11 -9
  353. package/dist/esm/static-resolve.native.js.map +1 -1
  354. package/dist/esm/style.mjs +58 -0
  355. package/dist/esm/style.mjs.map +1 -0
  356. package/dist/esm/style.native.js +63 -0
  357. package/dist/esm/style.native.js.map +1 -0
  358. package/dist/esm/styled.mjs +17 -62
  359. package/dist/esm/styled.mjs.map +1 -1
  360. package/dist/esm/styled.native.js +17 -64
  361. package/dist/esm/styled.native.js.map +1 -1
  362. package/dist/esm/types.mjs +3 -21
  363. package/dist/esm/types.mjs.map +1 -1
  364. package/dist/esm/types.native.js +3 -21
  365. package/dist/esm/types.native.js.map +1 -1
  366. package/dist/esm/views/TamaguiProvider.mjs +1 -2
  367. package/dist/esm/views/TamaguiProvider.mjs.map +1 -1
  368. package/dist/esm/views/TamaguiProvider.native.js +1 -2
  369. package/dist/esm/views/TamaguiProvider.native.js.map +1 -1
  370. package/dist/esm/views/Text.mjs +21 -14
  371. package/dist/esm/views/Text.mjs.map +1 -1
  372. package/dist/esm/views/Text.native.js +4 -2
  373. package/dist/esm/views/Text.native.js.map +1 -1
  374. package/dist/esm/views/Theme.mjs +2 -2
  375. package/dist/esm/views/Theme.mjs.map +1 -1
  376. package/dist/esm/views/Theme.native.js +2 -2
  377. package/dist/esm/views/Theme.native.js.map +1 -1
  378. package/dist/esm/views/ThemeDebug.mjs +1 -4
  379. package/dist/esm/views/ThemeDebug.mjs.map +1 -1
  380. package/dist/esm/views/View.mjs +4 -2
  381. package/dist/esm/views/View.mjs.map +1 -1
  382. package/dist/esm/views/View.native.js +4 -2
  383. package/dist/esm/views/View.native.js.map +1 -1
  384. package/package.json +15 -15
  385. package/src/config.ts +1 -1
  386. package/src/createComponent.tsx +62 -31
  387. package/src/createStyledHOC.tsx +56 -9
  388. package/src/createTokens.ts +1 -1
  389. package/src/createVariable.ts +0 -10
  390. package/src/dom/html.tsx +778 -877
  391. package/src/dom/htmlRuntime.native.tsx +7 -3
  392. package/src/dom/primitives.native.tsx +30 -39
  393. package/src/helpers/borderComponents.ts +62 -0
  394. package/src/helpers/componentDisplayName.ts +0 -11
  395. package/src/helpers/createDesignSystem.ts +0 -2
  396. package/src/helpers/createStyledContext.tsx +15 -53
  397. package/src/helpers/formatDiagnostic.ts +11 -13
  398. package/src/helpers/getCSSStylesAtomic.native.ts +6 -3
  399. package/src/helpers/getCSSStylesAtomic.ts +197 -206
  400. package/src/helpers/getCSSStylesAtomicCompiled.ts +13 -1
  401. package/src/helpers/getDynamicVal.ts +4 -0
  402. package/src/helpers/getSplitStyles.tsx +2058 -4052
  403. package/src/helpers/grammarConfig.ts +218 -1
  404. package/src/helpers/insertStyleRule.tsx +4 -2
  405. package/src/helpers/log.ts +12 -11
  406. package/src/helpers/mergeVariants.ts +55 -18
  407. package/src/helpers/nativeOnlyProps.ts +0 -1
  408. package/src/helpers/nativeStyleEngine.ts +55 -14
  409. package/src/helpers/normalizeValueWithProperty.ts +10 -12
  410. package/src/helpers/parseBorderShorthand.native.ts +23 -45
  411. package/src/helpers/parseOutlineShorthand.native.ts +9 -40
  412. package/src/helpers/resolveSafeArea.ts +34 -101
  413. package/src/helpers/resolveVariantStyle.ts +77 -0
  414. package/src/helpers/splitStyleProps.ts +166 -0
  415. package/src/helpers/styleFrontend.ts +16 -9
  416. package/src/helpers/styleStaticConfig.ts +21 -0
  417. package/src/helpers/styleStaticConfigCore.ts +110 -0
  418. package/src/helpers/styledDynamic.ts +191 -0
  419. package/src/helpers/tokenCategories.ts +32 -88
  420. package/src/helpers/variableValue.ts +20 -15
  421. package/src/helpers/warnOnce.ts +5 -4
  422. package/src/hooks/useAnimationDriver.ts +6 -2
  423. package/src/hooks/useComponentState.ts +55 -183
  424. package/src/hooks/useMedia.tsx +10 -8
  425. package/src/hooks/useSplitStyles.tsx +17 -2
  426. package/src/hooks/useStyle.ts +10 -0
  427. package/src/hooks/useTheme.tsx +1 -1
  428. package/src/hooks/useThemeState.ts +51 -264
  429. package/src/index.ts +14 -10
  430. package/src/internal-runtime.ts +10 -9
  431. package/src/internalRuntimeTypes.ts +1 -0
  432. package/src/static-resolve.ts +25 -18
  433. package/src/style.ts +97 -0
  434. package/src/styled.tsx +46 -332
  435. package/src/types.tsx +107 -192
  436. package/src/views/TamaguiProvider.tsx +0 -2
  437. package/src/views/Text.tsx +26 -21
  438. package/src/views/Theme.tsx +10 -8
  439. package/src/views/ThemeDebug.tsx +0 -1
  440. package/src/views/View.tsx +6 -7
  441. package/types/createComponent.d.ts.map +1 -1
  442. package/types/createStyledHOC.d.ts.map +1 -1
  443. package/types/createVariable.d.ts +0 -2
  444. package/types/createVariable.d.ts.map +1 -1
  445. package/types/dom/html.d.ts.map +1 -1
  446. package/types/dom/htmlRuntime.native.d.ts.map +1 -1
  447. package/types/dom/primitives.native.d.ts.map +1 -1
  448. package/types/helpers/borderComponents.d.ts +10 -0
  449. package/types/helpers/borderComponents.d.ts.map +1 -0
  450. package/types/helpers/componentDisplayName.d.ts +0 -3
  451. package/types/helpers/componentDisplayName.d.ts.map +1 -1
  452. package/types/helpers/createDesignSystem.d.ts.map +1 -1
  453. package/types/helpers/createStyledContext.d.ts.map +1 -1
  454. package/types/helpers/formatDiagnostic.d.ts.map +1 -1
  455. package/types/helpers/getCSSStylesAtomic.d.ts +25 -22
  456. package/types/helpers/getCSSStylesAtomic.d.ts.map +1 -1
  457. package/types/helpers/getCSSStylesAtomic.native.d.ts +5 -0
  458. package/types/helpers/getCSSStylesAtomic.native.d.ts.map +1 -1
  459. package/types/helpers/getCSSStylesAtomicCompiled.d.ts +6 -1
  460. package/types/helpers/getCSSStylesAtomicCompiled.d.ts.map +1 -1
  461. package/types/helpers/getDynamicVal.d.ts.map +1 -1
  462. package/types/helpers/getSplitStyles.d.ts +9 -11
  463. package/types/helpers/getSplitStyles.d.ts.map +1 -1
  464. package/types/helpers/grammarConfig.d.ts +25 -2
  465. package/types/helpers/grammarConfig.d.ts.map +1 -1
  466. package/types/helpers/insertStyleRule.d.ts +1 -0
  467. package/types/helpers/insertStyleRule.d.ts.map +1 -1
  468. package/types/helpers/log.d.ts.map +1 -1
  469. package/types/helpers/mergeVariants.d.ts.map +1 -1
  470. package/types/helpers/nativeOnlyProps.d.ts +0 -1
  471. package/types/helpers/nativeOnlyProps.d.ts.map +1 -1
  472. package/types/helpers/nativeStyleEngine.d.ts +6 -0
  473. package/types/helpers/nativeStyleEngine.d.ts.map +1 -1
  474. package/types/helpers/normalizeValueWithProperty.d.ts.map +1 -1
  475. package/types/helpers/parseBorderShorthand.native.d.ts +1 -0
  476. package/types/helpers/parseBorderShorthand.native.d.ts.map +1 -1
  477. package/types/helpers/parseOutlineShorthand.native.d.ts.map +1 -1
  478. package/types/helpers/resolveSafeArea.d.ts +0 -1
  479. package/types/helpers/resolveSafeArea.d.ts.map +1 -1
  480. package/types/helpers/resolveVariantStyle.d.ts +3 -0
  481. package/types/helpers/resolveVariantStyle.d.ts.map +1 -0
  482. package/types/helpers/splitStyleProps.d.ts +44 -0
  483. package/types/helpers/splitStyleProps.d.ts.map +1 -0
  484. package/types/helpers/styleFrontend.d.ts +7 -9
  485. package/types/helpers/styleFrontend.d.ts.map +1 -1
  486. package/types/helpers/styleStaticConfig.d.ts +14 -0
  487. package/types/helpers/styleStaticConfig.d.ts.map +1 -0
  488. package/types/helpers/styleStaticConfigCore.d.ts +4 -0
  489. package/types/helpers/styleStaticConfigCore.d.ts.map +1 -0
  490. package/types/helpers/styledDynamic.d.ts +18 -0
  491. package/types/helpers/styledDynamic.d.ts.map +1 -0
  492. package/types/helpers/tokenCategories.d.ts +0 -1
  493. package/types/helpers/tokenCategories.d.ts.map +1 -1
  494. package/types/helpers/variableValue.d.ts.map +1 -1
  495. package/types/helpers/warnOnce.d.ts.map +1 -1
  496. package/types/helpers/webPropsToSkip.native.d.ts +68 -68
  497. package/types/hooks/useAnimationDriver.d.ts.map +1 -1
  498. package/types/hooks/useComponentState.d.ts.map +1 -1
  499. package/types/hooks/useMedia.d.ts.map +1 -1
  500. package/types/hooks/useSplitStyles.d.ts.map +1 -1
  501. package/types/hooks/useStyle.d.ts +4 -0
  502. package/types/hooks/useStyle.d.ts.map +1 -0
  503. package/types/hooks/useThemeState.d.ts +1 -11
  504. package/types/hooks/useThemeState.d.ts.map +1 -1
  505. package/types/index.d.ts +8 -8
  506. package/types/index.d.ts.map +1 -1
  507. package/types/internal-runtime.d.ts.map +1 -1
  508. package/types/internalRuntimeTypes.d.ts +1 -1
  509. package/types/internalRuntimeTypes.d.ts.map +1 -1
  510. package/types/static-resolve.d.ts +2 -2
  511. package/types/static-resolve.d.ts.map +1 -1
  512. package/types/style.d.ts +18 -0
  513. package/types/style.d.ts.map +1 -0
  514. package/types/styled.d.ts +12 -48
  515. package/types/styled.d.ts.map +1 -1
  516. package/types/types.d.ts +75 -60
  517. package/types/types.d.ts.map +1 -1
  518. package/types/views/TamaguiProvider.d.ts +1 -1
  519. package/types/views/TamaguiProvider.d.ts.map +1 -1
  520. package/types/views/Text.d.ts.map +1 -1
  521. package/types/views/Theme.d.ts.map +1 -1
  522. package/types/views/ThemeDebug.d.ts.map +1 -1
  523. package/types/views/View.d.ts.map +1 -1
  524. package/dist/cjs/helpers/directStyleCSS.cjs +0 -348
  525. package/dist/cjs/helpers/directStyleCSS.native.cjs +0 -20
  526. package/dist/cjs/helpers/directStyleCSS.native.js.map +0 -1
  527. package/dist/cjs/helpers/directStyleCSSCompiled.cjs +0 -40
  528. package/dist/cjs/helpers/directStyleCSSCompiled.native.cjs +0 -46
  529. package/dist/cjs/helpers/directStyleCSSCompiled.native.js +0 -48
  530. package/dist/cjs/helpers/directStyleCSSCompiled.native.js.map +0 -1
  531. package/dist/cjs/helpers/getDefaultProps.native.js.map +0 -1
  532. package/dist/cjs/helpers/getVariantExtras.cjs +0 -91
  533. package/dist/cjs/helpers/getVariantExtras.native.cjs +0 -94
  534. package/dist/cjs/helpers/getVariantExtras.native.js +0 -96
  535. package/dist/cjs/helpers/getVariantExtras.native.js.map +0 -1
  536. package/dist/cjs/helpers/themeable.cjs +0 -92
  537. package/dist/cjs/helpers/themeable.native.cjs +0 -95
  538. package/dist/cjs/helpers/themeable.native.js +0 -97
  539. package/dist/cjs/helpers/themeable.native.js.map +0 -1
  540. package/dist/cjs/hooks/useProps.cjs +0 -129
  541. package/dist/cjs/hooks/useProps.native.cjs +0 -135
  542. package/dist/cjs/hooks/useProps.native.js +0 -137
  543. package/dist/cjs/hooks/useProps.native.js.map +0 -1
  544. package/dist/esm/helpers/directStyleCSS.mjs +0 -320
  545. package/dist/esm/helpers/directStyleCSS.mjs.map +0 -1
  546. package/dist/esm/helpers/directStyleCSS.native.js +0 -1
  547. package/dist/esm/helpers/directStyleCSSCompiled.mjs +0 -11
  548. package/dist/esm/helpers/directStyleCSSCompiled.mjs.map +0 -1
  549. package/dist/esm/helpers/directStyleCSSCompiled.native.js +0 -15
  550. package/dist/esm/helpers/directStyleCSSCompiled.native.js.map +0 -1
  551. package/dist/esm/helpers/getDefaultProps.mjs +0 -4
  552. package/dist/esm/helpers/getDefaultProps.mjs.map +0 -1
  553. package/dist/esm/helpers/getDefaultProps.native.js +0 -6
  554. package/dist/esm/helpers/getDefaultProps.native.js.map +0 -1
  555. package/dist/esm/helpers/getVariantExtras.mjs +0 -69
  556. package/dist/esm/helpers/getVariantExtras.mjs.map +0 -1
  557. package/dist/esm/helpers/getVariantExtras.native.js +0 -70
  558. package/dist/esm/helpers/getVariantExtras.native.js.map +0 -1
  559. package/dist/esm/helpers/themeable.mjs +0 -67
  560. package/dist/esm/helpers/themeable.mjs.map +0 -1
  561. package/dist/esm/helpers/themeable.native.js +0 -68
  562. package/dist/esm/helpers/themeable.native.js.map +0 -1
  563. package/dist/esm/hooks/useProps.mjs +0 -100
  564. package/dist/esm/hooks/useProps.mjs.map +0 -1
  565. package/dist/esm/hooks/useProps.native.js +0 -104
  566. package/dist/esm/hooks/useProps.native.js.map +0 -1
  567. package/src/helpers/directStyleCSS.native.ts +0 -1
  568. package/src/helpers/directStyleCSS.ts +0 -534
  569. package/src/helpers/directStyleCSSCompiled.ts +0 -32
  570. package/src/helpers/getDefaultProps.ts +0 -3
  571. package/src/helpers/getVariantExtras.tsx +0 -95
  572. package/src/helpers/themeable.tsx +0 -96
  573. package/src/hooks/useProps.tsx +0 -186
  574. package/types/helpers/directStyleCSS.d.ts +0 -28
  575. package/types/helpers/directStyleCSS.d.ts.map +0 -1
  576. package/types/helpers/directStyleCSS.native.d.ts +0 -2
  577. package/types/helpers/directStyleCSS.native.d.ts.map +0 -1
  578. package/types/helpers/directStyleCSSCompiled.d.ts +0 -10
  579. package/types/helpers/directStyleCSSCompiled.d.ts.map +0 -1
  580. package/types/helpers/getDefaultProps.d.ts +0 -3
  581. package/types/helpers/getDefaultProps.d.ts.map +0 -1
  582. package/types/helpers/getVariantExtras.d.ts +0 -4
  583. package/types/helpers/getVariantExtras.d.ts.map +0 -1
  584. package/types/helpers/themeable.d.ts +0 -3
  585. package/types/helpers/themeable.d.ts.map +0 -1
  586. package/types/hooks/useProps.d.ts +0 -39
  587. package/types/hooks/useProps.d.ts.map +0 -1
@@ -1,37 +1,44 @@
1
1
  import { stylePropsTextOnly, validStyles } from "@tamagui/helpers";
2
2
  import { createComponent } from "../createComponent.mjs";
3
- import { setComponentDisplayName } from "../helpers/componentDisplayName.mjs";
3
+ import { styledDynamic } from "../helpers/styledDynamic.mjs";
4
4
 
5
- const ellipsisStyle = {
6
- maxWidth: "100%",
7
- overflow: "hidden",
8
- textOverflow: "ellipsis",
9
- whiteSpace: "nowrap"
10
- };
11
5
  const textStaticConfig = {
12
6
  acceptsClassName: true,
13
7
  isText: true,
14
8
  defaultProps: void 0,
15
9
  inlineProps: /* @__PURE__ */ new Set(["maxFontSizeMultiplier"]),
16
10
  variants: {
17
- numberOfLines: {
18
- 1: ellipsisStyle,
19
- 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 ? {
20
19
  maxWidth: "100%",
21
20
  WebkitLineClamp: numberOfLines,
22
21
  WebkitBoxOrient: "vertical",
23
22
  display: "-webkit-box",
24
23
  overflow: "hidden"
25
- } : null
26
- },
27
- ellipsis: { true: ellipsisStyle }
24
+ } : null;
25
+ }),
26
+ ellipsis: { true: {
27
+ maxWidth: "100%",
28
+ overflow: "hidden",
29
+ textOverflow: "ellipsis",
30
+ whiteSpace: "nowrap"
31
+ } }
28
32
  },
29
33
  validStyles: {
30
34
  ...validStyles,
31
35
  ...stylePropsTextOnly
32
36
  }
33
37
  };
34
- const Text = setComponentDisplayName(createComponent(textStaticConfig), "Text");
38
+ const Text = createComponent({
39
+ ...textStaticConfig,
40
+ displayName: "Text"
41
+ });
35
42
 
36
43
  export { Text, textStaticConfig };
37
44
  //# sourceMappingURL=Text.mjs.map
@@ -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\";\nimport { setComponentDisplayName } from \"../helpers/componentDisplayName\";\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 = setComponentDisplayName(createComponent(textStaticConfig), \"Text\");\n\nexport { Text, textStaticConfig };"],"mappings":";;;;;AAIA,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,wBAAwB,gBAAgB,gBAAgB,GAAG,MAAM"}
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"}
@@ -1,6 +1,5 @@
1
1
  import { stylePropsTextOnly, validStyles } from "@tamagui/helpers";
2
2
  import { createComponent } from "../createComponent.native.js";
3
- import { setComponentDisplayName } from "../helpers/componentDisplayName.native.js";
4
3
 
5
4
  var textStaticConfig = {
6
5
  acceptsClassName: true,
@@ -16,7 +15,10 @@ var textStaticConfig = {
16
15
  ...stylePropsTextOnly
17
16
  }
18
17
  };
19
- var Text = setComponentDisplayName(createComponent(textStaticConfig), "Text");
18
+ var Text = createComponent({
19
+ ...textStaticConfig,
20
+ displayName: "Text"
21
+ });
20
22
 
21
23
  export { Text, textStaticConfig };
22
24
  //# sourceMappingURL=Text.native.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Text.native.js","names":[],"sources":["esm/views/Text.native.js"],"sourcesContent":["import { stylePropsTextOnly, validStyles } from \"@tamagui/helpers\";\nimport { createComponent } from \"../createComponent\";\nimport { setComponentDisplayName } from \"../helpers/componentDisplayName\";\n\nvar textStaticConfig = {\n\tacceptsClassName: true,\n\tisText: true,\n\tdefaultProps: { suppressHighlighting: true },\n\tinlineProps: /* @__PURE__ */ new Set([\"maxFontSizeMultiplier\"]),\n\tvariants: { ellipsis: { true: {\n\t\tnumberOfLines: 1,\n\t\tlineBreakMode: \"clip\"\n\t} } },\n\tvalidStyles: {\n\t\t...validStyles,\n\t\t...stylePropsTextOnly\n\t}\n};\nvar Text = setComponentDisplayName(createComponent(textStaticConfig), \"Text\");\n\nexport { Text, textStaticConfig };"],"mappings":";;;;;AAIA,IAAI,mBAAmB;CACtB,kBAAkB;CAClB,QAAQ;CACR,cAAc,EAAE,sBAAsB,KAAK;CAC3C,6BAA6B,IAAI,IAAI,CAAC,uBAAuB,CAAC;CAC9D,UAAU,EAAE,UAAU,EAAE,MAAM;EAC7B,eAAe;EACf,eAAe;CAChB,EAAE,EAAE;CACJ,aAAa;EACZ,GAAG;EACH,GAAG;CACJ;AACD;AACA,IAAI,OAAO,wBAAwB,gBAAgB,gBAAgB,GAAG,MAAM"}
1
+ {"version":3,"file":"Text.native.js","names":[],"sources":["esm/views/Text.native.js"],"sourcesContent":["import { stylePropsTextOnly, validStyles } from \"@tamagui/helpers\";\nimport { createComponent } from \"../createComponent\";\n\nvar textStaticConfig = {\n\tacceptsClassName: true,\n\tisText: true,\n\tdefaultProps: { suppressHighlighting: true },\n\tinlineProps: /* @__PURE__ */ new Set([\"maxFontSizeMultiplier\"]),\n\tvariants: { ellipsis: { true: {\n\t\tnumberOfLines: 1,\n\t\tlineBreakMode: \"clip\"\n\t} } },\n\tvalidStyles: {\n\t\t...validStyles,\n\t\t...stylePropsTextOnly\n\t}\n};\nvar Text = createComponent({\n\t...textStaticConfig,\n\tdisplayName: \"Text\"\n});\n\nexport { Text, textStaticConfig };"],"mappings":";;;;AAGA,IAAI,mBAAmB;CACtB,kBAAkB;CAClB,QAAQ;CACR,cAAc,EAAE,sBAAsB,KAAK;CAC3C,6BAA6B,IAAI,IAAI,CAAC,uBAAuB,CAAC;CAC9D,UAAU,EAAE,UAAU,EAAE,MAAM;EAC7B,eAAe;EACf,eAAe;CAChB,EAAE,EAAE;CACJ,aAAa;EACZ,GAAG;EACH,GAAG;CACJ;AACD;AACA,IAAI,OAAO,gBAAgB;CAC1B,GAAG;CACH,aAAa;AACd,CAAC"}
@@ -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,IAAI,QAAQ,IAAI,aAAa,eAAe;EAC3C,KAAK,MAAM,OAAO,OAAO,IAAI,CAAC,mBAAmB,MAAM,SAAS,gBAAgB,OAAO,UAAU,IAAI,0EAA0E,IAAI,eAAe;CACnM;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,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M,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]) 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,MAAM,SAAS,gBAAgB,OAAO,UAAU,IAAI,0EAA0E,IAAI,eAAe;CACnM;CACA,MAAM,EAAE,gBAAgB;CACxB,MAAM,SAA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AAS;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"}
@@ -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,mBAAm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AAQ,wBAAwB,KAAK,IAAI,KAAK,IAAI,oBAAoB;EAClK,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,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]) 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,MAAM,SAAS,gBAAgB,OAAO,UAAU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AAQ,wBAAwB,KAAK,IAAI,KAAK,IAAI,oBAAoB;EAClK,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,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,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],"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=Them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AAiB"}
@@ -1,12 +1,14 @@
1
1
  import { validStyles } from "@tamagui/helpers";
2
2
  import { createComponent } from "../createComponent.mjs";
3
- import { setComponentDisplayName } from "../helpers/componentDisplayName.mjs";
4
3
 
5
4
  const viewStaticConfig = {
6
5
  acceptsClassName: true,
7
6
  validStyles
8
7
  };
9
- const View = setComponentDisplayName(createComponent(viewStaticConfig), "View");
8
+ const View = createComponent({
9
+ ...viewStaticConfig,
10
+ displayName: "View"
11
+ });
10
12
 
11
13
  export { View, viewStaticConfig };
12
14
  //# sourceMappingURL=View.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"View.js","names":[],"sources":["esm/views/View.js"],"sourcesContent":["import { validStyles } from \"@tamagui/helpers\";\nimport { createComponent } from \"../createComponent\";\nimport { setComponentDisplayName } from \"../helpers/componentDisplayName\";\nconst viewStaticConfig = {\n acceptsClassName: true,\n validStyles\n};\nconst View = setComponentDisplayName(\n createComponent(\n viewStaticConfig\n ),\n \"View\"\n);\nexport {\n View,\n viewStaticConfig\n};\n//# sourceMappingURL=View.js.map\n"],"mappings":";;;;;AAGA,MAAM,mBAAmB;CACvB,kBAAkB;CAClB;AACF;AACA,MAAM,OAAO,wBACX,gBACE,gBACF,GACA,MACF"}
1
+ {"version":3,"file":"View.js","names":[],"sources":["esm/views/View.js"],"sourcesContent":["import { validStyles } from \"@tamagui/helpers\";\nimport { createComponent } from \"../createComponent\";\nconst viewStaticConfig = {\n acceptsClassName: true,\n validStyles\n};\nconst View = createComponent({ ...viewStaticConfig, displayName: \"View\" });\nexport {\n View,\n viewStaticConfig\n};\n//# sourceMappingURL=View.js.map\n"],"mappings":";;;;AAEA,MAAM,mBAAmB;CACvB,kBAAkB;CAClB;AACF;AACA,MAAM,OAAO,gBAAgB;CAAE,GAAG;CAAkB,aAAa;AAAO,CAAC"}
@@ -1,12 +1,14 @@
1
1
  import { validStyles } from "@tamagui/helpers";
2
2
  import { createComponent } from "../createComponent.native.js";
3
- import { setComponentDisplayName } from "../helpers/componentDisplayName.native.js";
4
3
 
5
4
  var viewStaticConfig = {
6
5
  acceptsClassName: true,
7
6
  validStyles
8
7
  };
9
- var View = setComponentDisplayName(createComponent(viewStaticConfig), "View");
8
+ var View = createComponent({
9
+ ...viewStaticConfig,
10
+ displayName: "View"
11
+ });
10
12
 
11
13
  export { View, viewStaticConfig };
12
14
  //# sourceMappingURL=View.native.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"View.native.js","names":[],"sources":["esm/views/View.native.js"],"sourcesContent":["import { validStyles } from \"@tamagui/helpers\";\nimport { createComponent } from \"../createComponent\";\nimport { setComponentDisplayName } from \"../helpers/componentDisplayName\";\nvar viewStaticConfig = {\n acceptsClassName: true,\n validStyles\n};\nvar View = setComponentDisplayName(createComponent(viewStaticConfig), \"View\");\nexport {\n View,\n viewStaticConfig\n};\n//# sourceMappingURL=View.js.map\n"],"mappings":";;;;;AAGA,IAAI,mBAAmB;CACrB,kBAAkB;CAClB;AACF;AACA,IAAI,OAAO,wBAAwB,gBAAgB,gBAAgB,GAAG,MAAM"}
1
+ {"version":3,"file":"View.native.js","names":[],"sources":["esm/views/View.native.js"],"sourcesContent":["import { validStyles } from \"@tamagui/helpers\";\nimport { createComponent } from \"../createComponent\";\nvar viewStaticConfig = {\n acceptsClassName: true,\n validStyles\n};\nvar View = createComponent({\n ...viewStaticConfig,\n displayName: \"View\"\n});\nexport {\n View,\n viewStaticConfig\n};\n//# sourceMappingURL=View.js.map\n"],"mappings":";;;;AAEA,IAAI,mBAAmB;CACrB,kBAAkB;CAClB;AACF;AACA,IAAI,OAAO,gBAAgB;CACzB,GAAG;CACH,aAAa;AACf,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/web",
3
- "version": "3.0.0-beta.807.1",
3
+ "version": "3.0.0-beta.881.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.807.1",
104
- "@tamagui/constants": "3.0.0-beta.807.1",
105
- "@tamagui/dom": "3.0.0-beta.807.1",
106
- "@tamagui/helpers": "3.0.0-beta.807.1",
107
- "@tamagui/is-equal-shallow": "3.0.0-beta.807.1",
108
- "@tamagui/native": "3.0.0-beta.807.1",
109
- "@tamagui/normalize-css-color": "3.0.0-beta.807.1",
110
- "@tamagui/style-grammar": "3.0.0-beta.807.1",
111
- "@tamagui/timer": "3.0.0-beta.807.1",
112
- "@tamagui/types": "3.0.0-beta.807.1",
113
- "@tamagui/use-did-finish-ssr": "3.0.0-beta.807.1",
114
- "@tamagui/use-event": "3.0.0-beta.807.1",
115
- "@tamagui/use-force-update": "3.0.0-beta.807.1"
103
+ "@tamagui/compose-refs": "3.0.0-beta.881.1",
104
+ "@tamagui/constants": "3.0.0-beta.881.1",
105
+ "@tamagui/dom": "3.0.0-beta.881.1",
106
+ "@tamagui/helpers": "3.0.0-beta.881.1",
107
+ "@tamagui/is-equal-shallow": "3.0.0-beta.881.1",
108
+ "@tamagui/native": "3.0.0-beta.881.1",
109
+ "@tamagui/normalize-css-color": "3.0.0-beta.881.1",
110
+ "@tamagui/style-grammar": "3.0.0-beta.881.1",
111
+ "@tamagui/timer": "3.0.0-beta.881.1",
112
+ "@tamagui/types": "3.0.0-beta.881.1",
113
+ "@tamagui/use-did-finish-ssr": "3.0.0-beta.881.1",
114
+ "@tamagui/use-event": "3.0.0-beta.881.1",
115
+ "@tamagui/use-force-update": "3.0.0-beta.881.1"
116
116
  },
117
117
  "devDependencies": {
118
- "@tamagui/build": "3.0.0-beta.807.1",
118
+ "@tamagui/build": "3.0.0-beta.881.1",
119
119
  "@testing-library/react": "^16.1.0",
120
120
  "csstype": "^3.0.10",
121
121
  "react": "19.2.3",
package/src/config.ts CHANGED
@@ -169,7 +169,7 @@ export const getThemes = () => getConfigFromGlobalOrLocal()!.themes
169
169
  export const updateConfig = (key: string, value: any) => {
170
170
  // for usage internally only
171
171
  const config = getConfigFromGlobalOrLocal()
172
- if (!config || !Object.prototype.hasOwnProperty.call(config, key)) {
172
+ if (!config || key === '__proto__' || !(key in config)) {
173
173
  return
174
174
  }
175
175
  Object.assign(config[key], value)
@@ -19,9 +19,10 @@ import { GroupContext } from './contexts/GroupContext'
19
19
  import { didGetVariableValue, setDidGetVariableValue } from './createVariable'
20
20
  import { defaultComponentStateMounted } from './defaultComponentState'
21
21
  import { getWebEvents, useEvents, wrapWithGestureDetector } from './eventHandling'
22
- import { getDefaultProps } from './helpers/getDefaultProps'
23
22
  import { componentDisplayName } from './helpers/componentDisplayName'
24
- import { getSplitStyles, prepareStyleStaticConfig } from './helpers/getSplitStyles'
23
+ import { getSplitStyles } from './helpers/getSplitStyles'
24
+ import { getConfigRevisionState } from './helpers/grammarConfig'
25
+ import { getStyleStaticConfig, type StyleStaticConfig } from './helpers/styleStaticConfig'
25
26
  import {
26
27
  getNativeStyleEngine,
27
28
  queueNativeViewState,
@@ -263,20 +264,16 @@ export function createComponent<
263
264
  // a const, a config read) makes it unfoldable.
264
265
  if (process.env.TAMAGUI_RUNTIME === 'zero') {
265
266
  throw new Error(
266
- `[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'
267
270
  )
268
271
  }
269
272
 
270
- prepareStyleStaticConfig(staticConfig)
271
-
272
273
  let config: TamaguiInternalConfig | null = null
273
274
  let resolvedDefaultProps: Record<string, any> | undefined
274
- let didResolveDefaultProps = false
275
- const styledContextPropKeys =
276
- staticConfig.contextProps || staticConfig.context?.propKeys
277
- const styledContextKeys = styledContextPropKeys
278
- ? new Set(styledContextPropKeys)
279
- : undefined
275
+ let resolvedStyleRevision = -1
276
+ let resolvedStyleStaticConfig: StyleStaticConfig | undefined
280
277
 
281
278
  const { Component, isText, isHOC } = staticConfig
282
279
 
@@ -290,11 +287,11 @@ export function createComponent<
290
287
 
291
288
  let res: ComponentType
292
289
 
290
+ const { displayName } = staticConfig
291
+
293
292
  const component = (propsInWithRef: ComponentPropTypes & { ref?: React.Ref<Ref> }) => {
294
293
  'use no memo'
295
294
 
296
- const displayName = (res as any)[componentDisplayName] as string | undefined
297
-
298
295
  // read the forwarded ref directly off the incoming props — do NOT clone the
299
296
  // whole object every render just to strip `ref`. the original props object is
300
297
  // passed straight through; `ref` is skipped in the getSplitStyles pass (so it
@@ -305,6 +302,29 @@ export function createComponent<
305
302
 
306
303
  config = config || getConfig()
307
304
 
305
+ const styleRevision = getConfigRevisionState(config).revision
306
+ if (resolvedStyleRevision !== styleRevision) {
307
+ resolvedStyleRevision = styleRevision
308
+ const nextStyleStaticConfig = getStyleStaticConfig(staticConfig, config)
309
+ resolvedStyleStaticConfig = nextStyleStaticConfig
310
+ resolvedDefaultProps = nextStyleStaticConfig.defaultProps
311
+ // the relative-position default is a style, so it joins the base layer
312
+ // under everything the call site writes
313
+ if (
314
+ isWeb &&
315
+ !staticConfig.isText &&
316
+ config.settings.defaultPosition === 'relative' &&
317
+ nextStyleStaticConfig.baseStyle?.position === undefined
318
+ ) {
319
+ resolvedStyleStaticConfig = {
320
+ ...nextStyleStaticConfig,
321
+ baseStyle: { position: 'relative', ...nextStyleStaticConfig.baseStyle },
322
+ }
323
+ }
324
+ }
325
+ const styleStaticConfig = resolvedStyleStaticConfig!
326
+ const styledContextKeys = styleStaticConfig.styledContextKeys
327
+
308
328
  const internalID = process.env.NODE_ENV === 'development' ? React.useId() : ''
309
329
 
310
330
  if (process.env.NODE_ENV === 'development') {
@@ -386,20 +406,6 @@ export function createComponent<
386
406
  let props: ViewProps | TextProps = propsIn
387
407
 
388
408
  // merge both default props and styled context props - ensure order is preserved
389
- if (!didResolveDefaultProps) {
390
- didResolveDefaultProps = true
391
- const staticDefaultProps = getDefaultProps(staticConfig)
392
- resolvedDefaultProps =
393
- isWeb &&
394
- !isText &&
395
- config.settings.defaultPosition === 'relative' &&
396
- staticDefaultProps?.position === undefined
397
- ? staticDefaultProps
398
- ? { position: 'relative', ...staticDefaultProps }
399
- : { position: 'relative' }
400
- : staticDefaultProps
401
- }
402
-
403
409
  // merge styled context props over defaults, ensure order is preserved
404
410
  const [nextProps, overrides] = mergeComponentProps(
405
411
  resolvedDefaultProps,
@@ -763,7 +769,6 @@ export function createComponent<
763
769
  canPlatformPseudo: componentState.platformPseudo,
764
770
  displayName,
765
771
  styledContext: styledContextValue,
766
- styledContextKeys,
767
772
  } as const
768
773
 
769
774
  const themeName = themeState?.name || ''
@@ -783,7 +788,8 @@ export function createComponent<
783
788
  elementType,
784
789
  startedUnhydrated,
785
790
  debugProp,
786
- animationDriver
791
+ animationDriver,
792
+ styleStaticConfig
787
793
  )
788
794
 
789
795
  const finalizedComponentState = componentState.finalizeStyleFlags(
@@ -957,7 +963,8 @@ export function createComponent<
957
963
  elementType,
958
964
  startedUnhydrated,
959
965
  debugProp,
960
- animationDriver
966
+ animationDriver,
967
+ styleStaticConfig
961
968
  )
962
969
  if (!nextStyles?.style) return false
963
970
 
@@ -1117,7 +1124,8 @@ export function createComponent<
1117
1124
  elementType,
1118
1125
  startedUnhydrated,
1119
1126
  debugProp,
1120
- animationDriver
1127
+ animationDriver,
1128
+ styleStaticConfig
1121
1129
  )
1122
1130
 
1123
1131
  const effectiveTransition =
@@ -2221,6 +2229,29 @@ export function createComponent<
2221
2229
 
2222
2230
  res.staticConfig = staticConfig
2223
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
+
2250
+ if (displayName) {
2251
+ res.displayName = displayName
2252
+ ;(res as any)[componentDisplayName] = displayName
2253
+ }
2254
+
2224
2255
  return res
2225
2256
  }
2226
2257
 
@@ -1,9 +1,6 @@
1
1
  import React, { type ReactNode, type Ref as ReactRef } from 'react'
2
- import {
3
- componentDisplayName,
4
- setComponentDisplayName,
5
- } from './helpers/componentDisplayName'
6
- import { themeable } from './helpers/themeable'
2
+ import { componentDisplayName } from './helpers/componentDisplayName'
3
+ import { Theme } from './views/Theme'
7
4
  import type {
8
5
  GetFinalProps,
9
6
  StaticConfig,
@@ -11,6 +8,7 @@ import type {
11
8
  StyledHOCOptions,
12
9
  TamaguiComponent,
13
10
  TamaDefer,
11
+ ThemeProps,
14
12
  } from './types'
15
13
 
16
14
  export function createStyledHOC<
@@ -70,18 +68,67 @@ export function createStyledHOC<
70
68
  }
71
69
 
72
70
  let out: any = function StyledHOCComponent(props: any) {
71
+ 'use no memo'
72
+
73
73
  const { ref, ...rest } = props
74
- return render(rest, ref)
75
- }
74
+ if (options?.disableTheme) {
75
+ return render(rest, ref)
76
+ }
77
+
78
+ const defaultTheme = extendedConfig.defaultProps?.theme
79
+ const { theme: _, ...themedRest } = rest
80
+ const element = render({ ...themedRest, 'data-disable-theme': true }, ref)
81
+
82
+ let themeProps: Partial<ThemeProps> | null = null
83
+ if ('debug' in props) {
84
+ themeProps = { debug: props.debug }
85
+ }
86
+ if ('theme' in props || defaultTheme) {
87
+ ;(themeProps ||= {}).name = 'theme' in props ? props.theme : defaultTheme
88
+ }
76
89
 
77
- out = options?.disableTheme ? out : themeable(out, extendedConfig, true)
90
+ // keeping the theme key present with a null value keeps the tree stable
91
+ // across theme changes, while an entirely absent key avoids mounting Theme.
92
+ if (!themeProps) {
93
+ return element
94
+ }
95
+
96
+ const context = extendedConfig.context
97
+ if (!context) {
98
+ return (
99
+ <Theme disable-child-theme {...themeProps}>
100
+ {element}
101
+ </Theme>
102
+ )
103
+ }
104
+
105
+ const contextValue = React.useContext(context)
106
+ let overriddenContextProps: object | undefined
107
+ for (const key in context.props) {
108
+ const value = props[key]
109
+ if (value !== undefined) {
110
+ ;(overriddenContextProps ||= {})[key] = value
111
+ }
112
+ }
113
+ const Provider = context.Provider
114
+ return (
115
+ <Provider {...contextValue} {...overriddenContextProps}>
116
+ <Theme disable-child-theme {...themeProps}>
117
+ {element}
118
+ </Theme>
119
+ </Provider>
120
+ )
121
+ }
78
122
 
79
123
  if (extendedConfig.memo || process.env.TAMAGUI_MEMOIZE_STYLED_HOC) {
80
124
  out = React.memo(out)
81
125
  }
82
126
 
83
127
  const displayName = options?.displayName || (component as any)[componentDisplayName]
84
- setComponentDisplayName(out, displayName)
128
+ if (displayName) {
129
+ out.displayName = displayName
130
+ out[componentDisplayName] = displayName
131
+ }
85
132
 
86
133
  out.staticConfig = extendedConfig
87
134
  return out
@@ -13,7 +13,7 @@ function validateNoTrueTokenKeys(tokens: CreateTokens) {
13
13
  const tokenSet = tokens[category]
14
14
  if (!tokenSet || typeof tokenSet !== 'object') continue
15
15
 
16
- if (Object.prototype.hasOwnProperty.call(tokenSet, 'true')) {
16
+ if ('true' in tokenSet) {
17
17
  throw new Error(
18
18
  `tokens.${category}.true is reserved because boolean values select component defaults. Use an explicit token name instead.`
19
19
  )