@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
@@ -0,0 +1,167 @@
1
+ import { getConfig } from '../config'
2
+ import { getVariableValue } from '../createVariable'
3
+ import type {
4
+ ComponentSize,
5
+ Font,
6
+ GenericSizing,
7
+ SizeRecipe,
8
+ TamaguiConfig,
9
+ TokensParsed,
10
+ } from '../types'
11
+
12
+ /** the env slice resolveSizing reads: a styled.dynamic env or hand-built */
13
+ export type SizingEnv = {
14
+ sizing: GenericSizing
15
+ fonts: TamaguiConfig['fonts']
16
+ tokens: TokensParsed
17
+ font?: Font
18
+ }
19
+
20
+ /**
21
+ * the default control ladder, transcribed from the Button frame/text tables
22
+ * so the derived px are identical by construction. v6 re-exports this;
23
+ * resolveSizing falls back to it when a config carries no `sizing`.
24
+ */
25
+ export const defaultSizing = {
26
+ default: 'md',
27
+ sizes: {
28
+ xs: {
29
+ fontSize: 'xs',
30
+ controlFontSize: 'xs',
31
+ paddingInline: '2',
32
+ paddingBlock: '1',
33
+ gap: '1',
34
+ radius: 'sm',
35
+ },
36
+ sm: {
37
+ fontSize: 'sm',
38
+ controlFontSize: 'sm',
39
+ paddingInline: '3',
40
+ paddingBlock: '1.5',
41
+ gap: '1.5',
42
+ radius: 'md',
43
+ },
44
+ md: {
45
+ fontSize: 'sm',
46
+ controlFontSize: 'base',
47
+ paddingInline: '4',
48
+ paddingBlock: '2',
49
+ gap: '2',
50
+ radius: 'md',
51
+ },
52
+ lg: {
53
+ fontSize: 'base',
54
+ controlFontSize: 'lg',
55
+ paddingInline: '6',
56
+ paddingBlock: '2',
57
+ gap: '2',
58
+ radius: 'md',
59
+ },
60
+ xl: {
61
+ fontSize: 'lg',
62
+ controlFontSize: 'xl',
63
+ paddingInline: '8',
64
+ paddingBlock: '2.5',
65
+ gap: '2.5',
66
+ radius: 'lg',
67
+ },
68
+ },
69
+ } as const satisfies GenericSizing
70
+
71
+ /** a rung resolved: token keys stay keys, geometry is px */
72
+ export type ResolvedSizing = {
73
+ /** the rung that rendered (degrades to the default in production) */
74
+ name: string
75
+ fontSize: string
76
+ lineHeight: string
77
+ paddingInline: string
78
+ paddingBlock: string
79
+ gap: string
80
+ radius: string
81
+ /** text line box plus vertical padding, before any border */
82
+ height: number
83
+ /** icon px for the rung */
84
+ icon: number
85
+ /** the square controls: checkbox box, radio circle, switch track height */
86
+ square: number
87
+ }
88
+
89
+ const toPx = (value: unknown): number =>
90
+ typeof value === 'number' ? value : Number.parseFloat(value as string)
91
+
92
+ /**
93
+ * a size name -> its rung resolved to pixels, against the sizing in `env`.
94
+ * `true`/absent resolve to the default rung, `false` to no styles. Without
95
+ * an env (plain render code, no styled.dynamic callback) it reads the active
96
+ * config and default font: a sync global read, not a subscription, so static
97
+ * sizes never re-render on media or theme changes. Unknown names resolve to
98
+ * no styles, exactly like a miss in the old static tables: numeric sizes and
99
+ * cascaded values pass through variants that do not know them, and must never
100
+ * throw. A rung pointing at missing tokens is a broken config: it warns in
101
+ * development and resolves to no styles.
102
+ */
103
+ export function resolveSizing(size: false, env?: SizingEnv): undefined
104
+ export function resolveSizing(
105
+ size: ComponentSize | true | undefined,
106
+ env?: SizingEnv
107
+ ): ResolvedSizing
108
+ export function resolveSizing(
109
+ size: ComponentSize | boolean | undefined,
110
+ env?: SizingEnv
111
+ ): ResolvedSizing | undefined
112
+ export function resolveSizing(
113
+ size: ComponentSize | boolean | undefined,
114
+ env?: SizingEnv
115
+ ): ResolvedSizing | undefined {
116
+ if (size === false) return undefined
117
+ const conf = env?.fonts && env?.tokens ? undefined : getConfig()
118
+ const sizing = { ...defaultSizing, ...(env?.sizing ?? conf?.sizing) }
119
+ const name = size === true || size == null ? sizing.default : size
120
+ const rung: SizeRecipe | undefined = sizing.sizes[name]
121
+ if (!rung) return undefined
122
+
123
+ const keys = {
124
+ fontSize: rung.fontSize,
125
+ lineHeight: rung.fontSize,
126
+ paddingInline: rung.paddingInline,
127
+ paddingBlock: rung.paddingBlock,
128
+ gap: rung.gap,
129
+ radius: rung.radius,
130
+ }
131
+ // an explicit rung geometry wins over derivation (v5 pins its heights)
132
+ if (rung.px) {
133
+ return {
134
+ name,
135
+ ...keys,
136
+ height: rung.px.height,
137
+ icon: rung.px.icon,
138
+ square: rung.px.square,
139
+ }
140
+ }
141
+
142
+ const fonts = env?.fonts ?? conf?.fontsParsed
143
+ const tokens = env?.tokens ?? conf?.tokensParsed
144
+ const font = env?.font ?? fonts?.[conf?.defaultFontToken ?? 'body']
145
+ const px = {
146
+ fontSize: toPx(getVariableValue(font?.size?.[rung.fontSize])),
147
+ control: toPx(getVariableValue(font?.size?.[rung.controlFontSize])),
148
+ lineHeight: toPx(getVariableValue(font?.lineHeight?.[rung.fontSize])),
149
+ paddingBlock: toPx(getVariableValue(tokens?.space?.[rung.paddingBlock])),
150
+ }
151
+ if (!Object.values(px).every(Number.isFinite)) {
152
+ if (process.env.NODE_ENV === 'development') {
153
+ console.warn(
154
+ `[tamagui] size "${name}" references a missing token (fontSize "${rung.fontSize}", controlFontSize "${rung.controlFontSize}", paddingBlock "${rung.paddingBlock}"); resolving to no styles`
155
+ )
156
+ }
157
+ return undefined
158
+ }
159
+
160
+ return {
161
+ name,
162
+ ...keys,
163
+ height: px.lineHeight + px.paddingBlock * 2,
164
+ icon: Math.ceil(px.fontSize / 4) * 4,
165
+ square: Math.round(px.control * 1.4),
166
+ }
167
+ }
@@ -6,26 +6,30 @@ export function resolveVariableValue(
6
6
  valOrVar: Variable | any,
7
7
  resolveValues?: ResolveVariableAs
8
8
  ) {
9
- if (resolveValues === 'none') {
9
+ if (resolveValues === 'none' || !isVariable(valOrVar)) {
10
10
  return valOrVar
11
11
  }
12
- if (isVariable(valOrVar)) {
13
- if (resolveValues === 'value') {
14
- return valOrVar.val
15
- }
16
-
12
+ let value
13
+ if (resolveValues === 'value') {
14
+ value = valOrVar.val
15
+ } else {
17
16
  // @ts-expect-error dynamic variables may expose a platform-aware getter
18
- const get = valOrVar?.get
19
-
20
- // shadowColor doesn't support dynamic style
21
- if (process.env.TAMAGUI_TARGET !== 'native' || key !== 'shadowColor') {
22
- if (typeof get === 'function') {
23
- const resolveDynamicFor = resolveValues === 'web' ? 'web' : undefined
24
- return get(resolveDynamicFor)
25
- }
26
- }
17
+ const get = valOrVar.get
27
18
 
28
- return process.env.TAMAGUI_TARGET === 'native' ? valOrVar.val : valOrVar.variable
19
+ // compound CSS strings cannot contain native dynamic color objects.
20
+ const needsLiteralColor =
21
+ key === 'shadowColor' ||
22
+ key === 'boxShadow' ||
23
+ key === 'textShadow' ||
24
+ key === 'backgroundImage'
25
+ value =
26
+ (process.env.TAMAGUI_TARGET !== 'native' || !needsLiteralColor) &&
27
+ typeof get === 'function'
28
+ ? get(resolveValues === 'web' ? 'web' : undefined)
29
+ : process.env.TAMAGUI_TARGET === 'native'
30
+ ? valOrVar.val
31
+ : valOrVar.variable
29
32
  }
30
- return valOrVar
33
+ // compiler variables can return native literals from a web-built resolver.
34
+ return key === 'lineHeight' && typeof value === 'number' ? `${value}px` : value
31
35
  }
@@ -10,7 +10,6 @@ export const skipProps = {
10
10
  untilMeasured: 1,
11
11
  transition: 1,
12
12
  space: 1,
13
- animateOnly: 1,
14
13
  animatedBy: 1,
15
14
  displayName: 1,
16
15
  disableClassName: 1,
@@ -66,6 +66,33 @@ export type FrontendClassPlan =
66
66
 
67
67
  export type FrontendClassSink = (entry: FrontendClassPlanEntry) => void
68
68
 
69
+ /**
70
+ * Fold one contribution into whatever a frontend already collected for the same
71
+ * property. A value already present becomes the `default` arm, so
72
+ * `ring-2 hover:ring-4` reads as `{ default, hover }`, and a later unconditional
73
+ * `ring-8` restates that `default` without dropping the `hover` arm.
74
+ *
75
+ * Both class-walk sinks use this: the one in `getSplitStyles` and the one the
76
+ * Tailwind frontend runs when it composes a class string statically.
77
+ */
78
+ export function mergeFrontendCondition(
79
+ previous: unknown,
80
+ value: unknown,
81
+ condition: string | undefined
82
+ ): unknown {
83
+ const merged =
84
+ previous !== null && typeof previous === 'object' && !Array.isArray(previous)
85
+ if (condition === undefined) {
86
+ return merged ? { ...(previous as Record<string, unknown>), default: value } : value
87
+ }
88
+ if (merged) {
89
+ return { ...(previous as Record<string, unknown>), [condition]: value }
90
+ }
91
+ return previous === undefined
92
+ ? { [condition]: value }
93
+ : { default: previous, [condition]: value }
94
+ }
95
+
69
96
  /**
70
97
  * A component's authoring syntax. It is chosen by the package the component was
71
98
  * imported from and frozen onto its static config when the component is created:
@@ -95,6 +122,18 @@ export type StyleFrontend = {
95
122
  staticConfig: Config,
96
123
  config: StyleFrontendConfig
97
124
  ) => FrontendStaticConfigNormalization
125
+
126
+ /**
127
+ * Composes the N-to-1 utilities a class walk collected under `__`-prefixed keys
128
+ * (ring width plus ring color into one `boxShadow`, gradient stops into one
129
+ * `backgroundImage`, filter parts into one `filter`) into ordinary styles.
130
+ *
131
+ * Called once per pass and only when the walk actually collected such a key, so
132
+ * a component with no className, or none carrying a composed utility, never runs
133
+ * it. The output contributes at the className's own authored position, which is
134
+ * why an unrelated `ring-2` cannot change which layer owns `backgroundColor`.
135
+ */
136
+ compose?: (collected: Record<string, any>) => Record<string, any> | null | undefined
98
137
  }
99
138
 
100
139
  /**
@@ -24,7 +24,7 @@ export const STYLE_TOKEN_PROVENANCE_KEY = 'tamagui.styleTokenProvenance'
24
24
  const provenanceSymbol = /* @__PURE__ */ Symbol.for(STYLE_TOKEN_PROVENANCE_KEY)
25
25
 
26
26
  export type StyleTokenBinding = {
27
- /** original token string before resolution, e.g. 'background' or 'color9' */
27
+ /** original token string before resolution, e.g. 'background' or 'color-9' */
28
28
  token: string
29
29
  /** full resolved theme name that produced the value, e.g. 'light_accent' */
30
30
  theme: string
@@ -28,6 +28,8 @@ export function resolveStyleStaticConfig(
28
28
  const variants = normalized ? normalized.variants : staticConfig.variants
29
29
  const authoredBaseStyle = normalized ? normalized.baseStyle : staticConfig.baseStyle
30
30
  const authoredDefaultProps = staticConfig.defaultProps
31
+ const keys = staticConfig.contextProps || staticConfig.context?.propKeys
32
+ const styledContextKeys = keys ? new Set(keys) : null
31
33
  let baseStyle: Record<string, any> | undefined
32
34
  let baseVariantProps: Record<string, any> | undefined
33
35
  let defaultProps: Record<string, any> | undefined
@@ -47,7 +49,12 @@ export function resolveStyleStaticConfig(
47
49
  ;(baseStyle ||= authoredBaseStyle ? { ...authoredBaseStyle } : {})[key] =
48
50
  authoredDefaultProps[key]
49
51
  }
50
- if (isVariant || !isStyle) {
52
+ if (
53
+ isVariant ||
54
+ !isStyle ||
55
+ staticConfig.inlineProps?.has(key) ||
56
+ styledContextKeys?.has(key)
57
+ ) {
51
58
  ;(defaultProps ||= {})[key] = authoredDefaultProps[key]
52
59
  }
53
60
  if (isVariant) {
@@ -74,7 +81,12 @@ export function resolveStyleStaticConfig(
74
81
  }
75
82
  for (const key in resolvedBaseStyle) {
76
83
  const expanded = conf.shorthands[key] || key
77
- if (key !== 'transition' && !variants?.[key] && expanded in validStyles) {
84
+ if (
85
+ key !== 'transition' &&
86
+ !variants?.[key] &&
87
+ !staticConfig.inlineProps?.has(expanded) &&
88
+ expanded in validStyles
89
+ ) {
78
90
  ;(directBaseStyle ||= {})[key] = resolvedBaseStyle[key]
79
91
  ;(directBaseKeys ||= []).push(key)
80
92
  } else {
@@ -86,14 +98,13 @@ export function resolveStyleStaticConfig(
86
98
  }
87
99
  flushDirectBaseStyle()
88
100
  }
89
- const keys = staticConfig.contextProps || staticConfig.context?.propKeys
90
101
  const value: StyleStaticConfig = {
91
102
  baseStyle: resolvedBaseStyle,
92
103
  baseVariantProps,
93
104
  baseStylePiece,
94
105
  baseStylePieces,
95
106
  defaultProps,
96
- styledContextKeys: keys ? new Set(keys) : null,
107
+ styledContextKeys,
97
108
  variants,
98
109
  variantStyleResolver: (staticConfig as any).variantStyleResolver,
99
110
  passthroughClassName: normalized
@@ -1,5 +1,6 @@
1
1
  import { getSetting } from '../config'
2
2
  import { getVariableValue } from '../createVariable'
3
+ import { defaultSizing } from './resolveSizing'
3
4
  import type {
4
5
  GenericFonts,
5
6
  GetStyleState,
@@ -151,7 +152,7 @@ export function styledDynamic(fn?: any) {
151
152
 
152
153
  /**
153
154
  * the env for `styled.dynamic` callbacks and `.resolve` resolvers: tokens,
154
- * theme, fonts, and the active font. Built once per style pass.
155
+ * theme, fonts, sizing, and the active font. Built once per style pass.
155
156
  */
156
157
  export function getDynamicEnv(styleState: GetStyleState): StyledDynamicEnv {
157
158
  const cached = (styleState as any).flatDynamicEnv
@@ -167,6 +168,7 @@ export function getDynamicEnv(styleState: GetStyleState): StyledDynamicEnv {
167
168
  fonts,
168
169
  tokens: conf.tokensParsed,
169
170
  theme,
171
+ sizing: { ...defaultSizing, ...conf.sizing },
170
172
  get fontFamily() {
171
173
  return (
172
174
  getVariableValue(styleState.fontFamily || props.fontFamily) ||
@@ -96,13 +96,22 @@ const createGroupListener = (
96
96
  Object.assign(group.pseudo, pseudo)
97
97
  didChange = true
98
98
  }
99
- } else if (layout && mediaGroups) {
100
- group.media ||= {}
101
- const mediaState = getMediaState(mediaGroups, layout)
102
- const next = mergeIfNotShallowEqual(group.media, mediaState)
103
- if (next !== group.media) {
104
- Object.assign(group.media, next)
105
- didChange = true
99
+ } else if (layout) {
100
+ if (mediaGroups) {
101
+ group.media ||= {}
102
+ const mediaState = getMediaState(mediaGroups, layout)
103
+ const next = mergeIfNotShallowEqual(group.media, mediaState)
104
+ if (next !== group.media) {
105
+ Object.assign(group.media, next)
106
+ didChange = true
107
+ }
108
+ }
109
+ if (layout.width !== undefined) {
110
+ const prevWidth = group.layout?.width
111
+ if (prevWidth === undefined || Math.abs(prevWidth - layout.width) >= 0.5) {
112
+ group.layout = layout
113
+ didChange = true
114
+ }
106
115
  }
107
116
  }
108
117
 
@@ -1,22 +1,38 @@
1
1
  import { createVariable, isVariable } from '../createVariable'
2
2
 
3
+ const schemeKey = /* @__PURE__ */ Symbol.for('tamagui.theme.scheme')
4
+
5
+ export function getAuthoredThemeScheme(theme: any): 'light' | 'dark' | undefined {
6
+ const scheme = theme[schemeKey]
7
+ return scheme === 'light' || scheme === 'dark' ? scheme : undefined
8
+ }
9
+
10
+ export function setAuthoredThemeScheme<T>(target: T, scheme: 'light' | 'dark'): T {
11
+ Object.defineProperty(target, schemeKey, { value: scheme })
12
+ return target
13
+ }
14
+
15
+ export function copyAuthoredThemeScheme<T>(target: T, source: any): T {
16
+ const scheme = getAuthoredThemeScheme(source)
17
+ if (scheme) setAuthoredThemeScheme(target, scheme)
18
+ return target
19
+ }
20
+
21
+ // a client that rebuilds its themes from the generated css has no theme
22
+ // objects to read the authored scheme from, so each authored theme's rule
23
+ // carries it as a selector that never matches an element.
24
+ export const themeSchemeSelectorPrefix = '.tm_scheme_'
25
+
3
26
  // mutates, freeze after
4
27
  // shared by createTamagui so extracted here
5
28
  export function ensureThemeVariable(theme: any, key: string) {
6
29
  const val = theme[key]
7
- const value = isVariable(val) ? val.val : val
8
- if (!isVariable(val)) {
9
- theme[key] = createVariable({
10
- key,
11
- name: key,
12
- val: value,
13
- })
14
- } else if (val.name !== key) {
15
- // rename to theme name
30
+ const variable = isVariable(val)
31
+ if (!variable || val.name !== key) {
16
32
  theme[key] = createVariable({
17
- key: val.name,
33
+ key: variable ? val.name : key,
18
34
  name: key,
19
- val: value,
35
+ val: variable ? val.val : val,
20
36
  })
21
37
  }
22
38
  }
@@ -1,5 +1,10 @@
1
1
  export type StyleTokenCategory = 'size' | 'space' | 'radius' | 'zIndex' | 'fontSize'
2
- export type RuntimeTokenCategory = StyleTokenCategory | 'color' | 'font' | 'fontFamily'
2
+ export type RuntimeTokenCategory =
3
+ | StyleTokenCategory
4
+ | 'color'
5
+ | 'font'
6
+ | 'fontFamily'
7
+ | (string & {})
3
8
 
4
9
  export function getTokenCategoryForProperty(
5
10
  property: string
@@ -14,7 +19,13 @@ export function getTokenCategoryForProperty(
14
19
  return 'font'
15
20
  }
16
21
  if (property === 'zIndex') return 'zIndex'
17
- if (property === 'color' || property.endsWith('Color')) return 'color'
22
+ if (
23
+ property === 'color' ||
24
+ property === 'fill' ||
25
+ property === 'stroke' ||
26
+ property.endsWith('Color')
27
+ )
28
+ return 'color'
18
29
  if (property.endsWith('Radius')) {
19
30
  return property === 'shadowRadius' ? 'size' : 'radius'
20
31
  }
@@ -23,7 +34,8 @@ export function getTokenCategoryForProperty(
23
34
  property.endsWith('BlockSize') ||
24
35
  property.endsWith('InlineSize') ||
25
36
  property === 'blockSize' ||
26
- property === 'inlineSize'
37
+ property === 'inlineSize' ||
38
+ property === 'flexBasis'
27
39
  ) {
28
40
  return 'size'
29
41
  }
@@ -278,7 +278,7 @@ export function getVariablesCSSRules(
278
278
  props: InlineValues,
279
279
  conf: TamaguiInternalConfig
280
280
  ): VariablesCSS | null {
281
- if (process.env.TAMAGUI_DID_OUTPUT_CSS) return null
281
+ if (process.env.TAMAGUI_RUNTIME === 'island') return null
282
282
  const cycleDropped = getCycleDroppedKeys(props)
283
283
  const themes = props.themes as
284
284
  | Record<string, InlineValues['values'] | undefined>
@@ -417,7 +417,7 @@ export const getInlineValuesKey = (inline: InlineValues): string => {
417
417
  return key
418
418
  }
419
419
 
420
- // ---- flat theme-value props: <ThemeUpdate background-hover="blue4 dark:blue2"> ----
420
+ // ---- flat theme-value props: <ThemeUpdate background-hover="blue-4 dark:blue-2"> ----
421
421
 
422
422
  /**
423
423
  * One authored theme-value clause the parser could not use. The runtime warns
@@ -22,6 +22,12 @@ export function warnOnce(key: string, message = key) {
22
22
  }
23
23
  }
24
24
 
25
+ export function resetWarned() {
26
+ if (process.env.NODE_ENV !== 'production') {
27
+ warned?.clear()
28
+ }
29
+ }
30
+
25
31
  /**
26
32
  * A value the flat-value scanner refused, reported where the author can act on
27
33
  * it. Item 5b left refusal silent, matching the clause scanner, so an author
@@ -3,14 +3,21 @@ import { webOnlyStylePropsText, webOnlyStylePropsView } from '@tamagui/helpers'
3
3
  // textOverflow is in webOnlyStylePropsText for web CSS, but on native we map
4
4
  // textOverflow="ellipsis" to numberOfLines={1} + ellipsizeMode="tail" on Text.
5
5
  // Handled specially in getSplitStyles.tsx so we exclude it from the skip list.
6
- const { textOverflow: __, ...webOnlyStylePropsTextWithoutTextOverflow } =
6
+ const { textOverflow: _textOverflow, ...webOnlyStylePropsTextWithoutTextOverflow } =
7
7
  webOnlyStylePropsText
8
8
 
9
+ // userSelect is in webOnlyStylePropsView for web CSS, but on native it is the
10
+ // authoring name for Text's selectable prop, mapped in getSplitStyles.tsx. the
11
+ // skip check runs before that mapping, so leaving it in the list dropped the prop
12
+ // on native with no error.
13
+ const { userSelect: _userSelect, ...webOnlyStylePropsViewWithoutUserSelect } =
14
+ webOnlyStylePropsView
15
+
9
16
  /**
10
17
  * Web-only props and event handlers that should be skipped on native
11
18
  */
12
19
  export const webPropsToSkip = {
13
- ...webOnlyStylePropsView,
20
+ ...webOnlyStylePropsViewWithoutUserSelect,
14
21
  ...webOnlyStylePropsTextWithoutTextOverflow,
15
22
 
16
23
  // Web-only event handlers
@@ -44,7 +51,6 @@ export const webPropsToSkip = {
44
51
  onChange: 1,
45
52
  onInput: 1,
46
53
  onBeforeInput: 1,
47
- onScroll: 1,
48
54
  onCopy: 1,
49
55
  onCut: 1,
50
56
  onPaste: 1,
@@ -67,7 +67,10 @@ function getCachedStyleTag(styleObject: StyleObject) {
67
67
  }
68
68
 
69
69
  export function getStyleTags(styles: StyleObject[]) {
70
- if (!process.env.TAMAGUI_DID_OUTPUT_CSS && process.env.TAMAGUI_TARGET !== 'native') {
70
+ if (
71
+ process.env.TAMAGUI_RUNTIME !== 'island' &&
72
+ process.env.TAMAGUI_TARGET !== 'native'
73
+ ) {
71
74
  if (styles.length) {
72
75
  queueStyleTagCacheClear()
73
76
  return <>{styles.map(getCachedStyleTag)}</>