@tamagui/web 3.0.0-beta.924.1 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (636) hide show
  1. package/dist/cjs/_withNativeStyle.cjs +3 -0
  2. package/dist/cjs/_withNativeStyle.native.cjs +3 -0
  3. package/dist/cjs/_withNativeStyle.native.js +3 -0
  4. package/dist/cjs/_withNativeStyle.native.js.map +1 -1
  5. package/dist/cjs/_withStableStyle.native.cjs +1 -5
  6. package/dist/cjs/_withStableStyle.native.js +1 -5
  7. package/dist/cjs/_withStableStyle.native.js.map +1 -1
  8. package/dist/cjs/config.cjs +6 -3
  9. package/dist/cjs/config.native.cjs +7 -5
  10. package/dist/cjs/config.native.js +7 -5
  11. package/dist/cjs/config.native.js.map +1 -1
  12. package/dist/cjs/contexts/ComponentContext.cjs +1 -0
  13. package/dist/cjs/contexts/ComponentContext.native.cjs +8 -0
  14. package/dist/cjs/contexts/ComponentContext.native.js +8 -0
  15. package/dist/cjs/contexts/ComponentContext.native.js.map +1 -1
  16. package/dist/cjs/createComponent.cjs +46 -32
  17. package/dist/cjs/createComponent.native.cjs +92 -72
  18. package/dist/cjs/createComponent.native.js +92 -72
  19. package/dist/cjs/createComponent.native.js.map +1 -1
  20. package/dist/cjs/createTamagui.cjs +32 -14
  21. package/dist/cjs/createTamagui.native.cjs +33 -19
  22. package/dist/cjs/createTamagui.native.js +33 -19
  23. package/dist/cjs/createTamagui.native.js.map +1 -1
  24. package/dist/cjs/createTokens.native.cjs +1 -5
  25. package/dist/cjs/createTokens.native.js +1 -5
  26. package/dist/cjs/createTokens.native.js.map +1 -1
  27. package/dist/cjs/createVariable.native.cjs +1 -5
  28. package/dist/cjs/createVariable.native.js +1 -5
  29. package/dist/cjs/createVariable.native.js.map +1 -1
  30. package/dist/cjs/createVariables.native.cjs +2 -6
  31. package/dist/cjs/createVariables.native.js +2 -6
  32. package/dist/cjs/createVariables.native.js.map +1 -1
  33. package/dist/cjs/dom/html.cjs +87 -329
  34. package/dist/cjs/dom/html.native.cjs +53 -2
  35. package/dist/cjs/dom/html.native.js +53 -2
  36. package/dist/cjs/dom/html.native.js.map +1 -1
  37. package/dist/cjs/{helpers/timer.native.js → dom/htmlReset.cjs} +6 -12
  38. package/dist/cjs/{helpers/timer.native.cjs → dom/htmlReset.native.cjs} +6 -8
  39. package/dist/cjs/dom/htmlReset.native.js +30 -0
  40. package/dist/cjs/dom/htmlReset.native.js.map +1 -0
  41. package/dist/cjs/dom/htmlRuntime.native.cjs +4 -0
  42. package/dist/cjs/dom/htmlRuntime.native.js +4 -0
  43. package/dist/cjs/dom/htmlRuntime.native.js.map +1 -1
  44. package/dist/cjs/dom/htmlStaticConfig.cjs +44 -0
  45. package/dist/cjs/dom/htmlStaticConfig.native.cjs +46 -0
  46. package/dist/cjs/dom/htmlStaticConfig.native.js +48 -0
  47. package/dist/cjs/dom/htmlStaticConfig.native.js.map +1 -0
  48. package/dist/cjs/dom/primitives.native.cjs +81 -34
  49. package/dist/cjs/dom/primitives.native.js +81 -34
  50. package/dist/cjs/dom/primitives.native.js.map +1 -1
  51. package/dist/cjs/eventHandling.cjs +10 -4
  52. package/dist/cjs/eventHandling.native.cjs +52 -16
  53. package/dist/cjs/eventHandling.native.js +52 -16
  54. package/dist/cjs/eventHandling.native.js.map +1 -1
  55. package/dist/cjs/helpers/NativeTextBinding.cjs +36 -0
  56. package/dist/cjs/helpers/NativeTextBinding.native.cjs +39 -0
  57. package/dist/cjs/helpers/NativeTextBinding.native.js +41 -0
  58. package/dist/cjs/helpers/NativeTextBinding.native.js.map +1 -0
  59. package/dist/cjs/helpers/configVariables.native.cjs +2 -6
  60. package/dist/cjs/helpers/configVariables.native.js +2 -6
  61. package/dist/cjs/helpers/configVariables.native.js.map +1 -1
  62. package/dist/cjs/helpers/createDesignSystem.cjs +14 -10
  63. package/dist/cjs/helpers/createDesignSystem.native.cjs +5 -4
  64. package/dist/cjs/helpers/createDesignSystem.native.js +5 -4
  65. package/dist/cjs/helpers/createDesignSystem.native.js.map +1 -1
  66. package/dist/cjs/helpers/createStyledContext.native.cjs +1 -5
  67. package/dist/cjs/helpers/createStyledContext.native.js +1 -5
  68. package/dist/cjs/helpers/createStyledContext.native.js.map +1 -1
  69. package/dist/cjs/helpers/expandStyle.cjs +45 -1
  70. package/dist/cjs/helpers/expandStyle.native.cjs +38 -2
  71. package/dist/cjs/helpers/expandStyle.native.js +38 -2
  72. package/dist/cjs/helpers/expandStyle.native.js.map +1 -1
  73. package/dist/cjs/helpers/expandStyles.cjs +15 -3
  74. package/dist/cjs/helpers/expandStyles.native.cjs +14 -8
  75. package/dist/cjs/helpers/expandStyles.native.js +14 -8
  76. package/dist/cjs/helpers/expandStyles.native.js.map +1 -1
  77. package/dist/cjs/helpers/fluid.cjs +56 -0
  78. package/dist/cjs/helpers/fluid.native.cjs +58 -0
  79. package/dist/cjs/helpers/fluid.native.js +60 -0
  80. package/dist/cjs/helpers/fluid.native.js.map +1 -0
  81. package/dist/cjs/helpers/formatDiagnostic.native.cjs +2 -6
  82. package/dist/cjs/helpers/formatDiagnostic.native.js +2 -6
  83. package/dist/cjs/helpers/formatDiagnostic.native.js.map +1 -1
  84. package/dist/cjs/helpers/getCSSStylesAtomic.cjs +6 -6
  85. package/dist/cjs/helpers/getSplitStyles.cjs +366 -150
  86. package/dist/cjs/helpers/getSplitStyles.native.cjs +584 -184
  87. package/dist/cjs/helpers/getSplitStyles.native.js +584 -184
  88. package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
  89. package/dist/cjs/helpers/getThemeCSSRules.cjs +37 -25
  90. package/dist/cjs/helpers/grammarConfig.cjs +6 -14
  91. package/dist/cjs/helpers/grammarConfig.native.cjs +32 -22
  92. package/dist/cjs/helpers/grammarConfig.native.js +32 -22
  93. package/dist/cjs/helpers/grammarConfig.native.js.map +1 -1
  94. package/dist/cjs/helpers/insertStyleRule.cjs +11 -4
  95. package/dist/cjs/helpers/insertStyleRule.native.cjs +8 -11
  96. package/dist/cjs/helpers/insertStyleRule.native.js +8 -11
  97. package/dist/cjs/helpers/insertStyleRule.native.js.map +1 -1
  98. package/dist/cjs/helpers/isObj.native.cjs +1 -5
  99. package/dist/cjs/helpers/isObj.native.js +1 -5
  100. package/dist/cjs/helpers/isObj.native.js.map +1 -1
  101. package/dist/cjs/helpers/mainThreadPressEvents.native.cjs +48 -100
  102. package/dist/cjs/helpers/mainThreadPressEvents.native.js +48 -100
  103. package/dist/cjs/helpers/mainThreadPressEvents.native.js.map +1 -1
  104. package/dist/cjs/helpers/mergeProps.cjs +18 -21
  105. package/dist/cjs/helpers/mergeProps.native.cjs +20 -23
  106. package/dist/cjs/helpers/mergeProps.native.js +20 -23
  107. package/dist/cjs/helpers/mergeProps.native.js.map +1 -1
  108. package/dist/cjs/helpers/nativeOnlyProps.cjs +0 -1
  109. package/dist/cjs/helpers/nativeOnlyProps.native.cjs +0 -1
  110. package/dist/cjs/helpers/nativeOnlyProps.native.js +0 -1
  111. package/dist/cjs/helpers/nativeOnlyProps.native.js.map +1 -1
  112. package/dist/cjs/helpers/nativeTextMetrics.cjs +74 -0
  113. package/dist/cjs/helpers/nativeTextMetrics.native.cjs +77 -0
  114. package/dist/cjs/helpers/nativeTextMetrics.native.js +79 -0
  115. package/dist/cjs/helpers/nativeTextMetrics.native.js.map +1 -0
  116. package/dist/cjs/helpers/normalizeColor.native.cjs +17 -2
  117. package/dist/cjs/helpers/normalizeColor.native.js +17 -2
  118. package/dist/cjs/helpers/normalizeColor.native.js.map +1 -1
  119. package/dist/cjs/helpers/normalizeValueWithProperty.cjs +2 -1
  120. package/dist/cjs/helpers/normalizeValueWithProperty.native.cjs +3 -6
  121. package/dist/cjs/helpers/normalizeValueWithProperty.native.js +3 -6
  122. package/dist/cjs/helpers/normalizeValueWithProperty.native.js.map +1 -1
  123. package/dist/cjs/helpers/objectIdentityKey.native.cjs +1 -5
  124. package/dist/cjs/helpers/objectIdentityKey.native.js +1 -5
  125. package/dist/cjs/helpers/objectIdentityKey.native.js.map +1 -1
  126. package/dist/cjs/helpers/parseNativeStyle.cjs +187 -0
  127. package/dist/cjs/helpers/parseNativeStyle.native.cjs +6 -4
  128. package/dist/cjs/helpers/parseNativeStyle.native.js +6 -4
  129. package/dist/cjs/helpers/parseNativeStyle.native.js.map +1 -1
  130. package/dist/cjs/helpers/proxyThemeToParents.cjs +9 -2
  131. package/dist/cjs/helpers/proxyThemeToParents.native.cjs +28 -2
  132. package/dist/cjs/helpers/proxyThemeToParents.native.js +28 -2
  133. package/dist/cjs/helpers/proxyThemeToParents.native.js.map +1 -1
  134. package/dist/cjs/helpers/resolveAnimationDriver.native.cjs +1 -5
  135. package/dist/cjs/helpers/resolveAnimationDriver.native.js +1 -5
  136. package/dist/cjs/helpers/resolveAnimationDriver.native.js.map +1 -1
  137. package/dist/cjs/helpers/{timer.cjs → resolveNativeUnits.cjs} +12 -8
  138. package/dist/cjs/helpers/resolveNativeUnits.native.cjs +205 -0
  139. package/dist/cjs/helpers/resolveNativeUnits.native.js +207 -0
  140. package/dist/cjs/helpers/resolveNativeUnits.native.js.map +1 -0
  141. package/dist/cjs/helpers/resolveRem.native.cjs +18 -21
  142. package/dist/cjs/helpers/resolveRem.native.js +18 -21
  143. package/dist/cjs/helpers/resolveRem.native.js.map +1 -1
  144. package/dist/cjs/helpers/resolveSizing.cjs +124 -0
  145. package/dist/cjs/helpers/resolveSizing.native.cjs +133 -0
  146. package/dist/cjs/helpers/resolveSizing.native.js +135 -0
  147. package/dist/cjs/helpers/resolveSizing.native.js.map +1 -0
  148. package/dist/cjs/helpers/resolveVariableValue.cjs +7 -7
  149. package/dist/cjs/helpers/resolveVariableValue.native.cjs +7 -9
  150. package/dist/cjs/helpers/resolveVariableValue.native.js +7 -9
  151. package/dist/cjs/helpers/resolveVariableValue.native.js.map +1 -1
  152. package/dist/cjs/helpers/resolveVariantStyle.native.cjs +2 -6
  153. package/dist/cjs/helpers/resolveVariantStyle.native.js +2 -6
  154. package/dist/cjs/helpers/resolveVariantStyle.native.js.map +1 -1
  155. package/dist/cjs/helpers/skipProps.cjs +0 -1
  156. package/dist/cjs/helpers/skipProps.native.cjs +0 -1
  157. package/dist/cjs/helpers/skipProps.native.js +0 -1
  158. package/dist/cjs/helpers/skipProps.native.js.map +1 -1
  159. package/dist/cjs/helpers/styleFrontend.cjs +23 -1
  160. package/dist/cjs/helpers/styleFrontend.native.cjs +23 -1
  161. package/dist/cjs/helpers/styleFrontend.native.js +23 -1
  162. package/dist/cjs/helpers/styleFrontend.native.js.map +1 -1
  163. package/dist/cjs/helpers/styleStaticConfigCore.cjs +5 -4
  164. package/dist/cjs/helpers/styleStaticConfigCore.native.cjs +7 -4
  165. package/dist/cjs/helpers/styleStaticConfigCore.native.js +7 -4
  166. package/dist/cjs/helpers/styleStaticConfigCore.native.js.map +1 -1
  167. package/dist/cjs/helpers/styledDynamic.cjs +5 -0
  168. package/dist/cjs/helpers/styledDynamic.native.cjs +8 -7
  169. package/dist/cjs/helpers/styledDynamic.native.js +8 -7
  170. package/dist/cjs/helpers/styledDynamic.native.js.map +1 -1
  171. package/dist/cjs/helpers/subscribeToContextGroup.cjs +16 -7
  172. package/dist/cjs/helpers/subscribeToContextGroup.native.cjs +18 -8
  173. package/dist/cjs/helpers/subscribeToContextGroup.native.js +18 -8
  174. package/dist/cjs/helpers/subscribeToContextGroup.native.js.map +1 -1
  175. package/dist/cjs/helpers/themeRef.native.cjs +1 -5
  176. package/dist/cjs/helpers/themeRef.native.js +1 -5
  177. package/dist/cjs/helpers/themeRef.native.js.map +1 -1
  178. package/dist/cjs/helpers/themes.cjs +26 -11
  179. package/dist/cjs/helpers/themes.native.cjs +26 -11
  180. package/dist/cjs/helpers/themes.native.js +26 -11
  181. package/dist/cjs/helpers/themes.native.js.map +1 -1
  182. package/dist/cjs/helpers/tokenCategories.cjs +2 -2
  183. package/dist/cjs/helpers/tokenCategories.native.cjs +2 -2
  184. package/dist/cjs/helpers/tokenCategories.native.js +2 -2
  185. package/dist/cjs/helpers/tokenCategories.native.js.map +1 -1
  186. package/dist/cjs/helpers/variables.cjs +1 -1
  187. package/dist/cjs/helpers/variables.native.cjs +4 -8
  188. package/dist/cjs/helpers/variables.native.js +4 -8
  189. package/dist/cjs/helpers/variables.native.js.map +1 -1
  190. package/dist/cjs/helpers/warnOnce.cjs +6 -0
  191. package/dist/cjs/helpers/warnOnce.native.cjs +6 -0
  192. package/dist/cjs/helpers/warnOnce.native.js +6 -0
  193. package/dist/cjs/helpers/warnOnce.native.js.map +1 -1
  194. package/dist/cjs/helpers/webPropsToSkip.native.cjs +3 -3
  195. package/dist/cjs/helpers/webPropsToSkip.native.js +3 -3
  196. package/dist/cjs/helpers/webPropsToSkip.native.js.map +1 -1
  197. package/dist/cjs/helpers/wrapStyleTags.cjs +1 -1
  198. package/dist/cjs/helpers/wrapStyleTags.native.cjs +1 -1
  199. package/dist/cjs/helpers/wrapStyleTags.native.js +1 -1
  200. package/dist/cjs/helpers/wrapStyleTags.native.js.map +1 -1
  201. package/dist/cjs/hooks/useComponentState.native.cjs +1 -5
  202. package/dist/cjs/hooks/useComponentState.native.js +1 -5
  203. package/dist/cjs/hooks/useComponentState.native.js.map +1 -1
  204. package/dist/cjs/hooks/useMedia.cjs +27 -34
  205. package/dist/cjs/hooks/useMedia.native.cjs +45 -51
  206. package/dist/cjs/hooks/useMedia.native.js +45 -51
  207. package/dist/cjs/hooks/useMedia.native.js.map +1 -1
  208. package/dist/cjs/hooks/useSplitStyles.cjs +1 -1
  209. package/dist/cjs/hooks/useSplitStyles.native.cjs +1 -1
  210. package/dist/cjs/hooks/useSplitStyles.native.js +1 -1
  211. package/dist/cjs/hooks/useSplitStyles.native.js.map +1 -1
  212. package/dist/cjs/hooks/useThemeState.cjs +37 -47
  213. package/dist/cjs/hooks/useThemeState.native.cjs +44 -50
  214. package/dist/cjs/hooks/useThemeState.native.js +44 -50
  215. package/dist/cjs/hooks/useThemeState.native.js.map +1 -1
  216. package/dist/cjs/index.cjs +7 -0
  217. package/dist/cjs/index.native.cjs +7 -0
  218. package/dist/cjs/index.native.js +7 -0
  219. package/dist/cjs/index.native.js.map +1 -1
  220. package/dist/cjs/internal-runtime.cjs +22 -0
  221. package/dist/cjs/internal-runtime.native.cjs +22 -0
  222. package/dist/cjs/internal-runtime.native.js +22 -0
  223. package/dist/cjs/internal-runtime.native.js.map +1 -1
  224. package/dist/cjs/static-resolve.native.cjs +2 -9
  225. package/dist/cjs/static-resolve.native.js +2 -9
  226. package/dist/cjs/static-resolve.native.js.map +1 -1
  227. package/dist/cjs/style.cjs +1 -1
  228. package/dist/cjs/style.native.cjs +4 -7
  229. package/dist/cjs/style.native.js +4 -7
  230. package/dist/cjs/style.native.js.map +1 -1
  231. package/dist/cjs/views/Theme.cjs +10 -17
  232. package/dist/cjs/views/Theme.native.cjs +9 -11
  233. package/dist/cjs/views/Theme.native.js +9 -11
  234. package/dist/cjs/views/Theme.native.js.map +1 -1
  235. package/dist/cjs/views/ThemeDebug.cjs +1 -1
  236. package/dist/cjs/views/ThemeUpdate.cjs +1 -1
  237. package/dist/cjs/views/ThemeUpdate.native.cjs +1 -1
  238. package/dist/cjs/views/ThemeUpdate.native.js +1 -1
  239. package/dist/cjs/views/ThemeUpdate.native.js.map +1 -1
  240. package/dist/esm/_withNativeStyle.mjs +4 -1
  241. package/dist/esm/_withNativeStyle.mjs.map +1 -1
  242. package/dist/esm/_withNativeStyle.native.js +4 -1
  243. package/dist/esm/_withNativeStyle.native.js.map +1 -1
  244. package/dist/esm/_withStableStyle.native.js +1 -5
  245. package/dist/esm/_withStableStyle.native.js.map +1 -1
  246. package/dist/esm/config.mjs +6 -3
  247. package/dist/esm/config.mjs.map +1 -1
  248. package/dist/esm/config.native.js +7 -5
  249. package/dist/esm/config.native.js.map +1 -1
  250. package/dist/esm/contexts/ComponentContext.mjs +9 -9
  251. package/dist/esm/contexts/ComponentContext.mjs.map +1 -1
  252. package/dist/esm/contexts/ComponentContext.native.js +16 -9
  253. package/dist/esm/contexts/ComponentContext.native.js.map +1 -1
  254. package/dist/esm/createComponent.mjs +45 -42
  255. package/dist/esm/createComponent.mjs.map +1 -1
  256. package/dist/esm/createComponent.native.js +93 -82
  257. package/dist/esm/createComponent.native.js.map +1 -1
  258. package/dist/esm/createTamagui.mjs +33 -15
  259. package/dist/esm/createTamagui.mjs.map +1 -1
  260. package/dist/esm/createTamagui.native.js +34 -20
  261. package/dist/esm/createTamagui.native.js.map +1 -1
  262. package/dist/esm/createTokens.native.js +1 -5
  263. package/dist/esm/createTokens.native.js.map +1 -1
  264. package/dist/esm/createVariable.native.js +1 -5
  265. package/dist/esm/createVariable.native.js.map +1 -1
  266. package/dist/esm/createVariables.native.js +2 -6
  267. package/dist/esm/createVariables.native.js.map +1 -1
  268. package/dist/esm/dom/html.mjs +87 -329
  269. package/dist/esm/dom/html.mjs.map +1 -1
  270. package/dist/esm/dom/html.native.js +53 -2
  271. package/dist/esm/dom/html.native.js.map +1 -1
  272. package/dist/esm/dom/htmlReset.mjs +6 -0
  273. package/dist/esm/dom/htmlReset.mjs.map +1 -0
  274. package/dist/esm/dom/htmlReset.native.js +6 -0
  275. package/dist/esm/dom/htmlReset.native.js.map +1 -0
  276. package/dist/esm/dom/htmlRuntime.native.js +4 -0
  277. package/dist/esm/dom/htmlRuntime.native.js.map +1 -1
  278. package/dist/esm/dom/htmlStaticConfig.mjs +22 -0
  279. package/dist/esm/dom/htmlStaticConfig.mjs.map +1 -0
  280. package/dist/esm/dom/htmlStaticConfig.native.js +22 -0
  281. package/dist/esm/dom/htmlStaticConfig.native.js.map +1 -0
  282. package/dist/esm/dom/primitives.native.js +81 -34
  283. package/dist/esm/dom/primitives.native.js.map +1 -1
  284. package/dist/esm/eventHandling.mjs +10 -4
  285. package/dist/esm/eventHandling.mjs.map +1 -1
  286. package/dist/esm/eventHandling.native.js +52 -16
  287. package/dist/esm/eventHandling.native.js.map +1 -1
  288. package/dist/esm/helpers/NativeTextBinding.mjs +17 -0
  289. package/dist/esm/helpers/NativeTextBinding.mjs.map +1 -0
  290. package/dist/esm/helpers/NativeTextBinding.native.js +18 -0
  291. package/dist/esm/helpers/NativeTextBinding.native.js.map +1 -0
  292. package/dist/esm/helpers/configVariables.native.js +2 -6
  293. package/dist/esm/helpers/configVariables.native.js.map +1 -1
  294. package/dist/esm/helpers/createDesignSystem.mjs +14 -10
  295. package/dist/esm/helpers/createDesignSystem.mjs.map +1 -1
  296. package/dist/esm/helpers/createDesignSystem.native.js +4 -4
  297. package/dist/esm/helpers/createDesignSystem.native.js.map +1 -1
  298. package/dist/esm/helpers/createStyledContext.native.js +1 -5
  299. package/dist/esm/helpers/createStyledContext.native.js.map +1 -1
  300. package/dist/esm/helpers/expandStyle.mjs +41 -1
  301. package/dist/esm/helpers/expandStyle.mjs.map +1 -1
  302. package/dist/esm/helpers/expandStyle.native.js +36 -3
  303. package/dist/esm/helpers/expandStyle.native.js.map +1 -1
  304. package/dist/esm/helpers/expandStyles.mjs +15 -3
  305. package/dist/esm/helpers/expandStyles.mjs.map +1 -1
  306. package/dist/esm/helpers/expandStyles.native.js +14 -8
  307. package/dist/esm/helpers/expandStyles.native.js.map +1 -1
  308. package/dist/esm/helpers/fluid.mjs +36 -0
  309. package/dist/esm/helpers/fluid.mjs.map +1 -0
  310. package/dist/esm/helpers/fluid.native.js +36 -0
  311. package/dist/esm/helpers/fluid.native.js.map +1 -0
  312. package/dist/esm/helpers/formatDiagnostic.native.js +2 -6
  313. package/dist/esm/helpers/formatDiagnostic.native.js.map +1 -1
  314. package/dist/esm/helpers/getCSSStylesAtomic.mjs +6 -6
  315. package/dist/esm/helpers/getCSSStylesAtomic.mjs.map +1 -1
  316. package/dist/esm/helpers/getSplitStyles.mjs +364 -150
  317. package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
  318. package/dist/esm/helpers/getSplitStyles.native.js +588 -188
  319. package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
  320. package/dist/esm/helpers/getThemeCSSRules.mjs +37 -25
  321. package/dist/esm/helpers/getThemeCSSRules.mjs.map +1 -1
  322. package/dist/esm/helpers/grammarConfig.mjs +6 -14
  323. package/dist/esm/helpers/grammarConfig.mjs.map +1 -1
  324. package/dist/esm/helpers/grammarConfig.native.js +32 -22
  325. package/dist/esm/helpers/grammarConfig.native.js.map +1 -1
  326. package/dist/esm/helpers/insertStyleRule.mjs +11 -4
  327. package/dist/esm/helpers/insertStyleRule.mjs.map +1 -1
  328. package/dist/esm/helpers/insertStyleRule.native.js +4 -4
  329. package/dist/esm/helpers/insertStyleRule.native.js.map +1 -1
  330. package/dist/esm/helpers/isObj.native.js +1 -5
  331. package/dist/esm/helpers/isObj.native.js.map +1 -1
  332. package/dist/esm/helpers/mainThreadPressEvents.native.js +48 -100
  333. package/dist/esm/helpers/mainThreadPressEvents.native.js.map +1 -1
  334. package/dist/esm/helpers/mergeProps.mjs +18 -21
  335. package/dist/esm/helpers/mergeProps.mjs.map +1 -1
  336. package/dist/esm/helpers/mergeProps.native.js +20 -23
  337. package/dist/esm/helpers/mergeProps.native.js.map +1 -1
  338. package/dist/esm/helpers/nativeOnlyProps.mjs +0 -1
  339. package/dist/esm/helpers/nativeOnlyProps.mjs.map +1 -1
  340. package/dist/esm/helpers/nativeOnlyProps.native.js +0 -1
  341. package/dist/esm/helpers/nativeOnlyProps.native.js.map +1 -1
  342. package/dist/esm/helpers/nativeTextMetrics.mjs +55 -0
  343. package/dist/esm/helpers/nativeTextMetrics.mjs.map +1 -0
  344. package/dist/esm/helpers/nativeTextMetrics.native.js +56 -0
  345. package/dist/esm/helpers/nativeTextMetrics.native.js.map +1 -0
  346. package/dist/esm/helpers/normalizeColor.native.js +17 -2
  347. package/dist/esm/helpers/normalizeColor.native.js.map +1 -1
  348. package/dist/esm/helpers/normalizeValueWithProperty.mjs +2 -1
  349. package/dist/esm/helpers/normalizeValueWithProperty.mjs.map +1 -1
  350. package/dist/esm/helpers/normalizeValueWithProperty.native.js +3 -6
  351. package/dist/esm/helpers/normalizeValueWithProperty.native.js.map +1 -1
  352. package/dist/esm/helpers/objectIdentityKey.native.js +1 -5
  353. package/dist/esm/helpers/objectIdentityKey.native.js.map +1 -1
  354. package/dist/esm/helpers/parseNativeStyle.mjs +168 -0
  355. package/dist/esm/helpers/parseNativeStyle.mjs.map +1 -0
  356. package/dist/esm/helpers/parseNativeStyle.native.js +4 -1
  357. package/dist/esm/helpers/parseNativeStyle.native.js.map +1 -1
  358. package/dist/esm/helpers/proxyThemeToParents.mjs +10 -2
  359. package/dist/esm/helpers/proxyThemeToParents.mjs.map +1 -1
  360. package/dist/esm/helpers/proxyThemeToParents.native.js +29 -2
  361. package/dist/esm/helpers/proxyThemeToParents.native.js.map +1 -1
  362. package/dist/esm/helpers/resolveAnimationDriver.native.js +1 -5
  363. package/dist/esm/helpers/resolveAnimationDriver.native.js.map +1 -1
  364. package/dist/esm/helpers/resolveNativeUnits.mjs +9 -0
  365. package/dist/esm/helpers/resolveNativeUnits.mjs.map +1 -0
  366. package/dist/esm/helpers/resolveNativeUnits.native.js +178 -0
  367. package/dist/esm/helpers/resolveNativeUnits.native.js.map +1 -0
  368. package/dist/esm/helpers/resolveRem.native.js +18 -21
  369. package/dist/esm/helpers/resolveRem.native.js.map +1 -1
  370. package/dist/esm/helpers/resolveSizing.mjs +102 -0
  371. package/dist/esm/helpers/resolveSizing.mjs.map +1 -0
  372. package/dist/esm/helpers/resolveSizing.native.js +109 -0
  373. package/dist/esm/helpers/resolveSizing.native.js.map +1 -0
  374. package/dist/esm/helpers/resolveVariableValue.mjs +7 -7
  375. package/dist/esm/helpers/resolveVariableValue.mjs.map +1 -1
  376. package/dist/esm/helpers/resolveVariableValue.native.js +7 -9
  377. package/dist/esm/helpers/resolveVariableValue.native.js.map +1 -1
  378. package/dist/esm/helpers/resolveVariantStyle.native.js +2 -6
  379. package/dist/esm/helpers/resolveVariantStyle.native.js.map +1 -1
  380. package/dist/esm/helpers/skipProps.mjs +0 -1
  381. package/dist/esm/helpers/skipProps.mjs.map +1 -1
  382. package/dist/esm/helpers/skipProps.native.js +0 -1
  383. package/dist/esm/helpers/skipProps.native.js.map +1 -1
  384. package/dist/esm/helpers/styleFrontend.mjs +20 -1
  385. package/dist/esm/helpers/styleFrontend.mjs.map +1 -1
  386. package/dist/esm/helpers/styleFrontend.native.js +20 -1
  387. package/dist/esm/helpers/styleFrontend.native.js.map +1 -1
  388. package/dist/esm/helpers/styleStaticConfigCore.mjs +5 -4
  389. package/dist/esm/helpers/styleStaticConfigCore.mjs.map +1 -1
  390. package/dist/esm/helpers/styleStaticConfigCore.native.js +7 -4
  391. package/dist/esm/helpers/styleStaticConfigCore.native.js.map +1 -1
  392. package/dist/esm/helpers/styledDynamic.mjs +5 -0
  393. package/dist/esm/helpers/styledDynamic.mjs.map +1 -1
  394. package/dist/esm/helpers/styledDynamic.native.js +8 -7
  395. package/dist/esm/helpers/styledDynamic.native.js.map +1 -1
  396. package/dist/esm/helpers/subscribeToContextGroup.mjs +16 -7
  397. package/dist/esm/helpers/subscribeToContextGroup.mjs.map +1 -1
  398. package/dist/esm/helpers/subscribeToContextGroup.native.js +18 -8
  399. package/dist/esm/helpers/subscribeToContextGroup.native.js.map +1 -1
  400. package/dist/esm/helpers/themeRef.native.js +1 -5
  401. package/dist/esm/helpers/themeRef.native.js.map +1 -1
  402. package/dist/esm/helpers/themes.mjs +20 -11
  403. package/dist/esm/helpers/themes.mjs.map +1 -1
  404. package/dist/esm/helpers/themes.native.js +20 -11
  405. package/dist/esm/helpers/themes.native.js.map +1 -1
  406. package/dist/esm/helpers/tokenCategories.mjs +2 -2
  407. package/dist/esm/helpers/tokenCategories.mjs.map +1 -1
  408. package/dist/esm/helpers/tokenCategories.native.js +2 -2
  409. package/dist/esm/helpers/tokenCategories.native.js.map +1 -1
  410. package/dist/esm/helpers/variables.mjs +1 -1
  411. package/dist/esm/helpers/variables.mjs.map +1 -1
  412. package/dist/esm/helpers/variables.native.js +4 -8
  413. package/dist/esm/helpers/variables.native.js.map +1 -1
  414. package/dist/esm/helpers/warnOnce.mjs +6 -1
  415. package/dist/esm/helpers/warnOnce.mjs.map +1 -1
  416. package/dist/esm/helpers/warnOnce.native.js +6 -1
  417. package/dist/esm/helpers/warnOnce.native.js.map +1 -1
  418. package/dist/esm/helpers/webPropsToSkip.native.js +3 -3
  419. package/dist/esm/helpers/webPropsToSkip.native.js.map +1 -1
  420. package/dist/esm/helpers/wrapStyleTags.mjs +1 -1
  421. package/dist/esm/helpers/wrapStyleTags.mjs.map +1 -1
  422. package/dist/esm/helpers/wrapStyleTags.native.js +1 -1
  423. package/dist/esm/helpers/wrapStyleTags.native.js.map +1 -1
  424. package/dist/esm/hooks/useComponentState.native.js +1 -5
  425. package/dist/esm/hooks/useComponentState.native.js.map +1 -1
  426. package/dist/esm/hooks/useMedia.mjs +27 -34
  427. package/dist/esm/hooks/useMedia.mjs.map +1 -1
  428. package/dist/esm/hooks/useMedia.native.js +45 -51
  429. package/dist/esm/hooks/useMedia.native.js.map +1 -1
  430. package/dist/esm/hooks/useSplitStyles.mjs +1 -1
  431. package/dist/esm/hooks/useSplitStyles.mjs.map +1 -1
  432. package/dist/esm/hooks/useSplitStyles.native.js +1 -1
  433. package/dist/esm/hooks/useSplitStyles.native.js.map +1 -1
  434. package/dist/esm/hooks/useThemeState.mjs +36 -48
  435. package/dist/esm/hooks/useThemeState.mjs.map +1 -1
  436. package/dist/esm/hooks/useThemeState.native.js +44 -50
  437. package/dist/esm/hooks/useThemeState.native.js.map +1 -1
  438. package/dist/esm/index.js +4 -1
  439. package/dist/esm/index.mjs +4 -1
  440. package/dist/esm/index.native.js +4 -1
  441. package/dist/esm/internal-runtime.mjs +22 -3
  442. package/dist/esm/internal-runtime.mjs.map +1 -1
  443. package/dist/esm/internal-runtime.native.js +22 -3
  444. package/dist/esm/internal-runtime.native.js.map +1 -1
  445. package/dist/esm/static-resolve.native.js +2 -9
  446. package/dist/esm/static-resolve.native.js.map +1 -1
  447. package/dist/esm/style.mjs +1 -1
  448. package/dist/esm/style.mjs.map +1 -1
  449. package/dist/esm/style.native.js +4 -7
  450. package/dist/esm/style.native.js.map +1 -1
  451. package/dist/esm/views/Theme.mjs +15 -14
  452. package/dist/esm/views/Theme.mjs.map +1 -1
  453. package/dist/esm/views/Theme.native.js +15 -15
  454. package/dist/esm/views/Theme.native.js.map +1 -1
  455. package/dist/esm/views/ThemeDebug.mjs +1 -1
  456. package/dist/esm/views/ThemeDebug.mjs.map +1 -1
  457. package/dist/esm/views/ThemeUpdate.mjs +1 -1
  458. package/dist/esm/views/ThemeUpdate.mjs.map +1 -1
  459. package/dist/esm/views/ThemeUpdate.native.js +1 -1
  460. package/dist/esm/views/ThemeUpdate.native.js.map +1 -1
  461. package/package.json +20 -18
  462. package/reset.css +11 -0
  463. package/src/_withNativeStyle.tsx +6 -1
  464. package/src/config.ts +6 -6
  465. package/src/contexts/ComponentContext.tsx +8 -0
  466. package/src/createComponent.tsx +177 -57
  467. package/src/createStyledHOC.tsx +25 -26
  468. package/src/createTamagui.ts +47 -28
  469. package/src/dom/contract.ts +4 -1
  470. package/src/dom/html.native.tsx +55 -2
  471. package/src/dom/html.tsx +189 -388
  472. package/src/dom/htmlReset.ts +15 -0
  473. package/src/dom/htmlRuntime.native.tsx +5 -0
  474. package/src/dom/htmlStaticConfig.ts +40 -0
  475. package/src/dom/primitives.native.tsx +138 -33
  476. package/src/dom/standalone.ts +2 -1
  477. package/src/dom/styleTypes.ts +82 -92
  478. package/src/eventHandling.native.ts +61 -11
  479. package/src/eventHandling.ts +19 -4
  480. package/src/helpers/NativeTextBinding.tsx +26 -0
  481. package/src/helpers/createDesignSystem.ts +24 -8
  482. package/src/helpers/expandStyle.ts +88 -4
  483. package/src/helpers/expandStyles.ts +6 -11
  484. package/src/helpers/fluid.ts +66 -0
  485. package/src/helpers/getCSSStylesAtomic.ts +11 -6
  486. package/src/helpers/getSplitStyles.tsx +1032 -296
  487. package/src/helpers/getThemeCSSRules.ts +73 -35
  488. package/src/helpers/grammarConfig.ts +23 -8
  489. package/src/helpers/insertStyleRule.tsx +14 -8
  490. package/src/helpers/mainThreadPressEvents.native.ts +65 -141
  491. package/src/helpers/mergeProps.ts +29 -62
  492. package/src/helpers/nativeOnlyProps.ts +0 -1
  493. package/src/helpers/nativeTextMetrics.ts +77 -0
  494. package/src/helpers/normalizeColor.native.ts +29 -4
  495. package/src/helpers/normalizeValueWithProperty.ts +2 -1
  496. package/src/helpers/{parseNativeStyle.native.ts → parseNativeStyle.ts} +8 -1
  497. package/src/helpers/proxyThemeToParents.ts +13 -2
  498. package/src/helpers/resolveNativeUnits.native.ts +247 -0
  499. package/src/helpers/resolveNativeUnits.ts +10 -0
  500. package/src/helpers/resolveRem.native.ts +25 -26
  501. package/src/helpers/resolveSizing.ts +167 -0
  502. package/src/helpers/resolveVariableValue.ts +21 -17
  503. package/src/helpers/skipProps.ts +0 -1
  504. package/src/helpers/styleFrontend.ts +39 -0
  505. package/src/helpers/styleProvenance.ts +1 -1
  506. package/src/helpers/styleStaticConfigCore.ts +15 -4
  507. package/src/helpers/styledDynamic.ts +3 -1
  508. package/src/helpers/subscribeToContextGroup.tsx +16 -7
  509. package/src/helpers/themes.ts +27 -11
  510. package/src/helpers/tokenCategories.ts +15 -3
  511. package/src/helpers/variables.ts +2 -2
  512. package/src/helpers/warnOnce.ts +6 -0
  513. package/src/helpers/webPropsToSkip.native.ts +9 -3
  514. package/src/helpers/wrapStyleTags.tsx +4 -1
  515. package/src/hooks/useMedia.tsx +36 -47
  516. package/src/hooks/useSplitStyles.tsx +4 -1
  517. package/src/hooks/useThemeState.ts +69 -74
  518. package/src/index.ts +13 -0
  519. package/src/interfaces/RNExclusiveTypes.ts +1 -3
  520. package/src/internal-runtime.ts +43 -2
  521. package/src/style.ts +4 -1
  522. package/src/styled.tsx +34 -3
  523. package/src/types.tsx +412 -132
  524. package/src/views/Theme.tsx +18 -21
  525. package/src/views/ThemeDebug.tsx +1 -1
  526. package/src/views/ThemeUpdate.tsx +1 -1
  527. package/types/_withNativeStyle.d.ts.map +1 -1
  528. package/types/config.d.ts.map +1 -1
  529. package/types/contexts/ComponentContext.d.ts +1 -1
  530. package/types/contexts/ComponentContext.d.ts.map +1 -1
  531. package/types/createComponent.d.ts.map +1 -1
  532. package/types/createStyledHOC.d.ts +5 -2
  533. package/types/createStyledHOC.d.ts.map +1 -1
  534. package/types/createTamagui.d.ts.map +1 -1
  535. package/types/dom/contract.d.ts +4 -1
  536. package/types/dom/contract.d.ts.map +1 -1
  537. package/types/dom/html.d.ts +60 -51
  538. package/types/dom/html.d.ts.map +1 -1
  539. package/types/dom/html.native.d.ts.map +1 -1
  540. package/types/dom/htmlReset.d.ts +10 -0
  541. package/types/dom/htmlReset.d.ts.map +1 -0
  542. package/types/dom/htmlRuntime.native.d.ts.map +1 -1
  543. package/types/dom/htmlStaticConfig.d.ts +22 -0
  544. package/types/dom/htmlStaticConfig.d.ts.map +1 -0
  545. package/types/dom/primitives.native.d.ts.map +1 -1
  546. package/types/dom/standalone.d.ts +2 -1
  547. package/types/dom/standalone.d.ts.map +1 -1
  548. package/types/dom/styleTypes.d.ts +63 -84
  549. package/types/dom/styleTypes.d.ts.map +1 -1
  550. package/types/eventHandling.d.ts +12 -4
  551. package/types/eventHandling.d.ts.map +1 -1
  552. package/types/eventHandling.native.d.ts.map +1 -1
  553. package/types/helpers/NativeTextBinding.d.ts +11 -0
  554. package/types/helpers/NativeTextBinding.d.ts.map +1 -0
  555. package/types/helpers/createDesignSystem.d.ts.map +1 -1
  556. package/types/helpers/expandStyle.d.ts +1 -0
  557. package/types/helpers/expandStyle.d.ts.map +1 -1
  558. package/types/helpers/expandStyles.d.ts.map +1 -1
  559. package/types/helpers/fluid.d.ts +21 -0
  560. package/types/helpers/fluid.d.ts.map +1 -0
  561. package/types/helpers/getCSSStylesAtomic.d.ts +3 -1
  562. package/types/helpers/getCSSStylesAtomic.d.ts.map +1 -1
  563. package/types/helpers/getSplitStyles.d.ts +2 -1
  564. package/types/helpers/getSplitStyles.d.ts.map +1 -1
  565. package/types/helpers/getThemeCSSRules.d.ts.map +1 -1
  566. package/types/helpers/grammarConfig.d.ts.map +1 -1
  567. package/types/helpers/insertStyleRule.d.ts.map +1 -1
  568. package/types/helpers/mainThreadPressEvents.native.d.ts +0 -7
  569. package/types/helpers/mainThreadPressEvents.native.d.ts.map +1 -1
  570. package/types/helpers/mergeProps.d.ts +1 -15
  571. package/types/helpers/mergeProps.d.ts.map +1 -1
  572. package/types/helpers/nativeOnlyProps.d.ts +0 -1
  573. package/types/helpers/nativeOnlyProps.d.ts.map +1 -1
  574. package/types/helpers/nativeTextMetrics.d.ts +16 -0
  575. package/types/helpers/nativeTextMetrics.d.ts.map +1 -0
  576. package/types/helpers/normalizeColor.native.d.ts +4 -1
  577. package/types/helpers/normalizeColor.native.d.ts.map +1 -1
  578. package/types/helpers/normalizeShadow.native.d.ts +3 -1
  579. package/types/helpers/normalizeShadow.native.d.ts.map +1 -1
  580. package/types/helpers/normalizeValueWithProperty.d.ts.map +1 -1
  581. package/types/helpers/{parseNativeStyle.native.d.ts → parseNativeStyle.d.ts} +1 -1
  582. package/types/helpers/parseNativeStyle.d.ts.map +1 -0
  583. package/types/helpers/proxyThemeToParents.d.ts +1 -1
  584. package/types/helpers/proxyThemeToParents.d.ts.map +1 -1
  585. package/types/helpers/resolveNativeUnits.d.ts +6 -0
  586. package/types/helpers/resolveNativeUnits.d.ts.map +1 -0
  587. package/types/helpers/resolveNativeUnits.native.d.ts +16 -0
  588. package/types/helpers/resolveNativeUnits.native.d.ts.map +1 -0
  589. package/types/helpers/resolveRem.native.d.ts +6 -4
  590. package/types/helpers/resolveRem.native.d.ts.map +1 -1
  591. package/types/helpers/resolveSizing.d.ts +90 -0
  592. package/types/helpers/resolveSizing.d.ts.map +1 -0
  593. package/types/helpers/resolveVariableValue.d.ts.map +1 -1
  594. package/types/helpers/skipProps.d.ts +0 -1
  595. package/types/helpers/skipProps.d.ts.map +1 -1
  596. package/types/helpers/styleFrontend.d.ts +21 -0
  597. package/types/helpers/styleFrontend.d.ts.map +1 -1
  598. package/types/helpers/styleProvenance.d.ts +1 -1
  599. package/types/helpers/styleProvenance.d.ts.map +1 -1
  600. package/types/helpers/styleStaticConfigCore.d.ts.map +1 -1
  601. package/types/helpers/styledDynamic.d.ts +1 -1
  602. package/types/helpers/styledDynamic.d.ts.map +1 -1
  603. package/types/helpers/themes.d.ts +4 -0
  604. package/types/helpers/themes.d.ts.map +1 -1
  605. package/types/helpers/tokenCategories.d.ts +1 -1
  606. package/types/helpers/tokenCategories.d.ts.map +1 -1
  607. package/types/helpers/warnOnce.d.ts +1 -0
  608. package/types/helpers/warnOnce.d.ts.map +1 -1
  609. package/types/helpers/webPropsToSkip.native.d.ts +6 -2
  610. package/types/helpers/webPropsToSkip.native.d.ts.map +1 -1
  611. package/types/helpers/wrapStyleTags.d.ts.map +1 -1
  612. package/types/hooks/useMedia.d.ts +5 -2
  613. package/types/hooks/useMedia.d.ts.map +1 -1
  614. package/types/hooks/useSplitStyles.d.ts.map +1 -1
  615. package/types/hooks/useThemeState.d.ts.map +1 -1
  616. package/types/index.d.ts +4 -1
  617. package/types/index.d.ts.map +1 -1
  618. package/types/interfaces/RNExclusiveTypes.d.ts +2 -3
  619. package/types/interfaces/RNExclusiveTypes.d.ts.map +1 -1
  620. package/types/internal-runtime.d.ts +12 -1
  621. package/types/internal-runtime.d.ts.map +1 -1
  622. package/types/style.d.ts.map +1 -1
  623. package/types/styled.d.ts +7 -4
  624. package/types/styled.d.ts.map +1 -1
  625. package/types/types.d.ts +258 -102
  626. package/types/types.d.ts.map +1 -1
  627. package/types/views/Theme.d.ts.map +1 -1
  628. package/dist/cjs/helpers/timer.native.js.map +0 -1
  629. package/dist/esm/helpers/timer.mjs +0 -13
  630. package/dist/esm/helpers/timer.mjs.map +0 -1
  631. package/dist/esm/helpers/timer.native.js +0 -13
  632. package/dist/esm/helpers/timer.native.js.map +0 -1
  633. package/src/helpers/timer.ts +0 -9
  634. package/types/helpers/parseNativeStyle.native.d.ts.map +0 -1
  635. package/types/helpers/timer.d.ts +0 -2
  636. package/types/helpers/timer.d.ts.map +0 -1
package/src/types.tsx CHANGED
@@ -4,6 +4,7 @@ import type {
4
4
  TransformAccumulator,
5
5
  } from '@tamagui/style-grammar/runtime'
6
6
  import type { Properties } from 'csstype'
7
+ import type { UnprefixedCSSProperties } from './dom/styleTypes'
7
8
  import type {
8
9
  CSSProperties,
9
10
  ComponentType,
@@ -18,16 +19,23 @@ import type {
18
19
  SetStateAction,
19
20
  } from 'react'
20
21
  import type {
22
+ FontVariant,
21
23
  PressableProps,
22
- Text as RNText,
24
+ TextInstance as RNText,
23
25
  TextStyle as RNTextStyle,
24
26
  TextProps as ReactTextProps,
25
- View,
27
+ ViewInstance as View,
26
28
  ViewProps,
27
29
  ViewStyle,
28
- } from 'react-native'
30
+ } from '@tamagui/react-native-types'
29
31
 
30
32
  import type { NativeStyleEngineLinkHandle } from './helpers/nativeStyleEngine'
33
+ import type {
34
+ AnimatedTextChannel,
35
+ NativeTextContext,
36
+ NativeTextMetrics,
37
+ } from './helpers/nativeTextMetrics'
38
+ export type { AnimatedTextChannel, NativeTextMetrics } from './helpers/nativeTextMetrics'
31
39
  import type { StyleFrontend } from './helpers/styleFrontend'
32
40
  import type { CSSColorNames } from './interfaces/CSSColorNames'
33
41
  import type { RNOnlyProps } from './interfaces/RNExclusiveTypes'
@@ -484,6 +492,12 @@ export type ThemeState = {
484
492
  isNew?: boolean
485
493
  parentId?: string
486
494
  scheme?: 'light' | 'dark'
495
+ // true when a `<Theme name="light_blue">` at or above this state named its
496
+ // scheme outright, rather than inheriting the scheme from the root. Only such
497
+ // a state may emit the scheme-qualified `t_light_blue` class; everything else
498
+ // stays scheme-relative so server output renders correctly under either root
499
+ // scheme. Cumulative: once an ancestor pins, descendants stay pinned.
500
+ schemeAuthored?: boolean
487
501
  }
488
502
 
489
503
  export interface Variable<A = any> {
@@ -613,14 +627,12 @@ export type ComponentSetStateShallow = React.Dispatch<
613
627
 
614
628
  export type ComponentSetState = Dispatch<SetStateAction<TamaguiComponentState>>
615
629
 
616
- export type ComponentContextI = {
630
+ export type ComponentContextI = NativeTextContext & {
617
631
  disableSSR?: boolean
618
632
  inText: boolean
619
633
  language: LanguageContextType | null
620
634
  animationDriver: AnimationDriver | null
621
635
  setParentFocusState: ComponentSetStateShallow | null
622
- mediaEmit?: (state: UseMediaState) => void
623
- mediaEmitListeners?: Set<(state: UseMediaState) => void>
624
636
  insets?: { top: number; right: number; bottom: number; left: number } | null
625
637
  }
626
638
 
@@ -630,6 +642,12 @@ export type TamaguiComponentStateRef = {
630
642
 
631
643
  host?: TamaguiElement
632
644
  composedRef?: (x: TamaguiElement) => void
645
+ // the forwarded ref composedRef writes to right now, read at attach time so the
646
+ // cached callback never pins the first render's ref
647
+ composedForwardedRef?: React.Ref<TamaguiElement>
648
+ // the forwarded ref composedRef last handed the host to, so a swap can be
649
+ // detected without a render-phase "previous" pointer (see createComponent)
650
+ attachedForwardedRef?: React.Ref<TamaguiElement>
633
651
  willHydrate?: boolean
634
652
  hasMeasured?: boolean
635
653
  hasAnimated?: boolean
@@ -641,6 +659,9 @@ export type TamaguiComponentStateRef = {
641
659
  hasEverResetPresence?: boolean
642
660
  hasHadEvents?: boolean
643
661
  hasRealPressEvents?: boolean
662
+ // previous render's press-plumbing presence, so a detach mid-press can drop
663
+ // the in-flight press instead of latching it (see createComponent)
664
+ hadAttachPress?: boolean
644
665
  isListeningToTheme?: boolean
645
666
  unPress?: Function
646
667
  setStateShallow?: ComponentSetStateShallow
@@ -665,8 +686,11 @@ export type TamaguiComponentStateRef = {
665
686
  // per-render animatedBy prop; hooks gated on it must keep a stable count)
666
687
  avoidReRenders?: boolean
667
688
 
668
- // cleanup function for media emit listener
669
- mediaEmitCleanup?: () => void
689
+ // avoidReRenders: this instance's useMedia emits media changes here instead
690
+ // of re-rendering
691
+ mediaEmit?: (state: UseMediaState) => void
692
+ // a restyle from mediaEmit is queued for this event turn
693
+ mediaEmitQueued?: boolean
670
694
 
671
695
  // previous pseudo state for detecting enter vs exit transitions
672
696
  prevPseudoState?: {
@@ -701,6 +725,10 @@ export type TamaguiComponentStateRef = {
701
725
  // but absent from the next push are sent as null (reset-to-default),
702
726
  // matching what a real re-render's style diff would do
703
727
  nativePushedKeys?: Set<string>
728
+
729
+ // native style stability: the most recently resolved style object, reused
730
+ // when the next render's resolved values are identical (see getSplitStyles)
731
+ prevStyle?: Record<string, any> | null
704
732
  }
705
733
 
706
734
  export type ComponentGroupEmitter = {
@@ -717,6 +745,7 @@ export type WidthHeight = {
717
745
  export type ChildGroupState = {
718
746
  pseudo?: PseudoGroupState
719
747
  media?: Record<MediaQueryKey extends number ? never : MediaQueryKey, boolean>
748
+ layout?: WidthHeight
720
749
  }
721
750
 
722
751
  export type ComponentGroupState = {
@@ -899,6 +928,7 @@ export type CreateTamaguiConfig<
899
928
  E extends GenericAnimations = GenericAnimations,
900
929
  F extends GenericFonts = GenericFonts,
901
930
  H extends GenericTamaguiSettings = GenericTamaguiSettings,
931
+ S extends GenericSizing = GenericSizing,
902
932
  // preserve the raw animation driver keys ('default' | 'css' | etc)
903
933
  // defaults to string so generic TamaguiInternalConfig accepts any driver keys
904
934
  AnimDriverKeys extends string = string,
@@ -923,6 +953,7 @@ export type CreateTamaguiConfig<
923
953
  // phantom type for preserving driver keys - never set at runtime, only for type inference
924
954
  animationDriverKeys?: AnimDriverKeys
925
955
  settings: H
956
+ sizing: S
926
957
  }
927
958
 
928
959
  type GetLanguagePostfix<Set> = Set extends string
@@ -949,7 +980,7 @@ type GetLanguagePostfixes<F extends GenericFonts> = GetLanguagePostfix<keyof F>
949
980
  // body_en: any
950
981
  // }>['fonts']
951
982
 
952
- type ConfProps<A, B, C, D, E, F, I, V = undefined> = {
983
+ type ConfProps<A, B, C, D, E, F, I, S, V = undefined> = {
953
984
  tokens?: A
954
985
  themes?: B
955
986
  shorthands?: C
@@ -957,6 +988,7 @@ type ConfProps<A, B, C, D, E, F, I, V = undefined> = {
957
988
  animations?: E
958
989
  fonts?: F
959
990
  settings?: I
991
+ sizing?: S
960
992
  variables?: V
961
993
  }
962
994
 
@@ -1022,6 +1054,7 @@ export type InferTamaguiConfig<Conf> =
1022
1054
  infer E,
1023
1055
  infer F,
1024
1056
  infer H,
1057
+ infer S,
1025
1058
  infer V
1026
1059
  >
1027
1060
  ? TamaguiInternalConfig<
@@ -1032,6 +1065,7 @@ export type InferTamaguiConfig<Conf> =
1032
1065
  ExtractAnimationConfig<E>,
1033
1066
  F extends GenericFonts ? F : EmptyFonts,
1034
1067
  H extends GenericTamaguiSettings ? H : EmptyTamaguiSettings,
1068
+ S extends GenericSizing ? S : GenericSizing,
1035
1069
  ExtractAnimationDriverKeys<E>
1036
1070
  >
1037
1071
  : unknown
@@ -1204,8 +1238,9 @@ export interface GenericTamaguiSettings {
1204
1238
  * controls style semantics where React Native/Yoga and CSS differ.
1205
1239
  *
1206
1240
  * - "legacy": preserves Tamagui v1 flex expansion.
1207
- * - "react-native": follows React Native/Yoga flex and raw numeric lineHeight semantics.
1208
- * - "web": follows CSS flex and unitless numeric lineHeight semantics.
1241
+ * - "react-native": follows React Native/Yoga flex expansion.
1242
+ * - "web": follows CSS flex expansion.
1243
+ * numeric Tamagui lineHeight values are ratios in every mode.
1209
1244
  *
1210
1245
  * @default "web"
1211
1246
  */
@@ -1299,6 +1334,18 @@ export interface GenericTamaguiSettings {
1299
1334
  */
1300
1335
  onlyAllowShorthands?: boolean | undefined
1301
1336
 
1337
+ /**
1338
+ * Restrict conditional style values to one syntax. Flat values accept both
1339
+ * the string form (`bg="red hover:blue"`) and the object form
1340
+ * (`bg={{ base: 'red', hover: 'blue' }}`); set this to keep one of them,
1341
+ * which narrows the types, makes the runtime warn on the other in
1342
+ * development, and tells `tamagui generate-prompt` and the skills to only
1343
+ * show that form.
1344
+ *
1345
+ * @default undefined - both forms are allowed
1346
+ */
1347
+ styleValueSyntax?: 'string' | 'object' | undefined
1348
+
1302
1349
  /**
1303
1350
  * Define a default font, for better types and default font on Text
1304
1351
  */
@@ -1383,6 +1430,56 @@ export interface GenericTamaguiSettings {
1383
1430
  onlyShorthandStyleProps?: boolean
1384
1431
  }
1385
1432
 
1433
+ /** one rung of the control ladder: token keys, plus optional pinned geometry */
1434
+ export type SizeRecipe = {
1435
+ fontSize: string
1436
+ /**
1437
+ * the type-scale key the square controls (checkbox, radio, switch) size
1438
+ * from. Usually the rung's own name, but text deliberately steps down at
1439
+ * `md`/`lg` so buttons are not chunky while the squares stay on-scale.
1440
+ */
1441
+ controlFontSize: string
1442
+ paddingInline: string
1443
+ paddingBlock: string
1444
+ gap: string
1445
+ radius: string
1446
+ /**
1447
+ * explicit rung geometry, skipping derivation. For scales whose keys
1448
+ * cannot derive the ladder (v5's numeric scales pin the frozen heights
1449
+ * here so v5 apps never resize).
1450
+ */
1451
+ px?: {
1452
+ height: number
1453
+ icon: number
1454
+ square: number
1455
+ }
1456
+ }
1457
+
1458
+ /**
1459
+ * the user-configurable control ladder. Rung names become the accepted
1460
+ * `size` values (see ComponentSize); the px derivations in resolveSizing are
1461
+ * fixed formulas over the rung's tokens.
1462
+ */
1463
+ export type GenericSizing = {
1464
+ default: string
1465
+ sizes: Record<string, SizeRecipe>
1466
+ }
1467
+
1468
+ /**
1469
+ * the config's control size names: the default ladder plus any custom rungs
1470
+ * from `sizing.sizes`. Stays the five literals (never `string`) when no
1471
+ * custom config is registered.
1472
+ */
1473
+ export type ComponentSize =
1474
+ | 'xs'
1475
+ | 'sm'
1476
+ | 'md'
1477
+ | 'lg'
1478
+ | 'xl'
1479
+ | (string extends keyof TamaguiConfig['sizing']['sizes']
1480
+ ? never
1481
+ : Extract<keyof TamaguiConfig['sizing']['sizes'], string>)
1482
+
1386
1483
  export type TamaguiSettings = TamaguiConfig['settings']
1387
1484
 
1388
1485
  export type BaseStyleProps = {
@@ -1436,12 +1533,11 @@ export type CreateTamaguiProps = {
1436
1533
  settings?: Partial<GenericTamaguiSettings>
1437
1534
 
1438
1535
  /**
1439
- * Web-only: define text-selection CSS
1536
+ * the control size ladder: rung names become the accepted `size` values.
1537
+ * Spread `defaultSizing` and override `sizes` to add or retune rungs; the
1538
+ * px derivations are fixed formulas over each rung's tokens.
1440
1539
  */
1441
- selectionStyles?: (theme: Record<string, string>) => null | {
1442
- backgroundColor?: any
1443
- color?: any
1444
- }
1540
+ sizing?: GenericSizing
1445
1541
  }
1446
1542
 
1447
1543
  export type GetCSS = (opts?: {
@@ -1459,11 +1555,12 @@ export type TamaguiInternalConfig<
1459
1555
  E extends GenericAnimations = GenericAnimations,
1460
1556
  F extends GenericFonts = GenericFonts,
1461
1557
  G extends GenericTamaguiSettings = GenericTamaguiSettings,
1558
+ S extends GenericSizing = GenericSizing,
1462
1559
  // preserve the raw animation driver keys ('default' | 'css' | etc)
1463
1560
  // defaults to string so generic TamaguiInternalConfig accepts any driver keys
1464
1561
  AnimDriverKeys extends string = string,
1465
1562
  > = Omit<CreateTamaguiProps, keyof GenericTamaguiConfig> &
1466
- Omit<CreateTamaguiConfig<A, B, C, D, E, F, G, AnimDriverKeys>, 'tokens'> & {
1563
+ Omit<CreateTamaguiConfig<A, B, C, D, E, F, G, S, AnimDriverKeys>, 'tokens'> & {
1467
1564
  // TODO need to make it this but this breaks types, revisit
1468
1565
  // animations: E //AnimationDriver<E>
1469
1566
  tokens: Tokenify<A>
@@ -1478,6 +1575,7 @@ export type TamaguiInternalConfig<
1478
1575
  reactNative?: any
1479
1576
  fontSizeTokens: Set<string>
1480
1577
  settings: Omit<GenericTamaguiSettings, keyof G> & G
1578
+ sizing: Omit<GenericSizing, keyof S> & S
1481
1579
  defaultFont?: string
1482
1580
  defaultFontToken: `${string}`
1483
1581
  // multi-driver animation config (e.g., { default: motionDriver, css: cssDriver })
@@ -1496,7 +1594,7 @@ type GenericFontKey = string | number | symbol
1496
1594
  export type GenericFont<Key extends GenericFontKey = GenericFontKey> = {
1497
1595
  size: { [key in Key]: number | Variable }
1498
1596
  family?: string | Variable
1499
- lineHeight?: Partial<{ [key in Key]: number | Variable }> | undefined
1597
+ lineHeight?: Partial<{ [key in Key]: number | Px | `${number}` | Variable }> | undefined
1500
1598
  letterSpacing?: Partial<{ [key in Key]: number | Variable }> | undefined
1501
1599
  weight?: Partial<{ [key in Key]: number | string | Variable }> | undefined
1502
1600
  style?: Partial<{ [key in Key]: RNTextStyle['fontStyle'] | Variable }> | undefined
@@ -1553,75 +1651,90 @@ export type MatchMedia = (query: string) => MediaQueryList
1553
1651
 
1554
1652
  // createComponent props helpers
1555
1653
 
1556
- // transition="bouncy"
1557
- // transition={['bouncy', { }]}
1558
- // { all: 'name' }
1559
-
1560
1654
  // TODO can override for better types
1561
1655
  export type AnimationConfigType = any
1562
1656
 
1563
1657
  /**
1564
- * Spring configuration parameters that can override preset defaults.
1565
- * Use with array syntax: transition={['bouncy', { stiffness: 1000, damping: 70 }]}
1658
+ * Low-level spring physics. A projection of `duration` + `bounce`, not a second
1659
+ * way to configure a spring: whichever you author, the other is derived, and
1660
+ * every driver ends up with the same motion.
1661
+ *
1662
+ * Reach for this only when you are porting a config you already tuned.
1566
1663
  */
1567
1664
  export type TransitionSpringConfig = {
1568
1665
  stiffness?: number
1569
1666
  damping?: number
1570
1667
  mass?: number
1571
- tension?: number
1572
- friction?: number
1573
1668
  velocity?: number
1574
1669
  overshootClamping?: boolean
1575
- duration?: number
1576
- bounciness?: number
1577
- speed?: number
1670
+ restDisplacementThreshold?: number
1671
+ restSpeedThreshold?: number
1578
1672
  }
1579
1673
 
1580
1674
  /**
1581
- * A transition value: the name of a configured driver animation, or a raw CSS
1582
- * transition string such as `200ms` or `200ms hover:400ms`. The runtime accepts
1583
- * both — a name that is not a configured preset is treated as CSS — so the type
1584
- * must too. `(string & {})` keeps the preset names in autocomplete instead of
1585
- * collapsing the union to plain `string`.
1675
+ * A transition value: the name of a configured driver animation, or a CSS
1676
+ * transition string such as `200ms`, `200ms ease-out`, or
1677
+ * `opacity 150ms, transform 300ms`.
1678
+ *
1679
+ * Springs get a CSS-shaped function of their own: `spring(300ms, 0.4)` is a
1680
+ * 300ms spring with a bounce of 0.4. It works everywhere a timing function
1681
+ * does, including on the web, where it compiles to a `linear()` easing.
1682
+ *
1683
+ * A bare string that exactly matches a configured animation name is that
1684
+ * preset; everything else is CSS. `(string & {})` keeps preset names in
1685
+ * autocomplete instead of collapsing the union to plain `string`.
1586
1686
  */
1587
1687
  export type TransitionValue = TransitionKeys | (string & {})
1588
1688
 
1689
+ /**
1690
+ * The settings half of a transition object. Anything else in the object is a
1691
+ * style property name carrying its own transition.
1692
+ */
1693
+ export type TransitionConfig = {
1694
+ /** a configured animation to start from */
1695
+ preset?: TransitionKeys
1696
+ /** milliseconds, or a CSS time like `'200ms'` */
1697
+ duration?: number | string
1698
+ /**
1699
+ * Makes it a spring. `0` is critically damped (no overshoot), approaching
1700
+ * `1` is loose and oscillating, negative is sluggish. `duration` stays the
1701
+ * perceptual "how fast does this feel" number either way.
1702
+ */
1703
+ bounce?: number
1704
+ /** any CSS timing function. Mutually exclusive with `bounce`. */
1705
+ easing?: string
1706
+ /** milliseconds, or a CSS time */
1707
+ delay?: number | string
1708
+ behavior?: 'normal' | 'allow-discrete'
1709
+ /** the CSS `transition-property` list these settings apply to */
1710
+ properties?: string
1711
+ spring?: TransitionSpringConfig
1712
+ /** the transition to use while mounting, if it differs */
1713
+ enter?: TransitionProp
1714
+ /** the transition to use while unmounting, if it differs */
1715
+ exit?: TransitionProp
1716
+ }
1717
+
1718
+ /**
1719
+ * `transition` accepts a string or an object, and nothing else.
1720
+ *
1721
+ * ```tsx
1722
+ * transition="bouncy" // a configured preset
1723
+ * transition="200ms ease-out" // css
1724
+ * transition="opacity 150ms, transform spring(300ms, 0.4)"
1725
+ * transition={{ duration: 200, bounce: 0.15 }}
1726
+ * transition={{ preset: 'bouncy', opacity: '150ms' }} // per-property override
1727
+ * ```
1728
+ *
1729
+ * Per-property keys are later CSS entries, so they win for that property and
1730
+ * inherit nothing from the base, exactly as
1731
+ * `transition: all 200ms, opacity 150ms` behaves in a stylesheet.
1732
+ */
1589
1733
  export type TransitionProp =
1590
1734
  | TransitionValue
1591
- | ({
1592
- default?: TransitionValue
1593
- enter?: TransitionValue
1594
- exit?: TransitionValue
1595
- delay?: number
1596
- } & TransitionSpringConfig & {
1597
- [key: string]:
1598
- | TransitionValue
1599
- | {
1600
- type: TransitionValue
1601
- [key: string]: any
1602
- }
1603
- | number
1604
- | boolean
1605
- | undefined
1606
- })
1607
- | [
1608
- TransitionValue,
1609
- {
1610
- delay?: number
1611
- enter?: TransitionValue
1612
- exit?: TransitionValue
1613
- } & TransitionSpringConfig & {
1614
- [key: string]:
1615
- | TransitionValue
1616
- | {
1617
- type?: TransitionValue
1618
- [key: string]: any
1619
- }
1620
- | number
1621
- | boolean
1622
- | undefined
1623
- },
1624
- ]
1735
+ | (TransitionConfig & {
1736
+ [property: string]: TransitionValue | TransitionConfig | unknown
1737
+ })
1625
1738
 
1626
1739
  /**
1627
1740
  * Emitted by the animation driver at the start and end of a transition.
@@ -1661,6 +1774,11 @@ export type SomewhatSpecificColorValue =
1661
1774
  | (`#${string}` & {})
1662
1775
 
1663
1776
  type WebOnlySizeValue =
1777
+ | `${number}px`
1778
+ | `${number}em`
1779
+ | `${number}ch`
1780
+ | `${number}vmin`
1781
+ | `${number}vmax`
1664
1782
  | `${number}vw`
1665
1783
  | `${number}dvw`
1666
1784
  | `${number}lvw`
@@ -1672,6 +1790,7 @@ type WebOnlySizeValue =
1672
1790
  | `calc(${string})`
1673
1791
  | `min(${string})`
1674
1792
  | `max(${string})`
1793
+ | `clamp(${string})`
1675
1794
  | 'max-content'
1676
1795
  | 'min-content'
1677
1796
 
@@ -1680,6 +1799,37 @@ type UserAllowedStyleValuesSetting = Exclude<
1680
1799
  undefined
1681
1800
  >
1682
1801
 
1802
+ /**
1803
+ * A flat value string that carries a clause (`red hover:blue`, `dark:red`)
1804
+ * or a multi-token payload (`1px solid red`). Its grammar is validated by the
1805
+ * language service and the runtime, not by the type system. With
1806
+ * `styleValueSyntax: 'object'` the `:` arm is dropped, so a clause-only
1807
+ * string like `hover:red` is a type error (a clause after a space still
1808
+ * passes through the multi-token arm).
1809
+ */
1810
+ export type FlatClauseString =
1811
+ | `${string} ${string}`
1812
+ | (StyleValueSyntaxSetting extends 'object' ? never : `${string}:${string}`)
1813
+
1814
+ type StyleValueSyntaxSetting = TamaguiSettings extends { styleValueSyntax: infer S }
1815
+ ? S
1816
+ : undefined
1817
+
1818
+ /**
1819
+ * The open string arm every style value carries. With no `allowedStyleValues`
1820
+ * setting (or a boolean one) it is `string & {}`, so any string is accepted.
1821
+ * With a strictness setting, a single-token string (no space, no `:`) has to
1822
+ * be a token, theme value, or a value the setting allows, so a typo like
1823
+ * `bg="backgroun"` is a type error; only clause strings stay open.
1824
+ */
1825
+ export type OpenStyleString = TamaguiSettings extends {
1826
+ allowedStyleValues: infer Setting
1827
+ }
1828
+ ? Setting extends boolean
1829
+ ? UnionableString
1830
+ : FlatClauseString
1831
+ : UnionableString
1832
+
1683
1833
  export type GetThemeValueSettingForCategory<
1684
1834
  Cat extends keyof AllowedStyleValuesSettingPerCategory,
1685
1835
  > = UserAllowedStyleValuesSetting extends AllowedValueSettingBase | undefined
@@ -1774,7 +1924,7 @@ export type GetTokenString<A> = A extends string | number ? `${A}` : string
1774
1924
  export type Size =
1775
1925
  | ThemeValueFallbackSize
1776
1926
  | GetTokenString<keyof Tokens['size']>
1777
- | (string & {})
1927
+ | OpenStyleString
1778
1928
  | true
1779
1929
 
1780
1930
  export type SizeTokens = Size
@@ -1799,7 +1949,7 @@ export type Color =
1799
1949
  | TokenWithOpacity
1800
1950
  // clause-bearing values are intentionally open-ended; the language service
1801
1951
  // validates the grammar without materializing a combinatorial type union
1802
- | (string & {})
1952
+ | OpenStyleString
1803
1953
 
1804
1954
  export type ColorTokens = Color
1805
1955
 
@@ -1862,6 +2012,8 @@ export type FontSizeTokens = FontSize
1862
2012
  export type FontLineHeightTokens =
1863
2013
  | GetTokenString<GetTokenFontKeysFor<'lineHeight'>>
1864
2014
  | number
2015
+ | Px
2016
+ | `${number}`
1865
2017
  | RemString
1866
2018
  export type FontWeightValues =
1867
2019
  | `${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}00`
@@ -1938,6 +2090,14 @@ export type LineHeightKeys = 'lineHeight'
1938
2090
  export type ZIndexKeys = 'zIndex'
1939
2091
  export type OpacityKeys = 'opacity'
1940
2092
 
2093
+ type FontStyleValueFallback = GetThemeValueFallbackFor<
2094
+ AllowedValueSettingSize,
2095
+ never,
2096
+ never,
2097
+ never,
2098
+ WebStyleValueUniversal | `${number}%`
2099
+ >
2100
+
1941
2101
  export type ThemeValueGet<K extends string | number | symbol> = K extends 'theme'
1942
2102
  ? ThemeTokens
1943
2103
  : K extends SizeKeys
@@ -1945,7 +2105,7 @@ export type ThemeValueGet<K extends string | number | symbol> = K extends 'theme
1945
2105
  : K extends FontKeys
1946
2106
  ? FontTokens
1947
2107
  : K extends FontSizeKeys
1948
- ? FontSizeTokens
2108
+ ? FontSizeTokens | FontStyleValueFallback
1949
2109
  : K extends `${`border${string | ''}Radius`}`
1950
2110
  ? RadiusTokens
1951
2111
  : K extends SpaceKeys
@@ -1957,7 +2117,7 @@ export type ThemeValueGet<K extends string | number | symbol> = K extends 'theme
1957
2117
  : K extends ZIndexKeys
1958
2118
  ? ZIndexTokens
1959
2119
  : K extends LineHeightKeys
1960
- ? FontLineHeightTokens
2120
+ ? FontLineHeightTokens | FontStyleValueFallback
1961
2121
  : K extends FontWeightKeys
1962
2122
  ? FontWeightTokens
1963
2123
  : K extends FontLetterSpacingKeys
@@ -2047,22 +2207,25 @@ type FlatClauseName =
2047
2207
  * string members ('unset', a fallback union) stop being assignable across
2048
2208
  * package boundaries.
2049
2209
  */
2050
- export type FlatStyleObject<T> = { default?: T | (string & {}) } & {
2051
- [K in FlatClauseName]?: T | (string & {})
2210
+ export type FlatStyleObject<T> = { default?: T | OpenStyleString } & {
2211
+ [K in FlatClauseName]?: T | OpenStyleString
2052
2212
  }
2053
2213
 
2054
2214
  /**
2055
- * The string arm stays at base values only: `(string & {})` admits every
2215
+ * The string arm stays at base values only: `OpenStyleString` admits every
2056
2216
  * clause string, and structured clause completion comes from the object
2057
2217
  * form's keys (and the language-service plugin for strings). A per-prop
2058
2218
  * `${modifier}:` prefix union used to ride along for first-prefix
2059
2219
  * completion; it multiplied across the whole component prop graph and the
2060
2220
  * object form made it redundant.
2061
2221
  */
2062
- export type FlatStyleValue<T> = T | FlatStyleObject<T> | (string & {})
2222
+ export type FlatStyleValue<T> =
2223
+ | T
2224
+ | (StyleValueSyntaxSetting extends 'string' ? never : FlatStyleObject<T>)
2225
+ | OpenStyleString
2063
2226
 
2064
2227
  export type WithThemeValues<T extends object> = {
2065
- [K in keyof T]:
2228
+ -readonly [K in keyof T]:
2066
2229
  | (ThemeValueGet<K> extends never
2067
2230
  ? K extends keyof ExtraBaseProps
2068
2231
  ? T[K]
@@ -2129,10 +2292,10 @@ export type WithThemeAndShorthands<
2129
2292
  A extends object,
2130
2293
  Variants = {},
2131
2294
  > = OnlyAllowShorthands extends true
2132
- ? WithThemeValues<MaybeOmitLonghands<Omit<A, Longhands>>> &
2295
+ ? WithThemeValues<MaybeOmitLonghands<Omit<A, Longhands | keyof Variants>>> &
2133
2296
  WithFlatVariantValues<Variants> &
2134
2297
  WithShorthands<WithThemeValues<A>>
2135
- : WithThemeValues<MaybeOmitLonghands<A>> &
2298
+ : WithThemeValues<MaybeOmitLonghands<Omit<A, keyof Variants>>> &
2136
2299
  WithFlatVariantValues<Variants> &
2137
2300
  WithShorthands<WithThemeValues<A>>
2138
2301
 
@@ -2150,13 +2313,13 @@ type TwoValueTransformOrigin = `${PxOrPct | 'left' | 'center' | 'right'} ${
2150
2313
 
2151
2314
  export interface TransformStyleProps {
2152
2315
  /**
2153
- * Maps to translateX
2316
+ * Maps to translateX. A percent string is relative to the element's own width.
2154
2317
  */
2155
- x?: number
2318
+ x?: number | `${number}%`
2156
2319
  /**
2157
- * Maps to translateY
2320
+ * Maps to translateY. A percent string is relative to the element's own height.
2158
2321
  */
2159
- y?: number
2322
+ y?: number | `${number}%`
2160
2323
  perspective?: number
2161
2324
  scale?: number
2162
2325
  scaleX?: number
@@ -2284,15 +2447,27 @@ interface ExtraStyleProps {
2284
2447
  * backgroundColor and drops url()/gradient/multi-part values it can't express.
2285
2448
  *
2286
2449
  * The v6 shorthands map `bg` here rather than to `backgroundColor`, because
2287
- * the background family splits a value like `url(x.png) color1` across
2450
+ * the background family splits a value like `url(x.png) color-1` across
2288
2451
  * backgroundImage and backgroundColor. Color tokens lead the union so `bg`
2289
- * completes them; `Properties['background']` keeps the CSS shorthand
2290
- * keywords. Adding this key to `ColorKeys` instead would erase that second
2291
- * arm, since that path runs the value type through `Exclude<T[K], string>`.
2292
- */
2293
- background?: ColorTokens | Properties['background']
2294
- /**
2295
- * Web-only style property. Will be omitted on native.
2452
+ * completes them; the CSS keywords and the function forms (`url()`,
2453
+ * gradients) keep the CSS shorthand, and multi-part values reach
2454
+ * `OpenStyleString` through their spaces. Adding this key to `ColorKeys`
2455
+ * instead would erase the CSS arm, since that path runs the value type
2456
+ * through `Exclude<T[K], string>`.
2457
+ */
2458
+ background?:
2459
+ | ColorTokens
2460
+ | Exclude<ThemeValueFallbackColor, number>
2461
+ | 'none'
2462
+ | 'inherit'
2463
+ | 'initial'
2464
+ | 'unset'
2465
+ | 'revert'
2466
+ | `${string}(${string})`
2467
+ | OpenStyleString
2468
+ /**
2469
+ * css background image. native maps supported linear gradients to
2470
+ * experimental_backgroundImage and drops values it cannot represent.
2296
2471
  */
2297
2472
  backgroundImage?: Properties['backgroundImage']
2298
2473
  /**
@@ -2347,6 +2522,8 @@ interface ExtraStyleProps {
2347
2522
  * Web-only style property. Will be omitted on native.
2348
2523
  */
2349
2524
  resize?: Properties['resize']
2525
+ /** react-native stops at visible/hidden/scroll; web also accepts auto and clip */
2526
+ overflow?: 'visible' | 'hidden' | 'scroll' | 'auto' | 'clip'
2350
2527
  /**
2351
2528
  * Web-only style property. Will be omitted on native.
2352
2529
  */
@@ -2601,6 +2778,7 @@ interface ExtraStyleProps {
2601
2778
  borderInlineWidth?: SpaceTokens | number
2602
2779
  borderInlineStartWidth?: SpaceTokens | number
2603
2780
  borderInlineEndWidth?: SpaceTokens | number
2781
+ borderStyle?: ViewStyle['borderStyle'] | 'none' | 'hidden'
2604
2782
  borderBlockStyle?: ViewStyle['borderStyle']
2605
2783
  borderBlockStartStyle?: ViewStyle['borderStyle']
2606
2784
  borderBlockEndStyle?: ViewStyle['borderStyle']
@@ -2640,12 +2818,6 @@ interface ExtraBaseProps {
2640
2818
  */
2641
2819
  transition?: TransitionProp | null
2642
2820
 
2643
- /**
2644
- * Pass an array of strings containing the long style property names
2645
- * which will be exclusively transitioned.
2646
- */
2647
- animateOnly?: string[]
2648
-
2649
2821
  /**
2650
2822
  * If you'd like this component to not attach to the nearest parent AnimatePresence,
2651
2823
  * set this to `false` and it will pass through to the next animated child.
@@ -2672,16 +2844,54 @@ interface ExtendedBaseProps
2672
2844
  ExtendBaseStackProps,
2673
2845
  ExtraStyleProps,
2674
2846
  ExtraBaseProps {
2675
- display?: 'inherit' | 'none' | 'inline' | 'block' | 'contents' | 'flex' | 'inline-flex'
2847
+ display?:
2848
+ | 'inherit'
2849
+ | 'none'
2850
+ | 'inline'
2851
+ | 'block'
2852
+ | 'inline-block'
2853
+ | 'contents'
2854
+ | 'flex'
2855
+ | 'inline-flex'
2856
+ | 'grid'
2857
+ | 'inline-grid'
2676
2858
  // extends RN's position to include 'fixed' (converted to 'absolute' on native)
2677
2859
  position?: 'absolute' | 'relative' | 'fixed' | 'static' | 'sticky'
2678
2860
  }
2679
2861
 
2680
2862
  export interface StackStyleBase
2681
- extends Omit<ViewStyle, keyof ExtendedBaseProps | 'elevation'>, ExtendedBaseProps {}
2863
+ extends
2864
+ Omit<ViewStyle, keyof ExtendedBaseProps | 'elevation'>,
2865
+ ExtendedBaseProps,
2866
+ Omit<
2867
+ UnprefixedCSSProperties,
2868
+ keyof ViewStyle | keyof ExtendedBaseProps | keyof TamaguiComponentPropsBaseBase
2869
+ > {}
2682
2870
 
2683
2871
  export interface TextStylePropsBase
2684
- extends Omit<RNTextStyle, keyof ExtendedBaseProps>, ExtendedBaseProps {
2872
+ extends
2873
+ Omit<
2874
+ RNTextStyle,
2875
+ keyof ExtendedBaseProps | 'fontVariant' | 'lineHeight' | 'includeFontPadding'
2876
+ >,
2877
+ ExtendedBaseProps,
2878
+ Omit<
2879
+ UnprefixedCSSProperties,
2880
+ | keyof RNTextStyle
2881
+ | keyof ExtendedBaseProps
2882
+ | keyof TamaguiComponentPropsBaseBase
2883
+ | 'textShadow'
2884
+ | 'textDecoration'
2885
+ | 'font'
2886
+ > {
2887
+ lineHeight?: number | Px | `${number}`
2888
+ /**
2889
+ * react-native types this as a mutable `FontVariant[]`, which an `as const` variant
2890
+ * definition can't satisfy — and a variants object that misses its constraint is
2891
+ * silently discarded whole, taking every variant on the component with it (#2787).
2892
+ * react-native types `transform` as readonly for the same reason.
2893
+ */
2894
+ fontVariant?: readonly FontVariant[]
2685
2895
  ellipsis?: boolean
2686
2896
  numberOfLines?: number
2687
2897
  textDecorationDistance?: number
@@ -2699,8 +2909,7 @@ export interface TextStylePropsBase
2699
2909
  */
2700
2910
  textDecoration?: string
2701
2911
  /**
2702
- * CSS font shorthand string ("italic bold 16px/1.5 Inter").
2703
- * Splits by the CSS micro-syntax; ambiguous forms stay unparsed.
2912
+ * css font shorthand string, browser-only and dropped on native.
2704
2913
  */
2705
2914
  font?: string
2706
2915
  }
@@ -2731,7 +2940,7 @@ export interface StackNonStyleProps
2731
2940
  | 'pointerEvents'
2732
2941
  | 'display'
2733
2942
  | 'children'
2734
- | keyof TamaguiComponentPropsBaseBase
2943
+ | keyof TamaguiComponentPropsBase
2735
2944
  // these are added back in by core
2736
2945
  | RNOnlyProps
2737
2946
  | keyof ExtendBaseStackProps
@@ -2761,7 +2970,7 @@ export interface TextNonStyleProps
2761
2970
  Omit<
2762
2971
  ReactTextProps,
2763
2972
  | 'children'
2764
- | keyof WebOnlyPressEvents
2973
+ | keyof TamaguiComponentPropsBase
2765
2974
  // these are added back in by core
2766
2975
  | RNOnlyProps
2767
2976
  | keyof ExtendBaseTextProps
@@ -2802,11 +3011,18 @@ export type StyledHOCMergedProps<Props, CustomProps> = keyof CustomProps extends
2802
3011
  ? Props
2803
3012
  : Omit<Props, keyof CustomProps> & CustomProps
2804
3013
 
3014
+ // declared receiver props keep their type when a new css name joins the style
3015
+ // surface. variants remain the explicit owner over either source.
2805
3016
  export type GetFinalProps<NonStyleProps, StylePropsBase, Variants> = Omit<
2806
3017
  NonStyleProps,
2807
- keyof StylePropsBase | keyof Variants
3018
+ keyof Variants
2808
3019
  > &
2809
- (StylePropsBase extends object ? WithThemeAndShorthands<StylePropsBase, Variants> : {})
3020
+ (StylePropsBase extends object
3021
+ ? Omit<
3022
+ WithThemeAndShorthands<StylePropsBase, Variants>,
3023
+ Exclude<keyof NonStyleProps, keyof Variants>
3024
+ >
3025
+ : {})
2810
3026
 
2811
3027
  export type TamaguiComponent<
2812
3028
  Props = any,
@@ -2967,6 +3183,7 @@ export type GetStyleState = {
2967
3183
  conf: TamaguiInternalConfig
2968
3184
  avoidMergeTransform?: boolean
2969
3185
  fontFamily?: string
3186
+ nativeLineHeight?: unknown
2970
3187
  debug?: DebugProp
2971
3188
  transformAccumulator?: TransformAccumulator
2972
3189
  // direct flat-value scan context and its subscription output
@@ -3091,6 +3308,8 @@ export type StaticConfigPublic = {
3091
3308
  }
3092
3309
 
3093
3310
  type StaticConfigBase = StaticConfigPublic & {
3311
+ // native DOM primitives own text inheritance and receive semantic metrics separately.
3312
+ isDOM?: boolean
3094
3313
  Component?: FunctionComponent<any> & StaticComponentObject<any, any, any, any, any, any>
3095
3314
 
3096
3315
  displayName?: string
@@ -3195,6 +3414,7 @@ export type StyledDynamicEnv = {
3195
3414
  fonts: TamaguiConfig['fonts']
3196
3415
  tokens: TokensParsed
3197
3416
  theme: Themes extends { [key: string]: infer B } ? B : unknown
3417
+ sizing: GenericSizing
3198
3418
  fontFamily?: FontFamilyTokens
3199
3419
  font?: Font
3200
3420
  }
@@ -3233,39 +3453,74 @@ export type VariantDefinitions<
3233
3453
  }
3234
3454
  ? S
3235
3455
  : {},
3236
- MyProps extends object = Partial<
3237
- GetVariantProps<
3238
- Parent,
3239
- StaticConfig['isText'] extends true
3240
- ? true
3241
- : StaticConfig['isInput'] extends true
3242
- ? true
3243
- : false
3244
- >
3245
- >,
3456
+ MyProps extends object = VariantStyleProps<Parent, StaticConfig>,
3246
3457
  Val = any,
3247
3458
  > = VariantDefinitionFromProps<MyProps, Val> & {
3248
3459
  _isEmpty?: 1
3249
3460
  }
3250
3461
 
3462
+ // the color style props only an input takes (runtime stylePropsInput)
3463
+ export type InputColorStyleProps = {
3464
+ placeholderTextColor?: ColorStyleProp
3465
+ selectionColor?: ColorStyleProp
3466
+ cursorColor?: ColorStyleProp
3467
+ selectionHandleColor?: ColorStyleProp
3468
+ }
3469
+
3470
+ export type VariantStyleProps<
3471
+ Parent extends StylableComponent,
3472
+ StaticConfig extends StaticConfigPublic,
3473
+ > = Partial<
3474
+ GetVariantProps<
3475
+ Parent,
3476
+ StaticConfig['isText'] extends true
3477
+ ? true
3478
+ : StaticConfig['isInput'] extends true
3479
+ ? true
3480
+ : false
3481
+ >
3482
+ > &
3483
+ (GetStaticConfig<Parent, StaticConfig>['isInput'] extends true
3484
+ ? InputColorStyleProps
3485
+ : {})
3486
+
3487
+ /**
3488
+ * the exact-key check styled() runs on the variants it infers: a key that is
3489
+ * not a style, shorthand, aria/data attribute, or variant of the component is
3490
+ * `never`, since inference alone never flags extra keys.
3491
+ */
3492
+ export type StyleOnlyVariants<Variants, AllowedKeys extends PropertyKey> = {
3493
+ [Name in keyof Variants]: Variants[Name] extends StyledDynamic<any, any>
3494
+ ? Variants[Name]
3495
+ : {
3496
+ [Value in keyof Variants[Name]]: Variants[Name][Value] extends object
3497
+ ? {
3498
+ [Key in keyof Variants[Name][Value]]: Key extends
3499
+ | AllowedKeys
3500
+ | keyof Variants
3501
+ | `aria-${string}`
3502
+ | `data-${string}`
3503
+ ? Variants[Name][Value][Key]
3504
+ : never
3505
+ }
3506
+ : Variants[Name][Value]
3507
+ }
3508
+ }
3509
+
3251
3510
  export type StaticStyleInput = string
3252
3511
 
3512
+ // variants are styles only: a variant value holds style props and the parent's
3513
+ // variants, never a non-style prop such as theme. a component that changes
3514
+ // theme with a variant does it one level up, as a theme prop.
3253
3515
  export type GetVariantProps<
3254
3516
  A extends StylableComponent,
3255
3517
  IsText extends boolean | undefined,
3256
3518
  > = A extends {
3257
- __tama: [
3258
- infer Props,
3259
- any,
3260
- infer NonStyledProps,
3261
- infer BaseStyles,
3262
- infer VariantProps,
3263
- any,
3264
- ]
3519
+ __tama: [any, any, any, infer BaseStyles, infer VariantProps, any]
3265
3520
  }
3266
- ? Props extends TamaDefer
3267
- ? GetFinalProps<NonStyledProps, BaseStyles, VariantProps>
3268
- : Props
3521
+ ? BaseStyles extends object
3522
+ ? WithThemeAndShorthands<BaseStyles, VariantProps>
3523
+ : {}
3269
3524
  : WithThemeAndShorthands<IsText extends true ? TextStylePropsBase : StackStyleBase>
3270
3525
 
3271
3526
  export type VariantDefinitionFromProps<MyProps, Val> = MyProps extends object
@@ -3319,6 +3574,10 @@ export type SplitStyleProps = {
3319
3574
  canPlatformPseudo?: boolean
3320
3575
  isAnimated: boolean
3321
3576
  isExiting?: boolean
3577
+ // native style stability: previous render's resolved style object, used to
3578
+ // return the same reference when the resolved values haven't changed (avoids
3579
+ // React Native's diffNestedProperty + cloneNodeWithNewProps on every re-render)
3580
+ prevStyle?: Record<string, any> | null
3322
3581
  }
3323
3582
 
3324
3583
  // Presence
@@ -3405,6 +3664,19 @@ type AnimationDriverBase<A extends AnimationConfig = AnimationConfig> = {
3405
3664
  animations: A
3406
3665
  View?: any
3407
3666
  Text?: any
3667
+ useTextMetrics?: (input: {
3668
+ inheritedText?: AnimatedTextChannel | null
3669
+ lineHeight?: NativeTextMetrics['lineHeight']
3670
+ }) => {
3671
+ textChannel: AnimatedTextChannel | null
3672
+ } & (
3673
+ | { style: null }
3674
+ | {
3675
+ style: Record<string, unknown>
3676
+ Text: ComponentType<any>
3677
+ TextInput: ComponentType<any>
3678
+ }
3679
+ )
3408
3680
  }
3409
3681
 
3410
3682
  export type AnimationDriver<A extends AnimationConfig = AnimationConfig> =
@@ -3445,11 +3717,13 @@ type UseStyleListener = (
3445
3717
  // true while a self pseudo (hover/press/focus) is active. lets avoidReRenders drivers know
3446
3718
  // the emitted style is a transient pseudo override that a real re-render must not be allowed
3447
3719
  // to reconcile away, vs the no-pseudo base which renders own again.
3448
- pseudoActive?: boolean
3720
+ pseudoActive?: boolean,
3721
+ nativeTextMetrics?: NativeTextMetrics
3449
3722
  ) => void
3450
3723
  export type UseStyleEmitter = (cb: UseStyleListener) => void
3451
3724
 
3452
3725
  export type UseAnimationHook = (props: {
3726
+ inheritedText?: AnimatedTextChannel | null
3453
3727
  style: Record<string, any>
3454
3728
  props: Record<string, any>
3455
3729
  styleState?: GetStyleResult | null
@@ -3464,24 +3738,29 @@ export type UseAnimationHook = (props: {
3464
3738
  onTransition?: OnTransition
3465
3739
  delay?: number
3466
3740
  }) => null | {
3741
+ textChannel?: AnimatedTextChannel | null
3467
3742
  style?: unknown
3468
3743
  className?: string
3469
3744
  ref?: any
3470
3745
  }
3471
3746
 
3472
3747
  export type GestureReponderEvent =
3473
- Exclude<View['props']['onResponderMove'], void> extends (event: infer Event) => void
3748
+ Exclude<ViewProps['onResponderMove'], void> extends (event: infer Event) => void
3474
3749
  ? Event
3475
3750
  : never
3476
3751
 
3477
3752
  export type RulesToInsert = Record<string, StyleObject>
3478
3753
 
3479
3754
  export type GetStyleResult = {
3480
- style: ViewStyle | null
3755
+ style: { -readonly [K in keyof ViewStyle]: ViewStyle[K] } | null
3481
3756
  classNames: ClassNamesObject
3482
3757
  rulesToInsert: RulesToInsert
3483
- viewProps: (StackNonStyleProps & StackStyle) & Record<string, any>
3758
+ viewProps: {
3759
+ -readonly [K in keyof (StackNonStyleProps & StackStyle)]: (StackNonStyleProps &
3760
+ StackStyle)[K]
3761
+ } & Record<string, any>
3484
3762
  fontFamily: string | undefined
3763
+ nativeTextMetrics?: NativeTextMetrics
3485
3764
  space?: any // SpaceTokens?
3486
3765
  hasMedia: boolean | Set<string>
3487
3766
  pseudoGroups?: Set<string>
@@ -3560,8 +3839,9 @@ export type StyleProp<T> =
3560
3839
  | T
3561
3840
  | StylePiece
3562
3841
  | RegisteredStyle<T>
3563
- | RecursiveArray<T | StylePiece | RegisteredStyle<T> | Falsy>
3842
+ | ReadonlyArray<StyleProp<T>>
3564
3843
  | Falsy
3844
+ | void
3565
3845
 
3566
3846
  export type FillInFont<A extends GenericFont, DefaultKeys extends string | number> = {
3567
3847
  family: string